Entering edit mode
6.0 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.
Are you using the latest version?
Yes, my version of
HTSeqis 0.11.2, and 3.7 forpythonBut you have GenomicPosition not Intervals