Search in sources :

Example 1 with EvidenceValueObject

use of ubic.gemma.model.genome.gene.phenotype.valueObject.EvidenceValueObject in project Gemma by PavlidisLab.

the class DeleteEvidenceCLI method doWork.

@Override
protected Exception doWork(String[] args) {
    Exception err = this.processCommandLine(args);
    if (err != null)
        return err;
    try {
        this.loadServices();
    } catch (Exception e) {
        AbstractCLI.log.info(e.getMessage());
    }
    Integer limit = 1000;
    AbstractCLI.log.info("Loading " + limit + " evidence (this takes some time)");
    Collection<EvidenceValueObject<? extends PhenotypeAssociation>> evidenceToDelete = this.phenotypeAssociationService.loadEvidenceWithExternalDatabaseName(externalDatabaseName, limit, 0);
    int i = 0;
    while (evidenceToDelete.size() > 0) {
        for (EvidenceValueObject e : evidenceToDelete) {
            this.phenotypeAssociationService.remove(e.getId());
            AbstractCLI.log.info(i++);
        }
        evidenceToDelete = this.phenotypeAssociationService.loadEvidenceWithExternalDatabaseName(externalDatabaseName, limit, 0);
    }
    System.exit(-1);
    return null;
}
Also used : EvidenceValueObject(ubic.gemma.model.genome.gene.phenotype.valueObject.EvidenceValueObject) PhenotypeAssociation(ubic.gemma.model.association.phenotype.PhenotypeAssociation)

Example 2 with EvidenceValueObject

use of ubic.gemma.model.genome.gene.phenotype.valueObject.EvidenceValueObject 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

PhenotypeAssociation (ubic.gemma.model.association.phenotype.PhenotypeAssociation)2 EvidenceValueObject (ubic.gemma.model.genome.gene.phenotype.valueObject.EvidenceValueObject)2 GeneValueObject (ubic.gemma.model.genome.gene.GeneValueObject)1 EvidenceFilter (ubic.gemma.model.genome.gene.phenotype.EvidenceFilter)1 CharacteristicValueObject (ubic.gemma.model.genome.gene.phenotype.valueObject.CharacteristicValueObject)1