omicverse
omicverse copied to clipboard
Request for bulk count to CPM/TPM/FPKM function
Hi,
Is there any plan to add a function that converts count to CPM/TPM/FPKM?
Thank you very much!
@JuliaMYQ, Please add a function that converts count to CPM/TPM/FPKM in omicvese.bulk._Deseq2.py file, and named this function normalize_bulk, argument type='CPM'/'TPM'/'FPKM'/'RPKM'. If you need any additional parameters, please add them yourself.
The TPM formula in R like:
tpm <- function(counts, lengths) {
rate <- counts / lengths
rate / sum(rate) * 1e6
}