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