import jalview.bin.ArgParser.ArgValues;
import jalview.bin.ArgParser.SubVal;
import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
+import jalview.datamodel.annotations.AlphaFoldAnnotationRowBuilder;
import jalview.gui.AlignFrame;
import jalview.gui.AlignmentPanel;
import jalview.gui.Desktop;
import jalview.io.FileLoader;
import jalview.io.HtmlSvgOutput;
import jalview.io.IdentifyFile;
+import jalview.structure.StructureImportSettings;
+import jalview.structure.StructureImportSettings.TFType;
import jalview.util.HttpUtils;
import jalview.util.MessageManager;
import jalview.util.Platform;
*/
// get kind of temperature factor annotation
- AlignmentAnnotation.TFType tempfacType = null;
+ StructureImportSettings.TFType tempfacType = TFType.DEFAULT;
if ((!ArgParser.getBoolean(m, Arg.NOTEMPFAC))
&& ArgParser.getArgValues(m, Arg.TEMPFAC) != null)
{
try
{
- tempfacType = AlignmentAnnotation.TFType.valueOf(ArgParser
+ tempfacType = StructureImportSettings.TFType.valueOf(ArgParser
.getValue(m, Arg.TEMPFAC).toUpperCase(Locale.ROOT));
Console.debug("Obtained Temperature Factor type of '"
+ tempfacType + "'");
.append(Arg.TEMPFAC.getName()).append(" to '")
.append(tempfacType)
.append("', ignoring. Valid values are: ");
- Iterator<AlignmentAnnotation.TFType> it = Arrays
- .stream(AlignmentAnnotation.TFType.values())
+ Iterator<StructureImportSettings.TFType> it = Arrays
+ .stream(StructureImportSettings.TFType.values())
.iterator();
while (it.hasNext())
{
Console.debug(
"Opening '" + openFile + "' in new alignment frame");
FileLoader fileLoader = new FileLoader(!headless);
- af = fileLoader.LoadFileWaitTillLoaded(openFile, protocol, format,
- tempfacType);
+
+ StructureImportSettings.setTemperatureFactorType(tempfacType);
+
+ af = fileLoader.LoadFileWaitTillLoaded(openFile, protocol,
+ format);
// wrap alignment?
if (ArgParser.getBoolean(m, Arg.WRAP))
// do this better (annotation types?)
List<String> hideThese = new ArrayList<>();
hideThese.add("Temperature Factor");
- hideThese.add(MessageManager
- .getString("label.alphafold_reliability"));
+ hideThese.add(AlphaFoldAnnotationRowBuilder.LABEL);
AlignmentUtils.showOrHideSequenceAnnotations(
af.getCurrentView().getAlignment(), hideThese, null,
false, false);
{
SubVal subVal = ArgParser.getSubVal(val);
File paeFile = new File(subVal.content);
- EBIAlfaFold.addAlphaFoldPAE(af.getCurrentView().getAlignment(),
- paeFile, subVal.index,
- "id".equals(subVal.keyName) ? subVal.keyValue : null);
- // required to readjust the height and position of the pAE
- // annotation
+ if ("structid".equals(subVal.index))
+ {
+ EBIAlfaFold.addAlphaFoldPAEToStructure(
+ af.getCurrentView().getAlignment(), paeFile,
+ subVal.index, subVal.keyValue);
+ }
+ else
+ {
+ EBIAlfaFold.addAlphaFoldPAEToSequence(af.getCurrentView().getAlignment(),
+ paeFile, subVal.index,
+ "id".equals(subVal.keyName) ? subVal.keyValue : null);
+ // required to readjust the height and position of the pAE
+ // annotation
+ }
for (AlignmentViewPanel ap : af.getAlignPanels())
{
ap.adjustAnnotationHeight();
switch (type)
{
case "svg":
+ Console.debug("Outputting type '" + type + "' to " + fileName);
af.createSVG(file);
break;
case "png":
+ Console.debug("Outputting type '" + type + "' to " + fileName);
af.createPNG(file);
break;
case "html":
+ Console.debug("Outputting type '" + type + "' to " + fileName);
HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
htmlSVG.exportHTML(fileName);
break;
+ default:
+ Console.warn("--image type '" + type + "' not known. Ignoring");
+ break;
}
}
}
private SequenceI getSpecifiedSequence(AlignFrame af, SubVal subId)
{
- SequenceI seq = null;
- SequenceI[] sequences = af.getCurrentView().getAlignment()
- .getSequencesArray();
- if (-1 < subId.index && subId.index < sequences.length)
+ AlignmentI al = af.getCurrentView().getAlignment();
+ if (-1 < subId.index && subId.index < al.getSequences().size())
{
- seq = sequences[subId.index];
+ return al.getSequenceAt(subId.index);
}
else if ("id".equals(subId.keyName))
{
- for (SequenceI s : sequences)
- {
- if (s.getDisplayId(false).equals(subId.keyValue))
- {
- seq = s;
- break;
- }
- }
+ return al.findName(subId.keyValue);
}
- return seq;
+ return null;
}
}