How can I change txt to bed file?
1
0
Entering edit mode
4.3 years ago

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 • 1.4k views
ADD COMMENT
1
Entering edit mode

Check the BED format definition first.

ADD REPLY
0
Entering edit mode

Thanks, I have added a column for chromosome number.

ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode
4.3 years ago

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

ADD COMMENT

Login before adding your answer.

Traffic: 1579 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6