Skip to content

Commit

Permalink
Move main_coda logic into differentialabundance as experimental study…
Browse files Browse the repository at this point in the history
… type
  • Loading branch information
bjlang committed Aug 27, 2024
1 parent 0a3927a commit 05cfb3a
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 172 deletions.
40 changes: 0 additions & 40 deletions main_coda.nf

This file was deleted.

4 changes: 4 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ params {
control_features = null
sizefactors_from_controls = false

// Experimental analysis options
tools = null
pathway = null

// Reporting
logo_file = "$projectDir/docs/images/nf-core-differentialabundance_logo_light.png"
css_file = "$projectDir/assets/nf-core_style.css"
Expand Down
55 changes: 0 additions & 55 deletions nextflow_coda.config

This file was deleted.

21 changes: 19 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"default": "rnaseq",
"description": "A string identifying the technology used to produce the data",
"help_text": "Currently 'rnaseq' or 'affy_array' may be specified.",
"enum": ["rnaseq", "affy_array", "maxquant", "geo_soft_file"],
"enum": ["rnaseq", "affy_array", "maxquant", "geo_soft_file", "experimental"],
"fa_icon": "far fa-keyboard"
},
"input": {
Expand Down Expand Up @@ -58,7 +58,15 @@
"default": "counts",
"description": "Type of abundance measure used, platform-dependent",
"fa_icon": "fas fa-keyboard"
},
}
}
},
"experimental_analysis_options": {
"title": "Experimental analysis, including CoDa",
"type": "object",
"fa_icon": "fas fa-terminal",
"description": "Values required for experimental analysis",
"properties": {
"tools": {
"type": "string",
"format": "file-path",
Expand All @@ -68,6 +76,12 @@
"pattern": "^\\S+\\.(csv|tsv|yaml)$",
"description": "Path to comma-separated file containing samplesheet",
"help_text": "This file defines possible combinations of tools, which are to be run by the pipeline"
},
"pathway": {
"type": "string",
"fa_icon": "fas fa-border-all",
"description": "(experimantal only): Choose a (list of) pathway from those predefined in the tool sheet",
"help_text": "Choose the a subset of pathways to run. Pathways are defined in the tool sheet."
}
}
},
Expand Down Expand Up @@ -1298,6 +1312,9 @@
{
"$ref": "#/definitions/input_output_options"
},
{
"$ref": "#/definitions/experimental_analysis_options"
},
{
"$ref": "#/definitions/abundance_values"
},
Expand Down
25 changes: 0 additions & 25 deletions nextflow_schema_coda.json

This file was deleted.

20 changes: 7 additions & 13 deletions subworkflows/local/correlation/main.nf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

// include nf-core modules
//
// Perform correlation analysis
//
include {PROPR_PROPR as PROPR} from "../../../modules/nf-core/propr/propr/main.nf"


workflow CORRELATION {
take:
ch_counts
Expand All @@ -17,30 +17,24 @@ workflow CORRELATION {
[ metacounts+metatools, counts ]
}
.branch {
propr: it[0]["cor_method"] == "propr"
propr: it[0]["cor_method"] == "propr"
}
.set { ch_counts_cor }

// Hacer un branch del channel para coger las counts normales cuando no hay variable selection

// Create a branch of the channel to retrieve the normal counts when there is no variable selection.
ch_counts_cor.propr
.branch{
no_sel: it[0]["sel_method"] == null
sel: it[0]["sel_method"] != null
no_sel: it[0]["sel_method"] == null
sel: it[0]["sel_method"] != null
}
.set { ch_counts_selection }

//ch_counts_selection.no_sel.view()
//ch_counts_filtered.view()

ch_propr = ch_counts_filtered.mix(ch_counts_selection.no_sel)
//ch_propr.view()

PROPR(ch_propr)
ch_matrix = PROPR.out.matrix
ch_adjacency = PROPR.out.adj


emit:
matrix = ch_matrix
adjacency = ch_adjacency
Expand Down
8 changes: 4 additions & 4 deletions subworkflows/local/differential/main.nf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// include modules
//
// Perform differential analysis
//
include {PROPR_PROPD as PROPD} from "../../../modules/nf-core/propr/propd/main.nf"


workflow DIFFERENTIAL {
take:
ch_counts
Expand All @@ -15,9 +16,8 @@ workflow DIFFERENTIAL {
metacounts, counts, meta ->
[ metacounts+meta, counts ]
}
//.view()
.branch {
propd: it[0]["diff_method"] == "propd"
propd: it[0]["diff_method"] == "propd"
deseq2: it[0]["diff_method"] == "deseq2"
}
.set { ch_counts_tools }
Expand Down
9 changes: 3 additions & 6 deletions subworkflows/local/enrichment/main.nf
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
// include modules

//
// Perform enrichment analysis
//
include { PROPR_GREA as GREA_DIFF } from "../../../modules/nf-core/propr/grea/main.nf"
include { PROPR_GREA as GREA_COR } from "../../../modules/nf-core/propr/grea/main.nf"
include { MYGENE } from "../../../modules/nf-core/mygene/main.nf"


workflow ENRICHMENT {
take:
ch_diff_adjacency
ch_cor_adjacency
ch_counts


main:

MYGENE(ch_counts)
ch_gmt = MYGENE.out.gmt

Expand All @@ -39,7 +37,6 @@ workflow ENRICHMENT {
GREA_COR(ch_cor_grea.grea, ch_gmt.collect())
ch_enriched_cor = GREA_COR.out.enrichedGO


emit:
enriched_diff = ch_enriched_diff
enriched_cor = ch_enriched_cor
Expand Down
15 changes: 4 additions & 11 deletions subworkflows/local/experimental/main.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// include subworkflows

//
// Run experimental analysis
//
include { CORRELATION } from '../correlation/main.nf'
include { DIFFERENTIAL } from '../differential/main.nf'
include { VARIABLE_SELECTION } from '../variable_selection/main.nf'
Expand All @@ -13,7 +14,7 @@ workflow EXPERIMENTAL {


main:
// Dividir el ch_samples_and_matrix en un channel de samplesheet y otro de matrix (PROPD los coge por separado)
// Split the ch_samples_and_matrix into one channel for the samplesheet and another for the matrix (PROPD takes them separately).
ch_samples_and_matrix
.map {
meta, samplesheet, counts ->
Expand All @@ -27,7 +28,6 @@ workflow EXPERIMENTAL {
[ meta, counts ]
}
.set { ch_counts }
// ch_counts.view()

ch_counts
.combine(ch_tools)
Expand All @@ -41,33 +41,26 @@ workflow EXPERIMENTAL {
ch_out = Channel.empty()

// Perform differential analysis

DIFFERENTIAL(ch_counts, ch_tools, ch_samplesheet.collect())
ch_diff_results = DIFFERENTIAL.out.results
ch_diff_adjacency = DIFFERENTIAL.out.adjacency

// Perform variable selection
ch_counts_filtered = VARIABLE_SELECTION(ch_diff_adjacency, ch_counts)

//VARIABLE_SELECTION.out.count.view()

// Perform correlation analysis
CORRELATION(ch_counts, ch_tools, ch_counts_filtered)
ch_matrix = CORRELATION.out.matrix
ch_cor_adjacency = CORRELATION.out.adjacency
ch_out.mix(ch_matrix)

//ch_diff_adjacency.view()
//ch_cor_adjacency.view()

// Perform enrichment analysis
ENRICHMENT(ch_diff_adjacency, ch_cor_adjacency, ch_counts)
ch_enriched_cor = ENRICHMENT.out.enriched_cor
ch_enriched_diff = ENRICHMENT.out.enriched_diff

ch_out.mix(ch_enriched_diff, ch_enriched_cor)


emit:
output = ch_out
}
16 changes: 5 additions & 11 deletions subworkflows/local/variable_selection/main.nf
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// include modules
//
// Perform variable selection
//
include { FILTERVAR } from "../../../modules/local/filtervar/main.nf"

workflow VARIABLE_SELECTION {
take:
ch_adj//meta_tools, adj
ch_counts //meta_id, counts

ch_adj //meta_tools, adj
ch_counts //meta_id, counts

main:
ch_counts
Expand All @@ -14,26 +15,19 @@ workflow VARIABLE_SELECTION {
[counts]
}
.combine(ch_adj)
//.view()
.map{
counts, meta, adj ->
[ meta, counts, adj]
}
//.view()
.branch {
filtervar: it[0]["sel_method"] == "filtervar"
deseqfilter: it[0]["sel_method"] == "deseqfilter"
}
.set { ch_counts_adj_sel }

//ch_counts_adj_sel.nofilter.view()


FILTERVAR(ch_counts_adj_sel.filtervar)

ch_counts_cor = FILTERVAR.out.count
//ch_counts_cor.view()


emit:
count = ch_counts_cor
Expand Down
Loading

0 comments on commit 05cfb3a

Please sign in to comment.