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