The coordinate system problem about DiffBind output
1
0
Entering edit mode
@shangguandong1996-21805
Last seen 5 days ago
China

Hello, Dr Stark. Recently, I am learning some knowlege about coordinate system of zero based and one based. And It reminds me that I often do some format change in DiffBind :). Just like

1. change the merged coordinate into bed format

dba_meta <- dba(minOverlap = 1, sampleSheet = sample_info)

> dba_meta$merged[1:10,] CHR START END 1 1 30 875 2 1 1392 1953 3 1 2164 3625 4 1 8268 8966 5 1 13654 14698 6 1 16512 16931 7 1 20391 21655 8 1 22671 23272 9 1 33104 33997 10 1 37785 38663  merge_peak <- as.data.frame(dba_meta$merged)
merge_peak$CHR <- gsub("(\\d+)","Chr\\1",merge_peak$CHR,perl = T)
merge_peak$name <- paste0("WFX_peak_",1:dim(merge_peak)[1]) merge_peak$scores <- "."
merge_peak$strands <- "." write.table(format(merge_peak,scientific=FALSE), file = "result/processed_result/merge_peak.bed", quote = F,sep = "\t", row.names = F,col.names = F, )  2. And annote dba_report ouput using ChIPseeker::AnnotatePeak  dba_report_all <- dba.report(dba_diff,th = 1) peakAnno <- annotatePeak(dba_report_all, TxDb = TxDb.Athaliana.BioMart.plantsmart28, level = "gene")  I noticed the DiffBind will first merge the Peakset from samples and change into GRange, But I not sure the dba_meta$merged is 0-based or 1-based. I do find the start of dba_metamerged is the same as the start of dba_report GRange, So the output of Diffbind is all 1-based? Sorry to bother you. Best wishes Guandong Shang diffbind Rory Stark coordinate • 200 views ADD COMMENT 1 Entering edit mode Rory Stark ★ 4.1k @rory-stark-5741 Last seen 13 hours ago CRUK, Cambridge, UK DiffBind assumes that the data provided it (peak intervals and aligned reads) are all using the same coordinate basis and maintains whatever values are supplied. ADD COMMENT 0 Entering edit mode Thanks for your reply! MACS2 produced peak is 0-based while the GRange is 1-based. But the start and end in dba_metamerged is the same as the GRange start and end in dba_report. So the 0-1 transformed occurs in the narrowPeak -> dba_meta\$merged?