eastgenomics / eggd_generate_variant_workbook

DNAnexus app for generating xlsx variant workbooks
3 stars 0 forks source link

Python3 use with get_transcript_regions.py causes error #39

Closed Yu-jinKim closed 3 years ago

Yu-jinKim commented 4 years ago

In my local setup of vcf2xls, using Python3 causes an eval error when I use get_transcript_regions.py. This is caused by Python3.6 (I think it's .6) being able to remember in which order keys and values are added in the dictionary. get_transcript_regions.py outputs this when using Python2:

(
        {
        refseq=>"NM_000060.2",
        exon_nr=>"1",
        region=>{
                        start=>"15643353",
                        end=>"15643406",
                        chrom=>"3",
                }
        },
        {
        refseq=>"NM_000060.2",
        exon_nr=>"2",
        region=>{
                        start=>"15676926",
                        end=>"15677200",
                        chrom=>"3",
                }
        },
        {
        refseq=>"NM_000060.2",
        exon_nr=>"3",
        region=>{
                        start=>"15683410",
                        end=>"15683569",
                        chrom=>"3",
                }
        },
        {
        refseq=>"NM_000060.2",
        exon_nr=>"4",
        region=>{
                        start=>"15685818",
                        end=>"15687000",
                        chrom=>"3",
                }
        },
)

But this when using Python3 because that's the way I add the data in the script:

(
        {
        refseq=>"NM_000060.2",
        region=>{
                        start=>"15643353",
                        end=>"15643406",
                        chrom=>"3",
                }
        exon_nr=>"1",
        },
        {
        refseq=>"NM_000060.2",
        region=>{
                        start=>"15676926",
                        end=>"15677200",
                        chrom=>"3",
                }
        exon_nr=>"2",
        },
        {
        refseq=>"NM_000060.2",
        region=>{
                        start=>"15683410",
                        end=>"15683569",
                        chrom=>"3",
                }
        exon_nr=>"3",
        },
        {
        refseq=>"NM_000060.2",
        region=>{
                        start=>"15685818",
                        end=>"15687000",
                        chrom=>"3",
                }
        exon_nr=>"4",
        },
)

The missing comma after the region sub-hashes causes the eval to fail and the use of Python2 was preventing this from happening. So add comma after printing the region sub-hash in get_transcript_regions.py

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.97. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.