Error with a function in ATAC-seq analysis
0
0
Entering edit mode
10 weeks ago
Chris ▴ 100

Hi ads,

I got an error when trying to apply code from a paper: https://epigeneticsandchromatin.biomedcentral.com/articles/10.1186/s13072-020-00342-y#MOESM1

 library(GenomicRanges)
 library(csaw)  

diseased1.peaks <- GRanges(diseased1.peaks)  
diseased.peaks <- union(diseased1.peaks, diseased2.peaks)

Error in as.vector(x) : no method for coercing this S4 class to a vector

Would you suggest me what wrong here? This error happens in other cases as well, not only with union(). Thank you so much!

ATAC-seq • 317 views
ADD COMMENT
1
Entering edit mode

sounds like diseased1.peaks is not a vector. What do you get when you run str(diseased1.peaks)?

ADD REPLY
0
Entering edit mode

Yes, it is not a vector. Formal class 'GRanges' Because GRanges() function made it become a Granges class which is a data frame before that.

ADD REPLY
1
Entering edit mode

run union on the data frames

ADD REPLY
0
Entering edit mode

So you skip the GRanges()? Yes, no error anymore but I am not sure if that causes changing in downstream analysis.

ADD REPLY

Login before adding your answer.

Traffic: 2879 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