/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
* @author $author$
* @version $Revision$
*/
-public class SequenceGroup
+public class SequenceGroup implements AnnotatedCollectionI
{
String groupName;
}
if (cs != null)
{
- cs.setConservation(c);
-
- if (cs instanceof ClustalxColourScheme)
+ if (cs.conservationApplied())
{
- ((ClustalxColourScheme) cs)
- .resetClustalX(sequences, getWidth());
+ cs.setConservation(c);
+
+ if (cs instanceof ClustalxColourScheme)
+ {
+ ((ClustalxColourScheme) cs).resetClustalX(sequences,
+ getWidth());
+ }
}
}
}
private boolean showConsensusHistogram;
/**
- * set this alignmentAnnotation object as the one used to render consensus annotation
+ * set this alignmentAnnotation object as the one used to render consensus
+ * annotation
+ *
* @param aan
*/
public void setConsensus(AlignmentAnnotation aan)
{
- if (consensus==null)
+ if (consensus == null)
{
- consensus=aan;
+ consensus = aan;
}
}
-
+
/**
*
* @return automatically calculated consensus row
}
/**
- * set this alignmentAnnotation object as the one used to render consensus annotation
+ * set this alignmentAnnotation object as the one used to render consensus
+ * annotation
+ *
* @param aan
*/
public void setConservationRow(AlignmentAnnotation aan)
{
- if (conservation==null)
+ if (conservation == null)
{
- conservation=aan;
+ conservation = aan;
}
}
+
/**
* get the conservation annotation row for this group
*
{
return showConsensusHistogram;
}
+
+ @Override
+ /**
+ * returns a new array with all annotation involving this group
+ */
+ public AlignmentAnnotation[] getAlignmentAnnotation()
+ {
+ // TODO add in other methods like 'getAlignmentAnnotation(String label), etc'
+ ArrayList<AlignmentAnnotation> annot = new ArrayList<AlignmentAnnotation>();
+ for (SequenceI seq:(Vector<SequenceI>)sequences)
+ {
+ for (AlignmentAnnotation al: seq.getAnnotation())
+ {
+ if (al.groupRef==this)
+ {
+ annot.add(al);
+ }
+ }
+ }
+ if (consensus!=null)
+ {
+ annot.add(consensus);
+ }
+ if (conservation!=null)
+ {
+ annot.add(conservation);
+ }
+ return annot.toArray(new AlignmentAnnotation[0]);
+ }
}