countcpgbin {methylMnM} | R Documentation

## Compute the total CpG number of each bin with each CpG site.

### Description

The function is used to compute the total CpG number of each bin with each CpG site.

### Usage

    countcpgbin(file.cpgsite,file.blacklist=NULL,file.bin=NULL, writefile=NULL,
     reportfile=NULL, binlength=500)

### Arguments

`file.cpgsite` | The path of cpg site file or sequence tag file.
`file.blacklist` | The path of blacklist file (If we do not use the file, there will be defaulted as NULL).
`file.bin` | The path of all cpg bin file. For computing the number of sequence tag of each window, we use the file as a normalization window position. (If we do not use the file, there will be defaulted as NULL).
`writefile` | The path of output results. (If writefile=NULL, there will return the results back to main program.)
`reportfile` | The path of output results of bin length, the number of bin, total reads before processing and total reads after processing.
`binlength` | The length of each window.(Defaulted length is 500).

### Value

The CpG site should include at least three columns "chromosome", "start position" and "end position". The output file is include four columns, that is "chromosome", "start position", "end position" and "CpG count". Also, the function output a report for some parameters.

### Author(s)

Yan Zhou, Bo Zhang, Nan Lin, BaoXue Zhang and Ting Wang

### Examples

      datafile<-system.file("extdata",  package = "methylMnM")
      filepath<-datafile[1]
      file.cpgsite<-paste(filepath,"/all_CpGsite_chr18.txt",sep="")
      f<-countcpgbin(file.cpgsite, binlength=5000)

[Package methylMnM version 1.18.0 Index]