use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldNotMapMet1_Lys144Deletion.
@Test
public void shouldNotMapMet1_Lys144Deletion() throws Exception {
SingleFeatureQuery query = new SingleFeatureQuery("BARD1-p.Met1_Lys144del", AnnotationCategory.VARIANT.getApiTypeName(), "");
FeatureQueryResult result = service.propagateFeature(query);
assertIsoformFeatureValid(result, "NX_Q99728-1", 1, 144, 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 validateList.
private static void validateList(String filename, boolean tabSep, IsoformMappingService service) throws Exception {
FileInputStream is = new FileInputStream(filename);
BufferedReader br = new BufferedReader(new InputStreamReader(is));
PrintWriter pw = new PrintWriter(Files.getNameWithoutExtension(filename) + "-results.tsv");
List<String[]> twoFirstFieldsList = br.lines().map((tabSep) ? to2FirstTabFields : to2FirstCommaFields).collect(toList());
pw.append("accession\tvariant\tvalid\terror message\n");
for (String[] twoFields : twoFirstFieldsList) {
String accession = twoFields[0];
String feature = twoFields[1];
FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery(feature, AnnotationCategory.VARIANT.getApiTypeName(), accession));
pw.append(accession).append("\t").append(feature).append("\t").append(String.valueOf(result.isSuccess()));
if (result.isSuccess()) {
pw.append("\t");
} else {
FeatureQueryFailureImpl error = (FeatureQueryFailureImpl) result;
pw.append("\t").append(error.getError().getMessage());
}
pw.append("\n");
}
pw.close();
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldValidateWithNoAccession.
@Test
public void shouldValidateWithNoAccession() throws Exception {
FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("SCN11A-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), ""));
assertIsoformFeatureValid(result, "NX_Q9UI33-1", 1158, 1158, true);
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldPropagateVariantToAllIsoforms.
@Test
public void shouldPropagateVariantToAllIsoforms() throws Exception {
FeatureQueryResult result = service.propagateFeature(new SingleFeatureQuery("SCN11A-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_Q9UI33"));
assertIsoformFeatureValid(result, "NX_Q9UI33-1", 1158, 1158, true);
assertIsoformFeatureValid(result, "NX_Q9UI33-2", 1158, 1158, true);
assertIsoformFeatureValid(result, "NX_Q9UI33-3", 1120, 1120, true);
}
use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldValidateVariantOnCanonicalIsoform.
@Test
public void shouldValidateVariantOnCanonicalIsoform() throws Exception {
FeatureQueryResult result = service.validateFeature(new SingleFeatureQuery("SCN11A-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName(), "NX_Q9UI33"));
assertIsoformFeatureValid(result, "NX_Q9UI33-1", 1158, 1158, true);
}
Aggregations