return validator;
}
-
+ PDBEntry.Type jmolFiletype=null;
+ /**
+ * resolve a jmol filetype string and update the jmolFiletype field accordingly
+ * @param jmolIdentifiedFileType
+ * @return true if filetype was identified as MMCIF, PDB
+ */
+ public boolean updateFileType(String jmolIdentifiedFileType)
+ {
+ if (jmolIdentifiedFileType == null
+ || jmolIdentifiedFileType.trim().equals(""))
+ {
+ return false;
+ }
+ if ("mmcif".equalsIgnoreCase(jmolIdentifiedFileType)) {
+ jmolFiletype = PDBEntry.Type.MMCIF;
+ return true;
+ }
+ if ("pdb".equalsIgnoreCase(jmolIdentifiedFileType))
+ {
+ jmolFiletype = PDBEntry.Type.PDB;
+ return true;
+ }
+ return false;
+ }
+
public void transformJmolModelToJalview(ModelSet ms) throws IOException
{
try
List<SequenceI> prot = new ArrayList<SequenceI>();
PDBChain tmpchain;
String pdbId = (String) ms.getInfo(0, "title");
- String isMMCIF = (String) ms.getInfo(0, "fileType");
-
+ boolean isMMCIF = false;
+ String jmolFileType_String = (String) ms.getInfo(0, "fileType");
+ if (updateFileType(jmolFileType_String))
+ {
+ setStructureFileType(jmolFiletype.toString());
+ }
+
+ isMMCIF = PDBEntry.Type.MMCIF.equals(jmolFiletype);
+
if (pdbId == null)
{
setId(safeName(getDataName()));
{
setId(pdbId);
setPDBIdAvailable(true);
- alphaFoldModel = alphaFold.search(pdbId) && isMMCIF!=null && isMMCIF.equalsIgnoreCase("mmcif");
+ alphaFoldModel = alphaFold.search(pdbId) && isMMCIF;
}
List<Atom> significantAtoms = convertSignificantAtoms(ms);
tmpchain.atoms.addElement(tmpatom);
} else
{
- tmpchain = new PDBChain(getId(), tmpatom.chain,isAlphafoldModel());
+ String tempFString=null;
+ if (isAlphafoldModel())
+ {
+ tempFString = "Alphafold Reliability";
+ }
+
+ tmpchain = new PDBChain(getId(), tmpatom.chain,tempFString);
getChains().add(tmpchain);
tmpchain.atoms.addElement(tmpatom);
}
public String pdbid = "";
- public PDBChain(String thePdbid, String theId, boolean isAlphaFoldModel)
+ String tfacName = "Temperature Factor";
+
+
+ public PDBChain(String thePdbid, String theId, String tempFactorColumnName)
{
this.pdbid = thePdbid == null ? thePdbid : thePdbid.toLowerCase();
this.id = theId;
- this.alphaFoldModel = isAlphaFoldModel;
+ if (tempFactorColumnName!=null && tempFactorColumnName.length()>0)
+ {
+ tfacName = tempFactorColumnName;
+ }
+ }
+
+ /**
+ * import chain data assuming Temperature Factor is in the Temperature Factor column
+ * @param thePdbid
+ * @param theId
+ */
+ public PDBChain(String thePdbid, String theId)
+ {
+ this(thePdbid,theId, null);
}
/**
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(
tfacName, tfacName + " for " + pdbid + id,
annots, min, max, AlignmentAnnotation.LINE_GRAPH);
}
}
- private boolean isAlphaFoldModel()
- {
- return alphaFoldModel;
- }
/**
* Colour start/end of bonds by charge
tmpchain.atoms.addElement(tmpatom);
} else
{
- // PDBfile never handles alphafold models, so false
- tmpchain = new PDBChain(getId(), tmpatom.chain, false);
+ // PDBfile never handles alphafold models
+ tmpchain = new PDBChain(getId(), tmpatom.chain);
getChains().add(tmpchain);
tmpchain.atoms.addElement(tmpatom);
}