use of ubic.gemma.model.association.phenotype.PhenotypeAssociation in project Gemma by PavlidisLab.
the class CharacteristicBrowserController method populateParentInformation.
private void populateParentInformation(AnnotationValueObject avo, Object parent) {
if (parent == null) {
avo.setParentLink("[Parent hidden or not available, " + avo.getObjectClass() + " ID=" + avo.getId() + "]");
} else if (parent instanceof ExpressionExperiment) {
ExpressionExperiment ee = (ExpressionExperiment) parent;
avo.setParentName(String.format("Experiment: %s", ee.getName()));
avo.setParentLink(AnchorTagUtil.getExpressionExperimentLink(ee.getId(), avo.getParentName()));
} else if (parent instanceof BioMaterial) {
BioMaterial bm = (BioMaterial) parent;
avo.setParentName(String.format("BioMat: %s", bm.getName()));
avo.setParentLink(AnchorTagUtil.getBioMaterialLink(bm.getId(), avo.getParentName()));
ExpressionExperiment ee = expressionExperimentService.findByBioMaterial(bm);
if (ee != null) {
avo.setParentOfParentName(String.format("%s", ee.getName()));
// avo.setParentOfParentDescription( ee.getDescription() );
avo.setParentOfParentLink(AnchorTagUtil.getExpressionExperimentLink(ee.getId(), avo.getParentOfParentName()));
} else {
log.warn("Expression experiment for " + bm + " was null");
}
} else if (parent instanceof FactorValue) {
FactorValue fv = (FactorValue) parent;
avo.setParentDescription(String.format("FactorValue: %s « Exp.Factor: %s", (fv.getValue() == null ? "" : ": " + fv.getValue()), fv.getExperimentalFactor().getName()));
ExpressionExperiment ee = experimentalDesignService.getExpressionExperiment(fv.getExperimentalFactor().getExperimentalDesign());
avo.setParentOfParentName(String.format("Experimental Design for: %s", ee.getName()));
avo.setParentOfParentLink(AnchorTagUtil.getExperimentalDesignLink(fv.getExperimentalFactor().getExperimentalDesign().getId(), avo.getParentName()) + " « " + AnchorTagUtil.getExpressionExperimentLink(ee.getId(), String.format("%s (%s)", StringUtils.abbreviate(ee.getName(), 80), ee.getShortName())));
} else if (parent instanceof ExperimentalFactor) {
ExperimentalFactor ef = (ExperimentalFactor) parent;
avo.setParentLink(AnchorTagUtil.getExperimentalDesignLink(ef.getExperimentalDesign().getId(), "Exp Fac: " + ef.getName() + " (" + StringUtils.abbreviate(ef.getDescription(), 50) + ")"));
ExpressionExperiment ee = experimentalDesignService.getExpressionExperiment(ef.getExperimentalDesign());
avo.setParentOfParentName(String.format("%s (%s)", StringUtils.abbreviate(ee.getName(), 80), ee.getShortName()));
avo.setParentOfParentLink(AnchorTagUtil.getExpressionExperimentLink(ee.getId(), avo.getParentOfParentName()));
} else if (parent instanceof PhenotypeAssociation) {
PhenotypeAssociation pa = (PhenotypeAssociation) parent;
avo.setParentLink("PhenotypeAssoc: " + pa.getGene().getOfficialSymbol());
avo.setParentDescription(pa.getId().toString());
}
}
use of ubic.gemma.model.association.phenotype.PhenotypeAssociation 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