Search in sources :

Example 26 with FeatureQueryResult

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

the class IsoformMappingServiceTest method shouldNotValidateInvalidVariantName.

@Test
public void shouldNotValidateInvalidVariantName() throws Exception {
    FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("SCN11A-z.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_Q9UI33"));
    SingleFeatureQuery query = Mockito.mock(SingleFeatureQuery.class);
    when(query.getFeature()).thenReturn("SCN11A-z.Leu1158Pro");
    Assert.assertFalse(result.isSuccess());
    Assert.assertEquals("invalid feature format: SCN11A-z.Leu1158Pro", ((FeatureQueryFailureImpl) result).getError().getMessage());
    Assert.assertEquals(1, ((FeatureQueryFailureImpl) result).getError().getCauses().size());
    Assert.assertEquals("Cannot separate gene name from variation (missing '-p.')", ((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 27 with FeatureQueryResult

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

the class IsoformMappingServiceTest method shouldPropagatePro358_Ser364delDeletion.

@Test
public void shouldPropagatePro358_Ser364delDeletion() throws Exception {
    SingleFeatureQuery query = new SingleFeatureQuery("BARD1-p.Pro358_Ser364del", AnnotationCategory.VARIANT.getApiTypeName(), "");
    FeatureQueryResult result = service.propagateFeature(query);
    assertIsoformFeatureValid(result, "NX_Q99728-1", 358, 364, true);
    assertIsoformFeatureValid(result, "NX_Q99728-2", 339, 345, true);
    assertIsoformFeatureValid(result, "NX_Q99728-3", 261, 267, true);
    assertIsoformFeatureValid(result, "NX_Q99728-4", null, null, false);
    assertIsoformFeatureValidOnMaster(result, "NX_Q99728-1", 1162, 1182);
    assertIsoformFeatureValidOnMaster(result, "NX_Q99728-2", 1162, 1182);
    assertIsoformFeatureValidOnMaster(result, "NX_Q99728-3", 1162, 1182);
    assertIsoformFeatureValidOnMaster(result, "NX_Q99728-4", null, null);
}
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 28 with FeatureQueryResult

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

the class IsoformMappingServiceTest method shouldValidateInsertionVariantOnCanonicalIsoform.

@Test
public void shouldValidateInsertionVariantOnCanonicalIsoform() throws Exception {
    FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("MLH1-p.Lys722_Ala723insTyrLys", AnnotationCategory.VARIANT.getApiTypeName(), "NX_P40692"));
    assertIsoformFeatureValid(result, "NX_P40692-1", 722, 723, 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 29 with FeatureQueryResult

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

the class IsoformMappingServiceTest method shouldNotValidateIncompatibleProteinAndGeneName.

@Test
public void shouldNotValidateIncompatibleProteinAndGeneName() throws Exception {
    FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("SCN11A-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_P01308"));
    SingleFeatureQuery query = Mockito.mock(SingleFeatureQuery.class);
    when(query.getAccession()).thenReturn("NX_P01308");
    assertIsoformFeatureNotValid((FeatureQueryFailureImpl) result, new IncompatibleGeneAndProteinNameException(query, "SCN11A", Lists.newArrayList("INS")));
}
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 30 with FeatureQueryResult

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

the class IsoformMappingServiceTest method shouldNotMapMet1_Asp94Deletion.

@Test
public void shouldNotMapMet1_Asp94Deletion() throws Exception {
    SingleFeatureQuery query = new SingleFeatureQuery("BARD1-p.Met1_Asp94del", AnnotationCategory.VARIANT.getApiTypeName(), "");
    FeatureQueryResult result = service.propagateFeature(query);
    assertIsoformFeatureValid(result, "NX_Q99728-1", 1, 94, true);
    assertIsoformFeatureValid(result, "NX_Q99728-2", null, null, false);
    assertIsoformFeatureValid(result, "NX_Q99728-3", null, null, false);
    assertIsoformFeatureValid(result, "NX_Q99728-4", 1, 94, true);
    assertIsoformFeatureValidOnMaster(result, "NX_Q99728-1", 1, 354);
    assertIsoformFeatureValidOnMaster(result, "NX_Q99728-4", 1, 354);
    assertIsoformFeatureValidOnMaster(result, "NX_Q99728-2", null, null);
    assertIsoformFeatureValidOnMaster(result, "NX_Q99728-3", null, null);
}
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

FeatureQueryResult (org.nextprot.api.isoform.mapper.domain.FeatureQueryResult)33 SingleFeatureQuery (org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery)33 Test (org.junit.Test)29 IsoformMappingBaseTest (org.nextprot.api.isoform.mapper.IsoformMappingBaseTest)29 FeatureQueryFailureImpl (org.nextprot.api.isoform.mapper.domain.impl.FeatureQueryFailureImpl)3 BufferedReader (java.io.BufferedReader)1 FileInputStream (java.io.FileInputStream)1 InputStreamReader (java.io.InputStreamReader)1 PrintWriter (java.io.PrintWriter)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 FeatureQueryFailure (org.nextprot.api.isoform.mapper.domain.FeatureQueryFailure)1 FeatureQuerySuccess (org.nextprot.api.isoform.mapper.domain.FeatureQuerySuccess)1 MultipleFeatureQuery (org.nextprot.api.isoform.mapper.domain.MultipleFeatureQuery)1