: new String(entry.getVersion())),
(entry.getAccessionId() == null ? ""
: new String(entry.getAccessionId())),
- (entry.getMap() == null ? null : new Mapping(entry.getMap())));
+ (entry.getMap() == null ? null : new Mapping(entry.getMap())),entry.isCanonical());
}
@Override
assertEquals(0, seq.firstResidueOutsideIterator(cs.iterator()));
}
+ @Test(groups= {"Functional"})
+ public void testTransferAnnotation() {
+ Sequence origSeq = new Sequence("MYSEQ","THISISASEQ");
+ Sequence toSeq = new Sequence("MYSEQ","THISISASEQ");
+ origSeq.addDBRef(new DBRefEntry("UNIPROT", "0", "Q12345", null, true));
+ toSeq.transferAnnotation(origSeq, null);
+ assertTrue(toSeq.getDBRefs().size()>0);
+
+ assertTrue(toSeq.getDBRefs().get(0).isCanonical());
+
+ }
}
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
import jalview.datamodel.FeatureProperties;
+import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.JvOptionPane;
import jalview.util.DBRefUtils;
+import jalview.ws.DBRefFetcher;
import jalview.ws.SequenceFetcher;
import jalview.ws.dbsources.Pdb;
import jalview.ws.dbsources.Uniprot;
{
}
+ @Test(groups= {"Network"})
+ public void checkUniprotCanonicalFlagSet()
+ {
+ // TODO - mock this - for moment it is a live request.
+ SequenceI uniprotSeq = new Sequence("FER1_SPIOL",
+ "MAATTTTMMGMATTFVPKPQAPPMMAALPSNTGRSLFGLKTGSRGGRMTMAAYKVTLVTPTGNVEFQCPDDV"
+ + "YILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQSFLDDDQIDEGWVLTCAAYPVSDVTIETHKEEE"
+ + "LTA");
+ DBRefFetcher dbr = new DBRefFetcher(new SequenceI[] { uniprotSeq });
+ dbr.fetchDBRefs(true);
+ List<DBRefEntry> primRefs = uniprotSeq.getPrimaryDBRefs();
+ assertNotNull(primRefs);
+ assertTrue(primRefs.size()>0);
+ boolean canonicalUp=false;
+ for (DBRefEntry ref:primRefs) {
+ assertEquals(DBRefSource.UNIPROT, ref.getCanonicalSourceName());
+ canonicalUp |= ref.isCanonical();
+ }
+ assertTrue("No Canonical Uniprot reference detected", canonicalUp);
+ }
/**
* Tests that standard protein database sources include Uniprot (as the first)
* and also PDB. (Additional sources are dependent on availability of DAS