brentp / duphold

don't get DUP'ed or DEL'ed by your putative SVs.
MIT License
101 stars 9 forks source link

svtype = variant.info.get("SVTYPE", "SV") #51

Open Jokendo-collab opened 1 year ago

Jokendo-collab commented 1 year ago

I am getting the following error and I am not sure how to go around this. I used the following command to annotate the my vcf.

duphold -v macope2_sorted.vcf -b ../macOpe2.sorted.bam -f /data/okendojo/datashare/macOpeProject/macOpe2Assembly.fasta -t 24 -o mc.vcf but I cannot get the SVTYPE column information.

(samplot) [okendojo@cn0798 bcgFile]$ samplot vcf --vcf mc.vcf  -d test -O png -b ../macOpe2.sorted.bam 
Traceback (most recent call last):
  File "/vf/users/okendojo/conda/envs/samplot/bin/samplot", line 10, in <module>
    sys.exit(main())
  File "/vf/users/okendojo/conda/envs/samplot/lib/python3.10/site-packages/samplot/__main__.py", line 31, in main
    args.func(parser, args, extra_args)
  File "/vf/users/okendojo/conda/envs/samplot/lib/python3.10/site-packages/samplot/samplot_vcf.py", line 1133, in vcf
    commands, table_data = generate_commands(
  File "/vf/users/okendojo/conda/envs/samplot/lib/python3.10/site-packages/samplot/samplot_vcf.py", line 949, in generate_commands
    svtype = variant.info.get("SVTYPE", "SV")
  File "pysam/libcbcf.pyx", line 2711, in pysam.libcbcf.VariantRecordInfo.get
ValueError: Invalid header
brentp commented 1 year ago

what does head mc.vcf show? This seems to be a samplot issue, not a duphold issue, right?

Jokendo-collab commented 1 year ago

head mc.vcf shows the following:

##fileformat=VCFv4.2
##contig=<ID=ptg000001l,length=17552345>
##contig=<ID=ptg000002l,length=15455575>
##contig=<ID=ptg000003l,length=17609903>
##contig=<ID=ptg000004l,length=20365586>
##contig=<ID=ptg000005l,length=2880420>
##contig=<ID=ptg000006l,length=19393576>
##contig=<ID=ptg000007l,length=20082800>
##contig=<ID=ptg000008l,length=19379476>
##contig=<ID=ptg000009l,length=24022457>