diff --git a/main.nf b/main.nf
index d5c43a2971ee0fce1e29aa9b7b5b186d116ffd12..ef103355badbe45ac707c83d7b4b12a08f3a3f87 100644
--- a/main.nf
+++ b/main.nf
@@ -153,11 +153,18 @@ if (params.input_paths){
    raw_reads = Channel.create()
    raw_reads_2 = Channel.create()
 
-   Channel
-      .from( params.input_paths )
-      .map { row -> [ row[0], [file(row[1][0]), file(row[1][1])]] }
-      .separate( raw_reads, raw_reads_2 ) { a -> [tuple(a[0], a[1][0]), tuple(a[0], a[1][1])] }
-
+   if ( params.split_fastq ){
+      Channel
+         .from( params.input_paths )
+         .map { row -> [ row[0], [file(row[1][0]), file(row[1][1])]] }
+	 .splitFastq( by: params.fastq_chunks_size, pe:true, file: true, compress:true)
+         .separate( raw_reads, raw_reads_2 ) { a -> [tuple(a[0], a[1]), tuple(a[0], a[1])] }
+   }else{
+     Channel
+        .from( params.input_paths )
+	.map { row -> [ row[0], [file(row[1][0]), file(row[1][1])]] }
+	.separate( raw_reads, raw_reads_2 ) { a -> [tuple(a[0] + "_R1", a[1][0]), tuple(a[0] + "_R2", a[1][1])] }
+   }
 }else{
    raw_reads = Channel.create()
    raw_reads_2 = Channel.create()