This is a test version of Biostars. For the public version, visit https://www.biostars.org.
sort-bed issue urgent

Hi all, I have a bed file named input.bed (excel file with three columns: chr#+start+end --> saved as tab-demilitied --> saved as .bed). When I type "sort-bed input.bed > final.bed" I get this error:

BED row length exceeds capacity at line 1 in final.txt.
Check that you have unix newlines (cat -A) or increase TOKENS_MAX_LENGTH in BEDOPS.Constants.hpp and recompile BEDOPS.

I tried trouble-shooting, this is what I got:

$ wc -l input.bed
       0 input.bed
$ head -n input.bed | cat -A
head: illegal line count -- input.bed
cat: illegal option -- A
usage: cat [-benstuv] [file ...]

Any help would be greatly appreciated! I am very close but I need the bigbed formatted files in an hour! Thank you Biostar community!

rna-seq

since this is so urgent let me drop everything and get right to it. try:

cat -A input.bed | head

PS. Why did you have to post this in different places?

A: bed to bigBed conversion

This is my output:

cat: illegal option -- A
usage: cat [-benstuv] [file ...]

Hi Apelin20, I have gotten to the last step --> when I use bedToBigBed I am getting this error:

cannot execute binary file

what does this mean? And what can I do now to run this?

Hi Apelin20, I have gotten to the last step --> when I use bedToBigBed I am getting this error:

cannot execute binary file

what does this mean? And what can I do now to run this?

Did you export from Excel on Windows, or export from Excel on Mac? Either way, you have to fix Microsoft-formatted text files to work in UNIX, but please indicate which and I can tell you what to run to fix the problem.

1 answer

You can do the following in the case of exporting from Excel on Mac:

$ tr '\r' '\n' < input.bed > input.fixedLineEndings.txt

If you exported your data from Excel on Windows:

$ tr -d '\r' < input.bed > input.fixedLineEndings.txt

Then you can sort normally:

$ sort-bed input.fixedLineEndings.txt > final.bed

Then, assuming you have downloaded the correct bedToBigBed binary for your platform, you can convert the resulting BED file to bigBed.

Hi Alex, This works now! Thank you very much!

Log in to answer this question.