Converting bedgraph file to wig file
1
0
Entering edit mode
20 months ago
margo ▴ 40

I have a bedgraph file which I have loaded up into R and I am wanting to convert it to a wig file for further analysis. In R, my bedgraph file looks like this:

1   0
2   0
3   0
4   0

I am wanting to add the header variableStep chrom=1 as the first line. I then want to convert this bedgraph file to wig. Does anyone know how to do this? I want my output file to look like this:

variableStep chrom=1
1   0
2   0
3   0
4   0
bedgraph wig R igv • 607 views
ADD COMMENT
0
Entering edit mode

x-posted https://support.bioconductor.org/p/9145939/ Please indicate crossposts across communities.

ADD REPLY
0
Entering edit mode
20 months ago

You can use the tool called bedGraphToBigWig that is part of kentUtils:

with conda you could use:

mamba install ucsc-bedgraphtobigwig

Edit: if you absolutely need wiggle then use bigwigtowig of the same toolset

ADD COMMENT

Login before adding your answer.

Traffic: 3093 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6