merge_sampleID: Merge sample ID with the array data

View source: R/read_files_functions.R

merge_sampleIDR Documentation

Merge sample ID with the array data

Description

A generic function that merges the protein data with the sample identifiers or sample names. If the file does not have sample identifiers the function generates it automatically.

Usage

merge_sampleID(iden, data_files, genepix_vars, method)

Arguments

iden

A character indicating the name of the object to be used under data_files.

data_files

A list of data objects with names utilised by iden.

genepix_vars

A list of specific definitions of the experiment design. See array_vars.

method

A description of the background correction to be used. See bg_correct.

Value

a data frame merged with corresponding sample ID's. The sample ID are specified in the sample ID files

Examples

## Not run:
### Define the genepix_vars
genepix_vars <- array_vars(
  channel = "635",
  chip_path = system.file("extdata", "array_data/machine1/",
   package="protGear"),
  totsamples = 21,
  blockspersample = 2,
  mig_prefix = "_first",
  machine = 1,
  ## optional
  date_process = "0520"
)

## the path where the micro-array data is located
data_path <- paste0(genepix_vars$chip_path)
filenames <- list.files(genepix_vars$chip_path,
                        pattern = "*.txt$|*.gpr$", full.names = FALSE
)
## create a list of all the files
data_files <- purrr::map(
 .x = filenames,
  .f = read_array_files,
  data_path = data_path,
  genepix_vars = genepix_vars
)
data_files <- purrr::set_names(data_files, 
purrr::map(filenames, name_of_files))
## merge the lab data with samples and perform bg correction
merge_sampleID(iden = "KK2-06", data_files = data_files,
               genepix_vars =genepix_vars,method = "subtract_global" )
## End(Not run)

Keniajin/protGear documentation built on Feb. 6, 2023, 6:28 p.m.