*/
package jalview.ext.jmol;
+import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
{
Viewer viewer = null;
- private boolean alphaFoldModel;
-
public JmolParser(boolean immediate, Object inFile,
DataSourceType sourceType) throws IOException
{
{
setId(pdbId);
setPDBIdAvailable(true);
- alphaFoldModel = alphaFold.search(pdbId) && isMMCIF;
-
+ Console.debug("##### DATASOURCETYPE=" + getDataSourceType());
+ setAlphafoldModel(alphaFold.search(pdbId) && isMMCIF
+ && getDataSourceType() == DataSourceType.URL);
}
List<Atom> significantAtoms = convertSignificantAtoms(ms);
for (Atom tmpatom : significantAtoms)
else
{
AnnotationRowBuilder builder = null;
- String tempFString = null;
- if (isAlphafoldModel() || StructureImportSettings.TFType.PLDDT
- .equals(getTemperatureFactorType()))
+ 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);
- if (al.getAlignmentAnnotation() != null)
- {
- for (AlignmentAnnotation alann : al.getAlignmentAnnotation())
- {
- annotations.add(alann);
- }
- }
- ;
+ 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)
+ Console.debug("##### hasPAEMatrix()=" + hasPAEMatrix());
+ Console.debug("##### isAlphafoldModel()=" + isAlphafoldModel());
+ Console.debug("##### getPAEMatrix()=" + getPAEMatrix());
+ if (hasPAEMatrix())
+ {
+ Alignment al = new Alignment(prot.toArray(new SequenceI[0]));
+ if (isAlphafoldModel())
+ {
+ EBIAlfaFold.addAlphaFoldPAE(al, new File(this.getPAEMatrix()), 0,
+ null, false, false);
+ }
+ else
+ {
+ EBIAlfaFold.addPAEToStructure(null, this.getInFile(),
+ new File(this.getPAEMatrix()));
+ }
+
+ Console.debug("##### al.getAlignmentAnnotation()="
+ + al.getAlignmentAnnotation());
+ if (al.getAlignmentAnnotation() != null)
+ {
+ for (AlignmentAnnotation alann : al.getAlignmentAnnotation())
+ {
+ Console.debug("##### Adding to alann" + alann.annotationId + "("
+ + alann.getCalcId() + ")");
+ annotations.add(alann);
+ }
+ }
+ }
} catch (OutOfMemoryError er)
{
System.out.println(
}
}
- public void setAlphafoldModel(boolean afm)
- {
- alphaFoldModel = afm;
- }
-
- private boolean isAlphafoldModel()
- {
- return alphaFoldModel;
- }
-
private List<Atom> convertSignificantAtoms(ModelSet ms)
{
List<Atom> significantAtoms = new ArrayList<Atom>();