X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FPDBEntry.java;h=d0ab8bf3dc716190e94d0f727422acd05fbfddf5;hb=304e64fb34b32659be1bbfd39fb4e15b2f79586e;hp=adcefb3826530d567d1b9de69a3d7ee8a404d8b5;hpb=61ff8fb4efa315c35149c9d11850d99e3d00c441;p=jalview.git diff --git a/src/jalview/datamodel/PDBEntry.java b/src/jalview/datamodel/PDBEntry.java index adcefb3..d0ab8bf 100755 --- a/src/jalview/datamodel/PDBEntry.java +++ b/src/jalview/datamodel/PDBEntry.java @@ -20,12 +20,12 @@ */ package jalview.datamodel; -import jalview.util.CaseInsensitiveString; - import java.util.Collections; import java.util.Enumeration; import java.util.Hashtable; +import jalview.util.CaseInsensitiveString; + public class PDBEntry { @@ -154,6 +154,32 @@ public class PDBEntry { } + /** + * Entry point when file is not known and fileType may be string + * @param pdbId + * @param chain may be null + * @param fileType "pdb", "mmcif", or "bcif"; null defaults to mmcif + */ + public PDBEntry(String pdbId, String chain, String fileType) { + this.id = pdbId.toLowerCase(); + setChainCode(chain); // I note that PDB Chains ARE case-sensitive now + if (fileType == null) + fileType = "mmcif"; + switch (fileType.toLowerCase()) { + case "pdb": + this.type = Type.PDB.toString(); + break; + case "mmcif": + this.type = Type.MMCIF.toString(); + break; + default: + case "bcif": + System.out.println("format " + fileType + " has not been implemented; using mmCIF"); + this.type = Type.MMCIF.toString(); + break; + } + } + public PDBEntry(String pdbId, String chain, PDBEntry.Type type, String filePath) { @@ -255,6 +281,12 @@ public class PDBEntry return id; } + /** + * TODO + * + * @param key "protocol" + * @param value + */ public void setProperty(String key, Object value) { if (this.properties == null)