Skip to contents

function to generate feature matrix

Usage

gen_feat_mat(data_path, ppm_range, si_size_real_spectrum, scale_factor_x)

Arguments

data_path

(string): path to the parent folder of where the original spectra are stored. After deconvolution this folder also contains for each spectrum two .txt files which contain for each spectrum the spectrum approximated from all deconvoluted signals and a parameter file that contains all numerical values of the deconvolution

ppm_range

(numeric) this is the result from the function get_ppm_range i.e the ppm range over which your signals are distributed

si_size_real_spectrum

(positive integer) number of real data points in your original spectra, e.g. 128k = 131072 data points

scale_factor_x

(positive integer): A factor which is used to avoid rounding errors e.g. 1000

Details

The output of this function is a data frame containing a matrix of all integral values found in your spectra (data_matrix). Here, each row corresponds to one spectrum and each column to one data point of the spectra, for example 128k data points in each spectrum correspond to 128K columns in the data matrix. Furthermore, a list of all signals(peakList), and individual parameters of the signals are stored in the data structure.

Examples

if (FALSE) {
feat <- gen_feat_mat(
  data_path = data_path,
  ppm_range = ppm_range,
  si_size_real_spectrum=si_size_real_spectrum,
  scale_factor_x=scale_factor
)
}