Function to read methylation calls

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Allfunctions.R


Reads the methylation calls from sorted SAM files generated from Bismark aligner.


1, output_folder, no_overlap, read.context, Nproc)



character; the path(s) to the folder location consisting of sorted SAM files


character; the path(s) to the folder location where the output files are written


character; if set to TRUE and the SAM file has paired-end reads, then one read of the overlapping paired-end read pair will be ignored for methylation calling


character; One of the 'CpG' or 'All'. Determines what type of methylation context will be read. If given as 'all', cytosine methylation information in all sequence context will be read.


numeric; the number of processors to use, one sample is processed by each processor.


The function reads methylation calls from the sorted SAM file so that they can be used to create a BSdata object. SAM files must be sorted based on chr and start of reads. The user can specify the sequence context in which the methylation information is read from these files either "CpG" or "All". If "All" is specified, cytosine methylation in all context (CG, CHG or CHH) will be read. The methylation calls is saved as a text file in the output folder. These text files are tab-delimited and contain the following columns: chromosome assignment (in the form chr1, chr2..), genomic position (positive integer), strand (either - or +), methylation sequence context (either CG, CHG or CHH), number (>0) of sequencing reads with C calls at that genomic position, number of sequencing reads with T calls at that genomic position. In addition a GRanges object consisting of uncovered genomic regions is generated and saved in the output folder for each sample. This information is used to distinguish unmethylated cytosines from those that are not covered by sequencing. This GRanges object is used further to provide uncovered regions information while creating BSdata object by BSdata method.


A text file of methylation calls and a GRanges object consisting of uncovered genomic regions for each sample are generated in the "output_folder" folder. The files are prefixed with sample name.


Kamal Kishore

See Also



file_loc <- system.file('extdata', 'test_methcall', package='methylPipe'), output_folder=tempdir(), no_overlap=TRUE, read.context="CpG", Nproc=1)

methylPipe documentation built on May 2, 2018, 2:47 a.m.