- SequenceI datasetSequence;
- String name;
- private String sequence;
- String description;
- int start;
- int end;
- Color color = Color.white;
- Vector pdbIds;
- String vamsasId;
- DBRefEntry [] dbrefs;
-
- /** This annotation is displayed below the alignment but the
- * positions are tied to the residues of this sequence */
- Vector annotation;
-
- /** DOCUMENT ME!! */
- public SequenceFeature [] sequenceFeatures;
-
- /** This array holds hidden sequences
- * of which this sequence is the representitive member of a group
- */
- SequenceGroup hiddenSequences;
-
- /**
- * Creates a new Sequence object.
- *
- * @param name DOCUMENT ME!
- * @param sequence DOCUMENT ME!
- * @param start DOCUMENT ME!
- * @param end DOCUMENT ME!
- */
- public Sequence(String name, String sequence, int start, int end)
- {
- this.name = name;
- this.sequence = sequence;
- this.start = start;
- this.end = end;
-
- parseId();
-
- checkValidRange();
- }
-
- com.stevesoft.pat.Regex limitrx = new com.stevesoft.pat.Regex(
- "[/][0-9]{1,}[-][0-9]{1,}$");
- com.stevesoft.pat.Regex endrx = new com.stevesoft.pat.Regex(
- "[0-9]{1,}$");
-
- void parseId()
- {
- // Does sequence have the /start-end signiature?
- if(limitrx.search(name))
- {
- name = limitrx.left();
- endrx.search(limitrx.stringMatched());
- setStart( Integer.parseInt( limitrx.stringMatched().substring(1,endrx.matchedFrom()-1 )));
- setEnd( Integer.parseInt( endrx.stringMatched() ));
- }
- }
-
- void checkValidRange()
- {
- if (end < 1)
+ SequenceI datasetSequence;
+ String name;
+ private char [] sequence;
+ String description;
+ int start;
+ int end;
+ Vector pdbIds;
+ String vamsasId;
+ DBRefEntry[] dbrefs;
+
+ /** This annotation is displayed below the alignment but the
+ * positions are tied to the residues of this sequence */
+ Vector annotation;
+
+ /** DOCUMENT ME!! */
+ public SequenceFeature[] sequenceFeatures;
+
+
+ /**
+ * Creates a new Sequence object.
+ *
+ * @param name DOCUMENT ME!
+ * @param sequence DOCUMENT ME!
+ * @param start DOCUMENT ME!
+ * @param end DOCUMENT ME!
+ */
+ public Sequence(String name, String sequence, int start, int end)
+ {
+ this.name = name;
+ this.sequence = sequence.toCharArray();
+ this.start = start;
+ this.end = end;
+ parseId();
+ checkValidRange();
+ }
+
+ public Sequence(String name, char [] sequence, int start, int end)
+ {
+ this.name = name;
+ this.sequence = sequence;
+ this.start = start;
+ this.end = end;
+ parseId();
+ checkValidRange();
+ }
+
+ com.stevesoft.pat.Regex limitrx = new com.stevesoft.pat.Regex(
+ "[/][0-9]{1,}[-][0-9]{1,}$");
+ com.stevesoft.pat.Regex endrx = new com.stevesoft.pat.Regex(
+ "[0-9]{1,}$");
+
+ void parseId()
+ {
+ // Does sequence have the /start-end signiature?
+ if (limitrx.search(name))
+ {
+ name = limitrx.left();
+ endrx.search(limitrx.stringMatched());
+ setStart(Integer.parseInt(limitrx.stringMatched().substring(1,
+ endrx.matchedFrom() - 1)));
+ setEnd(Integer.parseInt(endrx.stringMatched()));
+ }
+ }
+
+ void checkValidRange()
+ {
+ if (end < 1)
+ {
+ int endRes = 0;
+ for (int j = 0; j < sequence.length; j++)