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));
}
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);
}
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);
}
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")));
}
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);
}
Aggregations