read_featuretable_mzmine: Read a 'full_feature_table' from 'mzmine' into a tidy tibble

View source: R/io.R

read_featuretable_mzmineR Documentation

Read a 'full_feature_table' from 'mzmine' into a tidy tibble

Description

Similar to read_featuretable but specifically for full_feature_table' files created with 'mzmine'. For more information, see the 'mzmine' documentation.

Usage

read_featuretable_mzmine(
  file,
  intensity = "height",
  field_separator = ",",
  label_col = 1,
  import_datafile_cols = FALSE,
  remove_empty_cols = FALSE,
  show_removed_cols = TRUE
)

Arguments

file

A path to a file but can also be a connection or literal data.

intensity

A character that specifies what should be used as the (semi-)quantitative measure. Either "height" or "area".

field_separator

The field separator as specified in 'mzmine'. Usually "," if the file is in common CSV format.

label_col

The index or name (as a character) of the column that will be used to label Features. For example an identifier (e.g., KEGG, CAS, HMDB) or a m/z-RT pair.

import_datafile_cols

Should columns that begin with ⁠datafile:⁠ be imported? Those columns contain sample-specific information, for example the retention time of a feature measured in a specific sample. Usually, this information is not necessary for downstream analysis but it can be used for quality control purposes. If TRUE, ⁠datafile:⁠ columns are imported and the sample names are removed from the column names. This allows for tidy storage of the information in one column per variable.

remove_empty_cols

Either TRUE or FALSE. Should empty columns be removed after reading the feature table? For a more fine-grained control, you can use a combination of read_delim, remove_empty_cols and convert_from_wide.See the respective function documentation for more details.

show_removed_cols

Only relevant if remove_empty_cols = TRUE. If TRUE prints a message that shows which columns were removed.

Value

A tidy tibble.

References

  • H. Wickham, J. Stat. Soft. 2014, 59, DOI 10.18637/jss.v059.i10.

  • H. Wickham, M. Averick, J. Bryan, W. Chang, L. McGowan, R. François, G. Grolemund, A. Hayes, L. Henry, J. Hester, M. Kuhn, T. Pedersen, E. Miller, S. Bache, K. Müller, J. Ooms, D. Robinson, D. Seidel, V. Spinu, K. Takahashi, D. Vaughan, C. Wilke, K. Woo, H. Yutani, JOSS 2019, 4, 1686, DOI 10.21105/joss.01686.

  • “12 Tidy data | R for Data Science,” can be found under https://r4ds.had.co.nz/tidy-data.html, 2023.

Examples

# Read a toy dataset in the format produced with mzmine.

featuretable_path <- system.file("extdata", "toy_mzmine.csv", package = "metamorphr")

# Example 1: Use feature height as the metric
featuretable <- read_featuretable_mzmine(
  featuretable_path,
  intensity = "height"
)

featuretable

# Example 2: Use the 'mz' column as a Feature label
featuretable <- read_featuretable_mzmine(
  featuretable_path,
  label_col = "mz"
)

featuretable

metamorphr documentation built on June 10, 2026, 5:07 p.m.