Search in sources :

Example 1 with Curation

use of org.jbei.ice.lib.dto.Curation in project ice by JBEI.

the class AnnotationsTest method testCurate.

@Test
public void testCurate() throws Exception {
    Account account = AccountCreator.createTestAccount("AnnotationsTest.testCurate", true);
    Plasmid plasmid = TestEntryCreator.createTestPlasmid(account);
    Assert.assertNotNull(plasmid);
    SequenceDAO sequenceDAO = new SequenceDAO();
    Assert.assertFalse(sequenceDAO.hasSequence(plasmid.getId()));
    FeaturedDNASequence dnaSequence = GeneralParser.parse(sequenceString);
    PartSequence partSequence = new PartSequence(account.getEmail(), plasmid.getRecordId());
    partSequence.save(dnaSequence);
    SequenceFeatureDAO sequenceFeatureDAO = new SequenceFeatureDAO();
    List<SequenceFeature> sequenceFeatures = sequenceFeatureDAO.getEntrySequenceFeatures(plasmid);
    Assert.assertEquals(1, sequenceFeatures.size());
    Feature feature = sequenceFeatures.get(0).getFeature();
    DNAFeature dnaFeature = feature.toDataTransferObject();
    Curation curation = new Curation();
    curation.setExclude(true);
    dnaFeature.setCuration(curation);
    List<DNAFeature> features = new ArrayList<>();
    features.add(dnaFeature);
    Annotations annotations = new Annotations(account.getEmail());
    annotations.curate(features);
    sequenceFeatures = sequenceFeatureDAO.getEntrySequenceFeatures(plasmid);
    feature = sequenceFeatures.get(0).getFeature();
    Assert.assertTrue(feature.getCuration().isExclude());
}
Also used : Account(org.jbei.ice.storage.model.Account) Curation(org.jbei.ice.lib.dto.Curation) ArrayList(java.util.ArrayList) SequenceFeature(org.jbei.ice.storage.model.SequenceFeature) FeaturedDNASequence(org.jbei.ice.lib.dto.FeaturedDNASequence) Feature(org.jbei.ice.storage.model.Feature) SequenceFeature(org.jbei.ice.storage.model.SequenceFeature) DNAFeature(org.jbei.ice.lib.dto.DNAFeature) Plasmid(org.jbei.ice.storage.model.Plasmid) SequenceFeatureDAO(org.jbei.ice.storage.hibernate.dao.SequenceFeatureDAO) PartSequence(org.jbei.ice.lib.entry.sequence.PartSequence) SequenceDAO(org.jbei.ice.storage.hibernate.dao.SequenceDAO) DNAFeature(org.jbei.ice.lib.dto.DNAFeature) Test(org.junit.Test)

Example 2 with Curation

use of org.jbei.ice.lib.dto.Curation in project ice by JBEI.

the class FeatureCurationModel method toDataTransferObject.

@Override
public Curation toDataTransferObject() {
    Curation curation = new Curation();
    curation.setExclude(this.exclude);
    return curation;
}
Also used : Curation(org.jbei.ice.lib.dto.Curation)

Aggregations

Curation (org.jbei.ice.lib.dto.Curation)2 ArrayList (java.util.ArrayList)1 DNAFeature (org.jbei.ice.lib.dto.DNAFeature)1 FeaturedDNASequence (org.jbei.ice.lib.dto.FeaturedDNASequence)1 PartSequence (org.jbei.ice.lib.entry.sequence.PartSequence)1 SequenceDAO (org.jbei.ice.storage.hibernate.dao.SequenceDAO)1 SequenceFeatureDAO (org.jbei.ice.storage.hibernate.dao.SequenceFeatureDAO)1 Account (org.jbei.ice.storage.model.Account)1 Feature (org.jbei.ice.storage.model.Feature)1 Plasmid (org.jbei.ice.storage.model.Plasmid)1 SequenceFeature (org.jbei.ice.storage.model.SequenceFeature)1 Test (org.junit.Test)1