diff --git a/conf/modules.config b/conf/modules.config index c289ffbf9f52ebf1230baa4f7fb87b25e81eb9bd..aea9de9d1126a755a9d41c8036344afc3175b69f 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -174,6 +174,108 @@ process { ] } + //******************************************* + // HICSTUFF + withName: 'BOWTIE2_ALIGNMENT' { + ext.prefix = { "${meta.id}_${meta.chunk}_${meta.mates}" } + ext.args = params.hicstuff_bwt2_align_opts + publishDir = [ + path: { "${params.outdir}/hicstuff/reads"}, + mode: 'copy' + ] + } + + withName: 'FRAGMENT_ENZYME' { + ext.args = { [ + " -m ${params.hicstuff_min_size}", + " -c ${params.hicstuff_circular}", + " -o ${params.hicstuff_output_contigs}", + " -f ${params.hicstuff_output_frags}", + " -p ${params.hicstuff_frags_plot}", + " -g ${params.hicstuff_frags_plot_path}" + ].join('').trim() } + publishDir = [ + path: { "${params.outdir}/hicstuff/fragment_enzyme" }, + mode: 'copy' + ] + } + + withName: 'BAM2PAIRS' { + ext.pairs = params.hicstuff_valid_pairs + ext.index = params.hicstuff_valid_idx + ext.args = { [ + " -q ${params.hicstuff_min_qual}", + " -c ${params.hicstuff_circular}" + ].join('').trim() } + publishDir = [ + path: { "${params.outdir}/hicstuff/pairs" }, + mode: 'copy' + ] + } + + withName: 'FILTER_EVENT' { + ext.args = { [ + " -o ${params.hicstuff_valid_idx_filtered}", + " --plot ${params.hicstuff_plot_events}", + " -d ${params.hicstuff_dist_plot}", + " -q ${params.hicstuff_pie_plot}" + ].join('').trim() } + publishDir = [ + path: { "${params.outdir}/hicstuff/pairs" }, + mode: 'copy' + ] + } + + withName: 'DISTANCE_LAW' { + ext.args = { [ + " -c ${params.hicstuff_centro_file}", + " -b ${params.hicstuff_base}", + " -o ${params.hicstuff_distance_out_file}", + " -u ${params.hicstuff_circular}", + " -r ${params.hicstuff_rm_centro}", + " -l ${params.hicstuff_distance_plot}", + " -d ${params.hicstuff_distance_out_plot}" + ].join('').trim() } + publishDir = [ + path: { "${params.outdir}/hicstuff/pairs" }, + mode: 'copy' + ] + } + + withName: 'FILTER_PCR' { + ext.args = { [ + "-o ${params.hicstuff_filter_pcr_out_file}" + ].join('').trim() } + publishDir = [ + path: { "${params.outdir}/hicstuff/pairs" }, + mode: 'copy' + ] + } + + withName: 'BUILD_MATRIX' { + ext.args = params.hicstuff_matrix + publishDir = [ + path: { "${params.outdir}/hicstuff/matrix" }, + mode: 'copy' + ] + } + withName: 'BUILD_MATRIX_COOL' { + ext.args = params.hicstuff_matrix + publishDir = [ + path: { "${params.outdir}/hicstuff/matrix" }, + mode: 'copy' + ] + } + withName: 'BUILD_MATRIX_COOL_ALT' { + ext.outname = params.hicstuff_matrix + ext.bin = params.hicstuff_bin + ext.args = {"-c1 2 -p1 3 -p2 4 -c2 5"} + publishDir = [ + path: { "${params.outdir}/hicstuff/matrix" }, + mode: 'copy' + ] + } + //***************************************** // QUALITY METRICS diff --git a/nextflow.config b/nextflow.config index 8a5267e1091e54798010dcab7b6565e9e46464c8..cbdcd5c86049cce6b56174a3927ba4e63d0d5c62 100644 --- a/nextflow.config +++ b/nextflow.config @@ -9,6 +9,9 @@ // Global default params, used in configs params { + // Choice of the workflow ('hicpro' or 'hicstuff') + workflow = 'hicstuff' + // Input options input = null @@ -128,6 +131,36 @@ params { max_cpus = 16 max_time = '240.h' + // Hicstuff + hicstuff_bwt2_align_opts = '--very-sensitive-local' + hicstuff_min_size = 0 + hicstuff_circular = 'false' + hicstuff_output_contigs = 'info_contigs.txt' + hicstuff_output_frags = 'fragments_list.txt' + hicstuff_frags_plot = 'false' + hicstuff_frags_plot_path = 'frags_hist.pdf' + hicstuff_valid_pairs = 'valid.pairs' + hicstuff_valid_idx = 'valid_idx.pairs' + hicstuff_min_qual = 30 + hicstuff_matrix = 'abs_fragments_contacts_weighted.txt' + hicstuff_bin = 10000 + hicstuff_valid_idx_filtered = 'valid_idx_filtered.pairs' + hicstuff_plot_events = 'false' + hicstuff_pie_plot = 'distrib' + hicstuff_dist_plot = 'dist' + hicstuff_centro_file = 'None' //give absolute path or 'None' + hicstuff_base = 1.1 + hicstuff_distance_out_file = 'distance_law.txt' + hicstuff_rm_centro = 'None' //int or 'None' + hicstuff_distance_plot = 'false' + hicstuff_distance_out_plot = 'plot_distance_law.pdf' + hicstuff_filter_pcr_out_file = 'valid_idx_pcrfree.pairs' + + //Hicstuff optional modules + filter_event = false + distance_law = false + filter_pcr = false + } // Load base.config by default for all pipelines