Skip to contents

Calculate and return list of correlation between paired technical replicates in a dataset

Usage

calcReplicateCorr(
  dgeObject,
  group = NULL,
  corrThreshold = 0.8,
  return = "all",
  method = "pearson",
  ignoreZero = FALSE
)

Arguments

dgeObject

DGEList object with barcode counts with technical replicates.

group

Column name in sample metadata with replicate information (string). Correlation can only be calculated between pairs of replicates.

corrThreshold

Threshold distinguishing good vs bad correlation between technical replicates (decimal). Default = `0.8`.

return

Which values to return, one of `good`, `bad`, `all` (string). Default = `all`.

method

Method for correlation, one of `spearman`, `pearson` (string). Default = `pearson`.

ignoreZero

Remove barcodes where both replicates have 0 counts before calculating correlation (boolean). Including zeros can increase the spearman correlation, especially for samples with few barcodes detected. Default = `FALSE`.

Value

Returns a plot of the read counts per barcode (row) in a data frame

Examples

data(test.dge)
calcReplicateCorr(test.dge, group = "group")
#> 10_High_dose   11_Vehicle   12_Vehicle  13_Low_dose  14_Low_dose  15_Low_dose 
#>    0.9998576    0.9988335    0.9992809    0.9999569    0.9999779    0.9998940 
#>  16_Low_dose 17_High_dose   18_Vehicle  1_High_dose  2_High_dose  3_High_dose 
#>    0.9998965    0.9998269    0.9995630    0.9990497    0.9975044    0.9997354 
#>    4_Vehicle   5_Low_dose  6_High_dose    7_Vehicle    8_Vehicle   9_Low_dose 
#>    0.9975635    0.9999389    0.9994988    0.9997089    0.9992883    0.9997059 
#>           T0 
#>    0.9983848