/** */
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();
* get codon frames involving sequenceI
*/
public AlignedCodonFrame[] getCodonFrame(SequenceI seq);
+ /**
+ * find sequence with given name in alignment
+ * @param token name to find
+ * @param b true implies that case insensitive matching will <em>also</em> be tried
+ * @return matched sequence or null
+ */
+ public SequenceI findName(String token, boolean b);
}
// Still possible this is an old Jalview file,\r
// which does not have type colours at the beginning\r
token = st.nextToken();\r
- seq = align.findName(token);\r
+ seq = align.findName(token, true);\r
if (seq != null)\r
{\r
desc = st.nextToken();\r
\r
if (!token.equals("ID_NOT_SPECIFIED"))\r
{\r
- seq = align.findName(token);\r
+ seq = align.findName(token, true);\r
st.nextToken();\r
}\r
else\r