Search in sources :

Example 1 with ExternalDatabaseValueObject

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

the class PhenotypeAssociationTest method createLiteratureEvidence.

private void createLiteratureEvidence(int geneNCBIid, String uri) {
    this.litEvidence = new LiteratureEvidenceValueObject(-1L);
    this.litEvidence.setDescription("Test Description");
    this.litEvidence.setEvidenceCode("TAS");
    this.litEvidence.setGeneNCBI(geneNCBIid);
    this.litEvidence.setClassName("LiteratureEvidenceValueObject");
    CitationValueObject citationValueObject = new CitationValueObject();
    citationValueObject.setPubmedAccession("1");
    ExternalDatabaseValueObject externalDatabaseValueObject = new ExternalDatabaseValueObject();
    externalDatabaseValueObject.setName(PhenotypeAssociationTest.TEST_EXTERNAL_DATABASE);
    EvidenceSourceValueObject evidenceSourceValueObject = new EvidenceSourceValueObject("url_link", externalDatabaseValueObject);
    SortedSet<CharacteristicValueObject> phenotypes = new TreeSet<>();
    CharacteristicValueObject characteristicValueObject = new CharacteristicValueObject(-1L, uri);
    phenotypes.add(characteristicValueObject);
    this.litEvidence.setPhenotypes(phenotypes);
    SortedSet<PhenotypeAssPubValueObject> phenotypeAssPubVO = new TreeSet<>();
    PhenotypeAssPubValueObject phenotypeAssPubValueObject = new PhenotypeAssPubValueObject();
    phenotypeAssPubValueObject.setType("Primary");
    phenotypeAssPubValueObject.setCitationValueObject(citationValueObject);
    phenotypeAssPubVO.add(phenotypeAssPubValueObject);
    this.litEvidence.setPhenotypeAssPubVO(phenotypeAssPubVO);
    this.litEvidence.setEvidenceSource(evidenceSourceValueObject);
    // those extra fields tell us where the phenotype came from if different than the one given
    this.litEvidence.setPhenotypeMapping(PhenotypeMappingType.INFERRED_CURATED.toString());
    this.litEvidence.setOriginalPhenotype("Original Value Test");
    ValidateEvidenceValueObject e = this.phenotypeAssociationManagerService.makeEvidence(this.litEvidence);
    assertNull(e);
}
Also used : ExternalDatabaseValueObject(ubic.gemma.model.common.description.ExternalDatabaseValueObject) CitationValueObject(ubic.gemma.model.common.description.CitationValueObject)

Example 2 with ExternalDatabaseValueObject

use of ubic.gemma.model.common.description.ExternalDatabaseValueObject 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)

Example 3 with ExternalDatabaseValueObject

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

the class EvidenceImporterAbstractCLI method makeEvidenceSource.

EvidenceSourceValueObject makeEvidenceSource(String databaseID, String externalDatabaseName) {
    EvidenceSourceValueObject evidenceSourceValueObject = null;
    if (databaseID != null && externalDatabaseName != null && !externalDatabaseName.isEmpty()) {
        ExternalDatabaseValueObject externalDatabase = new ExternalDatabaseValueObject();
        externalDatabase.setName(externalDatabaseName);
        evidenceSourceValueObject = new EvidenceSourceValueObject(databaseID, externalDatabase);
    }
    return evidenceSourceValueObject;
}
Also used : ExternalDatabaseValueObject(ubic.gemma.model.common.description.ExternalDatabaseValueObject) EvidenceSourceValueObject(ubic.gemma.model.genome.gene.phenotype.valueObject.EvidenceSourceValueObject)

Aggregations

ExternalDatabaseValueObject (ubic.gemma.model.common.description.ExternalDatabaseValueObject)3 ArrayList (java.util.ArrayList)1 CitationValueObject (ubic.gemma.model.common.description.CitationValueObject)1 ExternalDatabase (ubic.gemma.model.common.description.ExternalDatabase)1 Taxon (ubic.gemma.model.genome.Taxon)1 TaxonValueObject (ubic.gemma.model.genome.TaxonValueObject)1 EvidenceSourceValueObject (ubic.gemma.model.genome.gene.phenotype.valueObject.EvidenceSourceValueObject)1