X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FPDBfile.java;h=ebc52aaf0aa0643410590de2c330fd5611782160;hb=2e9f692c73eebcd3f09f4762bc86acb5b5058202;hp=ed694f260c4f5a8c7af8ea3980d00659fe3399e2;hpb=e77a693cf000b4ff8a863411acf8c90c6390a061;p=jalview.git diff --git a/src/MCview/PDBfile.java b/src/MCview/PDBfile.java index ed694f2..ebc52aa 100755 --- a/src/MCview/PDBfile.java +++ b/src/MCview/PDBfile.java @@ -21,7 +21,9 @@ package MCview; import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.DBRefSource; import jalview.datamodel.SequenceI; +import jalview.io.DataSourceType; import jalview.io.FileParse; import jalview.io.StructureFile; import jalview.util.MessageManager; @@ -40,35 +42,29 @@ public class PDBfile extends StructureFile boolean predictSecondaryStructure, boolean externalSecStr) { super(); - this.visibleChainAnnotation = addAlignmentAnnotations; - this.predictSecondaryStructure = predictSecondaryStructure; - this.externalSecondaryStructure = externalSecStr; + addSettings(addAlignmentAnnotations, predictSecondaryStructure, + externalSecStr); } - public PDBfile(boolean addAlignmentAnnotations, - boolean predictSecondaryStructure, boolean externalSecStr, - String file, String protocol) throws IOException + public PDBfile(boolean addAlignmentAnnotations, boolean predictSecStr, + boolean externalSecStr, String dataObject, + DataSourceType sourceType) throws IOException { - super(false, file, protocol); - this.visibleChainAnnotation = addAlignmentAnnotations; - this.predictSecondaryStructure = predictSecondaryStructure; - this.externalSecondaryStructure = externalSecStr; + super(false, dataObject, sourceType); + addSettings(addAlignmentAnnotations, predictSecStr, externalSecStr); doParse(); } - public PDBfile(boolean addAlignmentAnnotations, - boolean predictSecondaryStructure, boolean externalSecStr, - FileParse source) throws IOException + public PDBfile(boolean addAlignmentAnnotations, boolean predictSecStr, + boolean externalSecStr, FileParse source) throws IOException { super(false, source); - this.visibleChainAnnotation = addAlignmentAnnotations; - this.predictSecondaryStructure = predictSecondaryStructure; - this.externalSecondaryStructure = externalSecStr; + addSettings(addAlignmentAnnotations, predictSecStr, externalSecStr); doParse(); } @Override - public String print() + public String print(SequenceI[] seqs, boolean jvSuffix) { return null; } @@ -76,6 +72,7 @@ public class PDBfile extends StructureFile @Override public void parse() throws IOException { + setDbRefType(DBRefSource.PDB); // TODO set the filename sensibly - try using data source name. setId(safeName(getDataName())); @@ -148,7 +145,7 @@ public class PDBfile extends StructureFile Atom tmpatom = new Atom(line); try { - tmpchain = findChain(tmpatom.chain); + tmpchain = findChain(tmpatom.chain); if (tmpatom.resNumIns.trim().equals(lastID)) { // phosphorylated protein - seen both CA and P.. @@ -192,9 +189,8 @@ public class PDBfile extends StructureFile } catch (OutOfMemoryError er) { System.out.println("OUT OF MEMORY LOADING PDB FILE"); - throw new IOException( - MessageManager - .getString("exception.outofmemory_loading_pdb_file")); + throw new IOException(MessageManager + .getString("exception.outofmemory_loading_pdb_file")); } catch (NumberFormatException ex) { if (line != null) @@ -206,8 +202,6 @@ public class PDBfile extends StructureFile markCalcIds(); } - - /** * Process a parsed chain to construct and return a Sequence, and add it to * the list of sequences parsed. @@ -232,8 +226,8 @@ public class PDBfile extends StructureFile public static String relocateCalcId(String calcId, Hashtable alreadyLoadedPDB) throws Exception { - int s = CALC_ID_PREFIX.length(), end = calcId - .indexOf(CALC_ID_PREFIX, s); + int s = CALC_ID_PREFIX.length(), + end = calcId.indexOf(CALC_ID_PREFIX, s); String between = calcId.substring(s, end - 1); return CALC_ID_PREFIX + alreadyLoadedPDB.get(between) + ":" + calcId.substring(end);