Search in sources :

Example 11 with ExternalDatabase

use of ubic.gemma.model.common.description.ExternalDatabase in project Gemma by PavlidisLab.

the class ExpressionExperimentFormController method referenceData.

@Override
protected Map referenceData(HttpServletRequest request) {
    Map<Object, Object> referenceData = new HashMap<>();
    Collection<ExternalDatabase> edCol = externalDatabaseService.loadAll();
    Collection<ExternalDatabase> keepers = new HashSet<>();
    for (ExternalDatabase database : edCol) {
        if (database.getType() == null)
            continue;
        if (database.getType().equals(DatabaseType.EXPRESSION)) {
            keepers.add(database);
        }
    }
    referenceData.put("externalDatabases", keepers);
    referenceData.put("standardQuantitationTypes", new ArrayList<>(StandardQuantitationType.literals()));
    referenceData.put("scaleTypes", new ArrayList<>(ScaleType.literals()));
    referenceData.put("generalQuantitationTypes", new ArrayList<>(GeneralType.literals()));
    referenceData.put("representations", new ArrayList<>(PrimitiveType.literals()));
    return referenceData;
}
Also used : ExternalDatabase(ubic.gemma.model.common.description.ExternalDatabase) BioAssayValueObject(ubic.gemma.model.expression.bioAssay.BioAssayValueObject) ExpressionExperimentValueObject(ubic.gemma.model.expression.experiment.ExpressionExperimentValueObject) JSONObject(com.sdicons.json.model.JSONObject)

Example 12 with ExternalDatabase

use of ubic.gemma.model.common.description.ExternalDatabase 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 13 with ExternalDatabase

use of ubic.gemma.model.common.description.ExternalDatabase in project Gemma by PavlidisLab.

the class PhenotypeAssociationTest method createExternalDatabase.

private void createExternalDatabase() {
    ExternalDatabase externalDatabase = ExternalDatabase.Factory.newInstance();
    externalDatabase.setName(PhenotypeAssociationTest.TEST_EXTERNAL_DATABASE);
    externalDatabase.setWebUri("http://www.test.ca/");
    externalDatabaseService.findOrCreate(externalDatabase);
    assertNotNull(externalDatabaseService.findByName(PhenotypeAssociationTest.TEST_EXTERNAL_DATABASE));
}
Also used : ExternalDatabase(ubic.gemma.model.common.description.ExternalDatabase)

Example 14 with ExternalDatabase

use of ubic.gemma.model.common.description.ExternalDatabase in project Gemma by PavlidisLab.

the class BioSequencePersistTest method onSetUpInTransaction.

@Before
public void onSetUpInTransaction() {
    bs = BioSequence.Factory.newInstance();
    Taxon t = Taxon.Factory.newInstance();
    t.setCommonName("mouse");
    t.setIsSpecies(true);
    t.setIsGenesUsable(true);
    bs.setTaxon(t);
    ExternalDatabase ed = ExternalDatabase.Factory.newInstance();
    ed.setName("Genbank");
    DatabaseEntry de = DatabaseEntry.Factory.newInstance();
    de.setExternalDatabase(ed);
    de.setAccession(RandomStringUtils.randomAlphanumeric(10));
    bs.setName(RandomStringUtils.randomAlphanumeric(10));
    bs.setSequenceDatabaseEntry(de);
}
Also used : ExternalDatabase(ubic.gemma.model.common.description.ExternalDatabase) DatabaseEntry(ubic.gemma.model.common.description.DatabaseEntry) Before(org.junit.Before)

Example 15 with ExternalDatabase

use of ubic.gemma.model.common.description.ExternalDatabase in project Gemma by PavlidisLab.

the class TaxonDaoImpl method loadValueObjectsPreFilter.

@Override
public Collection<TaxonValueObject> loadValueObjectsPreFilter(int offset, int limit, String orderBy, boolean asc, ArrayList<ObjectFilter[]> filter) {
    // Compose query
    Query query = this.getLoadValueObjectsQueryString(filter, orderBy, !asc);
    query.setCacheable(true);
    if (limit > 0)
        query.setMaxResults(limit);
    query.setFirstResult(offset);
    // noinspection unchecked
    List<Object[]> list = query.list();
    List<TaxonValueObject> vos = new ArrayList<>(list.size());
    for (Object[] row : list) {
        TaxonValueObject vo = new TaxonValueObject((Taxon) row[1]);
        if (row[2] != null) {
            vo.setExternalDatabase(new ExternalDatabaseValueObject((ExternalDatabase) row[2]));
        }
        if (row[3] != null) {
            vo.setParentTaxon(new TaxonValueObject((Taxon) row[3]));
            if (row[4] != null) {
                vo.getParentTaxon().setParentTaxon(new TaxonValueObject((Taxon) row[4]));
            }
        }
        vos.add(vo);
    }
    return vos;
}
Also used : TaxonValueObject(ubic.gemma.model.genome.TaxonValueObject) ExternalDatabase(ubic.gemma.model.common.description.ExternalDatabase) ExternalDatabaseValueObject(ubic.gemma.model.common.description.ExternalDatabaseValueObject) Taxon(ubic.gemma.model.genome.Taxon) ArrayList(java.util.ArrayList) TaxonValueObject(ubic.gemma.model.genome.TaxonValueObject) ExternalDatabaseValueObject(ubic.gemma.model.common.description.ExternalDatabaseValueObject)

Aggregations

ExternalDatabase (ubic.gemma.model.common.description.ExternalDatabase)23 DatabaseEntry (ubic.gemma.model.common.description.DatabaseEntry)11 Taxon (ubic.gemma.model.genome.Taxon)5 Test (org.junit.Test)4 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)4 HashMap (java.util.HashMap)3 Gene (ubic.gemma.model.genome.Gene)3 BioSequence (ubic.gemma.model.genome.biosequence.BioSequence)3 BlatResult (ubic.gemma.model.genome.sequenceAnalysis.BlatResult)3 IOException (java.io.IOException)2 Collection (java.util.Collection)2 HashSet (java.util.HashSet)2 Before (org.junit.Before)2 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)2 BibliographicReference (ubic.gemma.model.common.description.BibliographicReference)2 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)2 JSONObject (com.sdicons.json.model.JSONObject)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 GeoRecord (ubic.gemma.core.loader.expression.geo.model.GeoRecord)1