Trying to do log2 transformation of my rna seq data
1
0
Entering edit mode
3.6 years ago
rishav513 ▴ 30

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 • 2.7k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

class(hep$A1)

[1] "character"

ADD REPLY
2
Entering edit mode

Well, there you go. Try this:

log2_counts <- log2(data.matrix(hep[,-1]))
ADD REPLY
0
Entering edit mode

you can do it inside deseq2

ADD REPLY
3
Entering edit mode
3.6 years ago
Gordon Smyth ★ 7.6k

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.

ADD COMMENT

Login before adding your answer.

Traffic: 2490 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6