use of ubic.gemma.model.genome.TaxonValueObject in project Gemma by PavlidisLab.
the class TaxonServiceImpl method getTaxaWithArrays.
/**
* @return List of taxa with array designs in gemma
*/
@Override
@Transactional(readOnly = true)
public Collection<TaxonValueObject> getTaxaWithArrays() {
Set<TaxonValueObject> taxaWithArrays = new TreeSet<>(TaxonServiceImpl.TAXON_VO_COMPARATOR);
for (Taxon taxon : arrayDesignService.getPerTaxonCount().keySet()) {
taxaWithArrays.add(TaxonValueObject.fromEntity(taxon));
}
AbstractService.log.debug("GenePicker::getTaxaWithArrays returned " + taxaWithArrays.size() + " results");
return taxaWithArrays;
}
use of ubic.gemma.model.genome.TaxonValueObject in project Gemma by PavlidisLab.
the class TaxonDaoImpl method loadValueObjectsPreFilter.
@Override
public Collection<TaxonValueObject> loadValueObjectsPreFilter(int offset, int limit, String orderBy, boolean asc, ArrayList<ObjectFilter[]> filter) {
// Compose query
Query query = this.getLoadValueObjectsQueryString(filter, orderBy, !asc);
query.setCacheable(true);
if (limit > 0)
query.setMaxResults(limit);
query.setFirstResult(offset);
// noinspection unchecked
List<Object[]> list = query.list();
List<TaxonValueObject> vos = new ArrayList<>(list.size());
for (Object[] row : list) {
TaxonValueObject vo = new TaxonValueObject((Taxon) row[1]);
if (row[2] != null) {
vo.setExternalDatabase(new ExternalDatabaseValueObject((ExternalDatabase) row[2]));
}
if (row[3] != null) {
vo.setParentTaxon(new TaxonValueObject((Taxon) row[3]));
if (row[4] != null) {
vo.getParentTaxon().setParentTaxon(new TaxonValueObject((Taxon) row[4]));
}
}
vos.add(vo);
}
return vos;
}
use of ubic.gemma.model.genome.TaxonValueObject in project Gemma by PavlidisLab.
the class TaxonServiceImpl method getTaxaWithDatasets.
/**
* @return collection of taxa that have expression experiments available.
*/
@Override
@Transactional(readOnly = true)
public Collection<TaxonValueObject> getTaxaWithDatasets() {
Set<TaxonValueObject> taxaWithDatasets = new TreeSet<>(TaxonServiceImpl.TAXON_VO_COMPARATOR);
Map<Taxon, Long> perTaxonCount = expressionExperimentService.getPerTaxonCount();
for (Taxon taxon : this.loadAll()) {
if (perTaxonCount.containsKey(taxon) && perTaxonCount.get(taxon) > 0) {
taxaWithDatasets.add(TaxonValueObject.fromEntity(taxon));
}
}
return taxaWithDatasets;
}
use of ubic.gemma.model.genome.TaxonValueObject in project Gemma by PavlidisLab.
the class LinkUtils method getGenomeBrowserLink.
/**
* @param blatResult blat result
* @return URL to the genome browser for the given blat result, or null if the URL cannot be formed correctly.
*/
public static String getGenomeBrowserLink(BlatResultValueObject blatResult) {
if ((blatResult.getQuerySequence() == null) || (blatResult.getQuerySequence().getTaxon() == null))
return null;
TaxonValueObject taxon = blatResult.getQuerySequence().getTaxon();
String organism = taxon.getCommonName();
String database = "";
if (organism.equalsIgnoreCase("Human")) {
database = Settings.getString("gemma.goldenpath.db.human");
} else if (organism.equalsIgnoreCase("Rat")) {
database = Settings.getString("gemma.goldenpath.db.rat");
} else if (organism.equalsIgnoreCase("Mouse")) {
database = Settings.getString("gemma.goldenpath.db.mouse");
} else {
return null;
}
String link = "http://genome.ucsc.edu/cgi-bin/hgTracks?org=" + organism + "&pix=850" + "&db=" + database + "&hgt.customText=" + Settings.getBaseUrl() + "blatTrack.html?id=";
link += blatResult.getId();
return link;
}
use of ubic.gemma.model.genome.TaxonValueObject in project Gemma by PavlidisLab.
the class GeneSetController method addSessionGroup.
/**
* * AJAX adds the gene group to the session, used by SessionGeneGroupStore and SessionDatasetGroupStore sets the
* groups taxon value and reference.
*
* @param gsvo gsvo
* @param modificationBased whether the set was modified by the user
* @return gene set vo
*/
public SessionBoundGeneSetValueObject addSessionGroup(SessionBoundGeneSetValueObject gsvo, Boolean modificationBased) {
TaxonValueObject tax = geneSetService.getTaxonVOforGeneSetVO(gsvo);
gsvo.setTaxonId(tax.getId());
gsvo.setTaxonName(tax.getCommonName());
return sessionListManager.addGeneSet(gsvo, modificationBased);
}
Aggregations