use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldValidateExtensionVariantOnCanonicalIsoformBadPos.
@Test
public void shouldValidateExtensionVariantOnCanonicalIsoformBadPos() throws Exception {
SingleFeatureQuery query = new SingleFeatureQuery("RAD50-p.Ter1314Tyrext*66", AnnotationCategory.VARIANT.getApiTypeName(), "");
FeatureQueryResult result = service.validateFeature(query);
assertIsoformFeatureNotValid((FeatureQueryFailureImpl) result, new OutOfBoundSequencePositionException(query, 1313));
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class FeatureQueryExceptionTest method testUnknownFeatureIsoformException.
@Test
public void testUnknownFeatureIsoformException() throws FeatureQueryException {
SingleFeatureQuery query = new SingleFeatureQuery("SCN11A-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_Q9UI33");
UnknownFeatureIsoformException featureQueryException = new UnknownFeatureIsoformException(SequenceVariantTest.mockEntry("NX_Q9UI33", SequenceVariantTest.mockIsoform("NX_Q9UI33-1", "Iso 1", true), SequenceVariantTest.mockIsoform("NX_Q9UI33-1", "Iso 2", false), SequenceVariantTest.mockIsoform("NX_Q9UI33-1", "Iso 3", false)), query, "spongebob");
Assert.assertEquals("unknown isoform: cannot find isoform spongebob in entry NX_Q9UI33 (existing isoforms: [Iso 1, Iso 2, Iso 3])", featureQueryException.getReason().getMessage());
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class FeatureQueryExceptionTest method testUnknownFeatureQueryTypeException.
@Test
public void testUnknownFeatureQueryTypeException() throws FeatureQueryException {
SingleFeatureQuery query = new SingleFeatureQuery("SCN11A-p.Leu1158Pro", AnnotationCategory.CATALYTIC_ACTIVITY.getApiTypeName(), "NX_Q9UI33");
UnknownFeatureQueryTypeException featureQueryException = new UnknownFeatureQueryTypeException(query);
Assert.assertEquals("unknown feature type: cannot find feature type CatalyticActivity", featureQueryException.getReason().getMessage());
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class FeatureQueryExceptionTest method testUnexpectedAminoAcidsError.
@Test
public void testUnexpectedAminoAcidsError() throws FeatureQueryException {
SingleFeatureQuery query = new SingleFeatureQuery("SCN11A-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_Q9UI33");
UnexpectedFeatureQueryAminoAcidException featureQueryException = new UnexpectedFeatureQueryAminoAcidException(query, 1158, new AminoAcidCode[] { AminoAcidCode.ALANINE }, new AminoAcidCode[] { AminoAcidCode.LEUCINE });
Assert.assertEquals("Ala", featureQueryException.getReason().getCause("expectedAminoAcids"));
Assert.assertEquals("Leu", featureQueryException.getReason().getCause("featureAminoAcids"));
Assert.assertEquals(1158, featureQueryException.getReason().getCause("sequencePosition"));
Assert.assertEquals("unexpected amino-acid: found Leu at position 1158 of NX_Q9UI33 sequence instead of expected Ala", featureQueryException.getReason().getMessage());
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class FeatureQueryExceptionTest method testIncompatibleGeneAndProteinNameException.
@Test
public void testIncompatibleGeneAndProteinNameException() throws FeatureQueryException {
SingleFeatureQuery query = new SingleFeatureQuery("SCN11A-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_P01308");
IncompatibleGeneAndProteinNameException featureQueryException = new IncompatibleGeneAndProteinNameException(query, "SCN11A", Lists.newArrayList("INS"));
Assert.assertEquals("gene->protein incompatibility: protein NX_P01308 is not compatible with gene SCN11A (expected genes: [INS])", featureQueryException.getReason().getMessage());
}
Aggregations