This function converts data from MS-Dial into a mass_dataset object. It reads the data either from a given data frame or from a file and processes it to create a mass_dataset object.

convert_msdial2mass_dataset(x, path = ".", file_name)

Arguments

x

A data frame containing MS-Dial data. If missing, the function will read from a file.

path

The directory where the file is located. Default is the current directory.

file_name

The name of the file to read if x is missing.

Value

A mass_dataset object containing the processed MS-Dial data.

Details

The function reads MS-Dial data and processes it to create a mass_dataset object. It extracts sample information, variable information, and expression data. It also performs checks to ensure the data is correctly formatted.

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

##if you want to read the msdital table,
##use this function
## table <- read.table("msdial_table.csv", sep = ",")
data("msdial_table")
object =
  convert_msdial2mass_dataset(x = msdial_table)
object
#> -------------------- 
#> massdataset version: 1.0.28 
#> -------------------- 
#> 1.expression_data:[ 3751 x 20 data.frame]
#> 2.sample_info:[ 20 x 5 data.frame]
#> 20 samples:W03.01 W03.02 W03.03 ... W30.09 W30.10
#> 3.variable_info:[ 3751 x 32 data.frame]
#> 3751 variables:0 1 2 ... 6716 6717
#> 4.sample_info_note:[ 5 x 2 data.frame]
#> 5.variable_info_note:[ 32 x 2 data.frame]
#> 6.ms2_data:[ 0 variables x 0 MS2 spectra]
#> -------------------- 
#> Processing information
#> 1 processings in total
#> create_mass_dataset ---------- 
#>       Package                 Function.used                Time
#> 1 massdataset convert_msdial2mass_dataset() 2023-10-01 23:24:17