}
}
+ @Test(groups= {"Functional"})
+ public void testReconstructSeq()
+ {
+ String o_seq = "asdfktryasdtqwrtsaslldddptyipqqwaslchvhttt";
+ SequenceI s = new Sequence("MySeq", o_seq, 39, 80);
+ String orig_gapped = "----asdf------ktryas---dtqwrtsasll----dddptyipqqwa----slchvhttt";
+ // name of sequence in a particular alignment should be recovered
+ SequenceI s_gapped = new Sequence("MySeqAlign", orig_gapped, 39, 80);
+ s_gapped.setDatasetSequence(s);
+ SeqCigar cg_sgapped = new SeqCigar(s_gapped);
+ assertTrue(testSeqRecovery(cg_sgapped,s_gapped,true));
+ SequenceI subseq_gapped = s_gapped.getSubSequence(44, 60);
+ SeqCigar subseq_cg_range=new SeqCigar(s_gapped,44,59);
+ assertTrue(testSeqRecovery(subseq_cg_range, subseq_gapped, true),"SeqCigar created on range of sequence failed");
+
+ // test another way of reconstructing a sequence from seqCigar
+ SequenceI[] sqs=SeqCigar.createAlignmentSequences(new SeqCigar[] {subseq_cg_range}, '-', new HiddenColumns(), null);
+ assertTrue(testSeqRecovery(subseq_cg_range, sqs[0], true),"createAlignmentSequences didn't reconstruct same sequence as for SeqCigar created on range of sequence failed (used by AlignmentView for selections)");
+
+ subseq_gapped.setName("SubSeqMySeqAlign"); // name of sequence in a particular alignment should be recovered
+ SeqCigar subseq_cg = new SeqCigar(subseq_gapped);
+ assertTrue(testSeqRecovery(subseq_cg,subseq_gapped,true));
+ }
/*
* refactored 'as is' from main method
*