From: Jim Procter Date: Fri, 1 Jun 2018 13:59:48 +0000 (+0100) Subject: JAL-1950 JAL-2937 allow individual groups to be rematerialised from an alignment... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a573d96362b36d935d1f809a565859e6b17afef8;p=jalview.git JAL-1950 JAL-2937 allow individual groups to be rematerialised from an alignment view --- diff --git a/src/jalview/datamodel/AlignmentView.java b/src/jalview/datamodel/AlignmentView.java index 19ddff3..a3b2c45 100644 --- a/src/jalview/datamodel/AlignmentView.java +++ b/src/jalview/datamodel/AlignmentView.java @@ -25,6 +25,7 @@ import jalview.util.ShiftList; import java.io.PrintStream; import java.util.ArrayList; +import java.util.Collection; import java.util.List; /** @@ -114,6 +115,16 @@ public class AlignmentView { return seqs.size(); } + + public SequenceGroup getNewSequenceGroup(char c) + { + SequenceGroup newsg = new SequenceGroup(sg); + for (SeqCigar seq : seqs) + { + newsg.addSequence(seq.getSeq(c), false); + } + return newsg; + } } /** @@ -1238,4 +1249,21 @@ public class AlignmentView } } + + /** + * return pruned visible sequences in each group in alignment view + * + * @param c + * @return + */ + public Collection getVisibleGroups(char c) + { + ArrayList groups = new ArrayList<>(); + for (ScGroup sc : scGroups) + { + SequenceGroup sg = sc.getNewSequenceGroup(c); + groups.add(sg); + } + return groups; + } }