Search in sources :

Example 1 with ImageSeries

use of ubic.gemma.core.image.aba.ImageSeries in project Gemma by PavlidisLab.

the class LinkOutController method getAllenBrainAtlasLink.

/**
 * AJAX METHOD Given a gene's official symbol will return value object with the link to use
 *
 * @param geneOfficialSymbol gene official symbol
 * @return linkout vo
 */
@RemoteMethod
public ABALinkOutValueObject getAllenBrainAtlasLink(String geneOfficialSymbol) {
    Collection<ImageSeries> imageSeries = null;
    String abaGeneUrl = null;
    Collection<String> imageUrls = new ArrayList<>();
    // Get Allen Brain Atals information and put in value object
    try {
        imageSeries = allenBrainAtlasService.getRepresentativeSaggitalImages(geneOfficialSymbol);
        if (imageSeries != null) {
            abaGeneUrl = allenBrainAtlasService.getGeneUrl(geneOfficialSymbol);
            Collection<Image> representativeImages = allenBrainAtlasService.getImagesFromImageSeries(imageSeries);
            for (Image image : representativeImages) {
                imageUrls.add(image.getDownloadExpressionPath());
            }
        }
    } catch (IOException e) {
    }
    return new ABALinkOutValueObject(imageUrls, abaGeneUrl, geneOfficialSymbol);
}
Also used : ABALinkOutValueObject(ubic.gemma.core.image.ABALinkOutValueObject) ArrayList(java.util.ArrayList) IOException(java.io.IOException) Image(ubic.gemma.core.image.aba.Image) ImageSeries(ubic.gemma.core.image.aba.ImageSeries) RemoteMethod(org.directwebremoting.annotations.RemoteMethod)

Example 2 with ImageSeries

use of ubic.gemma.core.image.aba.ImageSeries 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

IOException (java.io.IOException)2 Image (ubic.gemma.core.image.aba.Image)2 ImageSeries (ubic.gemma.core.image.aba.ImageSeries)2 ArrayList (java.util.ArrayList)1 RemoteMethod (org.directwebremoting.annotations.RemoteMethod)1 ABALinkOutValueObject (ubic.gemma.core.image.ABALinkOutValueObject)1 GeneValueObject (ubic.gemma.model.genome.gene.GeneValueObject)1 ImageValueObject (ubic.gemma.web.image.aba.ImageValueObject)1