X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceGroup.java;h=a8b0ace9188402e8d4be1af115af124d48f459cb;hb=a82fbafb34572f4897f4ae2b57444f772f4a7a8b;hp=5fcd2bfd1dc9f7ebf46b9f6e187fcb35f9d5743e;hpb=abeb1ce92e146611f2e7b57ff3e0f8169a216991;p=jalview.git diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 5fcd2bf..a8b0ace 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) - * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1) + * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. * @@ -14,6 +14,7 @@ * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.datamodel; @@ -469,12 +470,28 @@ public class SequenceGroup implements AnnotatedCollectionI } /** - * Max Gaps Threshold for performing a conservation calculation TODO: make - * this a configurable property - or global to an alignment view + * Max Gaps Threshold (percent) for performing a conservation calculation */ private int consPercGaps = 25; /** + * @return Max Gaps Threshold for performing a conservation calculation + */ + public int getConsPercGaps() + { + return consPercGaps; + } + + /** + * set Max Gaps Threshold (percent) for performing a conservation calculation + * @param consPercGaps + */ + public void setConsPercGaps(int consPercGaps) + { + this.consPercGaps = consPercGaps; + } + + /** * calculate residue conservation for group - but only if necessary. */ public void recalcConservation() @@ -483,10 +500,6 @@ public class SequenceGroup implements AnnotatedCollectionI { return; } - if (cs != null) - { - cs.alignmentChanged(this, null); - } try { Hashtable cnsns[] = AAFrequency.calculate(sequences, startRes, @@ -498,7 +511,6 @@ public class SequenceGroup implements AnnotatedCollectionI if (cs != null) { cs.setConsensus(cnsns); - cs.alignmentChanged(this, null); } if ((conservation != null) @@ -518,10 +530,13 @@ public class SequenceGroup implements AnnotatedCollectionI if (cs.conservationApplied()) { cs.setConservation(c); - cs.alignmentChanged(this, null); } } } + if (cs != null) + { + cs.alignmentChanged(context!=null ? context : this, null); + } } catch (java.lang.OutOfMemoryError err) { // TODO: catch OOM @@ -612,9 +627,9 @@ public class SequenceGroup implements AnnotatedCollectionI } /** - * DOCUMENT ME! * - * @return DOCUMENT ME! + * + * @return the first column selected by this group. Runs from 0<=i annot = new ArrayList(); for (SequenceI seq : (Vector) sequences) { - for (AlignmentAnnotation al : seq.getAnnotation()) + AlignmentAnnotation[] aa = seq.getAnnotation(); + if (aa != null) { - if (al.groupRef == this) + for (AlignmentAnnotation al : aa) { - annot.add(al); + if (al.groupRef == this) + { + annot.add(al); + } } } } @@ -1232,4 +1250,21 @@ public class SequenceGroup implements AnnotatedCollectionI { sequences.clear(); } + private AnnotatedCollectionI context; + /** + * set the alignment or group context for this group + * @param context + */ + public void setContext(AnnotatedCollectionI context) + { + this.context = context; + } + /* (non-Javadoc) + * @see jalview.datamodel.AnnotatedCollectionI#getContext() + */ + @Override + public AnnotatedCollectionI getContext() + { + return context; + } }