farhangus / Sniffles2_plot

23 stars 1 forks source link

error when running with multisample vcf file #7

Closed imdanique closed 8 months ago

imdanique commented 10 months ago

The tool runs correctly with single-sample vcf files, however when I try to run a vcf file with 3 samples it throws an error

$ python3 sniffles2_plots.py -i ../merge.vcf -o ../merged_plots
../merge
Traceback (most recent call last):
  File "vcf_visulaizer.py", line 31, in <module>
    main()
  File "vcf_visulaizer.py", line 26, in main
    multi_visulaizer(input_vcf_file, output_path)
  File "/data/dkarabayev/wf-human-variation/sniffle2_plot/src/multi_vcf_visualizer.py", line 19, in multi_visulaizer
    SV_site.sv_sites_per_genome()
  File "/data/dkarabayev/wf-human-variation/sniffle2_plot/src/sv_sites_per_genome.py", line 36, in sv_sites_per_genome
    obj = VCFLineSVPopulation(line)
  File "/data/dkarabayev/wf-human-variation/sniffle2_plot/src/vcf_line_parser.py", line 214, in __init__
    self.get_genotype(FORMAT, sample_header_names)
  File "/data/dkarabayev/wf-human-variation/sniffle2_plot/src/vcf_line_parser.py", line 268, in get_genotype
    sample_gt.set_dr(gt_value)
  File "/data/dkarabayev/wf-human-variation/sniffle2_plot/src/vcf_line_parser.py", line 148, in set_dr
    self.dr = int(this_dr)
ValueError: invalid literal for int() with base 10: '.'
farhangus commented 10 months ago

Do your VCF files contain alternative chromosomes? The program does not support VCF files that include alternative chromosomes.

imdanique commented 10 months ago

@farhangus I don't have alternative contigs and I've removed all the variants from unlocalized and unplaced (random) sequences but still get the same error

farhangus commented 10 months ago

will you please send me your vcf file ("fjaryanius@gmail.com"), so I can check it

xjYANG66 commented 9 months ago

Have the above errors been resolved? I also encountered the same problem

farhangus commented 9 months ago

will you please send me your vcf file ("fjaryanius@gmail.com"), so I can check it

farhangus commented 8 months ago

The problem is solved in the latest version of the program.

imdanique commented 6 months ago

Hi, sorry for bothering again but it still gives me an error. Almost the same as previous one:

$python -m sniffles2_plot -i merged -o .                                                                                  

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/__main__.py", line 9, in <module>
    entry_point()
  File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/cli/entry_point.py", line 39, in entry_point
    generate_charts(file_name, directory_path)
  File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/cli/generate_charts.py", line 23, in generate_charts
    generate_multi_vcf_charts(input_vcf_file_path, output_directory_path)
  File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/cli/multi_vcf_visualizer.py", line 23, in generate_multi_vcf_charts
    SV_site.sv_sites_per_genome()
  File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/chart_generator/sv_sites_per_genome.py", line 38, in sv_sites_per_genome
    obj = VCFLineSVPopulation(line)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/parser/vcf_line_parser.py", line 272, in __init__
    self.get_genotype(FORMAT, sample_header_names)
  File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/parser/vcf_line_parser.py", line 344, in get_genotype
    sample_gt.set_dv(gt_value)
  File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/parser/vcf_line_parser.py", line 198, in set_dv
    self.dv = int(this_dv)
              ^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '.\n'
farhangus commented 6 months ago

Thanks for your message, will you please send me your VCF file, so I can check the program.

On Thu, Feb 1, 2024 at 7:18 AM Daniyar Karabayev @.***> wrote:

Hi, sorry for bothering again but it still gives me an error. Almost the same as previous one:

$python -m sniffles2_plot -i merged -o .

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/main.py", line 9, in entry_point() File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/cli/entry_point.py", line 39, in entry_point generate_charts(file_name, directory_path) File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/cli/generate_charts.py", line 23, in generate_charts generate_multi_vcf_charts(input_vcf_file_path, output_directory_path) File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/cli/multi_vcf_visualizer.py", line 23, in generate_multi_vcf_charts SV_site.sv_sites_per_genome() File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/chart_generator/sv_sites_per_genome.py", line 38, in sv_sites_per_genome obj = VCFLineSVPopulation(line) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/parser/vcf_line_parser.py", line 272, in init self.get_genotype(FORMAT, sample_header_names) File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/parser/vcf_line_parser.py", line 344, in get_genotype sample_gt.set_dv(gt_value) File "/Users/karabaye/miniconda3/envs/assemblies/lib/python3.12/site-packages/sniffles2_plot/parser/vcf_line_parser.py", line 198, in set_dv self.dv = int(this_dv) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '.\n'

— Reply to this email directly, view it on GitHub https://github.com/farhangus/Sniffles2_plot/issues/7#issuecomment-1921305860, or unsubscribe https://github.com/notifications/unsubscribe-auth/A73J5UIUSJXVUCEJ6XRTQ2DYROIYVAVCNFSM6AAAAAA6MDKEQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRRGMYDKOBWGA . You are receiving this because you modified the open/close state.Message ID: @.***>