use of org.nextprot.api.isoform.mapper.domain.FeatureQuerySuccess 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<>();
}
}
Aggregations