Entering edit mode
10 weeks ago
Chris ▴ 100
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!
diseased1.peaksis not a vector. What do you get when you run
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.
unionon the data frames
So you skip the GRanges()? Yes, no error anymore but I am not sure if that causes changing in downstream analysis.