-
Notifications
You must be signed in to change notification settings - Fork 57
Fix input to allow empty fixed modifications from SDRF #734
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
91cd6e8
fix(input): allow empty fixed modifications from SDRF
Shen-YuFei 1002e2d
Merge branch 'bigbio:dev' into dev
Shen-YuFei f66644f
fix(hooks): make pipeline output guard executable
Shen-YuFei edaab78
docs(input): document empty SDRF modification handling
Shen-YuFei 9978ecf
fix(input): normalize variable modifications before validation
Shen-YuFei 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Empty file.
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
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
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
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
97 changes: 97 additions & 0 deletions
97
subworkflows/local/create_input_channel/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,97 @@ | ||
| nextflow_function { | ||
|
|
||
| name "SDRF search modification metadata" | ||
| script "../main.nf" | ||
| function "create_meta_channel" | ||
| tag "create_input_channel" | ||
|
|
||
| [ | ||
| [name: 'empty fixed set', fixed: '', variable: 'Carbamidomethyl (C),Oxidation (M),Propionamide (C)'], | ||
| [name: 'missing fixed set', fixed: null, variable: 'Oxidation (M)'], | ||
| [ | ||
| name: 'whitespace fixed set', fixed: ' ', | ||
| variable: 'Carbamidomethyl (C),Oxidation (M),Acetyl (Protein N-term)' | ||
| ], | ||
| [name: 'nonempty fixed set', fixed: 'Carbamidomethyl (C)', variable: 'Oxidation (M)'], | ||
| [name: 'variable fallback', fixed: '', variable: null], | ||
| [ | ||
| name: 'trim SDRF variable set', fixed: '', variable: ' Oxidation (M) ', | ||
| fallback: 'Acetyl (Protein N-term)', expectedVariable: 'Oxidation (M)' | ||
| ], | ||
| [ | ||
| name: 'trim variable fallback', fixed: '', variable: null, | ||
| fallback: ' Oxidation (M) ', expectedVariable: 'Oxidation (M)' | ||
| ], | ||
| [ | ||
| name: 'whitespace SDRF uses fallback', fixed: '', variable: ' ', | ||
| expectedVariable: 'Oxidation (M)' | ||
| ], | ||
| [name: 'no modifications with Comet', fixed: '', variable: '', fallback: '', engines: 'comet'], | ||
| [name: 'no modifications with Sage', fixed: '', variable: '', fallback: '', engines: 'sage'], | ||
| [ | ||
| name: 'whitespace fallback with Comet', fixed: '', variable: '', fallback: ' ', | ||
| engines: 'comet', expectedVariable: '' | ||
| ], | ||
| [ | ||
| name: 'null fallback with Sage', fixed: '', variable: null, fallback: null, | ||
| engines: 'sage', expectedVariable: '' | ||
| ], | ||
| [ | ||
| name: 'reject MSGF implicit CAM', fixed: '', variable: '', fallback: '', | ||
| error: 'Both modification lists are empty' | ||
| ], | ||
| [ | ||
| name: 'reject MSGF whitespace fallback', fixed: '', variable: '', fallback: ' ', | ||
| error: 'Both modification lists are empty' | ||
| ], | ||
| [ | ||
| name: 'require label', fixed: '', variable: 'Oxidation (M)', label: '', | ||
| error: 'Missing or empty required SDRF columns' | ||
| ], | ||
| [ | ||
| name: 'require enzyme', fixed: '', variable: 'Oxidation (M)', enzyme: '', | ||
| error: 'Missing or empty required SDRF columns' | ||
| ], | ||
| ].each { example -> | ||
| test(example.name) { | ||
| when { | ||
| params { | ||
| root_folder = null | ||
| search_engines = example.engines ?: 'comet,msgf,sage' | ||
| variable_mods = example.containsKey('fallback') ? example.fallback : 'Oxidation (M)' | ||
| } | ||
| function { | ||
| """ | ||
| input[0] = [ | ||
| URI: "${projectDir}/main.nf", | ||
| 'Proteomics Data Acquisition Method': 'data-dependent acquisition', | ||
| DissociationMethod: 'BEAM-TYPE COLLISION-INDUCED DISSOCIATION', | ||
| Label: ${(example.containsKey('label') ? example.label : 'label free sample').inspect()}, | ||
| Enzyme: ${(example.containsKey('enzyme') ? example.enzyme : 'Trypsin').inspect()}, | ||
| FixedModifications: ${example.fixed.inspect()}, | ||
| VariableModifications: ${example.variable.inspect()} | ||
| ] | ||
| input[1] = [] as Set | ||
| input[2] = [] as Set | ||
| input[3] = [labelling_type: '', experiment_id: 'test.sdrf.tsv'] | ||
| """ | ||
| } | ||
| } | ||
| then { | ||
| if (example.error) { | ||
| assert function.failed | ||
| assert function.stdout.any { it.contains(example.error) } | ||
| } else { | ||
| assert function.success | ||
| assert function.result[0].fixedmodifications == (example.fixed?.trim() ?: '') | ||
| def fallback = example.containsKey('fallback') ? example.fallback : 'Oxidation (M)' | ||
| def expectedVariable = example.containsKey('expectedVariable') | ||
| ? example.expectedVariable : (example.variable ?: fallback) | ||
| assert function.result[0].variablemodifications == expectedVariable | ||
| assert function.result[0].enzyme == 'Trypsin' | ||
| assert function.result[0].labelling_type == 'label free sample' | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.