Biostar Beta. Not for public use.
Question: Bed to BedGraph
2
Entering edit mode

I am a bit confused.

Would you please guide me. I want to use DaPars. It need a BedGraph file as input.

I have searched and understand it is possible to covert bed to bedgraph!! But how the coverage could be defined then? In DaPars the coverage in needed to find if there is any alternative polyadenylation.

ADD COMMENTlink 4.0 years ago abc • 30 • updated 4.0 years ago dally • 180
Entering edit mode
2

Two easy ways to make Bedgraph from BED input with common Unix tools are with _cut_

$ cut -f1-3,5 foo.bed > foo.bedgraph

And with _awk_ :

$ awk '{ print $1"\t"$2"\t"$3"\t"$5 }' foo.bed > foo.bedgraph
ADD REPLYlink 4.0 years ago
Alex Reynolds
28k
Entering edit mode
0

Thanks a lot, would you please let me know how to convert wig to BedGraph?

ADD REPLYlink 4.0 years ago
abc
• 30
Entering edit mode
1

You can use wig2bed:

$ wig2bed < foo.wig | cut -f1-3,5 > foo.bedgraph
ADD REPLYlink 4.0 years ago
Alex Reynolds
28k
Entering edit mode
0

Thanks, I got this error "wig2bed: line 156: convert2bed: command not found"

ADD REPLYlink 4.0 years ago
abc
• 30
Entering edit mode
0

Install all the binaries into one place available from your path, like /usr/local/bin etc.

ADD REPLYlink 4.0 years ago
Alex Reynolds
28k
Entering edit mode
0

Of course I did it but I still face this error

ADD REPLYlink 4.0 years ago
abc
• 30
3
Entering edit mode

https://www.biostars.org/p/161120/ might be a good place to start looking.

Essentially you can use bedtools genome coverage tool to find converage in your bed file and then output the format as a bedGraph using the -bg parameter.

ADD COMMENTlink 4.0 years ago dally • 180

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.0