Skip to content

Commit

Permalink
Added filtered DE tables to output; add rounding after gprofiler2 PR …
Browse files Browse the repository at this point in the history
…is merged
  • Loading branch information
WackerO committed Nov 29, 2023
1 parent f09a2fc commit 0a24c7c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
9 changes: 9 additions & 0 deletions assets/differentialabundance_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ treatment-mCherry-hND6-batcheffect.deseq2.results.tsv
... where variable, reference, target and blocking come from the contrasts file
(with blocking being optional) and the suffix is defined in parameters.
Also save the tables again after filtering for DE entries
-->

```{r, echo=FALSE}
Expand Down Expand Up @@ -333,6 +335,13 @@ differential_results <- lapply(differential_files, function(diff_file){
if (! is.null(params$features)){
diff <- merge(features, diff, by.x = params$features_id_col, by.y = params$differential_feature_id_column)
}
# Filter tables by logFC threshold and padj threshold and save to TSV
filtered_diff <- na.omit(diff[log2(params$differential_min_fold_change) <= abs(diff[[params$differential_fc_column]]) & diff[[params$differential_qval_column]] <= params$differential_max_qval,])
filtered_diff <- round_dataframe_columns()
write.table(filtered_diff, file=file.path(params$artifact_dir, paste0(basename(tools::file_path_sans_ext(diff_file)), "_filtered.tsv")), sep="\t", quote=F, row.names=F)
diff
})
names(differential_results) <- contrasts$id
Expand Down
14 changes: 11 additions & 3 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,17 @@ process {
conda = "bioconda::r-shinyngs=1.8.4"
container = { "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.4--r43hdfd78af_0' : 'biocontainers/r-shinyngs:1.8.4--r43hdfd78af_0' }" }
publishDir = [
path: { "${params.outdir}/report" },
mode: params.publish_dir_mode,
pattern: '*.html'
[
path: { "${params.outdir}/report" },
mode: params.publish_dir_mode,
pattern: '*.html'
],
[
path: { "${params.outdir}/" },
mode: params.publish_dir_mode,
pattern: 'artifacts/*_filtered.tsv',
saveAs: { filename -> "tables/de_tables2/${filename.split("\\.", 2)[1]}" }
]
]
}

Expand Down

0 comments on commit 0a24c7c

Please sign in to comment.