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