/** */
public SequenceI findName(String name)
{
- int i = 0;
+ return findName(name,false);
+ }
+ /* (non-Javadoc)
+ * @see jalview.datamodel.AlignmentI#findName(java.lang.String, boolean)
+ */
+ public SequenceI findName(String token, boolean b)
+ {
+
+ int i = 0;
+ SequenceI sq=null;
+ String sqname=null;
while (i < sequences.size())
{
- if (getSequenceAt(i).getName().equals(name))
+ sq = getSequenceAt(i);
+ sqname = sq.getName();
+ if (sqname.equals(token) // exact match
+ || (b && // allow imperfect matches - case varies
+ (sqname.equalsIgnoreCase(token))))
{
return getSequenceAt(i);
}
return null;
}
-
public SequenceI[] findSequenceMatch(String name)
{
Vector matches = new Vector();
// Create a new dataset for this alignment.
// Can only be done once, if dataset is not null
// This will not be performed
- Sequence[] seqs = new Sequence[getHeight()];
+ SequenceI[] seqs = new SequenceI[getHeight()];
SequenceI currentSeq;
for (int i = 0; i < getHeight(); i++)
{
}
else
{
- seqs[i] = new Sequence(currentSeq.getName(),
- AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars,
- currentSeq.getSequenceAsString()
- ),
- currentSeq.getStart(),
- currentSeq.getEnd());
- seqs[i].sequenceFeatures = currentSeq.getSequenceFeatures();
- seqs[i].setDescription(currentSeq.getDescription());
- getSequenceAt(i).setSequenceFeatures(null);
- getSequenceAt(i).setDatasetSequence(seqs[i]);
+ seqs[i] = currentSeq.createDatasetSequence();
}
}