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

Coda workflow #281

Merged
merged 15 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
61 changes: 61 additions & 0 deletions assets/schema_tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "nf-core/differentialabundance - params.tools schema",
"description": "Schema for the file provided with params.tools",
"type": "array",
"items": {
"type": "object",
"properties": {
"pathway_name": {
"type": "string",
"meta": ["pathway_name"]
},
"diff_method": {
"type": "string",
"errorMessage": "choose propd, DESeq2 or none",
"meta": ["diff_method"]
},
"args_diff": {
"type": "string",
"meta": ["args_diff"]
},
"enr_diff_method": {
"type": "string",
"meta": ["enr_diff_method"],
"errorMessage": "choose grea, gsea or none"
},
"args_enr_diff": {
"type": "string",
"meta": ["args_enr_diff"]
},
"cor_method": {
"type": "string",
"meta": ["cor_method"],
"errorMessage": "choose correlation,proportionality, partial correlation or none"
},
"args_cor": {
"type": "string",
"meta": ["args_cor"]
},
"enr_cor_method": {
"type": "string",
"meta": ["enr_cor_method"],
"errorMessage": "choose grea or none"
},
"args_enr_cor": {
"type": "string",
"meta": ["args_enr_cor"]
},
"sel_method": {
"type": "string",
"meta": ["sel_method"],
"errorMessage": "choose filtervar or none"
},
"args_sel": {
"type": "string",
"meta": ["args_sel"]
}
},
"required": []
}
}
6 changes: 6 additions & 0 deletions assets/tools_samplesheet.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pathway_name,diff_method,args_diff,enr_diff_method,args_enr_diff,cor_method,args_cor,enr_cor_method,args_enr_cor,sel_method,args_sel
diff_prop,propd, --adjacency true --permutation 100 --fixseed true, , ,,, , ,,
filtered_pcor,propd, --adjacency true --permutation 100 --fixseed true, , ,propr, --permutation 10 --adjacency true --cutoff_min 0.005 --cutoff_max 0.5 --cutoff_interval 0.01 --metric pcor.bshrink, , , filtervar,
prop,, , , ,propr, --cutoff_min 0.05 --cutoff_max 0.95 --cutoff_interval 0.05 --fixseed true --metric rho --permutation 100 --adjacency true, , , ,
diff_grea,propd,--group_col fase --adjacency true --permutation 10,grea, --permutation 10, , , , ,,
deseq2,deseq2,,gsea,,,,,,,
41 changes: 41 additions & 0 deletions conf/crg.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
params {
config_profile_name = 'CRG profile'
config_profile_description = 'Configuration to run on CRG cluster'

max_cpus = 64
max_memory = 100.GB
max_time = 48.h
}


process {
executor = 'crg'
//maxRetries = params.max_retries
//errorStrategy = params.err_start

withLabel:process_low {
queue = 'cn-el7,short-centos79'
cpus = { check_max( 2 , 'cpus' ) }
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
time = { check_max( 4.h * task.attempt, 'time' ) }
}
withLabel:process_medium{
queue = 'cn-el7,short-centos79'
cpus = { check_max( 6 , 'cpus' ) }
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
time = { check_max( 8.h * task.attempt, 'time' ) }
}
withLabel:process_high {
queue = 'cn-el7,long-centos79'
cpus = { check_max( 12 , 'cpus' ) }
memory = { check_max( 56.GB * task.attempt, 'memory' ) }
time = { check_max( 12.h * task.attempt, 'time' ) }

}
}


singularity {
enabled = true
cacheDir = 'singularity_cache'
}
45 changes: 45 additions & 0 deletions conf/modules_coda.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
process {
withName: "PROPR"{
ext.args = { "${meta.args_cor}" == "null" ? '' : "${meta.args_cor}" }
publishDir = [
path: { "${params.outdir}/correlation_analysis/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
withName: "PROPD"{
ext.args = { "${meta.args_diff}" == "null" ? '' : "${meta.args_diff}" }
publishDir = [
path: { "${params.outdir}/differential_analysis/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: "FILTERVAR"{
ext.args = { "${meta.args_cor}" == "null" ? '' : "${meta.args_cor}" }
publishDir = [
path: { "${params.outdir}/variable_selection/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: "GREA_DIFF"{
ext.args = { "${meta.args_enr_diff}" == "null" ? '' : "${meta.args_enr_diff}" }
publishDir = [
path: { "${params.outdir}/enrichment_differential/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: "GREA_COR"{
ext.args = { "${meta.args_enr_cor}" == "null" ? '' : "${meta.args_enr_cor}" }
publishDir = [
path: { "${params.outdir}/enrichment_correlation/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
}
40 changes: 40 additions & 0 deletions main_coda.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// include { PROPR_PROPR } from '../../../modules/nf-core/propr/propr/main'
// include { PROPR_PROPD } from '../../../modules/nf-core/propr/propd/main'
// include { PROPR_GREA } from '../../../modules/nf-core/propr/grea/main'
// include { MYGENE } from '../../../modules/nf-core/mygene/main'
include { EXPERIMENTAL } from './subworkflows/experimental/main.nf'
include { fromSamplesheet } from 'plugin/nf-validation'


// These are local files from my Bachelor Thesis project, I am creating the ch_samples_and_matrix
// manually for testing but it should be be provided by the processing section of nf-core/differentialabundance
Counts_ch = Channel.fromPath("../YMC/counts_sin0.csv")

Sample_ch = Channel.fromPath("../YMC/samplesheet_RCvsOX.csv")
.map{ it -> [[id: 'YMC'], it]}

ch_samples_and_matrix = Sample_ch.combine(Counts_ch)

// Convert the samplesheet.csv in a channel with the proper format
ch_tools = Channel.fromSamplesheet('tools')


// TO DO: This should be modified to run one path per default, not all
if (params.pathway == "all") {
ch_tools
.set{ ch_tools_single }
} else {
ch_tools
.filter{
it[0]["pathway_name"] == params.pathway // TO DO: change pathway to path also in the tools_samplesheet file
}
//.view()
.set{ ch_tools_single }
}
ch_tools_single.view()

workflow {
EXPERIMENTAL(ch_samples_and_matrix, ch_tools_single)
EXPERIMENTAL.out.output.view()
}

20 changes: 20 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,26 @@
"git_sha": "9326d73af3fbe2ee90d9ce0a737461a727c5118e",
"installed_by": ["modules"]
},
"mygene": {
"branch": "master",
"git_sha": "82024cf6325d2ee194e7f056d841ecad2f6856e9",
"installed_by": ["modules"]
},
"propr/grea": {
"branch": "master",
"git_sha": "71b1180a5a3de6398eb0eb4d55424cbda36f52d8",
"installed_by": ["modules"]
},
"propr/propd": {
"branch": "master",
"git_sha": "08b360512467e8e7079f995bb7c981a7c204d00f",
"installed_by": ["modules"]
},
"propr/propr": {
"branch": "master",
"git_sha": "132fa6c9bd2515807f6a1cdec1ad7d03c817bcc9",
"installed_by": ["modules"]
},
"proteus/readproteingroups": {
"branch": "master",
"git_sha": "a069b29783583c219c1f23ed3dcf64a5aee1340b",
Expand Down
23 changes: 23 additions & 0 deletions modules/local/filtervar/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
process FILTERVAR {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/r-propr:5.0.3':
'quay.io/biocontainers/r-propr:5.0.3' }"

input:
tuple val(meta), path(count), path(adj_matrix)

output:
tuple val(meta), path("*.count_filtered.tsv"), emit: count
path "*.R_sessionInfo.log", emit: session_info
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when

script:
template 'filtervar.R'
}
Loading