harvardinformatics / degenotate

MIT License
40 stars 4 forks source link

Test-data: --no-fixed-in KeyError: 'num-ingroups' #51

Open periperipatus opened 2 months ago

periperipatus commented 2 months ago

Hello, I am attempting to run the following command on the corBra data in the test-data folder.

python /home/boltonp/miniconda3/envs/degenotate/bin/degenotate.py -a corBra.gff.gz -g corBra.fa.gz -v corBra.sample.vcf.gz -u SAMN02743852,SAMN02743851,SAMN02743850 -e SAMEA3334436,SAMEA3334437 -o degenotate_test -sfs -maf 0.05 -d " " --no-fixed-in

but I get the following error.

# 07.16.2024  10:28:16  Caclulating degeneracy per transcript             Processed 0 / 988 transcripts...                         
Traceback (most recent call last):                                                                                                 
  File "/home/boltonp/miniconda3/envs/degenotate/bin/degenotate.py", line 94, in <module>                                          
    globs = degen.processCodons(globs)                                                                                             
  File "/home/boltonp/miniconda3/envs/degenotate/lib/python3.10/site-packages/degenotate_lib/degen.py", line 369, in processCodons 
    mk_codons, globs = VCF.getVariants(globs, transcript, transcript_region, codons, extra_leading_nt, extra_trailing_nt)          
  File "/home/boltonp/miniconda3/envs/degenotate/lib/python3.10/site-packages/degenotate_lib/vcf.py", line 175, in getVariants     
    if not globs['count-fixed-alt-ingroups'] and len(in_hom_alts) == 1 and sum(in_hom_alts.values()) == globs['num-ingroups']:     
KeyError: 'num-ingroups'      

The exact same command runs fine without --no-fixed-in flag.

Any idea how to fix this? I am trying to run this on a larger dataset where the ingroup(s) is called to a heterospecific reference.

I'm running v 1.2.4 downloaded from bioconda.

tsackton commented 2 months ago

Hi periperitpatus,

This is a bug in our code, thanks for pointing it out. I've identified the issue but it might take a day or two for me to push a fix.

Tim

periperipatus commented 2 months ago

Hi Tim,

Thank you. I look forward to it. Will you reply when you've pushed the changes or should I check back next week?

Cheers,

Peri

tsackton commented 2 months ago

I'll reply here