use of ubic.gemma.model.genome.gene.phenotype.EvidenceFilter in project Gemma by PavlidisLab.
the class PhenotypeAssociationTest method testLoadTree.
@Test
public void testLoadTree() {
Collection<SimpleTreeValueObject> tree = this.phenotypeAssociationManagerService.loadAllPhenotypesByTree(new EvidenceFilter());
assertTrue(tree != null && tree.size() != 0);
}
use of ubic.gemma.model.genome.gene.phenotype.EvidenceFilter in project Gemma by PavlidisLab.
the class PhenotypeAssociationManagerServiceImpl method writeErmineJFile.
private void writeErmineJFile(String writeFolder, String disclaimer, Taxon taxon, boolean noElectronicAnnotation) throws IOException {
String noElectronicA = "";
if (noElectronicAnnotation) {
noElectronicA = "NoIEA";
}
try (BufferedWriter phenoCartageneSets = new BufferedWriter(new FileWriter(writeFolder + "Phenocarta_ErmineJ_" + taxon.getCommonName() + "Genesets" + noElectronicA + ".tsv"))) {
phenoCartageneSets.write(disclaimer);
// gets all : DOID id ---> gene NBCI
Collection<ExternalDatabaseValueObject> externalDatabaseValueObjects = this.findExternalDatabasesWithEvidence();
Collection<Long> extIDs = new HashSet<>();
for (ExternalDatabaseValueObject externalDatabaseValueObject : externalDatabaseValueObjects) {
if (!externalDatabaseValueObject.getName().contains("OMIM"))
extIDs.add(externalDatabaseValueObject.getId());
}
EvidenceFilter ef = new EvidenceFilter(taxon.getId(), false, extIDs);
Collection<TreeCharacteristicValueObject> ontologyTrees;
if (writeFolder.contains("OMIM"))
ontologyTrees = this.customTreeFeatures(this.findAllPhenotypesByTree(null, false, noElectronicAnnotation));
else
ontologyTrees = this.customTreeFeatures(this.findAllPhenotypesByTree(ef, false, noElectronicAnnotation));
// cache the results, for a gene found
HashMap<Integer, String> cacheMap = new HashMap<>();
if (writeFolder.contains("OMIM"))
PhenotypeAssociationManagerServiceImpl.log.debug("ErmineJ file dump, incl OMIM; ontologyTrees: " + ontologyTrees.size());
else
PhenotypeAssociationManagerServiceImpl.log.debug("ErmineJ file dump; ontologyTrees: " + ontologyTrees.size());
// ontologyTrees.iterator().next() is the disease Ontology, always at first position
this.writeForErmineJ(ontologyTrees.iterator().next(), taxon, cacheMap, phenoCartageneSets);
}
}
use of ubic.gemma.model.genome.gene.phenotype.EvidenceFilter in project Gemma by PavlidisLab.
the class GeneController method loadGeneDetails.
/**
* AJAX used for gene page
*/
public GeneValueObject loadGeneDetails(Long geneId) {
// return geneCoreService.loadGeneDetails( geneId );
GeneValueObject gvo = geneCoreService.loadGeneDetails(geneId);
Collection<EvidenceValueObject<? extends PhenotypeAssociation>> collEVO = phenotypeAssociationManagerService.findEvidenceByGeneId(geneId, new HashSet<String>(), new EvidenceFilter(gvo.getTaxonId(), false, null));
Iterator<EvidenceValueObject<? extends PhenotypeAssociation>> iter = collEVO.iterator();
Collection<CharacteristicValueObject> collFilteredDVO = new HashSet<>();
while (iter.hasNext()) {
EvidenceValueObject evo = iter.next();
if (!evo.isHomologueEvidence())
collFilteredDVO.addAll(evo.getPhenotypes());
}
gvo.setPhenotypes(collFilteredDVO);
gvo.setNumGoTerms(this.findGOTerms(geneId).size());
return gvo;
}
Aggregations