-
Notifications
You must be signed in to change notification settings - Fork 967
Feature/localcdsearch #9632
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
Feature/localcdsearch #9632
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
b3954d5
local-cd-search annotate and download modules
Ales-ibt 895b307
Fixing lint
Ales-ibt acd1f00
Merge branch 'master' into feature/localcdsearch
Ales-ibt c344319
Update localcdsearch tool metadata in meta.yml
Ales-ibt 8b108c0
Fix container URL selection logic in main.nf
Ales-ibt 2ea6819
Fix container URL for local-cd-search
Ales-ibt 3bb7e77
Fix container URL for local-cd-search
Ales-ibt a62d497
Fix container URL for local-cd-search
Ales-ibt 9c89f90
Fix container URL for local-cd-search
Ales-ibt e4e0752
Fix container URL for local-cd-search
Ales-ibt a8e7d5c
Update modules/nf-core/localcdsearch/annotate/main.nf
Ales-ibt b7c1b43
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt cd88e7f
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt 68fd0c8
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt 6fe433a
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt b2a2fd9
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt 979823f
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt 6366acd
Update modules/nf-core/localcdsearch/download/meta.yml
Ales-ibt 59e6941
Update modules/nf-core/localcdsearch/download/meta.yml
Ales-ibt 3bee222
Update modules/nf-core/localcdsearch/download/meta.yml
Ales-ibt 822536c
Singularity container added
Ales-ibt 289b1af
edamontology added
Ales-ibt 448a4ea
Updating test for one input only
Ales-ibt 5426030
Updating snap
Ales-ibt 86024dc
Updating test for db downloding
Ales-ibt c953ca8
Merge branch 'master' into feature/localcdsearch
Ales-ibt 301780d
Merge branch 'master' into feature/localcdsearch
Ales-ibt b9a6632
Merge branch 'master' into feature/localcdsearch
Ales-ibt 2c803fd
Update version handling in main.nf
Ales-ibt 2c329bb
Update version expression in meta.yml
Ales-ibt bf16933
Refactor version handling in main.nf
Ales-ibt 8a6184a
Update version retrieval expression in meta.yml
Ales-ibt 64d0174
Add version information to stub
Ales-ibt 2e368d7
Add version information to stub
Ales-ibt 84f955a
Merge branch 'master' into feature/localcdsearch
Ales-ibt a75edc7
Update modules/nf-core/localcdsearch/download/meta.yml
Ales-ibt dd7c915
Refactor assertions to include process success check
Ales-ibt ede89e2
Refactor assertions for process success in tests
Ales-ibt 6a5bb84
Merge branch 'master' into feature/localcdsearch
Ales-ibt bf7db4d
Update container URL for local-cd-search
Ales-ibt 0d9b181
Remove redundant success assertion in tests
Ales-ibt 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - "bioconda::local-cd-search=0.3.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,53 @@ | ||
| process LOCALCDSEARCH_ANNOTATE { | ||
| tag "$meta.id" | ||
| label 'process_medium' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
| 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/e1/e1ed921c933d8eeeb0db6d72ece09ec25edab9ad441c84b070acff1592af2d54/data' : | ||
| 'biocontainers/local-cd-search:0.3.0--pyhdfd78af_0' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(fasta) | ||
| path db | ||
| val sites | ||
|
|
||
| output: | ||
| tuple val(meta), path("*_results.tsv"), emit: result | ||
| tuple val(meta), path("*_sites.tsv") , emit: annot_sites, optional: true | ||
| tuple val("${task.process}"), val('local-cd-search'), eval("echo ${VERSION}"), topic: versions, emit: versions_localcdsearch | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| VERSION = '0.3.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def val_flag = sites ? "--sites-output ${prefix}_sites.tsv" : '' | ||
| def is_compressed = fasta.getExtension() == "gz" | ||
| def fasta_name = is_compressed ? fasta.getBaseName() : fasta | ||
| def uncompress_input = is_compressed ? "gzip -c -d ${fasta} > ${fasta_name}" : '' | ||
| """ | ||
| $uncompress_input | ||
|
|
||
| local-cd-search \\ | ||
| annotate \\ | ||
| $args \\ | ||
| $val_flag \\ | ||
| --threads $task.cpus \\ | ||
| ${fasta_name} \\ | ||
| ${prefix}_results.tsv \\ | ||
| ${db} | ||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| VERSION = '0.3.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| echo $args | ||
| touch ${prefix}_results.tsv | ||
| ${sites ? "touch ${prefix}_sites.tsv" : ''} | ||
| """ | ||
| } |
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,89 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
| name: "localcdsearch_annotate" | ||
| description: A command-line tool for local protein domain annotation using NCBI's Conserved Domain Database (CDD) | ||
| keywords: | ||
| - cdd | ||
| - rpsblast | ||
| - rpsbproc | ||
| - protein | ||
| - domain | ||
| - annotation | ||
| tools: | ||
| - "localcdsearch": | ||
| description: "Protein annotation using local PSSM databases from CDD." | ||
| homepage: "https://github.com/apcamargo/local-cd-search" | ||
| documentation: "https://github.com/apcamargo/local-cd-search" | ||
| tool_dev_url: "https://github.com/apcamargo/local-cd-search" | ||
| licence: ["MIT"] | ||
| identifier: "" | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - fasta: | ||
| type: file | ||
| description: Input fasta file containing protein queries sequences | ||
| pattern: "*.{fa,fasta,fa.gz,fasta.gz}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_1929" # FASTA | ||
| - db: | ||
| type: directory | ||
| description: Directory containing the metadata and databse directories | ||
| pattern: "*" | ||
| - sites: | ||
| type: boolean | ||
| description: When true an extra tsv output file is generated | ||
|
|
||
| output: | ||
| result: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*_results.tsv": | ||
| type: file | ||
| description: tab-separated file with hits filtered by CDD's curated bit-score thresholds | ||
| pattern: "*_results.tsv" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3475 # TSV | ||
| annot_sites: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*_sites.tsv": | ||
| type: file | ||
| description: If --sites-output is specified, an additional tab-separated file is created with functional site annotations | ||
| pattern: "*_sites.tsv" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3475 # TSV | ||
| versions_localcdsearch: | ||
| - - "${task.process}": | ||
| type: string | ||
| description: The name of the process | ||
| - "local-cd-search": | ||
| type: string | ||
| description: The name of the tool | ||
| - "echo ${VERSION}": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
|
|
||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - local-cd-search: | ||
| type: string | ||
| description: The name of the tool | ||
| - echo ${VERSION}: | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@Ales-ibt" | ||
| maintainers: | ||
| - "@Ales-ibt" |
126 changes: 126 additions & 0 deletions
126
modules/nf-core/localcdsearch/annotate/tests/main.nf.test
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,126 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process LOCALCDSEARCH_ANNOTATE" | ||
| script "../main.nf" | ||
| process "LOCALCDSEARCH_ANNOTATE" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "localcdsearch" | ||
| tag "localcdsearch/annotate" | ||
| tag "localcdsearch/download" | ||
|
|
||
| setup { | ||
| run("LOCALCDSEARCH_DOWNLOAD") { | ||
| script "../../download/main.nf" | ||
| process { | ||
| """ | ||
| input[0] = ['smart'] | ||
| """ | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test("sarscov2 - smart") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] | ||
| input[1] = LOCALCDSEARCH_DOWNLOAD.out.db | ||
| input[2] = false | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll ( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out.result, | ||
| process.out.findAll { key, val -> key.startsWith("versions")} | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("sarscov2 - smart - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] | ||
| input[1] = LOCALCDSEARCH_DOWNLOAD.out.db | ||
| input[2] = false | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out.result, | ||
| process.out.findAll { key, val -> key.startsWith("versions")} | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("sarscov2 - smart - sites") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] | ||
| input[1] = LOCALCDSEARCH_DOWNLOAD.out.db | ||
| input[2] = true | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out.result, | ||
| process.out.annot_sites, | ||
| process.out.findAll { key, val -> key.startsWith("versions")} | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("sarscov2 - smart - sites - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] | ||
| input[1] = LOCALCDSEARCH_DOWNLOAD.out.db | ||
| input[2] = true | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out.result, | ||
| process.out.annot_sites, | ||
| process.out.findAll { key, val -> key.startsWith("versions")} | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, if you had downloaded multiple dbs, would this still be the same? Or do you need to select one or more of the downloaded dbs somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The downloader tool creates the databases directory structure and the annotator detects all the available databases in the given directory. Then the tool runs the annotation versus ALL the detected databases. There's no way to select which database to use when multiple databases exists