use of ubic.gemma.core.loader.genome.taxon.TaxonLoader in project Gemma by PavlidisLab.
the class TaxonLoaderCli method doWork.
@Override
protected Exception doWork(String[] args) {
try {
Exception err = processCommandLine(args);
if (err != null)
return err;
TaxonFetcher tf = new TaxonFetcher();
Collection<LocalFile> files = tf.fetch();
LocalFile names = null;
for (LocalFile file : files) {
if (file.getLocalURL().toString().endsWith("names.dmp")) {
names = file;
}
}
if (names == null) {
throw new IllegalStateException("No names.dmp file");
}
TaxonLoader tl = new TaxonLoader();
tl.setPersisterHelper(this.getBean(PersisterHelper.class));
int numLoaded = tl.load(names.asFile());
log.info("Loaded " + numLoaded + " taxa");
} catch (Exception e) {
log.error(e);
return e;
}
return null;
}
Aggregations