diff --git a/bin/hicstuff_fragments.py b/bin/hicstuff_fragments.py
index c49378e003737b757eb547239adba97b80b59359..489945dd01948e200fc6b2ca48e4beafeee5b86f 100755
--- a/bin/hicstuff_fragments.py
+++ b/bin/hicstuff_fragments.py
@@ -7,10 +7,22 @@ if __name__ == "__main__":
     parser = argparse.ArgumentParser()
     parser.add_argument("-e", "--enzyme")
     parser.add_argument("-i", "--index")
+    parser.add_argument("-m", "--min_size")
+    parser.add_argument("-c", "--circular")
+    parser.add_argument("-o", "--output_contigs")
+    parser.add_argument("-f", "--output_frags")
+    parser.add_argument("-p", "--plot")
+    parser.add_argument("-g", "--fig_path")
     args = parser.parse_args()
 
     enzyme = args.enzyme
     index = args.index
+    min_size = args.min_size
+    circular = args.circular
+    output_contigs = args.output_contigs
+    output_frags = args.output_frags
+    plot = args.plot
+    fig_path = args.fig_path
 
 
     #hicstuff case sensitive enzymes adaptation
@@ -30,11 +42,11 @@ if __name__ == "__main__":
     hcd.write_frag_info(
         index,
         enzyme,
-        min_size=0,
-        circular=False,
-        output_contigs="info_contigs.txt",
-        output_frags="fragments_list.txt",
+        min_size,
+        circular,
+        output_contigs,
+        output_frags
     )
 
     # Log fragment size distribution
-    hcd.frag_len(frags_file_name="fragments_list.txt", plot=False, fig_path="frags_hist.pdf")
+    hcd.frag_len(output_frags, plot=plot, fig_path=fig_path)
diff --git a/conf/hicstuff.config b/conf/hicstuff.config
index 6b1178ac5d43c08629b9a6b4a911211125f2505d..578ded82a3de77260349b34fc62b65b4f1f41039 100644
--- a/conf/hicstuff.config
+++ b/conf/hicstuff.config
@@ -1,64 +1,3 @@
-process {
-    //Default
-    publishDir = [
-        path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
-        mode: 'copy',
-        saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
-    ]
-
-    withName: 'BOWTIE2_ALIGNMENT' {
-        ext.prefix = { "${meta.id}_${meta.chunk}_${meta.mates}" }
-        publishDir = [
-            path: { "${params.outdir}/hicstuff/reads"},
-            mode: 'copy'
-        ]
-    }
-
-    withName: 'FRAGMENT_ENZYME' {
-        publishDir = [
-            path: { "${params.outdir}/hicstuff/fragment_enzyme" },
-            mode: 'copy'
-        ]
-    }
-
-    withName: 'BAM2PAIRS' {
-        publishDir = [
-            path: { "${params.outdir}/hicstuff/pairs" },
-            mode: 'copy'
-        ]
-    }
-    withName: 'BUILD_MATRIX' {
-        publishDir = [
-            path: { "${params.outdir}/hicstuff/matrix" },
-            mode: 'copy'
-        ]
-    }
-
-    //**********************************************
-    // PREPARE_GENOME
-    withName: 'BOWTIE2_BUILD' {
-        publishDir = [
-            path: { "${params.outdir}/genome/bowtie2_index" },
-            mode: 'copy'
-        ]
-    }
-
-    withName: 'CUSTOM_GETCHROMSIZES' {
-        publishDir = [
-            path: { "${params.outdir}/genome" },
-            mode: 'copy'
-        ]
-    }
-
-    withName: 'GET_RESTRICTION_FRAGMENTS' {
-        publishDir = [
-            path: { "${params.outdir}/genome" },
-            mode: 'copy'
-        ]
-    }
-
-}
-
 params {
 
     // Input options
@@ -179,7 +118,86 @@ 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'
 }
+
+process {
+    //Default
+    publishDir = [
+        path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
+        mode: 'copy',
+        saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
+    ]
+
+    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' {
+        publishDir = [
+            path: { "${params.outdir}/hicstuff/pairs" },
+            mode: 'copy'
+        ]
+    }
+    withName: 'BUILD_MATRIX' {
+        publishDir = [
+            path: { "${params.outdir}/hicstuff/matrix" },
+            mode: 'copy'
+        ]
+    }
+
+    //**********************************************
+    // PREPARE_GENOME
+    withName: 'BOWTIE2_BUILD' {
+        publishDir = [
+            path: { "${params.outdir}/genome/bowtie2_index" },
+            mode: 'copy'
+        ]
+    }
+
+    withName: 'CUSTOM_GETCHROMSIZES' {
+        publishDir = [
+            path: { "${params.outdir}/genome" },
+            mode: 'copy'
+        ]
+    }
+
+    withName: 'GET_RESTRICTION_FRAGMENTS' {
+        publishDir = [
+            path: { "${params.outdir}/genome" },
+            mode: 'copy'
+        ]
+    }
+
+}
+
 profiles {
     debug { process.beforeScript = 'echo $HOSTNAME' }
     conda {
diff --git a/modules/local/hicstuff/align_bowtie2.nf b/modules/local/hicstuff/align_bowtie2.nf
index a3f2f1c237d0c66d5a46cf13900c7193176cf12a..188836d9ff6cf3affda23287355eb390896c22ec 100644
--- a/modules/local/hicstuff/align_bowtie2.nf
+++ b/modules/local/hicstuff/align_bowtie2.nf
@@ -16,13 +16,14 @@ process BOWTIE2_ALIGNMENT {
 
     script:
     def prefix = task.ext.prefix ?: "${meta.id}"
+    def args = task.ext.args ?: ''
 
     """
     INDEX=`find -L ./ -name "*.rev.1.bt2" | sed "s/\\.rev.1.bt2\$//"`
     [ -z "\$INDEX" ] && INDEX=`find -L ./ -name "*.rev.1.bt2l" | sed "s/\\.rev.1.bt2l\$//"`
     [ -z "\$INDEX" ] && echo "Bowtie2 index files not found" 1>&2 && exit 1
 
-    bowtie2 --very-sensitive-local -p $task.cpus -x \$INDEX -U $reads > ${prefix}.tmp
+    bowtie2 $args -p $task.cpus -x \$INDEX -U $reads > ${prefix}.tmp
 
     samtools view -F 2048 -h -@ $task.cpus ${prefix}.tmp | samtools sort -n -@ $task.cpus -o ${prefix}.bam -
     """
diff --git a/modules/local/hicstuff/fragment_enzyme.nf b/modules/local/hicstuff/fragment_enzyme.nf
index dafa3cff0746777d7eeece1d43a7f33415844599..d17fdfee3e6411555584309b0c6daee14e823c7e 100644
--- a/modules/local/hicstuff/fragment_enzyme.nf
+++ b/modules/local/hicstuff/fragment_enzyme.nf
@@ -10,12 +10,15 @@ process FRAGMENT_ENZYME {
     tuple val(meta), path(fasta)
 
     output:
-    tuple val(meta), path("info_contigs.txt") , emit: info_contigs
-    tuple val(meta), path("fragments_list.txt"), emit: fragments_list
+    tuple val(meta), path(params.hicstuff_output_contigs) , emit: info_contigs
+    tuple val(meta), path(params.hicstuff_output_frags), emit: fragments_list
 
     script:
+
+    def args = task.ext.args ?: ''
+
     """
-    hicstuff_fragments.py -e ${digestion} -i ${fasta}
+    hicstuff_fragments.py -e ${digestion} -i ${fasta} ${args}
     """
 
 }