Skip to content

Commit

Permalink
Update kmcp modules (#3680)
Browse files Browse the repository at this point in the history
* Update kmcp profile

* Update kmcp modules

* Remove one line

* Update test.yml for kmcp/profile

* test.yml

* Fix linting

* Update to kmcp:0.9.3

* kmcp=0.9.3

* Version 0.9.1

* Update test.yml for kmcp/search

* Prettier

* Fix linting

* Update test.yml for kmcp/profile

* Update test.yml

* Test without stub

* Prettier

* Add stub to test.yml

* Test gzip in search

* Try to fix gzip

* Try to fix gzip

* Test gzip
  • Loading branch information
sofstam authored Aug 1, 2023
1 parent 5b116ec commit e198734
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 42 deletions.
9 changes: 5 additions & 4 deletions modules/nf-core/kmcp/profile/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ process KMCP_PROFILE {

input:
tuple val(meta), path(search_results)
path taxdump
path taxid
path (db)
val mode

output:
Expand All @@ -24,11 +23,13 @@ process KMCP_PROFILE {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
taxid=`find -L ${db} -name "*map"`
taxdump=`find -L ${db}/*/ -type d -not -name "R001"`
kmcp \\
profile \\
$args \\
-X $taxdump \\
-T $taxid \\
-X \$taxdump \\
-T \$taxid \\
-m $mode \\
-j $task.cpus \\
-o ${prefix}.profile \\
Expand Down
11 changes: 3 additions & 8 deletions modules/nf-core/kmcp/profile/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,13 @@ input:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- db:
type: directory
description: Database directory containing taxdump files and taxid file
- search_results:
type: file
description: Gzipped file output from kmcp search module
pattern: "*.gz"
- taxdump:
type: directory
description: Directory of NCBI taxonomy dump files - names.dmp, nodes.dmp
pattern: "*"
- taxid:
type: file
description: Tabular two-column file(s) mapping reference IDs to TaxIds.
pattern: "*.{csv,tsv}"
- mode:
type: integer
description: Profiling mode.
Expand Down
3 changes: 1 addition & 2 deletions modules/nf-core/kmcp/search/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ process KMCP_SEARCH {
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}
gzip ${prefix}
touch ${prefix}.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/kmcp/search/meta.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "kmcp_compute"
name: "kmcp_search"
description: Search sequences against database
keywords:
- metagenomics
Expand Down
8 changes: 8 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2045,10 +2045,18 @@ kmcp/index:
- modules/nf-core/kmcp/index/**
- tests/modules/nf-core/kmcp/index/**

kmcp/merge:
- modules/nf-core/kmcp/merge/**
- tests/modules/nf-core/kmcp/merge/**

kmcp/profile:
- modules/nf-core/kmcp/profile/**
- tests/modules/nf-core/kmcp/profile/**

kmcp/search:
- modules/nf-core/kmcp/search/**
- tests/modules/nf-core/kmcp/search/**

kofamscan:
- modules/nf-core/kofamscan/**
- tests/modules/nf-core/kofamscan/**
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/nf-core/kmcp/compute/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ workflow test_kmcp_compute_directory {

input = UNTAR ( [
[ id:'test' ],
file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/kmcp.tar.gz", checkIfExists: true)
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/kmcp/kmcp_profile.tar.gz", checkIfExists: true)
]).untar

KMCP_COMPUTE ( input )
Expand Down
3 changes: 1 addition & 2 deletions tests/modules/nf-core/kmcp/compute/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
- name: kmcp compute test_kmcp_compute
command: nextflow run ./tests/modules/nf-core/kmcp/compute -entry test_kmcp_compute -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/kmcp/compute/nextflow.config
tags:
- kmcp
- kmcp/compute
- kmcp
files:
- path: output/kmcp/test_/_info.txt
contains: ["#path name chunkIdx idxNum genomeSize kmers"]
Expand All @@ -27,5 +27,4 @@
- path: output/kmcp/test_/_info.txt
contains: ["#path name chunkIdx idxNum genomeSize kmers"]
- path: output/kmcp/test_/genome.fasta.unik
- path: output/kmcp/test_/transcriptome.fasta.unik
- path: output/kmcp/versions.yml
16 changes: 7 additions & 9 deletions tests/modules/nf-core/kmcp/profile/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,21 @@ include { KMCP_PROFILE } from '../../../../../modules/nf-core/kmcp/profile/main.

workflow test_kmcp_profile {

input_compute = [
[ id:'test', single_end:false ], // meta map
file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/kmcp/NC_045512.2.fasta', checkIfExists: true)
]
input_compute= UNTAR ( [
[ id:'test' ],
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/kmcp/kmcp_profile.tar.gz", checkIfExists: true)
]).untar


input = [
[ id:'test', single_end:true ], // meta map
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
]

taxdump = [ [],file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/kmcp/kmcp_profile.tar.gz', checkIfExists: true)]
ch_taxid = file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/kmcp/seqid2taxid.map', checkIfExists: true)
mode = 3

UNTAR (taxdump)
KMCP_COMPUTE ( input_compute )
KMCP_COMPUTE (input_compute )
KMCP_INDEX ( KMCP_COMPUTE.out.outdir )
KMCP_SEARCH ( KMCP_INDEX.out.kmcp.map{it[1]}, input )
KMCP_PROFILE ( KMCP_SEARCH.out.result, UNTAR.out.untar.map{ it[1] }, ch_taxid, mode )
KMCP_PROFILE ( KMCP_SEARCH.out.result, input_compute.map{ it[1] }, mode )
}
2 changes: 1 addition & 1 deletion tests/modules/nf-core/kmcp/profile/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

withName: KMCP_INDEX {
withName: KMCP_COMPUTE {
ext.prefix = { "${meta.id}_" }
}

Expand Down
8 changes: 4 additions & 4 deletions tests/modules/nf-core/kmcp/profile/test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
- name: kmcp profile test_kmcp_profile
command: nextflow run ./tests/modules/nf-core/kmcp/profile -entry test_kmcp_profile -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/kmcp/profile/nextflow.config
tags:
- kmcp/profile
- kmcp
- kmcp/profile
files:
- path: output/kmcp/test.profile
- path: output/untar/versions.yml
- path: output/kmcp/versions.yml

- name: kmcp profile test_kmcp_profile stub_run
command: nextflow run ./tests/modules/nf-core/kmcp/profile -entry test_kmcp_profile -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/kmcp/profile/nextflow.config -stub-run
tags:
- kmcp/profile
- kmcp
- kmcp/profile
files:
- path: output/kmcp/test.profile
- path: output/untar/versions.yml
- path: output/kmcp/versions.yml
4 changes: 0 additions & 4 deletions tests/modules/nf-core/kmcp/search/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ process {
ext.prefix = { "${meta.id}_" }
}

withName: KMCP_SEARCH {
ext.prefix = { "${meta.id}_" }
}

}
8 changes: 2 additions & 6 deletions tests/modules/nf-core/kmcp/search/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
- kmcp
- kmcp/search
files:
- path: output/kmcp/test_/R001/__db.yml
- path: output/kmcp/test_/R001/__name_mapping.tsv
- path: output/kmcp/test_/R001/_block001.uniki
- path: output/kmcp/test.gz
- path: output/kmcp/versions.yml

- name: kmcp search test_kmcp_search stub_run
Expand All @@ -15,7 +13,5 @@
- kmcp
- kmcp/search
files:
- path: output/kmcp/test_/R001/__db.yml
- path: output/kmcp/test_/R001/__name_mapping.tsv
- path: output/kmcp/test_/R001/_block001.uniki
- path: output/kmcp/test.gz
- path: output/kmcp/versions.yml

0 comments on commit e198734

Please sign in to comment.