Search in sources :

Example 86 with ExpressionExperiment

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);
}
Also used : ExpressionExperimentValueObject(ubic.gemma.model.expression.experiment.ExpressionExperimentValueObject) CitationValueObject(ubic.gemma.model.common.description.CitationValueObject) ModelAndView(org.springframework.web.servlet.ModelAndView) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) BibliographicReference(ubic.gemma.model.common.description.BibliographicReference)

Example 87 with ExpressionExperiment

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;
}
Also used : Item(com.sun.syndication.feed.rss.Item) Content(com.sun.syndication.feed.rss.Content) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment)

Example 88 with ExpressionExperiment

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);
}
Also used : DifferentialExpressionAnalysisTaskCommand(ubic.gemma.core.tasks.analysis.diffex.DifferentialExpressionAnalysisTaskCommand) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment)

Example 89 with ExpressionExperiment

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);
}
Also used : DifferentialExpressionAnalysis(ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysis) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) DifferentialExpressionAnalysisRemoveTaskCommand(ubic.gemma.core.tasks.analysis.diffex.DifferentialExpressionAnalysisRemoveTaskCommand)

Example 90 with ExpressionExperiment

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);
        }
    }
}
Also used : ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) IOException(java.io.IOException)

Aggregations

ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)214 Test (org.junit.Test)71 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)42 InputStream (java.io.InputStream)36 GeoSeries (ubic.gemma.core.loader.expression.geo.model.GeoSeries)29 AlreadyExistsInSystemException (ubic.gemma.core.loader.util.AlreadyExistsInSystemException)29 GZIPInputStream (java.util.zip.GZIPInputStream)28 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)26 HashSet (java.util.HashSet)25 BioAssaySet (ubic.gemma.model.expression.experiment.BioAssaySet)25 GeoDomainObjectGeneratorLocal (ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal)23 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)22 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)20 Collection (java.util.Collection)18 StopWatch (org.apache.commons.lang3.time.StopWatch)18 ExperimentalFactor (ubic.gemma.model.expression.experiment.ExperimentalFactor)18 Taxon (ubic.gemma.model.genome.Taxon)14 Before (org.junit.Before)12 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)12 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)11