-
Notifications
You must be signed in to change notification settings - Fork 72
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 #259 from drpatelh/aspera
Add Aspera CLI download support to pipeline
- Loading branch information
Showing
20 changed files
with
293 additions
and
18 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
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,7 @@ | ||
name: aspera_cli | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::aspera-cli=4.14.0 |
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,63 @@ | ||
process ASPERA_CLI { | ||
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/aspera-cli:4.14.0--hdfd78af_1' : | ||
'biocontainers/aspera-cli:4.14.0--hdfd78af_1' }" | ||
|
||
input: | ||
tuple val(meta), val(fastq) | ||
val user | ||
|
||
output: | ||
tuple val(meta), path("*fastq.gz"), emit: fastq | ||
tuple val(meta), path("*md5") , emit: md5 | ||
path "versions.yml" , emit: versions | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
if (meta.single_end) { | ||
""" | ||
ascp \\ | ||
$args \\ | ||
-i \$CONDA_PREFIX/etc/aspera/aspera_bypass_dsa.pem \\ | ||
${user}@${fastq[0]} \\ | ||
${meta.id}.fastq.gz | ||
echo "${meta.md5_1} ${meta.id}.fastq.gz" > ${meta.id}.fastq.gz.md5 | ||
md5sum -c ${meta.id}.fastq.gz.md5 | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
aspera_cli: \$(ascli --version) | ||
END_VERSIONS | ||
""" | ||
} else { | ||
""" | ||
ascp \\ | ||
$args \\ | ||
-i \$CONDA_PREFIX/etc/aspera/aspera_bypass_dsa.pem \\ | ||
${user}@${fastq[0]} \\ | ||
${meta.id}_1.fastq.gz | ||
echo "${meta.md5_1} ${meta.id}_1.fastq.gz" > ${meta.id}_1.fastq.gz.md5 | ||
md5sum -c ${meta.id}_1.fastq.gz.md5 | ||
ascp \\ | ||
$args \\ | ||
-i \$CONDA_PREFIX/etc/aspera/aspera_bypass_dsa.pem \\ | ||
${user}@${fastq[1]} \\ | ||
${meta.id}_2.fastq.gz | ||
echo "${meta.md5_2} ${meta.id}_2.fastq.gz" > ${meta.id}_2.fastq.gz.md5 | ||
md5sum -c ${meta.id}_2.fastq.gz.md5 | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
aspera_cli: \$(ascli --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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
process { | ||
withName: 'ASPERA_CLI' { | ||
ext.args = '-QT -l 300m -P33001' | ||
publishDir = [ | ||
[ | ||
path: { "${params.outdir}/fastq" }, | ||
mode: params.publish_dir_mode, | ||
pattern: "*.fastq.gz" | ||
], | ||
[ | ||
path: { "${params.outdir}/fastq/md5" }, | ||
mode: params.publish_dir_mode, | ||
pattern: "*.md5" | ||
] | ||
] | ||
} | ||
} |
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,37 @@ | ||
nextflow_process { | ||
|
||
name "Test process: ASPERA_CLI" | ||
script "../main.nf" | ||
process "ASPERA_CLI" | ||
|
||
tag "ASPERA_CLI" | ||
|
||
test("Should run without failures") { | ||
|
||
when { | ||
params { | ||
outdir = "$outputDir" | ||
} | ||
|
||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'SRX9626017_SRR13191702', single_end:false, md5_1: '89c5be920021a035084d8aeb74f32df7', md5_2: '56271be38a80db78ef3bdfc5d9909b98' ], // meta map | ||
[ | ||
'fasp.sra.ebi.ac.uk:/vol1/fastq/SRR131/002/SRR13191702/SRR13191702_1.fastq.gz', | ||
'fasp.sra.ebi.ac.uk:/vol1/fastq/SRR131/002/SRR13191702/SRR13191702_2.fastq.gz' | ||
] | ||
] | ||
input[1] = 'era-fasp' | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
} |
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,71 @@ | ||
{ | ||
"Should run without failures": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz:md5,baaaea61cba4294ec696fdfea1610848", | ||
"SRX9626017_SRR13191702_2.fastq.gz:md5,8e43ad99049fabb6526a4b846da01c32" | ||
] | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz.md5:md5,055a6916ec9ee478e453d50651f87997", | ||
"SRX9626017_SRR13191702_2.fastq.gz.md5:md5,c30ac785f8d80ec563fabf604d8bf945" | ||
] | ||
] | ||
], | ||
"2": [ | ||
"versions.yml:md5,a51a1dfc6308d71058ddc12c46101dd3" | ||
], | ||
"fastq": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz:md5,baaaea61cba4294ec696fdfea1610848", | ||
"SRX9626017_SRR13191702_2.fastq.gz:md5,8e43ad99049fabb6526a4b846da01c32" | ||
] | ||
] | ||
], | ||
"md5": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz.md5:md5,055a6916ec9ee478e453d50651f87997", | ||
"SRX9626017_SRR13191702_2.fastq.gz.md5:md5,c30ac785f8d80ec563fabf604d8bf945" | ||
] | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,a51a1dfc6308d71058ddc12c46101dd3" | ||
] | ||
} | ||
], | ||
"timestamp": "2024-01-29T13:00:29.847293" | ||
} | ||
} |
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.