-
Notifications
You must be signed in to change notification settings - Fork 1k
Add module: Percolator #11273
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
Open
julianu
wants to merge
9
commits into
nf-core:master
Choose a base branch
from
medbioinf:percolator
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add module: Percolator #11273
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2de69b3
adding Percolator module
julianu a3e4c99
Merge branch 'master' into percolator
julianu d91864b
setup required tests
julianu 2307433
fixing linter issues
julianu b4a5093
fix linter issue
julianu 274ccae
adding container prefix
julianu f1308fc
Merge branch 'master' into percolator
julianu fd9525c
sanitizing output
julianu b2de695
fetching all of percolators outputs and adapting tests accordingly
julianu 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::percolator=3.7.1" |
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 PERCOLATOR { | ||
| 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/percolator:3.7.1--h6351f2a_0' | ||
| : 'quay.io/biocontainers/percolator:3.7.1--h6351f2a_0'}" | ||
|
|
||
| input: | ||
| tuple val(meta), path(peptide_identification) | ||
|
|
||
| output: | ||
| tuple val(meta), path("${prefix}.pout.xml"), emit: pout_xml | ||
| tuple val(meta), path("${prefix}.pep.xml"), emit: pout_pepxml | ||
| tuple val(meta), path("${prefix}.features.pin"), emit: features_pin | ||
| tuple val(meta), path("${prefix}.weights.tsv"), emit: weights | ||
| tuple val(meta), path("${prefix}.pep.target.pout"), emit: target_peptides, optional: true | ||
| tuple val(meta), path("${prefix}.pep.decoy.pout"), emit: decoy_peptides, optional: true | ||
| tuple val(meta), path("${prefix}.psm.target.pout"), emit: target_psms | ||
| tuple val(meta), path("${prefix}.psm.decoy.pout"), emit: decoy_psms | ||
| tuple val(meta), path("${prefix}.protein.target.pout"), emit: target_proteins, optional: true | ||
| tuple val(meta), path("${prefix}.protein.decoy.pout"), emit: decoy_proteins, optional: true | ||
| tuple val("${task.process}"), val('percolator'), eval('percolator --help 2>&1 | head -1 | sed "s;Percolator version \\([^,]*\\),.*;\\1;"'), topic: versions, emit: versions_percolator | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| percolator \\ | ||
| ${args} \\ | ||
| --num-threads ${task.cpus} \\ | ||
| --xmloutput ${prefix}.pout.xml \\ | ||
| --pepxml-output ${prefix}.pep.xml \\ | ||
| --tab-out ${prefix}.features.pin \\ | ||
| --weights ${prefix}.weights.tsv \\ | ||
| --results-peptides ${prefix}.pep.target.pout \\ | ||
| --decoy-results-peptides ${prefix}.pep.decoy.pout \\ | ||
| --results-psms ${prefix}.psm.target.pout \\ | ||
| --decoy-results-psms ${prefix}.psm.decoy.pout \\ | ||
| --results-proteins ${prefix}.protein.target.pout \\ | ||
| --decoy-results-proteins ${prefix}.protein.decoy.pout \\ | ||
| ${peptide_identification} | ||
| """ | ||
|
|
||
| stub: | ||
| prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| touch ${prefix}.pout.xml | ||
| touch ${prefix}.pep.xml | ||
| touch ${prefix}.features.pin | ||
| touch ${prefix}.weights.tsv | ||
| touch ${prefix}.pep.target.pout | ||
| touch ${prefix}.pep.decoy.pout | ||
| touch ${prefix}.psm.target.pout | ||
| touch ${prefix}.psm.decoy.pout | ||
| touch ${prefix}.protein.target.pout | ||
| touch ${prefix}.protein.decoy.pout | ||
| """ | ||
| } |
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,151 @@ | ||
| name: "percolator" | ||
| description: Rescore peptide-spectrum matches and estimate false discovery rates | ||
| using the Percolator semi-supervised learning algorithm. | ||
| keywords: | ||
| - proteomics | ||
| - spectrum identification | ||
| - psm | ||
| - peptide | ||
| - protein | ||
| - rescoring | ||
| - false discovery rate | ||
| - features | ||
| tools: | ||
| - "percolator": | ||
| description: "Semi-supervised learning for peptide identification from shotgun | ||
| proteomics datasets." | ||
| homepage: "http://percolator.ms" | ||
| documentation: "http://percolator.ms" | ||
| tool_dev_url: "https://github.com/percolator/percolator" | ||
| doi: "10.1038/nmeth1113" | ||
| licence: ["Apache-2.0"] | ||
| identifier: biotools:percolator | ||
|
|
||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ | ||
| id:'sample1' ]` | ||
| - peptide_identification: | ||
| type: file | ||
| description: peptide identifications as PIN (Percolator input) file | ||
| pattern: "*.pin" | ||
| ontologies: [] | ||
| output: | ||
| pout_xml: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1' ]` | ||
| - ${prefix}.pout.xml: | ||
| type: file | ||
| description: Percolator output in XML format containing all PSM-level results | ||
| pattern: "*.pout.xml" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2332" # XML | ||
| pout_pepxml: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1' ]` | ||
| - ${prefix}.pep.xml: | ||
| type: file | ||
| description: Percolator output in pepXML format | ||
| pattern: "*.pep.xml" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3655" # pepXML | ||
| features_pin: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1' ]` | ||
| - ${prefix}.features.pin: | ||
| type: file | ||
| description: Tab-separated file with rescored features (PIN format) | ||
| pattern: "*.features.pin" | ||
| ontologies: [] | ||
| weights: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1' ]` | ||
| - ${prefix}.weights.tsv: | ||
| type: file | ||
| description: TSV file containing the final feature weights | ||
| pattern: "*.weights.tsv" | ||
| ontologies: [] | ||
| target_peptides: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1' ]` | ||
| - ${prefix}.pep.target.pout: | ||
| type: file | ||
| description: Target peptide-level results in tab separated format (pout) | ||
| pattern: "*.pep.target.pout" | ||
| ontologies: [] | ||
| decoy_peptides: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1' ]` | ||
| - ${prefix}.pep.decoy.pout: | ||
| type: file | ||
| description: Decoy peptide-level results in tab separated format (pout) | ||
| pattern: "*.pep.decoy.pout" | ||
| ontologies: [] | ||
| target_psms: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1' ]` | ||
| - ${prefix}.psm.target.pout: | ||
| type: file | ||
| description: Target PSM-level results in tab separated format (pout) | ||
| pattern: "*.psm.target.pout" | ||
| ontologies: [] | ||
| decoy_psms: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1' ]` | ||
| - ${prefix}.psm.decoy.pout: | ||
| type: file | ||
| description: Decoy PSM-level results in tab separated format (pout) | ||
| pattern: "*.psm.decoy.pout" | ||
| ontologies: [] | ||
| target_proteins: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1' ]` | ||
| - ${prefix}.protein.target.pout: | ||
| type: file | ||
| description: Target protein-level results in tab separated format (pout) | ||
| pattern: "*.protein.target.pout" | ||
| ontologies: [] | ||
| decoy_proteins: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1' ]` | ||
| - ${prefix}.protein.decoy.pout: | ||
| type: file | ||
| description: Decoy protein-level results in tab separated format (pout) | ||
| pattern: "*.protein.decoy.pout" | ||
| ontologies: [] | ||
| versions_percolator: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - percolator: | ||
| type: string | ||
| description: The name of the tool | ||
| - percolator --help 2>&1 | head -1 | sed "s;Percolator version \([^,]*\),.*;\1;": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - percolator: | ||
| type: string | ||
| description: The name of the tool | ||
| - percolator --help 2>&1 | head -1 | sed "s;Percolator version \([^,]*\),.*;\1;": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@julianu" | ||
| maintainers: | ||
| - "@julianu" | ||
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,97 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process PERCOLATOR" | ||
| script "../main.nf" | ||
| process "PERCOLATOR" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "percolator" | ||
| tag "comet" | ||
| tag "openms/decoydatabase" | ||
|
|
||
| setup { | ||
| run("OPENMS_DECOYDATABASE") { | ||
| script "../../openms/decoydatabase/main.nf" | ||
| process { | ||
| """ | ||
| input[0] = channel.of([ | ||
| [ id:'test_db' ], | ||
| file(params.modules_testdata_base_path + 'proteomics/database/yeast_UPS.fasta', checkIfExists: true), | ||
| ]) | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| run("COMET") { | ||
| script "../../comet/main.nf" | ||
|
|
||
| process { | ||
| """ | ||
| def originalParams = file(params.modules_testdata_base_path + 'proteomics/parameter/OVEMB150205.comet.params', checkIfExists: true) | ||
| def modifiedParams = new File('./modified.comet.params') | ||
| modifiedParams.text = originalParams.text | ||
| .replaceAll('(?m)^output_percolatorfile =.*', 'output_percolatorfile = 1') | ||
| .replaceAll('(?m)^output_txtfile =.*', 'output_txtfile = 0') | ||
| .replaceAll('(?m)^output_mzidentmlfile =.*', 'output_mzidentmlfile = 0') | ||
|
|
||
| input[0] = OPENMS_DECOYDATABASE.out.decoy_fasta.map { meta, fasta -> | ||
| [ | ||
| [ id:'test'], | ||
| file(params.modules_testdata_base_path + 'proteomics/msspectra/OVEMB150205_12.mzML', checkIfExists: true), | ||
| fasta, | ||
| file(modifiedParams), | ||
| ] | ||
| } | ||
| """ | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test("percolator - OVEMB150205_12") { | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = COMET.out.pin | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| def outputs = sanitizeOutput(process.out).findAll { key, val -> | ||
| ['pout_xml', 'features_pin', 'weights', 'target_psms', 'decoy_psms'].contains(key) | ||
| } | ||
|
|
||
| assertAll( | ||
| { assert process.success }, | ||
| // all but pepXML can be matched as whole, pepXML has a timestamp and must be treated separately | ||
| { assert snapshot(outputs).match() }, | ||
| // in pepXML: check some lines for existence | ||
| { assert path(process.out.pout_pepxml.get(0).get(1)).readLines().any { it.contains('<spectrum_query spectrum="test_98_3_1"') }}, | ||
| { assert path(process.out.pout_pepxml.get(0).get(1)).readLines().any { it.contains('</msms_pipeline_analysis>') }} | ||
|
|
||
| ) | ||
|
|
||
| } | ||
| } | ||
|
|
||
| test("percolator - OVEMB150205_12 - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = COMET.out.pin | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).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.
no ontologies available ? :(
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.
Added some, where fitting.
Actually, most of the output files are kind of TSVs, but special ones.