String item=null;\r
boolean found = false;\r
\r
- /// is the searchString a residue number?\r
+ ////// is the searchString a residue number?\r
try{\r
int res = Integer.parseInt(searchString);\r
found = true;\r
searchResults.add( Integer.toString( seq.findIndex(res)-1 ) );\r
\r
}catch(NumberFormatException ex){}\r
+ ///////////////////////////////////////////////\r
+\r
\r
jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme();\r
Color [] newColors = new Color[24];\r
\r
int end = av.alignment.getHeight();\r
\r
-\r
- SequenceGroup rubberband = av.getSelectionGroup();\r
- if(rubberband!=null)\r
- end = rubberband.getEndRes();\r
-\r
-\r
+ SequenceGroup selection = av.getSelectionGroup();\r
+ if(selection!=null)\r
+ if(selection.getSize()<1 || (selection.getEndRes()-selection.getStartRes()<2))\r
+ selection = null;\r
\r
while( !found && seqIndex<end)\r
{\r
- seq = (Sequence)av.getAlignment().getSequenceAt(seqIndex);\r
+ seq = (Sequence)av.alignment.getSequenceAt(seqIndex);\r
\r
- if( av.getSelectionGroup().getSize()>0 && !av.getSelectionGroup().sequences.contains(seq)\r
- || (rubberband!=null && !rubberband.sequences.contains(seq)) )\r
+\r
+ if(selection!=null && !selection.sequences.contains(seq))\r
{\r
- // if a selection has been made, only search within that selection\r
seqIndex++;\r
resIndex=0;\r
continue;\r
}\r
\r
- item = seq.getSequence();\r
+ item = seq.getSequence().toUpperCase();\r
\r
- if(rubberband!=null)\r
- item = item.substring(0, rubberband.getEndRes()+1);\r
+ if(selection!=null && selection.getEndRes()<av.alignment.getWidth())\r
+ item = item.substring(0, selection.getEndRes()+1);\r
\r
///Shall we ignore gaps????\r
StringBuffer noGaps = new StringBuffer();\r
if( regex.searchFrom( noGaps.toString(), r ) )\r
{\r
resIndex = regex.matchedFrom();\r
-\r
-\r
- if(rubberband!=null && ( resIndex+ Integer.parseInt(spaces.get(resIndex).toString()) )<rubberband.getStartRes())\r
+ if(selection!=null && ( resIndex+ Integer.parseInt(spaces.get(resIndex).toString()) )<selection.getStartRes())\r
continue;\r
\r
searchResults.add( Integer.toString( seqIndex) );\r