Andres Suarez

Generation

code to explanationWed, 12 Apr 2023

data <- read.table("D:/USUARIO/OneDrive/Documents/Analisis de datos/Metaboanalist/importan Features POS/composite spectra.csv", header = TRUE, sep = ",") control_data <- data[, c("m.z", "RT", "Control", "Control.1", "Control.2", "Control.3", "Control.4", "Control.5", "Control.6", "Control.7", "Control.8")] treatment_data <- data[, c("m.z", "RT", "Treatment", "Treatment.1", "Treatment.2", "Treatment.3", "Treatment.4", "Treatment.5", "Treatment.6", "Treatment.7", "Treatment.8" )] myRawData <- readMSData(control_data, mzCol = 1, rtCol = 2, intensityCol = 3) control_raw <- xcmsRaw(control_data, profmethod = "bin") control_norm <- normalize(control_raw, method = "median") control_normalized_data <- as.data.frame(control_norm) control_data_norm <- normalize(control_data[, -c(1, 2)]) treatment_data_norm <- normalize(treatment_data[, -c(1, 2)])

The function readMSData allows reading data from several formats. Here, we read the data from a csv file, therefore we use the read.table function. The csv file contains the m/z, retention time and intensity values of the metabolomic profiles for each sample (n = 9 samples per group). Then, we use the xcmsRaw function to read the raw data from the csv file. The normalize function normalizes the data to the median. Therefore, we can compare the relative intensities between samples.

Want to kickstart your project?Use the new AI Studio to create your code