Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add design to report #189

Merged
merged 5 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion assets/differentialabundance_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,19 @@ Comparisons were made between `r params$observations_type` groups defined using
```{r, echo=FALSE, results='asis'}
contrasts_to_print <- contrasts
colnames(contrasts_to_print) <- prettifyVariablename(colnames(contrasts_to_print))

# Add design/model formulae to report
de_tool <- ifelse(params$study_type %in% c('rnaseq'), "deseq2", "limma")
contrasts_to_print$model <- sapply(contrasts_to_print$Id, function(id) {
model_file <- paste0(id, ".", de_tool, ".model.txt")
if (file.exists(model_file)) {
first_line <- readLines(model_file, n = 1)
return(first_line)
} else {
return(NA)
}
})

print( htmltools::tagList(datatable(contrasts_to_print, caption = paste0("Table of contrasts"), rownames = FALSE, options = list(dom = 't')) ))
```

Expand Down Expand Up @@ -944,4 +957,4 @@ print( htmltools::tagList(datatable(versions_table, caption = "Software versions

```{r, echo=FALSE, results='asis'}
htmltools::includeMarkdown(params$citations)
```
```
4 changes: 3 additions & 1 deletion workflows/differentialabundance.nf
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ workflow DIFFERENTIALABUNDANCE {
ch_samples_and_matrix
)
ch_differential = LIMMA_DIFFERENTIAL.out.results
ch_model = LIMMA_DIFFERENTIAL.out.model

ch_versions = ch_versions
.mix(LIMMA_DIFFERENTIAL.out.versions)
Expand Down Expand Up @@ -376,6 +377,7 @@ workflow DIFFERENTIALABUNDANCE {

ch_norm = DESEQ2_NORM.out.normalised_counts
ch_differential = DESEQ2_DIFFERENTIAL.out.results
ch_model = DESEQ2_DIFFERENTIAL.out.model

ch_versions = ch_versions
.mix(DESEQ2_DIFFERENTIAL.out.versions)
Expand Down Expand Up @@ -517,6 +519,7 @@ workflow DIFFERENTIALABUNDANCE {
.combine(ch_css_file)
.combine(ch_citations_file)
.combine(ch_differential.map{it[1]}.toList())
.combine(ch_model.map{it[1]}.toList())

if (params.gsea_run){
ch_report_input_files = ch_report_input_files
Expand Down Expand Up @@ -574,7 +577,6 @@ workflow DIFFERENTIALABUNDANCE {
}

// Render the final report

RMARKDOWNNOTEBOOK(
ch_report_file,
ch_report_params,
Expand Down