-
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 remote-tracking branch 'origin/main' into gitpod_edits
- Loading branch information
Showing
21 changed files
with
639 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ERR2537811,s3://pollen-metabarcoding-test-data/data/ERR2537811_1.fastq.gz,s3://pollen-metabarcoding-test-data/data/ERR2537811_2.fastq.gz | ||
ERR2537812,s3://pollen-metabarcoding-test-data/data/ERR2537812_1.fastq.gz,s3://pollen-metabarcoding-test-data/data/ERR2537812_2.fastq.gz | ||
ERR2537813,s3://pollen-metabarcoding-test-data/data/ERR2537813_1.fastq.gz,s3://pollen-metabarcoding-test-data/data/ERR2537813_2.fastq.gz | ||
ERR2537816,ERR2537816 | ||
ERR2537814,ERR2537814 |
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,8 @@ | ||
name: sratools_fasterqdump | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::sra-tools=3.0.8 | ||
- conda-forge::pigz=2.6 |
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,58 @@ | ||
process SRATOOLS_FASTERQDUMP { | ||
tag "$meta.id" | ||
label 'process_medium' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/mulled-v2-5f89fe0cd045cb1d615630b9261a1d17943a9b6a:2f4a4c900edd6801ff0068c2b3048b4459d119eb-0' : | ||
'biocontainers/mulled-v2-5f89fe0cd045cb1d615630b9261a1d17943a9b6a:2f4a4c900edd6801ff0068c2b3048b4459d119eb-0' }" | ||
|
||
input: | ||
tuple val(meta), path(sra) | ||
path ncbi_settings | ||
path certificate | ||
|
||
output: | ||
tuple val(meta), path('*.fastq.gz'), emit: reads | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def args2 = task.ext.args2 ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
def outfile = meta.single_end ? "${prefix}.fastq" : prefix | ||
def key_file = '' | ||
if (certificate.toString().endsWith('.jwt')) { | ||
key_file += " --perm ${certificate}" | ||
} else if (certificate.toString().endsWith('.ngc')) { | ||
key_file += " --ngc ${certificate}" | ||
} | ||
//HAD TO ADD SH SHEBANG TO ENSURE IT WAS INTERPRETED BY RIGHT SHELL, OTHERWISE FAILS WITH "bash not found" ERROR | ||
//HAD TO CHANGE ${outfile} TO "${outfile}.fastq" TO STOP AN ERROR WHEN WRITING TO THE SAME PLACE AS INPUT FILE | ||
""" | ||
#!/bin/sh | ||
export NCBI_SETTINGS="\$PWD/${ncbi_settings}" | ||
fasterq-dump \\ | ||
$args \\ | ||
--threads $task.cpus \\ | ||
--outfile "${outfile}.fastq" \\ | ||
${key_file} \\ | ||
${sra} | ||
pigz \\ | ||
$args2 \\ | ||
--no-name \\ | ||
--processes $task.cpus \\ | ||
*.fastq | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
sratools: \$(fasterq-dump --version 2>&1 | grep -Eo '[0-9.]+') | ||
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) | ||
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: sratools_fasterqdump | ||
description: Extract sequencing reads in FASTQ format from a given NCBI Sequence Read Archive (SRA). | ||
keywords: | ||
- sequencing | ||
- FASTQ | ||
- dump | ||
tools: | ||
- sratools: | ||
description: SRA Toolkit and SDK from NCBI | ||
homepage: https://github.com/ncbi/sra-tools | ||
documentation: https://github.com/ncbi/sra-tools/wiki | ||
tool_dev_url: https://github.com/ncbi/sra-tools | ||
licence: ["Public Domain"] | ||
input: | ||
- meta: | ||
type: map | ||
description: > | ||
Groovy Map containing sample information e.g. [ id:'test', single_end:false ] | ||
- sra: | ||
type: directory | ||
description: Directory containing ETL data for the given SRA. | ||
pattern: "*/*.sra" | ||
- ncbi_settings: | ||
type: file | ||
description: > | ||
An NCBI user settings file. | ||
pattern: "*.mkfg" | ||
- certificate: | ||
type: file | ||
description: > | ||
Path to a JWT cart file used to access protected dbGAP data on SRA using the sra-toolkit | ||
pattern: "*.cart" | ||
output: | ||
- meta: | ||
type: map | ||
description: > | ||
Groovy Map containing sample information e.g. [ id:'test', single_end:false ] | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- reads: | ||
type: file | ||
description: Extracted FASTQ file or files if the sequencing reads are paired-end. | ||
pattern: "*.fastq.gz" | ||
authors: | ||
- "@Midnighter" | ||
maintainers: | ||
- "@Midnighter" |
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,73 @@ | ||
nextflow_process { | ||
name "Test Process SRATOOLS_FASTERQDUMP" | ||
script "../main.nf" | ||
config "./nextflow.config" | ||
process "SRATOOLS_FASTERQDUMP" | ||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "untar" | ||
tag "sratools" | ||
tag "sratools/fasterqdump" | ||
|
||
test("Single-end") { | ||
|
||
setup { | ||
run("UNTAR") { | ||
script "modules/nf-core/untar/main.nf" | ||
process { | ||
""" | ||
input[0] = Channel.of([ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/sra/SRR13255544.tar.gz', checkIfExists: true) ]) | ||
""" | ||
} | ||
} | ||
} | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = UNTAR.out.untar.map{ meta, files -> [ [ id:'test_single_end', single_end:true ], files]} | ||
input[1] = file(params.modules_testdata_base_path + 'generic/config/ncbi_user_settings.mkfg', checkIfExists: true) | ||
input[2] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test("Paired-end") { | ||
|
||
setup { | ||
run("UNTAR") { | ||
script "modules/nf-core/untar/main.nf" | ||
process { | ||
""" | ||
input[0] = Channel.of([ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/sra/SRR11140744.tar.gz', checkIfExists: true) ]) | ||
""" | ||
} | ||
} | ||
} | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = UNTAR.out.untar.map{ meta, files -> [ [ id:'test_paired_end', single_end:false ], files]} | ||
input[1] = file(params.modules_testdata_base_path + 'generic/config/ncbi_user_settings.mkfg', checkIfExists: true) | ||
input[2] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.