use of org.nextprot.api.core.dao.StatementDao in project nextprot-api by calipho-sib.
the class StatementExportTask method execute.
@Override
protected void execute() throws FileNotFoundException {
StatementDao statementDao = getBean(StatementDao.class);
MasterIdentifierService masterIdentifierService = getBean(MasterIdentifierService.class);
ArgumentParser parser = getCommandLineParser();
StatementExporter exporter = new StatementExporter(statementDao, masterIdentifierService, parser.getExporterConfig());
LOGGER.info("exporting gene statements...");
// get all genes if no genes were specified
if (parser.getSpecificGeneListToExport().isEmpty()) {
Map<String, String> map = exporter.exportAllGeneStatementsAsTsvString();
for (String geneName : map.keySet()) {
exporter.exportAsTsvFile(parser.getOutputDirname(), geneName, map.get(geneName));
LOGGER.info("gene statements of " + geneName + " exported");
}
} else {
for (String geneName : parser.getSpecificGeneListToExport()) {
exporter.exportAsTsvFile(parser.getOutputDirname(), geneName, exporter.exportGeneStatementsAsTsvString(geneName));
LOGGER.info("gene statements of " + geneName + " exported");
}
}
}
Aggregations