Skip to content

[WIP] Adding mzTab-M file import#128

Open
NorStorz wants to merge 14 commits intoipb-halle:develfrom
NorStorz:feature/mztabmImport
Open

[WIP] Adding mzTab-M file import#128
NorStorz wants to merge 14 commits intoipb-halle:develfrom
NorStorz:feature/mztabmImport

Conversation

@NorStorz
Copy link
Contributor

@NorStorz NorStorz commented Oct 7, 2025

Implements readMzTabM() function to import mzTab-M files and convert them to QFeatures objects.

  • New readMzTabM() function in R/readMzTabM.R
  • Parses mzTab-M files using rmzTabM package
  • Converts SMF and SML sections to QFeatures with SummarizedExperiment objects
  • Merges metadata from MTD section (assay, sample, ms_run, study_variable)
  • Handles linkages between SML and SMF sections
  • Renames rowData columns to match MetFamily naming conventions

Current Status

  • Basic functionality is working - can successfully create QFeatures objects from mzTab-M files.

Remaining Work

  • Unit tests

@NorStorz NorStorz marked this pull request as ready for review October 27, 2025 13:19
@NorStorz
Copy link
Contributor Author

Addresses #106

# Merge assay, sample, ms_run, and study_variable metadata
if ("sample_ref" %in% names(assay_tab)) assay_tab$sample_id <- assay_tab$sample_ref
if ("ms_run_ref" %in% names(assay_tab)) assay_tab$ms_run_id <- assay_tab$ms_run_ref
if (!is.null(sample_tab) && "sample_id" %in% names(assay_tab))
Copy link
Contributor

@gpatoine gpatoine Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below: Please add curly brackets for if-statement contents on a different line.

# Build SummarizedExperiment for a section
build_se <- function(tab, id_col, cd) {
qcols <- get_assay_quant_cols(tab)
if (!length(qcols)) stop("No abundance_assay[...] columns in ", id_col, " section.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with curly brackets here.

}

# Cast regular fields to wide
regular_wide <- reshape(regular_df, idvar = idvar, timevar = field_col, v.names = value_col, direction = "wide")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting a warning: "some constant variables (field) are really varying". Is that an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants