Description Usage Arguments Details Value Examples
View source: R/scmethrix_operations.R
Subsets an scMethrix object based on regions, contigs and/or samples.
1 2 3 4 5 6 7 8 9  | 
scm | 
 
  | 
regions | 
 genomic regions to subset by. Could be a data.table with 3 columns (chr, start, end) or a   | 
contigs | 
 string; array of chromosome names to subset by  | 
samples | 
 string; array of sample names to subset by  | 
by | 
 string to decide whether to "include" or "exclude" the given criteria from the subset  | 
overlap_type | 
 string; defines the type of the overlap of the CpG sites with the target region. Default value is   | 
verbose | 
 boolean; Flag for outputting function status messages. Default = TRUE  | 
Takes scMethrix object and filters CpGs based on region, contig and/or sample. Can
either subset (include) to or filter (exclude) the specified parameters.
An object of class scMethrix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  | data('scMethrix_data')
contigs <- c("chr1","chr3")
regions <- GenomicRanges::GRanges(seqnames = "chr1", ranges = IRanges(1,100000000)) 
samples <- c("C1","C2")
#Subset to only samples bed1 and bed3, and chromosome 1
subset_scMethrix(scMethrix_data, samples = samples, contigs = contigs, by = "include")
#Subset to only region "chr1:1-5"
subset_scMethrix(scMethrix_data, regions = regions, by = "include")
#Subset to exclude samples bed1 and bed3, and chromosome 1
subset_scMethrix(scMethrix_data, samples = samples, contigs = contigs, by = "exclude")
#Subset to exclude region "chr1:1-5"
subset_scMethrix(scMethrix_data, regions = regions, by = "exclude")
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.