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