This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I change txt to bed file?

Forgive me, I know this question has already been asked but I ran into a few problems while trying the given methods.

So I have this text file in this format:

CACAAAGATAAAGACTTAATTAAAAACC    47564052    47564079    +   -28.27  P

CACAGTAATGAATGACTTTGCAAAGATT    47425208    47425235    +   -29.10  P

CACTGTGGTCTGCACCCTTGGTGAAATA    47344215    47344242    +   -29.13  P

CACTGAGATAAATGCAGCAACCTAAATT    47444207    47444234    +   -31.09  P

CACCCATGCACACCCCTCCGCACAAACA    47556633    47556660    -   -31.41  P

Note: there aren't actually spaces between lines it was just easier to read on Biostars if i put them here.

The first methos I tried was using> cut -f 2,3,4 cadm1.txt >cadm1.bed However, I cannot open the bed file in genome browsers such as IGV and IGB.

I also have tried using GenomeIntervals2BED python SeqGI_V1.2/scripts/GenomeIntervals2BED.py -f testfiles/cadm1.txt -c 2,3,4 --cID=1 -o testrun/cadm1.bed but keep getting "ERROR: column position (ID) has to be an integer." even though I have tried putting every column into cID ie. cID=1, cID=2 etc.

Please explain in simple terms as I am pretty new to any type of coding.

sequence cmd

Check the BED format definition first.

Thanks, I have added a column for chromosome number.

opheevallee : Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

1 answer

So I ended up solving the problem by recoding some lines in GenomesIntervals2BED.py, the file is pretty old and has not been updated to keep up with new programming language. I posted a fixed version on Github

Log in to answer this question.