Search in sources :

Example 26 with SingleFeatureQuery

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

the class IsoformMappingServiceTest method shouldNotValidateIncorrectAAVariantIsoform.

@Test
public void shouldNotValidateIncorrectAAVariantIsoform() throws Exception {
    FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("SCN11A-p.Met1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_Q9UI33"));
    SingleFeatureQuery query = Mockito.mock(SingleFeatureQuery.class);
    when(query.getAccession()).thenReturn("NX_Q9UI33");
    when(query.getFeature()).thenReturn("SCN11A-p.Met1158Pro");
    assertIsoformFeatureNotValid((FeatureQueryFailure) result, new UnexpectedFeatureQueryAminoAcidException(query, 1158, new AminoAcidCode[] { AminoAcidCode.LEUCINE }, new AminoAcidCode[] { AminoAcidCode.METHIONINE }));
}
Also used : FeatureQueryResult(org.nextprot.api.isoform.mapper.domain.FeatureQueryResult) SingleFeatureQuery(org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery) AminoAcidCode(org.nextprot.api.commons.bio.AminoAcidCode) IsoformMappingBaseTest(org.nextprot.api.isoform.mapper.IsoformMappingBaseTest) Test(org.junit.Test)

Example 27 with SingleFeatureQuery

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

the class IsoformMappingServiceTest method shouldNotMap1IsoformsContainingFirstAA.

@Test
public void shouldNotMap1IsoformsContainingFirstAA() throws Exception {
    SingleFeatureQuery query = new SingleFeatureQuery("TESPA1-p.Met1ext-5", AnnotationCategory.VARIANT.getApiTypeName(), "");
    FeatureQueryResult result = service.propagateFeature(query);
    assertIsoformFeatureValid(result, "NX_A2RU30-1", 1, 1, true);
    assertIsoformFeatureValid(result, "NX_A2RU30-2", null, null, false);
    assertIsoformFeatureValid(result, "NX_A2RU30-3", null, null, false);
}
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 SingleFeatureQuery

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

the class IsoformMappingServiceTest method shouldNotMapMet1_Arg406Deletion.

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

use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery 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 30 with SingleFeatureQuery

use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery 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)

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