use of ubic.gemma.model.genome.PhysicalLocationValueObject in project Gemma by PavlidisLab.
the class GeneSymbolArg method getGeneLocation.
@Override
public Collection<PhysicalLocationValueObject> getGeneLocation(GeneService geneService) {
Collection<Gene> genes = geneService.findByOfficialSymbol(this.value);
Collection<PhysicalLocationValueObject> gVos = new ArrayList<>(genes.size());
for (Gene gene : genes) {
gVos.addAll(geneService.getPhysicalLocationsValueObjects(gene));
}
return gVos;
}
use of ubic.gemma.model.genome.PhysicalLocationValueObject in project Gemma by PavlidisLab.
the class GeneServiceImpl method getPhysicalLocationsValueObjects.
@Override
@Transactional(readOnly = true)
public Collection<PhysicalLocationValueObject> getPhysicalLocationsValueObjects(Gene gene) {
if (gene == null) {
return Collections.emptyList();
}
gene = this.thaw(gene);
Collection<GeneProduct> gpCollection = gene.getProducts();
Collection<PhysicalLocationValueObject> locations = new LinkedList<>();
if (gpCollection == null)
return null;
for (GeneProduct gp : gpCollection) {
PhysicalLocation physicalLocation = gp.getPhysicalLocation();
if (physicalLocation == null) {
AbstractService.log.warn(gene.getOfficialSymbol() + " product " + gp.getName() + " (id:" + gp.getId() + ") has no location.");
continue;
}
// Only add if the physical location of the product is different from any we already know.
PhysicalLocationValueObject vo = new PhysicalLocationValueObject(physicalLocation);
if (!locations.contains(vo)) {
locations.add(vo);
}
}
return locations;
}
Aggregations