create_melissa_data_obj: Create methylation regions for all cells

Description Usage Arguments Value Author(s) See Also Examples

View source: R/process_data.R

Description

Wrapper function for creating methylation regions for all cells, which is the input object for Melissa prior to filtering.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
create_melissa_data_obj(
  met_dir,
  anno_file,
  chrom_size_file = NULL,
  chr_discarded = NULL,
  is_centre = FALSE,
  is_window = TRUE,
  upstream = -5000,
  downstream = 5000,
  cov = 5,
  sd_thresh = -1,
  no_cores = NULL
)

Arguments

met_dir

Directory of (binarised) methylation files, each file corresponds to a single cell.

anno_file

The annotation file with 'tab' delimited format: "chromosome", "start", "end", "strand", "id", "name" (optional). Read the 'BPRMeth' documentation for more details.

chrom_size_file

Optional file name to read genome chromosome sizes.

chr_discarded

Optional vector with chromosomes to be discarded.

is_centre

Logical, whether 'start' and 'end' locations are pre-centred. If TRUE, the mean of the locations will be chosen as centre. If FALSE, the 'start' will be chosen as the center; e.g. for genes the 'start' denotes the TSS and we use this as centre to obtain K-bp upstream and downstream of TSS.

is_window

Whether to consider a predefined window region around centre. If TRUE, then 'upstream' and 'downstream' parameters are used, otherwise we consider the whole region from start to end location.

upstream

Integer defining the length of bp upstream of 'centre' for creating the genomic region. If is_window = FALSE, this parameter is ignored.

downstream

Integer defining the length of bp downstream of 'centre' for creating the genomic region. If is_window = FALSE, this parameter is ignored.

cov

Integer defining the minimum coverage of CpGs that each region must contain.

sd_thresh

Optional numeric defining the minimum standard deviation of the methylation change in a region. This is used to filter regions with no methylation variability.

no_cores

Number of cores to be used for parallel processing of data.

Value

A melissa_data_obj object, with the following elements:

Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk

See Also

binarise_files, melissa, filter_regions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Met directory
met_dir <- "name_of_met_dir"
# Annotation file name
anno_file <- "name_of_anno_file"

obj <- create_melissa_data_obj(met_dir, anno_file)

# Extract annotation regions
met <- obj$met

# Extract annotation regions
anno <- obj$anno_region

## End(Not run)

andreaskapou/Melissa documentation built on June 12, 2020, 5:54 p.m.