<p>I want to  have a bigwig file converted into gff after having the genome coordinates and genome annotation files converted from Hg19 to Hg18. One way, would be to convert bigwig into BED, use the liftover tool and then have the BED file converted into gff. Could someone please suggest a method to convert bigwig to BED, nothing available on the net.</p>

<p>Instead of <code>bigWigToBedGraph</code>, you might use <code>bigWigToWig</code>, instead, as bedgraph is BED-like but isn&#39;t exactly BED, which may affect use of UCSC&#39;s liftover tool. In any case, both binaries are available from the <a href="http://hgdownload.cse.ucsc.edu/admin/exe/">UCSC executables download page</a>.</p>

<p>Once you have the file in WIG format, you can convert it to a UCSC BED file with the <a href="http://bedops.readthedocs.org/en/latest/content/reference/file-management/conversion/wig2bed.html">BEDOPS <code>wig2bed</code> conversion utility</a>.</p>

<p>Alternatively, you could take the bedgraph output and convert it to BED with an added GNU <code>awk</code> step:</p>

<pre>
<code>$ awk &#39;{ \
    if ($1 ~ /^chr/) { \
        print $1&quot;\t&quot;$2&quot;\t&quot;$3&quot;\tid-&quot;NR&quot;\t&quot;$4; \
    } \
}&#39; foo.bedgraph \
&gt; foo.bed
</code></pre>

<p>You should be able to safely run it through liftover at that point.</p>
