use of org.nextprot.api.isoform.mapper.domain.FeatureQueryResult in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldPropagateVariantToAllValidIsoforms.
@Test
public void shouldPropagateVariantToAllValidIsoforms() throws Exception {
FeatureQueryResult result = service.propagateFeature(new SingleFeatureQuery("SCN11A-p.Lys1710Thr", AnnotationCategory.VARIANT.getApiTypeName(), "NX_Q9UI33"));
assertIsoformFeatureValid(result, "NX_Q9UI33-1", 1710, 1710, true);
assertIsoformFeatureValid(result, "NX_Q9UI33-2", null, null, false);
assertIsoformFeatureValid(result, "NX_Q9UI33-3", 1672, 1672, true);
}
use of org.nextprot.api.isoform.mapper.domain.FeatureQueryResult in project nextprot-api by calipho-sib.
the class IsoformMappingServiceTest method shouldMap2IsoformsContainingLastAA.
@Test
public void shouldMap2IsoformsContainingLastAA() throws Exception {
SingleFeatureQuery query = new SingleFeatureQuery("SDHD-p.*160Leuext*3", AnnotationCategory.VARIANT.getApiTypeName(), "");
FeatureQueryResult result = service.propagateFeature(query);
assertIsoformFeatureValid(result, "NX_O14521-1", 160, 160, true);
assertIsoformFeatureValid(result, "NX_O14521-2", 121, 121, true);
assertIsoformFeatureValid(result, "NX_O14521-3", null, null, false);
assertIsoformFeatureValid(result, "NX_O14521-4", null, null, false);
}
use of org.nextprot.api.isoform.mapper.domain.FeatureQueryResult 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.FeatureQueryResult 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.FeatureQueryResult 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);
}
Aggregations