merge_sample_file: Merge sample / feature file

View source: R/3.0_read_omics.R

merge_sample_fileR Documentation

Merge sample / feature file

Description

Merge sample / feature file

Usage

merge_sample_file(
  object,
  sfile = NULL,
  by.x = "sample_id",
  by.y = "sample_id",
  all.x = TRUE,
  select = NULL,
  stringsAsFactors = FALSE,
  verbose = TRUE
)

merge_ffile(
  object,
  ffile = NULL,
  by.x = "feature_id",
  by.y = "feature_id",
  all.x = TRUE,
  select = NULL,
  stringsAsFactors = FALSE,
  verbose = TRUE
)

Arguments

object

SummarizedExperiment

sfile

string : sample file path

by.x

string : object mergevar

by.y

string : file mergevvar

all.x

TRUE / FALSE : whether to keep samples / feature without annotation

select

character : [sf]file columns to select

stringsAsFactors

TRUE / FALSE

verbose

TRUE / FALSE

ffile

string : ffile path

Value

SummarizedExperiment

Examples

file <- system.file('extdata/billing19.proteingroups.txt', package = 'autonomics')
subgroups <-  c('E00','E01', 'E02','E05','E15','E30', 'M00')
subgroups %<>% paste0('_STD')
object <- read_maxquant_proteingroups(file, subgroups = subgroups)
sfile <- paste0(tempdir(),'/', basename(tools::file_path_sans_ext(file)))
sfile %<>% paste0('.samples.txt')
dt <- data.table(sample_id = object$sample_id, 
                 day = split_extract_fixed(object$subgroup, '_', 1))
data.table::fwrite(dt, sfile)                 
sdt(object)
sdt(merge_sample_file(object, sfile))

bhagwataditya/autonomics documentation built on Nov. 1, 2024, 5:47 a.m.