This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Generate bed file containing regions with no bigwig coverage

Hey all-

I would like to find regions in a bigwig file which do not have a score (excluding regions with a score of 0 or more) and output as a bed file. Does anyone know of an easy way to do this? The bigwig files simply contain no data where there is no score (i.e. there is not a "location: no score") value, so it would have to be compared to the entire genome. I also have to use bigwig as the input, so something like bedrolls genomecov wouldn't work for me, since it takes BAM as input.

Thanks!

bigwig bed

As a follow up to this, I would like to be able to generate random regions in a bed file which excluded all of the regions where there is no score in the bigwig file. It doesn't seem that bedtools random has a mask option, however. Is there an alternative where I could generate random regions that excluded certain portions of the genome?

1 answer

I would like to find regions in a bigwig file which do not have a score

convert the wig to bedgraph : https://genome.ucsc.edu/goldenpath/help/bigWig.html

use awk to filter out the region having a value lower than your treshold.

also use 'bedtools complement' to find the regions not covered by the bedgraph.

Thanks Pierre, this worked very nicely to allow me to find regions where we simply didn't have coverage from our sequencing data.

Log in to answer this question.