use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class BibliographicReferenceControllerImpl method showAllForExperiments.
@Override
public ModelAndView showAllForExperiments(HttpServletRequest request, HttpServletResponse response) {
Map<ExpressionExperiment, BibliographicReference> eeToBibRefs = bibliographicReferenceService.getAllExperimentLinkedReferences();
// map sorted in natural order of the keys
SortedMap<CitationValueObject, Collection<ExpressionExperimentValueObject>> citationToEEs = new TreeMap<>();
for (Entry<ExpressionExperiment, BibliographicReference> entry : eeToBibRefs.entrySet()) {
if (entry.getValue().getTitle() == null || entry.getValue().getTitle().isEmpty() || entry.getValue().getAuthorList() == null || entry.getValue().getAuthorList().isEmpty()) {
continue;
}
CitationValueObject cvo = CitationValueObject.convert2CitationValueObject(entry.getValue());
if (!citationToEEs.containsKey(cvo)) {
citationToEEs.put(cvo, new ArrayList<ExpressionExperimentValueObject>());
}
ExpressionExperiment ee = entry.getKey();
ee.setBioAssays(null);
ee.setAccession(null);
ee.setExperimentalDesign(null);
citationToEEs.get(cvo).add(new ExpressionExperimentValueObject(ee));
}
return new ModelAndView("bibRefAllExperiments").addObject("citationToEEs", citationToEEs);
}
use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class CustomRssViewer method buildFeedItems.
@Override
protected List<Item> buildFeedItems(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) {
@SuppressWarnings("unchecked") Map<ExpressionExperiment, String> experiments = (Map<ExpressionExperiment, String>) model.get("feedContent");
List<Item> items = new ArrayList<>(experiments.size());
// Set content of each expression experiment
for (Map.Entry<ExpressionExperiment, String> entry : experiments.entrySet()) {
ExpressionExperiment e = entry.getKey();
String title = e.getShortName() + " (" + entry.getValue() + "): " + e.getName();
String link = Settings.getBaseUrl() + "expressionExperiment/showExpressionExperiment.html?id=" + e.getId().toString();
int maxLength = 500;
if (e.getDescription().length() < 500) {
maxLength = e.getDescription().length();
}
Item item = new Item();
Content content = new Content();
content.setValue(e.getDescription().substring(0, maxLength) + " ...");
item.setContent(content);
item.setTitle(title);
item.setLink(link);
if (e.getCurationDetails() != null) {
item.setPubDate(e.getCurationDetails().getLastUpdated());
}
items.add(item);
}
return items;
}
use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class DifferentialExpressionAnalysisController method run.
/**
* AJAX entry point when running completely automatically.
*
* @param id id
* @return string
*/
public String run(Long id) {
ExpressionExperiment ee = expressionExperimentService.load(id);
if (ee == null) {
throw new IllegalArgumentException("Cannot access experiment with id=" + id);
}
this.experimentReportService.evictFromCache(ee.getId());
ee = expressionExperimentService.thawLite(ee);
DifferentialExpressionAnalysisTaskCommand cmd = new DifferentialExpressionAnalysisTaskCommand(ee);
boolean rnaSeq = expressionExperimentService.isRNASeq(ee);
cmd.setUseWeights(rnaSeq);
cmd.setFactors(ExperimentalDesignUtils.factorsWithoutBatch(ee.getExperimentalDesign().getExperimentalFactors()));
// if possible, might get dropped.
cmd.setIncludeInteractions(true);
return taskRunningService.submitRemoteTask(cmd);
}
use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class DifferentialExpressionAnalysisController method remove.
/**
* AJAX entry point to remove an analysis given by the ID
*
* @param id id
* @return string
* @throws Exception exception
*/
public String remove(Long eeId, Long id) {
ExpressionExperiment ee = expressionExperimentService.load(eeId);
if (ee == null) {
throw new IllegalArgumentException("Cannot access experiment with id=" + eeId);
}
DifferentialExpressionAnalysis toRemove = differentialExpressionAnalysisService.load(id);
if (toRemove == null) {
throw new IllegalArgumentException("Cannot access analysis with id=" + id);
}
DifferentialExpressionAnalysisRemoveTaskCommand cmd = new DifferentialExpressionAnalysisRemoveTaskCommand(ee, toRemove);
this.experimentReportService.evictFromCache(ee.getId());
return taskRunningService.submitRemoteTask(cmd);
}
use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class ArrayDesignProbeMapperServiceImpl method deleteOldFiles.
/**
* Delete outdated annotation and associated experiment files.
*/
private void deleteOldFiles(ArrayDesign arrayDesign) {
arrayDesignAnnotationService.deleteExistingFiles(arrayDesign);
Collection<ExpressionExperiment> ees4platform = arrayDesignService.getExpressionExperiments(arrayDesign);
ArrayDesignProbeMapperServiceImpl.log.info("Removing invalidated files for up to " + ees4platform.size() + " experiments associated with updated platform " + arrayDesign);
for (ExpressionExperiment ee : ees4platform) {
try {
expressionDataFileService.deleteAllFiles(ee);
} catch (Exception e) {
ArrayDesignProbeMapperServiceImpl.log.error("Error deleting files for " + ee + " " + e.getMessage(), e);
}
}
}
Aggregations