X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fjmol%2FJmolParser.java;fp=src%2Fjalview%2Fext%2Fjmol%2FJmolParser.java;h=18d8e05555d4101a2d9c101badf9c3f164609ea7;hb=75aa2f504257f5564e3a88c3677905d7c392f24e;hp=ae8ff7a68c5e5b65e4cb07d9e17ebdb5bd79c369;hpb=00c42e936827790e689ecd5ff7d7781ecabe2313;p=jalview.git diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index ae8ff7a..18d8e05 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -160,7 +160,31 @@ public class JmolParser extends StructureFile implements JmolStatusListener 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 @@ -171,8 +195,15 @@ public class JmolParser extends StructureFile implements JmolStatusListener List prot = new ArrayList(); 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())); @@ -182,7 +213,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener { setId(pdbId); setPDBIdAvailable(true); - alphaFoldModel = alphaFold.search(pdbId) && isMMCIF!=null && isMMCIF.equalsIgnoreCase("mmcif"); + alphaFoldModel = alphaFold.search(pdbId) && isMMCIF; } List significantAtoms = convertSignificantAtoms(ms); @@ -199,7 +230,13 @@ public class JmolParser extends StructureFile implements JmolStatusListener 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); }