BIMSBbioinfo / pigx_bsseq

bisulfite sequencing pipeline from fastq to methylation reports
https://bioinformatics.mdc-berlin.de/pigx/
GNU General Public License v3.0
11 stars 4 forks source link

error when destranding during exporting bigwig #169

Open alexg9010 opened 3 years ago

alexg9010 commented 3 years ago
Error in `:=`(score, numCs/coverage) :
  Check that is.data.table(DT) == TRUE. Otherwise, := and `:=`(...) are defined for use in j, once only and in particular ways. See help(":=").
Calls: lapply ... <Anonymous> -> lapply -> FUN -> FUN -> [ -> [.data.frame -> :=
Execution halted

The problem is that the destranding function (https://github.com/BIMSBbioinfo/pigx_bsseq/blob/4b5057247fc52490b6e1421343f02a1a37d7c57d/scripts/export_tbx2bw.R#L131-L132) converts the data.table to a data.frame and subsequent data.table column assignment via reference does not work.

easy solution would be to convert the function results into data.table again before proceeding

if(destrand) dt <- as.data.table(methylKit:::.CpG.dinuc.unifyOld(dt))