forked from LaurenceKuhl/nanoseq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nf-core#157 from ekushele/master
Output demultiplexed fast5 files
- Loading branch information
Showing
9 changed files
with
204 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
process DEMUX_FAST5 { | ||
label 'process_medium' | ||
publishDir "${params.outdir}", | ||
mode: params.publish_dir_mode, | ||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process)) } | ||
|
||
|
||
conda (params.enable_conda ? "bioconda:ont-fast5-api:4.0.0--pyhdfd78af_0" : null) | ||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { | ||
container "https://depot.galaxyproject.org/singularity/ont-fast5-api:4.0.0--pyhdfd78af_0" | ||
} else { | ||
container "quay.io/biocontainers/ont-fast5-api:4.0.0--pyhdfd78af_0" | ||
} | ||
|
||
input: | ||
path(input_path), stageAs: 'input_path/*' | ||
tuple val(meta), path(input_summary) | ||
|
||
output: | ||
path "demultiplexed_fast5/*" , emit: fast5 | ||
path "versions.yml" , emit: versions | ||
|
||
script: | ||
""" | ||
demux_fast5 \\ | ||
--input input_path \\ | ||
--save_path ./demultiplexed_fast5 \\ | ||
--summary_file $input_summary | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
demux_fast5: \$(echo \$(python -c\'import ont_fast5_api;print(ont_fast5_api.__version__)\')) | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,65 @@ | ||
process GUPPY { | ||
label 'process_medium' | ||
|
||
if (params.guppy_gpu) { | ||
container = 'genomicpariscentre/guppy-gpu:4.0.14' | ||
clusterOptions = params.gpu_cluster_options | ||
} else { | ||
container = 'genomicpariscentre/guppy:4.0.14' | ||
} | ||
|
||
input: | ||
path(input_path), stageAs: 'input_path/*' | ||
val meta | ||
path guppy_config | ||
path guppy_model | ||
|
||
output: | ||
path "fastq/*.fastq.gz" , emit: fastq | ||
tuple val(meta), path("basecalling/*.txt") , emit: summary | ||
path "basecalling/*" , emit: called | ||
path "versions.yml" , emit: versions | ||
|
||
script: | ||
def barcode_kit = params.barcode_kit ? "--barcode_kits $params.barcode_kit" : "" | ||
def barcode_ends = params.barcode_both_ends ? "--require_barcodes_both_ends" : "" | ||
def proc_options = params.guppy_gpu ? "--device $params.gpu_device --num_callers $task.cpus --cpu_threads_per_caller $params.guppy_cpu_threads --gpu_runners_per_device $params.guppy_gpu_runners" : "--num_callers 2 --cpu_threads_per_caller ${task.cpus/2}" | ||
def config = "--flowcell $params.flowcell --kit $params.kit" | ||
if (params.guppy_config) config = file(params.guppy_config).exists() ? "--config ./$guppy_config" : "--config $params.guppy_config" | ||
def model = "" | ||
if (params.guppy_model) model = file(params.guppy_model).exists() ? "--model ./$guppy_model" : "--model $params.guppy_model" | ||
""" | ||
guppy_basecaller \\ | ||
--input_path input_path \\ | ||
--save_path ./basecalling \\ | ||
--records_per_fastq 0 \\ | ||
--compress_fastq \\ | ||
$barcode_kit \\ | ||
$proc_options \\ | ||
$barcode_ends \\ | ||
$config \\ | ||
$model | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
guppy: \$(echo \$(guppy_basecaller --version 2>&1) | sed -r 's/.{81}//') | ||
END_VERSIONS | ||
## Concatenate fastq files | ||
mkdir fastq | ||
cd basecalling | ||
if [ "\$(find . -type d -name "barcode*" )" != "" ] | ||
then | ||
for dir in barcode*/ | ||
do | ||
dir=\${dir%*/} | ||
cat \$dir/*.fastq.gz > ../fastq/\$dir.fastq.gz | ||
done | ||
else | ||
cat *.fastq.gz > ../fastq/${meta.id}.fastq.gz | ||
fi | ||
""" | ||
label 'process_medium' | ||
|
||
if (params.guppy_gpu) { | ||
container = 'genomicpariscentre/guppy-gpu:5.0.16' | ||
clusterOptions = params.gpu_cluster_options | ||
} else { | ||
container = 'genomicpariscentre/guppy:5.0.16' | ||
} | ||
|
||
|
||
input: | ||
path(input_path), stageAs: 'input_path/*' | ||
val meta | ||
path guppy_config | ||
path guppy_model | ||
|
||
output: | ||
path "fastq/*.fastq.gz" , emit: fastq | ||
tuple val(meta), path("basecalling/*.txt") , emit: summary | ||
path "basecalling/*" , emit: called | ||
path "versions.yml" , emit: versions | ||
|
||
|
||
script: | ||
def trim_barcodes = params.trim_barcodes ? "--trim_barcodes" : "" | ||
def barcode_kit = params.barcode_kit ? "--barcode_kits $params.barcode_kit" : "" | ||
def barcode_ends = params.barcode_both_ends ? "--require_barcodes_both_ends" : "" | ||
def proc_options = params.guppy_gpu ? "--device $params.gpu_device --num_callers $task.cpus --cpu_threads_per_caller $params.guppy_cpu_threads --gpu_runners_per_device $params.guppy_gpu_runners" : "--num_callers 2 --cpu_threads_per_caller ${task.cpus/2}" | ||
def config = "--flowcell $params.flowcell --kit $params.kit" | ||
if (params.guppy_config) config = file(params.guppy_config).exists() ? "--config ./$guppy_config" : "--config $params.guppy_config" | ||
def model = "" | ||
if (params.guppy_model) model = file(params.guppy_model).exists() ? "--model ./$guppy_model" : "--model $params.guppy_model" | ||
""" | ||
guppy_basecaller \\ | ||
--input_path input_path \\ | ||
--save_path ./basecalling \\ | ||
--records_per_fastq 0 \\ | ||
--compress_fastq \\ | ||
$barcode_kit \\ | ||
$proc_options \\ | ||
$barcode_ends \\ | ||
$config \\ | ||
$model | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
guppy: \$(echo \$(guppy_basecaller --version 2>&1) | sed -r 's/.{81}//') | ||
END_VERSIONS | ||
## Concatenate fastq files | ||
mkdir fastq | ||
cd basecalling | ||
if [ "\$(find . -type d -name "barcode*" )" != "" ] | ||
then | ||
for dir in pass/barcode*/ | ||
do | ||
dir=\$(basename \${dir%*/}) | ||
cat pass/\$dir/*.fastq.gz > ../fastq/\$dir.fastq.gz | ||
done | ||
else | ||
cat *.fastq.gz > ../fastq/${meta.id}.fastq.gz | ||
fi | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.