svtools icon indicating copy to clipboard operation
svtools copied to clipboard

bedpetovcf crashes

Open johnemajor opened this issue 6 years ago • 1 comments

I'm in a python 2.7.12 ve. I pip installed svtools. I'm trying to run: svtools bedpetovcf -i ./3717462611446476_add5.bedpe . (this is the bedpe file published as part of the LUMPY paper, here: https://genomebiology.biomedcentral.com/articles/10.1186/gb-2014-15-6-r84 ).

The output is: (p2.7) ubuntu@ip-10-71-22-180:/efs/WGS/data/reference/human/hg19$ svtools bedpetovcf -i ../../controls/b37/controls/cnv/NA12878/Lumpy/3717462611446476_add5.bedpe ##fileformat=VCFv4.2 ##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype"> #CHROM POS ID REF ALT QUAL FILTER INFO Traceback (most recent call last): File "/home/ubuntu/p2.7/bin/svtools", line 8, in sys.exit(main()) File "/home/ubuntu/p2.7/local/lib/python2.7/site-packages/svtools/cli.py", line 79, in main sys.exit(args.entry_point(args)) File "/home/ubuntu/p2.7/local/lib/python2.7/site-packages/svtools/bedpetovcf.py", line 73, in run_from_args bedpeToVcf(stream, args.output) File "/home/ubuntu/p2.7/local/lib/python2.7/site-packages/svtools/bedpetovcf.py", line 40, in bedpeToVcf bedpe = Bedpe(line.rstrip().split('\t')) File "/home/ubuntu/p2.7/local/lib/python2.7/site-packages/svtools/bedpe.py", line 30, in init self.orig_alt2 = bed_list[17] IndexError: list index out of range

The BEDPE file looks valid. Here is the head of it:

(p2.7) ubuntu@ip-10-71-22-180:/efs/WGS/data/reference/human/hg19$ head ../../controls/b37/controls/cnv/NA12878/Lumpy/3717462611446476_add5.bedpe chr1 756009 756501 chr1 756091 756538 2 6 + - TYPE:DELETION MAX:chr1:756030;chr1:756538 95:chr1:756027-756196;chr1:756092-756538 SIGNAL_TYPE:PE_ALONE SIGNAL_AMT:NA12878_PE,6;NA12878_SR,0 STRANDS:+-,6 VALIDATION:PB,4;MOL,0 chr1 869401 869594 chr1 870076 870286 3 22 + - TYPE:DELETION MAX:chr1:869422;chr1:870286 95:chr1:869418-869462;chr1:870077-870286 SIGNAL_TYPE:PE_ALONE SIGNAL_AMT:NA12878_PE,22;NA12878_SR,0 STRANDS:+-,22 VALIDATION:PB,14;MOL,2 chr1 2566137 2566511 chr1 2566412 2566600 12 15 + - TYPE:DELETION MAX:chr1:2566511;chr1:2566600 95:chr1:2566511-2566511;chr1:2566413-2566600 SIGNAL_TYPE:PE_ALONE SIGNAL_AMT:NA12878_PE,15;NA12878_SR,0 STRANDS:+-,15 VALIDATION:PB,6;MOL,1 chr1 2765752 2766179 chr1 2765940 2766201 13 5 + - TYPE:DELETION MAX:chr1:2765773;chr1:2766201 95:chr1:2765771-2765938;chr1:2765941-2766201 SIGNAL_TYPE:PE_ALONE SIGNAL_AMT:NA12878_PE,5;NA12878_SR,0 STRANDS:+-,5 VALIDATION:PB,2;MOL,0 chr1 2911538 2911560 chr1 2911838 2911860 14 23 + - TYPE:DELETION MAX:chr1:2911557;chr1:2911859 95:chr1:2911557-2911558;chr1:2911858-2911859 SIGNAL_TYPE:PE_SR SIGNAL_AMT:NA12878_PE,17;NA12878_SR,6 STRANDS:+-,23 VALIDATION:PB,0;MOL,15

Any help would be greatly appreciated. --john major

johnemajor avatar Dec 03 '19 08:12 johnemajor

Unfortunately this script is not as flexible as the bedpe format - it requires there to be sample fields, which are anything in field 21 (1-based) or later. A very hacky workaround is to add dummy fields to each line as well as a header starting with # with at least 21 fields. This also requires messing around with fields 11-20 as it is expecting specific information in each one, as defined in Bedpe.py. Basically I don't recommend this script outside the specific context it was originally used for.

apregier avatar Jan 22 '20 22:01 apregier