Adding methylProp column that has proportion of reads that were methylated for each site based on number of methylated reads divided by total number of reads. Note: Assigns methylProp column by reference with ":="

addMethPropCol(BSDTList)

Arguments

BSDTList

A bisulfite datatable or list of datatables with a column for number of methylated reads (methylCount) and a column for number of total reads (coverage) for each cytosine that was measured.

Value

The BSDTList but with extra `methylProp` column on each data.table in list.

Examples

data("exampleBSDT", package = "MIRA") exampleBSDT[, methylProp := NULL] # removing methylProp column
#> Warning: Adding new column 'methylProp' then assigning NULL (deleting it).
#> chr start methylCount coverage sampleName #> 1: chr1 1062326 0 3 Gm06990_1 #> 2: chr1 1062330 0 3 Gm06990_1 #> 3: chr1 1062339 0 4 Gm06990_1 #> 4: chr1 1062448 2 27 Gm06990_1 #> 5: chr1 1062478 0 23 Gm06990_1 #> --- #> 3996: chr1 153989760 10 12 Gm06990_1 #> 3997: chr1 153990357 0 1 Gm06990_1 #> 3998: chr1 153990361 1 1 Gm06990_1 #> 3999: chr1 154181845 2 5 Gm06990_1 #> 4000: chr1 154182496 0 2 Gm06990_1
addMethPropCol(list(exampleBSDT))
#> [[1]] #> chr start methylCount coverage sampleName methylProp #> 1: chr1 1062326 0 3 Gm06990_1 0.000 #> 2: chr1 1062330 0 3 Gm06990_1 0.000 #> 3: chr1 1062339 0 4 Gm06990_1 0.000 #> 4: chr1 1062448 2 27 Gm06990_1 0.074 #> 5: chr1 1062478 0 23 Gm06990_1 0.000 #> --- #> 3996: chr1 153989760 10 12 Gm06990_1 0.833 #> 3997: chr1 153990357 0 1 Gm06990_1 0.000 #> 3998: chr1 153990361 1 1 Gm06990_1 1.000 #> 3999: chr1 154181845 2 5 Gm06990_1 0.400 #> 4000: chr1 154182496 0 2 Gm06990_1 0.000 #>