Search in sources :

Example 6 with PhenotypeAssociation

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());
    }
}
Also used : BioMaterial(ubic.gemma.model.expression.biomaterial.BioMaterial) FactorValue(ubic.gemma.model.expression.experiment.FactorValue) ExperimentalFactor(ubic.gemma.model.expression.experiment.ExperimentalFactor) PhenotypeAssociation(ubic.gemma.model.association.phenotype.PhenotypeAssociation) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment)

Example 7 with PhenotypeAssociation

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;
}
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)7 BioMaterial (ubic.gemma.model.expression.biomaterial.BioMaterial)2 ExperimentalFactor (ubic.gemma.model.expression.experiment.ExperimentalFactor)2 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)2 FactorValue (ubic.gemma.model.expression.experiment.FactorValue)2 CharacteristicValueObject (ubic.gemma.model.genome.gene.phenotype.valueObject.CharacteristicValueObject)2 EvidenceValueObject (ubic.gemma.model.genome.gene.phenotype.valueObject.EvidenceValueObject)2 ArrayList (java.util.ArrayList)1 TreeSet (java.util.TreeSet)1 Transactional (org.springframework.transaction.annotation.Transactional)1 SearchResult (ubic.gemma.core.search.SearchResult)1 GeneCoexpressionNodeDegreeValueObject (ubic.gemma.model.association.coexpression.GeneCoexpressionNodeDegreeValueObject)1 AnnotationValueObject (ubic.gemma.model.common.description.AnnotationValueObject)1 BibliographicReference (ubic.gemma.model.common.description.BibliographicReference)1 BibliographicReferenceValueObject (ubic.gemma.model.common.description.BibliographicReferenceValueObject)1 Characteristic (ubic.gemma.model.common.description.Characteristic)1 VocabCharacteristic (ubic.gemma.model.common.description.VocabCharacteristic)1 SearchSettingsImpl (ubic.gemma.model.common.search.SearchSettingsImpl)1 Gene (ubic.gemma.model.genome.Gene)1 GeneValueObject (ubic.gemma.model.genome.gene.GeneValueObject)1