import_data()
takes two file paths, one for the pre-processed feature
table and one for sample metadata. Both files should be .csv.
Details
mpactr requires a peak table and meta data as input. Files are expected to be comma separated files (.csv).
peak_table
: a peak table where rows are expected to be compounds. mpactr supports import of feature table files from multiple tools through theformat
argument. Currently supported value forformat
are "Progenesis", "Metaboscape", or "None".
format
= "Progensis" allows users to provide a feature table exported by
Progenesis. To export a compatable peak table in Progenesis, navigate to the
Review Compounds tab then File -> Export Compound Measurements. Select
the following properties: Compound, m/z, Retention time (min), and Raw
abundance and click ok.
format
= "Metaboscape" allows users to provide a feature table exported by
Metaboscape with default settings. The import function will save the raw peak
table in the mpactr_object
and store a formatted peak table for filtering.
Reformatting includes selecting "FEATURE_ID", "RT", "PEPMASS", and sample
columns. Sample columns are determined from the "Injection" column in
meta_data
(see below). "PEPMASS" is converted to m/z using the "ADDUCT"
column and compound metadata columns are renamed for mpactr.
format
= "None" allows users to provide a feature table file in the
expected format. This can be useful if you have a file from another tool and
want to manually format it in R. The table rows are expected to be individual
features, while columns are compound metadata and samples. The feature table
must have the compound metadata columns "Compound", "mz", and "rt". Where
"Compound" is the compound id, and can be numeric
or character
. "mz" is
the compound m/z, and should be numeric
. "rt" is the retention time, in
mintues, and should be numeric
. The remaining columns should be samples,
and match the names in the "Injection" column of the meta_data
file.
2. meta_data
: a table with sample information. Either a file path or
data.frame
can be supplied. At minimum the following columns are expected:
"Injection", "Sample_Code", and "Biological_Group". "Injection" is the sample
name and is expected to match sample column names in the peak_table
.
"Sample_Code" is the id for technical replicate groups. "Biological_Group"
is the id for biological replicate groups. Other sample metadata can be
added, and is encouraged for downstream analysis following filtering with
mpactr.
Examples
data <- import_data(
example_path("coculture_peak_table.csv"),
example_path("metadata.csv"),
format = "Progenesis"
)
meta_data <- read.csv(example_path("metadata.csv"))
data <- import_data(example_path("coculture_peak_table.csv"),
meta_data,
format = "Progenesis"
)