X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignment.java;h=5f0bf6884fc9fabbb7acdec470c31a9e0c50bf10;hb=621a628afc1f6ee7a2778b9d0ae2729b88fe5bfd;hp=b0b04cae8739551cd24ee5b045d62d5391d81b01;hpb=50be9a6af05e540b996aa6de433fd0edfe9155d5;p=jalview.git diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index b0b04ca..5f0bf68 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -31,7 +31,6 @@ public class Alignment implements AlignmentI protected Alignment dataset; protected Vector sequences; protected Vector groups = new Vector(); - protected Vector superGroup = new Vector(); protected char gapCharacter = '-'; protected int type = NUCLEOTIDE; public static final int PROTEIN = 0; @@ -61,19 +60,7 @@ public class Alignment implements AlignmentI for (i = 0; i < seqs.length; i++) { sequences.addElement(seqs[i]); - - if(seqs[i].getDatasetSequence()!=null - && seqs[i].getDatasetSequence().getAnnotation()!=null) - { - - for(int a=0; a= threshold) - { - // Delete the shortest one - if (((SequenceI) sel.elementAt(j)).getSequence().length() > ((SequenceI) sel - .elementAt( - i)).getSequence().length()) - { - del.addElement(sel.elementAt(i)); - } - else - { - del.addElement(sel.elementAt(i)); - } - } - } - } - } - - // Now delete the sequences - for (int i = 0; i < del.size(); i++) - { - deleteSequence((SequenceI) del.elementAt(i)); - } - - return del; - } - - /** */ - public SequenceGroup findGroup(int i) - { - return findGroup(getSequenceAt(i)); - } /** */ public SequenceGroup findGroup(SequenceI s) @@ -345,7 +285,7 @@ public class Alignment implements AlignmentI { SequenceGroup sg = (SequenceGroup) groups.elementAt(i); - if (sg.sequences.contains(s)) + if (sg.getSequences(false).contains(s)) { return sg; } @@ -369,14 +309,14 @@ public class Alignment implements AlignmentI for (int i = 0; i < gSize; i++) { SequenceGroup sg = (SequenceGroup) groups.elementAt(i); - if(sg==null || sg.sequences==null) + if(sg==null || sg.getSequences(false)==null) { this.deleteGroup(sg); gSize--; continue; } - if (sg.sequences.contains(s)) + if (sg.getSequences(false).contains(s)) { temp.addElement(sg); } @@ -409,7 +349,6 @@ public class Alignment implements AlignmentI public void deleteAllGroups() { groups.removeAllElements(); - superGroup.removeAllElements(); int i = 0; @@ -536,9 +475,9 @@ public class Alignment implements AlignmentI for (int i = 0; i < sequences.size(); i++) { Sequence seq = (Sequence) sequences.elementAt(i); - seq.sequence = seq.sequence.replace('.', gc); - seq.sequence = seq.sequence.replace('-', gc); - seq.sequence = seq.sequence.replace(' ', gc); + seq.setSequence( seq.getSequence().replace('.', gc) ); + seq.setSequence( seq.getSequence().replace('-', gc) ); + seq.setSequence( seq.getSequence().replace(' ', gc) ); } } @@ -614,70 +553,6 @@ public class Alignment implements AlignmentI annotations = temp; } - /** - * - * @param aa AlignmentAnnotation - * @param seqRef The sequence to associate this annotation with - * @return The adjusted AlignmentAnnotation, with dataset sequence and annotation added - */ - public AlignmentAnnotation addAnnotation(AlignmentAnnotation aa, SequenceI seqRef) - { - if(seqRef!=null) - { - //We can only add Annotations to the dataset sequences - if(seqRef.getDatasetSequence()==null) - { - setDataset(null); - } - - AlignmentAnnotation [] old = seqRef.getDatasetSequence().getAnnotation(); - - //First check if this is a new annotation or not. If it is new, - //we must add the annotation to the dataset - boolean newAnnotation = true; - if(seqRef.getDatasetSequence().getAnnotation()!=null) - { - for(int a=0; a 0) - copy = new AlignmentAnnotation( - aa.label, aa.description, aa.annotations, aa.graphMin, - aa.graphMax, aa.graph - ); - else - copy = new AlignmentAnnotation( - aa.label, aa.description, aa.annotations - ); - - copy.datasetAnnotation = aa; - - addAnnotation(copy); - - copy.sequenceRef = seqRef; - - return copy; - } - else - { - addAnnotation(aa); - return aa; - } - } public void adjustSequenceAnnotations() {