*/
package jalview.ext.jmol;
+import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import jalview.io.FileParse;
import jalview.io.StructureFile;
import jalview.schemes.ResidueProperties;
+import jalview.structure.StructureImportSettings;
import jalview.util.Format;
import jalview.util.MessageManager;
import jalview.ws.dbsources.EBIAlfaFold;
{
Viewer viewer = null;
- private boolean alphaFoldModel;
-
public JmolParser(boolean immediate, Object inFile,
DataSourceType sourceType) throws IOException
{
// BH 2018 File or String for filename
super(immediate, inFile, sourceType);
+
}
public JmolParser(Object inFile, DataSourceType sourceType)
throws IOException
{
- super(inFile, sourceType);
+ this(inFile, sourceType, null);
+ }
+
+ public JmolParser(Object inFile, DataSourceType sourceType,
+ StructureImportSettings.TFType tempfacType) throws IOException
+ {
+ super(inFile, sourceType, tempfacType);
}
public JmolParser(FileParse fp) throws IOException
{
setId(pdbId);
setPDBIdAvailable(true);
- alphaFoldModel = alphaFold.search(pdbId) && isMMCIF;
-
+ setAlphafoldModel(alphaFold.search(pdbId) && isMMCIF);
}
List<Atom> significantAtoms = convertSignificantAtoms(ms);
for (Atom tmpatom : significantAtoms)
else
{
AnnotationRowBuilder builder = null;
- String tempFString = null;
- if (isAlphafoldModel())
+ if (isAlphafoldModel()
+ || getTemperatureFactorType() == StructureImportSettings.TFType.PLDDT)
{
builder = new AlphaFoldAnnotationRowBuilder();
}
createAnnotation(chainseq, chain, ms.at);
}
}
- if (isAlphafoldModel())
+ // if Alphafold, fetch the PAE matrix if doesn't already have one
+ if (isAlphafoldModel() && !hasPAEMatrix())
{
- // TODO - work out how to handle different ways that pAE is provided
- //
try
{
Console.info("retrieving pAE for " + pdbId);
- Alignment al = new Alignment(prot.toArray(new SequenceI[0]));
- EBIAlfaFold.retrieve_AlphaFold_pAE(pdbId, al, null);
- ;
+ File paeFile = EBIAlfaFold.fetchAlphaFoldPAE(pdbId, null);
+ this.setPAEMatrix(paeFile.getAbsolutePath());
} catch (Throwable t)
{
Console.error("Couldn't get the pAE for " + pdbId, t);
}
}
+ // add a PAEMatrix if set (either by above or otherwise)
+ if (hasPAEMatrix())
+ {
+ Alignment al = new Alignment(prot.toArray(new SequenceI[0]));
+ EBIAlfaFold.addAlphaFoldPAE(al, new File(this.getPAEMatrix()), 0,
+ null, false, false);
+
+ if (al.getAlignmentAnnotation() != null)
+ {
+ for (AlignmentAnnotation alann : al.getAlignmentAnnotation())
+ {
+ annotations.add(alann);
+ }
+ }
+ }
} catch (OutOfMemoryError er)
{
System.out.println(
}
}
- private boolean isAlphafoldModel()
- {
- return alphaFoldModel;
- }
-
private List<Atom> convertSignificantAtoms(ModelSet ms)
{
List<Atom> significantAtoms = new ArrayList<Atom>();