Hi,
I have differential binding analysis performed on a set of samples and plotted a Venn diagram (using DiffBind) to look at overlapping and unique diff. bound sites. Now I want to get those peaks in the Venn Diagram as a list for further analysis and to look on IGV. How can I convert these data to a report / csv file ? "bReturnPeaksets" function is removed it seems.
Thank you
Hesh
Thank you!
I'm having trouble converting the output GRanges file to a CSV file. I did try a couple different methods to convert the GRanges to a CSV or BED file but I keep getting errors. Highly appreciate if you can let me know how to get the output in CSV format.
Thank you!
This is what I tried:
gr <- GRanges(seqnames = Rle(Venn_2$name),
ranges = IRanges(Venn_2$start, end=Venn_2$stop),
strand = Rle(strand(c(rep("*", length(Venn_2$name))))),
Conc = Venn_2$Conc)
venn_2_df <- data.frame(seqnames=seqnames(gr),
starts=start(gr)-1,
ends=end(gr),
names=c(rep(".", length(gr))),
scores=c(rep(".", length(gr))),
strands=strand(gr))
write.table(venn_2_df, file="Venn_c123_th1.bed", quote=F, sep="\t", row.names=F, col.names = F)
Actually you can just call
write.csv()
on aGRanges
object. You will get a column with the strand, which you may not want.Another way is to convert a
GRanges
to adata.frame
by callingdata.frame(myGRanges)
, then write that out withwrite.csv()
including/deleting the columns you are/aren't interested in.