import org.jmol.modelset.ModelSet;
import org.jmol.viewer.Viewer;
+import com.stevesoft.pat.Regex;
+
import mc_view.Atom;
import mc_view.PDBChain;
import mc_view.Residue;
{
Viewer viewer = null;
+ private boolean alphaFoldModel;
+
public JmolParser(boolean immediate, Object inFile,
DataSourceType sourceType) throws IOException
{
}
return viewer;
}
+
+ public static Regex getNewAlphafoldValidator()
+ {
+ Regex validator = new Regex("(AF-[A-Z]+[0-9]+[A-Z0-9]+-F1)");
+ validator.setIgnoreCase(true);
+ return validator;
+ }
+
public void transformJmolModelToJalview(ModelSet ms) throws IOException
{
try
{
+ Regex alphaFold = getNewAlphafoldValidator();
String lastID = "";
List<SequenceI> rna = new ArrayList<SequenceI>();
List<SequenceI> prot = new ArrayList<SequenceI>();
PDBChain tmpchain;
String pdbId = (String) ms.getInfo(0, "title");
+ String isMMCIF = (String) ms.getInfo(0, "fileType");
if (pdbId == null)
{
{
setId(pdbId);
setPDBIdAvailable(true);
+ alphaFoldModel = alphaFold.search(pdbId) && isMMCIF!=null && isMMCIF.equalsIgnoreCase("mmcif");
+
}
List<Atom> significantAtoms = convertSignificantAtoms(ms);
for (Atom tmpatom : significantAtoms)
tmpchain.atoms.addElement(tmpatom);
} else
{
- tmpchain = new PDBChain(getId(), tmpatom.chain);
+ tmpchain = new PDBChain(getId(), tmpatom.chain,isAlphafoldModel());
getChains().add(tmpchain);
tmpchain.atoms.addElement(tmpatom);
}
}
}
+ private boolean isAlphafoldModel()
+ {
+ return alphaFoldModel;
+ }
+
private List<Atom> convertSignificantAtoms(ModelSet ms)
{
List<Atom> significantAtoms = new ArrayList<Atom>();
/**
* Helper method that adds an AlignmentAnnotation for secondary structure to
- * the sequence, provided at least one secondary structure prediction has been
+ * the sequence, provided at least one secondary structure assignment has been
* made
*
* @param modelTitle
public String pdbid = "";
- public PDBChain(String thePdbid, String theId)
+ public PDBChain(String thePdbid, String theId, boolean isAlphaFoldModel)
{
this.pdbid = thePdbid == null ? thePdbid : thePdbid.toLowerCase();
this.id = theId;
+ this.alphaFoldModel = isAlphaFoldModel;
}
/**
public Mapping shadowMap;
+ private boolean alphaFoldModel;
+
public void setNewlineString(String nl)
{
newline = nl;
min = Math.min(min, annots[i].value);
resAnnotation.setElementAt(null, i);
}
-
+ String tfacName = "Temperature Factor";
+ if (isAlphaFoldModel())
+ {
+ tfacName = "Alphafold Reliability";
+ }
AlignmentAnnotation tfactorann = new AlignmentAnnotation(
- "Temperature Factor", "Temperature Factor for " + pdbid + id,
+ tfacName, tfacName + " for " + pdbid + id,
annots, min, max, AlignmentAnnotation.LINE_GRAPH);
tfactorann.setSequenceRef(sequence);
sequence.addAlignmentAnnotation(tfactorann);
}
}
+ private boolean isAlphaFoldModel()
+ {
+ return alphaFoldModel;
+ }
+
/**
* Colour start/end of bonds by charge
* <ul>
tmpchain.atoms.addElement(tmpatom);
} else
{
- tmpchain = new PDBChain(getId(), tmpatom.chain);
+ // PDBfile never handles alphafold models, so false
+ tmpchain = new PDBChain(getId(), tmpatom.chain, false);
getChains().add(tmpchain);
tmpchain.atoms.addElement(tmpatom);
}
{
System.out.println("setup");
StructureImportSettings.setShowSeqFeatures(true);
- c = new PDBChain("1GAQ", "A");
+ c = new PDBChain("1GAQ", "A", false);
}
@Test(groups = { "Functional" })