diff --git a/README.md b/README.md new file mode 100644 index 0000000..b80fde6 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# gunzip_fqgz_process + +The nextflow wrapper for the `gunzip` process. + +https://github.com/nextflow-hub/trimmed_gunzip_fqgz \ No newline at end of file diff --git a/main.nf b/main.nf index 14521ce..4c543d4 100644 --- a/main.nf +++ b/main.nf @@ -1,6 +1,16 @@ #!/usr/bin/env nextflow + +/* +################ +params +################ +*/ +//NOTE: default parameter +params.trimmed=true + + /* ################ NEXTFLOW Global Config @@ -8,7 +18,12 @@ NEXTFLOW Global Config */ -inputRawFilePattern = "./*_{R1,R2}.p.fastq.gz" +inputUntrimmedRawFilePattern = "./*_{R1,R2}.fastq.gz" + +//NOTE: This pipeline is starts with `trimmed` because of the `p` in the file pattern. +inputTrimmedRawFilePattern = "./*_{R1,R2}.p.fastq.gz" + +inputRawFilePattern = params.trimmed ? inputTrimmedRawFilePattern : inputUntrimmedRawFilePattern Channel.fromFilePairs(inputRawFilePattern, flat: true) .into { ch_in_gzip } @@ -22,7 +37,6 @@ gzip these files process gzip { - echo true container 'abhi18av/biodragao_base' publishDir 'results/gzip' @@ -33,10 +47,12 @@ process gzip { tuple path(genome_1_fq), path(genome_2_fq) into ch_out_gzip script: + outputExtension = params.trimmed ? '.p.fastq' : '.fastq' + // rename the output files // G04880_R1.p.fastq.gz > G04880_R1.p.fastq - genome_1_fq = read_1_gz.name.split("\\.")[0] + '.p.fastq' - genome_2_fq = read_2_gz.name.split("\\.")[0] + '.p.fastq' + genome_1_fq = read_1_gz.name.split("\\.")[0] + outputExtension + genome_2_fq = read_2_gz.name.split("\\.")[0] + outputExtension """ gzip -dc ${read_1_gz} > ${genome_1_fq}