Closed MelinaKlostermann closed 1 year ago
Hi,
in principle the resulting plot is still correct, because the labels of df
are inverted in the next line of the code:
df = data.frame(type = rev(names(table(df))), count = as.vector(table(df)))
Nonetheless, this could certainly be solved in a more intuitive way...
One solution (thanks, Sri!) is to use a GRangesList for the regions:
regionsList = as(regions, "GRangesList") df= findOverlaps(x, regionsList) %>% as.data.frame() %>% table(.)
This df can then either be used for an UpSet plot or further processed with rowSums() %>% table()
into a similar structure as used in the code above:
df = rowSums() %>% table() %>% as.data.frame(.) colnames(df) = c("type", "count")
Hi, maybe I am missing something, but I was wondering about the third code chunk of the 3.3 Transcript region assignment chapter in the vignette. The code is:
So you want to know how many times a binding site overlaps with more than one region. You then say you "Count how many times an annotation is not present." But shouldn't you count how many times an annotation is present? So length(x[x != 0]) in the last row?
Because the plot afterward says "Bar plot shows how many times a binding site overlaps with an annotation of a different transcript region."