DaehwanKimLab / hisat2

Graph-based alignment (Hierarchical Graph FM index)
GNU General Public License v3.0
464 stars 113 forks source link

hisatgenotype_locus.py "TypeError: 'NoneType' object is not iterable" #246

Closed Piccetteeno closed 4 years ago

Piccetteeno commented 4 years ago

Hello, I am runnning hisatgenotype_locus.py to analyze HLA locus, it runs pretty well on all genes until it has to analyse HLA-C, when raises "TypeError: 'NoneType' object is not iterable".

 103 reads and 53 pairs are aligned
                                1 C*04:01:01:06 (count: 28)
                                2 C*04:198 (count: 28)
                                3 C*04:206 (count: 28)
                                4 C*04:01:01:01 (count: 27)
                                5 C*04:01:01:03 (count: 27)
                                6 C*04:01:01:05 (count: 27)
                                7 C*04:01:01:07 (count: 27)
                                8 C*04:01:44 (count: 27)
                                9 C*04:01:68 (count: 27)
                                10 C*04:01:73 (count: 27)

Traceback (most recent call last):
  File "/results/sampaolo/hisat2-2.2.0/hisatgenotype_locus.py", line 2630, in <module>
    debug)
  File "/results/sampaolo/hisat2-2.2.0/hisatgenotype_locus.py", line 2365, in genotyping_locus
    assembly_verbose)
  File "/results/sampaolo/hisat2-2.2.0/hisatgenotype_locus.py", line 1554, in typing
    begin_y = asm_graph.draw(0, "a. Read alignment")
  File "/results/sampaolo/hisat2-2.2.0/hisatgenotype_modules/hisatgenotype_assembly_graph.py", line 1788, in draw
    allele_node_colors)
TypeError: 'NoneType' object is not iterable

I suppose it happens when the code has to draw graphs for empty alleles, since python can't handle "None" data it raises an error instead of skipping to the next. I am using hisatgenotpye_v1.1.2_beta-devel version with this code:

hisatgenotype_locus.py --base hla --assembly -1 SRR1517869_1.fastq.gz -2 SRR1517869_2.fastq.gz

thanx for your contribution Best wishes Paolo

parkchanhee commented 4 years ago

@chbe-helix Could you please check this issue?

chbe-helix commented 4 years ago

Hi Paolo,

Sorry for the late rely. I'm not entirely sure what the issue is in the assembly. I suspect the issue is due to the low coverage over the gene. You're welcome to try using the new version of HISAT-genotype 1.3.0 found here: https://github.com/DaehwanKimLab/hisat-genotype

If you still have issues in the new version running on python3 I can look into it more and fix it in the next release.

Thanks! -Chris

chbe-helix commented 4 years ago

Since we have moved HISAT-genotype to it's own repository I will go ahead and close this issue here.