diff --git a/modules/filter_fastq_by_length.nf b/modules/filter_fastq_by_length.nf index c4d097d..145b93b 100644 --- a/modules/filter_fastq_by_length.nf +++ b/modules/filter_fastq_by_length.nf @@ -13,8 +13,8 @@ process filter_fastq_by_length { awk -F"\\t" 'length(\$2) <= 1500' | sed 's/\\t/\\n/g' | gzip > "${name}_filtered.fastq.gz" ;; *.fastq) - cat ${reads} | paste - - - - | awk -F"\\t" 'length(\$2) >= 1000' | sed 's/\\t/\\n/g' |\ - awk -F"\\t" 'length(\$2) <= 1300' | sed 's/\\t/\\n/g' | gzip > "${name}_filtered.fastq.gz" + cat ${reads} | paste - - - - | awk -F"\\t" 'length(\$2) >= 250' | sed 's/\\t/\\n/g' |\ + awk -F"\\t" 'length(\$2) <= 1500' | sed 's/\\t/\\n/g' | gzip > "${name}_filtered.fastq.gz" ;; esac diff --git a/modules/guppy.nf b/modules/guppy.nf index 31e6cf9..3902f4c 100644 --- a/modules/guppy.nf +++ b/modules/guppy.nf @@ -20,7 +20,7 @@ process guppy_gpu { mkdir -p fastq_tmp/ cp fastq/*.txt fastq_tmp """ - else if (!params.single) + if (!params.single && !params.one_end) """ guppy_basecaller -c dna_r9.4.1_450bps_hac.cfg -i ${dir} -s fastq_tmp -x auto -r guppy_barcoder --require_barcodes_both_ends -i fastq_tmp -s fastq --arrangements_files "barcode_arrs_nb12.cfg barcode_arrs_nb24.cfg" @@ -29,6 +29,17 @@ process guppy_gpu { find -L \${barcodes} -name '*.fastq' -exec cat {} + | gzip > \${barcodes##*/}.fastq.gz done + cp fastq/*.txt fastq_tmp + """ + else if (!params.single && params.one_end) + """ + guppy_basecaller -c dna_r9.4.1_450bps_hac.cfg -i ${dir} -s fastq_tmp -x auto -r + guppy_barcoder -i fastq_tmp -s fastq --arrangements_files "barcode_arrs_nb12.cfg barcode_arrs_nb24.cfg" + + for barcodes in fastq/barcode??; do + find -L \${barcodes} -name '*.fastq' -exec cat {} + | gzip > \${barcodes##*/}.fastq.gz + done + cp fastq/*.txt fastq_tmp """ } diff --git a/nextflow.config b/nextflow.config index 46f035c..95d0cd4 100644 --- a/nextflow.config +++ b/nextflow.config @@ -24,6 +24,7 @@ params { localguppy = false buildDB = false cloudProcess = false + one_end = false // parameters primerV = 'V3' diff --git a/poreCov.nf b/poreCov.nf index e95c564..926bc12 100755 --- a/poreCov.nf +++ b/poreCov.nf @@ -308,6 +308,8 @@ def helpMSG() { ${c_yellow}Parameters - Basecalling${c_reset} --localguppy use a native guppy installation instead of a gpu-guppy-docker native guppy installation is used by default for singularity or conda + --one_end removes the recommended "--require_barcodes_both_ends" from guppy demultiplexing + try this if to many barcodes are unclassified (check the pycoQC report) ${c_yellow}Parameters - nCov genome reconstruction${c_reset} --primerV artic-ncov2019 primer_schemes [default: ${params.primerV}] @@ -363,6 +365,7 @@ def defaultMSG(){ $params.output\u001B[0m Primerscheme: $params.primerV + Barcodes on one end enough?: $params.one_end CPUs to use: $params.cores Memory in GB: $params.memory @@ -370,13 +373,11 @@ def defaultMSG(){ """.stripIndent() } - - def v1200_MSG() { log.info """ 1200 bp options are used as primer scheme (V1200) - --minLength set to 1000bp - --maxLength set to 1300bp + --minLength set to 250bp + --maxLength set to 1500bp \u001B[1;30m______________________________________\033[0m """.stripIndent() } \ No newline at end of file