This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error with a function in ATAC-seq analysis

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

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

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.

run union on the data frames

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

0 answers

No answers yet.

Log in to answer this question.