From 9fca40e574724c639b24f05963c9fc5d29665991 Mon Sep 17 00:00:00 2001 From: nservant <nicolas.servant@curie.fr> Date: Thu, 4 Feb 2021 13:05:43 +0100 Subject: [PATCH] [TEST] update test parameters --- conf/test.config | 1 + main.nf | 30 +++++++++++++++++++++--------- nextflow.config | 4 +++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/conf/test.config b/conf/test.config index a08cfe8..d06ad50 100644 --- a/conf/test.config +++ b/conf/test.config @@ -34,4 +34,5 @@ params { res_dist_decay = '1000' res_tads = '1000' tads_caller = 'insulation,hicexplorer' + res_compartments = '1000' } diff --git a/main.nf b/main.nf index f1c597a..382432f 100644 --- a/main.nf +++ b/main.nf @@ -277,9 +277,23 @@ if (params.res_dist_decay && !params.skip_dist_decay){ } } +if (params.res_compartments && !params.skip_compartments){ + Channel.from( "${params.res_compartments}" ) + .splitCsv() + .flatten() + .into {comp_bin; comp_res} + map_res = map_res.concat(comp_bin) + all_res = all_res + ',' + params.res_compartments +}else{ + comp_res = Channel.create() + if (!params.skip_compartments){ + log.warn "[nf-core/hic] Hi-C resolution for compartment calling not specified. See --res_compartments" + } +} + map_res .unique() - .into { map_res_summary; map_res; map_res_cool } + .into { map_res_summary; map_res; map_res_cool; map_comp } /********************************************************** * SET UP LOGS @@ -1020,9 +1034,8 @@ process dist_decay { * Compartment calling */ -/* if(!params.skip_compartments){ - chcomp = maps_cool_comp.combine(comp_res).filter{ it[1] == it[4] }.dump(tag: "comp") + chcomp = maps_cool_comp.combine(comp_res).filter{ it[1] == it[3] }.dump(tag: "comp") }else{ chcomp = Channel.empty() } @@ -1036,17 +1049,16 @@ process compartment_calling { !params.skip_compartments input: - set val(sample), val(res), file(mat), file(bed), val(r) from chcomp + set val(sample), val(res), file(cool), val(r) from chcomp output: - file("*.bedgraph") optional true into out_compartments + file("*compartments*") optional true into out_compartments script: """ - call_compartments.r --matrix ${mat} --bed ${bed} + cooltools call-compartments --contact-type cis -o ${sample}_compartments ${cool} """ } -*/ /* @@ -1068,14 +1080,14 @@ process tads_hicexplorer { !params.skip_tads && params.tads_caller =~ 'hicexplorer' input: - set val(sample), val(res), file(h5mat), val(r) from chtads + set val(sample), val(res), file(cool), val(r) from chtads output: file("*.{bed,bedgraph,gff}") into hicexplorer_tads script: """ - hicFindTADs --matrix ${h5mat} \ + hicFindTADs --matrix ${cool} \ --outPrefix tad \ --correctForMultipleTesting fdr \ --numberOfProcessors ${task.cpus} diff --git a/nextflow.config b/nextflow.config index c3ddb38..6e8eae6 100644 --- a/nextflow.config +++ b/nextflow.config @@ -60,6 +60,7 @@ params { // Contact maps bin_size = '1000000' + res_zoomify = '5000' ice_max_iter = 100 ice_filer_low_count_perc = 0.02 ice_filer_high_count_perc = 0 @@ -69,7 +70,7 @@ params { res_dist_decay = '250000' tads_caller = 'insulation' res_tads = '40000' - res_zoomify = '5000' + res_compartments = '250000' // Workflow skip_maps = false @@ -77,6 +78,7 @@ params { skip_balancing = false skip_mcool = false skip_dist_decay = false + skip_compartments = false skip_tads = false skip_multiqc = false -- GitLab