Skip to content

Commit

Permalink
Merge pull request #374 from daichengxin/dev
Browse files Browse the repository at this point in the history
add msgfdb_indexing
  • Loading branch information
ypriverol committed May 16, 2024
2 parents bb0b114 + 55c8d3b commit d64652b
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
36 changes: 36 additions & 0 deletions modules/local/openms/thirdparty/msgfdb_indexing/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
process MSGFDBINDEXING {
tag "$database.baseName"
label 'process_low'
label 'openms'

conda "bioconda::openms-thirdparty=3.1.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/openms-thirdparty:3.1.0--h9ee0642_1' :
'biocontainers/openms-thirdparty:3.1.0--h9ee0642_1' }"

input:
path(database)

output:
tuple path("${database.baseName}.cnlcp"), path("${database.baseName}.canno"), path("${database.baseName}.csarr"), path("${database.baseName}.cseq"), emit: msgfdb_idx
path "versions.yml", emit: version
path "*.log", emit: log

script:
def args = task.ext.args ?: ''

"""
msgf_plus edu.ucsd.msjava.msdbsearch.BuildSA \\
-d ${database} \\
-o ./ \\
-tda 0 \\
-debug $params.db_debug \\
$args \\
2>&1 | tee ${database.baseName}_msgfdb_idx.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
msgf_plus: \$(msgf_plus 2>&1 | grep -E '^MS-GF\\+ Release.*')
END_VERSIONS
"""
}
32 changes: 32 additions & 0 deletions modules/local/openms/thirdparty/msgfdb_indexing/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: msgfdb_indexing
description: Indexing the database prior to the database search for MS-GF+.
keywords:
- Indexing
- database
- msgf
tools:
- msgf_plus:
description: |
The MS-GF+ protein identification (database search) engine.
homepage: https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/nightly/html/TOPP_MSGFPlusAdapter.html
documentation: https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/nightly/html/TOPP_MSGFPlusAdapter.html
input:
- database:
type: file
description: fasta file
pattern: "*.{fasta,fa}"
output:
- msgfdb_idx:
type: file
description: Database indexing files
pattern: "*.{cnlcp,canno,csarr,cseq}"
- log:
type: file
description: log file
pattern: "*.log"
- version:
type: file
description: File containing software version
pattern: "versions.yml"
authors:
- "@daichengxin"
2 changes: 1 addition & 1 deletion modules/local/openms/thirdparty/searchenginemsgf/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ process SEARCHENGINEMSGF {
'biocontainers/openms-thirdparty:3.1.0--h9ee0642_1' }"

input:
tuple val(meta), path(mzml_file), path(database)
tuple val(meta), path(mzml_file), path(database), path(cnlcp), path(canno), path(csarr), path(cseq)

output:
tuple val(meta), path("${mzml_file.baseName}_msgf.idXML"), emit: id_files_msgf
Expand Down
4 changes: 3 additions & 1 deletion subworkflows/local/databasesearchengines.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
include { SEARCHENGINEMSGF } from '../../modules/local/openms/thirdparty/searchenginemsgf/main'
include { SEARCHENGINECOMET } from '../../modules/local/openms/thirdparty/searchenginecomet/main'
include { SEARCHENGINESAGE } from '../../modules/local/openms/thirdparty/searchenginesage/main'
include { MSGFDBINDEXING } from '../../modules/local/openms/thirdparty/msgfdb_indexing/main'

workflow DATABASESEARCHENGINES {
take:
Expand All @@ -15,7 +16,8 @@ workflow DATABASESEARCHENGINES {
(ch_id_msgf, ch_id_comet, ch_id_sage, ch_versions) = [ Channel.empty(), Channel.empty(), Channel.empty(), Channel.empty() ]

if (params.search_engines.contains("msgf")) {
SEARCHENGINEMSGF(ch_mzmls_search.combine(ch_searchengine_in_db))
MSGFDBINDEXING(ch_searchengine_in_db)
SEARCHENGINEMSGF(ch_mzmls_search.combine(ch_searchengine_in_db).combine(MSGFDBINDEXING.out.msgfdb_idx))
ch_versions = ch_versions.mix(SEARCHENGINEMSGF.out.version)
ch_id_msgf = ch_id_msgf.mix(SEARCHENGINEMSGF.out.id_files_msgf)
}
Expand Down

0 comments on commit d64652b

Please sign in to comment.