X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequence.java;h=c7581d82b81b755852cafb8c6265e91bace4a332;hb=4d7f98a6dd54d9863ba449ec79dcd95d25ed863d;hp=c78ec2266c93deb6aabb22e73261263c8f49143d;hpb=fddf3084802b37e5cee17829e32692a4aac3e60d;p=jalview.git diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index c78ec22..c7581d8 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -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(); @@ -1302,5 +1297,28 @@ public class Sequence extends ASequence implements SequenceI return result; } + public String toString() + { + 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; + } }