svtools icon indicating copy to clipboard operation
svtools copied to clipboard

IndexError: list index out of range svtools copynumber

Open arumds opened this issue 5 years ago • 0 comments

I have been using the svtools pipeline on my datatset where lsort lmerge and genotype have been implemented successfully. The coordinates file has been generated from the lmerge vcf file. And I have met with the below issue while using copynumber.

/.local/bin/svtools copynumber --cnvnator /bin/cnvnator-multi -s AMB1 -w 100 -r /sv/lumpy/AMB1.tmp/cnvnator-temp/AMB1.recalibrated.bam.hist.root -c /sv/lumpy/coordinates -i /sv/lumpy/gt/AMB1.vcf > /sv/lumpy/cn/AMB1.vcf
Traceback (most recent call last):
  File "/.local/bin/svtools", line 11, in <module>
    sys.exit(main())
  File "/.local/lib/python2.7/site-packages/svtools/cli.py", line 79, in main
    sys.exit(args.entry_point(args))
  File "/.local/lib/python2.7/site-packages/svtools/copynumber.py", line 114, in run_from_args
    sv_readdepth(stream, args.sample, args.root, args.window, args.output, args.cnvnator, args.coordinates)
  File "/.local/lib/python2.7/site-packages/svtools/copynumber.py", line 26, in sv_readdepth
    write_copynumber(vcf_file, sample, vcf_out, cn)
  File "/.local/lib/python2.7/site-packages/svtools/copynumber.py", line 78, in write_copynumber
    update_line_copynumber(v, cn_list, i)
  File "/.local/lib/python2.7/site-packages/svtools/copynumber.py", line 38, in update_line_copynumber
    gts[cn_index] = str(cn_list[i])
IndexError: list index out of range

If this may help to trace the issue:

I found differing number of variants in merged and genotyped VCF files as shown below. And also the coordinates are only ~80K while the merge vcf has ~264K variants. Why are the variants differing in number. As per my understanding, the genotyped variants and coordinates should be equal to the number of variants in merged VCF file.

###number of variants after lmerge #### $ grep -v "##" WGS.merged.vcf| wc -l 264324

###number of variants after genotyping #### $ grep -v "##" gt/AMB1.vcf | wc -l 5106722

###number of coordinates#### $ /.local/bin/create_coordinates -i WGS.merged.vcf -o coordinates $ wc -l coordinates 80446 coordinates

arumds avatar Dec 28 '18 12:12 arumds