Search in sources :

Example 1 with ExternalDatabaseService

use of ubic.gemma.persistence.service.common.description.ExternalDatabaseService in project Gemma by PavlidisLab.

the class GenericGenelistDesignGenerator method processOptions.

@Override
protected void processOptions() {
    super.processOptions();
    geneService = this.getBean(GeneService.class);
    arrayDesignAnnotationService = this.getBean(ArrayDesignAnnotationService.class);
    TaxonService taxonService = this.getBean(TaxonService.class);
    bioSequenceService = this.getBean(BioSequenceService.class);
    arrayDesignService = this.getBean(ArrayDesignService.class);
    compositeSequenceService = this.getBean(CompositeSequenceService.class);
    annotationAssociationService = this.getBean(AnnotationAssociationService.class);
    externalDatabaseService = this.getBean(ExternalDatabaseService.class);
    arrayDesignReportService = this.getBean(ArrayDesignReportService.class);
    if (this.hasOption('t')) {
        this.taxon = this.setTaxonByName(taxonService);
    }
    if (this.hasOption("ncbiids")) {
        this.useNCBIIds = true;
    } else if (this.hasOption("ensembl")) {
        this.useEnsemblIds = true;
    }
    if (useNCBIIds && useEnsemblIds) {
        throw new IllegalArgumentException("Choose one of ensembl or ncbi ids or gene symbols");
    }
}
Also used : GeneService(ubic.gemma.core.genome.gene.service.GeneService) AnnotationAssociationService(ubic.gemma.persistence.service.genome.sequenceAnalysis.AnnotationAssociationService) ExternalDatabaseService(ubic.gemma.persistence.service.common.description.ExternalDatabaseService) TaxonService(ubic.gemma.persistence.service.genome.taxon.TaxonService) ArrayDesignAnnotationService(ubic.gemma.core.analysis.service.ArrayDesignAnnotationService) BioSequenceService(ubic.gemma.persistence.service.genome.biosequence.BioSequenceService) CompositeSequenceService(ubic.gemma.persistence.service.expression.designElement.CompositeSequenceService) ArrayDesignService(ubic.gemma.persistence.service.expression.arrayDesign.ArrayDesignService) ArrayDesignReportService(ubic.gemma.core.analysis.report.ArrayDesignReportService)

Example 2 with ExternalDatabaseService

use of ubic.gemma.persistence.service.common.description.ExternalDatabaseService in project Gemma by PavlidisLab.

the class ExternalDatabaseAdderCli method doWork.

@Override
protected Exception doWork(String[] args) {
    try {
        Exception err = processCommandLine(args);
        if (err != null)
            return err;
        // ContactService contactService = this.getBean( ContactService.class );
        ExternalDatabase toAdd = ExternalDatabase.Factory.newInstance();
        // Contact c = contactService.findByName( "Affymetrix" ).iterator().next();
        // toAdd.setDatabaseSupplier( c );
        // toAdd.setDescription( "The NetAffx Analysis Center enables researchers to correlate their "
        // + "GeneChip array results with array design and annotation information." );
        // toAdd.setName( "NetAFFX" );
        // toAdd.setType( DatabaseType.SEQUENCE );
        // toAdd.setWebUri( "http://www.affymetrix.com/analysis/index.affx" );
        // Contact c = Contact.Factory.newInstance();
        // c.setName( "McKusick-Nathans Institute of Genetic Medicine" );
        // c = contactService.findOrCreate( c );
        // toAdd.setDatabaseSupplier( c );
        // toAdd.setDescription(
        // "Online Mendelian Inheritance in Man is a comprehensive, authoritative, and timely compendium of human
        // genes and genetic phenotypes. "
        // +
        // "OMIM and Online Mendelian Inheritance in Man are registered trademarks of the Johns Hopkins University."
        // );
        // toAdd.setName( "OMIM" );
        // toAdd.setType( DatabaseType.OTHER );
        // toAdd.setWebUri( "http://omim.org/" );
        ExternalDatabaseService eds = this.getBean(ExternalDatabaseService.class);
        eds.findOrCreate(toAdd);
    } catch (Exception e) {
        return e;
    }
    return null;
}
Also used : ExternalDatabaseService(ubic.gemma.persistence.service.common.description.ExternalDatabaseService) ExternalDatabase(ubic.gemma.model.common.description.ExternalDatabase)

Example 3 with ExternalDatabaseService

use of ubic.gemma.persistence.service.common.description.ExternalDatabaseService in project Gemma by PavlidisLab.

the class ArrayDesignProbeMapperCli method processOptions.

/**
 * See 'configure' for how the other options are handled. (non-Javadoc)
 *
 * @see ArrayDesignSequenceManipulatingCli#processOptions()
 */
@Override
protected void processOptions() {
    super.processOptions();
    arrayDesignProbeMapperService = this.getBean(ArrayDesignProbeMapperService.class);
    TaxonService taxonService = this.getBean(TaxonService.class);
    if (this.hasOption(AbstractCLI.THREADS_OPTION)) {
        this.numThreads = this.getIntegerOptionValue("threads");
    }
    if (this.hasOption("import")) {
        if (!this.hasOption('t')) {
            throw new IllegalArgumentException("You must provide the taxon when using the import option");
        }
        if (!this.hasOption("source")) {
            throw new IllegalArgumentException("You must provide source database name when using the import option");
        }
        String sourceDBName = this.getOptionValue("source");
        ExternalDatabaseService eds = this.getBean(ExternalDatabaseService.class);
        this.sourceDatabase = eds.findByName(sourceDBName);
        this.directAnnotationInputFileName = this.getOptionValue("import");
        if (this.hasOption("ncbi")) {
            this.ncbiIds = true;
        }
    }
    if (this.hasOption('t')) {
        this.taxon = this.setTaxonByName(taxonService);
    }
    if (this.hasOption("nodb")) {
        this.useDB = false;
    }
    if (this.hasOption("probes")) {
        if (this.arrayDesignsToProcess == null || this.arrayDesignsToProcess.size() > 1) {
            throw new IllegalArgumentException("With '-probes' you must provide exactly one platform");
        }
        this.useDB = false;
        probeNames = this.getOptionValue("probes").split(",");
        if (probeNames.length == 0) {
            throw new IllegalArgumentException("You must provide at least one probe name when using '-probes'");
        }
    }
}
Also used : ExternalDatabaseService(ubic.gemma.persistence.service.common.description.ExternalDatabaseService) TaxonService(ubic.gemma.persistence.service.genome.taxon.TaxonService) ArrayDesignProbeMapperService(ubic.gemma.core.loader.expression.arrayDesign.ArrayDesignProbeMapperService)

Example 4 with ExternalDatabaseService

use of ubic.gemma.persistence.service.common.description.ExternalDatabaseService in project Gemma by PavlidisLab.

the class StringProteinLoadCli method loadProteinProteinInteractions.

/**
 * Method to wrap call to loader. Ensures that all spring beans are configured.
 *
 * @throws IOException IO problems
 */
// Possible external use
@SuppressWarnings({ "unused", "WeakerAccess" })
public void loadProteinProteinInteractions() throws IOException {
    StringProteinInteractionLoader loader = new StringProteinInteractionLoader();
    GeneService geneService = this.getBean(GeneService.class);
    ExternalDatabaseService externalDatabaseService = this.getBean(ExternalDatabaseService.class);
    // set all the loaders
    if (this.getPersisterHelper() == null || geneService == null || externalDatabaseService == null) {
        throw new RuntimeException("Spring configuration problem");
    }
    loader.setPersisterHelper(this.getPersisterHelper());
    loader.setGeneService(geneService);
    loader.setExternalDatabaseService(externalDatabaseService);
    Collection<Taxon> taxa = this.getValidTaxon();
    // some of these parameters can be null
    loader.load(stringProteinProteinFileNameLocal, stringProteinProteinFileNameRemote, biomartFileName, taxa);
}
Also used : GeneService(ubic.gemma.core.genome.gene.service.GeneService) ExternalDatabaseService(ubic.gemma.persistence.service.common.description.ExternalDatabaseService) StringProteinInteractionLoader(ubic.gemma.core.loader.protein.StringProteinInteractionLoader) Taxon(ubic.gemma.model.genome.Taxon)

Aggregations

ExternalDatabaseService (ubic.gemma.persistence.service.common.description.ExternalDatabaseService)4 GeneService (ubic.gemma.core.genome.gene.service.GeneService)2 TaxonService (ubic.gemma.persistence.service.genome.taxon.TaxonService)2 ArrayDesignReportService (ubic.gemma.core.analysis.report.ArrayDesignReportService)1 ArrayDesignAnnotationService (ubic.gemma.core.analysis.service.ArrayDesignAnnotationService)1 ArrayDesignProbeMapperService (ubic.gemma.core.loader.expression.arrayDesign.ArrayDesignProbeMapperService)1 StringProteinInteractionLoader (ubic.gemma.core.loader.protein.StringProteinInteractionLoader)1 ExternalDatabase (ubic.gemma.model.common.description.ExternalDatabase)1 Taxon (ubic.gemma.model.genome.Taxon)1 ArrayDesignService (ubic.gemma.persistence.service.expression.arrayDesign.ArrayDesignService)1 CompositeSequenceService (ubic.gemma.persistence.service.expression.designElement.CompositeSequenceService)1 BioSequenceService (ubic.gemma.persistence.service.genome.biosequence.BioSequenceService)1 AnnotationAssociationService (ubic.gemma.persistence.service.genome.sequenceAnalysis.AnnotationAssociationService)1