This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to generate a bed file from X:21915521-21918496 list

Hi. A software gaves tome a list of genome positions a of a TF binding site. But the format is not the best for forward analysis. Anyone knows hoy to generate a bed file from this type of list? Maybe transform the ":" to a tab space and the "-" to tab too. But I dont know how to do this kind of task. Regards

X:8306855-8315547 -1497 AGAGTC

X:8105257-8111070 2044 AGAGTG

X:8087170-8092400 -1284 AGAGTG

X:7860225-7870570 -4726 AGAGTC

X:7597311-7601864 1764 AGAGTC

X:7590303-7596941 1377 AGAGTG

X:7212492-7214714 -600 AGAGTC

X:7184199-7186520 -930 CACTCT

X:6898247-6901343 653 AGAGTG

chip-seq sequence

Take a look at the gsub function of awk. You are basically right, just change : and - to tab.

or sed or even Perl (ok not Perl...)

1 answer

There's so many options for this task. I would use sed -e 's/:/\t/g' -e 's/-/\t/g'

Log in to answer this question.