use of org.edamontology.edammap.core.benchmarking.MappingTest in project edammap by edamontology.
the class Txt method out.
static void out(QueryType type, PrintStream ps, Map<EdamUri, Concept> concepts, List<Query> queries, List<MappingTest> mappings) throws IOException {
ps.print("query_id");
ps.print(SEP);
ps.print("query_name");
ps.print(SEP);
ps.print("edam_branch");
ps.print(SEP);
ps.print("edam_uri");
ps.print(SEP);
ps.print("edam_label");
ps.print(SEP);
ps.print("edam_obsolete");
ps.print(SEP);
ps.print("best_one_query");
ps.print(SEP);
ps.print("best_one_edam");
ps.print(SEP);
ps.print("best_one_score");
ps.print(SEP);
ps.print("without_path_score");
ps.print(SEP);
ps.print("score");
ps.print(SEP);
ps.print("test");
ps.println();
for (int i = 0; i < queries.size(); ++i) {
Query query = queries.get(i);
MappingTest mapping = mappings.get(i);
for (Branch branch : Branch.values()) {
for (MatchTest matchTest : mapping.getMatches(branch)) {
Match match = matchTest.getMatch();
Concept concept = concepts.get(match.getEdamUri());
ps.print(query.getId() != null ? query.getId() : "");
ps.print(SEP);
ps.print(query.getName() != null ? query.getName() : "");
ps.print(SEP);
ps.print(branch);
ps.print(SEP);
ps.print(match.getEdamUri());
ps.print(SEP);
ps.print(concept.getLabel());
ps.print(SEP);
ps.print(concept.isObsolete());
ps.print(SEP);
ps.print(match.getQueryMatch().getType().name());
ps.print(SEP);
ps.print(match.getConceptMatch().getType().name());
ps.print(SEP);
ps.print(match.getBestOneScore() > -1 ? match.getBestOneScore() : "");
ps.print(SEP);
ps.print(match.getWithoutPathScore() > -1 ? match.getWithoutPathScore() : "");
ps.print(SEP);
ps.print(match.getScore());
ps.print(SEP);
ps.print(matchTest.getTest().name());
ps.println();
}
}
}
}
Aggregations