Search in sources :

Example 1 with OntologyService

use of ubic.gemma.core.ontology.OntologyService in project Gemma by PavlidisLab.

the class EvidenceImporterAbstractCLI method loadServices.

/**
 * Loads all services that will be needed
 *
 * @param experimentalEvidenceServicesNeeded if the type is an experimental evidence (we need then to load more)
 */
private synchronized void loadServices(boolean experimentalEvidenceServicesNeeded) throws Exception {
    this.phenotypeAssociationService = this.getBean(PhenotypeAssociationManagerService.class);
    this.geneService = this.getBean(GeneService.class);
    this.taxonService = this.getBean(TaxonService.class);
    OntologyService ontologyService = this.getBean(OntologyService.class);
    this.diseaseOntologyService = ontologyService.getDiseaseOntologyService();
    this.mammalianPhenotypeOntologyService = ontologyService.getMammalianPhenotypeOntologyService();
    this.humanPhenotypeOntologyService = ontologyService.getHumanPhenotypeOntologyService();
    while (!this.diseaseOntologyService.isOntologyLoaded()) {
        this.wait(3000);
        AbstractCLI.log.info("waiting for the Disease Ontology to load");
    }
    while (!this.humanPhenotypeOntologyService.isOntologyLoaded()) {
        this.wait(3000);
        AbstractCLI.log.info("waiting for the HP Ontology to load");
    }
    // only need those services for experimental evidences
    if (experimentalEvidenceServicesNeeded) {
        this.nifstdOntologyService = ontologyService.getNifstfOntologyService();
        this.obiService = ontologyService.getObiService();
        this.fmaOntologyService = ontologyService.getFmaOntologyService();
        while (!this.mammalianPhenotypeOntologyService.isOntologyLoaded()) {
            this.wait(3000);
            AbstractCLI.log.info("waiting for the MP Ontology to load");
        }
        while (!this.obiService.isOntologyLoaded()) {
            this.wait(3000);
            AbstractCLI.log.info("waiting for the OBI Ontology to load");
        }
        while (!this.nifstdOntologyService.isOntologyLoaded()) {
            this.wait(3000);
            AbstractCLI.log.info("waiting for the NIF Ontology to load");
        }
        while (!this.fmaOntologyService.isOntologyLoaded()) {
            this.wait(3000);
            AbstractCLI.log.info("waiting for the FMA Ontology to load");
        }
    }
}
Also used : GeneService(ubic.gemma.core.genome.gene.service.GeneService) TaxonService(ubic.gemma.persistence.service.genome.taxon.TaxonService) PhenotypeAssociationManagerService(ubic.gemma.core.association.phenotype.PhenotypeAssociationManagerService) OntologyService(ubic.gemma.core.ontology.OntologyService)

Example 2 with OntologyService

use of ubic.gemma.core.ontology.OntologyService in project Gemma by PavlidisLab.

the class ExternalDatabaseEvidenceImporterAbstractCLI method loadServices.

// load all needed services
private synchronized void loadServices(String[] args) throws Exception {
    // this gets the context, so we can access beans
    Exception err = this.processCommandLine(args);
    if (err != null)
        throw err;
    OntologyService ontologyService = this.getBean(OntologyService.class);
    this.diseaseOntologyService = ontologyService.getDiseaseOntologyService();
    this.humanPhenotypeOntologyService = ontologyService.getHumanPhenotypeOntologyService();
    this.geneService = this.getBean(GeneService.class);
    while (!this.diseaseOntologyService.isOntologyLoaded()) {
        this.wait(3000);
        AbstractCLI.log.info("waiting for the Disease Ontology to load");
    }
    while (!this.humanPhenotypeOntologyService.isOntologyLoaded()) {
        this.wait(3000);
        AbstractCLI.log.info("waiting for the HP Ontology to load");
    }
    this.medicOntologyService = new MedicOntologyService();
}
Also used : GeneService(ubic.gemma.core.genome.gene.service.GeneService) MedicOntologyService(ubic.basecode.ontology.providers.MedicOntologyService) HumanPhenotypeOntologyService(ubic.basecode.ontology.providers.HumanPhenotypeOntologyService) OntologyService(ubic.gemma.core.ontology.OntologyService) DiseaseOntologyService(ubic.basecode.ontology.providers.DiseaseOntologyService) MedicOntologyService(ubic.basecode.ontology.providers.MedicOntologyService) SocketException(java.net.SocketException)

Aggregations

GeneService (ubic.gemma.core.genome.gene.service.GeneService)2 OntologyService (ubic.gemma.core.ontology.OntologyService)2 SocketException (java.net.SocketException)1 DiseaseOntologyService (ubic.basecode.ontology.providers.DiseaseOntologyService)1 HumanPhenotypeOntologyService (ubic.basecode.ontology.providers.HumanPhenotypeOntologyService)1 MedicOntologyService (ubic.basecode.ontology.providers.MedicOntologyService)1 PhenotypeAssociationManagerService (ubic.gemma.core.association.phenotype.PhenotypeAssociationManagerService)1 TaxonService (ubic.gemma.persistence.service.genome.taxon.TaxonService)1