Converting bedgraph file to wig file
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
• 1,360 views
•
link
1 answer
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
• 0 views
•
link
Log in to answer this question.
x-posted https://support.bioconductor.org/p/9145939/ Please indicate crossposts across communities.