Error in converting vcf to bed file using bedops
1
0
Entering edit mode
8 months ago
evafinegan • 0

Hello,

I am using bedops to convert a vcf file to a bed file:

vcf2bed < in.vcf.gz > out.bed

But I get this error:

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

Thank you for any help!

bedops vcf bed • 410 views
ADD COMMENT
2
Entering edit mode
8 months ago

You may need to decompress the gzipped VCF file to text, before conversion.

If you use the bash shell, you can use a process substitution:

$ vcf2bed < <( gunzip -c in.vcf.gz ) > out.bed

Or you can pipe uncompressed data, using the hyphen with vcf2bed to specify standard input:

$ gunzip -c in.vcf.gz | vcf2bed - > out.bed
ADD COMMENT
0
Entering edit mode

I still get the same error.

ADD REPLY
0
Entering edit mode

Another possibility is that your VCF file contains genuinely very long lines, in which case, you'd need to run a version of BEDOPS that supports longer lines.

If this is your case, if you're using the binaries I distribute on our Github site, you should be able to run the following:

$ switch-BEDOPS-binary-type --megarow

This transparently swaps the binaries around so that your host runs a "megarow" build of these tools, which supports longer lines, at the cost of slightly longer runtime for set operations.

If you're using someone else's build (e.g., via Homebrew or a package manager I don't control) then my advice would be to compile the binaries you need.

Instructions for compilation are located at:

https://bedops.readthedocs.io/en/latest/content/installation.html#installation-via-source-code

As the instructions note, you'd run make megarow or make all to build the set of binaries of the "megarow" variety. Grab some coffee as it may take a few minutes. Install the binaries where you need them, then run the command as described above.

ADD REPLY

Login before adding your answer.

Traffic: 3371 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