Question: How to create a new bigwig file defined by a subset of bed file?
0
gravatar for xiaoyonf
19 months ago by
xiaoyonf10
Baylor College of Medicine, Houston, Texas, USA
xiaoyonf10 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 • 813 views
ADD COMMENTlink modified 19 months ago by Alex Reynolds26k • written 19 months ago by xiaoyonf10
3
gravatar for Alex Reynolds
19 months ago by
Alex Reynolds26k
Seattle, WA USA
Alex Reynolds26k 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 19 months ago • written 19 months ago by Alex Reynolds26k

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

ADD REPLYlink written 19 months ago by xiaoyonf10
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: 1793 users visited in the last hour