Search in sources :

Example 31 with GeneValueObject

use of ubic.gemma.model.genome.gene.GeneValueObject in project Gemma by PavlidisLab.

the class GeneController method loadAllenBrainImages.

/**
 * AJAX NOTE: this method updates the value object passed in
 */
public Collection<ImageValueObject> loadAllenBrainImages(Long geneId) {
    Collection<ImageValueObject> images = new ArrayList<>();
    GeneValueObject gene = geneService.loadValueObjectById(geneId);
    String queryGeneSymbol = gene.getOfficialSymbol();
    GeneValueObject mouseGene = gene;
    boolean usingHomologue = false;
    if (!gene.getTaxonCommonName().equals("mouse")) {
        mouseGene = this.homologeneService.getHomologueValueObject(geneId, "mouse");
        usingHomologue = true;
    }
    if (mouseGene != null) {
        Collection<ImageSeries> imageSeries;
        try {
            imageSeries = allenBrainAtlasService.getRepresentativeSaggitalImages(mouseGene.getOfficialSymbol());
            String abaGeneUrl = allenBrainAtlasService.getGeneUrl(mouseGene.getOfficialSymbol());
            Collection<Image> representativeImages = allenBrainAtlasService.getImagesFromImageSeries(imageSeries);
            images = ImageValueObject.convert2ValueObjects(representativeImages, abaGeneUrl, new GeneValueObject(mouseGene), queryGeneSymbol, usingHomologue);
        } catch (IOException e) {
            log.warn("Could not get ABA data: " + e);
        }
    }
    return images;
}
Also used : GeneValueObject(ubic.gemma.model.genome.gene.GeneValueObject) ImageValueObject(ubic.gemma.web.image.aba.ImageValueObject) IOException(java.io.IOException) Image(ubic.gemma.core.image.aba.Image) ImageSeries(ubic.gemma.core.image.aba.ImageSeries)

Aggregations

GeneValueObject (ubic.gemma.model.genome.gene.GeneValueObject)31 StopWatch (org.apache.commons.lang3.time.StopWatch)6 Gene (ubic.gemma.model.genome.Gene)6 Taxon (ubic.gemma.model.genome.Taxon)5 DoubleVectorValueObject (ubic.gemma.model.expression.bioAssayData.DoubleVectorValueObject)4 GeneSetValueObject (ubic.gemma.model.genome.gene.GeneSetValueObject)4 CharacteristicValueObject (ubic.gemma.model.genome.gene.phenotype.valueObject.CharacteristicValueObject)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 ModelAndView (org.springframework.web.servlet.ModelAndView)3 GeneProductValueObject (ubic.gemma.model.genome.gene.GeneProductValueObject)3 HashSet (java.util.HashSet)2 OntologyTerm (ubic.basecode.ontology.model.OntologyTerm)2 DifferentialExpressionValueObject (ubic.gemma.model.analysis.expression.diff.DifferentialExpressionValueObject)2 BioAssayValueObject (ubic.gemma.model.expression.bioAssay.BioAssayValueObject)2 ExpressionExperimentValueObject (ubic.gemma.model.expression.experiment.ExpressionExperimentValueObject)2 EvidenceValueObject (ubic.gemma.model.genome.gene.phenotype.valueObject.EvidenceValueObject)2 CoexpressionValueObject (ubic.gemma.persistence.service.association.coexpression.CoexpressionValueObject)2 VisualizationValueObject (ubic.gemma.web.controller.visualization.VisualizationValueObject)2 ImageValueObject (ubic.gemma.web.image.aba.ImageValueObject)2 DoubleArrayList (cern.colt.list.DoubleArrayList)1