Question: How to create a new bigwig file defined by a subset of bed file?
0
gravatar for xiaoyonf
10 months ago by
xiaoyonf0
Baylor College of Medicine, Houston, Texas, USA
xiaoyonf0 wrote:

Hello, I have a ChIP-seq bigwig file and a bed file that is a subset of the binding peaks defined from the bigwig file. I want to create a new (sub) bigwig file to use the subset of bed file. How can I do it? Many thanks! Xiaoyong

chip-seq • 387 views
ADD COMMENTlink modified 9 months ago by Alex Reynolds22k • written 10 months ago by xiaoyonf0
3
gravatar for Alex Reynolds
9 months ago by
Alex Reynolds22k
Seattle, WA USA
Alex Reynolds22k wrote:

Convert from bigwig to wiggle:

$ bigWigToWig data.bw data.wig

Convert from wiggle to bed:

$ wig2bed < data.wig > data.bed

Filter the bed file based on your peak subset, and make a bedgraph file from the subset:

$ sort-bed peak_subset.unsorted.bed > peak_subset.bed
$ bedops --element-of 1 data.bed peak_subset.bed | awk 'BEGIN{ OFS="\t"; }{ print $1, $2, $3, $5 }' > data_subset.bedgraph

Convert the bedgraph file to a bigwig file, e.g. for reference genome hg19:

$ fetchChromSizes hg19 > hg19.sizes
$ bedGraphToBigWig data_subset.bedgraph hg19.sizes data_subset.bw
ADD COMMENTlink modified 9 months ago • written 9 months ago by Alex Reynolds22k

Sounds cool. I will definitely try. Thank you, Alex! Xiaoyong

ADD REPLYlink written 9 months ago by xiaoyonf0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 876 users visited in the last hour