Search in sources :

Example 1 with EvidenceFilter

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);
}
Also used : EvidenceFilter(ubic.gemma.model.genome.gene.phenotype.EvidenceFilter) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 2 with EvidenceFilter

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);
    }
}
Also used : FileWriter(java.io.FileWriter) BufferedWriter(java.io.BufferedWriter) EvidenceFilter(ubic.gemma.model.genome.gene.phenotype.EvidenceFilter)

Example 3 with EvidenceFilter

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;
}
Also used : GeneValueObject(ubic.gemma.model.genome.gene.GeneValueObject) EvidenceValueObject(ubic.gemma.model.genome.gene.phenotype.valueObject.EvidenceValueObject) CharacteristicValueObject(ubic.gemma.model.genome.gene.phenotype.valueObject.CharacteristicValueObject) PhenotypeAssociation(ubic.gemma.model.association.phenotype.PhenotypeAssociation) EvidenceFilter(ubic.gemma.model.genome.gene.phenotype.EvidenceFilter)

Aggregations

EvidenceFilter (ubic.gemma.model.genome.gene.phenotype.EvidenceFilter)3 BufferedWriter (java.io.BufferedWriter)1 FileWriter (java.io.FileWriter)1 Test (org.junit.Test)1 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)1 PhenotypeAssociation (ubic.gemma.model.association.phenotype.PhenotypeAssociation)1 GeneValueObject (ubic.gemma.model.genome.gene.GeneValueObject)1 CharacteristicValueObject (ubic.gemma.model.genome.gene.phenotype.valueObject.CharacteristicValueObject)1 EvidenceValueObject (ubic.gemma.model.genome.gene.phenotype.valueObject.EvidenceValueObject)1