X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequence.java;h=4506742051dd57e0ac0d00462713bd13783dcfef;hb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;hp=916d785222d04f1ed7be7375dda8d219a5eee26e;hpb=c394157681d10261bd6f7883b19eaf88d6784609;p=jalview.git diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 916d785..4506742 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -59,7 +59,6 @@ public class Sequence extends ASequence implements SequenceI RNA rna; - /** * This annotation is displayed below the alignment but the positions are tied * to the residues of this sequence @@ -260,9 +259,9 @@ public class Sequence extends ASequence implements SequenceI } } } - if (seq.getPDBId() != null) + if (seq.getAllPDBEntries() != null) { - Vector ids = seq.getPDBId(); + Vector ids = seq.getAllPDBEntries(); Enumeration e = ids.elements(); while (e.hasMoreElements()) { @@ -410,7 +409,7 @@ public class Sequence extends ASequence implements SequenceI * @return DOCUMENT ME! */ @Override - public Vector getPDBId() + public Vector getAllPDBEntries() { return pdbIds; } @@ -748,8 +747,7 @@ public class Sequence extends ASequence implements SequenceI { if (lastj != -1) { - map.add(new int[] - { lastj, j - 1 }); + map.add(new int[] { lastj, j - 1 }); lastj = -1; } } @@ -757,8 +755,7 @@ public class Sequence extends ASequence implements SequenceI } if (lastj != -1) { - map.add(new int[] - { lastj, j - 1 }); + map.add(new int[] { lastj, j - 1 }); lastj = -1; } return map; @@ -956,7 +953,6 @@ public class Sequence extends ASequence implements SequenceI .toArray(new AlignmentAnnotation[annotation.size()]); } - @Override public boolean hasAnnotation(AlignmentAnnotation ann) { @@ -1057,7 +1053,7 @@ public class Sequence extends ASequence implements SequenceI // move database references onto dataset sequence datasetSequence.setDBRef(getDBRef()); setDBRef(null); - datasetSequence.setPDBId(getPDBId()); + datasetSequence.setPDBId(getAllPDBEntries()); setPDBId(null); datasetSequence.updatePDBIds(); if (annotation != null) @@ -1208,8 +1204,7 @@ public class Sequence extends ASequence implements SequenceI for (int si = 0; si < sfs.length; si++) { SequenceFeature sf[] = (mp != null) ? mp.locateFeature(sfs[si]) - : new SequenceFeature[] - { new SequenceFeature(sfs[si]) }; + : new SequenceFeature[] { new SequenceFeature(sfs[si]) }; if (sf != null && sf.length > 0) { for (int sfi = 0; sfi < sf.length; sfi++) @@ -1221,9 +1216,9 @@ public class Sequence extends ASequence implements SequenceI } // transfer PDB entries - if (entry.getPDBId() != null) + if (entry.getAllPDBEntries() != null) { - Enumeration e = entry.getPDBId().elements(); + Enumeration e = entry.getAllPDBEntries().elements(); while (e.hasMoreElements()) { PDBEntry pdb = (PDBEntry) e.nextElement(); @@ -1307,4 +1302,23 @@ public class Sequence extends ASequence implements SequenceI return getDisplayId(false); } + @Override + public PDBEntry getPDBEntry(String pdbIdStr) + { + if (getDatasetSequence() == null + || getDatasetSequence().getAllPDBEntries() == null) + { + return null; + } + List entries = getDatasetSequence().getAllPDBEntries(); + for (PDBEntry entry : entries) + { + if (entry.getId().equalsIgnoreCase(pdbIdStr)) + { + return entry; + } + } + return null; + } + }