createBsseqObject {MethCP} | R Documentation |
Create a bsseq object when the data for each sample is stored in a separate text file.
createBsseqObject( files, sample_names, chr_col, pos_col, m_col, cov_col, header = TRUE)
files |
a charactor vector of file names with full path to the file. |
sample_names |
a charactor vector of sample names. It should have the same length as files vector. |
chr_col |
name or index of the chromosome column in data files. |
pos_col |
name or index of the position column in data files. |
m_col |
name or index of the methylated counts column. |
cov_col |
name or index of the coverage counts column. |
header |
a logical value indicating whether the file contains the names of the variables as its first line. dedault TRUE. |
a MethCP
object that is not segmented.
library(bsseq) # The dataset is consist of 6 samples. 3 samples are H2A.Z mutant # plants, and 3 samples are controls. sample_names <- c( paste0("control", seq_len(3)), paste0("treatment", seq_len(3)) ) # Get the vector of file path and names raw_files <- system.file( "extdata", paste0(sample_names, ".txt"), package = "MethCP") # load the data bs_object <- createBsseqObject( files = raw_files, sample_names = sample_names, chr_col = 'Chr', pos_col = 'Pos', m_col = "M", cov_col = 'Cov')