- // mark representative
- SequenceI rep = ap.getAlignment().getSequenceAt(
- n++ % ap.getAlignment().getHeight());
- refs.put(ap.getViewName(), rep);
+ AlignViewportI av = ap.getAlignViewport();
+ AlignmentI alignment = ap.getAlignment();
+ int repIndex = n % alignment.getHeight();
+ SequenceI rep = alignment.getSequenceAt(repIndex);
+ refseqs.put(ap.getViewName(), rep);
+ List<String> hiddenNames = new ArrayList<String>();
+ hiddenSeqNames.put(ap.getViewName(), hiddenNames);
+
+ /*
+ * hide rep sequence and the one before it
+ */
+ SequenceI seqToHide = alignment.getSequenceAt(repIndex);
+ SequenceGroup sg = new SequenceGroup();
+ sg.addSequence(seqToHide, false);
+ SequenceI precedingSeq = alignment.getSequenceAt(repIndex - 1);
+ sg.addSequence(precedingSeq, false);
+ av.setSelectionGroup(sg);
+ ((AlignmentViewport) av).hideSequences(seqToHide, true);
+
+ /*
+ * record names of hidden sequences
+ */
+ HiddenSequences hs = alignment.getHiddenSequences();
+ for (SequenceI seq : hs.hiddenSequences)
+ {
+ if (seq != null)
+ {
+ hiddenNames.add(seq.getName());
+ }
+ }