use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class StatementTransformationUtil method getPropagatedStatementsForEntry.
static List<Statement> getPropagatedStatementsForEntry(IsoformMappingService isoformMappingService, Set<Statement> multipleSubjects, String nextprotAccession) {
List<Statement> result = new ArrayList<>();
for (Statement subject : multipleSubjects) {
FeatureQueryResult featureQueryResult;
featureQueryResult = isoformMappingService.propagateFeature(new SingleFeatureQuery(subject.getValue(StatementField.ANNOTATION_NAME), "variant", nextprotAccession));
if (featureQueryResult.isSuccess()) {
result.add(mapVariationStatementToEntry(subject, (FeatureQuerySuccess) featureQueryResult));
} else {
FeatureQueryFailure failure = (FeatureQueryFailure) featureQueryResult;
String message = "Failure for " + subject.getStatementId() + " " + failure.getError().getMessage();
LOGGER.error(message);
}
}
if (result.size() == multipleSubjects.size()) {
return result;
} else {
// return an empty list
return new ArrayList<>();
}
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldReturnError.
@Test
public void shouldReturnError() throws Exception {
FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("SCN11A-p-iso4.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_Q9UI33"));
Assert.assertTrue(!result.isSuccess());
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldValidateExtensionVariantOnCanonicalIsoformBadPos1.
@Test
public void shouldValidateExtensionVariantOnCanonicalIsoformBadPos1() throws Exception {
SingleFeatureQuery query = new SingleFeatureQuery("BCL2-p.Met1ext-5", AnnotationCategory.VARIANT.getApiTypeName(), "");
FeatureQueryResult result = service.validateFeature(query);
assertIsoformFeatureValid(result, "NX_P10415-1", 1, 1, true);
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldValidateMutagenesisOnCanonicalIsoform.
@Test
public void shouldValidateMutagenesisOnCanonicalIsoform() throws Exception {
FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("ACVR1-p.Gln207Asp", AnnotationCategory.MUTAGENESIS.getApiTypeName(), ""));
assertIsoformFeatureValid(result, "NX_Q04771-1", 207, 207, true);
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldNotValidateWithGeneNoAccession.
@Test
public void shouldNotValidateWithGeneNoAccession() throws Exception {
FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("SCN14A-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), ""));
SingleFeatureQuery query = Mockito.mock(SingleFeatureQuery.class);
when(query.getAccession()).thenReturn("");
assertIsoformFeatureNotValid((FeatureQueryFailureImpl) result, new EntryAccessionNotFoundForGeneException(query, "SCN14A"));
}
Aggregations