Entering edit mode
20 months ago
Chris
▴
340
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!
sounds like
diseased1.peaks
is not a vector. What do you get when you runstr(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 framesSo you skip the GRanges()? Yes, no error anymore but I am not sure if that causes changing in downstream analysis.