Skip to content

feat: add helper function for the MTD CV entries - #36

Open
jorainer wants to merge 4 commits into
issue_35from
jomain
Open

feat: add helper function for the MTD CV entries#36
jorainer wants to merge 4 commits into
issue_35from
jomain

Conversation

@jorainer

@jorainer jorainer commented Nov 5, 2025

Copy link
Copy Markdown
Collaborator

- Add a helper function to create the CV entries for the MTD element of an
  mzTab-M (issue #35).
@jorainer
jorainer requested a review from philouail November 5, 2025 14:17
@jorainer

jorainer commented Nov 5, 2025

Copy link
Copy Markdown
Collaborator Author

This re-uses your code from MsIO @philouail . what I would like to have is something like:

mtb_skeleton(...) where the user can specify entries/values for the MTB section and it returns a two column matrix - that could then be further expanded (additional elements added manually) and then written into the mzTab-M file.

Internally, the mtb_skeleton() function will ideally call other helper functions that format/check the input. This PR adds the first one, .cv() that builds the CV ontology definition.

@jorainer
jorainer marked this pull request as draft November 6, 2025 07:45
@jorainer
jorainer marked this pull request as ready for review November 6, 2025 10:20
@jorainer

jorainer commented Nov 6, 2025

Copy link
Copy Markdown
Collaborator Author

Essentially, please check only the MTD.R (and related unit test) file - the rest is re-running devtools::document() on the package.

And to explain, maybe check the @examples of the mtd_skeleton() function (from line 182 on). The idea is to have a function that creates a skeleton metadata section and the user/software developer completes and extends it.

Also, what is currently missing is the sample and ms run information. I will work now on a function to extract that from file names/sample annotations data.frame.

- Add `mtd_ms_run()` function to create the MS run part of the metadata section.
- Add a general documantation entry for MTD definition and export.
@jorainer

jorainer commented Nov 7, 2025

Copy link
Copy Markdown
Collaborator Author

@philouail @gpatoine , quick update: I have now also added a mtd_ms_run() function to define the ms_run fields of the MTD section. That one should be completely covered, with all mandatory and optional fields. I will next work on the assay, sample and study variable parts.

As always, any feedback is welcome, in particular if you spot something that you don't agree. Better to discuss early on than first implementing all and then changing :)

I also added a general MTD documentation to describe there all the individual functions. For now (and to keep development and testing simple) I split the functionality into separate small functions. We can then maybe at the end have one main function that calls all the individual ones. But also, for now, this code is more for the developer and not the user - so that we can e.g. implement export code easily for QFeatures or SummarizedExperiment and XcmsExperiment.

@philouail philouail left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok very minor comments
This was so much work thanks a lot. the documentation is amazing.
I wonder if this is not a bit to much for one single file. but we can discuss repo organization another time with everyone.

Comment thread R/MTD.R
#' for details and more information, in particular on the format of the mzTab-M
#' and on mandatory or optional fields.
#'
#' Generally, MTD data can be categarized into the following parts:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"categarized" typo

Comment thread R/MTD.R
small_molecule_quantification_unit = "[PRIDE, PRIDE:0000330, Arbitrary quantification unit, ]",
small_molecule_feature_quantification_unit = "[PRIDE, PRIDE:0000330, Arbitrary quantification unit, ]",
small_molecule_identification_reliability = "[MS, MS:1002896, compound identification confidence level, ]",
mztab_version = "2.0.0-M") {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

mmm i know this is somewhat a bad idea, but should we control the version ? as writer maybe we should. especially if the specification change and therefore the code change, it would be a way to keep integrity ? I know it's weird but just wanted to discuss it

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