Skip to contents

Even after alignment of spectra, alignment of individual signals is not always perfect, as a segment-wise alignment is performed i.e. groups of signals are aligned. For further improvements, partly filled neighboring columns are merged.

Usage

combine_peaks(shifted_mat, range, lower_bound, spectrum_data, data_path)

Arguments

shifted_mat

(matrix) the matrix obtained after alignment by speaq.

range

(positive integer) amount of adjacent columns which are permitted to be used for improving the alignment e.g. 5

lower_bound

(positive integer) amount of columns that need to be skipped (f.e. because they contain rownames instead of values, only modify in case of errors) default=1.

spectrum_data

(data frame) The output generated by the function generate_lorentz_curves

data_path

(string) Path to the parent folder 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

Details

As result two .csv files will be generated. One that contain all columns for each data point in the original spectrum one column (aligned_res_long.csv) and one where all columns that contain only zeros (aligned_res_short.csv) are omitted. Both files will be stored in the directory specified by data_path.

Examples

if (FALSE) {
aligned_res <- combine_peaks(
  after_speaq_mat,
  range,
  lower_bound,
  spectrum_data,
  data_path
)
}