Search in sources :

Example 1 with GOGroupValueObject

use of ubic.gemma.core.genome.gene.GOGroupValueObject in project Gemma by PavlidisLab.

the class GeneSetSearchImpl method findGeneSetValueObjectByGoId.

@Override
public GOGroupValueObject findGeneSetValueObjectByGoId(String goId, Long taxonId) {
    // shouldn't need to set the taxon here, should be taken care of when creating the value object
    Taxon taxon;
    if (taxonId != null) {
        taxon = taxonService.load(taxonId);
        if (taxon == null) {
            GeneSetSearchImpl.log.warn("No such taxon with id=" + taxonId);
        } else {
            GeneSet result = this.findByGoId(goId, taxonService.load(taxonId));
            if (result == null) {
                GeneSetSearchImpl.log.warn("No matching gene set found for: " + goId);
                return null;
            }
            GOGroupValueObject ggvo = geneSetValueObjectHelper.convertToGOValueObject(result, goId, goId);
            ggvo.setTaxonId(taxon.getId());
            ggvo.setTaxonName(taxon.getCommonName());
            return ggvo;
        }
    }
    return null;
}
Also used : GOGroupValueObject(ubic.gemma.core.genome.gene.GOGroupValueObject) Taxon(ubic.gemma.model.genome.Taxon) GeneSet(ubic.gemma.model.genome.gene.GeneSet)

Aggregations

GOGroupValueObject (ubic.gemma.core.genome.gene.GOGroupValueObject)1 Taxon (ubic.gemma.model.genome.Taxon)1 GeneSet (ubic.gemma.model.genome.gene.GeneSet)1