transferAnnotation(entry.getDatasetSequence(), mp);
return;
}
+ // transfer from entry to sequence
+ // if entry has a description and sequence doesn't, then transfer
+ if (entry.getDescription()!=null && (description==null || description.trim().length()==0))
+ {
+ description = entry.getDescription();
+ }
+
// transfer any new features from entry onto sequence
if (entry.getSequenceFeatures() != null)
{
{
Sequence origSeq = new Sequence("MYSEQ", "THISISASEQ");
Sequence toSeq = new Sequence("MYSEQ", "THISISASEQ");
+ origSeq.setDescription("DESCRIPTION");
origSeq.addDBRef(new DBRefEntry("UNIPROT", "0", "Q12345", null, true));
+
+ toSeq.transferAnnotation(origSeq, null);
+ assertEquals("DESCRIPTION",toSeq.getDescription());
+ toSeq = new Sequence("MYSEQ", "THISISASEQ");
+ toSeq.setDescription("unchanged");
toSeq.transferAnnotation(origSeq, null);
+ assertEquals("unchanged",toSeq.getDescription());
+
assertTrue(toSeq.getDBRefs().size() == 1);
assertTrue(toSeq.getDBRefs().get(0).isCanonical());