Skip to content

Add support for .dia file format and improve file format documentation - #623

Merged
ypriverol merged 8 commits into
devfrom
copilot/add-dia-file-support
Dec 9, 2025
Merged

ypriverol merged 8 commits into
devfrom
copilot/add-dia-file-support

Conversation

Copilot AI commented Dec 8, 2025 •

Copy link
Copy Markdown
Contributor

Add support for .dia file format and improve file format documentation ✅

This PR implements support for the .dia file format as requested in the issue. The changes enable users to use .dia files directly with the quantms pipeline without needing to convert them to another format first.

Changes Made:

  • File preparation workflow (subworkflows/local/file_preparation/main.nf)

    • Added .dia to file extension branching logic
    • .dia files are passed through without conversion (DIA-NN handles them natively)
    • Added validation for unsupported file formats with clear warning messages
    • Warning shows count of unsupported files and lists each one explicitly
    • Added clear comments explaining that .dia files bypass peak picking
  • SDRF parsing (modules/local/sdrf_parsing/main.nf)

    • Removed unnecessary compression handling for .dia files (binary format that isn't compressed)
  • Schema update (nextflow_schema.json)

    • Updated local_input_type parameter documentation to include all supported formats: 'mzML', 'raw', 'd', 'dia'
    • Clarified that compression is only supported for 'mzML', 'raw', and 'd' formats
  • Documentation updates

    • Added comprehensive "Supported file formats" section to README.md
    • Added comprehensive "Supported file formats" section to docs/usage.md
    • Documented all supported formats: .raw, .mzML, .d, .dia
    • Clarified that .dia is a binary format and compression is only supported for .raw, .mzML, and .d
    • Fixed prettier formatting issues

Implementation Details:

The implementation follows the same pattern as .d file handling when convert_dotd is false:

  • Files are recognized by the .dia extension
  • No format conversion is applied
  • Files are passed directly to DIA-NN which supports this format natively
  • .dia is a binary format and does not support compression

Validation and Error Handling:

  • Unsupported file formats are now detected early and trigger a clear warning message
  • Warning collects all unsupported files and displays them in a formatted list with count
  • Users are informed which formats are supported
  • Unsupported files are automatically skipped from processing

Testing:

  • JSON schema validated successfully
  • Code review completed and feedback addressed
  • Prettier formatting validated
  • Security scan (CodeQL) passed with no issues
  • Changes follow existing codebase patterns
Original prompt

This section details on the original issue you should resolve

<issue_title>Support for .dia file format in quantms pipeline</issue_title>
<issue_description>### Description of feature

Hello quantms team,

I would like to request the addition of support for the .dia file format as an input option in the quantms pipeline. Currently, as per the documentation and community feedback, the pipeline supports .raw, .mzML, and Bruker .d file formats. However, .dia files are not supported as input at this time.

Given that DIA-NN is capable of handling .dia files directly, implementing support for this format would enhance the flexibility and usability of the quantms pipeline. This would enable users who work with .dia files to directly utilise the pipeline without having to convert file formats beforehand, thus streamlining the workflow.

This feature would be valuable for users who generate .dia files and wish to take advantage of quantms's capabilities without needing additional file conversion steps. It would improve the pipeline's versatility and cater to a wider range of workflows.

Thank you for considering this feature request.</issue_description>

Comments on the Issue (you are @copilot in this section)

@ypriverol @hosseinvk How this `.dia` get obtained? It is a pre-conversion from `.d` -> `.dia`? @daichengxin Thanks @hosseinvk , We will trying to support `.dia` format input.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


PR Type

Enhancement


Description

  • Add .dia file format support to pipeline input handling

  • Implement file format validation with unsupported format warnings

  • Document all supported formats and compressed variants comprehensively

  • Update SDRF parsing for .dia compressed file decompression


Diagram Walkthrough

flowchart LR
  Input["Input Files<br/>(.raw, .mzML, .d, .dia)"]
  Branch["File Format<br/>Branching"]
  Validation["Unsupported Format<br/>Detection & Warning"]
  DiaPass["DIA Files<br/>Pass Through"]
  Conversion["Format Conversion<br/>(raw, mzML, .d)"]
  Results["Pipeline Results"]
  
  Input --> Branch
  Branch --> Validation
  Validation --> DiaPass
  Branch --> Conversion
  DiaPass --> Results
  Conversion --> Results
Loading

File Walkthrough

Relevant files
Documentation
README.md
Document supported file formats and variants                         

README.md

  • Added "Supported file formats" section documenting .raw, .mzML, .d,
    and .dia formats
  • Listed all supported compressed variants (.gz, .tar, .tar.gz, .zip)
  • Clarified format-specific handling (conversion behavior for each type)
+16/-0   
usage.md
Add file format documentation to usage guide                         

docs/usage.md

  • Added "Supported file formats" section with detailed format
    descriptions
  • Documented compressed variant support for all formats
  • Updated file column description to reference "mass spectra files"
    instead of "raw or mzML files"
+17/-1   
nextflow_schema.json
Update schema documentation for file type parameter           

nextflow_schema.json

  • Updated local_input_type parameter help text to include 'd' and 'dia'
    as valid options
  • Added documentation for compressed variant support (.gz, .tar,
    .tar.gz, .zip)
  • Clarified that letter case must match file extensions exactly
+1/-1     
Enhancement
main.nf
Add .dia compressed format decompression rules                     

modules/local/sdrf_parsing/main.nf

  • Added extension conversion rules for compressed .dia variants
    (.dia.gz, .dia.tar.gz, .dia.tar, .dia.zip)
  • Configured decompression to preserve .dia extension after extraction
  • Added comments explaining .dia native handling by DIA-NN
+3/-0     
main.nf
Implement .dia branching and format validation                     

subworkflows/local/file_preparation/main.nf

  • Added .dia branch to file format branching logic
  • Implemented unsupported file format detection with comprehensive
    warning message
  • Added .dia file pass-through without conversion (DIA-NN native
    handling)
  • Warning displays count and lists all unsupported files explicitly
+22/-0   

@coderabbitai

coderabbitai Bot commented Dec 8, 2025 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Add support for .dia file format in quantms pipeline Add support for .dia file format Dec 8, 2025
Copilot AI requested a review from jpfeuffer December 8, 2025 16:59
@jpfeuffer

Copy link
Copy Markdown
Collaborator

@copilot make sure to warn early if unsupported file formats are specified. Tell the user that they will be skipped from processing.
Make sure that the param docs and global docs are in sync with the supported formats. Looks like ".d" and tarred/tar.gzipped formats are not documented.

Copilot AI commented Dec 8, 2025

Copy link
Copy Markdown
Contributor Author

@copilot make sure to warn early if unsupported file formats are specified. Tell the user that they will be skipped from processing.
Make sure that the param docs and global docs are in sync with the ...

I've implemented all the requested changes in commit 2eaf584:

  1. Early warning for unsupported formats: Added validation in the file preparation workflow that detects unsupported file formats and warns users they will be skipped, listing all supported formats.

  2. Documentation sync: Updated all documentation to include comprehensive file format support:

    • README.md: Added "Supported file formats" section
    • docs/usage.md: Added "Supported file formats" section
    • nextflow_schema.json: Updated local_input_type parameter help text
  3. Complete format listing: All supported formats are now documented:

    • .raw (Thermo RAW files)
    • .mzML (open standard)
    • .d (Bruker timsTOF)
    • .dia (DIA-NN native)
    • All compressed variants (.gz, .tar, .tar.gz, .zip)

Copilot AI changed the title Add support for .dia file format Add support for .dia file format and improve file format documentation Dec 8, 2025
@github-actions

github-actions Bot commented Dec 8, 2025

Copy link
Copy Markdown

This PR is against the master branch ❌

  • Do not close this PR
  • Click Edit and change the base to dev
  • This CI test will remain failed until you push a new commit

Hi @Copilot,

It looks like this pull-request is has been made against the bigbio/quantms master branch.
The master branch on nf-core repositories should always contain code from the latest release.
Because of this, PRs to master are only allowed if they come from the bigbio/quantms dev branch.

You do not need to close this PR, you can change the target branch to dev by clicking the "Edit" button at the top of this page.
Note that even after this, the test will continue to show as failing until you push a new commit.

Thanks again for your contribution!

@ypriverol
ypriverol changed the base branch from master to dev December 8, 2025 19:03
@github-actions

github-actions Bot commented Dec 8, 2025 •

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 432d2e7

+| ✅ 111 tests passed       |+
#| ❔  19 tests were ignored |#
#| ❔   1 tests had warnings |#
!| ❗   1 tests had warnings |!
Details

❗ Test warnings:

  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here

❔ Tests ignored:

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 3.5.1
  • Run at 2025-12-09 10:11:29

@ypriverol

Copy link
Copy Markdown
Contributor

@copilot you have issues with prettier:

Run pre-commit run --all-files
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:[email protected].
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
prettier.................................................................Failed
- hook id: prettier
- files were modified by this hook

README.md

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
Error: Process completed with exit code 1.

Copilot AI commented Dec 8, 2025

Copy link
Copy Markdown
Contributor Author

@copilot you have issues with prettier:

...

Fixed in commit 6de67c4. Prettier required a blank line before the bulleted list in the "Compressed variants" section of README.md.

Copilot AI requested a review from ypriverol December 8, 2025 19:09
@ypriverol
ypriverol marked this pull request as ready for review December 9, 2025 08:56
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
⚪
Log injection risk

Description: The unsupported file format warning uses string interpolation of file paths directly in
logs without sanitization, which could allow terminal log injection if a maliciously
crafted filename contains control sequences (e.g., newline or ANSI escapes) leading to
misleading or manipulated logs.
main.nf [51-64]

Referred Code
ch_branched_input.unsupported
    .collect()
    .subscribe { files ->
        if (files.size() > 0) {
            log.warn "=" * 80
            log.warn "WARNING: ${files.size()} file(s) with unsupported format(s) detected and will be SKIPPED from processing:"
            files.each { meta, file ->
                log.warn "  - ${file}"
            }
            log.warn "\nSupported formats: .raw, .mzML, .d (Bruker), .dia"
            log.warn "Compressed variants (.gz, .tar, .tar.gz, .zip) are also supported."
            log.warn "=" * 80
        }
    }
Ticket Compliance
⚪
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
⚪
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

⚪
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
Logging Context: The new warning for unsupported file formats logs a count and file names but does not
include user identity or a clear action outcome structure as required for comprehensive
audit trails.

Referred Code
ch_branched_input.unsupported
    .collect()
    .subscribe { files ->
        if (files.size() > 0) {
            log.warn "=" * 80
            log.warn "WARNING: ${files.size()} file(s) with unsupported format(s) detected and will be SKIPPED from processing:"
            files.each { meta, file ->
                log.warn "  - ${file}"
            }
            log.warn "\nSupported formats: .raw, .mzML, .d (Bruker), .dia"
            log.warn "Compressed variants (.gz, .tar, .tar.gz, .zip) are also supported."
            log.warn "=" * 80
        }

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Unsupported Files Handling: Unsupported file formats are only warned and skipped without explicit downstream
validation or mechanism to fail fast or surface this condition in a structured way for
pipeline control.

Referred Code
ch_branched_input.unsupported
    .collect()
    .subscribe { files ->
        if (files.size() > 0) {
            log.warn "=" * 80
            log.warn "WARNING: ${files.size()} file(s) with unsupported format(s) detected and will be SKIPPED from processing:"
            files.each { meta, file ->
                log.warn "  - ${file}"
            }
            log.warn "\nSupported formats: .raw, .mzML, .d (Bruker), .dia"
            log.warn "Compressed variants (.gz, .tar, .tar.gz, .zip) are also supported."
            log.warn "=" * 80
        }

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
Input Validation Scope: The new branching accepts .dia files and logs unsupported ones, but the diff does not show
validation of file content or sanitization beyond extension checks, which may rely on
external steps not visible here.

Referred Code
raw: hasExtension(it[1], '.raw')
mzML: hasExtension(it[1], '.mzML')
dotd: hasExtension(it[1], '.d')
dia: hasExtension(it[1], '.dia')
unsupported: true

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Prevent passing incompatible files to process

Isolate .dia files into a separate channel instead of mixing them into
ch_results to prevent passing them to the MZML_STATISTICS process, which cannot
handle them.

subworkflows/local/file_preparation/main.nf [104-106]

 // Pass through .dia files without conversion (DIA-NN handles them natively)
 // Note: .dia files bypass peak picking (when enabled) as they are only used with DIA-NN
-ch_results = ch_results.mix(ch_branched_input.dia)
+ch_results_dia = ch_branched_input.dia
  • Apply / Chat
Suggestion importance[1-10]: 10

__

Why: This suggestion correctly identifies a critical bug where incompatible .dia files are passed to the MZML_STATISTICS process, which would cause a pipeline failure.

High
  • More

@ypriverol

Copy link
Copy Markdown
Contributor

@copilot can we open an issue that make clear we need a test for this use case in the future?

Copilot AI commented Dec 9, 2025

Copy link
Copy Markdown
Contributor Author

@copilot can we open an issue that make clear we need a test for this use case in the future?

I don't have permissions to create issues directly. However, here's what the issue should contain:

Title: Add test coverage for .dia file format support

Description:

  • Test that .dia files are correctly recognized and passed through to DIA-NN without conversion
  • Test compressed .dia variants (.dia.gz, .dia.tar.gz, .dia.tar, .dia.zip) are properly decompressed while preserving the .dia extension
  • Test that .dia files bypass OpenMS peak picking when enabled
  • Test validation: unsupported file formats trigger appropriate warnings

Test data needed: Sample .dia file(s) that can be added to the test dataset repository.

Comment thread modules/local/sdrf_parsing/main.nf Resolved
@ypriverol
ypriverol merged commit c482ab1 into dev Dec 9, 2025
@ypriverol
ypriverol deleted the copilot/add-dia-file-support branch January 8, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Support for .dia file format in quantms pipeline

3 participants