X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequence.java;h=290cdfc10dfa46ab7ba09734be35bf2e55038b8c;hb=10ddc20a773099eaf0dc4d9d1bbb3b88b4176ed4;hp=80dfda54c35e56f521e290d007226b9b0d011e0a;hpb=55e2e9b22b133db8b9ff0979b0338a33081fc8fd;p=jalview.git diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 80dfda5..290cdfc 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -42,9 +42,17 @@ public class Sequence implements SequenceI String vamsasId; Vector dbrefs; + /** This annotation is displayed below the alignment but the + * positions are tied to the residues of this sequence */ + Vector annotation; /** DOCUMENT ME!! */ - public Vector sequenceFeatures; + 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. @@ -66,9 +74,9 @@ public class Sequence implements SequenceI checkValidRange(); } - static com.stevesoft.pat.Regex limitrx = new com.stevesoft.pat.Regex( + com.stevesoft.pat.Regex limitrx = new com.stevesoft.pat.Regex( "[/][0-9]{1,}[-][0-9]{1,}$"); - static com.stevesoft.pat.Regex endrx = new com.stevesoft.pat.Regex( + com.stevesoft.pat.Regex endrx = new com.stevesoft.pat.Regex( "[0-9]{1,}$"); void parseId() @@ -133,25 +141,48 @@ public class Sequence implements SequenceI * * @param v DOCUMENT ME! */ - public void setSequenceFeatures(Vector v) + public void setSequenceFeatures(SequenceFeature [] features) { - sequenceFeatures = v; + sequenceFeatures = features; } public void addSequenceFeature(SequenceFeature sf) { if(sequenceFeatures==null) - sequenceFeatures = new Vector(); + { + sequenceFeatures = new SequenceFeature[0]; + } + + for(int i=0; isequence.length()) + end = sequence.length(); + + if (start > 0) + { + newSeq.append(sequence.substring(0, start)); + } + + if (toUpper) + newSeq.append(sequence.substring(start, end).toUpperCase()); + else + newSeq.append(sequence.substring(start, end).toLowerCase()); + + if (end < sequence.length()) + newSeq.append(sequence.substring(end)); + + sequence = newSeq.toString(); + } + + public void toggleCase(int start, int end) + { + StringBuffer newSeq = new StringBuffer(); + + if(end>sequence.length()) + end = sequence.length(); + + if (start > 0) + { + newSeq.append(sequence.substring(0, start)); + } + + char nextChar; + for(int c=start; c