'HTSeq._HTSeq.GenomicInterval' object has no attribute 'xrange'
0
0
Entering edit mode
4.5 years ago
zhangdengwei ▴ 210

Hi,

I'd like to employ HTSeq to summarize my alignment data. But I encountered an error about its syntax, my code is

import HTSeq
ga = HTSeq.GenomicArray("auto", stranded=False)
iv = HTSeq.GenomicPosition('chr1', 50, "+")
ga[iv] += 1
iv = HTSeq.GenomicPosition('chr1', 50, "+")
ga[iv] += 1
iv = HTSeq.GenomicPosition('chr1', 49, "+")
ga[iv] += 1
iv = HTSeq.GenomicPosition('chr1', 53, "+")
ga[iv] += 1
iv = HTSeq.GenomicPosition('chr1', 48, "+")
ga[iv] += 1
iv = HTSeq.GenomicPosition('chr1', 52, "+")
ga[iv] += 1

for iv, value in ga.steps():
    if value:
        for position in iv.xrange(step=1):
            print(position)

But I got this

Traceback (most recent call last):
  File "htsput.py", line 34, in <module>
    for position in iv.xrange(step=1):
AttributeError: 'HTSeq._HTSeq.GenomicInterval' object has no attribute 'xrange'

According to its tutorial, the GenomicInterval should have the attribute of xrange, like

GenomicInterval.xrange(step = 1)
GenomicInterval.xrange_d(step = 1)

So how can I correct my code? Any suggestion is appreciated, thanks very much.

RNA-Seq python HTSeq • 974 views
ADD COMMENT
0
Entering edit mode

Are you using the latest version?

ADD REPLY
0
Entering edit mode

Yes, my version of HTSeq is 0.11.2, and 3.7 for python

ADD REPLY
0
Entering edit mode

But you have GenomicPosition not Intervals

ADD REPLY

Login before adding your answer.

Traffic: 1804 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6