deeptools / deepTools

Tools to process and analyze deep sequencing data.
Other
677 stars 212 forks source link

correlation of bam/bigwig coverage with bed files? #479

Closed avilella closed 7 years ago

avilella commented 7 years ago

Hi,

I've got a bam file that I can transform into a bw (bigwig) file of read coverage, and I would like to correlate the coverage to a list of bed files, each of which has bed regions labelled as a group of 6 different states (Constitutive_Het, Promoter, Transcribed, etc.).

What's the best way to do such 1 bam vs multiple bed files correlation using deeptools?

Thx

dpryan79 commented 7 years ago

I guess I'm not sure what's being correlated in this context. Perhaps you want something like plotEnrichment instead?

avilella commented 7 years ago

I have used the multibamsummary/plotcorrelation/plotPCA tools before to correlate a set of bams.

Here I would like a correlation of coverage in 1 bam with where that coverage is present, among a collection of bed files.

E.g.:

myfile.bam

vs

segway.lung.bed segway.heart.bed segway.brain.bed

Where each bed file has 100,000s of entries named (column 4):

Quiescent ConstitutiveHet FacultativeHet Transcribed Promoter Enhancer RegPermissive Bivalent LowConfidance

So I expect tabular results (in whichever format, similar to these below, with made-up r_square values):

bedfile     region           coverage_correlation
segway.lung Quiescent        0.245
segway.lung ConstitutiveHet  0.45
segway.lung FacultativeHet   0.1432
segway.lung Transcribed      0.41
segway.lung Promoter         0.365
segway.lung Enhancer         0.145
segway.lung RegPermissive    0.8654
segway.lung Bivalent         0.8145
segway.lung LowConfidance    0.81243
segway.heart Quiescent       0.845
segway.heart ConstitutiveHet 0.86532
segway.heart FacultativeHet  0.87
segway.heart Transcribed     0.5
segway.heart Promoter        0.5234
segway.heart Enhancer        0.845
segway.heart RegPermissive   0.12435
segway.heart Bivalent        0.245
segway.heart LowConfidance   0.356
segway.brain Quiescent       0.376
segway.brain ConstitutiveHet 0.14
segway.brain FacultativeHet  0.365
segway.brain Transcribed     0.38
segway.brain Promoter        0.124
segway.brain Enhancer        0.12
segway.brain RegPermissive   0.145
segway.brain Bivalent        0.2345
segway.brain LowConfidance   0.37

Any ideas?

dpryan79 commented 7 years ago

OK, so plotEnrichment, likely after splitting your BED files according to column 4.