use diffbind with normilized bedgraph files from spike ins
1
0
Entering edit mode
@theodoregeorgomanolis-7993
Last seen 2.4 years ago
Germany

Hi all,

diffbind takes bam files to calculate the coverage (of course it can be used without setting bam files). Since I would like to take advantage of the spike ins (to normalize the samples with the ratio as derived from the spike ins (multiply all counts in the bedgraph file with the ratio), there is no way to do this if the only coverage file accepted is bam files. If I am not mistaken DESeq2 can read bedgraph files.

Any idea if there is an alternative?

thank you

diffbind chip-seq chip spike spike-ins • 450 views
0
Entering edit mode
Rory Stark ★ 4.4k
@rory-stark-5741
Last seen 6 days ago
CRUK, Cambridge, UK

'DiffBind' can only use '.bam' files to obtain counts, not bedgraphs.

You can use spike-in samples to help set the normalization factors. The way I am familiar with is to count the number of reads that align to the spike-in reference for each sample, then override the the library sizes after calling dba.count()but before calling dba.analyze(). You probably want to normalize the spike-in reads by the sequencing depth. Assuming you have the number of spike-in reads in a vector called spikeinReads (in the same order as the samples), here's what has worked for me:

myDBA <- dba.count(myDBA,...)
libsizes <- myDBA$class['Reads',] scaling <- spikeinReads / libsize relScaling <- scaling / mean(scaling) myDBA$class['Reads',] <-  relScaling * mean(libsize)
myDBA <- dba.analyze(myDBA, bFullLibrarySize=TRUE)