Is There Software For Generating A Histogram Or Boxplot From Values In Bedgraph Files?
2
2
Entering edit mode
13.0 years ago
Paul ▴ 40

I was wondering if there was software to generate histograms of a set of input bedgraph files so that we could look at the output and compare the signals of the tracks. Our goal is to see if these values are comparable; that the data sets are of a similarity quality.

graphs • 3.8k views
ADD COMMENT
1
Entering edit mode
13.0 years ago

Here's some R code:

library(rtracklayer)
setwd("mywigdir")
files<-Sys.glob("*.wig")
d<-list()
pdf("hists.pdf")
for( i in 1:length(files))
{
    d[[i]]<-import.wig(files[i])
    hist(d[[i]]$score,breaks=20,xlim=c(-6,6),col='blue')
}
dev.off()

Or you could make a boxplot of the scores:

scores<-lapply(d,function(x){x$score})
boxplot(scores,names=files,las=2,cex.axis=.6)
ADD COMMENT
0
Entering edit mode

Thank you. It turns out your solution is technically correct, unfortunately we are now running into the problem that our data sets are extremely large. The signal file itself is 2.5G which takes an unreasonable amount of RAM in R.

ADD REPLY
0
Entering edit mode

Ah, you know, I was wondering about that... You could sample the file somehow ahead of time if you're only interested in the general distribution of scores...

ADD REPLY
0
Entering edit mode
13.0 years ago
Wen.Huang ★ 1.2k

Anything that can generate histograms or box plots should do the job, such as R. In R, a simple "boxplot(y ~ group)" allows you to plot your data by a grouping factor "group".

ADD COMMENT

Login before adding your answer.

Traffic: 1952 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6