use of uk.ac.ebi.spot.goci.exception.MetricsCalculationException in project goci by EBISPOT.
the class KBMetricsDriver method generateMetricsReport.
/**
* Generate a report on the data metrics of the knowledgebase and write them this report to the supplied output
* stream
*
* @param out the output stream to write the report to
*/
public void generateMetricsReport(OutputStream out) throws MetricsCalculationException, IOException {
try {
// first, calculate data spread in KB
Map<IRI, Integer> metrics = loader.quantifyKnowledgeBase(_efoLocation, _gwasSchemaLocation, _kbLocation);
// build the efo tree
IRITree tree = treeBuilder.buildIRITree(_efoLocation);
// now tree is constructed, overlay counts onto it
walkTreeAndAddCounts(tree.getRootNode(), metrics);
// process the tree and write the "ideal legend" report
treeProcessor.processTree(tree, out);
// write the tree into a report
tree.prettyPrint(out);
} catch (OWLOntologyCreationException e) {
throw new MetricsCalculationException("Failed to calculate metrics because one or more ontologies failed to load " + "(" + e.getMessage() + ")", e);
} catch (URISyntaxException e) {
throw new MetricsCalculationException("Failed to calculate metrics - a reference to a supplied location was not valid " + "(" + e.getMessage() + ")", e);
}
}
Aggregations