Search in sources :

Example 6 with SingleFeatureQuery

use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.

the class IsoformMappingServiceTest method shouldValidateExtensionVariantOnCanonicalIsoform.

@Test
public void shouldValidateExtensionVariantOnCanonicalIsoform() throws Exception {
    // RAD50-p.*1313Tyrext*66 (CAVA-VD024428)
    FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("RAD50-p.Ter1313Tyrext*66", AnnotationCategory.VARIANT.getApiTypeName(), ""));
    assertIsoformFeatureValid(result, "NX_Q92878-1", 1313, 1313, true);
}
Also used : FeatureQueryResult(org.nextprot.api.isoform.mapper.domain.FeatureQueryResult) SingleFeatureQuery(org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery) IsoformMappingBaseTest(org.nextprot.api.isoform.mapper.IsoformMappingBaseTest) Test(org.junit.Test)

Example 7 with SingleFeatureQuery

use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.

the class IsoformMappingServiceTest method shouldNotValidateInvalidAminoAcidCode.

@Test
public void shouldNotValidateInvalidAminoAcidCode() throws Exception {
    FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("SCN11A-p.Let1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_Q9UI33"));
    SingleFeatureQuery query = Mockito.mock(SingleFeatureQuery.class);
    when(query.getFeature()).thenReturn("SCN11A-p.Let1158Pro");
    Assert.assertFalse(result.isSuccess());
    Assert.assertEquals("invalid feature format: SCN11A-p.Let1158Pro", ((FeatureQueryFailureImpl) result).getError().getMessage());
    Assert.assertEquals(1, ((FeatureQueryFailureImpl) result).getError().getCauses().size());
    Assert.assertEquals("Let: invalid AminoAcidCode", ((FeatureQueryFailureImpl) result).getError().getCause(InvalidFeatureQueryFormatException.PARSE_ERROR_MESSAGE));
}
Also used : FeatureQueryResult(org.nextprot.api.isoform.mapper.domain.FeatureQueryResult) SingleFeatureQuery(org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery) FeatureQueryFailureImpl(org.nextprot.api.isoform.mapper.domain.impl.FeatureQueryFailureImpl) IsoformMappingBaseTest(org.nextprot.api.isoform.mapper.IsoformMappingBaseTest) Test(org.junit.Test)

Example 8 with SingleFeatureQuery

use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.

the class IsoformMappingServiceTest method shouldValidateDeletionVariantOnCanonicalIsoform.

@Test
public void shouldValidateDeletionVariantOnCanonicalIsoform() throws Exception {
    FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("BRCA2-p.Gly2281_Asp2312del", AnnotationCategory.VARIANT.getApiTypeName(), "NX_P51587"));
    assertIsoformFeatureValid(result, "NX_P51587-1", 2281, 2312, true);
}
Also used : FeatureQueryResult(org.nextprot.api.isoform.mapper.domain.FeatureQueryResult) SingleFeatureQuery(org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery) IsoformMappingBaseTest(org.nextprot.api.isoform.mapper.IsoformMappingBaseTest) Test(org.junit.Test)

Example 9 with SingleFeatureQuery

use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.

the class IsoformMappingServiceTest method shouldNotValidateWithMultipleAccessions.

// no more multiple accessions for gene GCNT2
// TODO: find another gene with multiple accessions
@Ignore
@Test
public void shouldNotValidateWithMultipleAccessions() throws Exception {
    FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("GCNT2-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), ""));
    SingleFeatureQuery query = Mockito.mock(SingleFeatureQuery.class);
    when(query.getAccession()).thenReturn("");
    assertIsoformFeatureNotValid((FeatureQueryFailureImpl) result, new MultipleEntryAccessionForGeneException(query, "GCNT2", Sets.newHashSet("NX_Q06430", "NX_Q8N0V5", "NX_Q8NFS9")));
}
Also used : FeatureQueryResult(org.nextprot.api.isoform.mapper.domain.FeatureQueryResult) SingleFeatureQuery(org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery) Ignore(org.junit.Ignore) IsoformMappingBaseTest(org.nextprot.api.isoform.mapper.IsoformMappingBaseTest) Test(org.junit.Test)

Example 10 with SingleFeatureQuery

use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.

the class IsoformMappingServiceTest method shouldMap2IsoformsContainingFirstAA.

@Test
public void shouldMap2IsoformsContainingFirstAA() throws Exception {
    SingleFeatureQuery query = new SingleFeatureQuery("BCL2-p.Met1ext-5", AnnotationCategory.VARIANT.getApiTypeName(), "");
    FeatureQueryResult result = service.propagateFeature(query);
    assertIsoformFeatureValid(result, "NX_P10415-1", 1, 1, true);
    assertIsoformFeatureValid(result, "NX_P10415-2", 1, 1, true);
}
Also used : FeatureQueryResult(org.nextprot.api.isoform.mapper.domain.FeatureQueryResult) SingleFeatureQuery(org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery) IsoformMappingBaseTest(org.nextprot.api.isoform.mapper.IsoformMappingBaseTest) Test(org.junit.Test)

Aggregations

SingleFeatureQuery (org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery)41 Test (org.junit.Test)36 FeatureQueryResult (org.nextprot.api.isoform.mapper.domain.FeatureQueryResult)33 IsoformMappingBaseTest (org.nextprot.api.isoform.mapper.IsoformMappingBaseTest)29 SequenceVariantTest (org.nextprot.api.isoform.mapper.domain.impl.SequenceVariantTest)6 FeatureQueryFailureImpl (org.nextprot.api.isoform.mapper.domain.impl.FeatureQueryFailureImpl)3 Isoform (org.nextprot.api.core.domain.Isoform)2 BufferedReader (java.io.BufferedReader)1 FileInputStream (java.io.FileInputStream)1 InputStreamReader (java.io.InputStreamReader)1 PrintWriter (java.io.PrintWriter)1 ParseException (java.text.ParseException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Function (java.util.function.Function)1 Ignore (org.junit.Ignore)1 AminoAcidCode (org.nextprot.api.commons.bio.AminoAcidCode)1 SequenceVariation (org.nextprot.api.commons.bio.variation.prot.SequenceVariation)1 Entry (org.nextprot.api.core.domain.Entry)1 GeneMasterCodonPosition (org.nextprot.api.core.utils.seqmap.GeneMasterCodonPosition)1