Search in sources :

Example 16 with Entry

use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.

the class IsoformMappingServiceImpl method validateFeature.

@Override
public BaseFeatureQueryResult validateFeature(SingleFeatureQuery query) {
    try {
        SequenceFeature sequenceFeature = SequenceFeatureBase.newFeature(query);
        if (Strings.isNullOrEmpty(query.getAccession()))
            query.setAccession(findAccessionFromGeneName(query, sequenceFeature.getGeneName()));
        Entry entry = entryBuilderService.build(EntryConfig.newConfig(query.getAccession()).withTargetIsoforms().withOverview());
        SequenceFeatureValidator validator = new SequenceFeatureValidator(entry, query);
        return validator.validate(sequenceFeature);
    } catch (FeatureQueryException e) {
        return new FeatureQueryFailureImpl(e);
    }
}
Also used : Entry(org.nextprot.api.core.domain.Entry) SequenceFeatureValidator(org.nextprot.api.isoform.mapper.service.SequenceFeatureValidator) SequenceFeature(org.nextprot.api.isoform.mapper.domain.SequenceFeature) FeatureQueryException(org.nextprot.api.isoform.mapper.domain.FeatureQueryException) FeatureQueryFailureImpl(org.nextprot.api.isoform.mapper.domain.impl.FeatureQueryFailureImpl)

Example 17 with Entry

use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.

the class SequenceVariantTest method testGetIsoformCaseInsensitive.

@Test
public void testGetIsoformCaseInsensitive() throws Exception {
    SequenceVariant variant = new SequenceVariant("ABL1-isoib-p.Ser439Gly");
    Entry entry = mockEntry("NX_P00519", mockIsoform("NX_P00519-1", "IA", true), mockIsoform("NX_P00519-2", "IB", false));
    Assert.assertEquals("NX_P00519-2", variant.getIsoform(entry).getUniqueName());
}
Also used : Entry(org.nextprot.api.core.domain.Entry) Test(org.junit.Test)

Example 18 with Entry

use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.

the class SequenceVariantTest method testGetIsoformNonIso2.

@Test
public void testGetIsoformNonIso2() throws Exception {
    SequenceVariant variant = new SequenceVariant("INSR-isoShort-p.Arg113Pro");
    Entry entry = mockEntry("NX_P06213", mockIsoform("NX_P06213-1", "Long", true), mockIsoform("NX_P06213-2", "Short", false));
    Assert.assertEquals("NX_P06213-2", variant.getIsoform(entry).getUniqueName());
    Assert.assertEquals("Short", variant.getIsoformName());
}
Also used : Entry(org.nextprot.api.core.domain.Entry) Test(org.junit.Test)

Example 19 with Entry

use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.

the class SequenceVariantTest method testGetIsoformNonIso.

@Test
public void testGetIsoformNonIso() throws Exception {
    SequenceVariant variant = new SequenceVariant("INSR-isoshort-p.Arg113Pro");
    Entry entry = mockEntry("NX_P06213", mockIsoform("NX_P06213-1", "Long", true), mockIsoform("NX_P06213-2", "Short", false));
    Assert.assertEquals("NX_P06213-2", variant.getIsoform(entry).getUniqueName());
    Assert.assertEquals("short", variant.getIsoformName());
}
Also used : Entry(org.nextprot.api.core.domain.Entry) Test(org.junit.Test)

Example 20 with Entry

use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.

the class SequenceVariantTest method testGetIsoformIsoCanonical.

@Test
public void testGetIsoformIsoCanonical() throws Exception {
    SequenceVariant variant = new SequenceVariant("SCN11A-p.Leu1158Pro");
    Entry entry = mockEntry("NX_P06213", mockIsoform("NX_Q9UI33-1", "Iso 1", true), mockIsoform("NX_Q9UI33-2", "Iso 2", false), mockIsoform("NX_Q9UI33-3", "Iso 3", false));
    Assert.assertEquals("NX_Q9UI33-1", variant.getIsoform(entry).getUniqueName());
    Assert.assertNull(variant.getIsoformName());
}
Also used : Entry(org.nextprot.api.core.domain.Entry) Test(org.junit.Test)

Aggregations

Entry (org.nextprot.api.core.domain.Entry)60 Test (org.junit.Test)38 CoreUnitBaseTest (org.nextprot.api.core.test.base.CoreUnitBaseTest)16 Annotation (org.nextprot.api.core.domain.annotation.Annotation)9 Isoform (org.nextprot.api.core.domain.Isoform)8 EntryConfig (org.nextprot.api.core.service.fluent.EntryConfig)8 WebIntegrationBaseTest (org.nextprot.api.web.dbunit.base.mvc.WebIntegrationBaseTest)8 EntryBuilderService (org.nextprot.api.core.service.EntryBuilderService)6 Autowired (org.springframework.beans.factory.annotation.Autowired)6 Assert (org.junit.Assert)4 Ignore (org.junit.Ignore)4 AnnotationCategory (org.nextprot.api.commons.constants.AnnotationCategory)4 DbXref (org.nextprot.api.core.domain.DbXref)4 ArrayList (java.util.ArrayList)3 PropertyApiModel (org.nextprot.api.commons.constants.PropertyApiModel)3 SolrDiffTest (org.nextprot.api.tasks.solr.indexer.entry.SolrDiffTest)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 IOException (java.io.IOException)2 PrintWriter (java.io.PrintWriter)2 java.util (java.util)2