This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Trying to do log2 transformation of my rna seq data

While trying to log transform my RNA seq data, I got this error

> log_counts <- log2(hep + 1)
Error in FUN(left, right) : non-numeric argument to binary operator

Even after removing my first column, I got the same error

> log_counts <- log2(hep[,-1] + 1)
Error in FUN(left, right) : non-numeric argument to binary operator

My "hep" data is as follows:

please see the link below for image of "hep" data

r

Your columns are probably not a numeric datatype. What is class(hep$A1)?

Well, there you go. Try this:

log2_counts <- log2(data.matrix(hep[,-1]))

you can do it inside deseq2

1 answer

Log-transforming RNA-seq counts is nonsense and will give poor results in any analysis, as you indeed seem to report for this data on Biconductor:

https://support.bioconductor.org/p/9136077/

Please follow one of our workflows for an appropriate analysis of RNA-seq data.

Log in to answer this question.