This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bgr files: change chromosome annotation

How would I change chromosome names with sed or awk from 1-22, X, Y to chr(1-22,X,Y)? Is there an expression that I can use?

sed bedgraph expressions awk

Only see for changing the other away around, i.e. chr(1-22,X,Y) to 1-22, X, Y

Basically awk '{print "chr"$X}' with X being the column where the chromosomes are in. Try to modify this minimal command to fit your needs, there are plenty of posts on that already that will inspire you to complete it.

Hi,

Could you post an example of your bgr file, please?

You can do this in terminal by typing:

head your_bgr_file.bgr

Make sure you highlight your example and click the 010101 button to code the example, so it's easier to copy and paste. You could also Edit your post and add it there.

-Pratik

0 answers

No answers yet.

Log in to answer this question.