-
Notifications
You must be signed in to change notification settings - Fork 0
Add Demo Mode #21
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
Add Demo Mode #21
Conversation
add example workspaces remove unneeded output remove deconv example
WalkthroughThis update introduces persistent caching for sequence input and modifications, refactors sequence retrieval and validation logic to use the cache, and centralizes experiment selection index validation in viewer modules. The UI for file upload is simplified by removing example data loading tabs. Numerous new and updated example data and configuration files are also added. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant StreamlitApp
participant FileManager
participant Cache
User->>StreamlitApp: Load Sequence Input Page
StreamlitApp->>FileManager: Request cached sequence
FileManager->>Cache: Retrieve sequence data
Cache-->>FileManager: Return sequence (if exists)
FileManager-->>StreamlitApp: Provide sequence or None
alt Sequence exists
StreamlitApp->>StreamlitApp: Initialize session state with cached sequence
else Sequence does not exist
StreamlitApp->>StreamlitApp: Show empty input fields
end
User->>StreamlitApp: Submit sequence/modifications
StreamlitApp->>FileManager: Save sequence to cache
FileManager->>Cache: Store sequence data
Cache-->>FileManager: Acknowledge
FileManager-->>StreamlitApp: Confirm save
sequenceDiagram
participant User
participant StreamlitApp
participant FileManager
User->>StreamlitApp: Select experiment in viewer
StreamlitApp->>FileManager: Get available experiment results
StreamlitApp->>StreamlitApp: validate_selected_index()
alt Experiment valid
StreamlitApp->>StreamlitApp: Set selectbox index
else Experiment invalid
StreamlitApp->>StreamlitApp: Remove stale session key
StreamlitApp->>StreamlitApp: Set selectbox index to None
end
Possibly related PRs
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 10
🧹 Nitpick comments (23)
example-data/workspaces/default/params.json (1)
1-8: Consider adding a validation schema or documentation
Introduce a JSON schema or inline documentation to describe and validate each workspace parameter, improving maintainability and reducing runtime errors.example-data/workspaces/default/flashtnt/params.json (1)
1-12: Use structured JSON arrays for multi-value parameters.While the JSON is valid and lists necessary fields for FLASHTnT and FLASHDeconv workflows, encoding tolerances and ion types as newline-delimited strings can complicate parsing. Consider using native arrays for clarity:
- "FLASHDeconv": { - "SD:tol": "10.0\n10.0" - }, + "FLASHDeconv": { + "SD:tol": [10.0, 10.0] + }, - "FLASHTnT": { - "ion_type": "b\ny" - } + "FLASHTnT": { + "ion_type": ["b", "y"] + }example-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/FTnT_parameters.json (1)
1-1: Consider using a JSON array for ion types.The single-key JSON is syntactically correct, but representing
"ion_type": ["b", "c", "y", "z"]instead of a newline-delimited string improves readability and downstream handling.example-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/FD_parameters.json (1)
1-1: JSON config is well-formed but consider type improvements
FD_parameters.json correctly defines the deconvolution tolerance ("SD:tol": "10.0\n10.0") for demo mode. For stronger type safety and clearer intent, you might:
- Represent multi-valued tolerances as a JSON array, e.g.
"SD:tol": [10.0, 10.0]- Ensure the parsing logic supports newline-delimited strings if that format is required.
example-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/FD_parameters.json (1)
1-1: Validate parameter type consistency
The JSON is valid, but"SD:tol"is a newline-delimited string while"SD:max_charge"is an integer. To simplify parsing and avoid type-related bugs, consider:
- Converting
"SD:tol"to an array of numbers, e.g.[10, 10]- Ensuring all numeric parameters share the same JSON type.
example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/FD_parameters.json (1)
1-1: Ensure correct JSON types for boolean and multi-valued fields
FD_parameters.json is syntactically correct, but:
"FD:report_FDR"is a string"true"—consider using a JSON boolean value (true) for clarity."SD:tol"could be an array ([10.0, 10.0]) instead of a newline-separated string.
These changes will improve type safety and parsing robustness.example-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/FTnT_parameters.json (1)
1-1: Standardize multi-value configuration
FTnT_parameters.json is valid JSON but"ion_type": "b\ny"uses a newline-separated string for multiple ion types. For readability and consistent parsing, consider:
- Changing to an array format:
"ion_type": ["b", "y"]- Verifying that the consumer of this file correctly handles newline-delimited strings if you choose to keep the current format.
example-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/FD_parameters.json (1)
1-1: Improve parameter type uniformity
This JSON is well-formed, but mixing a newline-delimited string for"SD:tol"and a string for"FD:report_FDR"can lead to parsing inconsistencies. Consider:
- Switching
"FD:report_FDR"to a boolean (true)- Representing
"SD:tol"as a numeric array, e.g.[5, 5]
These adjustments will enhance clarity and reduce the chance of type-related errors.example-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/FTnT_parameters.json (1)
1-1: Suggest using a JSON array for ion types.
Representing ion types as an array improves clarity and prevents parsing quirks from newline characters. Consider:- {"ion_type": "b\nc\ny\nz"} + {"ion_type": ["b", "c", "y", "z"]}example-data/workspaces/default/flashdeconv/params.json (1)
1-7: Approve workspace-level FlashDeconv parameters.
The structure is clear, threads count is set, andmzML-filesis correctly an empty array. If supported, you might consider switching"SD:tol": "10.0\n10.0"to a numeric array for consistency.example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/toppic_ms2.feature (1)
1-2: Ensure POSIX compliance with newline at end-of-file
Add a trailing newline to this feature file to conform with Unix text file conventions and avoid tools truncating the last line.example-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/FTnT_parameters.json (2)
1-1: Clarify and optimize theion_typesetting
The value"b\ny"embeds a literal newline in the JSON string, which may not parse as intended. If you mean to specify two ion types, consider using an array:- "ion_type": "b\ny", + "ion_type": ["b", "y"],Please verify the downstream parser’s expectations before merging.
1-1: Add trailing newline for POSIX compliance
Include a newline at EOF to prevent potential issues with UNIX-based tooling.example-data/workspaces/demo_antibody/params.json (1)
1-8: Add trailing newline for POSIX compliance
This JSON file doesn’t end with a newline—adding one helps ensure compatibility with various text processors and version control diff tools.example-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/toppic_ms2.feature (1)
1-2: Ensure POSIX compliance with newline at end-of-file
A trailing newline should be added to the header-only feature file to satisfy text file conventions.example-data/workspaces/demo_aqpz/flashdeconv/params.json (1)
1-10: Add trailing newline for POSIX compliance
Please end the JSON file with a newline to conform with standard text file practices.example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/anno_annotated.mzML (1)
96-96: Consider externalising the giganticDeconvMassPeakIndicespayloadEmbedding ~150 KB of comma-separated indices inside a single
userParambloats the mzML and forces the XML parser to materialise the whole string in memory.
Moving this data to a side-car (e.g. JSON) referenced via<externalData>keeps the file lean and speeds up load time.example-data/workspaces/demo_aqpz/flashdeconv/ini/FLASHDeconv.ini (6)
1-1: Consider using UTF-8 encoding for broader compatibility.Most XML files in the project use UTF-8. Updating the header to:
<?xml version="1.0" encoding="UTF-8"?>avoids potential character-encoding issues across platforms.
2-2: Pin the schema reference to a released version.The
xsi:noNamespaceSchemaLocationcurrently points to thedevelopbranch. For reproducible demos, consider linking to a tagged release (e.g.,v2.6.0) or bundling the schema locally.
29-29: Evaluate default thread setting.The
threadsparameter is set to1. If the demo environment supports parallel execution, consider increasing this default to improve performance.
35-43: Review advanced algorithm parameters.Settings in the
FDnode likemerging_method,allowed_isotope_error, andprecursor_MS1_windowmay overwhelm demo users. Confirm these are appropriate for a demo or consider toggling them as advanced-only to simplify the UI.
70-70: Fix incomplete description in feature tracing.The
<ITEM name="min_cos">in theftnode is missing a closing parenthesis and ends abruptly. For example:- description="Cosine similarity threshold ... (set by -SD:min_cos will be used " + description="Cosine similarity threshold ... (set by -SD:min_cos) will be used."
74-74: Use a boolean type forisotope_correction.For consistency with other flags, change from
type="string"totype="bool":- <ITEM name="isotope_correction" value="true" type="string" ... /> + <ITEM name="isotope_correction" value="true" type="bool" ... />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (82)
example-data/flashdeconv/example_fd_spec1.tsvis excluded by!**/*.tsvexample-data/flashtagger/example_spectrum_1_protein.tsvis excluded by!**/*.tsvexample-data/flashtagger/example_spectrum_1_tagged.tsvis excluded by!**/*.tsvexample-data/flashtagger/example_spectrum_2_protein.tsvis excluded by!**/*.tsvexample-data/flashtagger/example_spectrum_2_tagged.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashdeconv/cache/cache.dbis excluded by!**/*.dbexample-data/workspaces/default/flashdeconv/cache/files/example_fd/FD_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashdeconv/cache/files/example_fd/out.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashdeconv/cache/files/example_fd/quant.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashdeconv/cache/files/example_fd/spec1.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashdeconv/cache/files/example_fd/spec2.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashquant/cache/cache.dbis excluded by!**/*.dbexample-data/workspaces/default/flashquant/cache/files/example/conflict_tsv.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashquant/cache/files/example/quant_tsv.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashquant/cache/files/example/trace_tsv.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashtnt/cache/cache.dbis excluded by!**/*.dbexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/FD_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/FTnT_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/internal_fragment_data.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/protein.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/prsms.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/quant.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/sequence_data.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/settings.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/spec2.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/tags.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/FD_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/FTnT_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/internal_fragment_data.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/protein.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/prsms.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/quant.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/sequence_data.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/settings.pkl.gzis excluded by!**/*.gzexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/spec2.tsvis excluded by!**/*.tsvexample-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/tags.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_antibody/flashdeconv/cache/cache.dbis excluded by!**/*.dbexample-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/FD_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/quant.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/spec2.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_antibody/flashdeconv/cache/files/sequence/sequence.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_antibody/flashdeconv/logs/all.logis excluded by!**/*.logexample-data/workspaces/demo_antibody/flashdeconv/logs/commands-and-run-times.logis excluded by!**/*.logexample-data/workspaces/demo_antibody/flashdeconv/logs/minimal.logis excluded by!**/*.logexample-data/workspaces/demo_antibody/flashtnt/cache/cache.dbis excluded by!**/*.dbexample-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/FD_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/FTnT_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/internal_fragment_data.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/protein.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/prsms.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/quant.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/sequence_data.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/settings.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/spec2.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/tags.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_antibody/flashtnt/logs/all.logis excluded by!**/*.logexample-data/workspaces/demo_antibody/flashtnt/logs/commands-and-run-times.logis excluded by!**/*.logexample-data/workspaces/demo_antibody/flashtnt/logs/minimal.logis excluded by!**/*.logexample-data/workspaces/demo_aqpz/flashdeconv/cache/cache.dbis excluded by!**/*.dbexample-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/FD_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/quant.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/spec2.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_aqpz/flashdeconv/cache/files/layout/layout.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_aqpz/flashdeconv/cache/files/sequence/sequence.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_aqpz/flashdeconv/logs/all.logis excluded by!**/*.logexample-data/workspaces/demo_aqpz/flashdeconv/logs/commands-and-run-times.logis excluded by!**/*.logexample-data/workspaces/demo_aqpz/flashdeconv/logs/minimal.logis excluded by!**/*.logexample-data/workspaces/demo_aqpz/flashquant/cache/cache.dbis excluded by!**/*.dbexample-data/workspaces/demo_aqpz/flashtnt/cache/cache.dbis excluded by!**/*.dbexample-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/FD_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/FTnT_parameters.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/internal_fragment_data.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/protein.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/prsms.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/quant.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/sequence_data.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/settings.pkl.gzis excluded by!**/*.gzexample-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/spec2.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/tags.tsvis excluded by!**/*.tsvexample-data/workspaces/demo_aqpz/flashtnt/logs/all.logis excluded by!**/*.logexample-data/workspaces/demo_aqpz/flashtnt/logs/commands-and-run-times.logis excluded by!**/*.logexample-data/workspaces/demo_aqpz/flashtnt/logs/minimal.logis excluded by!**/*.log
📒 Files selected for processing (56)
.github/workflows/build-windows-executable-app.yaml(1 hunks).gitignore(0 hunks)content/FLASHDeconv/FLASHDeconvLayoutManager.py(2 hunks)content/FLASHDeconv/FLASHDeconvSequenceInput.py(3 hunks)content/FLASHDeconv/FLASHDeconvViewer.py(6 hunks)content/FLASHDeconv/FLASHDeconvWorkflow.py(1 hunks)content/FLASHQuant/FLASHQuantFileUpload.py(1 hunks)content/FLASHTnT/FLASHTnTLayoutManager.py(0 hunks)content/FLASHTnT/FLASHTnTViewer.py(5 hunks)content/FLASHTnT/FLASHTnTWorkflow.py(1 hunks)example-data/flashtagger/example_spectrum_1_deconv.mzML(0 hunks)example-data/flashtagger/example_spectrum_2_deconv.mzML(0 hunks)example-data/workspaces/default/flashdeconv/cache/files/example_fd/FD_parameters.json(1 hunks)example-data/workspaces/default/flashdeconv/cache/files/example_fd/toppic_ms1.feature(1 hunks)example-data/workspaces/default/flashdeconv/cache/files/example_fd/toppic_ms2.feature(1 hunks)example-data/workspaces/default/flashdeconv/ini/FLASHDeconv.ini(1 hunks)example-data/workspaces/default/flashdeconv/params.json(1 hunks)example-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/FD_parameters.json(1 hunks)example-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/FTnT_parameters.json(1 hunks)example-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/out_deconv.mzML(1 hunks)example-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/toppic_ms2.feature(1 hunks)example-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/toppic_ms2.msalign(1 hunks)example-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/FD_parameters.json(1 hunks)example-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/FTnT_parameters.json(1 hunks)example-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/out_deconv.mzML(1 hunks)example-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/toppic_ms2.feature(1 hunks)example-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/toppic_ms2.msalign(1 hunks)example-data/workspaces/default/flashtnt/ini/FLASHDeconv.ini(1 hunks)example-data/workspaces/default/flashtnt/ini/FLASHTnT.ini(1 hunks)example-data/workspaces/default/flashtnt/params.json(1 hunks)example-data/workspaces/default/params.json(1 hunks)example-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/FD_parameters.json(1 hunks)example-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/out_deconv.mzML(1 hunks)example-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/toppic_ms2.feature(1 hunks)example-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/toppic_ms2.msalign(1 hunks)example-data/workspaces/demo_antibody/flashdeconv/ini/FLASHDeconv.ini(1 hunks)example-data/workspaces/demo_antibody/flashdeconv/params.json(1 hunks)example-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/FD_parameters.json(1 hunks)example-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/FTnT_parameters.json(1 hunks)example-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/out_deconv.mzML(1 hunks)example-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/toppic_ms2.feature(1 hunks)example-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/toppic_ms2.msalign(1 hunks)example-data/workspaces/demo_antibody/flashtnt/ini/FLASHDeconv.ini(1 hunks)example-data/workspaces/demo_antibody/flashtnt/ini/FLASHTnT.ini(1 hunks)example-data/workspaces/demo_antibody/flashtnt/params.json(1 hunks)example-data/workspaces/demo_antibody/params.json(1 hunks)example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/FD_parameters.json(1 hunks)example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/anno_annotated.mzML(2 hunks)example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/out_deconv.mzML(1 hunks)example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/toppic_ms2.feature(1 hunks)example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/toppic_ms2.msalign(1 hunks)example-data/workspaces/demo_aqpz/flashdeconv/ini/FLASHDeconv.ini(1 hunks)example-data/workspaces/demo_aqpz/flashdeconv/params.json(1 hunks)example-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/FD_parameters.json(1 hunks)example-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/FTnT_parameters.json(1 hunks)example-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/out_deconv.mzML(1 hunks)
💤 Files with no reviewable changes (4)
- .gitignore
- example-data/flashtagger/example_spectrum_2_deconv.mzML
- example-data/flashtagger/example_spectrum_1_deconv.mzML
- content/FLASHTnT/FLASHTnTLayoutManager.py
🧰 Additional context used
🪛 Ruff (0.11.9)
content/FLASHQuant/FLASHQuantFileUpload.py
98-98: Use is and is not for type comparisons, or isinstance() for isinstance checks
(E721)
content/FLASHDeconv/FLASHDeconvWorkflow.py
109-109: Use is and is not for type comparisons, or isinstance() for isinstance checks
(E721)
content/FLASHTnT/FLASHTnTWorkflow.py
105-105: Use is and is not for type comparisons, or isinstance() for isinstance checks
(E721)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: build-full-app
- GitHub Check: build-openms
🔇 Additional comments (57)
.github/workflows/build-windows-executable-app.yaml (1)
17-17: Ensure app version consistency across workflows and artifacts.The
APP_NAMEhas been bumped toFLASHApp-0.8.0to reflect the new demo‐mode release. Please verify that all other references to the application version—such as release tags, settings.json defaults, documentation, and installer metadata (APP_UpgradeCode)—are updated accordingly to prevent version mismatches.example-data/workspaces/default/params.json (3)
1-8: Approve default workspace parameters JSON
The JSON structure is valid and provides sensible defaults for the demo workspace.
2-4: Verify handling of hyphenated parameter keys
Ensure the application’s JSON loader and accessors correctly handle keys with hyphens (e.g.,"selected-mzML-files","2D-map-intensity-cutoff") and remain consistent across other workspace configs.
7-7: Clarify purpose and naming ofcontrollo
The key"controllo"may be unclear—confirm it’s intentional and documented. If it’s a typo or domain-specific term, consider renaming or adding explanatory documentation.example-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/toppic_ms2.feature (1)
1-2: Feature file header is consistent and valid.The header defines all required columns for FLASHTnT feature data and matches the schema used in other workspaces.
example-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/toppic_ms2.feature (1)
1-2: Feature file header is consistent across workspaces.The tab-separated header aligns exactly with the demo workspace version, ensuring uniform parsing logic.
example-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/toppic_ms2.msalign (2)
14-14: Verify relative path forFILE_NAME.The entry
FILE_NAME=../workspaces-FLASHApp/demo_antibody/flashtnt/input-files/mzML-files/example_spectrum_antibody.mzMLmust resolve correctly from the.msalignfile’s location. Please confirm this relative reference matches the actual directory structure.
1-533: Approve msalign file formatting and content.The file conforms to the standard msalign schema, includes necessary parameter comments, and comprehensively lists spectrum peaks. It is consistent with other example data in the workspace.
example-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/FD_parameters.json (1)
1-1: Approve new FD parameters file, verify parsing of newline-separated tolerances.
This JSON config looks correct, but please confirm that the consuming code expects"SD:tol"as a newline-separated string (rather than an array of numbers).example-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/FD_parameters.json (1)
1-1: Approve FD parameters for FLASHTnT example spectrum.
This mirrors other FD configs (tol + max_charge). Ensure the newline-separated"SD:tol"aligns with the parser’s expectations.example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/toppic_ms2.msalign (2)
1-175: LGTM: Well-formatted msalign file.The file follows the correct msalign format with proper parameter headers, metadata sections, and peak data structure. The data appears comprehensive with appropriate charge state assignments and intensity values.
14-14:Details
✅ Verification successful
Verify the relative path in FILE_NAME.
The FILE_NAME uses a relative path (
../workspaces-FLASHApp/demo_aqpz/...) which may cause issues if the working directory changes. Consider using absolute paths or ensuring the relative path is consistently resolved.
🏁 Script executed:
#!/bin/bash # Description: Check if similar relative paths are used consistently across msalign files # Expected: Consistent path patterns or absolute paths rg -g "*.msalign" "FILE_NAME=" -A 1Length of output: 67629
Consistency of
FILE_NAMEpaths confirmedAll
.msalignfiles (acrossflashdeconvandflashtntcaches) consistently use the same relative‐path convention for theFILE_NAMEmetadata. No change is needed in the generated data files—if absolute resolution is ever required, document the expected working‐directory layout rather than altering each metadata entry.example-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/toppic_ms2.feature (1)
1-1: LGTM: Correct feature file header structure.The header contains all the standard columns for mass spectrometry feature data. This appears to be a template file for demo purposes, which is appropriate for the demo mode functionality being added.
content/FLASHQuant/FLASHQuantFileUpload.py (2)
72-88: LGTM: UI simplification improves user experience.The removal of tabs and direct presentation of the upload interface makes the workflow more straightforward. The updated informational text clearly guides users through the upload process.
89-106: LGTM: File upload logic remains robust.The form structure and file processing logic maintains proper validation and error handling while integrating well with the simplified UI.
🧰 Tools
🪛 Ruff (0.11.9)
98-98: Use
isandis notfor type comparisons, orisinstance()for isinstance checks(E721)
example-data/workspaces/demo_antibody/flashdeconv/params.json (2)
1-11: LGTM: Well-structured FLASHDeconv configuration.The JSON configuration contains appropriate parameters for FLASHDeconv processing with reasonable thread count (14), tolerance settings, and FDR reporting enabled. The structure follows expected conventions for demo workspace configuration.
2-4:Details
✅ Verification successful
Verify relative path consistency in configuration.
Similar to other files in this PR, the mzML file path uses relative notation (
../workspaces-FLASHApp/...). Ensure this path resolution is consistent across all configuration files and runtime environments.
🏁 Script executed:
#!/bin/bash # Description: Check path patterns in all JSON configuration files # Expected: Consistent path resolution strategy rg -g "*.json" "workspaces-FLASHApp" -B 2 -A 2Length of output: 2793
All JSON configs use the same relative‐path pattern
I checked everyparams.jsonunderexample-data/workspaces/*/*and they all reference mzML (and FASTA) files via../workspaces-FLASHApp/.... No inconsistencies were found across workspaces. No changes required.content/FLASHDeconv/FLASHDeconvWorkflow.py (1)
88-100: LGTM: Clear and informative UI updatesThe new subheader and info section provide clear guidance to users on how to upload files. The structured information with numbered steps and tips improves user experience.
example-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/toppic_ms2.msalign (1)
1-274: LGTM: Well-formatted msalign data fileThe msalign file follows the correct format with:
- Proper parameter header section with tolerance, mass/charge ranges, and quality thresholds
- Valid BEGIN IONS/END IONS structure
- Complete spectrum metadata including file path, scan info, and precursor details
- Consistent m/z, intensity, and charge data format (273 data points)
The file structure supports FLASHDeconv/FLASHTnT proteomics workflows as expected for demo data.
example-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/toppic_ms2.msalign (1)
1-361: LGTM: Consistent msalign format with demo-specific parametersThis msalign file maintains the same proper format as the default workspace version with appropriate differences:
- Tighter tolerance: [5,5] vs [10,10] in the default version, suitable for higher precision demo data
- Correct workspace path: References
demo_antibodyworkspace as expected- Extended dataset: 360 data points providing richer demo content
- Same quality standards: Maintains consistent cos/SNR thresholds
The file structure supports the demo antibody proteomics workflow effectively.
example-data/workspaces/default/flashdeconv/cache/files/example_fd/toppic_ms2.feature (1)
1-193: New example data file:toppic_ms2.feature
This is a pure data addition to support demo mode—no executable code or logic to review. The header and tab-delimited rows follow the same format as complementary feature files (e.g.,toppic_ms1.feature), and the relative paths to input mzML files appear correct.example-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/toppic_ms2.msalign (1)
1-247: New msalign example data file
This file adds a single MS2 spectrum in standard msalign format (BEGIN IONS/END IONS) with appropriate metadata and spectrum entries. It’s a data-only change—no code logic to review.example-data/workspaces/default/flashdeconv/cache/files/example_fd/toppic_ms1.feature (1)
1-10: New example data file:toppic_ms1.feature
This pure data file complementstoppic_ms2.featureby providing MS1 feature entries. The structure and formatting are consistent with other feature files in the demo cache. No logic issues detected.content/FLASHDeconv/FLASHDeconvLayoutManager.py (1)
217-217: Good refactoring to use persistent cache.The change from checking session state to using the cached sequence data aligns well with the architectural improvements mentioned in the PR. This provides better persistence across user sessions.
example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/anno_annotated.mzML (2)
88-92: Double-check increased numerical precisionThe updated
base peak m/z,intensity,TIC, and observed m/z range values now carry extra precision.
If any downstream component assumes fixed decimal formatting (regex parsers, DB schemas with precision limits, etc.) this may overflow or break comparisons. Please verify consumers can handle the new number of significant digits.
189-192: Verify index offsets after manual edits
<offset idRef="TIC">and<indexListOffset>were decreased by 500 bytes.
If the byte positions don’t exactly match the mzML payload size the random-access reader will fail with “offset past end-of-file”.
Regenerate the index withmsconvert --mzML --indexedor runopenms::IndexedMzMLFileto be sure.content/FLASHTnT/FLASHTnTWorkflow.py (1)
82-95: LGTM! UI simplification improves usability.The removal of the tabbed interface and consolidation into direct file upload instructions makes the workflow cleaner and more straightforward for users. The step-by-step instructions are clear and helpful.
example-data/workspaces/default/flashtnt/cache/files/example_spectrum_aqpz/out_deconv.mzML (1)
1-194: LGTM! Well-structured mzML example data file.This mzML file is properly formatted according to the PSI mzML 1.1.0 standard with:
- Correct XML namespaces and schema references
- Comprehensive controlled vocabularies (MS, UO, BTO, GO, PATO)
- Complete metadata including instrument configuration and data processing
- Properly encoded binary data arrays
- Valid indexing structure for efficient access
The file serves as appropriate example data for the demo mode functionality.
example-data/workspaces/demo_antibody/flashdeconv/cache/files/example_spectrum_antibody_20250525-100610/out_deconv.mzML (1)
1-186: LGTM! Comprehensive antibody example data for demo mode.This mzML file provides well-structured example data for antibody analysis with:
- Complete mzML 1.1.0 compliance
- Detailed instrument metadata (FT-ICR mass spectrometer)
- MS2 spectrum data with 564 data points
- Proper precursor isolation and activation parameters
- Valid indexing and checksums
The file appropriately supports the demo mode for antibody workflows in FLASHDeconv.
example-data/workspaces/demo_aqpz/flashtnt/cache/files/example_spectrum_aqpz_20250525-092909/out_deconv.mzML (1)
1-194: LGTM! Complete AQPZ example data for FLASHTnT demo.This mzML file provides appropriate example data for AQPZ protein analysis with:
- Standard mzML 1.1.0 format compliance
- Q Exactive instrument configuration
- MS2 spectrum with 142 data points and proper scan parameters
- Consistent DeconvMassInfo parameters (tol=10.0) for demonstration
- Valid binary data encoding and indexing
The file completes the demo mode example data set for FLASHTnT workflows.
content/FLASHTnT/FLASHTnTViewer.py (1)
72-72: Excellent refactoring to centralize validation logic.The replacement of inline validation logic with calls to
validate_selected_indeximproves code maintainability and consistency across different UI layouts. This change ensures uniform handling of stale session state across all experiment selection scenarios.Also applies to: 81-81, 93-93, 111-111
example-data/workspaces/default/flashtnt/cache/files/example_spectrum_antibody/out_deconv.mzML (1)
1-186: Well-structured example mzML file for demo purposes.This mzML file follows the standard format correctly with proper XML structure, namespace declarations, and schema compliance. The file contains legitimate mass spectrometry data including:
- Complete metadata (instrument configuration, sample information, software versions)
- MS2 spectrum with appropriate scan parameters and binary data
- Proper encoding of m/z and intensity arrays
- Valid indexing structure for efficient data access
The deconvolution parameters in the userParam section indicate this file is properly processed for use with the FLASHTnT workflow.
example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/out_deconv.mzML (1)
1-194: Valid mzML example file for AQPZ demo workspace.This mzML file is properly structured and compliant with the mzML 1.1.0 specification. It contains Q Exactive instrument data with appropriate metadata and a single MS2 spectrum for AQPZ protein analysis. The file includes:
- Correct XML structure and namespace declarations
- Complete instrument configuration and sample metadata
- Properly encoded binary data arrays for m/z and intensity
- Valid deconvolution parameters for FLASHDeconv workflow integration
- Appropriate indexing for efficient data access
The file serves as suitable example data for the demo_aqpz workspace.
example-data/workspaces/default/flashtnt/ini/FLASHTnT.ini (1)
1-39: Comprehensive and well-structured parameter configuration file.This XML parameter file provides complete configuration options for the FLASHTnT tool with proper OpenMS parameter schema compliance. The file includes:
- Input/Output parameters: Proper file type specifications for mzML, FASTA, and TSV files
- Quality control settings: Configurable FDR thresholds at PrSM and proteoform levels
- Algorithm parameters: Comprehensive settings for modification detection and tag generation
- Runtime options: Threading, logging, and debugging controls
- Validation: Appropriate type restrictions and value ranges
The hierarchical structure with nested nodes for extension and tag algorithms provides logical organization. Default values are reasonable for proteomics analysis workflows, and parameter descriptions are clear and informative.
example-data/workspaces/demo_antibody/flashtnt/ini/FLASHTnT.ini (1)
1-39: LGTM! Well-structured parameter configuration file.The XML parameter configuration file for FLASHTnT is properly structured and follows the OpenMS parameter schema 1.7.0. The parameter definitions are comprehensive and appropriate for the tool's functionality.
content/FLASHDeconv/FLASHDeconvViewer.py (4)
20-27: Good centralization of validation logic.The
validate_selected_indexfunction properly centralizes the validation of selected experiment indices and handles cleanup of stale session state keys. This is a good refactoring that promotes code reuse and consistency.
38-46: Clean sequence retrieval from cache.The
get_sequencefunction properly checks for cached sequence data and returns the sequence information in a structured way. The implementation correctly handles the case where no sequence data exists.
47-48: Conditional layout modification looks correct.The logic to conditionally add the sequence view to the layout based on sequence availability is clean and appropriate.
75-75: Consistent use of validation function.Good consistent application of the new
validate_selected_indexfunction across all selectbox widgets. This ensures uniform behavior for experiment selection validation.Also applies to: 87-87, 103-103, 125-125
example-data/workspaces/demo_antibody/flashtnt/cache/files/example_spectrum_antibody_20250525-100107/out_deconv.mzML (1)
1-186: Well-formed example data file for demo mode.This mzML file is properly structured according to the mzML 1.1.0 standard and provides comprehensive example mass spectrometry data for the demo workspace. The file includes proper metadata, spectrum data with binary arrays, and chromatogram information that will support the demo mode functionality effectively.
example-data/workspaces/default/flashdeconv/ini/FLASHDeconv.ini (1)
1-81: Comprehensive and well-structured parameter configuration.This FLASHDeconv parameter configuration file is excellently structured with comprehensive parameter definitions covering all aspects of the deconvolution workflow including:
- Input/output file specifications for multiple MS levels
- Algorithmic parameters with proper restrictions and defaults
- Spectral deconvolution, feature tracing, and isobaric quantification settings
- Appropriate parameter organization into logical nodes
The configuration follows OpenMS standards and provides good default values with proper validation constraints.
content/FLASHDeconv/FLASHDeconvSequenceInput.py (6)
8-12: LGTM! Good caching setup with proper path handling.The FileManager initialization correctly uses the workspace and creates a dedicated cache directory for FLASHDeconv sequence data.
14-21: LGTM! Clean cache storage function.The
set_sequence()function properly stores sequence data with optional modification parameters. The data structure is well-organized and consistent.
23-30: LGTM! Robust cache retrieval with proper error handling.The
get_sequence()function correctly checks for cache existence before retrieval and returns a structured tuple. The None return for missing cache is appropriate.
32-35: LGTM! Consistent cache cleanup approach.The modified
emptySequenceInput()function properly removes cached data and sets the reset flag for UI updates, maintaining consistency with the new caching approach.
75-90: LGTM! Well-designed cache-to-session initialization.The logic correctly initializes session state from cached data only when session state keys don't already exist, preventing overwriting user changes. The conditional checks for None values are appropriate.
119-130: LGTM! Proper integration of cache storage in submission flow.The sequence submission correctly processes the input data and saves it to cache using the new
set_sequence()function. The variable assignments and conditional logic are clean and correct.example-data/workspaces/demo_antibody/flashdeconv/ini/FLASHDeconv.ini (5)
1-4: LGTM! Proper XML structure with schema validation.The XML declaration and parameter schema reference are correctly formatted. The version information appears consistent with the development timeline.
5-32: LGTM! Comprehensive I/O and general parameters.The file and output parameters are well-defined with appropriate metadata including supported formats, descriptions, and requirement flags. The threading and debugging options are appropriately configured.
33-43: LGTM! Well-structured FLASHDeconv algorithm parameters.The FD node parameters include appropriate settings for IDA coupling, FDR reporting, and spectrum merging with proper restrictions and default values.
44-63: LGTM! Comprehensive spectral deconvolution parameters.The SD node properly defines tolerance settings, mass/charge ranges, and quality thresholds with appropriate restrictions and list structures for MS level-specific values.
64-77: LGTM! Complete feature tracing and quantification parameters.Both the ft and iq nodes provide comprehensive parameter sets for feature tracing and isobaric quantification with appropriate default values and restrictions.
example-data/workspaces/default/flashtnt/ini/FLASHDeconv.ini (2)
1-4: LGTM! Consistent XML structure with appropriate version.The XML structure matches the previous configuration file. The version difference (FDdevelop vs FVdeploy) appears intentional for different development branches.
5-80: LGTM! Consistent parameter structure across workspaces.The parameter definitions are identical to the demo_antibody configuration, which is appropriate for maintaining consistency across different workspace environments while allowing for potential future customization.
example-data/workspaces/demo_antibody/flashtnt/ini/FLASHDeconv.ini (2)
1-4: LGTM! Consistent versioning within workspace.The file uses the same version as the demo_antibody/flashdeconv configuration, which is appropriate since both are part of the same workspace but serve different tool workflows.
5-80: LGTM! Appropriate parameter reuse across tool workflows.The configuration parameters are identical across FLASHDeconv and FLASHTnT workflows, which promotes consistency and reduces configuration complexity for users working with related tools.
example-data/workspaces/demo_aqpz/flashdeconv/ini/FLASHDeconv.ini (1)
4-4: Verify the tool version matches the demo data.Ensure that the
value="3.1.0-pre-FVdeploy-2025-05-05"aligns with the precomputed outputs in this workspace. If the demo artifacts were generated with a different build, update this accordingly.
| @@ -0,0 +1 @@ | |||
| {"SD:tol": "10.0\n10.0", "FD:report_FDR": "true"} No newline at end of file | |||
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.
Fix JSON boolean type for FDR reporting.
The key "FD:report_FDR" is currently the string "true", which may not be recognized as a boolean. Use a proper boolean literal to avoid parsing issues.
Apply this diff:
- {"SD:tol": "10.0\n10.0", "FD:report_FDR": "true"}
+ {"SD:tol": "10.0\n10.0", "FD:report_FDR": true}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {"SD:tol": "10.0\n10.0", "FD:report_FDR": "true"} | |
| {"SD:tol": "10.0\n10.0", "FD:report_FDR": true} |
🤖 Prompt for AI Agents
In
example-data/workspaces/default/flashdeconv/cache/files/example_fd/FD_parameters.json
at line 1, the value for the key "FD:report_FDR" is a string "true" instead of a
boolean. Change the value from the string "true" to the boolean literal true
without quotes to ensure proper JSON boolean type and avoid parsing issues.
| { | ||
| "mzML-files": [ | ||
| "../workspaces-FLASHApp/demo_aqpz/flashdeconv/input-files/mzML-files/example_spectrum_aqpz.mzML" | ||
| ], | ||
| "threads": 14, | ||
| "FLASHDeconv": { | ||
| "SD:tol": "10.0\n10.0", | ||
| "FD:report_FDR": "true" | ||
| } | ||
| } No newline at end of file |
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.
Fix relative path for mzML-files entry
The current path:
"../workspaces-FLASHApp/demo_aqpz/flashdeconv/input-files/mzML-files/example_spectrum_aqpz.mzML"does not resolve correctly from this directory. Update it to point to the actual input-files folder relative to this file, for example:
- "../workspaces-FLASHApp/demo_aqpz/flashdeconv/input-files/mzML-files/example_spectrum_aqpz.mzML"
+ "../demo_aqpz/flashdeconv/input-files/mzML-files/example_spectrum_aqpz.mzML"or simply:
- "../workspaces-FLASHApp/demo_aqpz/flashdeconv/input-files/mzML-files/example_spectrum_aqpz.mzML"
+ "input-files/mzML-files/example_spectrum_aqpz.mzML"to ensure the file can be located.
🤖 Prompt for AI Agents
In example-data/workspaces/demo_aqpz/flashdeconv/params.json lines 1 to 10, the
relative path for the "mzML-files" entry is incorrect and does not resolve
properly from this file's location. Update the path to correctly point to the
actual "input-files/mzML-files" directory relative to this JSON file, ensuring
the file can be found when accessed.
| if c2.form_submit_button("Add files to workspace", type="primary"): | ||
| if uploaded_files: | ||
| # A list of files is required, since online allows only single upload, create a list | ||
| if type(uploaded_files) != list: |
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.
Fix type comparison to use isinstance().
The current type comparison uses != which is not recommended for type checking. Use isinstance() for better type checking practices.
- if type(uploaded_files) != list:
+ if not isinstance(uploaded_files, list):📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if type(uploaded_files) != list: | |
| if not isinstance(uploaded_files, list): |
🧰 Tools
🪛 Ruff (0.11.9)
98-98: Use is and is not for type comparisons, or isinstance() for isinstance checks
(E721)
🤖 Prompt for AI Agents
In content/FLASHQuant/FLASHQuantFileUpload.py at line 98, replace the type
comparison using 'type(uploaded_files) != list' with 'not
isinstance(uploaded_files, list)' to follow best practices for type checking.
| with st.form('input_files', clear_on_submit=True): | ||
| uploaded_files = st.file_uploader( | ||
| "FLASHDeconv output mzML files or TSV files", accept_multiple_files=True, type=["mzML", "tsv"] | ||
| ) | ||
| with st.form('input_files', clear_on_submit=True): | ||
| uploaded_files = st.file_uploader( | ||
| "FLASHDeconv output mzML files or TSV files", accept_multiple_files=True, type=["mzML", "tsv"] | ||
| ) | ||
| _, c2, _ = st.columns(3) | ||
| if c2.form_submit_button("Add files to workspace", type="primary"): | ||
| if uploaded_files: | ||
| # A list of files is required, since online allows only single upload, create a list | ||
| if type(uploaded_files) != list: | ||
| uploaded_files = [uploaded_files] | ||
|
|
||
| # opening file dialog and closing without choosing a file results in None upload | ||
| process_uploaded_files(uploaded_files) | ||
| st.success("Successfully added uploaded files!") | ||
| else: | ||
| st.warning("Upload some files before adding them.") | ||
| _, c2, _ = st.columns(3) | ||
| if c2.form_submit_button("Add files to workspace", type="primary"): | ||
| if uploaded_files: | ||
| # A list of files is required, since online allows only single upload, create a list | ||
| if type(uploaded_files) != list: | ||
| uploaded_files = [uploaded_files] | ||
|
|
||
| # opening file dialog and closing without choosing a file results in None upload | ||
| process_uploaded_files(uploaded_files) | ||
| st.success("Successfully added uploaded files!") | ||
| else: | ||
| st.warning("Upload some files before adding them.") | ||
|
|
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.
Fix type comparison and approve form logic
The form-based file upload logic is well-structured with proper validation and user feedback. However, there's a type comparison issue that should be addressed.
Apply this diff to fix the type comparison:
- if type(uploaded_files) != list:
+ if not isinstance(uploaded_files, list):The rest of the form submission logic handles file processing correctly with appropriate success/warning messages.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| with st.form('input_files', clear_on_submit=True): | |
| uploaded_files = st.file_uploader( | |
| "FLASHDeconv output mzML files or TSV files", accept_multiple_files=True, type=["mzML", "tsv"] | |
| ) | |
| with st.form('input_files', clear_on_submit=True): | |
| uploaded_files = st.file_uploader( | |
| "FLASHDeconv output mzML files or TSV files", accept_multiple_files=True, type=["mzML", "tsv"] | |
| ) | |
| _, c2, _ = st.columns(3) | |
| if c2.form_submit_button("Add files to workspace", type="primary"): | |
| if uploaded_files: | |
| # A list of files is required, since online allows only single upload, create a list | |
| if type(uploaded_files) != list: | |
| uploaded_files = [uploaded_files] | |
| # opening file dialog and closing without choosing a file results in None upload | |
| process_uploaded_files(uploaded_files) | |
| st.success("Successfully added uploaded files!") | |
| else: | |
| st.warning("Upload some files before adding them.") | |
| _, c2, _ = st.columns(3) | |
| if c2.form_submit_button("Add files to workspace", type="primary"): | |
| if uploaded_files: | |
| # A list of files is required, since online allows only single upload, create a list | |
| if type(uploaded_files) != list: | |
| uploaded_files = [uploaded_files] | |
| # opening file dialog and closing without choosing a file results in None upload | |
| process_uploaded_files(uploaded_files) | |
| st.success("Successfully added uploaded files!") | |
| else: | |
| st.warning("Upload some files before adding them.") | |
| with st.form('input_files', clear_on_submit=True): | |
| uploaded_files = st.file_uploader( | |
| "FLASHDeconv output mzML files or TSV files", accept_multiple_files=True, type=["mzML", "tsv"] | |
| ) | |
| _, c2, _ = st.columns(3) | |
| if c2.form_submit_button("Add files to workspace", type="primary"): | |
| if uploaded_files: | |
| # A list of files is required, since online allows only single upload, create a list | |
| - if type(uploaded_files) != list: | |
| + if not isinstance(uploaded_files, list): | |
| uploaded_files = [uploaded_files] | |
| # opening file dialog and closing without choosing a file results in None upload | |
| process_uploaded_files(uploaded_files) | |
| st.success("Successfully added uploaded files!") | |
| else: | |
| st.warning("Upload some files before adding them.") |
🧰 Tools
🪛 Ruff (0.11.9)
109-109: Use is and is not for type comparisons, or isinstance() for isinstance checks
(E721)
🤖 Prompt for AI Agents
In content/FLASHDeconv/FLASHDeconvWorkflow.py around lines 101 to 117, the type
comparison for uploaded_files uses 'type(uploaded_files) != list', which is not
the recommended way to check types in Python. Replace this with 'not
isinstance(uploaded_files, list)' to correctly check if uploaded_files is not a
list before wrapping it in a list. This change ensures proper type checking and
maintains the existing form submission logic and user feedback.
| { | ||
| "mzML-files": [ | ||
| "../workspaces-FLASHApp/demo_antibody/flashtnt/input-files/mzML-files/example_spectrum_antibody.mzML" | ||
| ], | ||
| "fasta-file": "../workspaces-FLASHApp/demo_antibody/flashtnt/input-files/fasta-file/example_database.fasta", | ||
| "threads": 14, | ||
| "few_proteins": true, | ||
| "FLASHDeconv": { | ||
| "SD:tol": "5\n5", | ||
| "SD:max_charge": 30 | ||
| }, | ||
| "FLASHTnT": { | ||
| "ion_type": "b\ny", | ||
| "tag:min_length": 4 | ||
| } | ||
| } No newline at end of file |
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.
💡 Verification agent
🧩 Analysis chain
Validate configuration parameters and path structure
The JSON configuration is well-structured and follows a logical parameter organization. However, please verify the following:
- Path consistency: Ensure the relative paths to mzML and FASTA files exist in the target workspace structure
- Threading configuration: The
threads: 14setting should match the expected deployment environment - Parameter format: The newline-separated values in
"SD:tol": "5\n5"and"ion_type": "b\ny"appear to be intentional multi-line parameters
Run this script to verify the referenced files exist:
🏁 Script executed:
#!/bin/bash
# Description: Verify that the referenced input files exist in the workspace structure
# Check if the mzML file exists
echo "Checking mzML file..."
fd "example_spectrum_antibody.mzML" example-data/workspaces/demo_antibody/
# Check if the FASTA file exists
echo "Checking FASTA file..."
fd "example_database.fasta" example-data/workspaces/demo_antibody/
# List the workspace structure for context
echo "Workspace structure:"
fd . example-data/workspaces/demo_antibody/ --type d --max-depth 3Length of output: 1555
Fix broken relative paths in flashtnt/params.json
The files exist under flashtnt/input-files/..., but the JSON is pointing at a non-existent ../workspaces-FLASHApp/... directory. Please update the paths and confirm multi-line values are supported:
- File:
example-data/workspaces/demo_antibody/flashtnt/params.json
• Change"mzML-files": [
-
"../workspaces-FLASHApp/demo_antibody/flashtnt/input-files/mzML-files/example_spectrum_antibody.mzML"
-
],
"input-files/mzML-files/example_spectrum_antibody.mzML"
"fasta-file": "../workspaces-FLASHApp/demo_antibody/flashtnt/input-files/fasta-file/example_database.fasta"to ```json "fasta-file": "input-files/fasta-file/example_database.fasta"
- Verify that
"SD:tol": "5\n5"and"ion_type": "b\ny"are accepted by FLASHDeconv and FLASHTnT (or consider using arrays if required).
🤖 Prompt for AI Agents
In example-data/workspaces/demo_antibody/flashtnt/params.json lines 1 to 16, the
relative paths for "mzML-files" and "fasta-file" point to a non-existent
../workspaces-FLASHApp directory. Update these paths to be relative to the
current directory, e.g., change "fasta-file" to
"input-files/fasta-file/example_database.fasta" and similarly adjust the mzML
file path. Also, verify with the FLASHDeconv and FLASHTnT tools that multi-line
string values like "SD:tol": "5\n5" and "ion_type": "b\ny" are supported; if
not, convert these parameters to arrays or another supported format.
| def get_sequence(): | ||
| # Check if layout has been set | ||
| if not file_manager.result_exists('sequence', 'sequence'): | ||
| return None | ||
| # fetch layout from cache | ||
| sequence = file_manager.get_results('sequence', 'sequence')['sequence'] | ||
|
|
||
| return sequence['input_sequence'], sequence['fixed_mod_cysteine'], sequence['fixed_mod_methionine'] |
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.
🛠️ Refactor suggestion
Add error handling for cache operations.
The function should handle potential exceptions from file manager operations to prevent runtime errors if the cache is corrupted or inaccessible.
def get_sequence():
# Check if layout has been set
if not file_manager.result_exists('sequence', 'sequence'):
return None
- # fetch layout from cache
- sequence = file_manager.get_results('sequence', 'sequence')['sequence']
-
- return sequence['input_sequence'], sequence['fixed_mod_cysteine'], sequence['fixed_mod_methionine']
+ try:
+ # fetch sequence from cache
+ sequence = file_manager.get_results('sequence', 'sequence')['sequence']
+ return sequence['input_sequence'], sequence['fixed_mod_cysteine'], sequence['fixed_mod_methionine']
+ except (KeyError, TypeError) as e:
+ # Handle corrupted cache data
+ return None📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| def get_sequence(): | |
| # Check if layout has been set | |
| if not file_manager.result_exists('sequence', 'sequence'): | |
| return None | |
| # fetch layout from cache | |
| sequence = file_manager.get_results('sequence', 'sequence')['sequence'] | |
| return sequence['input_sequence'], sequence['fixed_mod_cysteine'], sequence['fixed_mod_methionine'] | |
| def get_sequence(): | |
| # Check if layout has been set | |
| if not file_manager.result_exists('sequence', 'sequence'): | |
| return None | |
| try: | |
| # fetch sequence from cache | |
| sequence = file_manager.get_results('sequence', 'sequence')['sequence'] | |
| return sequence['input_sequence'], sequence['fixed_mod_cysteine'], sequence['fixed_mod_methionine'] | |
| except (KeyError, TypeError) as e: | |
| # Handle corrupted cache data | |
| return None |
🤖 Prompt for AI Agents
In content/FLASHDeconv/FLASHDeconvLayoutManager.py around lines 39 to 46, the
get_sequence function lacks error handling for file_manager operations, which
may raise exceptions if the cache is corrupted or inaccessible. Wrap the calls
to file_manager.result_exists and file_manager.get_results in a try-except block
to catch potential exceptions, and handle them gracefully by returning None or
logging the error as appropriate to prevent runtime crashes.
| <scan > | ||
| <cvParam cvRef="MS" accession="MS:1000016" name="scan start time" value="4.41005058" unitAccession="UO:0000010" unitName="second" unitCvRef="UO" /> | ||
| <userParam name="MS:1000927" type="xsd:double" value="199.999997756223991" unitAccession="UO:0000028" unitName="millisecond" unitCvRef="UO"/> | ||
| <userParam name="MS:1000927" type="xsd:string" value="199.999997756224" unitAccession="UO:0000028" unitName="millisecond" unitCvRef="UO"/> |
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.
Potential type regression on MS:1000927
The scan duration userParam changed from xsd:double to xsd:string while still holding a numeric value (199.999997756224).
Code that casts the value to float will now receive a string and may raise ValueError/TypeMismatch.
Please confirm no deserialiser relies on the original type. Reverting to xsd:double is the safest.
🤖 Prompt for AI Agents
In
example-data/workspaces/demo_aqpz/flashdeconv/cache/files/example_spectrum_aqpz_20250525-092833/anno_annotated.mzML
at line 101, the userParam for MS:1000927 has changed its type from xsd:double
to xsd:string while still holding a numeric value. This may cause type errors
when code expects a float. To fix this, revert the type attribute back to
xsd:double to maintain type consistency and avoid deserialization issues.
| if type(uploaded_file) != list: | ||
| uploaded_file = [uploaded_file] |
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.
Fix type comparison to use isinstance().
Use isinstance() instead of type() for type checking as recommended by Python best practices and flagged by static analysis.
- if type(uploaded_file) != list:
+ if not isinstance(uploaded_file, list):📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if type(uploaded_file) != list: | |
| uploaded_file = [uploaded_file] | |
| if not isinstance(uploaded_file, list): | |
| uploaded_file = [uploaded_file] |
🧰 Tools
🪛 Ruff (0.11.9)
105-105: Use is and is not for type comparisons, or isinstance() for isinstance checks
(E721)
🤖 Prompt for AI Agents
In content/FLASHTnT/FLASHTnTWorkflow.py around lines 105 to 106, replace the
type comparison using `type(uploaded_file) != list` with `not
isinstance(uploaded_file, list)` to follow Python best practices and improve
code reliability.
| def validate_selected_index(file_manager, selected_experiment): | ||
| results = file_manager.get_results_list( | ||
| ['deconv_dfs', 'anno_dfs', 'tag_dfs', 'protein_dfs'] | ||
| ) | ||
| if selected_experiment in st.session_state: | ||
| if st.session_state[selected_experiment] in results: | ||
| return name_to_index[st.session_state[selected_experiment]] | ||
| else: | ||
| del st.session_state[selected_experiment] | ||
| return None |
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.
Fix variable scoping issue in validate_selected_index function.
The function references name_to_index which is defined later in the file (line 64). This creates a potential runtime error if the function is called before name_to_index is initialized.
Consider moving the name_to_index definition before this function or passing it as a parameter:
-def validate_selected_index(file_manager, selected_experiment):
+def validate_selected_index(file_manager, selected_experiment, name_to_index):
results = file_manager.get_results_list(
['deconv_dfs', 'anno_dfs', 'tag_dfs', 'protein_dfs']
)
if selected_experiment in st.session_state:
if st.session_state[selected_experiment] in results:
return name_to_index[st.session_state[selected_experiment]]
else:
del st.session_state[selected_experiment]
return NoneThen update all function calls to pass the name_to_index parameter.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In content/FLASHTnT/FLASHTnTViewer.py around lines 26 to 35, the function
validate_selected_index uses the variable name_to_index which is defined later
at line 64, causing a potential runtime error due to variable scoping. To fix
this, move the definition of name_to_index above the validate_selected_index
function or modify validate_selected_index to accept name_to_index as a
parameter and update all calls to this function to pass name_to_index
accordingly.
| <ITEM name="in" value="" type="input-file" description="Input file in mzML format. " required="true" advanced="false" supported_formats="*.mzML" /> | ||
| <ITEM name="out" value="" type="output-file" description="Default output tsv file containing deconvolved features" required="true" advanced="false" supported_formats="*.tsv" /> | ||
| <ITEM name="out_spec1" value="" type="output-file" description="Output tsv file for deconvolved MS1 spectra. Use -out_spec2, ..., -out_spec4 for MS2, ..., MS4 spectra." required="false" advanced="false" supported_formats="*.tsv" /> | ||
| <ITEM name="out_spec2" value="" type="output-file" description="Output TSV files for deconvolved MS2 spectra." required="false" advanced="true" supported_formats="*.tsv" /> | ||
| <ITEM name="out_spec3" value="" type="output-file" description="Output TSV files for deconvolved MS3 spectra." required="false" advanced="true" supported_formats="*.tsv" /> | ||
| <ITEM name="out_spec4" value="" type="output-file" description="Output TSV files for deconvolved MS4 spectra." required="false" advanced="true" supported_formats="*.tsv" /> | ||
| <ITEM name="out_mzml" value="" type="output-file" description="Output mzML file containing deconvolved spectra (for all MS levels)." required="false" advanced="false" supported_formats="*.mzML" /> | ||
| <ITEM name="out_quant" value="" type="output-file" description="Output tsv file with isobaric quantification results for MS2 spectra." required="false" advanced="false" supported_formats="*.tsv" /> | ||
| <ITEM name="out_annotated_mzml" value="" type="output-file" description="Output annotated mzML file with monoisotopic mass, charge, and isotope index metadata for peaks. Unannotated peaks are also retained without metadata." required="false" advanced="false" supported_formats="*.mzML" /> |
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.
🛠️ Refactor suggestion
Pre-fill demo-specific paths for inputs and outputs.
Since this is a demo workspace, populate the value attributes for in, out, out_spec*, out_mzml, out_quant, and out_annotated_mzml with the corresponding precomputed example files (for example, ../mzML/demo_run.mzML and ../cache/out_deconv.tsv). This ensures users can immediately load results offline without manual configuration.
🤖 Prompt for AI Agents
In example-data/workspaces/demo_aqpz/flashdeconv/ini/FLASHDeconv.ini lines 6 to
14, the value attributes for input and output file items are empty. Populate
these value attributes with demo-specific example file paths such as
'../mzML/demo_run.mzML' for the input and corresponding precomputed output files
like '../cache/out_deconv.tsv' for outputs including out, out_spec1, out_spec2,
out_spec3, out_spec4, out_mzml, out_quant, and out_annotated_mzml to enable
immediate offline use without manual setup.
This PR
Summary by CodeRabbit
New Features
Bug Fixes
Chores