Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot-vcfstats -s leads to IndexError: list index out of range #2353

Open
warthmann opened this issue Jan 9, 2025 · 0 comments
Open

plot-vcfstats -s leads to IndexError: list index out of range #2353

warthmann opened this issue Jan 9, 2025 · 0 comments

Comments

@warthmann
Copy link

Hello,

bcftools view input.vcf.gz | bcftools stats -s - > file.vchk
plot-vcfstats -p outdir file.vchk

works perfectly, but when I want sample names instead of indices, ie use the -s flag, it throws an index error

(ngs-tools) norman@norman-Workstation:$ plot-vcfstats -s -p outdir file.vchk
Parsing bcftools stats output: file.vchk
Plotting graphs: python3 plot.py
Traceback (most recent call last):
  File "/mnt/data/norman/Analysis/banana/TR4_SEQ2020/Analysis-Aug2024/Results-SNP-Analysis/outdir/plot.py", line 601, in <module>
    plt.xticks([int(row[0]) for row in dat],[row[7] for row in dat],**sample_font)
                                             ~~~^^^
IndexError: list index out of range
The command exited with non-zero status 256:
	python3 plot.py

 at xxx/miniconda3/envs/ngs-tools/bin/plot-vcfstats line 116.
	main::error("The command exited with non-zero status 256:\x{a}\x{9}python3 plot.py\x{a}\x{a}") called at xxx/miniconda3/envs/ngs-tools/bin/plot-vcfstats line 311
	main::plot(HASH(0x56199d6bbed0)) called at xxx/miniconda3/envs/ngs-tools/bin/plot-vcfstats line 75

any help is greatly appreciated. My vcf file contains 5 samples, and it occurs whether or not I list them in the bcftools stats -s commandline.

I am on Ubuntu 20 in a conda environment with
bcftools 1.21
matplotlib 3.10.0
Python 3.13.1

thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant