Skip to content

gtf2bed.py py2->py3 conversation error #16

@genio0815

Description

@genio0815

Hi,

running

nf-core/slamseq v1.0.0
Container: singularity - nfcore/slamseq:1.0.0

leads to

Error executing process > 'gtf2bed (genes.gtf)'

Caused by:
  Process `gtf2bed (genes.gtf)` terminated with an error exit status (1)

Command executed:

  gtf2bed.py genes.gtf | sort -k1,1 -k2,2n > genes.3utr.bed

Command exit status:
  1

Command output:
  (empty)

Command error:
  Traceback (most recent call last):
    File  XXX/nf-core/slamseq/bin/gtf2bed.py", line 223, in <module>
      lastCDSIndexInExon = exonRank.index(lastCDS)
  AttributeError: 'dict_keys' object has no attribute 'index'

as also reported in issue #13

However the reason for that seems to be an incomplete py3 compatibility in gtf2bed.py.
The py2=>py3 conversion as begun in
t-neumann@47c9439#diff-70d6ae98392251549ca5b2101e582aaa
is (at least) also missing in line 199

exonRank = dict.keys()
# returns a 'dict_key' object in in py3, but a 'list' object in pyt2 

lastCDSIndexInExon = exonRank.index(lastCDS) 
# fails therefore in py3

cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions