Search in sources :

Example 1 with NcbiGeneLoader

use of ubic.gemma.core.loader.genome.gene.ncbi.NcbiGeneLoader in project Gemma by PavlidisLab.

the class CompositeSequenceGeneMapperServiceTest method loadGeneData.

private void loadGeneData() throws Exception {
    NcbiGeneLoader loader = new NcbiGeneLoader();
    loader.setTaxonService(taxonService);
    loader.setPersisterHelper(this.persisterHelper);
    String filePath = FileTools.resourceToPath("/data/loader/genome/gene");
    String geneInfoFile = filePath + File.separatorChar + "selected_gene_info.gz";
    String gene2AccFile = filePath + File.separatorChar + "selected_gene2accession.gz";
    String geneHistoryFile = filePath + File.separatorChar + "selected_gene_history.gz";
    loader.load(geneInfoFile, gene2AccFile, geneHistoryFile, null, true);
}
Also used : NcbiGeneLoader(ubic.gemma.core.loader.genome.gene.ncbi.NcbiGeneLoader)

Example 2 with NcbiGeneLoader

use of ubic.gemma.core.loader.genome.gene.ncbi.NcbiGeneLoader in project Gemma by PavlidisLab.

the class NcbiGeneLoaderCLI method doWork.

@Override
protected Exception doWork(String[] args) {
    Exception err = this.processCommandLine(args);
    if (err != null)
        return err;
    loader = new NcbiGeneLoader();
    TaxonService taxonService = this.getBean(TaxonService.class);
    loader.setTaxonService(taxonService);
    loader.setPersisterHelper(this.getPersisterHelper());
    loader.setSkipDownload(this.skipDownload);
    loader.setStartingNcbiId(startNcbiId);
    Taxon t = null;
    if (StringUtils.isNotBlank(taxonCommonName)) {
        t = taxonService.findByCommonName(this.taxonCommonName);
        if (t == null) {
            throw new IllegalArgumentException("Unrecognized taxon: " + taxonCommonName);
        }
    }
    if (filePath != null) {
        String geneInfoFile = filePath + File.separatorChar + NcbiGeneLoaderCLI.GENE_INFO_FILE;
        String gene2AccFile = filePath + File.separatorChar + NcbiGeneLoaderCLI.GENE2ACCESSION_FILE;
        String geneHistoryFile = filePath + File.separatorChar + NcbiGeneLoaderCLI.GENE_HISTORY_FILE;
        String geneEnsemblFile = filePath + File.separatorChar + NcbiGeneLoaderCLI.GENE2ENSEMBL_FILE;
        if (t != null) {
            loader.load(geneInfoFile, gene2AccFile, geneHistoryFile, geneEnsemblFile, t);
        } else {
            // do filtering of
            loader.load(geneInfoFile, gene2AccFile, geneHistoryFile, geneEnsemblFile, true);
        // taxa
        }
    } else {
        /* defaults to download files remotely. */
        if (t != null) {
            loader.load(t);
        } else {
            loader.load(true);
        }
    }
    return null;
}
Also used : TaxonService(ubic.gemma.persistence.service.genome.taxon.TaxonService) Taxon(ubic.gemma.model.genome.Taxon) NcbiGeneLoader(ubic.gemma.core.loader.genome.gene.ncbi.NcbiGeneLoader)

Aggregations

NcbiGeneLoader (ubic.gemma.core.loader.genome.gene.ncbi.NcbiGeneLoader)2 Taxon (ubic.gemma.model.genome.Taxon)1 TaxonService (ubic.gemma.persistence.service.genome.taxon.TaxonService)1