-
Notifications
You must be signed in to change notification settings - Fork 81
Add Aspera CLI download support to pipeline #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a233dc0
Add Aspera CLI download support to pipeline
drpatelh f58c568
Fix ECLint
drpatelh 5f00ba8
Mix Aspera CLI output channel with FTP and sratools reads
drpatelh d538a2a
Fix ECLint
drpatelh eb8ce7e
Merge branch 'dev' into aspera
drpatelh acd2cfc
Merge branch 'dev' of https://github.com/nf-core/fetchngs into aspera
drpatelh 8885970
Update usage docs
drpatelh 1f42b05
Fix pre-commit lint
drpatelh 84c2066
Add comment for contents of meta.fastq_aspera
drpatelh e33eef4
Update usage docs for samples with more than 2 FastQ files
drpatelh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.