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");
}
}
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;
}
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'");
}
}
}
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);
}
Aggregations