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