Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# gunzip_fqgz_process

The nextflow wrapper for the `gunzip` process.

https://github.com/nextflow-hub/trimmed_gunzip_fqgz
24 changes: 20 additions & 4 deletions main.nf
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
#!/usr/bin/env nextflow



/*
################
params
################
*/
//NOTE: default parameter
params.trimmed=true


/*
################
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 }
Expand All @@ -22,7 +37,6 @@ gzip these files


process gzip {
echo true
container 'abhi18av/biodragao_base'
publishDir 'results/gzip'

Expand All @@ -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}
Expand Down