use of org.nextprot.api.isoform.mapper.domain.FeatureQueryResult in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldNotMapMet1_Lys170Deletion.
@Test
public void shouldNotMapMet1_Lys170Deletion() throws Exception {
SingleFeatureQuery query = new SingleFeatureQuery("BARD1-p.Met1_Lys170del", AnnotationCategory.VARIANT.getApiTypeName(), "");
FeatureQueryResult result = service.propagateFeature(query);
assertIsoformFeatureValid(result, "NX_Q99728-1", 1, 170, 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.FeatureQueryResult in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldNotValidateInvalidPositionVariantIsoform.
@Test
public void shouldNotValidateInvalidPositionVariantIsoform() throws Exception {
FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("SCN11A-p.Leu1158999Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_Q9UI33"));
SingleFeatureQuery query = Mockito.mock(SingleFeatureQuery.class);
when(query.getAccession()).thenReturn("NX_Q9UI33");
assertIsoformFeatureNotValid((FeatureQueryFailureImpl) result, new OutOfBoundSequencePositionException(query, 1158999));
}
use of org.nextprot.api.isoform.mapper.domain.FeatureQueryResult in project nextprot-api by calipho-sib.
the class IsoformMappingService method handleMultipleQueries.
/**
* Execute the given single feature query function to each feature query
* @param multipleFeatureQuery multiple feature query
* @param function the function that process a FeatureQuery and produces FeatureQueryResult
* @return a map of results
*/
default Map<String, FeatureQueryResult> handleMultipleQueries(MultipleFeatureQuery multipleFeatureQuery, Function<SingleFeatureQuery, FeatureQueryResult> function) {
Map<String, FeatureQueryResult> results = new HashMap<>(multipleFeatureQuery.getFeatureList().size() + multipleFeatureQuery.getFeatureMaps().size());
multipleFeatureQuery.getFeatureList().stream().filter(feature -> !results.containsKey(feature)).forEach(feature -> results.put(feature, function.apply(new SingleFeatureQuery(feature, multipleFeatureQuery.getFeatureType(), multipleFeatureQuery.getAccession()))));
multipleFeatureQuery.getFeatureMaps().stream().filter(featureQuery -> !results.containsKey(featureQuery.get("feature"))).forEach(featureQuery -> results.put(featureQuery.get("feature"), function.apply(new SingleFeatureQuery(featureQuery.get("feature"), multipleFeatureQuery.getFeatureType(), featureQuery.get("accession")))));
return results;
}
use of org.nextprot.api.isoform.mapper.domain.FeatureQueryResult in project nextprot-api by calipho-sib.
the class IsoformMappingLocalMockImpl method main.
public static void main(String[] args) {
IsoformMappingLocalMockImpl mi = new IsoformMappingLocalMockImpl();
FeatureQueryResult fq = mi.propagateFeature(new SingleFeatureQuery("SCN9A-iso3-p.Met932Leu", "variant", null));
}
use of org.nextprot.api.isoform.mapper.domain.FeatureQueryResult in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldValidateWithNullAccession.
@Test
public void shouldValidateWithNullAccession() throws Exception {
FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("SCN11A-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), null));
assertIsoformFeatureValid(result, "NX_Q9UI33-1", 1158, 1158, true);
Assert.assertEquals("NX_Q9UI33", result.getQuery().getAccession());
}
Aggregations