assertEquals("ABCDEF",
derived.getDatasetSequence().getSequenceAsString());
}
-
+
/**
* test that creating a copy of an existing sequence with dataset sequence and
* associated contact matrix yields annotation associated with the same
* contact matrix in the copy
*/
- @Test(groups= {"Functional"})
+ @Test(groups = { "Functional" })
public void testCopyPasteStyleDerivesequence_withcontactMatrixAnn()
{
- SequenceI seq1=new Sequence("seq1","ACDACDACD");
+ SequenceI seq1 = new Sequence("seq1", "ACDACDACD");
seq1.createDatasetSequence();
ContactMatrixI cm = new SeqDistanceContactMatrix(seq1.getLength());
- // addContactList needs to return annotation addable to the sequence reference it was called from
+ // addContactList needs to return annotation addable to the sequence
+ // reference it was called from
AlignmentAnnotation aann = seq1.addContactList(cm);
- assertTrue(aann.sequenceRef==seq1);
- assertEquals(1,seq1.getAnnotation().length);
+ assertTrue(aann.sequenceRef == seq1);
+ assertEquals(1, seq1.getAnnotation().length);
assertNotNull(seq1.getContactListFor(seq1.getAnnotation()[0], 1));
-
- SequenceI seq_derived=seq1.deriveSequence();
- assertEquals(1,seq_derived.getAnnotation().length);
- assertTrue(cm==seq_derived.getContactMatrixFor(seq_derived.getAnnotation()[0]));
- assertNotNull(seq_derived.getContactListFor(seq_derived.getAnnotation()[0], 1));
-
+
+ SequenceI seq_derived = seq1.deriveSequence();
+ assertEquals(1, seq_derived.getAnnotation().length);
+ assertTrue(cm == seq_derived
+ .getContactMatrixFor(seq_derived.getAnnotation()[0]));
+ assertNotNull(seq_derived
+ .getContactListFor(seq_derived.getAnnotation()[0], 1));
+
// copy paste actually uses the copy constructor .. so
-
- SequenceI seq_copied=new Sequence((Sequence)seq_derived);
- assertEquals(1,seq_copied.getAnnotation().length);
- assertTrue(cm==seq_copied.getContactMatrixFor(seq_copied.getAnnotation()[0]));
- assertNotNull(seq_copied.getContactListFor(seq_copied.getAnnotation()[0], 1));
-
-
+
+ SequenceI seq_copied = new Sequence((Sequence) seq_derived);
+ assertEquals(1, seq_copied.getAnnotation().length);
+ assertTrue(cm == seq_copied
+ .getContactMatrixFor(seq_copied.getAnnotation()[0]));
+ assertNotNull(
+ seq_copied.getContactListFor(seq_copied.getAnnotation()[0], 1));
+
}
@Test(groups = { "Functional" })
origSeq.addDBRef(new DBRefEntry("UNIPROT", "0", "Q12345", null, true));
toSeq.transferAnnotation(origSeq, null);
- assertEquals("DESCRIPTION",toSeq.getDescription());
+ assertEquals("DESCRIPTION", toSeq.getDescription());
toSeq = new Sequence("MYSEQ", "THISISASEQ");
toSeq.setDescription("unchanged");
toSeq.transferAnnotation(origSeq, null);
- assertEquals("unchanged",toSeq.getDescription());
-
+ assertEquals("unchanged", toSeq.getDescription());
+
assertTrue(toSeq.getDBRefs().size() == 1);
assertTrue(toSeq.getDBRefs().get(0).isCanonical());