2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.datamodel;
23 import jalview.analysis.AlignSeq;
24 import jalview.api.DBRefEntryI;
25 import jalview.datamodel.features.SequenceFeatures;
26 import jalview.datamodel.features.SequenceFeaturesI;
27 import jalview.util.Comparison;
28 import jalview.util.DBRefUtils;
29 import jalview.util.MapList;
30 import jalview.util.StringUtils;
32 import java.util.ArrayList;
33 import java.util.Arrays;
34 import java.util.Collections;
35 import java.util.Enumeration;
36 import java.util.List;
37 import java.util.Vector;
39 import com.stevesoft.pat.Regex;
41 import fr.orsay.lri.varna.models.rna.RNA;
45 * Implements the SequenceI interface for a char[] based sequence object.
50 public class Sequence extends ASequence implements SequenceI
52 private static final Regex limitrx = new Regex(
53 "[/][0-9]{1,}[-][0-9]{1,}$");
55 private static final Regex endrx = new Regex("[0-9]{1,}$");
57 SequenceI datasetSequence;
61 private char[] sequence;
69 Vector<PDBEntry> pdbIds;
78 * This annotation is displayed below the alignment but the positions are tied
79 * to the residues of this sequence
81 * TODO: change to List<>
83 Vector<AlignmentAnnotation> annotation;
86 * The index of the sequence in a MSA
90 private SequenceFeatures sequenceFeatureStore;
93 * Creates a new Sequence object.
98 * string to form a possibly gapped sequence out of
100 * first position of non-gap residue in the sequence
102 * last position of ungapped residues (nearly always only used for
105 public Sequence(String name, String sequence, int start, int end)
108 initSeqAndName(name, sequence.toCharArray(), start, end);
111 public Sequence(String name, char[] sequence, int start, int end)
114 initSeqAndName(name, sequence, start, end);
118 * Stage 1 constructor - assign name, sequence, and set start and end fields.
119 * start and end are updated values from name2 if it ends with /start-end
126 protected void initSeqAndName(String name2, char[] sequence2, int start2,
130 this.sequence = sequence2;
142 .println("POSSIBLE IMPLEMENTATION ERROR: null sequence name passed to constructor.");
145 // Does sequence have the /start-end signature?
146 if (limitrx.search(name))
148 name = limitrx.left();
149 endrx.search(limitrx.stringMatched());
150 setStart(Integer.parseInt(limitrx.stringMatched().substring(1,
151 endrx.matchedFrom() - 1)));
152 setEnd(Integer.parseInt(endrx.stringMatched()));
156 void checkValidRange()
159 // http://issues.jalview.org/browse/JAL-774?focusedCommentId=11239&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-11239
162 for (int j = 0; j < sequence.length; j++)
164 if (!jalview.util.Comparison.isGap(sequence[j]))
183 * default constructor
187 sequenceFeatureStore = new SequenceFeatures();
191 * Creates a new Sequence object.
198 public Sequence(String name, String sequence)
200 this(name, sequence, 1, -1);
204 * Creates a new Sequence object with new AlignmentAnnotations but inherits
205 * any existing dataset sequence reference. If non exists, everything is
209 * if seq is a dataset sequence, behaves like a plain old copy
212 public Sequence(SequenceI seq)
214 this(seq, seq.getAnnotation());
218 * Create a new sequence object with new features, DBRefEntries, and PDBIds
219 * but inherits any existing dataset sequence reference, and duplicate of any
220 * annotation that is present in the given annotation array.
223 * the sequence to be copied
224 * @param alAnnotation
225 * an array of annotation including some associated with seq
227 public Sequence(SequenceI seq, AlignmentAnnotation[] alAnnotation)
230 initSeqFrom(seq, alAnnotation);
234 * does the heavy lifting when cloning a dataset sequence, or coping data from
235 * dataset to a new derived sequence.
238 * - source of attributes.
239 * @param alAnnotation
240 * - alignment annotation present on seq that should be copied onto
243 protected void initSeqFrom(SequenceI seq,
244 AlignmentAnnotation[] alAnnotation)
246 char[] oseq = seq.getSequence();
247 initSeqAndName(seq.getName(), Arrays.copyOf(oseq, oseq.length),
248 seq.getStart(), seq.getEnd());
250 description = seq.getDescription();
251 if (seq != datasetSequence)
253 setDatasetSequence(seq.getDatasetSequence());
257 * only copy DBRefs and seqfeatures if we really are a dataset sequence
259 if (datasetSequence == null)
261 if (seq.getDBRefs() != null)
263 DBRefEntry[] dbr = seq.getDBRefs();
264 for (int i = 0; i < dbr.length; i++)
266 addDBRef(new DBRefEntry(dbr[i]));
271 * make copies of any sequence features
273 for (SequenceFeature sf : seq.getSequenceFeatures())
275 addSequenceFeature(new SequenceFeature(sf));
279 if (seq.getAnnotation() != null)
281 AlignmentAnnotation[] sqann = seq.getAnnotation();
282 for (int i = 0; i < sqann.length; i++)
284 if (sqann[i] == null)
288 boolean found = (alAnnotation == null);
291 for (int apos = 0; !found && apos < alAnnotation.length; apos++)
293 found = (alAnnotation[apos] == sqann[i]);
298 // only copy the given annotation
299 AlignmentAnnotation newann = new AlignmentAnnotation(sqann[i]);
300 addAlignmentAnnotation(newann);
304 if (seq.getAllPDBEntries() != null)
306 Vector<PDBEntry> ids = seq.getAllPDBEntries();
307 for (PDBEntry pdb : ids)
309 this.addPDBId(new PDBEntry(pdb));
315 public void setSequenceFeatures(List<SequenceFeature> features)
317 if (datasetSequence != null)
319 datasetSequence.setSequenceFeatures(features);
322 sequenceFeatureStore = new SequenceFeatures(features);
326 public synchronized boolean addSequenceFeature(SequenceFeature sf)
328 if (sf.getType() == null)
330 System.err.println("SequenceFeature type may not be null: "
335 if (datasetSequence != null)
337 return datasetSequence.addSequenceFeature(sf);
340 return sequenceFeatureStore.add(sf);
344 public void deleteFeature(SequenceFeature sf)
346 if (datasetSequence != null)
348 datasetSequence.deleteFeature(sf);
352 sequenceFeatureStore.delete(sf);
362 public List<SequenceFeature> getSequenceFeatures()
364 if (datasetSequence != null)
366 return datasetSequence.getSequenceFeatures();
368 return sequenceFeatureStore.getAllFeatures();
372 public SequenceFeaturesI getFeatures()
374 return datasetSequence != null ? datasetSequence.getFeatures()
375 : sequenceFeatureStore;
379 public boolean addPDBId(PDBEntry entry)
383 pdbIds = new Vector<PDBEntry>();
388 for (PDBEntry pdbe : pdbIds)
390 if (pdbe.updateFrom(entry))
395 pdbIds.addElement(entry);
406 public void setPDBId(Vector<PDBEntry> id)
414 * @return DOCUMENT ME!
417 public Vector<PDBEntry> getAllPDBEntries()
419 return pdbIds == null ? new Vector<PDBEntry>() : pdbIds;
425 * @return DOCUMENT ME!
428 public String getDisplayId(boolean jvsuffix)
430 StringBuffer result = new StringBuffer(name);
433 result.append("/" + start + "-" + end);
436 return result.toString();
446 public void setName(String name)
455 * @return DOCUMENT ME!
458 public String getName()
470 public void setStart(int start)
478 * @return DOCUMENT ME!
481 public int getStart()
493 public void setEnd(int end)
501 * @return DOCUMENT ME!
512 * @return DOCUMENT ME!
515 public int getLength()
517 return this.sequence.length;
527 public void setSequence(String seq)
529 this.sequence = seq.toCharArray();
534 public String getSequenceAsString()
536 return new String(sequence);
540 public String getSequenceAsString(int start, int end)
542 return new String(getSequence(start, end));
546 public char[] getSequence()
554 * @see jalview.datamodel.SequenceI#getSequence(int, int)
557 public char[] getSequence(int start, int end)
563 // JBPNote - left to user to pad the result here (TODO:Decide on this
565 if (start >= sequence.length)
570 if (end >= sequence.length)
572 end = sequence.length;
575 char[] reply = new char[end - start];
576 System.arraycopy(sequence, start, reply, 0, end - start);
582 public SequenceI getSubSequence(int start, int end)
588 char[] seq = getSequence(start, end);
593 int nstart = findPosition(start);
594 int nend = findPosition(end) - 1;
595 // JBPNote - this is an incomplete copy.
596 SequenceI nseq = new Sequence(this.getName(), seq, nstart, nend);
597 nseq.setDescription(description);
598 if (datasetSequence != null)
600 nseq.setDatasetSequence(datasetSequence);
604 nseq.setDatasetSequence(this);
610 * Returns the character of the aligned sequence at the given position (base
611 * zero), or space if the position is not within the sequence's bounds
616 public char getCharAt(int i)
618 if (i >= 0 && i < sequence.length)
635 public void setDescription(String desc)
637 this.description = desc;
643 * @return DOCUMENT ME!
646 public String getDescription()
648 return this.description;
654 * @see jalview.datamodel.SequenceI#findIndex(int)
657 public int findIndex(int pos)
659 // returns the alignment position for a residue
662 // Rely on end being at least as long as the length of the sequence.
663 while ((i < sequence.length) && (j <= end) && (j <= pos))
665 if (!Comparison.isGap(sequence[i]))
673 if ((j == end) && (j < pos))
684 public int findPosition(int i)
688 int seqlen = sequence.length;
689 while ((j < i) && (j < seqlen))
691 if (!Comparison.isGap(sequence[j]))
706 public Range findPositions(int fromCol, int toCol)
709 * count residues before fromCol
713 int seqlen = sequence.length;
714 while (j < fromCol && j < seqlen)
716 if (!Comparison.isGap(sequence[j]))
724 * find first and last residues between fromCol and toCol
729 boolean foundFirst = false;
731 while (j <= toCol && j < seqlen)
733 if (!Comparison.isGap(sequence[j]))
750 * no residues in this range
756 * adjust for sequence start coordinate
758 firstPos += start - 1;
759 lastPos += start - 1;
761 return new Range(firstPos, lastPos);
765 * Returns an int array where indices correspond to each residue in the
766 * sequence and the element value gives its position in the alignment
768 * @return int[SequenceI.getEnd()-SequenceI.getStart()+1] or null if no
769 * residues in SequenceI object
772 public int[] gapMap()
774 String seq = jalview.analysis.AlignSeq.extractGaps(
775 jalview.util.Comparison.GapChars, new String(sequence));
776 int[] map = new int[seq.length()];
780 while (j < sequence.length)
782 if (!jalview.util.Comparison.isGap(sequence[j]))
794 public int[] findPositionMap()
796 int map[] = new int[sequence.length];
799 int seqlen = sequence.length;
803 if (!jalview.util.Comparison.isGap(sequence[j]))
814 public List<int[]> getInsertions()
816 ArrayList<int[]> map = new ArrayList<int[]>();
817 int lastj = -1, j = 0;
819 int seqlen = sequence.length;
822 if (jalview.util.Comparison.isGap(sequence[j]))
833 map.add(new int[] { lastj, j - 1 });
841 map.add(new int[] { lastj, j - 1 });
848 public void deleteChars(int i, int j)
850 int newstart = start, newend = end;
851 if (i >= sequence.length || i < 0)
856 char[] tmp = StringUtils.deleteChars(sequence, i, j);
857 boolean createNewDs = false;
858 // TODO: take a (second look) at the dataset creation validation method for
859 // the very large sequence case
860 int eindex = -1, sindex = -1;
861 boolean ecalc = false, scalc = false;
862 for (int s = i; s < j; s++)
864 if (jalview.schemes.ResidueProperties.aaIndex[sequence[s]] != 23)
874 sindex = findIndex(start) - 1;
879 // delete characters including start of sequence
880 newstart = findPosition(j);
881 break; // don't need to search for any more residue characters.
885 // delete characters after start.
888 eindex = findIndex(end) - 1;
893 // delete characters at end of sequence
894 newend = findPosition(i - 1);
895 break; // don't need to search for any more residue characters.
900 newend--; // decrease end position by one for the deleted residue
901 // and search further
907 // deletion occured in the middle of the sequence
908 if (createNewDs && this.datasetSequence != null)
910 // construct a new sequence
911 Sequence ds = new Sequence(datasetSequence);
912 // TODO: remove any non-inheritable properties ?
913 // TODO: create a sequence mapping (since there is a relation here ?)
914 ds.deleteChars(i, j);
915 datasetSequence = ds;
923 public void insertCharAt(int i, int length, char c)
925 char[] tmp = new char[sequence.length + length];
927 if (i >= sequence.length)
929 System.arraycopy(sequence, 0, tmp, 0, sequence.length);
934 System.arraycopy(sequence, 0, tmp, 0, i);
944 if (i < sequence.length)
946 System.arraycopy(sequence, i, tmp, index, sequence.length - i);
953 public void insertCharAt(int i, char c)
955 insertCharAt(i, 1, c);
959 public String getVamsasId()
965 public void setVamsasId(String id)
971 public void setDBRefs(DBRefEntry[] dbref)
973 if (dbrefs == null && datasetSequence != null
974 && this != datasetSequence)
976 datasetSequence.setDBRefs(dbref);
982 DBRefUtils.ensurePrimaries(this);
987 public DBRefEntry[] getDBRefs()
989 if (dbrefs == null && datasetSequence != null
990 && this != datasetSequence)
992 return datasetSequence.getDBRefs();
998 public void addDBRef(DBRefEntry entry)
1000 if (datasetSequence != null)
1002 datasetSequence.addDBRef(entry);
1008 dbrefs = new DBRefEntry[0];
1011 for (DBRefEntryI dbr : dbrefs)
1013 if (dbr.updateFrom(entry))
1016 * found a dbref that either matched, or could be
1017 * updated from, the new entry - no need to add it
1024 * extend the array to make room for one more
1026 // TODO use an ArrayList instead
1027 int j = dbrefs.length;
1028 DBRefEntry[] temp = new DBRefEntry[j + 1];
1029 System.arraycopy(dbrefs, 0, temp, 0, j);
1030 temp[temp.length - 1] = entry;
1034 DBRefUtils.ensurePrimaries(this);
1038 public void setDatasetSequence(SequenceI seq)
1042 throw new IllegalArgumentException(
1043 "Implementation Error: self reference passed to SequenceI.setDatasetSequence");
1045 if (seq != null && seq.getDatasetSequence() != null)
1047 throw new IllegalArgumentException(
1048 "Implementation error: cascading dataset sequences are not allowed.");
1050 datasetSequence = seq;
1054 public SequenceI getDatasetSequence()
1056 return datasetSequence;
1060 public AlignmentAnnotation[] getAnnotation()
1062 return annotation == null ? null : annotation
1063 .toArray(new AlignmentAnnotation[annotation.size()]);
1067 public boolean hasAnnotation(AlignmentAnnotation ann)
1069 return annotation == null ? false : annotation.contains(ann);
1073 public void addAlignmentAnnotation(AlignmentAnnotation annotation)
1075 if (this.annotation == null)
1077 this.annotation = new Vector<AlignmentAnnotation>();
1079 if (!this.annotation.contains(annotation))
1081 this.annotation.addElement(annotation);
1083 annotation.setSequenceRef(this);
1087 public void removeAlignmentAnnotation(AlignmentAnnotation annotation)
1089 if (this.annotation != null)
1091 this.annotation.removeElement(annotation);
1092 if (this.annotation.size() == 0)
1094 this.annotation = null;
1100 * test if this is a valid candidate for another sequence's dataset sequence.
1103 private boolean isValidDatasetSequence()
1105 if (datasetSequence != null)
1109 for (int i = 0; i < sequence.length; i++)
1111 if (jalview.util.Comparison.isGap(sequence[i]))
1120 public SequenceI deriveSequence()
1122 Sequence seq = null;
1123 if (datasetSequence == null)
1125 if (isValidDatasetSequence())
1127 // Use this as dataset sequence
1128 seq = new Sequence(getName(), "", 1, -1);
1129 seq.setDatasetSequence(this);
1130 seq.initSeqFrom(this, getAnnotation());
1135 // Create a new, valid dataset sequence
1136 createDatasetSequence();
1139 return new Sequence(this);
1142 private boolean _isNa;
1144 private long _seqhash = 0;
1147 * Answers false if the sequence is more than 85% nucleotide (ACGTU), else
1151 public boolean isProtein()
1153 if (datasetSequence != null)
1155 return datasetSequence.isProtein();
1157 if (_seqhash != sequence.hashCode())
1159 _seqhash = sequence.hashCode();
1160 _isNa = Comparison.isNucleotide(this);
1168 * @see jalview.datamodel.SequenceI#createDatasetSequence()
1171 public SequenceI createDatasetSequence()
1173 if (datasetSequence == null)
1175 Sequence dsseq = new Sequence(getName(), AlignSeq.extractGaps(
1176 jalview.util.Comparison.GapChars, getSequenceAsString()),
1177 getStart(), getEnd());
1179 datasetSequence = dsseq;
1181 dsseq.setDescription(description);
1182 // move features and database references onto dataset sequence
1183 dsseq.sequenceFeatureStore = sequenceFeatureStore;
1184 sequenceFeatureStore = null;
1185 dsseq.dbrefs = dbrefs;
1187 // TODO: search and replace any references to this sequence with
1188 // references to the dataset sequence in Mappings on dbref
1189 dsseq.pdbIds = pdbIds;
1191 datasetSequence.updatePDBIds();
1192 if (annotation != null)
1194 // annotation is cloned rather than moved, to preserve what's currently
1196 for (AlignmentAnnotation aa : annotation)
1198 AlignmentAnnotation _aa = new AlignmentAnnotation(aa);
1199 _aa.sequenceRef = datasetSequence;
1200 _aa.adjustForAlignment(); // uses annotation's own record of
1201 // sequence-column mapping
1202 datasetSequence.addAlignmentAnnotation(_aa);
1206 return datasetSequence;
1213 * jalview.datamodel.SequenceI#setAlignmentAnnotation(AlignmmentAnnotation[]
1217 public void setAlignmentAnnotation(AlignmentAnnotation[] annotations)
1219 if (annotation != null)
1221 annotation.removeAllElements();
1223 if (annotations != null)
1225 for (int i = 0; i < annotations.length; i++)
1227 if (annotations[i] != null)
1229 addAlignmentAnnotation(annotations[i]);
1236 public AlignmentAnnotation[] getAnnotation(String label)
1238 if (annotation == null || annotation.size() == 0)
1243 Vector<AlignmentAnnotation> subset = new Vector<AlignmentAnnotation>();
1244 Enumeration<AlignmentAnnotation> e = annotation.elements();
1245 while (e.hasMoreElements())
1247 AlignmentAnnotation ann = e.nextElement();
1248 if (ann.label != null && ann.label.equals(label))
1250 subset.addElement(ann);
1253 if (subset.size() == 0)
1257 AlignmentAnnotation[] anns = new AlignmentAnnotation[subset.size()];
1259 e = subset.elements();
1260 while (e.hasMoreElements())
1262 anns[i++] = e.nextElement();
1264 subset.removeAllElements();
1269 public boolean updatePDBIds()
1271 if (datasetSequence != null)
1273 // TODO: could merge DBRefs
1274 return datasetSequence.updatePDBIds();
1276 if (dbrefs == null || dbrefs.length == 0)
1280 boolean added = false;
1281 for (DBRefEntry dbr : dbrefs)
1283 if (DBRefSource.PDB.equals(dbr.getSource()))
1286 * 'Add' any PDB dbrefs as a PDBEntry - add is only performed if the
1287 * PDB id is not already present in a 'matching' PDBEntry
1288 * Constructor parses out a chain code if appended to the accession id
1289 * (a fudge used to 'store' the chain code in the DBRef)
1291 PDBEntry pdbe = new PDBEntry(dbr);
1292 added |= addPDBId(pdbe);
1299 public void transferAnnotation(SequenceI entry, Mapping mp)
1301 if (datasetSequence != null)
1303 datasetSequence.transferAnnotation(entry, mp);
1306 if (entry.getDatasetSequence() != null)
1308 transferAnnotation(entry.getDatasetSequence(), mp);
1311 // transfer any new features from entry onto sequence
1312 if (entry.getSequenceFeatures() != null)
1315 List<SequenceFeature> sfs = entry.getSequenceFeatures();
1316 for (SequenceFeature feature : sfs)
1318 SequenceFeature sf[] = (mp != null) ? mp.locateFeature(feature)
1319 : new SequenceFeature[] { new SequenceFeature(feature) };
1322 for (int sfi = 0; sfi < sf.length; sfi++)
1324 addSequenceFeature(sf[sfi]);
1330 // transfer PDB entries
1331 if (entry.getAllPDBEntries() != null)
1333 Enumeration<PDBEntry> e = entry.getAllPDBEntries().elements();
1334 while (e.hasMoreElements())
1336 PDBEntry pdb = e.nextElement();
1340 // transfer database references
1341 DBRefEntry[] entryRefs = entry.getDBRefs();
1342 if (entryRefs != null)
1344 for (int r = 0; r < entryRefs.length; r++)
1346 DBRefEntry newref = new DBRefEntry(entryRefs[r]);
1347 if (newref.getMap() != null && mp != null)
1349 // remap ref using our local mapping
1351 // we also assume all version string setting is done by dbSourceProxy
1353 * if (!newref.getSource().equalsIgnoreCase(dbSource)) {
1354 * newref.setSource(dbSource); }
1362 * @return The index (zero-based) on this sequence in the MSA. It returns
1363 * {@code -1} if this information is not available.
1366 public int getIndex()
1372 * Defines the position of this sequence in the MSA. Use the value {@code -1}
1373 * if this information is undefined.
1376 * position for this sequence. This value is zero-based (zero for
1377 * this first sequence)
1380 public void setIndex(int value)
1386 public void setRNA(RNA r)
1398 public List<AlignmentAnnotation> getAlignmentAnnotations(String calcId,
1401 List<AlignmentAnnotation> result = new ArrayList<AlignmentAnnotation>();
1402 if (this.annotation != null)
1404 for (AlignmentAnnotation ann : annotation)
1406 if (ann.calcId != null && ann.calcId.equals(calcId)
1407 && ann.label != null && ann.label.equals(label))
1417 public String toString()
1419 return getDisplayId(false);
1423 public PDBEntry getPDBEntry(String pdbIdStr)
1425 if (getDatasetSequence() != null)
1427 return getDatasetSequence().getPDBEntry(pdbIdStr);
1433 List<PDBEntry> entries = getAllPDBEntries();
1434 for (PDBEntry entry : entries)
1436 if (entry.getId().equalsIgnoreCase(pdbIdStr))
1445 public List<DBRefEntry> getPrimaryDBRefs()
1447 if (datasetSequence != null)
1449 return datasetSequence.getPrimaryDBRefs();
1451 if (dbrefs == null || dbrefs.length == 0)
1453 return Collections.emptyList();
1455 synchronized (dbrefs)
1457 List<DBRefEntry> primaries = new ArrayList<DBRefEntry>();
1458 DBRefEntry[] tmp = new DBRefEntry[1];
1459 for (DBRefEntry ref : dbrefs)
1461 if (!ref.isPrimaryCandidate())
1467 MapList mp = ref.getMap().getMap();
1468 if (mp.getFromLowest() > start || mp.getFromHighest() < end)
1470 // map only involves a subsequence, so cannot be primary
1474 // whilst it looks like it is a primary ref, we also sanity check type
1475 if (DBRefUtils.getCanonicalName(DBRefSource.PDB).equals(
1476 DBRefUtils.getCanonicalName(ref.getSource())))
1478 // PDB dbrefs imply there should be a PDBEntry associated
1479 // TODO: tighten PDB dbrefs
1480 // formally imply Jalview has actually downloaded and
1481 // parsed the pdb file. That means there should be a cached file
1482 // handle on the PDBEntry, and a real mapping between sequence and
1483 // extracted sequence from PDB file
1484 PDBEntry pdbentry = getPDBEntry(ref.getAccessionId());
1485 if (pdbentry != null && pdbentry.getFile() != null)
1491 // check standard protein or dna sources
1493 DBRefEntry[] res = DBRefUtils.selectDbRefs(!isProtein(), tmp);
1494 if (res != null && res[0] == tmp[0])
1508 public List<SequenceFeature> findFeatures(int from, int to,
1511 if (datasetSequence != null)
1513 return datasetSequence.findFeatures(from, to, types);
1515 return sequenceFeatureStore.findFeatures(from, to, types);