HTSeq-0.11.2/ 0000755 0000000 0000000 00000000000 13415007017 012513 5 ustar root root 0000000 0000000 HTSeq-0.11.2/README.rst 0000664 0000000 0000000 00000005636 13415006247 014222 0 ustar root root 0000000 0000000 |Build Status| |Documentation Status|
HTSeq
=====
HTSeq is a Python library to facilitate processing and analysis of data
from high-throughput sequencing (HTS) experiments.
Requirements
~~~~~~~~~~~~
To use ``HTSeq`` you will need:
- ``Python 2.7``\ or ``Python >= 3.4`` (tested up to 3.6)
- ``numpy``
- ``pysam >= 0.9.0``
To run the ``htseq-qa`` script, you will also need:
- ``matplotlib >=1.4``
To **build** the package from source, you will **also** need:
- ``Cython``
- ``SWIG >=3.0.8``
The latter packages are not required if you have already built ``HTSeq``
and are transferring the binaries onto another machine with a compatible
environment (architechture, shared libraries). If you are not sure,
chances are you need them.
Both **Linux** and **OSX** are supported and binaries are provided for virtually
all Linux versions and for some OSX versions (the latter only for Python 2.7
and 3.6). A source package which should not require ``Cython`` nor ``SWIG``
is provided for all other cases.
**Windows is not officially supported** as we don't have access to a Continuous
Integration Windows machine that supports ``pysam``. However, if you have built
``HTSeq`` for Windows, please open an issue and we'll try and include it in the
release.
Installation
~~~~~~~~~~~~
PIP
^^^
To install directly from PyPI:
.. raw:: html
::
pip install HTSeq
.. raw:: html
To install a specific version (e.g. version 0.11.0):
.. raw:: html
::
pip install 'HTSeq==0.11.0'
.. raw:: html
If this fails, please install all dependencies first:
.. raw:: html
::
pip install 'matplotlib>=1.4'
pip install Cython
pip install 'pysam>=0.9'
pip install HTSeq
.. raw:: html
**NOTE**: ``pysam==0.9.0`` has a bug so that ``pip Cython`` is
**required** at installation. ``pysam>=0.10.0`` should build without
Cython.
Using setup.py (distutils/setuptools)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Install the dependencies with your favourite tool (``pip``, ``conda``,
etc.).
To install ``HTSeq`` itself, run:
.. raw:: html
::
python setup.py build install
.. raw:: html
Documentation
~~~~~~~~~~~~~
Please see:
http://htseq.readthedocs.io
.. |Build Status| image:: https://camo.githubusercontent.com/12452733a10aadd3dfd477d0497f2f4a32935be3/68747470733a2f2f7472617669732d63692e6f72672f73696d6f6e2d616e646572732f68747365712e7376673f6272616e63683d6d6173746572
:target: https://travis-ci.org/simon-anders/htseq
.. |Documentation Status| image:: https://camo.githubusercontent.com/d3d354c898588bb4b62f559a3a30fa6b6364dfc3/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f68747365712f62616467652f3f76657273696f6e3d6d6173746572
:target: http://htseq.readthedocs.io
HTSeq-0.11.2/setup.py 0000664 0000000 0000000 00000014405 13415006247 014237 0 ustar root root 0000000 0000000 #!/usr/bin/env python
from __future__ import print_function
import sys
import os
from distutils.log import INFO as logINFO
if ((sys.version_info[0] == 2 and sys.version_info[1] < 7) or
(sys.version_info[0] == 3 and sys.version_info[1] < 4)):
sys.stderr.write("Error in setup script for HTSeq:\n")
sys.stderr.write("HTSeq support Python 2.7 or 3.4+.")
sys.exit(1)
# Manage python2/3 compatibility with symlinks
py_maj = sys.version_info[0]
py_fdn = 'python'+str(py_maj)+'/'
print('symlinking folders for python'+str(py_maj))
for fdn in ['src', 'HTSeq', 'doc', 'scripts', 'test']:
if os.path.islink(fdn):
os.unlink(fdn)
os.symlink(py_fdn+fdn, fdn)
try:
from setuptools import setup, Extension
from setuptools.command.build_py import build_py
from setuptools import Command
# Setuptools but not distutils support build/runtime/optional dependencies
# NOTE: setuptools < 18.0 has issues with Cython as a dependency
# NOTE: old setuptools < 18.0 has issues with extras
kwargs = dict(
setup_requires=[
'Cython',
'numpy',
'pysam>=0.9.0',
],
install_requires=[
'numpy',
'pysam>=0.9.0',
],
extras_require={
'htseq-qa': ['matplotlib>=1.4']
},
)
except ImportError:
sys.stderr.write("Could not import 'setuptools'," +
" falling back to 'distutils'.\n")
from distutils.core import setup, Extension
from distutils.command.build_py import build_py
from distutils.cmd import Command
kwargs = dict(
requires=[
'Cython',
'numpy',
'pysam>=0.9.0',
]
)
try:
import numpy
except ImportError:
sys.stderr.write("Setup script for HTSeq: Failed to import 'numpy'.\n")
sys.stderr.write("Please install numpy and then try again to install" +
" HTSeq.\n")
sys.exit(1)
numpy_include_dir = os.path.join(os.path.dirname(numpy.__file__),
'core', 'include')
# Update version from VERSION file into module
with open('VERSION') as fversion:
version = fversion.readline().rstrip()
with open(py_fdn+'HTSeq/_version.py', 'wt') as fversion:
fversion.write('__version__ = "'+version+'"')
class Preprocess_command(Command):
'''Cython and SWIG preprocessing'''
description = "preprocess Cython and SWIG files for HTSeq"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
self.swig_and_cython()
def swig_and_cython(self):
import os
from shutil import copy
from subprocess import check_call
if py_maj == 2:
from subprocess import CalledProcessError as SubprocessError
else:
from subprocess import SubprocessError
def c(x): return check_call(x, shell=True)
def p(x): return self.announce(x, level=logINFO)
# CYTHON
p('cythonizing')
cython = os.getenv('CYTHON', 'cython')
try:
c(cython+' --version')
except SubprocessError:
if os.path.isfile('src/_HTSeq.c'):
p('Cython not found, but transpiled file found')
else:
raise
else:
if py_maj == 2:
c(cython+' '+py_fdn+'src/HTSeq/_HTSeq.pyx -o '+py_fdn+'src/_HTSeq.c')
else:
c(cython+' -3 '+py_fdn+'src/HTSeq/_HTSeq.pyx -o '+py_fdn+'src/_HTSeq.c')
# SWIG
p('SWIGging')
swig = os.getenv('SWIG', 'swig')
pyswigged = py_fdn+'src/StepVector.py'
try:
if py_maj == 2:
c(swig+' -Wall -c++ -python '+py_fdn+'src/StepVector.i')
else:
p('correcting SWIG for python3')
c("2to3 --no-diffs --write --nobackups "+pyswigged)
c("sed -i 's/ import builtins as __builtin__/ import builtins/' "+pyswigged)
c("sed -i 's/\.next/.__next__/' "+pyswigged)
except SubprocessError:
if (os.path.isfile(py_fdn+'src/StepVector_wrap.cxx') and
os.path.isfile(py_fdn+'src/StepVector.py')):
p('SWIG not found, but transpiled files found')
else:
raise
p('moving swigged .py module')
copy(pyswigged, py_fdn+'HTSeq/StepVector.py')
p('done')
class Build_with_preprocess(build_py):
def run(self):
self.run_command('preprocess')
build_py.run(self)
setup(name='HTSeq',
version=version,
author='Simon Anders',
author_email='sanders@fs.tum.de',
maintainer='Fabio Zanini',
maintainer_email='fabio.zanini@stanford.edu',
url='https://github.com/simon-anders/htseq',
description="A framework to process and analyze data from " +
"high-throughput sequencing (HTS) assays",
long_description="""
A framework to process and analyze data from high-throughput sequencing
(HTS) assays.
Development: https://github.com/simon-anders/htseq
Documentation: http://htseq.readthedocs.io""",
license='GPL3',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: POSIX',
'Programming Language :: Python'
],
ext_modules=[
Extension(
'HTSeq._HTSeq',
['src/_HTSeq.c'],
include_dirs=[numpy_include_dir],
extra_compile_args=['-w']),
Extension(
'HTSeq._StepVector',
['src/StepVector_wrap.cxx'],
extra_compile_args=['-w']),
],
py_modules=[
'HTSeq._HTSeq_internal',
'HTSeq.StepVector',
'HTSeq._version',
'HTSeq.scripts.qa',
'HTSeq.scripts.count'
],
scripts=[
'scripts/htseq-qa',
'scripts/htseq-count',
],
cmdclass={
'preprocess': Preprocess_command,
'build_py': Build_with_preprocess,
},
**kwargs
)
HTSeq-0.11.2/python3/ 0000755 0000000 0000000 00000000000 13415007017 014117 5 ustar root root 0000000 0000000 HTSeq-0.11.2/python3/HTSeq/ 0000755 0000000 0000000 00000000000 13415007017 015103 5 ustar root root 0000000 0000000 HTSeq-0.11.2/python3/HTSeq/_HTSeq_internal.py 0000664 0000000 0000000 00000002610 13415006247 020501 0 ustar root root 0000000 0000000 import HTSeq
import itertools
import numpy
def GenomicInterval_xrange( gi, step ):
for pos in range( gi.start, gi.end, step ):
yield HTSeq.GenomicPosition( gi.chrom, pos, gi.strand )
def GenomicInterval_xranged( gi, step ):
if gi.strand == "-":
step *= -1
for pos in range( gi.start_d, gi.end_d, step ):
yield HTSeq.GenomicPosition( gi.chrom, pos, gi.strand )
def ChromVector_steps( cv ):
if isinstance( cv.array, numpy.ndarray ):
start = cv.iv.start
prev_val = None
for i in range( cv.iv.start, cv.iv.end ):
val = cv.array[ i - cv.offset ]
if prev_val is None or val != prev_val:
if prev_val is not None:
yield ( HTSeq.GenomicInterval( cv.iv.chrom, start, i, cv.iv.strand ), prev_val )
prev_val = val
start = i
yield ( HTSeq.GenomicInterval( cv.iv.chrom, start, cv.iv.end, cv.iv.strand ), prev_val )
elif isinstance( cv.array, HTSeq.StepVector.StepVector ):
for start, stop, value in cv.array[cv.iv.start:cv.iv.end].get_steps():
yield ( HTSeq.GenomicInterval( cv.iv.chrom, start, stop, cv.iv.strand ), value )
else:
raise SystemError("Unknown array type.")
def GenomicArray_steps( ga ):
for a in list(ga.chrom_vectors.values()):
for cv in list(a.values()):
for iv, val in cv.steps():
yield iv, val
HTSeq-0.11.2/python3/HTSeq/__init__.py 0000664 0000000 0000000 00000126760 13415006247 017236 0 ustar root root 0000000 0000000 """HTSeq is a package to process high-throughput sequencing data.
See htseq.readthedocs.io/en/master/index.html for documentation.
"""
import itertools
import warnings
import os
import shlex
import sys
import HTSeq
from HTSeq._HTSeq import *
from HTSeq._version import __version__
#########################
# Utils
#########################
class FileOrSequence(object):
""" The construcutor takes one argument, which may either be a string,
which is interpreted as a file name (possibly with path), or a
connection, by which we mean a text file opened for reading, or
any other object that can provide an iterator over strings
(lines of the file).
The advantage of passing a file name instead of an already opened file
is that if an iterator is requested several times, the file will be
re-opened each time. If the file is already open, its lines can be read
only once, and then, the iterator stays exhausted.
Furthermore, if a file name is passed that end in ".gz" or ".gzip"
(case insensitive), it is transparently gunzipped.
"""
def __init__(self, filename_or_sequence):
self.fos = filename_or_sequence
self.line_no = None
def __iter__(self):
self.line_no = 1
if isinstance(self.fos, str):
if self.fos.lower().endswith((".gz", ".gzip")):
lines = gzip.open(self.fos, 'rt')
else:
lines = open(self.fos)
else:
lines = self.fos
for line in lines:
yield line
self.line_no += 1
if isinstance(self.fos, str):
lines.close()
self.line_no = None
def __repr__(self):
if isinstance(self.fos, str):
return "<%s object, connected to file name '%s'>" % (
self.__class__.__name__, self.fos)
else:
return "<%s object, connected to %s >" % (
self.__class__.__name__, repr(self.fos))
def get_line_number_string(self):
if self.line_no is None:
if isinstance(self.fos, str):
return "file %s closed" % self.fos
else:
return "file closed"
if isinstance(self.fos, str):
return "line %d of file %s" % (self.line_no, self.fos)
else:
return "line %d" % self.line_no
#########################
# Features
#########################
class GenomicFeature(object):
"""A genomic feature, i.e., an interval on a genome with metadata.
At minimum, the following information should be provided by slots:
name: a string identifying the feature (e.g., a gene symbol)
type: a string giving the feature type (e.g., "gene", "exon")
iv: a GenomicInterval object specifying the feature locus
"""
def __init__(self, name, type_, interval):
self.name = name
self.type = sys.intern(type_)
self.iv = interval
def __repr__(self):
return "<%s: %s '%s' at %s: %d -> %d (strand '%s')>" % \
(self.__class__.__name__, self.type, self.name,
self.iv.chrom, self.iv.start_d, self.iv.end_d, self.iv.strand)
def __eq__(self, other):
if not isinstance(other, GenomicFeature):
return False
return self.name == other.name and self.type == other.type and \
self.iv == other.iv
def __neq__(self, other):
if not isinstance(other, GenomicFeature):
return True
return not self.__eq__(other)
def get_gff_line(self, with_equal_sign=False):
try:
source = self.source
except AttributeError:
source = "."
try:
score = self.score
except AttributeError:
score = "."
try:
frame = self.frame
except AttributeError:
frame = "."
try:
attr = self.attr
except AttributeError:
attr = {'ID': self.name}
if with_equal_sign:
sep = "="
else:
sep = " "
attr_str = '; '.join(
['%s%s\"%s\"' % (ak, sep, attr[ak]) for ak in attr])
return "\t".join(str(a) for a in (self.iv.chrom, source,
self.type, self.iv.start + 1, self.iv.end, score,
self.iv.strand, frame, attr_str)) + "\n"
_re_attr_main = re.compile("\s*([^\s\=]+)[\s=]+(.*)")
_re_attr_empty = re.compile("^\s*$")
def parse_GFF_attribute_string(attrStr, extra_return_first_value=False):
"""Parses a GFF attribute string and returns it as a dictionary.
If 'extra_return_first_value' is set, a pair is returned: the dictionary
and the value of the first attribute. This might be useful if this is the
ID.
"""
if attrStr.endswith("\n"):
attrStr = attrStr[:-1]
d = {}
first_val = "_unnamed_"
for (i, attr) in zip(
itertools.count(),
_HTSeq.quotesafe_split(attrStr.encode())):
attr = attr.decode()
if _re_attr_empty.match(attr):
continue
if attr.count('"') not in (0, 2):
raise ValueError(
"The attribute string seems to contain mismatched quotes.")
mo = _re_attr_main.match(attr)
if not mo:
raise ValueError("Failure parsing GFF attribute line")
val = mo.group(2)
if val.startswith('"') and val.endswith('"'):
val = val[1:-1]
d[sys.intern(mo.group(1))] = sys.intern(val)
if extra_return_first_value and i == 0:
first_val = val
if extra_return_first_value:
return (d, first_val)
else:
return d
_re_gff_meta_comment = re.compile("##\s*(\S+)\s+(\S*)")
class GFF_Reader(FileOrSequence):
"""Parse a GFF file
Pass the constructor either a file name or an iterator of lines of a
GFF files. If a file name is specified, it may refer to a gzip compressed
file.
Iterating over the object then yields GenomicFeature objects.
"""
def __init__(self, filename_or_sequence, end_included=True):
FileOrSequence.__init__(self, filename_or_sequence)
self.end_included = end_included
self.metadata = {}
def __iter__(self):
for line in FileOrSequence.__iter__(self):
if isinstance(line, bytes):
line = line.decode()
if line == "\n":
continue
if line.startswith('#'):
if line.startswith("##"):
mo = _re_gff_meta_comment.match(line)
if mo:
self.metadata[mo.group(1)] = mo.group(2)
continue
(seqname, source, feature, start, end, score,
strand, frame, attributeStr) = line.split("\t", 8)
(attr, name) = parse_GFF_attribute_string(attributeStr, True)
if self.end_included:
iv = GenomicInterval(
seqname,
int(start) - 1, int(end),
strand)
else:
iv = GenomicInterval(
seqname,
int(start) - 1, int(end) - 1,
strand)
f = GenomicFeature(name, feature, iv)
if score != ".":
score = float(score)
if frame != ".":
frame = int(frame)
f.source = source
f.score = score
f.frame = frame
f.attr = attr
yield f
def make_feature_dict(feature_sequence):
"""A feature dict is a convenient way to organize a sequence of Feature
object (which you have got, e.g., from parse_GFF).
The function returns a dict with all the feature types as keys. Each value
of this dict is again a dict, now of feature names. The values of this dict
is a list of feature.
An example makes this clear. Let's say you load the C. elegans GTF file
from Ensemble and make a feature dict:
>>> worm_features_dict = HTSeq.make_feature_dict(HTSeq.parse_GFF(
... "test_data/Caenorhabditis_elegans.WS200.55.gtf.gz"))
(This command may take a few minutes to deal with the 430,000 features
in the GTF file. Note that you may need a lot of RAM if you have millions
of features.)
Then, you can simply access, say, exon 0 of gene "F08E10.4" as follows:
>>> worm_features_dict[ 'exon' ][ 'F08E10.4' ][ 0 ]
17479001 (strand '-')>
"""
res = {}
for f in feature_sequence:
if f.type not in res:
res[f.type] = {}
res_ftype = res[f.type]
if f.name not in res_ftype:
res_ftype[f.name] = [f]
else:
res_ftype[f.name].append(f)
return res
#########################
# GenomicArray
#########################
def read_chrom_lens(filename, delimiter="\t"):
return dict(
((chrom, int(len))
for chrom, len in csv.reader(open(filename), delimiter=delimiter)))
#########################
# Sequence readers
#########################
_re_fasta_header_line = re.compile(r'>\s*(\S+)\s*(.*)')
class FastaReader(FileOrSequence):
"""A Fasta_Reader is associated with a FASTA file or an open connection
to a file-like object with content in FASTA format.
It can generate an iterator over the sequences.
"""
def __init__(self, file_, raw_iterator=False):
FileOrSequence.__init__(self, file_)
self.raw_iterator = raw_iterator
def __iter__(self):
seq = None
name = None
descr = None
for line in FileOrSequence.__iter__(self):
if line.startswith(">"):
if seq:
if self.raw_iterator:
s = (seq, name, descr)
else:
s = Sequence(seq.encode(), name)
s.descr = descr
yield s
mo = _re_fasta_header_line.match(line)
name = mo.group(1)
descr = mo.group(2)
seq = ""
else:
assert seq is not None, "FASTA file does not start with '>'."
seq += line[:-1]
if seq is not None:
if self.raw_iterator:
s = (seq, name, descr)
else:
s = Sequence(seq.encode(), name)
s.descr = descr
yield s
def get_sequence_lengths(self):
seqname = None
length = 0
seqlengths = {}
for line in FileOrSequence.__iter__(self):
if line.startswith(">"):
if seqname is not None:
seqlengths[seqname] = length
mo = _re_fasta_header_line.match(line)
seqname = mo.group(1)
length = 0
else:
assert seqname is not None, "FASTA file does not start with '>'."
length += len(line.rstrip())
if seqname is not None:
seqlengths[seqname] = length
return seqlengths
@staticmethod
def _import_pysam():
global pysam
try:
import pysam
except ImportError:
sys.stderr.write(
"Please install the 'pysam' package to be able to use the Fasta indexing functionality.")
raise
def build_index(self, force=False):
self._import_pysam()
if not isinstance(self.fos, str):
raise TypeError(
"This function only works with FastaReader objects " +
"connected to a fasta file via file name")
index_filename = self.fos + ".fai"
if os.access(index_filename, os.R_OK):
if (not force) and os.stat(self.filename_or_sequence).st_mtime <= \
os.stat(index_filename).st_mtime:
# index is up to date
return
pysam.faidx(self.fos)
if not os.access(index_filename, os.R_OK):
raise SystemError(
"Building of Fasta index failed due to unknown error.")
def __getitem__(self, iv):
if not isinstance(iv, GenomicInterval):
raise TypeError("GenomicInterval expected as key.")
if not isinstance(self.fos, str):
raise TypeError(
"This function only works with FastaReader objects " +
"connected to a fasta file via file name")
self._import_pysam()
fasta = pysam.faidx(
self.fos,
"%s:%d-%d" % (iv.chrom, iv.start, iv.end - 1))
ans = list(FastaReader(fasta))
assert len(ans) == 1
ans[0].name = str(iv)
if iv.strand != "-":
return ans[0]
else:
return ans[0].get_reverse_complement()
class FastqReader(FileOrSequence):
"""A Fastq object is associated with a FASTQ self.file. When an iterator
is requested from the object, the FASTQ file is read.
qual_scale is one of "phred", "solexa", "solexa-old".
"""
def __init__(self, file_, qual_scale="phred", raw_iterator=False):
FileOrSequence.__init__(self, file_)
self.qual_scale = qual_scale
if qual_scale not in ("phred", "solexa", "solexa-old"):
raise ValueError("Illegal quality scale.")
self.raw_iterator = raw_iterator
def __iter__(self):
fin = FileOrSequence.__iter__(self)
while True:
id1 = next(fin)
seq = next(fin)
id2 = next(fin)
qual = next(fin)
if qual == "":
if id1 != "":
warnings.warn(
"Number of lines in FASTQ file is not "
"a multiple of 4. Discarding the last, "
"incomplete record")
break
if not qual.endswith("\n"):
qual += "\n"
if not id1.startswith("@"):
raise ValueError(
"Primary ID line in FASTQ file does "
"not start with '@'. Either this is not FASTQ data or the "
"parser got out of sync.")
if not id2.startswith("+"):
raise ValueError(
"Secondary ID line in FASTQ file does"
"not start with '+'. Maybe got out of sync.")
if len(id2) > 2 and id1[1:] != id2[1:]:
raise ValueError(
"Primary and secondary ID line in FASTQ"
"disagree.")
if self.raw_iterator:
s = (seq[:-1], id1[1:-1], qual[:-1], self.qual_scale)
else:
s = SequenceWithQualities(
seq[:-1].encode(), id1[1:-1],
qual[:-1].encode(),
self.qual_scale)
yield s
class BowtieReader(FileOrSequence):
"""A BowtieFile object is associated with a Bowtie output file that
contains short read alignments. It can generate an iterator of Alignment
objects."""
def __iter__(self):
for line in FileOrSequence.__iter__(self):
try:
algnt = BowtieAlignment(line)
except ValueError:
if line.startswith("Reported "):
continue
warnings.warn(
"BowtieReader: Ignoring the following line, which could "
"not be parsed:\n%s\n" % line,
RuntimeWarning)
yield algnt
def bundle_multiple_alignments(sequence_of_alignments):
"""Some alignment programs, e.g., Bowtie, can output multiple alignments,
i.e., the same read is reported consecutively with different alignments.
This function takes an iterator over alignments and bundles consecutive
alignments regarding the same read to a list of Alignment objects and
returns an iterator over these.
"""
alignment_iter = iter(sequence_of_alignments)
algnt = next(alignment_iter)
ma = [algnt]
for algnt in alignment_iter:
if algnt.read.name != ma[0].read.name:
yield ma
ma = [algnt]
else:
ma.append(algnt)
yield ma
class SolexaExportAlignment(Alignment):
"""Iterating over SolexaExportReader objects will yield SoelxaExportRecord
objects. These have four fields:
read - a SequenceWithQualities object
aligned - a boolean, indicating whether the object was aligned
iv - a GenomicInterval giving the alignment (or None, if not aligned)
passed_filter - a boolean, indicating whether the object passed the filter
nomatch_code - a code indicating why no match was found (or None, if the
read was aligned)
As long as 'aligned' is True, a SolexaExportRecord can be treated as an
Alignment object.
"""
def __init__(self):
# Data is filled in by SolexaExportRecord
pass
def __repr__(self):
if self.aligned:
return "< %s object: Read '%s', aligned to %s >" % (
self.__class__.__name__, self.read.name, self.iv)
else:
return "< %s object: Non-aligned read '%s' >" % (
self.__class__.__name__, self.read.name)
class SolexaExportReader(FileOrSequence):
"""Parser for *_export.txt files from the SolexaPipeline software.
Iterating over a SolexaExportReader yields SolexaExportRecord objects.
"""
def __init__(self, filename_or_sequence, solexa_old=False):
FileOrSequence.__init__(self, filename_or_sequence)
if solexa_old:
self.qualscale = "solexa-old"
else:
self.qualscale = "solexa"
@classmethod
def parse_line_bare(dummy, line):
if line[-1] == "\n":
line = line[:-1]
res = {}
(res['machine'],
res['run_number'],
res['lane'],
res['tile'],
res['x_coord'],
res['y_coord'],
res['index_string'],
res['read_nbr'],
res['read_seq'],
res['qual_str'],
res['chrom'],
res['contig'],
res['pos'],
res['strand'],
res['match_descr'],
res['single_read_algnt_score'],
res['paired_read_algnt_score'],
res['partner_chrom'],
res['partner_contig'],
res['partner_offset'],
res['partner_strand'],
res['passed_filtering']) = line.split("\t")
return res
def __iter__(self):
for line in FileOrSequence.__iter__(self):
record = SolexaExportAlignment()
fields = SolexaExportReader.parse_line_bare(line)
if fields['read_nbr'] != "1":
warnings.warn(
"Paired-end read encountered. PE is so far supported only "
"for SAM files, not yet for SolexaExport. All PE-related "
"fields are ignored.")
record.read = SequenceWithQualities(
fields['read_seq'],
"%s:%s:%s:%s:%s#0" % (fields['machine'],
fields['lane'],
fields['tile'],
fields['x_coord'],
fields['y_coord']),
fields['qual_str'], self.qualscale)
if fields['passed_filtering'] == 'Y':
record.passed_filter = True
elif fields['passed_filtering'] == 'N':
record.passed_filter = False
else:
raise ValueError(
"Illegal 'passed filter' value in Solexa export data: '%s'." % fields['passed_filtering'])
record.index_string = fields['index_string']
if fields['pos'] == '':
record.iv = None
record.nomatch_code = fields['chrom']
else:
if fields['strand'] == 'F':
strand = '+'
elif fields['strand'] == 'R':
strand = '-'
else:
raise ValueError(
"Illegal strand value in Solexa export data.")
start = int(fields['pos'])
chrom = fields['chrom']
if fields['chrom'] == "":
chrom = fields['contig']
record.iv = GenomicInterval(
chrom, start,
start + len(fields['read_seq']), strand)
yield record
class SAM_Reader(FileOrSequence):
"""A SAM_Reader object is associated with a SAM file that
contains short read alignments. It can generate an iterator of Alignment
objects."""
def __iter__(self):
for line in FileOrSequence.__iter__(self):
if line.startswith("@"):
# do something with the header line
continue
try:
algnt = SAM_Alignment.from_SAM_line(line)
except ValueError as e:
e.args = e.args + (self.get_line_number_string(), )
raise
yield algnt
class GenomicArrayOfSets(GenomicArray):
"""A GenomicArrayOfSets is a specialization of GenomicArray that allows to store
sets of objects. On construction, the step vectors are initialized with empty sets.
By using the 'add_value' method, objects can be added to intervals. If an object
is already present in the set(s) at this interval, an the new object is added to
the present set, and the set is split if necessary.
"""
def __init__(self, chroms, stranded=True, storage='step', memmap_dir=""):
GenomicArray.__init__(self, chroms, stranded, 'O', storage, memmap_dir)
def add_chrom(self, chrom, length=sys.maxsize, start_index=0):
GenomicArray.add_chrom(self, chrom, length, start_index)
for cv in list(self.chrom_vectors[chrom].values()):
cv[:] = set()
cv.is_vector_of_sets = True
###########################
# paired-end handling
###########################
def pair_SAM_alignments(
alignments,
bundle=False,
primary_only=False):
'''Iterate over SAM aligments, name-sorted paired-end
Args:
alignments (iterator of SAM/BAM alignments): the alignments to wrap
bundle (bool): if True, bundle all alignments from one read pair into a
single yield. If False (default), each pair of alignments is
yielded separately.
primary_only (bool): for each read, consider only the primary line
(SAM flag 0x900 = 0). The SAM specification requires one and only
one of those for each read.
Yields:
2-tuples with each pair of alignments or, if bundle==True, each bundled
list of alignments.
'''
mate_missing_count = [0]
def process_list(almnt_list):
'''Transform a list of alignment with the same read name into pairs
Args:
almnt_list (list): alignments to process
Yields:
each pair of alignments.
This function is needed because each line of a BAM file is not a read
but an alignment. For uniquely mapped and unmapped reads, those two are
the same. For multimapped reads, however, there can be more than one
alignment for each read. Also, it is normal for a mapper to uniquely
map one read and multimap its mate.
This function goes down the list of alignments for a given read name
and tries to find the first mate. So if read 1 is uniquely mapped but
read 2 is mapped 4 times, only (read 1, read 2 - first occurrence) will
yield; the other 3 alignments of read 2 are ignored.
'''
while len(almnt_list) > 0:
a1 = almnt_list.pop(0)
# Find its mate
for a2 in almnt_list:
if a1.pe_which == a2.pe_which:
continue
if a1.aligned != a2.mate_aligned or a1.mate_aligned != a2.aligned:
continue
if not (a1.aligned and a2.aligned):
break
if a1.iv.chrom == a2.mate_start.chrom and a1.iv.start == a2.mate_start.pos and \
a2.iv.chrom == a1.mate_start.chrom and a2.iv.start == a1.mate_start.pos:
break
else:
if a1.mate_aligned:
mate_missing_count[0] += 1
if mate_missing_count[0] == 1:
warnings.warn(
"Read " + a1.read.name + " claims to have an aligned mate " +
"which could not be found in an adjacent line.")
a2 = None
if a2 is not None:
almnt_list.remove(a2)
if a1.pe_which == "first":
yield (a1, a2)
else:
assert a1.pe_which == "second"
yield (a2, a1)
almnt_list = []
current_name = None
for almnt in alignments:
if not almnt.paired_end:
raise ValueError(
"'pair_alignments' needs a sequence of paired-end alignments")
if almnt.pe_which == "unknown":
raise ValueError(
"Paired-end read found with 'unknown' 'pe_which' status.")
# FIXME: almnt.not_primary_alignment currently means secondary
if primary_only and (almnt.not_primary_alignment or almnt.supplementary):
continue
if almnt.read.name == current_name:
almnt_list.append(almnt)
else:
if bundle:
yield list(process_list(almnt_list))
else:
for p in process_list(almnt_list):
yield p
current_name = almnt.read.name
almnt_list = [almnt]
if bundle:
yield list(process_list(almnt_list))
else:
for p in process_list(almnt_list):
yield p
if mate_missing_count[0] > 1:
warnings.warn("%d reads with missing mate encountered." %
mate_missing_count[0])
def pair_SAM_alignments_with_buffer(
alignments,
max_buffer_size=30000000,
primary_only=False):
'''Iterate over SAM aligments with buffer, position-sorted paired-end
Args:
alignments (iterator of SAM/BAM alignments): the alignments to wrap
max_buffer_size (int): maxmal numer of alignments to keep in memory.
primary_only (bool): for each read, consider only the primary line
(SAM flag 0x900 = 0). The SAM specification requires one and only
one of those for each read.
Yields:
2-tuples with each pair of alignments.
'''
almnt_buffer = {}
ambiguous_pairing_counter = 0
for almnt in alignments:
if not almnt.paired_end:
raise ValueError(
"Sequence of paired-end alignments expected, but got single-end alignment.")
if almnt.pe_which == "unknown":
raise ValueError(
"Cannot process paired-end alignment found with 'unknown' 'pe_which' status.")
# FIXME: almnt.not_primary_alignment currently means secondary
if primary_only and (almnt.not_primary_alignment or almnt.supplementary):
continue
matekey = (
almnt.read.name,
"second" if almnt.pe_which == "first" else "first",
almnt.mate_start.chrom if almnt.mate_aligned else None,
almnt.mate_start.pos if almnt.mate_aligned else None,
almnt.iv.chrom if almnt.aligned else None,
almnt.iv.start if almnt.aligned else None,
-almnt.inferred_insert_size if almnt.aligned and almnt.mate_aligned else None)
if matekey in almnt_buffer:
if len(almnt_buffer[matekey]) == 1:
mate = almnt_buffer[matekey][0]
del almnt_buffer[matekey]
else:
mate = almnt_buffer[matekey].pop(0)
if ambiguous_pairing_counter == 0:
ambiguous_pairing_first_occurance = matekey
ambiguous_pairing_counter += 1
if almnt.pe_which == "first":
yield (almnt, mate)
else:
yield (mate, almnt)
else:
almntkey = (
almnt.read.name, almnt.pe_which,
almnt.iv.chrom if almnt.aligned else None,
almnt.iv.start if almnt.aligned else None,
almnt.mate_start.chrom if almnt.mate_aligned else None,
almnt.mate_start.pos if almnt.mate_aligned else None,
almnt.inferred_insert_size if almnt.aligned and almnt.mate_aligned else None)
if almntkey not in almnt_buffer:
almnt_buffer[almntkey] = [almnt]
else:
almnt_buffer[almntkey].append(almnt)
if len(almnt_buffer) > max_buffer_size:
raise ValueError(
"Maximum alignment buffer size exceeded while pairing SAM alignments.")
if len(almnt_buffer) > 0:
warnings.warn(
"Mate records missing for %d records; first such record: %s." %
(len(almnt_buffer), str(list(almnt_buffer.values())[0][0])))
for almnt_list in list(almnt_buffer.values()):
for almnt in almnt_list:
if almnt.pe_which == "first":
yield (almnt, None)
else:
yield (None, almnt)
if ambiguous_pairing_counter > 0:
warnings.warn(
"Mate pairing was ambiguous for %d records; mate key for first such record: %s." %
(ambiguous_pairing_counter, str(ambiguous_pairing_first_occurance)))
###########################
# variant calls
###########################
_re_vcf_meta_comment = re.compile("^##([a-zA-Z]+)\=(.*)$")
_re_vcf_meta_descr = re.compile(
'ID=[^,]+,?|Number=[^,]+,?|Type=[^,]+,?|Description="[^"]+",?')
_re_vcf_meta_types = re.compile("[INFO|FILTER|FORMAT]")
_vcf_typemap = {
"Integer": int,
"Float": float,
"String": str,
"Flag": bool
}
class VariantCall(object):
def __init__(self, chrom=None, pos=None, identifier=None, ref=None,
alt=None, qual=None, filtr=None, info=None):
self.chrom = chrom
self.pos = pos
self.id = identifier
self.ref = ref
self.alt = alt
self.qual = qual
self.filter = filtr
self.info = info
self._original_line = None
@classmethod
def fromdict(cls, dictionary):
ret = cls()
ret.chrom = dictionary["chrom"]
ret.pos = dictionary["pos"]
ret.id = dictionary["id"]
ret.ref = dictionary["ref"]
ret.alt = dictionary["alt"]
ret.qual = dictionary["qual"]
ret.filter = dictionary["filter"]
ret.info = dictionary["info"]
ret._original_line = None
@classmethod
def fromline(cls, line, nsamples=0, sampleids=[]):
ret = cls()
if nsamples == 0:
ret.format = None
ret.chrom, ret.pos, ret.id, ret.ref, ret.alt, ret.qual, ret.filter, ret.info = line.rstrip("\n").split("\t", 7)
else:
lsplit = line.rstrip("\n").split("\t")
ret.chrom, ret.pos, ret.id, ret.ref, ret.alt, ret.qual, ret.filter, ret.info = lsplit[:8]
ret.format = lsplit[8].split(":")
ret.samples = {}
spos = 9
for sid in sampleids:
ret.samples[sid] = dict((name, value) for (
name, value) in zip(ret.format, lsplit[spos].split(":")))
spos += 1
ret.pos = GenomicPosition(ret.chrom, int(ret.pos))
ret.alt = ret.alt.split(",")
ret._original_line = line
return ret
def infoline(self):
if self.info.__class__ == dict:
return ";".join(map((lambda key: str(key) + "=" + str(self.info[key])), self.info))
else:
return self.info
def get_original_line(self):
warnings.warn(
"Original line is empty, probably this object was created from scratch and not from a line in a .vcf file!")
return self._original_line
def sampleline(self):
if self.format == None:
sys.stderr.write("No samples in this variant call!\n")
return ""
keys = self.format
ret = [":".join(keys)]
for sid in self.samples:
tmp = []
for k in keys:
if k in self.samples[sid]:
tmp.append(self.samples[sid][k])
ret.append(":".join(tmp))
return "\t".join(ret)
def to_line(self):
if self.format == None:
return "\t".join(map(str, [self.pos.chrom, self.pos.pos, self.id, self.ref, ",".join(self.alt), self.qual, self.filter, self.infoline()])) + "\n"
else:
return "\t".join(map(str, [self.pos.chrom, self.pos.pos, self.id, self.ref, ",".join(self.alt), self.qual, self.filter, self.infoline(), self.sampleline()])) + "\n"
def __descr__(self):
return "" % (str(self.pos).rstrip("/."), self.ref, str(self.alt).strip("[]"))
def __str__(self):
return "%s:'%s'->%s" % (str(self.pos).rstrip("/."), self.ref, str(self.alt).strip("[]"))
def unpack_info(self, infodict):
tmp = {}
for token in self.info.strip(";").split(";"):
if re.compile("=").search(token):
token = token.split("=")
if token[0] in infodict:
tmp[token[0]] = list(
map(infodict[token[0]], token[1].split(",")))
else:
tmp[token[0]] = token[1].split(",")
if len(tmp[token[0]]) == 1:
tmp[token[0]] = tmp[token[0]][0]
else: # Flag attribute found
tmp[token] = True
diff = set(infodict.keys()).difference(set(tmp.keys()))
for key in diff:
if infodict[key] == bool:
tmp[key] = False
self.info = tmp
class VCF_Reader(FileOrSequence):
def __init__(self, filename_or_sequence):
FileOrSequence.__init__(self, filename_or_sequence)
self.metadata = {}
self.info = {}
self.filters = {}
self.formats = {}
self.nsamples = 0
self.sampleids = []
def make_info_dict(self):
self.infodict = dict(
(key,
_vcf_typemap[self.info[key]["Type"]]) for key in list(self.info.keys()))
def parse_meta(self, header_filename=None):
if header_filename is None:
the_iter = FileOrSequence.__iter__(self)
else:
the_iter = open(header_filename, "r")
for line in the_iter:
if line.startswith('#'):
if line.startswith("##"):
mo = _re_vcf_meta_comment.match(line)
if mo:
value = mo.group(2)
if mo.group(1) == "INFO":
value = dict(e.rstrip(",").split("=", 1)
for e in _re_vcf_meta_descr.findall(value))
key = value["ID"]
del value["ID"]
self.info[key] = value
elif mo.group(1) == "FILTER":
value = dict(e.rstrip(",").split("=", 1)
for e in _re_vcf_meta_descr.findall(value))
key = value["ID"]
del value["ID"]
self.filters[key] = value
elif mo.group(1) == "FORMAT":
value = dict(e.rstrip(",").split("=", 1)
for e in _re_vcf_meta_descr.findall(value))
key = value["ID"]
del value["ID"]
self.formats[key] = value
else:
self.metadata[mo.group(1)] = mo.group(2)
else:
self.sampleids = line.rstrip("\t\n").split("\t")[9:]
self.nsamples = len(self.sampleids)
continue
else:
break
def meta_info(self, header_filename=None):
ret = []
if header_filename is None:
the_iter = FileOrSequence.__iter__(self)
else:
the_iter = open(header_filename, "r")
for line in the_iter:
if line.startswith('#'):
ret.append(line)
else:
break
return ret
def __iter__(self):
for line in FileOrSequence.__iter__(self):
if line == "\n" or line.startswith('#'):
continue
vc = VariantCall.fromline(line, self.nsamples, self.sampleids)
yield vc
class WiggleReader(FileOrSequence):
def __init__(self, filename_or_sequence, verbose=True):
FileOrSequence.__init__(self, filename_or_sequence)
self.attributes = {}
self.stepType = 'none'
self.verbose = verbose
def __iter__(self):
span = 1
pos = None
step = None
chrom = None
for line in FileOrSequence.__iter__(self):
if line.startswith('track'):
fields = shlex.split(line)[1:]
self.attributes = dict([(p[0], p[1].strip('"'))
for p in [x.split("=") for x in fields]])
elif line.startswith('fixedStep'): # do fixed step stuff
self.stepType = 'fixed'
fields = shlex.split(line)[1:]
declarations = dict([(p[0], p[1].strip('"'))
for p in [x.split("=") for x in fields]])
pos = int(declarations['start'])
step = int(declarations['step'])
chrom = declarations['chrom']
if 'span' in declarations:
span = int(declarations['span'])
else:
span = 1
elif line.startswith('variableStep'): # do variable step stuff
self.stepType = 'variable'
fields = shlex.split(line)[1:]
declarations = dict([(p[0], p[1].strip('"'))
for p in [x.split("=") for x in fields]])
chrom = declarations['chrom']
if 'span' in declarations:
span = int(declarations['span'])
else:
span = 1
elif line.startswith('browser') or line.startswith('#'): # Comment or ignored
if self.verbose:
print("Ignored line:", line)
continue
else:
if self.stepType == 'fixed':
yield (GenomicInterval(chrom, pos, pos + span, '.'), float(line.strip()))
pos += step
elif self.stepType == 'variable':
tmp = line.strip().split(" ")
pos = int(tmp[0])
yield (GenomicInterval(chrom, pos, pos + span, '.'), float(tmp[1]))
class BAM_Reader(object):
def __init__(self, filename, check_sq=True):
global pysam
self.filename = filename
self.sf = None # This one is only used by __getitem__
self.record_no = -1
self.check_sq = check_sq
try:
import pysam
except ImportError:
sys.stderr.write(
"Please Install PySam to use the BAM_Reader Class (http://code.google.com/p/pysam/)")
raise
def __iter__(self):
sf = pysam.Samfile(self.filename, "rb", check_sq=self.check_sq)
self.record_no = 0
for pa in sf:
yield SAM_Alignment.from_pysam_AlignedSegment(pa, sf)
self.record_no += 1
def fetch(self, reference=None, start=None, end=None, region=None):
sf = pysam.Samfile(self.filename, "rb", check_sq=self.check_sq)
self.record_no = 0
try:
for pa in sf.fetch(reference, start, end, region):
yield SAM_Alignment.from_pysam_AlignedRead(pa, sf)
self.record_no += 1
except ValueError as e:
if e.message == "fetch called on bamfile without index":
print("Error: ", e.message)
print(
"Your bam index file is missing or wrongly named, convention is that file 'x.bam' has index file 'x.bam.bai'!")
else:
raise
except:
raise
def get_line_number_string(self):
if self.record_no == -1:
return "unopened file %s" % (self.filename)
else:
return "record #%d in file %s" % (self.record_no, self.filename)
def __getitem__(self, iv):
if not isinstance(iv, GenomicInterval):
raise TypeError(
"Use a HTSeq.GenomicInterval to access regions within .bam-file!")
if self.sf is None:
self.sf = pysam.Samfile(self.filename, "rb", check_sq=self.check_sq)
# NOTE: pysam 0.9 has renames _hasIndex into has_index
if (hasattr(self.sf, '_hasIndex') and (not self.sf._hasIndex())) or (not self.sf.has_index()):
raise ValueError(
"The .bam-file has no index, random-access is disabled!")
for pa in self.sf.fetch(iv.chrom, iv.start + 1, iv.end):
yield SAM_Alignment.from_pysam_AlignedRead(pa, self.sf)
def get_header_dict(self):
sf = pysam.Samfile(self.filename, "rb", check_sq=self.check_sq)
return sf.header
class BAM_Writer(object):
def __init__(self, filename, template=None, referencenames=None,
referencelengths=None, text=None, header=None):
try:
import pysam
except ImportError:
sys.stderr.write(
"Please Install PySam to use the BAM_Writer Class (http://code.google.com/p/pysam/)")
raise
self.filename = filename
self.template = template
self.referencenames = referencenames
self.referencelengths = referencelengths
self.text = text
self.header = header
self.sf = pysam.Samfile(
self.filename,
mode="wb",
template=self.template,
referencenames=self.referencenames,
referencelengths=self.referencelengths,
text=self.text,
header=self.header)
@classmethod
def from_BAM_Reader(cls, fn, br):
return BAM_Writer(filename=fn, header=br.get_header_dict())
def write(self, alnmt):
self.sf.write(alnmt.to_pysam_AlignedSegment(self.sf))
def close(self):
self.sf.close()
class BED_Reader(FileOrSequence):
def __init__(self, filename_or_sequence):
FileOrSequence.__init__(self, filename_or_sequence)
def __iter__(self):
for line in FileOrSequence.__iter__(self):
if line.startswith("track"):
continue
fields = line.split()
if len(fields) < 3:
raise ValueError("BED file line contains less than 3 fields")
if len(fields) > 9:
raise ValueError("BED file line contains more than 9 fields")
iv = GenomicInterval(
fields[0],
int(fields[1]),
int(fields[2]),
fields[5] if len(fields) > 5 else ".")
f = GenomicFeature(
fields[3] if len(fields) > 3 else "unnamed",
"BED line",
iv)
f.score = float(fields[4]) if len(fields) > 4 else None
f.thick = GenomicInterval(
iv.chrom,
int(fields[6]),
int(fields[7]),
iv.strand) if len(fields) > 7 else None
f.itemRgb = [int(a) for a in fields[8].split(",")
] if len(fields) > 8 else None
yield(f)
HTSeq-0.11.2/python3/HTSeq/_version.py 0000664 0000000 0000000 00000000026 13415007013 017275 0 ustar root root 0000000 0000000 __version__ = "0.11.2" HTSeq-0.11.2/python3/HTSeq/scripts/ 0000755 0000000 0000000 00000000000 13415007017 016572 5 ustar root root 0000000 0000000 HTSeq-0.11.2/python3/HTSeq/scripts/qa.py 0000664 0000000 0000000 00000020226 13415006247 017555 0 ustar root root 0000000 0000000 #!/usr/bin/env python
# HTSeq_QA.py
#
# (c) Simon Anders, European Molecular Biology Laboratory, 2010
# released under GNU General Public License
import sys
import os.path
import optparse
from itertools import *
import numpy
import HTSeq
def main():
try:
import matplotlib
except ImportError:
sys.stderr.write("This script needs the 'matplotlib' library, which ")
sys.stderr.write("was not found. Please install it.")
matplotlib.use('PDF')
from matplotlib import pyplot
# Matplotlib <1.5 uses normalize, so this block will be deprecated
try:
from matplotlib.pyplot import Normalize
except ImportError:
from matplotlib.pyplot import normalize as Normalize
# **** Parse command line ****
optParser = optparse.OptionParser(
usage="%prog [options] read_file",
description=
"This script take a file with high-throughput sequencing reads " +
"(supported formats: SAM, Solexa _export.txt, FASTQ, Solexa " +
"_sequence.txt) and performs a simply quality assessment by " +
"producing plots showing the distribution of called bases and " +
"base-call quality scores by position within the reads. The " +
"plots are output as a PDF file.",
epilog =
"Written by Simon Anders (sanders@fs.tum.de), European Molecular Biology " +
" Laboratory (EMBL). (c) 2010. Released under the terms of the GNU General " +
" Public License v3. Part of the 'HTSeq' framework, version %s." % HTSeq.__version__)
optParser.add_option(
"-t", "--type", type="choice", dest="type",
choices=("sam", "bam", "solexa-export", "fastq", "solexa-fastq"),
default="sam", help="type of read_file (one of: sam [default], bam, " +
"solexa-export, fastq, solexa-fastq)")
optParser.add_option(
"-o", "--outfile", type="string", dest="outfile",
help="output filename (default is .pdf)")
optParser.add_option(
"-r", "--readlength", type="int", dest="readlen",
help="the maximum read length (when not specified, the script guesses from the file")
optParser.add_option(
"-g", "--gamma", type="float", dest="gamma",
default=0.3,
help="the gamma factor for the contrast adjustment of the quality score plot")
optParser.add_option(
"-n", "--nosplit", action="store_true", dest="nosplit",
help="do not split reads in unaligned and aligned ones")
optParser.add_option(
"-m", "--maxqual", type="int", dest="maxqual", default=41,
help="the maximum quality score that appears in the data (default: 41)")
if len(sys.argv) == 1:
optParser.print_help()
sys.exit(1)
(opts, args) = optParser.parse_args()
if len(args) != 1:
sys.stderr.write(
sys.argv[0] + ": Error: Please provide one argument (the read_file).\n")
sys.stderr.write(" Call with '-h' to get usage information.\n")
sys.exit(1)
readfilename = args[0]
if opts.type == "sam":
readfile = HTSeq.SAM_Reader(readfilename)
isAlnmntFile = True
elif opts.type == "bam":
readfile = HTSeq.BAM_Reader(readfilename)
isAlnmntFile = True
elif opts.type == "solexa-export":
readfile = HTSeq.SolexaExportReader(readfilename)
isAlnmntFile = True
elif opts.type == "fastq":
readfile = HTSeq.FastqReader(readfilename)
isAlnmntFile = False
elif opts.type == "solexa-fastq":
readfile = HTSeq.FastqReader(readfilename, "solexa")
isAlnmntFile = False
else:
sys.error("Oops.")
twoColumns = isAlnmntFile and not opts.nosplit
if opts.outfile is None:
outfilename = os.path.basename(readfilename) + ".pdf"
else:
outfilename = opts.outfile
# **** Get read length ****
if opts.readlen is not None:
readlen = opts.readlen
else:
readlen = 0
if isAlnmntFile:
reads = (a.read for a in readfile)
else:
reads = readfile
for r in islice(reads, 10000):
if len(r) > readlen:
readlen = len(r)
max_qual = opts.maxqual
gamma = opts.gamma
# **** Initialize count arrays ****
base_arr_U = numpy.zeros((readlen, 5), numpy.int)
qual_arr_U = numpy.zeros((readlen, max_qual+1), numpy.int)
if twoColumns:
base_arr_A = numpy.zeros((readlen, 5), numpy.int)
qual_arr_A = numpy.zeros((readlen, max_qual+1), numpy.int)
# **** Main counting loop ****
i = 0
try:
for a in readfile:
if isAlnmntFile:
r = a.read
else:
r = a
if twoColumns and (isAlnmntFile and a.aligned):
r.add_bases_to_count_array(base_arr_A)
r.add_qual_to_count_array(qual_arr_A)
else:
r.add_bases_to_count_array(base_arr_U)
r.add_qual_to_count_array(qual_arr_U)
i += 1
if (i % 200000) == 0:
print(i, "reads processed")
except:
sys.stderr.write("Error occured in: %s\n" %
readfile.get_line_number_string())
raise
print(i, "reads processed")
# **** Normalize result ****
def norm_by_pos(arr):
arr = numpy.array(arr, numpy.float)
arr_n = (arr.T / arr.sum(1)).T
arr_n[arr == 0] = 0
return arr_n
def norm_by_start(arr):
arr = numpy.array(arr, numpy.float)
arr_n = (arr.T / arr.sum(1)[0]).T
arr_n[arr == 0] = 0
return arr_n
base_arr_U_n = norm_by_pos(base_arr_U)
qual_arr_U_n = norm_by_start(qual_arr_U)
nreads_U = base_arr_U[0, :].sum()
if twoColumns:
base_arr_A_n = norm_by_pos(base_arr_A)
qual_arr_A_n = norm_by_start(qual_arr_A)
nreads_A = base_arr_A[0, :].sum()
# **** Make plot ****
def plot_bases(arr):
xg = numpy.arange(readlen)
pyplot.plot(xg, arr[:, 0], marker='.', color='red')
pyplot.plot(xg, arr[:, 1], marker='.', color='darkgreen')
pyplot.plot(xg, arr[:, 2], marker='.', color='lightgreen')
pyplot.plot(xg, arr[:, 3], marker='.', color='orange')
pyplot.plot(xg, arr[:, 4], marker='.', color='grey')
pyplot.axis((0, readlen-1, 0, 1))
pyplot.text(readlen*.70, .9, "A", color="red")
pyplot.text(readlen*.75, .9, "C", color="darkgreen")
pyplot.text(readlen*.80, .9, "G", color="lightgreen")
pyplot.text(readlen*.85, .9, "T", color="orange")
pyplot.text(readlen*.90, .9, "N", color="grey")
pyplot.figure()
pyplot.subplots_adjust(top=.85)
pyplot.suptitle(os.path.basename(readfilename), fontweight='bold')
if twoColumns:
pyplot.subplot(221)
plot_bases(base_arr_U_n)
pyplot.ylabel("proportion of base")
pyplot.title("non-aligned reads\n%.0f%% (%.4f million)" %
(100. * nreads_U / (nreads_U+nreads_A), nreads_U / 1e6))
pyplot.subplot(222)
plot_bases(base_arr_A_n)
pyplot.title("aligned reads\n%.0f%% (%.4f million)" %
(100. * nreads_A / (nreads_U+nreads_A), nreads_A / 1e6))
pyplot.subplot(223)
pyplot.pcolor(qual_arr_U_n.T ** gamma, cmap=pyplot.cm.Greens,
norm=Normalize(0, 1))
pyplot.axis((0, readlen-1, 0, max_qual+1))
pyplot.xlabel("position in read")
pyplot.ylabel("base-call quality score")
pyplot.subplot(224)
pyplot.pcolor(qual_arr_A_n.T ** gamma, cmap=pyplot.cm.Greens,
norm=Normalize(0, 1))
pyplot.axis((0, readlen-1, 0, max_qual+1))
pyplot.xlabel("position in read")
else:
pyplot.subplot(211)
plot_bases(base_arr_U_n)
pyplot.ylabel("proportion of base")
pyplot.title("%.3f million reads" % (nreads_U / 1e6))
pyplot.subplot(212)
pyplot.pcolor(qual_arr_U_n.T ** gamma, cmap=pyplot.cm.Greens,
norm=Normalize(0, 1))
pyplot.axis((0, readlen-1, 0, max_qual+1))
pyplot.xlabel("position in read")
pyplot.ylabel("base-call quality score")
pyplot.savefig(outfilename)
if __name__ == "__main__":
main()
HTSeq-0.11.2/python3/HTSeq/scripts/__init__.py 0000664 0000000 0000000 00000000000 13415006247 020677 0 ustar root root 0000000 0000000 HTSeq-0.11.2/python3/HTSeq/scripts/count.py 0000664 0000000 0000000 00000047167 13415006247 020321 0 ustar root root 0000000 0000000 import sys
import argparse
import itertools
import warnings
import traceback
import os.path
import HTSeq
class UnknownChrom(Exception):
pass
def invert_strand(iv):
iv2 = iv.copy()
if iv2.strand == "+":
iv2.strand = "-"
elif iv2.strand == "-":
iv2.strand = "+"
else:
raise ValueError("Illegal strand")
return iv2
def count_reads_in_features(sam_filenames, gff_filename,
samtype,
order, max_buffer_size,
stranded, overlap_mode,
multimapped_mode,
secondary_alignment_mode,
supplementary_alignment_mode,
feature_type, id_attribute,
additional_attributes,
quiet, minaqual, samouts):
def write_to_samout(r, assignment, samoutfile):
if samoutfile is None:
return
if not pe_mode:
r = (r,)
for read in r:
if read is not None:
read.optional_fields.append(('XF', assignment))
samoutfile.write(read.get_sam_line() + "\n")
if samouts != []:
if len(samouts) != len(sam_filenames):
raise ValueError('Select the same number of SAM input and output files')
# Try to open samout files early in case any of them has issues
for samout in samouts:
with open(samout, 'w'):
pass
# Try to open samfiles to fail early in case any of them is not there
if (len(sam_filenames) != 1) or (sam_filenames[0] != '-'):
for sam_filename in sam_filenames:
with open(sam_filename):
pass
# CIGAR match characters (including alignment match, sequence match, and
# sequence mismatch
com = ('M', '=', 'X')
features = HTSeq.GenomicArrayOfSets("auto", stranded != "no")
gff = HTSeq.GFF_Reader(gff_filename)
counts = {}
attributes = {}
i = 0
try:
for f in gff:
if f.type == feature_type:
try:
feature_id = f.attr[id_attribute]
except KeyError:
raise ValueError("Feature %s does not contain a '%s' attribute" %
(f.name, id_attribute))
if stranded != "no" and f.iv.strand == ".":
raise ValueError("Feature %s at %s does not have strand information but you are "
"running htseq-count in stranded mode. Use '--stranded=no'." %
(f.name, f.iv))
features[f.iv] += feature_id
counts[f.attr[id_attribute]] = 0
attributes[f.attr[id_attribute]] = [
f.attr[attr] if attr in f.attr else ''
for attr in additional_attributes]
i += 1
if i % 100000 == 0 and not quiet:
sys.stderr.write("%d GFF lines processed.\n" % i)
sys.stderr.flush()
except:
sys.stderr.write(
"Error occured when processing GFF file (%s):\n" %
gff.get_line_number_string())
raise
if not quiet:
sys.stderr.write("%d GFF lines processed.\n" % i)
sys.stderr.flush()
if len(counts) == 0:
sys.stderr.write(
"Warning: No features of type '%s' found.\n" % feature_type)
if samtype == "sam":
SAM_or_BAM_Reader = HTSeq.SAM_Reader
elif samtype == "bam":
SAM_or_BAM_Reader = HTSeq.BAM_Reader
else:
raise ValueError("Unknown input format %s specified." % samtype)
counts_all = []
empty_all = []
ambiguous_all = []
notaligned_all = []
lowqual_all = []
nonunique_all = []
for isam, (sam_filename) in enumerate(sam_filenames):
if samouts != []:
samoutfile = open(samouts[isam], 'w')
else:
samoutfile = None
try:
if sam_filename == "-":
read_seq_file = SAM_or_BAM_Reader(sys.stdin)
else:
read_seq_file = SAM_or_BAM_Reader(sam_filename)
read_seq_iter = iter(read_seq_file)
# Catch empty BAM files
try:
first_read = next(read_seq_iter)
pe_mode = first_read.paired_end
except:
first_read = None
pe_mode = False
if first_read is not None:
read_seq = itertools.chain([first_read], read_seq_iter)
else:
read_seq = []
except:
sys.stderr.write(
"Error occured when reading beginning of SAM/BAM file.\n")
raise
try:
if pe_mode:
if ((supplementary_alignment_mode == 'ignore') and
(secondary_alignment_mode == 'ignore')):
primary_only = True
else:
primary_only = False
if order == "name":
read_seq = HTSeq.pair_SAM_alignments(
read_seq,
primary_only=primary_only)
elif order == "pos":
read_seq = HTSeq.pair_SAM_alignments_with_buffer(
read_seq,
max_buffer_size=max_buffer_size,
primary_only=primary_only)
else:
raise ValueError("Illegal order specified.")
empty = 0
ambiguous = 0
notaligned = 0
lowqual = 0
nonunique = 0
i = 0
for r in read_seq:
if i > 0 and i % 100000 == 0 and not quiet:
sys.stderr.write(
"%d SAM alignment record%s processed.\n" %
(i, "s" if not pe_mode else " pairs"))
sys.stderr.flush()
i += 1
if not pe_mode:
if not r.aligned:
notaligned += 1
write_to_samout(r, "__not_aligned", samoutfile)
continue
if ((secondary_alignment_mode == 'ignore') and
r.not_primary_alignment):
continue
if ((supplementary_alignment_mode == 'ignore') and
r.supplementary):
continue
try:
if r.optional_field("NH") > 1:
nonunique += 1
write_to_samout(r, "__alignment_not_unique", samoutfile)
if multimapped_mode == 'none':
continue
except KeyError:
pass
if r.aQual < minaqual:
lowqual += 1
write_to_samout(r, "__too_low_aQual", samoutfile)
continue
if stranded != "reverse":
iv_seq = (co.ref_iv for co in r.cigar if co.type in com
and co.size > 0)
else:
iv_seq = (invert_strand(co.ref_iv)
for co in r.cigar if (co.type in com and
co.size > 0))
else:
if r[0] is not None and r[0].aligned:
if stranded != "reverse":
iv_seq = (co.ref_iv for co in r[0].cigar
if co.type in com and co.size > 0)
else:
iv_seq = (invert_strand(co.ref_iv) for co in r[0].cigar
if co.type in com and co.size > 0)
else:
iv_seq = tuple()
if r[1] is not None and r[1].aligned:
if stranded != "reverse":
iv_seq = itertools.chain(
iv_seq,
(invert_strand(co.ref_iv) for co in r[1].cigar
if co.type in com and co.size > 0))
else:
iv_seq = itertools.chain(
iv_seq,
(co.ref_iv for co in r[1].cigar
if co.type in com and co.size > 0))
else:
if (r[0] is None) or not (r[0].aligned):
write_to_samout(r, "__not_aligned", samoutfile)
notaligned += 1
continue
if secondary_alignment_mode == 'ignore':
if (r[0] is not None) and r[0].not_primary_alignment:
continue
elif (r[1] is not None) and r[1].not_primary_alignment:
continue
if supplementary_alignment_mode == 'ignore':
if (r[0] is not None) and r[0].supplementary:
continue
elif (r[1] is not None) and r[1].supplementary:
continue
try:
if ((r[0] is not None and r[0].optional_field("NH") > 1) or
(r[1] is not None and r[1].optional_field("NH") > 1)):
nonunique += 1
write_to_samout(r, "__alignment_not_unique", samoutfile)
if multimapped_mode == 'none':
continue
except KeyError:
pass
if ((r[0] and r[0].aQual < minaqual) or
(r[1] and r[1].aQual < minaqual)):
lowqual += 1
write_to_samout(r, "__too_low_aQual", samoutfile)
continue
try:
if overlap_mode == "union":
fs = set()
for iv in iv_seq:
if iv.chrom not in features.chrom_vectors:
raise UnknownChrom
for iv2, fs2 in features[iv].steps():
fs = fs.union(fs2)
elif overlap_mode in ("intersection-strict",
"intersection-nonempty"):
fs = None
for iv in iv_seq:
if iv.chrom not in features.chrom_vectors:
raise UnknownChrom
for iv2, fs2 in features[iv].steps():
if ((len(fs2) > 0) or
(overlap_mode == "intersection-strict")):
if fs is None:
fs = fs2.copy()
else:
fs = fs.intersection(fs2)
else:
sys.exit("Illegal overlap mode.")
if fs is None or len(fs) == 0:
write_to_samout(r, "__no_feature", samoutfile)
empty += 1
elif len(fs) > 1:
write_to_samout(r, "__ambiguous[" + '+'.join(fs) + "]",
samoutfile)
ambiguous += 1
else:
write_to_samout(r, list(fs)[0], samoutfile)
if fs is not None and len(fs) > 0:
if multimapped_mode == 'none':
if len(fs) == 1:
counts[list(fs)[0]] += 1
elif multimapped_mode == 'all':
for fsi in list(fs):
counts[fsi] += 1
else:
sys.exit("Illegal multimap mode.")
except UnknownChrom:
write_to_samout(r, "__no_feature", samoutfile)
empty += 1
except:
sys.stderr.write(
"Error occured when processing SAM input (%s):\n" %
read_seq_file.get_line_number_string())
raise
if not quiet:
sys.stderr.write(
"%d SAM %s processed.\n" %
(i, "alignments " if not pe_mode else "alignment pairs"))
sys.stderr.flush()
if samoutfile is not None:
samoutfile.close()
counts_all.append(counts.copy())
for fn in counts:
counts[fn] = 0
empty_all.append(empty)
ambiguous_all.append(ambiguous)
lowqual_all.append(lowqual)
notaligned_all.append(notaligned)
nonunique_all.append(nonunique)
pad = ['' for attr in additional_attributes]
for fn in sorted(counts.keys()):
print('\t'.join([fn] + attributes[fn] + [str(c[fn]) for c in counts_all]))
print('\t'.join(["__no_feature"] + pad + [str(c) for c in empty_all]))
print('\t'.join(["__ambiguous"] + pad + [str(c) for c in ambiguous_all]))
print('\t'.join(["__too_low_aQual"] + pad + [str(c) for c in lowqual_all]))
print('\t'.join(["__not_aligned"] + pad + [str(c) for c in notaligned_all]))
print('\t'.join(["__alignment_not_unique"] + pad + [str(c) for c in nonunique_all]))
def my_showwarning(message, category, filename, lineno=None, file=None, line=None):
sys.stderr.write("Warning: %s\n" % message)
def main():
pa = argparse.ArgumentParser(
usage="%(prog)s [options] alignment_file gff_file",
description="This script takes one or more alignment files in SAM/BAM " +
"format and a feature file in GFF format and calculates for each feature " +
"the number of reads mapping to it. See " +
"http://htseq.readthedocs.io/en/master/count.html for details.",
epilog="Written by Simon Anders (sanders@fs.tum.de), " +
"European Molecular Biology Laboratory (EMBL). (c) 2010. " +
"Released under the terms of the GNU General Public License v3. " +
"Part of the 'HTSeq' framework, version %s." % HTSeq.__version__)
pa.add_argument(
"samfilenames", nargs='+', type=str,
help="Path to the SAM/BAM files containing the mapped reads. " +
"If '-' is selected, read from standard input")
pa.add_argument(
"featuresfilename", type=str,
help="Path to the file containing the features")
pa.add_argument(
"-f", "--format", dest="samtype",
choices=("sam", "bam"), default="sam",
help="type of data, either 'sam' or 'bam' (default: sam)")
pa.add_argument(
"-r", "--order", dest="order",
choices=("pos", "name"), default="name",
help="'pos' or 'name'. Sorting order of (default: name). Paired-end sequencing " +
"data must be sorted either by position or by read name, and the sorting order " +
"must be specified. Ignored for single-end data.")
pa.add_argument(
"--max-reads-in-buffer", dest="max_buffer_size", type=int,
default=30000000,
help="When is paired end sorted by position, " +
"allow only so many reads to stay in memory until the mates are " +
"found (raising this number will use more memory). Has no effect " +
"for single end or paired end sorted by name")
pa.add_argument(
"-s", "--stranded", dest="stranded",
choices=("yes", "no", "reverse"), default="yes",
help="whether the data is from a strand-specific assay. Specify 'yes', " +
"'no', or 'reverse' (default: yes). " +
"'reverse' means 'yes' with reversed strand interpretation")
pa.add_argument(
"-a", "--minaqual", type=int, dest="minaqual",
default=10,
help="skip all reads with alignment quality lower than the given " +
"minimum value (default: 10)")
pa.add_argument(
"-t", "--type", type=str, dest="featuretype",
default="exon", help="feature type (3rd column in GFF file) to be used, " +
"all features of other type are ignored (default, suitable for Ensembl " +
"GTF files: exon)")
pa.add_argument(
"-i", "--idattr", type=str, dest="idattr",
default="gene_id", help="GFF attribute to be used as feature ID (default, " +
"suitable for Ensembl GTF files: gene_id)")
pa.add_argument(
"--additional-attr", type=str,
action='append',
default=[], help="Additional feature attributes (default: none, " +
"suitable for Ensembl GTF files: gene_name). Use multiple times " +
"for each different attribute")
pa.add_argument(
"-m", "--mode", dest="mode",
choices=("union", "intersection-strict", "intersection-nonempty"),
default="union", help="mode to handle reads overlapping more than one feature " +
"(choices: union, intersection-strict, intersection-nonempty; default: union)")
pa.add_argument(
"--nonunique", dest="nonunique", type=str,
choices=("none", "all"), default="none",
help="Whether to score reads that are not uniquely aligned " +
"or ambiguously assigned to features")
pa.add_argument(
"--secondary-alignments", dest="secondary_alignments", type=str,
choices=("score", "ignore"), default="ignore",
help="Whether to score secondary alignments (0x100 flag)")
pa.add_argument(
"--supplementary-alignments", dest="supplementary_alignments", type=str,
choices=("score", "ignore"), default="ignore",
help="Whether to score supplementary alignments (0x800 flag)")
pa.add_argument(
"-o", "--samout", type=str, dest="samouts",
action='append',
default=[], help="write out all SAM alignment records into " +
"SAM files (one per input file needed), annotating each line " +
"with its feature assignment (as an optional field with tag 'XF')")
pa.add_argument(
"-q", "--quiet", action="store_true", dest="quiet",
help="suppress progress report") # and warnings" )
args = pa.parse_args()
warnings.showwarning = my_showwarning
try:
count_reads_in_features(
args.samfilenames,
args.featuresfilename,
args.samtype,
args.order,
args.max_buffer_size,
args.stranded,
args.mode,
args.nonunique,
args.secondary_alignments,
args.supplementary_alignments,
args.featuretype,
args.idattr,
args.additional_attr,
args.quiet,
args.minaqual,
args.samouts)
except:
sys.stderr.write(" %s\n" % str(sys.exc_info()[1]))
sys.stderr.write(" [Exception type: %s, raised in %s:%d]\n" %
(sys.exc_info()[1].__class__.__name__,
os.path.basename(traceback.extract_tb(
sys.exc_info()[2])[-1][0]),
traceback.extract_tb(sys.exc_info()[2])[-1][1]))
sys.exit(1)
if __name__ == "__main__":
main()
HTSeq-0.11.2/python3/src/ 0000755 0000000 0000000 00000000000 13415007017 014706 5 ustar root root 0000000 0000000 HTSeq-0.11.2/python3/src/StepVector_wrap.cxx 0000664 0000000 0000000 00000666540 13415006247 020610 0 ustar root root 0000000 0000000 /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.11
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifndef SWIGPYTHON
#define SWIGPYTHON
#endif
#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
template class SwigValueWrapper {
struct SwigMovePointer {
T *ptr;
SwigMovePointer(T *p) : ptr(p) { }
~SwigMovePointer() { delete ptr; }
SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
} pointer;
SwigValueWrapper& operator=(const SwigValueWrapper& rhs);
SwigValueWrapper(const SwigValueWrapper& rhs);
public:
SwigValueWrapper() : pointer(0) { }
SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
operator T&() const { return *pointer.ptr; }
T *operator&() { return pointer.ptr; }
};
template T SwigValueInit() {
return T();
}
#endif
/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
* ----------------------------------------------------------------------------- */
/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif
/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
# else
# define SWIGINLINE
# endif
#endif
/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
#endif
#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
/* exporting methods */
#if defined(__GNUC__)
# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# ifndef GCC_HASCLASSVISIBILITY
# define GCC_HASCLASSVISIBILITY
# endif
# endif
#endif
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGEXPORT
# else
# define SWIGEXPORT __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define SWIGEXPORT __attribute__ ((visibility("default")))
# else
# define SWIGEXPORT
# endif
# endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
#endif
/* Intel's compiler complains if a variable which was never initialised is
* cast to void, which is a common idiom which we use to indicate that we
* are aware a variable isn't used. So we just silence that warning.
* See: https://github.com/swig/swig/issues/192 for more discussion.
*/
#ifdef __INTEL_COMPILER
# pragma warning disable 592
#endif
#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
/* Use debug wrappers with the Python release dll */
# undef _DEBUG
# include
# define _DEBUG
#else
# include
#endif
/* -----------------------------------------------------------------------------
* swigrun.swg
*
* This file contains generic C API SWIG runtime support for pointer
* type checking.
* ----------------------------------------------------------------------------- */
/* This should only be incremented when either the layout of swig_type_info changes,
or for whatever reason, the runtime changes incompatibly */
#define SWIG_RUNTIME_VERSION "4"
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE
# define SWIG_QUOTE_STRING(x) #x
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
#else
# define SWIG_TYPE_TABLE_NAME
#endif
/*
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
creating a static or dynamic library from the SWIG runtime code.
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
But only do this if strictly necessary, ie, if you have problems
with your compiler or suchlike.
*/
#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif
#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif
/* Generic buffer size */
#ifndef SWIG_BUFFER_SIZE
# define SWIG_BUFFER_SIZE 1024
#endif
/* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN 0x1
#define SWIG_CAST_NEW_MEMORY 0x2
/* Flags for new pointer objects */
#define SWIG_POINTER_OWN 0x1
/*
Flags/methods for returning states.
The SWIG conversion methods, as ConvertPtr, return an integer
that tells if the conversion was successful or not. And if not,
an error code can be returned (see swigerrors.swg for the codes).
Use the following macros/flags to set or process the returning
states.
In old versions of SWIG, code such as the following was usually written:
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
// success code
} else {
//fail code
}
Now you can be more explicit:
int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
if (SWIG_IsOK(res)) {
// success code
} else {
// fail code
}
which is the same really, but now you can also do
Type *ptr;
int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
if (SWIG_IsOK(res)) {
// success code
if (SWIG_IsNewObj(res) {
...
delete *ptr;
} else {
...
}
} else {
// fail code
}
I.e., now SWIG_ConvertPtr can return new objects and you can
identify the case and take care of the deallocation. Of course that
also requires SWIG_ConvertPtr to return new result values, such as
int SWIG_ConvertPtr(obj, ptr,...) {
if () {
if () {
*ptr = ;
return SWIG_NEWOBJ;
} else {
*ptr = ;
return SWIG_OLDOBJ;
}
} else {
return SWIG_BADOBJ;
}
}
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
SWIG errors code.
Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
allows to return the 'cast rank', for example, if you have this
int food(double)
int fooi(int);
and you call
food(1) // cast rank '1' (1 -> 1.0)
fooi(1) // cast rank '0'
just use the SWIG_AddCast()/SWIG_CheckState()
*/
#define SWIG_OK (0)
#define SWIG_ERROR (-1)
#define SWIG_IsOK(r) (r >= 0)
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT (1 << 8)
/* The NewMask denotes the object was created (using new/malloc) */
#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
/* The TmpMask is for in/out typemaps that use temporal objects */
#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
/* Simple returning values */
#define SWIG_BADOBJ (SWIG_ERROR)
#define SWIG_OLDOBJ (SWIG_OK)
#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
/* Check, add and del mask methods */
#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
/* Cast-Rank Mode */
#if defined(SWIG_CASTRANK_MODE)
# ifndef SWIG_TypeRank
# define SWIG_TypeRank unsigned long
# endif
# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
# define SWIG_MAXCASTRANK (2)
# endif
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) {
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
SWIGINTERNINLINE int SWIG_CheckState(int r) {
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
}
#else /* no cast-rank mode */
# define SWIG_AddCast(r) (r)
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif
#include
#ifdef __cplusplus
extern "C" {
#endif
typedef void *(*swig_converter_func)(void *, int *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);
/* Structure to store information on one type */
typedef struct swig_type_info {
const char *name; /* mangled name of this type */
const char *str; /* human readable name of this type */
swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
struct swig_cast_info *cast; /* linked list of types that can cast into this type */
void *clientdata; /* language specific type data */
int owndata; /* flag if the structure owns the clientdata */
} swig_type_info;
/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
swig_type_info *type; /* pointer to type that is equivalent to this type */
swig_converter_func converter; /* function to cast the void pointers */
struct swig_cast_info *next; /* pointer to next cast in linked list */
struct swig_cast_info *prev; /* pointer to the previous cast */
} swig_cast_info;
/* Structure used to store module information
* Each module generates one structure like this, and the runtime collects
* all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
size_t size; /* Number of types in this module */
struct swig_module_info *next; /* Pointer to next element in circularly linked list */
swig_type_info **type_initial; /* Array of initially generated type structures */
swig_cast_info **cast_initial; /* Array of initially generated casting structures */
void *clientdata; /* Language specific module data */
} swig_module_info;
/*
Compare two type names skipping the space characters, therefore
"char*" == "char *" and "Class" == "Class", etc.
Return 0 when the two name types are equivalent, as in
strncmp, but skipping ' '.
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
const char *f2, const char *l2) {
for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
while ((*f1 == ' ') && (f1 != l1)) ++f1;
while ((*f2 == ' ') && (f2 != l2)) ++f2;
if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
}
return (int)((l1 - f1) - (l2 - f2));
}
/*
Check type equivalence in a name list like ||...
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
SWIG_TypeCmp(const char *nb, const char *tb) {
int equiv = 1;
const char* te = tb + strlen(tb);
const char* ne = nb;
while (equiv != 0 && *ne) {
for (nb = ne; *ne; ++ne) {
if (*ne == '|') break;
}
equiv = SWIG_TypeNameComp(nb, ne, tb, te);
if (*ne) ++ne;
}
return equiv;
}
/*
Check type equivalence in a name list like ||...
Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
}
/*
Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
if (ty) {
swig_cast_info *iter = ty->cast;
while (iter) {
if (strcmp(iter->type->name, c) == 0) {
if (iter == ty->cast)
return iter;
/* Move iter to the top of the linked list */
iter->prev->next = iter->next;
if (iter->next)
iter->next->prev = iter->prev;
iter->next = ty->cast;
iter->prev = 0;
if (ty->cast) ty->cast->prev = iter;
ty->cast = iter;
return iter;
}
iter = iter->next;
}
}
return 0;
}
/*
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
if (ty) {
swig_cast_info *iter = ty->cast;
while (iter) {
if (iter->type == from) {
if (iter == ty->cast)
return iter;
/* Move iter to the top of the linked list */
iter->prev->next = iter->next;
if (iter->next)
iter->next->prev = iter->prev;
iter->next = ty->cast;
iter->prev = 0;
if (ty->cast) ty->cast->prev = iter;
ty->cast = iter;
return iter;
}
iter = iter->next;
}
}
return 0;
}
/*
Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}
/*
Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
swig_type_info *lastty = ty;
if (!ty || !ty->dcast) return ty;
while (ty && (ty->dcast)) {
ty = (*ty->dcast)(ptr);
if (ty) lastty = ty;
}
return lastty;
}
/*
Return the name associated with this type
*/
SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info *ty) {
return ty->name;
}
/*
Return the pretty name associated with this type,
that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info *type) {
/* The "str" field contains the equivalent pretty names of the
type, separated by vertical-bar characters. We choose
to print the last name, as it is often (?) the most
specific. */
if (!type) return NULL;
if (type->str != NULL) {
const char *last_name = type->str;
const char *s;
for (s = type->str; *s; s++)
if (*s == '|') last_name = s+1;
return last_name;
}
else
return type->name;
}
/*
Set the clientdata field for a type
*/
SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
swig_cast_info *cast = ti->cast;
/* if (ti->clientdata == clientdata) return; */
ti->clientdata = clientdata;
while (cast) {
if (!cast->converter) {
swig_type_info *tc = cast->type;
if (!tc->clientdata) {
SWIG_TypeClientData(tc, clientdata);
}
}
cast = cast->next;
}
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
SWIG_TypeClientData(ti, clientdata);
ti->owndata = 1;
}
/*
Search for a swig_type_info structure only by mangled name
Search is a O(log #types)
We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start,
swig_module_info *end,
const char *name) {
swig_module_info *iter = start;
do {
if (iter->size) {
size_t l = 0;
size_t r = iter->size - 1;
do {
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
size_t i = (l + r) >> 1;
const char *iname = iter->types[i]->name;
if (iname) {
int compare = strcmp(name, iname);
if (compare == 0) {
return iter->types[i];
} else if (compare < 0) {
if (i) {
r = i - 1;
} else {
break;
}
} else if (compare > 0) {
l = i + 1;
}
} else {
break; /* should never happen */
}
} while (l <= r);
}
iter = iter->next;
} while (iter != end);
return 0;
}
/*
Search for a swig_type_info structure for either a mangled name or a human readable name.
It first searches the mangled names of the types, which is a O(log #types)
If a type is not found it then searches the human readable names, which is O(#types).
We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info *start,
swig_module_info *end,
const char *name) {
/* STEP 1: Search the name field using binary search */
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
if (ret) {
return ret;
} else {
/* STEP 2: If the type hasn't been found, do a complete search
of the str field (the human readable name) */
swig_module_info *iter = start;
do {
size_t i = 0;
for (; i < iter->size; ++i) {
if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
return iter->types[i];
}
iter = iter->next;
} while (iter != end);
}
/* neither found a match */
return 0;
}
/*
Pack binary data into a string
*/
SWIGRUNTIME char *
SWIG_PackData(char *c, void *ptr, size_t sz) {
static const char hex[17] = "0123456789abcdef";
const unsigned char *u = (unsigned char *) ptr;
const unsigned char *eu = u + sz;
for (; u != eu; ++u) {
unsigned char uu = *u;
*(c++) = hex[(uu & 0xf0) >> 4];
*(c++) = hex[uu & 0xf];
}
return c;
}
/*
Unpack binary data from a string
*/
SWIGRUNTIME const char *
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
unsigned char *u = (unsigned char *) ptr;
const unsigned char *eu = u + sz;
for (; u != eu; ++u) {
char d = *(c++);
unsigned char uu;
if ((d >= '0') && (d <= '9'))
uu = (unsigned char)((d - '0') << 4);
else if ((d >= 'a') && (d <= 'f'))
uu = (unsigned char)((d - ('a'-10)) << 4);
else
return (char *) 0;
d = *(c++);
if ((d >= '0') && (d <= '9'))
uu |= (unsigned char)(d - '0');
else if ((d >= 'a') && (d <= 'f'))
uu |= (unsigned char)(d - ('a'-10));
else
return (char *) 0;
*u = uu;
}
return c;
}
/*
Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
char *r = buff;
if ((2*sizeof(void *) + 2) > bsz) return 0;
*(r++) = '_';
r = SWIG_PackData(r,&ptr,sizeof(void *));
if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
strcpy(r,name);
return buff;
}
SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
if (*c != '_') {
if (strcmp(c,"NULL") == 0) {
*ptr = (void *) 0;
return name;
} else {
return 0;
}
}
return SWIG_UnpackData(++c,ptr,sizeof(void *));
}
SWIGRUNTIME char *
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
char *r = buff;
size_t lname = (name ? strlen(name) : 0);
if ((2*sz + 2 + lname) > bsz) return 0;
*(r++) = '_';
r = SWIG_PackData(r,ptr,sz);
if (lname) {
strncpy(r,name,lname+1);
} else {
*r = 0;
}
return buff;
}
SWIGRUNTIME const char *
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
if (*c != '_') {
if (strcmp(c,"NULL") == 0) {
memset(ptr,0,sz);
return name;
} else {
return 0;
}
}
return SWIG_UnpackData(++c,ptr,sz);
}
#ifdef __cplusplus
}
#endif
/* Errors in SWIG */
#define SWIG_UnknownError -1
#define SWIG_IOError -2
#define SWIG_RuntimeError -3
#define SWIG_IndexError -4
#define SWIG_TypeError -5
#define SWIG_DivisionByZero -6
#define SWIG_OverflowError -7
#define SWIG_SyntaxError -8
#define SWIG_ValueError -9
#define SWIG_SystemError -10
#define SWIG_AttributeError -11
#define SWIG_MemoryError -12
#define SWIG_NullReferenceError -13
/* Compatibility macros for Python 3 */
#if PY_VERSION_HEX >= 0x03000000
#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
#define PyInt_Check(x) PyLong_Check(x)
#define PyInt_AsLong(x) PyLong_AsLong(x)
#define PyInt_FromLong(x) PyLong_FromLong(x)
#define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
#define PyString_Check(name) PyBytes_Check(name)
#define PyString_FromString(x) PyUnicode_FromString(x)
#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
#define PyString_AsString(str) PyBytes_AsString(str)
#define PyString_Size(str) PyBytes_Size(str)
#define PyString_InternFromString(key) PyUnicode_InternFromString(key)
#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
#endif
#ifndef Py_TYPE
# define Py_TYPE(op) ((op)->ob_type)
#endif
/* SWIG APIs for compatibility of both Python 2 & 3 */
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_Python_str_FromFormat PyUnicode_FromFormat
#else
# define SWIG_Python_str_FromFormat PyString_FromFormat
#endif
/* Warning: This function will allocate a new string in Python 3,
* so please call SWIG_Python_str_DelForPy3(x) to free the space.
*/
SWIGINTERN char*
SWIG_Python_str_AsChar(PyObject *str)
{
#if PY_VERSION_HEX >= 0x03000000
char *cstr;
char *newstr;
Py_ssize_t len;
str = PyUnicode_AsUTF8String(str);
PyBytes_AsStringAndSize(str, &cstr, &len);
newstr = (char *) malloc(len+1);
memcpy(newstr, cstr, len+1);
Py_XDECREF(str);
return newstr;
#else
return PyString_AsString(str);
#endif
}
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
#else
# define SWIG_Python_str_DelForPy3(x)
#endif
SWIGINTERN PyObject*
SWIG_Python_str_FromChar(const char *c)
{
#if PY_VERSION_HEX >= 0x03000000
return PyUnicode_FromString(c);
#else
return PyString_FromString(c);
#endif
}
/* Add PyOS_snprintf for old Pythons */
#if PY_VERSION_HEX < 0x02020000
# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
# define PyOS_snprintf _snprintf
# else
# define PyOS_snprintf snprintf
# endif
#endif
/* A crude PyString_FromFormat implementation for old Pythons */
#if PY_VERSION_HEX < 0x02020000
#ifndef SWIG_PYBUFFER_SIZE
# define SWIG_PYBUFFER_SIZE 1024
#endif
static PyObject *
PyString_FromFormat(const char *fmt, ...) {
va_list ap;
char buf[SWIG_PYBUFFER_SIZE * 2];
int res;
va_start(ap, fmt);
res = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
}
#endif
#ifndef PyObject_DEL
# define PyObject_DEL PyObject_Del
#endif
/* A crude PyExc_StopIteration exception for old Pythons */
#if PY_VERSION_HEX < 0x02020000
# ifndef PyExc_StopIteration
# define PyExc_StopIteration PyExc_RuntimeError
# endif
# ifndef PyObject_GenericGetAttr
# define PyObject_GenericGetAttr 0
# endif
#endif
/* Py_NotImplemented is defined in 2.1 and up. */
#if PY_VERSION_HEX < 0x02010000
# ifndef Py_NotImplemented
# define Py_NotImplemented PyExc_RuntimeError
# endif
#endif
/* A crude PyString_AsStringAndSize implementation for old Pythons */
#if PY_VERSION_HEX < 0x02010000
# ifndef PyString_AsStringAndSize
# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
# endif
#endif
/* PySequence_Size for old Pythons */
#if PY_VERSION_HEX < 0x02000000
# ifndef PySequence_Size
# define PySequence_Size PySequence_Length
# endif
#endif
/* PyBool_FromLong for old Pythons */
#if PY_VERSION_HEX < 0x02030000
static
PyObject *PyBool_FromLong(long ok)
{
PyObject *result = ok ? Py_True : Py_False;
Py_INCREF(result);
return result;
}
#endif
/* Py_ssize_t for old Pythons */
/* This code is as recommended by: */
/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef int Py_ssize_t;
# define PY_SSIZE_T_MAX INT_MAX
# define PY_SSIZE_T_MIN INT_MIN
typedef inquiry lenfunc;
typedef intargfunc ssizeargfunc;
typedef intintargfunc ssizessizeargfunc;
typedef intobjargproc ssizeobjargproc;
typedef intintobjargproc ssizessizeobjargproc;
typedef getreadbufferproc readbufferproc;
typedef getwritebufferproc writebufferproc;
typedef getsegcountproc segcountproc;
typedef getcharbufferproc charbufferproc;
static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
{
long result = 0;
PyObject *i = PyNumber_Int(x);
if (i) {
result = PyInt_AsLong(i);
Py_DECREF(i);
}
return result;
}
#endif
#if PY_VERSION_HEX < 0x02050000
#define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
#endif
#if PY_VERSION_HEX < 0x02040000
#define Py_VISIT(op) \
do { \
if (op) { \
int vret = visit((op), arg); \
if (vret) \
return vret; \
} \
} while (0)
#endif
#if PY_VERSION_HEX < 0x02030000
typedef struct {
PyTypeObject type;
PyNumberMethods as_number;
PyMappingMethods as_mapping;
PySequenceMethods as_sequence;
PyBufferProcs as_buffer;
PyObject *name, *slots;
} PyHeapTypeObject;
#endif
#if PY_VERSION_HEX < 0x02030000
typedef destructor freefunc;
#endif
#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
(PY_MAJOR_VERSION > 3))
# define SWIGPY_USE_CAPSULE
# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
#endif
#if PY_VERSION_HEX < 0x03020000
#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
#define Py_hash_t long
#endif
/* -----------------------------------------------------------------------------
* error manipulation
* ----------------------------------------------------------------------------- */
SWIGRUNTIME PyObject*
SWIG_Python_ErrorType(int code) {
PyObject* type = 0;
switch(code) {
case SWIG_MemoryError:
type = PyExc_MemoryError;
break;
case SWIG_IOError:
type = PyExc_IOError;
break;
case SWIG_RuntimeError:
type = PyExc_RuntimeError;
break;
case SWIG_IndexError:
type = PyExc_IndexError;
break;
case SWIG_TypeError:
type = PyExc_TypeError;
break;
case SWIG_DivisionByZero:
type = PyExc_ZeroDivisionError;
break;
case SWIG_OverflowError:
type = PyExc_OverflowError;
break;
case SWIG_SyntaxError:
type = PyExc_SyntaxError;
break;
case SWIG_ValueError:
type = PyExc_ValueError;
break;
case SWIG_SystemError:
type = PyExc_SystemError;
break;
case SWIG_AttributeError:
type = PyExc_AttributeError;
break;
default:
type = PyExc_RuntimeError;
}
return type;
}
SWIGRUNTIME void
SWIG_Python_AddErrorMsg(const char* mesg)
{
PyObject *type = 0;
PyObject *value = 0;
PyObject *traceback = 0;
if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
if (value) {
char *tmp;
PyObject *old_str = PyObject_Str(value);
PyErr_Clear();
Py_XINCREF(type);
PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
SWIG_Python_str_DelForPy3(tmp);
Py_DECREF(old_str);
Py_DECREF(value);
} else {
PyErr_SetString(PyExc_RuntimeError, mesg);
}
}
#if defined(SWIG_PYTHON_NO_THREADS)
# if defined(SWIG_PYTHON_THREADS)
# undef SWIG_PYTHON_THREADS
# endif
#endif
#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
# define SWIG_PYTHON_USE_GIL
# endif
# endif
# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
# ifndef SWIG_PYTHON_INITIALIZE_THREADS
# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
# endif
# ifdef __cplusplus /* C++ code */
class SWIG_Python_Thread_Block {
bool status;
PyGILState_STATE state;
public:
void end() { if (status) { PyGILState_Release(state); status = false;} }
SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
~SWIG_Python_Thread_Block() { end(); }
};
class SWIG_Python_Thread_Allow {
bool status;
PyThreadState *save;
public:
void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
~SWIG_Python_Thread_Allow() { end(); }
};
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
# else /* C code */
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
# endif
# else /* Old thread way, not implemented, user must provide it */
# if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
# define SWIG_PYTHON_INITIALIZE_THREADS
# endif
# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
# endif
# if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
# define SWIG_PYTHON_THREAD_END_BLOCK
# endif
# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
# endif
# if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
# define SWIG_PYTHON_THREAD_END_ALLOW
# endif
# endif
#else /* No thread support */
# define SWIG_PYTHON_INITIALIZE_THREADS
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
# define SWIG_PYTHON_THREAD_END_BLOCK
# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
# define SWIG_PYTHON_THREAD_END_ALLOW
#endif
/* -----------------------------------------------------------------------------
* Python API portion that goes into the runtime
* ----------------------------------------------------------------------------- */
#ifdef __cplusplus
extern "C" {
#endif
/* -----------------------------------------------------------------------------
* Constant declarations
* ----------------------------------------------------------------------------- */
/* Constant Types */
#define SWIG_PY_POINTER 4
#define SWIG_PY_BINARY 5
/* Constant information structure */
typedef struct swig_const_info {
int type;
char *name;
long lvalue;
double dvalue;
void *pvalue;
swig_type_info **ptype;
} swig_const_info;
/* -----------------------------------------------------------------------------
* Wrapper of PyInstanceMethod_New() used in Python 3
* It is exported to the generated module, used for -fastproxy
* ----------------------------------------------------------------------------- */
#if PY_VERSION_HEX >= 0x03000000
SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
{
return PyInstanceMethod_New(func);
}
#else
SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
{
return NULL;
}
#endif
#ifdef __cplusplus
}
#endif
/* -----------------------------------------------------------------------------
* pyrun.swg
*
* This file contains the runtime support for Python modules
* and includes code for managing global variables and pointer
* type checking.
*
* ----------------------------------------------------------------------------- */
/* Common SWIG API */
/* for raw pointers */
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
#ifdef SWIGPYTHON_BUILTIN
#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
#else
#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
#endif
#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
#define swig_owntype int
/* for raw packed data */
#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
/* for class or struct pointers */
#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
/* for C or C++ function pointers */
#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
/* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
/* Runtime API */
#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
#define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
#define SWIG_SetErrorObj SWIG_Python_SetErrorObj
#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
#define SWIG_fail goto fail
/* Runtime API implementation */
/* Error manipulation */
SWIGINTERN void
SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
PyErr_SetObject(errtype, obj);
Py_DECREF(obj);
SWIG_PYTHON_THREAD_END_BLOCK;
}
SWIGINTERN void
SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
PyErr_SetString(errtype, msg);
SWIG_PYTHON_THREAD_END_BLOCK;
}
#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
/* Set a constant value */
#if defined(SWIGPYTHON_BUILTIN)
SWIGINTERN void
SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
PyObject *s = PyString_InternFromString(key);
PyList_Append(seq, s);
Py_DECREF(s);
}
SWIGINTERN void
SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
#if PY_VERSION_HEX < 0x02030000
PyDict_SetItemString(d, (char *)name, obj);
#else
PyDict_SetItemString(d, name, obj);
#endif
Py_DECREF(obj);
if (public_interface)
SwigPyBuiltin_AddPublicSymbol(public_interface, name);
}
#else
SWIGINTERN void
SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
#if PY_VERSION_HEX < 0x02030000
PyDict_SetItemString(d, (char *)name, obj);
#else
PyDict_SetItemString(d, name, obj);
#endif
Py_DECREF(obj);
}
#endif
/* Append a value to the result obj */
SWIGINTERN PyObject*
SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
if (!result) {
result = obj;
} else if (result == Py_None) {
Py_DECREF(result);
result = obj;
} else {
if (!PyList_Check(result)) {
PyObject *o2 = result;
result = PyList_New(1);
PyList_SetItem(result, 0, o2);
}
PyList_Append(result,obj);
Py_DECREF(obj);
}
return result;
#else
PyObject* o2;
PyObject* o3;
if (!result) {
result = obj;
} else if (result == Py_None) {
Py_DECREF(result);
result = obj;
} else {
if (!PyTuple_Check(result)) {
o2 = result;
result = PyTuple_New(1);
PyTuple_SET_ITEM(result, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SET_ITEM(o3, 0, obj);
o2 = result;
result = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return result;
#endif
}
/* Unpack the argument tuple */
SWIGINTERN Py_ssize_t
SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
{
if (!args) {
if (!min && !max) {
return 1;
} else {
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
name, (min == max ? "" : "at least "), (int)min);
return 0;
}
}
if (!PyTuple_Check(args)) {
if (min <= 1 && max >= 1) {
Py_ssize_t i;
objs[0] = args;
for (i = 1; i < max; ++i) {
objs[i] = 0;
}
return 2;
}
PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
return 0;
} else {
Py_ssize_t l = PyTuple_GET_SIZE(args);
if (l < min) {
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
name, (min == max ? "" : "at least "), (int)min, (int)l);
return 0;
} else if (l > max) {
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
name, (min == max ? "" : "at most "), (int)max, (int)l);
return 0;
} else {
Py_ssize_t i;
for (i = 0; i < l; ++i) {
objs[i] = PyTuple_GET_ITEM(args, i);
}
for (; l < max; ++l) {
objs[l] = 0;
}
return i + 1;
}
}
}
/* A functor is a function object with one single object argument */
#if PY_VERSION_HEX >= 0x02020000
#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
#else
#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj);
#endif
/*
Helper for static pointer initialization for both C and C++ code, for example
static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
*/
#ifdef __cplusplus
#define SWIG_STATIC_POINTER(var) var
#else
#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
#endif
/* -----------------------------------------------------------------------------
* Pointer declarations
* ----------------------------------------------------------------------------- */
/* Flags for new pointer objects */
#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
#ifdef __cplusplus
extern "C" {
#endif
/* How to access Py_None */
#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# ifndef SWIG_PYTHON_NO_BUILD_NONE
# ifndef SWIG_PYTHON_BUILD_NONE
# define SWIG_PYTHON_BUILD_NONE
# endif
# endif
#endif
#ifdef SWIG_PYTHON_BUILD_NONE
# ifdef Py_None
# undef Py_None
# define Py_None SWIG_Py_None()
# endif
SWIGRUNTIMEINLINE PyObject *
_SWIG_Py_None(void)
{
PyObject *none = Py_BuildValue((char*)"");
Py_DECREF(none);
return none;
}
SWIGRUNTIME PyObject *
SWIG_Py_None(void)
{
static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
return none;
}
#endif
/* The python void return value */
SWIGRUNTIMEINLINE PyObject *
SWIG_Py_Void(void)
{
PyObject *none = Py_None;
Py_INCREF(none);
return none;
}
/* SwigPyClientData */
typedef struct {
PyObject *klass;
PyObject *newraw;
PyObject *newargs;
PyObject *destroy;
int delargs;
int implicitconv;
PyTypeObject *pytype;
} SwigPyClientData;
SWIGRUNTIMEINLINE int
SWIG_Python_CheckImplicit(swig_type_info *ty)
{
SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
return data ? data->implicitconv : 0;
}
SWIGRUNTIMEINLINE PyObject *
SWIG_Python_ExceptionType(swig_type_info *desc) {
SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
PyObject *klass = data ? data->klass : 0;
return (klass ? klass : PyExc_RuntimeError);
}
SWIGRUNTIME SwigPyClientData *
SwigPyClientData_New(PyObject* obj)
{
if (!obj) {
return 0;
} else {
SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
/* the klass element */
data->klass = obj;
Py_INCREF(data->klass);
/* the newraw method and newargs arguments used to create a new raw instance */
if (PyClass_Check(obj)) {
data->newraw = 0;
data->newargs = obj;
Py_INCREF(obj);
} else {
#if (PY_VERSION_HEX < 0x02020000)
data->newraw = 0;
#else
data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
#endif
if (data->newraw) {
Py_INCREF(data->newraw);
data->newargs = PyTuple_New(1);
PyTuple_SetItem(data->newargs, 0, obj);
} else {
data->newargs = obj;
}
Py_INCREF(data->newargs);
}
/* the destroy method, aka as the C++ delete method */
data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
if (PyErr_Occurred()) {
PyErr_Clear();
data->destroy = 0;
}
if (data->destroy) {
int flags;
Py_INCREF(data->destroy);
flags = PyCFunction_GET_FLAGS(data->destroy);
#ifdef METH_O
data->delargs = !(flags & (METH_O));
#else
data->delargs = 0;
#endif
} else {
data->delargs = 0;
}
data->implicitconv = 0;
data->pytype = 0;
return data;
}
}
SWIGRUNTIME void
SwigPyClientData_Del(SwigPyClientData *data) {
Py_XDECREF(data->newraw);
Py_XDECREF(data->newargs);
Py_XDECREF(data->destroy);
}
/* =============== SwigPyObject =====================*/
typedef struct {
PyObject_HEAD
void *ptr;
swig_type_info *ty;
int own;
PyObject *next;
#ifdef SWIGPYTHON_BUILTIN
PyObject *dict;
#endif
} SwigPyObject;
#ifdef SWIGPYTHON_BUILTIN
SWIGRUNTIME PyObject *
SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
{
SwigPyObject *sobj = (SwigPyObject *)v;
if (!sobj->dict)
sobj->dict = PyDict_New();
Py_INCREF(sobj->dict);
return sobj->dict;
}
#endif
SWIGRUNTIME PyObject *
SwigPyObject_long(SwigPyObject *v)
{
return PyLong_FromVoidPtr(v->ptr);
}
SWIGRUNTIME PyObject *
SwigPyObject_format(const char* fmt, SwigPyObject *v)
{
PyObject *res = NULL;
PyObject *args = PyTuple_New(1);
if (args) {
if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
if (ofmt) {
#if PY_VERSION_HEX >= 0x03000000
res = PyUnicode_Format(ofmt,args);
#else
res = PyString_Format(ofmt,args);
#endif
Py_DECREF(ofmt);
}
Py_DECREF(args);
}
}
return res;
}
SWIGRUNTIME PyObject *
SwigPyObject_oct(SwigPyObject *v)
{
return SwigPyObject_format("%o",v);
}
SWIGRUNTIME PyObject *
SwigPyObject_hex(SwigPyObject *v)
{
return SwigPyObject_format("%x",v);
}
SWIGRUNTIME PyObject *
#ifdef METH_NOARGS
SwigPyObject_repr(SwigPyObject *v)
#else
SwigPyObject_repr(SwigPyObject *v, PyObject *args)
#endif
{
const char *name = SWIG_TypePrettyName(v->ty);
PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v);
if (v->next) {
# ifdef METH_NOARGS
PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
# else
PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
# endif
# if PY_VERSION_HEX >= 0x03000000
PyObject *joined = PyUnicode_Concat(repr, nrep);
Py_DecRef(repr);
Py_DecRef(nrep);
repr = joined;
# else
PyString_ConcatAndDel(&repr,nrep);
# endif
}
return repr;
}
SWIGRUNTIME int
SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
{
void *i = v->ptr;
void *j = w->ptr;
return (i < j) ? -1 : ((i > j) ? 1 : 0);
}
/* Added for Python 3.x, would it also be useful for Python 2.x? */
SWIGRUNTIME PyObject*
SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
{
PyObject* res;
if( op != Py_EQ && op != Py_NE ) {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
return res;
}
SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
#ifdef SWIGPYTHON_BUILTIN
static swig_type_info *SwigPyObject_stype = 0;
SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void) {
SwigPyClientData *cd;
assert(SwigPyObject_stype);
cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
assert(cd);
assert(cd->pytype);
return cd->pytype;
}
#else
SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void) {
static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
return type;
}
#endif
SWIGRUNTIMEINLINE int
SwigPyObject_Check(PyObject *op) {
#ifdef SWIGPYTHON_BUILTIN
PyTypeObject *target_tp = SwigPyObject_type();
if (PyType_IsSubtype(op->ob_type, target_tp))
return 1;
return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
#else
return (Py_TYPE(op) == SwigPyObject_type())
|| (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
#endif
}
SWIGRUNTIME PyObject *
SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
SWIGRUNTIME void
SwigPyObject_dealloc(PyObject *v)
{
SwigPyObject *sobj = (SwigPyObject *) v;
PyObject *next = sobj->next;
if (sobj->own == SWIG_POINTER_OWN) {
swig_type_info *ty = sobj->ty;
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
PyObject *destroy = data ? data->destroy : 0;
if (destroy) {
/* destroy is always a VARARGS method */
PyObject *res;
/* PyObject_CallFunction() has the potential to silently drop
the active active exception. In cases of unnamed temporary
variable or where we just finished iterating over a generator
StopIteration will be active right now, and this needs to
remain true upon return from SwigPyObject_dealloc. So save
and restore. */
PyObject *val = NULL, *type = NULL, *tb = NULL;
PyErr_Fetch(&val, &type, &tb);
if (data->delargs) {
/* we need to create a temporary object to carry the destroy operation */
PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
res = SWIG_Python_CallFunctor(destroy, tmp);
Py_DECREF(tmp);
} else {
PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
PyObject *mself = PyCFunction_GET_SELF(destroy);
res = ((*meth)(mself, v));
}
if (!res)
PyErr_WriteUnraisable(destroy);
PyErr_Restore(val, type, tb);
Py_XDECREF(res);
}
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
else {
const char *name = SWIG_TypePrettyName(ty);
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
}
#endif
}
Py_XDECREF(next);
PyObject_DEL(v);
}
SWIGRUNTIME PyObject*
SwigPyObject_append(PyObject* v, PyObject* next)
{
SwigPyObject *sobj = (SwigPyObject *) v;
#ifndef METH_O
PyObject *tmp = 0;
if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
next = tmp;
#endif
if (!SwigPyObject_Check(next)) {
PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
return NULL;
}
sobj->next = next;
Py_INCREF(next);
return SWIG_Py_Void();
}
SWIGRUNTIME PyObject*
#ifdef METH_NOARGS
SwigPyObject_next(PyObject* v)
#else
SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
#endif
{
SwigPyObject *sobj = (SwigPyObject *) v;
if (sobj->next) {
Py_INCREF(sobj->next);
return sobj->next;
} else {
return SWIG_Py_Void();
}
}
SWIGINTERN PyObject*
#ifdef METH_NOARGS
SwigPyObject_disown(PyObject *v)
#else
SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
#endif
{
SwigPyObject *sobj = (SwigPyObject *)v;
sobj->own = 0;
return SWIG_Py_Void();
}
SWIGINTERN PyObject*
#ifdef METH_NOARGS
SwigPyObject_acquire(PyObject *v)
#else
SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
#endif
{
SwigPyObject *sobj = (SwigPyObject *)v;
sobj->own = SWIG_POINTER_OWN;
return SWIG_Py_Void();
}
SWIGINTERN PyObject*
SwigPyObject_own(PyObject *v, PyObject *args)
{
PyObject *val = 0;
#if (PY_VERSION_HEX < 0x02020000)
if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
#elif (PY_VERSION_HEX < 0x02050000)
if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
#else
if (!PyArg_UnpackTuple(args, "own", 0, 1, &val))
#endif
{
return NULL;
}
else
{
SwigPyObject *sobj = (SwigPyObject *)v;
PyObject *obj = PyBool_FromLong(sobj->own);
if (val) {
#ifdef METH_NOARGS
if (PyObject_IsTrue(val)) {
SwigPyObject_acquire(v);
} else {
SwigPyObject_disown(v);
}
#else
if (PyObject_IsTrue(val)) {
SwigPyObject_acquire(v,args);
} else {
SwigPyObject_disown(v,args);
}
#endif
}
return obj;
}
}
#ifdef METH_O
static PyMethodDef
swigobject_methods[] = {
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"},
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
{(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"},
{0, 0, 0, 0}
};
#else
static PyMethodDef
swigobject_methods[] = {
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"},
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
{(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"},
{0, 0, 0, 0}
};
#endif
#if PY_VERSION_HEX < 0x02020000
SWIGINTERN PyObject *
SwigPyObject_getattr(SwigPyObject *sobj,char *name)
{
return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
}
#endif
SWIGRUNTIME PyTypeObject*
SwigPyObject_TypeOnce(void) {
static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
static PyNumberMethods SwigPyObject_as_number = {
(binaryfunc)0, /*nb_add*/
(binaryfunc)0, /*nb_subtract*/
(binaryfunc)0, /*nb_multiply*/
/* nb_divide removed in Python 3 */
#if PY_VERSION_HEX < 0x03000000
(binaryfunc)0, /*nb_divide*/
#endif
(binaryfunc)0, /*nb_remainder*/
(binaryfunc)0, /*nb_divmod*/
(ternaryfunc)0,/*nb_power*/
(unaryfunc)0, /*nb_negative*/
(unaryfunc)0, /*nb_positive*/
(unaryfunc)0, /*nb_absolute*/
(inquiry)0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
#if PY_VERSION_HEX < 0x03000000
0, /*nb_coerce*/
#endif
(unaryfunc)SwigPyObject_long, /*nb_int*/
#if PY_VERSION_HEX < 0x03000000
(unaryfunc)SwigPyObject_long, /*nb_long*/
#else
0, /*nb_reserved*/
#endif
(unaryfunc)0, /*nb_float*/
#if PY_VERSION_HEX < 0x03000000
(unaryfunc)SwigPyObject_oct, /*nb_oct*/
(unaryfunc)SwigPyObject_hex, /*nb_hex*/
#endif
#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
#endif
};
static PyTypeObject swigpyobject_type;
static int type_init = 0;
if (!type_init) {
const PyTypeObject tmp = {
#if PY_VERSION_HEX >= 0x03000000
PyVarObject_HEAD_INIT(NULL, 0)
#else
PyObject_HEAD_INIT(NULL)
0, /* ob_size */
#endif
(char *)"SwigPyObject", /* tp_name */
sizeof(SwigPyObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)SwigPyObject_dealloc, /* tp_dealloc */
0, /* tp_print */
#if PY_VERSION_HEX < 0x02020000
(getattrfunc)SwigPyObject_getattr, /* tp_getattr */
#else
(getattrfunc)0, /* tp_getattr */
#endif
(setattrfunc)0, /* tp_setattr */
#if PY_VERSION_HEX >= 0x03000000
0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
#else
(cmpfunc)SwigPyObject_compare, /* tp_compare */
#endif
(reprfunc)SwigPyObject_repr, /* tp_repr */
&SwigPyObject_as_number, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
(hashfunc)0, /* tp_hash */
(ternaryfunc)0, /* tp_call */
0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
swigobject_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
(richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
0, /* tp_weaklistoffset */
#if PY_VERSION_HEX >= 0x02020000
0, /* tp_iter */
0, /* tp_iternext */
swigobject_methods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
0, /* tp_bases */
0, /* tp_mro */
0, /* tp_cache */
0, /* tp_subclasses */
0, /* tp_weaklist */
#endif
#if PY_VERSION_HEX >= 0x02030000
0, /* tp_del */
#endif
#if PY_VERSION_HEX >= 0x02060000
0, /* tp_version_tag */
#endif
#if PY_VERSION_HEX >= 0x03040000
0, /* tp_finalize */
#endif
#ifdef COUNT_ALLOCS
0, /* tp_allocs */
0, /* tp_frees */
0, /* tp_maxalloc */
#if PY_VERSION_HEX >= 0x02050000
0, /* tp_prev */
#endif
0 /* tp_next */
#endif
};
swigpyobject_type = tmp;
type_init = 1;
#if PY_VERSION_HEX < 0x02020000
swigpyobject_type.ob_type = &PyType_Type;
#else
if (PyType_Ready(&swigpyobject_type) < 0)
return NULL;
#endif
}
return &swigpyobject_type;
}
SWIGRUNTIME PyObject *
SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
{
SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
if (sobj) {
sobj->ptr = ptr;
sobj->ty = ty;
sobj->own = own;
sobj->next = 0;
}
return (PyObject *)sobj;
}
/* -----------------------------------------------------------------------------
* Implements a simple Swig Packed type, and use it instead of string
* ----------------------------------------------------------------------------- */
typedef struct {
PyObject_HEAD
void *pack;
swig_type_info *ty;
size_t size;
} SwigPyPacked;
SWIGRUNTIME int
SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
{
char result[SWIG_BUFFER_SIZE];
fputs("pack, v->size, 0, sizeof(result))) {
fputs("at ", fp);
fputs(result, fp);
}
fputs(v->ty->name,fp);
fputs(">", fp);
return 0;
}
SWIGRUNTIME PyObject *
SwigPyPacked_repr(SwigPyPacked *v)
{
char result[SWIG_BUFFER_SIZE];
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
return SWIG_Python_str_FromFormat("", result, v->ty->name);
} else {
return SWIG_Python_str_FromFormat("", v->ty->name);
}
}
SWIGRUNTIME PyObject *
SwigPyPacked_str(SwigPyPacked *v)
{
char result[SWIG_BUFFER_SIZE];
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
} else {
return SWIG_Python_str_FromChar(v->ty->name);
}
}
SWIGRUNTIME int
SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
{
size_t i = v->size;
size_t j = w->size;
int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
}
SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
SWIGRUNTIME PyTypeObject*
SwigPyPacked_type(void) {
static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
return type;
}
SWIGRUNTIMEINLINE int
SwigPyPacked_Check(PyObject *op) {
return ((op)->ob_type == SwigPyPacked_TypeOnce())
|| (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
}
SWIGRUNTIME void
SwigPyPacked_dealloc(PyObject *v)
{
if (SwigPyPacked_Check(v)) {
SwigPyPacked *sobj = (SwigPyPacked *) v;
free(sobj->pack);
}
PyObject_DEL(v);
}
SWIGRUNTIME PyTypeObject*
SwigPyPacked_TypeOnce(void) {
static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
static PyTypeObject swigpypacked_type;
static int type_init = 0;
if (!type_init) {
const PyTypeObject tmp = {
#if PY_VERSION_HEX>=0x03000000
PyVarObject_HEAD_INIT(NULL, 0)
#else
PyObject_HEAD_INIT(NULL)
0, /* ob_size */
#endif
(char *)"SwigPyPacked", /* tp_name */
sizeof(SwigPyPacked), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)SwigPyPacked_dealloc, /* tp_dealloc */
(printfunc)SwigPyPacked_print, /* tp_print */
(getattrfunc)0, /* tp_getattr */
(setattrfunc)0, /* tp_setattr */
#if PY_VERSION_HEX>=0x03000000
0, /* tp_reserved in 3.0.1 */
#else
(cmpfunc)SwigPyPacked_compare, /* tp_compare */
#endif
(reprfunc)SwigPyPacked_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
(hashfunc)0, /* tp_hash */
(ternaryfunc)0, /* tp_call */
(reprfunc)SwigPyPacked_str, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
swigpacked_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
#if PY_VERSION_HEX >= 0x02020000
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
0, /* tp_bases */
0, /* tp_mro */
0, /* tp_cache */
0, /* tp_subclasses */
0, /* tp_weaklist */
#endif
#if PY_VERSION_HEX >= 0x02030000
0, /* tp_del */
#endif
#if PY_VERSION_HEX >= 0x02060000
0, /* tp_version_tag */
#endif
#if PY_VERSION_HEX >= 0x03040000
0, /* tp_finalize */
#endif
#ifdef COUNT_ALLOCS
0, /* tp_allocs */
0, /* tp_frees */
0, /* tp_maxalloc */
#if PY_VERSION_HEX >= 0x02050000
0, /* tp_prev */
#endif
0 /* tp_next */
#endif
};
swigpypacked_type = tmp;
type_init = 1;
#if PY_VERSION_HEX < 0x02020000
swigpypacked_type.ob_type = &PyType_Type;
#else
if (PyType_Ready(&swigpypacked_type) < 0)
return NULL;
#endif
}
return &swigpypacked_type;
}
SWIGRUNTIME PyObject *
SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
{
SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
if (sobj) {
void *pack = malloc(size);
if (pack) {
memcpy(pack, ptr, size);
sobj->pack = pack;
sobj->ty = ty;
sobj->size = size;
} else {
PyObject_DEL((PyObject *) sobj);
sobj = 0;
}
}
return (PyObject *) sobj;
}
SWIGRUNTIME swig_type_info *
SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
{
if (SwigPyPacked_Check(obj)) {
SwigPyPacked *sobj = (SwigPyPacked *)obj;
if (sobj->size != size) return 0;
memcpy(ptr, sobj->pack, size);
return sobj->ty;
} else {
return 0;
}
}
/* -----------------------------------------------------------------------------
* pointers/data manipulation
* ----------------------------------------------------------------------------- */
SWIGRUNTIMEINLINE PyObject *
_SWIG_This(void)
{
return SWIG_Python_str_FromChar("this");
}
static PyObject *swig_this = NULL;
SWIGRUNTIME PyObject *
SWIG_This(void)
{
if (swig_this == NULL)
swig_this = _SWIG_This();
return swig_this;
}
/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
/* TODO: I don't know how to implement the fast getset in Python 3 right now */
#if PY_VERSION_HEX>=0x03000000
#define SWIG_PYTHON_SLOW_GETSET_THIS
#endif
SWIGRUNTIME SwigPyObject *
SWIG_Python_GetSwigThis(PyObject *pyobj)
{
PyObject *obj;
if (SwigPyObject_Check(pyobj))
return (SwigPyObject *) pyobj;
#ifdef SWIGPYTHON_BUILTIN
(void)obj;
# ifdef PyWeakref_CheckProxy
if (PyWeakref_CheckProxy(pyobj)) {
pyobj = PyWeakref_GET_OBJECT(pyobj);
if (pyobj && SwigPyObject_Check(pyobj))
return (SwigPyObject*) pyobj;
}
# endif
return NULL;
#else
obj = 0;
#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
if (PyInstance_Check(pyobj)) {
obj = _PyInstance_Lookup(pyobj, SWIG_This());
} else {
PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
if (dictptr != NULL) {
PyObject *dict = *dictptr;
obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
} else {
#ifdef PyWeakref_CheckProxy
if (PyWeakref_CheckProxy(pyobj)) {
PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
}
#endif
obj = PyObject_GetAttr(pyobj,SWIG_This());
if (obj) {
Py_DECREF(obj);
} else {
if (PyErr_Occurred()) PyErr_Clear();
return 0;
}
}
}
#else
obj = PyObject_GetAttr(pyobj,SWIG_This());
if (obj) {
Py_DECREF(obj);
} else {
if (PyErr_Occurred()) PyErr_Clear();
return 0;
}
#endif
if (obj && !SwigPyObject_Check(obj)) {
/* a PyObject is called 'this', try to get the 'real this'
SwigPyObject from it */
return SWIG_Python_GetSwigThis(obj);
}
return (SwigPyObject *)obj;
#endif
}
/* Acquire a pointer value */
SWIGRUNTIME int
SWIG_Python_AcquirePtr(PyObject *obj, int own) {
if (own == SWIG_POINTER_OWN) {
SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
if (sobj) {
int oldown = sobj->own;
sobj->own = own;
return oldown;
}
}
return 0;
}
/* Convert a pointer value */
SWIGRUNTIME int
SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
int res;
SwigPyObject *sobj;
int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
if (!obj)
return SWIG_ERROR;
if (obj == Py_None && !implicit_conv) {
if (ptr)
*ptr = 0;
return SWIG_OK;
}
res = SWIG_ERROR;
sobj = SWIG_Python_GetSwigThis(obj);
if (own)
*own = 0;
while (sobj) {
void *vptr = sobj->ptr;
if (ty) {
swig_type_info *to = sobj->ty;
if (to == ty) {
/* no type cast needed */
if (ptr) *ptr = vptr;
break;
} else {
swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
if (!tc) {
sobj = (SwigPyObject *)sobj->next;
} else {
if (ptr) {
int newmemory = 0;
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
if (newmemory == SWIG_CAST_NEW_MEMORY) {
assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
if (own)
*own = *own | SWIG_CAST_NEW_MEMORY;
}
}
break;
}
}
} else {
if (ptr) *ptr = vptr;
break;
}
}
if (sobj) {
if (own)
*own = *own | sobj->own;
if (flags & SWIG_POINTER_DISOWN) {
sobj->own = 0;
}
res = SWIG_OK;
} else {
if (implicit_conv) {
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
if (data && !data->implicitconv) {
PyObject *klass = data->klass;
if (klass) {
PyObject *impconv;
data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
impconv = SWIG_Python_CallFunctor(klass, obj);
data->implicitconv = 0;
if (PyErr_Occurred()) {
PyErr_Clear();
impconv = 0;
}
if (impconv) {
SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
if (iobj) {
void *vptr;
res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
if (SWIG_IsOK(res)) {
if (ptr) {
*ptr = vptr;
/* transfer the ownership to 'ptr' */
iobj->own = 0;
res = SWIG_AddCast(res);
res = SWIG_AddNewMask(res);
} else {
res = SWIG_AddCast(res);
}
}
}
Py_DECREF(impconv);
}
}
}
}
if (!SWIG_IsOK(res) && obj == Py_None) {
if (ptr)
*ptr = 0;
if (PyErr_Occurred())
PyErr_Clear();
res = SWIG_OK;
}
}
return res;
}
/* Convert a function ptr value */
SWIGRUNTIME int
SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
if (!PyCFunction_Check(obj)) {
return SWIG_ConvertPtr(obj, ptr, ty, 0);
} else {
void *vptr = 0;
/* here we get the method pointer for callbacks */
const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
if (desc)
desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
if (!desc)
return SWIG_ERROR;
if (ty) {
swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
if (tc) {
int newmemory = 0;
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
assert(!newmemory); /* newmemory handling not yet implemented */
} else {
return SWIG_ERROR;
}
} else {
*ptr = vptr;
}
return SWIG_OK;
}
}
/* Convert a packed value value */
SWIGRUNTIME int
SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
if (!to) return SWIG_ERROR;
if (ty) {
if (to != ty) {
/* check type cast? */
swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
if (!tc) return SWIG_ERROR;
}
}
return SWIG_OK;
}
/* -----------------------------------------------------------------------------
* Create a new pointer object
* ----------------------------------------------------------------------------- */
/*
Create a new instance object, without calling __init__, and set the
'this' attribute.
*/
SWIGRUNTIME PyObject*
SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
{
#if (PY_VERSION_HEX >= 0x02020000)
PyObject *inst = 0;
PyObject *newraw = data->newraw;
if (newraw) {
inst = PyObject_Call(newraw, data->newargs, NULL);
if (inst) {
#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
PyObject **dictptr = _PyObject_GetDictPtr(inst);
if (dictptr != NULL) {
PyObject *dict = *dictptr;
if (dict == NULL) {
dict = PyDict_New();
*dictptr = dict;
PyDict_SetItem(dict, SWIG_This(), swig_this);
}
}
#else
PyObject *key = SWIG_This();
PyObject_SetAttr(inst, key, swig_this);
#endif
}
} else {
#if PY_VERSION_HEX >= 0x03000000
inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
if (inst) {
PyObject_SetAttr(inst, SWIG_This(), swig_this);
Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
}
#else
PyObject *dict = PyDict_New();
if (dict) {
PyDict_SetItem(dict, SWIG_This(), swig_this);
inst = PyInstance_NewRaw(data->newargs, dict);
Py_DECREF(dict);
}
#endif
}
return inst;
#else
#if (PY_VERSION_HEX >= 0x02010000)
PyObject *inst = 0;
PyObject *dict = PyDict_New();
if (dict) {
PyDict_SetItem(dict, SWIG_This(), swig_this);
inst = PyInstance_NewRaw(data->newargs, dict);
Py_DECREF(dict);
}
return (PyObject *) inst;
#else
PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
if (inst == NULL) {
return NULL;
}
inst->in_class = (PyClassObject *)data->newargs;
Py_INCREF(inst->in_class);
inst->in_dict = PyDict_New();
if (inst->in_dict == NULL) {
Py_DECREF(inst);
return NULL;
}
#ifdef Py_TPFLAGS_HAVE_WEAKREFS
inst->in_weakreflist = NULL;
#endif
#ifdef Py_TPFLAGS_GC
PyObject_GC_Init(inst);
#endif
PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
return (PyObject *) inst;
#endif
#endif
}
SWIGRUNTIME void
SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
{
PyObject *dict;
#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
PyObject **dictptr = _PyObject_GetDictPtr(inst);
if (dictptr != NULL) {
dict = *dictptr;
if (dict == NULL) {
dict = PyDict_New();
*dictptr = dict;
}
PyDict_SetItem(dict, SWIG_This(), swig_this);
return;
}
#endif
dict = PyObject_GetAttrString(inst, (char*)"__dict__");
PyDict_SetItem(dict, SWIG_This(), swig_this);
Py_DECREF(dict);
}
SWIGINTERN PyObject *
SWIG_Python_InitShadowInstance(PyObject *args) {
PyObject *obj[2];
if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
return NULL;
} else {
SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
if (sthis) {
SwigPyObject_append((PyObject*) sthis, obj[1]);
} else {
SWIG_Python_SetSwigThis(obj[0], obj[1]);
}
return SWIG_Py_Void();
}
}
/* Create a new pointer object */
SWIGRUNTIME PyObject *
SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
SwigPyClientData *clientdata;
PyObject * robj;
int own;
if (!ptr)
return SWIG_Py_Void();
clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
if (clientdata && clientdata->pytype) {
SwigPyObject *newobj;
if (flags & SWIG_BUILTIN_TP_INIT) {
newobj = (SwigPyObject*) self;
if (newobj->ptr) {
PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
while (newobj->next)
newobj = (SwigPyObject *) newobj->next;
newobj->next = next_self;
newobj = (SwigPyObject *)next_self;
#ifdef SWIGPYTHON_BUILTIN
newobj->dict = 0;
#endif
}
} else {
newobj = PyObject_New(SwigPyObject, clientdata->pytype);
#ifdef SWIGPYTHON_BUILTIN
newobj->dict = 0;
#endif
}
if (newobj) {
newobj->ptr = ptr;
newobj->ty = type;
newobj->own = own;
newobj->next = 0;
return (PyObject*) newobj;
}
return SWIG_Py_Void();
}
assert(!(flags & SWIG_BUILTIN_TP_INIT));
robj = SwigPyObject_New(ptr, type, own);
if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
Py_DECREF(robj);
robj = inst;
}
return robj;
}
/* Create a new packed object */
SWIGRUNTIMEINLINE PyObject *
SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
}
/* -----------------------------------------------------------------------------*
* Get type list
* -----------------------------------------------------------------------------*/
#ifdef SWIG_LINK_RUNTIME
void *SWIG_ReturnGlobalTypeList(void *);
#endif
SWIGRUNTIME swig_module_info *
SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
static void *type_pointer = (void *)0;
/* first check if module already created */
if (!type_pointer) {
#ifdef SWIG_LINK_RUNTIME
type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
#else
# ifdef SWIGPY_USE_CAPSULE
type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
# else
type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
(char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
# endif
if (PyErr_Occurred()) {
PyErr_Clear();
type_pointer = (void *)0;
}
#endif
}
return (swig_module_info *) type_pointer;
}
#if PY_MAJOR_VERSION < 2
/* PyModule_AddObject function was introduced in Python 2.0. The following function
is copied out of Python/modsupport.c in python version 2.3.4 */
SWIGINTERN int
PyModule_AddObject(PyObject *m, char *name, PyObject *o)
{
PyObject *dict;
if (!PyModule_Check(m)) {
PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg");
return SWIG_ERROR;
}
if (!o) {
PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value");
return SWIG_ERROR;
}
dict = PyModule_GetDict(m);
if (dict == NULL) {
/* Internal error -- modules must have a dict! */
PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
PyModule_GetName(m));
return SWIG_ERROR;
}
if (PyDict_SetItemString(dict, name, o))
return SWIG_ERROR;
Py_DECREF(o);
return SWIG_OK;
}
#endif
SWIGRUNTIME void
#ifdef SWIGPY_USE_CAPSULE
SWIG_Python_DestroyModule(PyObject *obj)
#else
SWIG_Python_DestroyModule(void *vptr)
#endif
{
#ifdef SWIGPY_USE_CAPSULE
swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
#else
swig_module_info *swig_module = (swig_module_info *) vptr;
#endif
swig_type_info **types = swig_module->types;
size_t i;
for (i =0; i < swig_module->size; ++i) {
swig_type_info *ty = types[i];
if (ty->owndata) {
SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
if (data) SwigPyClientData_Del(data);
}
}
Py_DECREF(SWIG_This());
swig_this = NULL;
}
SWIGRUNTIME void
SWIG_Python_SetModule(swig_module_info *swig_module) {
#if PY_VERSION_HEX >= 0x03000000
/* Add a dummy module object into sys.modules */
PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
#else
static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
#endif
#ifdef SWIGPY_USE_CAPSULE
PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
if (pointer && module) {
PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
} else {
Py_XDECREF(pointer);
}
#else
PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
if (pointer && module) {
PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
} else {
Py_XDECREF(pointer);
}
#endif
}
/* The python cached type query */
SWIGRUNTIME PyObject *
SWIG_Python_TypeCache(void) {
static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
return cache;
}
SWIGRUNTIME swig_type_info *
SWIG_Python_TypeQuery(const char *type)
{
PyObject *cache = SWIG_Python_TypeCache();
PyObject *key = SWIG_Python_str_FromChar(type);
PyObject *obj = PyDict_GetItem(cache, key);
swig_type_info *descriptor;
if (obj) {
#ifdef SWIGPY_USE_CAPSULE
descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
#else
descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
#endif
} else {
swig_module_info *swig_module = SWIG_GetModule(0);
descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
if (descriptor) {
#ifdef SWIGPY_USE_CAPSULE
obj = PyCapsule_New((void*) descriptor, NULL, NULL);
#else
obj = PyCObject_FromVoidPtr(descriptor, NULL);
#endif
PyDict_SetItem(cache, key, obj);
Py_DECREF(obj);
}
}
Py_DECREF(key);
return descriptor;
}
/*
For backward compatibility only
*/
#define SWIG_POINTER_EXCEPTION 0
#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
SWIGRUNTIME int
SWIG_Python_AddErrMesg(const char* mesg, int infront)
{
if (PyErr_Occurred()) {
PyObject *type = 0;
PyObject *value = 0;
PyObject *traceback = 0;
PyErr_Fetch(&type, &value, &traceback);
if (value) {
char *tmp;
PyObject *old_str = PyObject_Str(value);
Py_XINCREF(type);
PyErr_Clear();
if (infront) {
PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
} else {
PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
}
SWIG_Python_str_DelForPy3(tmp);
Py_DECREF(old_str);
}
return 1;
} else {
return 0;
}
}
SWIGRUNTIME int
SWIG_Python_ArgFail(int argnum)
{
if (PyErr_Occurred()) {
/* add information about failing argument */
char mesg[256];
PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
return SWIG_Python_AddErrMesg(mesg, 1);
} else {
return 0;
}
}
SWIGRUNTIMEINLINE const char *
SwigPyObject_GetDesc(PyObject *self)
{
SwigPyObject *v = (SwigPyObject *)self;
swig_type_info *ty = v ? v->ty : 0;
return ty ? ty->str : "";
}
SWIGRUNTIME void
SWIG_Python_TypeError(const char *type, PyObject *obj)
{
if (type) {
#if defined(SWIG_COBJECT_TYPES)
if (obj && SwigPyObject_Check(obj)) {
const char *otype = (const char *) SwigPyObject_GetDesc(obj);
if (otype) {
PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
type, otype);
return;
}
} else
#endif
{
const char *otype = (obj ? obj->ob_type->tp_name : 0);
if (otype) {
PyObject *str = PyObject_Str(obj);
const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
if (cstr) {
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
type, otype, cstr);
SWIG_Python_str_DelForPy3(cstr);
} else {
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
type, otype);
}
Py_XDECREF(str);
return;
}
}
PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
} else {
PyErr_Format(PyExc_TypeError, "unexpected type is received");
}
}
/* Convert a pointer value, signal an exception on a type mismatch */
SWIGRUNTIME void *
SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
void *result;
if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
PyErr_Clear();
#if SWIG_POINTER_EXCEPTION
if (flags) {
SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
SWIG_Python_ArgFail(argnum);
}
#endif
}
return result;
}
#ifdef SWIGPYTHON_BUILTIN
SWIGRUNTIME int
SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
PyTypeObject *tp = obj->ob_type;
PyObject *descr;
PyObject *encoded_name;
descrsetfunc f;
int res = -1;
# ifdef Py_USING_UNICODE
if (PyString_Check(name)) {
name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
if (!name)
return -1;
} else if (!PyUnicode_Check(name))
# else
if (!PyString_Check(name))
# endif
{
PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
return -1;
} else {
Py_INCREF(name);
}
if (!tp->tp_dict) {
if (PyType_Ready(tp) < 0)
goto done;
}
descr = _PyType_Lookup(tp, name);
f = NULL;
if (descr != NULL)
f = descr->ob_type->tp_descr_set;
if (!f) {
if (PyString_Check(name)) {
encoded_name = name;
Py_INCREF(name);
} else {
encoded_name = PyUnicode_AsUTF8String(name);
}
PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
Py_DECREF(encoded_name);
} else {
res = f(descr, obj, value);
}
done:
Py_DECREF(name);
return res;
}
#endif
#ifdef __cplusplus
}
#endif
#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
#define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
/* -------- TYPES TABLE (BEGIN) -------- */
#define SWIGTYPE_p_AutoPyObjPtr swig_types[0]
#define SWIGTYPE_p_char swig_types[1]
#define SWIGTYPE_p_std__pairT_long_AutoPyObjPtr_t swig_types[2]
#define SWIGTYPE_p_std__pairT_long_bool_t swig_types[3]
#define SWIGTYPE_p_std__pairT_long_double_t swig_types[4]
#define SWIGTYPE_p_std__pairT_long_int_t swig_types[5]
#define SWIGTYPE_p_step_vectorT_AutoPyObjPtr_t__const_iterator swig_types[6]
#define SWIGTYPE_p_step_vectorT_bool_t__const_iterator swig_types[7]
#define SWIGTYPE_p_step_vectorT_double_t__const_iterator swig_types[8]
#define SWIGTYPE_p_step_vectorT_int_t__const_iterator swig_types[9]
#define SWIGTYPE_p_step_vector_for_pythonT_AutoPyObjPtr_t swig_types[10]
#define SWIGTYPE_p_step_vector_for_pythonT_bool_t swig_types[11]
#define SWIGTYPE_p_step_vector_for_pythonT_double_t swig_types[12]
#define SWIGTYPE_p_step_vector_for_pythonT_int_t swig_types[13]
#define SWIGTYPE_p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t swig_types[14]
#define SWIGTYPE_p_step_vector_pystyle_iteratorT_bool_t swig_types[15]
#define SWIGTYPE_p_step_vector_pystyle_iteratorT_double_t swig_types[16]
#define SWIGTYPE_p_step_vector_pystyle_iteratorT_int_t swig_types[17]
static swig_type_info *swig_types[19];
static swig_module_info swig_module = {swig_types, 18, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
/* -------- TYPES TABLE (END) -------- */
#if (PY_VERSION_HEX <= 0x02000000)
# if !defined(SWIG_PYTHON_CLASSIC)
# error "This python version requires swig to be run with the '-classic' option"
# endif
#endif
/*-----------------------------------------------
@(target):= _StepVector.so
------------------------------------------------*/
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_init PyInit__StepVector
#else
# define SWIG_init init_StepVector
#endif
#define SWIG_name "_StepVector"
#define SWIGVERSION 0x030011
#define SWIG_VERSION SWIGVERSION
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
#include
namespace swig {
class SwigPtr_PyObject {
protected:
PyObject *_obj;
public:
SwigPtr_PyObject() :_obj(0)
{
}
SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
{
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
Py_XINCREF(_obj);
SWIG_PYTHON_THREAD_END_BLOCK;
}
SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
{
if (initial_ref) {
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
Py_XINCREF(_obj);
SWIG_PYTHON_THREAD_END_BLOCK;
}
}
SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item)
{
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
Py_XINCREF(item._obj);
Py_XDECREF(_obj);
_obj = item._obj;
SWIG_PYTHON_THREAD_END_BLOCK;
return *this;
}
~SwigPtr_PyObject()
{
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
Py_XDECREF(_obj);
SWIG_PYTHON_THREAD_END_BLOCK;
}
operator PyObject *() const
{
return _obj;
}
PyObject *operator->() const
{
return _obj;
}
};
}
namespace swig {
struct SwigVar_PyObject : SwigPtr_PyObject {
SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
SwigVar_PyObject & operator = (PyObject* obj)
{
Py_XDECREF(_obj);
_obj = obj;
return *this;
}
};
}
#define AUTOPYOBJPTR_EXTRAOPS
struct AutoPyObjPtr {
PyObject * obj;
AutoPyObjPtr( PyObject * o = Py_None );
AutoPyObjPtr( const AutoPyObjPtr & op );
AutoPyObjPtr & operator= ( const AutoPyObjPtr & po );
bool operator== ( const AutoPyObjPtr & po ) const;
~AutoPyObjPtr( );
#ifdef AUTOPYOBJPTR_EXTRAOPS
AutoPyObjPtr & operator+=( const AutoPyObjPtr & po );
AutoPyObjPtr & operator+( const AutoPyObjPtr & po );
#endif
};
AutoPyObjPtr::AutoPyObjPtr( PyObject * o )
: obj( o )
{
Py_XINCREF( obj );
}
AutoPyObjPtr::AutoPyObjPtr( const AutoPyObjPtr & op )
: obj( op.obj )
{
Py_XINCREF( obj );
}
AutoPyObjPtr & AutoPyObjPtr::operator= ( const AutoPyObjPtr & po )
{
Py_XDECREF( obj );
obj = po.obj;
Py_XINCREF( obj );
return *this;
}
bool AutoPyObjPtr::operator== ( const AutoPyObjPtr & po ) const
{
int res = PyObject_RichCompareBool( obj, po.obj, Py_EQ );
assert( res == 0 || res == 1 );
return res;
}
AutoPyObjPtr::~AutoPyObjPtr( )
{
Py_XDECREF( obj );
}
#ifdef AUTOPYOBJPTR_EXTRAOPS
class type_error_non_arith {};
AutoPyObjPtr & AutoPyObjPtr::operator+= ( const AutoPyObjPtr & po )
{ throw type_error_non_arith(); }
AutoPyObjPtr & AutoPyObjPtr::operator+ ( const AutoPyObjPtr & po )
{ throw type_error_non_arith(); }
#endif
#include "step_vector.h"
class pystyle_stopiteration {};
template< class T >
class step_vector_pystyle_iterator
{
typename step_vector::const_iterator current;
typename step_vector::const_iterator last;
public:
step_vector_pystyle_iterator( typename step_vector::const_iterator first,
typename step_vector::const_iterator last_ );
std::pair< long int, T > next( );
step_vector_pystyle_iterator * __iter__( );
};
template< class T >
class step_vector_for_python : public step_vector
{
public:
step_vector_pystyle_iterator get_all_values_pystyle( ) const;
step_vector_pystyle_iterator get_values_pystyle( long int from ) const;
int num_values( ) const;
};
template< class T >
step_vector_pystyle_iterator::step_vector_pystyle_iterator(
typename step_vector::const_iterator first,
typename step_vector::const_iterator last_ )
: current( first ), last( last_ )
{
}
template< class T >
step_vector_pystyle_iterator step_vector_for_python::get_all_values_pystyle( ) const
{
return step_vector_pystyle_iterator( this->begin(), this->end() );
}
template< class T >
step_vector_pystyle_iterator step_vector_for_python::get_values_pystyle( long int from ) const
{
return step_vector_pystyle_iterator( this->get_values( from ), this->end() );
}
template< class T >
int step_vector_for_python::num_values( ) const
{
return this->m.size();
}
template< class T >
std::pair< long int, T > step_vector_pystyle_iterator::next( )
{
if( current == last )
throw pystyle_stopiteration ();
else {
return *current++;
}
}
template< class T >
step_vector_pystyle_iterator * step_vector_pystyle_iterator::__iter__( )
{
return this;
}
SWIGINTERN int
SWIG_AsVal_double (PyObject *obj, double *val)
{
int res = SWIG_TypeError;
if (PyFloat_Check(obj)) {
if (val) *val = PyFloat_AsDouble(obj);
return SWIG_OK;
#if PY_VERSION_HEX < 0x03000000
} else if (PyInt_Check(obj)) {
if (val) *val = (double) PyInt_AsLong(obj);
return SWIG_OK;
#endif
} else if (PyLong_Check(obj)) {
double v = PyLong_AsDouble(obj);
if (!PyErr_Occurred()) {
if (val) *val = v;
return SWIG_OK;
} else {
PyErr_Clear();
}
}
#ifdef SWIG_PYTHON_CAST_MODE
{
int dispatch = 0;
double d = PyFloat_AsDouble(obj);
if (!PyErr_Occurred()) {
if (val) *val = d;
return SWIG_AddCast(SWIG_OK);
} else {
PyErr_Clear();
}
if (!dispatch) {
long v = PyLong_AsLong(obj);
if (!PyErr_Occurred()) {
if (val) *val = v;
return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
} else {
PyErr_Clear();
}
}
}
#endif
return res;
}
#include
#include
SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double *d, double min, double max) {
double x = *d;
if ((min <= x && x <= max)) {
double fx = floor(x);
double cx = ceil(x);
double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
if ((errno == EDOM) || (errno == ERANGE)) {
errno = 0;
} else {
double summ, reps, diff;
if (rd < x) {
diff = x - rd;
} else if (rd > x) {
diff = rd - x;
} else {
return 1;
}
summ = rd + x;
reps = diff/summ;
if (reps < 8*DBL_EPSILON) {
*d = rd;
return 1;
}
}
}
return 0;
}
SWIGINTERN int
SWIG_AsVal_long (PyObject *obj, long* val)
{
#if PY_VERSION_HEX < 0x03000000
if (PyInt_Check(obj)) {
if (val) *val = PyInt_AsLong(obj);
return SWIG_OK;
} else
#endif
if (PyLong_Check(obj)) {
long v = PyLong_AsLong(obj);
if (!PyErr_Occurred()) {
if (val) *val = v;
return SWIG_OK;
} else {
PyErr_Clear();
return SWIG_OverflowError;
}
}
#ifdef SWIG_PYTHON_CAST_MODE
{
int dispatch = 0;
long v = PyInt_AsLong(obj);
if (!PyErr_Occurred()) {
if (val) *val = v;
return SWIG_AddCast(SWIG_OK);
} else {
PyErr_Clear();
}
if (!dispatch) {
double d;
int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
if (val) *val = (long)(d);
return res;
}
}
}
#endif
return SWIG_TypeError;
}
#define SWIG_From_long PyInt_FromLong
#define SWIG_From_double PyFloat_FromDouble
SWIGINTERNINLINE PyObject*
SWIG_From_int (int value)
{
return PyInt_FromLong((long) value);
}
#include
#if !defined(SWIG_NO_LLONG_MAX)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
# define LLONG_MAX __LONG_LONG_MAX__
# define LLONG_MIN (-LLONG_MAX - 1LL)
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
# endif
#endif
SWIGINTERN int
SWIG_AsVal_int (PyObject * obj, int *val)
{
long v;
int res = SWIG_AsVal_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v < INT_MIN || v > INT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = static_cast< int >(v);
}
}
return res;
}
SWIGINTERN int
SWIG_AsVal_bool (PyObject *obj, bool *val)
{
int r;
if (!PyBool_Check(obj))
return SWIG_ERROR;
r = PyObject_IsTrue(obj);
if (r == -1)
return SWIG_ERROR;
if (val) *val = r ? true : false;
return SWIG_OK;
}
SWIGINTERNINLINE PyObject*
SWIG_From_bool (bool value)
{
return PyBool_FromLong(value ? 1 : 0);
}
#ifdef __cplusplus
extern "C" {
#endif
SWIGINTERN PyObject *_wrap__Pair_int_float_first_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,double > *arg1 = (std::pair< long,double > *) 0 ;
long arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:_Pair_int_float_first_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_float_first_set" "', argument " "1"" of type '" "std::pair< long,double > *""'");
}
arg1 = reinterpret_cast< std::pair< long,double > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_Pair_int_float_first_set" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
if (arg1) (arg1)->first = arg2;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_float_first_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,double > *arg1 = (std::pair< long,double > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
long result;
if (!PyArg_ParseTuple(args,(char *)"O:_Pair_int_float_first_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_float_first_get" "', argument " "1"" of type '" "std::pair< long,double > *""'");
}
arg1 = reinterpret_cast< std::pair< long,double > * >(argp1);
result = (long) ((arg1)->first);
resultobj = SWIG_From_long(static_cast< long >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_float_second_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,double > *arg1 = (std::pair< long,double > *) 0 ;
double arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
double val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:_Pair_int_float_second_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_float_second_set" "', argument " "1"" of type '" "std::pair< long,double > *""'");
}
arg1 = reinterpret_cast< std::pair< long,double > * >(argp1);
ecode2 = SWIG_AsVal_double(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_Pair_int_float_second_set" "', argument " "2"" of type '" "double""'");
}
arg2 = static_cast< double >(val2);
if (arg1) (arg1)->second = arg2;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_float_second_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,double > *arg1 = (std::pair< long,double > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
double result;
if (!PyArg_ParseTuple(args,(char *)"O:_Pair_int_float_second_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_float_second_get" "', argument " "1"" of type '" "std::pair< long,double > *""'");
}
arg1 = reinterpret_cast< std::pair< long,double > * >(argp1);
result = (double) ((arg1)->second);
resultobj = SWIG_From_double(static_cast< double >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new__Pair_int_float(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
long arg1 ;
double arg2 ;
long val1 ;
int ecode1 = 0 ;
double val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
std::pair< long,double > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:new__Pair_int_float",&obj0,&obj1)) SWIG_fail;
ecode1 = SWIG_AsVal_long(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new__Pair_int_float" "', argument " "1"" of type '" "long""'");
}
arg1 = static_cast< long >(val1);
ecode2 = SWIG_AsVal_double(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new__Pair_int_float" "', argument " "2"" of type '" "double""'");
}
arg2 = static_cast< double >(val2);
result = (std::pair< long,double > *)new std::pair< long,double >(arg1,arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__pairT_long_double_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__Pair_int_float(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,double > *arg1 = (std::pair< long,double > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__Pair_int_float",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_double_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__Pair_int_float" "', argument " "1"" of type '" "std::pair< long,double > *""'");
}
arg1 = reinterpret_cast< std::pair< long,double > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_Pair_int_float_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_std__pairT_long_double_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN PyObject *_wrap_new__StepVector_Iterator_float(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector< double >::const_iterator arg1 ;
step_vector< double >::const_iterator arg2 ;
void *argp1 ;
int res1 = 0 ;
void *argp2 ;
int res2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
step_vector_pystyle_iterator< double > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:new__StepVector_Iterator_float",&obj0,&obj1)) SWIG_fail;
{
res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_step_vectorT_double_t__const_iterator, 0 | 0);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new__StepVector_Iterator_float" "', argument " "1"" of type '" "step_vector< double >::const_iterator""'");
}
if (!argp1) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new__StepVector_Iterator_float" "', argument " "1"" of type '" "step_vector< double >::const_iterator""'");
} else {
step_vector< double >::const_iterator * temp = reinterpret_cast< step_vector< double >::const_iterator * >(argp1);
arg1 = *temp;
if (SWIG_IsNewObj(res1)) delete temp;
}
}
{
res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_step_vectorT_double_t__const_iterator, 0 | 0);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new__StepVector_Iterator_float" "', argument " "2"" of type '" "step_vector< double >::const_iterator""'");
}
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new__StepVector_Iterator_float" "', argument " "2"" of type '" "step_vector< double >::const_iterator""'");
} else {
step_vector< double >::const_iterator * temp = reinterpret_cast< step_vector< double >::const_iterator * >(argp2);
arg2 = *temp;
if (SWIG_IsNewObj(res2)) delete temp;
}
}
result = (step_vector_pystyle_iterator< double > *)new step_vector_pystyle_iterator< double >(arg1,arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_pystyle_iteratorT_double_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_Iterator_float_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< double > *arg1 = (step_vector_pystyle_iterator< double > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
SwigValueWrapper< std::pair< long,double > > result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_Iterator_float_next",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_Iterator_float_next" "', argument " "1"" of type '" "step_vector_pystyle_iterator< double > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< double > * >(argp1);
{
try {
result = (arg1)->next();
} catch (pystyle_stopiteration &e) {
PyErr_SetString( PyExc_StopIteration, "" );
return NULL;
}
}
resultobj = SWIG_NewPointerObj((new std::pair< long,double >(static_cast< const std::pair< long,double >& >(result))), SWIGTYPE_p_std__pairT_long_double_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_Iterator_float___iter__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< double > *arg1 = (step_vector_pystyle_iterator< double > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
step_vector_pystyle_iterator< double > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_Iterator_float___iter__",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_Iterator_float___iter__" "', argument " "1"" of type '" "step_vector_pystyle_iterator< double > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< double > * >(argp1);
result = (step_vector_pystyle_iterator< double > *)(arg1)->__iter__();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_pystyle_iteratorT_double_t, 0 | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__StepVector_Iterator_float(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< double > *arg1 = (step_vector_pystyle_iterator< double > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__StepVector_Iterator_float",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_double_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__StepVector_Iterator_float" "', argument " "1"" of type '" "step_vector_pystyle_iterator< double > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< double > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_StepVector_Iterator_float_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_step_vector_pystyle_iteratorT_double_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN int Swig_var__StepVector_float_min_index_set(PyObject *) {
SWIG_Error(SWIG_AttributeError,"Variable _StepVector_float_min_index is read-only.");
return 1;
}
SWIGINTERN PyObject *Swig_var__StepVector_float_min_index_get(void) {
PyObject *pyobj = 0;
pyobj = SWIG_From_long(static_cast< long >(step_vector_for_python< double >::min_index));
return pyobj;
}
SWIGINTERN int Swig_var__StepVector_float_max_index_set(PyObject *) {
SWIG_Error(SWIG_AttributeError,"Variable _StepVector_float_max_index is read-only.");
return 1;
}
SWIGINTERN PyObject *Swig_var__StepVector_float_max_index_get(void) {
PyObject *pyobj = 0;
pyobj = SWIG_From_long(static_cast< long >(step_vector_for_python< double >::max_index));
return pyobj;
}
SWIGINTERN PyObject *_wrap_new__StepVector_float(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< double > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)":new__StepVector_float")) SWIG_fail;
result = (step_vector_for_python< double > *)new step_vector_for_python< double >();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_for_pythonT_double_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_float_set_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< double > *arg1 = (step_vector_for_python< double > *) 0 ;
long arg2 ;
long arg3 ;
double arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
long val3 ;
int ecode3 = 0 ;
double val4 ;
int ecode4 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOO:_StepVector_float_set_value",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_float_set_value" "', argument " "1"" of type '" "step_vector_for_python< double > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< double > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_float_set_value" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
ecode3 = SWIG_AsVal_long(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "_StepVector_float_set_value" "', argument " "3"" of type '" "long""'");
}
arg3 = static_cast< long >(val3);
ecode4 = SWIG_AsVal_double(obj3, &val4);
if (!SWIG_IsOK(ecode4)) {
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_StepVector_float_set_value" "', argument " "4"" of type '" "double""'");
}
arg4 = static_cast< double >(val4);
{
try {
(arg1)->set_value(arg2,arg3,arg4);
} catch (std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, e.what() );
} catch (type_error_non_arith &e) {
SWIG_exception(SWIG_TypeError, "Illegal arithmetic operation" );
}
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_float_add_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< double > *arg1 = (step_vector_for_python< double > *) 0 ;
long arg2 ;
long arg3 ;
double arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
long val3 ;
int ecode3 = 0 ;
double val4 ;
int ecode4 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOO:_StepVector_float_add_value",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_float_add_value" "', argument " "1"" of type '" "step_vector_for_python< double > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< double > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_float_add_value" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
ecode3 = SWIG_AsVal_long(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "_StepVector_float_add_value" "', argument " "3"" of type '" "long""'");
}
arg3 = static_cast< long >(val3);
ecode4 = SWIG_AsVal_double(obj3, &val4);
if (!SWIG_IsOK(ecode4)) {
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_StepVector_float_add_value" "', argument " "4"" of type '" "double""'");
}
arg4 = static_cast< double >(val4);
{
try {
(arg1)->add_value(arg2,arg3,arg4);
} catch (std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, e.what() );
} catch (type_error_non_arith &e) {
SWIG_exception(SWIG_TypeError, "Illegal arithmetic operation" );
}
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_float_get_all_values_pystyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< double > *arg1 = (step_vector_for_python< double > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
SwigValueWrapper< step_vector_pystyle_iterator< double > > result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_float_get_all_values_pystyle",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_float_get_all_values_pystyle" "', argument " "1"" of type '" "step_vector_for_python< double > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< double > * >(argp1);
result = ((step_vector_for_python< double > const *)arg1)->get_all_values_pystyle();
resultobj = SWIG_NewPointerObj((new step_vector_pystyle_iterator< double >(static_cast< const step_vector_pystyle_iterator< double >& >(result))), SWIGTYPE_p_step_vector_pystyle_iteratorT_double_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_float_get_values_pystyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< double > *arg1 = (step_vector_for_python< double > *) 0 ;
long arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
SwigValueWrapper< step_vector_pystyle_iterator< double > > result;
if (!PyArg_ParseTuple(args,(char *)"OO:_StepVector_float_get_values_pystyle",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_float_get_values_pystyle" "', argument " "1"" of type '" "step_vector_for_python< double > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< double > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_float_get_values_pystyle" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
result = ((step_vector_for_python< double > const *)arg1)->get_values_pystyle(arg2);
resultobj = SWIG_NewPointerObj((new step_vector_pystyle_iterator< double >(static_cast< const step_vector_pystyle_iterator< double >& >(result))), SWIGTYPE_p_step_vector_pystyle_iteratorT_double_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_float_num_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< double > *arg1 = (step_vector_for_python< double > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
int result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_float_num_values",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_double_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_float_num_values" "', argument " "1"" of type '" "step_vector_for_python< double > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< double > * >(argp1);
result = (int)((step_vector_for_python< double > const *)arg1)->num_values();
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__StepVector_float(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< double > *arg1 = (step_vector_for_python< double > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__StepVector_float",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_double_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__StepVector_float" "', argument " "1"" of type '" "step_vector_for_python< double > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< double > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_StepVector_float_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_step_vector_for_pythonT_double_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN PyObject *_wrap__Pair_int_int_first_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,int > *arg1 = (std::pair< long,int > *) 0 ;
long arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:_Pair_int_int_first_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_int_first_set" "', argument " "1"" of type '" "std::pair< long,int > *""'");
}
arg1 = reinterpret_cast< std::pair< long,int > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_Pair_int_int_first_set" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
if (arg1) (arg1)->first = arg2;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_int_first_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,int > *arg1 = (std::pair< long,int > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
long result;
if (!PyArg_ParseTuple(args,(char *)"O:_Pair_int_int_first_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_int_first_get" "', argument " "1"" of type '" "std::pair< long,int > *""'");
}
arg1 = reinterpret_cast< std::pair< long,int > * >(argp1);
result = (long) ((arg1)->first);
resultobj = SWIG_From_long(static_cast< long >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_int_second_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,int > *arg1 = (std::pair< long,int > *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:_Pair_int_int_second_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_int_second_set" "', argument " "1"" of type '" "std::pair< long,int > *""'");
}
arg1 = reinterpret_cast< std::pair< long,int > * >(argp1);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_Pair_int_int_second_set" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
if (arg1) (arg1)->second = arg2;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_int_second_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,int > *arg1 = (std::pair< long,int > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
int result;
if (!PyArg_ParseTuple(args,(char *)"O:_Pair_int_int_second_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_int_second_get" "', argument " "1"" of type '" "std::pair< long,int > *""'");
}
arg1 = reinterpret_cast< std::pair< long,int > * >(argp1);
result = (int) ((arg1)->second);
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new__Pair_int_int(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
long arg1 ;
int arg2 ;
long val1 ;
int ecode1 = 0 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
std::pair< long,int > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:new__Pair_int_int",&obj0,&obj1)) SWIG_fail;
ecode1 = SWIG_AsVal_long(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new__Pair_int_int" "', argument " "1"" of type '" "long""'");
}
arg1 = static_cast< long >(val1);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new__Pair_int_int" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
result = (std::pair< long,int > *)new std::pair< long,int >(arg1,arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__pairT_long_int_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__Pair_int_int(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,int > *arg1 = (std::pair< long,int > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__Pair_int_int",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_int_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__Pair_int_int" "', argument " "1"" of type '" "std::pair< long,int > *""'");
}
arg1 = reinterpret_cast< std::pair< long,int > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_Pair_int_int_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_std__pairT_long_int_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN PyObject *_wrap_new__StepVector_Iterator_int(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector< int >::const_iterator arg1 ;
step_vector< int >::const_iterator arg2 ;
void *argp1 ;
int res1 = 0 ;
void *argp2 ;
int res2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
step_vector_pystyle_iterator< int > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:new__StepVector_Iterator_int",&obj0,&obj1)) SWIG_fail;
{
res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_step_vectorT_int_t__const_iterator, 0 | 0);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new__StepVector_Iterator_int" "', argument " "1"" of type '" "step_vector< int >::const_iterator""'");
}
if (!argp1) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new__StepVector_Iterator_int" "', argument " "1"" of type '" "step_vector< int >::const_iterator""'");
} else {
step_vector< int >::const_iterator * temp = reinterpret_cast< step_vector< int >::const_iterator * >(argp1);
arg1 = *temp;
if (SWIG_IsNewObj(res1)) delete temp;
}
}
{
res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_step_vectorT_int_t__const_iterator, 0 | 0);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new__StepVector_Iterator_int" "', argument " "2"" of type '" "step_vector< int >::const_iterator""'");
}
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new__StepVector_Iterator_int" "', argument " "2"" of type '" "step_vector< int >::const_iterator""'");
} else {
step_vector< int >::const_iterator * temp = reinterpret_cast< step_vector< int >::const_iterator * >(argp2);
arg2 = *temp;
if (SWIG_IsNewObj(res2)) delete temp;
}
}
result = (step_vector_pystyle_iterator< int > *)new step_vector_pystyle_iterator< int >(arg1,arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_pystyle_iteratorT_int_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_Iterator_int_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< int > *arg1 = (step_vector_pystyle_iterator< int > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
SwigValueWrapper< std::pair< long,int > > result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_Iterator_int_next",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_Iterator_int_next" "', argument " "1"" of type '" "step_vector_pystyle_iterator< int > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< int > * >(argp1);
{
try {
result = (arg1)->next();
} catch (pystyle_stopiteration &e) {
PyErr_SetString( PyExc_StopIteration, "" );
return NULL;
}
}
resultobj = SWIG_NewPointerObj((new std::pair< long,int >(static_cast< const std::pair< long,int >& >(result))), SWIGTYPE_p_std__pairT_long_int_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_Iterator_int___iter__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< int > *arg1 = (step_vector_pystyle_iterator< int > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
step_vector_pystyle_iterator< int > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_Iterator_int___iter__",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_Iterator_int___iter__" "', argument " "1"" of type '" "step_vector_pystyle_iterator< int > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< int > * >(argp1);
result = (step_vector_pystyle_iterator< int > *)(arg1)->__iter__();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_pystyle_iteratorT_int_t, 0 | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__StepVector_Iterator_int(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< int > *arg1 = (step_vector_pystyle_iterator< int > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__StepVector_Iterator_int",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_int_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__StepVector_Iterator_int" "', argument " "1"" of type '" "step_vector_pystyle_iterator< int > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< int > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_StepVector_Iterator_int_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_step_vector_pystyle_iteratorT_int_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN int Swig_var__StepVector_int_min_index_set(PyObject *) {
SWIG_Error(SWIG_AttributeError,"Variable _StepVector_int_min_index is read-only.");
return 1;
}
SWIGINTERN PyObject *Swig_var__StepVector_int_min_index_get(void) {
PyObject *pyobj = 0;
pyobj = SWIG_From_long(static_cast< long >(step_vector_for_python< int >::min_index));
return pyobj;
}
SWIGINTERN int Swig_var__StepVector_int_max_index_set(PyObject *) {
SWIG_Error(SWIG_AttributeError,"Variable _StepVector_int_max_index is read-only.");
return 1;
}
SWIGINTERN PyObject *Swig_var__StepVector_int_max_index_get(void) {
PyObject *pyobj = 0;
pyobj = SWIG_From_long(static_cast< long >(step_vector_for_python< int >::max_index));
return pyobj;
}
SWIGINTERN PyObject *_wrap_new__StepVector_int(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< int > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)":new__StepVector_int")) SWIG_fail;
result = (step_vector_for_python< int > *)new step_vector_for_python< int >();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_for_pythonT_int_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_int_set_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< int > *arg1 = (step_vector_for_python< int > *) 0 ;
long arg2 ;
long arg3 ;
int arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
long val3 ;
int ecode3 = 0 ;
int val4 ;
int ecode4 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOO:_StepVector_int_set_value",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_int_set_value" "', argument " "1"" of type '" "step_vector_for_python< int > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< int > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_int_set_value" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
ecode3 = SWIG_AsVal_long(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "_StepVector_int_set_value" "', argument " "3"" of type '" "long""'");
}
arg3 = static_cast< long >(val3);
ecode4 = SWIG_AsVal_int(obj3, &val4);
if (!SWIG_IsOK(ecode4)) {
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_StepVector_int_set_value" "', argument " "4"" of type '" "int""'");
}
arg4 = static_cast< int >(val4);
{
try {
(arg1)->set_value(arg2,arg3,arg4);
} catch (std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, e.what() );
} catch (type_error_non_arith &e) {
SWIG_exception(SWIG_TypeError, "Illegal arithmetic operation" );
}
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_int_add_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< int > *arg1 = (step_vector_for_python< int > *) 0 ;
long arg2 ;
long arg3 ;
int arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
long val3 ;
int ecode3 = 0 ;
int val4 ;
int ecode4 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOO:_StepVector_int_add_value",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_int_add_value" "', argument " "1"" of type '" "step_vector_for_python< int > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< int > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_int_add_value" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
ecode3 = SWIG_AsVal_long(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "_StepVector_int_add_value" "', argument " "3"" of type '" "long""'");
}
arg3 = static_cast< long >(val3);
ecode4 = SWIG_AsVal_int(obj3, &val4);
if (!SWIG_IsOK(ecode4)) {
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_StepVector_int_add_value" "', argument " "4"" of type '" "int""'");
}
arg4 = static_cast< int >(val4);
{
try {
(arg1)->add_value(arg2,arg3,arg4);
} catch (std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, e.what() );
} catch (type_error_non_arith &e) {
SWIG_exception(SWIG_TypeError, "Illegal arithmetic operation" );
}
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_int_get_all_values_pystyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< int > *arg1 = (step_vector_for_python< int > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
SwigValueWrapper< step_vector_pystyle_iterator< int > > result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_int_get_all_values_pystyle",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_int_get_all_values_pystyle" "', argument " "1"" of type '" "step_vector_for_python< int > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< int > * >(argp1);
result = ((step_vector_for_python< int > const *)arg1)->get_all_values_pystyle();
resultobj = SWIG_NewPointerObj((new step_vector_pystyle_iterator< int >(static_cast< const step_vector_pystyle_iterator< int >& >(result))), SWIGTYPE_p_step_vector_pystyle_iteratorT_int_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_int_get_values_pystyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< int > *arg1 = (step_vector_for_python< int > *) 0 ;
long arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
SwigValueWrapper< step_vector_pystyle_iterator< int > > result;
if (!PyArg_ParseTuple(args,(char *)"OO:_StepVector_int_get_values_pystyle",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_int_get_values_pystyle" "', argument " "1"" of type '" "step_vector_for_python< int > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< int > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_int_get_values_pystyle" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
result = ((step_vector_for_python< int > const *)arg1)->get_values_pystyle(arg2);
resultobj = SWIG_NewPointerObj((new step_vector_pystyle_iterator< int >(static_cast< const step_vector_pystyle_iterator< int >& >(result))), SWIGTYPE_p_step_vector_pystyle_iteratorT_int_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_int_num_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< int > *arg1 = (step_vector_for_python< int > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
int result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_int_num_values",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_int_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_int_num_values" "', argument " "1"" of type '" "step_vector_for_python< int > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< int > * >(argp1);
result = (int)((step_vector_for_python< int > const *)arg1)->num_values();
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__StepVector_int(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< int > *arg1 = (step_vector_for_python< int > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__StepVector_int",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_int_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__StepVector_int" "', argument " "1"" of type '" "step_vector_for_python< int > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< int > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_StepVector_int_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_step_vector_for_pythonT_int_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN PyObject *_wrap__Pair_int_bool_first_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,bool > *arg1 = (std::pair< long,bool > *) 0 ;
long arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:_Pair_int_bool_first_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_bool_first_set" "', argument " "1"" of type '" "std::pair< long,bool > *""'");
}
arg1 = reinterpret_cast< std::pair< long,bool > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_Pair_int_bool_first_set" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
if (arg1) (arg1)->first = arg2;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_bool_first_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,bool > *arg1 = (std::pair< long,bool > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
long result;
if (!PyArg_ParseTuple(args,(char *)"O:_Pair_int_bool_first_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_bool_first_get" "', argument " "1"" of type '" "std::pair< long,bool > *""'");
}
arg1 = reinterpret_cast< std::pair< long,bool > * >(argp1);
result = (long) ((arg1)->first);
resultobj = SWIG_From_long(static_cast< long >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_bool_second_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,bool > *arg1 = (std::pair< long,bool > *) 0 ;
bool arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
bool val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:_Pair_int_bool_second_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_bool_second_set" "', argument " "1"" of type '" "std::pair< long,bool > *""'");
}
arg1 = reinterpret_cast< std::pair< long,bool > * >(argp1);
ecode2 = SWIG_AsVal_bool(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_Pair_int_bool_second_set" "', argument " "2"" of type '" "bool""'");
}
arg2 = static_cast< bool >(val2);
if (arg1) (arg1)->second = arg2;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_bool_second_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,bool > *arg1 = (std::pair< long,bool > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
bool result;
if (!PyArg_ParseTuple(args,(char *)"O:_Pair_int_bool_second_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_bool_second_get" "', argument " "1"" of type '" "std::pair< long,bool > *""'");
}
arg1 = reinterpret_cast< std::pair< long,bool > * >(argp1);
result = (bool) ((arg1)->second);
resultobj = SWIG_From_bool(static_cast< bool >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new__Pair_int_bool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
long arg1 ;
bool arg2 ;
long val1 ;
int ecode1 = 0 ;
bool val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
std::pair< long,bool > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:new__Pair_int_bool",&obj0,&obj1)) SWIG_fail;
ecode1 = SWIG_AsVal_long(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new__Pair_int_bool" "', argument " "1"" of type '" "long""'");
}
arg1 = static_cast< long >(val1);
ecode2 = SWIG_AsVal_bool(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new__Pair_int_bool" "', argument " "2"" of type '" "bool""'");
}
arg2 = static_cast< bool >(val2);
result = (std::pair< long,bool > *)new std::pair< long,bool >(arg1,arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__pairT_long_bool_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__Pair_int_bool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,bool > *arg1 = (std::pair< long,bool > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__Pair_int_bool",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_bool_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__Pair_int_bool" "', argument " "1"" of type '" "std::pair< long,bool > *""'");
}
arg1 = reinterpret_cast< std::pair< long,bool > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_Pair_int_bool_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_std__pairT_long_bool_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN PyObject *_wrap_new__StepVector_Iterator_bool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector< bool >::const_iterator arg1 ;
step_vector< bool >::const_iterator arg2 ;
void *argp1 ;
int res1 = 0 ;
void *argp2 ;
int res2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
step_vector_pystyle_iterator< bool > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:new__StepVector_Iterator_bool",&obj0,&obj1)) SWIG_fail;
{
res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_step_vectorT_bool_t__const_iterator, 0 | 0);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new__StepVector_Iterator_bool" "', argument " "1"" of type '" "step_vector< bool >::const_iterator""'");
}
if (!argp1) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new__StepVector_Iterator_bool" "', argument " "1"" of type '" "step_vector< bool >::const_iterator""'");
} else {
step_vector< bool >::const_iterator * temp = reinterpret_cast< step_vector< bool >::const_iterator * >(argp1);
arg1 = *temp;
if (SWIG_IsNewObj(res1)) delete temp;
}
}
{
res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_step_vectorT_bool_t__const_iterator, 0 | 0);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new__StepVector_Iterator_bool" "', argument " "2"" of type '" "step_vector< bool >::const_iterator""'");
}
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new__StepVector_Iterator_bool" "', argument " "2"" of type '" "step_vector< bool >::const_iterator""'");
} else {
step_vector< bool >::const_iterator * temp = reinterpret_cast< step_vector< bool >::const_iterator * >(argp2);
arg2 = *temp;
if (SWIG_IsNewObj(res2)) delete temp;
}
}
result = (step_vector_pystyle_iterator< bool > *)new step_vector_pystyle_iterator< bool >(arg1,arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_pystyle_iteratorT_bool_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_Iterator_bool_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< bool > *arg1 = (step_vector_pystyle_iterator< bool > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
SwigValueWrapper< std::pair< long,bool > > result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_Iterator_bool_next",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_Iterator_bool_next" "', argument " "1"" of type '" "step_vector_pystyle_iterator< bool > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< bool > * >(argp1);
{
try {
result = (arg1)->next();
} catch (pystyle_stopiteration &e) {
PyErr_SetString( PyExc_StopIteration, "" );
return NULL;
}
}
resultobj = SWIG_NewPointerObj((new std::pair< long,bool >(static_cast< const std::pair< long,bool >& >(result))), SWIGTYPE_p_std__pairT_long_bool_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_Iterator_bool___iter__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< bool > *arg1 = (step_vector_pystyle_iterator< bool > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
step_vector_pystyle_iterator< bool > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_Iterator_bool___iter__",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_Iterator_bool___iter__" "', argument " "1"" of type '" "step_vector_pystyle_iterator< bool > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< bool > * >(argp1);
result = (step_vector_pystyle_iterator< bool > *)(arg1)->__iter__();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_pystyle_iteratorT_bool_t, 0 | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__StepVector_Iterator_bool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< bool > *arg1 = (step_vector_pystyle_iterator< bool > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__StepVector_Iterator_bool",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_bool_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__StepVector_Iterator_bool" "', argument " "1"" of type '" "step_vector_pystyle_iterator< bool > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< bool > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_StepVector_Iterator_bool_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_step_vector_pystyle_iteratorT_bool_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN int Swig_var__StepVector_bool_min_index_set(PyObject *) {
SWIG_Error(SWIG_AttributeError,"Variable _StepVector_bool_min_index is read-only.");
return 1;
}
SWIGINTERN PyObject *Swig_var__StepVector_bool_min_index_get(void) {
PyObject *pyobj = 0;
pyobj = SWIG_From_long(static_cast< long >(step_vector_for_python< bool >::min_index));
return pyobj;
}
SWIGINTERN int Swig_var__StepVector_bool_max_index_set(PyObject *) {
SWIG_Error(SWIG_AttributeError,"Variable _StepVector_bool_max_index is read-only.");
return 1;
}
SWIGINTERN PyObject *Swig_var__StepVector_bool_max_index_get(void) {
PyObject *pyobj = 0;
pyobj = SWIG_From_long(static_cast< long >(step_vector_for_python< bool >::max_index));
return pyobj;
}
SWIGINTERN PyObject *_wrap_new__StepVector_bool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< bool > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)":new__StepVector_bool")) SWIG_fail;
result = (step_vector_for_python< bool > *)new step_vector_for_python< bool >();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_for_pythonT_bool_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_bool_set_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< bool > *arg1 = (step_vector_for_python< bool > *) 0 ;
long arg2 ;
long arg3 ;
bool arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
long val3 ;
int ecode3 = 0 ;
bool val4 ;
int ecode4 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOO:_StepVector_bool_set_value",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_bool_set_value" "', argument " "1"" of type '" "step_vector_for_python< bool > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< bool > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_bool_set_value" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
ecode3 = SWIG_AsVal_long(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "_StepVector_bool_set_value" "', argument " "3"" of type '" "long""'");
}
arg3 = static_cast< long >(val3);
ecode4 = SWIG_AsVal_bool(obj3, &val4);
if (!SWIG_IsOK(ecode4)) {
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_StepVector_bool_set_value" "', argument " "4"" of type '" "bool""'");
}
arg4 = static_cast< bool >(val4);
{
try {
(arg1)->set_value(arg2,arg3,arg4);
} catch (std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, e.what() );
} catch (type_error_non_arith &e) {
SWIG_exception(SWIG_TypeError, "Illegal arithmetic operation" );
}
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_bool_add_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< bool > *arg1 = (step_vector_for_python< bool > *) 0 ;
long arg2 ;
long arg3 ;
bool arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
long val3 ;
int ecode3 = 0 ;
bool val4 ;
int ecode4 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOO:_StepVector_bool_add_value",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_bool_add_value" "', argument " "1"" of type '" "step_vector_for_python< bool > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< bool > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_bool_add_value" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
ecode3 = SWIG_AsVal_long(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "_StepVector_bool_add_value" "', argument " "3"" of type '" "long""'");
}
arg3 = static_cast< long >(val3);
ecode4 = SWIG_AsVal_bool(obj3, &val4);
if (!SWIG_IsOK(ecode4)) {
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_StepVector_bool_add_value" "', argument " "4"" of type '" "bool""'");
}
arg4 = static_cast< bool >(val4);
{
try {
(arg1)->add_value(arg2,arg3,arg4);
} catch (std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, e.what() );
} catch (type_error_non_arith &e) {
SWIG_exception(SWIG_TypeError, "Illegal arithmetic operation" );
}
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_bool_get_all_values_pystyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< bool > *arg1 = (step_vector_for_python< bool > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
SwigValueWrapper< step_vector_pystyle_iterator< bool > > result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_bool_get_all_values_pystyle",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_bool_get_all_values_pystyle" "', argument " "1"" of type '" "step_vector_for_python< bool > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< bool > * >(argp1);
result = ((step_vector_for_python< bool > const *)arg1)->get_all_values_pystyle();
resultobj = SWIG_NewPointerObj((new step_vector_pystyle_iterator< bool >(static_cast< const step_vector_pystyle_iterator< bool >& >(result))), SWIGTYPE_p_step_vector_pystyle_iteratorT_bool_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_bool_get_values_pystyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< bool > *arg1 = (step_vector_for_python< bool > *) 0 ;
long arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
SwigValueWrapper< step_vector_pystyle_iterator< bool > > result;
if (!PyArg_ParseTuple(args,(char *)"OO:_StepVector_bool_get_values_pystyle",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_bool_get_values_pystyle" "', argument " "1"" of type '" "step_vector_for_python< bool > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< bool > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_bool_get_values_pystyle" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
result = ((step_vector_for_python< bool > const *)arg1)->get_values_pystyle(arg2);
resultobj = SWIG_NewPointerObj((new step_vector_pystyle_iterator< bool >(static_cast< const step_vector_pystyle_iterator< bool >& >(result))), SWIGTYPE_p_step_vector_pystyle_iteratorT_bool_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_bool_num_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< bool > *arg1 = (step_vector_for_python< bool > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
int result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_bool_num_values",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_bool_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_bool_num_values" "', argument " "1"" of type '" "step_vector_for_python< bool > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< bool > * >(argp1);
result = (int)((step_vector_for_python< bool > const *)arg1)->num_values();
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__StepVector_bool(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< bool > *arg1 = (step_vector_for_python< bool > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__StepVector_bool",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_bool_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__StepVector_bool" "', argument " "1"" of type '" "step_vector_for_python< bool > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< bool > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_StepVector_bool_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_step_vector_for_pythonT_bool_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN PyObject *_wrap__Pair_int_obj_first_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,AutoPyObjPtr > *arg1 = (std::pair< long,AutoPyObjPtr > *) 0 ;
long arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:_Pair_int_obj_first_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_obj_first_set" "', argument " "1"" of type '" "std::pair< long,AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< std::pair< long,AutoPyObjPtr > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_Pair_int_obj_first_set" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
if (arg1) (arg1)->first = arg2;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_obj_first_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,AutoPyObjPtr > *arg1 = (std::pair< long,AutoPyObjPtr > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
long result;
if (!PyArg_ParseTuple(args,(char *)"O:_Pair_int_obj_first_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_obj_first_get" "', argument " "1"" of type '" "std::pair< long,AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< std::pair< long,AutoPyObjPtr > * >(argp1);
result = (long) ((arg1)->first);
resultobj = SWIG_From_long(static_cast< long >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_obj_second_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,AutoPyObjPtr > *arg1 = (std::pair< long,AutoPyObjPtr > *) 0 ;
AutoPyObjPtr arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:_Pair_int_obj_second_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_obj_second_set" "', argument " "1"" of type '" "std::pair< long,AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< std::pair< long,AutoPyObjPtr > * >(argp1);
{
arg2 = AutoPyObjPtr( obj1 );
}
if (arg1) (arg1)->second = arg2;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__Pair_int_obj_second_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,AutoPyObjPtr > *arg1 = (std::pair< long,AutoPyObjPtr > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
AutoPyObjPtr result;
if (!PyArg_ParseTuple(args,(char *)"O:_Pair_int_obj_second_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Pair_int_obj_second_get" "', argument " "1"" of type '" "std::pair< long,AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< std::pair< long,AutoPyObjPtr > * >(argp1);
result = ((arg1)->second);
{
Py_XINCREF( (&result)->obj );
resultobj = (&result)->obj;
}
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new__Pair_int_obj(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
long arg1 ;
AutoPyObjPtr arg2 ;
long val1 ;
int ecode1 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
std::pair< long,AutoPyObjPtr > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:new__Pair_int_obj",&obj0,&obj1)) SWIG_fail;
ecode1 = SWIG_AsVal_long(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new__Pair_int_obj" "', argument " "1"" of type '" "long""'");
}
arg1 = static_cast< long >(val1);
{
arg2 = AutoPyObjPtr( obj1 );
}
result = (std::pair< long,AutoPyObjPtr > *)new std::pair< long,AutoPyObjPtr >(arg1,arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__pairT_long_AutoPyObjPtr_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__Pair_int_obj(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::pair< long,AutoPyObjPtr > *arg1 = (std::pair< long,AutoPyObjPtr > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__Pair_int_obj",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__pairT_long_AutoPyObjPtr_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__Pair_int_obj" "', argument " "1"" of type '" "std::pair< long,AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< std::pair< long,AutoPyObjPtr > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_Pair_int_obj_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_std__pairT_long_AutoPyObjPtr_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN PyObject *_wrap_new__StepVector_Iterator_obj(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector< AutoPyObjPtr >::const_iterator arg1 ;
step_vector< AutoPyObjPtr >::const_iterator arg2 ;
void *argp1 ;
int res1 = 0 ;
void *argp2 ;
int res2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
step_vector_pystyle_iterator< AutoPyObjPtr > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:new__StepVector_Iterator_obj",&obj0,&obj1)) SWIG_fail;
{
res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_step_vectorT_AutoPyObjPtr_t__const_iterator, 0 | 0);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new__StepVector_Iterator_obj" "', argument " "1"" of type '" "step_vector< AutoPyObjPtr >::const_iterator""'");
}
if (!argp1) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new__StepVector_Iterator_obj" "', argument " "1"" of type '" "step_vector< AutoPyObjPtr >::const_iterator""'");
} else {
step_vector< AutoPyObjPtr >::const_iterator * temp = reinterpret_cast< step_vector< AutoPyObjPtr >::const_iterator * >(argp1);
arg1 = *temp;
if (SWIG_IsNewObj(res1)) delete temp;
}
}
{
res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_step_vectorT_AutoPyObjPtr_t__const_iterator, 0 | 0);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new__StepVector_Iterator_obj" "', argument " "2"" of type '" "step_vector< AutoPyObjPtr >::const_iterator""'");
}
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new__StepVector_Iterator_obj" "', argument " "2"" of type '" "step_vector< AutoPyObjPtr >::const_iterator""'");
} else {
step_vector< AutoPyObjPtr >::const_iterator * temp = reinterpret_cast< step_vector< AutoPyObjPtr >::const_iterator * >(argp2);
arg2 = *temp;
if (SWIG_IsNewObj(res2)) delete temp;
}
}
result = (step_vector_pystyle_iterator< AutoPyObjPtr > *)new step_vector_pystyle_iterator< AutoPyObjPtr >(arg1,arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_Iterator_obj_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< AutoPyObjPtr > *arg1 = (step_vector_pystyle_iterator< AutoPyObjPtr > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
SwigValueWrapper< std::pair< long,AutoPyObjPtr > > result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_Iterator_obj_next",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_Iterator_obj_next" "', argument " "1"" of type '" "step_vector_pystyle_iterator< AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< AutoPyObjPtr > * >(argp1);
{
try {
result = (arg1)->next();
} catch (pystyle_stopiteration &e) {
PyErr_SetString( PyExc_StopIteration, "" );
return NULL;
}
}
resultobj = SWIG_NewPointerObj((new std::pair< long,AutoPyObjPtr >(static_cast< const std::pair< long,AutoPyObjPtr >& >(result))), SWIGTYPE_p_std__pairT_long_AutoPyObjPtr_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_Iterator_obj___iter__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< AutoPyObjPtr > *arg1 = (step_vector_pystyle_iterator< AutoPyObjPtr > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
step_vector_pystyle_iterator< AutoPyObjPtr > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_Iterator_obj___iter__",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_Iterator_obj___iter__" "', argument " "1"" of type '" "step_vector_pystyle_iterator< AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< AutoPyObjPtr > * >(argp1);
result = (step_vector_pystyle_iterator< AutoPyObjPtr > *)(arg1)->__iter__();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t, 0 | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__StepVector_Iterator_obj(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_pystyle_iterator< AutoPyObjPtr > *arg1 = (step_vector_pystyle_iterator< AutoPyObjPtr > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__StepVector_Iterator_obj",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__StepVector_Iterator_obj" "', argument " "1"" of type '" "step_vector_pystyle_iterator< AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< step_vector_pystyle_iterator< AutoPyObjPtr > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_StepVector_Iterator_obj_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN int Swig_var__StepVector_obj_min_index_set(PyObject *) {
SWIG_Error(SWIG_AttributeError,"Variable _StepVector_obj_min_index is read-only.");
return 1;
}
SWIGINTERN PyObject *Swig_var__StepVector_obj_min_index_get(void) {
PyObject *pyobj = 0;
pyobj = SWIG_From_long(static_cast< long >(step_vector_for_python< AutoPyObjPtr >::min_index));
return pyobj;
}
SWIGINTERN int Swig_var__StepVector_obj_max_index_set(PyObject *) {
SWIG_Error(SWIG_AttributeError,"Variable _StepVector_obj_max_index is read-only.");
return 1;
}
SWIGINTERN PyObject *Swig_var__StepVector_obj_max_index_get(void) {
PyObject *pyobj = 0;
pyobj = SWIG_From_long(static_cast< long >(step_vector_for_python< AutoPyObjPtr >::max_index));
return pyobj;
}
SWIGINTERN PyObject *_wrap_new__StepVector_obj(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< AutoPyObjPtr > *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)":new__StepVector_obj")) SWIG_fail;
result = (step_vector_for_python< AutoPyObjPtr > *)new step_vector_for_python< AutoPyObjPtr >();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_step_vector_for_pythonT_AutoPyObjPtr_t, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_obj_set_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< AutoPyObjPtr > *arg1 = (step_vector_for_python< AutoPyObjPtr > *) 0 ;
long arg2 ;
long arg3 ;
AutoPyObjPtr arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
long val3 ;
int ecode3 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOO:_StepVector_obj_set_value",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_obj_set_value" "', argument " "1"" of type '" "step_vector_for_python< AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< AutoPyObjPtr > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_obj_set_value" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
ecode3 = SWIG_AsVal_long(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "_StepVector_obj_set_value" "', argument " "3"" of type '" "long""'");
}
arg3 = static_cast< long >(val3);
{
arg4 = AutoPyObjPtr( obj3 );
}
{
try {
(arg1)->set_value(arg2,arg3,arg4);
} catch (std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, e.what() );
} catch (type_error_non_arith &e) {
SWIG_exception(SWIG_TypeError, "Illegal arithmetic operation" );
}
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_obj_add_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< AutoPyObjPtr > *arg1 = (step_vector_for_python< AutoPyObjPtr > *) 0 ;
long arg2 ;
long arg3 ;
AutoPyObjPtr arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
long val3 ;
int ecode3 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOO:_StepVector_obj_add_value",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_obj_add_value" "', argument " "1"" of type '" "step_vector_for_python< AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< AutoPyObjPtr > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_obj_add_value" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
ecode3 = SWIG_AsVal_long(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "_StepVector_obj_add_value" "', argument " "3"" of type '" "long""'");
}
arg3 = static_cast< long >(val3);
{
arg4 = AutoPyObjPtr( obj3 );
}
{
try {
(arg1)->add_value(arg2,arg3,arg4);
} catch (std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, e.what() );
} catch (type_error_non_arith &e) {
SWIG_exception(SWIG_TypeError, "Illegal arithmetic operation" );
}
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_obj_get_all_values_pystyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< AutoPyObjPtr > *arg1 = (step_vector_for_python< AutoPyObjPtr > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
SwigValueWrapper< step_vector_pystyle_iterator< AutoPyObjPtr > > result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_obj_get_all_values_pystyle",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_obj_get_all_values_pystyle" "', argument " "1"" of type '" "step_vector_for_python< AutoPyObjPtr > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< AutoPyObjPtr > * >(argp1);
result = ((step_vector_for_python< AutoPyObjPtr > const *)arg1)->get_all_values_pystyle();
resultobj = SWIG_NewPointerObj((new step_vector_pystyle_iterator< AutoPyObjPtr >(static_cast< const step_vector_pystyle_iterator< AutoPyObjPtr >& >(result))), SWIGTYPE_p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_obj_get_values_pystyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< AutoPyObjPtr > *arg1 = (step_vector_for_python< AutoPyObjPtr > *) 0 ;
long arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
SwigValueWrapper< step_vector_pystyle_iterator< AutoPyObjPtr > > result;
if (!PyArg_ParseTuple(args,(char *)"OO:_StepVector_obj_get_values_pystyle",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_obj_get_values_pystyle" "', argument " "1"" of type '" "step_vector_for_python< AutoPyObjPtr > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< AutoPyObjPtr > * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_StepVector_obj_get_values_pystyle" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
result = ((step_vector_for_python< AutoPyObjPtr > const *)arg1)->get_values_pystyle(arg2);
resultobj = SWIG_NewPointerObj((new step_vector_pystyle_iterator< AutoPyObjPtr >(static_cast< const step_vector_pystyle_iterator< AutoPyObjPtr >& >(result))), SWIGTYPE_p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap__StepVector_obj_num_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< AutoPyObjPtr > *arg1 = (step_vector_for_python< AutoPyObjPtr > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
int result;
if (!PyArg_ParseTuple(args,(char *)"O:_StepVector_obj_num_values",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_AutoPyObjPtr_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_StepVector_obj_num_values" "', argument " "1"" of type '" "step_vector_for_python< AutoPyObjPtr > const *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< AutoPyObjPtr > * >(argp1);
result = (int)((step_vector_for_python< AutoPyObjPtr > const *)arg1)->num_values();
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_delete__StepVector_obj(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
step_vector_for_python< AutoPyObjPtr > *arg1 = (step_vector_for_python< AutoPyObjPtr > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete__StepVector_obj",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_step_vector_for_pythonT_AutoPyObjPtr_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__StepVector_obj" "', argument " "1"" of type '" "step_vector_for_python< AutoPyObjPtr > *""'");
}
arg1 = reinterpret_cast< step_vector_for_python< AutoPyObjPtr > * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_StepVector_obj_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_step_vector_for_pythonT_AutoPyObjPtr_t, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
static PyMethodDef SwigMethods[] = {
{ (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
{ (char *)"_Pair_int_float_first_set", _wrap__Pair_int_float_first_set, METH_VARARGS, NULL},
{ (char *)"_Pair_int_float_first_get", _wrap__Pair_int_float_first_get, METH_VARARGS, NULL},
{ (char *)"_Pair_int_float_second_set", _wrap__Pair_int_float_second_set, METH_VARARGS, NULL},
{ (char *)"_Pair_int_float_second_get", _wrap__Pair_int_float_second_get, METH_VARARGS, NULL},
{ (char *)"new__Pair_int_float", _wrap_new__Pair_int_float, METH_VARARGS, NULL},
{ (char *)"delete__Pair_int_float", _wrap_delete__Pair_int_float, METH_VARARGS, NULL},
{ (char *)"_Pair_int_float_swigregister", _Pair_int_float_swigregister, METH_VARARGS, NULL},
{ (char *)"new__StepVector_Iterator_float", _wrap_new__StepVector_Iterator_float, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_float_next", _wrap__StepVector_Iterator_float_next, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_float___iter__", _wrap__StepVector_Iterator_float___iter__, METH_VARARGS, NULL},
{ (char *)"delete__StepVector_Iterator_float", _wrap_delete__StepVector_Iterator_float, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_float_swigregister", _StepVector_Iterator_float_swigregister, METH_VARARGS, NULL},
{ (char *)"new__StepVector_float", _wrap_new__StepVector_float, METH_VARARGS, NULL},
{ (char *)"_StepVector_float_set_value", _wrap__StepVector_float_set_value, METH_VARARGS, NULL},
{ (char *)"_StepVector_float_add_value", _wrap__StepVector_float_add_value, METH_VARARGS, NULL},
{ (char *)"_StepVector_float_get_all_values_pystyle", _wrap__StepVector_float_get_all_values_pystyle, METH_VARARGS, NULL},
{ (char *)"_StepVector_float_get_values_pystyle", _wrap__StepVector_float_get_values_pystyle, METH_VARARGS, NULL},
{ (char *)"_StepVector_float_num_values", _wrap__StepVector_float_num_values, METH_VARARGS, NULL},
{ (char *)"delete__StepVector_float", _wrap_delete__StepVector_float, METH_VARARGS, NULL},
{ (char *)"_StepVector_float_swigregister", _StepVector_float_swigregister, METH_VARARGS, NULL},
{ (char *)"_Pair_int_int_first_set", _wrap__Pair_int_int_first_set, METH_VARARGS, NULL},
{ (char *)"_Pair_int_int_first_get", _wrap__Pair_int_int_first_get, METH_VARARGS, NULL},
{ (char *)"_Pair_int_int_second_set", _wrap__Pair_int_int_second_set, METH_VARARGS, NULL},
{ (char *)"_Pair_int_int_second_get", _wrap__Pair_int_int_second_get, METH_VARARGS, NULL},
{ (char *)"new__Pair_int_int", _wrap_new__Pair_int_int, METH_VARARGS, NULL},
{ (char *)"delete__Pair_int_int", _wrap_delete__Pair_int_int, METH_VARARGS, NULL},
{ (char *)"_Pair_int_int_swigregister", _Pair_int_int_swigregister, METH_VARARGS, NULL},
{ (char *)"new__StepVector_Iterator_int", _wrap_new__StepVector_Iterator_int, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_int_next", _wrap__StepVector_Iterator_int_next, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_int___iter__", _wrap__StepVector_Iterator_int___iter__, METH_VARARGS, NULL},
{ (char *)"delete__StepVector_Iterator_int", _wrap_delete__StepVector_Iterator_int, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_int_swigregister", _StepVector_Iterator_int_swigregister, METH_VARARGS, NULL},
{ (char *)"new__StepVector_int", _wrap_new__StepVector_int, METH_VARARGS, NULL},
{ (char *)"_StepVector_int_set_value", _wrap__StepVector_int_set_value, METH_VARARGS, NULL},
{ (char *)"_StepVector_int_add_value", _wrap__StepVector_int_add_value, METH_VARARGS, NULL},
{ (char *)"_StepVector_int_get_all_values_pystyle", _wrap__StepVector_int_get_all_values_pystyle, METH_VARARGS, NULL},
{ (char *)"_StepVector_int_get_values_pystyle", _wrap__StepVector_int_get_values_pystyle, METH_VARARGS, NULL},
{ (char *)"_StepVector_int_num_values", _wrap__StepVector_int_num_values, METH_VARARGS, NULL},
{ (char *)"delete__StepVector_int", _wrap_delete__StepVector_int, METH_VARARGS, NULL},
{ (char *)"_StepVector_int_swigregister", _StepVector_int_swigregister, METH_VARARGS, NULL},
{ (char *)"_Pair_int_bool_first_set", _wrap__Pair_int_bool_first_set, METH_VARARGS, NULL},
{ (char *)"_Pair_int_bool_first_get", _wrap__Pair_int_bool_first_get, METH_VARARGS, NULL},
{ (char *)"_Pair_int_bool_second_set", _wrap__Pair_int_bool_second_set, METH_VARARGS, NULL},
{ (char *)"_Pair_int_bool_second_get", _wrap__Pair_int_bool_second_get, METH_VARARGS, NULL},
{ (char *)"new__Pair_int_bool", _wrap_new__Pair_int_bool, METH_VARARGS, NULL},
{ (char *)"delete__Pair_int_bool", _wrap_delete__Pair_int_bool, METH_VARARGS, NULL},
{ (char *)"_Pair_int_bool_swigregister", _Pair_int_bool_swigregister, METH_VARARGS, NULL},
{ (char *)"new__StepVector_Iterator_bool", _wrap_new__StepVector_Iterator_bool, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_bool_next", _wrap__StepVector_Iterator_bool_next, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_bool___iter__", _wrap__StepVector_Iterator_bool___iter__, METH_VARARGS, NULL},
{ (char *)"delete__StepVector_Iterator_bool", _wrap_delete__StepVector_Iterator_bool, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_bool_swigregister", _StepVector_Iterator_bool_swigregister, METH_VARARGS, NULL},
{ (char *)"new__StepVector_bool", _wrap_new__StepVector_bool, METH_VARARGS, NULL},
{ (char *)"_StepVector_bool_set_value", _wrap__StepVector_bool_set_value, METH_VARARGS, NULL},
{ (char *)"_StepVector_bool_add_value", _wrap__StepVector_bool_add_value, METH_VARARGS, NULL},
{ (char *)"_StepVector_bool_get_all_values_pystyle", _wrap__StepVector_bool_get_all_values_pystyle, METH_VARARGS, NULL},
{ (char *)"_StepVector_bool_get_values_pystyle", _wrap__StepVector_bool_get_values_pystyle, METH_VARARGS, NULL},
{ (char *)"_StepVector_bool_num_values", _wrap__StepVector_bool_num_values, METH_VARARGS, NULL},
{ (char *)"delete__StepVector_bool", _wrap_delete__StepVector_bool, METH_VARARGS, NULL},
{ (char *)"_StepVector_bool_swigregister", _StepVector_bool_swigregister, METH_VARARGS, NULL},
{ (char *)"_Pair_int_obj_first_set", _wrap__Pair_int_obj_first_set, METH_VARARGS, NULL},
{ (char *)"_Pair_int_obj_first_get", _wrap__Pair_int_obj_first_get, METH_VARARGS, NULL},
{ (char *)"_Pair_int_obj_second_set", _wrap__Pair_int_obj_second_set, METH_VARARGS, NULL},
{ (char *)"_Pair_int_obj_second_get", _wrap__Pair_int_obj_second_get, METH_VARARGS, NULL},
{ (char *)"new__Pair_int_obj", _wrap_new__Pair_int_obj, METH_VARARGS, NULL},
{ (char *)"delete__Pair_int_obj", _wrap_delete__Pair_int_obj, METH_VARARGS, NULL},
{ (char *)"_Pair_int_obj_swigregister", _Pair_int_obj_swigregister, METH_VARARGS, NULL},
{ (char *)"new__StepVector_Iterator_obj", _wrap_new__StepVector_Iterator_obj, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_obj_next", _wrap__StepVector_Iterator_obj_next, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_obj___iter__", _wrap__StepVector_Iterator_obj___iter__, METH_VARARGS, NULL},
{ (char *)"delete__StepVector_Iterator_obj", _wrap_delete__StepVector_Iterator_obj, METH_VARARGS, NULL},
{ (char *)"_StepVector_Iterator_obj_swigregister", _StepVector_Iterator_obj_swigregister, METH_VARARGS, NULL},
{ (char *)"new__StepVector_obj", _wrap_new__StepVector_obj, METH_VARARGS, NULL},
{ (char *)"_StepVector_obj_set_value", _wrap__StepVector_obj_set_value, METH_VARARGS, NULL},
{ (char *)"_StepVector_obj_add_value", _wrap__StepVector_obj_add_value, METH_VARARGS, NULL},
{ (char *)"_StepVector_obj_get_all_values_pystyle", _wrap__StepVector_obj_get_all_values_pystyle, METH_VARARGS, NULL},
{ (char *)"_StepVector_obj_get_values_pystyle", _wrap__StepVector_obj_get_values_pystyle, METH_VARARGS, NULL},
{ (char *)"_StepVector_obj_num_values", _wrap__StepVector_obj_num_values, METH_VARARGS, NULL},
{ (char *)"delete__StepVector_obj", _wrap_delete__StepVector_obj, METH_VARARGS, NULL},
{ (char *)"_StepVector_obj_swigregister", _StepVector_obj_swigregister, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL }
};
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
static swig_type_info _swigt__p_AutoPyObjPtr = {"_p_AutoPyObjPtr", "AutoPyObjPtr *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__pairT_long_AutoPyObjPtr_t = {"_p_std__pairT_long_AutoPyObjPtr_t", "std::pair< long,AutoPyObjPtr > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__pairT_long_bool_t = {"_p_std__pairT_long_bool_t", "std::pair< long,bool > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__pairT_long_double_t = {"_p_std__pairT_long_double_t", "std::pair< long,double > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__pairT_long_int_t = {"_p_std__pairT_long_int_t", "std::pair< long,int > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vectorT_AutoPyObjPtr_t__const_iterator = {"_p_step_vectorT_AutoPyObjPtr_t__const_iterator", "step_vector< AutoPyObjPtr >::const_iterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vectorT_bool_t__const_iterator = {"_p_step_vectorT_bool_t__const_iterator", "step_vector< bool >::const_iterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vectorT_double_t__const_iterator = {"_p_step_vectorT_double_t__const_iterator", "step_vector< double >::const_iterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vectorT_int_t__const_iterator = {"_p_step_vectorT_int_t__const_iterator", "step_vector< int >::const_iterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vector_for_pythonT_AutoPyObjPtr_t = {"_p_step_vector_for_pythonT_AutoPyObjPtr_t", "step_vector_for_python< AutoPyObjPtr > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vector_for_pythonT_bool_t = {"_p_step_vector_for_pythonT_bool_t", "step_vector_for_python< bool > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vector_for_pythonT_double_t = {"_p_step_vector_for_pythonT_double_t", "step_vector_for_python< double > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vector_for_pythonT_int_t = {"_p_step_vector_for_pythonT_int_t", "step_vector_for_python< int > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t = {"_p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t", "step_vector_pystyle_iterator< AutoPyObjPtr > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vector_pystyle_iteratorT_bool_t = {"_p_step_vector_pystyle_iteratorT_bool_t", "step_vector_pystyle_iterator< bool > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vector_pystyle_iteratorT_double_t = {"_p_step_vector_pystyle_iteratorT_double_t", "step_vector_pystyle_iterator< double > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_step_vector_pystyle_iteratorT_int_t = {"_p_step_vector_pystyle_iteratorT_int_t", "step_vector_pystyle_iterator< int > *", 0, 0, (void*)0, 0};
static swig_type_info *swig_type_initial[] = {
&_swigt__p_AutoPyObjPtr,
&_swigt__p_char,
&_swigt__p_std__pairT_long_AutoPyObjPtr_t,
&_swigt__p_std__pairT_long_bool_t,
&_swigt__p_std__pairT_long_double_t,
&_swigt__p_std__pairT_long_int_t,
&_swigt__p_step_vectorT_AutoPyObjPtr_t__const_iterator,
&_swigt__p_step_vectorT_bool_t__const_iterator,
&_swigt__p_step_vectorT_double_t__const_iterator,
&_swigt__p_step_vectorT_int_t__const_iterator,
&_swigt__p_step_vector_for_pythonT_AutoPyObjPtr_t,
&_swigt__p_step_vector_for_pythonT_bool_t,
&_swigt__p_step_vector_for_pythonT_double_t,
&_swigt__p_step_vector_for_pythonT_int_t,
&_swigt__p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t,
&_swigt__p_step_vector_pystyle_iteratorT_bool_t,
&_swigt__p_step_vector_pystyle_iteratorT_double_t,
&_swigt__p_step_vector_pystyle_iteratorT_int_t,
};
static swig_cast_info _swigc__p_AutoPyObjPtr[] = { {&_swigt__p_AutoPyObjPtr, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__pairT_long_AutoPyObjPtr_t[] = { {&_swigt__p_std__pairT_long_AutoPyObjPtr_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__pairT_long_bool_t[] = { {&_swigt__p_std__pairT_long_bool_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__pairT_long_double_t[] = { {&_swigt__p_std__pairT_long_double_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__pairT_long_int_t[] = { {&_swigt__p_std__pairT_long_int_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vectorT_AutoPyObjPtr_t__const_iterator[] = { {&_swigt__p_step_vectorT_AutoPyObjPtr_t__const_iterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vectorT_bool_t__const_iterator[] = { {&_swigt__p_step_vectorT_bool_t__const_iterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vectorT_double_t__const_iterator[] = { {&_swigt__p_step_vectorT_double_t__const_iterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vectorT_int_t__const_iterator[] = { {&_swigt__p_step_vectorT_int_t__const_iterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vector_for_pythonT_AutoPyObjPtr_t[] = { {&_swigt__p_step_vector_for_pythonT_AutoPyObjPtr_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vector_for_pythonT_bool_t[] = { {&_swigt__p_step_vector_for_pythonT_bool_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vector_for_pythonT_double_t[] = { {&_swigt__p_step_vector_for_pythonT_double_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vector_for_pythonT_int_t[] = { {&_swigt__p_step_vector_for_pythonT_int_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t[] = { {&_swigt__p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vector_pystyle_iteratorT_bool_t[] = { {&_swigt__p_step_vector_pystyle_iteratorT_bool_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vector_pystyle_iteratorT_double_t[] = { {&_swigt__p_step_vector_pystyle_iteratorT_double_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_step_vector_pystyle_iteratorT_int_t[] = { {&_swigt__p_step_vector_pystyle_iteratorT_int_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info *swig_cast_initial[] = {
_swigc__p_AutoPyObjPtr,
_swigc__p_char,
_swigc__p_std__pairT_long_AutoPyObjPtr_t,
_swigc__p_std__pairT_long_bool_t,
_swigc__p_std__pairT_long_double_t,
_swigc__p_std__pairT_long_int_t,
_swigc__p_step_vectorT_AutoPyObjPtr_t__const_iterator,
_swigc__p_step_vectorT_bool_t__const_iterator,
_swigc__p_step_vectorT_double_t__const_iterator,
_swigc__p_step_vectorT_int_t__const_iterator,
_swigc__p_step_vector_for_pythonT_AutoPyObjPtr_t,
_swigc__p_step_vector_for_pythonT_bool_t,
_swigc__p_step_vector_for_pythonT_double_t,
_swigc__p_step_vector_for_pythonT_int_t,
_swigc__p_step_vector_pystyle_iteratorT_AutoPyObjPtr_t,
_swigc__p_step_vector_pystyle_iteratorT_bool_t,
_swigc__p_step_vector_pystyle_iteratorT_double_t,
_swigc__p_step_vector_pystyle_iteratorT_int_t,
};
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
static swig_const_info swig_const_table[] = {
{0, 0, 0, 0.0, 0, 0}};
#ifdef __cplusplus
}
#endif
/* -----------------------------------------------------------------------------
* Type initialization:
* This problem is tough by the requirement that no dynamic
* memory is used. Also, since swig_type_info structures store pointers to
* swig_cast_info structures and swig_cast_info structures store pointers back
* to swig_type_info structures, we need some lookup code at initialization.
* The idea is that swig generates all the structures that are needed.
* The runtime then collects these partially filled structures.
* The SWIG_InitializeModule function takes these initial arrays out of
* swig_module, and does all the lookup, filling in the swig_module.types
* array with the correct data and linking the correct swig_cast_info
* structures together.
*
* The generated swig_type_info structures are assigned statically to an initial
* array. We just loop through that array, and handle each type individually.
* First we lookup if this type has been already loaded, and if so, use the
* loaded structure instead of the generated one. Then we have to fill in the
* cast linked list. The cast data is initially stored in something like a
* two-dimensional array. Each row corresponds to a type (there are the same
* number of rows as there are in the swig_type_initial array). Each entry in
* a column is one of the swig_cast_info structures for that type.
* The cast_initial array is actually an array of arrays, because each row has
* a variable number of columns. So to actually build the cast linked list,
* we find the array of casts associated with the type, and loop through it
* adding the casts to the list. The one last trick we need to do is making
* sure the type pointer in the swig_cast_info struct is correct.
*
* First off, we lookup the cast->type name to see if it is already loaded.
* There are three cases to handle:
* 1) If the cast->type has already been loaded AND the type we are adding
* casting info to has not been loaded (it is in this module), THEN we
* replace the cast->type pointer with the type pointer that has already
* been loaded.
* 2) If BOTH types (the one we are adding casting info to, and the
* cast->type) are loaded, THEN the cast info has already been loaded by
* the previous module so we just ignore it.
* 3) Finally, if cast->type has not already been loaded, then we add that
* swig_cast_info to the linked list (because the cast->type) pointer will
* be correct.
* ----------------------------------------------------------------------------- */
#ifdef __cplusplus
extern "C" {
#if 0
} /* c-mode */
#endif
#endif
#if 0
#define SWIGRUNTIME_DEBUG
#endif
SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
size_t i;
swig_module_info *module_head, *iter;
int init;
/* check to see if the circular list has been setup, if not, set it up */
if (swig_module.next==0) {
/* Initialize the swig_module */
swig_module.type_initial = swig_type_initial;
swig_module.cast_initial = swig_cast_initial;
swig_module.next = &swig_module;
init = 1;
} else {
init = 0;
}
/* Try and load any already created modules */
module_head = SWIG_GetModule(clientdata);
if (!module_head) {
/* This is the first module loaded for this interpreter */
/* so set the swig module into the interpreter */
SWIG_SetModule(clientdata, &swig_module);
} else {
/* the interpreter has loaded a SWIG module, but has it loaded this one? */
iter=module_head;
do {
if (iter==&swig_module) {
/* Our module is already in the list, so there's nothing more to do. */
return;
}
iter=iter->next;
} while (iter!= module_head);
/* otherwise we must add our module into the list */
swig_module.next = module_head->next;
module_head->next = &swig_module;
}
/* When multiple interpreters are used, a module could have already been initialized in
a different interpreter, but not yet have a pointer in this interpreter.
In this case, we do not want to continue adding types... everything should be
set up already */
if (init == 0) return;
/* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#endif
for (i = 0; i < swig_module.size; ++i) {
swig_type_info *type = 0;
swig_type_info *ret;
swig_cast_info *cast;
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif
/* if there is another module already loaded */
if (swig_module.next != &swig_module) {
type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
}
if (type) {
/* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
if (swig_module.type_initial[i]->clientdata) {
type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
}
} else {
type = swig_module.type_initial[i];
}
/* Insert casting types */
cast = swig_module.cast_initial[i];
while (cast->type) {
/* Don't need to add information already in the list */
ret = 0;
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
if (swig_module.next != &swig_module) {
ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
#endif
}
if (ret) {
if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
cast->type = ret;
ret = 0;
} else {
/* Check for casting already in the list */
swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
#endif
if (!ocast) ret = 0;
}
}
if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
if (type->cast) {
type->cast->prev = cast;
cast->next = type->cast;
}
type->cast = cast;
}
cast++;
}
/* Set entry in modules->types array equal to the type */
swig_module.types[i] = type;
}
swig_module.types[i] = 0;
#ifdef SWIGRUNTIME_DEBUG
printf("**** SWIG_InitializeModule: Cast List ******\n");
for (i = 0; i < swig_module.size; ++i) {
int j = 0;
swig_cast_info *cast = swig_module.cast_initial[i];
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
while (cast->type) {
printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
cast++;
++j;
}
printf("---- Total casts: %d\n",j);
}
printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}
/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
* of equivalent types. It is like calling
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
SWIG_PropagateClientData(void) {
size_t i;
swig_cast_info *equiv;
static int init_run = 0;
if (init_run) return;
init_run = 1;
for (i = 0; i < swig_module.size; i++) {
if (swig_module.types[i]->clientdata) {
equiv = swig_module.types[i]->cast;
while (equiv) {
if (!equiv->converter) {
if (equiv->type && !equiv->type->clientdata)
SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
}
equiv = equiv->next;
}
}
}
}
#ifdef __cplusplus
#if 0
{
/* c-mode */
#endif
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Python-specific SWIG API */
#define SWIG_newvarlink() SWIG_Python_newvarlink()
#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
/* -----------------------------------------------------------------------------
* global variable support code.
* ----------------------------------------------------------------------------- */
typedef struct swig_globalvar {
char *name; /* Name of global variable */
PyObject *(*get_attr)(void); /* Return the current value */
int (*set_attr)(PyObject *); /* Set the value */
struct swig_globalvar *next;
} swig_globalvar;
typedef struct swig_varlinkobject {
PyObject_HEAD
swig_globalvar *vars;
} swig_varlinkobject;
SWIGINTERN PyObject *
swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
#if PY_VERSION_HEX >= 0x03000000
return PyUnicode_InternFromString("");
#else
return PyString_FromString("");
#endif
}
SWIGINTERN PyObject *
swig_varlink_str(swig_varlinkobject *v) {
#if PY_VERSION_HEX >= 0x03000000
PyObject *str = PyUnicode_InternFromString("(");
PyObject *tail;
PyObject *joined;
swig_globalvar *var;
for (var = v->vars; var; var=var->next) {
tail = PyUnicode_FromString(var->name);
joined = PyUnicode_Concat(str, tail);
Py_DecRef(str);
Py_DecRef(tail);
str = joined;
if (var->next) {
tail = PyUnicode_InternFromString(", ");
joined = PyUnicode_Concat(str, tail);
Py_DecRef(str);
Py_DecRef(tail);
str = joined;
}
}
tail = PyUnicode_InternFromString(")");
joined = PyUnicode_Concat(str, tail);
Py_DecRef(str);
Py_DecRef(tail);
str = joined;
#else
PyObject *str = PyString_FromString("(");
swig_globalvar *var;
for (var = v->vars; var; var=var->next) {
PyString_ConcatAndDel(&str,PyString_FromString(var->name));
if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
}
PyString_ConcatAndDel(&str,PyString_FromString(")"));
#endif
return str;
}
SWIGINTERN int
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
char *tmp;
PyObject *str = swig_varlink_str(v);
fprintf(fp,"Swig global variables ");
fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
SWIG_Python_str_DelForPy3(tmp);
Py_DECREF(str);
return 0;
}
SWIGINTERN void
swig_varlink_dealloc(swig_varlinkobject *v) {
swig_globalvar *var = v->vars;
while (var) {
swig_globalvar *n = var->next;
free(var->name);
free(var);
var = n;
}
}
SWIGINTERN PyObject *
swig_varlink_getattr(swig_varlinkobject *v, char *n) {
PyObject *res = NULL;
swig_globalvar *var = v->vars;
while (var) {
if (strcmp(var->name,n) == 0) {
res = (*var->get_attr)();
break;
}
var = var->next;
}
if (res == NULL && !PyErr_Occurred()) {
PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
}
return res;
}
SWIGINTERN int
swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
int res = 1;
swig_globalvar *var = v->vars;
while (var) {
if (strcmp(var->name,n) == 0) {
res = (*var->set_attr)(p);
break;
}
var = var->next;
}
if (res == 1 && !PyErr_Occurred()) {
PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
}
return res;
}
SWIGINTERN PyTypeObject*
swig_varlink_type(void) {
static char varlink__doc__[] = "Swig var link object";
static PyTypeObject varlink_type;
static int type_init = 0;
if (!type_init) {
const PyTypeObject tmp = {
#if PY_VERSION_HEX >= 0x03000000
PyVarObject_HEAD_INIT(NULL, 0)
#else
PyObject_HEAD_INIT(NULL)
0, /* ob_size */
#endif
(char *)"swigvarlink", /* tp_name */
sizeof(swig_varlinkobject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor) swig_varlink_dealloc, /* tp_dealloc */
(printfunc) swig_varlink_print, /* tp_print */
(getattrfunc) swig_varlink_getattr, /* tp_getattr */
(setattrfunc) swig_varlink_setattr, /* tp_setattr */
0, /* tp_compare */
(reprfunc) swig_varlink_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
(reprfunc) swig_varlink_str, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
0, /* tp_flags */
varlink__doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
#if PY_VERSION_HEX >= 0x02020000
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
#endif
#if PY_VERSION_HEX >= 0x02030000
0, /* tp_del */
#endif
#if PY_VERSION_HEX >= 0x02060000
0, /* tp_version_tag */
#endif
#if PY_VERSION_HEX >= 0x03040000
0, /* tp_finalize */
#endif
#ifdef COUNT_ALLOCS
0, /* tp_allocs */
0, /* tp_frees */
0, /* tp_maxalloc */
#if PY_VERSION_HEX >= 0x02050000
0, /* tp_prev */
#endif
0 /* tp_next */
#endif
};
varlink_type = tmp;
type_init = 1;
#if PY_VERSION_HEX < 0x02020000
varlink_type.ob_type = &PyType_Type;
#else
if (PyType_Ready(&varlink_type) < 0)
return NULL;
#endif
}
return &varlink_type;
}
/* Create a variable linking object for use later */
SWIGINTERN PyObject *
SWIG_Python_newvarlink(void) {
swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
if (result) {
result->vars = 0;
}
return ((PyObject*) result);
}
SWIGINTERN void
SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
swig_varlinkobject *v = (swig_varlinkobject *) p;
swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
if (gv) {
size_t size = strlen(name)+1;
gv->name = (char *)malloc(size);
if (gv->name) {
strncpy(gv->name,name,size);
gv->get_attr = get_attr;
gv->set_attr = set_attr;
gv->next = v->vars;
}
}
v->vars = gv;
}
SWIGINTERN PyObject *
SWIG_globals(void) {
static PyObject *_SWIG_globals = 0;
if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
return _SWIG_globals;
}
/* -----------------------------------------------------------------------------
* constants/methods manipulation
* ----------------------------------------------------------------------------- */
/* Install Constants */
SWIGINTERN void
SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
PyObject *obj = 0;
size_t i;
for (i = 0; constants[i].type; ++i) {
switch(constants[i].type) {
case SWIG_PY_POINTER:
obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
break;
case SWIG_PY_BINARY:
obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
break;
default:
obj = 0;
break;
}
if (obj) {
PyDict_SetItemString(d, constants[i].name, obj);
Py_DECREF(obj);
}
}
}
/* -----------------------------------------------------------------------------*/
/* Fix SwigMethods to carry the callback ptrs when needed */
/* -----------------------------------------------------------------------------*/
SWIGINTERN void
SWIG_Python_FixMethods(PyMethodDef *methods,
swig_const_info *const_table,
swig_type_info **types,
swig_type_info **types_initial) {
size_t i;
for (i = 0; methods[i].ml_name; ++i) {
const char *c = methods[i].ml_doc;
if (!c) continue;
c = strstr(c, "swig_ptr: ");
if (c) {
int j;
swig_const_info *ci = 0;
const char *name = c + 10;
for (j = 0; const_table[j].type; ++j) {
if (strncmp(const_table[j].name, name,
strlen(const_table[j].name)) == 0) {
ci = &(const_table[j]);
break;
}
}
if (ci) {
void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
if (ptr) {
size_t shift = (ci->ptype) - types;
swig_type_info *ty = types_initial[shift];
size_t ldoc = (c - methods[i].ml_doc);
size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
char *ndoc = (char*)malloc(ldoc + lptr + 10);
if (ndoc) {
char *buff = ndoc;
strncpy(buff, methods[i].ml_doc, ldoc);
buff += ldoc;
strncpy(buff, "swig_ptr: ", 10);
buff += 10;
SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
methods[i].ml_doc = ndoc;
}
}
}
}
}
}
#ifdef __cplusplus
}
#endif
/* -----------------------------------------------------------------------------*
* Partial Init method
* -----------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT
#if PY_VERSION_HEX >= 0x03000000
PyObject*
#else
void
#endif
SWIG_init(void) {
PyObject *m, *d, *md;
#if PY_VERSION_HEX >= 0x03000000
static struct PyModuleDef SWIG_module = {
# if PY_VERSION_HEX >= 0x03020000
PyModuleDef_HEAD_INIT,
# else
{
PyObject_HEAD_INIT(NULL)
NULL, /* m_init */
0, /* m_index */
NULL, /* m_copy */
},
# endif
(char *) SWIG_name,
NULL,
-1,
SwigMethods,
NULL,
NULL,
NULL,
NULL
};
#endif
#if defined(SWIGPYTHON_BUILTIN)
static SwigPyClientData SwigPyObject_clientdata = {
0, 0, 0, 0, 0, 0, 0
};
static PyGetSetDef this_getset_def = {
(char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
};
static SwigPyGetSet thisown_getset_closure = {
(PyCFunction) SwigPyObject_own,
(PyCFunction) SwigPyObject_own
};
static PyGetSetDef thisown_getset_def = {
(char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
};
PyTypeObject *builtin_pytype;
int builtin_base_count;
swig_type_info *builtin_basetype;
PyObject *tuple;
PyGetSetDescrObject *static_getset;
PyTypeObject *metatype;
PyTypeObject *swigpyobject;
SwigPyClientData *cd;
PyObject *public_interface, *public_symbol;
PyObject *this_descr;
PyObject *thisown_descr;
PyObject *self = 0;
int i;
(void)builtin_pytype;
(void)builtin_base_count;
(void)builtin_basetype;
(void)tuple;
(void)static_getset;
(void)self;
/* Metaclass is used to implement static member variables */
metatype = SwigPyObjectType();
assert(metatype);
#endif
/* Fix SwigMethods to carry the callback ptrs when needed */
SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
#if PY_VERSION_HEX >= 0x03000000
m = PyModule_Create(&SWIG_module);
#else
m = Py_InitModule((char *) SWIG_name, SwigMethods);
#endif
md = d = PyModule_GetDict(m);
(void)md;
SWIG_InitializeModule(0);
#ifdef SWIGPYTHON_BUILTIN
swigpyobject = SwigPyObject_TypeOnce();
SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
assert(SwigPyObject_stype);
cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
if (!cd) {
SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
SwigPyObject_clientdata.pytype = swigpyobject;
} else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
# if PY_VERSION_HEX >= 0x03000000
return NULL;
# else
return;
# endif
}
/* All objects have a 'this' attribute */
this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
(void)this_descr;
/* All objects have a 'thisown' attribute */
thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
(void)thisown_descr;
public_interface = PyList_New(0);
public_symbol = 0;
(void)public_symbol;
PyDict_SetItemString(md, "__all__", public_interface);
Py_DECREF(public_interface);
for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
for (i = 0; swig_const_table[i].name != 0; ++i)
SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
#endif
SWIG_InstallConstants(d,swig_const_table);
PyDict_SetItemString(md,(char *)"cvar", SWIG_globals());
SWIG_addvarlink(SWIG_globals(),(char *)"_StepVector_float_min_index",Swig_var__StepVector_float_min_index_get, Swig_var__StepVector_float_min_index_set);
SWIG_addvarlink(SWIG_globals(),(char *)"_StepVector_float_max_index",Swig_var__StepVector_float_max_index_get, Swig_var__StepVector_float_max_index_set);
SWIG_addvarlink(SWIG_globals(),(char *)"_StepVector_int_min_index",Swig_var__StepVector_int_min_index_get, Swig_var__StepVector_int_min_index_set);
SWIG_addvarlink(SWIG_globals(),(char *)"_StepVector_int_max_index",Swig_var__StepVector_int_max_index_get, Swig_var__StepVector_int_max_index_set);
SWIG_addvarlink(SWIG_globals(),(char *)"_StepVector_bool_min_index",Swig_var__StepVector_bool_min_index_get, Swig_var__StepVector_bool_min_index_set);
SWIG_addvarlink(SWIG_globals(),(char *)"_StepVector_bool_max_index",Swig_var__StepVector_bool_max_index_get, Swig_var__StepVector_bool_max_index_set);
SWIG_addvarlink(SWIG_globals(),(char *)"_StepVector_obj_min_index",Swig_var__StepVector_obj_min_index_get, Swig_var__StepVector_obj_min_index_set);
SWIG_addvarlink(SWIG_globals(),(char *)"_StepVector_obj_max_index",Swig_var__StepVector_obj_max_index_get, Swig_var__StepVector_obj_max_index_set);
#if PY_VERSION_HEX >= 0x03000000
return m;
#else
return;
#endif
}
HTSeq-0.11.2/python3/src/step_vector.h 0000664 0000000 0000000 00000011451 13415006247 017424 0 ustar root root 0000000 0000000 #ifndef _STEP_VECTOR_H_
#define _STEP_VECTOR_H_
#include
#include
#include
#include //for now only
template< class T >
class step_vector {
protected:
std::map< long int, T > m;
public:
static const long int min_index;
static const long int max_index;
typedef typename std::map< long int, T >::const_iterator const_iterator;
step_vector( );
const T operator[]( long int i ) const;
void set_value( long int from, long int to, T value );
void add_value( long int from, long int to, T value );
void apply_to_values( long int from, long int to, void (*func)( T & val ) );
const_iterator get_values( long int from ) const;
const_iterator begin( ) const;
const_iterator end( ) const;
};
template< class T >
const long int step_vector::min_index = LONG_MIN;
template< class T >
const long int step_vector::max_index = LONG_MAX;
template< class T >
step_vector::step_vector( )
{
m[ min_index ] = T();
}
template< class T >
const T step_vector::operator[]( long int i ) const
{
const_iterator it = m.upper_bound( i );
it--;
return it->second;
}
template< class T >
void step_vector::set_value( long int from, long int to, T value )
{
if( from > to )
throw std::out_of_range( "Indices reversed in step_vector." );
// Unless the new step extends to the end, we need to insert a new
// value afterwards unless the step to the right has the same value
if( to < max_index ) {
T next_value = (*this)[to+1];
if( !( next_value == value ) )
m[ to + 1 ] = next_value;
}
// Find the left step, i.e., the step whose start is smaller or equal
// to 'from':
typename std::map< long int, T>::iterator left = m.upper_bound( from );
left--;
assert( left->first <= from );
// Get rid of the steps present between from and to
typename std::map< long int, T>::iterator it = m.lower_bound( from );
if( it->first == from )
it++;
assert( it->first > from );
if( it->first <= to ) {
m.erase( it, m.upper_bound( to ) );
}
if( ! (left->second == value ) ) {
if( left->first != from )
// Insert a new step
m[ from ] = value;
else {
// We have from == left->first, so the step is already present.
// Would changing m[from] to value make it equal to its left
// neighbor?
if( left == m.begin() )
// no, there is no left neighbor
m[ from ] = value;
else {
typename std::map< long int, T>::iterator leftleft = left;
leftleft--;
if( ! ( leftleft->second == value ) )
// ok, change the value
m[ from ] = value;
else
// no, rather delete the step
m.erase( left );
}
}
}
}
template< class T >
void step_vector::add_value( long int from, long int to, T value )
{
if( from > to )
throw std::out_of_range( "Indices reversed in step_vector." );
if( to < max_index ) {
T next_value = (*this)[to+1];
m[ to + 1 ] = next_value;
}
typename std::map< long int, T>::iterator it = m.upper_bound( from );
it--;
bool need_to_insert_step_at_from = it->first < from;
T old_val_at_from;
if( need_to_insert_step_at_from ) {
old_val_at_from = it->second;
it++;
}
// Now, it points to the first element with it->first >= from
for( ; it != m.end() && it->first <= to; it++ )
it->second += value;
if( need_to_insert_step_at_from )
m[ from ] = old_val_at_from + value;
}
template< class T >
void step_vector::apply_to_values( long int from, long int to,
void (*func)( T & val ) )
{
if( from > to )
throw std::out_of_range( "Indices reversed in step_vector." );
if( to < max_index ) {
T next_value = (*this)[to+1];
m[ to + 1 ] = next_value;
}
typename std::map< long int, T>::iterator it = m.upper_bound( from );
it--;
bool need_to_insert_step_at_from = it->first < from;
T old_val_at_from;
if( need_to_insert_step_at_from ) {
old_val_at_from = it->second;
it++;
}
// Now, it points to the first element with it->first >= from
for( ; it != m.end() && it->first <= to; it++ )
func( it->second );
if( need_to_insert_step_at_from ) {
func( old_val_at_from );
m[ from ] = old_val_at_from;
}
}
template< class T >
typename step_vector::const_iterator step_vector::get_values( long int from ) const
{
return --m.upper_bound( from );
}
template< class T >
typename step_vector::const_iterator step_vector::begin( ) const
{
return m.begin();
}
template< class T >
typename step_vector::const_iterator step_vector::end( ) const
{
return m.end();
}
#endif //_STEP_VECTOR_H_
HTSeq-0.11.2/python3/src/_HTSeq.c 0000664 0000000 0000000 00010641437 13415006247 016223 0 ustar root root 0000000 0000000 /* Generated by Cython 0.29.2 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_2"
#define CYTHON_HEX_VERSION 0x001D02F0
#define CYTHON_FUTURE_DIVISION 1
#include
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
#if PY_VERSION_HEX >= 0x02070000
#define HAVE_LONG_LONG
#endif
#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#if PY_VERSION_HEX < 0x03050000
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#undef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 1
#undef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 0
#undef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#undef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 0
#undef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 0
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#undef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 0
#undef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 0
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#if PY_VERSION_HEX < 0x02070000
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
#define CYTHON_USE_PYTYPE_LOOKUP 1
#endif
#if PY_MAJOR_VERSION < 3
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#if PY_VERSION_HEX < 0x02070000
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#elif !defined(CYTHON_USE_PYLONG_INTERNALS)
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#ifndef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 1
#endif
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#if PY_VERSION_HEX < 0x030300F0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#elif !defined(CYTHON_USE_UNICODE_WRITER)
#define CYTHON_USE_UNICODE_WRITER 1
#endif
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#ifndef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 1
#endif
#ifndef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 1
#endif
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
#endif
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
#endif
#ifndef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
#endif
#ifndef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
#endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#undef SHIFT
#undef BASE
#undef MASK
#ifdef SIZEOF_VOID_P
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
#endif
#endif
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
#define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
#define CYTHON_RESTRICT __restrict__
#elif defined(_MSC_VER) && _MSC_VER >= 1400
#define CYTHON_RESTRICT __restrict
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_RESTRICT restrict
#else
#define CYTHON_RESTRICT
#endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
# if defined(__cplusplus)
template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
# else
# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
# define CYTHON_NCP_UNUSED
# else
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
#ifndef _MSC_STDINT_H_
#if _MSC_VER < 1300
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
#else
typedef unsigned __int8 uint8_t;
typedef unsigned __int32 uint32_t;
#endif
#endif
#else
#include
#endif
#ifndef CYTHON_FALLTHROUGH
#if defined(__cplusplus) && __cplusplus >= 201103L
#if __has_cpp_attribute(fallthrough)
#define CYTHON_FALLTHROUGH [[fallthrough]]
#elif __has_cpp_attribute(clang::fallthrough)
#define CYTHON_FALLTHROUGH [[clang::fallthrough]]
#elif __has_cpp_attribute(gnu::fallthrough)
#define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
#endif
#endif
#ifndef CYTHON_FALLTHROUGH
#if __has_attribute(fallthrough)
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
#else
#define CYTHON_FALLTHROUGH
#endif
#endif
#if defined(__clang__ ) && defined(__apple_build_version__)
#if __apple_build_version__ < 7000000
#undef CYTHON_FALLTHROUGH
#define CYTHON_FALLTHROUGH
#endif
#endif
#endif
#ifndef CYTHON_INLINE
#if defined(__clang__)
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
#elif defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#define __Pyx_DefaultClassType PyClass_Type
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
#define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
#ifndef METH_FASTCALL
#define METH_FASTCALL 0x80
#endif
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
Py_ssize_t nargs, PyObject *kwnames);
#else
#define __Pyx_PyCFunctionFast _PyCFunctionFast
#define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_USE_DICT_VERSIONS
#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
(version_var) = __PYX_GET_DICT_VERSION(dict);\
(cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
static PY_UINT64_T __pyx_dict_version = 0;\
static PyObject *__pyx_dict_cached_value = NULL;\
if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
(VAR) = __pyx_dict_cached_value;\
} else {\
(VAR) = __pyx_dict_cached_value = (LOOKUP);\
__pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
}\
}
#else
#define __PYX_GET_DICT_VERSION(dict) (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
#define PyObject_Malloc(s) PyMem_Malloc(s)
#define PyObject_Free(p) PyMem_Free(p)
#define PyObject_Realloc(p) PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
#define PyMem_RawMalloc(n) PyMem_Malloc(n)
#define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
#define PyMem_RawFree(p) PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
#define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
#define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
#define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
#define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
*key = PyThread_create_key();
return 0; // PyThread_create_key reports success always
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
*key = Py_tss_NEEDS_INIT;
return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
PyThread_delete_key(*key);
*key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
return PyThread_get_key_value(*key);
}
#endif // TSS (Thread Specific Storage) API
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n) PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
#define PyUnicode_1BYTE_KIND 1
#define PyUnicode_2BYTE_KIND 2
#define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
#else
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
#define PyObject_ASCII(o) PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
#define PyObject_Unicode PyObject_Str
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
#define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
#define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
#else
#define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
#define PyInt_FromString PyLong_FromString
#define PyInt_FromUnicode PyLong_FromUnicode
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#define PyNumber_Int PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBoolObject PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
#ifndef PyUnicode_InternFromString
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#endif
#if PY_VERSION_HEX < 0x030200A4
typedef long Py_hash_t;
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
#define __Pyx_PyInt_AsHash_t PyInt_AsLong
#else
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
#else
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
typedef struct {
unaryfunc am_await;
unaryfunc am_aiter;
unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#endif
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
float value;
memset(&value, 0xFF, sizeof(value));
return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
__pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}
#ifndef __PYX_EXTERN_C
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#endif
#define __PYX_HAVE__HTSeq___HTSeq
#define __PYX_HAVE_API__HTSeq___HTSeq
/* Early includes */
#include
#include
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#ifdef _OPENMP
#include
#endif /* _OPENMP */
#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
(sizeof(type) < sizeof(Py_ssize_t)) ||\
(sizeof(type) > sizeof(Py_ssize_t) &&\
likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX) &&\
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
v == (type)PY_SSIZE_T_MIN))) ||\
(sizeof(type) == sizeof(Py_ssize_t) &&\
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
#include
#define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
#define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
#define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
#define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
#define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
const Py_UNICODE *u_end = u;
while (*u_end++) ;
return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
PyObject* sys;
PyObject* default_encoding = NULL;
PyObject* ascii_chars_u = NULL;
PyObject* ascii_chars_b = NULL;
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
if (!default_encoding_c) goto bad;
if (strcmp(default_encoding_c, "ascii") == 0) {
__Pyx_sys_getdefaultencoding_not_ascii = 0;
} else {
char ascii_chars[128];
int c;
for (c = 0; c < 128; c++) {
ascii_chars[c] = c;
}
__Pyx_sys_getdefaultencoding_not_ascii = 1;
ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
if (!ascii_chars_u) goto bad;
ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
PyErr_Format(
PyExc_ValueError,
"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
default_encoding_c);
goto bad;
}
Py_DECREF(ascii_chars_u);
Py_DECREF(ascii_chars_b);
}
Py_DECREF(default_encoding);
return 0;
bad:
Py_XDECREF(default_encoding);
Py_XDECREF(ascii_chars_u);
Py_XDECREF(ascii_chars_b);
return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
PyObject* sys;
PyObject* default_encoding = NULL;
char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
if (!default_encoding_c) goto bad;
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
Py_DECREF(default_encoding);
return 0;
bad:
Py_XDECREF(default_encoding);
return -1;
}
#endif
#endif
/* Test for GCC > 2.95 */
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
#if defined(__cplusplus)
#define CYTHON_CCOMPLEX 1
#elif defined(_Complex_I)
#define CYTHON_CCOMPLEX 1
#else
#define CYTHON_CCOMPLEX 0
#endif
#endif
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
#include
#else
#include
#endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
#undef _Complex_I
#define _Complex_I 1.0fj
#endif
static const char *__pyx_f[] = {
"python3/src/HTSeq/_HTSeq.pyx",
"python3/src/HTSeq/_HTSeq.pxd",
"stringsource",
"__init__.pxd",
"type.pxd",
};
/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
const char* name;
struct __Pyx_StructField_* fields;
size_t size;
size_t arraysize[8];
int ndim;
char typegroup;
char is_unsigned;
int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
__Pyx_TypeInfo* type;
const char* name;
size_t offset;
} __Pyx_StructField;
typedef struct {
__Pyx_StructField* field;
size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
__Pyx_StructField root;
__Pyx_BufFmt_StackElem* head;
size_t fmt_offset;
size_t new_count, enc_count;
size_t struct_alignment;
int is_complex;
char enc_type;
char new_packmode;
char enc_packmode;
char is_valid_array;
} __Pyx_BufFmt_Context;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
* # in Cython to enable them only on the right systems.
*
* ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
*/
typedef npy_int8 __pyx_t_5numpy_int8_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
*
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t
*/
typedef npy_int16 __pyx_t_5numpy_int16_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
* ctypedef npy_int64 int64_t
* #ctypedef npy_int96 int96_t
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
* #ctypedef npy_int96 int96_t
* #ctypedef npy_int128 int128_t
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
* #ctypedef npy_int128 int128_t
*
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
*
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t
*/
typedef npy_uint16 __pyx_t_5numpy_uint16_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
* ctypedef npy_uint64 uint64_t
* #ctypedef npy_uint96 uint96_t
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
* #ctypedef npy_uint96 uint96_t
* #ctypedef npy_uint128 uint128_t
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
* #ctypedef npy_uint128 uint128_t
*
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
* ctypedef npy_float64 float64_t
* #ctypedef npy_float80 float80_t
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
*
* ctypedef npy_float32 float32_t
* ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
* #ctypedef npy_float80 float80_t
* #ctypedef npy_float128 float128_t
*/
typedef npy_float64 __pyx_t_5numpy_float64_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":800
* # The int types are mapped a bit surprising --
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t # <<<<<<<<<<<<<<
* ctypedef npy_longlong long_t
* ctypedef npy_longlong longlong_t
*/
typedef npy_long __pyx_t_5numpy_int_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
* ctypedef npy_longlong longlong_t
*
*/
typedef npy_longlong __pyx_t_5numpy_long_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
*
* ctypedef npy_ulong uint_t
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
* ctypedef npy_longlong longlong_t
*
* ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
* ctypedef npy_ulonglong ulong_t
* ctypedef npy_ulonglong ulonglong_t
*/
typedef npy_ulong __pyx_t_5numpy_uint_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
*
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
* ctypedef npy_ulonglong ulonglong_t
*
*/
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
*
* ctypedef npy_intp intp_t
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":808
* ctypedef npy_ulonglong ulonglong_t
*
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
* ctypedef npy_uintp uintp_t
*
*/
typedef npy_intp __pyx_t_5numpy_intp_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
*
* ctypedef npy_intp intp_t
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
*
* ctypedef npy_double float_t
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":811
* ctypedef npy_uintp uintp_t
*
* ctypedef npy_double float_t # <<<<<<<<<<<<<<
* ctypedef npy_double double_t
* ctypedef npy_longdouble longdouble_t
*/
typedef npy_double __pyx_t_5numpy_float_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
*
* ctypedef npy_double float_t
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
* ctypedef npy_longdouble longdouble_t
*
*/
typedef npy_double __pyx_t_5numpy_double_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
* ctypedef npy_double float_t
* ctypedef npy_double double_t
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
*
* ctypedef npy_cfloat cfloat_t
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< float > __pyx_t_float_complex;
#else
typedef float _Complex __pyx_t_float_complex;
#endif
#else
typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< double > __pyx_t_double_complex;
#else
typedef double _Complex __pyx_t_double_complex;
#endif
#else
typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
/*--- Type declarations ---*/
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition;
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities;
struct __pyx_obj_5HTSeq_6_HTSeq_Alignment;
struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment;
struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray;
struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment;
struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation;
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
* ctypedef npy_longdouble longdouble_t
*
* ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
* ctypedef npy_cdouble cdouble_t
* ctypedef npy_clongdouble clongdouble_t
*/
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
*
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
* ctypedef npy_clongdouble clongdouble_t
*
*/
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":817
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t
* ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
*
* ctypedef npy_cdouble complex_t
*/
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":819
* ctypedef npy_clongdouble clongdouble_t
*
* ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
*
* cdef inline object PyArray_MultiIterNew1(a):
*/
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement;
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end;
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end;
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals;
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals;
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement;
struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar;
struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list;
struct __pyx_opt_args_5HTSeq_6_HTSeq_quotesafe_split;
/* "HTSeq/_HTSeq.pxd":23
* cdef public str name
* cdef public str descr
* cpdef Sequence get_reverse_complement(self, bint rename=?) # <<<<<<<<<<<<<<
* cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_)
* cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=?)
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement {
int __pyx_n;
int rename;
};
/* "HTSeq/_HTSeq.pxd":25
* cpdef Sequence get_reverse_complement(self, bint rename=?)
* cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_)
* cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=?) # <<<<<<<<<<<<<<
* cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=?)
*
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end {
int __pyx_n;
float mismatch_prop;
};
/* "HTSeq/_HTSeq.pxd":26
* cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_)
* cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=?)
* cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=?) # <<<<<<<<<<<<<<
*
*
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end {
int __pyx_n;
float mismatch_prop;
};
/* "HTSeq/_HTSeq.pxd":36
* cdef _fill_qual_arr(SequenceWithQualities self)
* cpdef object add_qual_to_count_array(SequenceWithQualities self, numpy.ndarray count_array_)
* cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self, # <<<<<<<<<<<<<<
* Sequence pattern, int max_mm_qual=?)
* cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self,
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals {
int __pyx_n;
int max_mm_qual;
};
/* "HTSeq/_HTSeq.pxd":38
* cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,
* Sequence pattern, int max_mm_qual=?)
* cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self, # <<<<<<<<<<<<<<
* Sequence pattern, int max_mm_qual=?)
*
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals {
int __pyx_n;
int max_mm_qual;
};
/* "HTSeq/_HTSeq.pyx":906
* return sio.getvalue()
*
* cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True): # <<<<<<<<<<<<<<
* cdef SequenceWithQualities res
* if rename:
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement {
int __pyx_n;
int rename;
};
/* "HTSeq/_HTSeq.pyx":1162
* _re_cigar_codes = re.compile('([MIDNSHP=X])')
*
* cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."): # <<<<<<<<<<<<<<
* cdef list split_cigar, cl
* cdef int size
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar {
int __pyx_n;
int ref_left;
PyObject *chrom;
PyObject *strand;
};
/* "HTSeq/_HTSeq.pyx":1179
* return build_cigar_list(cl, ref_left, chrom, strand)
*
* cpdef list build_cigar_list(list cigar_pairs, int ref_left=0, str chrom="", str strand="."): # <<<<<<<<<<<<<<
* cdef list split_cigar, res
* cdef int rpos, qpos, size
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list {
int __pyx_n;
int ref_left;
PyObject *chrom;
PyObject *strand;
};
/* "HTSeq/_HTSeq.pyx":1576
* ###########################
*
* cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'): # <<<<<<<<<<<<<<
* cdef list l = []
* cdef int i = 0
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_quotesafe_split {
int __pyx_n;
PyObject *split;
PyObject *quote;
};
/* "HTSeq/_HTSeq.pxd":3
* cimport numpy
*
* cdef class GenomicInterval: # <<<<<<<<<<<<<<
*
* cdef public str chrom
*/
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval {
PyObject_HEAD
struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *__pyx_vtab;
PyObject *chrom;
long start;
long end;
PyObject *_strand;
};
/* "HTSeq/_HTSeq.pxd":15
* cpdef extend_to_include(GenomicInterval self, GenomicInterval iv)
*
* cdef class GenomicPosition( GenomicInterval ): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition {
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval __pyx_base;
};
/* "HTSeq/_HTSeq.pxd":19
*
*
* cdef class Sequence(object): # <<<<<<<<<<<<<<
* cdef public bytes seq
* cdef public str name
*/
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence {
PyObject_HEAD
struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence *__pyx_vtab;
PyObject *seq;
PyObject *name;
PyObject *descr;
};
/* "HTSeq/_HTSeq.pxd":29
*
*
* cdef class SequenceWithQualities(Sequence): # <<<<<<<<<<<<<<
* cdef readonly bytes _qualstr
* cdef readonly bytes _qualstr_phred
*/
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities {
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence __pyx_base;
PyObject *_qualstr;
PyObject *_qualstr_phred;
PyObject *_qualscale;
PyObject *_qualarr;
};
/* "HTSeq/_HTSeq.pxd":42
*
*
* cdef class Alignment(object): # <<<<<<<<<<<<<<
* cdef public SequenceWithQualities _read
* cdef public GenomicInterval iv
*/
struct __pyx_obj_5HTSeq_6_HTSeq_Alignment {
PyObject_HEAD
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *_read;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *iv;
};
/* "HTSeq/_HTSeq.pxd":46
* cdef public GenomicInterval iv
*
* cdef class AlignmentWithSequenceReversal(Alignment): # <<<<<<<<<<<<<<
* cdef public SequenceWithQualities read_as_aligned
* cdef public SequenceWithQualities _read_as_sequenced
*/
struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal {
struct __pyx_obj_5HTSeq_6_HTSeq_Alignment __pyx_base;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *read_as_aligned;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *_read_as_sequenced;
};
/* "HTSeq/_HTSeq.pxd":50
* cdef public SequenceWithQualities _read_as_sequenced
*
* cdef class SAM_Alignment(AlignmentWithSequenceReversal): # <<<<<<<<<<<<<<
* cdef public list cigar
* cdef public int aQual
*/
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment {
struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal __pyx_base;
PyObject *cigar;
int aQual;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *mate_start;
PyObject *pe_which;
int inferred_insert_size;
int proper_pair;
int not_primary_alignment;
int failed_platform_qc;
int pcr_or_optical_duplicate;
int supplementary;
PyObject *original_sam_line;
int _flag;
PyObject *optional_fields;
};
/* "HTSeq/_HTSeq.pyx":318
*
*
* cdef class ChromVector(object): # <<<<<<<<<<<<<<
*
* cdef public object array
*/
struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector {
PyObject_HEAD
PyObject *array;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *iv;
int offset;
int is_vector_of_sets;
PyObject *_storage;
};
/* "HTSeq/_HTSeq.pyx":486
* return cv
*
* cdef class GenomicArray(object): # <<<<<<<<<<<<<<
*
* cdef public dict chrom_vectors
*/
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray {
PyObject_HEAD
PyObject *chrom_vectors;
int stranded;
PyObject *typecode;
int auto_add_chroms;
PyObject *storage;
PyObject *memmap_dir;
};
/* "HTSeq/_HTSeq.pyx":1082
*
*
* cdef class BowtieAlignment(AlignmentWithSequenceReversal): # <<<<<<<<<<<<<<
*
* """When reading in a Bowtie file, objects of the class BowtieAlignment
*/
struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment {
struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal __pyx_base;
PyObject *reserved;
PyObject *substitutions;
};
/* "HTSeq/_HTSeq.pyx":1118
* 'X': 'sequence-mismatched'}
*
* cdef class CigarOperation(object): # <<<<<<<<<<<<<<
*
* cdef public str type
*/
struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation {
PyObject_HEAD
PyObject *type;
int size;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *ref_iv;
int query_from;
int query_to;
};
/* "HTSeq/_HTSeq.pyx":442
* raise TypeError, "Illegal index type"
*
* def __iadd__(self, value): # <<<<<<<<<<<<<<
* if not self.is_vector_of_sets:
* self.array[self.iv.start - self.offset: self.iv.end -
*/
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ {
PyObject_HEAD
PyObject *__pyx_v_value;
};
/* "HTSeq/_HTSeq.pyx":29
* cdef str strand_nostrand = intern(".")
*
* cdef class GenomicInterval: # <<<<<<<<<<<<<<
*
* """A GenomicInterval specifies an interval (i.e., a range of
*/
struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval {
PyObject *(*is_contained_in)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch);
PyObject *(*contains)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch);
PyObject *(*overlaps)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch);
PyObject *(*extend_to_include)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *__pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval;
/* "HTSeq/_HTSeq.pyx":261
*
*
* cdef class GenomicPosition(GenomicInterval): # <<<<<<<<<<<<<<
*
* """A GenomicPosition specifies the position of a nucleotide or
*/
struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicPosition {
struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval __pyx_base;
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicPosition *__pyx_vtabptr_5HTSeq_6_HTSeq_GenomicPosition;
/* "HTSeq/_HTSeq.pyx":639
* base_to_column = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'N': 4}
*
* cdef class Sequence(object): # <<<<<<<<<<<<<<
* """A Sequence, typically of DNA, with a name.
* """
*/
struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence {
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*get_reverse_complement)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement *__pyx_optional_args);
PyObject *(*add_bases_to_count_array)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, PyArrayObject *, int __pyx_skip_dispatch);
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*trim_left_end)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end *__pyx_optional_args);
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*trim_right_end)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end *__pyx_optional_args);
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence *__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence;
/* "HTSeq/_HTSeq.pyx":789
*
*
* cdef class SequenceWithQualities(Sequence): # <<<<<<<<<<<<<<
* """A Sequence with base-call quality scores.
* It now has property 'qual', an integer NumPy array of Sanger/Phred
*/
struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities {
struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence __pyx_base;
PyObject *(*_fill_qual_arr)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *);
PyObject *(*add_qual_to_count_array)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, PyArrayObject *, int __pyx_skip_dispatch);
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*trim_left_end_with_quals)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals *__pyx_optional_args);
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*trim_right_end_with_quals)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals *__pyx_optional_args);
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*get_reverse_complement)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args);
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities;
/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, int);
void (*DECREF)(void*, PyObject*, int);
void (*GOTREF)(void*, PyObject*, int);
void (*GIVEREF)(void*, PyObject*, int);
void* (*SetupContext)(const char*, int, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
if (acquire_gil) {\
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
PyGILState_Release(__pyx_gilstate_save);\
} else {\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
}
#else
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
#define __Pyx_RefNannyFinishContext()\
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
#define __Pyx_RefNannyDeclarations
#define __Pyx_RefNannySetupContext(name, acquire_gil)
#define __Pyx_RefNannyFinishContext()
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_DECREF(r) Py_DECREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_XINCREF(r) Py_XINCREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#define __Pyx_XGOTREF(r)
#define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; __Pyx_XDECREF(tmp);\
} while (0)
#define __Pyx_DECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; __Pyx_DECREF(tmp);\
} while (0)
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
__Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
/* Intern.proto */
static PyObject* __Pyx_Intern(PyObject* s);
/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif
/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred() PyErr_Occurred()
#endif
/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
#endif
/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
(sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
static size_t __pyx_pyframe_localsplus_offset = 0;
#include "frameobject.h"
#define __Pxy_PyFrame_Initialize_Offsets()\
((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
(void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
#define __Pyx_PyFrame_GetLocalsplus(frame)\
(assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif
/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif
/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
#endif
/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
/* PyUnicode_Unicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj);
/* BuildPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
int prepend_sign, char padding_char);
/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char);
/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name) {\
static PY_UINT64_T __pyx_dict_version = 0;\
static PyObject *__pyx_dict_cached_value = NULL;\
(var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
(likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
__Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name) {\
PY_UINT64_T __pyx_dict_version;\
PyObject *__pyx_dict_cached_value;\
(var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif
/* IncludeStringH.proto */
#include
/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
Py_UCS4 max_char);
/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif
/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
__Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
(is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list, int wraparound, int boundscheck);
/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
#define __Pyx_CyFunction_GetClosure(f)\
(((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
(((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
PyObject *func_weakreflist;
#endif
PyObject *func_dict;
PyObject *func_name;
PyObject *func_qualname;
PyObject *func_doc;
PyObject *func_globals;
PyObject *func_code;
PyObject *func_closure;
PyObject *func_classobj;
void *defaults;
int defaults_pyobjects;
int flags;
PyObject *defaults_tuple;
PyObject *defaults_kwdict;
PyObject *(*defaults_getter)(PyObject *);
PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
__Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
int flags, PyObject* qualname,
PyObject *self,
PyObject *module, PyObject *globals,
PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
size_t size,
int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
static int __pyx_CyFunction_init(void);
/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
if (likely(L->allocated > len)) {
Py_INCREF(x);
PyList_SET_ITEM(list, len, x);
Py_SIZE(list) = len+1;
return 0;
}
return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif
/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
#else
#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
#endif
/* PyDictContains.proto */
static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
int result = PyDict_Contains(dict, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
(likely(PyDict_CheckExact(obj)) ?\
__Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
#endif
/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
/* UnpackTuple2.proto */
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
(likely(is_tuple || PyTuple_Check(tuple)) ?\
(likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
__Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
(__Pyx_UnpackTupleError(tuple, 2), -1)) :\
__Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
(inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif
/* decode_c_string_utf16.proto */
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
int byteorder = 0;
return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
int byteorder = -1;
return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
int byteorder = 1;
return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
/* decode_c_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
PyObject* string, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
return __Pyx_decode_c_bytes(
PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
start, stop, encoding, errors, decode_func);
}
/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
/* unicode_tailmatch.proto */
static int __Pyx_PyUnicode_Tailmatch(
PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction);
/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
(inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif
/* IsLittleEndian.proto */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
/* BufferFormatCheck.proto */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
__Pyx_BufFmt_StackElem* stack,
__Pyx_TypeInfo* type);
/* BufferGetAndValidate.proto */
#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
((obj == Py_None || obj == NULL) ?\
(__Pyx_ZeroBuffer(buf), 0) :\
__Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
__Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static void __Pyx_ZeroBuffer(Py_buffer* buf);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);
#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
/* BufferFallbackError.proto */
static void __Pyx_RaiseBufferFallbackError(void);
/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
#endif
/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
/* None.proto */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t);
/* None.proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif
/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
#endif
/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif
/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
Py_INCREF(x);
PyList_SET_ITEM(list, len, x);
Py_SIZE(list) = len+1;
return 0;
}
return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
/* GetItemIntUnicode.proto */
#define __Pyx_GetItemInt_Unicode(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Unicode_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "string index out of range"), (Py_UCS4)-1))
static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i,
int wraparound, int boundscheck);
/* PyUnicode_Substring.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
PyObject* text, Py_ssize_t start, Py_ssize_t stop);
/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
/* bytes_index.proto */
static CYTHON_INLINE char __Pyx_PyBytes_GetItemInt(PyObject* bytes, Py_ssize_t index, int check_bounds);
/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
/* CallNextTpTraverse.proto */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
/* CallNextTpClear.proto */
static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif
/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif
/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);
/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
__Pyx_ImportType_CheckSize_Error = 0,
__Pyx_ImportType_CheckSize_Warn = 1,
__Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif
/* ClassMethod.proto */
#include "descrobject.h"
static PyObject* __Pyx_Method_ClassMethod(PyObject *method);
/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);
/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif
/* CodeObjectCache.proto */
typedef struct {
PyCodeObject* code_object;
int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
int max_count;
__Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
size_t refcount;
Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
__Pyx_Buffer *rcbuffer;
char *data;
__Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;
#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
#define __Pyx_GetBuffer PyObject_GetBuffer
#define __Pyx_ReleaseBuffer PyBuffer_Release
#endif
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
/* None.proto */
static CYTHON_INLINE long __Pyx_pow_long(long, long);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
/* RealImag.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
#define __Pyx_CREAL(z) ((z).real())
#define __Pyx_CIMAG(z) ((z).imag())
#else
#define __Pyx_CREAL(z) (__real__(z))
#define __Pyx_CIMAG(z) (__imag__(z))
#endif
#else
#define __Pyx_CREAL(z) ((z).real)
#define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
&& (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
#define __Pyx_SET_CREAL(z,x) ((z).real(x))
#define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
#define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
#define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif
/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
#define __Pyx_c_eq_float(a, b) ((a)==(b))
#define __Pyx_c_sum_float(a, b) ((a)+(b))
#define __Pyx_c_diff_float(a, b) ((a)-(b))
#define __Pyx_c_prod_float(a, b) ((a)*(b))
#define __Pyx_c_quot_float(a, b) ((a)/(b))
#define __Pyx_c_neg_float(a) (-(a))
#ifdef __cplusplus
#define __Pyx_c_is_zero_float(z) ((z)==(float)0)
#define __Pyx_c_conj_float(z) (::std::conj(z))
#if 1
#define __Pyx_c_abs_float(z) (::std::abs(z))
#define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
#endif
#else
#define __Pyx_c_is_zero_float(z) ((z)==0)
#define __Pyx_c_conj_float(z) (conjf(z))
#if 1
#define __Pyx_c_abs_float(z) (cabsf(z))
#define __Pyx_c_pow_float(a, b) (cpowf(a, b))
#endif
#endif
#else
static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
#if 1
static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
#endif
#endif
/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
#define __Pyx_c_eq_double(a, b) ((a)==(b))
#define __Pyx_c_sum_double(a, b) ((a)+(b))
#define __Pyx_c_diff_double(a, b) ((a)-(b))
#define __Pyx_c_prod_double(a, b) ((a)*(b))
#define __Pyx_c_quot_double(a, b) ((a)/(b))
#define __Pyx_c_neg_double(a) (-(a))
#ifdef __cplusplus
#define __Pyx_c_is_zero_double(z) ((z)==(double)0)
#define __Pyx_c_conj_double(z) (::std::conj(z))
#if 1
#define __Pyx_c_abs_double(z) (::std::abs(z))
#define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
#endif
#else
#define __Pyx_c_is_zero_double(z) ((z)==0)
#define __Pyx_c_conj_double(z) (conj(z))
#if 1
#define __Pyx_c_abs_double(z) (cabs(z))
#define __Pyx_c_pow_double(a, b) (cpow(a, b))
#endif
#endif
#else
static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
#if 1
static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
#endif
#endif
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_is_contained_in(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_contains(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_overlaps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_extend_to_include(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_8Sequence_add_bases_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyArrayObject *__pyx_v_count_array_, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_left_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end *__pyx_optional_args); /* proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_right_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities__fill_qual_arr(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto*/
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args); /* proto*/
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement__pyx_wrap_1(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_add_qual_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyArrayObject *__pyx_v_count_array_, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals *__pyx_optional_args); /* proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals *__pyx_optional_args); /* proto*/
/* Module declarations from 'cpython.buffer' */
/* Module declarations from 'libc.string' */
/* Module declarations from 'libc.stdio' */
/* Module declarations from '__builtin__' */
/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
/* Module declarations from 'cpython' */
/* Module declarations from 'cpython.object' */
/* Module declarations from 'cpython.ref' */
/* Module declarations from 'cpython.mem' */
/* Module declarations from 'numpy' */
/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
/* Module declarations from 'HTSeq._HTSeq' */
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_Sequence = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_Alignment = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_ChromVector = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ = 0;
static PyObject *__pyx_v_5HTSeq_6_HTSeq_strand_plus = 0;
static PyObject *__pyx_v_5HTSeq_6_HTSeq_strand_minus = 0;
static PyObject *__pyx_v_5HTSeq_6_HTSeq_strand_nostrand = 0;
static PyObject *__pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation = 0;
static PyObject *__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i;
static PyObject *__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x;
static PyObject *__pyx_f_5HTSeq_6_HTSeq_reverse_complement(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_parse_cigar(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_build_cigar_list(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq__parse_SAM_optional_field_value(PyObject *); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_quotesafe_split(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_quotesafe_split *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_Alignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *, PyObject *); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_AlignmentWithSequenceReversal__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *, PyObject *); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_BowtieAlignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *, PyObject *); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_CigarOperation__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *, PyObject *); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_SAM_Alignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *, PyObject *); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
#define __Pyx_MODULE_NAME "HTSeq._HTSeq"
extern int __pyx_module_is_main_HTSeq___HTSeq;
int __pyx_module_is_main_HTSeq___HTSeq = 0;
/* Implementation of 'HTSeq._HTSeq' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_RuntimeError;
static const char __pyx_k_A[] = "A";
static const char __pyx_k_C[] = "C";
static const char __pyx_k_D[] = "D";
static const char __pyx_k_G[] = "G";
static const char __pyx_k_H[] = "H";
static const char __pyx_k_I[] = "I";
static const char __pyx_k_M[] = "M";
static const char __pyx_k_N[] = "N";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_P[] = "P";
static const char __pyx_k_S[] = "S";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_X[] = "X";
static const char __pyx_k_Z[] = "Z";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_j[] = "j";
static const char __pyx_k_s[] = ">%s\n";
static const char __pyx_k_w[] = "w+";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k__2[] = "<";
static const char __pyx_k__3[] = "', [";
static const char __pyx_k__4[] = ",";
static const char __pyx_k__5[] = "'>";
static const char __pyx_k__6[] = ":[";
static const char __pyx_k__7[] = ")/";
static const char __pyx_k__8[] = ".";
static const char __pyx_k__9[] = "':";
static const char __pyx_k_cv[] = "cv";
static const char __pyx_k_ga[] = "ga";
static const char __pyx_k_iv[] = "iv";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_re[] = "re";
static const char __pyx_k_se[] = "se";
static const char __pyx_k_Inf[] = "Inf";
static const char __pyx_k__10[] = ":";
static const char __pyx_k__11[] = "/";
static const char __pyx_k__12[] = "";
static const char __pyx_k__16[] = ", ";
static const char __pyx_k__17[] = ">";
static const char __pyx_k__19[] = "+";
static const char __pyx_k__20[] = "-";
static const char __pyx_k__21[] = "\t";
static const char __pyx_k__22[] = "\n";
static const char __pyx_k__25[] = ")>";
static const char __pyx_k__26[] = " ";
static const char __pyx_k__27[] = "@";
static const char __pyx_k__28[] = "+\n";
static const char __pyx_k__29[] = " '";
static const char __pyx_k__30[] = "< ";
static const char __pyx_k__31[] = ": ";
static const char __pyx_k__32[] = ") >";
static const char __pyx_k__33[] = "=";
static const char __pyx_k__34[] = "*";
static const char __pyx_k__39[] = ";";
static const char __pyx_k__40[] = "\"";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_csv[] = "csv";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_nmm[] = ".nmm";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_qto[] = "qto";
static const char __pyx_k_rto[] = "rto";
static const char __pyx_k_s_2[] = "@%s\n";
static const char __pyx_k_s_3[] = "s";
static const char __pyx_k_seq[] = "seq";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tid[] = "tid";
static const char __pyx_k_vec[] = "vec";
static const char __pyx_k_w_2[] = "w";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_Read[] = "Read";
static const char __pyx_k_aend[] = "aend";
static const char __pyx_k_auto[] = "auto";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_flag[] = "flag";
static const char __pyx_k_gzip[] = "gzip";
static const char __pyx_k_iadd[] = "__iadd__";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mapq[] = "mapq";
static const char __pyx_k_math[] = "math";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_mpos[] = "mpos";
static const char __pyx_k_mrnm[] = "mrnm";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_none[] = "none";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_part[] = "[part]";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_qual[] = "qual";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_tags[] = "tags";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_type[] = "type_";
static const char __pyx_k_HTSeq[] = "HTSeq";
static const char __pyx_k_apply[] = "apply";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_check[] = "check";
static const char __pyx_k_chrom[] = "chrom";
static const char __pyx_k_cigar[] = "cigar";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_descr[] = "descr";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_end_d[] = "end_d";
static const char __pyx_k_first[] = "first";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_isize[] = "isize";
static const char __pyx_k_log10[] = "log10";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_phred[] = "phred";
static const char __pyx_k_pysam[] = "pysam";
static const char __pyx_k_qfrom[] = "qfrom";
static const char __pyx_k_qname[] = "qname";
static const char __pyx_k_quote[] = "quote";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_rfrom[] = "rfrom";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_steps[] = "steps";
static const char __pyx_k_uint8[] = "uint8";
static const char __pyx_k_upper[] = "upper";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_addval[] = "addval";
static const char __pyx_k_base_s[] = " base(s) ";
static const char __pyx_k_chroms[] = "chroms";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_gettid[] = "gettid";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_memmap[] = "memmap";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_object[] = " object '";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_padded[] = "padded";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_ref_iv[] = "ref_iv";
static const char __pyx_k_rename[] = "rename";
static const char __pyx_k_rstrip[] = "rstrip";
static const char __pyx_k_second[] = "second";
static const char __pyx_k_solexa[] = "solexa";
static const char __pyx_k_stderr[] = "stderr";
static const char __pyx_k_strand[] = "strand";
static const char __pyx_k_type_2[] = "type";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_aligned[] = "aligned";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_deleted[] = "deleted";
static const char __pyx_k_matched[] = "matched";
static const char __pyx_k_maxsize[] = "maxsize";
static const char __pyx_k_missing[] = "missing";
static const char __pyx_k_ndarray[] = "ndarray";
static const char __pyx_k_noquals[] = "noquals";
static const char __pyx_k_pattern[] = "pattern";
static const char __pyx_k_qualstr[] = "qualstr";
static const char __pyx_k_samfile[] = "samfile";
static const char __pyx_k_skipped[] = "skipped";
static const char __pyx_k_start_d[] = "start_d";
static const char __pyx_k_storage[] = "storage";
static const char __pyx_k_unknown[] = "unknown";
static const char __pyx_k_unnamed[] = "unnamed";
static const char __pyx_k_ACGTacgt[] = "ACGTacgt";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_Sequence[] = "Sequence";
static const char __pyx_k_StringIO[] = "StringIO";
static const char __pyx_k_TGCAtgca[] = "TGCAtgca";
static const char __pyx_k_contains[] = "contains";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_getrname[] = "getrname";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_getvalue[] = "getvalue";
static const char __pyx_k_inserted[] = "inserted";
static const char __pyx_k_is_read1[] = "is_read1";
static const char __pyx_k_is_read2[] = "is_read2";
static const char __pyx_k_length_2[] = "' (length ";
static const char __pyx_k_object_2[] = " object, ";
static const char __pyx_k_object_3[] = " object: ";
static const char __pyx_k_overlaps[] = "overlaps";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_query_iv[] = ", query iv [";
static const char __pyx_k_ref_left[] = "ref_left";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_strand_2[] = "), strand '";
static const char __pyx_k_strand_3[] = ", strand '";
static const char __pyx_k_stranded[] = "stranded";
static const char __pyx_k_typecode[] = "typecode";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_Alignment[] = "Alignment";
static const char __pyx_k_MIDNSHP_X[] = "([MIDNSHP=X])";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_add_chrom[] = "add_chrom";
static const char __pyx_k_cStringIO[] = "cStringIO";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_is_paired[] = "is_paired";
static const char __pyx_k_is_qcfail[] = "is_qcfail";
static const char __pyx_k_itertools[] = "itertools";
static const char __pyx_k_maketrans[] = "maketrans";
static const char __pyx_k_on_ref_iv[] = " on ref iv ";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_qualscale[] = "qualscale";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_storage_2[] = "_storage";
static const char __pyx_k_translate[] = "translate";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_StepVector[] = "StepVector";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_aligned_to[] = "' aligned to ";
static const char __pyx_k_fasta_file[] = "fasta_file";
static const char __pyx_k_is_reverse[] = "is_reverse";
static const char __pyx_k_memmap_dir[] = "memmap_dir";
static const char __pyx_k_paired_end[] = "paired_end";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_query_name[] = "query_name";
static const char __pyx_k_revcomp_of[] = "revcomp_of_";
static const char __pyx_k_solexa_old[] = "solexa-old";
static const char __pyx_k_AlignedRead[] = "AlignedRead";
static const char __pyx_k_ChromVector[] = "ChromVector";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_bowtie_line[] = "bowtie_line";
static const char __pyx_k_cigar_pairs[] = "cigar_pairs";
static const char __pyx_k_cigartuples[] = "cigartuples";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_create_view[] = "_create_view";
static const char __pyx_k_is_unmapped[] = "is_unmapped";
static const char __pyx_k_max_mm_qual[] = "max_mm_qual";
static const char __pyx_k_not_aligned[] = "', not aligned>";
static const char __pyx_k_start_index[] = "start_index";
static const char __pyx_k_GenomicArray[] = "GenomicArray";
static const char __pyx_k_HTSeq__HTSeq[] = "HTSeq._HTSeq";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_cigar_string[] = "cigar_string";
static const char __pyx_k_hard_clipped[] = "hard-clipped";
static const char __pyx_k_is_duplicate[] = "is_duplicate";
static const char __pyx_k_is_secondary[] = "is_secondary";
static const char __pyx_k_mate_aligned[] = "mate_aligned";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_reference_id[] = "reference_id";
static const char __pyx_k_soft_clipped[] = "soft-clipped";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_SAM_Alignment[] = "SAM_Alignment";
static const char __pyx_k_chrom_vectors[] = "chrom_vectors";
static const char __pyx_k_from_SAM_line[] = "from_SAM_line";
static const char __pyx_k_mismatch_prop[] = "mismatch_prop";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_reference_end[] = "reference_end";
static const char __pyx_k_track_options[] = "track_options";
static const char __pyx_k_trim_left_end[] = "trim_left_end";
static const char __pyx_k_AlignedSegment[] = "AlignedSegment";
static const char __pyx_k_CigarOperation[] = "CigarOperation";
static const char __pyx_k_HTSeq_internal[] = "_HTSeq_internal";
static const char __pyx_k_base_to_column[] = "base_to_column";
static const char __pyx_k_is_proper_pair[] = "is_proper_pair";
static const char __pyx_k_not_paired_end[] = "not_paired_end";
static const char __pyx_k_query_sequence[] = "query_sequence";
static const char __pyx_k_re_cigar_codes[] = "_re_cigar_codes";
static const char __pyx_k_stop_too_large[] = "stop too large";
static const char __pyx_k_trim_right_end[] = "trim_right_end";
static const char __pyx_k_BowtieAlignment[] = "BowtieAlignment";
static const char __pyx_k_GenomicInterval[] = "GenomicInterval";
static const char __pyx_k_GenomicPosition[] = "GenomicPosition";
static const char __pyx_k_Paired_end_read[] = "Paired-end read";
static const char __pyx_k_Strand_mismatch[] = "Strand mismatch.";
static const char __pyx_k_is_contained_in[] = "is_contained_in";
static const char __pyx_k_mapping_quality[] = "mapping_quality";
static const char __pyx_k_mate_is_reverse[] = "mate_is_reverse";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_query_qualities[] = "query_qualities";
static const char __pyx_k_read_as_aligned[] = "read_as_aligned";
static const char __pyx_k_reference_start[] = "reference_start";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_start_too_small[] = "start too small";
static const char __pyx_k_template_length[] = "template_length";
static const char __pyx_k_unmatched_quote[] = "unmatched quote";
static const char __pyx_k_convert_to_phred[] = "convert_to_phred";
static const char __pyx_k_file_or_filename[] = "file_or_filename";
static const char __pyx_k_is_supplementary[] = "is_supplementary";
static const char __pyx_k_mate_is_unmapped[] = "mate_is_unmapped";
static const char __pyx_k_sequence_matched[] = "sequence-matched";
static const char __pyx_k_ChromVector_steps[] = "ChromVector_steps";
static const char __pyx_k_Strand_must_be_or[] = "Strand must be'+', '-', or '.'.";
static const char __pyx_k_extend_to_include[] = "extend_to_include";
static const char __pyx_k_is_vector_of_sets[] = "is_vector_of_sets";
static const char __pyx_k_next_reference_id[] = "next_reference_id";
static const char __pyx_k_GenomicArray_steps[] = "GenomicArray_steps";
static const char __pyx_k_Illegal_index_type[] = "Illegal index type";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_characters_per_line[] = "characters_per_line";
static const char __pyx_k_raw_optional_fields[] = "raw_optional_fields";
static const char __pyx_k_sequence_mismatched[] = "sequence-mismatched";
static const char __pyx_k_track_type_bedGraph[] = "track type=bedGraph\n";
static const char __pyx_k_write_to_fastq_file[] = "write_to_fastq_file";
static const char __pyx_k_ChromVector_unpickle[] = "_ChromVector_unpickle";
static const char __pyx_k_Illegal_index_type_2[] = "Illegal index type.";
static const char __pyx_k_Illegal_storage_mode[] = "Illegal storage mode.";
static const char __pyx_k_iadd___locals_addval[] = "__iadd__..addval";
static const char __pyx_k_next_reference_start[] = "next_reference_start";
static const char __pyx_k_GenomicArray_unpickle[] = "_GenomicArray_unpickle";
static const char __pyx_k_GenomicInterval_range[] = "GenomicInterval_range";
static const char __pyx_k_SequenceWithQualities[] = "SequenceWithQualities";
static const char __pyx_k_cigar_operation_codes[] = "cigar_operation_codes";
static const char __pyx_k_cigar_operation_names[] = "cigar_operation_names";
static const char __pyx_k_track_type_bedGraph_s[] = "track type=bedGraph %s\n";
static const char __pyx_k_GenomicInterval_ranged[] = "GenomicInterval_ranged";
static const char __pyx_k_Illegal_CIGAR_string_s[] = "Illegal CIGAR string '%s'";
static const char __pyx_k_Quality_string_missing[] = "Quality string missing.";
static const char __pyx_k_from_pysam_AlignedRead[] = "from_pysam_AlignedRead";
static const char __pyx_k_get_reverse_complement[] = "get_reverse_complement";
static const char __pyx_k_pyx_unpickle_Alignment[] = "__pyx_unpickle_Alignment";
static const char __pyx_k_quote_must_be_length_1[] = "'quote' must be length 1";
static const char __pyx_k_split_must_be_length_1[] = "'split' must be length 1";
static const char __pyx_k_Illegal_quality_scale_s[] = "Illegal quality scale '%s'.";
static const char __pyx_k_add_qual_to_count_array[] = "add_qual_to_count_array";
static const char __pyx_k_Chromosome_name_mismatch[] = "Chromosome name mismatch.";
static const char __pyx_k_Quality_string_missing_2[] = "Quality string missing";
static const char __pyx_k_add_bases_to_count_array[] = "add_bases_to_count_array";
static const char __pyx_k_start_is_larger_than_end[] = "start is larger than end";
static const char __pyx_k_trim_left_end_with_quals[] = "trim_left_end_with_quals";
static const char __pyx_k_cigar_operation_code_dict[] = "cigar_operation_code_dict";
static const char __pyx_k_from_pysam_AlignedSegment[] = "from_pysam_AlignedSegment";
static const char __pyx_k_trim_right_end_with_quals[] = "trim_right_end_with_quals";
static const char __pyx_k_pyx_unpickle_SAM_Alignment[] = "__pyx_unpickle_SAM_Alignment";
static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static const char __pyx_k_pyx_unpickle_CigarOperation[] = "__pyx_unpickle_CigarOperation";
static const char __pyx_k_Inconsistent_CIGAR_operation[] = "Inconsistent CIGAR operation.";
static const char __pyx_k_python3_src_HTSeq__HTSeq_pyx[] = "python3/src/HTSeq/_HTSeq.pyx";
static const char __pyx_k_pyx_unpickle_BowtieAlignment[] = "__pyx_unpickle_BowtieAlignment";
static const char __pyx_k_AlignmentWithSequenceReversal[] = "AlignmentWithSequenceReversal";
static const char __pyx_k_pyx_unpickle_AlignmentWithSequ[] = "__pyx_unpickle_AlignmentWithSequenceReversal";
static const char __pyx_k_Automatic_adding_of_chromosomes[] = "Automatic adding of chromosomes can only be used with storage type 'StepVector'.";
static const char __pyx_k_Illegal_base_letter_encountered[] = "Illegal base letter encountered.";
static const char __pyx_k_Malformatted_SAM_optional_field[] = "Malformatted SAM optional field '%'";
static const char __pyx_k_Quality_string_has_not_the_same[] = "Quality string has not the same length as sequence.";
static const char __pyx_k_SAM_optional_field_with_illegal[] = "SAM optional field with illegal type letter '%s'";
static const char __pyx_k_assignment_to_qual_with_illegal[] = "assignment to qual with illegal shape";
static const char __pyx_k_chroms_must_be_a_list_or_a_dict[] = "'chroms' must be a list or a dict or 'auto'.";
static const char __pyx_k_count_array_has_too_few_columns[] = "'count_array' has too few columns.";
static const char __pyx_k_count_array_too_small_for_seque[] = "'count_array' too small for sequence.";
static const char __pyx_k_make_translation_table_for_comp[] = "_make_translation_table_for_complementation";
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
static const char __pyx_k_seq_and_qualstr_do_not_have_the[] = "'seq' and 'qualstr' do not have the same length.";
static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static const char __pyx_k_Cannot_assign_to_zero_length_int[] = "Cannot assign to zero-length interval.";
static const char __pyx_k_Cannot_extend_an_interval_to_inc[] = "Cannot extend an interval to include None.";
static const char __pyx_k_Cannot_subset_to_zero_length_int[] = "Cannot subset to zero-length interval.";
static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static const char __pyx_k_GenomicInterval_from_directional[] = "GenomicInterval_from_directional";
static const char __pyx_k_Incompatible_checksums_s_vs_0x1b[] = "Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x48[] = "Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x77[] = "Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xb5[] = "Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xf6[] = "Incompatible checksums (%s vs 0xf6933f3 = (_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary))";
static const char __pyx_k_Indefinite_length_chromosomes_ca[] = "Indefinite-length chromosomes can only be used with storage type 'StepVector'.";
static const char __pyx_k_Malformed_SAM_line_MRNM_although[] = "Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared";
static const char __pyx_k_Malformed_SAM_line_RNAME_althoug[] = "Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared";
static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static const char __pyx_k_Non_stranded_index_used_for_stra[] = "Non-stranded index used for stranded GenomicArray.";
static const char __pyx_k_Please_Install_PySam_to_use_this[] = "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)";
static const char __pyx_k_Required_assignment_signature_no[] = "Required assignment signature not yet implemented.";
static const char __pyx_k_SAM_line_does_not_contain_at_lea[] = "SAM line does not contain at least 11 tab-delimited fields.";
static const char __pyx_k_SAM_optional_field_tag_s_not_fou[] = "SAM optional field tag %s not found";
static const char __pyx_k_SAM_optional_field_tag_s_not_uni[] = "SAM optional field tag %s not unique";
static const char __pyx_k_Sequence_in_SAM_file_contains_wh[] = "Sequence in SAM file contains '=', which is not supported.";
static const char __pyx_k_Start_of_interval_is_after_its_e[] = "Start of interval is after its end.";
static const char __pyx_k_Strand_must_be_specified_for_str[] = "Strand must be specified for stranded GenomicArray.";
static const char __pyx_k_Strand_specified_in_unstranded_G[] = "Strand specified in unstranded GenomicArray.";
static const char __pyx_k_Too_large_quality_value_encounte[] = "Too large quality value encountered.";
static const char __pyx_k_Unknown_CIGAR_code_s_encountered[] = "Unknown CIGAR code '%s' encountered.";
static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
static const char __pyx_k_qual_can_only_be_assigned_a_nump[] = "qual can only be assigned a numpy array of type numpy.uint8";
static const char __pyx_k_Cannot_extend_an_interval_to_inc_2[] = "Cannot extend an interval to include an interval on another chromosome.";
static const char __pyx_k_Cannot_extend_an_interval_to_inc_3[] = "Cannot extend an interval to include an interval on another strand.";
static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static const char __pyx_k_Sequence_in_SAM_file_contains_wh_2[] = "Sequence in SAM file contains '.', which is not supported.";
static PyObject *__pyx_n_u_A;
static PyObject *__pyx_n_b_ACGTacgt;
static PyObject *__pyx_n_s_AlignedRead;
static PyObject *__pyx_n_s_AlignedSegment;
static PyObject *__pyx_n_s_Alignment;
static PyObject *__pyx_n_s_AlignmentWithSequenceReversal;
static PyObject *__pyx_kp_u_Automatic_adding_of_chromosomes;
static PyObject *__pyx_n_s_BowtieAlignment;
static PyObject *__pyx_n_u_C;
static PyObject *__pyx_kp_u_Cannot_assign_to_zero_length_int;
static PyObject *__pyx_kp_u_Cannot_extend_an_interval_to_inc;
static PyObject *__pyx_kp_u_Cannot_extend_an_interval_to_inc_2;
static PyObject *__pyx_kp_u_Cannot_extend_an_interval_to_inc_3;
static PyObject *__pyx_kp_u_Cannot_subset_to_zero_length_int;
static PyObject *__pyx_n_s_ChromVector;
static PyObject *__pyx_n_s_ChromVector_steps;
static PyObject *__pyx_n_s_ChromVector_unpickle;
static PyObject *__pyx_kp_u_Chromosome_name_mismatch;
static PyObject *__pyx_n_s_CigarOperation;
static PyObject *__pyx_n_u_D;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
static PyObject *__pyx_n_u_G;
static PyObject *__pyx_n_s_GenomicArray;
static PyObject *__pyx_n_s_GenomicArray_steps;
static PyObject *__pyx_n_s_GenomicArray_unpickle;
static PyObject *__pyx_n_s_GenomicInterval;
static PyObject *__pyx_n_s_GenomicInterval_from_directional;
static PyObject *__pyx_n_s_GenomicInterval_range;
static PyObject *__pyx_n_s_GenomicInterval_ranged;
static PyObject *__pyx_n_s_GenomicPosition;
static PyObject *__pyx_n_u_H;
static PyObject *__pyx_n_s_HTSeq;
static PyObject *__pyx_n_s_HTSeq__HTSeq;
static PyObject *__pyx_n_s_HTSeq_internal;
static PyObject *__pyx_n_u_I;
static PyObject *__pyx_kp_u_Illegal_CIGAR_string_s;
static PyObject *__pyx_kp_u_Illegal_base_letter_encountered;
static PyObject *__pyx_kp_u_Illegal_index_type;
static PyObject *__pyx_kp_u_Illegal_index_type_2;
static PyObject *__pyx_kp_u_Illegal_quality_scale_s;
static PyObject *__pyx_kp_u_Illegal_storage_mode;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x1b;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x48;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x77;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb5;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xf6;
static PyObject *__pyx_kp_u_Inconsistent_CIGAR_operation;
static PyObject *__pyx_kp_u_Indefinite_length_chromosomes_ca;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_u_Inf;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_u_M;
static PyObject *__pyx_kp_u_MIDNSHP_X;
static PyObject *__pyx_kp_u_Malformatted_SAM_optional_field;
static PyObject *__pyx_kp_u_Malformed_SAM_line_MRNM_although;
static PyObject *__pyx_kp_u_Malformed_SAM_line_RNAME_althoug;
static PyObject *__pyx_n_u_N;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_kp_u_Non_stranded_index_used_for_stra;
static PyObject *__pyx_kp_u_None;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_u_O;
static PyObject *__pyx_n_u_P;
static PyObject *__pyx_kp_u_Paired_end_read;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_kp_u_Please_Install_PySam_to_use_this;
static PyObject *__pyx_kp_u_Quality_string_has_not_the_same;
static PyObject *__pyx_kp_u_Quality_string_missing;
static PyObject *__pyx_kp_u_Quality_string_missing_2;
static PyObject *__pyx_n_u_Read;
static PyObject *__pyx_kp_u_Required_assignment_signature_no;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_u_S;
static PyObject *__pyx_n_s_SAM_Alignment;
static PyObject *__pyx_kp_u_SAM_line_does_not_contain_at_lea;
static PyObject *__pyx_kp_u_SAM_optional_field_tag_s_not_fou;
static PyObject *__pyx_kp_u_SAM_optional_field_tag_s_not_uni;
static PyObject *__pyx_kp_u_SAM_optional_field_with_illegal;
static PyObject *__pyx_n_s_Sequence;
static PyObject *__pyx_n_s_SequenceWithQualities;
static PyObject *__pyx_kp_u_Sequence_in_SAM_file_contains_wh;
static PyObject *__pyx_kp_u_Sequence_in_SAM_file_contains_wh_2;
static PyObject *__pyx_kp_u_Start_of_interval_is_after_its_e;
static PyObject *__pyx_n_s_StepVector;
static PyObject *__pyx_kp_u_Strand_mismatch;
static PyObject *__pyx_kp_u_Strand_must_be_or;
static PyObject *__pyx_kp_u_Strand_must_be_specified_for_str;
static PyObject *__pyx_kp_u_Strand_specified_in_unstranded_G;
static PyObject *__pyx_n_s_StringIO;
static PyObject *__pyx_n_u_T;
static PyObject *__pyx_n_b_TGCAtgca;
static PyObject *__pyx_kp_u_Too_large_quality_value_encounte;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_u_Unknown_CIGAR_code_s_encountered;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_u_X;
static PyObject *__pyx_n_u_Z;
static PyObject *__pyx_kp_u__10;
static PyObject *__pyx_kp_u__11;
static PyObject *__pyx_kp_b__12;
static PyObject *__pyx_kp_u__12;
static PyObject *__pyx_kp_u__16;
static PyObject *__pyx_kp_u__17;
static PyObject *__pyx_kp_u__19;
static PyObject *__pyx_kp_u__2;
static PyObject *__pyx_kp_u__20;
static PyObject *__pyx_kp_u__21;
static PyObject *__pyx_kp_u__22;
static PyObject *__pyx_kp_u__25;
static PyObject *__pyx_kp_b__26;
static PyObject *__pyx_kp_u__26;
static PyObject *__pyx_kp_u__27;
static PyObject *__pyx_kp_u__28;
static PyObject *__pyx_kp_u__29;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_kp_u__30;
static PyObject *__pyx_kp_u__31;
static PyObject *__pyx_kp_u__32;
static PyObject *__pyx_kp_u__33;
static PyObject *__pyx_kp_b__34;
static PyObject *__pyx_kp_u__34;
static PyObject *__pyx_kp_b__39;
static PyObject *__pyx_kp_u__4;
static PyObject *__pyx_kp_b__40;
static PyObject *__pyx_kp_u__5;
static PyObject *__pyx_kp_u__6;
static PyObject *__pyx_kp_u__7;
static PyObject *__pyx_kp_u__8;
static PyObject *__pyx_kp_u__9;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_bases_to_count_array;
static PyObject *__pyx_n_s_add_chrom;
static PyObject *__pyx_n_s_add_qual_to_count_array;
static PyObject *__pyx_n_s_addval;
static PyObject *__pyx_n_s_aend;
static PyObject *__pyx_n_s_aligned;
static PyObject *__pyx_kp_u_aligned_to;
static PyObject *__pyx_n_s_apply;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_kp_u_assignment_to_qual_with_illegal;
static PyObject *__pyx_n_u_auto;
static PyObject *__pyx_kp_u_base_s;
static PyObject *__pyx_n_s_base_to_column;
static PyObject *__pyx_n_s_bowtie_line;
static PyObject *__pyx_n_s_cStringIO;
static PyObject *__pyx_n_s_characters_per_line;
static PyObject *__pyx_n_s_check;
static PyObject *__pyx_n_s_chrom;
static PyObject *__pyx_n_s_chrom_vectors;
static PyObject *__pyx_n_s_chroms;
static PyObject *__pyx_kp_u_chroms_must_be_a_list_or_a_dict;
static PyObject *__pyx_n_s_cigar;
static PyObject *__pyx_n_s_cigar_operation_code_dict;
static PyObject *__pyx_n_s_cigar_operation_codes;
static PyObject *__pyx_n_s_cigar_operation_names;
static PyObject *__pyx_n_s_cigar_pairs;
static PyObject *__pyx_n_s_cigar_string;
static PyObject *__pyx_n_s_cigartuples;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_contains;
static PyObject *__pyx_n_s_convert_to_phred;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_kp_u_count_array_has_too_few_columns;
static PyObject *__pyx_kp_u_count_array_too_small_for_seque;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_s_create_view;
static PyObject *__pyx_n_s_csv;
static PyObject *__pyx_n_s_cv;
static PyObject *__pyx_n_u_d;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_u_deleted;
static PyObject *__pyx_n_u_descr;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_end_d;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_extend_to_include;
static PyObject *__pyx_n_u_f;
static PyObject *__pyx_n_s_fasta_file;
static PyObject *__pyx_n_s_file_or_filename;
static PyObject *__pyx_n_s_filename;
static PyObject *__pyx_n_u_first;
static PyObject *__pyx_n_s_flag;
static PyObject *__pyx_n_s_from_SAM_line;
static PyObject *__pyx_n_s_from_pysam_AlignedRead;
static PyObject *__pyx_n_s_from_pysam_AlignedSegment;
static PyObject *__pyx_n_s_ga;
static PyObject *__pyx_n_s_get_reverse_complement;
static PyObject *__pyx_n_s_getrname;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_gettid;
static PyObject *__pyx_n_s_getvalue;
static PyObject *__pyx_n_s_gzip;
static PyObject *__pyx_kp_u_hard_clipped;
static PyObject *__pyx_n_u_i;
static PyObject *__pyx_n_s_iadd;
static PyObject *__pyx_n_s_iadd___locals_addval;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_u_inserted;
static PyObject *__pyx_n_s_is_contained_in;
static PyObject *__pyx_n_s_is_duplicate;
static PyObject *__pyx_n_s_is_paired;
static PyObject *__pyx_n_s_is_proper_pair;
static PyObject *__pyx_n_s_is_qcfail;
static PyObject *__pyx_n_s_is_read1;
static PyObject *__pyx_n_s_is_read2;
static PyObject *__pyx_n_s_is_reverse;
static PyObject *__pyx_n_s_is_secondary;
static PyObject *__pyx_n_s_is_supplementary;
static PyObject *__pyx_n_s_is_unmapped;
static PyObject *__pyx_n_s_is_vector_of_sets;
static PyObject *__pyx_n_s_isize;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_s_iv;
static PyObject *__pyx_n_u_j;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_kp_u_length_2;
static PyObject *__pyx_n_s_log10;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_translation_table_for_comp;
static PyObject *__pyx_n_s_maketrans;
static PyObject *__pyx_n_s_mapping_quality;
static PyObject *__pyx_n_s_mapq;
static PyObject *__pyx_n_u_matched;
static PyObject *__pyx_n_s_mate_aligned;
static PyObject *__pyx_n_s_mate_is_reverse;
static PyObject *__pyx_n_s_mate_is_unmapped;
static PyObject *__pyx_n_s_math;
static PyObject *__pyx_n_s_max_mm_qual;
static PyObject *__pyx_n_s_maxsize;
static PyObject *__pyx_n_s_memmap;
static PyObject *__pyx_n_u_memmap;
static PyObject *__pyx_n_s_memmap_dir;
static PyObject *__pyx_n_s_mismatch_prop;
static PyObject *__pyx_n_u_missing;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_mpos;
static PyObject *__pyx_n_s_mrnm;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_u_name_2;
static PyObject *__pyx_n_u_ndarray;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_next_reference_id;
static PyObject *__pyx_n_s_next_reference_start;
static PyObject *__pyx_kp_u_nmm;
static PyObject *__pyx_n_u_none;
static PyObject *__pyx_n_u_noquals;
static PyObject *__pyx_kp_u_not_aligned;
static PyObject *__pyx_n_u_not_paired_end;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_kp_u_object;
static PyObject *__pyx_kp_u_object_2;
static PyObject *__pyx_kp_u_object_3;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_kp_u_on_ref_iv;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_overlaps;
static PyObject *__pyx_n_u_padded;
static PyObject *__pyx_n_s_paired_end;
static PyObject *__pyx_kp_u_part;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_pattern;
static PyObject *__pyx_n_u_phred;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_pysam;
static PyObject *__pyx_kp_s_python3_src_HTSeq__HTSeq_pyx;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_Alignment;
static PyObject *__pyx_n_s_pyx_unpickle_AlignmentWithSequ;
static PyObject *__pyx_n_s_pyx_unpickle_BowtieAlignment;
static PyObject *__pyx_n_s_pyx_unpickle_CigarOperation;
static PyObject *__pyx_n_s_pyx_unpickle_SAM_Alignment;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qfrom;
static PyObject *__pyx_n_s_qname;
static PyObject *__pyx_n_s_qto;
static PyObject *__pyx_n_s_qual;
static PyObject *__pyx_kp_u_qual_can_only_be_assigned_a_nump;
static PyObject *__pyx_n_s_qualscale;
static PyObject *__pyx_n_s_qualstr;
static PyObject *__pyx_kp_u_query_iv;
static PyObject *__pyx_n_s_query_name;
static PyObject *__pyx_n_s_query_qualities;
static PyObject *__pyx_n_s_query_sequence;
static PyObject *__pyx_n_s_quote;
static PyObject *__pyx_kp_u_quote_must_be_length_1;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_raw_optional_fields;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_re_cigar_codes;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_read_as_aligned;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_ref_iv;
static PyObject *__pyx_n_s_ref_left;
static PyObject *__pyx_n_s_reference_end;
static PyObject *__pyx_n_s_reference_id;
static PyObject *__pyx_n_s_reference_start;
static PyObject *__pyx_n_s_rename;
static PyObject *__pyx_n_u_revcomp_of;
static PyObject *__pyx_n_s_rfrom;
static PyObject *__pyx_n_s_rstrip;
static PyObject *__pyx_n_s_rto;
static PyObject *__pyx_kp_u_s;
static PyObject *__pyx_kp_u_s_2;
static PyObject *__pyx_n_s_s_3;
static PyObject *__pyx_n_s_samfile;
static PyObject *__pyx_n_s_se;
static PyObject *__pyx_n_u_second;
static PyObject *__pyx_n_s_seq;
static PyObject *__pyx_n_u_seq;
static PyObject *__pyx_kp_u_seq_and_qualstr_do_not_have_the;
static PyObject *__pyx_kp_u_sequence_matched;
static PyObject *__pyx_kp_u_sequence_mismatched;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_u_skipped;
static PyObject *__pyx_kp_u_soft_clipped;
static PyObject *__pyx_n_u_solexa;
static PyObject *__pyx_kp_u_solexa_old;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_kp_u_split_must_be_length_1;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_start_d;
static PyObject *__pyx_n_s_start_index;
static PyObject *__pyx_kp_u_start_is_larger_than_end;
static PyObject *__pyx_kp_u_start_too_small;
static PyObject *__pyx_n_s_stderr;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_u_step;
static PyObject *__pyx_n_s_steps;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_kp_u_stop_too_large;
static PyObject *__pyx_n_s_storage;
static PyObject *__pyx_n_s_storage_2;
static PyObject *__pyx_n_s_strand;
static PyObject *__pyx_kp_u_strand_2;
static PyObject *__pyx_kp_u_strand_3;
static PyObject *__pyx_n_s_stranded;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_tags;
static PyObject *__pyx_n_s_template_length;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_tid;
static PyObject *__pyx_n_s_track_options;
static PyObject *__pyx_kp_u_track_type_bedGraph;
static PyObject *__pyx_kp_u_track_type_bedGraph_s;
static PyObject *__pyx_n_s_translate;
static PyObject *__pyx_n_s_trim_left_end;
static PyObject *__pyx_n_s_trim_left_end_with_quals;
static PyObject *__pyx_n_s_trim_right_end;
static PyObject *__pyx_n_s_trim_right_end_with_quals;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_type_2;
static PyObject *__pyx_n_s_typecode;
static PyObject *__pyx_n_s_uint8;
static PyObject *__pyx_n_u_unknown;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_kp_u_unmatched_quote;
static PyObject *__pyx_n_u_unnamed;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_vec;
static PyObject *__pyx_kp_u_w;
static PyObject *__pyx_n_u_w_2;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_u_write;
static PyObject *__pyx_n_s_write_to_fastq_file;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_zeros;
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_chrom, long __pyx_v_start, long __pyx_v_end, PyObject *__pyx_v_strand); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand___set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_strand); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand_2__get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_2__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_4__copy__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_8__str__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_newLength); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_newStartd); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5end_d___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10__richcmp__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_other, int __pyx_v_op); /* proto */
static Py_hash_t __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12__hash__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_16contains(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_20range(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_step); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_22range_d(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_step); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_26copy(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_GenomicInterval_from_directional(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chrom, long __pyx_v_start_d, long __pyx_v_length, PyObject *__pyx_v_strand); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self, PyObject *__pyx_v_chrom, long __pyx_v_pos, PyObject *__pyx_v_strand); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self, long __pyx_v_newValue); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6length___get__(CYTHON_UNUSED struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_4__str__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_8copy(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_create(PyTypeObject *__pyx_v_cls, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, PyObject *__pyx_v_typecode, PyObject *__pyx_v_storage, PyObject *__pyx_v_memmap_dir); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2_create_view(PyTypeObject *__pyx_v_cls, struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_vec, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_4__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6__setitem__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__iadd___addval(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__iadd__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10__iter__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_12values(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_14steps(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_16apply(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_fun); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_18__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_20__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_2_ChromVector_unpickle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_iv, PyObject *__pyx_v_offset, PyObject *__pyx_v_is_vector_of_sets, PyObject *__pyx_v__storage); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_chroms, int __pyx_v_stranded, PyObject *__pyx_v_typecode, PyObject *__pyx_v_storage, PyObject *__pyx_v_memmap_dir); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_2__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_4__setitem__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6add_chrom(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_length, PyObject *__pyx_v_start_index); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10write_bedgraph_file(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_file_or_filename, PyObject *__pyx_v_strand, PyObject *__pyx_v_track_options); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_12steps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8stranded___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8typecode___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_7storage___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_4_GenomicArray_unpickle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stranded, PyObject *__pyx_v_typecode, PyObject *__pyx_v_chrom_vectors); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_6_make_translation_table_for_complementation(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8reverse_complement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence___init__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_2get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, int __pyx_v_rename); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_4__str__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_6__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_5HTSeq_6_HTSeq_8Sequence_8__len__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_10__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_12__getstate__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_14__setstate__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_16__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_fasta_file, PyObject *__pyx_v_characters_per_line); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_20add_bases_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyArrayObject *__pyx_v_count_array_); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_22trim_left_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, float __pyx_v_mismatch_prop); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_24trim_right_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, float __pyx_v_mismatch_prop); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities___init__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_name, PyObject *__pyx_v_qualstr, PyObject *__pyx_v_qualscale); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_newvalue); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_6write_to_fastq_file(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_fastq_file); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8get_fastq_str(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_v_convert_to_phred); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_v_rename); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_12add_qual_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyArrayObject *__pyx_v_count_array_); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14trim_left_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_v_max_mm_qual); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_16trim_right_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_v_max_mm_qual); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment___init__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_read, PyObject *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_4read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_10paired_end___get__(CYTHON_UNUSED struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_7aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_4__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_6__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal___init__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_read_as_aligned, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_2__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment___init__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_bowtie_line); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved___get__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions___get__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_2__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_4__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation___init__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_type_, int __pyx_v_size, int __pyx_v_rfrom, int __pyx_v_rto, int __pyx_v_qfrom, int __pyx_v_qto, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand, int __pyx_v_check); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4check(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_10parse_cigar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cigar_string, int __pyx_v_ref_left, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12build_cigar_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cigar_pairs, int __pyx_v_ref_left, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_to_pysam_AlignedSegment(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_2to_pysam_AlignedRead(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4from_pysam_AlignedRead(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_read, PyObject *__pyx_v_samfile); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_6from_pysam_AlignedSegment(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_read, PyObject *__pyx_v_samfile); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8from_SAM_line(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_line); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10get_sam_line(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12optional_field(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_tag); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_14raw_optional_fields(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_16__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14quotesafe_split(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s, PyObject *__pyx_v_split, PyObject *__pyx_v_quote); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_16__pyx_unpickle_Alignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_18__pyx_unpickle_AlignmentWithSequenceReversal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_20__pyx_unpickle_BowtieAlignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_22__pyx_unpickle_CigarOperation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_24__pyx_unpickle_SAM_Alignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicInterval(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicPosition(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_Sequence(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_SequenceWithQualities(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_Alignment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_SAM_Alignment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_ChromVector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_BowtieAlignment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_CigarOperation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_11;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_70;
static PyObject *__pyx_int_28831487;
static PyObject *__pyx_int_75678070;
static PyObject *__pyx_int_125566450;
static PyObject *__pyx_int_190567068;
static PyObject *__pyx_int_258552819;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k_;
static PyObject *__pyx_k__18;
static PyObject *__pyx_slice__13;
static PyObject *__pyx_slice__24;
static PyObject *__pyx_slice__35;
static PyObject *__pyx_slice__36;
static PyObject *__pyx_slice__37;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_codeobj__15;
static PyObject *__pyx_codeobj__49;
static PyObject *__pyx_codeobj__51;
static PyObject *__pyx_codeobj__53;
static PyObject *__pyx_codeobj__54;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__59;
static PyObject *__pyx_codeobj__61;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__65;
/* Late includes */
/* "HTSeq/_HTSeq.pyx":56
* """
*
* def __init__(GenomicInterval self, str chrom, long start, long end, # <<<<<<<<<<<<<<
* str strand=strand_nostrand):
* """See the class docstring for the meaning of the slots. Note that
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval___init__[] = "See the class docstring for the meaning of the slots. Note that \n there is also a factory function, 'from_directional', to be used if\n you wish to specify start_d and length.\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5HTSeq_6_HTSeq_15GenomicInterval___init__;
#endif
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_chrom = 0;
long __pyx_v_start;
long __pyx_v_end;
PyObject *__pyx_v_strand = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_strand,0};
PyObject* values[4] = {0,0,0,0};
values[3] = __pyx_k_;
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 56, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 56, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_chrom = ((PyObject*)values[0]);
__pyx_v_start = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_start == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error)
__pyx_v_end = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_end == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error)
__pyx_v_strand = ((PyObject*)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 56, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 57, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_strand);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_chrom, long __pyx_v_start, long __pyx_v_end, PyObject *__pyx_v_strand) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
__Pyx_RefNannySetupContext("__init__", 0);
/* "HTSeq/_HTSeq.pyx":62
* you wish to specify start_d and length.
* """
* self.chrom = intern(chrom) # <<<<<<<<<<<<<<
* self.start = start
* self.end = end
*/
__pyx_t_1 = __Pyx_Intern(__pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 62, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->chrom);
__Pyx_DECREF(__pyx_v_self->chrom);
__pyx_v_self->chrom = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":63
* """
* self.chrom = intern(chrom)
* self.start = start # <<<<<<<<<<<<<<
* self.end = end
* self.strand = strand
*/
__pyx_v_self->start = __pyx_v_start;
/* "HTSeq/_HTSeq.pyx":64
* self.chrom = intern(chrom)
* self.start = start
* self.end = end # <<<<<<<<<<<<<<
* self.strand = strand
* if self.start > self.end:
*/
__pyx_v_self->end = __pyx_v_end;
/* "HTSeq/_HTSeq.pyx":65
* self.start = start
* self.end = end
* self.strand = strand # <<<<<<<<<<<<<<
* if self.start > self.end:
* raise ValueError, "start is larger than end"
*/
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand, __pyx_v_strand) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":66
* self.end = end
* self.strand = strand
* if self.start > self.end: # <<<<<<<<<<<<<<
* raise ValueError, "start is larger than end"
*
*/
__pyx_t_2 = ((__pyx_v_self->start > __pyx_v_self->end) != 0);
if (unlikely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":67
* self.strand = strand
* if self.start > self.end:
* raise ValueError, "start is larger than end" # <<<<<<<<<<<<<<
*
* property strand:
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_start_is_larger_than_end, 0, 0);
__PYX_ERR(0, 67, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":66
* self.end = end
* self.strand = strand
* if self.start > self.end: # <<<<<<<<<<<<<<
* raise ValueError, "start is larger than end"
*
*/
}
/* "HTSeq/_HTSeq.pyx":56
* """
*
* def __init__(GenomicInterval self, str chrom, long start, long end, # <<<<<<<<<<<<<<
* str strand=strand_nostrand):
* """See the class docstring for the meaning of the slots. Note that
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":70
*
* property strand:
* def __set__(self, strand): # <<<<<<<<<<<<<<
* strand = intern(strand)
* if not(strand is strand_plus or strand is strand_minus or
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_strand); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_strand) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand___set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((PyObject *)__pyx_v_strand));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand___set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_strand) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
__Pyx_RefNannySetupContext("__set__", 0);
__Pyx_INCREF(__pyx_v_strand);
/* "HTSeq/_HTSeq.pyx":71
* property strand:
* def __set__(self, strand):
* strand = intern(strand) # <<<<<<<<<<<<<<
* if not(strand is strand_plus or strand is strand_minus or
* strand is strand_nostrand):
*/
__pyx_t_1 = __Pyx_Intern(__pyx_v_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_strand, __pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":72
* def __set__(self, strand):
* strand = intern(strand)
* if not(strand is strand_plus or strand is strand_minus or # <<<<<<<<<<<<<<
* strand is strand_nostrand):
* raise ValueError, "Strand must be'+', '-', or '.'."
*/
__pyx_t_3 = (__pyx_v_strand == __pyx_v_5HTSeq_6_HTSeq_strand_plus);
__pyx_t_4 = (__pyx_t_3 != 0);
if (!__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = (__pyx_v_strand == __pyx_v_5HTSeq_6_HTSeq_strand_minus);
__pyx_t_3 = (__pyx_t_4 != 0);
if (!__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
/* "HTSeq/_HTSeq.pyx":73
* strand = intern(strand)
* if not(strand is strand_plus or strand is strand_minus or
* strand is strand_nostrand): # <<<<<<<<<<<<<<
* raise ValueError, "Strand must be'+', '-', or '.'."
* self._strand = strand
*/
__pyx_t_3 = (__pyx_v_strand == __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__pyx_t_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
/* "HTSeq/_HTSeq.pyx":72
* def __set__(self, strand):
* strand = intern(strand)
* if not(strand is strand_plus or strand is strand_minus or # <<<<<<<<<<<<<<
* strand is strand_nostrand):
* raise ValueError, "Strand must be'+', '-', or '.'."
*/
__pyx_t_4 = ((!__pyx_t_2) != 0);
if (unlikely(__pyx_t_4)) {
/* "HTSeq/_HTSeq.pyx":74
* if not(strand is strand_plus or strand is strand_minus or
* strand is strand_nostrand):
* raise ValueError, "Strand must be'+', '-', or '.'." # <<<<<<<<<<<<<<
* self._strand = strand
*
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Strand_must_be_or, 0, 0);
__PYX_ERR(0, 74, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":72
* def __set__(self, strand):
* strand = intern(strand)
* if not(strand is strand_plus or strand is strand_minus or # <<<<<<<<<<<<<<
* strand is strand_nostrand):
* raise ValueError, "Strand must be'+', '-', or '.'."
*/
}
/* "HTSeq/_HTSeq.pyx":75
* strand is strand_nostrand):
* raise ValueError, "Strand must be'+', '-', or '.'."
* self._strand = strand # <<<<<<<<<<<<<<
*
* def __get__(self):
*/
if (!(likely(PyUnicode_CheckExact(__pyx_v_strand))||((__pyx_v_strand) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_strand)->tp_name), 0))) __PYX_ERR(0, 75, __pyx_L1_error)
__pyx_t_1 = __pyx_v_strand;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->_strand);
__Pyx_DECREF(__pyx_v_self->_strand);
__pyx_v_self->_strand = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":70
*
* property strand:
* def __set__(self, strand): # <<<<<<<<<<<<<<
* strand = intern(strand)
* if not(strand is strand_plus or strand is strand_minus or
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.strand.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_strand);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":77
* self._strand = strand
*
* def __get__(self): # <<<<<<<<<<<<<<
* return self._strand
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_3__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_3__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand_2__get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand_2__get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":78
*
* def __get__(self):
* return self._strand # <<<<<<<<<<<<<<
*
* def __reduce__(GenomicInterval self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->_strand);
__pyx_r = __pyx_v_self->_strand;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":77
* self._strand = strand
*
* def __get__(self): # <<<<<<<<<<<<<<
* return self._strand
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":80
* return self._strand
*
* def __reduce__(GenomicInterval self): # <<<<<<<<<<<<<<
* return GenomicInterval, (self.chrom, self.start, self.end,
* self.strand)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_2__reduce__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_2__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("__reduce__", 0);
/* "HTSeq/_HTSeq.pyx":81
*
* def __reduce__(GenomicInterval self):
* return GenomicInterval, (self.chrom, self.start, self.end, # <<<<<<<<<<<<<<
* self.strand)
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "HTSeq/_HTSeq.pyx":82
* def __reduce__(GenomicInterval self):
* return GenomicInterval, (self.chrom, self.start, self.end,
* self.strand) # <<<<<<<<<<<<<<
*
* def __copy__(self):
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
/* "HTSeq/_HTSeq.pyx":81
*
* def __reduce__(GenomicInterval self):
* return GenomicInterval, (self.chrom, self.start, self.end, # <<<<<<<<<<<<<<
* self.strand)
*
*/
__pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_v_self->chrom);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval));
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":80
* return self._strand
*
* def __reduce__(GenomicInterval self): # <<<<<<<<<<<<<<
* return GenomicInterval, (self.chrom, self.start, self.end,
* self.strand)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":84
* self.strand)
*
* def __copy__(self): # <<<<<<<<<<<<<<
* constr, args = self.__reduce__()
* return constr(*args)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_4__copy__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_4__copy__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_v_constr = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *(*__pyx_t_5)(PyObject *);
__Pyx_RefNannySetupContext("__copy__", 0);
/* "HTSeq/_HTSeq.pyx":85
*
* def __copy__(self):
* constr, args = self.__reduce__() # <<<<<<<<<<<<<<
* return constr(*args)
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reduce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 85, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
__pyx_t_5 = NULL;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L4_unpacking_done;
__pyx_L3_unpacking_failed:;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 85, __pyx_L1_error)
__pyx_L4_unpacking_done:;
}
__pyx_v_constr = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_3;
__pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":86
* def __copy__(self):
* constr, args = self.__reduce__()
* return constr(*args) # <<<<<<<<<<<<<<
*
* def __repr__(GenomicInterval self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_constr, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":84
* self.strand)
*
* def __copy__(self): # <<<<<<<<<<<<<<
* constr, args = self.__reduce__()
* return constr(*args)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_constr);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":88
* return constr(*args)
*
* def __repr__(GenomicInterval self): # <<<<<<<<<<<<<<
* return "<%s object '%s', [%d,%s), strand '%s'>" % \
* (self.__class__.__name__, self.chrom, self.start,
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6__repr__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "HTSeq/_HTSeq.pyx":89
*
* def __repr__(GenomicInterval self):
* return "<%s object '%s', [%d,%s), strand '%s'>" % \ # <<<<<<<<<<<<<<
* (self.__class__.__name__, self.chrom, self.start,
* str(self.end) if self.end != sys.maxsize else "Inf", self.strand)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__Pyx_INCREF(__pyx_kp_u__2);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
/* "HTSeq/_HTSeq.pyx":90
* def __repr__(GenomicInterval self):
* return "<%s object '%s', [%d,%s), strand '%s'>" % \
* (self.__class__.__name__, self.chrom, self.start, # <<<<<<<<<<<<<<
* str(self.end) if self.end != sys.maxsize else "Inf", self.strand)
*
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u_object);
__pyx_t_2 += 9;
__Pyx_GIVEREF(__pyx_kp_u_object);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object);
__pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__3);
__pyx_t_2 += 4;
__Pyx_GIVEREF(__pyx_kp_u__3);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
__pyx_t_4 = __Pyx_PyUnicode_From_long(__pyx_v_self->start, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__4);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__4);
PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__4);
/* "HTSeq/_HTSeq.pyx":91
* return "<%s object '%s', [%d,%s), strand '%s'>" % \
* (self.__class__.__name__, self.chrom, self.start,
* str(self.end) if self.end != sys.maxsize else "Inf", self.strand) # <<<<<<<<<<<<<<
*
* def __str__(GenomicInterval self):
*/
__pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_8) {
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_4 = __pyx_t_7;
__pyx_t_7 = 0;
} else {
__Pyx_INCREF(__pyx_n_u_Inf);
__pyx_t_4 = __pyx_n_u_Inf;
}
__pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_INCREF(__pyx_kp_u_strand_2);
__pyx_t_2 += 11;
__Pyx_GIVEREF(__pyx_kp_u_strand_2);
PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u_strand_2);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__5);
__pyx_t_2 += 2;
__Pyx_GIVEREF(__pyx_kp_u__5);
PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u__5);
/* "HTSeq/_HTSeq.pyx":89
*
* def __repr__(GenomicInterval self):
* return "<%s object '%s', [%d,%s), strand '%s'>" % \ # <<<<<<<<<<<<<<
* (self.__class__.__name__, self.chrom, self.start,
* str(self.end) if self.end != sys.maxsize else "Inf", self.strand)
*/
__pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":88
* return constr(*args)
*
* def __repr__(GenomicInterval self): # <<<<<<<<<<<<<<
* return "<%s object '%s', [%d,%s), strand '%s'>" % \
* (self.__class__.__name__, self.chrom, self.start,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":93
* str(self.end) if self.end != sys.maxsize else "Inf", self.strand)
*
* def __str__(GenomicInterval self): # <<<<<<<<<<<<<<
* return "%s:[%d,%s)/%s" % \
* (self.chrom, self.start, str(self.end)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_9__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_9__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_8__str__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_8__str__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
__Pyx_RefNannySetupContext("__str__", 0);
/* "HTSeq/_HTSeq.pyx":94
*
* def __str__(GenomicInterval self):
* return "%s:[%d,%s)/%s" % \ # <<<<<<<<<<<<<<
* (self.chrom, self.start, str(self.end)
* if self.end != sys.maxsize else "Inf", self.strand)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
/* "HTSeq/_HTSeq.pyx":95
* def __str__(GenomicInterval self):
* return "%s:[%d,%s)/%s" % \
* (self.chrom, self.start, str(self.end) # <<<<<<<<<<<<<<
* if self.end != sys.maxsize else "Inf", self.strand)
*
*/
__pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__6);
__pyx_t_2 += 2;
__Pyx_GIVEREF(__pyx_kp_u__6);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__6);
__pyx_t_4 = __Pyx_PyUnicode_From_long(__pyx_v_self->start, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__4);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__4);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__4);
/* "HTSeq/_HTSeq.pyx":96
* return "%s:[%d,%s)/%s" % \
* (self.chrom, self.start, str(self.end)
* if self.end != sys.maxsize else "Inf", self.strand) # <<<<<<<<<<<<<<
*
* property length:
*/
__pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 96, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_8) {
/* "HTSeq/_HTSeq.pyx":95
* def __str__(GenomicInterval self):
* return "%s:[%d,%s)/%s" % \
* (self.chrom, self.start, str(self.end) # <<<<<<<<<<<<<<
* if self.end != sys.maxsize else "Inf", self.strand)
*
*/
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_4 = __pyx_t_7;
__pyx_t_7 = 0;
} else {
__Pyx_INCREF(__pyx_n_u_Inf);
__pyx_t_4 = __pyx_n_u_Inf;
}
__pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_INCREF(__pyx_kp_u__7);
__pyx_t_2 += 2;
__Pyx_GIVEREF(__pyx_kp_u__7);
PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__7);
/* "HTSeq/_HTSeq.pyx":96
* return "%s:[%d,%s)/%s" % \
* (self.chrom, self.start, str(self.end)
* if self.end != sys.maxsize else "Inf", self.strand) # <<<<<<<<<<<<<<
*
* property length:
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_4);
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":94
*
* def __str__(GenomicInterval self):
* return "%s:[%d,%s)/%s" % \ # <<<<<<<<<<<<<<
* (self.chrom, self.start, str(self.end)
* if self.end != sys.maxsize else "Inf", self.strand)
*/
__pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":93
* str(self.end) if self.end != sys.maxsize else "Inf", self.strand)
*
* def __str__(GenomicInterval self): # <<<<<<<<<<<<<<
* return "%s:[%d,%s)/%s" % \
* (self.chrom, self.start, str(self.end)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":104
* is '-', in which case 'start' is changed."""
*
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* return self.end - self.start
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":105
*
* def __get__(GenomicInterval self):
* return self.end - self.start # <<<<<<<<<<<<<<
*
* def __set__(GenomicInterval self, long newLength):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->end - __pyx_v_self->start)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":104
* is '-', in which case 'start' is changed."""
*
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* return self.end - self.start
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":107
* return self.end - self.start
*
* def __set__(GenomicInterval self, long newLength): # <<<<<<<<<<<<<<
* if self._strand is not strand_minus:
* self.end = self.start + newLength
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newLength); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newLength) {
long __pyx_v_newLength;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
assert(__pyx_arg_newLength); {
__pyx_v_newLength = __Pyx_PyInt_As_long(__pyx_arg_newLength); if (unlikely((__pyx_v_newLength == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.length.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((long)__pyx_v_newLength));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_newLength) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
__Pyx_RefNannySetupContext("__set__", 0);
/* "HTSeq/_HTSeq.pyx":108
*
* def __set__(GenomicInterval self, long newLength):
* if self._strand is not strand_minus: # <<<<<<<<<<<<<<
* self.end = self.start + newLength
* else:
*/
__pyx_t_1 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_minus);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":109
* def __set__(GenomicInterval self, long newLength):
* if self._strand is not strand_minus:
* self.end = self.start + newLength # <<<<<<<<<<<<<<
* else:
* self.start = self.end - newLength
*/
__pyx_v_self->end = (__pyx_v_self->start + __pyx_v_newLength);
/* "HTSeq/_HTSeq.pyx":108
*
* def __set__(GenomicInterval self, long newLength):
* if self._strand is not strand_minus: # <<<<<<<<<<<<<<
* self.end = self.start + newLength
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":111
* self.end = self.start + newLength
* else:
* self.start = self.end - newLength # <<<<<<<<<<<<<<
*
* property start_d:
*/
/*else*/ {
__pyx_v_self->start = (__pyx_v_self->end - __pyx_v_newLength);
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":107
* return self.end - self.start
*
* def __set__(GenomicInterval self, long newLength): # <<<<<<<<<<<<<<
* if self._strand is not strand_minus:
* self.end = self.start + newLength
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":119
* length stays unchanged."""
*
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* if self._strand is not strand_minus:
* return self.start
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":120
*
* def __get__(GenomicInterval self):
* if self._strand is not strand_minus: # <<<<<<<<<<<<<<
* return self.start
* else:
*/
__pyx_t_1 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_minus);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":121
* def __get__(GenomicInterval self):
* if self._strand is not strand_minus:
* return self.start # <<<<<<<<<<<<<<
* else:
* return self.end - 1
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":120
*
* def __get__(GenomicInterval self):
* if self._strand is not strand_minus: # <<<<<<<<<<<<<<
* return self.start
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":123
* return self.start
* else:
* return self.end - 1 # <<<<<<<<<<<<<<
*
* def __set__(GenomicInterval self, long newStartd):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_self->end - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "HTSeq/_HTSeq.pyx":119
* length stays unchanged."""
*
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* if self._strand is not strand_minus:
* return self.start
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start_d.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":125
* return self.end - 1
*
* def __set__(GenomicInterval self, long newStartd): # <<<<<<<<<<<<<<
* if self._strand is not strand_minus:
* self.end = newStartd + self.length
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newStartd); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newStartd) {
long __pyx_v_newStartd;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
assert(__pyx_arg_newStartd); {
__pyx_v_newStartd = __Pyx_PyInt_As_long(__pyx_arg_newStartd); if (unlikely((__pyx_v_newStartd == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start_d.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((long)__pyx_v_newStartd));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_newStartd) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
long __pyx_t_6;
__Pyx_RefNannySetupContext("__set__", 0);
/* "HTSeq/_HTSeq.pyx":126
*
* def __set__(GenomicInterval self, long newStartd):
* if self._strand is not strand_minus: # <<<<<<<<<<<<<<
* self.end = newStartd + self.length
* self.start = newStartd
*/
__pyx_t_1 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_minus);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":127
* def __set__(GenomicInterval self, long newStartd):
* if self._strand is not strand_minus:
* self.end = newStartd + self.length # <<<<<<<<<<<<<<
* self.start = newStartd
* else:
*/
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_newStartd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_5); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->end = __pyx_t_6;
/* "HTSeq/_HTSeq.pyx":128
* if self._strand is not strand_minus:
* self.end = newStartd + self.length
* self.start = newStartd # <<<<<<<<<<<<<<
* else:
* self.start = newStartd + 1 - self.length
*/
__pyx_v_self->start = __pyx_v_newStartd;
/* "HTSeq/_HTSeq.pyx":126
*
* def __set__(GenomicInterval self, long newStartd):
* if self._strand is not strand_minus: # <<<<<<<<<<<<<<
* self.end = newStartd + self.length
* self.start = newStartd
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":130
* self.start = newStartd
* else:
* self.start = newStartd + 1 - self.length # <<<<<<<<<<<<<<
* self.end = newStartd + 1
*
*/
/*else*/ {
__pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_newStartd + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_self->start = __pyx_t_6;
/* "HTSeq/_HTSeq.pyx":131
* else:
* self.start = newStartd + 1 - self.length
* self.end = newStartd + 1 # <<<<<<<<<<<<<<
*
* property end_d:
*/
__pyx_v_self->end = (__pyx_v_newStartd + 1);
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":125
* return self.end - 1
*
* def __set__(GenomicInterval self, long newStartd): # <<<<<<<<<<<<<<
* if self._strand is not strand_minus:
* self.end = newStartd + self.length
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start_d.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":135
* property end_d:
*
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* if self._strand is not strand_minus:
* return self.end
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5end_d_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5end_d_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5end_d___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5end_d___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":136
*
* def __get__(GenomicInterval self):
* if self._strand is not strand_minus: # <<<<<<<<<<<<<<
* return self.end
* else:
*/
__pyx_t_1 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_minus);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":137
* def __get__(GenomicInterval self):
* if self._strand is not strand_minus:
* return self.end # <<<<<<<<<<<<<<
* else:
* return self.start - 1
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":136
*
* def __get__(GenomicInterval self):
* if self._strand is not strand_minus: # <<<<<<<<<<<<<<
* return self.end
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":139
* return self.end
* else:
* return self.start - 1 # <<<<<<<<<<<<<<
*
* property start_as_pos:
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_self->start - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "HTSeq/_HTSeq.pyx":135
* property end_d:
*
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* if self._strand is not strand_minus:
* return self.end
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.end_d.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":142
*
* property start_as_pos:
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* return GenomicPosition(self.chrom, self.start, self. strand)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":143
* property start_as_pos:
* def __get__(GenomicInterval self):
* return GenomicPosition(self.chrom, self.start, self. strand) # <<<<<<<<<<<<<<
*
* property end_as_pos:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_v_self->chrom);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":142
*
* property start_as_pos:
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* return GenomicPosition(self.chrom, self.start, self. strand)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start_as_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":146
*
* property end_as_pos:
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* return GenomicPosition(self.chrom, self.end, self. strand)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":147
* property end_as_pos:
* def __get__(GenomicInterval self):
* return GenomicPosition(self.chrom, self.end, self. strand) # <<<<<<<<<<<<<<
*
* property start_d_as_pos:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_v_self->chrom);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":146
*
* property end_as_pos:
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* return GenomicPosition(self.chrom, self.end, self. strand)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.end_as_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":150
*
* property start_d_as_pos:
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* return GenomicPosition(self.chrom, self.start_d, self. strand)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":151
* property start_d_as_pos:
* def __get__(GenomicInterval self):
* return GenomicPosition(self.chrom, self.start_d, self. strand) # <<<<<<<<<<<<<<
*
* property end_d_as_pos:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_v_self->chrom);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":150
*
* property start_d_as_pos:
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* return GenomicPosition(self.chrom, self.start_d, self. strand)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start_d_as_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":154
*
* property end_d_as_pos:
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* return GenomicPosition(self.chrom, self.end_d, self. strand)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":155
* property end_d_as_pos:
* def __get__(GenomicInterval self):
* return GenomicPosition(self.chrom, self.end_d, self. strand) # <<<<<<<<<<<<<<
*
* def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_v_self->chrom);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":154
*
* property end_d_as_pos:
* def __get__(GenomicInterval self): # <<<<<<<<<<<<<<
* return GenomicPosition(self.chrom, self.end_d, self. strand)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.end_d_as_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":157
* return GenomicPosition(self.chrom, self.end_d, self. strand)
*
* def __richcmp__(GenomicInterval self, GenomicInterval other, int op): # <<<<<<<<<<<<<<
* if op == 2: # ==
* if other == None:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_11__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_11__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "other", 0))) __PYX_ERR(0, 157, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10__richcmp__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_other), ((int)__pyx_v_op));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10__richcmp__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_other, int __pyx_v_op) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__richcmp__", 0);
/* "HTSeq/_HTSeq.pyx":158
*
* def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
* if op == 2: # == # <<<<<<<<<<<<<<
* if other == None:
* return False
*/
switch (__pyx_v_op) {
case 2:
/* "HTSeq/_HTSeq.pyx":159
* def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
* if op == 2: # ==
* if other == None: # <<<<<<<<<<<<<<
* return False
* return self._strand is other._strand and \
*/
__pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_other), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":160
* if op == 2: # ==
* if other == None:
* return False # <<<<<<<<<<<<<<
* return self._strand is other._strand and \
* self.start == other.start and self.end == other.end
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":159
* def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
* if op == 2: # ==
* if other == None: # <<<<<<<<<<<<<<
* return False
* return self._strand is other._strand and \
*/
}
/* "HTSeq/_HTSeq.pyx":161
* if other == None:
* return False
* return self._strand is other._strand and \ # <<<<<<<<<<<<<<
* self.start == other.start and self.end == other.end
* elif op == 3: # !=
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = (__pyx_v_self->_strand == __pyx_v_other->_strand);
if (__pyx_t_2) {
} else {
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L4_bool_binop_done;
}
/* "HTSeq/_HTSeq.pyx":162
* return False
* return self._strand is other._strand and \
* self.start == other.start and self.end == other.end # <<<<<<<<<<<<<<
* elif op == 3: # !=
* return not (self == other)
*/
__pyx_t_2 = (__pyx_v_self->start == __pyx_v_other->start);
if (__pyx_t_2) {
} else {
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = (__pyx_v_self->end == __pyx_v_other->end);
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __pyx_t_3;
__pyx_t_3 = 0;
__pyx_L4_bool_binop_done:;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":158
*
* def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
* if op == 2: # == # <<<<<<<<<<<<<<
* if other == None:
* return False
*/
break;
case 3:
/* "HTSeq/_HTSeq.pyx":164
* self.start == other.start and self.end == other.end
* elif op == 3: # !=
* return not (self == other) # <<<<<<<<<<<<<<
* else:
* raise NotImplementedError
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":163
* return self._strand is other._strand and \
* self.start == other.start and self.end == other.end
* elif op == 3: # != # <<<<<<<<<<<<<<
* return not (self == other)
* else:
*/
break;
default:
/* "HTSeq/_HTSeq.pyx":166
* return not (self == other)
* else:
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def __hash__(GenomicInterval self):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(0, 166, __pyx_L1_error)
break;
}
/* "HTSeq/_HTSeq.pyx":157
* return GenomicPosition(self.chrom, self.end_d, self. strand)
*
* def __richcmp__(GenomicInterval self, GenomicInterval other, int op): # <<<<<<<<<<<<<<
* if op == 2: # ==
* if other == None:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":168
* raise NotImplementedError
*
* def __hash__(GenomicInterval self): # <<<<<<<<<<<<<<
* return hash((self.chrom, self.start, self.end, self.strand))
*
*/
/* Python wrapper */
static Py_hash_t __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_13__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_13__hash__(PyObject *__pyx_v_self) {
Py_hash_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12__hash__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static Py_hash_t __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12__hash__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
Py_hash_t __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
Py_hash_t __pyx_t_5;
__Pyx_RefNannySetupContext("__hash__", 0);
/* "HTSeq/_HTSeq.pyx":169
*
* def __hash__(GenomicInterval self):
* return hash((self.chrom, self.start, self.end, self.strand)) # <<<<<<<<<<<<<<
*
* cpdef is_contained_in(GenomicInterval self, GenomicInterval iv):
*/
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_v_self->chrom);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_t_5 = PyObject_Hash(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_hash_t)-1))) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_5;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":168
* raise NotImplementedError
*
* def __hash__(GenomicInterval self): # <<<<<<<<<<<<<<
* return hash((self.chrom, self.start, self.end, self.strand))
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":171
* return hash((self.chrom, self.start, self.end, self.strand))
*
* cpdef is_contained_in(GenomicInterval self, GenomicInterval iv): # <<<<<<<<<<<<<<
* """Returns a boolean value indicating whether the 'self' interval
* is fully within the 'iv' interval.
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in(PyObject *__pyx_v_self, PyObject *__pyx_v_iv); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_is_contained_in(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
__Pyx_RefNannySetupContext("is_contained_in", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_contained_in); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_iv)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_iv));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":182
* - self.end <= iv.end
* """
* if iv == None: # <<<<<<<<<<<<<<
* return False
* if self.chrom != iv.chrom:
*/
__pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 182, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":183
* """
* if iv == None:
* return False # <<<<<<<<<<<<<<
* if self.chrom != iv.chrom:
* return False
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":182
* - self.end <= iv.end
* """
* if iv == None: # <<<<<<<<<<<<<<
* return False
* if self.chrom != iv.chrom:
*/
}
/* "HTSeq/_HTSeq.pyx":184
* if iv == None:
* return False
* if self.chrom != iv.chrom: # <<<<<<<<<<<<<<
* return False
* if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
__pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_self->chrom, __pyx_v_iv->chrom, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 184, __pyx_L1_error)
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":185
* return False
* if self.chrom != iv.chrom:
* return False # <<<<<<<<<<<<<<
* if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \
* self.strand is not iv._strand:
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":184
* if iv == None:
* return False
* if self.chrom != iv.chrom: # <<<<<<<<<<<<<<
* return False
* if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
}
/* "HTSeq/_HTSeq.pyx":186
* if self.chrom != iv.chrom:
* return False
* if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.strand is not iv._strand:
* return False
*/
__pyx_t_5 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__pyx_t_7 = (__pyx_t_5 != 0);
if (__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = (__pyx_t_7 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_6 = __pyx_t_5;
goto __pyx_L6_bool_binop_done;
}
/* "HTSeq/_HTSeq.pyx":187
* return False
* if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \
* self.strand is not iv._strand: # <<<<<<<<<<<<<<
* return False
* if self.start < iv.start or self.end > iv.end:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = (__pyx_t_1 != __pyx_v_iv->_strand);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_7 = (__pyx_t_5 != 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L6_bool_binop_done:;
/* "HTSeq/_HTSeq.pyx":186
* if self.chrom != iv.chrom:
* return False
* if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.strand is not iv._strand:
* return False
*/
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":188
* if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \
* self.strand is not iv._strand:
* return False # <<<<<<<<<<<<<<
* if self.start < iv.start or self.end > iv.end:
* return False
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":186
* if self.chrom != iv.chrom:
* return False
* if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.strand is not iv._strand:
* return False
*/
}
/* "HTSeq/_HTSeq.pyx":189
* self.strand is not iv._strand:
* return False
* if self.start < iv.start or self.end > iv.end: # <<<<<<<<<<<<<<
* return False
* return True
*/
__pyx_t_7 = ((__pyx_v_self->start < __pyx_v_iv->start) != 0);
if (!__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L10_bool_binop_done;
}
__pyx_t_7 = ((__pyx_v_self->end > __pyx_v_iv->end) != 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L10_bool_binop_done:;
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":190
* return False
* if self.start < iv.start or self.end > iv.end:
* return False # <<<<<<<<<<<<<<
* return True
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":189
* self.strand is not iv._strand:
* return False
* if self.start < iv.start or self.end > iv.end: # <<<<<<<<<<<<<<
* return False
* return True
*/
}
/* "HTSeq/_HTSeq.pyx":191
* if self.start < iv.start or self.end > iv.end:
* return False
* return True # <<<<<<<<<<<<<<
*
* cpdef contains(GenomicInterval self, GenomicInterval iv):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_True);
__pyx_r = Py_True;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":171
* return hash((self.chrom, self.start, self.end, self.strand))
*
* cpdef is_contained_in(GenomicInterval self, GenomicInterval iv): # <<<<<<<<<<<<<<
* """Returns a boolean value indicating whether the 'self' interval
* is fully within the 'iv' interval.
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.is_contained_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in(PyObject *__pyx_v_self, PyObject *__pyx_v_iv); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in[] = "Returns a boolean value indicating whether the 'self' interval \n is fully within the 'iv' interval.\n\n This is deemed the case if\007\n - both are on the same chromosome, and \n - both are on the same strand, or at least one of them is\n not stranded (i.e., has strand == '.'), and\n - self.start >= iv.start, and\n - self.end <= iv.end\n ";
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in(PyObject *__pyx_v_self, PyObject *__pyx_v_iv) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("is_contained_in (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 171, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_iv));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("is_contained_in", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_is_contained_in(__pyx_v_self, __pyx_v_iv, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.is_contained_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":193
* return True
*
* cpdef contains(GenomicInterval self, GenomicInterval iv): # <<<<<<<<<<<<<<
* """Returns a boolean value indicating whether the 'self' interval
* fully contains the 'iv' interval.
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains(PyObject *__pyx_v_self, PyObject *__pyx_v_iv); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_contains(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
__Pyx_RefNannySetupContext("contains", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_contains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_iv)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_iv));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":199
* See 'is_contained_in' for the exact criteria.
* """
* if iv == None: # <<<<<<<<<<<<<<
* return False
* return iv.is_contained_in(self)
*/
__pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":200
* """
* if iv == None:
* return False # <<<<<<<<<<<<<<
* return iv.is_contained_in(self)
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":199
* See 'is_contained_in' for the exact criteria.
* """
* if iv == None: # <<<<<<<<<<<<<<
* return False
* return iv.is_contained_in(self)
*/
}
/* "HTSeq/_HTSeq.pyx":201
* if iv == None:
* return False
* return iv.is_contained_in(self) # <<<<<<<<<<<<<<
*
* cpdef overlaps(GenomicInterval self, GenomicInterval iv):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_iv->__pyx_vtab)->is_contained_in(__pyx_v_iv, __pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":193
* return True
*
* cpdef contains(GenomicInterval self, GenomicInterval iv): # <<<<<<<<<<<<<<
* """Returns a boolean value indicating whether the 'self' interval
* fully contains the 'iv' interval.
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains(PyObject *__pyx_v_self, PyObject *__pyx_v_iv); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_16contains[] = "Returns a boolean value indicating whether the 'self' interval \n fully contains the 'iv' interval.\n\n See 'is_contained_in' for the exact criteria.\n ";
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains(PyObject *__pyx_v_self, PyObject *__pyx_v_iv) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("contains (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 193, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_16contains(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_iv));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_16contains(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("contains", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_contains(__pyx_v_self, __pyx_v_iv, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":203
* return iv.is_contained_in(self)
*
* cpdef overlaps(GenomicInterval self, GenomicInterval iv): # <<<<<<<<<<<<<<
* """Returns a boolean value indicating whether the 'self' interval
* overlaps the 'iv' interval.
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps(PyObject *__pyx_v_self, PyObject *__pyx_v_iv); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_overlaps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
__Pyx_RefNannySetupContext("overlaps", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overlaps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_iv)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_iv));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":213
* - the actual intervals overlap
* """
* if iv == None: # <<<<<<<<<<<<<<
* return False
* if self.chrom != iv.chrom:
*/
__pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 213, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":214
* """
* if iv == None:
* return False # <<<<<<<<<<<<<<
* if self.chrom != iv.chrom:
* return False
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":213
* - the actual intervals overlap
* """
* if iv == None: # <<<<<<<<<<<<<<
* return False
* if self.chrom != iv.chrom:
*/
}
/* "HTSeq/_HTSeq.pyx":215
* if iv == None:
* return False
* if self.chrom != iv.chrom: # <<<<<<<<<<<<<<
* return False
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
__pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_self->chrom, __pyx_v_iv->chrom, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":216
* return False
* if self.chrom != iv.chrom:
* return False # <<<<<<<<<<<<<<
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
* self.strand is not iv.strand:
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":215
* if iv == None:
* return False
* if self.chrom != iv.chrom: # <<<<<<<<<<<<<<
* return False
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
}
/* "HTSeq/_HTSeq.pyx":217
* if self.chrom != iv.chrom:
* return False
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.strand is not iv.strand:
* return False
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_7 = (__pyx_t_5 != 0);
if (__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = (__pyx_t_7 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_6 = __pyx_t_5;
goto __pyx_L6_bool_binop_done;
}
/* "HTSeq/_HTSeq.pyx":218
* return False
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
* self.strand is not iv.strand: # <<<<<<<<<<<<<<
* return False
* if self.start <= iv.start:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = (__pyx_t_1 != __pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_7 = (__pyx_t_5 != 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L6_bool_binop_done:;
/* "HTSeq/_HTSeq.pyx":217
* if self.chrom != iv.chrom:
* return False
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.strand is not iv.strand:
* return False
*/
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":219
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
* self.strand is not iv.strand:
* return False # <<<<<<<<<<<<<<
* if self.start <= iv.start:
* return self.end > iv.start
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":217
* if self.chrom != iv.chrom:
* return False
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.strand is not iv.strand:
* return False
*/
}
/* "HTSeq/_HTSeq.pyx":220
* self.strand is not iv.strand:
* return False
* if self.start <= iv.start: # <<<<<<<<<<<<<<
* return self.end > iv.start
* else:
*/
__pyx_t_6 = ((__pyx_v_self->start <= __pyx_v_iv->start) != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":221
* return False
* if self.start <= iv.start:
* return self.end > iv.start # <<<<<<<<<<<<<<
* else:
* return iv.end > self.start
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->end > __pyx_v_iv->start)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":220
* self.strand is not iv.strand:
* return False
* if self.start <= iv.start: # <<<<<<<<<<<<<<
* return self.end > iv.start
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":223
* return self.end > iv.start
* else:
* return iv.end > self.start # <<<<<<<<<<<<<<
*
* def range(GenomicInterval self, long int step=1):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_iv->end > __pyx_v_self->start)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "HTSeq/_HTSeq.pyx":203
* return iv.is_contained_in(self)
*
* cpdef overlaps(GenomicInterval self, GenomicInterval iv): # <<<<<<<<<<<<<<
* """Returns a boolean value indicating whether the 'self' interval
* overlaps the 'iv' interval.
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.overlaps", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps(PyObject *__pyx_v_self, PyObject *__pyx_v_iv); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps[] = "Returns a boolean value indicating whether the 'self' interval \n overlaps the 'iv' interval.\n\n This is deemed the case if\n - both are on the same chromosome, and \n - both are on the same strand, or at least one of them is\n not stranded (i.e., has strand == '.'), and\n - the actual intervals overlap\n ";
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps(PyObject *__pyx_v_self, PyObject *__pyx_v_iv) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("overlaps (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 203, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_iv));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("overlaps", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_overlaps(__pyx_v_self, __pyx_v_iv, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.overlaps", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":225
* return iv.end > self.start
*
* def range(GenomicInterval self, long int step=1): # <<<<<<<<<<<<<<
* """Generate an iterator over the GenomicPositions covered by the interval,
* running from start to end.
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_21range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_20range[] = "Generate an iterator over the GenomicPositions covered by the interval,\n running from start to end.\n ";
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_21range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
long __pyx_v_step;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("range (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "range") < 0)) __PYX_ERR(0, 225, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
if (values[0]) {
__pyx_v_step = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_step == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
} else {
__pyx_v_step = ((long)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("range", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 225, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.range", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_20range(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), __pyx_v_step);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_20range(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_step) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("range", 0);
/* "HTSeq/_HTSeq.pyx":229
* running from start to end.
* """
* return _HTSeq_internal.GenomicInterval_range(self, step) # <<<<<<<<<<<<<<
*
* def range_d(GenomicInterval self, long int step=1):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HTSeq_internal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GenomicInterval_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_t_2};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_t_2};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":225
* return iv.end > self.start
*
* def range(GenomicInterval self, long int step=1): # <<<<<<<<<<<<<<
* """Generate an iterator over the GenomicPositions covered by the interval,
* running from start to end.
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.range", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":231
* return _HTSeq_internal.GenomicInterval_range(self, step)
*
* def range_d(GenomicInterval self, long int step=1): # <<<<<<<<<<<<<<
* """Generate an iterator over the GenomicPositions covered by the interval.
* running from start_d to end_d.
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_23range_d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_22range_d[] = "Generate an iterator over the GenomicPositions covered by the interval.\n running from start_d to end_d.\n ";
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_23range_d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
long __pyx_v_step;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("range_d (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "range_d") < 0)) __PYX_ERR(0, 231, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
if (values[0]) {
__pyx_v_step = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_step == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L3_error)
} else {
__pyx_v_step = ((long)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("range_d", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 231, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.range_d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_22range_d(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), __pyx_v_step);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_22range_d(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_step) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("range_d", 0);
/* "HTSeq/_HTSeq.pyx":235
* running from start_d to end_d.
* """
* return _HTSeq_internal.GenomicInterval_ranged(self, step) # <<<<<<<<<<<<<<
*
* cpdef extend_to_include(GenomicInterval self, GenomicInterval iv):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HTSeq_internal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GenomicInterval_ranged); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_t_2};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_t_2};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":231
* return _HTSeq_internal.GenomicInterval_range(self, step)
*
* def range_d(GenomicInterval self, long int step=1): # <<<<<<<<<<<<<<
* """Generate an iterator over the GenomicPositions covered by the interval.
* running from start_d to end_d.
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.range_d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":237
* return _HTSeq_internal.GenomicInterval_ranged(self, step)
*
* cpdef extend_to_include(GenomicInterval self, GenomicInterval iv): # <<<<<<<<<<<<<<
* """Extend the interval such that it includes iv."""
* if iv is None:
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include(PyObject *__pyx_v_self, PyObject *__pyx_v_iv); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_extend_to_include(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
long __pyx_t_8;
long __pyx_t_9;
long __pyx_t_10;
__Pyx_RefNannySetupContext("extend_to_include", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extend_to_include); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_iv)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_iv));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":239
* cpdef extend_to_include(GenomicInterval self, GenomicInterval iv):
* """Extend the interval such that it includes iv."""
* if iv is None: # <<<<<<<<<<<<<<
* raise TypeError, "Cannot extend an interval to include None."
* if self.chrom != iv.chrom:
*/
__pyx_t_5 = (((PyObject *)__pyx_v_iv) == Py_None);
__pyx_t_6 = (__pyx_t_5 != 0);
if (unlikely(__pyx_t_6)) {
/* "HTSeq/_HTSeq.pyx":240
* """Extend the interval such that it includes iv."""
* if iv is None:
* raise TypeError, "Cannot extend an interval to include None." # <<<<<<<<<<<<<<
* if self.chrom != iv.chrom:
* raise ValueError, "Cannot extend an interval to include an interval on another chromosome."
*/
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Cannot_extend_an_interval_to_inc, 0, 0);
__PYX_ERR(0, 240, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":239
* cpdef extend_to_include(GenomicInterval self, GenomicInterval iv):
* """Extend the interval such that it includes iv."""
* if iv is None: # <<<<<<<<<<<<<<
* raise TypeError, "Cannot extend an interval to include None."
* if self.chrom != iv.chrom:
*/
}
/* "HTSeq/_HTSeq.pyx":241
* if iv is None:
* raise TypeError, "Cannot extend an interval to include None."
* if self.chrom != iv.chrom: # <<<<<<<<<<<<<<
* raise ValueError, "Cannot extend an interval to include an interval on another chromosome."
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
__pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_self->chrom, __pyx_v_iv->chrom, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 241, __pyx_L1_error)
__pyx_t_5 = (__pyx_t_6 != 0);
if (unlikely(__pyx_t_5)) {
/* "HTSeq/_HTSeq.pyx":242
* raise TypeError, "Cannot extend an interval to include None."
* if self.chrom != iv.chrom:
* raise ValueError, "Cannot extend an interval to include an interval on another chromosome." # <<<<<<<<<<<<<<
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
* self.strand is not iv.strand:
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Cannot_extend_an_interval_to_inc_2, 0, 0);
__PYX_ERR(0, 242, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":241
* if iv is None:
* raise TypeError, "Cannot extend an interval to include None."
* if self.chrom != iv.chrom: # <<<<<<<<<<<<<<
* raise ValueError, "Cannot extend an interval to include an interval on another chromosome."
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
}
/* "HTSeq/_HTSeq.pyx":243
* if self.chrom != iv.chrom:
* raise ValueError, "Cannot extend an interval to include an interval on another chromosome."
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.strand is not iv.strand:
* raise ValueError, "Cannot extend an interval to include an interval on another strand."
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
} else {
__pyx_t_5 = __pyx_t_7;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = (__pyx_t_7 != 0);
if (__pyx_t_6) {
} else {
__pyx_t_5 = __pyx_t_6;
goto __pyx_L6_bool_binop_done;
}
/* "HTSeq/_HTSeq.pyx":244
* raise ValueError, "Cannot extend an interval to include an interval on another chromosome."
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
* self.strand is not iv.strand: # <<<<<<<<<<<<<<
* raise ValueError, "Cannot extend an interval to include an interval on another strand."
* self.start = min(self.start, iv.start)
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = (__pyx_t_1 != __pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_7 = (__pyx_t_6 != 0);
__pyx_t_5 = __pyx_t_7;
__pyx_L6_bool_binop_done:;
/* "HTSeq/_HTSeq.pyx":243
* if self.chrom != iv.chrom:
* raise ValueError, "Cannot extend an interval to include an interval on another chromosome."
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.strand is not iv.strand:
* raise ValueError, "Cannot extend an interval to include an interval on another strand."
*/
if (unlikely(__pyx_t_5)) {
/* "HTSeq/_HTSeq.pyx":245
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
* self.strand is not iv.strand:
* raise ValueError, "Cannot extend an interval to include an interval on another strand." # <<<<<<<<<<<<<<
* self.start = min(self.start, iv.start)
* self.end = max(self.end, iv.end)
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Cannot_extend_an_interval_to_inc_3, 0, 0);
__PYX_ERR(0, 245, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":243
* if self.chrom != iv.chrom:
* raise ValueError, "Cannot extend an interval to include an interval on another chromosome."
* if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.strand is not iv.strand:
* raise ValueError, "Cannot extend an interval to include an interval on another strand."
*/
}
/* "HTSeq/_HTSeq.pyx":246
* self.strand is not iv.strand:
* raise ValueError, "Cannot extend an interval to include an interval on another strand."
* self.start = min(self.start, iv.start) # <<<<<<<<<<<<<<
* self.end = max(self.end, iv.end)
*
*/
__pyx_t_8 = __pyx_v_iv->start;
__pyx_t_9 = __pyx_v_self->start;
if (((__pyx_t_8 < __pyx_t_9) != 0)) {
__pyx_t_10 = __pyx_t_8;
} else {
__pyx_t_10 = __pyx_t_9;
}
__pyx_v_self->start = __pyx_t_10;
/* "HTSeq/_HTSeq.pyx":247
* raise ValueError, "Cannot extend an interval to include an interval on another strand."
* self.start = min(self.start, iv.start)
* self.end = max(self.end, iv.end) # <<<<<<<<<<<<<<
*
* def copy(self):
*/
__pyx_t_10 = __pyx_v_iv->end;
__pyx_t_8 = __pyx_v_self->end;
if (((__pyx_t_10 > __pyx_t_8) != 0)) {
__pyx_t_9 = __pyx_t_10;
} else {
__pyx_t_9 = __pyx_t_8;
}
__pyx_v_self->end = __pyx_t_9;
/* "HTSeq/_HTSeq.pyx":237
* return _HTSeq_internal.GenomicInterval_ranged(self, step)
*
* cpdef extend_to_include(GenomicInterval self, GenomicInterval iv): # <<<<<<<<<<<<<<
* """Extend the interval such that it includes iv."""
* if iv is None:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.extend_to_include", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include(PyObject *__pyx_v_self, PyObject *__pyx_v_iv); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include[] = "Extend the interval such that it includes iv.";
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include(PyObject *__pyx_v_self, PyObject *__pyx_v_iv) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("extend_to_include (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 237, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_iv));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("extend_to_include", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_extend_to_include(__pyx_v_self, __pyx_v_iv, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.extend_to_include", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":249
* self.end = max(self.end, iv.end)
*
* def copy(self): # <<<<<<<<<<<<<<
* return GenomicInterval(self.chrom, self.start, self.end, self.strand)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_27copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_27copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("copy (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_26copy(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_26copy(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("copy", 0);
/* "HTSeq/_HTSeq.pyx":250
*
* def copy(self):
* return GenomicInterval(self.chrom, self.start, self.end, self.strand) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_v_self->chrom);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":249
* self.end = max(self.end, iv.end)
*
* def copy(self): # <<<<<<<<<<<<<<
* return GenomicInterval(self.chrom, self.start, self.end, self.strand)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":5
* cdef class GenomicInterval:
*
* cdef public str chrom # <<<<<<<<<<<<<<
* cdef public long start
* cdef public long end
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->chrom);
__pyx_r = __pyx_v_self->chrom;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 5, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->chrom);
__Pyx_DECREF(__pyx_v_self->chrom);
__pyx_v_self->chrom = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.chrom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->chrom);
__Pyx_DECREF(__pyx_v_self->chrom);
__pyx_v_self->chrom = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":6
*
* cdef public str chrom
* cdef public long start # <<<<<<<<<<<<<<
* cdef public long end
* cdef str _strand
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
long __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 6, __pyx_L1_error)
__pyx_v_self->start = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":7
* cdef public str chrom
* cdef public long start
* cdef public long end # <<<<<<<<<<<<<<
* cdef str _strand
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
long __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 7, __pyx_L1_error)
__pyx_v_self->end = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.end.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":253
*
*
* def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."): # <<<<<<<<<<<<<<
* strand = intern(strand)
* if strand.se is not strand_minus:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_1GenomicInterval_from_directional(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_1GenomicInterval_from_directional = {"GenomicInterval_from_directional", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_1GenomicInterval_from_directional, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_1GenomicInterval_from_directional(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_chrom = 0;
long __pyx_v_start_d;
long __pyx_v_length;
PyObject *__pyx_v_strand = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("GenomicInterval_from_directional (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_start_d,&__pyx_n_s_length,&__pyx_n_s_strand,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject*)__pyx_kp_u__8);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start_d)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("GenomicInterval_from_directional", 0, 3, 4, 1); __PYX_ERR(0, 253, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("GenomicInterval_from_directional", 0, 3, 4, 2); __PYX_ERR(0, 253, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "GenomicInterval_from_directional") < 0)) __PYX_ERR(0, 253, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_chrom = ((PyObject*)values[0]);
__pyx_v_start_d = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_start_d == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
__pyx_v_length = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_length == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
__pyx_v_strand = ((PyObject*)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("GenomicInterval_from_directional", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 253, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval_from_directional", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 253, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 253, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_GenomicInterval_from_directional(__pyx_self, __pyx_v_chrom, __pyx_v_start_d, __pyx_v_length, __pyx_v_strand);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_GenomicInterval_from_directional(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chrom, long __pyx_v_start_d, long __pyx_v_length, PyObject *__pyx_v_strand) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("GenomicInterval_from_directional", 0);
__Pyx_INCREF(__pyx_v_strand);
/* "HTSeq/_HTSeq.pyx":254
*
* def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):
* strand = intern(strand) # <<<<<<<<<<<<<<
* if strand.se is not strand_minus:
* return GenomicInterval(chrom, start_d, start_d + length, strand)
*/
__pyx_t_1 = __Pyx_Intern(__pyx_v_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 254, __pyx_L1_error)
__Pyx_DECREF_SET(__pyx_v_strand, ((PyObject*)__pyx_t_1));
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":255
* def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):
* strand = intern(strand)
* if strand.se is not strand_minus: # <<<<<<<<<<<<<<
* return GenomicInterval(chrom, start_d, start_d + length, strand)
* else:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_strand, __pyx_n_s_se); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_minus);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":256
* strand = intern(strand)
* if strand.se is not strand_minus:
* return GenomicInterval(chrom, start_d, start_d + length, strand) # <<<<<<<<<<<<<<
* else:
* return GenomicInterval(chrom, start_d - length + 1, start_d + 1, strand)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_start_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_start_d + __pyx_v_length)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_strand);
__pyx_t_1 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":255
* def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):
* strand = intern(strand)
* if strand.se is not strand_minus: # <<<<<<<<<<<<<<
* return GenomicInterval(chrom, start_d, start_d + length, strand)
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":258
* return GenomicInterval(chrom, start_d, start_d + length, strand)
* else:
* return GenomicInterval(chrom, start_d - length + 1, start_d + 1, strand) # <<<<<<<<<<<<<<
*
*
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyInt_From_long(((__pyx_v_start_d - __pyx_v_length) + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_start_d + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_strand);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
}
/* "HTSeq/_HTSeq.pyx":253
*
*
* def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."): # <<<<<<<<<<<<<<
* strand = intern(strand)
* if strand.se is not strand_minus:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval_from_directional", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_strand);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":279
* """
*
* def __init__(self, str chrom, long int pos, str strand='.'): # <<<<<<<<<<<<<<
* GenomicInterval.__init__(self, chrom, pos, pos + 1, strand)
*
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_chrom = 0;
long __pyx_v_pos;
PyObject *__pyx_v_strand = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_pos,&__pyx_n_s_strand,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject*)__pyx_kp_u__8);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 279, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 279, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_chrom = ((PyObject*)values[0]);
__pyx_v_pos = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_pos == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L3_error)
__pyx_v_strand = ((PyObject*)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 279, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 279, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 279, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self), __pyx_v_chrom, __pyx_v_pos, __pyx_v_strand);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self, PyObject *__pyx_v_chrom, long __pyx_v_pos, PyObject *__pyx_v_strand) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
/* "HTSeq/_HTSeq.pyx":280
*
* def __init__(self, str chrom, long int pos, str strand='.'):
* GenomicInterval.__init__(self, chrom, pos, pos + 1, strand) # <<<<<<<<<<<<<<
*
* property pos:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_pos + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_chrom, __pyx_t_3, __pyx_t_4, __pyx_v_strand};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_chrom, __pyx_t_3, __pyx_t_4, __pyx_v_strand};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
__pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_chrom);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_t_4);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_strand);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":279
* """
*
* def __init__(self, str chrom, long int pos, str strand='.'): # <<<<<<<<<<<<<<
* GenomicInterval.__init__(self, chrom, pos, pos + 1, strand)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":288
* """
*
* def __get__(self): # <<<<<<<<<<<<<<
* return self.start_d
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":289
*
* def __get__(self):
* return self.start_d # <<<<<<<<<<<<<<
*
* def __set__(self, long newValue):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":288
* """
*
* def __get__(self): # <<<<<<<<<<<<<<
* return self.start_d
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":291
* return self.start_d
*
* def __set__(self, long newValue): # <<<<<<<<<<<<<<
* self.start_d = newValue
*
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newValue); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newValue) {
long __pyx_v_newValue;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
assert(__pyx_arg_newValue); {
__pyx_v_newValue = __Pyx_PyInt_As_long(__pyx_arg_newValue); if (unlikely((__pyx_v_newValue == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self), ((long)__pyx_v_newValue));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self, long __pyx_v_newValue) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
/* "HTSeq/_HTSeq.pyx":292
*
* def __set__(self, long newValue):
* self.start_d = newValue # <<<<<<<<<<<<<<
*
* property end:
*/
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_newValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start_d, __pyx_t_1) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":291
* return self.start_d
*
* def __set__(self, long newValue): # <<<<<<<<<<<<<<
* self.start_d = newValue
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":296
* property end:
*
* def __get__(self): # <<<<<<<<<<<<<<
* return self.start + 1
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3end_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3end_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3end___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":297
*
* def __get__(self):
* return self.start + 1 # <<<<<<<<<<<<<<
*
* property length:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->__pyx_base.start + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":296
* property end:
*
* def __get__(self): # <<<<<<<<<<<<<<
* return self.start + 1
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":301
* property length:
*
* def __get__(self): # <<<<<<<<<<<<<<
* return 1
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_6length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_6length_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6length___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6length___get__(CYTHON_UNUSED struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":302
*
* def __get__(self):
* return 1 # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_int_1);
__pyx_r = __pyx_int_1;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":301
* property length:
*
* def __get__(self): # <<<<<<<<<<<<<<
* return 1
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":304
* return 1
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "<%s object '%s':%d, strand '%s'>" % \
* (self.__class__.__name__, self.chrom, self.pos, self.strand)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_2__repr__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "HTSeq/_HTSeq.pyx":305
*
* def __repr__(self):
* return "<%s object '%s':%d, strand '%s'>" % \ # <<<<<<<<<<<<<<
* (self.__class__.__name__, self.chrom, self.pos, self.strand)
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__Pyx_INCREF(__pyx_kp_u__2);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
/* "HTSeq/_HTSeq.pyx":306
* def __repr__(self):
* return "<%s object '%s':%d, strand '%s'>" % \
* (self.__class__.__name__, self.chrom, self.pos, self.strand) # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u_object);
__pyx_t_2 += 9;
__Pyx_GIVEREF(__pyx_kp_u_object);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object);
__pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__9);
__pyx_t_2 += 2;
__Pyx_GIVEREF(__pyx_kp_u__9);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__9);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5);
__pyx_t_5 = 0;
__Pyx_INCREF(__pyx_kp_u_strand_3);
__pyx_t_2 += 10;
__Pyx_GIVEREF(__pyx_kp_u_strand_3);
PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_strand_3);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__5);
__pyx_t_2 += 2;
__Pyx_GIVEREF(__pyx_kp_u__5);
PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__5);
/* "HTSeq/_HTSeq.pyx":305
*
* def __repr__(self):
* return "<%s object '%s':%d, strand '%s'>" % \ # <<<<<<<<<<<<<<
* (self.__class__.__name__, self.chrom, self.pos, self.strand)
*
*/
__pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":304
* return 1
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "<%s object '%s':%d, strand '%s'>" % \
* (self.__class__.__name__, self.chrom, self.pos, self.strand)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":308
* (self.__class__.__name__, self.chrom, self.pos, self.strand)
*
* def __str__(self): # <<<<<<<<<<<<<<
* return "%s:%d/%s" % (self.chrom, self.pos, self.strand)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_5__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_4__str__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_4__str__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
/* "HTSeq/_HTSeq.pyx":309
*
* def __str__(self):
* return "%s:%d/%s" % (self.chrom, self.pos, self.strand) # <<<<<<<<<<<<<<
*
* def __reduce__(GenomicPosition self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__10);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__10);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__10);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
__pyx_t_5 = 0;
__Pyx_INCREF(__pyx_kp_u__11);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__11);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__11);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":308
* (self.__class__.__name__, self.chrom, self.pos, self.strand)
*
* def __str__(self): # <<<<<<<<<<<<<<
* return "%s:%d/%s" % (self.chrom, self.pos, self.strand)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":311
* return "%s:%d/%s" % (self.chrom, self.pos, self.strand)
*
* def __reduce__(GenomicPosition self): # <<<<<<<<<<<<<<
* return GenomicPosition, (self.chrom, self.pos, self.strand)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6__reduce__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__reduce__", 0);
/* "HTSeq/_HTSeq.pyx":312
*
* def __reduce__(GenomicPosition self):
* return GenomicPosition, (self.chrom, self.pos, self.strand) # <<<<<<<<<<<<<<
*
* def copy(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_self->__pyx_base.chrom);
__Pyx_GIVEREF(__pyx_v_self->__pyx_base.chrom);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition));
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":311
* return "%s:%d/%s" % (self.chrom, self.pos, self.strand)
*
* def __reduce__(GenomicPosition self): # <<<<<<<<<<<<<<
* return GenomicPosition, (self.chrom, self.pos, self.strand)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":314
* return GenomicPosition, (self.chrom, self.pos, self.strand)
*
* def copy(self): # <<<<<<<<<<<<<<
* return GenomicPosition(self.chrom, self.pos, self.strand)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("copy (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_8copy(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_8copy(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("copy", 0);
/* "HTSeq/_HTSeq.pyx":315
*
* def copy(self):
* return GenomicPosition(self.chrom, self.pos, self.strand) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_self->__pyx_base.chrom);
__Pyx_GIVEREF(__pyx_v_self->__pyx_base.chrom);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":314
* return GenomicPosition, (self.chrom, self.pos, self.strand)
*
* def copy(self): # <<<<<<<<<<<<<<
* return GenomicPosition(self.chrom, self.pos, self.strand)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":327
*
* @classmethod
* def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""): # <<<<<<<<<<<<<<
* ncv = cls()
* ncv.iv = iv
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_1create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_1create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
PyObject *__pyx_v_typecode = 0;
PyObject *__pyx_v_storage = 0;
PyObject *__pyx_v_memmap_dir = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("create (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iv,&__pyx_n_s_typecode,&__pyx_n_s_storage,&__pyx_n_s_memmap_dir,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject*)__pyx_kp_u__12);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iv)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typecode)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("create", 0, 3, 4, 1); __PYX_ERR(0, 327, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("create", 0, 3, 4, 2); __PYX_ERR(0, 327, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memmap_dir);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 327, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)values[0]);
__pyx_v_typecode = ((PyObject*)values[1]);
__pyx_v_storage = ((PyObject*)values[2]);
__pyx_v_memmap_dir = ((PyObject*)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 327, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 327, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_typecode), (&PyUnicode_Type), 1, "typecode", 1))) __PYX_ERR(0, 327, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage), (&PyUnicode_Type), 1, "storage", 1))) __PYX_ERR(0, 327, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memmap_dir), (&PyUnicode_Type), 1, "memmap_dir", 1))) __PYX_ERR(0, 327, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_create(((PyTypeObject*)__pyx_v_cls), __pyx_v_iv, __pyx_v_typecode, __pyx_v_storage, __pyx_v_memmap_dir);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_create(PyTypeObject *__pyx_v_cls, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, PyObject *__pyx_v_typecode, PyObject *__pyx_v_storage, PyObject *__pyx_v_memmap_dir) {
PyObject *__pyx_v_ncv = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
__Pyx_RefNannySetupContext("create", 0);
/* "HTSeq/_HTSeq.pyx":328
* @classmethod
* def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):
* ncv = cls() # <<<<<<<<<<<<<<
* ncv.iv = iv
* if storage == "ndarray":
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_v_cls)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ncv = __pyx_t_1;
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":329
* def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):
* ncv = cls()
* ncv.iv = iv # <<<<<<<<<<<<<<
* if storage == "ndarray":
* if typecode != 'O':
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_iv, ((PyObject *)__pyx_v_iv)) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":330
* ncv = cls()
* ncv.iv = iv
* if storage == "ndarray": # <<<<<<<<<<<<<<
* if typecode != 'O':
* ncv.array = numpy.zeros(shape=(iv.length, ), dtype=typecode)
*/
__pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_n_u_ndarray, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 330, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":331
* ncv.iv = iv
* if storage == "ndarray":
* if typecode != 'O': # <<<<<<<<<<<<<<
* ncv.array = numpy.zeros(shape=(iv.length, ), dtype=typecode)
* else:
*/
__pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_typecode, __pyx_n_u_O, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 331, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":332
* if storage == "ndarray":
* if typecode != 'O':
* ncv.array = numpy.zeros(shape=(iv.length, ), dtype=typecode) # <<<<<<<<<<<<<<
* else:
* ncv.array = numpy.empty(shape=(iv.length, ), dtype=typecode)
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__pyx_t_5 = 0;
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_6) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_typecode) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_array, __pyx_t_6) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":331
* ncv.iv = iv
* if storage == "ndarray":
* if typecode != 'O': # <<<<<<<<<<<<<<
* ncv.array = numpy.zeros(shape=(iv.length, ), dtype=typecode)
* else:
*/
goto __pyx_L4;
}
/* "HTSeq/_HTSeq.pyx":334
* ncv.array = numpy.zeros(shape=(iv.length, ), dtype=typecode)
* else:
* ncv.array = numpy.empty(shape=(iv.length, ), dtype=typecode) # <<<<<<<<<<<<<<
* ncv.array[:] = None
* elif storage == "memmap":
*/
/*else*/ {
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_v_typecode) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_array, __pyx_t_5) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":335
* else:
* ncv.array = numpy.empty(shape=(iv.length, ), dtype=typecode)
* ncv.array[:] = None # <<<<<<<<<<<<<<
* elif storage == "memmap":
* ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ncv, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_PyObject_SetSlice(__pyx_t_5, Py_None, 0, 0, NULL, NULL, &__pyx_slice__13, 0, 0, 1) < 0) __PYX_ERR(0, 335, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_L4:;
/* "HTSeq/_HTSeq.pyx":330
* ncv = cls()
* ncv.iv = iv
* if storage == "ndarray": # <<<<<<<<<<<<<<
* if typecode != 'O':
* ncv.array = numpy.zeros(shape=(iv.length, ), dtype=typecode)
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":336
* ncv.array = numpy.empty(shape=(iv.length, ), dtype=typecode)
* ncv.array[:] = None
* elif storage == "memmap": # <<<<<<<<<<<<<<
* ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
* filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
*/
__pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_n_u_memmap, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":337
* ncv.array[:] = None
* elif storage == "memmap":
* ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode, # <<<<<<<<<<<<<<
* filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
* elif storage == "step":
*/
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_memmap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__pyx_t_1 = 0;
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_t_4) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_typecode) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":338
* elif storage == "memmap":
* ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
* filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+') # <<<<<<<<<<<<<<
* elif storage == "step":
* ncv.array = StepVector.StepVector.create(typecode=typecode)
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyNumber_Add(__pyx_v_iv->chrom, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_u_nmm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
__pyx_t_9 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
__pyx_t_9 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_memmap_dir, __pyx_t_7};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_memmap_dir, __pyx_t_7};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
{
__pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
if (__pyx_t_8) {
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
}
__Pyx_INCREF(__pyx_v_memmap_dir);
__Pyx_GIVEREF(__pyx_v_memmap_dir);
PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_memmap_dir);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
__pyx_t_7 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_filename, __pyx_t_4) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_kp_u_w) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":337
* ncv.array[:] = None
* elif storage == "memmap":
* ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode, # <<<<<<<<<<<<<<
* filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
* elif storage == "step":
*/
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_array, __pyx_t_4) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":336
* ncv.array = numpy.empty(shape=(iv.length, ), dtype=typecode)
* ncv.array[:] = None
* elif storage == "memmap": # <<<<<<<<<<<<<<
* ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
* filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":339
* ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
* filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
* elif storage == "step": # <<<<<<<<<<<<<<
* ncv.array = StepVector.StepVector.create(typecode=typecode)
* else:
*/
__pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_n_u_step, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 339, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_3 != 0);
if (likely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":340
* filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
* elif storage == "step":
* ncv.array = StepVector.StepVector.create(typecode=typecode) # <<<<<<<<<<<<<<
* else:
* raise ValueError, "Illegal storage mode."
*/
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_StepVector); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepVector); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_create); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_typecode, __pyx_v_typecode) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_array, __pyx_t_6) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":339
* ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
* filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
* elif storage == "step": # <<<<<<<<<<<<<<
* ncv.array = StepVector.StepVector.create(typecode=typecode)
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":342
* ncv.array = StepVector.StepVector.create(typecode=typecode)
* else:
* raise ValueError, "Illegal storage mode." # <<<<<<<<<<<<<<
* ncv._storage = storage
* # TODO: Test whether offset works properly
*/
/*else*/ {
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Illegal_storage_mode, 0, 0);
__PYX_ERR(0, 342, __pyx_L1_error)
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":343
* else:
* raise ValueError, "Illegal storage mode."
* ncv._storage = storage # <<<<<<<<<<<<<<
* # TODO: Test whether offset works properly
* ncv.offset = iv.start
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_storage_2, __pyx_v_storage) < 0) __PYX_ERR(0, 343, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":345
* ncv._storage = storage
* # TODO: Test whether offset works properly
* ncv.offset = iv.start # <<<<<<<<<<<<<<
* ncv.is_vector_of_sets = False
* return ncv
*/
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_offset, __pyx_t_6) < 0) __PYX_ERR(0, 345, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":346
* # TODO: Test whether offset works properly
* ncv.offset = iv.start
* ncv.is_vector_of_sets = False # <<<<<<<<<<<<<<
* return ncv
*
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_is_vector_of_sets, Py_False) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":347
* ncv.offset = iv.start
* ncv.is_vector_of_sets = False
* return ncv # <<<<<<<<<<<<<<
*
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_ncv);
__pyx_r = __pyx_v_ncv;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":327
*
* @classmethod
* def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""): # <<<<<<<<<<<<<<
* ncv = cls()
* ncv.iv = iv
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ncv);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":350
*
* @classmethod
* def _create_view(cls, ChromVector vec, GenomicInterval iv): # <<<<<<<<<<<<<<
* if iv.length == 0:
* raise IndexError, "Cannot subset to zero-length interval."
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_3_create_view(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_3_create_view(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_vec = 0;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_create_view (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_iv,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iv)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_create_view", 1, 2, 2, 1); __PYX_ERR(0, 350, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_view") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_vec = ((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)values[0]);
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_create_view", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector._create_view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_5HTSeq_6_HTSeq_ChromVector, 1, "vec", 0))) __PYX_ERR(0, 350, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 350, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2_create_view(((PyTypeObject*)__pyx_v_cls), __pyx_v_vec, __pyx_v_iv);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2_create_view(PyTypeObject *__pyx_v_cls, struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_vec, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
PyObject *__pyx_v_v = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
__Pyx_RefNannySetupContext("_create_view", 0);
/* "HTSeq/_HTSeq.pyx":351
* @classmethod
* def _create_view(cls, ChromVector vec, GenomicInterval iv):
* if iv.length == 0: # <<<<<<<<<<<<<<
* raise IndexError, "Cannot subset to zero-length interval."
* v = cls()
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(__pyx_t_3)) {
/* "HTSeq/_HTSeq.pyx":352
* def _create_view(cls, ChromVector vec, GenomicInterval iv):
* if iv.length == 0:
* raise IndexError, "Cannot subset to zero-length interval." # <<<<<<<<<<<<<<
* v = cls()
* v.iv = iv
*/
__Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_Cannot_subset_to_zero_length_int, 0, 0);
__PYX_ERR(0, 352, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":351
* @classmethod
* def _create_view(cls, ChromVector vec, GenomicInterval iv):
* if iv.length == 0: # <<<<<<<<<<<<<<
* raise IndexError, "Cannot subset to zero-length interval."
* v = cls()
*/
}
/* "HTSeq/_HTSeq.pyx":353
* if iv.length == 0:
* raise IndexError, "Cannot subset to zero-length interval."
* v = cls() # <<<<<<<<<<<<<<
* v.iv = iv
* v.array = vec.array
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_v_cls)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_v = __pyx_t_2;
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":354
* raise IndexError, "Cannot subset to zero-length interval."
* v = cls()
* v.iv = iv # <<<<<<<<<<<<<<
* v.array = vec.array
* v.offset = vec.offset
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_n_s_iv, ((PyObject *)__pyx_v_iv)) < 0) __PYX_ERR(0, 354, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":355
* v = cls()
* v.iv = iv
* v.array = vec.array # <<<<<<<<<<<<<<
* v.offset = vec.offset
* v.is_vector_of_sets = vec.is_vector_of_sets
*/
__pyx_t_2 = __pyx_v_vec->array;
__Pyx_INCREF(__pyx_t_2);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_n_s_array, __pyx_t_2) < 0) __PYX_ERR(0, 355, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":356
* v.iv = iv
* v.array = vec.array
* v.offset = vec.offset # <<<<<<<<<<<<<<
* v.is_vector_of_sets = vec.is_vector_of_sets
* v._storage = vec._storage
*/
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_vec->offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_n_s_offset, __pyx_t_2) < 0) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":357
* v.array = vec.array
* v.offset = vec.offset
* v.is_vector_of_sets = vec.is_vector_of_sets # <<<<<<<<<<<<<<
* v._storage = vec._storage
* return v
*/
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_vec->is_vector_of_sets); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_n_s_is_vector_of_sets, __pyx_t_2) < 0) __PYX_ERR(0, 357, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":358
* v.offset = vec.offset
* v.is_vector_of_sets = vec.is_vector_of_sets
* v._storage = vec._storage # <<<<<<<<<<<<<<
* return v
*
*/
__pyx_t_2 = __pyx_v_vec->_storage;
__Pyx_INCREF(__pyx_t_2);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_n_s_storage_2, __pyx_t_2) < 0) __PYX_ERR(0, 358, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":359
* v.is_vector_of_sets = vec.is_vector_of_sets
* v._storage = vec._storage
* return v # <<<<<<<<<<<<<<
*
* def __getitem__(self, index):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_v);
__pyx_r = __pyx_v_v;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":350
*
* @classmethod
* def _create_view(cls, ChromVector vec, GenomicInterval iv): # <<<<<<<<<<<<<<
* if iv.length == 0:
* raise IndexError, "Cannot subset to zero-length interval."
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector._create_view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_v);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":361
* return v
*
* def __getitem__(self, index): # <<<<<<<<<<<<<<
* cdef slice index_slice
* cdef long int index_int
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_4__getitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_4__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_index) {
PyObject *__pyx_v_index_slice = 0;
long __pyx_v_index_int;
long __pyx_v_start;
long __pyx_v_stop;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
long __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
int __pyx_t_9;
__Pyx_RefNannySetupContext("__getitem__", 0);
/* "HTSeq/_HTSeq.pyx":366
* cdef long int start, stop
* cdef GenomicInterval iv
* if isinstance(index, int): # <<<<<<<<<<<<<<
* index_int = index
* if index_int < self.iv.start or index_int >= self.iv.end:
*/
__pyx_t_1 = PyInt_Check(__pyx_v_index);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":367
* cdef GenomicInterval iv
* if isinstance(index, int):
* index_int = index # <<<<<<<<<<<<<<
* if index_int < self.iv.start or index_int >= self.iv.end:
* raise IndexError
*/
__pyx_t_3 = __Pyx_PyInt_As_long(__pyx_v_index); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error)
__pyx_v_index_int = __pyx_t_3;
/* "HTSeq/_HTSeq.pyx":368
* if isinstance(index, int):
* index_int = index
* if index_int < self.iv.start or index_int >= self.iv.end: # <<<<<<<<<<<<<<
* raise IndexError
* return self.array[index_int - self.offset]
*/
__pyx_t_1 = ((__pyx_v_index_int < __pyx_v_self->iv->start) != 0);
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = ((__pyx_v_index_int >= __pyx_v_self->iv->end) != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L5_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":369
* index_int = index
* if index_int < self.iv.start or index_int >= self.iv.end:
* raise IndexError # <<<<<<<<<<<<<<
* return self.array[index_int - self.offset]
* elif isinstance(index, slice):
*/
__Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0);
__PYX_ERR(0, 369, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":368
* if isinstance(index, int):
* index_int = index
* if index_int < self.iv.start or index_int >= self.iv.end: # <<<<<<<<<<<<<<
* raise IndexError
* return self.array[index_int - self.offset]
*/
}
/* "HTSeq/_HTSeq.pyx":370
* if index_int < self.iv.start or index_int >= self.iv.end:
* raise IndexError
* return self.array[index_int - self.offset] # <<<<<<<<<<<<<<
* elif isinstance(index, slice):
* index_slice = index
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = (__pyx_v_index_int - __pyx_v_self->offset);
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self->array, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":366
* cdef long int start, stop
* cdef GenomicInterval iv
* if isinstance(index, int): # <<<<<<<<<<<<<<
* index_int = index
* if index_int < self.iv.start or index_int >= self.iv.end:
*/
}
/* "HTSeq/_HTSeq.pyx":371
* raise IndexError
* return self.array[index_int - self.offset]
* elif isinstance(index, slice): # <<<<<<<<<<<<<<
* index_slice = index
* if index_slice.start is not None:
*/
__pyx_t_2 = PySlice_Check(__pyx_v_index);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":372
* return self.array[index_int - self.offset]
* elif isinstance(index, slice):
* index_slice = index # <<<<<<<<<<<<<<
* if index_slice.start is not None:
* start = index_slice.start
*/
if (!(likely(PySlice_Check(__pyx_v_index))||((__pyx_v_index) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_v_index)->tp_name), 0))) __PYX_ERR(0, 372, __pyx_L1_error)
__pyx_t_4 = __pyx_v_index;
__Pyx_INCREF(__pyx_t_4);
__pyx_v_index_slice = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":373
* elif isinstance(index, slice):
* index_slice = index
* if index_slice.start is not None: # <<<<<<<<<<<<<<
* start = index_slice.start
* if start < self.iv.start:
*/
__pyx_t_1 = (((PySliceObject*)__pyx_v_index_slice)->start != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":374
* index_slice = index
* if index_slice.start is not None:
* start = index_slice.start # <<<<<<<<<<<<<<
* if start < self.iv.start:
* raise IndexError, "start too small"
*/
__pyx_t_3 = __Pyx_PyInt_As_long(((PySliceObject*)__pyx_v_index_slice)->start); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L1_error)
__pyx_v_start = __pyx_t_3;
/* "HTSeq/_HTSeq.pyx":375
* if index_slice.start is not None:
* start = index_slice.start
* if start < self.iv.start: # <<<<<<<<<<<<<<
* raise IndexError, "start too small"
* else:
*/
__pyx_t_2 = ((__pyx_v_start < __pyx_v_self->iv->start) != 0);
if (unlikely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":376
* start = index_slice.start
* if start < self.iv.start:
* raise IndexError, "start too small" # <<<<<<<<<<<<<<
* else:
* start = self.iv.start
*/
__Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_start_too_small, 0, 0);
__PYX_ERR(0, 376, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":375
* if index_slice.start is not None:
* start = index_slice.start
* if start < self.iv.start: # <<<<<<<<<<<<<<
* raise IndexError, "start too small"
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":373
* elif isinstance(index, slice):
* index_slice = index
* if index_slice.start is not None: # <<<<<<<<<<<<<<
* start = index_slice.start
* if start < self.iv.start:
*/
goto __pyx_L7;
}
/* "HTSeq/_HTSeq.pyx":378
* raise IndexError, "start too small"
* else:
* start = self.iv.start # <<<<<<<<<<<<<<
* if index_slice.stop is not None:
* stop = index_slice.stop
*/
/*else*/ {
__pyx_t_3 = __pyx_v_self->iv->start;
__pyx_v_start = __pyx_t_3;
}
__pyx_L7:;
/* "HTSeq/_HTSeq.pyx":379
* else:
* start = self.iv.start
* if index_slice.stop is not None: # <<<<<<<<<<<<<<
* stop = index_slice.stop
* if stop > self.iv.end:
*/
__pyx_t_2 = (((PySliceObject*)__pyx_v_index_slice)->stop != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":380
* start = self.iv.start
* if index_slice.stop is not None:
* stop = index_slice.stop # <<<<<<<<<<<<<<
* if stop > self.iv.end:
* raise IndexError, "stop too large"
*/
__pyx_t_3 = __Pyx_PyInt_As_long(((PySliceObject*)__pyx_v_index_slice)->stop); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
__pyx_v_stop = __pyx_t_3;
/* "HTSeq/_HTSeq.pyx":381
* if index_slice.stop is not None:
* stop = index_slice.stop
* if stop > self.iv.end: # <<<<<<<<<<<<<<
* raise IndexError, "stop too large"
* else:
*/
__pyx_t_1 = ((__pyx_v_stop > __pyx_v_self->iv->end) != 0);
if (unlikely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":382
* stop = index_slice.stop
* if stop > self.iv.end:
* raise IndexError, "stop too large" # <<<<<<<<<<<<<<
* else:
* stop = self.iv.end
*/
__Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_stop_too_large, 0, 0);
__PYX_ERR(0, 382, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":381
* if index_slice.stop is not None:
* stop = index_slice.stop
* if stop > self.iv.end: # <<<<<<<<<<<<<<
* raise IndexError, "stop too large"
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":379
* else:
* start = self.iv.start
* if index_slice.stop is not None: # <<<<<<<<<<<<<<
* stop = index_slice.stop
* if stop > self.iv.end:
*/
goto __pyx_L9;
}
/* "HTSeq/_HTSeq.pyx":384
* raise IndexError, "stop too large"
* else:
* stop = self.iv.end # <<<<<<<<<<<<<<
* iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)
* if not self.iv.contains(iv):
*/
/*else*/ {
__pyx_t_3 = __pyx_v_self->iv->end;
__pyx_v_stop = __pyx_t_3;
}
__pyx_L9:;
/* "HTSeq/_HTSeq.pyx":385
* else:
* stop = self.iv.end
* iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand) # <<<<<<<<<<<<<<
* if not self.iv.contains(iv):
* raise IndexError
*/
__pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_stop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_self->iv->chrom);
__Pyx_GIVEREF(__pyx_v_self->iv->chrom);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->iv->chrom);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":386
* stop = self.iv.end
* iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)
* if not self.iv.contains(iv): # <<<<<<<<<<<<<<
* raise IndexError
* return ChromVector._create_view(self, iv)
*/
__pyx_t_6 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self->iv->__pyx_vtab)->contains(__pyx_v_self->iv, __pyx_v_iv, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_2 = ((!__pyx_t_1) != 0);
if (unlikely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":387
* iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)
* if not self.iv.contains(iv):
* raise IndexError # <<<<<<<<<<<<<<
* return ChromVector._create_view(self, iv)
* elif isinstance(index, GenomicInterval):
*/
__Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0);
__PYX_ERR(0, 387, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":386
* stop = self.iv.end
* iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)
* if not self.iv.contains(iv): # <<<<<<<<<<<<<<
* raise IndexError
* return ChromVector._create_view(self, iv)
*/
}
/* "HTSeq/_HTSeq.pyx":388
* if not self.iv.contains(iv):
* raise IndexError
* return ChromVector._create_view(self, iv) # <<<<<<<<<<<<<<
* elif isinstance(index, GenomicInterval):
* if not self.iv.contains(index):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector), __pyx_n_s_create_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_5 = NULL;
__pyx_t_8 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
__pyx_t_8 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_iv)};
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_iv)};
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
{
__pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
__Pyx_INCREF(((PyObject *)__pyx_v_iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, ((PyObject *)__pyx_v_iv));
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":371
* raise IndexError
* return self.array[index_int - self.offset]
* elif isinstance(index, slice): # <<<<<<<<<<<<<<
* index_slice = index
* if index_slice.start is not None:
*/
}
/* "HTSeq/_HTSeq.pyx":389
* raise IndexError
* return ChromVector._create_view(self, iv)
* elif isinstance(index, GenomicInterval): # <<<<<<<<<<<<<<
* if not self.iv.contains(index):
* raise IndexError
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval);
__pyx_t_1 = (__pyx_t_2 != 0);
if (likely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":390
* return ChromVector._create_view(self, iv)
* elif isinstance(index, GenomicInterval):
* if not self.iv.contains(index): # <<<<<<<<<<<<<<
* raise IndexError
* if self.iv.strand is strand_nostrand and \
*/
if (!(likely(((__pyx_v_index) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 390, __pyx_L1_error)
__pyx_t_6 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self->iv->__pyx_vtab)->contains(__pyx_v_self->iv, ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_index), 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_2 = ((!__pyx_t_1) != 0);
if (unlikely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":391
* elif isinstance(index, GenomicInterval):
* if not self.iv.contains(index):
* raise IndexError # <<<<<<<<<<<<<<
* if self.iv.strand is strand_nostrand and \
* index.strand is not strand_nostrand:
*/
__Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0);
__PYX_ERR(0, 391, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":390
* return ChromVector._create_view(self, iv)
* elif isinstance(index, GenomicInterval):
* if not self.iv.contains(index): # <<<<<<<<<<<<<<
* raise IndexError
* if self.iv.strand is strand_nostrand and \
*/
}
/* "HTSeq/_HTSeq.pyx":392
* if not self.iv.contains(index):
* raise IndexError
* if self.iv.strand is strand_nostrand and \ # <<<<<<<<<<<<<<
* index.strand is not strand_nostrand:
* iv = index.copy() # Is this correct now?
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = (__pyx_t_6 == __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_9 = (__pyx_t_1 != 0);
if (__pyx_t_9) {
} else {
__pyx_t_2 = __pyx_t_9;
goto __pyx_L14_bool_binop_done;
}
/* "HTSeq/_HTSeq.pyx":393
* raise IndexError
* if self.iv.strand is strand_nostrand and \
* index.strand is not strand_nostrand: # <<<<<<<<<<<<<<
* iv = index.copy() # Is this correct now?
* iv.strand = strand_nostrand
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = (__pyx_t_6 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_1 = (__pyx_t_9 != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L14_bool_binop_done:;
/* "HTSeq/_HTSeq.pyx":392
* if not self.iv.contains(index):
* raise IndexError
* if self.iv.strand is strand_nostrand and \ # <<<<<<<<<<<<<<
* index.strand is not strand_nostrand:
* iv = index.copy() # Is this correct now?
*/
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":394
* if self.iv.strand is strand_nostrand and \
* index.strand is not strand_nostrand:
* iv = index.copy() # Is this correct now? # <<<<<<<<<<<<<<
* iv.strand = strand_nostrand
* return ChromVector._create_view(self, iv)
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
__pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 394, __pyx_L1_error)
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":395
* index.strand is not strand_nostrand:
* iv = index.copy() # Is this correct now?
* iv.strand = strand_nostrand # <<<<<<<<<<<<<<
* return ChromVector._create_view(self, iv)
* else:
*/
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand) < 0) __PYX_ERR(0, 395, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":392
* if not self.iv.contains(index):
* raise IndexError
* if self.iv.strand is strand_nostrand and \ # <<<<<<<<<<<<<<
* index.strand is not strand_nostrand:
* iv = index.copy() # Is this correct now?
*/
}
/* "HTSeq/_HTSeq.pyx":396
* iv = index.copy() # Is this correct now?
* iv.strand = strand_nostrand
* return ChromVector._create_view(self, iv) # <<<<<<<<<<<<<<
* else:
* raise TypeError, "Illegal index type"
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector), __pyx_n_s_create_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (unlikely(!__pyx_v_iv)) { __Pyx_RaiseUnboundLocalError("iv"); __PYX_ERR(0, 396, __pyx_L1_error) }
__pyx_t_4 = NULL;
__pyx_t_8 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
__pyx_t_8 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_iv)};
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_iv)};
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
{
__pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
__Pyx_INCREF(((PyObject *)__pyx_v_iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)__pyx_v_iv));
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":389
* raise IndexError
* return ChromVector._create_view(self, iv)
* elif isinstance(index, GenomicInterval): # <<<<<<<<<<<<<<
* if not self.iv.contains(index):
* raise IndexError
*/
}
/* "HTSeq/_HTSeq.pyx":398
* return ChromVector._create_view(self, iv)
* else:
* raise TypeError, "Illegal index type" # <<<<<<<<<<<<<<
*
* def __setitem__(self, index, value):
*/
/*else*/ {
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Illegal_index_type, 0, 0);
__PYX_ERR(0, 398, __pyx_L1_error)
}
/* "HTSeq/_HTSeq.pyx":361
* return v
*
* def __getitem__(self, index): # <<<<<<<<<<<<<<
* cdef slice index_slice
* cdef long int index_int
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_index_slice);
__Pyx_XDECREF((PyObject *)__pyx_v_iv);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":400
* raise TypeError, "Illegal index type"
*
* def __setitem__(self, index, value): # <<<<<<<<<<<<<<
* cdef slice index_slice
* cdef long int start, stop
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6__setitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6__setitem__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
PyObject *__pyx_v_index_slice = 0;
long __pyx_v_start;
long __pyx_v_stop;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
long __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__setitem__", 0);
/* "HTSeq/_HTSeq.pyx":403
* cdef slice index_slice
* cdef long int start, stop
* if isinstance(value, ChromVector): # <<<<<<<<<<<<<<
* if self.array is value.array and value.iv.start == index.start and \
* value.iv.end == index.stop and (index.step is None or index.step == 1):
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":404
* cdef long int start, stop
* if isinstance(value, ChromVector):
* if self.array is value.array and value.iv.start == index.start and \ # <<<<<<<<<<<<<<
* value.iv.end == index.stop and (index.step is None or index.step == 1):
* return
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = (__pyx_v_self->array == __pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = (__pyx_t_1 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_iv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L5_bool_binop_done;
}
/* "HTSeq/_HTSeq.pyx":405
* if isinstance(value, ChromVector):
* if self.array is value.array and value.iv.start == index.start and \
* value.iv.end == index.stop and (index.step is None or index.step == 1): # <<<<<<<<<<<<<<
* return
* else:
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_iv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = (__pyx_t_5 == Py_None);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_1 = (__pyx_t_4 != 0);
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_2 = __pyx_t_1;
__pyx_L5_bool_binop_done:;
/* "HTSeq/_HTSeq.pyx":404
* cdef long int start, stop
* if isinstance(value, ChromVector):
* if self.array is value.array and value.iv.start == index.start and \ # <<<<<<<<<<<<<<
* value.iv.end == index.stop and (index.step is None or index.step == 1):
* return
*/
if (likely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":406
* if self.array is value.array and value.iv.start == index.start and \
* value.iv.end == index.stop and (index.step is None or index.step == 1):
* return # <<<<<<<<<<<<<<
* else:
* raise NotImplementedError, "Required assignment signature not yet implemented."
*/
__pyx_r = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":404
* cdef long int start, stop
* if isinstance(value, ChromVector):
* if self.array is value.array and value.iv.start == index.start and \ # <<<<<<<<<<<<<<
* value.iv.end == index.stop and (index.step is None or index.step == 1):
* return
*/
}
/* "HTSeq/_HTSeq.pyx":408
* return
* else:
* raise NotImplementedError, "Required assignment signature not yet implemented." # <<<<<<<<<<<<<<
* if isinstance(index, int):
* self.array[index - self.iv.start] = value
*/
/*else*/ {
__Pyx_Raise(__pyx_builtin_NotImplementedError, __pyx_kp_u_Required_assignment_signature_no, 0, 0);
__PYX_ERR(0, 408, __pyx_L1_error)
}
/* "HTSeq/_HTSeq.pyx":403
* cdef slice index_slice
* cdef long int start, stop
* if isinstance(value, ChromVector): # <<<<<<<<<<<<<<
* if self.array is value.array and value.iv.start == index.start and \
* value.iv.end == index.stop and (index.step is None or index.step == 1):
*/
}
/* "HTSeq/_HTSeq.pyx":409
* else:
* raise NotImplementedError, "Required assignment signature not yet implemented."
* if isinstance(index, int): # <<<<<<<<<<<<<<
* self.array[index - self.iv.start] = value
* elif isinstance(index, slice):
*/
__pyx_t_2 = PyInt_Check(__pyx_v_index);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":410
* raise NotImplementedError, "Required assignment signature not yet implemented."
* if isinstance(index, int):
* self.array[index - self.iv.start] = value # <<<<<<<<<<<<<<
* elif isinstance(index, slice):
* index_slice = index
*/
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyNumber_Subtract(__pyx_v_index, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(PyObject_SetItem(__pyx_v_self->array, __pyx_t_5, __pyx_v_value) < 0)) __PYX_ERR(0, 410, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":409
* else:
* raise NotImplementedError, "Required assignment signature not yet implemented."
* if isinstance(index, int): # <<<<<<<<<<<<<<
* self.array[index - self.iv.start] = value
* elif isinstance(index, slice):
*/
goto __pyx_L10;
}
/* "HTSeq/_HTSeq.pyx":411
* if isinstance(index, int):
* self.array[index - self.iv.start] = value
* elif isinstance(index, slice): # <<<<<<<<<<<<<<
* index_slice = index
* if index_slice.start is not None:
*/
__pyx_t_1 = PySlice_Check(__pyx_v_index);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":412
* self.array[index - self.iv.start] = value
* elif isinstance(index, slice):
* index_slice = index # <<<<<<<<<<<<<<
* if index_slice.start is not None:
* start = index_slice.start
*/
if (!(likely(PySlice_Check(__pyx_v_index))||((__pyx_v_index) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_v_index)->tp_name), 0))) __PYX_ERR(0, 412, __pyx_L1_error)
__pyx_t_5 = __pyx_v_index;
__Pyx_INCREF(__pyx_t_5);
__pyx_v_index_slice = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":413
* elif isinstance(index, slice):
* index_slice = index
* if index_slice.start is not None: # <<<<<<<<<<<<<<
* start = index_slice.start
* if start < self.iv.start:
*/
__pyx_t_2 = (((PySliceObject*)__pyx_v_index_slice)->start != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":414
* index_slice = index
* if index_slice.start is not None:
* start = index_slice.start # <<<<<<<<<<<<<<
* if start < self.iv.start:
* raise IndexError, "start too small"
*/
__pyx_t_7 = __Pyx_PyInt_As_long(((PySliceObject*)__pyx_v_index_slice)->start); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 414, __pyx_L1_error)
__pyx_v_start = __pyx_t_7;
/* "HTSeq/_HTSeq.pyx":415
* if index_slice.start is not None:
* start = index_slice.start
* if start < self.iv.start: # <<<<<<<<<<<<<<
* raise IndexError, "start too small"
* else:
*/
__pyx_t_1 = ((__pyx_v_start < __pyx_v_self->iv->start) != 0);
if (unlikely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":416
* start = index_slice.start
* if start < self.iv.start:
* raise IndexError, "start too small" # <<<<<<<<<<<<<<
* else:
* start = self.iv.start
*/
__Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_start_too_small, 0, 0);
__PYX_ERR(0, 416, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":415
* if index_slice.start is not None:
* start = index_slice.start
* if start < self.iv.start: # <<<<<<<<<<<<<<
* raise IndexError, "start too small"
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":413
* elif isinstance(index, slice):
* index_slice = index
* if index_slice.start is not None: # <<<<<<<<<<<<<<
* start = index_slice.start
* if start < self.iv.start:
*/
goto __pyx_L11;
}
/* "HTSeq/_HTSeq.pyx":418
* raise IndexError, "start too small"
* else:
* start = self.iv.start # <<<<<<<<<<<<<<
* if index_slice.stop is not None:
* stop = index_slice.stop
*/
/*else*/ {
__pyx_t_7 = __pyx_v_self->iv->start;
__pyx_v_start = __pyx_t_7;
}
__pyx_L11:;
/* "HTSeq/_HTSeq.pyx":419
* else:
* start = self.iv.start
* if index_slice.stop is not None: # <<<<<<<<<<<<<<
* stop = index_slice.stop
* if stop > self.iv.end:
*/
__pyx_t_1 = (((PySliceObject*)__pyx_v_index_slice)->stop != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":420
* start = self.iv.start
* if index_slice.stop is not None:
* stop = index_slice.stop # <<<<<<<<<<<<<<
* if stop > self.iv.end:
* raise IndexError, "stop too large"
*/
__pyx_t_7 = __Pyx_PyInt_As_long(((PySliceObject*)__pyx_v_index_slice)->stop); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L1_error)
__pyx_v_stop = __pyx_t_7;
/* "HTSeq/_HTSeq.pyx":421
* if index_slice.stop is not None:
* stop = index_slice.stop
* if stop > self.iv.end: # <<<<<<<<<<<<<<
* raise IndexError, "stop too large"
* else:
*/
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_self->iv->end) != 0);
if (unlikely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":422
* stop = index_slice.stop
* if stop > self.iv.end:
* raise IndexError, "stop too large" # <<<<<<<<<<<<<<
* else:
* stop = self.iv.end
*/
__Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_stop_too_large, 0, 0);
__PYX_ERR(0, 422, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":421
* if index_slice.stop is not None:
* stop = index_slice.stop
* if stop > self.iv.end: # <<<<<<<<<<<<<<
* raise IndexError, "stop too large"
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":419
* else:
* start = self.iv.start
* if index_slice.stop is not None: # <<<<<<<<<<<<<<
* stop = index_slice.stop
* if stop > self.iv.end:
*/
goto __pyx_L13;
}
/* "HTSeq/_HTSeq.pyx":424
* raise IndexError, "stop too large"
* else:
* stop = self.iv.end # <<<<<<<<<<<<<<
* if start > stop:
* raise IndexError, "Start of interval is after its end."
*/
/*else*/ {
__pyx_t_7 = __pyx_v_self->iv->end;
__pyx_v_stop = __pyx_t_7;
}
__pyx_L13:;
/* "HTSeq/_HTSeq.pyx":425
* else:
* stop = self.iv.end
* if start > stop: # <<<<<<<<<<<<<<
* raise IndexError, "Start of interval is after its end."
* if start == stop:
*/
__pyx_t_2 = ((__pyx_v_start > __pyx_v_stop) != 0);
if (unlikely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":426
* stop = self.iv.end
* if start > stop:
* raise IndexError, "Start of interval is after its end." # <<<<<<<<<<<<<<
* if start == stop:
* raise IndexError, "Cannot assign to zero-length interval."
*/
__Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_Start_of_interval_is_after_its_e, 0, 0);
__PYX_ERR(0, 426, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":425
* else:
* stop = self.iv.end
* if start > stop: # <<<<<<<<<<<<<<
* raise IndexError, "Start of interval is after its end."
* if start == stop:
*/
}
/* "HTSeq/_HTSeq.pyx":427
* if start > stop:
* raise IndexError, "Start of interval is after its end."
* if start == stop: # <<<<<<<<<<<<<<
* raise IndexError, "Cannot assign to zero-length interval."
* self.array[start - self.offset: stop -
*/
__pyx_t_2 = ((__pyx_v_start == __pyx_v_stop) != 0);
if (unlikely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":428
* raise IndexError, "Start of interval is after its end."
* if start == stop:
* raise IndexError, "Cannot assign to zero-length interval." # <<<<<<<<<<<<<<
* self.array[start - self.offset: stop -
* self.iv.start: index.step] = value
*/
__Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_Cannot_assign_to_zero_length_int, 0, 0);
__PYX_ERR(0, 428, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":427
* if start > stop:
* raise IndexError, "Start of interval is after its end."
* if start == stop: # <<<<<<<<<<<<<<
* raise IndexError, "Cannot assign to zero-length interval."
* self.array[start - self.offset: stop -
*/
}
/* "HTSeq/_HTSeq.pyx":429
* if start == stop:
* raise IndexError, "Cannot assign to zero-length interval."
* self.array[start - self.offset: stop - # <<<<<<<<<<<<<<
* self.iv.start: index.step] = value
* elif isinstance(index, GenomicInterval):
*/
__pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_start - __pyx_v_self->offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
/* "HTSeq/_HTSeq.pyx":430
* raise IndexError, "Cannot assign to zero-length interval."
* self.array[start - self.offset: stop -
* self.iv.start: index.step] = value # <<<<<<<<<<<<<<
* elif isinstance(index, GenomicInterval):
* if index.chrom != self.iv.chrom:
*/
__pyx_t_6 = __Pyx_PyInt_From_long((__pyx_v_stop - __pyx_v_self->iv->start)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
/* "HTSeq/_HTSeq.pyx":429
* if start == stop:
* raise IndexError, "Cannot assign to zero-length interval."
* self.array[start - self.offset: stop - # <<<<<<<<<<<<<<
* self.iv.start: index.step] = value
* elif isinstance(index, GenomicInterval):
*/
__pyx_t_8 = PySlice_New(__pyx_t_5, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(PyObject_SetItem(__pyx_v_self->array, __pyx_t_8, __pyx_v_value) < 0)) __PYX_ERR(0, 429, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "HTSeq/_HTSeq.pyx":411
* if isinstance(index, int):
* self.array[index - self.iv.start] = value
* elif isinstance(index, slice): # <<<<<<<<<<<<<<
* index_slice = index
* if index_slice.start is not None:
*/
goto __pyx_L10;
}
/* "HTSeq/_HTSeq.pyx":431
* self.array[start - self.offset: stop -
* self.iv.start: index.step] = value
* elif isinstance(index, GenomicInterval): # <<<<<<<<<<<<<<
* if index.chrom != self.iv.chrom:
* raise KeyError, "Chromosome name mismatch."
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval);
__pyx_t_1 = (__pyx_t_2 != 0);
if (likely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":432
* self.iv.start: index.step] = value
* elif isinstance(index, GenomicInterval):
* if index.chrom != self.iv.chrom: # <<<<<<<<<<<<<<
* raise KeyError, "Chromosome name mismatch."
* if self.iv.strand is not strand_nostrand and \
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_v_self->iv->chrom, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 432, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":433
* elif isinstance(index, GenomicInterval):
* if index.chrom != self.iv.chrom:
* raise KeyError, "Chromosome name mismatch." # <<<<<<<<<<<<<<
* if self.iv.strand is not strand_nostrand and \
* self.iv.strand is not self.index.strand:
*/
__Pyx_Raise(__pyx_builtin_KeyError, __pyx_kp_u_Chromosome_name_mismatch, 0, 0);
__PYX_ERR(0, 433, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":432
* self.iv.start: index.step] = value
* elif isinstance(index, GenomicInterval):
* if index.chrom != self.iv.chrom: # <<<<<<<<<<<<<<
* raise KeyError, "Chromosome name mismatch."
* if self.iv.strand is not strand_nostrand and \
*/
}
/* "HTSeq/_HTSeq.pyx":434
* if index.chrom != self.iv.chrom:
* raise KeyError, "Chromosome name mismatch."
* if self.iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.iv.strand is not self.index.strand:
* raise KeyError, "Strand mismatch."
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_2 = (__pyx_t_8 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L19_bool_binop_done;
}
/* "HTSeq/_HTSeq.pyx":435
* raise KeyError, "Chromosome name mismatch."
* if self.iv.strand is not strand_nostrand and \
* self.iv.strand is not self.index.strand: # <<<<<<<<<<<<<<
* raise KeyError, "Strand mismatch."
* self.array[index.iv.start - self.iv.start,
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = (__pyx_t_8 != __pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_2 = (__pyx_t_4 != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L19_bool_binop_done:;
/* "HTSeq/_HTSeq.pyx":434
* if index.chrom != self.iv.chrom:
* raise KeyError, "Chromosome name mismatch."
* if self.iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.iv.strand is not self.index.strand:
* raise KeyError, "Strand mismatch."
*/
if (unlikely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":436
* if self.iv.strand is not strand_nostrand and \
* self.iv.strand is not self.index.strand:
* raise KeyError, "Strand mismatch." # <<<<<<<<<<<<<<
* self.array[index.iv.start - self.iv.start,
* index.iv.end - self.iv.start] = value
*/
__Pyx_Raise(__pyx_builtin_KeyError, __pyx_kp_u_Strand_mismatch, 0, 0);
__PYX_ERR(0, 436, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":434
* if index.chrom != self.iv.chrom:
* raise KeyError, "Chromosome name mismatch."
* if self.iv.strand is not strand_nostrand and \ # <<<<<<<<<<<<<<
* self.iv.strand is not self.index.strand:
* raise KeyError, "Strand mismatch."
*/
}
/* "HTSeq/_HTSeq.pyx":437
* self.iv.strand is not self.index.strand:
* raise KeyError, "Strand mismatch."
* self.array[index.iv.start - self.iv.start, # <<<<<<<<<<<<<<
* index.iv.end - self.iv.start] = value
* else:
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_iv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = PyNumber_Subtract(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":438
* raise KeyError, "Strand mismatch."
* self.array[index.iv.start - self.iv.start,
* index.iv.end - self.iv.start] = value # <<<<<<<<<<<<<<
* else:
* raise TypeError, "Illegal index type"
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_iv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_end); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyNumber_Subtract(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":437
* self.iv.strand is not self.index.strand:
* raise KeyError, "Strand mismatch."
* self.array[index.iv.start - self.iv.start, # <<<<<<<<<<<<<<
* index.iv.end - self.iv.start] = value
* else:
*/
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
if (unlikely(PyObject_SetItem(__pyx_v_self->array, __pyx_t_6, __pyx_v_value) < 0)) __PYX_ERR(0, 437, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":431
* self.array[start - self.offset: stop -
* self.iv.start: index.step] = value
* elif isinstance(index, GenomicInterval): # <<<<<<<<<<<<<<
* if index.chrom != self.iv.chrom:
* raise KeyError, "Chromosome name mismatch."
*/
goto __pyx_L10;
}
/* "HTSeq/_HTSeq.pyx":440
* index.iv.end - self.iv.start] = value
* else:
* raise TypeError, "Illegal index type" # <<<<<<<<<<<<<<
*
* def __iadd__(self, value):
*/
/*else*/ {
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Illegal_index_type, 0, 0);
__PYX_ERR(0, 440, __pyx_L1_error)
}
__pyx_L10:;
/* "HTSeq/_HTSeq.pyx":400
* raise TypeError, "Illegal index type"
*
* def __setitem__(self, index, value): # <<<<<<<<<<<<<<
* cdef slice index_slice
* cdef long int start, stop
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_index_slice);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":442
* raise TypeError, "Illegal index type"
*
* def __iadd__(self, value): # <<<<<<<<<<<<<<
* if not self.is_vector_of_sets:
* self.array[self.iv.start - self.offset: self.iv.end -
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__iadd__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":447
* self.offset].__iadd__(value)
* else:
* def addval(x): # <<<<<<<<<<<<<<
* y = x.copy()
* y.add(value)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval = {"addval", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval, METH_O, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval(PyObject *__pyx_self, PyObject *__pyx_v_x) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("addval (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__iadd___addval(__pyx_self, ((PyObject *)__pyx_v_x));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__iadd___addval(PyObject *__pyx_self, PyObject *__pyx_v_x) {
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *__pyx_cur_scope;
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *__pyx_outer_scope;
PyObject *__pyx_v_y = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("addval", 0);
__pyx_outer_scope = (struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
/* "HTSeq/_HTSeq.pyx":448
* else:
* def addval(x):
* y = x.copy() # <<<<<<<<<<<<<<
* y.add(value)
* return y
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_y = __pyx_t_1;
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":449
* def addval(x):
* y = x.copy()
* y.add(value) # <<<<<<<<<<<<<<
* return y
* self.apply(addval)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_add); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 449, __pyx_L1_error) }
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":450
* y = x.copy()
* y.add(value)
* return y # <<<<<<<<<<<<<<
* self.apply(addval)
* return self
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_y);
__pyx_r = __pyx_v_y;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":447
* self.offset].__iadd__(value)
* else:
* def addval(x): # <<<<<<<<<<<<<<
* y = x.copy()
* y.add(value)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__iadd__.addval", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_y);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":442
* raise TypeError, "Illegal index type"
*
* def __iadd__(self, value): # <<<<<<<<<<<<<<
* if not self.is_vector_of_sets:
* self.array[self.iv.start - self.offset: self.iv.end -
*/
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__iadd__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *__pyx_cur_scope;
PyObject *__pyx_v_addval = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("__iadd__", 0);
__pyx_cur_scope = (struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)__pyx_tp_new_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__pyx_cur_scope = ((struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)Py_None);
__Pyx_INCREF(Py_None);
__PYX_ERR(0, 442, __pyx_L1_error)
} else {
__Pyx_GOTREF(__pyx_cur_scope);
}
__pyx_cur_scope->__pyx_v_value = __pyx_v_value;
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
/* "HTSeq/_HTSeq.pyx":443
*
* def __iadd__(self, value):
* if not self.is_vector_of_sets: # <<<<<<<<<<<<<<
* self.array[self.iv.start - self.offset: self.iv.end -
* self.offset].__iadd__(value)
*/
__pyx_t_1 = ((!(__pyx_v_self->is_vector_of_sets != 0)) != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":444
* def __iadd__(self, value):
* if not self.is_vector_of_sets:
* self.array[self.iv.start - self.offset: self.iv.end - # <<<<<<<<<<<<<<
* self.offset].__iadd__(value)
* else:
*/
__pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_self->array, (__pyx_v_self->iv->start - __pyx_v_self->offset), (__pyx_v_self->iv->end - __pyx_v_self->offset), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
/* "HTSeq/_HTSeq.pyx":445
* if not self.is_vector_of_sets:
* self.array[self.iv.start - self.offset: self.iv.end -
* self.offset].__iadd__(value) # <<<<<<<<<<<<<<
* else:
* def addval(x):
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iadd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_cur_scope->__pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":443
*
* def __iadd__(self, value):
* if not self.is_vector_of_sets: # <<<<<<<<<<<<<<
* self.array[self.iv.start - self.offset: self.iv.end -
* self.offset].__iadd__(value)
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":447
* self.offset].__iadd__(value)
* else:
* def addval(x): # <<<<<<<<<<<<<<
* y = x.copy()
* y.add(value)
*/
/*else*/ {
__pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval, 0, __pyx_n_s_iadd___locals_addval, ((PyObject*)__pyx_cur_scope), __pyx_n_s_HTSeq__HTSeq, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_addval = __pyx_t_2;
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":451
* y.add(value)
* return y
* self.apply(addval) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_addval) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_addval);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":452
* return y
* self.apply(addval)
* return self # <<<<<<<<<<<<<<
*
* def __iter__(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":442
* raise TypeError, "Illegal index type"
*
* def __iadd__(self, value): # <<<<<<<<<<<<<<
* if not self.is_vector_of_sets:
* self.array[self.iv.start - self.offset: self.iv.end -
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_addval);
__Pyx_DECREF(((PyObject *)__pyx_cur_scope));
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":454
* return self
*
* def __iter__(self): # <<<<<<<<<<<<<<
* return self.values()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_11__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_11__iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10__iter__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10__iter__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__iter__", 0);
/* "HTSeq/_HTSeq.pyx":455
*
* def __iter__(self):
* return self.values() # <<<<<<<<<<<<<<
*
* def values(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":454
* return self
*
* def __iter__(self): # <<<<<<<<<<<<<<
* return self.values()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":457
* return self.values()
*
* def values(self): # <<<<<<<<<<<<<<
* return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("values (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_12values(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_12values(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("values", 0);
/* "HTSeq/_HTSeq.pyx":458
*
* def values(self):
* return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset]) # <<<<<<<<<<<<<<
*
* def steps(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_self->array, (__pyx_v_self->iv->start - __pyx_v_self->offset), (__pyx_v_self->iv->end - __pyx_v_self->offset), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":457
* return self.values()
*
* def values(self): # <<<<<<<<<<<<<<
* return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":460
* return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])
*
* def steps(self): # <<<<<<<<<<<<<<
* return _HTSeq_internal.ChromVector_steps(self)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_15steps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_15steps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("steps (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_14steps(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_14steps(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("steps", 0);
/* "HTSeq/_HTSeq.pyx":461
*
* def steps(self):
* return _HTSeq_internal.ChromVector_steps(self) # <<<<<<<<<<<<<<
*
* def apply(self, fun):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HTSeq_internal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ChromVector_steps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":460
* return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])
*
* def steps(self): # <<<<<<<<<<<<<<
* return _HTSeq_internal.ChromVector_steps(self)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":463
* return _HTSeq_internal.ChromVector_steps(self)
*
* def apply(self, fun): # <<<<<<<<<<<<<<
* for iv, value in self.steps():
* self.array[iv.start - self.offset: iv.end -
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17apply(PyObject *__pyx_v_self, PyObject *__pyx_v_fun); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17apply(PyObject *__pyx_v_self, PyObject *__pyx_v_fun) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("apply (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_16apply(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_fun));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_16apply(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_fun) {
PyObject *__pyx_v_iv = NULL;
PyObject *__pyx_v_value = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
Py_ssize_t __pyx_t_4;
PyObject *(*__pyx_t_5)(PyObject *);
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
PyObject *__pyx_t_9 = NULL;
__Pyx_RefNannySetupContext("apply", 0);
/* "HTSeq/_HTSeq.pyx":464
*
* def apply(self, fun):
* for iv, value in self.steps(): # <<<<<<<<<<<<<<
* self.array[iv.start - self.offset: iv.end -
* self.offset] = fun(value)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_steps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
__pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_5(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 464, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 464, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_3 = PyList_GET_ITEM(sequence, 0);
__pyx_t_6 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 464, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_iv, __pyx_t_3);
__pyx_t_3 = 0;
__Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":466
* for iv, value in self.steps():
* self.array[iv.start - self.offset: iv.end -
* self.offset] = fun(value) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__Pyx_INCREF(__pyx_v_fun);
__pyx_t_6 = __pyx_v_fun; __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":465
* def apply(self, fun):
* for iv, value in self.steps():
* self.array[iv.start - self.offset: iv.end - # <<<<<<<<<<<<<<
* self.offset] = fun(value)
*
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
/* "HTSeq/_HTSeq.pyx":466
* for iv, value in self.steps():
* self.array[iv.start - self.offset: iv.end -
* self.offset] = fun(value) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
/* "HTSeq/_HTSeq.pyx":465
* def apply(self, fun):
* for iv, value in self.steps():
* self.array[iv.start - self.offset: iv.end - # <<<<<<<<<<<<<<
* self.offset] = fun(value)
*
*/
__pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__Pyx_PyObject_SetSlice(__pyx_v_self->array, __pyx_t_1, 0, 0, &__pyx_t_7, &__pyx_t_9, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":464
*
* def apply(self, fun):
* for iv, value in self.steps(): # <<<<<<<<<<<<<<
* self.array[iv.start - self.offset: iv.end -
* self.offset] = fun(value)
*/
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":463
* return _HTSeq_internal.ChromVector_steps(self)
*
* def apply(self, fun): # <<<<<<<<<<<<<<
* for iv, value in self.steps():
* self.array[iv.start - self.offset: iv.end -
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_iv);
__Pyx_XDECREF(__pyx_v_value);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":468
* self.offset] = fun(value)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_19__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_19__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_18__repr__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_18__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "HTSeq/_HTSeq.pyx":469
*
* def __repr__(self):
* return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage) # <<<<<<<<<<<<<<
*
* def __reduce__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__Pyx_INCREF(__pyx_kp_u__2);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u_object_2);
__pyx_t_2 += 9;
__Pyx_GIVEREF(__pyx_kp_u_object_2);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object_2);
__pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self->iv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__16);
__pyx_t_2 += 2;
__Pyx_GIVEREF(__pyx_kp_u__16);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__16);
__pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->_storage); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__17);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__17);
PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__17);
__pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":468
* self.offset] = fun(value)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":471
* return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage)
*
* def __reduce__(self): # <<<<<<<<<<<<<<
* assert self.__class__ is ChromVector
* return(_ChromVector_unpickle,
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_21__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_21__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_20__reduce__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_20__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__reduce__", 0);
/* "HTSeq/_HTSeq.pyx":472
*
* def __reduce__(self):
* assert self.__class__ is ChromVector # <<<<<<<<<<<<<<
* return(_ChromVector_unpickle,
* (self.array, self.iv, self.offset, self.is_vector_of_sets, self._storage))
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!Py_OptimizeFlag)) {
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = (__pyx_t_1 == ((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector));
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!(__pyx_t_2 != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(0, 472, __pyx_L1_error)
}
}
#endif
/* "HTSeq/_HTSeq.pyx":473
* def __reduce__(self):
* assert self.__class__ is ChromVector
* return(_ChromVector_unpickle, # <<<<<<<<<<<<<<
* (self.array, self.iv, self.offset, self.is_vector_of_sets, self._storage))
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ChromVector_unpickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "HTSeq/_HTSeq.pyx":474
* assert self.__class__ is ChromVector
* return(_ChromVector_unpickle,
* (self.array, self.iv, self.offset, self.is_vector_of_sets, self._storage)) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->is_vector_of_sets); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_self->array);
__Pyx_GIVEREF(__pyx_v_self->array);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->array);
__Pyx_INCREF(((PyObject *)__pyx_v_self->iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->iv));
PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->iv));
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
__Pyx_INCREF(__pyx_v_self->_storage);
__Pyx_GIVEREF(__pyx_v_self->_storage);
PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_self->_storage);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":473
* def __reduce__(self):
* assert self.__class__ is ChromVector
* return(_ChromVector_unpickle, # <<<<<<<<<<<<<<
* (self.array, self.iv, self.offset, self.is_vector_of_sets, self._storage))
*
*/
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
__pyx_t_1 = 0;
__pyx_t_5 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":471
* return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage)
*
* def __reduce__(self): # <<<<<<<<<<<<<<
* assert self.__class__ is ChromVector
* return(_ChromVector_unpickle,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":320
* cdef class ChromVector(object):
*
* cdef public object array # <<<<<<<<<<<<<<
* cdef public GenomicInterval iv
* cdef public int offset
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->array);
__pyx_r = __pyx_v_self->array;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__", 0);
__Pyx_INCREF(__pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
__Pyx_GOTREF(__pyx_v_self->array);
__Pyx_DECREF(__pyx_v_self->array);
__pyx_v_self->array = __pyx_v_value;
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->array);
__Pyx_DECREF(__pyx_v_self->array);
__pyx_v_self->array = Py_None;
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":321
*
* cdef public object array
* cdef public GenomicInterval iv # <<<<<<<<<<<<<<
* cdef public int offset
* cdef public bint is_vector_of_sets
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->iv));
__pyx_r = ((PyObject *)__pyx_v_self->iv);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 321, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->iv);
__Pyx_DECREF(((PyObject *)__pyx_v_self->iv));
__pyx_v_self->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.iv.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->iv);
__Pyx_DECREF(((PyObject *)__pyx_v_self->iv));
__pyx_v_self->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":322
* cdef public object array
* cdef public GenomicInterval iv
* cdef public int offset # <<<<<<<<<<<<<<
* cdef public bint is_vector_of_sets
* cdef public str _storage
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 322, __pyx_L1_error)
__pyx_v_self->offset = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":323
* cdef public GenomicInterval iv
* cdef public int offset
* cdef public bint is_vector_of_sets # <<<<<<<<<<<<<<
* cdef public str _storage
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_vector_of_sets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.is_vector_of_sets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L1_error)
__pyx_v_self->is_vector_of_sets = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.is_vector_of_sets.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":324
* cdef public int offset
* cdef public bint is_vector_of_sets
* cdef public str _storage # <<<<<<<<<<<<<<
*
* @classmethod
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->_storage);
__pyx_r = __pyx_v_self->_storage;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 324, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->_storage);
__Pyx_DECREF(__pyx_v_self->_storage);
__pyx_v_self->_storage = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.ChromVector._storage.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->_storage);
__Pyx_DECREF(__pyx_v_self->_storage);
__pyx_v_self->_storage = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":477
*
*
* def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage): # <<<<<<<<<<<<<<
* cv = ChromVector()
* cv.array = array
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_3_ChromVector_unpickle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_3_ChromVector_unpickle = {"_ChromVector_unpickle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_3_ChromVector_unpickle, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_3_ChromVector_unpickle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_array = 0;
PyObject *__pyx_v_iv = 0;
PyObject *__pyx_v_offset = 0;
PyObject *__pyx_v_is_vector_of_sets = 0;
PyObject *__pyx_v__storage = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_ChromVector_unpickle (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_iv,&__pyx_n_s_offset,&__pyx_n_s_is_vector_of_sets,&__pyx_n_s_storage_2,0};
PyObject* values[5] = {0,0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iv)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, 1); __PYX_ERR(0, 477, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, 2); __PYX_ERR(0, 477, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_vector_of_sets)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, 3); __PYX_ERR(0, 477, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 4:
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_2)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, 4); __PYX_ERR(0, 477, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ChromVector_unpickle") < 0)) __PYX_ERR(0, 477, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
}
__pyx_v_array = values[0];
__pyx_v_iv = values[1];
__pyx_v_offset = values[2];
__pyx_v_is_vector_of_sets = values[3];
__pyx_v__storage = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq._ChromVector_unpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_2_ChromVector_unpickle(__pyx_self, __pyx_v_array, __pyx_v_iv, __pyx_v_offset, __pyx_v_is_vector_of_sets, __pyx_v__storage);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_2_ChromVector_unpickle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_iv, PyObject *__pyx_v_offset, PyObject *__pyx_v_is_vector_of_sets, PyObject *__pyx_v__storage) {
struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_cv = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
__Pyx_RefNannySetupContext("_ChromVector_unpickle", 0);
/* "HTSeq/_HTSeq.pyx":478
*
* def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage):
* cv = ChromVector() # <<<<<<<<<<<<<<
* cv.array = array
* cv.iv = iv
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_cv = ((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":479
* def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage):
* cv = ChromVector()
* cv.array = array # <<<<<<<<<<<<<<
* cv.iv = iv
* cv.offset = offset
*/
__Pyx_INCREF(__pyx_v_array);
__Pyx_GIVEREF(__pyx_v_array);
__Pyx_GOTREF(__pyx_v_cv->array);
__Pyx_DECREF(__pyx_v_cv->array);
__pyx_v_cv->array = __pyx_v_array;
/* "HTSeq/_HTSeq.pyx":480
* cv = ChromVector()
* cv.array = array
* cv.iv = iv # <<<<<<<<<<<<<<
* cv.offset = offset
* cv.is_vector_of_sets = is_vector_of_sets
*/
if (!(likely(((__pyx_v_iv) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_iv, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 480, __pyx_L1_error)
__pyx_t_1 = __pyx_v_iv;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_cv->iv);
__Pyx_DECREF(((PyObject *)__pyx_v_cv->iv));
__pyx_v_cv->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":481
* cv.array = array
* cv.iv = iv
* cv.offset = offset # <<<<<<<<<<<<<<
* cv.is_vector_of_sets = is_vector_of_sets
* cv._storage = _storage
*/
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_offset); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L1_error)
__pyx_v_cv->offset = __pyx_t_2;
/* "HTSeq/_HTSeq.pyx":482
* cv.iv = iv
* cv.offset = offset
* cv.is_vector_of_sets = is_vector_of_sets # <<<<<<<<<<<<<<
* cv._storage = _storage
* return cv
*/
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_vector_of_sets); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L1_error)
__pyx_v_cv->is_vector_of_sets = __pyx_t_3;
/* "HTSeq/_HTSeq.pyx":483
* cv.offset = offset
* cv.is_vector_of_sets = is_vector_of_sets
* cv._storage = _storage # <<<<<<<<<<<<<<
* return cv
*
*/
if (!(likely(PyUnicode_CheckExact(__pyx_v__storage))||((__pyx_v__storage) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v__storage)->tp_name), 0))) __PYX_ERR(0, 483, __pyx_L1_error)
__pyx_t_1 = __pyx_v__storage;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_cv->_storage);
__Pyx_DECREF(__pyx_v_cv->_storage);
__pyx_v_cv->_storage = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":484
* cv.is_vector_of_sets = is_vector_of_sets
* cv._storage = _storage
* return cv # <<<<<<<<<<<<<<
*
* cdef class GenomicArray(object):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_cv));
__pyx_r = ((PyObject *)__pyx_v_cv);
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":477
*
*
* def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage): # <<<<<<<<<<<<<<
* cv = ChromVector()
* cv.array = array
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq._ChromVector_unpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_cv);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":495
* cdef readonly str memmap_dir
*
* def __init__(self, object chroms, bint stranded=True, str typecode='d', # <<<<<<<<<<<<<<
* str storage='step', str memmap_dir=""):
* self.chrom_vectors = {}
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_chroms = 0;
int __pyx_v_stranded;
PyObject *__pyx_v_typecode = 0;
PyObject *__pyx_v_storage = 0;
PyObject *__pyx_v_memmap_dir = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chroms,&__pyx_n_s_stranded,&__pyx_n_s_typecode,&__pyx_n_s_storage,&__pyx_n_s_memmap_dir,0};
PyObject* values[5] = {0,0,0,0,0};
values[2] = ((PyObject*)__pyx_n_u_d);
values[3] = ((PyObject*)__pyx_n_u_step);
values[4] = ((PyObject*)__pyx_kp_u__12);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chroms)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stranded);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typecode);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memmap_dir);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 495, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_chroms = values[0];
if (values[1]) {
__pyx_v_stranded = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_stranded == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L3_error)
} else {
__pyx_v_stranded = ((int)1);
}
__pyx_v_typecode = ((PyObject*)values[2]);
__pyx_v_storage = ((PyObject*)values[3]);
__pyx_v_memmap_dir = ((PyObject*)values[4]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 495, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_typecode), (&PyUnicode_Type), 1, "typecode", 1))) __PYX_ERR(0, 495, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage), (&PyUnicode_Type), 1, "storage", 1))) __PYX_ERR(0, 496, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memmap_dir), (&PyUnicode_Type), 1, "memmap_dir", 1))) __PYX_ERR(0, 496, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), __pyx_v_chroms, __pyx_v_stranded, __pyx_v_typecode, __pyx_v_storage, __pyx_v_memmap_dir);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_chroms, int __pyx_v_stranded, PyObject *__pyx_v_typecode, PyObject *__pyx_v_storage, PyObject *__pyx_v_memmap_dir) {
PyObject *__pyx_v_chrom = NULL;
PyObject *__pyx_7genexpr__pyx_v_c = NULL;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
Py_ssize_t __pyx_t_5;
PyObject *(*__pyx_t_6)(PyObject *);
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
__Pyx_INCREF(__pyx_v_chroms);
/* "HTSeq/_HTSeq.pyx":497
* def __init__(self, object chroms, bint stranded=True, str typecode='d',
* str storage='step', str memmap_dir=""):
* self.chrom_vectors = {} # <<<<<<<<<<<<<<
* self.stranded = stranded
* self.typecode = typecode
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->chrom_vectors);
__Pyx_DECREF(__pyx_v_self->chrom_vectors);
__pyx_v_self->chrom_vectors = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":498
* str storage='step', str memmap_dir=""):
* self.chrom_vectors = {}
* self.stranded = stranded # <<<<<<<<<<<<<<
* self.typecode = typecode
* self.auto_add_chroms = chroms == "auto"
*/
__pyx_v_self->stranded = __pyx_v_stranded;
/* "HTSeq/_HTSeq.pyx":499
* self.chrom_vectors = {}
* self.stranded = stranded
* self.typecode = typecode # <<<<<<<<<<<<<<
* self.auto_add_chroms = chroms == "auto"
* if self.auto_add_chroms:
*/
__Pyx_INCREF(__pyx_v_typecode);
__Pyx_GIVEREF(__pyx_v_typecode);
__Pyx_GOTREF(__pyx_v_self->typecode);
__Pyx_DECREF(__pyx_v_self->typecode);
__pyx_v_self->typecode = __pyx_v_typecode;
/* "HTSeq/_HTSeq.pyx":500
* self.stranded = stranded
* self.typecode = typecode
* self.auto_add_chroms = chroms == "auto" # <<<<<<<<<<<<<<
* if self.auto_add_chroms:
* chroms = []
*/
__pyx_t_1 = PyObject_RichCompare(__pyx_v_chroms, __pyx_n_u_auto, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_self->auto_add_chroms = __pyx_t_2;
/* "HTSeq/_HTSeq.pyx":501
* self.typecode = typecode
* self.auto_add_chroms = chroms == "auto"
* if self.auto_add_chroms: # <<<<<<<<<<<<<<
* chroms = []
* if storage != 'step':
*/
__pyx_t_2 = (__pyx_v_self->auto_add_chroms != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":502
* self.auto_add_chroms = chroms == "auto"
* if self.auto_add_chroms:
* chroms = [] # <<<<<<<<<<<<<<
* if storage != 'step':
* raise TypeError, "Automatic adding of chromosomes can " + \
*/
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_chroms, __pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":503
* if self.auto_add_chroms:
* chroms = []
* if storage != 'step': # <<<<<<<<<<<<<<
* raise TypeError, "Automatic adding of chromosomes can " + \
* " only be used with storage type 'StepVector'."
*/
__pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_n_u_step, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 503, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_2 != 0);
if (unlikely(__pyx_t_3)) {
/* "HTSeq/_HTSeq.pyx":504
* chroms = []
* if storage != 'step':
* raise TypeError, "Automatic adding of chromosomes can " + \ # <<<<<<<<<<<<<<
* " only be used with storage type 'StepVector'."
* elif isinstance(chroms, list):
*/
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Automatic_adding_of_chromosomes, 0, 0);
__PYX_ERR(0, 504, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":503
* if self.auto_add_chroms:
* chroms = []
* if storage != 'step': # <<<<<<<<<<<<<<
* raise TypeError, "Automatic adding of chromosomes can " + \
* " only be used with storage type 'StepVector'."
*/
}
/* "HTSeq/_HTSeq.pyx":501
* self.typecode = typecode
* self.auto_add_chroms = chroms == "auto"
* if self.auto_add_chroms: # <<<<<<<<<<<<<<
* chroms = []
* if storage != 'step':
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":506
* raise TypeError, "Automatic adding of chromosomes can " + \
* " only be used with storage type 'StepVector'."
* elif isinstance(chroms, list): # <<<<<<<<<<<<<<
* if storage != 'step':
* raise TypeError, "Indefinite-length chromosomes can " + \
*/
__pyx_t_3 = PyList_Check(__pyx_v_chroms);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":507
* " only be used with storage type 'StepVector'."
* elif isinstance(chroms, list):
* if storage != 'step': # <<<<<<<<<<<<<<
* raise TypeError, "Indefinite-length chromosomes can " + \
* " only be used with storage type 'StepVector'."
*/
__pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_n_u_step, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 507, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_2 != 0);
if (unlikely(__pyx_t_3)) {
/* "HTSeq/_HTSeq.pyx":508
* elif isinstance(chroms, list):
* if storage != 'step':
* raise TypeError, "Indefinite-length chromosomes can " + \ # <<<<<<<<<<<<<<
* " only be used with storage type 'StepVector'."
* chroms = dict([(c, sys.maxsize) for c in chroms])
*/
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Indefinite_length_chromosomes_ca, 0, 0);
__PYX_ERR(0, 508, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":507
* " only be used with storage type 'StepVector'."
* elif isinstance(chroms, list):
* if storage != 'step': # <<<<<<<<<<<<<<
* raise TypeError, "Indefinite-length chromosomes can " + \
* " only be used with storage type 'StepVector'."
*/
}
/* "HTSeq/_HTSeq.pyx":510
* raise TypeError, "Indefinite-length chromosomes can " + \
* " only be used with storage type 'StepVector'."
* chroms = dict([(c, sys.maxsize) for c in chroms]) # <<<<<<<<<<<<<<
* elif not isinstance(chroms, dict):
* raise TypeError, "'chroms' must be a list or a dict or 'auto'."
*/
{ /* enter inner scope */
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_v_chroms)) || PyTuple_CheckExact(__pyx_v_chroms)) {
__pyx_t_4 = __pyx_v_chroms; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
} else {
__pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_chroms); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L8_error)
}
for (;;) {
if (likely(!__pyx_t_6)) {
if (likely(PyList_CheckExact(__pyx_t_4))) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 510, __pyx_L8_error)
#else
__pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
} else {
if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 510, __pyx_L8_error)
#else
__pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
__pyx_t_7 = __pyx_t_6(__pyx_t_4);
if (unlikely(!__pyx_t_7)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 510, __pyx_L8_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_7);
}
__Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_c, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 510, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_7genexpr__pyx_v_c);
__Pyx_GIVEREF(__pyx_7genexpr__pyx_v_c);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_7genexpr__pyx_v_c);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
__pyx_t_8 = 0;
if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 510, __pyx_L8_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_c); __pyx_7genexpr__pyx_v_c = 0;
goto __pyx_L11_exit_scope;
__pyx_L8_error:;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_c); __pyx_7genexpr__pyx_v_c = 0;
goto __pyx_L1_error;
__pyx_L11_exit_scope:;
} /* exit inner scope */
__pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_chroms, __pyx_t_4);
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":506
* raise TypeError, "Automatic adding of chromosomes can " + \
* " only be used with storage type 'StepVector'."
* elif isinstance(chroms, list): # <<<<<<<<<<<<<<
* if storage != 'step':
* raise TypeError, "Indefinite-length chromosomes can " + \
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":511
* " only be used with storage type 'StepVector'."
* chroms = dict([(c, sys.maxsize) for c in chroms])
* elif not isinstance(chroms, dict): # <<<<<<<<<<<<<<
* raise TypeError, "'chroms' must be a list or a dict or 'auto'."
* self.storage = storage
*/
__pyx_t_3 = PyDict_Check(__pyx_v_chroms);
__pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
if (unlikely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":512
* chroms = dict([(c, sys.maxsize) for c in chroms])
* elif not isinstance(chroms, dict):
* raise TypeError, "'chroms' must be a list or a dict or 'auto'." # <<<<<<<<<<<<<<
* self.storage = storage
* self.memmap_dir = memmap_dir
*/
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_chroms_must_be_a_list_or_a_dict, 0, 0);
__PYX_ERR(0, 512, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":511
* " only be used with storage type 'StepVector'."
* chroms = dict([(c, sys.maxsize) for c in chroms])
* elif not isinstance(chroms, dict): # <<<<<<<<<<<<<<
* raise TypeError, "'chroms' must be a list or a dict or 'auto'."
* self.storage = storage
*/
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":513
* elif not isinstance(chroms, dict):
* raise TypeError, "'chroms' must be a list or a dict or 'auto'."
* self.storage = storage # <<<<<<<<<<<<<<
* self.memmap_dir = memmap_dir
*
*/
__Pyx_INCREF(__pyx_v_storage);
__Pyx_GIVEREF(__pyx_v_storage);
__Pyx_GOTREF(__pyx_v_self->storage);
__Pyx_DECREF(__pyx_v_self->storage);
__pyx_v_self->storage = __pyx_v_storage;
/* "HTSeq/_HTSeq.pyx":514
* raise TypeError, "'chroms' must be a list or a dict or 'auto'."
* self.storage = storage
* self.memmap_dir = memmap_dir # <<<<<<<<<<<<<<
*
* for chrom in chroms:
*/
__Pyx_INCREF(__pyx_v_memmap_dir);
__Pyx_GIVEREF(__pyx_v_memmap_dir);
__Pyx_GOTREF(__pyx_v_self->memmap_dir);
__Pyx_DECREF(__pyx_v_self->memmap_dir);
__pyx_v_self->memmap_dir = __pyx_v_memmap_dir;
/* "HTSeq/_HTSeq.pyx":516
* self.memmap_dir = memmap_dir
*
* for chrom in chroms: # <<<<<<<<<<<<<<
* self.add_chrom(chrom, chroms[chrom])
*
*/
if (likely(PyList_CheckExact(__pyx_v_chroms)) || PyTuple_CheckExact(__pyx_v_chroms)) {
__pyx_t_4 = __pyx_v_chroms; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
} else {
__pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_chroms); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_6)) {
if (likely(PyList_CheckExact(__pyx_t_4))) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_6(__pyx_t_4);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 516, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":517
*
* for chrom in chroms:
* self.add_chrom(chrom, chroms[chrom]) # <<<<<<<<<<<<<<
*
* def __getitem__(self, index):
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_chroms, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = NULL;
__pyx_t_10 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
__pyx_t_10 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_chrom, __pyx_t_8};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_chrom, __pyx_t_8};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
{
__pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
if (__pyx_t_9) {
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
}
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_chrom);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
__pyx_t_8 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":516
* self.memmap_dir = memmap_dir
*
* for chrom in chroms: # <<<<<<<<<<<<<<
* self.add_chrom(chrom, chroms[chrom])
*
*/
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":495
* cdef readonly str memmap_dir
*
* def __init__(self, object chroms, bint stranded=True, str typecode='d', # <<<<<<<<<<<<<<
* str storage='step', str memmap_dir=""):
* self.chrom_vectors = {}
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_chrom);
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_c);
__Pyx_XDECREF(__pyx_v_chroms);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":519
* self.add_chrom(chrom, chroms[chrom])
*
* def __getitem__(self, index): # <<<<<<<<<<<<<<
* if isinstance(index, GenomicInterval):
* if self.stranded and index.strand not in (strand_plus, strand_minus):
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_2__getitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), ((PyObject *)__pyx_v_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_2__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_index) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__getitem__", 0);
/* "HTSeq/_HTSeq.pyx":520
*
* def __getitem__(self, index):
* if isinstance(index, GenomicInterval): # <<<<<<<<<<<<<<
* if self.stranded and index.strand not in (strand_plus, strand_minus):
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":521
* def __getitem__(self, index):
* if isinstance(index, GenomicInterval):
* if self.stranded and index.strand not in (strand_plus, strand_minus): # <<<<<<<<<<<<<<
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
*/
__pyx_t_1 = (__pyx_v_self->stranded != 0);
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_plus, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
if (__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L7_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
__pyx_t_1 = __pyx_t_4;
__pyx_L7_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = (__pyx_t_1 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L5_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
/* "HTSeq/_HTSeq.pyx":522
* if isinstance(index, GenomicInterval):
* if self.stranded and index.strand not in (strand_plus, strand_minus):
* raise KeyError, "Non-stranded index used for stranded GenomicArray." # <<<<<<<<<<<<<<
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
* self.add_chrom(index.chrom)
*/
__Pyx_Raise(__pyx_builtin_KeyError, __pyx_kp_u_Non_stranded_index_used_for_stra, 0, 0);
__PYX_ERR(0, 522, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":521
* def __getitem__(self, index):
* if isinstance(index, GenomicInterval):
* if self.stranded and index.strand not in (strand_plus, strand_minus): # <<<<<<<<<<<<<<
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
*/
}
/* "HTSeq/_HTSeq.pyx":523
* if self.stranded and index.strand not in (strand_plus, strand_minus):
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors: # <<<<<<<<<<<<<<
* self.add_chrom(index.chrom)
* if isinstance(index, GenomicPosition):
*/
__pyx_t_4 = (__pyx_v_self->auto_add_chroms != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L10_bool_binop_done;
}
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 523, __pyx_L1_error)
}
__pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_t_3, __pyx_v_self->chrom_vectors, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = (__pyx_t_4 != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L10_bool_binop_done:;
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":524
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
* self.add_chrom(index.chrom) # <<<<<<<<<<<<<<
* if isinstance(index, GenomicPosition):
* if self.stranded:
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":523
* if self.stranded and index.strand not in (strand_plus, strand_minus):
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors: # <<<<<<<<<<<<<<
* self.add_chrom(index.chrom)
* if isinstance(index, GenomicPosition):
*/
}
/* "HTSeq/_HTSeq.pyx":525
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
* self.add_chrom(index.chrom)
* if isinstance(index, GenomicPosition): # <<<<<<<<<<<<<<
* if self.stranded:
* return self.chrom_vectors[index.chrom][index.strand][index.pos]
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":526
* self.add_chrom(index.chrom)
* if isinstance(index, GenomicPosition):
* if self.stranded: # <<<<<<<<<<<<<<
* return self.chrom_vectors[index.chrom][index.strand][index.pos]
* else:
*/
__pyx_t_1 = (__pyx_v_self->stranded != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":527
* if isinstance(index, GenomicPosition):
* if self.stranded:
* return self.chrom_vectors[index.chrom][index.strand][index.pos] # <<<<<<<<<<<<<<
* else:
* return self.chrom_vectors[index.chrom][strand_nostrand][index.pos]
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 527, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":526
* self.add_chrom(index.chrom)
* if isinstance(index, GenomicPosition):
* if self.stranded: # <<<<<<<<<<<<<<
* return self.chrom_vectors[index.chrom][index.strand][index.pos]
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":529
* return self.chrom_vectors[index.chrom][index.strand][index.pos]
* else:
* return self.chrom_vectors[index.chrom][strand_nostrand][index.pos] # <<<<<<<<<<<<<<
* else:
* if self.stranded:
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 529, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 529, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
}
/* "HTSeq/_HTSeq.pyx":525
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
* self.add_chrom(index.chrom)
* if isinstance(index, GenomicPosition): # <<<<<<<<<<<<<<
* if self.stranded:
* return self.chrom_vectors[index.chrom][index.strand][index.pos]
*/
}
/* "HTSeq/_HTSeq.pyx":531
* return self.chrom_vectors[index.chrom][strand_nostrand][index.pos]
* else:
* if self.stranded: # <<<<<<<<<<<<<<
* return self.chrom_vectors[index.chrom][index.strand][index.start: index.end]
* else:
*/
/*else*/ {
__pyx_t_1 = (__pyx_v_self->stranded != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":532
* else:
* if self.stranded:
* return self.chrom_vectors[index.chrom][index.strand][index.start: index.end] # <<<<<<<<<<<<<<
* else:
* return self.chrom_vectors[index.chrom][strand_nostrand][index.start: index.end]
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 532, __pyx_L1_error)
}
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_t_6, &__pyx_t_3, NULL, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_7;
__pyx_t_7 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":531
* return self.chrom_vectors[index.chrom][strand_nostrand][index.pos]
* else:
* if self.stranded: # <<<<<<<<<<<<<<
* return self.chrom_vectors[index.chrom][index.strand][index.start: index.end]
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":534
* return self.chrom_vectors[index.chrom][index.strand][index.start: index.end]
* else:
* return self.chrom_vectors[index.chrom][strand_nostrand][index.start: index.end] # <<<<<<<<<<<<<<
* else:
* return self.chrom_vectors[index]
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 534, __pyx_L1_error)
}
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_7, 0, 0, &__pyx_t_3, &__pyx_t_6, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
}
}
/* "HTSeq/_HTSeq.pyx":520
*
* def __getitem__(self, index):
* if isinstance(index, GenomicInterval): # <<<<<<<<<<<<<<
* if self.stranded and index.strand not in (strand_plus, strand_minus):
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
*/
}
/* "HTSeq/_HTSeq.pyx":536
* return self.chrom_vectors[index.chrom][strand_nostrand][index.start: index.end]
* else:
* return self.chrom_vectors[index] # <<<<<<<<<<<<<<
*
* def __setitem__(self, index, value):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 536, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
}
/* "HTSeq/_HTSeq.pyx":519
* self.add_chrom(chrom, chroms[chrom])
*
* def __getitem__(self, index): # <<<<<<<<<<<<<<
* if isinstance(index, GenomicInterval):
* if self.stranded and index.strand not in (strand_plus, strand_minus):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":538
* return self.chrom_vectors[index]
*
* def __setitem__(self, index, value): # <<<<<<<<<<<<<<
* cdef GenomicInterval index2
* if isinstance(value, ChromVector):
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_4__setitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_4__setitem__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_index2 = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__setitem__", 0);
/* "HTSeq/_HTSeq.pyx":540
* def __setitem__(self, index, value):
* cdef GenomicInterval index2
* if isinstance(value, ChromVector): # <<<<<<<<<<<<<<
* if not isinstance(index, GenomicInterval):
* raise NotImplementedError, "Required assignment signature not yet implemented."
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":541
* cdef GenomicInterval index2
* if isinstance(value, ChromVector):
* if not isinstance(index, GenomicInterval): # <<<<<<<<<<<<<<
* raise NotImplementedError, "Required assignment signature not yet implemented."
* index2 = index.copy()
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval);
__pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
if (unlikely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":542
* if isinstance(value, ChromVector):
* if not isinstance(index, GenomicInterval):
* raise NotImplementedError, "Required assignment signature not yet implemented." # <<<<<<<<<<<<<<
* index2 = index.copy()
* if not self.stranded:
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, __pyx_kp_u_Required_assignment_signature_no, 0, 0);
__PYX_ERR(0, 542, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":541
* cdef GenomicInterval index2
* if isinstance(value, ChromVector):
* if not isinstance(index, GenomicInterval): # <<<<<<<<<<<<<<
* raise NotImplementedError, "Required assignment signature not yet implemented."
* index2 = index.copy()
*/
}
/* "HTSeq/_HTSeq.pyx":543
* if not isinstance(index, GenomicInterval):
* raise NotImplementedError, "Required assignment signature not yet implemented."
* index2 = index.copy() # <<<<<<<<<<<<<<
* if not self.stranded:
* index2.strand = strand_nostrand
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 543, __pyx_L1_error)
__pyx_v_index2 = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_3);
__pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":544
* raise NotImplementedError, "Required assignment signature not yet implemented."
* index2 = index.copy()
* if not self.stranded: # <<<<<<<<<<<<<<
* index2.strand = strand_nostrand
* if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:
*/
__pyx_t_1 = ((!(__pyx_v_self->stranded != 0)) != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":545
* index2 = index.copy()
* if not self.stranded:
* index2.strand = strand_nostrand # <<<<<<<<<<<<<<
* if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:
* return
*/
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_index2), __pyx_n_s_strand, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand) < 0) __PYX_ERR(0, 545, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":544
* raise NotImplementedError, "Required assignment signature not yet implemented."
* index2 = index.copy()
* if not self.stranded: # <<<<<<<<<<<<<<
* index2.strand = strand_nostrand
* if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:
*/
}
/* "HTSeq/_HTSeq.pyx":546
* if not self.stranded:
* index2.strand = strand_nostrand
* if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv: # <<<<<<<<<<<<<<
* return
* raise NotImplementedError, "Required assignment signature not yet implemented."
*/
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 546, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_index2->chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_index2), __pyx_n_s_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_2 = (__pyx_t_4 == __pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = (__pyx_t_2 != 0);
if (__pyx_t_6) {
} else {
__pyx_t_1 = __pyx_t_6;
goto __pyx_L7_bool_binop_done;
}
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_iv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_index2), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 546, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_1 = __pyx_t_6;
__pyx_L7_bool_binop_done:;
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":547
* index2.strand = strand_nostrand
* if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:
* return # <<<<<<<<<<<<<<
* raise NotImplementedError, "Required assignment signature not yet implemented."
* if isinstance(index, GenomicInterval):
*/
__pyx_r = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":546
* if not self.stranded:
* index2.strand = strand_nostrand
* if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv: # <<<<<<<<<<<<<<
* return
* raise NotImplementedError, "Required assignment signature not yet implemented."
*/
}
/* "HTSeq/_HTSeq.pyx":548
* if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:
* return
* raise NotImplementedError, "Required assignment signature not yet implemented." # <<<<<<<<<<<<<<
* if isinstance(index, GenomicInterval):
* if self.stranded and index.strand not in (strand_plus, strand_minus):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, __pyx_kp_u_Required_assignment_signature_no, 0, 0);
__PYX_ERR(0, 548, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":540
* def __setitem__(self, index, value):
* cdef GenomicInterval index2
* if isinstance(value, ChromVector): # <<<<<<<<<<<<<<
* if not isinstance(index, GenomicInterval):
* raise NotImplementedError, "Required assignment signature not yet implemented."
*/
}
/* "HTSeq/_HTSeq.pyx":549
* return
* raise NotImplementedError, "Required assignment signature not yet implemented."
* if isinstance(index, GenomicInterval): # <<<<<<<<<<<<<<
* if self.stranded and index.strand not in (strand_plus, strand_minus):
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval);
__pyx_t_6 = (__pyx_t_1 != 0);
if (likely(__pyx_t_6)) {
/* "HTSeq/_HTSeq.pyx":550
* raise NotImplementedError, "Required assignment signature not yet implemented."
* if isinstance(index, GenomicInterval):
* if self.stranded and index.strand not in (strand_plus, strand_minus): # <<<<<<<<<<<<<<
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
*/
__pyx_t_1 = (__pyx_v_self->stranded != 0);
if (__pyx_t_1) {
} else {
__pyx_t_6 = __pyx_t_1;
goto __pyx_L11_bool_binop_done;
}
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_v_5HTSeq_6_HTSeq_strand_plus, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 550, __pyx_L1_error)
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L13_bool_binop_done;
}
__pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 550, __pyx_L1_error)
__pyx_t_1 = __pyx_t_2;
__pyx_L13_bool_binop_done:;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = (__pyx_t_1 != 0);
__pyx_t_6 = __pyx_t_2;
__pyx_L11_bool_binop_done:;
if (unlikely(__pyx_t_6)) {
/* "HTSeq/_HTSeq.pyx":551
* if isinstance(index, GenomicInterval):
* if self.stranded and index.strand not in (strand_plus, strand_minus):
* raise KeyError, "Non-stranded index used for stranded GenomicArray." # <<<<<<<<<<<<<<
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
* self.add_chrom(index.chrom)
*/
__Pyx_Raise(__pyx_builtin_KeyError, __pyx_kp_u_Non_stranded_index_used_for_stra, 0, 0);
__PYX_ERR(0, 551, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":550
* raise NotImplementedError, "Required assignment signature not yet implemented."
* if isinstance(index, GenomicInterval):
* if self.stranded and index.strand not in (strand_plus, strand_minus): # <<<<<<<<<<<<<<
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
*/
}
/* "HTSeq/_HTSeq.pyx":552
* if self.stranded and index.strand not in (strand_plus, strand_minus):
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors: # <<<<<<<<<<<<<<
* self.add_chrom(index.chrom)
* if self.stranded:
*/
__pyx_t_2 = (__pyx_v_self->auto_add_chroms != 0);
if (__pyx_t_2) {
} else {
__pyx_t_6 = __pyx_t_2;
goto __pyx_L16_bool_binop_done;
}
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 552, __pyx_L1_error)
}
__pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_4, __pyx_v_self->chrom_vectors, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 552, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_1 = (__pyx_t_2 != 0);
__pyx_t_6 = __pyx_t_1;
__pyx_L16_bool_binop_done:;
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":553
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
* self.add_chrom(index.chrom) # <<<<<<<<<<<<<<
* if self.stranded:
* self.chrom_vectors[index.chrom][index.strand][
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":552
* if self.stranded and index.strand not in (strand_plus, strand_minus):
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors: # <<<<<<<<<<<<<<
* self.add_chrom(index.chrom)
* if self.stranded:
*/
}
/* "HTSeq/_HTSeq.pyx":554
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
* self.add_chrom(index.chrom)
* if self.stranded: # <<<<<<<<<<<<<<
* self.chrom_vectors[index.chrom][index.strand][
* index.start: index.end] = value
*/
__pyx_t_6 = (__pyx_v_self->stranded != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":555
* self.add_chrom(index.chrom)
* if self.stranded:
* self.chrom_vectors[index.chrom][index.strand][ # <<<<<<<<<<<<<<
* index.start: index.end] = value
* else:
*/
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 555, __pyx_L1_error)
}
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":556
* if self.stranded:
* self.chrom_vectors[index.chrom][index.strand][
* index.start: index.end] = value # <<<<<<<<<<<<<<
* else:
* self.chrom_vectors[index.chrom][strand_nostrand][
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_PyObject_SetSlice(__pyx_t_3, __pyx_v_value, 0, 0, &__pyx_t_4, &__pyx_t_5, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":554
* if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
* self.add_chrom(index.chrom)
* if self.stranded: # <<<<<<<<<<<<<<
* self.chrom_vectors[index.chrom][index.strand][
* index.start: index.end] = value
*/
goto __pyx_L18;
}
/* "HTSeq/_HTSeq.pyx":559
* else:
* self.chrom_vectors[index.chrom][strand_nostrand][
* index.start: index.end] = value # <<<<<<<<<<<<<<
* else:
* raise TypeError, "Illegal index type."
*/
/*else*/ {
/* "HTSeq/_HTSeq.pyx":558
* index.start: index.end] = value
* else:
* self.chrom_vectors[index.chrom][strand_nostrand][ # <<<<<<<<<<<<<<
* index.start: index.end] = value
* else:
*/
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 558, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":559
* else:
* self.chrom_vectors[index.chrom][strand_nostrand][
* index.start: index.end] = value # <<<<<<<<<<<<<<
* else:
* raise TypeError, "Illegal index type."
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_PyObject_SetSlice(__pyx_t_5, __pyx_v_value, 0, 0, &__pyx_t_4, &__pyx_t_3, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L18:;
/* "HTSeq/_HTSeq.pyx":549
* return
* raise NotImplementedError, "Required assignment signature not yet implemented."
* if isinstance(index, GenomicInterval): # <<<<<<<<<<<<<<
* if self.stranded and index.strand not in (strand_plus, strand_minus):
* raise KeyError, "Non-stranded index used for stranded GenomicArray."
*/
goto __pyx_L9;
}
/* "HTSeq/_HTSeq.pyx":561
* index.start: index.end] = value
* else:
* raise TypeError, "Illegal index type." # <<<<<<<<<<<<<<
*
* def add_chrom(self, chrom, length=sys.maxsize, start_index=0):
*/
/*else*/ {
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Illegal_index_type_2, 0, 0);
__PYX_ERR(0, 561, __pyx_L1_error)
}
__pyx_L9:;
/* "HTSeq/_HTSeq.pyx":538
* return self.chrom_vectors[index]
*
* def __setitem__(self, index, value): # <<<<<<<<<<<<<<
* cdef GenomicInterval index2
* if isinstance(value, ChromVector):
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_index2);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":563
* raise TypeError, "Illegal index type."
*
* def add_chrom(self, chrom, length=sys.maxsize, start_index=0): # <<<<<<<<<<<<<<
* cdef GenomicInterval iv
* if length == sys.maxsize:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_chrom = 0;
PyObject *__pyx_v_length = 0;
PyObject *__pyx_v_start_index = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_chrom (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_length,&__pyx_n_s_start_index,0};
PyObject* values[3] = {0,0,0};
values[1] = __pyx_k__18;
values[2] = ((PyObject *)__pyx_int_0);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start_index);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_chrom") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_chrom = values[0];
__pyx_v_length = values[1];
__pyx_v_start_index = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("add_chrom", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.add_chrom", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6add_chrom(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), __pyx_v_chrom, __pyx_v_length, __pyx_v_start_index);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6add_chrom(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_length, PyObject *__pyx_v_start_index) {
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("add_chrom", 0);
/* "HTSeq/_HTSeq.pyx":565
* def add_chrom(self, chrom, length=sys.maxsize, start_index=0):
* cdef GenomicInterval iv
* if length == sys.maxsize: # <<<<<<<<<<<<<<
* iv = GenomicInterval(chrom, start_index, sys.maxsize, ".")
* else:
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_RichCompare(__pyx_v_length, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 565, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":566
* cdef GenomicInterval iv
* if length == sys.maxsize:
* iv = GenomicInterval(chrom, start_index, sys.maxsize, ".") # <<<<<<<<<<<<<<
* else:
* iv = GenomicInterval(chrom, start_index, start_index + length, ".")
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
__Pyx_INCREF(__pyx_v_start_index);
__Pyx_GIVEREF(__pyx_v_start_index);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start_index);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
__Pyx_INCREF(__pyx_kp_u__8);
__Pyx_GIVEREF(__pyx_kp_u__8);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__8);
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":565
* def add_chrom(self, chrom, length=sys.maxsize, start_index=0):
* cdef GenomicInterval iv
* if length == sys.maxsize: # <<<<<<<<<<<<<<
* iv = GenomicInterval(chrom, start_index, sys.maxsize, ".")
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":568
* iv = GenomicInterval(chrom, start_index, sys.maxsize, ".")
* else:
* iv = GenomicInterval(chrom, start_index, start_index + length, ".") # <<<<<<<<<<<<<<
* if self.stranded:
* self.chrom_vectors[chrom] = {}
*/
/*else*/ {
__pyx_t_2 = PyNumber_Add(__pyx_v_start_index, __pyx_v_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
__Pyx_INCREF(__pyx_v_start_index);
__Pyx_GIVEREF(__pyx_v_start_index);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start_index);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
__Pyx_INCREF(__pyx_kp_u__8);
__Pyx_GIVEREF(__pyx_kp_u__8);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__8);
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2);
__pyx_t_2 = 0;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":569
* else:
* iv = GenomicInterval(chrom, start_index, start_index + length, ".")
* if self.stranded: # <<<<<<<<<<<<<<
* self.chrom_vectors[chrom] = {}
* iv.strand = "+"
*/
__pyx_t_3 = (__pyx_v_self->stranded != 0);
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":570
* iv = GenomicInterval(chrom, start_index, start_index + length, ".")
* if self.stranded:
* self.chrom_vectors[chrom] = {} # <<<<<<<<<<<<<<
* iv.strand = "+"
* self.chrom_vectors[ chrom ][ strand_plus ] = \
*/
__pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 570, __pyx_L1_error)
}
if (unlikely(PyDict_SetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom, __pyx_t_2) < 0)) __PYX_ERR(0, 570, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":571
* if self.stranded:
* self.chrom_vectors[chrom] = {}
* iv.strand = "+" # <<<<<<<<<<<<<<
* self.chrom_vectors[ chrom ][ strand_plus ] = \
* ChromVector.create(iv, self.typecode,
*/
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand, __pyx_kp_u__19) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":573
* iv.strand = "+"
* self.chrom_vectors[ chrom ][ strand_plus ] = \
* ChromVector.create(iv, self.typecode, # <<<<<<<<<<<<<<
* self.storage, self.memmap_dir)
* iv = iv.copy()
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector), __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "HTSeq/_HTSeq.pyx":574
* self.chrom_vectors[ chrom ][ strand_plus ] = \
* ChromVector.create(iv, self.typecode,
* self.storage, self.memmap_dir) # <<<<<<<<<<<<<<
* iv = iv.copy()
* iv.strand = "-"
*/
__pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[5] = {__pyx_t_4, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[5] = {__pyx_t_4, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
__pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_iv));
__Pyx_INCREF(__pyx_v_self->typecode);
__Pyx_GIVEREF(__pyx_v_self->typecode);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->typecode);
__Pyx_INCREF(__pyx_v_self->storage);
__Pyx_GIVEREF(__pyx_v_self->storage);
PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_self->storage);
__Pyx_INCREF(__pyx_v_self->memmap_dir);
__Pyx_GIVEREF(__pyx_v_self->memmap_dir);
PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_self->memmap_dir);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":572
* self.chrom_vectors[chrom] = {}
* iv.strand = "+"
* self.chrom_vectors[ chrom ][ strand_plus ] = \ # <<<<<<<<<<<<<<
* ChromVector.create(iv, self.typecode,
* self.storage, self.memmap_dir)
*/
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 572, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_5HTSeq_6_HTSeq_strand_plus, __pyx_t_2) < 0)) __PYX_ERR(0, 572, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":575
* ChromVector.create(iv, self.typecode,
* self.storage, self.memmap_dir)
* iv = iv.copy() # <<<<<<<<<<<<<<
* iv.strand = "-"
* self.chrom_vectors[ chrom ][ strand_minus ] = \
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
__pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 575, __pyx_L1_error)
__Pyx_DECREF_SET(__pyx_v_iv, ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2));
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":576
* self.storage, self.memmap_dir)
* iv = iv.copy()
* iv.strand = "-" # <<<<<<<<<<<<<<
* self.chrom_vectors[ chrom ][ strand_minus ] = \
* ChromVector.create(iv, self.typecode,
*/
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand, __pyx_kp_u__20) < 0) __PYX_ERR(0, 576, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":578
* iv.strand = "-"
* self.chrom_vectors[ chrom ][ strand_minus ] = \
* ChromVector.create(iv, self.typecode, # <<<<<<<<<<<<<<
* self.storage, self.memmap_dir)
* else:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector), __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "HTSeq/_HTSeq.pyx":579
* self.chrom_vectors[ chrom ][ strand_minus ] = \
* ChromVector.create(iv, self.typecode,
* self.storage, self.memmap_dir) # <<<<<<<<<<<<<<
* else:
* self.chrom_vectors[chrom] = {
*/
__pyx_t_6 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
__pyx_t_4 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__pyx_t_6) {
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, ((PyObject *)__pyx_v_iv));
__Pyx_INCREF(__pyx_v_self->typecode);
__Pyx_GIVEREF(__pyx_v_self->typecode);
PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_self->typecode);
__Pyx_INCREF(__pyx_v_self->storage);
__Pyx_GIVEREF(__pyx_v_self->storage);
PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_v_self->storage);
__Pyx_INCREF(__pyx_v_self->memmap_dir);
__Pyx_GIVEREF(__pyx_v_self->memmap_dir);
PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_5, __pyx_v_self->memmap_dir);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":577
* iv = iv.copy()
* iv.strand = "-"
* self.chrom_vectors[ chrom ][ strand_minus ] = \ # <<<<<<<<<<<<<<
* ChromVector.create(iv, self.typecode,
* self.storage, self.memmap_dir)
*/
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 577, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_5HTSeq_6_HTSeq_strand_minus, __pyx_t_2) < 0)) __PYX_ERR(0, 577, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":569
* else:
* iv = GenomicInterval(chrom, start_index, start_index + length, ".")
* if self.stranded: # <<<<<<<<<<<<<<
* self.chrom_vectors[chrom] = {}
* iv.strand = "+"
*/
goto __pyx_L4;
}
/* "HTSeq/_HTSeq.pyx":582
* else:
* self.chrom_vectors[chrom] = {
* strand_nostrand: ChromVector.create(iv, self.typecode, # <<<<<<<<<<<<<<
* self.storage,
* self.memmap_dir)}
*/
/*else*/ {
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector), __pyx_n_s_create); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "HTSeq/_HTSeq.pyx":584
* strand_nostrand: ChromVector.create(iv, self.typecode,
* self.storage,
* self.memmap_dir)} # <<<<<<<<<<<<<<
*
* def __reduce__(self):
*/
__pyx_t_6 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
__pyx_t_7 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 582, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_6) {
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, ((PyObject *)__pyx_v_iv));
__Pyx_INCREF(__pyx_v_self->typecode);
__Pyx_GIVEREF(__pyx_v_self->typecode);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, __pyx_v_self->typecode);
__Pyx_INCREF(__pyx_v_self->storage);
__Pyx_GIVEREF(__pyx_v_self->storage);
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_5, __pyx_v_self->storage);
__Pyx_INCREF(__pyx_v_self->memmap_dir);
__Pyx_GIVEREF(__pyx_v_self->memmap_dir);
PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_5, __pyx_v_self->memmap_dir);
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PyDict_SetItem(__pyx_t_2, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand, __pyx_t_1) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":581
* self.storage, self.memmap_dir)
* else:
* self.chrom_vectors[chrom] = { # <<<<<<<<<<<<<<
* strand_nostrand: ChromVector.create(iv, self.typecode,
* self.storage,
*/
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 581, __pyx_L1_error)
}
if (unlikely(PyDict_SetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom, __pyx_t_2) < 0)) __PYX_ERR(0, 581, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L4:;
/* "HTSeq/_HTSeq.pyx":563
* raise TypeError, "Illegal index type."
*
* def add_chrom(self, chrom, length=sys.maxsize, start_index=0): # <<<<<<<<<<<<<<
* cdef GenomicInterval iv
* if length == sys.maxsize:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.add_chrom", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_iv);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":586
* self.memmap_dir)}
*
* def __reduce__(self): # <<<<<<<<<<<<<<
* return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8__reduce__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__reduce__", 0);
/* "HTSeq/_HTSeq.pyx":587
*
* def __reduce__(self):
* return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors)) # <<<<<<<<<<<<<<
*
* def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GenomicArray_unpickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->stranded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_INCREF(__pyx_v_self->typecode);
__Pyx_GIVEREF(__pyx_v_self->typecode);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->typecode);
__Pyx_INCREF(__pyx_v_self->chrom_vectors);
__Pyx_GIVEREF(__pyx_v_self->chrom_vectors);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->chrom_vectors);
__pyx_t_2 = 0;
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":586
* self.memmap_dir)}
*
* def __reduce__(self): # <<<<<<<<<<<<<<
* return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":589
* return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
*
* def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""): # <<<<<<<<<<<<<<
* if (not self.stranded) and strand != ".":
* raise ValueError, "Strand specified in unstranded GenomicArray."
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_11write_bedgraph_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_11write_bedgraph_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_file_or_filename = 0;
PyObject *__pyx_v_strand = 0;
PyObject *__pyx_v_track_options = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_bedgraph_file (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_or_filename,&__pyx_n_s_strand,&__pyx_n_s_track_options,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)__pyx_kp_u__8);
values[2] = ((PyObject *)__pyx_kp_u__12);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file_or_filename)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_track_options);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bedgraph_file") < 0)) __PYX_ERR(0, 589, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_file_or_filename = values[0];
__pyx_v_strand = values[1];
__pyx_v_track_options = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("write_bedgraph_file", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 589, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.write_bedgraph_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10write_bedgraph_file(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), __pyx_v_file_or_filename, __pyx_v_strand, __pyx_v_track_options);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10write_bedgraph_file(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_file_or_filename, PyObject *__pyx_v_strand, PyObject *__pyx_v_track_options) {
PyObject *__pyx_v_f = NULL;
PyObject *__pyx_v_chrom = NULL;
PyObject *__pyx_v_iv = NULL;
PyObject *__pyx_v_value = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
Py_ssize_t __pyx_t_8;
Py_ssize_t __pyx_t_9;
int __pyx_t_10;
int __pyx_t_11;
Py_ssize_t __pyx_t_12;
PyObject *(*__pyx_t_13)(PyObject *);
PyObject *__pyx_t_14 = NULL;
PyObject *__pyx_t_15 = NULL;
PyObject *(*__pyx_t_16)(PyObject *);
Py_ssize_t __pyx_t_17;
Py_UCS4 __pyx_t_18;
PyObject *__pyx_t_19 = NULL;
__Pyx_RefNannySetupContext("write_bedgraph_file", 0);
/* "HTSeq/_HTSeq.pyx":590
*
* def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""):
* if (not self.stranded) and strand != ".": # <<<<<<<<<<<<<<
* raise ValueError, "Strand specified in unstranded GenomicArray."
* if self.stranded and strand not in (strand_plus, strand_minus):
*/
__pyx_t_2 = ((!(__pyx_v_self->stranded != 0)) != 0);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_strand, __pyx_kp_u__8, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 590, __pyx_L1_error)
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":591
* def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""):
* if (not self.stranded) and strand != ".":
* raise ValueError, "Strand specified in unstranded GenomicArray." # <<<<<<<<<<<<<<
* if self.stranded and strand not in (strand_plus, strand_minus):
* raise ValueError, "Strand must be specified for stranded GenomicArray."
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Strand_specified_in_unstranded_G, 0, 0);
__PYX_ERR(0, 591, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":590
*
* def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""):
* if (not self.stranded) and strand != ".": # <<<<<<<<<<<<<<
* raise ValueError, "Strand specified in unstranded GenomicArray."
* if self.stranded and strand not in (strand_plus, strand_minus):
*/
}
/* "HTSeq/_HTSeq.pyx":592
* if (not self.stranded) and strand != ".":
* raise ValueError, "Strand specified in unstranded GenomicArray."
* if self.stranded and strand not in (strand_plus, strand_minus): # <<<<<<<<<<<<<<
* raise ValueError, "Strand must be specified for stranded GenomicArray."
* if hasattr(file_or_filename, "write"):
*/
__pyx_t_2 = (__pyx_v_self->stranded != 0);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L7_bool_binop_done;
}
__Pyx_INCREF(__pyx_v_strand);
__pyx_t_3 = __pyx_v_strand;
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_plus, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 592, __pyx_L1_error)
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 592, __pyx_L1_error)
__pyx_t_2 = __pyx_t_4;
__pyx_L9_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_4;
__pyx_L7_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":593
* raise ValueError, "Strand specified in unstranded GenomicArray."
* if self.stranded and strand not in (strand_plus, strand_minus):
* raise ValueError, "Strand must be specified for stranded GenomicArray." # <<<<<<<<<<<<<<
* if hasattr(file_or_filename, "write"):
* f = file_or_filename
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Strand_must_be_specified_for_str, 0, 0);
__PYX_ERR(0, 593, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":592
* if (not self.stranded) and strand != ".":
* raise ValueError, "Strand specified in unstranded GenomicArray."
* if self.stranded and strand not in (strand_plus, strand_minus): # <<<<<<<<<<<<<<
* raise ValueError, "Strand must be specified for stranded GenomicArray."
* if hasattr(file_or_filename, "write"):
*/
}
/* "HTSeq/_HTSeq.pyx":594
* if self.stranded and strand not in (strand_plus, strand_minus):
* raise ValueError, "Strand must be specified for stranded GenomicArray."
* if hasattr(file_or_filename, "write"): # <<<<<<<<<<<<<<
* f = file_or_filename
* else:
*/
__pyx_t_1 = __Pyx_HasAttr(__pyx_v_file_or_filename, __pyx_n_u_write); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 594, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_1 != 0);
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":595
* raise ValueError, "Strand must be specified for stranded GenomicArray."
* if hasattr(file_or_filename, "write"):
* f = file_or_filename # <<<<<<<<<<<<<<
* else:
* f = open(file_or_filename, "w")
*/
__Pyx_INCREF(__pyx_v_file_or_filename);
__pyx_v_f = __pyx_v_file_or_filename;
/* "HTSeq/_HTSeq.pyx":594
* if self.stranded and strand not in (strand_plus, strand_minus):
* raise ValueError, "Strand must be specified for stranded GenomicArray."
* if hasattr(file_or_filename, "write"): # <<<<<<<<<<<<<<
* f = file_or_filename
* else:
*/
goto __pyx_L11;
}
/* "HTSeq/_HTSeq.pyx":597
* f = file_or_filename
* else:
* f = open(file_or_filename, "w") # <<<<<<<<<<<<<<
* if track_options == "":
* f.write("track type=bedGraph\n")
*/
/*else*/ {
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_file_or_filename);
__Pyx_GIVEREF(__pyx_v_file_or_filename);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_file_or_filename);
__Pyx_INCREF(__pyx_n_u_w_2);
__Pyx_GIVEREF(__pyx_n_u_w_2);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_w_2);
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_f = __pyx_t_5;
__pyx_t_5 = 0;
}
__pyx_L11:;
/* "HTSeq/_HTSeq.pyx":598
* else:
* f = open(file_or_filename, "w")
* if track_options == "": # <<<<<<<<<<<<<<
* f.write("track type=bedGraph\n")
* else:
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_track_options, __pyx_kp_u__12, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 598, __pyx_L1_error)
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":599
* f = open(file_or_filename, "w")
* if track_options == "":
* f.write("track type=bedGraph\n") # <<<<<<<<<<<<<<
* else:
* f.write("track type=bedGraph %s\n" % track_options)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_kp_u_track_type_bedGraph) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_track_type_bedGraph);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":598
* else:
* f = open(file_or_filename, "w")
* if track_options == "": # <<<<<<<<<<<<<<
* f.write("track type=bedGraph\n")
* else:
*/
goto __pyx_L12;
}
/* "HTSeq/_HTSeq.pyx":601
* f.write("track type=bedGraph\n")
* else:
* f.write("track type=bedGraph %s\n" % track_options) # <<<<<<<<<<<<<<
* for chrom in self.chrom_vectors:
* for iv, value in self.chrom_vectors[chrom][strand].steps():
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_track_type_bedGraph_s, __pyx_v_track_options); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_L12:;
/* "HTSeq/_HTSeq.pyx":602
* else:
* f.write("track type=bedGraph %s\n" % track_options)
* for chrom in self.chrom_vectors: # <<<<<<<<<<<<<<
* for iv, value in self.chrom_vectors[chrom][strand].steps():
* if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
*/
__pyx_t_8 = 0;
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 602, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_dict_iterator(__pyx_v_self->chrom_vectors, 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__pyx_t_5 = __pyx_t_3;
__pyx_t_3 = 0;
while (1) {
__pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_9, &__pyx_t_8, &__pyx_t_3, NULL, NULL, __pyx_t_10);
if (unlikely(__pyx_t_11 == 0)) break;
if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_3);
__pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":603
* f.write("track type=bedGraph %s\n" % track_options)
* for chrom in self.chrom_vectors:
* for iv, value in self.chrom_vectors[chrom][strand].steps(): # <<<<<<<<<<<<<<
* if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
* continue
*/
if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 603, __pyx_L1_error)
}
__pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_steps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0;
__pyx_t_13 = NULL;
} else {
__pyx_t_12 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 603, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
if (likely(!__pyx_t_13)) {
if (likely(PyList_CheckExact(__pyx_t_6))) {
if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 603, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 603, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
__pyx_t_3 = __pyx_t_13(__pyx_t_6);
if (unlikely(!__pyx_t_3)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 603, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_3);
}
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 603, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_14 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_14 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_14);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_15 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
index = 0; __pyx_t_7 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_7)) goto __pyx_L17_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
index = 1; __pyx_t_14 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L17_unpacking_failed;
__Pyx_GOTREF(__pyx_t_14);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 2) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
__pyx_t_16 = NULL;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
goto __pyx_L18_unpacking_done;
__pyx_L17_unpacking_failed:;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_16 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 603, __pyx_L1_error)
__pyx_L18_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_iv, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_14);
__pyx_t_14 = 0;
/* "HTSeq/_HTSeq.pyx":604
* for chrom in self.chrom_vectors:
* for iv, value in self.chrom_vectors[chrom][strand].steps():
* if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize: # <<<<<<<<<<<<<<
* continue
* f.write("%s\t%d\t%d\t%f\n" %
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_14 = PyNumber_Negative(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_t_14, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_14 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
if (!__pyx_t_1) {
} else {
__pyx_t_4 = __pyx_t_1;
goto __pyx_L20_bool_binop_done;
}
__pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_end); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = PyObject_RichCompare(__pyx_t_14, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_4 = __pyx_t_1;
__pyx_L20_bool_binop_done:;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":605
* for iv, value in self.chrom_vectors[chrom][strand].steps():
* if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
* continue # <<<<<<<<<<<<<<
* f.write("%s\t%d\t%d\t%f\n" %
* (iv.chrom, iv.start, iv.end, value))
*/
goto __pyx_L15_continue;
/* "HTSeq/_HTSeq.pyx":604
* for chrom in self.chrom_vectors:
* for iv, value in self.chrom_vectors[chrom][strand].steps():
* if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize: # <<<<<<<<<<<<<<
* continue
* f.write("%s\t%d\t%d\t%f\n" %
*/
}
/* "HTSeq/_HTSeq.pyx":606
* if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
* continue
* f.write("%s\t%d\t%d\t%f\n" % # <<<<<<<<<<<<<<
* (iv.chrom, iv.start, iv.end, value))
* if not hasattr(file_or_filename, "write"):
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_14 = PyTuple_New(8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_17 = 0;
__pyx_t_18 = 127;
/* "HTSeq/_HTSeq.pyx":607
* continue
* f.write("%s\t%d\t%d\t%f\n" %
* (iv.chrom, iv.start, iv.end, value)) # <<<<<<<<<<<<<<
* if not hasattr(file_or_filename, "write"):
* f.close()
*/
__pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_chrom); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
__pyx_t_19 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_15), __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
__pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
__Pyx_GIVEREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_19);
__pyx_t_19 = 0;
__Pyx_INCREF(__pyx_kp_u__21);
__pyx_t_17 += 1;
__Pyx_GIVEREF(__pyx_kp_u__21);
PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_kp_u__21);
__pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_start); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_15 = __Pyx_PyObject_Format(__pyx_t_19, __pyx_n_u_d); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_18;
__pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_15);
__pyx_t_15 = 0;
__Pyx_INCREF(__pyx_kp_u__21);
__pyx_t_17 += 1;
__Pyx_GIVEREF(__pyx_kp_u__21);
PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_kp_u__21);
__pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_end); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
__pyx_t_19 = __Pyx_PyObject_Format(__pyx_t_15, __pyx_n_u_d); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
__pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
__Pyx_GIVEREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_19);
__pyx_t_19 = 0;
__Pyx_INCREF(__pyx_kp_u__21);
__pyx_t_17 += 1;
__Pyx_GIVEREF(__pyx_kp_u__21);
PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_kp_u__21);
__pyx_t_19 = __Pyx_PyObject_Format(__pyx_v_value, __pyx_n_u_f); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
__pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
__Pyx_GIVEREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_19);
__pyx_t_19 = 0;
__Pyx_INCREF(__pyx_kp_u__22);
__pyx_t_17 += 1;
__Pyx_GIVEREF(__pyx_kp_u__22);
PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_kp_u__22);
/* "HTSeq/_HTSeq.pyx":606
* if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
* continue
* f.write("%s\t%d\t%d\t%f\n" % # <<<<<<<<<<<<<<
* (iv.chrom, iv.start, iv.end, value))
* if not hasattr(file_or_filename, "write"):
*/
__pyx_t_19 = __Pyx_PyUnicode_Join(__pyx_t_14, 8, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_14 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_14)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_14);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_7 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_14, __pyx_t_19) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_19);
__Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "HTSeq/_HTSeq.pyx":603
* f.write("track type=bedGraph %s\n" % track_options)
* for chrom in self.chrom_vectors:
* for iv, value in self.chrom_vectors[chrom][strand].steps(): # <<<<<<<<<<<<<<
* if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
* continue
*/
__pyx_L15_continue:;
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":608
* f.write("%s\t%d\t%d\t%f\n" %
* (iv.chrom, iv.start, iv.end, value))
* if not hasattr(file_or_filename, "write"): # <<<<<<<<<<<<<<
* f.close()
*
*/
__pyx_t_4 = __Pyx_HasAttr(__pyx_v_file_or_filename, __pyx_n_u_write); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 608, __pyx_L1_error)
__pyx_t_1 = ((!(__pyx_t_4 != 0)) != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":609
* (iv.chrom, iv.start, iv.end, value))
* if not hasattr(file_or_filename, "write"):
* f.close() # <<<<<<<<<<<<<<
*
* def steps(self):
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":608
* f.write("%s\t%d\t%d\t%f\n" %
* (iv.chrom, iv.start, iv.end, value))
* if not hasattr(file_or_filename, "write"): # <<<<<<<<<<<<<<
* f.close()
*
*/
}
/* "HTSeq/_HTSeq.pyx":589
* return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
*
* def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""): # <<<<<<<<<<<<<<
* if (not self.stranded) and strand != ".":
* raise ValueError, "Strand specified in unstranded GenomicArray."
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_19);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.write_bedgraph_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_f);
__Pyx_XDECREF(__pyx_v_chrom);
__Pyx_XDECREF(__pyx_v_iv);
__Pyx_XDECREF(__pyx_v_value);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":611
* f.close()
*
* def steps(self): # <<<<<<<<<<<<<<
* return _HTSeq_internal.GenomicArray_steps(self)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13steps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13steps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("steps (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_12steps(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_12steps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("steps", 0);
/* "HTSeq/_HTSeq.pyx":612
*
* def steps(self):
* return _HTSeq_internal.GenomicArray_steps(self) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HTSeq_internal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GenomicArray_steps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":611
* f.close()
*
* def steps(self): # <<<<<<<<<<<<<<
* return _HTSeq_internal.GenomicArray_steps(self)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":488
* cdef class GenomicArray(object):
*
* cdef public dict chrom_vectors # <<<<<<<<<<<<<<
* cdef readonly bint stranded
* cdef readonly str typecode
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->chrom_vectors);
__pyx_r = __pyx_v_self->chrom_vectors;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 488, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->chrom_vectors);
__Pyx_DECREF(__pyx_v_self->chrom_vectors);
__pyx_v_self->chrom_vectors = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.chrom_vectors.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->chrom_vectors);
__Pyx_DECREF(__pyx_v_self->chrom_vectors);
__pyx_v_self->chrom_vectors = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":489
*
* cdef public dict chrom_vectors
* cdef readonly bint stranded # <<<<<<<<<<<<<<
* cdef readonly str typecode
* cdef public bint auto_add_chroms
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8stranded_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8stranded_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8stranded___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8stranded___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->stranded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.stranded.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":490
* cdef public dict chrom_vectors
* cdef readonly bint stranded
* cdef readonly str typecode # <<<<<<<<<<<<<<
* cdef public bint auto_add_chroms
* cdef readonly str storage
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8typecode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8typecode_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8typecode___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8typecode___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->typecode);
__pyx_r = __pyx_v_self->typecode;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":491
* cdef readonly bint stranded
* cdef readonly str typecode
* cdef public bint auto_add_chroms # <<<<<<<<<<<<<<
* cdef readonly str storage
* cdef readonly str memmap_dir
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->auto_add_chroms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.auto_add_chroms.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L1_error)
__pyx_v_self->auto_add_chroms = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.auto_add_chroms.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":492
* cdef readonly str typecode
* cdef public bint auto_add_chroms
* cdef readonly str storage # <<<<<<<<<<<<<<
* cdef readonly str memmap_dir
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7storage_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7storage_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_7storage___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_7storage___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->storage);
__pyx_r = __pyx_v_self->storage;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":493
* cdef public bint auto_add_chroms
* cdef readonly str storage
* cdef readonly str memmap_dir # <<<<<<<<<<<<<<
*
* def __init__(self, object chroms, bint stranded=True, str typecode='d',
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->memmap_dir);
__pyx_r = __pyx_v_self->memmap_dir;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":615
*
*
* def _GenomicArray_unpickle(stranded, typecode, chrom_vectors): # <<<<<<<<<<<<<<
* ga = GenomicArray({}, stranded, typecode)
* ga.chrom_vectors = chrom_vectors
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_5_GenomicArray_unpickle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_5_GenomicArray_unpickle = {"_GenomicArray_unpickle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_5_GenomicArray_unpickle, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_5_GenomicArray_unpickle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_stranded = 0;
PyObject *__pyx_v_typecode = 0;
PyObject *__pyx_v_chrom_vectors = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_GenomicArray_unpickle (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stranded,&__pyx_n_s_typecode,&__pyx_n_s_chrom_vectors,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stranded)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typecode)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_GenomicArray_unpickle", 1, 3, 3, 1); __PYX_ERR(0, 615, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom_vectors)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_GenomicArray_unpickle", 1, 3, 3, 2); __PYX_ERR(0, 615, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_GenomicArray_unpickle") < 0)) __PYX_ERR(0, 615, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_stranded = values[0];
__pyx_v_typecode = values[1];
__pyx_v_chrom_vectors = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_GenomicArray_unpickle", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 615, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq._GenomicArray_unpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_4_GenomicArray_unpickle(__pyx_self, __pyx_v_stranded, __pyx_v_typecode, __pyx_v_chrom_vectors);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_4_GenomicArray_unpickle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stranded, PyObject *__pyx_v_typecode, PyObject *__pyx_v_chrom_vectors) {
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_ga = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("_GenomicArray_unpickle", 0);
/* "HTSeq/_HTSeq.pyx":616
*
* def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):
* ga = GenomicArray({}, stranded, typecode) # <<<<<<<<<<<<<<
* ga.chrom_vectors = chrom_vectors
* return ga
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_INCREF(__pyx_v_stranded);
__Pyx_GIVEREF(__pyx_v_stranded);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_stranded);
__Pyx_INCREF(__pyx_v_typecode);
__Pyx_GIVEREF(__pyx_v_typecode);
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_typecode);
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_ga = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":617
* def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):
* ga = GenomicArray({}, stranded, typecode)
* ga.chrom_vectors = chrom_vectors # <<<<<<<<<<<<<<
* return ga
*
*/
if (!(likely(PyDict_CheckExact(__pyx_v_chrom_vectors))||((__pyx_v_chrom_vectors) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_chrom_vectors)->tp_name), 0))) __PYX_ERR(0, 617, __pyx_L1_error)
__pyx_t_1 = __pyx_v_chrom_vectors;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_ga->chrom_vectors);
__Pyx_DECREF(__pyx_v_ga->chrom_vectors);
__pyx_v_ga->chrom_vectors = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":618
* ga = GenomicArray({}, stranded, typecode)
* ga.chrom_vectors = chrom_vectors
* return ga # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ga));
__pyx_r = ((PyObject *)__pyx_v_ga);
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":615
*
*
* def _GenomicArray_unpickle(stranded, typecode, chrom_vectors): # <<<<<<<<<<<<<<
* ga = GenomicArray({}, stranded, typecode)
* ga.chrom_vectors = chrom_vectors
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("HTSeq._HTSeq._GenomicArray_unpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ga);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":626
*
*
* def _make_translation_table_for_complementation(): # <<<<<<<<<<<<<<
* return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation = {"_make_translation_table_for_complementation", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation, METH_NOARGS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_make_translation_table_for_complementation (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_6_make_translation_table_for_complementation(__pyx_self);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_6_make_translation_table_for_complementation(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("_make_translation_table_for_complementation", 0);
/* "HTSeq/_HTSeq.pyx":627
*
* def _make_translation_table_for_complementation():
* return bytes.maketrans(b'ACGTacgt', b'TGCAtgca') # <<<<<<<<<<<<<<
*
* cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation()
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyBytes_Type)), __pyx_n_s_maketrans); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":626
*
*
* def _make_translation_table_for_complementation(): # <<<<<<<<<<<<<<
* return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("HTSeq._HTSeq._make_translation_table_for_complementation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":631
* cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation()
*
* cpdef bytes reverse_complement(bytes seq): # <<<<<<<<<<<<<<
* """Returns the reverse complement of DNA sequence 'seq'. Does not yet
* work with extended IUPAC nucleotide letters or RNA."""
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9reverse_complement(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_reverse_complement(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("reverse_complement", 0);
/* "HTSeq/_HTSeq.pyx":635
* work with extended IUPAC nucleotide letters or RNA."""
*
* return seq[::-1].translate(_translation_table_for_complementation) # <<<<<<<<<<<<<<
*
* base_to_column = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'N': 4}
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_seq, __pyx_slice__24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_translate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 635, __pyx_L1_error)
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":631
* cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation()
*
* cpdef bytes reverse_complement(bytes seq): # <<<<<<<<<<<<<<
* """Returns the reverse complement of DNA sequence 'seq'. Does not yet
* work with extended IUPAC nucleotide letters or RNA."""
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9reverse_complement(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_8reverse_complement[] = "Returns the reverse complement of DNA sequence 'seq'. Does not yet\n work with extended IUPAC nucleotide letters or RNA.";
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9reverse_complement(PyObject *__pyx_self, PyObject *__pyx_v_seq) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reverse_complement (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seq), (&PyBytes_Type), 1, "seq", 1))) __PYX_ERR(0, 631, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8reverse_complement(__pyx_self, ((PyObject*)__pyx_v_seq));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8reverse_complement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("reverse_complement", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":643
* """
*
* def __init__(self, bytes seq, str name="unnamed"): # <<<<<<<<<<<<<<
* self.seq = seq
* self.name = name
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_seq = 0;
PyObject *__pyx_v_name = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,&__pyx_n_s_name_2,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject*)__pyx_n_u_unnamed);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 643, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_seq = ((PyObject*)values[0]);
__pyx_v_name = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 643, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seq), (&PyBytes_Type), 1, "seq", 1))) __PYX_ERR(0, 643, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 643, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_seq, __pyx_v_name);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence___init__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_name) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
/* "HTSeq/_HTSeq.pyx":644
*
* def __init__(self, bytes seq, str name="unnamed"):
* self.seq = seq # <<<<<<<<<<<<<<
* self.name = name
* self.descr = None
*/
__Pyx_INCREF(__pyx_v_seq);
__Pyx_GIVEREF(__pyx_v_seq);
__Pyx_GOTREF(__pyx_v_self->seq);
__Pyx_DECREF(__pyx_v_self->seq);
__pyx_v_self->seq = __pyx_v_seq;
/* "HTSeq/_HTSeq.pyx":645
* def __init__(self, bytes seq, str name="unnamed"):
* self.seq = seq
* self.name = name # <<<<<<<<<<<<<<
* self.descr = None
*
*/
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
__Pyx_GOTREF(__pyx_v_self->name);
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
/* "HTSeq/_HTSeq.pyx":646
* self.seq = seq
* self.name = name
* self.descr = None # <<<<<<<<<<<<<<
*
* cpdef Sequence get_reverse_complement(self, bint rename=True):
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->descr);
__Pyx_DECREF(__pyx_v_self->descr);
__pyx_v_self->descr = ((PyObject*)Py_None);
/* "HTSeq/_HTSeq.pyx":643
* """
*
* def __init__(self, bytes seq, str name="unnamed"): # <<<<<<<<<<<<<<
* self.seq = seq
* self.name = name
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":648
* self.descr = None
*
* cpdef Sequence get_reverse_complement(self, bint rename=True): # <<<<<<<<<<<<<<
* if rename:
* return Sequence(
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement *__pyx_optional_args) {
int __pyx_v_rename = ((int)1);
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_RefNannySetupContext("get_reverse_complement", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_rename = __pyx_optional_args->rename;
}
}
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_reverse_complement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_rename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 648, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":649
*
* cpdef Sequence get_reverse_complement(self, bint rename=True):
* if rename: # <<<<<<<<<<<<<<
* return Sequence(
* reverse_complement(self.seq),
*/
__pyx_t_6 = (__pyx_v_rename != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":650
* cpdef Sequence get_reverse_complement(self, bint rename=True):
* if rename:
* return Sequence( # <<<<<<<<<<<<<<
* reverse_complement(self.seq),
* "revcomp_of_" + self.name)
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
/* "HTSeq/_HTSeq.pyx":651
* if rename:
* return Sequence(
* reverse_complement(self.seq), # <<<<<<<<<<<<<<
* "revcomp_of_" + self.name)
* else:
*/
__pyx_t_1 = __pyx_v_self->seq;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":652
* return Sequence(
* reverse_complement(self.seq),
* "revcomp_of_" + self.name) # <<<<<<<<<<<<<<
* else:
* return Sequence(
*/
__pyx_t_1 = __Pyx_PyUnicode_ConcatSafe(__pyx_n_u_revcomp_of, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "HTSeq/_HTSeq.pyx":650
* cpdef Sequence get_reverse_complement(self, bint rename=True):
* if rename:
* return Sequence( # <<<<<<<<<<<<<<
* reverse_complement(self.seq),
* "revcomp_of_" + self.name)
*/
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_Sequence), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":649
*
* cpdef Sequence get_reverse_complement(self, bint rename=True):
* if rename: # <<<<<<<<<<<<<<
* return Sequence(
* reverse_complement(self.seq),
*/
}
/* "HTSeq/_HTSeq.pyx":654
* "revcomp_of_" + self.name)
* else:
* return Sequence( # <<<<<<<<<<<<<<
* reverse_complement(self.seq),
* self.name)
*/
/*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
/* "HTSeq/_HTSeq.pyx":655
* else:
* return Sequence(
* reverse_complement(self.seq), # <<<<<<<<<<<<<<
* self.name)
*
*/
__pyx_t_1 = __pyx_v_self->seq;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":654
* "revcomp_of_" + self.name)
* else:
* return Sequence( # <<<<<<<<<<<<<<
* reverse_complement(self.seq),
* self.name)
*/
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_INCREF(__pyx_v_self->name);
__Pyx_GIVEREF(__pyx_v_self->name);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->name);
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_Sequence), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
}
/* "HTSeq/_HTSeq.pyx":648
* self.descr = None
*
* cpdef Sequence get_reverse_complement(self, bint rename=True): # <<<<<<<<<<<<<<
* if rename:
* return Sequence(
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_rename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_reverse_complement (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rename,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rename);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_reverse_complement") < 0)) __PYX_ERR(0, 648, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
if (values[0]) {
__pyx_v_rename = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_rename == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L3_error)
} else {
__pyx_v_rename = ((int)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("get_reverse_complement", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_2get_reverse_complement(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_rename);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_2get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, int __pyx_v_rename) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement __pyx_t_2;
__Pyx_RefNannySetupContext("get_reverse_complement", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.rename = __pyx_v_rename;
__pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence->get_reverse_complement(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":658
* self.name)
*
* def __str__(self): # <<<<<<<<<<<<<<
* return self.seq.decode()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4__str__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_4__str__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
/* "HTSeq/_HTSeq.pyx":659
*
* def __str__(self):
* return self.seq.decode() # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_self->seq == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
__PYX_ERR(0, 659, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_decode_bytes(__pyx_v_self->seq, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":658
* self.name)
*
* def __str__(self): # <<<<<<<<<<<<<<
* return self.seq.decode()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":661
* return self.seq.decode()
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "<%s object '%s' (length %d)>" % (
* self.__class__.__name__, self.name, len(self.seq))
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_7__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_6__repr__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_6__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
Py_ssize_t __pyx_t_6;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "HTSeq/_HTSeq.pyx":662
*
* def __repr__(self):
* return "<%s object '%s' (length %d)>" % ( # <<<<<<<<<<<<<<
* self.__class__.__name__, self.name, len(self.seq))
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__Pyx_INCREF(__pyx_kp_u__2);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
/* "HTSeq/_HTSeq.pyx":663
* def __repr__(self):
* return "<%s object '%s' (length %d)>" % (
* self.__class__.__name__, self.name, len(self.seq)) # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u_object);
__pyx_t_2 += 9;
__Pyx_GIVEREF(__pyx_kp_u_object);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object);
__pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u_length_2);
__pyx_t_2 += 10;
__Pyx_GIVEREF(__pyx_kp_u_length_2);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_length_2);
__pyx_t_4 = __pyx_v_self->seq;
__Pyx_INCREF(__pyx_t_4);
if (unlikely(__pyx_t_4 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 663, __pyx_L1_error)
}
__pyx_t_6 = PyBytes_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_6, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__25);
__pyx_t_2 += 2;
__Pyx_GIVEREF(__pyx_kp_u__25);
PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__25);
/* "HTSeq/_HTSeq.pyx":662
*
* def __repr__(self):
* return "<%s object '%s' (length %d)>" % ( # <<<<<<<<<<<<<<
* self.__class__.__name__, self.name, len(self.seq))
*
*/
__pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":661
* return self.seq.decode()
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "<%s object '%s' (length %d)>" % (
* self.__class__.__name__, self.name, len(self.seq))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":665
* self.__class__.__name__, self.name, len(self.seq))
*
* def __len__(self): # <<<<<<<<<<<<<<
* return len(self.seq)
*
*/
/* Python wrapper */
static Py_ssize_t __pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_8__len__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static Py_ssize_t __pyx_pf_5HTSeq_6_HTSeq_8Sequence_8__len__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
__Pyx_RefNannySetupContext("__len__", 0);
/* "HTSeq/_HTSeq.pyx":666
*
* def __len__(self):
* return len(self.seq) # <<<<<<<<<<<<<<
*
* def __getitem__(self, item):
*/
__pyx_t_1 = __pyx_v_self->seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 666, __pyx_L1_error)
}
__pyx_t_2 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 666, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":665
* self.__class__.__name__, self.name, len(self.seq))
*
* def __len__(self): # <<<<<<<<<<<<<<
* return len(self.seq)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":668
* return len(self.seq)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
* if self.name.endswith("[part]"):
* new_name = self.name
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_10__getitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyObject *)__pyx_v_item));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_10__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_item) {
PyObject *__pyx_v_new_name = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__getitem__", 0);
/* "HTSeq/_HTSeq.pyx":669
*
* def __getitem__(self, item):
* if self.name.endswith("[part]"): # <<<<<<<<<<<<<<
* new_name = self.name
* else:
*/
if (unlikely(__pyx_v_self->name == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "endswith");
__PYX_ERR(0, 669, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_self->name, __pyx_kp_u_part, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 669, __pyx_L1_error)
if ((__pyx_t_1 != 0)) {
/* "HTSeq/_HTSeq.pyx":670
* def __getitem__(self, item):
* if self.name.endswith("[part]"):
* new_name = self.name # <<<<<<<<<<<<<<
* else:
* new_name = self.name + "[part]"
*/
__pyx_t_2 = __pyx_v_self->name;
__Pyx_INCREF(__pyx_t_2);
__pyx_v_new_name = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":669
*
* def __getitem__(self, item):
* if self.name.endswith("[part]"): # <<<<<<<<<<<<<<
* new_name = self.name
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":672
* new_name = self.name
* else:
* new_name = self.name + "[part]" # <<<<<<<<<<<<<<
* return Sequence(self.seq[item], new_name)
*
*/
/*else*/ {
__pyx_t_2 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_self->name, __pyx_kp_u_part); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_new_name = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":673
* else:
* new_name = self.name + "[part]"
* return Sequence(self.seq[item], new_name) # <<<<<<<<<<<<<<
*
* def __getstate__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self->seq, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_INCREF(__pyx_v_new_name);
__Pyx_GIVEREF(__pyx_v_new_name);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_new_name);
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_Sequence), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":668
* return len(self.seq)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
* if self.name.endswith("[part]"):
* new_name = self.name
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_new_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":675
* return Sequence(self.seq[item], new_name)
*
* def __getstate__(self): # <<<<<<<<<<<<<<
* return {'seq': self.seq,
* 'name': self.name,
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_13__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_13__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_12__getstate__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_12__getstate__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__getstate__", 0);
/* "HTSeq/_HTSeq.pyx":676
*
* def __getstate__(self):
* return {'seq': self.seq, # <<<<<<<<<<<<<<
* 'name': self.name,
* 'descr': self.descr}
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seq, __pyx_v_self->seq) < 0) __PYX_ERR(0, 676, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":677
* def __getstate__(self):
* return {'seq': self.seq,
* 'name': self.name, # <<<<<<<<<<<<<<
* 'descr': self.descr}
*
*/
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_name_2, __pyx_v_self->name) < 0) __PYX_ERR(0, 676, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":678
* return {'seq': self.seq,
* 'name': self.name,
* 'descr': self.descr} # <<<<<<<<<<<<<<
*
* def __setstate__(self, state):
*/
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_descr, __pyx_v_self->descr) < 0) __PYX_ERR(0, 676, __pyx_L1_error)
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":675
* return Sequence(self.seq[item], new_name)
*
* def __getstate__(self): # <<<<<<<<<<<<<<
* return {'seq': self.seq,
* 'name': self.name,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":680
* 'descr': self.descr}
*
* def __setstate__(self, state): # <<<<<<<<<<<<<<
* self.seq = state['seq']
* self.name = state['name']
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_15__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_15__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_14__setstate__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyObject *)__pyx_v_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_14__setstate__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__setstate__", 0);
/* "HTSeq/_HTSeq.pyx":681
*
* def __setstate__(self, state):
* self.seq = state['seq'] # <<<<<<<<<<<<<<
* self.name = state['name']
* self.descr = state['descr']
*/
__pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_state, __pyx_n_u_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 681, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->seq);
__Pyx_DECREF(__pyx_v_self->seq);
__pyx_v_self->seq = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":682
* def __setstate__(self, state):
* self.seq = state['seq']
* self.name = state['name'] # <<<<<<<<<<<<<<
* self.descr = state['descr']
*
*/
__pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_state, __pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 682, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->name);
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":683
* self.seq = state['seq']
* self.name = state['name']
* self.descr = state['descr'] # <<<<<<<<<<<<<<
*
* def __reduce__(self):
*/
__pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_state, __pyx_n_u_descr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 683, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->descr);
__Pyx_DECREF(__pyx_v_self->descr);
__pyx_v_self->descr = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":680
* 'descr': self.descr}
*
* def __setstate__(self, state): # <<<<<<<<<<<<<<
* self.seq = state['seq']
* self.name = state['name']
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":685
* self.descr = state['descr']
*
* def __reduce__(self): # <<<<<<<<<<<<<<
* return (self.__class__, (self.seq, self.name), self.__getstate__())
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_17__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_17__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_16__reduce__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_16__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__reduce__", 0);
/* "HTSeq/_HTSeq.pyx":686
*
* def __reduce__(self):
* return (self.__class__, (self.seq, self.name), self.__getstate__()) # <<<<<<<<<<<<<<
*
* def write_to_fasta_file(self, fasta_file, characters_per_line=70):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_self->seq);
__Pyx_GIVEREF(__pyx_v_self->seq);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->seq);
__Pyx_INCREF(__pyx_v_self->name);
__Pyx_GIVEREF(__pyx_v_self->name);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->name);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":685
* self.descr = state['descr']
*
* def __reduce__(self): # <<<<<<<<<<<<<<
* return (self.__class__, (self.seq, self.name), self.__getstate__())
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":688
* return (self.__class__, (self.seq, self.name), self.__getstate__())
*
* def write_to_fasta_file(self, fasta_file, characters_per_line=70): # <<<<<<<<<<<<<<
* """Write sequence to file in FASTA format.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file[] = "Write sequence to file in FASTA format.\n\n Arguments:\n - fasta_file (file handle): destination file\n - characters_per_line (int >=0): if 0, write the whole sequence on a single line. Otherwise, break into several lines if the sequence is long enough.\n\n ";
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_fasta_file = 0;
PyObject *__pyx_v_characters_per_line = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_to_fasta_file (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fasta_file,&__pyx_n_s_characters_per_line,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)__pyx_int_70);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fasta_file)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characters_per_line);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_to_fasta_file") < 0)) __PYX_ERR(0, 688, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_fasta_file = values[0];
__pyx_v_characters_per_line = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("write_to_fasta_file", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 688, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.write_to_fasta_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_fasta_file, __pyx_v_characters_per_line);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_fasta_file, PyObject *__pyx_v_characters_per_line) {
PyObject *__pyx_v_i = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
Py_ssize_t __pyx_t_6;
Py_UCS4 __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
Py_ssize_t __pyx_t_9;
Py_ssize_t __pyx_t_10;
__Pyx_RefNannySetupContext("write_to_fasta_file", 0);
/* "HTSeq/_HTSeq.pyx":696
*
* """
* if self.descr is not None: # <<<<<<<<<<<<<<
* fasta_file.write(">%s %s\n" % (self.name, self.descr))
* else:
*/
__pyx_t_1 = (__pyx_v_self->descr != ((PyObject*)Py_None));
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":697
* """
* if self.descr is not None:
* fasta_file.write(">%s %s\n" % (self.name, self.descr)) # <<<<<<<<<<<<<<
* else:
* fasta_file.write(">%s\n" % self.name)
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fasta_file, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = 0;
__pyx_t_7 = 127;
__Pyx_INCREF(__pyx_kp_u__17);
__pyx_t_6 += 1;
__Pyx_GIVEREF(__pyx_kp_u__17);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u__17);
__pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_self->name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
__pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_INCREF(__pyx_kp_u__26);
__pyx_t_6 += 1;
__Pyx_GIVEREF(__pyx_kp_u__26);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__26);
__pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_self->descr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
__pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_INCREF(__pyx_kp_u__22);
__pyx_t_6 += 1;
__Pyx_GIVEREF(__pyx_kp_u__22);
PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__22);
__pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":696
*
* """
* if self.descr is not None: # <<<<<<<<<<<<<<
* fasta_file.write(">%s %s\n" % (self.name, self.descr))
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":699
* fasta_file.write(">%s %s\n" % (self.name, self.descr))
* else:
* fasta_file.write(">%s\n" % self.name) # <<<<<<<<<<<<<<
*
* if characters_per_line == 0:
*/
/*else*/ {
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fasta_file, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = PyUnicode_Format(__pyx_kp_u_s, __pyx_v_self->name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":701
* fasta_file.write(">%s\n" % self.name)
*
* if characters_per_line == 0: # <<<<<<<<<<<<<<
* fasta_file.write(self.seq.decode() + "\n")
* else:
*/
__pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_characters_per_line, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 701, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":702
*
* if characters_per_line == 0:
* fasta_file.write(self.seq.decode() + "\n") # <<<<<<<<<<<<<<
* else:
* i = 0
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fasta_file, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (unlikely(__pyx_v_self->seq == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
__PYX_ERR(0, 702, __pyx_L1_error)
}
__pyx_t_8 = __Pyx_decode_bytes(__pyx_v_self->seq, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 702, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u__22); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":701
* fasta_file.write(">%s\n" % self.name)
*
* if characters_per_line == 0: # <<<<<<<<<<<<<<
* fasta_file.write(self.seq.decode() + "\n")
* else:
*/
goto __pyx_L4;
}
/* "HTSeq/_HTSeq.pyx":704
* fasta_file.write(self.seq.decode() + "\n")
* else:
* i = 0 # <<<<<<<<<<<<<<
* while i * characters_per_line < len(self.seq):
* fasta_file.write(
*/
/*else*/ {
__Pyx_INCREF(__pyx_int_0);
__pyx_v_i = __pyx_int_0;
/* "HTSeq/_HTSeq.pyx":705
* else:
* i = 0
* while i * characters_per_line < len(self.seq): # <<<<<<<<<<<<<<
* fasta_file.write(
* self.seq[i * characters_per_line: (i + 1) * characters_per_line].decode() + "\n")
*/
while (1) {
__pyx_t_3 = PyNumber_Multiply(__pyx_v_i, __pyx_v_characters_per_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __pyx_v_self->seq;
__Pyx_INCREF(__pyx_t_4);
if (unlikely(__pyx_t_4 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 705, __pyx_L1_error)
}
__pyx_t_6 = PyBytes_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 705, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 705, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!__pyx_t_2) break;
/* "HTSeq/_HTSeq.pyx":706
* i = 0
* while i * characters_per_line < len(self.seq):
* fasta_file.write( # <<<<<<<<<<<<<<
* self.seq[i * characters_per_line: (i + 1) * characters_per_line].decode() + "\n")
* i += 1
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fasta_file, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 706, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "HTSeq/_HTSeq.pyx":707
* while i * characters_per_line < len(self.seq):
* fasta_file.write(
* self.seq[i * characters_per_line: (i + 1) * characters_per_line].decode() + "\n") # <<<<<<<<<<<<<<
* i += 1
*
*/
if (unlikely(__pyx_v_self->seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 707, __pyx_L1_error)
}
__pyx_t_3 = PyNumber_Multiply(__pyx_v_i, __pyx_v_characters_per_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = (__pyx_t_3 == Py_None);
if (__pyx_t_2) {
__pyx_t_6 = 0;
} else {
__pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error)
__pyx_t_6 = __pyx_t_9;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = PyNumber_Multiply(__pyx_t_3, __pyx_v_characters_per_line); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_2 = (__pyx_t_8 == Py_None);
if (__pyx_t_2) {
__pyx_t_9 = PY_SSIZE_T_MAX;
} else {
__pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error)
__pyx_t_9 = __pyx_t_10;
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = __Pyx_decode_bytes(__pyx_v_self->seq, __pyx_t_6, __pyx_t_9, NULL, NULL, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u__22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":708
* fasta_file.write(
* self.seq[i * characters_per_line: (i + 1) * characters_per_line].decode() + "\n")
* i += 1 # <<<<<<<<<<<<<<
*
* cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_):
*/
__pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_i, __pyx_t_5);
__pyx_t_5 = 0;
}
}
__pyx_L4:;
/* "HTSeq/_HTSeq.pyx":688
* return (self.__class__, (self.seq, self.name), self.__getstate__())
*
* def write_to_fasta_file(self, fasta_file, characters_per_line=70): # <<<<<<<<<<<<<<
* """Write sequence to file in FASTA format.
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.write_to_fasta_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_i);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":710
* i += 1
*
* cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_): # <<<<<<<<<<<<<<
*
* cdef numpy.ndarray[numpy.int_t, ndim = 2] count_array = count_array_
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array(PyObject *__pyx_v_self, PyObject *__pyx_v_count_array_); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_8Sequence_add_bases_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyArrayObject *__pyx_v_count_array_, int __pyx_skip_dispatch) {
PyArrayObject *__pyx_v_count_array = 0;
int __pyx_v_seq_length;
npy_intp __pyx_v_i;
char __pyx_v_b;
char *__pyx_v_seq_cstr;
__Pyx_LocalBuf_ND __pyx_pybuffernd_count_array;
__Pyx_Buffer __pyx_pybuffer_count_array;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
Py_ssize_t __pyx_t_5;
int __pyx_t_6;
char *__pyx_t_7;
int __pyx_t_8;
int __pyx_t_9;
npy_intp __pyx_t_10;
Py_ssize_t __pyx_t_11;
Py_ssize_t __pyx_t_12;
int __pyx_t_13;
Py_ssize_t __pyx_t_14;
Py_ssize_t __pyx_t_15;
Py_ssize_t __pyx_t_16;
Py_ssize_t __pyx_t_17;
Py_ssize_t __pyx_t_18;
Py_ssize_t __pyx_t_19;
Py_ssize_t __pyx_t_20;
Py_ssize_t __pyx_t_21;
__Pyx_RefNannySetupContext("add_bases_to_count_array", 0);
__pyx_pybuffer_count_array.pybuffer.buf = NULL;
__pyx_pybuffer_count_array.refcount = 0;
__pyx_pybuffernd_count_array.data = NULL;
__pyx_pybuffernd_count_array.rcbuffer = &__pyx_pybuffer_count_array;
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_bases_to_count_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_count_array_)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_count_array_));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":712
* cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_):
*
* cdef numpy.ndarray[numpy.int_t, ndim = 2] count_array = count_array_ # <<<<<<<<<<<<<<
* cdef int seq_length = len(self.seq)
*
*/
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_count_array_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
__pyx_v_count_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf = NULL;
__PYX_ERR(0, 712, __pyx_L1_error)
} else {__pyx_pybuffernd_count_array.diminfo[0].strides = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_count_array.diminfo[0].shape = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_count_array.diminfo[1].strides = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_count_array.diminfo[1].shape = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.shape[1];
}
}
__Pyx_INCREF(((PyObject *)__pyx_v_count_array_));
__pyx_v_count_array = ((PyArrayObject *)__pyx_v_count_array_);
/* "HTSeq/_HTSeq.pyx":713
*
* cdef numpy.ndarray[numpy.int_t, ndim = 2] count_array = count_array_
* cdef int seq_length = len(self.seq) # <<<<<<<<<<<<<<
*
* if numpy.PyArray_DIMS(count_array)[0] < seq_length:
*/
__pyx_t_1 = __pyx_v_self->seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 713, __pyx_L1_error)
}
__pyx_t_5 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 713, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_seq_length = __pyx_t_5;
/* "HTSeq/_HTSeq.pyx":715
* cdef int seq_length = len(self.seq)
*
* if numpy.PyArray_DIMS(count_array)[0] < seq_length: # <<<<<<<<<<<<<<
* raise ValueError, "'count_array' too small for sequence."
* if numpy.PyArray_DIMS(count_array)[1] < 5:
*/
__pyx_t_6 = (((PyArray_DIMS(((PyArrayObject *)__pyx_v_count_array))[0]) < __pyx_v_seq_length) != 0);
if (unlikely(__pyx_t_6)) {
/* "HTSeq/_HTSeq.pyx":716
*
* if numpy.PyArray_DIMS(count_array)[0] < seq_length:
* raise ValueError, "'count_array' too small for sequence." # <<<<<<<<<<<<<<
* if numpy.PyArray_DIMS(count_array)[1] < 5:
* raise ValueError, "'count_array' has too few columns."
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_count_array_too_small_for_seque, 0, 0);
__PYX_ERR(0, 716, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":715
* cdef int seq_length = len(self.seq)
*
* if numpy.PyArray_DIMS(count_array)[0] < seq_length: # <<<<<<<<<<<<<<
* raise ValueError, "'count_array' too small for sequence."
* if numpy.PyArray_DIMS(count_array)[1] < 5:
*/
}
/* "HTSeq/_HTSeq.pyx":717
* if numpy.PyArray_DIMS(count_array)[0] < seq_length:
* raise ValueError, "'count_array' too small for sequence."
* if numpy.PyArray_DIMS(count_array)[1] < 5: # <<<<<<<<<<<<<<
* raise ValueError, "'count_array' has too few columns."
*
*/
__pyx_t_6 = (((PyArray_DIMS(((PyArrayObject *)__pyx_v_count_array))[1]) < 5) != 0);
if (unlikely(__pyx_t_6)) {
/* "HTSeq/_HTSeq.pyx":718
* raise ValueError, "'count_array' too small for sequence."
* if numpy.PyArray_DIMS(count_array)[1] < 5:
* raise ValueError, "'count_array' has too few columns." # <<<<<<<<<<<<<<
*
* cdef numpy.npy_intp i
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_count_array_has_too_few_columns, 0, 0);
__PYX_ERR(0, 718, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":717
* if numpy.PyArray_DIMS(count_array)[0] < seq_length:
* raise ValueError, "'count_array' too small for sequence."
* if numpy.PyArray_DIMS(count_array)[1] < 5: # <<<<<<<<<<<<<<
* raise ValueError, "'count_array' has too few columns."
*
*/
}
/* "HTSeq/_HTSeq.pyx":722
* cdef numpy.npy_intp i
* cdef char b
* cdef char * seq_cstr = self.seq # <<<<<<<<<<<<<<
* for i in range(seq_length):
* b = seq_cstr[i]
*/
if (unlikely(__pyx_v_self->seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 722, __pyx_L1_error)
}
__pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->seq); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 722, __pyx_L1_error)
__pyx_v_seq_cstr = __pyx_t_7;
/* "HTSeq/_HTSeq.pyx":723
* cdef char b
* cdef char * seq_cstr = self.seq
* for i in range(seq_length): # <<<<<<<<<<<<<<
* b = seq_cstr[i]
* if b in [b'A', b'a']:
*/
__pyx_t_8 = __pyx_v_seq_length;
__pyx_t_9 = __pyx_t_8;
for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
__pyx_v_i = __pyx_t_10;
/* "HTSeq/_HTSeq.pyx":724
* cdef char * seq_cstr = self.seq
* for i in range(seq_length):
* b = seq_cstr[i] # <<<<<<<<<<<<<<
* if b in [b'A', b'a']:
* count_array[i, 0] += 1
*/
__pyx_v_b = (__pyx_v_seq_cstr[__pyx_v_i]);
/* "HTSeq/_HTSeq.pyx":725
* for i in range(seq_length):
* b = seq_cstr[i]
* if b in [b'A', b'a']: # <<<<<<<<<<<<<<
* count_array[i, 0] += 1
* elif b in [b'C', b'c']:
*/
switch (__pyx_v_b) {
case 'A':
case 'a':
/* "HTSeq/_HTSeq.pyx":726
* b = seq_cstr[i]
* if b in [b'A', b'a']:
* count_array[i, 0] += 1 # <<<<<<<<<<<<<<
* elif b in [b'C', b'c']:
* count_array[i, 1] += 1
*/
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = 0;
__pyx_t_13 = -1;
if (__pyx_t_11 < 0) {
__pyx_t_11 += __pyx_pybuffernd_count_array.diminfo[0].shape;
if (unlikely(__pyx_t_11 < 0)) __pyx_t_13 = 0;
} else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_13 = 0;
if (__pyx_t_12 < 0) {
__pyx_t_12 += __pyx_pybuffernd_count_array.diminfo[1].shape;
if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 1;
} else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_13 = 1;
if (unlikely(__pyx_t_13 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_13);
__PYX_ERR(0, 726, __pyx_L1_error)
}
*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;
/* "HTSeq/_HTSeq.pyx":725
* for i in range(seq_length):
* b = seq_cstr[i]
* if b in [b'A', b'a']: # <<<<<<<<<<<<<<
* count_array[i, 0] += 1
* elif b in [b'C', b'c']:
*/
break;
case 'C':
/* "HTSeq/_HTSeq.pyx":727
* if b in [b'A', b'a']:
* count_array[i, 0] += 1
* elif b in [b'C', b'c']: # <<<<<<<<<<<<<<
* count_array[i, 1] += 1
* elif b in [b'G', b'g']:
*/
case 'c':
/* "HTSeq/_HTSeq.pyx":728
* count_array[i, 0] += 1
* elif b in [b'C', b'c']:
* count_array[i, 1] += 1 # <<<<<<<<<<<<<<
* elif b in [b'G', b'g']:
* count_array[i, 2] += 1
*/
__pyx_t_14 = __pyx_v_i;
__pyx_t_15 = 1;
__pyx_t_13 = -1;
if (__pyx_t_14 < 0) {
__pyx_t_14 += __pyx_pybuffernd_count_array.diminfo[0].shape;
if (unlikely(__pyx_t_14 < 0)) __pyx_t_13 = 0;
} else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_13 = 0;
if (__pyx_t_15 < 0) {
__pyx_t_15 += __pyx_pybuffernd_count_array.diminfo[1].shape;
if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 1;
} else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_13 = 1;
if (unlikely(__pyx_t_13 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_13);
__PYX_ERR(0, 728, __pyx_L1_error)
}
*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;
/* "HTSeq/_HTSeq.pyx":727
* if b in [b'A', b'a']:
* count_array[i, 0] += 1
* elif b in [b'C', b'c']: # <<<<<<<<<<<<<<
* count_array[i, 1] += 1
* elif b in [b'G', b'g']:
*/
break;
case 'G':
/* "HTSeq/_HTSeq.pyx":729
* elif b in [b'C', b'c']:
* count_array[i, 1] += 1
* elif b in [b'G', b'g']: # <<<<<<<<<<<<<<
* count_array[i, 2] += 1
* elif b in [b'T', b't']:
*/
case 'g':
/* "HTSeq/_HTSeq.pyx":730
* count_array[i, 1] += 1
* elif b in [b'G', b'g']:
* count_array[i, 2] += 1 # <<<<<<<<<<<<<<
* elif b in [b'T', b't']:
* count_array[i, 3] += 1
*/
__pyx_t_16 = __pyx_v_i;
__pyx_t_17 = 2;
__pyx_t_13 = -1;
if (__pyx_t_16 < 0) {
__pyx_t_16 += __pyx_pybuffernd_count_array.diminfo[0].shape;
if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 0;
} else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_13 = 0;
if (__pyx_t_17 < 0) {
__pyx_t_17 += __pyx_pybuffernd_count_array.diminfo[1].shape;
if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 1;
} else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_13 = 1;
if (unlikely(__pyx_t_13 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_13);
__PYX_ERR(0, 730, __pyx_L1_error)
}
*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;
/* "HTSeq/_HTSeq.pyx":729
* elif b in [b'C', b'c']:
* count_array[i, 1] += 1
* elif b in [b'G', b'g']: # <<<<<<<<<<<<<<
* count_array[i, 2] += 1
* elif b in [b'T', b't']:
*/
break;
case 'T':
/* "HTSeq/_HTSeq.pyx":731
* elif b in [b'G', b'g']:
* count_array[i, 2] += 1
* elif b in [b'T', b't']: # <<<<<<<<<<<<<<
* count_array[i, 3] += 1
* elif b in [b'N', b'n', b'.']:
*/
case 't':
/* "HTSeq/_HTSeq.pyx":732
* count_array[i, 2] += 1
* elif b in [b'T', b't']:
* count_array[i, 3] += 1 # <<<<<<<<<<<<<<
* elif b in [b'N', b'n', b'.']:
* count_array[i, 4] += 1
*/
__pyx_t_18 = __pyx_v_i;
__pyx_t_19 = 3;
__pyx_t_13 = -1;
if (__pyx_t_18 < 0) {
__pyx_t_18 += __pyx_pybuffernd_count_array.diminfo[0].shape;
if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 0;
} else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_13 = 0;
if (__pyx_t_19 < 0) {
__pyx_t_19 += __pyx_pybuffernd_count_array.diminfo[1].shape;
if (unlikely(__pyx_t_19 < 0)) __pyx_t_13 = 1;
} else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_13 = 1;
if (unlikely(__pyx_t_13 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_13);
__PYX_ERR(0, 732, __pyx_L1_error)
}
*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;
/* "HTSeq/_HTSeq.pyx":731
* elif b in [b'G', b'g']:
* count_array[i, 2] += 1
* elif b in [b'T', b't']: # <<<<<<<<<<<<<<
* count_array[i, 3] += 1
* elif b in [b'N', b'n', b'.']:
*/
break;
case 'N':
/* "HTSeq/_HTSeq.pyx":733
* elif b in [b'T', b't']:
* count_array[i, 3] += 1
* elif b in [b'N', b'n', b'.']: # <<<<<<<<<<<<<<
* count_array[i, 4] += 1
* else:
*/
case 'n':
case '.':
/* "HTSeq/_HTSeq.pyx":734
* count_array[i, 3] += 1
* elif b in [b'N', b'n', b'.']:
* count_array[i, 4] += 1 # <<<<<<<<<<<<<<
* else:
* raise ValueError, "Illegal base letter encountered."
*/
__pyx_t_20 = __pyx_v_i;
__pyx_t_21 = 4;
__pyx_t_13 = -1;
if (__pyx_t_20 < 0) {
__pyx_t_20 += __pyx_pybuffernd_count_array.diminfo[0].shape;
if (unlikely(__pyx_t_20 < 0)) __pyx_t_13 = 0;
} else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_13 = 0;
if (__pyx_t_21 < 0) {
__pyx_t_21 += __pyx_pybuffernd_count_array.diminfo[1].shape;
if (unlikely(__pyx_t_21 < 0)) __pyx_t_13 = 1;
} else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_13 = 1;
if (unlikely(__pyx_t_13 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_13);
__PYX_ERR(0, 734, __pyx_L1_error)
}
*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;
/* "HTSeq/_HTSeq.pyx":733
* elif b in [b'T', b't']:
* count_array[i, 3] += 1
* elif b in [b'N', b'n', b'.']: # <<<<<<<<<<<<<<
* count_array[i, 4] += 1
* else:
*/
break;
default:
/* "HTSeq/_HTSeq.pyx":736
* count_array[i, 4] += 1
* else:
* raise ValueError, "Illegal base letter encountered." # <<<<<<<<<<<<<<
*
* return None
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Illegal_base_letter_encountered, 0, 0);
__PYX_ERR(0, 736, __pyx_L1_error)
break;
}
}
/* "HTSeq/_HTSeq.pyx":738
* raise ValueError, "Illegal base letter encountered."
*
* return None # <<<<<<<<<<<<<<
*
* cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":710
* i += 1
*
* cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_): # <<<<<<<<<<<<<<
*
* cdef numpy.ndarray[numpy.int_t, ndim = 2] count_array = count_array_
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.add_bases_to_count_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_count_array);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array(PyObject *__pyx_v_self, PyObject *__pyx_v_count_array_); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array(PyObject *__pyx_v_self, PyObject *__pyx_v_count_array_) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_bases_to_count_array (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count_array_), __pyx_ptype_5numpy_ndarray, 1, "count_array_", 0))) __PYX_ERR(0, 710, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_20add_bases_to_count_array(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyArrayObject *)__pyx_v_count_array_));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_20add_bases_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyArrayObject *__pyx_v_count_array_) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("add_bases_to_count_array", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_8Sequence_add_bases_to_count_array(__pyx_v_self, __pyx_v_count_array_, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.add_bases_to_count_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":740
* return None
*
* cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.): # <<<<<<<<<<<<<<
* cdef int seqlen = len(self.seq)
* cdef int patlen = len(pattern.seq)
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_left_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end *__pyx_optional_args) {
float __pyx_v_mismatch_prop = ((float)0.);
int __pyx_v_seqlen;
int __pyx_v_patlen;
int __pyx_v_minlen;
char *__pyx_v_seq_cstr;
char *__pyx_v_pat_cstr;
int __pyx_v_match;
int __pyx_v_i;
int __pyx_v_j;
int __pyx_v_num_mismatches;
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
Py_ssize_t __pyx_t_8;
int __pyx_t_9;
char *__pyx_t_10;
long __pyx_t_11;
long __pyx_t_12;
int __pyx_t_13;
int __pyx_t_14;
int __pyx_t_15;
__Pyx_RefNannySetupContext("trim_left_end", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_mismatch_prop = __pyx_optional_args->mismatch_prop;
}
}
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trim_left_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_3 = PyFloat_FromDouble(__pyx_v_mismatch_prop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
__pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_pattern));
__Pyx_GIVEREF(((PyObject *)__pyx_v_pattern));
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_pattern));
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 740, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":741
*
* cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
* cdef int seqlen = len(self.seq) # <<<<<<<<<<<<<<
* cdef int patlen = len(pattern.seq)
* cdef int minlen
*/
__pyx_t_1 = __pyx_v_self->seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 741, __pyx_L1_error)
}
__pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 741, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_seqlen = __pyx_t_8;
/* "HTSeq/_HTSeq.pyx":742
* cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
* cdef int seqlen = len(self.seq)
* cdef int patlen = len(pattern.seq) # <<<<<<<<<<<<<<
* cdef int minlen
* if seqlen < patlen:
*/
__pyx_t_1 = __pyx_v_pattern->seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 742, __pyx_L1_error)
}
__pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 742, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_patlen = __pyx_t_8;
/* "HTSeq/_HTSeq.pyx":744
* cdef int patlen = len(pattern.seq)
* cdef int minlen
* if seqlen < patlen: # <<<<<<<<<<<<<<
* minlen = seqlen
* else:
*/
__pyx_t_9 = ((__pyx_v_seqlen < __pyx_v_patlen) != 0);
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":745
* cdef int minlen
* if seqlen < patlen:
* minlen = seqlen # <<<<<<<<<<<<<<
* else:
* minlen = patlen
*/
__pyx_v_minlen = __pyx_v_seqlen;
/* "HTSeq/_HTSeq.pyx":744
* cdef int patlen = len(pattern.seq)
* cdef int minlen
* if seqlen < patlen: # <<<<<<<<<<<<<<
* minlen = seqlen
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":747
* minlen = seqlen
* else:
* minlen = patlen # <<<<<<<<<<<<<<
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq
*/
/*else*/ {
__pyx_v_minlen = __pyx_v_patlen;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":748
* else:
* minlen = patlen
* cdef char * seq_cstr = self.seq # <<<<<<<<<<<<<<
* cdef char * pat_cstr = pattern.seq
* cdef int match = 0
*/
if (unlikely(__pyx_v_self->seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 748, __pyx_L1_error)
}
__pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L1_error)
__pyx_v_seq_cstr = __pyx_t_10;
/* "HTSeq/_HTSeq.pyx":749
* minlen = patlen
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq # <<<<<<<<<<<<<<
* cdef int match = 0
* cdef int i, j
*/
if (unlikely(__pyx_v_pattern->seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 749, __pyx_L1_error)
}
__pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 749, __pyx_L1_error)
__pyx_v_pat_cstr = __pyx_t_10;
/* "HTSeq/_HTSeq.pyx":750
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq
* cdef int match = 0 # <<<<<<<<<<<<<<
* cdef int i, j
* cdef int num_mismatches
*/
__pyx_v_match = 0;
/* "HTSeq/_HTSeq.pyx":753
* cdef int i, j
* cdef int num_mismatches
* for i in range(1, minlen + 1): # <<<<<<<<<<<<<<
* num_mismatches = 0
* for j in range(i):
*/
__pyx_t_11 = (__pyx_v_minlen + 1);
__pyx_t_12 = __pyx_t_11;
for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_12; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
/* "HTSeq/_HTSeq.pyx":754
* cdef int num_mismatches
* for i in range(1, minlen + 1):
* num_mismatches = 0 # <<<<<<<<<<<<<<
* for j in range(i):
* if seq_cstr[j] != pat_cstr[patlen - i + j]:
*/
__pyx_v_num_mismatches = 0;
/* "HTSeq/_HTSeq.pyx":755
* for i in range(1, minlen + 1):
* num_mismatches = 0
* for j in range(i): # <<<<<<<<<<<<<<
* if seq_cstr[j] != pat_cstr[patlen - i + j]:
* num_mismatches += 1
*/
__pyx_t_13 = __pyx_v_i;
__pyx_t_14 = __pyx_t_13;
for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
__pyx_v_j = __pyx_t_15;
/* "HTSeq/_HTSeq.pyx":756
* num_mismatches = 0
* for j in range(i):
* if seq_cstr[j] != pat_cstr[patlen - i + j]: # <<<<<<<<<<<<<<
* num_mismatches += 1
* if num_mismatches > mismatch_prop * i:
*/
__pyx_t_9 = (((__pyx_v_seq_cstr[__pyx_v_j]) != (__pyx_v_pat_cstr[((__pyx_v_patlen - __pyx_v_i) + __pyx_v_j)])) != 0);
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":757
* for j in range(i):
* if seq_cstr[j] != pat_cstr[patlen - i + j]:
* num_mismatches += 1 # <<<<<<<<<<<<<<
* if num_mismatches > mismatch_prop * i:
* break
*/
__pyx_v_num_mismatches = (__pyx_v_num_mismatches + 1);
/* "HTSeq/_HTSeq.pyx":758
* if seq_cstr[j] != pat_cstr[patlen - i + j]:
* num_mismatches += 1
* if num_mismatches > mismatch_prop * i: # <<<<<<<<<<<<<<
* break
* else:
*/
__pyx_t_9 = ((__pyx_v_num_mismatches > (__pyx_v_mismatch_prop * __pyx_v_i)) != 0);
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":759
* num_mismatches += 1
* if num_mismatches > mismatch_prop * i:
* break # <<<<<<<<<<<<<<
* else:
* match = i
*/
goto __pyx_L7_break;
/* "HTSeq/_HTSeq.pyx":758
* if seq_cstr[j] != pat_cstr[patlen - i + j]:
* num_mismatches += 1
* if num_mismatches > mismatch_prop * i: # <<<<<<<<<<<<<<
* break
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":756
* num_mismatches = 0
* for j in range(i):
* if seq_cstr[j] != pat_cstr[patlen - i + j]: # <<<<<<<<<<<<<<
* num_mismatches += 1
* if num_mismatches > mismatch_prop * i:
*/
}
}
/*else*/ {
/* "HTSeq/_HTSeq.pyx":761
* break
* else:
* match = i # <<<<<<<<<<<<<<
* return self[match: seqlen]
*
*/
__pyx_v_match = __pyx_v_i;
}
__pyx_L7_break:;
}
/* "HTSeq/_HTSeq.pyx":762
* else:
* match = i
* return self[match: seqlen] # <<<<<<<<<<<<<<
*
* cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), __pyx_v_match, __pyx_v_seqlen, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 762, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":740
* return None
*
* cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.): # <<<<<<<<<<<<<<
* cdef int seqlen = len(self.seq)
* cdef int patlen = len(pattern.seq)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.trim_left_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
float __pyx_v_mismatch_prop;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("trim_left_end (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pattern,&__pyx_n_s_mismatch_prop,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pattern)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mismatch_prop);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trim_left_end") < 0)) __PYX_ERR(0, 740, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_pattern = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)values[0]);
if (values[1]) {
__pyx_v_mismatch_prop = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_mismatch_prop == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 740, __pyx_L3_error)
} else {
__pyx_v_mismatch_prop = ((float)0.);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("trim_left_end", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 740, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.trim_left_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pattern), __pyx_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 740, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_22trim_left_end(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_pattern, __pyx_v_mismatch_prop);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_22trim_left_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, float __pyx_v_mismatch_prop) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end __pyx_t_2;
__Pyx_RefNannySetupContext("trim_left_end", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.mismatch_prop = __pyx_v_mismatch_prop;
__pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence->trim_left_end(__pyx_v_self, __pyx_v_pattern, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.trim_left_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":764
* return self[match: seqlen]
*
* cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.): # <<<<<<<<<<<<<<
* cdef int seqlen = len(self.seq)
* cdef int patlen = len(pattern.seq)
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_right_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end *__pyx_optional_args) {
float __pyx_v_mismatch_prop = ((float)0.);
int __pyx_v_seqlen;
int __pyx_v_patlen;
int __pyx_v_minlen;
char *__pyx_v_seq_cstr;
char *__pyx_v_pat_cstr;
int __pyx_v_match;
int __pyx_v_i;
int __pyx_v_j;
int __pyx_v_num_mismatches;
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
Py_ssize_t __pyx_t_8;
int __pyx_t_9;
char *__pyx_t_10;
long __pyx_t_11;
long __pyx_t_12;
int __pyx_t_13;
int __pyx_t_14;
int __pyx_t_15;
__Pyx_RefNannySetupContext("trim_right_end", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_mismatch_prop = __pyx_optional_args->mismatch_prop;
}
}
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trim_right_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_3 = PyFloat_FromDouble(__pyx_v_mismatch_prop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
__pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_pattern));
__Pyx_GIVEREF(((PyObject *)__pyx_v_pattern));
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_pattern));
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 764, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":765
*
* cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
* cdef int seqlen = len(self.seq) # <<<<<<<<<<<<<<
* cdef int patlen = len(pattern.seq)
* cdef int minlen
*/
__pyx_t_1 = __pyx_v_self->seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 765, __pyx_L1_error)
}
__pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 765, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_seqlen = __pyx_t_8;
/* "HTSeq/_HTSeq.pyx":766
* cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
* cdef int seqlen = len(self.seq)
* cdef int patlen = len(pattern.seq) # <<<<<<<<<<<<<<
* cdef int minlen
* if seqlen < patlen:
*/
__pyx_t_1 = __pyx_v_pattern->seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 766, __pyx_L1_error)
}
__pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 766, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_patlen = __pyx_t_8;
/* "HTSeq/_HTSeq.pyx":768
* cdef int patlen = len(pattern.seq)
* cdef int minlen
* if seqlen < patlen: # <<<<<<<<<<<<<<
* minlen = seqlen
* else:
*/
__pyx_t_9 = ((__pyx_v_seqlen < __pyx_v_patlen) != 0);
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":769
* cdef int minlen
* if seqlen < patlen:
* minlen = seqlen # <<<<<<<<<<<<<<
* else:
* minlen = patlen
*/
__pyx_v_minlen = __pyx_v_seqlen;
/* "HTSeq/_HTSeq.pyx":768
* cdef int patlen = len(pattern.seq)
* cdef int minlen
* if seqlen < patlen: # <<<<<<<<<<<<<<
* minlen = seqlen
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":771
* minlen = seqlen
* else:
* minlen = patlen # <<<<<<<<<<<<<<
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq
*/
/*else*/ {
__pyx_v_minlen = __pyx_v_patlen;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":772
* else:
* minlen = patlen
* cdef char * seq_cstr = self.seq # <<<<<<<<<<<<<<
* cdef char * pat_cstr = pattern.seq
* cdef int match = 0
*/
if (unlikely(__pyx_v_self->seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 772, __pyx_L1_error)
}
__pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L1_error)
__pyx_v_seq_cstr = __pyx_t_10;
/* "HTSeq/_HTSeq.pyx":773
* minlen = patlen
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq # <<<<<<<<<<<<<<
* cdef int match = 0
* cdef int i, j
*/
if (unlikely(__pyx_v_pattern->seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 773, __pyx_L1_error)
}
__pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 773, __pyx_L1_error)
__pyx_v_pat_cstr = __pyx_t_10;
/* "HTSeq/_HTSeq.pyx":774
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq
* cdef int match = 0 # <<<<<<<<<<<<<<
* cdef int i, j
* cdef int num_mismatches
*/
__pyx_v_match = 0;
/* "HTSeq/_HTSeq.pyx":777
* cdef int i, j
* cdef int num_mismatches
* for i in range(1, minlen + 1): # <<<<<<<<<<<<<<
* num_mismatches = 0
* for j in range(i):
*/
__pyx_t_11 = (__pyx_v_minlen + 1);
__pyx_t_12 = __pyx_t_11;
for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_12; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
/* "HTSeq/_HTSeq.pyx":778
* cdef int num_mismatches
* for i in range(1, minlen + 1):
* num_mismatches = 0 # <<<<<<<<<<<<<<
* for j in range(i):
* if seq_cstr[seqlen - i + j] != pat_cstr[j]:
*/
__pyx_v_num_mismatches = 0;
/* "HTSeq/_HTSeq.pyx":779
* for i in range(1, minlen + 1):
* num_mismatches = 0
* for j in range(i): # <<<<<<<<<<<<<<
* if seq_cstr[seqlen - i + j] != pat_cstr[j]:
* num_mismatches += 1
*/
__pyx_t_13 = __pyx_v_i;
__pyx_t_14 = __pyx_t_13;
for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
__pyx_v_j = __pyx_t_15;
/* "HTSeq/_HTSeq.pyx":780
* num_mismatches = 0
* for j in range(i):
* if seq_cstr[seqlen - i + j] != pat_cstr[j]: # <<<<<<<<<<<<<<
* num_mismatches += 1
* if num_mismatches > mismatch_prop * i:
*/
__pyx_t_9 = (((__pyx_v_seq_cstr[((__pyx_v_seqlen - __pyx_v_i) + __pyx_v_j)]) != (__pyx_v_pat_cstr[__pyx_v_j])) != 0);
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":781
* for j in range(i):
* if seq_cstr[seqlen - i + j] != pat_cstr[j]:
* num_mismatches += 1 # <<<<<<<<<<<<<<
* if num_mismatches > mismatch_prop * i:
* break
*/
__pyx_v_num_mismatches = (__pyx_v_num_mismatches + 1);
/* "HTSeq/_HTSeq.pyx":782
* if seq_cstr[seqlen - i + j] != pat_cstr[j]:
* num_mismatches += 1
* if num_mismatches > mismatch_prop * i: # <<<<<<<<<<<<<<
* break
* else:
*/
__pyx_t_9 = ((__pyx_v_num_mismatches > (__pyx_v_mismatch_prop * __pyx_v_i)) != 0);
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":783
* num_mismatches += 1
* if num_mismatches > mismatch_prop * i:
* break # <<<<<<<<<<<<<<
* else:
* match = i
*/
goto __pyx_L7_break;
/* "HTSeq/_HTSeq.pyx":782
* if seq_cstr[seqlen - i + j] != pat_cstr[j]:
* num_mismatches += 1
* if num_mismatches > mismatch_prop * i: # <<<<<<<<<<<<<<
* break
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":780
* num_mismatches = 0
* for j in range(i):
* if seq_cstr[seqlen - i + j] != pat_cstr[j]: # <<<<<<<<<<<<<<
* num_mismatches += 1
* if num_mismatches > mismatch_prop * i:
*/
}
}
/*else*/ {
/* "HTSeq/_HTSeq.pyx":785
* break
* else:
* match = i # <<<<<<<<<<<<<<
* return self[0: seqlen - match]
*
*/
__pyx_v_match = __pyx_v_i;
}
__pyx_L7_break:;
}
/* "HTSeq/_HTSeq.pyx":786
* else:
* match = i
* return self[0: seqlen - match] # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, (__pyx_v_seqlen - __pyx_v_match), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 786, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":764
* return self[match: seqlen]
*
* cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.): # <<<<<<<<<<<<<<
* cdef int seqlen = len(self.seq)
* cdef int patlen = len(pattern.seq)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.trim_right_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
float __pyx_v_mismatch_prop;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("trim_right_end (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pattern,&__pyx_n_s_mismatch_prop,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pattern)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mismatch_prop);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trim_right_end") < 0)) __PYX_ERR(0, 764, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_pattern = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)values[0]);
if (values[1]) {
__pyx_v_mismatch_prop = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_mismatch_prop == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 764, __pyx_L3_error)
} else {
__pyx_v_mismatch_prop = ((float)0.);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("trim_right_end", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 764, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.trim_right_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pattern), __pyx_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 764, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_24trim_right_end(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_pattern, __pyx_v_mismatch_prop);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_24trim_right_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, float __pyx_v_mismatch_prop) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end __pyx_t_2;
__Pyx_RefNannySetupContext("trim_right_end", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.mismatch_prop = __pyx_v_mismatch_prop;
__pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence->trim_right_end(__pyx_v_self, __pyx_v_pattern, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.trim_right_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":20
*
* cdef class Sequence(object):
* cdef public bytes seq # <<<<<<<<<<<<<<
* cdef public str name
* cdef public str descr
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->seq);
__pyx_r = __pyx_v_self->seq;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyBytes_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 20, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->seq);
__Pyx_DECREF(__pyx_v_self->seq);
__pyx_v_self->seq = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.seq.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->seq);
__Pyx_DECREF(__pyx_v_self->seq);
__pyx_v_self->seq = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":21
* cdef class Sequence(object):
* cdef public bytes seq
* cdef public str name # <<<<<<<<<<<<<<
* cdef public str descr
* cpdef Sequence get_reverse_complement(self, bint rename=?)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->name);
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 21, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->name);
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->name);
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":22
* cdef public bytes seq
* cdef public str name
* cdef public str descr # <<<<<<<<<<<<<<
* cpdef Sequence get_reverse_complement(self, bint rename=?)
* cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->descr);
__pyx_r = __pyx_v_self->descr;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 22, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->descr);
__Pyx_DECREF(__pyx_v_self->descr);
__pyx_v_self->descr = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Sequence.descr.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->descr);
__Pyx_DECREF(__pyx_v_self->descr);
__pyx_v_self->descr = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":795
* """
*
* def __init__(self, bytes seq, str name, bytes qualstr, str qualscale="phred"): # <<<<<<<<<<<<<<
* """ Construct a SequenceWithQuality object.
*
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_21SequenceWithQualities___init__[] = " Construct a SequenceWithQuality object.\n\n seq - The actual sequence.\n name - The sequence name or ID\n qualstr - The quality string. Must have the same length as seq\n qualscale - The encoding scale of the quality string. Must be one of\n \"phred\", \"solexa\", \"solexa-old\", or \"noquals\" )\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5HTSeq_6_HTSeq_21SequenceWithQualities___init__;
#endif
static int __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_seq = 0;
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_qualstr = 0;
PyObject *__pyx_v_qualscale = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,&__pyx_n_s_name_2,&__pyx_n_s_qualstr,&__pyx_n_s_qualscale,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject*)__pyx_n_u_phred);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 795, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qualstr)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 795, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qualscale);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 795, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_seq = ((PyObject*)values[0]);
__pyx_v_name = ((PyObject*)values[1]);
__pyx_v_qualstr = ((PyObject*)values[2]);
__pyx_v_qualscale = ((PyObject*)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 795, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seq), (&PyBytes_Type), 1, "seq", 1))) __PYX_ERR(0, 795, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 795, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qualstr), (&PyBytes_Type), 1, "qualstr", 1))) __PYX_ERR(0, 795, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qualscale), (&PyUnicode_Type), 1, "qualscale", 1))) __PYX_ERR(0, 795, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_seq, __pyx_v_name, __pyx_v_qualstr, __pyx_v_qualscale);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities___init__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_name, PyObject *__pyx_v_qualstr, PyObject *__pyx_v_qualscale) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
Py_ssize_t __pyx_t_8;
Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("__init__", 0);
/* "HTSeq/_HTSeq.pyx":804
* "phred", "solexa", "solexa-old", or "noquals" )
* """
* Sequence.__init__(self, seq, name) # <<<<<<<<<<<<<<
* if qualscale != "noquals":
* if len(seq) != len(qualstr):
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_Sequence), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
__pyx_t_4 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_4 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_seq, __pyx_v_name};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_seq, __pyx_v_name};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
__pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_3) {
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
__Pyx_INCREF(__pyx_v_seq);
__Pyx_GIVEREF(__pyx_v_seq);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_seq);
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_name);
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":805
* """
* Sequence.__init__(self, seq, name)
* if qualscale != "noquals": # <<<<<<<<<<<<<<
* if len(seq) != len(qualstr):
* raise ValueError, "'seq' and 'qualstr' do not have the same length."
*/
__pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_qualscale, __pyx_n_u_noquals, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 805, __pyx_L1_error)
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
/* "HTSeq/_HTSeq.pyx":806
* Sequence.__init__(self, seq, name)
* if qualscale != "noquals":
* if len(seq) != len(qualstr): # <<<<<<<<<<<<<<
* raise ValueError, "'seq' and 'qualstr' do not have the same length."
* self._qualstr = qualstr
*/
if (unlikely(__pyx_v_seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 806, __pyx_L1_error)
}
__pyx_t_8 = PyBytes_GET_SIZE(__pyx_v_seq); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 806, __pyx_L1_error)
if (unlikely(__pyx_v_qualstr == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 806, __pyx_L1_error)
}
__pyx_t_9 = PyBytes_GET_SIZE(__pyx_v_qualstr); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 806, __pyx_L1_error)
__pyx_t_7 = ((__pyx_t_8 != __pyx_t_9) != 0);
if (unlikely(__pyx_t_7)) {
/* "HTSeq/_HTSeq.pyx":807
* if qualscale != "noquals":
* if len(seq) != len(qualstr):
* raise ValueError, "'seq' and 'qualstr' do not have the same length." # <<<<<<<<<<<<<<
* self._qualstr = qualstr
* else:
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_seq_and_qualstr_do_not_have_the, 0, 0);
__PYX_ERR(0, 807, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":806
* Sequence.__init__(self, seq, name)
* if qualscale != "noquals":
* if len(seq) != len(qualstr): # <<<<<<<<<<<<<<
* raise ValueError, "'seq' and 'qualstr' do not have the same length."
* self._qualstr = qualstr
*/
}
/* "HTSeq/_HTSeq.pyx":808
* if len(seq) != len(qualstr):
* raise ValueError, "'seq' and 'qualstr' do not have the same length."
* self._qualstr = qualstr # <<<<<<<<<<<<<<
* else:
* self._qualstr = b''
*/
__Pyx_INCREF(__pyx_v_qualstr);
__Pyx_GIVEREF(__pyx_v_qualstr);
__Pyx_GOTREF(__pyx_v_self->_qualstr);
__Pyx_DECREF(__pyx_v_self->_qualstr);
__pyx_v_self->_qualstr = __pyx_v_qualstr;
/* "HTSeq/_HTSeq.pyx":805
* """
* Sequence.__init__(self, seq, name)
* if qualscale != "noquals": # <<<<<<<<<<<<<<
* if len(seq) != len(qualstr):
* raise ValueError, "'seq' and 'qualstr' do not have the same length."
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":810
* self._qualstr = qualstr
* else:
* self._qualstr = b'' # <<<<<<<<<<<<<<
* self._qualscale = qualscale
* self._qualarr = None
*/
/*else*/ {
__Pyx_INCREF(__pyx_kp_b__12);
__Pyx_GIVEREF(__pyx_kp_b__12);
__Pyx_GOTREF(__pyx_v_self->_qualstr);
__Pyx_DECREF(__pyx_v_self->_qualstr);
__pyx_v_self->_qualstr = __pyx_kp_b__12;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":811
* else:
* self._qualstr = b''
* self._qualscale = qualscale # <<<<<<<<<<<<<<
* self._qualarr = None
* self._qualstr_phred = b''
*/
__Pyx_INCREF(__pyx_v_qualscale);
__Pyx_GIVEREF(__pyx_v_qualscale);
__Pyx_GOTREF(__pyx_v_self->_qualscale);
__Pyx_DECREF(__pyx_v_self->_qualscale);
__pyx_v_self->_qualscale = __pyx_v_qualscale;
/* "HTSeq/_HTSeq.pyx":812
* self._qualstr = b''
* self._qualscale = qualscale
* self._qualarr = None # <<<<<<<<<<<<<<
* self._qualstr_phred = b''
*
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->_qualarr);
__Pyx_DECREF(__pyx_v_self->_qualarr);
__pyx_v_self->_qualarr = Py_None;
/* "HTSeq/_HTSeq.pyx":813
* self._qualscale = qualscale
* self._qualarr = None
* self._qualstr_phred = b'' # <<<<<<<<<<<<<<
*
* cdef _fill_qual_arr(SequenceWithQualities self):
*/
__Pyx_INCREF(__pyx_kp_b__12);
__Pyx_GIVEREF(__pyx_kp_b__12);
__Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
__Pyx_DECREF(__pyx_v_self->_qualstr_phred);
__pyx_v_self->_qualstr_phred = __pyx_kp_b__12;
/* "HTSeq/_HTSeq.pyx":795
* """
*
* def __init__(self, bytes seq, str name, bytes qualstr, str qualscale="phred"): # <<<<<<<<<<<<<<
* """ Construct a SequenceWithQuality object.
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":815
* self._qualstr_phred = b''
*
* cdef _fill_qual_arr(SequenceWithQualities self): # <<<<<<<<<<<<<<
* cdef int seq_len = len(self.seq)
* if self._qualscale == "missing":
*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities__fill_qual_arr(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
int __pyx_v_seq_len;
PyArrayObject *__pyx_v_qualarr = 0;
int __pyx_v_i;
char *__pyx_v_qualstr;
__Pyx_LocalBuf_ND __pyx_pybuffernd_qualarr;
__Pyx_Buffer __pyx_pybuffer_qualarr;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
PyArrayObject *__pyx_t_11 = NULL;
char *__pyx_t_12;
int __pyx_t_13;
int __pyx_t_14;
Py_ssize_t __pyx_t_15;
int __pyx_t_16;
Py_ssize_t __pyx_t_17;
__pyx_t_5numpy_uint8_t __pyx_t_18;
Py_ssize_t __pyx_t_19;
__Pyx_RefNannySetupContext("_fill_qual_arr", 0);
__pyx_pybuffer_qualarr.pybuffer.buf = NULL;
__pyx_pybuffer_qualarr.refcount = 0;
__pyx_pybuffernd_qualarr.data = NULL;
__pyx_pybuffernd_qualarr.rcbuffer = &__pyx_pybuffer_qualarr;
/* "HTSeq/_HTSeq.pyx":816
*
* cdef _fill_qual_arr(SequenceWithQualities self):
* cdef int seq_len = len(self.seq) # <<<<<<<<<<<<<<
* if self._qualscale == "missing":
* raise ValueError, "Quality string missing."
*/
__pyx_t_1 = __pyx_v_self->__pyx_base.seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 816, __pyx_L1_error)
}
__pyx_t_2 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 816, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_seq_len = __pyx_t_2;
/* "HTSeq/_HTSeq.pyx":817
* cdef _fill_qual_arr(SequenceWithQualities self):
* cdef int seq_len = len(self.seq)
* if self._qualscale == "missing": # <<<<<<<<<<<<<<
* raise ValueError, "Quality string missing."
* if seq_len != len(self._qualstr):
*/
__pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_n_u_missing, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 817, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_3 != 0);
if (unlikely(__pyx_t_4)) {
/* "HTSeq/_HTSeq.pyx":818
* cdef int seq_len = len(self.seq)
* if self._qualscale == "missing":
* raise ValueError, "Quality string missing." # <<<<<<<<<<<<<<
* if seq_len != len(self._qualstr):
* raise ValueError, "Quality string has not the same length as sequence."
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Quality_string_missing, 0, 0);
__PYX_ERR(0, 818, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":817
* cdef _fill_qual_arr(SequenceWithQualities self):
* cdef int seq_len = len(self.seq)
* if self._qualscale == "missing": # <<<<<<<<<<<<<<
* raise ValueError, "Quality string missing."
* if seq_len != len(self._qualstr):
*/
}
/* "HTSeq/_HTSeq.pyx":819
* if self._qualscale == "missing":
* raise ValueError, "Quality string missing."
* if seq_len != len(self._qualstr): # <<<<<<<<<<<<<<
* raise ValueError, "Quality string has not the same length as sequence."
* cdef numpy.ndarray[numpy.uint8_t, ndim= 1] qualarr = numpy.empty((seq_len, ), numpy.uint8)
*/
__pyx_t_1 = __pyx_v_self->_qualstr;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 819, __pyx_L1_error)
}
__pyx_t_2 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 819, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4 = ((__pyx_v_seq_len != __pyx_t_2) != 0);
if (unlikely(__pyx_t_4)) {
/* "HTSeq/_HTSeq.pyx":820
* raise ValueError, "Quality string missing."
* if seq_len != len(self._qualstr):
* raise ValueError, "Quality string has not the same length as sequence." # <<<<<<<<<<<<<<
* cdef numpy.ndarray[numpy.uint8_t, ndim= 1] qualarr = numpy.empty((seq_len, ), numpy.uint8)
* cdef int i
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Quality_string_has_not_the_same, 0, 0);
__PYX_ERR(0, 820, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":819
* if self._qualscale == "missing":
* raise ValueError, "Quality string missing."
* if seq_len != len(self._qualstr): # <<<<<<<<<<<<<<
* raise ValueError, "Quality string has not the same length as sequence."
* cdef numpy.ndarray[numpy.uint8_t, ndim= 1] qualarr = numpy.empty((seq_len, ), numpy.uint8)
*/
}
/* "HTSeq/_HTSeq.pyx":821
* if seq_len != len(self._qualstr):
* raise ValueError, "Quality string has not the same length as sequence."
* cdef numpy.ndarray[numpy.uint8_t, ndim= 1] qualarr = numpy.empty((seq_len, ), numpy.uint8) # <<<<<<<<<<<<<<
* cdef int i
* cdef char * qualstr = self._qualstr
*/
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_seq_len); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__pyx_t_5 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_9 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_9 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_t_8};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_t_8};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
{
__pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_8);
__pyx_t_7 = 0;
__pyx_t_8 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 821, __pyx_L1_error)
__pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qualarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_qualarr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf = NULL;
__PYX_ERR(0, 821, __pyx_L1_error)
} else {__pyx_pybuffernd_qualarr.diminfo[0].strides = __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qualarr.diminfo[0].shape = __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_11 = 0;
__pyx_v_qualarr = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":823
* cdef numpy.ndarray[numpy.uint8_t, ndim= 1] qualarr = numpy.empty((seq_len, ), numpy.uint8)
* cdef int i
* cdef char * qualstr = self._qualstr # <<<<<<<<<<<<<<
* if self._qualscale == "phred":
* for i in range(seq_len):
*/
if (unlikely(__pyx_v_self->_qualstr == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 823, __pyx_L1_error)
}
__pyx_t_12 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_qualstr); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L1_error)
__pyx_v_qualstr = __pyx_t_12;
/* "HTSeq/_HTSeq.pyx":824
* cdef int i
* cdef char * qualstr = self._qualstr
* if self._qualscale == "phred": # <<<<<<<<<<<<<<
* for i in range(seq_len):
* qualarr[i] = qualstr[i] - 33
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_n_u_phred, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 824, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":825
* cdef char * qualstr = self._qualstr
* if self._qualscale == "phred":
* for i in range(seq_len): # <<<<<<<<<<<<<<
* qualarr[i] = qualstr[i] - 33
* elif self._qualscale == "solexa":
*/
__pyx_t_9 = __pyx_v_seq_len;
__pyx_t_13 = __pyx_t_9;
for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
__pyx_v_i = __pyx_t_14;
/* "HTSeq/_HTSeq.pyx":826
* if self._qualscale == "phred":
* for i in range(seq_len):
* qualarr[i] = qualstr[i] - 33 # <<<<<<<<<<<<<<
* elif self._qualscale == "solexa":
* for i in range(seq_len):
*/
__pyx_t_15 = __pyx_v_i;
__pyx_t_16 = -1;
if (__pyx_t_15 < 0) {
__pyx_t_15 += __pyx_pybuffernd_qualarr.diminfo[0].shape;
if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
} else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_qualarr.diminfo[0].shape)) __pyx_t_16 = 0;
if (unlikely(__pyx_t_16 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_16);
__PYX_ERR(0, 826, __pyx_L1_error)
}
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qualarr.diminfo[0].strides) = ((__pyx_v_qualstr[__pyx_v_i]) - 33);
}
/* "HTSeq/_HTSeq.pyx":824
* cdef int i
* cdef char * qualstr = self._qualstr
* if self._qualscale == "phred": # <<<<<<<<<<<<<<
* for i in range(seq_len):
* qualarr[i] = qualstr[i] - 33
*/
goto __pyx_L5;
}
/* "HTSeq/_HTSeq.pyx":827
* for i in range(seq_len):
* qualarr[i] = qualstr[i] - 33
* elif self._qualscale == "solexa": # <<<<<<<<<<<<<<
* for i in range(seq_len):
* qualarr[i] = qualstr[i] - 64
*/
__pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_n_u_solexa, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 827, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":828
* qualarr[i] = qualstr[i] - 33
* elif self._qualscale == "solexa":
* for i in range(seq_len): # <<<<<<<<<<<<<<
* qualarr[i] = qualstr[i] - 64
* elif self._qualscale == "solexa-old":
*/
__pyx_t_9 = __pyx_v_seq_len;
__pyx_t_13 = __pyx_t_9;
for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
__pyx_v_i = __pyx_t_14;
/* "HTSeq/_HTSeq.pyx":829
* elif self._qualscale == "solexa":
* for i in range(seq_len):
* qualarr[i] = qualstr[i] - 64 # <<<<<<<<<<<<<<
* elif self._qualscale == "solexa-old":
* for i in range(seq_len):
*/
__pyx_t_17 = __pyx_v_i;
__pyx_t_16 = -1;
if (__pyx_t_17 < 0) {
__pyx_t_17 += __pyx_pybuffernd_qualarr.diminfo[0].shape;
if (unlikely(__pyx_t_17 < 0)) __pyx_t_16 = 0;
} else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_qualarr.diminfo[0].shape)) __pyx_t_16 = 0;
if (unlikely(__pyx_t_16 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_16);
__PYX_ERR(0, 829, __pyx_L1_error)
}
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qualarr.diminfo[0].strides) = ((__pyx_v_qualstr[__pyx_v_i]) - 64);
}
/* "HTSeq/_HTSeq.pyx":827
* for i in range(seq_len):
* qualarr[i] = qualstr[i] - 33
* elif self._qualscale == "solexa": # <<<<<<<<<<<<<<
* for i in range(seq_len):
* qualarr[i] = qualstr[i] - 64
*/
goto __pyx_L5;
}
/* "HTSeq/_HTSeq.pyx":830
* for i in range(seq_len):
* qualarr[i] = qualstr[i] - 64
* elif self._qualscale == "solexa-old": # <<<<<<<<<<<<<<
* for i in range(seq_len):
* qualarr[i] = 10 * \
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_kp_u_solexa_old, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_4 != 0);
if (likely(__pyx_t_3)) {
/* "HTSeq/_HTSeq.pyx":831
* qualarr[i] = qualstr[i] - 64
* elif self._qualscale == "solexa-old":
* for i in range(seq_len): # <<<<<<<<<<<<<<
* qualarr[i] = 10 * \
* math.log10(1 + 10 ** (qualstr[i] - 64) / 10.0)
*/
__pyx_t_9 = __pyx_v_seq_len;
__pyx_t_13 = __pyx_t_9;
for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
__pyx_v_i = __pyx_t_14;
/* "HTSeq/_HTSeq.pyx":833
* for i in range(seq_len):
* qualarr[i] = 10 * \
* math.log10(1 + 10 ** (qualstr[i] - 64) / 10.0) # <<<<<<<<<<<<<<
* else:
* raise ValueError, "Illegal quality scale '%s'." % self._qualscale
*/
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = PyFloat_FromDouble((1.0 + (((double)__Pyx_pow_long(10, ((__pyx_v_qualstr[__pyx_v_i]) - 64))) / 10.0))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_10, function);
}
}
__pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
/* "HTSeq/_HTSeq.pyx":832
* elif self._qualscale == "solexa-old":
* for i in range(seq_len):
* qualarr[i] = 10 * \ # <<<<<<<<<<<<<<
* math.log10(1 + 10 ** (qualstr[i] - 64) / 10.0)
* else:
*/
__pyx_t_10 = PyNumber_Multiply(__pyx_int_10, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_18 = __Pyx_PyInt_As_npy_uint8(__pyx_t_10); if (unlikely((__pyx_t_18 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_19 = __pyx_v_i;
__pyx_t_16 = -1;
if (__pyx_t_19 < 0) {
__pyx_t_19 += __pyx_pybuffernd_qualarr.diminfo[0].shape;
if (unlikely(__pyx_t_19 < 0)) __pyx_t_16 = 0;
} else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_qualarr.diminfo[0].shape)) __pyx_t_16 = 0;
if (unlikely(__pyx_t_16 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_16);
__PYX_ERR(0, 832, __pyx_L1_error)
}
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qualarr.diminfo[0].strides) = __pyx_t_18;
}
/* "HTSeq/_HTSeq.pyx":830
* for i in range(seq_len):
* qualarr[i] = qualstr[i] - 64
* elif self._qualscale == "solexa-old": # <<<<<<<<<<<<<<
* for i in range(seq_len):
* qualarr[i] = 10 * \
*/
goto __pyx_L5;
}
/* "HTSeq/_HTSeq.pyx":835
* math.log10(1 + 10 ** (qualstr[i] - 64) / 10.0)
* else:
* raise ValueError, "Illegal quality scale '%s'." % self._qualscale # <<<<<<<<<<<<<<
* self._qualarr = qualarr
*
*/
/*else*/ {
__pyx_t_10 = PyUnicode_Format(__pyx_kp_u_Illegal_quality_scale_s, __pyx_v_self->_qualscale); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 835, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_10, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__PYX_ERR(0, 835, __pyx_L1_error)
}
__pyx_L5:;
/* "HTSeq/_HTSeq.pyx":836
* else:
* raise ValueError, "Illegal quality scale '%s'." % self._qualscale
* self._qualarr = qualarr # <<<<<<<<<<<<<<
*
* property qual:
*/
__Pyx_INCREF(((PyObject *)__pyx_v_qualarr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_qualarr));
__Pyx_GOTREF(__pyx_v_self->_qualarr);
__Pyx_DECREF(__pyx_v_self->_qualarr);
__pyx_v_self->_qualarr = ((PyObject *)__pyx_v_qualarr);
/* "HTSeq/_HTSeq.pyx":815
* self._qualstr_phred = b''
*
* cdef _fill_qual_arr(SequenceWithQualities self): # <<<<<<<<<<<<<<
* cdef int seq_len = len(self.seq)
* if self._qualscale == "missing":
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_10);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qualarr.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities._fill_qual_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qualarr.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_qualarr);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":839
*
* property qual:
* def __get__(self): # <<<<<<<<<<<<<<
* if self._qualarr is None:
* self._fill_qual_arr()
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":840
* property qual:
* def __get__(self):
* if self._qualarr is None: # <<<<<<<<<<<<<<
* self._fill_qual_arr()
* return self._qualarr
*/
__pyx_t_1 = (__pyx_v_self->_qualarr == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":841
* def __get__(self):
* if self._qualarr is None:
* self._fill_qual_arr() # <<<<<<<<<<<<<<
* return self._qualarr
*
*/
__pyx_t_3 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":840
* property qual:
* def __get__(self):
* if self._qualarr is None: # <<<<<<<<<<<<<<
* self._fill_qual_arr()
* return self._qualarr
*/
}
/* "HTSeq/_HTSeq.pyx":842
* if self._qualarr is None:
* self._fill_qual_arr()
* return self._qualarr # <<<<<<<<<<<<<<
*
* def __set__(self, newvalue):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->_qualarr);
__pyx_r = __pyx_v_self->_qualarr;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":839
*
* property qual:
* def __get__(self): # <<<<<<<<<<<<<<
* if self._qualarr is None:
* self._fill_qual_arr()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.qual.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":844
* return self._qualarr
*
* def __set__(self, newvalue): # <<<<<<<<<<<<<<
* if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):
* raise TypeError, "qual can only be assigned a numpy array of type numpy.uint8"
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_newvalue); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_newvalue) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), ((PyObject *)__pyx_v_newvalue));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_newvalue) {
CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
Py_ssize_t __pyx_t_7;
__Pyx_RefNannySetupContext("__set__", 0);
/* "HTSeq/_HTSeq.pyx":845
*
* def __set__(self, newvalue):
* if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8): # <<<<<<<<<<<<<<
* raise TypeError, "qual can only be assigned a numpy array of type numpy.uint8"
* if not (newvalue.shape == (len(self.seq), )):
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_newvalue, __pyx_ptype_5numpy_ndarray);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_newvalue, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_1 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
__pyx_t_3 = ((!__pyx_t_1) != 0);
if (unlikely(__pyx_t_3)) {
/* "HTSeq/_HTSeq.pyx":846
* def __set__(self, newvalue):
* if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):
* raise TypeError, "qual can only be assigned a numpy array of type numpy.uint8" # <<<<<<<<<<<<<<
* if not (newvalue.shape == (len(self.seq), )):
* raise TypeError, "assignment to qual with illegal shape"
*/
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_qual_can_only_be_assigned_a_nump, 0, 0);
__PYX_ERR(0, 846, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":845
*
* def __set__(self, newvalue):
* if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8): # <<<<<<<<<<<<<<
* raise TypeError, "qual can only be assigned a numpy array of type numpy.uint8"
* if not (newvalue.shape == (len(self.seq), )):
*/
}
/* "HTSeq/_HTSeq.pyx":847
* if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):
* raise TypeError, "qual can only be assigned a numpy array of type numpy.uint8"
* if not (newvalue.shape == (len(self.seq), )): # <<<<<<<<<<<<<<
* raise TypeError, "assignment to qual with illegal shape"
* self._qualarr = newvalue
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_newvalue, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 847, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __pyx_v_self->__pyx_base.seq;
__Pyx_INCREF(__pyx_t_6);
if (unlikely(__pyx_t_6 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 847, __pyx_L1_error)
}
__pyx_t_7 = PyBytes_GET_SIZE(__pyx_t_6); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 847, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 847, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 847, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 847, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_1 = ((!__pyx_t_3) != 0);
if (unlikely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":848
* raise TypeError, "qual can only be assigned a numpy array of type numpy.uint8"
* if not (newvalue.shape == (len(self.seq), )):
* raise TypeError, "assignment to qual with illegal shape" # <<<<<<<<<<<<<<
* self._qualarr = newvalue
* self._qualstr = b""
*/
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_assignment_to_qual_with_illegal, 0, 0);
__PYX_ERR(0, 848, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":847
* if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):
* raise TypeError, "qual can only be assigned a numpy array of type numpy.uint8"
* if not (newvalue.shape == (len(self.seq), )): # <<<<<<<<<<<<<<
* raise TypeError, "assignment to qual with illegal shape"
* self._qualarr = newvalue
*/
}
/* "HTSeq/_HTSeq.pyx":849
* if not (newvalue.shape == (len(self.seq), )):
* raise TypeError, "assignment to qual with illegal shape"
* self._qualarr = newvalue # <<<<<<<<<<<<<<
* self._qualstr = b""
* self._qualscale = "none"
*/
__Pyx_INCREF(__pyx_v_newvalue);
__Pyx_GIVEREF(__pyx_v_newvalue);
__Pyx_GOTREF(__pyx_v_self->_qualarr);
__Pyx_DECREF(__pyx_v_self->_qualarr);
__pyx_v_self->_qualarr = __pyx_v_newvalue;
/* "HTSeq/_HTSeq.pyx":850
* raise TypeError, "assignment to qual with illegal shape"
* self._qualarr = newvalue
* self._qualstr = b"" # <<<<<<<<<<<<<<
* self._qualscale = "none"
* self._qualstr_phred = b""
*/
__Pyx_INCREF(__pyx_kp_b__12);
__Pyx_GIVEREF(__pyx_kp_b__12);
__Pyx_GOTREF(__pyx_v_self->_qualstr);
__Pyx_DECREF(__pyx_v_self->_qualstr);
__pyx_v_self->_qualstr = __pyx_kp_b__12;
/* "HTSeq/_HTSeq.pyx":851
* self._qualarr = newvalue
* self._qualstr = b""
* self._qualscale = "none" # <<<<<<<<<<<<<<
* self._qualstr_phred = b""
* # Experimentally trying to set qualstr when the array is modified
*/
__Pyx_INCREF(__pyx_n_u_none);
__Pyx_GIVEREF(__pyx_n_u_none);
__Pyx_GOTREF(__pyx_v_self->_qualscale);
__Pyx_DECREF(__pyx_v_self->_qualscale);
__pyx_v_self->_qualscale = __pyx_n_u_none;
/* "HTSeq/_HTSeq.pyx":852
* self._qualstr = b""
* self._qualscale = "none"
* self._qualstr_phred = b"" # <<<<<<<<<<<<<<
* # Experimentally trying to set qualstr when the array is modified
* # directly
*/
__Pyx_INCREF(__pyx_kp_b__12);
__Pyx_GIVEREF(__pyx_kp_b__12);
__Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
__Pyx_DECREF(__pyx_v_self->_qualstr_phred);
__pyx_v_self->_qualstr_phred = __pyx_kp_b__12;
/* "HTSeq/_HTSeq.pyx":855
* # Experimentally trying to set qualstr when the array is modified
* # directly
* tmp = self.qualstr # <<<<<<<<<<<<<<
* self._qualstr = self._qualstr_phred
*
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qualstr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 855, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_v_tmp = __pyx_t_6;
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":856
* # directly
* tmp = self.qualstr
* self._qualstr = self._qualstr_phred # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__pyx_t_6 = __pyx_v_self->_qualstr_phred;
__Pyx_INCREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_self->_qualstr);
__Pyx_DECREF(__pyx_v_self->_qualstr);
__pyx_v_self->_qualstr = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":844
* return self._qualarr
*
* def __set__(self, newvalue): # <<<<<<<<<<<<<<
* if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):
* raise TypeError, "qual can only be assigned a numpy array of type numpy.uint8"
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.qual.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":858
* self._qualstr = self._qualstr_phred
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "<%s object '%s'>" % (self.__class__.__name__, self.name)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_3__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_2__repr__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "HTSeq/_HTSeq.pyx":859
*
* def __repr__(self):
* return "<%s object '%s'>" % (self.__class__.__name__, self.name) # <<<<<<<<<<<<<<
*
* def __getitem__(self, item):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__Pyx_INCREF(__pyx_kp_u__2);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u_object);
__pyx_t_2 += 9;
__Pyx_GIVEREF(__pyx_kp_u_object);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object);
__pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__5);
__pyx_t_2 += 2;
__Pyx_GIVEREF(__pyx_kp_u__5);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__5);
__pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":858
* self._qualstr = self._qualstr_phred
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "<%s object '%s'>" % (self.__class__.__name__, self.name)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":861
* return "<%s object '%s'>" % (self.__class__.__name__, self.name)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
* if self.name.endswith("[part]"):
* new_name = self.name
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4__getitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), ((PyObject *)__pyx_v_item));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_item) {
PyObject *__pyx_v_new_name = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("__getitem__", 0);
/* "HTSeq/_HTSeq.pyx":862
*
* def __getitem__(self, item):
* if self.name.endswith("[part]"): # <<<<<<<<<<<<<<
* new_name = self.name
* else:
*/
if (unlikely(__pyx_v_self->__pyx_base.name == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "endswith");
__PYX_ERR(0, 862, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_self->__pyx_base.name, __pyx_kp_u_part, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 862, __pyx_L1_error)
if ((__pyx_t_1 != 0)) {
/* "HTSeq/_HTSeq.pyx":863
* def __getitem__(self, item):
* if self.name.endswith("[part]"):
* new_name = self.name # <<<<<<<<<<<<<<
* else:
* new_name = self.name + "[part]"
*/
__pyx_t_2 = __pyx_v_self->__pyx_base.name;
__Pyx_INCREF(__pyx_t_2);
__pyx_v_new_name = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":862
*
* def __getitem__(self, item):
* if self.name.endswith("[part]"): # <<<<<<<<<<<<<<
* new_name = self.name
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":865
* new_name = self.name
* else:
* new_name = self.name + "[part]" # <<<<<<<<<<<<<<
* return SequenceWithQualities(
* self.seq[item], new_name, self.qualstr[item])
*/
/*else*/ {
__pyx_t_2 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_self->__pyx_base.name, __pyx_kp_u_part); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_new_name = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":866
* else:
* new_name = self.name + "[part]"
* return SequenceWithQualities( # <<<<<<<<<<<<<<
* self.seq[item], new_name, self.qualstr[item])
*
*/
__Pyx_XDECREF(__pyx_r);
/* "HTSeq/_HTSeq.pyx":867
* new_name = self.name + "[part]"
* return SequenceWithQualities(
* self.seq[item], new_name, self.qualstr[item]) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.seq, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qualstr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":866
* else:
* new_name = self.name + "[part]"
* return SequenceWithQualities( # <<<<<<<<<<<<<<
* self.seq[item], new_name, self.qualstr[item])
*
*/
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_INCREF(__pyx_v_new_name);
__Pyx_GIVEREF(__pyx_v_new_name);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_new_name);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
__pyx_t_2 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":861
* return "<%s object '%s'>" % (self.__class__.__name__, self.name)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
* if self.name.endswith("[part]"):
* new_name = self.name
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_new_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":870
*
* @property
* def qualstr(self): # <<<<<<<<<<<<<<
* cdef int seqlen
* cdef char * qualstr_phred_cstr = self._qualstr_phred
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
int __pyx_v_seqlen;
char *__pyx_v_qualstr_phred_cstr;
int __pyx_v_i;
PyArrayObject *__pyx_v_qual_array = 0;
__Pyx_LocalBuf_ND __pyx_pybuffernd_qual_array;
__Pyx_Buffer __pyx_pybuffer_qual_array;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
char *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
Py_ssize_t __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
int __pyx_t_11;
int __pyx_t_12;
Py_ssize_t __pyx_t_13;
int __pyx_t_14;
__Pyx_RefNannySetupContext("__get__", 0);
__pyx_pybuffer_qual_array.pybuffer.buf = NULL;
__pyx_pybuffer_qual_array.refcount = 0;
__pyx_pybuffernd_qual_array.data = NULL;
__pyx_pybuffernd_qual_array.rcbuffer = &__pyx_pybuffer_qual_array;
/* "HTSeq/_HTSeq.pyx":872
* def qualstr(self):
* cdef int seqlen
* cdef char * qualstr_phred_cstr = self._qualstr_phred # <<<<<<<<<<<<<<
* cdef int i
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array
*/
if (unlikely(__pyx_v_self->_qualstr_phred == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 872, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_qualstr_phred); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L1_error)
__pyx_v_qualstr_phred_cstr = __pyx_t_1;
/* "HTSeq/_HTSeq.pyx":875
* cdef int i
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array
* if qualstr_phred_cstr[0] == 0: # <<<<<<<<<<<<<<
* if self._qualscale == "noquals":
* raise ValueError, "Quality string missing"
*/
__pyx_t_2 = (((__pyx_v_qualstr_phred_cstr[0]) == 0) != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":876
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array
* if qualstr_phred_cstr[0] == 0:
* if self._qualscale == "noquals": # <<<<<<<<<<<<<<
* raise ValueError, "Quality string missing"
* if self._qualscale == "phred":
*/
__pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_n_u_noquals, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_2 != 0);
if (unlikely(__pyx_t_3)) {
/* "HTSeq/_HTSeq.pyx":877
* if qualstr_phred_cstr[0] == 0:
* if self._qualscale == "noquals":
* raise ValueError, "Quality string missing" # <<<<<<<<<<<<<<
* if self._qualscale == "phred":
* self._qualstr_phred = self._qualstr
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Quality_string_missing_2, 0, 0);
__PYX_ERR(0, 877, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":876
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array
* if qualstr_phred_cstr[0] == 0:
* if self._qualscale == "noquals": # <<<<<<<<<<<<<<
* raise ValueError, "Quality string missing"
* if self._qualscale == "phred":
*/
}
/* "HTSeq/_HTSeq.pyx":878
* if self._qualscale == "noquals":
* raise ValueError, "Quality string missing"
* if self._qualscale == "phred": # <<<<<<<<<<<<<<
* self._qualstr_phred = self._qualstr
* else:
*/
__pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_n_u_phred, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 878, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":879
* raise ValueError, "Quality string missing"
* if self._qualscale == "phred":
* self._qualstr_phred = self._qualstr # <<<<<<<<<<<<<<
* else:
* seqlen = len(self.seq)
*/
__pyx_t_4 = __pyx_v_self->_qualstr;
__Pyx_INCREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
__Pyx_DECREF(__pyx_v_self->_qualstr_phred);
__pyx_v_self->_qualstr_phred = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":878
* if self._qualscale == "noquals":
* raise ValueError, "Quality string missing"
* if self._qualscale == "phred": # <<<<<<<<<<<<<<
* self._qualstr_phred = self._qualstr
* else:
*/
goto __pyx_L5;
}
/* "HTSeq/_HTSeq.pyx":881
* self._qualstr_phred = self._qualstr
* else:
* seqlen = len(self.seq) # <<<<<<<<<<<<<<
* # FIXME: is this fixed now?
* self._qualstr_phred = b' ' * seqlen
*/
/*else*/ {
__pyx_t_4 = __pyx_v_self->__pyx_base.seq;
__Pyx_INCREF(__pyx_t_4);
if (unlikely(__pyx_t_4 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 881, __pyx_L1_error)
}
__pyx_t_5 = PyBytes_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 881, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_seqlen = __pyx_t_5;
/* "HTSeq/_HTSeq.pyx":883
* seqlen = len(self.seq)
* # FIXME: is this fixed now?
* self._qualstr_phred = b' ' * seqlen # <<<<<<<<<<<<<<
* qualstr_phred_cstr = self._qualstr_phred
* if self._qualarr is None:
*/
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_seqlen); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = PyNumber_Multiply(__pyx_kp_b__26, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 883, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 883, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
__Pyx_DECREF(__pyx_v_self->_qualstr_phred);
__pyx_v_self->_qualstr_phred = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":884
* # FIXME: is this fixed now?
* self._qualstr_phred = b' ' * seqlen
* qualstr_phred_cstr = self._qualstr_phred # <<<<<<<<<<<<<<
* if self._qualarr is None:
* self._fill_qual_arr()
*/
if (unlikely(__pyx_v_self->_qualstr_phred == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 884, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_qualstr_phred); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
__pyx_v_qualstr_phred_cstr = __pyx_t_1;
/* "HTSeq/_HTSeq.pyx":885
* self._qualstr_phred = b' ' * seqlen
* qualstr_phred_cstr = self._qualstr_phred
* if self._qualarr is None: # <<<<<<<<<<<<<<
* self._fill_qual_arr()
* qual_array = self._qualarr
*/
__pyx_t_2 = (__pyx_v_self->_qualarr == Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":886
* qualstr_phred_cstr = self._qualstr_phred
* if self._qualarr is None:
* self._fill_qual_arr() # <<<<<<<<<<<<<<
* qual_array = self._qualarr
* for i in range(seqlen):
*/
__pyx_t_6 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 886, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":885
* self._qualstr_phred = b' ' * seqlen
* qualstr_phred_cstr = self._qualstr_phred
* if self._qualarr is None: # <<<<<<<<<<<<<<
* self._fill_qual_arr()
* qual_array = self._qualarr
*/
}
/* "HTSeq/_HTSeq.pyx":887
* if self._qualarr is None:
* self._fill_qual_arr()
* qual_array = self._qualarr # <<<<<<<<<<<<<<
* for i in range(seqlen):
* qualstr_phred_cstr[i] = 33 + qual_array[i]
*/
if (!(likely(((__pyx_v_self->_qualarr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->_qualarr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 887, __pyx_L1_error)
__pyx_t_6 = __pyx_v_self->_qualarr;
__Pyx_INCREF(__pyx_t_6);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
__pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_6), &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
if (unlikely(__pyx_t_7 < 0)) {
PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_qual_array, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
__Pyx_RaiseBufferFallbackError();
} else {
PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
}
__pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
}
__pyx_pybuffernd_qual_array.diminfo[0].strides = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qual_array.diminfo[0].shape = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.shape[0];
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 887, __pyx_L1_error)
}
__pyx_v_qual_array = ((PyArrayObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":888
* self._fill_qual_arr()
* qual_array = self._qualarr
* for i in range(seqlen): # <<<<<<<<<<<<<<
* qualstr_phred_cstr[i] = 33 + qual_array[i]
* return self._qualstr_phred
*/
__pyx_t_7 = __pyx_v_seqlen;
__pyx_t_11 = __pyx_t_7;
for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
__pyx_v_i = __pyx_t_12;
/* "HTSeq/_HTSeq.pyx":889
* qual_array = self._qualarr
* for i in range(seqlen):
* qualstr_phred_cstr[i] = 33 + qual_array[i] # <<<<<<<<<<<<<<
* return self._qualstr_phred
*
*/
__pyx_t_13 = __pyx_v_i;
__pyx_t_14 = -1;
if (__pyx_t_13 < 0) {
__pyx_t_13 += __pyx_pybuffernd_qual_array.diminfo[0].shape;
if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
} else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_qual_array.diminfo[0].shape)) __pyx_t_14 = 0;
if (unlikely(__pyx_t_14 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_14);
__PYX_ERR(0, 889, __pyx_L1_error)
}
(__pyx_v_qualstr_phred_cstr[__pyx_v_i]) = (33 + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_qual_array.diminfo[0].strides)));
}
}
__pyx_L5:;
/* "HTSeq/_HTSeq.pyx":875
* cdef int i
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array
* if qualstr_phred_cstr[0] == 0: # <<<<<<<<<<<<<<
* if self._qualscale == "noquals":
* raise ValueError, "Quality string missing"
*/
}
/* "HTSeq/_HTSeq.pyx":890
* for i in range(seqlen):
* qualstr_phred_cstr[i] = 33 + qual_array[i]
* return self._qualstr_phred # <<<<<<<<<<<<<<
*
* def write_to_fastq_file(self, fastq_file):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->_qualstr_phred);
__pyx_r = __pyx_v_self->_qualstr_phred;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":870
*
* @property
* def qualstr(self): # <<<<<<<<<<<<<<
* cdef int seqlen
* cdef char * qualstr_phred_cstr = self._qualstr_phred
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.qualstr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_qual_array);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":892
* return self._qualstr_phred
*
* def write_to_fastq_file(self, fastq_file): # <<<<<<<<<<<<<<
* if hasattr(self, "descr") and self.descr is not None:
* fastq_file.write("@%s %s\n" % (self.name, self.descr))
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file(PyObject *__pyx_v_self, PyObject *__pyx_v_fastq_file); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file(PyObject *__pyx_v_self, PyObject *__pyx_v_fastq_file) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_to_fastq_file (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_6write_to_fastq_file(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), ((PyObject *)__pyx_v_fastq_file));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_6write_to_fastq_file(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_fastq_file) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
Py_ssize_t __pyx_t_7;
Py_UCS4 __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
__Pyx_RefNannySetupContext("write_to_fastq_file", 0);
/* "HTSeq/_HTSeq.pyx":893
*
* def write_to_fastq_file(self, fastq_file):
* if hasattr(self, "descr") and self.descr is not None: # <<<<<<<<<<<<<<
* fastq_file.write("@%s %s\n" % (self.name, self.descr))
* else:
*/
__pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_descr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 893, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_3 = (__pyx_v_self->__pyx_base.descr != ((PyObject*)Py_None));
__pyx_t_2 = (__pyx_t_3 != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":894
* def write_to_fastq_file(self, fastq_file):
* if hasattr(self, "descr") and self.descr is not None:
* fastq_file.write("@%s %s\n" % (self.name, self.descr)) # <<<<<<<<<<<<<<
* else:
* fastq_file.write("@%s\n" % self.name)
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fastq_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 894, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 894, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = 0;
__pyx_t_8 = 127;
__Pyx_INCREF(__pyx_kp_u__27);
__pyx_t_7 += 1;
__Pyx_GIVEREF(__pyx_kp_u__27);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__27);
__pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8;
__pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_9);
__pyx_t_9 = 0;
__Pyx_INCREF(__pyx_kp_u__26);
__pyx_t_7 += 1;
__Pyx_GIVEREF(__pyx_kp_u__26);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__26);
__pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.descr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8;
__pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_9);
__pyx_t_9 = 0;
__Pyx_INCREF(__pyx_kp_u__22);
__pyx_t_7 += 1;
__Pyx_GIVEREF(__pyx_kp_u__22);
PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__22);
__pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_6, 5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 894, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":893
*
* def write_to_fastq_file(self, fastq_file):
* if hasattr(self, "descr") and self.descr is not None: # <<<<<<<<<<<<<<
* fastq_file.write("@%s %s\n" % (self.name, self.descr))
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":896
* fastq_file.write("@%s %s\n" % (self.name, self.descr))
* else:
* fastq_file.write("@%s\n" % self.name) # <<<<<<<<<<<<<<
* fastq_file.write(self.seq.decode() + "\n")
* fastq_file.write("+\n")
*/
/*else*/ {
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fastq_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = PyUnicode_Format(__pyx_kp_u_s_2, __pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 896, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 896, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":897
* else:
* fastq_file.write("@%s\n" % self.name)
* fastq_file.write(self.seq.decode() + "\n") # <<<<<<<<<<<<<<
* fastq_file.write("+\n")
* fastq_file.write(self.qualstr.decode() + "\n")
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fastq_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 897, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__pyx_v_self->__pyx_base.seq == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
__PYX_ERR(0, 897, __pyx_L1_error)
}
__pyx_t_9 = __Pyx_decode_bytes(__pyx_v_self->__pyx_base.seq, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 897, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_9, __pyx_kp_u__22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":898
* fastq_file.write("@%s\n" % self.name)
* fastq_file.write(self.seq.decode() + "\n")
* fastq_file.write("+\n") # <<<<<<<<<<<<<<
* fastq_file.write(self.qualstr.decode() + "\n")
*
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fastq_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_u__28) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u__28);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":899
* fastq_file.write(self.seq.decode() + "\n")
* fastq_file.write("+\n")
* fastq_file.write(self.qualstr.decode() + "\n") # <<<<<<<<<<<<<<
*
* def get_fastq_str(self, bint convert_to_phred=False):
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fastq_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qualstr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_decode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_10, function);
}
}
__pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__22); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":892
* return self._qualstr_phred
*
* def write_to_fastq_file(self, fastq_file): # <<<<<<<<<<<<<<
* if hasattr(self, "descr") and self.descr is not None:
* fastq_file.write("@%s %s\n" % (self.name, self.descr))
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.write_to_fastq_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":901
* fastq_file.write(self.qualstr.decode() + "\n")
*
* def get_fastq_str(self, bint convert_to_phred=False): # <<<<<<<<<<<<<<
* sio = cStringIO.StringIO()
* self.write_to_fastq_file(sio, convert_to_phred)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_convert_to_phred;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_fastq_str (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_convert_to_phred,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_convert_to_phred);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_fastq_str") < 0)) __PYX_ERR(0, 901, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
if (values[0]) {
__pyx_v_convert_to_phred = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_convert_to_phred == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L3_error)
} else {
__pyx_v_convert_to_phred = ((int)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("get_fastq_str", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 901, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.get_fastq_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8get_fastq_str(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_convert_to_phred);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8get_fastq_str(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_v_convert_to_phred) {
PyObject *__pyx_v_sio = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("get_fastq_str", 0);
/* "HTSeq/_HTSeq.pyx":902
*
* def get_fastq_str(self, bint convert_to_phred=False):
* sio = cStringIO.StringIO() # <<<<<<<<<<<<<<
* self.write_to_fastq_file(sio, convert_to_phred)
* return sio.getvalue()
*/
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cStringIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_sio = __pyx_t_1;
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":903
* def get_fastq_str(self, bint convert_to_phred=False):
* sio = cStringIO.StringIO()
* self.write_to_fastq_file(sio, convert_to_phred) # <<<<<<<<<<<<<<
* return sio.getvalue()
*
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to_fastq_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_convert_to_phred); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_sio, __pyx_t_2};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_sio, __pyx_t_2};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 903, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_sio);
__Pyx_GIVEREF(__pyx_v_sio);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_sio);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":904
* sio = cStringIO.StringIO()
* self.write_to_fastq_file(sio, convert_to_phred)
* return sio.getvalue() # <<<<<<<<<<<<<<
*
* cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sio, __pyx_n_s_getvalue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 904, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":901
* fastq_file.write(self.qualstr.decode() + "\n")
*
* def get_fastq_str(self, bint convert_to_phred=False): # <<<<<<<<<<<<<<
* sio = cStringIO.StringIO()
* self.write_to_fastq_file(sio, convert_to_phred)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.get_fastq_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_sio);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":906
* return sio.getvalue()
*
* cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True): # <<<<<<<<<<<<<<
* cdef SequenceWithQualities res
* if rename:
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args) {
int __pyx_v_rename = ((int)1);
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_res = 0;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
__Pyx_RefNannySetupContext("get_reverse_complement", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_rename = __pyx_optional_args->rename;
}
}
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_reverse_complement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_rename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 906, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":908
* cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):
* cdef SequenceWithQualities res
* if rename: # <<<<<<<<<<<<<<
* res = SequenceWithQualities(
* reverse_complement(self.seq),
*/
__pyx_t_6 = (__pyx_v_rename != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":910
* if rename:
* res = SequenceWithQualities(
* reverse_complement(self.seq), # <<<<<<<<<<<<<<
* "revcomp_of_" + self.name,
* self._qualstr[::-1],
*/
__pyx_t_1 = __pyx_v_self->__pyx_base.seq;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 910, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":911
* res = SequenceWithQualities(
* reverse_complement(self.seq),
* "revcomp_of_" + self.name, # <<<<<<<<<<<<<<
* self._qualstr[::-1],
* self._qualscale)
*/
__pyx_t_1 = __Pyx_PyUnicode_ConcatSafe(__pyx_n_u_revcomp_of, __pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "HTSeq/_HTSeq.pyx":912
* reverse_complement(self.seq),
* "revcomp_of_" + self.name,
* self._qualstr[::-1], # <<<<<<<<<<<<<<
* self._qualscale)
* else:
*/
__pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_qualstr, __pyx_slice__24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "HTSeq/_HTSeq.pyx":909
* cdef SequenceWithQualities res
* if rename:
* res = SequenceWithQualities( # <<<<<<<<<<<<<<
* reverse_complement(self.seq),
* "revcomp_of_" + self.name,
*/
__pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
__Pyx_INCREF(__pyx_v_self->_qualscale);
__Pyx_GIVEREF(__pyx_v_self->_qualscale);
PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->_qualscale);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 909, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_res = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_4);
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":908
* cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):
* cdef SequenceWithQualities res
* if rename: # <<<<<<<<<<<<<<
* res = SequenceWithQualities(
* reverse_complement(self.seq),
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":915
* self._qualscale)
* else:
* res = SequenceWithQualities( # <<<<<<<<<<<<<<
* reverse_complement(self.seq),
* self.name,
*/
/*else*/ {
/* "HTSeq/_HTSeq.pyx":916
* else:
* res = SequenceWithQualities(
* reverse_complement(self.seq), # <<<<<<<<<<<<<<
* self.name,
* self._qualstr[::-1],
*/
__pyx_t_4 = __pyx_v_self->__pyx_base.seq;
__Pyx_INCREF(__pyx_t_4);
__pyx_t_3 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_4), 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":918
* reverse_complement(self.seq),
* self.name,
* self._qualstr[::-1], # <<<<<<<<<<<<<<
* self._qualscale)
* if self._qualarr is not None:
*/
__pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_qualstr, __pyx_slice__24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 918, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "HTSeq/_HTSeq.pyx":915
* self._qualscale)
* else:
* res = SequenceWithQualities( # <<<<<<<<<<<<<<
* reverse_complement(self.seq),
* self.name,
*/
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
__Pyx_INCREF(__pyx_v_self->__pyx_base.name);
__Pyx_GIVEREF(__pyx_v_self->__pyx_base.name);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->__pyx_base.name);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
__Pyx_INCREF(__pyx_v_self->_qualscale);
__Pyx_GIVEREF(__pyx_v_self->_qualscale);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->_qualscale);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 915, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_res = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":920
* self._qualstr[::-1],
* self._qualscale)
* if self._qualarr is not None: # <<<<<<<<<<<<<<
* res._qualarr = self._qualarr[::-1]
* return res
*/
__pyx_t_6 = (__pyx_v_self->_qualarr != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
/* "HTSeq/_HTSeq.pyx":921
* self._qualscale)
* if self._qualarr is not None:
* res._qualarr = self._qualarr[::-1] # <<<<<<<<<<<<<<
* return res
*
*/
__pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_qualarr, __pyx_slice__24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_v_res->_qualarr);
__Pyx_DECREF(__pyx_v_res->_qualarr);
__pyx_v_res->_qualarr = __pyx_t_4;
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":920
* self._qualstr[::-1],
* self._qualscale)
* if self._qualarr is not None: # <<<<<<<<<<<<<<
* res._qualarr = self._qualarr[::-1]
* return res
*/
}
/* "HTSeq/_HTSeq.pyx":922
* if self._qualarr is not None:
* res._qualarr = self._qualarr[::-1]
* return res # <<<<<<<<<<<<<<
*
* cpdef object add_qual_to_count_array(SequenceWithQualities self,
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_res));
__pyx_r = __pyx_v_res;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":906
* return sio.getvalue()
*
* cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True): # <<<<<<<<<<<<<<
* cdef SequenceWithQualities res
* if rename:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_res);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_rename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_reverse_complement (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rename,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rename);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_reverse_complement") < 0)) __PYX_ERR(0, 906, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
if (values[0]) {
__pyx_v_rename = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_rename == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L3_error)
} else {
__pyx_v_rename = ((int)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("get_reverse_complement", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 906, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10get_reverse_complement(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_rename);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_v_rename) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement __pyx_t_2;
__Pyx_RefNannySetupContext("get_reverse_complement", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.rename = __pyx_v_rename;
__pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities->get_reverse_complement(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement__pyx_wrap_1(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args) {
return __pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement(__pyx_v_self, __pyx_skip_dispatch, __pyx_optional_args);
}
/* "HTSeq/_HTSeq.pyx":924
* return res
*
* cpdef object add_qual_to_count_array(SequenceWithQualities self, # <<<<<<<<<<<<<<
* numpy.ndarray count_array_):
*
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array(PyObject *__pyx_v_self, PyObject *__pyx_v_count_array_); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_add_qual_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyArrayObject *__pyx_v_count_array_, int __pyx_skip_dispatch) {
PyArrayObject *__pyx_v_count_array = 0;
PyArrayObject *__pyx_v_qual_array = 0;
npy_intp __pyx_v_seq_length;
npy_intp __pyx_v_qual_size;
npy_intp __pyx_v_i;
npy_int __pyx_v_q;
__Pyx_LocalBuf_ND __pyx_pybuffernd_count_array;
__Pyx_Buffer __pyx_pybuffer_count_array;
__Pyx_LocalBuf_ND __pyx_pybuffernd_qual_array;
__Pyx_Buffer __pyx_pybuffer_qual_array;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
npy_intp __pyx_t_7;
npy_intp __pyx_t_8;
npy_intp __pyx_t_9;
Py_ssize_t __pyx_t_10;
int __pyx_t_11;
Py_ssize_t __pyx_t_12;
Py_ssize_t __pyx_t_13;
__Pyx_RefNannySetupContext("add_qual_to_count_array", 0);
__pyx_pybuffer_count_array.pybuffer.buf = NULL;
__pyx_pybuffer_count_array.refcount = 0;
__pyx_pybuffernd_count_array.data = NULL;
__pyx_pybuffernd_count_array.rcbuffer = &__pyx_pybuffer_count_array;
__pyx_pybuffer_qual_array.pybuffer.buf = NULL;
__pyx_pybuffer_qual_array.refcount = 0;
__pyx_pybuffernd_qual_array.data = NULL;
__pyx_pybuffernd_qual_array.rcbuffer = &__pyx_pybuffer_qual_array;
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_qual_to_count_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_count_array_)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_count_array_));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":927
* numpy.ndarray count_array_):
*
* cdef numpy.ndarray[numpy.int_t, ndim = 2] count_array = count_array_ # <<<<<<<<<<<<<<
* if self._qualarr is None:
* self._fill_qual_arr()
*/
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_count_array_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
__pyx_v_count_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf = NULL;
__PYX_ERR(0, 927, __pyx_L1_error)
} else {__pyx_pybuffernd_count_array.diminfo[0].strides = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_count_array.diminfo[0].shape = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_count_array.diminfo[1].strides = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_count_array.diminfo[1].shape = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.shape[1];
}
}
__Pyx_INCREF(((PyObject *)__pyx_v_count_array_));
__pyx_v_count_array = ((PyArrayObject *)__pyx_v_count_array_);
/* "HTSeq/_HTSeq.pyx":928
*
* cdef numpy.ndarray[numpy.int_t, ndim = 2] count_array = count_array_
* if self._qualarr is None: # <<<<<<<<<<<<<<
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
__pyx_t_5 = (__pyx_v_self->_qualarr == Py_None);
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":929
* cdef numpy.ndarray[numpy.int_t, ndim = 2] count_array = count_array_
* if self._qualarr is None:
* self._fill_qual_arr() # <<<<<<<<<<<<<<
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":928
*
* cdef numpy.ndarray[numpy.int_t, ndim = 2] count_array = count_array_
* if self._qualarr is None: # <<<<<<<<<<<<<<
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
}
/* "HTSeq/_HTSeq.pyx":930
* if self._qualarr is None:
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr # <<<<<<<<<<<<<<
*
* cdef numpy.npy_intp seq_length = numpy.PyArray_DIMS(qual_array)[0]
*/
if (!(likely(((__pyx_v_self->_qualarr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->_qualarr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 930, __pyx_L1_error)
__pyx_t_1 = __pyx_v_self->_qualarr;
__Pyx_INCREF(__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_qual_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf = NULL;
__PYX_ERR(0, 930, __pyx_L1_error)
} else {__pyx_pybuffernd_qual_array.diminfo[0].strides = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qual_array.diminfo[0].shape = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.shape[0];
}
}
__pyx_v_qual_array = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":932
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*
* cdef numpy.npy_intp seq_length = numpy.PyArray_DIMS(qual_array)[0] # <<<<<<<<<<<<<<
* cdef numpy.npy_intp qual_size = numpy.PyArray_DIMS(count_array)[1]
*
*/
__pyx_v_seq_length = (PyArray_DIMS(((PyArrayObject *)__pyx_v_qual_array))[0]);
/* "HTSeq/_HTSeq.pyx":933
*
* cdef numpy.npy_intp seq_length = numpy.PyArray_DIMS(qual_array)[0]
* cdef numpy.npy_intp qual_size = numpy.PyArray_DIMS(count_array)[1] # <<<<<<<<<<<<<<
*
* if seq_length > numpy.PyArray_DIMS(count_array)[0]:
*/
__pyx_v_qual_size = (PyArray_DIMS(((PyArrayObject *)__pyx_v_count_array))[1]);
/* "HTSeq/_HTSeq.pyx":935
* cdef numpy.npy_intp qual_size = numpy.PyArray_DIMS(count_array)[1]
*
* if seq_length > numpy.PyArray_DIMS(count_array)[0]: # <<<<<<<<<<<<<<
* raise ValueError, "'count_array' too small for sequence."
*
*/
__pyx_t_6 = ((__pyx_v_seq_length > (PyArray_DIMS(((PyArrayObject *)__pyx_v_count_array))[0])) != 0);
if (unlikely(__pyx_t_6)) {
/* "HTSeq/_HTSeq.pyx":936
*
* if seq_length > numpy.PyArray_DIMS(count_array)[0]:
* raise ValueError, "'count_array' too small for sequence." # <<<<<<<<<<<<<<
*
* cdef numpy.npy_intp i
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_count_array_too_small_for_seque, 0, 0);
__PYX_ERR(0, 936, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":935
* cdef numpy.npy_intp qual_size = numpy.PyArray_DIMS(count_array)[1]
*
* if seq_length > numpy.PyArray_DIMS(count_array)[0]: # <<<<<<<<<<<<<<
* raise ValueError, "'count_array' too small for sequence."
*
*/
}
/* "HTSeq/_HTSeq.pyx":940
* cdef numpy.npy_intp i
* cdef numpy.npy_int q
* for i in range(seq_length): # <<<<<<<<<<<<<<
* q = qual_array[i]
* if(q >= qual_size):
*/
__pyx_t_7 = __pyx_v_seq_length;
__pyx_t_8 = __pyx_t_7;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "HTSeq/_HTSeq.pyx":941
* cdef numpy.npy_int q
* for i in range(seq_length):
* q = qual_array[i] # <<<<<<<<<<<<<<
* if(q >= qual_size):
* raise ValueError, "Too large quality value encountered."
*/
__pyx_t_10 = __pyx_v_i;
__pyx_t_11 = -1;
if (__pyx_t_10 < 0) {
__pyx_t_10 += __pyx_pybuffernd_qual_array.diminfo[0].shape;
if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
} else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_qual_array.diminfo[0].shape)) __pyx_t_11 = 0;
if (unlikely(__pyx_t_11 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_11);
__PYX_ERR(0, 941, __pyx_L1_error)
}
__pyx_v_q = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_qual_array.diminfo[0].strides));
/* "HTSeq/_HTSeq.pyx":942
* for i in range(seq_length):
* q = qual_array[i]
* if(q >= qual_size): # <<<<<<<<<<<<<<
* raise ValueError, "Too large quality value encountered."
* count_array[i, q] += 1
*/
__pyx_t_6 = ((__pyx_v_q >= __pyx_v_qual_size) != 0);
if (unlikely(__pyx_t_6)) {
/* "HTSeq/_HTSeq.pyx":943
* q = qual_array[i]
* if(q >= qual_size):
* raise ValueError, "Too large quality value encountered." # <<<<<<<<<<<<<<
* count_array[i, q] += 1
*
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Too_large_quality_value_encounte, 0, 0);
__PYX_ERR(0, 943, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":942
* for i in range(seq_length):
* q = qual_array[i]
* if(q >= qual_size): # <<<<<<<<<<<<<<
* raise ValueError, "Too large quality value encountered."
* count_array[i, q] += 1
*/
}
/* "HTSeq/_HTSeq.pyx":944
* if(q >= qual_size):
* raise ValueError, "Too large quality value encountered."
* count_array[i, q] += 1 # <<<<<<<<<<<<<<
*
* return None
*/
__pyx_t_12 = __pyx_v_i;
__pyx_t_13 = __pyx_v_q;
__pyx_t_11 = -1;
if (__pyx_t_12 < 0) {
__pyx_t_12 += __pyx_pybuffernd_count_array.diminfo[0].shape;
if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
} else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_11 = 0;
if (__pyx_t_13 < 0) {
__pyx_t_13 += __pyx_pybuffernd_count_array.diminfo[1].shape;
if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
} else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_11 = 1;
if (unlikely(__pyx_t_11 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_11);
__PYX_ERR(0, 944, __pyx_L1_error)
}
*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;
}
/* "HTSeq/_HTSeq.pyx":946
* count_array[i, q] += 1
*
* return None # <<<<<<<<<<<<<<
*
* cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":924
* return res
*
* cpdef object add_qual_to_count_array(SequenceWithQualities self, # <<<<<<<<<<<<<<
* numpy.ndarray count_array_):
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.add_qual_to_count_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_count_array);
__Pyx_XDECREF((PyObject *)__pyx_v_qual_array);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array(PyObject *__pyx_v_self, PyObject *__pyx_v_count_array_); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array(PyObject *__pyx_v_self, PyObject *__pyx_v_count_array_) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_qual_to_count_array (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count_array_), __pyx_ptype_5numpy_ndarray, 1, "count_array_", 0))) __PYX_ERR(0, 925, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_12add_qual_to_count_array(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), ((PyArrayObject *)__pyx_v_count_array_));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_12add_qual_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyArrayObject *__pyx_v_count_array_) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("add_qual_to_count_array", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_add_qual_to_count_array(__pyx_v_self, __pyx_v_count_array_, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.add_qual_to_count_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":948
* return None
*
* cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self, # <<<<<<<<<<<<<<
* Sequence pattern, int max_mm_qual=5):
* cdef int seqlen = len(self.seq)
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals *__pyx_optional_args) {
int __pyx_v_max_mm_qual = ((int)5);
int __pyx_v_seqlen;
int __pyx_v_patlen;
int __pyx_v_minlen;
char *__pyx_v_seq_cstr;
char *__pyx_v_pat_cstr;
int __pyx_v_match;
int __pyx_v_i;
int __pyx_v_j;
int __pyx_v_sum_mm_qual;
PyArrayObject *__pyx_v_qual_array = 0;
CYTHON_UNUSED long __pyx_v_num_mismatches;
__Pyx_LocalBuf_ND __pyx_pybuffernd_qual_array;
__Pyx_Buffer __pyx_pybuffer_qual_array;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
Py_ssize_t __pyx_t_8;
int __pyx_t_9;
char *__pyx_t_10;
int __pyx_t_11;
long __pyx_t_12;
long __pyx_t_13;
int __pyx_t_14;
int __pyx_t_15;
int __pyx_t_16;
Py_ssize_t __pyx_t_17;
int __pyx_t_18;
__Pyx_RefNannySetupContext("trim_left_end_with_quals", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_max_mm_qual = __pyx_optional_args->max_mm_qual;
}
}
__pyx_pybuffer_qual_array.pybuffer.buf = NULL;
__pyx_pybuffer_qual_array.refcount = 0;
__pyx_pybuffernd_qual_array.data = NULL;
__pyx_pybuffernd_qual_array.rcbuffer = &__pyx_pybuffer_qual_array;
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trim_left_end_with_quals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_mm_qual); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 948, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
__pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 948, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_pattern));
__Pyx_GIVEREF(((PyObject *)__pyx_v_pattern));
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_pattern));
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 948, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":950
* cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,
* Sequence pattern, int max_mm_qual=5):
* cdef int seqlen = len(self.seq) # <<<<<<<<<<<<<<
* cdef int patlen = len(pattern.seq)
* cdef int minlen
*/
__pyx_t_1 = __pyx_v_self->__pyx_base.seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 950, __pyx_L1_error)
}
__pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 950, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_seqlen = __pyx_t_8;
/* "HTSeq/_HTSeq.pyx":951
* Sequence pattern, int max_mm_qual=5):
* cdef int seqlen = len(self.seq)
* cdef int patlen = len(pattern.seq) # <<<<<<<<<<<<<<
* cdef int minlen
* if seqlen < patlen:
*/
__pyx_t_1 = __pyx_v_pattern->seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 951, __pyx_L1_error)
}
__pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 951, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_patlen = __pyx_t_8;
/* "HTSeq/_HTSeq.pyx":953
* cdef int patlen = len(pattern.seq)
* cdef int minlen
* if seqlen < patlen: # <<<<<<<<<<<<<<
* minlen = seqlen
* else:
*/
__pyx_t_9 = ((__pyx_v_seqlen < __pyx_v_patlen) != 0);
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":954
* cdef int minlen
* if seqlen < patlen:
* minlen = seqlen # <<<<<<<<<<<<<<
* else:
* minlen = patlen
*/
__pyx_v_minlen = __pyx_v_seqlen;
/* "HTSeq/_HTSeq.pyx":953
* cdef int patlen = len(pattern.seq)
* cdef int minlen
* if seqlen < patlen: # <<<<<<<<<<<<<<
* minlen = seqlen
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":956
* minlen = seqlen
* else:
* minlen = patlen # <<<<<<<<<<<<<<
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq
*/
/*else*/ {
__pyx_v_minlen = __pyx_v_patlen;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":957
* else:
* minlen = patlen
* cdef char * seq_cstr = self.seq # <<<<<<<<<<<<<<
* cdef char * pat_cstr = pattern.seq
* cdef int match = 0
*/
if (unlikely(__pyx_v_self->__pyx_base.seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 957, __pyx_L1_error)
}
__pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->__pyx_base.seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L1_error)
__pyx_v_seq_cstr = __pyx_t_10;
/* "HTSeq/_HTSeq.pyx":958
* minlen = patlen
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq # <<<<<<<<<<<<<<
* cdef int match = 0
* cdef int i, j
*/
if (unlikely(__pyx_v_pattern->seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 958, __pyx_L1_error)
}
__pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L1_error)
__pyx_v_pat_cstr = __pyx_t_10;
/* "HTSeq/_HTSeq.pyx":959
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq
* cdef int match = 0 # <<<<<<<<<<<<<<
* cdef int i, j
* cdef int sum_mm_qual
*/
__pyx_v_match = 0;
/* "HTSeq/_HTSeq.pyx":962
* cdef int i, j
* cdef int sum_mm_qual
* if self._qualarr is None: # <<<<<<<<<<<<<<
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
__pyx_t_9 = (__pyx_v_self->_qualarr == Py_None);
__pyx_t_11 = (__pyx_t_9 != 0);
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":963
* cdef int sum_mm_qual
* if self._qualarr is None:
* self._fill_qual_arr() # <<<<<<<<<<<<<<
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
* for i in range(1, minlen + 1):
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":962
* cdef int i, j
* cdef int sum_mm_qual
* if self._qualarr is None: # <<<<<<<<<<<<<<
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
}
/* "HTSeq/_HTSeq.pyx":964
* if self._qualarr is None:
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr # <<<<<<<<<<<<<<
* for i in range(1, minlen + 1):
* num_mismatches = 0
*/
if (!(likely(((__pyx_v_self->_qualarr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->_qualarr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 964, __pyx_L1_error)
__pyx_t_1 = __pyx_v_self->_qualarr;
__Pyx_INCREF(__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_qual_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf = NULL;
__PYX_ERR(0, 964, __pyx_L1_error)
} else {__pyx_pybuffernd_qual_array.diminfo[0].strides = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qual_array.diminfo[0].shape = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.shape[0];
}
}
__pyx_v_qual_array = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":965
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
* for i in range(1, minlen + 1): # <<<<<<<<<<<<<<
* num_mismatches = 0
* for j in range(i):
*/
__pyx_t_12 = (__pyx_v_minlen + 1);
__pyx_t_13 = __pyx_t_12;
for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_13; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
/* "HTSeq/_HTSeq.pyx":966
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
* for i in range(1, minlen + 1):
* num_mismatches = 0 # <<<<<<<<<<<<<<
* for j in range(i):
* if seq_cstr[j] != pat_cstr[patlen - i + j]:
*/
__pyx_v_num_mismatches = 0;
/* "HTSeq/_HTSeq.pyx":967
* for i in range(1, minlen + 1):
* num_mismatches = 0
* for j in range(i): # <<<<<<<<<<<<<<
* if seq_cstr[j] != pat_cstr[patlen - i + j]:
* sum_mm_qual += qual_array[j]
*/
__pyx_t_14 = __pyx_v_i;
__pyx_t_15 = __pyx_t_14;
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
__pyx_v_j = __pyx_t_16;
/* "HTSeq/_HTSeq.pyx":968
* num_mismatches = 0
* for j in range(i):
* if seq_cstr[j] != pat_cstr[patlen - i + j]: # <<<<<<<<<<<<<<
* sum_mm_qual += qual_array[j]
* if sum_mm_qual > max_mm_qual:
*/
__pyx_t_11 = (((__pyx_v_seq_cstr[__pyx_v_j]) != (__pyx_v_pat_cstr[((__pyx_v_patlen - __pyx_v_i) + __pyx_v_j)])) != 0);
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":969
* for j in range(i):
* if seq_cstr[j] != pat_cstr[patlen - i + j]:
* sum_mm_qual += qual_array[j] # <<<<<<<<<<<<<<
* if sum_mm_qual > max_mm_qual:
* break
*/
__pyx_t_17 = __pyx_v_j;
__pyx_t_18 = -1;
if (__pyx_t_17 < 0) {
__pyx_t_17 += __pyx_pybuffernd_qual_array.diminfo[0].shape;
if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 0;
} else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_qual_array.diminfo[0].shape)) __pyx_t_18 = 0;
if (unlikely(__pyx_t_18 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_18);
__PYX_ERR(0, 969, __pyx_L1_error)
}
__pyx_v_sum_mm_qual = (__pyx_v_sum_mm_qual + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qual_array.diminfo[0].strides)));
/* "HTSeq/_HTSeq.pyx":970
* if seq_cstr[j] != pat_cstr[patlen - i + j]:
* sum_mm_qual += qual_array[j]
* if sum_mm_qual > max_mm_qual: # <<<<<<<<<<<<<<
* break
* else:
*/
__pyx_t_11 = ((__pyx_v_sum_mm_qual > __pyx_v_max_mm_qual) != 0);
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":971
* sum_mm_qual += qual_array[j]
* if sum_mm_qual > max_mm_qual:
* break # <<<<<<<<<<<<<<
* else:
* match = i
*/
goto __pyx_L8_break;
/* "HTSeq/_HTSeq.pyx":970
* if seq_cstr[j] != pat_cstr[patlen - i + j]:
* sum_mm_qual += qual_array[j]
* if sum_mm_qual > max_mm_qual: # <<<<<<<<<<<<<<
* break
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":968
* num_mismatches = 0
* for j in range(i):
* if seq_cstr[j] != pat_cstr[patlen - i + j]: # <<<<<<<<<<<<<<
* sum_mm_qual += qual_array[j]
* if sum_mm_qual > max_mm_qual:
*/
}
}
/*else*/ {
/* "HTSeq/_HTSeq.pyx":973
* break
* else:
* match = i # <<<<<<<<<<<<<<
* return self[match: seqlen]
*
*/
__pyx_v_match = __pyx_v_i;
}
__pyx_L8_break:;
}
/* "HTSeq/_HTSeq.pyx":974
* else:
* match = i
* return self[match: seqlen] # <<<<<<<<<<<<<<
*
* cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self,
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), __pyx_v_match, __pyx_v_seqlen, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 974, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":948
* return None
*
* cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self, # <<<<<<<<<<<<<<
* Sequence pattern, int max_mm_qual=5):
* cdef int seqlen = len(self.seq)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.trim_left_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_qual_array);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
int __pyx_v_max_mm_qual;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("trim_left_end_with_quals (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pattern,&__pyx_n_s_max_mm_qual,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pattern)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_mm_qual);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trim_left_end_with_quals") < 0)) __PYX_ERR(0, 948, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_pattern = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)values[0]);
if (values[1]) {
__pyx_v_max_mm_qual = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_max_mm_qual == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 949, __pyx_L3_error)
} else {
__pyx_v_max_mm_qual = ((int)5);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("trim_left_end_with_quals", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 948, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.trim_left_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pattern), __pyx_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 949, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14trim_left_end_with_quals(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_pattern, __pyx_v_max_mm_qual);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14trim_left_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_v_max_mm_qual) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals __pyx_t_2;
__Pyx_RefNannySetupContext("trim_left_end_with_quals", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.max_mm_qual = __pyx_v_max_mm_qual;
__pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities->trim_left_end_with_quals(__pyx_v_self, __pyx_v_pattern, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.trim_left_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":976
* return self[match: seqlen]
*
* cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self, # <<<<<<<<<<<<<<
* Sequence pattern, int max_mm_qual=5):
* cdef int seqlen = len(self.seq)
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals *__pyx_optional_args) {
int __pyx_v_max_mm_qual = ((int)5);
int __pyx_v_seqlen;
int __pyx_v_patlen;
int __pyx_v_minlen;
char *__pyx_v_seq_cstr;
char *__pyx_v_pat_cstr;
int __pyx_v_match;
int __pyx_v_i;
int __pyx_v_j;
int __pyx_v_sum_mm_qual;
PyArrayObject *__pyx_v_qual_array = 0;
__Pyx_LocalBuf_ND __pyx_pybuffernd_qual_array;
__Pyx_Buffer __pyx_pybuffer_qual_array;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
Py_ssize_t __pyx_t_8;
int __pyx_t_9;
char *__pyx_t_10;
int __pyx_t_11;
long __pyx_t_12;
long __pyx_t_13;
int __pyx_t_14;
int __pyx_t_15;
int __pyx_t_16;
Py_ssize_t __pyx_t_17;
int __pyx_t_18;
__Pyx_RefNannySetupContext("trim_right_end_with_quals", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_max_mm_qual = __pyx_optional_args->max_mm_qual;
}
}
__pyx_pybuffer_qual_array.pybuffer.buf = NULL;
__pyx_pybuffer_qual_array.refcount = 0;
__pyx_pybuffernd_qual_array.data = NULL;
__pyx_pybuffernd_qual_array.rcbuffer = &__pyx_pybuffer_qual_array;
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
else {
PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trim_right_end_with_quals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals)) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_mm_qual); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
__pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 976, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_pattern));
__Pyx_GIVEREF(((PyObject *)__pyx_v_pattern));
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_pattern));
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 976, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
if (unlikely(type_dict_guard != tp_dict_version)) {
tp_dict_version = obj_dict_version = 0;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
}
#endif
}
/* "HTSeq/_HTSeq.pyx":978
* cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self,
* Sequence pattern, int max_mm_qual=5):
* cdef int seqlen = len(self.seq) # <<<<<<<<<<<<<<
* cdef int patlen = len(pattern.seq)
* cdef int minlen
*/
__pyx_t_1 = __pyx_v_self->__pyx_base.seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 978, __pyx_L1_error)
}
__pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 978, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_seqlen = __pyx_t_8;
/* "HTSeq/_HTSeq.pyx":979
* Sequence pattern, int max_mm_qual=5):
* cdef int seqlen = len(self.seq)
* cdef int patlen = len(pattern.seq) # <<<<<<<<<<<<<<
* cdef int minlen
* if seqlen < patlen:
*/
__pyx_t_1 = __pyx_v_pattern->seq;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 979, __pyx_L1_error)
}
__pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 979, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_patlen = __pyx_t_8;
/* "HTSeq/_HTSeq.pyx":981
* cdef int patlen = len(pattern.seq)
* cdef int minlen
* if seqlen < patlen: # <<<<<<<<<<<<<<
* minlen = seqlen
* else:
*/
__pyx_t_9 = ((__pyx_v_seqlen < __pyx_v_patlen) != 0);
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":982
* cdef int minlen
* if seqlen < patlen:
* minlen = seqlen # <<<<<<<<<<<<<<
* else:
* minlen = patlen
*/
__pyx_v_minlen = __pyx_v_seqlen;
/* "HTSeq/_HTSeq.pyx":981
* cdef int patlen = len(pattern.seq)
* cdef int minlen
* if seqlen < patlen: # <<<<<<<<<<<<<<
* minlen = seqlen
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":984
* minlen = seqlen
* else:
* minlen = patlen # <<<<<<<<<<<<<<
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq
*/
/*else*/ {
__pyx_v_minlen = __pyx_v_patlen;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":985
* else:
* minlen = patlen
* cdef char * seq_cstr = self.seq # <<<<<<<<<<<<<<
* cdef char * pat_cstr = pattern.seq
* cdef int match = 0
*/
if (unlikely(__pyx_v_self->__pyx_base.seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 985, __pyx_L1_error)
}
__pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->__pyx_base.seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 985, __pyx_L1_error)
__pyx_v_seq_cstr = __pyx_t_10;
/* "HTSeq/_HTSeq.pyx":986
* minlen = patlen
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq # <<<<<<<<<<<<<<
* cdef int match = 0
* cdef int i, j
*/
if (unlikely(__pyx_v_pattern->seq == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 986, __pyx_L1_error)
}
__pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 986, __pyx_L1_error)
__pyx_v_pat_cstr = __pyx_t_10;
/* "HTSeq/_HTSeq.pyx":987
* cdef char * seq_cstr = self.seq
* cdef char * pat_cstr = pattern.seq
* cdef int match = 0 # <<<<<<<<<<<<<<
* cdef int i, j
* cdef int sum_mm_qual
*/
__pyx_v_match = 0;
/* "HTSeq/_HTSeq.pyx":990
* cdef int i, j
* cdef int sum_mm_qual
* if self._qualarr is None: # <<<<<<<<<<<<<<
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
__pyx_t_9 = (__pyx_v_self->_qualarr == Py_None);
__pyx_t_11 = (__pyx_t_9 != 0);
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":991
* cdef int sum_mm_qual
* if self._qualarr is None:
* self._fill_qual_arr() # <<<<<<<<<<<<<<
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
* for i in range(1, minlen + 1):
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":990
* cdef int i, j
* cdef int sum_mm_qual
* if self._qualarr is None: # <<<<<<<<<<<<<<
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
}
/* "HTSeq/_HTSeq.pyx":992
* if self._qualarr is None:
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr # <<<<<<<<<<<<<<
* for i in range(1, minlen + 1):
* sum_mm_qual = 0
*/
if (!(likely(((__pyx_v_self->_qualarr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->_qualarr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 992, __pyx_L1_error)
__pyx_t_1 = __pyx_v_self->_qualarr;
__Pyx_INCREF(__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_qual_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf = NULL;
__PYX_ERR(0, 992, __pyx_L1_error)
} else {__pyx_pybuffernd_qual_array.diminfo[0].strides = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qual_array.diminfo[0].shape = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.shape[0];
}
}
__pyx_v_qual_array = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":993
* self._fill_qual_arr()
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
* for i in range(1, minlen + 1): # <<<<<<<<<<<<<<
* sum_mm_qual = 0
* for j in range(i):
*/
__pyx_t_12 = (__pyx_v_minlen + 1);
__pyx_t_13 = __pyx_t_12;
for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_13; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
/* "HTSeq/_HTSeq.pyx":994
* cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
* for i in range(1, minlen + 1):
* sum_mm_qual = 0 # <<<<<<<<<<<<<<
* for j in range(i):
* if seq_cstr[seqlen - i + j] != pat_cstr[j]:
*/
__pyx_v_sum_mm_qual = 0;
/* "HTSeq/_HTSeq.pyx":995
* for i in range(1, minlen + 1):
* sum_mm_qual = 0
* for j in range(i): # <<<<<<<<<<<<<<
* if seq_cstr[seqlen - i + j] != pat_cstr[j]:
* sum_mm_qual += qual_array[seqlen - i + j]
*/
__pyx_t_14 = __pyx_v_i;
__pyx_t_15 = __pyx_t_14;
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
__pyx_v_j = __pyx_t_16;
/* "HTSeq/_HTSeq.pyx":996
* sum_mm_qual = 0
* for j in range(i):
* if seq_cstr[seqlen - i + j] != pat_cstr[j]: # <<<<<<<<<<<<<<
* sum_mm_qual += qual_array[seqlen - i + j]
* if sum_mm_qual > max_mm_qual:
*/
__pyx_t_11 = (((__pyx_v_seq_cstr[((__pyx_v_seqlen - __pyx_v_i) + __pyx_v_j)]) != (__pyx_v_pat_cstr[__pyx_v_j])) != 0);
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":997
* for j in range(i):
* if seq_cstr[seqlen - i + j] != pat_cstr[j]:
* sum_mm_qual += qual_array[seqlen - i + j] # <<<<<<<<<<<<<<
* if sum_mm_qual > max_mm_qual:
* break
*/
__pyx_t_17 = ((__pyx_v_seqlen - __pyx_v_i) + __pyx_v_j);
__pyx_t_18 = -1;
if (__pyx_t_17 < 0) {
__pyx_t_17 += __pyx_pybuffernd_qual_array.diminfo[0].shape;
if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 0;
} else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_qual_array.diminfo[0].shape)) __pyx_t_18 = 0;
if (unlikely(__pyx_t_18 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_18);
__PYX_ERR(0, 997, __pyx_L1_error)
}
__pyx_v_sum_mm_qual = (__pyx_v_sum_mm_qual + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qual_array.diminfo[0].strides)));
/* "HTSeq/_HTSeq.pyx":998
* if seq_cstr[seqlen - i + j] != pat_cstr[j]:
* sum_mm_qual += qual_array[seqlen - i + j]
* if sum_mm_qual > max_mm_qual: # <<<<<<<<<<<<<<
* break
* else:
*/
__pyx_t_11 = ((__pyx_v_sum_mm_qual > __pyx_v_max_mm_qual) != 0);
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":999
* sum_mm_qual += qual_array[seqlen - i + j]
* if sum_mm_qual > max_mm_qual:
* break # <<<<<<<<<<<<<<
* else:
* match = i
*/
goto __pyx_L8_break;
/* "HTSeq/_HTSeq.pyx":998
* if seq_cstr[seqlen - i + j] != pat_cstr[j]:
* sum_mm_qual += qual_array[seqlen - i + j]
* if sum_mm_qual > max_mm_qual: # <<<<<<<<<<<<<<
* break
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":996
* sum_mm_qual = 0
* for j in range(i):
* if seq_cstr[seqlen - i + j] != pat_cstr[j]: # <<<<<<<<<<<<<<
* sum_mm_qual += qual_array[seqlen - i + j]
* if sum_mm_qual > max_mm_qual:
*/
}
}
/*else*/ {
/* "HTSeq/_HTSeq.pyx":1001
* break
* else:
* match = i # <<<<<<<<<<<<<<
* return self[0: seqlen - match]
*
*/
__pyx_v_match = __pyx_v_i;
}
__pyx_L8_break:;
}
/* "HTSeq/_HTSeq.pyx":1002
* else:
* match = i
* return self[0: seqlen - match] # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, (__pyx_v_seqlen - __pyx_v_match), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 1002, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":976
* return self[match: seqlen]
*
* cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self, # <<<<<<<<<<<<<<
* Sequence pattern, int max_mm_qual=5):
* cdef int seqlen = len(self.seq)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.trim_right_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_qual_array);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
int __pyx_v_max_mm_qual;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("trim_right_end_with_quals (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pattern,&__pyx_n_s_max_mm_qual,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pattern)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_mm_qual);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trim_right_end_with_quals") < 0)) __PYX_ERR(0, 976, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_pattern = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)values[0]);
if (values[1]) {
__pyx_v_max_mm_qual = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_max_mm_qual == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L3_error)
} else {
__pyx_v_max_mm_qual = ((int)5);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("trim_right_end_with_quals", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 976, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.trim_right_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pattern), __pyx_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 977, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_16trim_right_end_with_quals(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_pattern, __pyx_v_max_mm_qual);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_16trim_right_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_v_max_mm_qual) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals __pyx_t_2;
__Pyx_RefNannySetupContext("trim_right_end_with_quals", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.max_mm_qual = __pyx_v_max_mm_qual;
__pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities->trim_right_end_with_quals(__pyx_v_self, __pyx_v_pattern, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.trim_right_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":30
*
* cdef class SequenceWithQualities(Sequence):
* cdef readonly bytes _qualstr # <<<<<<<<<<<<<<
* cdef readonly bytes _qualstr_phred
* cdef readonly str _qualscale
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->_qualstr);
__pyx_r = __pyx_v_self->_qualstr;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":31
* cdef class SequenceWithQualities(Sequence):
* cdef readonly bytes _qualstr
* cdef readonly bytes _qualstr_phred # <<<<<<<<<<<<<<
* cdef readonly str _qualscale
* cdef readonly object _qualarr
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->_qualstr_phred);
__pyx_r = __pyx_v_self->_qualstr_phred;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":32
* cdef readonly bytes _qualstr
* cdef readonly bytes _qualstr_phred
* cdef readonly str _qualscale # <<<<<<<<<<<<<<
* cdef readonly object _qualarr
* cdef _fill_qual_arr(SequenceWithQualities self)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->_qualscale);
__pyx_r = __pyx_v_self->_qualscale;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":33
* cdef readonly bytes _qualstr_phred
* cdef readonly str _qualscale
* cdef readonly object _qualarr # <<<<<<<<<<<<<<
* cdef _fill_qual_arr(SequenceWithQualities self)
* cpdef object add_qual_to_count_array(SequenceWithQualities self, numpy.ndarray count_array_)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->_qualarr);
__pyx_r = __pyx_v_self->_qualarr;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1020
* """
*
* def __init__(self, read, iv): # <<<<<<<<<<<<<<
* self._read = read
* self.iv = iv
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_read = 0;
PyObject *__pyx_v_iv = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read,&__pyx_n_s_iv,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iv)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1020, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1020, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_read = values[0];
__pyx_v_iv = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1020, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.Alignment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self), __pyx_v_read, __pyx_v_iv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment___init__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_read, PyObject *__pyx_v_iv) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
/* "HTSeq/_HTSeq.pyx":1021
*
* def __init__(self, read, iv):
* self._read = read # <<<<<<<<<<<<<<
* self.iv = iv
*
*/
if (!(likely(((__pyx_v_read) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_read, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 1021, __pyx_L1_error)
__pyx_t_1 = __pyx_v_read;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->_read);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_read));
__pyx_v_self->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1022
* def __init__(self, read, iv):
* self._read = read
* self.iv = iv # <<<<<<<<<<<<<<
*
* @property
*/
if (!(likely(((__pyx_v_iv) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_iv, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 1022, __pyx_L1_error)
__pyx_t_1 = __pyx_v_iv;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->iv);
__Pyx_DECREF(((PyObject *)__pyx_v_self->iv));
__pyx_v_self->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1020
* """
*
* def __init__(self, read, iv): # <<<<<<<<<<<<<<
* self._read = read
* self.iv = iv
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Alignment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1025
*
* @property
* def read(self): # <<<<<<<<<<<<<<
* return self._read
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_4read_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_4read_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_4read___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_4read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":1026
* @property
* def read(self):
* return self._read # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->_read));
__pyx_r = ((PyObject *)__pyx_v_self->_read);
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1025
*
* @property
* def read(self): # <<<<<<<<<<<<<<
* return self._read
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1028
* return self._read
*
* def __repr__(self): # <<<<<<<<<<<<<<
* cdef str s
* if self.paired_end:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2__repr__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
PyObject *__pyx_v_s = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
Py_ssize_t __pyx_t_3;
Py_UCS4 __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "HTSeq/_HTSeq.pyx":1030
* def __repr__(self):
* cdef str s
* if self.paired_end: # <<<<<<<<<<<<<<
* s = "Paired-end read"
* else:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_paired_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1030, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":1031
* cdef str s
* if self.paired_end:
* s = "Paired-end read" # <<<<<<<<<<<<<<
* else:
* s = "Read"
*/
__Pyx_INCREF(__pyx_kp_u_Paired_end_read);
__pyx_v_s = __pyx_kp_u_Paired_end_read;
/* "HTSeq/_HTSeq.pyx":1030
* def __repr__(self):
* cdef str s
* if self.paired_end: # <<<<<<<<<<<<<<
* s = "Paired-end read"
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":1033
* s = "Paired-end read"
* else:
* s = "Read" # <<<<<<<<<<<<<<
* if self.aligned:
* return "<%s object: %s '%s' aligned to %s>" % (
*/
/*else*/ {
__Pyx_INCREF(__pyx_n_u_Read);
__pyx_v_s = __pyx_n_u_Read;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":1034
* else:
* s = "Read"
* if self.aligned: # <<<<<<<<<<<<<<
* return "<%s object: %s '%s' aligned to %s>" % (
* self.__class__.__name__, s, self.read.name, str(self.iv))
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_aligned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1034, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":1035
* s = "Read"
* if self.aligned:
* return "<%s object: %s '%s' aligned to %s>" % ( # <<<<<<<<<<<<<<
* self.__class__.__name__, s, self.read.name, str(self.iv))
* else:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = 0;
__pyx_t_4 = 127;
__Pyx_INCREF(__pyx_kp_u__2);
__pyx_t_3 += 1;
__Pyx_GIVEREF(__pyx_kp_u__2);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
/* "HTSeq/_HTSeq.pyx":1036
* if self.aligned:
* return "<%s object: %s '%s' aligned to %s>" % (
* self.__class__.__name__, s, self.read.name, str(self.iv)) # <<<<<<<<<<<<<<
* else:
* return "<%s object: %s '%s', not aligned>" % (
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1036, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
__pyx_t_5 = 0;
__Pyx_INCREF(__pyx_kp_u_object_3);
__pyx_t_3 += 9;
__Pyx_GIVEREF(__pyx_kp_u_object_3);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object_3);
__Pyx_INCREF(__pyx_v_s);
__pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_s) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_s) : __pyx_t_4;
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_s);
__Pyx_GIVEREF(__pyx_v_s);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_s);
__Pyx_INCREF(__pyx_kp_u__29);
__pyx_t_3 += 2;
__Pyx_GIVEREF(__pyx_kp_u__29);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__29);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1036, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5);
__pyx_t_5 = 0;
__Pyx_INCREF(__pyx_kp_u_aligned_to);
__pyx_t_3 += 13;
__Pyx_GIVEREF(__pyx_kp_u_aligned_to);
PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_aligned_to);
__pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self->iv)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_5);
__pyx_t_5 = 0;
__Pyx_INCREF(__pyx_kp_u__17);
__pyx_t_3 += 1;
__Pyx_GIVEREF(__pyx_kp_u__17);
PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__17);
/* "HTSeq/_HTSeq.pyx":1035
* s = "Read"
* if self.aligned:
* return "<%s object: %s '%s' aligned to %s>" % ( # <<<<<<<<<<<<<<
* self.__class__.__name__, s, self.read.name, str(self.iv))
* else:
*/
__pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1035, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1034
* else:
* s = "Read"
* if self.aligned: # <<<<<<<<<<<<<<
* return "<%s object: %s '%s' aligned to %s>" % (
* self.__class__.__name__, s, self.read.name, str(self.iv))
*/
}
/* "HTSeq/_HTSeq.pyx":1038
* self.__class__.__name__, s, self.read.name, str(self.iv))
* else:
* return "<%s object: %s '%s', not aligned>" % ( # <<<<<<<<<<<<<<
* self.__class__.__name__, s, self.read.name)
*
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1038, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_4 = 127;
__Pyx_INCREF(__pyx_kp_u__2);
__pyx_t_3 += 1;
__Pyx_GIVEREF(__pyx_kp_u__2);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u__2);
/* "HTSeq/_HTSeq.pyx":1039
* else:
* return "<%s object: %s '%s', not aligned>" % (
* self.__class__.__name__, s, self.read.name) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_4;
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
__pyx_t_1 = 0;
__Pyx_INCREF(__pyx_kp_u_object_3);
__pyx_t_3 += 9;
__Pyx_GIVEREF(__pyx_kp_u_object_3);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_object_3);
__Pyx_INCREF(__pyx_v_s);
__pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_s) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_s) : __pyx_t_4;
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_s);
__Pyx_GIVEREF(__pyx_v_s);
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_s);
__Pyx_INCREF(__pyx_kp_u__29);
__pyx_t_3 += 2;
__Pyx_GIVEREF(__pyx_kp_u__29);
PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__29);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_4;
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1);
__pyx_t_1 = 0;
__Pyx_INCREF(__pyx_kp_u_not_aligned);
__pyx_t_3 += 15;
__Pyx_GIVEREF(__pyx_kp_u_not_aligned);
PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_kp_u_not_aligned);
/* "HTSeq/_HTSeq.pyx":1038
* self.__class__.__name__, s, self.read.name, str(self.iv))
* else:
* return "<%s object: %s '%s', not aligned>" % ( # <<<<<<<<<<<<<<
* self.__class__.__name__, s, self.read.name)
*
*/
__pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_5, 7, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
}
/* "HTSeq/_HTSeq.pyx":1028
* return self._read
*
* def __repr__(self): # <<<<<<<<<<<<<<
* cdef str s
* if self.paired_end:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("HTSeq._HTSeq.Alignment.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_s);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1042
*
* @property
* def paired_end(self): # <<<<<<<<<<<<<<
* return False
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_10paired_end_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_10paired_end_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_10paired_end___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_10paired_end___get__(CYTHON_UNUSED struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":1043
* @property
* def paired_end(self):
* return False # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1042
*
* @property
* def paired_end(self): # <<<<<<<<<<<<<<
* return False
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1046
*
* @property
* def aligned(self): # <<<<<<<<<<<<<<
* """Returns True unless self.iv is None. The latter indicates that
* this record decribes a read for which no alignment was found.
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_7aligned_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_7aligned_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_7aligned___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_7aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":1050
* this record decribes a read for which no alignment was found.
* """
* return self.iv is not None # <<<<<<<<<<<<<<
*
* cdef class AlignmentWithSequenceReversal(Alignment):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = (((PyObject *)__pyx_v_self->iv) != Py_None);
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1046
*
* @property
* def aligned(self): # <<<<<<<<<<<<<<
* """Returns True unless self.iv is None. The latter indicates that
* this record decribes a read for which no alignment was found.
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("HTSeq._HTSeq.Alignment.aligned.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":43
*
* cdef class Alignment(object):
* cdef public SequenceWithQualities _read # <<<<<<<<<<<<<<
* cdef public GenomicInterval iv
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->_read));
__pyx_r = ((PyObject *)__pyx_v_self->_read);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(1, 43, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->_read);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_read));
__pyx_v_self->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Alignment._read.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->_read);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_read));
__pyx_v_self->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":44
* cdef class Alignment(object):
* cdef public SequenceWithQualities _read
* cdef public GenomicInterval iv # <<<<<<<<<<<<<<
*
* cdef class AlignmentWithSequenceReversal(Alignment):
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->iv));
__pyx_r = ((PyObject *)__pyx_v_self->iv);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(1, 44, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->iv);
__Pyx_DECREF(((PyObject *)__pyx_v_self->iv));
__pyx_v_self->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Alignment.iv.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->iv);
__Pyx_DECREF(((PyObject *)__pyx_v_self->iv));
__pyx_v_self->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_4__reduce_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_4__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
PyObject *__pyx_v_state = 0;
PyObject *__pyx_v__dict = 0;
int __pyx_v_use_setstate;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__reduce_cython__", 0);
/* "(tree fragment)":5
* cdef object _dict
* cdef bint use_setstate
* state = (self._read, self.iv) # <<<<<<<<<<<<<<
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
*/
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self->_read));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->_read));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->_read));
__Pyx_INCREF(((PyObject *)__pyx_v_self->iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->iv));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->iv));
__pyx_v_state = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "(tree fragment)":6
* cdef bint use_setstate
* state = (self._read, self.iv)
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
* if _dict is not None:
* state += (_dict,)
*/
__pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v__dict = __pyx_t_1;
__pyx_t_1 = 0;
/* "(tree fragment)":7
* state = (self._read, self.iv)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
__pyx_t_2 = (__pyx_v__dict != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "(tree fragment)":8
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
* state += (_dict,) # <<<<<<<<<<<<<<
* use_setstate = True
* else:
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v__dict);
__Pyx_GIVEREF(__pyx_v__dict);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
__pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
__pyx_t_4 = 0;
/* "(tree fragment)":9
* if _dict is not None:
* state += (_dict,)
* use_setstate = True # <<<<<<<<<<<<<<
* else:
* use_setstate = self._read is not None or self.iv is not None
*/
__pyx_v_use_setstate = 1;
/* "(tree fragment)":7
* state = (self._read, self.iv)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
goto __pyx_L3;
}
/* "(tree fragment)":11
* use_setstate = True
* else:
* use_setstate = self._read is not None or self.iv is not None # <<<<<<<<<<<<<<
* if use_setstate:
* return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, None), state
*/
/*else*/ {
__pyx_t_2 = (((PyObject *)__pyx_v_self->_read) != Py_None);
__pyx_t_5 = (__pyx_t_2 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)__pyx_v_self->iv) != Py_None);
__pyx_t_2 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
__pyx_v_use_setstate = __pyx_t_3;
}
__pyx_L3:;
/* "(tree fragment)":12
* else:
* use_setstate = self._read is not None or self.iv is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, None), state
* else:
*/
__pyx_t_3 = (__pyx_v_use_setstate != 0);
if (__pyx_t_3) {
/* "(tree fragment)":13
* use_setstate = self._read is not None or self.iv is not None
* if use_setstate:
* return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, None), state # <<<<<<<<<<<<<<
* else:
* return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, state)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Alignment); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_INCREF(__pyx_int_125566450);
__Pyx_GIVEREF(__pyx_int_125566450);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_125566450);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
__pyx_t_4 = 0;
__pyx_t_1 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "(tree fragment)":12
* else:
* use_setstate = self._read is not None or self.iv is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, None), state
* else:
*/
}
/* "(tree fragment)":15
* return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, None), state
* else:
* return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, state) # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_Alignment__set_state(self, __pyx_state)
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_Alignment); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_INCREF(__pyx_int_125566450);
__Pyx_GIVEREF(__pyx_int_125566450);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_125566450);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__pyx_t_6 = 0;
__pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("HTSeq._HTSeq.Alignment.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_state);
__Pyx_XDECREF(__pyx_v__dict);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_Alignment__set_state(self, __pyx_state)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_6__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_6__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__setstate_cython__", 0);
/* "(tree fragment)":17
* return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, state)
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_Alignment__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_Alignment__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_Alignment__set_state(self, __pyx_state)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.Alignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1063
* """
*
* def __init__(self, SequenceWithQualities read_as_aligned, GenomicInterval iv): # <<<<<<<<<<<<<<
* self.read_as_aligned = read_as_aligned
* self._read_as_sequenced = None
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_read_as_aligned = 0;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read_as_aligned,&__pyx_n_s_iv,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read_as_aligned)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iv)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1063, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1063, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)values[0]);
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1063, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read_as_aligned), __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, 1, "read_as_aligned", 0))) __PYX_ERR(0, 1063, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 1063, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self), __pyx_v_read_as_aligned, __pyx_v_iv);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal___init__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_read_as_aligned, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
/* "HTSeq/_HTSeq.pyx":1064
*
* def __init__(self, SequenceWithQualities read_as_aligned, GenomicInterval iv):
* self.read_as_aligned = read_as_aligned # <<<<<<<<<<<<<<
* self._read_as_sequenced = None
* self.iv = iv
*/
__Pyx_INCREF(((PyObject *)__pyx_v_read_as_aligned));
__Pyx_GIVEREF(((PyObject *)__pyx_v_read_as_aligned));
__Pyx_GOTREF(__pyx_v_self->read_as_aligned);
__Pyx_DECREF(((PyObject *)__pyx_v_self->read_as_aligned));
__pyx_v_self->read_as_aligned = __pyx_v_read_as_aligned;
/* "HTSeq/_HTSeq.pyx":1065
* def __init__(self, SequenceWithQualities read_as_aligned, GenomicInterval iv):
* self.read_as_aligned = read_as_aligned
* self._read_as_sequenced = None # <<<<<<<<<<<<<<
* self.iv = iv
*
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->_read_as_sequenced);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
__pyx_v_self->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None);
/* "HTSeq/_HTSeq.pyx":1066
* self.read_as_aligned = read_as_aligned
* self._read_as_sequenced = None
* self.iv = iv # <<<<<<<<<<<<<<
*
* property read:
*/
__Pyx_INCREF(((PyObject *)__pyx_v_iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
__Pyx_GOTREF(__pyx_v_self->__pyx_base.iv);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.iv));
__pyx_v_self->__pyx_base.iv = __pyx_v_iv;
/* "HTSeq/_HTSeq.pyx":1063
* """
*
* def __init__(self, SequenceWithQualities read_as_aligned, GenomicInterval iv): # <<<<<<<<<<<<<<
* self.read_as_aligned = read_as_aligned
* self._read_as_sequenced = None
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1069
*
* property read:
* def __get__(self): # <<<<<<<<<<<<<<
* if self._read_as_sequenced is None:
* if (not self.aligned) or self.iv.strand != "-":
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":1070
* property read:
* def __get__(self):
* if self._read_as_sequenced is None: # <<<<<<<<<<<<<<
* if (not self.aligned) or self.iv.strand != "-":
* self._read_as_sequenced = self.read_as_aligned
*/
__pyx_t_1 = (((PyObject *)__pyx_v_self->_read_as_sequenced) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":1071
* def __get__(self):
* if self._read_as_sequenced is None:
* if (not self.aligned) or self.iv.strand != "-": # <<<<<<<<<<<<<<
* self._read_as_sequenced = self.read_as_aligned
* else:
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_aligned); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1071, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = ((!__pyx_t_1) != 0);
if (!__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__20, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1071, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_2 = __pyx_t_4;
__pyx_L5_bool_binop_done:;
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":1072
* if self._read_as_sequenced is None:
* if (not self.aligned) or self.iv.strand != "-":
* self._read_as_sequenced = self.read_as_aligned # <<<<<<<<<<<<<<
* else:
* self._read_as_sequenced = self.read_as_aligned.get_reverse_complement()
*/
__pyx_t_3 = ((PyObject *)__pyx_v_self->read_as_aligned);
__Pyx_INCREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->_read_as_sequenced);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
__pyx_v_self->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_3);
__pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":1071
* def __get__(self):
* if self._read_as_sequenced is None:
* if (not self.aligned) or self.iv.strand != "-": # <<<<<<<<<<<<<<
* self._read_as_sequenced = self.read_as_aligned
* else:
*/
goto __pyx_L4;
}
/* "HTSeq/_HTSeq.pyx":1074
* self._read_as_sequenced = self.read_as_aligned
* else:
* self._read_as_sequenced = self.read_as_aligned.get_reverse_complement() # <<<<<<<<<<<<<<
* self._read_as_sequenced.name = self.read_as_aligned.name
* return self._read_as_sequenced
*/
/*else*/ {
__pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->read_as_aligned->__pyx_base.__pyx_vtab)->get_reverse_complement(__pyx_v_self->read_as_aligned, 0, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->_read_as_sequenced);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
__pyx_v_self->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_3);
__pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":1075
* else:
* self._read_as_sequenced = self.read_as_aligned.get_reverse_complement()
* self._read_as_sequenced.name = self.read_as_aligned.name # <<<<<<<<<<<<<<
* return self._read_as_sequenced
* # def __set__( self, read ):
*/
__pyx_t_3 = __pyx_v_self->read_as_aligned->__pyx_base.name;
__Pyx_INCREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->_read_as_sequenced->__pyx_base.name);
__Pyx_DECREF(__pyx_v_self->_read_as_sequenced->__pyx_base.name);
__pyx_v_self->_read_as_sequenced->__pyx_base.name = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
}
__pyx_L4:;
/* "HTSeq/_HTSeq.pyx":1070
* property read:
* def __get__(self):
* if self._read_as_sequenced is None: # <<<<<<<<<<<<<<
* if (not self.aligned) or self.iv.strand != "-":
* self._read_as_sequenced = self.read_as_aligned
*/
}
/* "HTSeq/_HTSeq.pyx":1076
* self._read_as_sequenced = self.read_as_aligned.get_reverse_complement()
* self._read_as_sequenced.name = self.read_as_aligned.name
* return self._read_as_sequenced # <<<<<<<<<<<<<<
* # def __set__( self, read ):
* # self.read_as_aligned = read
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
__pyx_r = ((PyObject *)__pyx_v_self->_read_as_sequenced);
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1069
*
* property read:
* def __get__(self): # <<<<<<<<<<<<<<
* if self._read_as_sequenced is None:
* if (not self.aligned) or self.iv.strand != "-":
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal.read.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":47
*
* cdef class AlignmentWithSequenceReversal(Alignment):
* cdef public SequenceWithQualities read_as_aligned # <<<<<<<<<<<<<<
* cdef public SequenceWithQualities _read_as_sequenced
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->read_as_aligned));
__pyx_r = ((PyObject *)__pyx_v_self->read_as_aligned);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(1, 47, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->read_as_aligned);
__Pyx_DECREF(((PyObject *)__pyx_v_self->read_as_aligned));
__pyx_v_self->read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal.read_as_aligned.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->read_as_aligned);
__Pyx_DECREF(((PyObject *)__pyx_v_self->read_as_aligned));
__pyx_v_self->read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":48
* cdef class AlignmentWithSequenceReversal(Alignment):
* cdef public SequenceWithQualities read_as_aligned
* cdef public SequenceWithQualities _read_as_sequenced # <<<<<<<<<<<<<<
*
* cdef class SAM_Alignment(AlignmentWithSequenceReversal):
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
__pyx_r = ((PyObject *)__pyx_v_self->_read_as_sequenced);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(1, 48, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->_read_as_sequenced);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
__pyx_v_self->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal._read_as_sequenced.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->_read_as_sequenced);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
__pyx_v_self->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_2__reduce_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_2__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
PyObject *__pyx_v_state = 0;
PyObject *__pyx_v__dict = 0;
int __pyx_v_use_setstate;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__reduce_cython__", 0);
/* "(tree fragment)":5
* cdef object _dict
* cdef bint use_setstate
* state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned) # <<<<<<<<<<<<<<
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
*/
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base._read));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base._read));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->__pyx_base._read));
__Pyx_INCREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->_read_as_sequenced));
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.iv));
PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->__pyx_base.iv));
__Pyx_INCREF(((PyObject *)__pyx_v_self->read_as_aligned));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->read_as_aligned));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_self->read_as_aligned));
__pyx_v_state = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "(tree fragment)":6
* cdef bint use_setstate
* state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned)
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
* if _dict is not None:
* state += (_dict,)
*/
__pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v__dict = __pyx_t_1;
__pyx_t_1 = 0;
/* "(tree fragment)":7
* state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
__pyx_t_2 = (__pyx_v__dict != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "(tree fragment)":8
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
* state += (_dict,) # <<<<<<<<<<<<<<
* use_setstate = True
* else:
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v__dict);
__Pyx_GIVEREF(__pyx_v__dict);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
__pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
__pyx_t_4 = 0;
/* "(tree fragment)":9
* if _dict is not None:
* state += (_dict,)
* use_setstate = True # <<<<<<<<<<<<<<
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None
*/
__pyx_v_use_setstate = 1;
/* "(tree fragment)":7
* state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
goto __pyx_L3;
}
/* "(tree fragment)":11
* use_setstate = True
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None # <<<<<<<<<<<<<<
* if use_setstate:
* return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, None), state
*/
/*else*/ {
__pyx_t_2 = (((PyObject *)__pyx_v_self->__pyx_base._read) != Py_None);
__pyx_t_5 = (__pyx_t_2 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)__pyx_v_self->_read_as_sequenced) != Py_None);
__pyx_t_2 = (__pyx_t_5 != 0);
if (!__pyx_t_2) {
} else {
__pyx_t_3 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = (((PyObject *)__pyx_v_self->__pyx_base.iv) != Py_None);
__pyx_t_5 = (__pyx_t_2 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)__pyx_v_self->read_as_aligned) != Py_None);
__pyx_t_2 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
__pyx_v_use_setstate = __pyx_t_3;
}
__pyx_L3:;
/* "(tree fragment)":12
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, None), state
* else:
*/
__pyx_t_3 = (__pyx_v_use_setstate != 0);
if (__pyx_t_3) {
/* "(tree fragment)":13
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None
* if use_setstate:
* return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, None), state # <<<<<<<<<<<<<<
* else:
* return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, state)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_AlignmentWithSequ); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_INCREF(__pyx_int_28831487);
__Pyx_GIVEREF(__pyx_int_28831487);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_28831487);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
__pyx_t_4 = 0;
__pyx_t_1 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "(tree fragment)":12
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, None), state
* else:
*/
}
/* "(tree fragment)":15
* return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, None), state
* else:
* return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, state) # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state)
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_AlignmentWithSequ); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_INCREF(__pyx_int_28831487);
__Pyx_GIVEREF(__pyx_int_28831487);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_28831487);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__pyx_t_6 = 0;
__pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_state);
__Pyx_XDECREF(__pyx_v__dict);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__setstate_cython__", 0);
/* "(tree fragment)":17
* return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, state)
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_AlignmentWithSequenceReversal__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1095
* cdef public str substitutions
*
* def __init__(self, bowtie_line): # <<<<<<<<<<<<<<
* cdef str readId, strand, chrom, position, read, qual
* cdef int positionint
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_bowtie_line = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bowtie_line,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bowtie_line)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_bowtie_line = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self), __pyx_v_bowtie_line);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment___init__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_bowtie_line) {
PyObject *__pyx_v_readId = 0;
PyObject *__pyx_v_strand = 0;
PyObject *__pyx_v_chrom = 0;
PyObject *__pyx_v_position = 0;
PyObject *__pyx_v_read = 0;
PyObject *__pyx_v_qual = 0;
int __pyx_v_positionint;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *(*__pyx_t_11)(PyObject *);
int __pyx_t_12;
Py_ssize_t __pyx_t_13;
__Pyx_RefNannySetupContext("__init__", 0);
/* "HTSeq/_HTSeq.pyx":1099
* cdef int positionint
* (readId, strand, chrom, position, read, qual,
* self.reserved, self.substitutions) = bowtie_line.split('\t') # <<<<<<<<<<<<<<
* positionint = int(position)
* AlignmentWithSequenceReversal.__init__(self,
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_bowtie_line, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u__21) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u__21);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 8)) {
if (size > 8) __Pyx_RaiseTooManyValuesError(8);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 1098, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 4);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 5);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 6);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 7);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_4 = PyList_GET_ITEM(sequence, 2);
__pyx_t_5 = PyList_GET_ITEM(sequence, 3);
__pyx_t_6 = PyList_GET_ITEM(sequence, 4);
__pyx_t_7 = PyList_GET_ITEM(sequence, 5);
__pyx_t_8 = PyList_GET_ITEM(sequence, 6);
__pyx_t_9 = PyList_GET_ITEM(sequence, 7);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
#else
{
Py_ssize_t i;
PyObject** temps[8] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
for (i=0; i < 8; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1098, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
PyObject** temps[8] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
__pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1098, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
for (index=0; index < 8; index++) {
PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 8) < 0) __PYX_ERR(0, 1098, __pyx_L1_error)
__pyx_t_11 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L4_unpacking_done;
__pyx_L3_unpacking_failed:;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 1098, __pyx_L1_error)
__pyx_L4_unpacking_done:;
}
/* "HTSeq/_HTSeq.pyx":1098
* cdef str readId, strand, chrom, position, read, qual
* cdef int positionint
* (readId, strand, chrom, position, read, qual, # <<<<<<<<<<<<<<
* self.reserved, self.substitutions) = bowtie_line.split('\t')
* positionint = int(position)
*/
if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_9)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
__pyx_v_readId = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
__pyx_v_strand = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
__pyx_v_chrom = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
__pyx_v_position = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
__pyx_v_read = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
__pyx_v_qual = ((PyObject*)__pyx_t_7);
__pyx_t_7 = 0;
/* "HTSeq/_HTSeq.pyx":1099
* cdef int positionint
* (readId, strand, chrom, position, read, qual,
* self.reserved, self.substitutions) = bowtie_line.split('\t') # <<<<<<<<<<<<<<
* positionint = int(position)
* AlignmentWithSequenceReversal.__init__(self,
*/
__Pyx_GIVEREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_v_self->reserved);
__Pyx_DECREF(__pyx_v_self->reserved);
__pyx_v_self->reserved = ((PyObject*)__pyx_t_8);
__pyx_t_8 = 0;
__Pyx_GIVEREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_v_self->substitutions);
__Pyx_DECREF(__pyx_v_self->substitutions);
__pyx_v_self->substitutions = ((PyObject*)__pyx_t_9);
__pyx_t_9 = 0;
/* "HTSeq/_HTSeq.pyx":1100
* (readId, strand, chrom, position, read, qual,
* self.reserved, self.substitutions) = bowtie_line.split('\t')
* positionint = int(position) # <<<<<<<<<<<<<<
* AlignmentWithSequenceReversal.__init__(self,
* SequenceWithQualities(
*/
__pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_positionint = __pyx_t_12;
/* "HTSeq/_HTSeq.pyx":1101
* self.reserved, self.substitutions) = bowtie_line.split('\t')
* positionint = int(position)
* AlignmentWithSequenceReversal.__init__(self, # <<<<<<<<<<<<<<
* SequenceWithQualities(
* read, readId, qual),
*/
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal), __pyx_n_s_init); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
/* "HTSeq/_HTSeq.pyx":1102
* positionint = int(position)
* AlignmentWithSequenceReversal.__init__(self,
* SequenceWithQualities( # <<<<<<<<<<<<<<
* read, readId, qual),
* GenomicInterval(chrom, positionint, positionint + len(read), strand))
*/
__pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_read);
__Pyx_GIVEREF(__pyx_v_read);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_read);
__Pyx_INCREF(__pyx_v_readId);
__Pyx_GIVEREF(__pyx_v_readId);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_readId);
__Pyx_INCREF(__pyx_v_qual);
__Pyx_GIVEREF(__pyx_v_qual);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_qual);
__pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "HTSeq/_HTSeq.pyx":1104
* SequenceWithQualities(
* read, readId, qual),
* GenomicInterval(chrom, positionint, positionint + len(read), strand)) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_positionint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (unlikely(__pyx_v_read == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 1104, __pyx_L1_error)
}
__pyx_t_13 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_read); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1104, __pyx_L1_error)
__pyx_t_6 = PyInt_FromSsize_t((__pyx_v_positionint + __pyx_t_13)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_strand);
__pyx_t_8 = 0;
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_12 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_9, function);
__pyx_t_12 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_9)) {
PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_7, __pyx_t_6};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_7, __pyx_t_6};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
__pyx_t_8 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_12, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_12, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_12, __pyx_t_6);
__pyx_t_7 = 0;
__pyx_t_6 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1095
* cdef public str substitutions
*
* def __init__(self, bowtie_line): # <<<<<<<<<<<<<<
* cdef str readId, strand, chrom, position, read, qual
* cdef int positionint
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_readId);
__Pyx_XDECREF(__pyx_v_strand);
__Pyx_XDECREF(__pyx_v_chrom);
__Pyx_XDECREF(__pyx_v_position);
__Pyx_XDECREF(__pyx_v_read);
__Pyx_XDECREF(__pyx_v_qual);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1092
* """
*
* cdef public str reserved # <<<<<<<<<<<<<<
* cdef public str substitutions
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved___get__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->reserved);
__pyx_r = __pyx_v_self->reserved;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1092, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->reserved);
__Pyx_DECREF(__pyx_v_self->reserved);
__pyx_v_self->reserved = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.reserved.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->reserved);
__Pyx_DECREF(__pyx_v_self->reserved);
__pyx_v_self->reserved = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1093
*
* cdef public str reserved
* cdef public str substitutions # <<<<<<<<<<<<<<
*
* def __init__(self, bowtie_line):
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions___get__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->substitutions);
__pyx_r = __pyx_v_self->substitutions;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1093, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->substitutions);
__Pyx_DECREF(__pyx_v_self->substitutions);
__pyx_v_self->substitutions = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.substitutions.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->substitutions);
__Pyx_DECREF(__pyx_v_self->substitutions);
__pyx_v_self->substitutions = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_2__reduce_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_2__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self) {
PyObject *__pyx_v_state = 0;
PyObject *__pyx_v__dict = 0;
int __pyx_v_use_setstate;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__reduce_cython__", 0);
/* "(tree fragment)":5
* cdef object _dict
* cdef bint use_setstate
* state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned, self.reserved, self.substitutions) # <<<<<<<<<<<<<<
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
*/
__pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read));
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
__Pyx_INCREF(__pyx_v_self->reserved);
__Pyx_GIVEREF(__pyx_v_self->reserved);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_self->reserved);
__Pyx_INCREF(__pyx_v_self->substitutions);
__Pyx_GIVEREF(__pyx_v_self->substitutions);
PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_self->substitutions);
__pyx_v_state = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "(tree fragment)":6
* cdef bint use_setstate
* state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned, self.reserved, self.substitutions)
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
* if _dict is not None:
* state += (_dict,)
*/
__pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v__dict = __pyx_t_1;
__pyx_t_1 = 0;
/* "(tree fragment)":7
* state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned, self.reserved, self.substitutions)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
__pyx_t_2 = (__pyx_v__dict != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "(tree fragment)":8
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
* state += (_dict,) # <<<<<<<<<<<<<<
* use_setstate = True
* else:
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v__dict);
__Pyx_GIVEREF(__pyx_v__dict);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
__pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
__pyx_t_4 = 0;
/* "(tree fragment)":9
* if _dict is not None:
* state += (_dict,)
* use_setstate = True # <<<<<<<<<<<<<<
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None or self.reserved is not None or self.substitutions is not None
*/
__pyx_v_use_setstate = 1;
/* "(tree fragment)":7
* state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned, self.reserved, self.substitutions)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
goto __pyx_L3;
}
/* "(tree fragment)":11
* use_setstate = True
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None or self.reserved is not None or self.substitutions is not None # <<<<<<<<<<<<<<
* if use_setstate:
* return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, None), state
*/
/*else*/ {
__pyx_t_2 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read) != Py_None);
__pyx_t_5 = (__pyx_t_2 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced) != Py_None);
__pyx_t_2 = (__pyx_t_5 != 0);
if (!__pyx_t_2) {
} else {
__pyx_t_3 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv) != Py_None);
__pyx_t_5 = (__pyx_t_2 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned) != Py_None);
__pyx_t_2 = (__pyx_t_5 != 0);
if (!__pyx_t_2) {
} else {
__pyx_t_3 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = (__pyx_v_self->reserved != ((PyObject*)Py_None));
__pyx_t_5 = (__pyx_t_2 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = (__pyx_v_self->substitutions != ((PyObject*)Py_None));
__pyx_t_2 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
__pyx_v_use_setstate = __pyx_t_3;
}
__pyx_L3:;
/* "(tree fragment)":12
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None or self.reserved is not None or self.substitutions is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, None), state
* else:
*/
__pyx_t_3 = (__pyx_v_use_setstate != 0);
if (__pyx_t_3) {
/* "(tree fragment)":13
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None or self.reserved is not None or self.substitutions is not None
* if use_setstate:
* return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, None), state # <<<<<<<<<<<<<<
* else:
* return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, state)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_BowtieAlignment); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_INCREF(__pyx_int_75678070);
__Pyx_GIVEREF(__pyx_int_75678070);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_75678070);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
__pyx_t_4 = 0;
__pyx_t_1 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "(tree fragment)":12
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None or self.reserved is not None or self.substitutions is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, None), state
* else:
*/
}
/* "(tree fragment)":15
* return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, None), state
* else:
* return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, state) # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state)
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_BowtieAlignment); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_INCREF(__pyx_int_75678070);
__Pyx_GIVEREF(__pyx_int_75678070);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_75678070);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__pyx_t_6 = 0;
__pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_state);
__Pyx_XDECREF(__pyx_v__dict);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_4__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_4__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__setstate_cython__", 0);
/* "(tree fragment)":17
* return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, state)
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_BowtieAlignment__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1125
* cdef public int query_from, query_to
*
* def __init__(self, str type_, int size, int rfrom, int rto, int qfrom, # <<<<<<<<<<<<<<
* int qto, str chrom, str strand, bint check=True):
* self.type = type_
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_type_ = 0;
int __pyx_v_size;
int __pyx_v_rfrom;
int __pyx_v_rto;
int __pyx_v_qfrom;
int __pyx_v_qto;
PyObject *__pyx_v_chrom = 0;
PyObject *__pyx_v_strand = 0;
int __pyx_v_check;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_size,&__pyx_n_s_rfrom,&__pyx_n_s_rto,&__pyx_n_s_qfrom,&__pyx_n_s_qto,&__pyx_n_s_chrom,&__pyx_n_s_strand,&__pyx_n_s_check,0};
PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
CYTHON_FALLTHROUGH;
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
CYTHON_FALLTHROUGH;
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
CYTHON_FALLTHROUGH;
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 1); __PYX_ERR(0, 1125, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rfrom)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 2); __PYX_ERR(0, 1125, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rto)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 3); __PYX_ERR(0, 1125, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 4:
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qfrom)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 4); __PYX_ERR(0, 1125, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 5:
if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qto)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 5); __PYX_ERR(0, 1125, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 6:
if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 6); __PYX_ERR(0, 1125, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 7:
if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 7); __PYX_ERR(0, 1125, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 8:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_check);
if (value) { values[8] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1125, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
CYTHON_FALLTHROUGH;
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_type_ = ((PyObject*)values[0]);
__pyx_v_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1125, __pyx_L3_error)
__pyx_v_rfrom = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_rfrom == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1125, __pyx_L3_error)
__pyx_v_rto = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_rto == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1125, __pyx_L3_error)
__pyx_v_qfrom = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_qfrom == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1125, __pyx_L3_error)
__pyx_v_qto = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_qto == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L3_error)
__pyx_v_chrom = ((PyObject*)values[6]);
__pyx_v_strand = ((PyObject*)values[7]);
if (values[8]) {
__pyx_v_check = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_check == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L3_error)
} else {
/* "HTSeq/_HTSeq.pyx":1126
*
* def __init__(self, str type_, int size, int rfrom, int rto, int qfrom,
* int qto, str chrom, str strand, bint check=True): # <<<<<<<<<<<<<<
* self.type = type_
* self.size = size
*/
__pyx_v_check = ((int)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1125, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type_), (&PyUnicode_Type), 1, "type_", 1))) __PYX_ERR(0, 1125, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 1126, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 1126, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), __pyx_v_type_, __pyx_v_size, __pyx_v_rfrom, __pyx_v_rto, __pyx_v_qfrom, __pyx_v_qto, __pyx_v_chrom, __pyx_v_strand, __pyx_v_check);
/* "HTSeq/_HTSeq.pyx":1125
* cdef public int query_from, query_to
*
* def __init__(self, str type_, int size, int rfrom, int rto, int qfrom, # <<<<<<<<<<<<<<
* int qto, str chrom, str strand, bint check=True):
* self.type = type_
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation___init__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_type_, int __pyx_v_size, int __pyx_v_rfrom, int __pyx_v_rto, int __pyx_v_qfrom, int __pyx_v_qto, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand, int __pyx_v_check) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
__Pyx_RefNannySetupContext("__init__", 0);
/* "HTSeq/_HTSeq.pyx":1127
* def __init__(self, str type_, int size, int rfrom, int rto, int qfrom,
* int qto, str chrom, str strand, bint check=True):
* self.type = type_ # <<<<<<<<<<<<<<
* self.size = size
* self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand)
*/
__Pyx_INCREF(__pyx_v_type_);
__Pyx_GIVEREF(__pyx_v_type_);
__Pyx_GOTREF(__pyx_v_self->type);
__Pyx_DECREF(__pyx_v_self->type);
__pyx_v_self->type = __pyx_v_type_;
/* "HTSeq/_HTSeq.pyx":1128
* int qto, str chrom, str strand, bint check=True):
* self.type = type_
* self.size = size # <<<<<<<<<<<<<<
* self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand)
* self.query_from = qfrom
*/
__pyx_v_self->size = __pyx_v_size;
/* "HTSeq/_HTSeq.pyx":1129
* self.type = type_
* self.size = size
* self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand) # <<<<<<<<<<<<<<
* self.query_from = qfrom
* self.query_to = qto
*/
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rfrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rto); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_strand);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->ref_iv);
__Pyx_DECREF(((PyObject *)__pyx_v_self->ref_iv));
__pyx_v_self->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1130
* self.size = size
* self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand)
* self.query_from = qfrom # <<<<<<<<<<<<<<
* self.query_to = qto
* if check and not self.check():
*/
__pyx_v_self->query_from = __pyx_v_qfrom;
/* "HTSeq/_HTSeq.pyx":1131
* self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand)
* self.query_from = qfrom
* self.query_to = qto # <<<<<<<<<<<<<<
* if check and not self.check():
* raise ValueError, "Inconsistent CIGAR operation."
*/
__pyx_v_self->query_to = __pyx_v_qto;
/* "HTSeq/_HTSeq.pyx":1132
* self.query_from = qfrom
* self.query_to = qto
* if check and not self.check(): # <<<<<<<<<<<<<<
* raise ValueError, "Inconsistent CIGAR operation."
*
*/
__pyx_t_5 = (__pyx_v_check != 0);
if (__pyx_t_5) {
} else {
__pyx_t_4 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = ((!__pyx_t_5) != 0);
__pyx_t_4 = __pyx_t_6;
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_4)) {
/* "HTSeq/_HTSeq.pyx":1133
* self.query_to = qto
* if check and not self.check():
* raise ValueError, "Inconsistent CIGAR operation." # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Inconsistent_CIGAR_operation, 0, 0);
__PYX_ERR(0, 1133, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1132
* self.query_from = qfrom
* self.query_to = qto
* if check and not self.check(): # <<<<<<<<<<<<<<
* raise ValueError, "Inconsistent CIGAR operation."
*
*/
}
/* "HTSeq/_HTSeq.pyx":1125
* cdef public int query_from, query_to
*
* def __init__(self, str type_, int size, int rfrom, int rto, int qfrom, # <<<<<<<<<<<<<<
* int qto, str chrom, str strand, bint check=True):
* self.type = type_
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1135
* raise ValueError, "Inconsistent CIGAR operation."
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (
* self.__class__.__name__, self.size, cigar_operation_names[
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_3__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_2__repr__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
Py_UCS4 __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "HTSeq/_HTSeq.pyx":1136
*
* def __repr__(self):
* return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % ( # <<<<<<<<<<<<<<
* self.__class__.__name__, self.size, cigar_operation_names[
* self.type],
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_3 = 127;
__Pyx_INCREF(__pyx_kp_u__30);
__pyx_t_2 += 2;
__Pyx_GIVEREF(__pyx_kp_u__30);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__30);
/* "HTSeq/_HTSeq.pyx":1137
* def __repr__(self):
* return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (
* self.__class__.__name__, self.size, cigar_operation_names[ # <<<<<<<<<<<<<<
* self.type],
* str(self.ref_iv), self.query_from, self.query_to)
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__31);
__pyx_t_2 += 2;
__Pyx_GIVEREF(__pyx_kp_u__31);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__31);
__pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->size, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u_base_s);
__pyx_t_2 += 9;
__Pyx_GIVEREF(__pyx_kp_u_base_s);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_base_s);
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cigar_operation_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "HTSeq/_HTSeq.pyx":1138
* return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (
* self.__class__.__name__, self.size, cigar_operation_names[
* self.type], # <<<<<<<<<<<<<<
* str(self.ref_iv), self.query_from, self.query_to)
*
*/
__pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_v_self->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":1137
* def __repr__(self):
* return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (
* self.__class__.__name__, self.size, cigar_operation_names[ # <<<<<<<<<<<<<<
* self.type],
* str(self.ref_iv), self.query_from, self.query_to)
*/
__pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u_on_ref_iv);
__pyx_t_2 += 11;
__Pyx_GIVEREF(__pyx_kp_u_on_ref_iv);
PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_on_ref_iv);
/* "HTSeq/_HTSeq.pyx":1139
* self.__class__.__name__, self.size, cigar_operation_names[
* self.type],
* str(self.ref_iv), self.query_from, self.query_to) # <<<<<<<<<<<<<<
*
* def check(CigarOperation self):
*/
__pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self->ref_iv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u_query_iv);
__pyx_t_2 += 12;
__Pyx_GIVEREF(__pyx_kp_u_query_iv);
PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u_query_iv);
__pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->query_from, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__4);
__pyx_t_2 += 1;
__Pyx_GIVEREF(__pyx_kp_u__4);
PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u__4);
__pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->query_to, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 11, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_kp_u__32);
__pyx_t_2 += 3;
__Pyx_GIVEREF(__pyx_kp_u__32);
PyTuple_SET_ITEM(__pyx_t_1, 12, __pyx_kp_u__32);
/* "HTSeq/_HTSeq.pyx":1136
*
* def __repr__(self):
* return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % ( # <<<<<<<<<<<<<<
* self.__class__.__name__, self.size, cigar_operation_names[
* self.type],
*/
__pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 13, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1135
* raise ValueError, "Inconsistent CIGAR operation."
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (
* self.__class__.__name__, self.size, cigar_operation_names[
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1141
* str(self.ref_iv), self.query_from, self.query_to)
*
* def check(CigarOperation self): # <<<<<<<<<<<<<<
* cdef int qlen = self.query_to - self.query_from
* cdef int rlen = self.ref_iv.length
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_5check(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_5check(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("check (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4check(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4check(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
int __pyx_v_qlen;
int __pyx_v_rlen;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
__Pyx_RefNannySetupContext("check", 0);
/* "HTSeq/_HTSeq.pyx":1142
*
* def check(CigarOperation self):
* cdef int qlen = self.query_to - self.query_from # <<<<<<<<<<<<<<
* cdef int rlen = self.ref_iv.length
* if self.type == 'M' or self.type == '=' or self.type == 'X':
*/
__pyx_v_qlen = (__pyx_v_self->query_to - __pyx_v_self->query_from);
/* "HTSeq/_HTSeq.pyx":1143
* def check(CigarOperation self):
* cdef int qlen = self.query_to - self.query_from
* cdef int rlen = self.ref_iv.length # <<<<<<<<<<<<<<
* if self.type == 'M' or self.type == '=' or self.type == 'X':
* if not (qlen == self.size and rlen == self.size):
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ref_iv), __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_rlen = __pyx_t_2;
/* "HTSeq/_HTSeq.pyx":1144
* cdef int qlen = self.query_to - self.query_from
* cdef int rlen = self.ref_iv.length
* if self.type == 'M' or self.type == '=' or self.type == 'X': # <<<<<<<<<<<<<<
* if not (qlen == self.size and rlen == self.size):
* return False
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_M, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1144, __pyx_L1_error)
__pyx_t_5 = (__pyx_t_4 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_kp_u__33, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1144, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_5 != 0);
if (!__pyx_t_4) {
} else {
__pyx_t_3 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_X, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1144, __pyx_L1_error)
__pyx_t_5 = (__pyx_t_4 != 0);
__pyx_t_3 = __pyx_t_5;
__pyx_L4_bool_binop_done:;
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":1145
* cdef int rlen = self.ref_iv.length
* if self.type == 'M' or self.type == '=' or self.type == 'X':
* if not (qlen == self.size and rlen == self.size): # <<<<<<<<<<<<<<
* return False
* elif self.type == 'I' or self.type == 'S':
*/
__pyx_t_5 = ((__pyx_v_qlen == __pyx_v_self->size) != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_5 = ((__pyx_v_rlen == __pyx_v_self->size) != 0);
__pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
__pyx_t_5 = ((!__pyx_t_3) != 0);
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1146
* if self.type == 'M' or self.type == '=' or self.type == 'X':
* if not (qlen == self.size and rlen == self.size):
* return False # <<<<<<<<<<<<<<
* elif self.type == 'I' or self.type == 'S':
* if not (qlen == self.size and rlen == 0):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1145
* cdef int rlen = self.ref_iv.length
* if self.type == 'M' or self.type == '=' or self.type == 'X':
* if not (qlen == self.size and rlen == self.size): # <<<<<<<<<<<<<<
* return False
* elif self.type == 'I' or self.type == 'S':
*/
}
/* "HTSeq/_HTSeq.pyx":1144
* cdef int qlen = self.query_to - self.query_from
* cdef int rlen = self.ref_iv.length
* if self.type == 'M' or self.type == '=' or self.type == 'X': # <<<<<<<<<<<<<<
* if not (qlen == self.size and rlen == self.size):
* return False
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":1147
* if not (qlen == self.size and rlen == self.size):
* return False
* elif self.type == 'I' or self.type == 'S': # <<<<<<<<<<<<<<
* if not (qlen == self.size and rlen == 0):
* return False
*/
__pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_I, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1147, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_3 != 0);
if (!__pyx_t_4) {
} else {
__pyx_t_5 = __pyx_t_4;
goto __pyx_L10_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_S, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1147, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_4 != 0);
__pyx_t_5 = __pyx_t_3;
__pyx_L10_bool_binop_done:;
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1148
* return False
* elif self.type == 'I' or self.type == 'S':
* if not (qlen == self.size and rlen == 0): # <<<<<<<<<<<<<<
* return False
* elif self.type == 'D' or self.type == 'N':
*/
__pyx_t_3 = ((__pyx_v_qlen == __pyx_v_self->size) != 0);
if (__pyx_t_3) {
} else {
__pyx_t_5 = __pyx_t_3;
goto __pyx_L13_bool_binop_done;
}
__pyx_t_3 = ((__pyx_v_rlen == 0) != 0);
__pyx_t_5 = __pyx_t_3;
__pyx_L13_bool_binop_done:;
__pyx_t_3 = ((!__pyx_t_5) != 0);
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":1149
* elif self.type == 'I' or self.type == 'S':
* if not (qlen == self.size and rlen == 0):
* return False # <<<<<<<<<<<<<<
* elif self.type == 'D' or self.type == 'N':
* if not (qlen == 0 and rlen == self.size):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1148
* return False
* elif self.type == 'I' or self.type == 'S':
* if not (qlen == self.size and rlen == 0): # <<<<<<<<<<<<<<
* return False
* elif self.type == 'D' or self.type == 'N':
*/
}
/* "HTSeq/_HTSeq.pyx":1147
* if not (qlen == self.size and rlen == self.size):
* return False
* elif self.type == 'I' or self.type == 'S': # <<<<<<<<<<<<<<
* if not (qlen == self.size and rlen == 0):
* return False
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":1150
* if not (qlen == self.size and rlen == 0):
* return False
* elif self.type == 'D' or self.type == 'N': # <<<<<<<<<<<<<<
* if not (qlen == 0 and rlen == self.size):
* return False
*/
__pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_D, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1150, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_5 != 0);
if (!__pyx_t_4) {
} else {
__pyx_t_3 = __pyx_t_4;
goto __pyx_L15_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_N, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1150, __pyx_L1_error)
__pyx_t_5 = (__pyx_t_4 != 0);
__pyx_t_3 = __pyx_t_5;
__pyx_L15_bool_binop_done:;
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":1151
* return False
* elif self.type == 'D' or self.type == 'N':
* if not (qlen == 0 and rlen == self.size): # <<<<<<<<<<<<<<
* return False
* elif self.type == 'H' or self.type == 'P':
*/
__pyx_t_5 = ((__pyx_v_qlen == 0) != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L18_bool_binop_done;
}
__pyx_t_5 = ((__pyx_v_rlen == __pyx_v_self->size) != 0);
__pyx_t_3 = __pyx_t_5;
__pyx_L18_bool_binop_done:;
__pyx_t_5 = ((!__pyx_t_3) != 0);
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1152
* elif self.type == 'D' or self.type == 'N':
* if not (qlen == 0 and rlen == self.size):
* return False # <<<<<<<<<<<<<<
* elif self.type == 'H' or self.type == 'P':
* if not (qlen == 0 and rlen == 0):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1151
* return False
* elif self.type == 'D' or self.type == 'N':
* if not (qlen == 0 and rlen == self.size): # <<<<<<<<<<<<<<
* return False
* elif self.type == 'H' or self.type == 'P':
*/
}
/* "HTSeq/_HTSeq.pyx":1150
* if not (qlen == self.size and rlen == 0):
* return False
* elif self.type == 'D' or self.type == 'N': # <<<<<<<<<<<<<<
* if not (qlen == 0 and rlen == self.size):
* return False
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":1153
* if not (qlen == 0 and rlen == self.size):
* return False
* elif self.type == 'H' or self.type == 'P': # <<<<<<<<<<<<<<
* if not (qlen == 0 and rlen == 0):
* return False
*/
__pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_H, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1153, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_3 != 0);
if (!__pyx_t_4) {
} else {
__pyx_t_5 = __pyx_t_4;
goto __pyx_L20_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_P, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1153, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_4 != 0);
__pyx_t_5 = __pyx_t_3;
__pyx_L20_bool_binop_done:;
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1154
* return False
* elif self.type == 'H' or self.type == 'P':
* if not (qlen == 0 and rlen == 0): # <<<<<<<<<<<<<<
* return False
* else:
*/
__pyx_t_3 = ((__pyx_v_qlen == 0) != 0);
if (__pyx_t_3) {
} else {
__pyx_t_5 = __pyx_t_3;
goto __pyx_L23_bool_binop_done;
}
__pyx_t_3 = ((__pyx_v_rlen == 0) != 0);
__pyx_t_5 = __pyx_t_3;
__pyx_L23_bool_binop_done:;
__pyx_t_3 = ((!__pyx_t_5) != 0);
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":1155
* elif self.type == 'H' or self.type == 'P':
* if not (qlen == 0 and rlen == 0):
* return False # <<<<<<<<<<<<<<
* else:
* return False
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1154
* return False
* elif self.type == 'H' or self.type == 'P':
* if not (qlen == 0 and rlen == 0): # <<<<<<<<<<<<<<
* return False
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":1153
* if not (qlen == 0 and rlen == self.size):
* return False
* elif self.type == 'H' or self.type == 'P': # <<<<<<<<<<<<<<
* if not (qlen == 0 and rlen == 0):
* return False
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":1157
* return False
* else:
* return False # <<<<<<<<<<<<<<
* return True
*
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":1158
* else:
* return False
* return True # <<<<<<<<<<<<<<
*
* _re_cigar_codes = re.compile('([MIDNSHP=X])')
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_True);
__pyx_r = Py_True;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1141
* str(self.ref_iv), self.query_from, self.query_to)
*
* def check(CigarOperation self): # <<<<<<<<<<<<<<
* cdef int qlen = self.query_to - self.query_from
* cdef int rlen = self.ref_iv.length
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.check", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1120
* cdef class CigarOperation(object):
*
* cdef public str type # <<<<<<<<<<<<<<
* cdef public int size
* cdef public GenomicInterval ref_iv
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->type);
__pyx_r = __pyx_v_self->type;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1120, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->type);
__Pyx_DECREF(__pyx_v_self->type);
__pyx_v_self->type = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->type);
__Pyx_DECREF(__pyx_v_self->type);
__pyx_v_self->type = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1121
*
* cdef public str type
* cdef public int size # <<<<<<<<<<<<<<
* cdef public GenomicInterval ref_iv
* cdef public int query_from, query_to
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1121, __pyx_L1_error)
__pyx_v_self->size = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1122
* cdef public str type
* cdef public int size
* cdef public GenomicInterval ref_iv # <<<<<<<<<<<<<<
* cdef public int query_from, query_to
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->ref_iv));
__pyx_r = ((PyObject *)__pyx_v_self->ref_iv);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 1122, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->ref_iv);
__Pyx_DECREF(((PyObject *)__pyx_v_self->ref_iv));
__pyx_v_self->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.ref_iv.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->ref_iv);
__Pyx_DECREF(((PyObject *)__pyx_v_self->ref_iv));
__pyx_v_self->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1123
* cdef public int size
* cdef public GenomicInterval ref_iv
* cdef public int query_from, query_to # <<<<<<<<<<<<<<
*
* def __init__(self, str type_, int size, int rfrom, int rto, int qfrom,
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->query_from); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.query_from.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1123, __pyx_L1_error)
__pyx_v_self->query_from = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.query_from.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->query_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.query_to.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1123, __pyx_L1_error)
__pyx_v_self->query_to = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.query_to.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6__reduce_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
PyObject *__pyx_v_state = 0;
PyObject *__pyx_v__dict = 0;
int __pyx_v_use_setstate;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
__Pyx_RefNannySetupContext("__reduce_cython__", 0);
/* "(tree fragment)":5
* cdef object _dict
* cdef bint use_setstate
* state = (self.query_from, self.query_to, self.ref_iv, self.size, self.type) # <<<<<<<<<<<<<<
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
*/
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->query_from); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->query_to); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_v_self->ref_iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->ref_iv));
PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->ref_iv));
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
__Pyx_INCREF(__pyx_v_self->type);
__Pyx_GIVEREF(__pyx_v_self->type);
PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_self->type);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_v_state = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "(tree fragment)":6
* cdef bint use_setstate
* state = (self.query_from, self.query_to, self.ref_iv, self.size, self.type)
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
* if _dict is not None:
* state += (_dict,)
*/
__pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v__dict = __pyx_t_4;
__pyx_t_4 = 0;
/* "(tree fragment)":7
* state = (self.query_from, self.query_to, self.ref_iv, self.size, self.type)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
__pyx_t_5 = (__pyx_v__dict != Py_None);
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
/* "(tree fragment)":8
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
* state += (_dict,) # <<<<<<<<<<<<<<
* use_setstate = True
* else:
*/
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v__dict);
__Pyx_GIVEREF(__pyx_v__dict);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
__pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
__pyx_t_3 = 0;
/* "(tree fragment)":9
* if _dict is not None:
* state += (_dict,)
* use_setstate = True # <<<<<<<<<<<<<<
* else:
* use_setstate = self.ref_iv is not None or self.type is not None
*/
__pyx_v_use_setstate = 1;
/* "(tree fragment)":7
* state = (self.query_from, self.query_to, self.ref_iv, self.size, self.type)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
goto __pyx_L3;
}
/* "(tree fragment)":11
* use_setstate = True
* else:
* use_setstate = self.ref_iv is not None or self.type is not None # <<<<<<<<<<<<<<
* if use_setstate:
* return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, None), state
*/
/*else*/ {
__pyx_t_5 = (((PyObject *)__pyx_v_self->ref_iv) != Py_None);
__pyx_t_7 = (__pyx_t_5 != 0);
if (!__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_7 = (__pyx_v_self->type != ((PyObject*)Py_None));
__pyx_t_5 = (__pyx_t_7 != 0);
__pyx_t_6 = __pyx_t_5;
__pyx_L4_bool_binop_done:;
__pyx_v_use_setstate = __pyx_t_6;
}
__pyx_L3:;
/* "(tree fragment)":12
* else:
* use_setstate = self.ref_iv is not None or self.type is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, None), state
* else:
*/
__pyx_t_6 = (__pyx_v_use_setstate != 0);
if (__pyx_t_6) {
/* "(tree fragment)":13
* use_setstate = self.ref_iv is not None or self.type is not None
* if use_setstate:
* return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, None), state # <<<<<<<<<<<<<<
* else:
* return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, state)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_CigarOperation); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_INCREF(__pyx_int_190567068);
__Pyx_GIVEREF(__pyx_int_190567068);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_190567068);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
__pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "(tree fragment)":12
* else:
* use_setstate = self.ref_iv is not None or self.type is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, None), state
* else:
*/
}
/* "(tree fragment)":15
* return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, None), state
* else:
* return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, state) # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_CigarOperation__set_state(self, __pyx_state)
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_CigarOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_INCREF(__pyx_int_190567068);
__Pyx_GIVEREF(__pyx_int_190567068);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_190567068);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
__pyx_t_2 = 0;
__pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_state);
__Pyx_XDECREF(__pyx_v__dict);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_CigarOperation__set_state(self, __pyx_state)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__setstate_cython__", 0);
/* "(tree fragment)":17
* return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, state)
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_CigarOperation__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_CigarOperation__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_CigarOperation__set_state(self, __pyx_state)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1162
* _re_cigar_codes = re.compile('([MIDNSHP=X])')
*
* cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."): # <<<<<<<<<<<<<<
* cdef list split_cigar, cl
* cdef int size
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11parse_cigar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_parse_cigar(PyObject *__pyx_v_cigar_string, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar *__pyx_optional_args) {
int __pyx_v_ref_left = ((int)0);
PyObject *__pyx_v_chrom = ((PyObject*)__pyx_kp_u__12);
PyObject *__pyx_v_strand = ((PyObject*)__pyx_kp_u__8);
PyObject *__pyx_v_split_cigar = 0;
PyObject *__pyx_v_cl = 0;
int __pyx_v_size;
PyObject *__pyx_v_code = 0;
PyObject *__pyx_v_i = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_t_5;
Py_ssize_t __pyx_t_6;
PyObject *(*__pyx_t_7)(PyObject *);
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
int __pyx_t_11;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
int __pyx_t_14;
struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_15;
__Pyx_RefNannySetupContext("parse_cigar", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_ref_left = __pyx_optional_args->ref_left;
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_chrom = __pyx_optional_args->chrom;
if (__pyx_optional_args->__pyx_n > 2) {
__pyx_v_strand = __pyx_optional_args->strand;
}
}
}
}
/* "HTSeq/_HTSeq.pyx":1166
* cdef int size
* cdef str code
* split_cigar = _re_cigar_codes.split(cigar_string) # <<<<<<<<<<<<<<
* if split_cigar[-1] != '' or len(split_cigar) % 2 != 1:
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
*/
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re_cigar_codes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_cigar_string) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_cigar_string);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1166, __pyx_L1_error)
__pyx_v_split_cigar = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1167
* cdef str code
* split_cigar = _re_cigar_codes.split(cigar_string)
* if split_cigar[-1] != '' or len(split_cigar) % 2 != 1: # <<<<<<<<<<<<<<
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
* cl = []
*/
if (unlikely(__pyx_v_split_cigar == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1167, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_split_cigar, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__12, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1167, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_5) {
} else {
__pyx_t_4 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
if (unlikely(__pyx_v_split_cigar == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 1167, __pyx_L1_error)
}
__pyx_t_6 = PyList_GET_SIZE(__pyx_v_split_cigar); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1167, __pyx_L1_error)
__pyx_t_5 = ((__Pyx_mod_Py_ssize_t(__pyx_t_6, 2) != 1) != 0);
__pyx_t_4 = __pyx_t_5;
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_4)) {
/* "HTSeq/_HTSeq.pyx":1168
* split_cigar = _re_cigar_codes.split(cigar_string)
* if split_cigar[-1] != '' or len(split_cigar) % 2 != 1:
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string # <<<<<<<<<<<<<<
* cl = []
* for i in range(len(split_cigar) // 2):
*/
__pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Illegal_CIGAR_string_s, __pyx_v_cigar_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_1, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(0, 1168, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1167
* cdef str code
* split_cigar = _re_cigar_codes.split(cigar_string)
* if split_cigar[-1] != '' or len(split_cigar) % 2 != 1: # <<<<<<<<<<<<<<
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
* cl = []
*/
}
/* "HTSeq/_HTSeq.pyx":1169
* if split_cigar[-1] != '' or len(split_cigar) % 2 != 1:
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
* cl = [] # <<<<<<<<<<<<<<
* for i in range(len(split_cigar) // 2):
* try:
*/
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_cl = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1170
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
* cl = []
* for i in range(len(split_cigar) // 2): # <<<<<<<<<<<<<<
* try:
* size = int(split_cigar[2 * i])
*/
if (unlikely(__pyx_v_split_cigar == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 1170, __pyx_L1_error)
}
__pyx_t_6 = PyList_GET_SIZE(__pyx_v_split_cigar); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1170, __pyx_L1_error)
__pyx_t_1 = PyInt_FromSsize_t(__Pyx_div_Py_ssize_t(__pyx_t_6, 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
} else {
__pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1170, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
if (likely(!__pyx_t_7)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1170, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1170, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
__pyx_t_3 = __pyx_t_7(__pyx_t_1);
if (unlikely(!__pyx_t_3)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 1170, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
__pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":1171
* cl = []
* for i in range(len(split_cigar) // 2):
* try: # <<<<<<<<<<<<<<
* size = int(split_cigar[2 * i])
* except ValueError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
/*try:*/ {
/* "HTSeq/_HTSeq.pyx":1172
* for i in range(len(split_cigar) // 2):
* try:
* size = int(split_cigar[2 * i]) # <<<<<<<<<<<<<<
* except ValueError:
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
*/
if (unlikely(__pyx_v_split_cigar == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1172, __pyx_L8_error)
}
__pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1172, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_split_cigar, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1172, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1172, __pyx_L8_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_size = __pyx_t_11;
/* "HTSeq/_HTSeq.pyx":1171
* cl = []
* for i in range(len(split_cigar) // 2):
* try: # <<<<<<<<<<<<<<
* size = int(split_cigar[2 * i])
* except ValueError:
*/
}
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L15_try_end;
__pyx_L8_error:;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":1173
* try:
* size = int(split_cigar[2 * i])
* except ValueError: # <<<<<<<<<<<<<<
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
* code = split_cigar[2 * i + 1]
*/
__pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
if (__pyx_t_11) {
__Pyx_AddTraceback("HTSeq._HTSeq.parse_cigar", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_12) < 0) __PYX_ERR(0, 1173, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_12);
/* "HTSeq/_HTSeq.pyx":1174
* size = int(split_cigar[2 * i])
* except ValueError:
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string # <<<<<<<<<<<<<<
* code = split_cigar[2 * i + 1]
* cl.append((code, size))
*/
__pyx_t_13 = PyUnicode_Format(__pyx_kp_u_Illegal_CIGAR_string_s, __pyx_v_cigar_string); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_13, 0, 0);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__PYX_ERR(0, 1174, __pyx_L10_except_error)
}
goto __pyx_L10_except_error;
__pyx_L10_except_error:;
/* "HTSeq/_HTSeq.pyx":1171
* cl = []
* for i in range(len(split_cigar) // 2):
* try: # <<<<<<<<<<<<<<
* size = int(split_cigar[2 * i])
* except ValueError:
*/
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
goto __pyx_L1_error;
__pyx_L15_try_end:;
}
/* "HTSeq/_HTSeq.pyx":1175
* except ValueError:
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
* code = split_cigar[2 * i + 1] # <<<<<<<<<<<<<<
* cl.append((code, size))
* return build_cigar_list(cl, ref_left, chrom, strand)
*/
if (unlikely(__pyx_v_split_cigar == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1175, __pyx_L1_error)
}
__pyx_t_12 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_split_cigar, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(PyUnicode_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_12)->tp_name), 0))) __PYX_ERR(0, 1175, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_code, ((PyObject*)__pyx_t_12));
__pyx_t_12 = 0;
/* "HTSeq/_HTSeq.pyx":1176
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
* code = split_cigar[2 * i + 1]
* cl.append((code, size)) # <<<<<<<<<<<<<<
* return build_cigar_list(cl, ref_left, chrom, strand)
*
*/
__pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_code);
__Pyx_GIVEREF(__pyx_v_code);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_code);
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12);
__pyx_t_12 = 0;
__pyx_t_14 = __Pyx_PyList_Append(__pyx_v_cl, __pyx_t_2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1176, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1170
* raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
* cl = []
* for i in range(len(split_cigar) // 2): # <<<<<<<<<<<<<<
* try:
* size = int(split_cigar[2 * i])
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1177
* code = split_cigar[2 * i + 1]
* cl.append((code, size))
* return build_cigar_list(cl, ref_left, chrom, strand) # <<<<<<<<<<<<<<
*
* cpdef list build_cigar_list(list cigar_pairs, int ref_left=0, str chrom="", str strand="."):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_15.__pyx_n = 3;
__pyx_t_15.ref_left = __pyx_v_ref_left;
__pyx_t_15.chrom = __pyx_v_chrom;
__pyx_t_15.strand = __pyx_v_strand;
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(__pyx_v_cl, 0, &__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1162
* _re_cigar_codes = re.compile('([MIDNSHP=X])')
*
* cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."): # <<<<<<<<<<<<<<
* cdef list split_cigar, cl
* cdef int size
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_AddTraceback("HTSeq._HTSeq.parse_cigar", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_split_cigar);
__Pyx_XDECREF(__pyx_v_cl);
__Pyx_XDECREF(__pyx_v_code);
__Pyx_XDECREF(__pyx_v_i);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11parse_cigar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11parse_cigar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_cigar_string = 0;
int __pyx_v_ref_left;
PyObject *__pyx_v_chrom = 0;
PyObject *__pyx_v_strand = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("parse_cigar (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cigar_string,&__pyx_n_s_ref_left,&__pyx_n_s_chrom,&__pyx_n_s_strand,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject*)__pyx_kp_u__12);
values[3] = ((PyObject*)__pyx_kp_u__8);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cigar_string)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref_left);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse_cigar") < 0)) __PYX_ERR(0, 1162, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_cigar_string = ((PyObject*)values[0]);
if (values[1]) {
__pyx_v_ref_left = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_ref_left == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L3_error)
} else {
__pyx_v_ref_left = ((int)0);
}
__pyx_v_chrom = ((PyObject*)values[2]);
__pyx_v_strand = ((PyObject*)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("parse_cigar", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1162, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.parse_cigar", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cigar_string), (&PyUnicode_Type), 1, "cigar_string", 1))) __PYX_ERR(0, 1162, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 1162, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 1162, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_10parse_cigar(__pyx_self, __pyx_v_cigar_string, __pyx_v_ref_left, __pyx_v_chrom, __pyx_v_strand);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_10parse_cigar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cigar_string, int __pyx_v_ref_left, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar __pyx_t_2;
__Pyx_RefNannySetupContext("parse_cigar", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 3;
__pyx_t_2.ref_left = __pyx_v_ref_left;
__pyx_t_2.chrom = __pyx_v_chrom;
__pyx_t_2.strand = __pyx_v_strand;
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_parse_cigar(__pyx_v_cigar_string, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.parse_cigar", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1179
* return build_cigar_list(cl, ref_left, chrom, strand)
*
* cpdef list build_cigar_list(list cigar_pairs, int ref_left=0, str chrom="", str strand="."): # <<<<<<<<<<<<<<
* cdef list split_cigar, res
* cdef int rpos, qpos, size
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13build_cigar_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_build_cigar_list(PyObject *__pyx_v_cigar_pairs, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list *__pyx_optional_args) {
int __pyx_v_ref_left = ((int)0);
PyObject *__pyx_v_chrom = ((PyObject*)__pyx_kp_u__12);
PyObject *__pyx_v_strand = ((PyObject*)__pyx_kp_u__8);
PyObject *__pyx_v_res = 0;
int __pyx_v_rpos;
int __pyx_v_qpos;
int __pyx_v_size;
PyObject *__pyx_v_code = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *(*__pyx_t_7)(PyObject *);
int __pyx_t_8;
int __pyx_t_9;
int __pyx_t_10;
int __pyx_t_11;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
int __pyx_t_14;
__Pyx_RefNannySetupContext("build_cigar_list", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_ref_left = __pyx_optional_args->ref_left;
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_chrom = __pyx_optional_args->chrom;
if (__pyx_optional_args->__pyx_n > 2) {
__pyx_v_strand = __pyx_optional_args->strand;
}
}
}
}
/* "HTSeq/_HTSeq.pyx":1183
* cdef int rpos, qpos, size
* cdef str code
* rpos = ref_left # <<<<<<<<<<<<<<
* qpos = 0
* res = []
*/
__pyx_v_rpos = __pyx_v_ref_left;
/* "HTSeq/_HTSeq.pyx":1184
* cdef str code
* rpos = ref_left
* qpos = 0 # <<<<<<<<<<<<<<
* res = []
* for code, size in cigar_pairs:
*/
__pyx_v_qpos = 0;
/* "HTSeq/_HTSeq.pyx":1185
* rpos = ref_left
* qpos = 0
* res = [] # <<<<<<<<<<<<<<
* for code, size in cigar_pairs:
* if code == 'M' or code == '=' or code == 'X':
*/
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_res = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1186
* qpos = 0
* res = []
* for code, size in cigar_pairs: # <<<<<<<<<<<<<<
* if code == 'M' or code == '=' or code == 'X':
* res.append(CigarOperation(
*/
if (unlikely(__pyx_v_cigar_pairs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 1186, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_cigar_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
for (;;) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1186, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 1186, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1186, __pyx_L1_error)
__pyx_t_7 = NULL;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 1186, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1186, __pyx_L1_error)
__pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF_SET(__pyx_v_code, ((PyObject*)__pyx_t_4));
__pyx_t_4 = 0;
__pyx_v_size = __pyx_t_8;
/* "HTSeq/_HTSeq.pyx":1187
* res = []
* for code, size in cigar_pairs:
* if code == 'M' or code == '=' or code == 'X': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
*/
__pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_M, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error)
__pyx_t_11 = (__pyx_t_10 != 0);
if (!__pyx_t_11) {
} else {
__pyx_t_9 = __pyx_t_11;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_kp_u__33, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error)
__pyx_t_10 = (__pyx_t_11 != 0);
if (!__pyx_t_10) {
} else {
__pyx_t_9 = __pyx_t_10;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_X, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error)
__pyx_t_11 = (__pyx_t_10 != 0);
__pyx_t_9 = __pyx_t_11;
__pyx_L8_bool_binop_done:;
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":1189
* if code == 'M' or code == '=' or code == 'X':
* res.append(CigarOperation(
* code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand)) # <<<<<<<<<<<<<<
* rpos += size
* qpos += size
*/
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_rpos + __pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_12 = __Pyx_PyInt_From_int((__pyx_v_qpos + __pyx_v_size)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
/* "HTSeq/_HTSeq.pyx":1188
* for code, size in cigar_pairs:
* if code == 'M' or code == '=' or code == 'X':
* res.append(CigarOperation( # <<<<<<<<<<<<<<
* code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
* rpos += size
*/
__pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_INCREF(__pyx_v_code);
__Pyx_GIVEREF(__pyx_v_code);
PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_code);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_12);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_v_chrom);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_v_strand);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
__pyx_t_4 = 0;
__pyx_t_6 = 0;
__pyx_t_12 = 0;
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_12); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1188, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
/* "HTSeq/_HTSeq.pyx":1190
* res.append(CigarOperation(
* code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
* rpos += size # <<<<<<<<<<<<<<
* qpos += size
* elif code == 'I':
*/
__pyx_v_rpos = (__pyx_v_rpos + __pyx_v_size);
/* "HTSeq/_HTSeq.pyx":1191
* code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
* rpos += size
* qpos += size # <<<<<<<<<<<<<<
* elif code == 'I':
* res.append(CigarOperation(
*/
__pyx_v_qpos = (__pyx_v_qpos + __pyx_v_size);
/* "HTSeq/_HTSeq.pyx":1187
* res = []
* for code, size in cigar_pairs:
* if code == 'M' or code == '=' or code == 'X': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
*/
goto __pyx_L7;
}
/* "HTSeq/_HTSeq.pyx":1192
* rpos += size
* qpos += size
* elif code == 'I': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
*/
__pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_I, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1192, __pyx_L1_error)
__pyx_t_11 = (__pyx_t_9 != 0);
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":1194
* elif code == 'I':
* res.append(CigarOperation(
* 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand)) # <<<<<<<<<<<<<<
* qpos += size
* elif code == 'D':
*/
__pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_qpos + __pyx_v_size)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
/* "HTSeq/_HTSeq.pyx":1193
* qpos += size
* elif code == 'I':
* res.append(CigarOperation( # <<<<<<<<<<<<<<
* 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
* qpos += size
*/
__pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_n_u_I);
__Pyx_GIVEREF(__pyx_n_u_I);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_I);
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_13);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_13);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_5);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_v_chrom);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_strand);
__pyx_t_12 = 0;
__pyx_t_13 = 0;
__pyx_t_6 = 0;
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_5); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1193, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":1195
* res.append(CigarOperation(
* 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
* qpos += size # <<<<<<<<<<<<<<
* elif code == 'D':
* res.append(CigarOperation(
*/
__pyx_v_qpos = (__pyx_v_qpos + __pyx_v_size);
/* "HTSeq/_HTSeq.pyx":1192
* rpos += size
* qpos += size
* elif code == 'I': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
*/
goto __pyx_L7;
}
/* "HTSeq/_HTSeq.pyx":1196
* 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
* qpos += size
* elif code == 'D': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
*/
__pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_D, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1196, __pyx_L1_error)
__pyx_t_9 = (__pyx_t_11 != 0);
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":1198
* elif code == 'D':
* res.append(CigarOperation(
* 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand)) # <<<<<<<<<<<<<<
* rpos += size
* elif code == 'N':
*/
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_rpos + __pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
/* "HTSeq/_HTSeq.pyx":1197
* qpos += size
* elif code == 'D':
* res.append(CigarOperation( # <<<<<<<<<<<<<<
* 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
* rpos += size
*/
__pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(__pyx_n_u_D);
__Pyx_GIVEREF(__pyx_n_u_D);
PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_u_D);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_13);
PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_13);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_v_chrom);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_v_strand);
__pyx_t_5 = 0;
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_6 = 0;
__pyx_t_13 = 0;
__pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1197, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
/* "HTSeq/_HTSeq.pyx":1199
* res.append(CigarOperation(
* 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
* rpos += size # <<<<<<<<<<<<<<
* elif code == 'N':
* res.append(CigarOperation(
*/
__pyx_v_rpos = (__pyx_v_rpos + __pyx_v_size);
/* "HTSeq/_HTSeq.pyx":1196
* 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
* qpos += size
* elif code == 'D': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
*/
goto __pyx_L7;
}
/* "HTSeq/_HTSeq.pyx":1200
* 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
* rpos += size
* elif code == 'N': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
*/
__pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_N, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1200, __pyx_L1_error)
__pyx_t_11 = (__pyx_t_9 != 0);
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":1202
* elif code == 'N':
* res.append(CigarOperation(
* 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand)) # <<<<<<<<<<<<<<
* rpos += size
* elif code == 'S':
*/
__pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_rpos + __pyx_v_size)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
/* "HTSeq/_HTSeq.pyx":1201
* rpos += size
* elif code == 'N':
* res.append(CigarOperation( # <<<<<<<<<<<<<<
* 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
* rpos += size
*/
__pyx_t_5 = PyTuple_New(8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_n_u_N);
__Pyx_GIVEREF(__pyx_n_u_N);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_u_N);
__Pyx_GIVEREF(__pyx_t_13);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_13);
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_3);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_chrom);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_v_strand);
__pyx_t_13 = 0;
__pyx_t_12 = 0;
__pyx_t_6 = 0;
__pyx_t_4 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_3); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1201, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":1203
* res.append(CigarOperation(
* 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
* rpos += size # <<<<<<<<<<<<<<
* elif code == 'S':
* res.append(CigarOperation(
*/
__pyx_v_rpos = (__pyx_v_rpos + __pyx_v_size);
/* "HTSeq/_HTSeq.pyx":1200
* 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
* rpos += size
* elif code == 'N': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
*/
goto __pyx_L7;
}
/* "HTSeq/_HTSeq.pyx":1204
* 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
* rpos += size
* elif code == 'S': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
*/
__pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_S, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1204, __pyx_L1_error)
__pyx_t_9 = (__pyx_t_11 != 0);
if (__pyx_t_9) {
/* "HTSeq/_HTSeq.pyx":1206
* elif code == 'S':
* res.append(CigarOperation(
* 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand)) # <<<<<<<<<<<<<<
* qpos += size
* elif code == 'H':
*/
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_12 = __Pyx_PyInt_From_int((__pyx_v_qpos + __pyx_v_size)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
/* "HTSeq/_HTSeq.pyx":1205
* rpos += size
* elif code == 'S':
* res.append(CigarOperation( # <<<<<<<<<<<<<<
* 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
* qpos += size
*/
__pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_INCREF(__pyx_n_u_S);
__Pyx_GIVEREF(__pyx_n_u_S);
PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_n_u_S);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_12);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_v_chrom);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_v_strand);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
__pyx_t_4 = 0;
__pyx_t_6 = 0;
__pyx_t_12 = 0;
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_12); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1205, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
/* "HTSeq/_HTSeq.pyx":1207
* res.append(CigarOperation(
* 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
* qpos += size # <<<<<<<<<<<<<<
* elif code == 'H':
* res.append(CigarOperation(
*/
__pyx_v_qpos = (__pyx_v_qpos + __pyx_v_size);
/* "HTSeq/_HTSeq.pyx":1204
* 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
* rpos += size
* elif code == 'S': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
*/
goto __pyx_L7;
}
/* "HTSeq/_HTSeq.pyx":1208
* 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
* qpos += size
* elif code == 'H': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
*/
__pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_H, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1208, __pyx_L1_error)
__pyx_t_11 = (__pyx_t_9 != 0);
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":1210
* elif code == 'H':
* res.append(CigarOperation(
* 'H', size, rpos, rpos, qpos, qpos, chrom, strand)) # <<<<<<<<<<<<<<
* elif code == 'P':
* res.append(CigarOperation(
*/
__pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1210, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1210, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1210, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
/* "HTSeq/_HTSeq.pyx":1209
* qpos += size
* elif code == 'H':
* res.append(CigarOperation( # <<<<<<<<<<<<<<
* 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
* elif code == 'P':
*/
__pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_n_u_H);
__Pyx_GIVEREF(__pyx_n_u_H);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_H);
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_13);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_13);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_5);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_v_chrom);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_strand);
__pyx_t_12 = 0;
__pyx_t_13 = 0;
__pyx_t_6 = 0;
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_5); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1209, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":1208
* 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
* qpos += size
* elif code == 'H': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
*/
goto __pyx_L7;
}
/* "HTSeq/_HTSeq.pyx":1211
* res.append(CigarOperation(
* 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
* elif code == 'P': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'P', size, rpos, rpos, qpos, qpos, chrom, strand))
*/
__pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_P, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1211, __pyx_L1_error)
__pyx_t_9 = (__pyx_t_11 != 0);
if (likely(__pyx_t_9)) {
/* "HTSeq/_HTSeq.pyx":1213
* elif code == 'P':
* res.append(CigarOperation(
* 'P', size, rpos, rpos, qpos, qpos, chrom, strand)) # <<<<<<<<<<<<<<
* else:
* raise ValueError, "Unknown CIGAR code '%s' encountered." % code
*/
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
/* "HTSeq/_HTSeq.pyx":1212
* 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
* elif code == 'P':
* res.append(CigarOperation( # <<<<<<<<<<<<<<
* 'P', size, rpos, rpos, qpos, qpos, chrom, strand))
* else:
*/
__pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1212, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(__pyx_n_u_P);
__Pyx_GIVEREF(__pyx_n_u_P);
PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_u_P);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_13);
PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_13);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_v_chrom);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_v_strand);
__pyx_t_5 = 0;
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_6 = 0;
__pyx_t_13 = 0;
__pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1212, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1212, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
/* "HTSeq/_HTSeq.pyx":1211
* res.append(CigarOperation(
* 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
* elif code == 'P': # <<<<<<<<<<<<<<
* res.append(CigarOperation(
* 'P', size, rpos, rpos, qpos, qpos, chrom, strand))
*/
goto __pyx_L7;
}
/* "HTSeq/_HTSeq.pyx":1215
* 'P', size, rpos, rpos, qpos, qpos, chrom, strand))
* else:
* raise ValueError, "Unknown CIGAR code '%s' encountered." % code # <<<<<<<<<<<<<<
* return res
*
*/
/*else*/ {
__pyx_t_13 = PyUnicode_Format(__pyx_kp_u_Unknown_CIGAR_code_s_encountered, __pyx_v_code); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_13, 0, 0);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__PYX_ERR(0, 1215, __pyx_L1_error)
}
__pyx_L7:;
/* "HTSeq/_HTSeq.pyx":1186
* qpos = 0
* res = []
* for code, size in cigar_pairs: # <<<<<<<<<<<<<<
* if code == 'M' or code == '=' or code == 'X':
* res.append(CigarOperation(
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1216
* else:
* raise ValueError, "Unknown CIGAR code '%s' encountered." % code
* return res # <<<<<<<<<<<<<<
*
* cdef _parse_SAM_optional_field_value(str field):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_res);
__pyx_r = __pyx_v_res;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1179
* return build_cigar_list(cl, ref_left, chrom, strand)
*
* cpdef list build_cigar_list(list cigar_pairs, int ref_left=0, str chrom="", str strand="."): # <<<<<<<<<<<<<<
* cdef list split_cigar, res
* cdef int rpos, qpos, size
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_AddTraceback("HTSeq._HTSeq.build_cigar_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_res);
__Pyx_XDECREF(__pyx_v_code);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13build_cigar_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13build_cigar_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_cigar_pairs = 0;
int __pyx_v_ref_left;
PyObject *__pyx_v_chrom = 0;
PyObject *__pyx_v_strand = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("build_cigar_list (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cigar_pairs,&__pyx_n_s_ref_left,&__pyx_n_s_chrom,&__pyx_n_s_strand,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject*)__pyx_kp_u__12);
values[3] = ((PyObject*)__pyx_kp_u__8);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cigar_pairs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref_left);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build_cigar_list") < 0)) __PYX_ERR(0, 1179, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_cigar_pairs = ((PyObject*)values[0]);
if (values[1]) {
__pyx_v_ref_left = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_ref_left == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L3_error)
} else {
__pyx_v_ref_left = ((int)0);
}
__pyx_v_chrom = ((PyObject*)values[2]);
__pyx_v_strand = ((PyObject*)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("build_cigar_list", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1179, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.build_cigar_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cigar_pairs), (&PyList_Type), 1, "cigar_pairs", 1))) __PYX_ERR(0, 1179, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 1179, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 1179, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12build_cigar_list(__pyx_self, __pyx_v_cigar_pairs, __pyx_v_ref_left, __pyx_v_chrom, __pyx_v_strand);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12build_cigar_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cigar_pairs, int __pyx_v_ref_left, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_2;
__Pyx_RefNannySetupContext("build_cigar_list", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 3;
__pyx_t_2.ref_left = __pyx_v_ref_left;
__pyx_t_2.chrom = __pyx_v_chrom;
__pyx_t_2.strand = __pyx_v_strand;
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(__pyx_v_cigar_pairs, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.build_cigar_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1218
* return res
*
* cdef _parse_SAM_optional_field_value(str field): # <<<<<<<<<<<<<<
* if len(field) < 5 or field[2] != ':' or field[4] != ':':
* raise ValueError, "Malformatted SAM optional field '%'" % field
*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq__parse_SAM_optional_field_value(PyObject *__pyx_v_field) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
Py_UCS4 __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
__Pyx_RefNannySetupContext("_parse_SAM_optional_field_value", 0);
/* "HTSeq/_HTSeq.pyx":1219
*
* cdef _parse_SAM_optional_field_value(str field):
* if len(field) < 5 or field[2] != ':' or field[4] != ':': # <<<<<<<<<<<<<<
* raise ValueError, "Malformatted SAM optional field '%'" % field
* if field[3] == 'A':
*/
if (unlikely(__pyx_v_field == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 1219, __pyx_L1_error)
}
__pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_field); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1219, __pyx_L1_error)
__pyx_t_3 = ((__pyx_t_2 < 5) != 0);
if (!__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1219, __pyx_L1_error)
__pyx_t_3 = ((__pyx_t_4 != 58) != 0);
if (!__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1219, __pyx_L1_error)
__pyx_t_3 = ((__pyx_t_4 != 58) != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":1220
* cdef _parse_SAM_optional_field_value(str field):
* if len(field) < 5 or field[2] != ':' or field[4] != ':':
* raise ValueError, "Malformatted SAM optional field '%'" % field # <<<<<<<<<<<<<<
* if field[3] == 'A':
* return field[5]
*/
__pyx_t_5 = PyUnicode_Format(__pyx_kp_u_Malformatted_SAM_optional_field, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_5, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(0, 1220, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1219
*
* cdef _parse_SAM_optional_field_value(str field):
* if len(field) < 5 or field[2] != ':' or field[4] != ':': # <<<<<<<<<<<<<<
* raise ValueError, "Malformatted SAM optional field '%'" % field
* if field[3] == 'A':
*/
}
/* "HTSeq/_HTSeq.pyx":1221
* if len(field) < 5 or field[2] != ':' or field[4] != ':':
* raise ValueError, "Malformatted SAM optional field '%'" % field
* if field[3] == 'A': # <<<<<<<<<<<<<<
* return field[5]
* elif field[3] == 'i':
*/
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1221, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_4 == 65) != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":1222
* raise ValueError, "Malformatted SAM optional field '%'" % field
* if field[3] == 'A':
* return field[5] # <<<<<<<<<<<<<<
* elif field[3] == 'i':
* return int(field[5:])
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1222, __pyx_L1_error)
__pyx_t_5 = PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1222, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1221
* if len(field) < 5 or field[2] != ':' or field[4] != ':':
* raise ValueError, "Malformatted SAM optional field '%'" % field
* if field[3] == 'A': # <<<<<<<<<<<<<<
* return field[5]
* elif field[3] == 'i':
*/
}
/* "HTSeq/_HTSeq.pyx":1223
* if field[3] == 'A':
* return field[5]
* elif field[3] == 'i': # <<<<<<<<<<<<<<
* return int(field[5:])
* elif field[3] == 'f':
*/
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1223, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_4 == 0x69) != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":1224
* return field[5]
* elif field[3] == 'i':
* return int(field[5:]) # <<<<<<<<<<<<<<
* elif field[3] == 'f':
* return float(field[5:])
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_field == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1224, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_field, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1223
* if field[3] == 'A':
* return field[5]
* elif field[3] == 'i': # <<<<<<<<<<<<<<
* return int(field[5:])
* elif field[3] == 'f':
*/
}
/* "HTSeq/_HTSeq.pyx":1225
* elif field[3] == 'i':
* return int(field[5:])
* elif field[3] == 'f': # <<<<<<<<<<<<<<
* return float(field[5:])
* elif field[3] == 'Z':
*/
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1225, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_4 == 0x66) != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":1226
* return int(field[5:])
* elif field[3] == 'f':
* return float(field[5:]) # <<<<<<<<<<<<<<
* elif field[3] == 'Z':
* return field[5:]
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_field == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1226, __pyx_L1_error)
}
__pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_field, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __Pyx_PyNumber_Float(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1225
* elif field[3] == 'i':
* return int(field[5:])
* elif field[3] == 'f': # <<<<<<<<<<<<<<
* return float(field[5:])
* elif field[3] == 'Z':
*/
}
/* "HTSeq/_HTSeq.pyx":1227
* elif field[3] == 'f':
* return float(field[5:])
* elif field[3] == 'Z': # <<<<<<<<<<<<<<
* return field[5:]
* elif field[3] == 'H':
*/
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1227, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_4 == 90) != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":1228
* return float(field[5:])
* elif field[3] == 'Z':
* return field[5:] # <<<<<<<<<<<<<<
* elif field[3] == 'H':
* return int(field[5:], 16)
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_field == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1228, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_field, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1227
* elif field[3] == 'f':
* return float(field[5:])
* elif field[3] == 'Z': # <<<<<<<<<<<<<<
* return field[5:]
* elif field[3] == 'H':
*/
}
/* "HTSeq/_HTSeq.pyx":1229
* elif field[3] == 'Z':
* return field[5:]
* elif field[3] == 'H': # <<<<<<<<<<<<<<
* return int(field[5:], 16)
* elif field[3] == 'B':
*/
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1229, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_4 == 72) != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":1230
* return field[5:]
* elif field[3] == 'H':
* return int(field[5:], 16) # <<<<<<<<<<<<<<
* elif field[3] == 'B':
* if field[5] == 'f':
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_field == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1230, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_field, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_INCREF(__pyx_int_16);
__Pyx_GIVEREF(__pyx_int_16);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_16);
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1229
* elif field[3] == 'Z':
* return field[5:]
* elif field[3] == 'H': # <<<<<<<<<<<<<<
* return int(field[5:], 16)
* elif field[3] == 'B':
*/
}
/* "HTSeq/_HTSeq.pyx":1231
* elif field[3] == 'H':
* return int(field[5:], 16)
* elif field[3] == 'B': # <<<<<<<<<<<<<<
* if field[5] == 'f':
* return numpy.array(field[7:].split(','), float)
*/
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1231, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_4 == 66) != 0);
if (likely(__pyx_t_1)) {
/* "HTSeq/_HTSeq.pyx":1232
* return int(field[5:], 16)
* elif field[3] == 'B':
* if field[5] == 'f': # <<<<<<<<<<<<<<
* return numpy.array(field[7:].split(','), float)
* else:
*/
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1232, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_4 == 0x66) != 0);
if (__pyx_t_1) {
/* "HTSeq/_HTSeq.pyx":1233
* elif field[3] == 'B':
* if field[5] == 'f':
* return numpy.array(field[7:].split(','), float) # <<<<<<<<<<<<<<
* else:
* return numpy.array(field[7:].split(','), int)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v_field == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1233, __pyx_L1_error)
}
__pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_field, 7, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = PyUnicode_Split(((PyObject*)__pyx_t_6), __pyx_kp_u__4, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
__pyx_t_9 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
__pyx_t_9 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_8, ((PyObject *)(&PyFloat_Type))};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1233, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_8, ((PyObject *)(&PyFloat_Type))};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1233, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
{
__pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
if (__pyx_t_6) {
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
}
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_8);
__Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
__Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, ((PyObject *)(&PyFloat_Type)));
__pyx_t_8 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1232
* return int(field[5:], 16)
* elif field[3] == 'B':
* if field[5] == 'f': # <<<<<<<<<<<<<<
* return numpy.array(field[7:].split(','), float)
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":1235
* return numpy.array(field[7:].split(','), float)
* else:
* return numpy.array(field[7:].split(','), int) # <<<<<<<<<<<<<<
* else:
* raise ValueError, "SAM optional field with illegal type letter '%s'" % field[2]
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(__pyx_v_field == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1235, __pyx_L1_error)
}
__pyx_t_7 = __Pyx_PyUnicode_Substring(__pyx_v_field, 7, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyUnicode_Split(((PyObject*)__pyx_t_7), __pyx_kp_u__4, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
__pyx_t_9 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_10, function);
__pyx_t_9 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_10)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, ((PyObject *)(&PyInt_Type))};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, ((PyObject *)(&PyInt_Type))};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_7) {
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
}
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_8);
__Pyx_INCREF(((PyObject *)(&PyInt_Type)));
__Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, ((PyObject *)(&PyInt_Type)));
__pyx_t_8 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
}
/* "HTSeq/_HTSeq.pyx":1231
* elif field[3] == 'H':
* return int(field[5:], 16)
* elif field[3] == 'B': # <<<<<<<<<<<<<<
* if field[5] == 'f':
* return numpy.array(field[7:].split(','), float)
*/
}
/* "HTSeq/_HTSeq.pyx":1237
* return numpy.array(field[7:].split(','), int)
* else:
* raise ValueError, "SAM optional field with illegal type letter '%s'" % field[2] # <<<<<<<<<<<<<<
*
* cigar_operation_codes = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X']
*/
/*else*/ {
__pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1237, __pyx_L1_error)
__pyx_t_5 = PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_10 = PyUnicode_Format(__pyx_kp_u_SAM_optional_field_with_illegal, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_10, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__PYX_ERR(0, 1237, __pyx_L1_error)
}
/* "HTSeq/_HTSeq.pyx":1218
* return res
*
* cdef _parse_SAM_optional_field_value(str field): # <<<<<<<<<<<<<<
* if len(field) < 5 or field[2] != ':' or field[4] != ':':
* raise ValueError, "Malformatted SAM optional field '%'" % field
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("HTSeq._HTSeq._parse_SAM_optional_field_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1253
* """
*
* def to_pysam_AlignedSegment(self, sf): # <<<<<<<<<<<<<<
* try:
* import pysam
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment(PyObject *__pyx_v_self, PyObject *__pyx_v_sf); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment(PyObject *__pyx_v_self, PyObject *__pyx_v_sf) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("to_pysam_AlignedSegment (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_to_pysam_AlignedSegment(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_sf));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_to_pysam_AlignedSegment(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_sf) {
PyObject *__pyx_v_pysam = NULL;
PyObject *__pyx_v_a = NULL;
PyObject *__pyx_8genexpr2__pyx_v_c = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
int __pyx_t_11;
int __pyx_t_12;
Py_ssize_t __pyx_t_13;
__Pyx_RefNannySetupContext("to_pysam_AlignedSegment", 0);
/* "HTSeq/_HTSeq.pyx":1254
*
* def to_pysam_AlignedSegment(self, sf):
* try: # <<<<<<<<<<<<<<
* import pysam
* except ImportError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "HTSeq/_HTSeq.pyx":1255
* def to_pysam_AlignedSegment(self, sf):
* try:
* import pysam # <<<<<<<<<<<<<<
* except ImportError:
* sys.stderr.write(
*/
__pyx_t_4 = __Pyx_Import(__pyx_n_s_pysam, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1255, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_pysam = __pyx_t_4;
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":1254
*
* def to_pysam_AlignedSegment(self, sf):
* try: # <<<<<<<<<<<<<<
* import pysam
* except ImportError:
*/
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":1256
* try:
* import pysam
* except ImportError: # <<<<<<<<<<<<<<
* sys.stderr.write(
* "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
*/
__pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
if (__pyx_t_5) {
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1256, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_7);
/* "HTSeq/_HTSeq.pyx":1257
* import pysam
* except ImportError:
* sys.stderr.write( # <<<<<<<<<<<<<<
* "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
* raise
*/
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1257, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1257, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1257, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_9, function);
}
}
__pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_kp_u_Please_Install_PySam_to_use_this) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_kp_u_Please_Install_PySam_to_use_this);
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1257, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "HTSeq/_HTSeq.pyx":1259
* sys.stderr.write(
* "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
* raise # <<<<<<<<<<<<<<
*
* a = pysam.AlignedSegment()
*/
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_7);
__pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
__PYX_ERR(0, 1259, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "HTSeq/_HTSeq.pyx":1254
*
* def to_pysam_AlignedSegment(self, sf):
* try: # <<<<<<<<<<<<<<
* import pysam
* except ImportError:
*/
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
/* "HTSeq/_HTSeq.pyx":1261
* raise
*
* a = pysam.AlignedSegment() # <<<<<<<<<<<<<<
* a.query_sequence = self.read.seq if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().seq
* a.query_qualities = self.read.qual if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().qual
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pysam, __pyx_n_s_AlignedSegment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_a = __pyx_t_7;
__pyx_t_7 = 0;
/* "HTSeq/_HTSeq.pyx":1262
*
* a = pysam.AlignedSegment()
* a.query_sequence = self.read.seq if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().seq # <<<<<<<<<<<<<<
* a.query_qualities = self.read.qual if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().qual
* a.query_name = self.read.name
*/
__pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __pyx_L1_error)
__pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (!__pyx_t_12) {
} else {
__pyx_t_11 = __pyx_t_12;
goto __pyx_L11_bool_binop_done;
}
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__19, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_11 = __pyx_t_12;
__pyx_L11_bool_binop_done:;
if (__pyx_t_11) {
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_seq); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_7 = __pyx_t_4;
__pyx_t_4 = 0;
} else {
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get_reverse_complement); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_8, function);
}
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_seq); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_7 = __pyx_t_8;
__pyx_t_8 = 0;
}
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_query_sequence, __pyx_t_7) < 0) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "HTSeq/_HTSeq.pyx":1263
* a = pysam.AlignedSegment()
* a.query_sequence = self.read.seq if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().seq
* a.query_qualities = self.read.qual if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().qual # <<<<<<<<<<<<<<
* a.query_name = self.read.name
* a.flag = self.flag
*/
__pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error)
__pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (!__pyx_t_12) {
} else {
__pyx_t_11 = __pyx_t_12;
goto __pyx_L13_bool_binop_done;
}
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_kp_u__19, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_11 = __pyx_t_12;
__pyx_L13_bool_binop_done:;
if (__pyx_t_11) {
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_qual); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_7 = __pyx_t_4;
__pyx_t_4 = 0;
} else {
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_get_reverse_complement); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_qual); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_7 = __pyx_t_6;
__pyx_t_6 = 0;
}
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_query_qualities, __pyx_t_7) < 0) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "HTSeq/_HTSeq.pyx":1264
* a.query_sequence = self.read.seq if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().seq
* a.query_qualities = self.read.qual if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().qual
* a.query_name = self.read.name # <<<<<<<<<<<<<<
* a.flag = self.flag
* a.tags = self.optional_fields
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_query_name, __pyx_t_6) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1265
* a.query_qualities = self.read.qual if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().qual
* a.query_name = self.read.name
* a.flag = self.flag # <<<<<<<<<<<<<<
* a.tags = self.optional_fields
* if self.aligned:
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1265, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_flag, __pyx_t_6) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1266
* a.query_name = self.read.name
* a.flag = self.flag
* a.tags = self.optional_fields # <<<<<<<<<<<<<<
* if self.aligned:
* a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
*/
__pyx_t_6 = __pyx_v_self->optional_fields;
__Pyx_INCREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_tags, __pyx_t_6) < 0) __PYX_ERR(0, 1266, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1267
* a.flag = self.flag
* a.tags = self.optional_fields
* if self.aligned: # <<<<<<<<<<<<<<
* a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
* for c in self.cigar]
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_aligned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1267, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1267, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":1268
* a.tags = self.optional_fields
* if self.aligned:
* a.cigartuples = [(cigar_operation_code_dict[c.type], c.size) # <<<<<<<<<<<<<<
* for c in self.cigar]
* a.reference_start = self.iv.start
*/
{ /* enter inner scope */
__pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1268, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_6);
/* "HTSeq/_HTSeq.pyx":1269
* if self.aligned:
* a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
* for c in self.cigar] # <<<<<<<<<<<<<<
* a.reference_start = self.iv.start
* a.reference_id = sf.gettid(self.iv.chrom)
*/
if (unlikely(__pyx_v_self->cigar == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 1269, __pyx_L18_error)
}
__pyx_t_7 = __pyx_v_self->cigar; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0;
for (;;) {
if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1269, __pyx_L18_error)
#else
__pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1269, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_c, __pyx_t_4);
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":1268
* a.tags = self.optional_fields
* if self.aligned:
* a.cigartuples = [(cigar_operation_code_dict[c.type], c.size) # <<<<<<<<<<<<<<
* for c in self.cigar]
* a.reference_start = self.iv.start
*/
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cigar_operation_code_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1268, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr2__pyx_v_c, __pyx_n_s_type_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1268, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1268, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr2__pyx_v_c, __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1268, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1268, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
__pyx_t_9 = 0;
__pyx_t_8 = 0;
if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1268, __pyx_L18_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":1269
* if self.aligned:
* a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
* for c in self.cigar] # <<<<<<<<<<<<<<
* a.reference_start = self.iv.start
* a.reference_id = sf.gettid(self.iv.chrom)
*/
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_c); __pyx_8genexpr2__pyx_v_c = 0;
goto __pyx_L21_exit_scope;
__pyx_L18_error:;
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_c); __pyx_8genexpr2__pyx_v_c = 0;
goto __pyx_L1_error;
__pyx_L21_exit_scope:;
} /* exit inner scope */
/* "HTSeq/_HTSeq.pyx":1268
* a.tags = self.optional_fields
* if self.aligned:
* a.cigartuples = [(cigar_operation_code_dict[c.type], c.size) # <<<<<<<<<<<<<<
* for c in self.cigar]
* a.reference_start = self.iv.start
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_cigartuples, __pyx_t_6) < 0) __PYX_ERR(0, 1268, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1270
* a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
* for c in self.cigar]
* a.reference_start = self.iv.start # <<<<<<<<<<<<<<
* a.reference_id = sf.gettid(self.iv.chrom)
* a.template_length = self.inferred_insert_size
*/
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->__pyx_base.__pyx_base.iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1270, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_reference_start, __pyx_t_6) < 0) __PYX_ERR(0, 1270, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1271
* for c in self.cigar]
* a.reference_start = self.iv.start
* a.reference_id = sf.gettid(self.iv.chrom) # <<<<<<<<<<<<<<
* a.template_length = self.inferred_insert_size
* a.mapping_quality = self.aQual
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sf, __pyx_n_s_gettid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
__pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_self->__pyx_base.__pyx_base.iv->chrom) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->__pyx_base.__pyx_base.iv->chrom);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_reference_id, __pyx_t_6) < 0) __PYX_ERR(0, 1271, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1272
* a.reference_start = self.iv.start
* a.reference_id = sf.gettid(self.iv.chrom)
* a.template_length = self.inferred_insert_size # <<<<<<<<<<<<<<
* a.mapping_quality = self.aQual
* else:
*/
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_template_length, __pyx_t_6) < 0) __PYX_ERR(0, 1272, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1273
* a.reference_id = sf.gettid(self.iv.chrom)
* a.template_length = self.inferred_insert_size
* a.mapping_quality = self.aQual # <<<<<<<<<<<<<<
* else:
* a.reference_start = -1
*/
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mapping_quality, __pyx_t_6) < 0) __PYX_ERR(0, 1273, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1267
* a.flag = self.flag
* a.tags = self.optional_fields
* if self.aligned: # <<<<<<<<<<<<<<
* a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
* for c in self.cigar]
*/
goto __pyx_L15;
}
/* "HTSeq/_HTSeq.pyx":1275
* a.mapping_quality = self.aQual
* else:
* a.reference_start = -1 # <<<<<<<<<<<<<<
* a.reference_id = -1
* if self.mate_aligned:
*/
/*else*/ {
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_reference_start, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1275, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1276
* else:
* a.reference_start = -1
* a.reference_id = -1 # <<<<<<<<<<<<<<
* if self.mate_aligned:
* a.next_reference_id = sf.gettid(self.mate_start.chrom)
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_reference_id, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1276, __pyx_L1_error)
}
__pyx_L15:;
/* "HTSeq/_HTSeq.pyx":1277
* a.reference_start = -1
* a.reference_id = -1
* if self.mate_aligned: # <<<<<<<<<<<<<<
* a.next_reference_id = sf.gettid(self.mate_start.chrom)
* a.next_reference_start = self.mate_start.start
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mate_aligned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1277, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":1278
* a.reference_id = -1
* if self.mate_aligned:
* a.next_reference_id = sf.gettid(self.mate_start.chrom) # <<<<<<<<<<<<<<
* a.next_reference_start = self.mate_start.start
* else:
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sf, __pyx_n_s_gettid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
__pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_self->mate_start->__pyx_base.chrom) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->mate_start->__pyx_base.chrom);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_next_reference_id, __pyx_t_6) < 0) __PYX_ERR(0, 1278, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1279
* if self.mate_aligned:
* a.next_reference_id = sf.gettid(self.mate_start.chrom)
* a.next_reference_start = self.mate_start.start # <<<<<<<<<<<<<<
* else:
* a.next_reference_id = -1
*/
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->mate_start->__pyx_base.start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_next_reference_start, __pyx_t_6) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1277
* a.reference_start = -1
* a.reference_id = -1
* if self.mate_aligned: # <<<<<<<<<<<<<<
* a.next_reference_id = sf.gettid(self.mate_start.chrom)
* a.next_reference_start = self.mate_start.start
*/
goto __pyx_L22;
}
/* "HTSeq/_HTSeq.pyx":1281
* a.next_reference_start = self.mate_start.start
* else:
* a.next_reference_id = -1 # <<<<<<<<<<<<<<
* a.next_reference_start = -1
* return a
*/
/*else*/ {
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_next_reference_id, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1281, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1282
* else:
* a.next_reference_id = -1
* a.next_reference_start = -1 # <<<<<<<<<<<<<<
* return a
*
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_next_reference_start, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1282, __pyx_L1_error)
}
__pyx_L22:;
/* "HTSeq/_HTSeq.pyx":1283
* a.next_reference_id = -1
* a.next_reference_start = -1
* return a # <<<<<<<<<<<<<<
*
* def to_pysam_AlignedRead(self, sf):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_a);
__pyx_r = __pyx_v_a;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1253
* """
*
* def to_pysam_AlignedSegment(self, sf): # <<<<<<<<<<<<<<
* try:
* import pysam
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pysam);
__Pyx_XDECREF(__pyx_v_a);
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_c);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1285
* return a
*
* def to_pysam_AlignedRead(self, sf): # <<<<<<<<<<<<<<
* try:
* import pysam
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead(PyObject *__pyx_v_self, PyObject *__pyx_v_sf); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead(PyObject *__pyx_v_self, PyObject *__pyx_v_sf) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("to_pysam_AlignedRead (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_2to_pysam_AlignedRead(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_sf));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_2to_pysam_AlignedRead(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_sf) {
PyObject *__pyx_v_pysam = NULL;
PyObject *__pyx_v_a = NULL;
PyObject *__pyx_8genexpr3__pyx_v_c = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
int __pyx_t_11;
Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("to_pysam_AlignedRead", 0);
/* "HTSeq/_HTSeq.pyx":1286
*
* def to_pysam_AlignedRead(self, sf):
* try: # <<<<<<<<<<<<<<
* import pysam
* except ImportError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "HTSeq/_HTSeq.pyx":1287
* def to_pysam_AlignedRead(self, sf):
* try:
* import pysam # <<<<<<<<<<<<<<
* except ImportError:
* sys.stderr.write(
*/
__pyx_t_4 = __Pyx_Import(__pyx_n_s_pysam, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1287, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_pysam = __pyx_t_4;
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":1286
*
* def to_pysam_AlignedRead(self, sf):
* try: # <<<<<<<<<<<<<<
* import pysam
* except ImportError:
*/
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":1288
* try:
* import pysam
* except ImportError: # <<<<<<<<<<<<<<
* sys.stderr.write(
* "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
*/
__pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
if (__pyx_t_5) {
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1288, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_7);
/* "HTSeq/_HTSeq.pyx":1289
* import pysam
* except ImportError:
* sys.stderr.write( # <<<<<<<<<<<<<<
* "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
* raise
*/
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1289, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1289, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1289, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_9, function);
}
}
__pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_kp_u_Please_Install_PySam_to_use_this) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_kp_u_Please_Install_PySam_to_use_this);
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1289, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "HTSeq/_HTSeq.pyx":1291
* sys.stderr.write(
* "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
* raise # <<<<<<<<<<<<<<
*
* a = pysam.AlignedRead()
*/
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_7);
__pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
__PYX_ERR(0, 1291, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "HTSeq/_HTSeq.pyx":1286
*
* def to_pysam_AlignedRead(self, sf):
* try: # <<<<<<<<<<<<<<
* import pysam
* except ImportError:
*/
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
/* "HTSeq/_HTSeq.pyx":1293
* raise
*
* a = pysam.AlignedRead() # <<<<<<<<<<<<<<
* a.seq = self.read.seq
* a.qual = self.read.qualstr
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pysam, __pyx_n_s_AlignedRead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_a = __pyx_t_7;
__pyx_t_7 = 0;
/* "HTSeq/_HTSeq.pyx":1294
*
* a = pysam.AlignedRead()
* a.seq = self.read.seq # <<<<<<<<<<<<<<
* a.qual = self.read.qualstr
* a.qname = self.read.name
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_seq); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_seq, __pyx_t_6) < 0) __PYX_ERR(0, 1294, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1295
* a = pysam.AlignedRead()
* a.seq = self.read.seq
* a.qual = self.read.qualstr # <<<<<<<<<<<<<<
* a.qname = self.read.name
* a.flag = self.flag
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_qualstr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_qual, __pyx_t_7) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "HTSeq/_HTSeq.pyx":1296
* a.seq = self.read.seq
* a.qual = self.read.qualstr
* a.qname = self.read.name # <<<<<<<<<<<<<<
* a.flag = self.flag
* a.tags = self.optional_fields
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_qname, __pyx_t_6) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1297
* a.qual = self.read.qualstr
* a.qname = self.read.name
* a.flag = self.flag # <<<<<<<<<<<<<<
* a.tags = self.optional_fields
* if self.aligned:
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_flag, __pyx_t_6) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1298
* a.qname = self.read.name
* a.flag = self.flag
* a.tags = self.optional_fields # <<<<<<<<<<<<<<
* if self.aligned:
* a.cigar = [(cigar_operation_code_dict[c.type], c.size)
*/
__pyx_t_6 = __pyx_v_self->optional_fields;
__Pyx_INCREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_tags, __pyx_t_6) < 0) __PYX_ERR(0, 1298, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1299
* a.flag = self.flag
* a.tags = self.optional_fields
* if self.aligned: # <<<<<<<<<<<<<<
* a.cigar = [(cigar_operation_code_dict[c.type], c.size)
* for c in self.cigar]
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_aligned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1299, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":1300
* a.tags = self.optional_fields
* if self.aligned:
* a.cigar = [(cigar_operation_code_dict[c.type], c.size) # <<<<<<<<<<<<<<
* for c in self.cigar]
* a.pos = self.iv.start
*/
{ /* enter inner scope */
__pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1300, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_6);
/* "HTSeq/_HTSeq.pyx":1301
* if self.aligned:
* a.cigar = [(cigar_operation_code_dict[c.type], c.size)
* for c in self.cigar] # <<<<<<<<<<<<<<
* a.pos = self.iv.start
* a.tid = sf.gettid(self.iv.chrom)
*/
if (unlikely(__pyx_v_self->cigar == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 1301, __pyx_L14_error)
}
__pyx_t_7 = __pyx_v_self->cigar; __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = 0;
for (;;) {
if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1301, __pyx_L14_error)
#else
__pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1301, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_c, __pyx_t_4);
__pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":1300
* a.tags = self.optional_fields
* if self.aligned:
* a.cigar = [(cigar_operation_code_dict[c.type], c.size) # <<<<<<<<<<<<<<
* for c in self.cigar]
* a.pos = self.iv.start
*/
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cigar_operation_code_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1300, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr3__pyx_v_c, __pyx_n_s_type_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1300, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1300, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr3__pyx_v_c, __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1300, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1300, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
__pyx_t_9 = 0;
__pyx_t_8 = 0;
if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1300, __pyx_L14_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "HTSeq/_HTSeq.pyx":1301
* if self.aligned:
* a.cigar = [(cigar_operation_code_dict[c.type], c.size)
* for c in self.cigar] # <<<<<<<<<<<<<<
* a.pos = self.iv.start
* a.tid = sf.gettid(self.iv.chrom)
*/
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c); __pyx_8genexpr3__pyx_v_c = 0;
goto __pyx_L17_exit_scope;
__pyx_L14_error:;
__Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c); __pyx_8genexpr3__pyx_v_c = 0;
goto __pyx_L1_error;
__pyx_L17_exit_scope:;
} /* exit inner scope */
/* "HTSeq/_HTSeq.pyx":1300
* a.tags = self.optional_fields
* if self.aligned:
* a.cigar = [(cigar_operation_code_dict[c.type], c.size) # <<<<<<<<<<<<<<
* for c in self.cigar]
* a.pos = self.iv.start
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_cigar, __pyx_t_6) < 0) __PYX_ERR(0, 1300, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1302
* a.cigar = [(cigar_operation_code_dict[c.type], c.size)
* for c in self.cigar]
* a.pos = self.iv.start # <<<<<<<<<<<<<<
* a.tid = sf.gettid(self.iv.chrom)
* a.isize = self.inferred_insert_size
*/
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->__pyx_base.__pyx_base.iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_pos, __pyx_t_6) < 0) __PYX_ERR(0, 1302, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1303
* for c in self.cigar]
* a.pos = self.iv.start
* a.tid = sf.gettid(self.iv.chrom) # <<<<<<<<<<<<<<
* a.isize = self.inferred_insert_size
* a.mapq = self.aQual
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sf, __pyx_n_s_gettid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
__pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_self->__pyx_base.__pyx_base.iv->chrom) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->__pyx_base.__pyx_base.iv->chrom);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_tid, __pyx_t_6) < 0) __PYX_ERR(0, 1303, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1304
* a.pos = self.iv.start
* a.tid = sf.gettid(self.iv.chrom)
* a.isize = self.inferred_insert_size # <<<<<<<<<<<<<<
* a.mapq = self.aQual
* else:
*/
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_isize, __pyx_t_6) < 0) __PYX_ERR(0, 1304, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1305
* a.tid = sf.gettid(self.iv.chrom)
* a.isize = self.inferred_insert_size
* a.mapq = self.aQual # <<<<<<<<<<<<<<
* else:
* a.pos = -1
*/
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mapq, __pyx_t_6) < 0) __PYX_ERR(0, 1305, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1299
* a.flag = self.flag
* a.tags = self.optional_fields
* if self.aligned: # <<<<<<<<<<<<<<
* a.cigar = [(cigar_operation_code_dict[c.type], c.size)
* for c in self.cigar]
*/
goto __pyx_L11;
}
/* "HTSeq/_HTSeq.pyx":1307
* a.mapq = self.aQual
* else:
* a.pos = -1 # <<<<<<<<<<<<<<
* a.tid = -1
* if self.mate_aligned:
*/
/*else*/ {
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_pos, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1308
* else:
* a.pos = -1
* a.tid = -1 # <<<<<<<<<<<<<<
* if self.mate_aligned:
* a.mrnm = sf.gettid(self.mate_start.chrom)
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_tid, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1308, __pyx_L1_error)
}
__pyx_L11:;
/* "HTSeq/_HTSeq.pyx":1309
* a.pos = -1
* a.tid = -1
* if self.mate_aligned: # <<<<<<<<<<<<<<
* a.mrnm = sf.gettid(self.mate_start.chrom)
* a.mpos = self.mate_start.start
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mate_aligned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1309, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_11) {
/* "HTSeq/_HTSeq.pyx":1310
* a.tid = -1
* if self.mate_aligned:
* a.mrnm = sf.gettid(self.mate_start.chrom) # <<<<<<<<<<<<<<
* a.mpos = self.mate_start.start
* else:
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sf, __pyx_n_s_gettid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
__pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_self->mate_start->__pyx_base.chrom) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->mate_start->__pyx_base.chrom);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mrnm, __pyx_t_6) < 0) __PYX_ERR(0, 1310, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1311
* if self.mate_aligned:
* a.mrnm = sf.gettid(self.mate_start.chrom)
* a.mpos = self.mate_start.start # <<<<<<<<<<<<<<
* else:
* a.mrnm = -1
*/
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->mate_start->__pyx_base.start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mpos, __pyx_t_6) < 0) __PYX_ERR(0, 1311, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1309
* a.pos = -1
* a.tid = -1
* if self.mate_aligned: # <<<<<<<<<<<<<<
* a.mrnm = sf.gettid(self.mate_start.chrom)
* a.mpos = self.mate_start.start
*/
goto __pyx_L18;
}
/* "HTSeq/_HTSeq.pyx":1313
* a.mpos = self.mate_start.start
* else:
* a.mrnm = -1 # <<<<<<<<<<<<<<
* a.mpos = -1
* return a
*/
/*else*/ {
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mrnm, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1313, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1314
* else:
* a.mrnm = -1
* a.mpos = -1 # <<<<<<<<<<<<<<
* return a
*
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mpos, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
}
__pyx_L18:;
/* "HTSeq/_HTSeq.pyx":1315
* a.mrnm = -1
* a.mpos = -1
* return a # <<<<<<<<<<<<<<
*
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_a);
__pyx_r = __pyx_v_a;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1285
* return a
*
* def to_pysam_AlignedRead(self, sf): # <<<<<<<<<<<<<<
* try:
* import pysam
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pysam);
__Pyx_XDECREF(__pyx_v_a);
__Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1318
*
* @classmethod
* def from_pysam_AlignedRead(cls, read, samfile): # <<<<<<<<<<<<<<
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_read = 0;
PyObject *__pyx_v_samfile = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("from_pysam_AlignedRead (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read,&__pyx_n_s_samfile,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("from_pysam_AlignedRead", 1, 2, 2, 1); __PYX_ERR(0, 1318, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pysam_AlignedRead") < 0)) __PYX_ERR(0, 1318, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_read = values[0];
__pyx_v_samfile = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("from_pysam_AlignedRead", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1318, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.from_pysam_AlignedRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4from_pysam_AlignedRead(((PyTypeObject*)__pyx_v_cls), __pyx_v_read, __pyx_v_samfile);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4from_pysam_AlignedRead(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_read, PyObject *__pyx_v_samfile) {
PyObject *__pyx_v_strand = NULL;
PyObject *__pyx_v_chrom = NULL;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = NULL;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_seq = NULL;
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_a = NULL;
PyObject *__pyx_8genexpr4__pyx_v_code = NULL;
PyObject *__pyx_8genexpr4__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
Py_ssize_t __pyx_t_8;
PyObject *(*__pyx_t_9)(PyObject *);
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *(*__pyx_t_12)(PyObject *);
int __pyx_t_13;
struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_14;
int __pyx_t_15;
__Pyx_RefNannySetupContext("from_pysam_AlignedRead", 0);
/* "HTSeq/_HTSeq.pyx":1319
* @classmethod
* def from_pysam_AlignedRead(cls, read, samfile):
* strand = "-" if read.is_reverse else "+" # <<<<<<<<<<<<<<
* if not read.is_unmapped:
* chrom = samfile.getrname(read.tid)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_reverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1319, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
__Pyx_INCREF(__pyx_kp_u__20);
__pyx_t_1 = __pyx_kp_u__20;
} else {
__Pyx_INCREF(__pyx_kp_u__19);
__pyx_t_1 = __pyx_kp_u__19;
}
__pyx_v_strand = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1320
* def from_pysam_AlignedRead(cls, read, samfile):
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped: # <<<<<<<<<<<<<<
* chrom = samfile.getrname(read.tid)
* iv = GenomicInterval(chrom, read.pos, read.aend, strand)
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_unmapped); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1320, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4 = ((!__pyx_t_3) != 0);
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1321
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped:
* chrom = samfile.getrname(read.tid) # <<<<<<<<<<<<<<
* iv = GenomicInterval(chrom, read.pos, read.aend, strand)
* else:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_samfile, __pyx_n_s_getrname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_tid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_chrom = __pyx_t_1;
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1322
* if not read.is_unmapped:
* chrom = samfile.getrname(read.tid)
* iv = GenomicInterval(chrom, read.pos, read.aend, strand) # <<<<<<<<<<<<<<
* else:
* iv = None
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_aend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_strand);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1320
* def from_pysam_AlignedRead(cls, read, samfile):
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped: # <<<<<<<<<<<<<<
* chrom = samfile.getrname(read.tid)
* iv = GenomicInterval(chrom, read.pos, read.aend, strand)
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":1324
* iv = GenomicInterval(chrom, read.pos, read.aend, strand)
* else:
* iv = None # <<<<<<<<<<<<<<
* if read.qual != b"*":
* seq = SequenceWithQualities(
*/
/*else*/ {
__Pyx_INCREF(Py_None);
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":1325
* else:
* iv = None
* if read.qual != b"*": # <<<<<<<<<<<<<<
* seq = SequenceWithQualities(
* read.query_sequence.encode(), read.qname, read.qual.encode())
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_qual); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_kp_b__34, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1325, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1327
* if read.qual != b"*":
* seq = SequenceWithQualities(
* read.query_sequence.encode(), read.qname, read.qual.encode()) # <<<<<<<<<<<<<<
* else:
* seq = SequenceWithQualities(read.query_sequence.encode(
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_qname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_qual); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
__pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "HTSeq/_HTSeq.pyx":1326
* iv = None
* if read.qual != b"*":
* seq = SequenceWithQualities( # <<<<<<<<<<<<<<
* read.query_sequence.encode(), read.qname, read.qual.encode())
* else:
*/
__pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_seq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_5);
__pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":1325
* else:
* iv = None
* if read.qual != b"*": # <<<<<<<<<<<<<<
* seq = SequenceWithQualities(
* read.query_sequence.encode(), read.qname, read.qual.encode())
*/
goto __pyx_L4;
}
/* "HTSeq/_HTSeq.pyx":1329
* read.query_sequence.encode(), read.qname, read.qual.encode())
* else:
* seq = SequenceWithQualities(read.query_sequence.encode( # <<<<<<<<<<<<<<
* ), read.qname, read.qual.encode(), "noquals")
* a = SAM_Alignment(seq, iv)
*/
/*else*/ {
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_sequence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
__pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1330
* else:
* seq = SequenceWithQualities(read.query_sequence.encode(
* ), read.qname, read.qual.encode(), "noquals") # <<<<<<<<<<<<<<
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_qname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_qual); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1330, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1329
* read.query_sequence.encode(), read.qname, read.qual.encode())
* else:
* seq = SequenceWithQualities(read.query_sequence.encode( # <<<<<<<<<<<<<<
* ), read.qname, read.qual.encode(), "noquals")
* a = SAM_Alignment(seq, iv)
*/
__pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_7);
__Pyx_INCREF(__pyx_n_u_noquals);
__Pyx_GIVEREF(__pyx_n_u_noquals);
PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_n_u_noquals);
__pyx_t_5 = 0;
__pyx_t_1 = 0;
__pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_seq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_7);
__pyx_t_7 = 0;
}
__pyx_L4:;
/* "HTSeq/_HTSeq.pyx":1331
* seq = SequenceWithQualities(read.query_sequence.encode(
* ), read.qname, read.qual.encode(), "noquals")
* a = SAM_Alignment(seq, iv) # <<<<<<<<<<<<<<
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
*/
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(((PyObject *)__pyx_v_seq));
__Pyx_GIVEREF(((PyObject *)__pyx_v_seq));
PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_seq));
__Pyx_INCREF(((PyObject *)__pyx_v_iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_iv));
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_a = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1333
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else [] # <<<<<<<<<<<<<<
* a.inferred_insert_size = read.isize
* a.aQual = read.mapq
*/
__pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_iv), Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1333, __pyx_L1_error)
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1333, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1332
* ), read.qname, read.qual.encode(), "noquals")
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for ( # <<<<<<<<<<<<<<
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.isize
*/
{ /* enter inner scope */
__pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_7);
/* "HTSeq/_HTSeq.pyx":1333
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else [] # <<<<<<<<<<<<<<
* a.inferred_insert_size = read.isize
* a.aQual = read.mapq
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_cigar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
__pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1333, __pyx_L7_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1333, __pyx_L7_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1333, __pyx_L7_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_9(__pyx_t_5);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 1333, __pyx_L7_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 1333, __pyx_L7_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_10 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_10);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1333, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_10);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1333, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L10_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
__Pyx_GOTREF(__pyx_t_10);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1333, __pyx_L7_error)
__pyx_t_12 = NULL;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L11_unpacking_done;
__pyx_L10_unpacking_failed:;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_12 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 1333, __pyx_L7_error)
__pyx_L11_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_code, __pyx_t_2);
__pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_length, __pyx_t_10);
__pyx_t_10 = 0;
/* "HTSeq/_HTSeq.pyx":1332
* ), read.qname, read.qual.encode(), "noquals")
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for ( # <<<<<<<<<<<<<<
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.isize
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cigar_operation_codes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_8genexpr4__pyx_v_code); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1332, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
__Pyx_INCREF(__pyx_8genexpr4__pyx_v_length);
__Pyx_GIVEREF(__pyx_8genexpr4__pyx_v_length);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_8genexpr4__pyx_v_length);
__pyx_t_10 = 0;
if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1332, __pyx_L7_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_8genexpr4__pyx_v_code); __pyx_8genexpr4__pyx_v_code = 0;
__Pyx_XDECREF(__pyx_8genexpr4__pyx_v_length); __pyx_8genexpr4__pyx_v_length = 0;
goto __pyx_L12_exit_scope;
__pyx_L7_error:;
__Pyx_XDECREF(__pyx_8genexpr4__pyx_v_code); __pyx_8genexpr4__pyx_v_code = 0;
__Pyx_XDECREF(__pyx_8genexpr4__pyx_v_length); __pyx_8genexpr4__pyx_v_length = 0;
goto __pyx_L1_error;
__pyx_L12_exit_scope:;
} /* exit inner scope */
/* "HTSeq/_HTSeq.pyx":1333
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else [] # <<<<<<<<<<<<<<
* a.inferred_insert_size = read.isize
* a.aQual = read.mapq
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_pos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1333, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_v_chrom)) { __Pyx_RaiseUnboundLocalError("chrom"); __PYX_ERR(0, 1333, __pyx_L1_error) }
if (!(likely(PyUnicode_CheckExact(__pyx_v_chrom))||((__pyx_v_chrom) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_chrom)->tp_name), 0))) __PYX_ERR(0, 1333, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1332
* ), read.qname, read.qual.encode(), "noquals")
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for ( # <<<<<<<<<<<<<<
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.isize
*/
__pyx_t_14.__pyx_n = 3;
__pyx_t_14.ref_left = __pyx_t_13;
__pyx_t_14.chrom = ((PyObject*)__pyx_v_chrom);
__pyx_t_14.strand = __pyx_v_strand;
__pyx_t_5 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(((PyObject*)__pyx_t_7), 0, &__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_6 = __pyx_t_5;
__pyx_t_5 = 0;
} else {
/* "HTSeq/_HTSeq.pyx":1333
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else [] # <<<<<<<<<<<<<<
* a.inferred_insert_size = read.isize
* a.aQual = read.mapq
*/
__pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __pyx_t_5;
__pyx_t_5 = 0;
}
/* "HTSeq/_HTSeq.pyx":1332
* ), read.qname, read.qual.encode(), "noquals")
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for ( # <<<<<<<<<<<<<<
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.isize
*/
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_a->cigar);
__Pyx_DECREF(__pyx_v_a->cigar);
__pyx_v_a->cigar = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1334
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.isize # <<<<<<<<<<<<<<
* a.aQual = read.mapq
* a.flag = read.flag
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_isize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1334, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_a->inferred_insert_size = __pyx_t_13;
/* "HTSeq/_HTSeq.pyx":1335
* code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.isize
* a.aQual = read.mapq # <<<<<<<<<<<<<<
* a.flag = read.flag
* a.proper_pair = read.is_proper_pair
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mapq); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1335, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_a->aQual = __pyx_t_13;
/* "HTSeq/_HTSeq.pyx":1336
* a.inferred_insert_size = read.isize
* a.aQual = read.mapq
* a.flag = read.flag # <<<<<<<<<<<<<<
* a.proper_pair = read.is_proper_pair
* a.not_primary_alignment = read.is_secondary
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_flag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_flag, __pyx_t_6) < 0) __PYX_ERR(0, 1336, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1337
* a.aQual = read.mapq
* a.flag = read.flag
* a.proper_pair = read.is_proper_pair # <<<<<<<<<<<<<<
* a.not_primary_alignment = read.is_secondary
* a.failed_platform_qc = read.is_qcfail
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_proper_pair); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1337, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_a->proper_pair = __pyx_t_4;
/* "HTSeq/_HTSeq.pyx":1338
* a.flag = read.flag
* a.proper_pair = read.is_proper_pair
* a.not_primary_alignment = read.is_secondary # <<<<<<<<<<<<<<
* a.failed_platform_qc = read.is_qcfail
* a.pcr_or_optical_duplicate = read.is_duplicate
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_secondary); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1338, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_a->not_primary_alignment = __pyx_t_4;
/* "HTSeq/_HTSeq.pyx":1339
* a.proper_pair = read.is_proper_pair
* a.not_primary_alignment = read.is_secondary
* a.failed_platform_qc = read.is_qcfail # <<<<<<<<<<<<<<
* a.pcr_or_optical_duplicate = read.is_duplicate
* a.supplementary = read.is_supplementary
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_qcfail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_a->failed_platform_qc = __pyx_t_4;
/* "HTSeq/_HTSeq.pyx":1340
* a.not_primary_alignment = read.is_secondary
* a.failed_platform_qc = read.is_qcfail
* a.pcr_or_optical_duplicate = read.is_duplicate # <<<<<<<<<<<<<<
* a.supplementary = read.is_supplementary
* a.original_sam_line = ""
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_duplicate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1340, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_a->pcr_or_optical_duplicate = __pyx_t_4;
/* "HTSeq/_HTSeq.pyx":1341
* a.failed_platform_qc = read.is_qcfail
* a.pcr_or_optical_duplicate = read.is_duplicate
* a.supplementary = read.is_supplementary # <<<<<<<<<<<<<<
* a.original_sam_line = ""
* a.optional_fields = read.tags
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_supplementary); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1341, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_a->supplementary = __pyx_t_4;
/* "HTSeq/_HTSeq.pyx":1342
* a.pcr_or_optical_duplicate = read.is_duplicate
* a.supplementary = read.is_supplementary
* a.original_sam_line = "" # <<<<<<<<<<<<<<
* a.optional_fields = read.tags
* if read.is_paired:
*/
__Pyx_INCREF(__pyx_kp_u__12);
__Pyx_GIVEREF(__pyx_kp_u__12);
__Pyx_GOTREF(__pyx_v_a->original_sam_line);
__Pyx_DECREF(__pyx_v_a->original_sam_line);
__pyx_v_a->original_sam_line = __pyx_kp_u__12;
/* "HTSeq/_HTSeq.pyx":1343
* a.supplementary = read.is_supplementary
* a.original_sam_line = ""
* a.optional_fields = read.tags # <<<<<<<<<<<<<<
* if read.is_paired:
* # These two should be but are not always consistent
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_tags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1343, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_a->optional_fields);
__Pyx_DECREF(__pyx_v_a->optional_fields);
__pyx_v_a->optional_fields = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1344
* a.original_sam_line = ""
* a.optional_fields = read.tags
* if read.is_paired: # <<<<<<<<<<<<<<
* # These two should be but are not always consistent
* if (not read.mate_is_unmapped) and (read.mrnm != -1):
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_paired); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1344, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1344, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1346
* if read.is_paired:
* # These two should be but are not always consistent
* if (not read.mate_is_unmapped) and (read.mrnm != -1): # <<<<<<<<<<<<<<
* strand = "-" if read.mate_is_reverse else "+"
* a.mate_start = GenomicPosition(
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mate_is_unmapped); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1346, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_15 = ((!__pyx_t_3) != 0);
if (__pyx_t_15) {
} else {
__pyx_t_4 = __pyx_t_15;
goto __pyx_L15_bool_binop_done;
}
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mrnm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_t_6, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 1346, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_4 = __pyx_t_15;
__pyx_L15_bool_binop_done:;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1347
* # These two should be but are not always consistent
* if (not read.mate_is_unmapped) and (read.mrnm != -1):
* strand = "-" if read.mate_is_reverse else "+" # <<<<<<<<<<<<<<
* a.mate_start = GenomicPosition(
* samfile.getrname(read.mrnm), read.mpos, strand)
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mate_is_reverse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1347, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
__Pyx_INCREF(__pyx_kp_u__20);
__pyx_t_5 = __pyx_kp_u__20;
} else {
__Pyx_INCREF(__pyx_kp_u__19);
__pyx_t_5 = __pyx_kp_u__19;
}
__Pyx_DECREF_SET(__pyx_v_strand, ((PyObject*)__pyx_t_5));
__pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":1349
* strand = "-" if read.mate_is_reverse else "+"
* a.mate_start = GenomicPosition(
* samfile.getrname(read.mrnm), read.mpos, strand) # <<<<<<<<<<<<<<
* else:
* a.mate_start = None
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_samfile, __pyx_n_s_getrname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mrnm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
/* "HTSeq/_HTSeq.pyx":1348
* if (not read.mate_is_unmapped) and (read.mrnm != -1):
* strand = "-" if read.mate_is_reverse else "+"
* a.mate_start = GenomicPosition( # <<<<<<<<<<<<<<
* samfile.getrname(read.mrnm), read.mpos, strand)
* else:
*/
__pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_strand);
__pyx_t_5 = 0;
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_a->mate_start);
__Pyx_DECREF(((PyObject *)__pyx_v_a->mate_start));
__pyx_v_a->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1346
* if read.is_paired:
* # These two should be but are not always consistent
* if (not read.mate_is_unmapped) and (read.mrnm != -1): # <<<<<<<<<<<<<<
* strand = "-" if read.mate_is_reverse else "+"
* a.mate_start = GenomicPosition(
*/
goto __pyx_L14;
}
/* "HTSeq/_HTSeq.pyx":1351
* samfile.getrname(read.mrnm), read.mpos, strand)
* else:
* a.mate_start = None # <<<<<<<<<<<<<<
* if read.is_read1:
* a.pe_which = intern("first")
*/
/*else*/ {
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_a->mate_start);
__Pyx_DECREF(((PyObject *)__pyx_v_a->mate_start));
__pyx_v_a->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None);
}
__pyx_L14:;
/* "HTSeq/_HTSeq.pyx":1352
* else:
* a.mate_start = None
* if read.is_read1: # <<<<<<<<<<<<<<
* a.pe_which = intern("first")
* elif read.is_read2:
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_read1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1352, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1353
* a.mate_start = None
* if read.is_read1:
* a.pe_which = intern("first") # <<<<<<<<<<<<<<
* elif read.is_read2:
* a.pe_which = intern("second")
*/
__pyx_t_6 = __Pyx_Intern(__pyx_n_u_first); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1353, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_a->pe_which);
__Pyx_DECREF(__pyx_v_a->pe_which);
__pyx_v_a->pe_which = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1352
* else:
* a.mate_start = None
* if read.is_read1: # <<<<<<<<<<<<<<
* a.pe_which = intern("first")
* elif read.is_read2:
*/
goto __pyx_L17;
}
/* "HTSeq/_HTSeq.pyx":1354
* if read.is_read1:
* a.pe_which = intern("first")
* elif read.is_read2: # <<<<<<<<<<<<<<
* a.pe_which = intern("second")
* else:
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_read2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1354, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1354, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1355
* a.pe_which = intern("first")
* elif read.is_read2:
* a.pe_which = intern("second") # <<<<<<<<<<<<<<
* else:
* a.pe_which = intern("unknown")
*/
__pyx_t_6 = __Pyx_Intern(__pyx_n_u_second); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1355, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_a->pe_which);
__Pyx_DECREF(__pyx_v_a->pe_which);
__pyx_v_a->pe_which = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1354
* if read.is_read1:
* a.pe_which = intern("first")
* elif read.is_read2: # <<<<<<<<<<<<<<
* a.pe_which = intern("second")
* else:
*/
goto __pyx_L17;
}
/* "HTSeq/_HTSeq.pyx":1357
* a.pe_which = intern("second")
* else:
* a.pe_which = intern("unknown") # <<<<<<<<<<<<<<
* else:
* a.pe_which = intern("not_paired_end")
*/
/*else*/ {
__pyx_t_6 = __Pyx_Intern(__pyx_n_u_unknown); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1357, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1357, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_a->pe_which);
__Pyx_DECREF(__pyx_v_a->pe_which);
__pyx_v_a->pe_which = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
}
__pyx_L17:;
/* "HTSeq/_HTSeq.pyx":1344
* a.original_sam_line = ""
* a.optional_fields = read.tags
* if read.is_paired: # <<<<<<<<<<<<<<
* # These two should be but are not always consistent
* if (not read.mate_is_unmapped) and (read.mrnm != -1):
*/
goto __pyx_L13;
}
/* "HTSeq/_HTSeq.pyx":1359
* a.pe_which = intern("unknown")
* else:
* a.pe_which = intern("not_paired_end") # <<<<<<<<<<<<<<
* return a
*
*/
/*else*/ {
__pyx_t_6 = __Pyx_Intern(__pyx_n_u_not_paired_end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1359, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1359, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_a->pe_which);
__Pyx_DECREF(__pyx_v_a->pe_which);
__pyx_v_a->pe_which = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
}
__pyx_L13:;
/* "HTSeq/_HTSeq.pyx":1360
* else:
* a.pe_which = intern("not_paired_end")
* return a # <<<<<<<<<<<<<<
*
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_a));
__pyx_r = ((PyObject *)__pyx_v_a);
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1318
*
* @classmethod
* def from_pysam_AlignedRead(cls, read, samfile): # <<<<<<<<<<<<<<
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.from_pysam_AlignedRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_strand);
__Pyx_XDECREF(__pyx_v_chrom);
__Pyx_XDECREF((PyObject *)__pyx_v_iv);
__Pyx_XDECREF((PyObject *)__pyx_v_seq);
__Pyx_XDECREF((PyObject *)__pyx_v_a);
__Pyx_XDECREF(__pyx_8genexpr4__pyx_v_code);
__Pyx_XDECREF(__pyx_8genexpr4__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1363
*
* @classmethod
* def from_pysam_AlignedSegment(cls, read, samfile): # <<<<<<<<<<<<<<
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_read = 0;
PyObject *__pyx_v_samfile = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("from_pysam_AlignedSegment (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read,&__pyx_n_s_samfile,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("from_pysam_AlignedSegment", 1, 2, 2, 1); __PYX_ERR(0, 1363, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pysam_AlignedSegment") < 0)) __PYX_ERR(0, 1363, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_read = values[0];
__pyx_v_samfile = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("from_pysam_AlignedSegment", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1363, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.from_pysam_AlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_6from_pysam_AlignedSegment(((PyTypeObject*)__pyx_v_cls), __pyx_v_read, __pyx_v_samfile);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_6from_pysam_AlignedSegment(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_read, PyObject *__pyx_v_samfile) {
PyObject *__pyx_v_strand = NULL;
PyObject *__pyx_v_chrom = NULL;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = NULL;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_seq = NULL;
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_a = NULL;
PyObject *__pyx_8genexpr5__pyx_v_code = NULL;
PyObject *__pyx_8genexpr5__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
Py_ssize_t __pyx_t_7;
PyObject *(*__pyx_t_8)(PyObject *);
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *(*__pyx_t_12)(PyObject *);
int __pyx_t_13;
struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_14;
int __pyx_t_15;
__Pyx_RefNannySetupContext("from_pysam_AlignedSegment", 0);
/* "HTSeq/_HTSeq.pyx":1364
* @classmethod
* def from_pysam_AlignedSegment(cls, read, samfile):
* strand = "-" if read.is_reverse else "+" # <<<<<<<<<<<<<<
* if not read.is_unmapped:
* chrom = samfile.getrname(read.tid)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_reverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1364, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
__Pyx_INCREF(__pyx_kp_u__20);
__pyx_t_1 = __pyx_kp_u__20;
} else {
__Pyx_INCREF(__pyx_kp_u__19);
__pyx_t_1 = __pyx_kp_u__19;
}
__pyx_v_strand = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1365
* def from_pysam_AlignedSegment(cls, read, samfile):
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped: # <<<<<<<<<<<<<<
* chrom = samfile.getrname(read.tid)
* iv = GenomicInterval(chrom, read.reference_start,
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_unmapped); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1365, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4 = ((!__pyx_t_3) != 0);
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1366
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped:
* chrom = samfile.getrname(read.tid) # <<<<<<<<<<<<<<
* iv = GenomicInterval(chrom, read.reference_start,
* read.reference_end, strand)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_samfile, __pyx_n_s_getrname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_tid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_chrom = __pyx_t_1;
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1367
* if not read.is_unmapped:
* chrom = samfile.getrname(read.tid)
* iv = GenomicInterval(chrom, read.reference_start, # <<<<<<<<<<<<<<
* read.reference_end, strand)
* else:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_reference_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "HTSeq/_HTSeq.pyx":1368
* chrom = samfile.getrname(read.tid)
* iv = GenomicInterval(chrom, read.reference_start,
* read.reference_end, strand) # <<<<<<<<<<<<<<
* else:
* iv = None
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_reference_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "HTSeq/_HTSeq.pyx":1367
* if not read.is_unmapped:
* chrom = samfile.getrname(read.tid)
* iv = GenomicInterval(chrom, read.reference_start, # <<<<<<<<<<<<<<
* read.reference_end, strand)
* else:
*/
__pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_strand);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1365
* def from_pysam_AlignedSegment(cls, read, samfile):
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped: # <<<<<<<<<<<<<<
* chrom = samfile.getrname(read.tid)
* iv = GenomicInterval(chrom, read.reference_start,
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":1370
* read.reference_end, strand)
* else:
* iv = None # <<<<<<<<<<<<<<
* seq = SequenceWithQualities(
* read.query_sequence.encode(), read.query_name, b'', 'noquals')
*/
/*else*/ {
__Pyx_INCREF(Py_None);
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":1372
* iv = None
* seq = SequenceWithQualities(
* read.query_sequence.encode(), read.query_name, b'', 'noquals') # <<<<<<<<<<<<<<
* if read.query_qualities != None:
* seq.qual = numpy.array(read.query_qualities)
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "HTSeq/_HTSeq.pyx":1371
* else:
* iv = None
* seq = SequenceWithQualities( # <<<<<<<<<<<<<<
* read.query_sequence.encode(), read.query_name, b'', 'noquals')
* if read.query_qualities != None:
*/
__pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1371, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
__Pyx_INCREF(__pyx_kp_b__12);
__Pyx_GIVEREF(__pyx_kp_b__12);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_b__12);
__Pyx_INCREF(__pyx_n_u_noquals);
__Pyx_GIVEREF(__pyx_n_u_noquals);
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_n_u_noquals);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_seq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1373
* seq = SequenceWithQualities(
* read.query_sequence.encode(), read.query_name, b'', 'noquals')
* if read.query_qualities != None: # <<<<<<<<<<<<<<
* seq.qual = numpy.array(read.query_qualities)
* a = SAM_Alignment(seq, iv)
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_qualities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1373, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1373, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1374
* read.query_sequence.encode(), read.query_name, b'', 'noquals')
* if read.query_qualities != None:
* seq.qual = numpy.array(read.query_qualities) # <<<<<<<<<<<<<<
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_qualities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1374, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_seq), __pyx_n_s_qual, __pyx_t_5) < 0) __PYX_ERR(0, 1374, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":1373
* seq = SequenceWithQualities(
* read.query_sequence.encode(), read.query_name, b'', 'noquals')
* if read.query_qualities != None: # <<<<<<<<<<<<<<
* seq.qual = numpy.array(read.query_qualities)
* a = SAM_Alignment(seq, iv)
*/
}
/* "HTSeq/_HTSeq.pyx":1375
* if read.query_qualities != None:
* seq.qual = numpy.array(read.query_qualities)
* a = SAM_Alignment(seq, iv) # <<<<<<<<<<<<<<
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
*/
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1375, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_seq));
__Pyx_GIVEREF(((PyObject *)__pyx_v_seq));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_seq));
__Pyx_INCREF(((PyObject *)__pyx_v_iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_iv));
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_a = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1377
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else [] # <<<<<<<<<<<<<<
* a.inferred_insert_size = read.template_length
* a.aQual = read.mapping_quality
*/
__pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_v_iv), Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1377, __pyx_L1_error)
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1377, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1376
* seq.qual = numpy.array(read.query_qualities)
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for ( # <<<<<<<<<<<<<<
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.template_length
*/
{ /* enter inner scope */
__pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1376, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_5);
/* "HTSeq/_HTSeq.pyx":1377
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else [] # <<<<<<<<<<<<<<
* a.inferred_insert_size = read.template_length
* a.aQual = read.mapping_quality
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_cigartuples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
__pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1377, __pyx_L7_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_8)) {
if (likely(PyList_CheckExact(__pyx_t_6))) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1377, __pyx_L7_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1377, __pyx_L7_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_8(__pyx_t_6);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 1377, __pyx_L7_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 1377, __pyx_L7_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_9 = PyList_GET_ITEM(sequence, 0);
__pyx_t_10 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(__pyx_t_10);
#else
__pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1377, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1377, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_10);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1377, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L10_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
__Pyx_GOTREF(__pyx_t_10);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1377, __pyx_L7_error)
__pyx_t_12 = NULL;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L11_unpacking_done;
__pyx_L10_unpacking_failed:;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_12 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 1377, __pyx_L7_error)
__pyx_L11_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_code, __pyx_t_9);
__pyx_t_9 = 0;
__Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_length, __pyx_t_10);
__pyx_t_10 = 0;
/* "HTSeq/_HTSeq.pyx":1376
* seq.qual = numpy.array(read.query_qualities)
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for ( # <<<<<<<<<<<<<<
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.template_length
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cigar_operation_codes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_8genexpr5__pyx_v_code); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1376, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
__Pyx_INCREF(__pyx_8genexpr5__pyx_v_length);
__Pyx_GIVEREF(__pyx_8genexpr5__pyx_v_length);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_8genexpr5__pyx_v_length);
__pyx_t_10 = 0;
if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1376, __pyx_L7_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_8genexpr5__pyx_v_code); __pyx_8genexpr5__pyx_v_code = 0;
__Pyx_XDECREF(__pyx_8genexpr5__pyx_v_length); __pyx_8genexpr5__pyx_v_length = 0;
goto __pyx_L12_exit_scope;
__pyx_L7_error:;
__Pyx_XDECREF(__pyx_8genexpr5__pyx_v_code); __pyx_8genexpr5__pyx_v_code = 0;
__Pyx_XDECREF(__pyx_8genexpr5__pyx_v_length); __pyx_8genexpr5__pyx_v_length = 0;
goto __pyx_L1_error;
__pyx_L12_exit_scope:;
} /* exit inner scope */
/* "HTSeq/_HTSeq.pyx":1377
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else [] # <<<<<<<<<<<<<<
* a.inferred_insert_size = read.template_length
* a.aQual = read.mapping_quality
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_reference_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_v_chrom)) { __Pyx_RaiseUnboundLocalError("chrom"); __PYX_ERR(0, 1377, __pyx_L1_error) }
if (!(likely(PyUnicode_CheckExact(__pyx_v_chrom))||((__pyx_v_chrom) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_chrom)->tp_name), 0))) __PYX_ERR(0, 1377, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1376
* seq.qual = numpy.array(read.query_qualities)
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for ( # <<<<<<<<<<<<<<
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.template_length
*/
__pyx_t_14.__pyx_n = 3;
__pyx_t_14.ref_left = __pyx_t_13;
__pyx_t_14.chrom = ((PyObject*)__pyx_v_chrom);
__pyx_t_14.strand = __pyx_v_strand;
__pyx_t_6 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(((PyObject*)__pyx_t_5), 0, &__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1376, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_2 = __pyx_t_6;
__pyx_t_6 = 0;
} else {
/* "HTSeq/_HTSeq.pyx":1377
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else [] # <<<<<<<<<<<<<<
* a.inferred_insert_size = read.template_length
* a.aQual = read.mapping_quality
*/
__pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_2 = __pyx_t_6;
__pyx_t_6 = 0;
}
/* "HTSeq/_HTSeq.pyx":1376
* seq.qual = numpy.array(read.query_qualities)
* a = SAM_Alignment(seq, iv)
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for ( # <<<<<<<<<<<<<<
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.template_length
*/
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_a->cigar);
__Pyx_DECREF(__pyx_v_a->cigar);
__pyx_v_a->cigar = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1378
* a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.template_length # <<<<<<<<<<<<<<
* a.aQual = read.mapping_quality
* a.flag = read.flag
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_template_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1378, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_a->inferred_insert_size = __pyx_t_13;
/* "HTSeq/_HTSeq.pyx":1379
* code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
* a.inferred_insert_size = read.template_length
* a.aQual = read.mapping_quality # <<<<<<<<<<<<<<
* a.flag = read.flag
* a.proper_pair = read.is_proper_pair
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mapping_quality); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1379, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_a->aQual = __pyx_t_13;
/* "HTSeq/_HTSeq.pyx":1380
* a.inferred_insert_size = read.template_length
* a.aQual = read.mapping_quality
* a.flag = read.flag # <<<<<<<<<<<<<<
* a.proper_pair = read.is_proper_pair
* a.not_primary_alignment = read.is_secondary
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_flag, __pyx_t_2) < 0) __PYX_ERR(0, 1380, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1381
* a.aQual = read.mapping_quality
* a.flag = read.flag
* a.proper_pair = read.is_proper_pair # <<<<<<<<<<<<<<
* a.not_primary_alignment = read.is_secondary
* a.failed_platform_qc = read.is_qcfail
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_proper_pair); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_a->proper_pair = __pyx_t_4;
/* "HTSeq/_HTSeq.pyx":1382
* a.flag = read.flag
* a.proper_pair = read.is_proper_pair
* a.not_primary_alignment = read.is_secondary # <<<<<<<<<<<<<<
* a.failed_platform_qc = read.is_qcfail
* a.pcr_or_optical_duplicate = read.is_duplicate
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_secondary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1382, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_a->not_primary_alignment = __pyx_t_4;
/* "HTSeq/_HTSeq.pyx":1383
* a.proper_pair = read.is_proper_pair
* a.not_primary_alignment = read.is_secondary
* a.failed_platform_qc = read.is_qcfail # <<<<<<<<<<<<<<
* a.pcr_or_optical_duplicate = read.is_duplicate
* a.supplementary = read.is_supplementary
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_qcfail); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_a->failed_platform_qc = __pyx_t_4;
/* "HTSeq/_HTSeq.pyx":1384
* a.not_primary_alignment = read.is_secondary
* a.failed_platform_qc = read.is_qcfail
* a.pcr_or_optical_duplicate = read.is_duplicate # <<<<<<<<<<<<<<
* a.supplementary = read.is_supplementary
* a.original_sam_line = ""
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_duplicate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_a->pcr_or_optical_duplicate = __pyx_t_4;
/* "HTSeq/_HTSeq.pyx":1385
* a.failed_platform_qc = read.is_qcfail
* a.pcr_or_optical_duplicate = read.is_duplicate
* a.supplementary = read.is_supplementary # <<<<<<<<<<<<<<
* a.original_sam_line = ""
* a.optional_fields = read.tags
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_supplementary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1385, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_a->supplementary = __pyx_t_4;
/* "HTSeq/_HTSeq.pyx":1386
* a.pcr_or_optical_duplicate = read.is_duplicate
* a.supplementary = read.is_supplementary
* a.original_sam_line = "" # <<<<<<<<<<<<<<
* a.optional_fields = read.tags
* if read.is_paired:
*/
__Pyx_INCREF(__pyx_kp_u__12);
__Pyx_GIVEREF(__pyx_kp_u__12);
__Pyx_GOTREF(__pyx_v_a->original_sam_line);
__Pyx_DECREF(__pyx_v_a->original_sam_line);
__pyx_v_a->original_sam_line = __pyx_kp_u__12;
/* "HTSeq/_HTSeq.pyx":1387
* a.supplementary = read.is_supplementary
* a.original_sam_line = ""
* a.optional_fields = read.tags # <<<<<<<<<<<<<<
* if read.is_paired:
* # These two should be but are not always consistent
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_tags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1387, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_a->optional_fields);
__Pyx_DECREF(__pyx_v_a->optional_fields);
__pyx_v_a->optional_fields = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1388
* a.original_sam_line = ""
* a.optional_fields = read.tags
* if read.is_paired: # <<<<<<<<<<<<<<
* # These two should be but are not always consistent
* if (not read.mate_is_unmapped) and (read.mrnm != -1):
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_paired); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1388, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1390
* if read.is_paired:
* # These two should be but are not always consistent
* if (not read.mate_is_unmapped) and (read.mrnm != -1): # <<<<<<<<<<<<<<
* strand = "-" if read.mate_is_reverse else "+"
* a.mate_start = GenomicPosition(samfile.getrname(
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mate_is_unmapped); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1390, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_15 = ((!__pyx_t_3) != 0);
if (__pyx_t_15) {
} else {
__pyx_t_4 = __pyx_t_15;
goto __pyx_L15_bool_binop_done;
}
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mrnm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = __Pyx_PyInt_NeObjC(__pyx_t_2, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 1390, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_4 = __pyx_t_15;
__pyx_L15_bool_binop_done:;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1391
* # These two should be but are not always consistent
* if (not read.mate_is_unmapped) and (read.mrnm != -1):
* strand = "-" if read.mate_is_reverse else "+" # <<<<<<<<<<<<<<
* a.mate_start = GenomicPosition(samfile.getrname(
* read.mrnm), read.next_reference_start, strand)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mate_is_reverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1391, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_4) {
__Pyx_INCREF(__pyx_kp_u__20);
__pyx_t_6 = __pyx_kp_u__20;
} else {
__Pyx_INCREF(__pyx_kp_u__19);
__pyx_t_6 = __pyx_kp_u__19;
}
__Pyx_DECREF_SET(__pyx_v_strand, ((PyObject*)__pyx_t_6));
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1392
* if (not read.mate_is_unmapped) and (read.mrnm != -1):
* strand = "-" if read.mate_is_reverse else "+"
* a.mate_start = GenomicPosition(samfile.getrname( # <<<<<<<<<<<<<<
* read.mrnm), read.next_reference_start, strand)
* else:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_samfile, __pyx_n_s_getrname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "HTSeq/_HTSeq.pyx":1393
* strand = "-" if read.mate_is_reverse else "+"
* a.mate_start = GenomicPosition(samfile.getrname(
* read.mrnm), read.next_reference_start, strand) # <<<<<<<<<<<<<<
* else:
* a.mate_start = None
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mrnm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_next_reference_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "HTSeq/_HTSeq.pyx":1392
* if (not read.mate_is_unmapped) and (read.mrnm != -1):
* strand = "-" if read.mate_is_reverse else "+"
* a.mate_start = GenomicPosition(samfile.getrname( # <<<<<<<<<<<<<<
* read.mrnm), read.next_reference_start, strand)
* else:
*/
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_strand);
__pyx_t_6 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_a->mate_start);
__Pyx_DECREF(((PyObject *)__pyx_v_a->mate_start));
__pyx_v_a->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1390
* if read.is_paired:
* # These two should be but are not always consistent
* if (not read.mate_is_unmapped) and (read.mrnm != -1): # <<<<<<<<<<<<<<
* strand = "-" if read.mate_is_reverse else "+"
* a.mate_start = GenomicPosition(samfile.getrname(
*/
goto __pyx_L14;
}
/* "HTSeq/_HTSeq.pyx":1395
* read.mrnm), read.next_reference_start, strand)
* else:
* a.mate_start = None # <<<<<<<<<<<<<<
* if read.is_read1:
* a.pe_which = intern("first")
*/
/*else*/ {
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_a->mate_start);
__Pyx_DECREF(((PyObject *)__pyx_v_a->mate_start));
__pyx_v_a->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None);
}
__pyx_L14:;
/* "HTSeq/_HTSeq.pyx":1396
* else:
* a.mate_start = None
* if read.is_read1: # <<<<<<<<<<<<<<
* a.pe_which = intern("first")
* elif read.is_read2:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_read1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1396, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1397
* a.mate_start = None
* if read.is_read1:
* a.pe_which = intern("first") # <<<<<<<<<<<<<<
* elif read.is_read2:
* a.pe_which = intern("second")
*/
__pyx_t_2 = __Pyx_Intern(__pyx_n_u_first); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1397, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_a->pe_which);
__Pyx_DECREF(__pyx_v_a->pe_which);
__pyx_v_a->pe_which = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1396
* else:
* a.mate_start = None
* if read.is_read1: # <<<<<<<<<<<<<<
* a.pe_which = intern("first")
* elif read.is_read2:
*/
goto __pyx_L17;
}
/* "HTSeq/_HTSeq.pyx":1398
* if read.is_read1:
* a.pe_which = intern("first")
* elif read.is_read2: # <<<<<<<<<<<<<<
* a.pe_which = intern("second")
* else:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_read2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1398, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1398, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_4) {
/* "HTSeq/_HTSeq.pyx":1399
* a.pe_which = intern("first")
* elif read.is_read2:
* a.pe_which = intern("second") # <<<<<<<<<<<<<<
* else:
* a.pe_which = intern("unknown")
*/
__pyx_t_2 = __Pyx_Intern(__pyx_n_u_second); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1399, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_a->pe_which);
__Pyx_DECREF(__pyx_v_a->pe_which);
__pyx_v_a->pe_which = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "HTSeq/_HTSeq.pyx":1398
* if read.is_read1:
* a.pe_which = intern("first")
* elif read.is_read2: # <<<<<<<<<<<<<<
* a.pe_which = intern("second")
* else:
*/
goto __pyx_L17;
}
/* "HTSeq/_HTSeq.pyx":1401
* a.pe_which = intern("second")
* else:
* a.pe_which = intern("unknown") # <<<<<<<<<<<<<<
* else:
* a.pe_which = intern("not_paired_end")
*/
/*else*/ {
__pyx_t_2 = __Pyx_Intern(__pyx_n_u_unknown); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1401, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_a->pe_which);
__Pyx_DECREF(__pyx_v_a->pe_which);
__pyx_v_a->pe_which = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
}
__pyx_L17:;
/* "HTSeq/_HTSeq.pyx":1388
* a.original_sam_line = ""
* a.optional_fields = read.tags
* if read.is_paired: # <<<<<<<<<<<<<<
* # These two should be but are not always consistent
* if (not read.mate_is_unmapped) and (read.mrnm != -1):
*/
goto __pyx_L13;
}
/* "HTSeq/_HTSeq.pyx":1403
* a.pe_which = intern("unknown")
* else:
* a.pe_which = intern("not_paired_end") # <<<<<<<<<<<<<<
* return a
*
*/
/*else*/ {
__pyx_t_2 = __Pyx_Intern(__pyx_n_u_not_paired_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1403, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_a->pe_which);
__Pyx_DECREF(__pyx_v_a->pe_which);
__pyx_v_a->pe_which = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
}
__pyx_L13:;
/* "HTSeq/_HTSeq.pyx":1404
* else:
* a.pe_which = intern("not_paired_end")
* return a # <<<<<<<<<<<<<<
*
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_a));
__pyx_r = ((PyObject *)__pyx_v_a);
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1363
*
* @classmethod
* def from_pysam_AlignedSegment(cls, read, samfile): # <<<<<<<<<<<<<<
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.from_pysam_AlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_strand);
__Pyx_XDECREF(__pyx_v_chrom);
__Pyx_XDECREF((PyObject *)__pyx_v_iv);
__Pyx_XDECREF((PyObject *)__pyx_v_seq);
__Pyx_XDECREF((PyObject *)__pyx_v_a);
__Pyx_XDECREF(__pyx_8genexpr5__pyx_v_code);
__Pyx_XDECREF(__pyx_8genexpr5__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1407
*
* @classmethod
* def from_SAM_line(cls, line): # <<<<<<<<<<<<<<
* cdef str qname, flag, rname, pos, mapq, cigar,
* cdef str mrnm, mpos, isize, seq, qual
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line(PyObject *__pyx_v_cls, PyObject *__pyx_v_line); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line(PyObject *__pyx_v_cls, PyObject *__pyx_v_line) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("from_SAM_line (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8from_SAM_line(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_line));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8from_SAM_line(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_line) {
PyObject *__pyx_v_qname = 0;
PyObject *__pyx_v_flag = 0;
PyObject *__pyx_v_rname = 0;
PyObject *__pyx_v_pos = 0;
PyObject *__pyx_v_mapq = 0;
PyObject *__pyx_v_cigar = 0;
PyObject *__pyx_v_mrnm = 0;
PyObject *__pyx_v_mpos = 0;
PyObject *__pyx_v_isize = 0;
PyObject *__pyx_v_seq = 0;
PyObject *__pyx_v_qual = 0;
PyObject *__pyx_v_optional_fields = 0;
int __pyx_v_posint;
int __pyx_v_flagint;
PyObject *__pyx_v_strand = 0;
PyObject *__pyx_v_cigarlist = 0;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_swq = 0;
PyObject *__pyx_v_fields = NULL;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = NULL;
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_alnmt = NULL;
PyObject *__pyx_8genexpr6__pyx_v_field = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
Py_ssize_t __pyx_t_5;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
PyObject *__pyx_t_15 = NULL;
PyObject *(*__pyx_t_16)(PyObject *);
int __pyx_t_17;
int __pyx_t_18;
struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar __pyx_t_19;
__Pyx_RefNannySetupContext("from_SAM_line", 0);
/* "HTSeq/_HTSeq.pyx":1416
* cdef SequenceWithQualities swq
*
* fields = line.rstrip().split("\t") # <<<<<<<<<<<<<<
* if len(fields) < 10:
* raise ValueError, "SAM line does not contain at least 11 tab-delimited fields."
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_rstrip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u__21) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u__21);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_fields = __pyx_t_1;
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1417
*
* fields = line.rstrip().split("\t")
* if len(fields) < 10: # <<<<<<<<<<<<<<
* raise ValueError, "SAM line does not contain at least 11 tab-delimited fields."
* (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
*/
__pyx_t_5 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1417, __pyx_L1_error)
__pyx_t_6 = ((__pyx_t_5 < 10) != 0);
if (unlikely(__pyx_t_6)) {
/* "HTSeq/_HTSeq.pyx":1418
* fields = line.rstrip().split("\t")
* if len(fields) < 10:
* raise ValueError, "SAM line does not contain at least 11 tab-delimited fields." # <<<<<<<<<<<<<<
* (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
* seq, qual) = fields[0:11]
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_SAM_line_does_not_contain_at_lea, 0, 0);
__PYX_ERR(0, 1418, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1417
*
* fields = line.rstrip().split("\t")
* if len(fields) < 10: # <<<<<<<<<<<<<<
* raise ValueError, "SAM line does not contain at least 11 tab-delimited fields."
* (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
*/
}
/* "HTSeq/_HTSeq.pyx":1420
* raise ValueError, "SAM line does not contain at least 11 tab-delimited fields."
* (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
* seq, qual) = fields[0:11] # <<<<<<<<<<<<<<
* optional_fields = fields[11:]
*
*/
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_fields, 0, 11, NULL, NULL, &__pyx_slice__35, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 11)) {
if (size > 11) __Pyx_RaiseTooManyValuesError(11);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 1419, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 4);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 5);
__pyx_t_10 = PyTuple_GET_ITEM(sequence, 6);
__pyx_t_11 = PyTuple_GET_ITEM(sequence, 7);
__pyx_t_12 = PyTuple_GET_ITEM(sequence, 8);
__pyx_t_13 = PyTuple_GET_ITEM(sequence, 9);
__pyx_t_14 = PyTuple_GET_ITEM(sequence, 10);
} else {
__pyx_t_3 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
__pyx_t_4 = PyList_GET_ITEM(sequence, 2);
__pyx_t_7 = PyList_GET_ITEM(sequence, 3);
__pyx_t_8 = PyList_GET_ITEM(sequence, 4);
__pyx_t_9 = PyList_GET_ITEM(sequence, 5);
__pyx_t_10 = PyList_GET_ITEM(sequence, 6);
__pyx_t_11 = PyList_GET_ITEM(sequence, 7);
__pyx_t_12 = PyList_GET_ITEM(sequence, 8);
__pyx_t_13 = PyList_GET_ITEM(sequence, 9);
__pyx_t_14 = PyList_GET_ITEM(sequence, 10);
}
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(__pyx_t_14);
#else
{
Py_ssize_t i;
PyObject** temps[11] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14};
for (i=0; i < 11; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1419, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
PyObject** temps[11] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14};
__pyx_t_15 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1419, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
for (index=0; index < 11; index++) {
PyObject* item = __pyx_t_16(__pyx_t_15); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 11) < 0) __PYX_ERR(0, 1419, __pyx_L1_error)
__pyx_t_16 = NULL;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
goto __pyx_L5_unpacking_done;
__pyx_L4_unpacking_failed:;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_16 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 1419, __pyx_L1_error)
__pyx_L5_unpacking_done:;
}
/* "HTSeq/_HTSeq.pyx":1419
* if len(fields) < 10:
* raise ValueError, "SAM line does not contain at least 11 tab-delimited fields."
* (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize, # <<<<<<<<<<<<<<
* seq, qual) = fields[0:11]
* optional_fields = fields[11:]
*/
if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_9)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_10)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_11)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_12)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_13)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_14)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
__pyx_v_qname = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
__pyx_v_flag = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
__pyx_v_rname = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
__pyx_v_pos = ((PyObject*)__pyx_t_7);
__pyx_t_7 = 0;
__pyx_v_mapq = ((PyObject*)__pyx_t_8);
__pyx_t_8 = 0;
__pyx_v_cigar = ((PyObject*)__pyx_t_9);
__pyx_t_9 = 0;
__pyx_v_mrnm = ((PyObject*)__pyx_t_10);
__pyx_t_10 = 0;
__pyx_v_mpos = ((PyObject*)__pyx_t_11);
__pyx_t_11 = 0;
__pyx_v_isize = ((PyObject*)__pyx_t_12);
__pyx_t_12 = 0;
__pyx_v_seq = ((PyObject*)__pyx_t_13);
__pyx_t_13 = 0;
__pyx_v_qual = ((PyObject*)__pyx_t_14);
__pyx_t_14 = 0;
/* "HTSeq/_HTSeq.pyx":1421
* (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
* seq, qual) = fields[0:11]
* optional_fields = fields[11:] # <<<<<<<<<<<<<<
*
* if seq.count("=") > 0:
*/
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_fields, 11, 0, NULL, NULL, &__pyx_slice__36, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1421, __pyx_L1_error)
__pyx_v_optional_fields = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1423
* optional_fields = fields[11:]
*
* if seq.count("=") > 0: # <<<<<<<<<<<<<<
* raise ValueError, "Sequence in SAM file contains '=', which is not supported."
* if seq.count(".") > 0:
*/
if (unlikely(__pyx_v_seq == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "count");
__PYX_ERR(0, 1423, __pyx_L1_error)
}
__pyx_t_5 = PyUnicode_Count(__pyx_v_seq, __pyx_kp_u__33, 0, PY_SSIZE_T_MAX); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1423, __pyx_L1_error)
__pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_14 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1423, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1423, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
if (unlikely(__pyx_t_6)) {
/* "HTSeq/_HTSeq.pyx":1424
*
* if seq.count("=") > 0:
* raise ValueError, "Sequence in SAM file contains '=', which is not supported." # <<<<<<<<<<<<<<
* if seq.count(".") > 0:
* raise ValueError, "Sequence in SAM file contains '.', which is not supported."
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Sequence_in_SAM_file_contains_wh, 0, 0);
__PYX_ERR(0, 1424, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1423
* optional_fields = fields[11:]
*
* if seq.count("=") > 0: # <<<<<<<<<<<<<<
* raise ValueError, "Sequence in SAM file contains '=', which is not supported."
* if seq.count(".") > 0:
*/
}
/* "HTSeq/_HTSeq.pyx":1425
* if seq.count("=") > 0:
* raise ValueError, "Sequence in SAM file contains '=', which is not supported."
* if seq.count(".") > 0: # <<<<<<<<<<<<<<
* raise ValueError, "Sequence in SAM file contains '.', which is not supported."
* flagint = int(flag)
*/
if (unlikely(__pyx_v_seq == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "count");
__PYX_ERR(0, 1425, __pyx_L1_error)
}
__pyx_t_5 = PyUnicode_Count(__pyx_v_seq, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1425, __pyx_L1_error)
__pyx_t_14 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_1 = PyObject_RichCompare(__pyx_t_14, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1425, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_t_6)) {
/* "HTSeq/_HTSeq.pyx":1426
* raise ValueError, "Sequence in SAM file contains '=', which is not supported."
* if seq.count(".") > 0:
* raise ValueError, "Sequence in SAM file contains '.', which is not supported." # <<<<<<<<<<<<<<
* flagint = int(flag)
*
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Sequence_in_SAM_file_contains_wh_2, 0, 0);
__PYX_ERR(0, 1426, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1425
* if seq.count("=") > 0:
* raise ValueError, "Sequence in SAM file contains '=', which is not supported."
* if seq.count(".") > 0: # <<<<<<<<<<<<<<
* raise ValueError, "Sequence in SAM file contains '.', which is not supported."
* flagint = int(flag)
*/
}
/* "HTSeq/_HTSeq.pyx":1427
* if seq.count(".") > 0:
* raise ValueError, "Sequence in SAM file contains '.', which is not supported."
* flagint = int(flag) # <<<<<<<<<<<<<<
*
* if flagint & 0x0004: # flag "query sequence is unmapped"
*/
__pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_flagint = __pyx_t_17;
/* "HTSeq/_HTSeq.pyx":1429
* flagint = int(flag)
*
* if flagint & 0x0004: # flag "query sequence is unmapped" # <<<<<<<<<<<<<<
* iv = None
* cigarlist = None
*/
__pyx_t_6 = ((__pyx_v_flagint & 0x0004) != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":1430
*
* if flagint & 0x0004: # flag "query sequence is unmapped"
* iv = None # <<<<<<<<<<<<<<
* cigarlist = None
* else:
*/
__Pyx_INCREF(Py_None);
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);
/* "HTSeq/_HTSeq.pyx":1431
* if flagint & 0x0004: # flag "query sequence is unmapped"
* iv = None
* cigarlist = None # <<<<<<<<<<<<<<
* else:
* if rname == "*":
*/
__Pyx_INCREF(Py_None);
__pyx_v_cigarlist = ((PyObject*)Py_None);
/* "HTSeq/_HTSeq.pyx":1429
* flagint = int(flag)
*
* if flagint & 0x0004: # flag "query sequence is unmapped" # <<<<<<<<<<<<<<
* iv = None
* cigarlist = None
*/
goto __pyx_L8;
}
/* "HTSeq/_HTSeq.pyx":1433
* cigarlist = None
* else:
* if rname == "*": # <<<<<<<<<<<<<<
* raise ValueError, "Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared"
* # SAM is one-based, but HTSeq is zero-based!
*/
/*else*/ {
__pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_rname, __pyx_kp_u__34, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1433, __pyx_L1_error)
__pyx_t_18 = (__pyx_t_6 != 0);
if (unlikely(__pyx_t_18)) {
/* "HTSeq/_HTSeq.pyx":1434
* else:
* if rname == "*":
* raise ValueError, "Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared" # <<<<<<<<<<<<<<
* # SAM is one-based, but HTSeq is zero-based!
* posint = int(pos) - 1
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Malformed_SAM_line_RNAME_althoug, 0, 0);
__PYX_ERR(0, 1434, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1433
* cigarlist = None
* else:
* if rname == "*": # <<<<<<<<<<<<<<
* raise ValueError, "Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared"
* # SAM is one-based, but HTSeq is zero-based!
*/
}
/* "HTSeq/_HTSeq.pyx":1436
* raise ValueError, "Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared"
* # SAM is one-based, but HTSeq is zero-based!
* posint = int(pos) - 1 # <<<<<<<<<<<<<<
* if flagint & 0x0010: # flag "strand of the query"
* strand = "-"
*/
__pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_14 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_14); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_v_posint = __pyx_t_17;
/* "HTSeq/_HTSeq.pyx":1437
* # SAM is one-based, but HTSeq is zero-based!
* posint = int(pos) - 1
* if flagint & 0x0010: # flag "strand of the query" # <<<<<<<<<<<<<<
* strand = "-"
* else:
*/
__pyx_t_18 = ((__pyx_v_flagint & 0x0010) != 0);
if (__pyx_t_18) {
/* "HTSeq/_HTSeq.pyx":1438
* posint = int(pos) - 1
* if flagint & 0x0010: # flag "strand of the query"
* strand = "-" # <<<<<<<<<<<<<<
* else:
* strand = "+"
*/
__Pyx_INCREF(__pyx_kp_u__20);
__pyx_v_strand = __pyx_kp_u__20;
/* "HTSeq/_HTSeq.pyx":1437
* # SAM is one-based, but HTSeq is zero-based!
* posint = int(pos) - 1
* if flagint & 0x0010: # flag "strand of the query" # <<<<<<<<<<<<<<
* strand = "-"
* else:
*/
goto __pyx_L10;
}
/* "HTSeq/_HTSeq.pyx":1440
* strand = "-"
* else:
* strand = "+" # <<<<<<<<<<<<<<
* cigarlist = parse_cigar(cigar, posint, rname, strand)
* iv = GenomicInterval(
*/
/*else*/ {
__Pyx_INCREF(__pyx_kp_u__19);
__pyx_v_strand = __pyx_kp_u__19;
}
__pyx_L10:;
/* "HTSeq/_HTSeq.pyx":1441
* else:
* strand = "+"
* cigarlist = parse_cigar(cigar, posint, rname, strand) # <<<<<<<<<<<<<<
* iv = GenomicInterval(
* rname, posint, cigarlist[-1].ref_iv.end, strand)
*/
__pyx_t_19.__pyx_n = 3;
__pyx_t_19.ref_left = __pyx_v_posint;
__pyx_t_19.chrom = __pyx_v_rname;
__pyx_t_19.strand = __pyx_v_strand;
__pyx_t_14 = __pyx_f_5HTSeq_6_HTSeq_parse_cigar(__pyx_v_cigar, 0, &__pyx_t_19); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1441, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__pyx_v_cigarlist = ((PyObject*)__pyx_t_14);
__pyx_t_14 = 0;
/* "HTSeq/_HTSeq.pyx":1443
* cigarlist = parse_cigar(cigar, posint, rname, strand)
* iv = GenomicInterval(
* rname, posint, cigarlist[-1].ref_iv.end, strand) # <<<<<<<<<<<<<<
*
* if qual != "*":
*/
__pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_posint); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1443, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
if (unlikely(__pyx_v_cigarlist == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1443, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_cigarlist, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ref_iv); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1443, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
/* "HTSeq/_HTSeq.pyx":1442
* strand = "+"
* cigarlist = parse_cigar(cigar, posint, rname, strand)
* iv = GenomicInterval( # <<<<<<<<<<<<<<
* rname, posint, cigarlist[-1].ref_iv.end, strand)
*
*/
__pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1442, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_INCREF(__pyx_v_rname);
__Pyx_GIVEREF(__pyx_v_rname);
PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_rname);
__Pyx_GIVEREF(__pyx_t_14);
PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_1);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_v_strand);
__pyx_t_14 = 0;
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1442, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
}
__pyx_L8:;
/* "HTSeq/_HTSeq.pyx":1445
* rname, posint, cigarlist[-1].ref_iv.end, strand)
*
* if qual != "*": # <<<<<<<<<<<<<<
* swq = SequenceWithQualities(
* seq.upper().encode(), qname, qual.upper().encode())
*/
__pyx_t_18 = (__Pyx_PyUnicode_Equals(__pyx_v_qual, __pyx_kp_u__34, Py_NE)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 1445, __pyx_L1_error)
__pyx_t_6 = (__pyx_t_18 != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":1447
* if qual != "*":
* swq = SequenceWithQualities(
* seq.upper().encode(), qname, qual.upper().encode()) # <<<<<<<<<<<<<<
* else:
* swq = SequenceWithQualities(
*/
__pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_seq, __pyx_n_s_upper); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_12 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
__pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
if (likely(__pyx_t_12)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_14, function);
}
}
__pyx_t_13 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_t_13 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
__pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
if (likely(__pyx_t_13)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
__Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_14, function);
}
}
__pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_qual, __pyx_n_s_upper); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_11 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
__pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
if (likely(__pyx_t_11)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_12, function);
}
}
__pyx_t_13 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_encode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_t_13 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
__pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
if (likely(__pyx_t_13)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
__Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_12, function);
}
}
__pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
/* "HTSeq/_HTSeq.pyx":1446
*
* if qual != "*":
* swq = SequenceWithQualities( # <<<<<<<<<<<<<<
* seq.upper().encode(), qname, qual.upper().encode())
* else:
*/
__pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1446, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1);
__Pyx_INCREF(__pyx_v_qname);
__Pyx_GIVEREF(__pyx_v_qname);
PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_qname);
__Pyx_GIVEREF(__pyx_t_14);
PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_14);
__pyx_t_1 = 0;
__pyx_t_14 = 0;
__pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_12, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1446, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_v_swq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_14);
__pyx_t_14 = 0;
/* "HTSeq/_HTSeq.pyx":1445
* rname, posint, cigarlist[-1].ref_iv.end, strand)
*
* if qual != "*": # <<<<<<<<<<<<<<
* swq = SequenceWithQualities(
* seq.upper().encode(), qname, qual.upper().encode())
*/
goto __pyx_L11;
}
/* "HTSeq/_HTSeq.pyx":1449
* seq.upper().encode(), qname, qual.upper().encode())
* else:
* swq = SequenceWithQualities( # <<<<<<<<<<<<<<
* seq.upper().encode(), qname, b"", "noquals")
*
*/
/*else*/ {
/* "HTSeq/_HTSeq.pyx":1450
* else:
* swq = SequenceWithQualities(
* seq.upper().encode(), qname, b"", "noquals") # <<<<<<<<<<<<<<
*
* alnmt = SAM_Alignment(swq, iv)
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_seq, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_13 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_13)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
__pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_12)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
__pyx_t_14 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1449
* seq.upper().encode(), qname, qual.upper().encode())
* else:
* swq = SequenceWithQualities( # <<<<<<<<<<<<<<
* seq.upper().encode(), qname, b"", "noquals")
*
*/
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_14);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14);
__Pyx_INCREF(__pyx_v_qname);
__Pyx_GIVEREF(__pyx_v_qname);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_qname);
__Pyx_INCREF(__pyx_kp_b__12);
__Pyx_GIVEREF(__pyx_kp_b__12);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_b__12);
__Pyx_INCREF(__pyx_n_u_noquals);
__Pyx_GIVEREF(__pyx_n_u_noquals);
PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_noquals);
__pyx_t_14 = 0;
__pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_1, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1449, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_swq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_14);
__pyx_t_14 = 0;
}
__pyx_L11:;
/* "HTSeq/_HTSeq.pyx":1452
* seq.upper().encode(), qname, b"", "noquals")
*
* alnmt = SAM_Alignment(swq, iv) # <<<<<<<<<<<<<<
* alnmt.flag = flagint
* alnmt.cigar = cigarlist
*/
__pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_v_swq));
__Pyx_GIVEREF(((PyObject *)__pyx_v_swq));
PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_swq));
__Pyx_INCREF(((PyObject *)__pyx_v_iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
PyTuple_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_v_iv));
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment), __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_v_alnmt = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1453
*
* alnmt = SAM_Alignment(swq, iv)
* alnmt.flag = flagint # <<<<<<<<<<<<<<
* alnmt.cigar = cigarlist
* alnmt.optional_fields = [
*/
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flagint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_alnmt), __pyx_n_s_flag, __pyx_t_1) < 0) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1454
* alnmt = SAM_Alignment(swq, iv)
* alnmt.flag = flagint
* alnmt.cigar = cigarlist # <<<<<<<<<<<<<<
* alnmt.optional_fields = [
* (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]
*/
__Pyx_INCREF(__pyx_v_cigarlist);
__Pyx_GIVEREF(__pyx_v_cigarlist);
__Pyx_GOTREF(__pyx_v_alnmt->cigar);
__Pyx_DECREF(__pyx_v_alnmt->cigar);
__pyx_v_alnmt->cigar = __pyx_v_cigarlist;
/* "HTSeq/_HTSeq.pyx":1455
* alnmt.flag = flagint
* alnmt.cigar = cigarlist
* alnmt.optional_fields = [ # <<<<<<<<<<<<<<
* (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]
* alnmt.aQual = int(mapq)
*/
{ /* enter inner scope */
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_1);
/* "HTSeq/_HTSeq.pyx":1456
* alnmt.cigar = cigarlist
* alnmt.optional_fields = [
* (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields] # <<<<<<<<<<<<<<
* alnmt.aQual = int(mapq)
* alnmt.inferred_insert_size = int(isize)
*/
if (unlikely(__pyx_v_optional_fields == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 1456, __pyx_L14_error)
}
__pyx_t_14 = __pyx_v_optional_fields; __Pyx_INCREF(__pyx_t_14); __pyx_t_5 = 0;
for (;;) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_5); __Pyx_INCREF(__pyx_t_12); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1456, __pyx_L14_error)
#else
__pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1456, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_12);
#endif
__Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_field, __pyx_t_12);
__pyx_t_12 = 0;
__pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_8genexpr6__pyx_v_field, 0, 2, NULL, NULL, &__pyx_slice__37, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1456, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_12);
if (!(likely(PyUnicode_CheckExact(__pyx_8genexpr6__pyx_v_field))||((__pyx_8genexpr6__pyx_v_field) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_8genexpr6__pyx_v_field)->tp_name), 0))) __PYX_ERR(0, 1456, __pyx_L14_error)
__pyx_t_13 = __pyx_f_5HTSeq_6_HTSeq__parse_SAM_optional_field_value(((PyObject*)__pyx_8genexpr6__pyx_v_field)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1456, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1456, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_13);
PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
__pyx_t_12 = 0;
__pyx_t_13 = 0;
if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1455, __pyx_L14_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XDECREF(__pyx_8genexpr6__pyx_v_field); __pyx_8genexpr6__pyx_v_field = 0;
goto __pyx_L17_exit_scope;
__pyx_L14_error:;
__Pyx_XDECREF(__pyx_8genexpr6__pyx_v_field); __pyx_8genexpr6__pyx_v_field = 0;
goto __pyx_L1_error;
__pyx_L17_exit_scope:;
} /* exit inner scope */
/* "HTSeq/_HTSeq.pyx":1455
* alnmt.flag = flagint
* alnmt.cigar = cigarlist
* alnmt.optional_fields = [ # <<<<<<<<<<<<<<
* (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]
* alnmt.aQual = int(mapq)
*/
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_alnmt->optional_fields);
__Pyx_DECREF(__pyx_v_alnmt->optional_fields);
__pyx_v_alnmt->optional_fields = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1457
* alnmt.optional_fields = [
* (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]
* alnmt.aQual = int(mapq) # <<<<<<<<<<<<<<
* alnmt.inferred_insert_size = int(isize)
* alnmt.original_sam_line = line
*/
__pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_mapq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1457, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_alnmt->aQual = __pyx_t_17;
/* "HTSeq/_HTSeq.pyx":1458
* (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]
* alnmt.aQual = int(mapq)
* alnmt.inferred_insert_size = int(isize) # <<<<<<<<<<<<<<
* alnmt.original_sam_line = line
*
*/
__pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_isize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1458, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_alnmt->inferred_insert_size = __pyx_t_17;
/* "HTSeq/_HTSeq.pyx":1459
* alnmt.aQual = int(mapq)
* alnmt.inferred_insert_size = int(isize)
* alnmt.original_sam_line = line # <<<<<<<<<<<<<<
*
* if flagint & 0x0001: # flag "read is paired in sequencing"
*/
if (!(likely(PyUnicode_CheckExact(__pyx_v_line))||((__pyx_v_line) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_line)->tp_name), 0))) __PYX_ERR(0, 1459, __pyx_L1_error)
__pyx_t_1 = __pyx_v_line;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_alnmt->original_sam_line);
__Pyx_DECREF(__pyx_v_alnmt->original_sam_line);
__pyx_v_alnmt->original_sam_line = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1461
* alnmt.original_sam_line = line
*
* if flagint & 0x0001: # flag "read is paired in sequencing" # <<<<<<<<<<<<<<
* if flagint & 0x0008: # flag "mate is unmapped"
* alnmt.mate_start = None
*/
__pyx_t_6 = ((__pyx_v_flagint & 0x0001) != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":1462
*
* if flagint & 0x0001: # flag "read is paired in sequencing"
* if flagint & 0x0008: # flag "mate is unmapped" # <<<<<<<<<<<<<<
* alnmt.mate_start = None
* else:
*/
__pyx_t_6 = ((__pyx_v_flagint & 0x0008) != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":1463
* if flagint & 0x0001: # flag "read is paired in sequencing"
* if flagint & 0x0008: # flag "mate is unmapped"
* alnmt.mate_start = None # <<<<<<<<<<<<<<
* else:
* if mrnm == "*":
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_alnmt->mate_start);
__Pyx_DECREF(((PyObject *)__pyx_v_alnmt->mate_start));
__pyx_v_alnmt->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None);
/* "HTSeq/_HTSeq.pyx":1462
*
* if flagint & 0x0001: # flag "read is paired in sequencing"
* if flagint & 0x0008: # flag "mate is unmapped" # <<<<<<<<<<<<<<
* alnmt.mate_start = None
* else:
*/
goto __pyx_L19;
}
/* "HTSeq/_HTSeq.pyx":1465
* alnmt.mate_start = None
* else:
* if mrnm == "*": # <<<<<<<<<<<<<<
* raise ValueError, "Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared"
* posint = int(mpos) - 1
*/
/*else*/ {
__pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_mrnm, __pyx_kp_u__34, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1465, __pyx_L1_error)
__pyx_t_18 = (__pyx_t_6 != 0);
if (unlikely(__pyx_t_18)) {
/* "HTSeq/_HTSeq.pyx":1466
* else:
* if mrnm == "*":
* raise ValueError, "Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared" # <<<<<<<<<<<<<<
* posint = int(mpos) - 1
* if flagint & 0x0020: # flag "strand of the mate"
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Malformed_SAM_line_MRNM_although, 0, 0);
__PYX_ERR(0, 1466, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1465
* alnmt.mate_start = None
* else:
* if mrnm == "*": # <<<<<<<<<<<<<<
* raise ValueError, "Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared"
* posint = int(mpos) - 1
*/
}
/* "HTSeq/_HTSeq.pyx":1467
* if mrnm == "*":
* raise ValueError, "Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared"
* posint = int(mpos) - 1 # <<<<<<<<<<<<<<
* if flagint & 0x0020: # flag "strand of the mate"
* strand = "-"
*/
__pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_mpos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_14 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_14); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1467, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_v_posint = __pyx_t_17;
/* "HTSeq/_HTSeq.pyx":1468
* raise ValueError, "Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared"
* posint = int(mpos) - 1
* if flagint & 0x0020: # flag "strand of the mate" # <<<<<<<<<<<<<<
* strand = "-"
* else:
*/
__pyx_t_18 = ((__pyx_v_flagint & 0x0020) != 0);
if (__pyx_t_18) {
/* "HTSeq/_HTSeq.pyx":1469
* posint = int(mpos) - 1
* if flagint & 0x0020: # flag "strand of the mate"
* strand = "-" # <<<<<<<<<<<<<<
* else:
* strand = "+"
*/
__Pyx_INCREF(__pyx_kp_u__20);
__Pyx_XDECREF_SET(__pyx_v_strand, __pyx_kp_u__20);
/* "HTSeq/_HTSeq.pyx":1468
* raise ValueError, "Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared"
* posint = int(mpos) - 1
* if flagint & 0x0020: # flag "strand of the mate" # <<<<<<<<<<<<<<
* strand = "-"
* else:
*/
goto __pyx_L21;
}
/* "HTSeq/_HTSeq.pyx":1471
* strand = "-"
* else:
* strand = "+" # <<<<<<<<<<<<<<
* alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
* if alnmt.mate_start.chrom == "=":
*/
/*else*/ {
__Pyx_INCREF(__pyx_kp_u__19);
__Pyx_XDECREF_SET(__pyx_v_strand, __pyx_kp_u__19);
}
__pyx_L21:;
/* "HTSeq/_HTSeq.pyx":1472
* else:
* strand = "+"
* alnmt.mate_start = GenomicPosition(mrnm, posint, strand) # <<<<<<<<<<<<<<
* if alnmt.mate_start.chrom == "=":
* if alnmt.iv is not None:
*/
__pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_posint); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_mrnm);
__Pyx_GIVEREF(__pyx_v_mrnm);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_mrnm);
__Pyx_GIVEREF(__pyx_t_14);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_14);
__Pyx_INCREF(__pyx_v_strand);
__Pyx_GIVEREF(__pyx_v_strand);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_strand);
__pyx_t_14 = 0;
__pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_1, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_14);
__Pyx_GOTREF(__pyx_v_alnmt->mate_start);
__Pyx_DECREF(((PyObject *)__pyx_v_alnmt->mate_start));
__pyx_v_alnmt->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_t_14);
__pyx_t_14 = 0;
/* "HTSeq/_HTSeq.pyx":1473
* strand = "+"
* alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
* if alnmt.mate_start.chrom == "=": # <<<<<<<<<<<<<<
* if alnmt.iv is not None:
* alnmt.mate_start.chrom = alnmt.iv.chrom
*/
__pyx_t_18 = (__Pyx_PyUnicode_Equals(__pyx_v_alnmt->mate_start->__pyx_base.chrom, __pyx_kp_u__33, Py_EQ)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 1473, __pyx_L1_error)
__pyx_t_6 = (__pyx_t_18 != 0);
if (__pyx_t_6) {
/* "HTSeq/_HTSeq.pyx":1474
* alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
* if alnmt.mate_start.chrom == "=":
* if alnmt.iv is not None: # <<<<<<<<<<<<<<
* alnmt.mate_start.chrom = alnmt.iv.chrom
* if flagint & 0x0040:
*/
__pyx_t_6 = (((PyObject *)__pyx_v_alnmt->__pyx_base.__pyx_base.iv) != Py_None);
__pyx_t_18 = (__pyx_t_6 != 0);
if (__pyx_t_18) {
/* "HTSeq/_HTSeq.pyx":1475
* if alnmt.mate_start.chrom == "=":
* if alnmt.iv is not None:
* alnmt.mate_start.chrom = alnmt.iv.chrom # <<<<<<<<<<<<<<
* if flagint & 0x0040:
* alnmt.pe_which = intern("first")
*/
__pyx_t_14 = __pyx_v_alnmt->__pyx_base.__pyx_base.iv->chrom;
__Pyx_INCREF(__pyx_t_14);
__Pyx_GIVEREF(__pyx_t_14);
__Pyx_GOTREF(__pyx_v_alnmt->mate_start->__pyx_base.chrom);
__Pyx_DECREF(__pyx_v_alnmt->mate_start->__pyx_base.chrom);
__pyx_v_alnmt->mate_start->__pyx_base.chrom = ((PyObject*)__pyx_t_14);
__pyx_t_14 = 0;
/* "HTSeq/_HTSeq.pyx":1474
* alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
* if alnmt.mate_start.chrom == "=":
* if alnmt.iv is not None: # <<<<<<<<<<<<<<
* alnmt.mate_start.chrom = alnmt.iv.chrom
* if flagint & 0x0040:
*/
}
/* "HTSeq/_HTSeq.pyx":1473
* strand = "+"
* alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
* if alnmt.mate_start.chrom == "=": # <<<<<<<<<<<<<<
* if alnmt.iv is not None:
* alnmt.mate_start.chrom = alnmt.iv.chrom
*/
}
}
__pyx_L19:;
/* "HTSeq/_HTSeq.pyx":1476
* if alnmt.iv is not None:
* alnmt.mate_start.chrom = alnmt.iv.chrom
* if flagint & 0x0040: # <<<<<<<<<<<<<<
* alnmt.pe_which = intern("first")
* elif flagint & 0x0080:
*/
__pyx_t_18 = ((__pyx_v_flagint & 0x0040) != 0);
if (__pyx_t_18) {
/* "HTSeq/_HTSeq.pyx":1477
* alnmt.mate_start.chrom = alnmt.iv.chrom
* if flagint & 0x0040:
* alnmt.pe_which = intern("first") # <<<<<<<<<<<<<<
* elif flagint & 0x0080:
* alnmt.pe_which = intern("second")
*/
__pyx_t_14 = __Pyx_Intern(__pyx_n_u_first); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_14)->tp_name), 0))) __PYX_ERR(0, 1477, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_14);
__Pyx_GOTREF(__pyx_v_alnmt->pe_which);
__Pyx_DECREF(__pyx_v_alnmt->pe_which);
__pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_14);
__pyx_t_14 = 0;
/* "HTSeq/_HTSeq.pyx":1476
* if alnmt.iv is not None:
* alnmt.mate_start.chrom = alnmt.iv.chrom
* if flagint & 0x0040: # <<<<<<<<<<<<<<
* alnmt.pe_which = intern("first")
* elif flagint & 0x0080:
*/
goto __pyx_L24;
}
/* "HTSeq/_HTSeq.pyx":1478
* if flagint & 0x0040:
* alnmt.pe_which = intern("first")
* elif flagint & 0x0080: # <<<<<<<<<<<<<<
* alnmt.pe_which = intern("second")
* else:
*/
__pyx_t_18 = ((__pyx_v_flagint & 0x0080) != 0);
if (__pyx_t_18) {
/* "HTSeq/_HTSeq.pyx":1479
* alnmt.pe_which = intern("first")
* elif flagint & 0x0080:
* alnmt.pe_which = intern("second") # <<<<<<<<<<<<<<
* else:
* alnmt.pe_which = intern("unknown")
*/
__pyx_t_14 = __Pyx_Intern(__pyx_n_u_second); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1479, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_14)->tp_name), 0))) __PYX_ERR(0, 1479, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_14);
__Pyx_GOTREF(__pyx_v_alnmt->pe_which);
__Pyx_DECREF(__pyx_v_alnmt->pe_which);
__pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_14);
__pyx_t_14 = 0;
/* "HTSeq/_HTSeq.pyx":1478
* if flagint & 0x0040:
* alnmt.pe_which = intern("first")
* elif flagint & 0x0080: # <<<<<<<<<<<<<<
* alnmt.pe_which = intern("second")
* else:
*/
goto __pyx_L24;
}
/* "HTSeq/_HTSeq.pyx":1481
* alnmt.pe_which = intern("second")
* else:
* alnmt.pe_which = intern("unknown") # <<<<<<<<<<<<<<
* else:
* alnmt.mate_start = None
*/
/*else*/ {
__pyx_t_14 = __Pyx_Intern(__pyx_n_u_unknown); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_14)->tp_name), 0))) __PYX_ERR(0, 1481, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_14);
__Pyx_GOTREF(__pyx_v_alnmt->pe_which);
__Pyx_DECREF(__pyx_v_alnmt->pe_which);
__pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_14);
__pyx_t_14 = 0;
}
__pyx_L24:;
/* "HTSeq/_HTSeq.pyx":1461
* alnmt.original_sam_line = line
*
* if flagint & 0x0001: # flag "read is paired in sequencing" # <<<<<<<<<<<<<<
* if flagint & 0x0008: # flag "mate is unmapped"
* alnmt.mate_start = None
*/
goto __pyx_L18;
}
/* "HTSeq/_HTSeq.pyx":1483
* alnmt.pe_which = intern("unknown")
* else:
* alnmt.mate_start = None # <<<<<<<<<<<<<<
* alnmt.pe_which = intern("not_paired_end")
*
*/
/*else*/ {
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_alnmt->mate_start);
__Pyx_DECREF(((PyObject *)__pyx_v_alnmt->mate_start));
__pyx_v_alnmt->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None);
/* "HTSeq/_HTSeq.pyx":1484
* else:
* alnmt.mate_start = None
* alnmt.pe_which = intern("not_paired_end") # <<<<<<<<<<<<<<
*
* alnmt.proper_pair = flagint & 0x0002 > 0
*/
__pyx_t_14 = __Pyx_Intern(__pyx_n_u_not_paired_end); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1484, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_14)->tp_name), 0))) __PYX_ERR(0, 1484, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_14);
__Pyx_GOTREF(__pyx_v_alnmt->pe_which);
__Pyx_DECREF(__pyx_v_alnmt->pe_which);
__pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_14);
__pyx_t_14 = 0;
}
__pyx_L18:;
/* "HTSeq/_HTSeq.pyx":1486
* alnmt.pe_which = intern("not_paired_end")
*
* alnmt.proper_pair = flagint & 0x0002 > 0 # <<<<<<<<<<<<<<
* alnmt.not_primary_alignment = flagint & 0x0100 > 0
* alnmt.failed_platform_qc = flagint & 0x0200 > 0
*/
__pyx_v_alnmt->proper_pair = ((__pyx_v_flagint & 0x0002) > 0);
/* "HTSeq/_HTSeq.pyx":1487
*
* alnmt.proper_pair = flagint & 0x0002 > 0
* alnmt.not_primary_alignment = flagint & 0x0100 > 0 # <<<<<<<<<<<<<<
* alnmt.failed_platform_qc = flagint & 0x0200 > 0
* alnmt.pcr_or_optical_duplicate = flagint & 0x0400 > 0
*/
__pyx_v_alnmt->not_primary_alignment = ((__pyx_v_flagint & 0x0100) > 0);
/* "HTSeq/_HTSeq.pyx":1488
* alnmt.proper_pair = flagint & 0x0002 > 0
* alnmt.not_primary_alignment = flagint & 0x0100 > 0
* alnmt.failed_platform_qc = flagint & 0x0200 > 0 # <<<<<<<<<<<<<<
* alnmt.pcr_or_optical_duplicate = flagint & 0x0400 > 0
* alnmt.supplementary = flagint & 0x0800 > 0
*/
__pyx_v_alnmt->failed_platform_qc = ((__pyx_v_flagint & 0x0200) > 0);
/* "HTSeq/_HTSeq.pyx":1489
* alnmt.not_primary_alignment = flagint & 0x0100 > 0
* alnmt.failed_platform_qc = flagint & 0x0200 > 0
* alnmt.pcr_or_optical_duplicate = flagint & 0x0400 > 0 # <<<<<<<<<<<<<<
* alnmt.supplementary = flagint & 0x0800 > 0
*
*/
__pyx_v_alnmt->pcr_or_optical_duplicate = ((__pyx_v_flagint & 0x0400) > 0);
/* "HTSeq/_HTSeq.pyx":1490
* alnmt.failed_platform_qc = flagint & 0x0200 > 0
* alnmt.pcr_or_optical_duplicate = flagint & 0x0400 > 0
* alnmt.supplementary = flagint & 0x0800 > 0 # <<<<<<<<<<<<<<
*
* return alnmt
*/
__pyx_v_alnmt->supplementary = ((__pyx_v_flagint & 0x0800) > 0);
/* "HTSeq/_HTSeq.pyx":1492
* alnmt.supplementary = flagint & 0x0800 > 0
*
* return alnmt # <<<<<<<<<<<<<<
*
* property flag:
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_alnmt));
__pyx_r = ((PyObject *)__pyx_v_alnmt);
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1407
*
* @classmethod
* def from_SAM_line(cls, line): # <<<<<<<<<<<<<<
* cdef str qname, flag, rname, pos, mapq, cigar,
* cdef str mrnm, mpos, isize, seq, qual
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.from_SAM_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_qname);
__Pyx_XDECREF(__pyx_v_flag);
__Pyx_XDECREF(__pyx_v_rname);
__Pyx_XDECREF(__pyx_v_pos);
__Pyx_XDECREF(__pyx_v_mapq);
__Pyx_XDECREF(__pyx_v_cigar);
__Pyx_XDECREF(__pyx_v_mrnm);
__Pyx_XDECREF(__pyx_v_mpos);
__Pyx_XDECREF(__pyx_v_isize);
__Pyx_XDECREF(__pyx_v_seq);
__Pyx_XDECREF(__pyx_v_qual);
__Pyx_XDECREF(__pyx_v_optional_fields);
__Pyx_XDECREF(__pyx_v_strand);
__Pyx_XDECREF(__pyx_v_cigarlist);
__Pyx_XDECREF((PyObject *)__pyx_v_swq);
__Pyx_XDECREF(__pyx_v_fields);
__Pyx_XDECREF((PyObject *)__pyx_v_iv);
__Pyx_XDECREF((PyObject *)__pyx_v_alnmt);
__Pyx_XDECREF(__pyx_8genexpr6__pyx_v_field);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1495
*
* property flag:
* def __get__(self): # <<<<<<<<<<<<<<
* return self._flag
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":1496
* property flag:
* def __get__(self):
* return self._flag # <<<<<<<<<<<<<<
*
* def __set__(self, value):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1495
*
* property flag:
* def __get__(self): # <<<<<<<<<<<<<<
* return self._flag
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.flag.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1498
* return self._flag
*
* def __set__(self, value): # <<<<<<<<<<<<<<
* self._flag = value
*
*/
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
/* "HTSeq/_HTSeq.pyx":1499
*
* def __set__(self, value):
* self._flag = value # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1499, __pyx_L1_error)
__pyx_v_self->_flag = __pyx_t_1;
/* "HTSeq/_HTSeq.pyx":1498
* return self._flag
*
* def __set__(self, value): # <<<<<<<<<<<<<<
* self._flag = value
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.flag.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1502
*
* @property
* def paired_end(self): # <<<<<<<<<<<<<<
* return self.pe_which != "not_paired_end"
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":1503
* @property
* def paired_end(self):
* return self.pe_which != "not_paired_end" # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->pe_which, __pyx_n_u_not_paired_end, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1503, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1503, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1502
*
* @property
* def paired_end(self): # <<<<<<<<<<<<<<
* return self.pe_which != "not_paired_end"
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.paired_end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1506
*
* @property
* def mate_aligned(self): # <<<<<<<<<<<<<<
* return self.mate_start is not None
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "HTSeq/_HTSeq.pyx":1507
* @property
* def mate_aligned(self):
* return self.mate_start is not None # <<<<<<<<<<<<<<
*
* def get_sam_line(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = (((PyObject *)__pyx_v_self->mate_start) != Py_None);
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1507, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1506
*
* @property
* def mate_aligned(self): # <<<<<<<<<<<<<<
* return self.mate_start is not None
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.mate_aligned.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1509
* return self.mate_start is not None
*
* def get_sam_line(self): # <<<<<<<<<<<<<<
* cdef str cigar = ""
* cdef GenomicInterval query_start, mate_start
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_sam_line (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10get_sam_line(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10get_sam_line(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_v_cigar = 0;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_query_start = 0;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_mate_start = 0;
struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_cop = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
Py_ssize_t __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
__Pyx_RefNannySetupContext("get_sam_line", 0);
/* "HTSeq/_HTSeq.pyx":1510
*
* def get_sam_line(self):
* cdef str cigar = "" # <<<<<<<<<<<<<<
* cdef GenomicInterval query_start, mate_start
* cdef CigarOperation cop
*/
__Pyx_INCREF(__pyx_kp_u__12);
__pyx_v_cigar = __pyx_kp_u__12;
/* "HTSeq/_HTSeq.pyx":1514
* cdef CigarOperation cop
*
* if self.aligned: # <<<<<<<<<<<<<<
* query_start = self.iv
* else:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_aligned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1514, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":1515
*
* if self.aligned:
* query_start = self.iv # <<<<<<<<<<<<<<
* else:
* query_start = GenomicPosition("*", -1)
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv);
__Pyx_INCREF(__pyx_t_1);
__pyx_v_query_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1514
* cdef CigarOperation cop
*
* if self.aligned: # <<<<<<<<<<<<<<
* query_start = self.iv
* else:
*/
goto __pyx_L3;
}
/* "HTSeq/_HTSeq.pyx":1517
* query_start = self.iv
* else:
* query_start = GenomicPosition("*", -1) # <<<<<<<<<<<<<<
*
* if self.mate_start is not None:
*/
/*else*/ {
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_query_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
}
__pyx_L3:;
/* "HTSeq/_HTSeq.pyx":1519
* query_start = GenomicPosition("*", -1)
*
* if self.mate_start is not None: # <<<<<<<<<<<<<<
* mate_start = self.mate_start
* else:
*/
__pyx_t_2 = (((PyObject *)__pyx_v_self->mate_start) != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "HTSeq/_HTSeq.pyx":1520
*
* if self.mate_start is not None:
* mate_start = self.mate_start # <<<<<<<<<<<<<<
* else:
* mate_start = GenomicPosition("*", -1)
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->mate_start);
__Pyx_INCREF(__pyx_t_1);
__pyx_v_mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1519
* query_start = GenomicPosition("*", -1)
*
* if self.mate_start is not None: # <<<<<<<<<<<<<<
* mate_start = self.mate_start
* else:
*/
goto __pyx_L4;
}
/* "HTSeq/_HTSeq.pyx":1522
* mate_start = self.mate_start
* else:
* mate_start = GenomicPosition("*", -1) # <<<<<<<<<<<<<<
*
* if self.cigar is not None:
*/
/*else*/ {
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1522, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
}
__pyx_L4:;
/* "HTSeq/_HTSeq.pyx":1524
* mate_start = GenomicPosition("*", -1)
*
* if self.cigar is not None: # <<<<<<<<<<<<<<
* for cop in self.cigar:
* cigar += str(cop.size) + cop.type
*/
__pyx_t_3 = (__pyx_v_self->cigar != ((PyObject*)Py_None));
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "HTSeq/_HTSeq.pyx":1525
*
* if self.cigar is not None:
* for cop in self.cigar: # <<<<<<<<<<<<<<
* cigar += str(cop.size) + cop.type
* else:
*/
if (unlikely(__pyx_v_self->cigar == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 1525, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->cigar; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
for (;;) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1525, __pyx_L1_error)
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1525, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5HTSeq_6_HTSeq_CigarOperation))))) __PYX_ERR(0, 1525, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_cop, ((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_t_5));
__pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":1526
* if self.cigar is not None:
* for cop in self.cigar:
* cigar += str(cop.size) + cop.type # <<<<<<<<<<<<<<
* else:
* cigar = "*"
*/
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cop->size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1526, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_6, __pyx_v_cop->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_v_cigar, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1526, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_cigar, ((PyObject*)__pyx_t_6));
__pyx_t_6 = 0;
/* "HTSeq/_HTSeq.pyx":1525
*
* if self.cigar is not None:
* for cop in self.cigar: # <<<<<<<<<<<<<<
* cigar += str(cop.size) + cop.type
* else:
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1524
* mate_start = GenomicPosition("*", -1)
*
* if self.cigar is not None: # <<<<<<<<<<<<<<
* for cop in self.cigar:
* cigar += str(cop.size) + cop.type
*/
goto __pyx_L5;
}
/* "HTSeq/_HTSeq.pyx":1528
* cigar += str(cop.size) + cop.type
* else:
* cigar = "*" # <<<<<<<<<<<<<<
*
* return '\t'.join(
*/
/*else*/ {
__Pyx_INCREF(__pyx_kp_u__34);
__Pyx_DECREF_SET(__pyx_v_cigar, __pyx_kp_u__34);
}
__pyx_L5:;
/* "HTSeq/_HTSeq.pyx":1530
* cigar = "*"
*
* return '\t'.join( # <<<<<<<<<<<<<<
* (self.read.name,
* str(self.flag),
*/
__Pyx_XDECREF(__pyx_r);
/* "HTSeq/_HTSeq.pyx":1531
*
* return '\t'.join(
* (self.read.name, # <<<<<<<<<<<<<<
* str(self.flag),
* query_start.chrom,
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1531, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1532
* return '\t'.join(
* (self.read.name,
* str(self.flag), # <<<<<<<<<<<<<<
* query_start.chrom,
* str(query_start.start + 1),
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1534
* str(self.flag),
* query_start.chrom,
* str(query_start.start + 1), # <<<<<<<<<<<<<<
* str(self.aQual),
* cigar,
*/
__pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_query_start->start + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1535
* query_start.chrom,
* str(query_start.start + 1),
* str(self.aQual), # <<<<<<<<<<<<<<
* cigar,
* mate_start.chrom,
*/
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1538
* cigar,
* mate_start.chrom,
* str(mate_start.pos + 1), # <<<<<<<<<<<<<<
* str(self.inferred_insert_size),
* self.read_as_aligned.seq.decode(),
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mate_start), __pyx_n_s_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "HTSeq/_HTSeq.pyx":1539
* mate_start.chrom,
* str(mate_start.pos + 1),
* str(self.inferred_insert_size), # <<<<<<<<<<<<<<
* self.read_as_aligned.seq.decode(),
* self.read_as_aligned.qualstr.decode(),
*/
__pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1539, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1539, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "HTSeq/_HTSeq.pyx":1540
* str(mate_start.pos + 1),
* str(self.inferred_insert_size),
* self.read_as_aligned.seq.decode(), # <<<<<<<<<<<<<<
* self.read_as_aligned.qualstr.decode(),
* '\t'.join(self.raw_optional_fields())))
*/
if (unlikely(__pyx_v_self->__pyx_base.read_as_aligned->__pyx_base.seq == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
__PYX_ERR(0, 1540, __pyx_L1_error)
}
__pyx_t_9 = __Pyx_decode_bytes(__pyx_v_self->__pyx_base.read_as_aligned->__pyx_base.seq, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1540, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
/* "HTSeq/_HTSeq.pyx":1541
* str(self.inferred_insert_size),
* self.read_as_aligned.seq.decode(),
* self.read_as_aligned.qualstr.decode(), # <<<<<<<<<<<<<<
* '\t'.join(self.raw_optional_fields())))
*
*/
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned), __pyx_n_s_qualstr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1541, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_decode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1541, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
__pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
if (likely(__pyx_t_12)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_13, function);
}
}
__pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1541, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
/* "HTSeq/_HTSeq.pyx":1542
* self.read_as_aligned.seq.decode(),
* self.read_as_aligned.qualstr.decode(),
* '\t'.join(self.raw_optional_fields()))) # <<<<<<<<<<<<<<
*
* def optional_field(SAM_Alignment self, str tag):
*/
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raw_optional_fields); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1542, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_14 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
__pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
if (likely(__pyx_t_14)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
__Pyx_INCREF(__pyx_t_14);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_12, function);
}
}
__pyx_t_13 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1542, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = PyUnicode_Join(__pyx_kp_u__21, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1542, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
/* "HTSeq/_HTSeq.pyx":1531
*
* return '\t'.join(
* (self.read.name, # <<<<<<<<<<<<<<
* str(self.flag),
* query_start.chrom,
*/
__pyx_t_13 = PyTuple_New(12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1531, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_5);
__Pyx_INCREF(__pyx_v_query_start->chrom);
__Pyx_GIVEREF(__pyx_v_query_start->chrom);
PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_query_start->chrom);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_8);
__Pyx_INCREF(__pyx_v_cigar);
__Pyx_GIVEREF(__pyx_v_cigar);
PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_v_cigar);
__Pyx_INCREF(__pyx_v_mate_start->chrom);
__Pyx_GIVEREF(__pyx_v_mate_start->chrom);
PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_v_mate_start->chrom);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_13, 9, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_13, 10, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_13, 11, __pyx_t_12);
__pyx_t_6 = 0;
__pyx_t_5 = 0;
__pyx_t_7 = 0;
__pyx_t_8 = 0;
__pyx_t_1 = 0;
__pyx_t_10 = 0;
__pyx_t_9 = 0;
__pyx_t_11 = 0;
__pyx_t_12 = 0;
/* "HTSeq/_HTSeq.pyx":1530
* cigar = "*"
*
* return '\t'.join( # <<<<<<<<<<<<<<
* (self.read.name,
* str(self.flag),
*/
__pyx_t_12 = PyUnicode_Join(__pyx_kp_u__21, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_r = __pyx_t_12;
__pyx_t_12 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1509
* return self.mate_start is not None
*
* def get_sam_line(self): # <<<<<<<<<<<<<<
* cdef str cigar = ""
* cdef GenomicInterval query_start, mate_start
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.get_sam_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_cigar);
__Pyx_XDECREF((PyObject *)__pyx_v_query_start);
__Pyx_XDECREF((PyObject *)__pyx_v_mate_start);
__Pyx_XDECREF((PyObject *)__pyx_v_cop);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1544
* '\t'.join(self.raw_optional_fields())))
*
* def optional_field(SAM_Alignment self, str tag): # <<<<<<<<<<<<<<
* res = [p for p in self.optional_fields if p[0] == tag]
* if len(res) == 1:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13optional_field(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13optional_field(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("optional_field (wrapper)", 0);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tag), (&PyUnicode_Type), 1, "tag", 1))) __PYX_ERR(0, 1544, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12optional_field(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject*)__pyx_v_tag));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12optional_field(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_tag) {
PyObject *__pyx_v_res = NULL;
PyObject *__pyx_8genexpr7__pyx_v_p = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
__Pyx_RefNannySetupContext("optional_field", 0);
/* "HTSeq/_HTSeq.pyx":1545
*
* def optional_field(SAM_Alignment self, str tag):
* res = [p for p in self.optional_fields if p[0] == tag] # <<<<<<<<<<<<<<
* if len(res) == 1:
* return res[0][1]
*/
{ /* enter inner scope */
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_1);
if (unlikely(__pyx_v_self->optional_fields == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 1545, __pyx_L5_error)
}
__pyx_t_2 = __pyx_v_self->optional_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
for (;;) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1545, __pyx_L5_error)
#else
__pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1545, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_p, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_GetItemInt(__pyx_8genexpr7__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1545, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_v_tag, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1545, __pyx_L5_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr7__pyx_v_p))) __PYX_ERR(0, 1545, __pyx_L5_error)
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_8genexpr7__pyx_v_p); __pyx_8genexpr7__pyx_v_p = 0;
goto __pyx_L9_exit_scope;
__pyx_L5_error:;
__Pyx_XDECREF(__pyx_8genexpr7__pyx_v_p); __pyx_8genexpr7__pyx_v_p = 0;
goto __pyx_L1_error;
__pyx_L9_exit_scope:;
} /* exit inner scope */
__pyx_v_res = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1546
* def optional_field(SAM_Alignment self, str tag):
* res = [p for p in self.optional_fields if p[0] == tag]
* if len(res) == 1: # <<<<<<<<<<<<<<
* return res[0][1]
* else:
*/
__pyx_t_3 = PyList_GET_SIZE(__pyx_v_res); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1546, __pyx_L1_error)
__pyx_t_5 = ((__pyx_t_3 == 1) != 0);
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1547
* res = [p for p in self.optional_fields if p[0] == tag]
* if len(res) == 1:
* return res[0][1] # <<<<<<<<<<<<<<
* else:
* if len(res) == 0:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1547, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1547, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1546
* def optional_field(SAM_Alignment self, str tag):
* res = [p for p in self.optional_fields if p[0] == tag]
* if len(res) == 1: # <<<<<<<<<<<<<<
* return res[0][1]
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":1549
* return res[0][1]
* else:
* if len(res) == 0: # <<<<<<<<<<<<<<
* raise KeyError, "SAM optional field tag %s not found" % tag
* else:
*/
/*else*/ {
__pyx_t_3 = PyList_GET_SIZE(__pyx_v_res); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1549, __pyx_L1_error)
__pyx_t_5 = ((__pyx_t_3 == 0) != 0);
if (unlikely(__pyx_t_5)) {
/* "HTSeq/_HTSeq.pyx":1550
* else:
* if len(res) == 0:
* raise KeyError, "SAM optional field tag %s not found" % tag # <<<<<<<<<<<<<<
* else:
* raise ValueError, "SAM optional field tag %s not unique" % tag
*/
__pyx_t_2 = PyUnicode_Format(__pyx_kp_u_SAM_optional_field_tag_s_not_fou, __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1550, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_builtin_KeyError, __pyx_t_2, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(0, 1550, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1549
* return res[0][1]
* else:
* if len(res) == 0: # <<<<<<<<<<<<<<
* raise KeyError, "SAM optional field tag %s not found" % tag
* else:
*/
}
/* "HTSeq/_HTSeq.pyx":1552
* raise KeyError, "SAM optional field tag %s not found" % tag
* else:
* raise ValueError, "SAM optional field tag %s not unique" % tag # <<<<<<<<<<<<<<
*
* def raw_optional_fields(self):
*/
/*else*/ {
__pyx_t_2 = PyUnicode_Format(__pyx_kp_u_SAM_optional_field_tag_s_not_uni, __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_2, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(0, 1552, __pyx_L1_error)
}
}
/* "HTSeq/_HTSeq.pyx":1544
* '\t'.join(self.raw_optional_fields())))
*
* def optional_field(SAM_Alignment self, str tag): # <<<<<<<<<<<<<<
* res = [p for p in self.optional_fields if p[0] == tag]
* if len(res) == 1:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.optional_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_res);
__Pyx_XDECREF(__pyx_8genexpr7__pyx_v_p);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1554
* raise ValueError, "SAM optional field tag %s not unique" % tag
*
* def raw_optional_fields(self): # <<<<<<<<<<<<<<
* res = []
* for op in self.optional_fields:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15raw_optional_fields(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15raw_optional_fields(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("raw_optional_fields (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_14raw_optional_fields(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_14raw_optional_fields(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_v_res = NULL;
PyObject *__pyx_v_op = NULL;
PyObject *__pyx_v_tc = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
Py_ssize_t __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
__Pyx_RefNannySetupContext("raw_optional_fields", 0);
/* "HTSeq/_HTSeq.pyx":1555
*
* def raw_optional_fields(self):
* res = [] # <<<<<<<<<<<<<<
* for op in self.optional_fields:
* if op[1].__class__ == str:
*/
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_res = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1556
* def raw_optional_fields(self):
* res = []
* for op in self.optional_fields: # <<<<<<<<<<<<<<
* if op[1].__class__ == str:
* if len(op[1]) == 1:
*/
if (unlikely(__pyx_v_self->optional_fields == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 1556, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_self->optional_fields; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
for (;;) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1556, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1556, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
__Pyx_XDECREF_SET(__pyx_v_op, __pyx_t_3);
__pyx_t_3 = 0;
/* "HTSeq/_HTSeq.pyx":1557
* res = []
* for op in self.optional_fields:
* if op[1].__class__ == str: # <<<<<<<<<<<<<<
* if len(op[1]) == 1:
* tc = "A"
*/
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1557, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1557, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1558
* for op in self.optional_fields:
* if op[1].__class__ == str:
* if len(op[1]) == 1: # <<<<<<<<<<<<<<
* tc = "A"
* else:
*/
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1558, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = ((__pyx_t_6 == 1) != 0);
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1559
* if op[1].__class__ == str:
* if len(op[1]) == 1:
* tc = "A" # <<<<<<<<<<<<<<
* else:
* tc = "Z"
*/
__Pyx_INCREF(__pyx_n_u_A);
__Pyx_XDECREF_SET(__pyx_v_tc, __pyx_n_u_A);
/* "HTSeq/_HTSeq.pyx":1558
* for op in self.optional_fields:
* if op[1].__class__ == str:
* if len(op[1]) == 1: # <<<<<<<<<<<<<<
* tc = "A"
* else:
*/
goto __pyx_L6;
}
/* "HTSeq/_HTSeq.pyx":1561
* tc = "A"
* else:
* tc = "Z" # <<<<<<<<<<<<<<
* elif op[1].__class__ == int:
* tc = "i"
*/
/*else*/ {
__Pyx_INCREF(__pyx_n_u_Z);
__Pyx_XDECREF_SET(__pyx_v_tc, __pyx_n_u_Z);
}
__pyx_L6:;
/* "HTSeq/_HTSeq.pyx":1557
* res = []
* for op in self.optional_fields:
* if op[1].__class__ == str: # <<<<<<<<<<<<<<
* if len(op[1]) == 1:
* tc = "A"
*/
goto __pyx_L5;
}
/* "HTSeq/_HTSeq.pyx":1562
* else:
* tc = "Z"
* elif op[1].__class__ == int: # <<<<<<<<<<<<<<
* tc = "i"
* elif op[1].__class__ == float:
*/
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1562, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1562, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1563
* tc = "Z"
* elif op[1].__class__ == int:
* tc = "i" # <<<<<<<<<<<<<<
* elif op[1].__class__ == float:
* tc = "j"
*/
__Pyx_INCREF(__pyx_n_u_i);
__Pyx_XDECREF_SET(__pyx_v_tc, __pyx_n_u_i);
/* "HTSeq/_HTSeq.pyx":1562
* else:
* tc = "Z"
* elif op[1].__class__ == int: # <<<<<<<<<<<<<<
* tc = "i"
* elif op[1].__class__ == float:
*/
goto __pyx_L5;
}
/* "HTSeq/_HTSeq.pyx":1564
* elif op[1].__class__ == int:
* tc = "i"
* elif op[1].__class__ == float: # <<<<<<<<<<<<<<
* tc = "j"
* else:
*/
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1564, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1564, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1564, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1564, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1565
* tc = "i"
* elif op[1].__class__ == float:
* tc = "j" # <<<<<<<<<<<<<<
* else:
* tc = "H"
*/
__Pyx_INCREF(__pyx_n_u_j);
__Pyx_XDECREF_SET(__pyx_v_tc, __pyx_n_u_j);
/* "HTSeq/_HTSeq.pyx":1564
* elif op[1].__class__ == int:
* tc = "i"
* elif op[1].__class__ == float: # <<<<<<<<<<<<<<
* tc = "j"
* else:
*/
goto __pyx_L5;
}
/* "HTSeq/_HTSeq.pyx":1567
* tc = "j"
* else:
* tc = "H" # <<<<<<<<<<<<<<
* res.append(":".join([op[0], tc, str(op[1])]))
* return res
*/
/*else*/ {
__Pyx_INCREF(__pyx_n_u_H);
__Pyx_XDECREF_SET(__pyx_v_tc, __pyx_n_u_H);
}
__pyx_L5:;
/* "HTSeq/_HTSeq.pyx":1568
* else:
* tc = "H"
* res.append(":".join([op[0], tc, str(op[1])])) # <<<<<<<<<<<<<<
* return res
*
*/
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_INCREF(__pyx_v_tc);
__Pyx_GIVEREF(__pyx_v_tc);
PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_tc);
__Pyx_GIVEREF(__pyx_t_7);
PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_7);
__pyx_t_3 = 0;
__pyx_t_7 = 0;
__pyx_t_7 = PyUnicode_Join(__pyx_kp_u__10, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_8 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1568, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "HTSeq/_HTSeq.pyx":1556
* def raw_optional_fields(self):
* res = []
* for op in self.optional_fields: # <<<<<<<<<<<<<<
* if op[1].__class__ == str:
* if len(op[1]) == 1:
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1569
* tc = "H"
* res.append(":".join([op[0], tc, str(op[1])]))
* return res # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_res);
__pyx_r = __pyx_v_res;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1554
* raise ValueError, "SAM optional field tag %s not unique" % tag
*
* def raw_optional_fields(self): # <<<<<<<<<<<<<<
* res = []
* for op in self.optional_fields:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.raw_optional_fields", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_res);
__Pyx_XDECREF(__pyx_v_op);
__Pyx_XDECREF(__pyx_v_tc);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":51
*
* cdef class SAM_Alignment(AlignmentWithSequenceReversal):
* cdef public list cigar # <<<<<<<<<<<<<<
* cdef public int aQual
* cdef public GenomicPosition mate_start
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->cigar);
__pyx_r = __pyx_v_self->cigar;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 51, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->cigar);
__Pyx_DECREF(__pyx_v_self->cigar);
__pyx_v_self->cigar = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.cigar.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->cigar);
__Pyx_DECREF(__pyx_v_self->cigar);
__pyx_v_self->cigar = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":52
* cdef class SAM_Alignment(AlignmentWithSequenceReversal):
* cdef public list cigar
* cdef public int aQual # <<<<<<<<<<<<<<
* cdef public GenomicPosition mate_start
* cdef public str pe_which
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 52, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.aQual.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L1_error)
__pyx_v_self->aQual = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.aQual.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":53
* cdef public list cigar
* cdef public int aQual
* cdef public GenomicPosition mate_start # <<<<<<<<<<<<<<
* cdef public str pe_which
* cdef public int inferred_insert_size
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->mate_start));
__pyx_r = ((PyObject *)__pyx_v_self->mate_start);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition))))) __PYX_ERR(1, 53, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->mate_start);
__Pyx_DECREF(((PyObject *)__pyx_v_self->mate_start));
__pyx_v_self->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.mate_start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->mate_start);
__Pyx_DECREF(((PyObject *)__pyx_v_self->mate_start));
__pyx_v_self->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":54
* cdef public int aQual
* cdef public GenomicPosition mate_start
* cdef public str pe_which # <<<<<<<<<<<<<<
* cdef public int inferred_insert_size
* cdef public bint proper_pair
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->pe_which);
__pyx_r = __pyx_v_self->pe_which;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 54, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->pe_which);
__Pyx_DECREF(__pyx_v_self->pe_which);
__pyx_v_self->pe_which = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.pe_which.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->pe_which);
__Pyx_DECREF(__pyx_v_self->pe_which);
__pyx_v_self->pe_which = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":55
* cdef public GenomicPosition mate_start
* cdef public str pe_which
* cdef public int inferred_insert_size # <<<<<<<<<<<<<<
* cdef public bint proper_pair
* cdef public bint not_primary_alignment
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.inferred_insert_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L1_error)
__pyx_v_self->inferred_insert_size = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.inferred_insert_size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":56
* cdef public str pe_which
* cdef public int inferred_insert_size
* cdef public bint proper_pair # <<<<<<<<<<<<<<
* cdef public bint not_primary_alignment
* cdef public bint failed_platform_qc
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->proper_pair); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.proper_pair.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L1_error)
__pyx_v_self->proper_pair = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.proper_pair.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":57
* cdef public int inferred_insert_size
* cdef public bint proper_pair
* cdef public bint not_primary_alignment # <<<<<<<<<<<<<<
* cdef public bint failed_platform_qc
* cdef public bint pcr_or_optical_duplicate
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->not_primary_alignment); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 57, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.not_primary_alignment.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 57, __pyx_L1_error)
__pyx_v_self->not_primary_alignment = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.not_primary_alignment.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":58
* cdef public bint proper_pair
* cdef public bint not_primary_alignment
* cdef public bint failed_platform_qc # <<<<<<<<<<<<<<
* cdef public bint pcr_or_optical_duplicate
* cdef public bint supplementary
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->failed_platform_qc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.failed_platform_qc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error)
__pyx_v_self->failed_platform_qc = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.failed_platform_qc.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":59
* cdef public bint not_primary_alignment
* cdef public bint failed_platform_qc
* cdef public bint pcr_or_optical_duplicate # <<<<<<<<<<<<<<
* cdef public bint supplementary
* cdef readonly str original_sam_line
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->pcr_or_optical_duplicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.pcr_or_optical_duplicate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 59, __pyx_L1_error)
__pyx_v_self->pcr_or_optical_duplicate = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.pcr_or_optical_duplicate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":60
* cdef public bint failed_platform_qc
* cdef public bint pcr_or_optical_duplicate
* cdef public bint supplementary # <<<<<<<<<<<<<<
* cdef readonly str original_sam_line
* cdef int _flag
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->supplementary); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.supplementary.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 60, __pyx_L1_error)
__pyx_v_self->supplementary = __pyx_t_1;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.supplementary.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":61
* cdef public bint pcr_or_optical_duplicate
* cdef public bint supplementary
* cdef readonly str original_sam_line # <<<<<<<<<<<<<<
* cdef int _flag
* cdef public list optional_fields
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->original_sam_line);
__pyx_r = __pyx_v_self->original_sam_line;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pxd":63
* cdef readonly str original_sam_line
* cdef int _flag
* cdef public list optional_fields # <<<<<<<<<<<<<<
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->optional_fields);
__pyx_r = __pyx_v_self->optional_fields;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__set__", 0);
if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 63, __pyx_L1_error)
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->optional_fields);
__Pyx_DECREF(__pyx_v_self->optional_fields);
__pyx_v_self->optional_fields = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.optional_fields.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->optional_fields);
__Pyx_DECREF(__pyx_v_self->optional_fields);
__pyx_v_self->optional_fields = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_16__reduce_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_16__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
PyObject *__pyx_v_state = 0;
PyObject *__pyx_v__dict = 0;
int __pyx_v_use_setstate;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
int __pyx_t_11;
int __pyx_t_12;
__Pyx_RefNannySetupContext("__reduce_cython__", 0);
/* "(tree fragment)":5
* cdef object _dict
* cdef bint use_setstate
* state = (self._flag, self._read, self._read_as_sequenced, self.aQual, self.cigar, self.failed_platform_qc, self.inferred_insert_size, self.iv, self.mate_start, self.not_primary_alignment, self.optional_fields, self.original_sam_line, self.pcr_or_optical_duplicate, self.pe_which, self.proper_pair, self.read_as_aligned, self.supplementary) # <<<<<<<<<<<<<<
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
*/
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->failed_platform_qc); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->not_primary_alignment); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->pcr_or_optical_duplicate); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->proper_pair); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_self->supplementary); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PyTuple_New(17); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read));
PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read));
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_2);
__Pyx_INCREF(__pyx_v_self->cigar);
__Pyx_GIVEREF(__pyx_v_self->cigar);
PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_self->cigar);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
PyTuple_SET_ITEM(__pyx_t_9, 7, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
__Pyx_INCREF(((PyObject *)__pyx_v_self->mate_start));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->mate_start));
PyTuple_SET_ITEM(__pyx_t_9, 8, ((PyObject *)__pyx_v_self->mate_start));
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_9, 9, __pyx_t_5);
__Pyx_INCREF(__pyx_v_self->optional_fields);
__Pyx_GIVEREF(__pyx_v_self->optional_fields);
PyTuple_SET_ITEM(__pyx_t_9, 10, __pyx_v_self->optional_fields);
__Pyx_INCREF(__pyx_v_self->original_sam_line);
__Pyx_GIVEREF(__pyx_v_self->original_sam_line);
PyTuple_SET_ITEM(__pyx_t_9, 11, __pyx_v_self->original_sam_line);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_9, 12, __pyx_t_6);
__Pyx_INCREF(__pyx_v_self->pe_which);
__Pyx_GIVEREF(__pyx_v_self->pe_which);
PyTuple_SET_ITEM(__pyx_t_9, 13, __pyx_v_self->pe_which);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_9, 14, __pyx_t_7);
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
PyTuple_SET_ITEM(__pyx_t_9, 15, ((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_9, 16, __pyx_t_8);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_t_6 = 0;
__pyx_t_7 = 0;
__pyx_t_8 = 0;
__pyx_v_state = ((PyObject*)__pyx_t_9);
__pyx_t_9 = 0;
/* "(tree fragment)":6
* cdef bint use_setstate
* state = (self._flag, self._read, self._read_as_sequenced, self.aQual, self.cigar, self.failed_platform_qc, self.inferred_insert_size, self.iv, self.mate_start, self.not_primary_alignment, self.optional_fields, self.original_sam_line, self.pcr_or_optical_duplicate, self.pe_which, self.proper_pair, self.read_as_aligned, self.supplementary)
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
* if _dict is not None:
* state += (_dict,)
*/
__pyx_t_9 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_v__dict = __pyx_t_9;
__pyx_t_9 = 0;
/* "(tree fragment)":7
* state = (self._flag, self._read, self._read_as_sequenced, self.aQual, self.cigar, self.failed_platform_qc, self.inferred_insert_size, self.iv, self.mate_start, self.not_primary_alignment, self.optional_fields, self.original_sam_line, self.pcr_or_optical_duplicate, self.pe_which, self.proper_pair, self.read_as_aligned, self.supplementary)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
__pyx_t_10 = (__pyx_v__dict != Py_None);
__pyx_t_11 = (__pyx_t_10 != 0);
if (__pyx_t_11) {
/* "(tree fragment)":8
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
* state += (_dict,) # <<<<<<<<<<<<<<
* use_setstate = True
* else:
*/
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v__dict);
__Pyx_GIVEREF(__pyx_v__dict);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v__dict);
__pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_8));
__pyx_t_8 = 0;
/* "(tree fragment)":9
* if _dict is not None:
* state += (_dict,)
* use_setstate = True # <<<<<<<<<<<<<<
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.cigar is not None or self.iv is not None or self.mate_start is not None or self.optional_fields is not None or self.original_sam_line is not None or self.pe_which is not None or self.read_as_aligned is not None
*/
__pyx_v_use_setstate = 1;
/* "(tree fragment)":7
* state = (self._flag, self._read, self._read_as_sequenced, self.aQual, self.cigar, self.failed_platform_qc, self.inferred_insert_size, self.iv, self.mate_start, self.not_primary_alignment, self.optional_fields, self.original_sam_line, self.pcr_or_optical_duplicate, self.pe_which, self.proper_pair, self.read_as_aligned, self.supplementary)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
goto __pyx_L3;
}
/* "(tree fragment)":11
* use_setstate = True
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.cigar is not None or self.iv is not None or self.mate_start is not None or self.optional_fields is not None or self.original_sam_line is not None or self.pe_which is not None or self.read_as_aligned is not None # <<<<<<<<<<<<<<
* if use_setstate:
* return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, None), state
*/
/*else*/ {
__pyx_t_10 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read) != Py_None);
__pyx_t_12 = (__pyx_t_10 != 0);
if (!__pyx_t_12) {
} else {
__pyx_t_11 = __pyx_t_12;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_12 = (((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced) != Py_None);
__pyx_t_10 = (__pyx_t_12 != 0);
if (!__pyx_t_10) {
} else {
__pyx_t_11 = __pyx_t_10;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_10 = (__pyx_v_self->cigar != ((PyObject*)Py_None));
__pyx_t_12 = (__pyx_t_10 != 0);
if (!__pyx_t_12) {
} else {
__pyx_t_11 = __pyx_t_12;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_12 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv) != Py_None);
__pyx_t_10 = (__pyx_t_12 != 0);
if (!__pyx_t_10) {
} else {
__pyx_t_11 = __pyx_t_10;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_10 = (((PyObject *)__pyx_v_self->mate_start) != Py_None);
__pyx_t_12 = (__pyx_t_10 != 0);
if (!__pyx_t_12) {
} else {
__pyx_t_11 = __pyx_t_12;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_12 = (__pyx_v_self->optional_fields != ((PyObject*)Py_None));
__pyx_t_10 = (__pyx_t_12 != 0);
if (!__pyx_t_10) {
} else {
__pyx_t_11 = __pyx_t_10;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_10 = (__pyx_v_self->original_sam_line != ((PyObject*)Py_None));
__pyx_t_12 = (__pyx_t_10 != 0);
if (!__pyx_t_12) {
} else {
__pyx_t_11 = __pyx_t_12;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_12 = (__pyx_v_self->pe_which != ((PyObject*)Py_None));
__pyx_t_10 = (__pyx_t_12 != 0);
if (!__pyx_t_10) {
} else {
__pyx_t_11 = __pyx_t_10;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_10 = (((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned) != Py_None);
__pyx_t_12 = (__pyx_t_10 != 0);
__pyx_t_11 = __pyx_t_12;
__pyx_L4_bool_binop_done:;
__pyx_v_use_setstate = __pyx_t_11;
}
__pyx_L3:;
/* "(tree fragment)":12
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.cigar is not None or self.iv is not None or self.mate_start is not None or self.optional_fields is not None or self.original_sam_line is not None or self.pe_which is not None or self.read_as_aligned is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, None), state
* else:
*/
__pyx_t_11 = (__pyx_v_use_setstate != 0);
if (__pyx_t_11) {
/* "(tree fragment)":13
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.cigar is not None or self.iv is not None or self.mate_start is not None or self.optional_fields is not None or self.original_sam_line is not None or self.pe_which is not None or self.read_as_aligned is not None
* if use_setstate:
* return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, None), state # <<<<<<<<<<<<<<
* else:
* return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, state)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pyx_unpickle_SAM_Alignment); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_INCREF(__pyx_int_258552819);
__Pyx_GIVEREF(__pyx_int_258552819);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_258552819);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None);
__pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
__pyx_t_8 = 0;
__pyx_t_9 = 0;
__pyx_r = __pyx_t_7;
__pyx_t_7 = 0;
goto __pyx_L0;
/* "(tree fragment)":12
* else:
* use_setstate = self._read is not None or self._read_as_sequenced is not None or self.cigar is not None or self.iv is not None or self.mate_start is not None or self.optional_fields is not None or self.original_sam_line is not None or self.pe_which is not None or self.read_as_aligned is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, None), state
* else:
*/
}
/* "(tree fragment)":15
* return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, None), state
* else:
* return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, state) # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_SAM_Alignment__set_state(self, __pyx_state)
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pyx_unpickle_SAM_Alignment); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_INCREF(__pyx_int_258552819);
__Pyx_GIVEREF(__pyx_int_258552819);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_258552819);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state);
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
__pyx_t_7 = 0;
__pyx_t_9 = 0;
__pyx_r = __pyx_t_8;
__pyx_t_8 = 0;
goto __pyx_L0;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_state);
__Pyx_XDECREF(__pyx_v__dict);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_SAM_Alignment__set_state(self, __pyx_state)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__setstate_cython__", 0);
/* "(tree fragment)":17
* return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, state)
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_SAM_Alignment__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_SAM_Alignment__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_SAM_Alignment__set_state(self, __pyx_state)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "HTSeq/_HTSeq.pyx":1576
* ###########################
*
* cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'): # <<<<<<<<<<<<<<
* cdef list l = []
* cdef int i = 0
*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15quotesafe_split(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_quotesafe_split(PyObject *__pyx_v_s, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_quotesafe_split *__pyx_optional_args) {
PyObject *__pyx_v_split = ((PyObject*)__pyx_kp_b__39);
PyObject *__pyx_v_quote = ((PyObject*)__pyx_kp_b__40);
PyObject *__pyx_v_l = 0;
int __pyx_v_i;
int __pyx_v_begin_token;
int __pyx_v_in_quote;
char *__pyx_v_s_c;
char __pyx_v_split_c;
char __pyx_v_quote_c;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
char *__pyx_t_2;
char __pyx_t_3;
Py_ssize_t __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
__Pyx_RefNannySetupContext("quotesafe_split", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_split = __pyx_optional_args->split;
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_quote = __pyx_optional_args->quote;
}
}
}
/* "HTSeq/_HTSeq.pyx":1577
*
* cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'):
* cdef list l = [] # <<<<<<<<<<<<<<
* cdef int i = 0
* cdef int begin_token = 0
*/
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1577, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_l = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1578
* cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'):
* cdef list l = []
* cdef int i = 0 # <<<<<<<<<<<<<<
* cdef int begin_token = 0
* cdef bint in_quote = False
*/
__pyx_v_i = 0;
/* "HTSeq/_HTSeq.pyx":1579
* cdef list l = []
* cdef int i = 0
* cdef int begin_token = 0 # <<<<<<<<<<<<<<
* cdef bint in_quote = False
* cdef char * s_c = s
*/
__pyx_v_begin_token = 0;
/* "HTSeq/_HTSeq.pyx":1580
* cdef int i = 0
* cdef int begin_token = 0
* cdef bint in_quote = False # <<<<<<<<<<<<<<
* cdef char * s_c = s
* cdef char split_c = split[0]
*/
__pyx_v_in_quote = 0;
/* "HTSeq/_HTSeq.pyx":1581
* cdef int begin_token = 0
* cdef bint in_quote = False
* cdef char * s_c = s # <<<<<<<<<<<<<<
* cdef char split_c = split[0]
* cdef char quote_c = quote[0]
*/
if (unlikely(__pyx_v_s == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(0, 1581, __pyx_L1_error)
}
__pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_s); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 1581, __pyx_L1_error)
__pyx_v_s_c = __pyx_t_2;
/* "HTSeq/_HTSeq.pyx":1582
* cdef bint in_quote = False
* cdef char * s_c = s
* cdef char split_c = split[0] # <<<<<<<<<<<<<<
* cdef char quote_c = quote[0]
* if len(split) != 1:
*/
if (unlikely(__pyx_v_split == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1582, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyBytes_GetItemInt(__pyx_v_split, 0, 1); if (unlikely(__pyx_t_3 == ((char)((char)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1582, __pyx_L1_error)
__pyx_v_split_c = __pyx_t_3;
/* "HTSeq/_HTSeq.pyx":1583
* cdef char * s_c = s
* cdef char split_c = split[0]
* cdef char quote_c = quote[0] # <<<<<<<<<<<<<<
* if len(split) != 1:
* raise ValueError, "'split' must be length 1"
*/
if (unlikely(__pyx_v_quote == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1583, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyBytes_GetItemInt(__pyx_v_quote, 0, 1); if (unlikely(__pyx_t_3 == ((char)((char)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1583, __pyx_L1_error)
__pyx_v_quote_c = __pyx_t_3;
/* "HTSeq/_HTSeq.pyx":1584
* cdef char split_c = split[0]
* cdef char quote_c = quote[0]
* if len(split) != 1: # <<<<<<<<<<<<<<
* raise ValueError, "'split' must be length 1"
* if len(quote) != 1:
*/
if (unlikely(__pyx_v_split == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 1584, __pyx_L1_error)
}
__pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_split); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1584, __pyx_L1_error)
__pyx_t_5 = ((__pyx_t_4 != 1) != 0);
if (unlikely(__pyx_t_5)) {
/* "HTSeq/_HTSeq.pyx":1585
* cdef char quote_c = quote[0]
* if len(split) != 1:
* raise ValueError, "'split' must be length 1" # <<<<<<<<<<<<<<
* if len(quote) != 1:
* raise ValueError, "'quote' must be length 1"
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_split_must_be_length_1, 0, 0);
__PYX_ERR(0, 1585, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1584
* cdef char split_c = split[0]
* cdef char quote_c = quote[0]
* if len(split) != 1: # <<<<<<<<<<<<<<
* raise ValueError, "'split' must be length 1"
* if len(quote) != 1:
*/
}
/* "HTSeq/_HTSeq.pyx":1586
* if len(split) != 1:
* raise ValueError, "'split' must be length 1"
* if len(quote) != 1: # <<<<<<<<<<<<<<
* raise ValueError, "'quote' must be length 1"
* while s_c[i] != 0:
*/
if (unlikely(__pyx_v_quote == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 1586, __pyx_L1_error)
}
__pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_quote); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1586, __pyx_L1_error)
__pyx_t_5 = ((__pyx_t_4 != 1) != 0);
if (unlikely(__pyx_t_5)) {
/* "HTSeq/_HTSeq.pyx":1587
* raise ValueError, "'split' must be length 1"
* if len(quote) != 1:
* raise ValueError, "'quote' must be length 1" # <<<<<<<<<<<<<<
* while s_c[i] != 0:
* if s_c[i] == quote_c:
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_quote_must_be_length_1, 0, 0);
__PYX_ERR(0, 1587, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1586
* if len(split) != 1:
* raise ValueError, "'split' must be length 1"
* if len(quote) != 1: # <<<<<<<<<<<<<<
* raise ValueError, "'quote' must be length 1"
* while s_c[i] != 0:
*/
}
/* "HTSeq/_HTSeq.pyx":1588
* if len(quote) != 1:
* raise ValueError, "'quote' must be length 1"
* while s_c[i] != 0: # <<<<<<<<<<<<<<
* if s_c[i] == quote_c:
* in_quote = not in_quote
*/
while (1) {
__pyx_t_5 = (((__pyx_v_s_c[__pyx_v_i]) != 0) != 0);
if (!__pyx_t_5) break;
/* "HTSeq/_HTSeq.pyx":1589
* raise ValueError, "'quote' must be length 1"
* while s_c[i] != 0:
* if s_c[i] == quote_c: # <<<<<<<<<<<<<<
* in_quote = not in_quote
* elif (not in_quote) and s_c[i] == split_c:
*/
__pyx_t_5 = (((__pyx_v_s_c[__pyx_v_i]) == __pyx_v_quote_c) != 0);
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1590
* while s_c[i] != 0:
* if s_c[i] == quote_c:
* in_quote = not in_quote # <<<<<<<<<<<<<<
* elif (not in_quote) and s_c[i] == split_c:
* l.append(s[begin_token: i])
*/
__pyx_v_in_quote = (!(__pyx_v_in_quote != 0));
/* "HTSeq/_HTSeq.pyx":1589
* raise ValueError, "'quote' must be length 1"
* while s_c[i] != 0:
* if s_c[i] == quote_c: # <<<<<<<<<<<<<<
* in_quote = not in_quote
* elif (not in_quote) and s_c[i] == split_c:
*/
goto __pyx_L7;
}
/* "HTSeq/_HTSeq.pyx":1591
* if s_c[i] == quote_c:
* in_quote = not in_quote
* elif (not in_quote) and s_c[i] == split_c: # <<<<<<<<<<<<<<
* l.append(s[begin_token: i])
* begin_token = i + 1
*/
__pyx_t_6 = ((!(__pyx_v_in_quote != 0)) != 0);
if (__pyx_t_6) {
} else {
__pyx_t_5 = __pyx_t_6;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_6 = (((__pyx_v_s_c[__pyx_v_i]) == __pyx_v_split_c) != 0);
__pyx_t_5 = __pyx_t_6;
__pyx_L8_bool_binop_done:;
if (__pyx_t_5) {
/* "HTSeq/_HTSeq.pyx":1592
* in_quote = not in_quote
* elif (not in_quote) and s_c[i] == split_c:
* l.append(s[begin_token: i]) # <<<<<<<<<<<<<<
* begin_token = i + 1
* i += 1
*/
if (unlikely(__pyx_v_s == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1592, __pyx_L1_error)
}
__pyx_t_1 = PySequence_GetSlice(__pyx_v_s, __pyx_v_begin_token, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = __Pyx_PyList_Append(__pyx_v_l, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1592, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1593
* elif (not in_quote) and s_c[i] == split_c:
* l.append(s[begin_token: i])
* begin_token = i + 1 # <<<<<<<<<<<<<<
* i += 1
* l.append(s[begin_token:])
*/
__pyx_v_begin_token = (__pyx_v_i + 1);
/* "HTSeq/_HTSeq.pyx":1591
* if s_c[i] == quote_c:
* in_quote = not in_quote
* elif (not in_quote) and s_c[i] == split_c: # <<<<<<<<<<<<<<
* l.append(s[begin_token: i])
* begin_token = i + 1
*/
}
__pyx_L7:;
/* "HTSeq/_HTSeq.pyx":1594
* l.append(s[begin_token: i])
* begin_token = i + 1
* i += 1 # <<<<<<<<<<<<<<
* l.append(s[begin_token:])
* if in_quote:
*/
__pyx_v_i = (__pyx_v_i + 1);
}
/* "HTSeq/_HTSeq.pyx":1595
* begin_token = i + 1
* i += 1
* l.append(s[begin_token:]) # <<<<<<<<<<<<<<
* if in_quote:
* raise ValueError, "unmatched quote"
*/
if (unlikely(__pyx_v_s == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1595, __pyx_L1_error)
}
__pyx_t_1 = PySequence_GetSlice(__pyx_v_s, __pyx_v_begin_token, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = __Pyx_PyList_Append(__pyx_v_l, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1595, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1596
* i += 1
* l.append(s[begin_token:])
* if in_quote: # <<<<<<<<<<<<<<
* raise ValueError, "unmatched quote"
* return l
*/
__pyx_t_5 = (__pyx_v_in_quote != 0);
if (unlikely(__pyx_t_5)) {
/* "HTSeq/_HTSeq.pyx":1597
* l.append(s[begin_token:])
* if in_quote:
* raise ValueError, "unmatched quote" # <<<<<<<<<<<<<<
* return l
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_unmatched_quote, 0, 0);
__PYX_ERR(0, 1597, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1596
* i += 1
* l.append(s[begin_token:])
* if in_quote: # <<<<<<<<<<<<<<
* raise ValueError, "unmatched quote"
* return l
*/
}
/* "HTSeq/_HTSeq.pyx":1598
* if in_quote:
* raise ValueError, "unmatched quote"
* return l # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_l);
__pyx_r = __pyx_v_l;
goto __pyx_L0;
/* "HTSeq/_HTSeq.pyx":1576
* ###########################
*
* cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'): # <<<<<<<<<<<<<<
* cdef list l = []
* cdef int i = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.quotesafe_split", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_l);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15quotesafe_split(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15quotesafe_split(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_s = 0;
PyObject *__pyx_v_split = 0;
PyObject *__pyx_v_quote = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("quotesafe_split (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s_3,&__pyx_n_s_split,&__pyx_n_s_quote,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject*)__pyx_kp_b__39);
values[2] = ((PyObject*)__pyx_kp_b__40);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s_3)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_split);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quote);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "quotesafe_split") < 0)) __PYX_ERR(0, 1576, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_s = ((PyObject*)values[0]);
__pyx_v_split = ((PyObject*)values[1]);
__pyx_v_quote = ((PyObject*)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("quotesafe_split", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1576, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.quotesafe_split", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyBytes_Type), 1, "s", 1))) __PYX_ERR(0, 1576, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split), (&PyBytes_Type), 1, "split", 1))) __PYX_ERR(0, 1576, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quote), (&PyBytes_Type), 1, "quote", 1))) __PYX_ERR(0, 1576, __pyx_L1_error)
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14quotesafe_split(__pyx_self, __pyx_v_s, __pyx_v_split, __pyx_v_quote);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14quotesafe_split(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s, PyObject *__pyx_v_split, PyObject *__pyx_v_quote) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_5HTSeq_6_HTSeq_quotesafe_split __pyx_t_2;
__Pyx_RefNannySetupContext("quotesafe_split", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 2;
__pyx_t_2.split = __pyx_v_split;
__pyx_t_2.quote = __pyx_v_quote;
__pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_quotesafe_split(__pyx_v_s, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("HTSeq._HTSeq.quotesafe_split", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_17__pyx_unpickle_Alignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_17__pyx_unpickle_Alignment = {"__pyx_unpickle_Alignment", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_17__pyx_unpickle_Alignment, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_17__pyx_unpickle_Alignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v___pyx_type = 0;
long __pyx_v___pyx_checksum;
PyObject *__pyx_v___pyx_state = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__pyx_unpickle_Alignment (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Alignment", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Alignment", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Alignment") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v___pyx_type = values[0];
__pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
__pyx_v___pyx_state = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Alignment", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_16__pyx_unpickle_Alignment(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_16__pyx_unpickle_Alignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_v___pyx_PickleError = 0;
PyObject *__pyx_v___pyx_result = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_RefNannySetupContext("__pyx_unpickle_Alignment", 0);
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum != 0x77bfdf2: # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
*/
__pyx_t_1 = ((__pyx_v___pyx_checksum != 0x77bfdf2) != 0);
if (__pyx_t_1) {
/* "(tree fragment)":5
* cdef object __pyx_result
* if __pyx_checksum != 0x77bfdf2:
* from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
* __pyx_result = Alignment.__new__(__pyx_type)
*/
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_n_s_PickleError);
__Pyx_GIVEREF(__pyx_n_s_PickleError);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
__pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_2);
__pyx_v___pyx_PickleError = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":6
* if __pyx_checksum != 0x77bfdf2:
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum) # <<<<<<<<<<<<<<
* __pyx_result = Alignment.__new__(__pyx_type)
* if __pyx_state is not None:
*/
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_INCREF(__pyx_v___pyx_PickleError);
__pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(2, 6, __pyx_L1_error)
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum != 0x77bfdf2: # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
*/
}
/* "(tree fragment)":7
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
* __pyx_result = Alignment.__new__(__pyx_type) # <<<<<<<<<<<<<<
* if __pyx_state is not None:
* __pyx_unpickle_Alignment__set_state( __pyx_result, __pyx_state)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_Alignment), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v___pyx_result = __pyx_t_3;
__pyx_t_3 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
* __pyx_result = Alignment.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
*/
__pyx_t_1 = (__pyx_v___pyx_state != Py_None);
__pyx_t_6 = (__pyx_t_1 != 0);
if (__pyx_t_6) {
/* "(tree fragment)":9
* __pyx_result = Alignment.__new__(__pyx_type)
* if __pyx_state is not None:
* __pyx_unpickle_Alignment__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
* return __pyx_result
* cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, tuple __pyx_state):
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
__pyx_t_3 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_Alignment__set_state(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
* __pyx_result = Alignment.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
*/
}
/* "(tree fragment)":10
* if __pyx_state is not None:
* __pyx_unpickle_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result # <<<<<<<<<<<<<<
* cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v___pyx_result);
__pyx_r = __pyx_v___pyx_result;
goto __pyx_L0;
/* "(tree fragment)":1
* def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v___pyx_PickleError);
__Pyx_XDECREF(__pyx_v___pyx_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":11
* __pyx_unpickle_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_Alignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__pyx_unpickle_Alignment__set_state", 0);
/* "(tree fragment)":12
* return __pyx_result
* cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1] # <<<<<<<<<<<<<<
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[2])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->_read);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->_read));
__pyx_v___pyx_result->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->iv);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->iv));
__pyx_v___pyx_result->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[2])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(2, 13, __pyx_L1_error)
}
__pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
__pyx_t_4 = ((__pyx_t_3 > 2) != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
__pyx_t_5 = (__pyx_t_4 != 0);
__pyx_t_2 = __pyx_t_5;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "(tree fragment)":14
* __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<<
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 14, __pyx_L1_error)
}
__pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
__pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[2])
*/
}
/* "(tree fragment)":11
* __pyx_unpickle_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_Alignment__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __pyx_unpickle_AlignmentWithSequenceReversal(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_19__pyx_unpickle_AlignmentWithSequenceReversal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_19__pyx_unpickle_AlignmentWithSequenceReversal = {"__pyx_unpickle_AlignmentWithSequenceReversal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_19__pyx_unpickle_AlignmentWithSequenceReversal, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_19__pyx_unpickle_AlignmentWithSequenceReversal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v___pyx_type = 0;
long __pyx_v___pyx_checksum;
PyObject *__pyx_v___pyx_state = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__pyx_unpickle_AlignmentWithSequenceReversal (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AlignmentWithSequenceReversal", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AlignmentWithSequenceReversal", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_AlignmentWithSequenceReversal") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v___pyx_type = values[0];
__pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
__pyx_v___pyx_state = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AlignmentWithSequenceReversal", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_AlignmentWithSequenceReversal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_18__pyx_unpickle_AlignmentWithSequenceReversal(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_18__pyx_unpickle_AlignmentWithSequenceReversal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_v___pyx_PickleError = 0;
PyObject *__pyx_v___pyx_result = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_RefNannySetupContext("__pyx_unpickle_AlignmentWithSequenceReversal", 0);
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum != 0x1b7eeff: # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
*/
__pyx_t_1 = ((__pyx_v___pyx_checksum != 0x1b7eeff) != 0);
if (__pyx_t_1) {
/* "(tree fragment)":5
* cdef object __pyx_result
* if __pyx_checksum != 0x1b7eeff:
* from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
* __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
*/
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_n_s_PickleError);
__Pyx_GIVEREF(__pyx_n_s_PickleError);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
__pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_2);
__pyx_v___pyx_PickleError = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":6
* if __pyx_checksum != 0x1b7eeff:
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum) # <<<<<<<<<<<<<<
* __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
* if __pyx_state is not None:
*/
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x1b, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_INCREF(__pyx_v___pyx_PickleError);
__pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(2, 6, __pyx_L1_error)
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum != 0x1b7eeff: # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
*/
}
/* "(tree fragment)":7
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
* __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type) # <<<<<<<<<<<<<<
* if __pyx_state is not None:
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state( __pyx_result, __pyx_state)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v___pyx_result = __pyx_t_3;
__pyx_t_3 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
* __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state( __pyx_result, __pyx_state)
* return __pyx_result
*/
__pyx_t_1 = (__pyx_v___pyx_state != Py_None);
__pyx_t_6 = (__pyx_t_1 != 0);
if (__pyx_t_6) {
/* "(tree fragment)":9
* __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
* if __pyx_state is not None:
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
* return __pyx_result
* cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, tuple __pyx_state):
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
__pyx_t_3 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_AlignmentWithSequenceReversal__set_state(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
* __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state( __pyx_result, __pyx_state)
* return __pyx_result
*/
}
/* "(tree fragment)":10
* if __pyx_state is not None:
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state( __pyx_result, __pyx_state)
* return __pyx_result # <<<<<<<<<<<<<<
* cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v___pyx_result);
__pyx_r = __pyx_v___pyx_result;
goto __pyx_L0;
/* "(tree fragment)":1
* def __pyx_unpickle_AlignmentWithSequenceReversal(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_AlignmentWithSequenceReversal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v___pyx_PickleError);
__Pyx_XDECREF(__pyx_v___pyx_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":11
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]
* if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_AlignmentWithSequenceReversal__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__pyx_unpickle_AlignmentWithSequenceReversal__set_state", 0);
/* "(tree fragment)":12
* return __pyx_result
* cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3] # <<<<<<<<<<<<<<
* if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[4])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._read);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base._read));
__pyx_v___pyx_result->__pyx_base._read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->_read_as_sequenced);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->_read_as_sequenced));
__pyx_v___pyx_result->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.iv);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.iv));
__pyx_v___pyx_result->__pyx_base.iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->read_as_aligned);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->read_as_aligned));
__pyx_v___pyx_result->read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]
* if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[4])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(2, 13, __pyx_L1_error)
}
__pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
__pyx_t_4 = ((__pyx_t_3 > 4) != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
__pyx_t_5 = (__pyx_t_4 != 0);
__pyx_t_2 = __pyx_t_5;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "(tree fragment)":14
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]
* if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[4]) # <<<<<<<<<<<<<<
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 14, __pyx_L1_error)
}
__pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
__pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]
* if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[4])
*/
}
/* "(tree fragment)":11
* __pyx_unpickle_AlignmentWithSequenceReversal__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]
* if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_AlignmentWithSequenceReversal__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __pyx_unpickle_BowtieAlignment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21__pyx_unpickle_BowtieAlignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_21__pyx_unpickle_BowtieAlignment = {"__pyx_unpickle_BowtieAlignment", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21__pyx_unpickle_BowtieAlignment, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21__pyx_unpickle_BowtieAlignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v___pyx_type = 0;
long __pyx_v___pyx_checksum;
PyObject *__pyx_v___pyx_state = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__pyx_unpickle_BowtieAlignment (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BowtieAlignment", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BowtieAlignment", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BowtieAlignment") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v___pyx_type = values[0];
__pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
__pyx_v___pyx_state = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BowtieAlignment", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_BowtieAlignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_20__pyx_unpickle_BowtieAlignment(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_20__pyx_unpickle_BowtieAlignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_v___pyx_PickleError = 0;
PyObject *__pyx_v___pyx_result = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_RefNannySetupContext("__pyx_unpickle_BowtieAlignment", 0);
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum != 0x482c176: # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
*/
__pyx_t_1 = ((__pyx_v___pyx_checksum != 0x482c176) != 0);
if (__pyx_t_1) {
/* "(tree fragment)":5
* cdef object __pyx_result
* if __pyx_checksum != 0x482c176:
* from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
* __pyx_result = BowtieAlignment.__new__(__pyx_type)
*/
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_n_s_PickleError);
__Pyx_GIVEREF(__pyx_n_s_PickleError);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
__pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_2);
__pyx_v___pyx_PickleError = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":6
* if __pyx_checksum != 0x482c176:
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum) # <<<<<<<<<<<<<<
* __pyx_result = BowtieAlignment.__new__(__pyx_type)
* if __pyx_state is not None:
*/
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x48, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_INCREF(__pyx_v___pyx_PickleError);
__pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(2, 6, __pyx_L1_error)
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum != 0x482c176: # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
*/
}
/* "(tree fragment)":7
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
* __pyx_result = BowtieAlignment.__new__(__pyx_type) # <<<<<<<<<<<<<<
* if __pyx_state is not None:
* __pyx_unpickle_BowtieAlignment__set_state( __pyx_result, __pyx_state)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v___pyx_result = __pyx_t_3;
__pyx_t_3 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
* __pyx_result = BowtieAlignment.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_BowtieAlignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
*/
__pyx_t_1 = (__pyx_v___pyx_state != Py_None);
__pyx_t_6 = (__pyx_t_1 != 0);
if (__pyx_t_6) {
/* "(tree fragment)":9
* __pyx_result = BowtieAlignment.__new__(__pyx_type)
* if __pyx_state is not None:
* __pyx_unpickle_BowtieAlignment__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
* return __pyx_result
* cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, tuple __pyx_state):
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
__pyx_t_3 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_BowtieAlignment__set_state(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
* __pyx_result = BowtieAlignment.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_BowtieAlignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
*/
}
/* "(tree fragment)":10
* if __pyx_state is not None:
* __pyx_unpickle_BowtieAlignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result # <<<<<<<<<<<<<<
* cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v___pyx_result);
__pyx_r = __pyx_v___pyx_result;
goto __pyx_L0;
/* "(tree fragment)":1
* def __pyx_unpickle_BowtieAlignment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_BowtieAlignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v___pyx_PickleError);
__Pyx_XDECREF(__pyx_v___pyx_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":11
* __pyx_unpickle_BowtieAlignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
* if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_BowtieAlignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__pyx_unpickle_BowtieAlignment__set_state", 0);
/* "(tree fragment)":12
* return __pyx_result
* cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5] # <<<<<<<<<<<<<<
* if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[6])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base._read);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base._read));
__pyx_v___pyx_result->__pyx_base.__pyx_base._read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._read_as_sequenced);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base._read_as_sequenced));
__pyx_v___pyx_result->__pyx_base._read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.iv);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.iv));
__pyx_v___pyx_result->__pyx_base.__pyx_base.iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.read_as_aligned);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.read_as_aligned));
__pyx_v___pyx_result->__pyx_base.read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->reserved);
__Pyx_DECREF(__pyx_v___pyx_result->reserved);
__pyx_v___pyx_result->reserved = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->substitutions);
__Pyx_DECREF(__pyx_v___pyx_result->substitutions);
__pyx_v___pyx_result->substitutions = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
* if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[6])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(2, 13, __pyx_L1_error)
}
__pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
__pyx_t_4 = ((__pyx_t_3 > 6) != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
__pyx_t_5 = (__pyx_t_4 != 0);
__pyx_t_2 = __pyx_t_5;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "(tree fragment)":14
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
* if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[6]) # <<<<<<<<<<<<<<
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 14, __pyx_L1_error)
}
__pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
__pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, tuple __pyx_state):
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
* if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[6])
*/
}
/* "(tree fragment)":11
* __pyx_unpickle_BowtieAlignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
* if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_BowtieAlignment__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __pyx_unpickle_CigarOperation(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_23__pyx_unpickle_CigarOperation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_23__pyx_unpickle_CigarOperation = {"__pyx_unpickle_CigarOperation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_23__pyx_unpickle_CigarOperation, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_23__pyx_unpickle_CigarOperation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v___pyx_type = 0;
long __pyx_v___pyx_checksum;
PyObject *__pyx_v___pyx_state = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__pyx_unpickle_CigarOperation (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CigarOperation", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CigarOperation", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_CigarOperation") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v___pyx_type = values[0];
__pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
__pyx_v___pyx_state = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CigarOperation", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_CigarOperation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_22__pyx_unpickle_CigarOperation(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_22__pyx_unpickle_CigarOperation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_v___pyx_PickleError = 0;
PyObject *__pyx_v___pyx_result = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_RefNannySetupContext("__pyx_unpickle_CigarOperation", 0);
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum != 0xb5bd29c: # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
*/
__pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb5bd29c) != 0);
if (__pyx_t_1) {
/* "(tree fragment)":5
* cdef object __pyx_result
* if __pyx_checksum != 0xb5bd29c:
* from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
* __pyx_result = CigarOperation.__new__(__pyx_type)
*/
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_n_s_PickleError);
__Pyx_GIVEREF(__pyx_n_s_PickleError);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
__pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_2);
__pyx_v___pyx_PickleError = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":6
* if __pyx_checksum != 0xb5bd29c:
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum) # <<<<<<<<<<<<<<
* __pyx_result = CigarOperation.__new__(__pyx_type)
* if __pyx_state is not None:
*/
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_INCREF(__pyx_v___pyx_PickleError);
__pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(2, 6, __pyx_L1_error)
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum != 0xb5bd29c: # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
*/
}
/* "(tree fragment)":7
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
* __pyx_result = CigarOperation.__new__(__pyx_type) # <<<<<<<<<<<<<<
* if __pyx_state is not None:
* __pyx_unpickle_CigarOperation__set_state( __pyx_result, __pyx_state)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v___pyx_result = __pyx_t_3;
__pyx_t_3 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
* __pyx_result = CigarOperation.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_CigarOperation__set_state( __pyx_result, __pyx_state)
* return __pyx_result
*/
__pyx_t_1 = (__pyx_v___pyx_state != Py_None);
__pyx_t_6 = (__pyx_t_1 != 0);
if (__pyx_t_6) {
/* "(tree fragment)":9
* __pyx_result = CigarOperation.__new__(__pyx_type)
* if __pyx_state is not None:
* __pyx_unpickle_CigarOperation__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
* return __pyx_result
* cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, tuple __pyx_state):
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
__pyx_t_3 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_CigarOperation__set_state(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
* __pyx_result = CigarOperation.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_CigarOperation__set_state( __pyx_result, __pyx_state)
* return __pyx_result
*/
}
/* "(tree fragment)":10
* if __pyx_state is not None:
* __pyx_unpickle_CigarOperation__set_state( __pyx_result, __pyx_state)
* return __pyx_result # <<<<<<<<<<<<<<
* cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, tuple __pyx_state):
* __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v___pyx_result);
__pyx_r = __pyx_v___pyx_result;
goto __pyx_L0;
/* "(tree fragment)":1
* def __pyx_unpickle_CigarOperation(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_CigarOperation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v___pyx_PickleError);
__Pyx_XDECREF(__pyx_v___pyx_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":11
* __pyx_unpickle_CigarOperation__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]
* if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_CigarOperation__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
Py_ssize_t __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
__Pyx_RefNannySetupContext("__pyx_unpickle_CigarOperation__set_state", 0);
/* "(tree fragment)":12
* return __pyx_result
* cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, tuple __pyx_state):
* __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4] # <<<<<<<<<<<<<<
* if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[5])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->query_from = __pyx_t_2;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->query_to = __pyx_t_2;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->ref_iv);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->ref_iv));
__pyx_v___pyx_result->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->size = __pyx_t_2;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->type);
__Pyx_DECREF(__pyx_v___pyx_result->type);
__pyx_v___pyx_result->type = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, tuple __pyx_state):
* __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]
* if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[5])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(2, 13, __pyx_L1_error)
}
__pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
__pyx_t_5 = ((__pyx_t_4 > 5) != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
__pyx_t_6 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_6;
__pyx_L4_bool_binop_done:;
if (__pyx_t_3) {
/* "(tree fragment)":14
* __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]
* if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[5]) # <<<<<<<<<<<<<<
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 14, __pyx_L1_error)
}
__pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_8, function);
}
}
__pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, tuple __pyx_state):
* __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]
* if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[5])
*/
}
/* "(tree fragment)":11
* __pyx_unpickle_CigarOperation__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]
* if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_CigarOperation__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __pyx_unpickle_SAM_Alignment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment = {"__pyx_unpickle_SAM_Alignment", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v___pyx_type = 0;
long __pyx_v___pyx_checksum;
PyObject *__pyx_v___pyx_state = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__pyx_unpickle_SAM_Alignment (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SAM_Alignment", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SAM_Alignment", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SAM_Alignment") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v___pyx_type = values[0];
__pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
__pyx_v___pyx_state = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SAM_Alignment", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_SAM_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5HTSeq_6_HTSeq_24__pyx_unpickle_SAM_Alignment(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_24__pyx_unpickle_SAM_Alignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_v___pyx_PickleError = 0;
PyObject *__pyx_v___pyx_result = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_RefNannySetupContext("__pyx_unpickle_SAM_Alignment", 0);
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum != 0xf6933f3: # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary))" % __pyx_checksum)
*/
__pyx_t_1 = ((__pyx_v___pyx_checksum != 0xf6933f3) != 0);
if (__pyx_t_1) {
/* "(tree fragment)":5
* cdef object __pyx_result
* if __pyx_checksum != 0xf6933f3:
* from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary))" % __pyx_checksum)
* __pyx_result = SAM_Alignment.__new__(__pyx_type)
*/
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_n_s_PickleError);
__Pyx_GIVEREF(__pyx_n_s_PickleError);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
__pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_2);
__pyx_v___pyx_PickleError = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":6
* if __pyx_checksum != 0xf6933f3:
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary))" % __pyx_checksum) # <<<<<<<<<<<<<<
* __pyx_result = SAM_Alignment.__new__(__pyx_type)
* if __pyx_state is not None:
*/
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xf6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_INCREF(__pyx_v___pyx_PickleError);
__pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(2, 6, __pyx_L1_error)
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum != 0xf6933f3: # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary))" % __pyx_checksum)
*/
}
/* "(tree fragment)":7
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary))" % __pyx_checksum)
* __pyx_result = SAM_Alignment.__new__(__pyx_type) # <<<<<<<<<<<<<<
* if __pyx_state is not None:
* __pyx_unpickle_SAM_Alignment__set_state( __pyx_result, __pyx_state)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v___pyx_result = __pyx_t_3;
__pyx_t_3 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary))" % __pyx_checksum)
* __pyx_result = SAM_Alignment.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_SAM_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
*/
__pyx_t_1 = (__pyx_v___pyx_state != Py_None);
__pyx_t_6 = (__pyx_t_1 != 0);
if (__pyx_t_6) {
/* "(tree fragment)":9
* __pyx_result = SAM_Alignment.__new__(__pyx_type)
* if __pyx_state is not None:
* __pyx_unpickle_SAM_Alignment__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
* return __pyx_result
* cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, tuple __pyx_state):
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
__pyx_t_3 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_SAM_Alignment__set_state(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary))" % __pyx_checksum)
* __pyx_result = SAM_Alignment.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_SAM_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
*/
}
/* "(tree fragment)":10
* if __pyx_state is not None:
* __pyx_unpickle_SAM_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result # <<<<<<<<<<<<<<
* cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, tuple __pyx_state):
* __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v___pyx_result);
__pyx_r = __pyx_v___pyx_result;
goto __pyx_L0;
/* "(tree fragment)":1
* def __pyx_unpickle_SAM_Alignment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_SAM_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v___pyx_PickleError);
__Pyx_XDECREF(__pyx_v___pyx_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":11
* __pyx_unpickle_SAM_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]
* if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_SAM_Alignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
Py_ssize_t __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
__Pyx_RefNannySetupContext("__pyx_unpickle_SAM_Alignment__set_state", 0);
/* "(tree fragment)":12
* return __pyx_result
* cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, tuple __pyx_state):
* __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16] # <<<<<<<<<<<<<<
* if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[17])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->_flag = __pyx_t_2;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base._read);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base._read));
__pyx_v___pyx_result->__pyx_base.__pyx_base._read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._read_as_sequenced);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base._read_as_sequenced));
__pyx_v___pyx_result->__pyx_base._read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->aQual = __pyx_t_2;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->cigar);
__Pyx_DECREF(__pyx_v___pyx_result->cigar);
__pyx_v___pyx_result->cigar = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->failed_platform_qc = __pyx_t_3;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->inferred_insert_size = __pyx_t_2;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.iv);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.iv));
__pyx_v___pyx_result->__pyx_base.__pyx_base.iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->mate_start);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->mate_start));
__pyx_v___pyx_result->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->not_primary_alignment = __pyx_t_3;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->optional_fields);
__Pyx_DECREF(__pyx_v___pyx_result->optional_fields);
__pyx_v___pyx_result->optional_fields = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->original_sam_line);
__Pyx_DECREF(__pyx_v___pyx_result->original_sam_line);
__pyx_v___pyx_result->original_sam_line = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->pcr_or_optical_duplicate = __pyx_t_3;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->pe_which);
__Pyx_DECREF(__pyx_v___pyx_result->pe_which);
__pyx_v___pyx_result->pe_which = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->proper_pair = __pyx_t_3;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.read_as_aligned);
__Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.read_as_aligned));
__pyx_v___pyx_result->__pyx_base.read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
__pyx_t_1 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v___pyx_result->supplementary = __pyx_t_3;
/* "(tree fragment)":13
* cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, tuple __pyx_state):
* __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]
* if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[17])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(2, 13, __pyx_L1_error)
}
__pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
__pyx_t_5 = ((__pyx_t_4 > 17) != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
__pyx_t_6 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_6;
__pyx_L4_bool_binop_done:;
if (__pyx_t_3) {
/* "(tree fragment)":14
* __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]
* if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[17]) # <<<<<<<<<<<<<<
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 14, __pyx_L1_error)
}
__pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_8, function);
}
}
__pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, tuple __pyx_state):
* __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]
* if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[17])
*/
}
/* "(tree fragment)":11
* __pyx_unpickle_SAM_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]
* if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_SAM_Alignment__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
* # This implementation of getbuffer is geared towards Cython
* # requirements, and does not yet fulfill the PEP.
*/
/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
__pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
int __pyx_v_i;
int __pyx_v_ndim;
int __pyx_v_endian_detector;
int __pyx_v_little_endian;
int __pyx_v_t;
char *__pyx_v_f;
PyArray_Descr *__pyx_v_descr = 0;
int __pyx_v_offset;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
PyArray_Descr *__pyx_t_7;
PyObject *__pyx_t_8 = NULL;
char *__pyx_t_9;
if (__pyx_v_info == NULL) {
PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
return -1;
}
__Pyx_RefNannySetupContext("__getbuffer__", 0);
__pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
__Pyx_GIVEREF(__pyx_v_info->obj);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
*
* cdef int i, ndim
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
* cdef bint little_endian = ((&endian_detector)[0] != 0)
*
*/
__pyx_v_endian_detector = 1;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
* cdef int i, ndim
* cdef int endian_detector = 1
* cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
*
* ndim = PyArray_NDIM(self)
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
* cdef bint little_endian = ((&endian_detector)[0] != 0)
*
* ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
*/
__pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
* ndim = PyArray_NDIM(self)
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
* raise ValueError(u"ndarray is not C contiguous")
*/
__pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
* raise ValueError(u"ndarray is not C contiguous")
*
*/
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
* ndim = PyArray_NDIM(self)
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
* raise ValueError(u"ndarray is not C contiguous")
*/
if (unlikely(__pyx_t_1)) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
* raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(3, 272, __pyx_L1_error)
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
* ndim = PyArray_NDIM(self)
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
* raise ValueError(u"ndarray is not C contiguous")
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
* raise ValueError(u"ndarray is not C contiguous")
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
* raise ValueError(u"ndarray is not Fortran contiguous")
*/
__pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L7_bool_binop_done;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
* raise ValueError(u"ndarray is not Fortran contiguous")
*
*/
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L7_bool_binop_done:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
* raise ValueError(u"ndarray is not C contiguous")
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
* raise ValueError(u"ndarray is not Fortran contiguous")
*/
if (unlikely(__pyx_t_1)) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
* raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
*
* info.buf = PyArray_DATA(self)
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(3, 276, __pyx_L1_error)
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
* raise ValueError(u"ndarray is not C contiguous")
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
* raise ValueError(u"ndarray is not Fortran contiguous")
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
* raise ValueError(u"ndarray is not Fortran contiguous")
*
* info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
* info.ndim = ndim
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
*/
__pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
*
* info.buf = PyArray_DATA(self)
* info.ndim = ndim # <<<<<<<<<<<<<<
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* # Allocate new buffer for strides and shape info.
*/
__pyx_v_info->ndim = __pyx_v_ndim;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
* info.buf = PyArray_DATA(self)
* info.ndim = ndim
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
* # Allocate new buffer for strides and shape info.
* # This is allocated as one block, strides first.
*/
__pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
if (__pyx_t_1) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
* # Allocate new buffer for strides and shape info.
* # This is allocated as one block, strides first.
* info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<<
* info.shape = info.strides + ndim
* for i in range(ndim):
*/
__pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
* # This is allocated as one block, strides first.
* info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim)
* info.shape = info.strides + ndim # <<<<<<<<<<<<<<
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i]
*/
__pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
* info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim)
* info.shape = info.strides + ndim
* for i in range(ndim): # <<<<<<<<<<<<<<
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i]
*/
__pyx_t_4 = __pyx_v_ndim;
__pyx_t_5 = __pyx_t_4;
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
* info.shape = info.strides + ndim
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
* info.shape[i] = PyArray_DIMS(self)[i]
* else:
*/
(__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
* else:
* info.strides = PyArray_STRIDES(self)
*/
(__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
* info.buf = PyArray_DATA(self)
* info.ndim = ndim
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
* # Allocate new buffer for strides and shape info.
* # This is allocated as one block, strides first.
*/
goto __pyx_L9;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
* info.shape[i] = PyArray_DIMS(self)[i]
* else:
* info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<<
* info.shape = PyArray_DIMS(self)
* info.suboffsets = NULL
*/
/*else*/ {
__pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
* else:
* info.strides = PyArray_STRIDES(self)
* info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<<
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
*/
__pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
}
__pyx_L9:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
* info.strides = PyArray_STRIDES(self)
* info.shape = PyArray_DIMS(self)
* info.suboffsets = NULL # <<<<<<<<<<<<<<
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self)
*/
__pyx_v_info->suboffsets = NULL;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
* info.shape = PyArray_DIMS(self)
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
* info.readonly = not PyArray_ISWRITEABLE(self)
*
*/
__pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
*
* cdef int t
*/
__pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
*
* cdef int t
* cdef char* f = NULL # <<<<<<<<<<<<<<
* cdef dtype descr = PyArray_DESCR(self)
* cdef int offset
*/
__pyx_v_f = NULL;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
* cdef int t
* cdef char* f = NULL
* cdef dtype descr = PyArray_DESCR(self) # <<<<<<<<<<<<<<
* cdef int offset
*
*/
__pyx_t_7 = PyArray_DESCR(__pyx_v_self);
__pyx_t_3 = ((PyObject *)__pyx_t_7);
__Pyx_INCREF(__pyx_t_3);
__pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
__pyx_t_3 = 0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":300
* cdef int offset
*
* info.obj = self # <<<<<<<<<<<<<<
*
* if not PyDataType_HASFIELDS(descr):
*/
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
* info.obj = self
*
* if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or
*/
__pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
if (__pyx_t_1) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":303
*
* if not PyDataType_HASFIELDS(descr):
* t = descr.type_num # <<<<<<<<<<<<<<
* if ((descr.byteorder == c'>' and little_endian) or
* (descr.byteorder == c'<' and not little_endian)):
*/
__pyx_t_4 = __pyx_v_descr->type_num;
__pyx_v_t = __pyx_t_4;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
* if not PyDataType_HASFIELDS(descr):
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
* (descr.byteorder == c'<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
*/
__pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
if (!__pyx_t_2) {
goto __pyx_L15_next_or;
} else {
}
__pyx_t_2 = (__pyx_v_little_endian != 0);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L14_bool_binop_done;
}
__pyx_L15_next_or:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":305
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or
* (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
*/
__pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L14_bool_binop_done;
}
__pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L14_bool_binop_done:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
* if not PyDataType_HASFIELDS(descr):
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
* (descr.byteorder == c'<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
*/
if (unlikely(__pyx_t_1)) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
* if ((descr.byteorder == c'>' and little_endian) or
* (descr.byteorder == c'<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(3, 306, __pyx_L1_error)
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
* if not PyDataType_HASFIELDS(descr):
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
* (descr.byteorder == c'<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":307
* (descr.byteorder == c'<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h"
*/
switch (__pyx_v_t) {
case NPY_BYTE:
__pyx_v_f = ((char *)"b");
break;
case NPY_UBYTE:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":308
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H"
*/
__pyx_v_f = ((char *)"B");
break;
case NPY_SHORT:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":309
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i"
*/
__pyx_v_f = ((char *)"h");
break;
case NPY_USHORT:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":310
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I"
*/
__pyx_v_f = ((char *)"H");
break;
case NPY_INT:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":311
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l"
*/
__pyx_v_f = ((char *)"i");
break;
case NPY_UINT:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":312
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L"
*/
__pyx_v_f = ((char *)"I");
break;
case NPY_LONG:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":313
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q"
*/
__pyx_v_f = ((char *)"l");
break;
case NPY_ULONG:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":314
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q"
*/
__pyx_v_f = ((char *)"L");
break;
case NPY_LONGLONG:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":315
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f"
*/
__pyx_v_f = ((char *)"q");
break;
case NPY_ULONGLONG:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":316
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d"
*/
__pyx_v_f = ((char *)"Q");
break;
case NPY_FLOAT:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":317
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g"
*/
__pyx_v_f = ((char *)"f");
break;
case NPY_DOUBLE:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":318
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf"
*/
__pyx_v_f = ((char *)"d");
break;
case NPY_LONGDOUBLE:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":319
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd"
*/
__pyx_v_f = ((char *)"g");
break;
case NPY_CFLOAT:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":320
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg"
*/
__pyx_v_f = ((char *)"Zf");
break;
case NPY_CDOUBLE:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":321
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
* elif t == NPY_CLONGDOUBLE: f = "Zg"
* elif t == NPY_OBJECT: f = "O"
*/
__pyx_v_f = ((char *)"Zd");
break;
case NPY_CLONGDOUBLE:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":322
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
* elif t == NPY_OBJECT: f = "O"
* else:
*/
__pyx_v_f = ((char *)"Zg");
break;
case NPY_OBJECT:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":323
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg"
* elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
*/
__pyx_v_f = ((char *)"O");
break;
default:
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":325
* elif t == NPY_OBJECT: f = "O"
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
* info.format = f
* return
*/
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(3, 325, __pyx_L1_error)
break;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":326
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f # <<<<<<<<<<<<<<
* return
* else:
*/
__pyx_v_info->format = __pyx_v_f;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":327
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f
* return # <<<<<<<<<<<<<<
* else:
* info.format = PyObject_Malloc(_buffer_format_string_len)
*/
__pyx_r = 0;
goto __pyx_L0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
* info.obj = self
*
* if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":329
* return
* else:
* info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
* info.format[0] = c'^' # Native data types, manual alignment
* offset = 0
*/
/*else*/ {
__pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":330
* else:
* info.format = PyObject_Malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
* offset = 0
* f = _util_dtypestring(descr, info.format + 1,
*/
(__pyx_v_info->format[0]) = '^';
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":331
* info.format = PyObject_Malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment
* offset = 0 # <<<<<<<<<<<<<<
* f = _util_dtypestring(descr, info.format + 1,
* info.format + _buffer_format_string_len,
*/
__pyx_v_offset = 0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":332
* info.format[0] = c'^' # Native data types, manual alignment
* offset = 0
* f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
* info.format + _buffer_format_string_len,
* &offset)
*/
__pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 332, __pyx_L1_error)
__pyx_v_f = __pyx_t_9;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":335
* info.format + _buffer_format_string_len,
* &offset)
* f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
*/
(__pyx_v_f[0]) = '\x00';
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
* # This implementation of getbuffer is geared towards Cython
* # requirements, and does not yet fulfill the PEP.
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
if (__pyx_v_info->obj != NULL) {
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
}
goto __pyx_L2;
__pyx_L0:;
if (__pyx_v_info->obj == Py_None) {
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
}
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_descr);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
* if PyArray_HASFIELDS(self):
* PyObject_Free(info.format)
*/
/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__releasebuffer__", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
* PyObject_Free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
*/
__pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
if (__pyx_t_1) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":339
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self):
* PyObject_Free(info.format) # <<<<<<<<<<<<<<
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* PyObject_Free(info.strides)
*/
PyObject_Free(__pyx_v_info->format);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
* PyObject_Free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
* if PyArray_HASFIELDS(self):
* PyObject_Free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
* PyObject_Free(info.strides)
* # info.shape was stored after info.strides in the same block
*/
__pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
if (__pyx_t_1) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":341
* PyObject_Free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* PyObject_Free(info.strides) # <<<<<<<<<<<<<<
* # info.shape was stored after info.strides in the same block
*
*/
PyObject_Free(__pyx_v_info->strides);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
* if PyArray_HASFIELDS(self):
* PyObject_Free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
* PyObject_Free(info.strides)
* # info.shape was stored after info.strides in the same block
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
* if PyArray_HASFIELDS(self):
* PyObject_Free(info.format)
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(1, a)
*
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
*
* cdef inline object PyArray_MultiIterNew1(a):
* return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<<
*
* cdef inline object PyArray_MultiIterNew2(a, b):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 822, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(1, a)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
* return PyArray_MultiIterNew(1, a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(2, a, b)
*
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
*
* cdef inline object PyArray_MultiIterNew2(a, b):
* return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<<
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 825, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
* return PyArray_MultiIterNew(1, a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(2, a, b)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
* return PyArray_MultiIterNew(2, a, b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(3, a, b, c)
*
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
* return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<<
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 828, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
* return PyArray_MultiIterNew(2, a, b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(3, a, b, c)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
* return PyArray_MultiIterNew(3, a, b, c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(4, a, b, c, d)
*
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
* return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<<
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 831, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
* return PyArray_MultiIterNew(3, a, b, c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(4, a, b, c, d)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
* return PyArray_MultiIterNew(4, a, b, c, d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(5, a, b, c, d, e)
*
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
* return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<<
*
* cdef inline tuple PyDataType_SHAPE(dtype d):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 834, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
* return PyArray_MultiIterNew(4, a, b, c, d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(5, a, b, c, d, e)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
* return PyArray_MultiIterNew(5, a, b, c, d, e)
*
* cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
* if PyDataType_HASSUBARRAY(d):
* return d.subarray.shape
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
*
* cdef inline tuple PyDataType_SHAPE(dtype d):
* if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
* return d.subarray.shape
* else:
*/
__pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
if (__pyx_t_1) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
* cdef inline tuple PyDataType_SHAPE(dtype d):
* if PyDataType_HASSUBARRAY(d):
* return d.subarray.shape # <<<<<<<<<<<<<<
* else:
* return ()
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
__pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
goto __pyx_L0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
*
* cdef inline tuple PyDataType_SHAPE(dtype d):
* if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
* return d.subarray.shape
* else:
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
* return d.subarray.shape
* else:
* return () # <<<<<<<<<<<<<<
*
* cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_r = __pyx_empty_tuple;
goto __pyx_L0;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
* return PyArray_MultiIterNew(5, a, b, c, d, e)
*
* cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
* if PyDataType_HASSUBARRAY(d):
* return d.subarray.shape
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
* return ()
*
* cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
* # Recursive utility function used in __getbuffer__ to get format
* # string. The new location in the format string is returned.
*/
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
PyArray_Descr *__pyx_v_child = 0;
int __pyx_v_endian_detector;
int __pyx_v_little_endian;
PyObject *__pyx_v_fields = 0;
PyObject *__pyx_v_childname = NULL;
PyObject *__pyx_v_new_offset = NULL;
PyObject *__pyx_v_t = NULL;
char *__pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
long __pyx_t_8;
char *__pyx_t_9;
__Pyx_RefNannySetupContext("_util_dtypestring", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
*
* cdef dtype child
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
* cdef bint little_endian = ((&endian_detector)[0] != 0)
* cdef tuple fields
*/
__pyx_v_endian_detector = 1;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
* cdef dtype child
* cdef int endian_detector = 1
* cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
* cdef tuple fields
*
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
* fields = descr.fields[childname]
* child, new_offset = fields
*/
if (unlikely(__pyx_v_descr->names == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(3, 851, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
for (;;) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
__Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
__pyx_t_3 = 0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
*
* for childname in descr.names:
* fields = descr.fields[childname] # <<<<<<<<<<<<<<
* child, new_offset = fields
*
*/
if (unlikely(__pyx_v_descr->fields == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(3, 852, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 852, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
__pyx_t_3 = 0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
* for childname in descr.names:
* fields = descr.fields[childname]
* child, new_offset = fields # <<<<<<<<<<<<<<
*
* if (end - f) - (new_offset - offset[0]) < 15:
*/
if (likely(__pyx_v_fields != Py_None)) {
PyObject* sequence = __pyx_v_fields;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(3, 853, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
__Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 853, __pyx_L1_error)
}
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 853, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
__pyx_t_3 = 0;
__Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
__pyx_t_4 = 0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
* child, new_offset = fields
*
* if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
*
*/
__pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 855, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
if (unlikely(__pyx_t_6)) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
*
* if (end - f) - (new_offset - offset[0]) < 15:
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
*
* if ((child.byteorder == c'>' and little_endian) or
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 856, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(3, 856, __pyx_L1_error)
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
* child, new_offset = fields
*
* if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
*
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
*
* if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
* (child.byteorder == c'<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
*/
__pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
if (!__pyx_t_7) {
goto __pyx_L8_next_or;
} else {
}
__pyx_t_7 = (__pyx_v_little_endian != 0);
if (!__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L7_bool_binop_done;
}
__pyx_L8_next_or:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":859
*
* if ((child.byteorder == c'>' and little_endian) or
* (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
* raise ValueError(u"Non-native byte order not supported")
* # One could encode it in the format string and have Cython
*/
__pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
if (__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L7_bool_binop_done;
}
__pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L7_bool_binop_done:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
*
* if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
* (child.byteorder == c'<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
*/
if (unlikely(__pyx_t_6)) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
* if ((child.byteorder == c'>' and little_endian) or
* (child.byteorder == c'<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
* # One could encode it in the format string and have Cython
* # complain instead, BUT: < and > in format strings also imply
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(3, 860, __pyx_L1_error)
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
*
* if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
* (child.byteorder == c'<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":870
*
* # Output padding bytes
* while offset[0] < new_offset: # <<<<<<<<<<<<<<
* f[0] = 120 # "x"; pad byte
* f += 1
*/
while (1) {
__pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 870, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 870, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 870, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!__pyx_t_6) break;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":871
* # Output padding bytes
* while offset[0] < new_offset:
* f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
* f += 1
* offset[0] += 1
*/
(__pyx_v_f[0]) = 0x78;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":872
* while offset[0] < new_offset:
* f[0] = 120 # "x"; pad byte
* f += 1 # <<<<<<<<<<<<<<
* offset[0] += 1
*
*/
__pyx_v_f = (__pyx_v_f + 1);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":873
* f[0] = 120 # "x"; pad byte
* f += 1
* offset[0] += 1 # <<<<<<<<<<<<<<
*
* offset[0] += child.itemsize
*/
__pyx_t_8 = 0;
(__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":875
* offset[0] += 1
*
* offset[0] += child.itemsize # <<<<<<<<<<<<<<
*
* if not PyDataType_HASFIELDS(child):
*/
__pyx_t_8 = 0;
(__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
* offset[0] += child.itemsize
*
* if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
* t = child.type_num
* if end - f < 5:
*/
__pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
if (__pyx_t_6) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
*
* if not PyDataType_HASFIELDS(child):
* t = child.type_num # <<<<<<<<<<<<<<
* if end - f < 5:
* raise RuntimeError(u"Format string allocated too short.")
*/
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
__pyx_t_4 = 0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
* if not PyDataType_HASFIELDS(child):
* t = child.type_num
* if end - f < 5: # <<<<<<<<<<<<<<
* raise RuntimeError(u"Format string allocated too short.")
*
*/
__pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
if (unlikely(__pyx_t_6)) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
* t = child.type_num
* if end - f < 5:
* raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
*
* # Until ticket #99 is fixed, use integers to avoid warnings
*/
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 880, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(3, 880, __pyx_L1_error)
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
* if not PyDataType_HASFIELDS(child):
* t = child.type_num
* if end - f < 5: # <<<<<<<<<<<<<<
* raise RuntimeError(u"Format string allocated too short.")
*
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":883
*
* # Until ticket #99 is fixed, use integers to avoid warnings
* if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
* elif t == NPY_UBYTE: f[0] = 66 #"B"
* elif t == NPY_SHORT: f[0] = 104 #"h"
*/
__pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 883, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 883, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 883, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 98;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":884
* # Until ticket #99 is fixed, use integers to avoid warnings
* if t == NPY_BYTE: f[0] = 98 #"b"
* elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
* elif t == NPY_SHORT: f[0] = 104 #"h"
* elif t == NPY_USHORT: f[0] = 72 #"H"
*/
__pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 884, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 884, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 884, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 66;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":885
* if t == NPY_BYTE: f[0] = 98 #"b"
* elif t == NPY_UBYTE: f[0] = 66 #"B"
* elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
* elif t == NPY_USHORT: f[0] = 72 #"H"
* elif t == NPY_INT: f[0] = 105 #"i"
*/
__pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 885, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 885, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 0x68;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":886
* elif t == NPY_UBYTE: f[0] = 66 #"B"
* elif t == NPY_SHORT: f[0] = 104 #"h"
* elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
* elif t == NPY_INT: f[0] = 105 #"i"
* elif t == NPY_UINT: f[0] = 73 #"I"
*/
__pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 886, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 886, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 886, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 72;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":887
* elif t == NPY_SHORT: f[0] = 104 #"h"
* elif t == NPY_USHORT: f[0] = 72 #"H"
* elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
* elif t == NPY_UINT: f[0] = 73 #"I"
* elif t == NPY_LONG: f[0] = 108 #"l"
*/
__pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 887, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 887, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 887, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 0x69;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":888
* elif t == NPY_USHORT: f[0] = 72 #"H"
* elif t == NPY_INT: f[0] = 105 #"i"
* elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
* elif t == NPY_LONG: f[0] = 108 #"l"
* elif t == NPY_ULONG: f[0] = 76 #"L"
*/
__pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 888, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 888, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 888, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 73;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":889
* elif t == NPY_INT: f[0] = 105 #"i"
* elif t == NPY_UINT: f[0] = 73 #"I"
* elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
* elif t == NPY_ULONG: f[0] = 76 #"L"
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
*/
__pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 889, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 889, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 889, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 0x6C;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":890
* elif t == NPY_UINT: f[0] = 73 #"I"
* elif t == NPY_LONG: f[0] = 108 #"l"
* elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
*/
__pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 890, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 890, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 890, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 76;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":891
* elif t == NPY_LONG: f[0] = 108 #"l"
* elif t == NPY_ULONG: f[0] = 76 #"L"
* elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
* elif t == NPY_FLOAT: f[0] = 102 #"f"
*/
__pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 891, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 891, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 891, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 0x71;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":892
* elif t == NPY_ULONG: f[0] = 76 #"L"
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
* elif t == NPY_FLOAT: f[0] = 102 #"f"
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
*/
__pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 892, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 892, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 892, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 81;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":893
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
* elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
*/
__pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 893, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 893, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 893, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 0x66;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":894
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
* elif t == NPY_FLOAT: f[0] = 102 #"f"
* elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
*/
__pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 894, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 894, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 894, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 0x64;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":895
* elif t == NPY_FLOAT: f[0] = 102 #"f"
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
*/
__pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 895, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 895, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 895, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 0x67;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":896
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
*/
__pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 896, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 896, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 896, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 90;
(__pyx_v_f[1]) = 0x66;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":897
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
* elif t == NPY_OBJECT: f[0] = 79 #"O"
*/
__pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 897, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 897, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 897, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 90;
(__pyx_v_f[1]) = 0x64;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":898
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
* elif t == NPY_OBJECT: f[0] = 79 #"O"
* else:
*/
__pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 898, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 898, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 898, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 90;
(__pyx_v_f[1]) = 0x67;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":899
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
* elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
*/
__pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 899, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 899, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (likely(__pyx_t_6)) {
(__pyx_v_f[0]) = 79;
goto __pyx_L15;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":901
* elif t == NPY_OBJECT: f[0] = 79 #"O"
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
* f += 1
* else:
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 901, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 901, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(3, 901, __pyx_L1_error)
}
__pyx_L15:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":902
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* f += 1 # <<<<<<<<<<<<<<
* else:
* # Cython ignores struct boundary information ("T{...}"),
*/
__pyx_v_f = (__pyx_v_f + 1);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
* offset[0] += child.itemsize
*
* if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
* t = child.type_num
* if end - f < 5:
*/
goto __pyx_L13;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":906
* # Cython ignores struct boundary information ("T{...}"),
* # so don't output it
* f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
* return f
*
*/
/*else*/ {
__pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 906, __pyx_L1_error)
__pyx_v_f = __pyx_t_9;
}
__pyx_L13:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
* fields = descr.fields[childname]
* child, new_offset = fields
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":907
* # so don't output it
* f = _util_dtypestring(child, f, end, offset)
* return f # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_f;
goto __pyx_L0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
* return ()
*
* cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
* # Recursive utility function used in __getbuffer__ to get format
* # string. The new location in the format string is returned.
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_child);
__Pyx_XDECREF(__pyx_v_fields);
__Pyx_XDECREF(__pyx_v_childname);
__Pyx_XDECREF(__pyx_v_new_offset);
__Pyx_XDECREF(__pyx_v_t);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
* int _import_umath() except -1
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
* Py_INCREF(base) # important to do this before stealing the reference below!
* PyArray_SetBaseObject(arr, base)
*/
static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_array_base", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1023
*
* cdef inline void set_array_base(ndarray arr, object base):
* Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
* PyArray_SetBaseObject(arr, base)
*
*/
Py_INCREF(__pyx_v_base);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1024
* cdef inline void set_array_base(ndarray arr, object base):
* Py_INCREF(base) # important to do this before stealing the reference below!
* PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
*
* cdef inline object get_array_base(ndarray arr):
*/
(void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
* int _import_umath() except -1
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
* Py_INCREF(base) # important to do this before stealing the reference below!
* PyArray_SetBaseObject(arr, base)
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
* PyArray_SetBaseObject(arr, base)
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
* base = PyArray_BASE(arr)
* if base is NULL:
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
PyObject *__pyx_v_base;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_array_base", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027
*
* cdef inline object get_array_base(ndarray arr):
* base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
* if base is NULL:
* return None
*/
__pyx_v_base = PyArray_BASE(__pyx_v_arr);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
* cdef inline object get_array_base(ndarray arr):
* base = PyArray_BASE(arr)
* if base is NULL: # <<<<<<<<<<<<<<
* return None
* return base
*/
__pyx_t_1 = ((__pyx_v_base == NULL) != 0);
if (__pyx_t_1) {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1029
* base = PyArray_BASE(arr)
* if base is NULL:
* return None # <<<<<<<<<<<<<<
* return base
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
* cdef inline object get_array_base(ndarray arr):
* base = PyArray_BASE(arr)
* if base is NULL: # <<<<<<<<<<<<<<
* return None
* return base
*/
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1030
* if base is NULL:
* return None
* return base # <<<<<<<<<<<<<<
*
* # Versions of the import_* functions which are more suitable for
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_base));
__pyx_r = ((PyObject *)__pyx_v_base);
goto __pyx_L0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
* PyArray_SetBaseObject(arr, base)
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
* base = PyArray_BASE(arr)
* if base is NULL:
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
* # Versions of the import_* functions which are more suitable for
* # Cython code.
* cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
* try:
* _import_array()
*/
static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("import_array", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
* # Cython code.
* cdef inline int import_array() except -1:
* try: # <<<<<<<<<<<<<<
* _import_array()
* except Exception:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036
* cdef inline int import_array() except -1:
* try:
* _import_array() # <<<<<<<<<<<<<<
* except Exception:
* raise ImportError("numpy.core.multiarray failed to import")
*/
__pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1036, __pyx_L3_error)
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
* # Cython code.
* cdef inline int import_array() except -1:
* try: # <<<<<<<<<<<<<<
* _import_array()
* except Exception:
*/
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
* try:
* _import_array()
* except Exception: # <<<<<<<<<<<<<<
* raise ImportError("numpy.core.multiarray failed to import")
*
*/
__pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
if (__pyx_t_4) {
__Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1037, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_7);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
* _import_array()
* except Exception:
* raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
*
* cdef inline int import_umath() except -1:
*/
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1038, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(3, 1038, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
* # Cython code.
* cdef inline int import_array() except -1:
* try: # <<<<<<<<<<<<<<
* _import_array()
* except Exception:
*/
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
* # Versions of the import_* functions which are more suitable for
* # Cython code.
* cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
* try:
* _import_array()
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
* raise ImportError("numpy.core.multiarray failed to import")
*
* cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
* try:
* _import_umath()
*/
static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("import_umath", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
*
* cdef inline int import_umath() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042
* cdef inline int import_umath() except -1:
* try:
* _import_umath() # <<<<<<<<<<<<<<
* except Exception:
* raise ImportError("numpy.core.umath failed to import")
*/
__pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1042, __pyx_L3_error)
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
*
* cdef inline int import_umath() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
* try:
* _import_umath()
* except Exception: # <<<<<<<<<<<<<<
* raise ImportError("numpy.core.umath failed to import")
*
*/
__pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
if (__pyx_t_4) {
__Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1043, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_7);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
* _import_umath()
* except Exception:
* raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
*
* cdef inline int import_ufunc() except -1:
*/
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1044, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(3, 1044, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
*
* cdef inline int import_umath() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
* raise ImportError("numpy.core.multiarray failed to import")
*
* cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
* try:
* _import_umath()
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
* raise ImportError("numpy.core.umath failed to import")
*
* cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
* try:
* _import_umath()
*/
static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("import_ufunc", 0);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
*
* cdef inline int import_ufunc() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048
* cdef inline int import_ufunc() except -1:
* try:
* _import_umath() # <<<<<<<<<<<<<<
* except Exception:
* raise ImportError("numpy.core.umath failed to import")
*/
__pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1048, __pyx_L3_error)
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
*
* cdef inline int import_ufunc() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049
* try:
* _import_umath()
* except Exception: # <<<<<<<<<<<<<<
* raise ImportError("numpy.core.umath failed to import")
*/
__pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
if (__pyx_t_4) {
__Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1049, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_7);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1050
* _import_umath()
* except Exception:
* raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
*/
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1050, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(3, 1050, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
*
* cdef inline int import_ufunc() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
* raise ImportError("numpy.core.umath failed to import")
*
* cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
* try:
* _import_umath()
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval __pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval;
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicInterval(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
} else {
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)o);
p->__pyx_vtab = __pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval;
p->chrom = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->_strand = ((PyObject*)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicInterval(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *p = (struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)o;
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
Py_CLEAR(p->chrom);
Py_CLEAR(p->_strand);
(*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_strand(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_3__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_strand(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_1__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_length(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_length(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_d(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5end_d_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_as_pos(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_as_pos(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d_as_pos(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_d_as_pos(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_chrom(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_chrom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_end(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_GenomicInterval[] = {
{"__reduce__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__, METH_NOARGS, 0},
{"__copy__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__, METH_NOARGS, 0},
{"is_contained_in", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in, METH_O, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in},
{"contains", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains, METH_O, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_16contains},
{"overlaps", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps, METH_O, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps},
{"range", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_21range, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_20range},
{"range_d", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_23range_d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_22range_d},
{"extend_to_include", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include, METH_O, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include},
{"copy", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_27copy, METH_NOARGS, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_GenomicInterval[] = {
{(char *)"strand", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_strand, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_strand, (char *)0, 0},
{(char *)"length", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_length, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_length, (char *)"The length is calculated as end - start. If you set the length, \n 'start_d' will be preserved, i.e., 'end' is changed, unless the strand\n is '-', in which case 'start' is changed.", 0},
{(char *)"start_d", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d, (char *)"See the class docstring for the meaning of the 'directional start'.\n Note that if you set 'start_d', both the start and the end are changed, \n such the interval gets the requested new directional start and its\n length stays unchanged.", 0},
{(char *)"end_d", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_d, 0, (char *)0, 0},
{(char *)"start_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_as_pos, 0, (char *)0, 0},
{(char *)"end_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_as_pos, 0, (char *)0, 0},
{(char *)"start_d_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d_as_pos, 0, (char *)0, 0},
{(char *)"end_d_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_d_as_pos, 0, (char *)0, 0},
{(char *)"chrom", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_chrom, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_chrom, (char *)0, 0},
{(char *)"start", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_start, (char *)0, 0},
{(char *)"end", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_end, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_GenomicInterval = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.GenomicInterval", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicInterval, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7__repr__, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_13__hash__, /*tp_hash*/
0, /*tp_call*/
__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_9__str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
"A GenomicInterval specifies an interval (i.e., a range of \n consecutive positions) on a reference genome.\n\n A GenomicInterval object has the following slots, some of which \n are calculated from the other:\n\n chrom: The name of a sequence (i.e., chromosome, contig, or \n the like). \n start: The start of the interval. Even on the reverse strand,\n this is always the smaller of the two values 'start' and 'end'.\n Note that all positions should be given as 0-based value!\n end: The end of the interval. Following Python convention for \n ranges, this in one more than the coordinate of the last base\n that is considered part of the sequence.\n strand: The strand, as a single character, '+' or '-'. '.' indicates\n that the strand is irrelavant. (Alternatively, pass a Strand object.)\n length: The length of the interval, i.e., end - start\n start_d: The \"directional start\" position. This is the position of the\n first base of the interval, taking the strand into account. Hence, \n this is the same as 'start' except when strand == '-', in which \n case it is end-1.\n end_d: The \"directional end\": Usually, the same as 'end', but for \n strand=='-1', it is start-1.\n ", /*tp_doc*/
0, /*tp_traverse*/
0, /*tp_clear*/
__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_11__richcmp__, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_GenomicInterval, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_GenomicInterval, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_GenomicInterval, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicPosition __pyx_vtable_5HTSeq_6_HTSeq_GenomicPosition;
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicPosition(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *p;
PyObject *o = __pyx_tp_new_5HTSeq_6_HTSeq_GenomicInterval(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)o);
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval*)__pyx_vtabptr_5HTSeq_6_HTSeq_GenomicPosition;
return o;
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_pos(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicPosition_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_end(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3end_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_length(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_6length_1__get__(o);
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_GenomicPosition[] = {
{"__reduce__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__, METH_NOARGS, 0},
{"copy", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_9copy, METH_NOARGS, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_GenomicPosition[] = {
{(char *)"pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_pos, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicPosition_pos, (char *)"As GenomicPosition is a subclass of GenomicInterval, 'pos' is actually\n just an alias for 'start_d'.\n ", 0},
{(char *)"end", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_end, 0, (char *)0, 0},
{(char *)"length", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_length, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_GenomicPosition = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.GenomicPosition", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicInterval, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3__repr__, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_5__str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
"A GenomicPosition specifies the position of a nucleotide or\n base pair on a reference genome.\n\n It has the following slots:\n chrom: The name of a sequence (i.e., chromosome, contig, or \n the like). \n pos: The position on the sequence specified by seqname.\n The position should always be given as 0-based value!\n strand: The strand, as a single character, '+' or '-'. '.' indicates\n that the strand is irrelavant.\n\n The GenomicPosition class is derived from GenomicInterval. Hence,\n a GenomicPosition is always a GenomicInterval of length 1. Do not tinker\n with the exposed GenomeInterval slots.\n ", /*tp_doc*/
0, /*tp_traverse*/
0, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_GenomicPosition, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_GenomicPosition, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_GenomicPosition, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence __pyx_vtable_5HTSeq_6_HTSeq_Sequence;
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_Sequence(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
} else {
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)o);
p->__pyx_vtab = __pyx_vtabptr_5HTSeq_6_HTSeq_Sequence;
p->seq = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->descr = ((PyObject*)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_Sequence(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *p = (struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)o;
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
Py_CLEAR(p->seq);
Py_CLEAR(p->name);
Py_CLEAR(p->descr);
(*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_5HTSeq_6_HTSeq_Sequence(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_8Sequence_seq(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_seq(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_8Sequence_name(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_8Sequence_descr(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_descr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_5__del__(o);
}
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_Sequence[] = {
{"get_reverse_complement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement, METH_VARARGS|METH_KEYWORDS, 0},
{"__getstate__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_13__getstate__, METH_NOARGS, 0},
{"__setstate__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_15__setstate__, METH_O, 0},
{"__reduce__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_17__reduce__, METH_NOARGS, 0},
{"write_to_fasta_file", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file},
{"add_bases_to_count_array", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array, METH_O, 0},
{"trim_left_end", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end, METH_VARARGS|METH_KEYWORDS, 0},
{"trim_right_end", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_Sequence[] = {
{(char *)"seq", __pyx_getprop_5HTSeq_6_HTSeq_8Sequence_seq, __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_seq, (char *)0, 0},
{(char *)"name", __pyx_getprop_5HTSeq_6_HTSeq_8Sequence_name, __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_name, (char *)0, 0},
{(char *)"descr", __pyx_getprop_5HTSeq_6_HTSeq_8Sequence_descr, __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_descr, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PySequenceMethods __pyx_tp_as_sequence_Sequence = {
__pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_5HTSeq_6_HTSeq_Sequence, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_Sequence = {
__pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__, /*mp_length*/
__pyx_pw_5HTSeq_6_HTSeq_8Sequence_11__getitem__, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_Sequence = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.Sequence", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_Sequence, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
__pyx_pw_5HTSeq_6_HTSeq_8Sequence_7__repr__, /*tp_repr*/
0, /*tp_as_number*/
&__pyx_tp_as_sequence_Sequence, /*tp_as_sequence*/
&__pyx_tp_as_mapping_Sequence, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5__str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
"A Sequence, typically of DNA, with a name.\n ", /*tp_doc*/
0, /*tp_traverse*/
0, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_Sequence, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_Sequence, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_5HTSeq_6_HTSeq_8Sequence_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_Sequence, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities __pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities;
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_SequenceWithQualities(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *p;
PyObject *o = __pyx_tp_new_5HTSeq_6_HTSeq_Sequence(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)o);
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence*)__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities;
p->_qualstr = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->_qualstr_phred = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->_qualscale = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->_qualarr = Py_None; Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_SequenceWithQualities(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)o;
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->_qualstr);
Py_CLEAR(p->_qualstr_phred);
Py_CLEAR(p->_qualscale);
Py_CLEAR(p->_qualarr);
#if CYTHON_USE_TYPE_SLOTS
if (PyType_IS_GC(Py_TYPE(o)->tp_base))
#endif
PyObject_GC_Track(o);
__pyx_tp_dealloc_5HTSeq_6_HTSeq_Sequence(o);
}
static int __pyx_tp_traverse_5HTSeq_6_HTSeq_SequenceWithQualities(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)o;
e = ((likely(__pyx_ptype_5HTSeq_6_HTSeq_Sequence)) ? ((__pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_traverse) ? __pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5HTSeq_6_HTSeq_SequenceWithQualities)); if (e) return e;
if (p->_qualarr) {
e = (*v)(p->_qualarr, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_5HTSeq_6_HTSeq_SequenceWithQualities(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)o;
if (likely(__pyx_ptype_5HTSeq_6_HTSeq_Sequence)) { if (__pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_clear) __pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5HTSeq_6_HTSeq_SequenceWithQualities);
tmp = ((PyObject*)p->_qualarr);
p->_qualarr = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_sq_item_5HTSeq_6_HTSeq_SequenceWithQualities(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qual(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qual(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qualstr(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualstr(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualstr_phred(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualscale(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualarr(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr_1__get__(o);
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_SequenceWithQualities[] = {
{"write_to_fastq_file", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file, METH_O, 0},
{"get_fastq_str", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str, METH_VARARGS|METH_KEYWORDS, 0},
{"get_reverse_complement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement, METH_VARARGS|METH_KEYWORDS, 0},
{"add_qual_to_count_array", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array, METH_O, 0},
{"trim_left_end_with_quals", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals, METH_VARARGS|METH_KEYWORDS, 0},
{"trim_right_end_with_quals", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_SequenceWithQualities[] = {
{(char *)"qual", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qual, __pyx_setprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qual, (char *)0, 0},
{(char *)"qualstr", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qualstr, 0, (char *)0, 0},
{(char *)"_qualstr", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualstr, 0, (char *)0, 0},
{(char *)"_qualstr_phred", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualstr_phred, 0, (char *)0, 0},
{(char *)"_qualscale", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualscale, 0, (char *)0, 0},
{(char *)"_qualarr", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualarr, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PySequenceMethods __pyx_tp_as_sequence_SequenceWithQualities = {
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__, /*sq_length*/
#else
0, /*sq_length*/
#endif
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_5HTSeq_6_HTSeq_SequenceWithQualities, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_SequenceWithQualities = {
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__, /*mp_length*/
#else
0, /*mp_length*/
#endif
__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_5__getitem__, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.SequenceWithQualities", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_3__repr__, /*tp_repr*/
0, /*tp_as_number*/
&__pyx_tp_as_sequence_SequenceWithQualities, /*tp_as_sequence*/
&__pyx_tp_as_mapping_SequenceWithQualities, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"A Sequence with base-call quality scores.\n It now has property 'qual', an integer NumPy array of Sanger/Phred \n quality scores of the base calls.\n ", /*tp_doc*/
__pyx_tp_traverse_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_traverse*/
__pyx_tp_clear_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_Alignment(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
} else {
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)o);
p->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
p->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_Alignment(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)o;
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->_read);
Py_CLEAR(p->iv);
(*Py_TYPE(o)->tp_free)(o);
}
static int __pyx_tp_traverse_5HTSeq_6_HTSeq_Alignment(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)o;
if (p->_read) {
e = (*v)(((PyObject *)p->_read), a); if (e) return e;
}
if (p->iv) {
e = (*v)(((PyObject *)p->iv), a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_5HTSeq_6_HTSeq_Alignment(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)o;
tmp = ((PyObject*)p->_read);
p->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->iv);
p->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_9Alignment_read(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_4read_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_9Alignment_paired_end(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_10paired_end_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_9Alignment_aligned(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_7aligned_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_9Alignment__read(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_9Alignment__read(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_9Alignment_iv(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_9Alignment_iv(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_5__del__(o);
}
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_Alignment[] = {
{"__reduce_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_9Alignment_5__reduce_cython__, METH_NOARGS, 0},
{"__setstate_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_9Alignment_7__setstate_cython__, METH_O, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_Alignment[] = {
{(char *)"read", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_read, 0, (char *)0, 0},
{(char *)"paired_end", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_paired_end, 0, (char *)0, 0},
{(char *)"aligned", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_aligned, 0, (char *)"Returns True unless self.iv is None. The latter indicates that\n this record decribes a read for which no alignment was found.\n ", 0},
{(char *)"_read", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment__read, __pyx_setprop_5HTSeq_6_HTSeq_9Alignment__read, (char *)0, 0},
{(char *)"iv", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_iv, __pyx_setprop_5HTSeq_6_HTSeq_9Alignment_iv, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_Alignment = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.Alignment", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_Alignment, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
__pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Alignment base type:\n\n An alignment object can be defined in different ways but will always\n provide these attributes:\n read: a SequenceWithQualities object with the read\n aligned: whether the read is aligned\n iv: a GenomicInterval object with the alignment position \n ", /*tp_doc*/
__pyx_tp_traverse_5HTSeq_6_HTSeq_Alignment, /*tp_traverse*/
__pyx_tp_clear_5HTSeq_6_HTSeq_Alignment, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_Alignment, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_Alignment, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_5HTSeq_6_HTSeq_9Alignment_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_Alignment, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *p;
PyObject *o = __pyx_tp_new_5HTSeq_6_HTSeq_Alignment(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)o);
p->read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
p->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *p = (struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)o;
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->read_as_aligned);
Py_CLEAR(p->_read_as_sequenced);
PyObject_GC_Track(o);
__pyx_tp_dealloc_5HTSeq_6_HTSeq_Alignment(o);
}
static int __pyx_tp_traverse_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *p = (struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)o;
e = __pyx_tp_traverse_5HTSeq_6_HTSeq_Alignment(o, v, a); if (e) return e;
if (p->read_as_aligned) {
e = (*v)(((PyObject *)p->read_as_aligned), a); if (e) return e;
}
if (p->_read_as_sequenced) {
e = (*v)(((PyObject *)p->_read_as_sequenced), a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *p = (struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)o;
__pyx_tp_clear_5HTSeq_6_HTSeq_Alignment(o);
tmp = ((PyObject*)p->read_as_aligned);
p->read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->_read_as_sequenced);
p->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read_as_aligned(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read_as_aligned(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal__read_as_sequenced(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal__read_as_sequenced(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_5__del__(o);
}
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal[] = {
{"__reduce_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_3__reduce_cython__, METH_NOARGS, 0},
{"__setstate_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__, METH_O, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal[] = {
{(char *)"read", __pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read, 0, (char *)0, 0},
{(char *)"read_as_aligned", __pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read_as_aligned, __pyx_setprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read_as_aligned, (char *)0, 0},
{(char *)"_read_as_sequenced", __pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal__read_as_sequenced, __pyx_setprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal__read_as_sequenced, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.AlignmentWithSequenceReversal", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Many aligners report the read's sequence in reverse-complemented form\n when it was mapped to the reverse strand. For such alignments, a \n daughter class of this one should be used.\n\n Then, the read is stored as aligned in the 'read_as_aligned' field,\n and get reverse-complemented back to the sequenced form when the 'read'\n attribute is sequenced.\n ", /*tp_doc*/
__pyx_tp_traverse_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_traverse*/
__pyx_tp_clear_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_SAM_Alignment(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *p;
PyObject *o = __pyx_tp_new_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)o);
p->cigar = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None); Py_INCREF(Py_None);
p->pe_which = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->original_sam_line = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->optional_fields = ((PyObject*)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_SAM_Alignment(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)o;
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->cigar);
Py_CLEAR(p->mate_start);
Py_CLEAR(p->pe_which);
Py_CLEAR(p->original_sam_line);
Py_CLEAR(p->optional_fields);
PyObject_GC_Track(o);
__pyx_tp_dealloc_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(o);
}
static int __pyx_tp_traverse_5HTSeq_6_HTSeq_SAM_Alignment(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)o;
e = __pyx_tp_traverse_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(o, v, a); if (e) return e;
if (p->cigar) {
e = (*v)(p->cigar, a); if (e) return e;
}
if (p->mate_start) {
e = (*v)(((PyObject *)p->mate_start), a); if (e) return e;
}
if (p->optional_fields) {
e = (*v)(p->optional_fields, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_5HTSeq_6_HTSeq_SAM_Alignment(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)o;
__pyx_tp_clear_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(o);
tmp = ((PyObject*)p->cigar);
p->cigar = ((PyObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->mate_start);
p->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->optional_fields);
p->optional_fields = ((PyObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_flag(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_flag(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_paired_end(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_aligned(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_cigar(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_cigar(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_aQual(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_aQual(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_start(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_pe_which(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_pe_which(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_inferred_insert_size(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_inferred_insert_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_proper_pair(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_proper_pair(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_not_primary_alignment(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_not_primary_alignment(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_failed_platform_qc(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_failed_platform_qc(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_pcr_or_optical_duplicate(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_pcr_or_optical_duplicate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_supplementary(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_supplementary(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_original_sam_line(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_optional_fields(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_optional_fields(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_5__del__(o);
}
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_SAM_Alignment[] = {
{"to_pysam_AlignedSegment", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment, METH_O, 0},
{"to_pysam_AlignedRead", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead, METH_O, 0},
{"from_pysam_AlignedRead", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead, METH_VARARGS|METH_KEYWORDS, 0},
{"from_pysam_AlignedSegment", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment, METH_VARARGS|METH_KEYWORDS, 0},
{"from_SAM_line", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line, METH_O, 0},
{"get_sam_line", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line, METH_NOARGS, 0},
{"optional_field", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13optional_field, METH_O, 0},
{"raw_optional_fields", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15raw_optional_fields, METH_NOARGS, 0},
{"__reduce_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17__reduce_cython__, METH_NOARGS, 0},
{"__setstate_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_19__setstate_cython__, METH_O, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_SAM_Alignment[] = {
{(char *)"flag", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_flag, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_flag, (char *)0, 0},
{(char *)"paired_end", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_paired_end, 0, (char *)0, 0},
{(char *)"mate_aligned", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_aligned, 0, (char *)0, 0},
{(char *)"cigar", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_cigar, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_cigar, (char *)0, 0},
{(char *)"aQual", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_aQual, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_aQual, (char *)0, 0},
{(char *)"mate_start", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_start, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_start, (char *)0, 0},
{(char *)"pe_which", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_pe_which, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_pe_which, (char *)0, 0},
{(char *)"inferred_insert_size", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_inferred_insert_size, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_inferred_insert_size, (char *)0, 0},
{(char *)"proper_pair", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_proper_pair, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_proper_pair, (char *)0, 0},
{(char *)"not_primary_alignment", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_not_primary_alignment, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_not_primary_alignment, (char *)0, 0},
{(char *)"failed_platform_qc", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_failed_platform_qc, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_failed_platform_qc, (char *)0, 0},
{(char *)"pcr_or_optical_duplicate", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_pcr_or_optical_duplicate, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_pcr_or_optical_duplicate, (char *)0, 0},
{(char *)"supplementary", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_supplementary, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_supplementary, (char *)0, 0},
{(char *)"original_sam_line", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_original_sam_line, 0, (char *)0, 0},
{(char *)"optional_fields", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_optional_fields, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_optional_fields, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_SAM_Alignment = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.SAM_Alignment", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_SAM_Alignment, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"When reading in a SAM file, objects of the class SAM_Alignment\n are returned. In addition to the 'read', 'iv' and 'aligned' fields (see \n Alignment class), the following fields are provided:\n - aQual: the alignment quality score\n - cigar: a list of CigarOperatio objects, describing the alignment\n - tags: the extra information tags [not yet implemented]\n ", /*tp_doc*/
__pyx_tp_traverse_5HTSeq_6_HTSeq_SAM_Alignment, /*tp_traverse*/
__pyx_tp_clear_5HTSeq_6_HTSeq_SAM_Alignment, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_SAM_Alignment, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_SAM_Alignment, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_SAM_Alignment, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_ChromVector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
} else {
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)o);
p->array = Py_None; Py_INCREF(Py_None);
p->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
p->_storage = ((PyObject*)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_ChromVector(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *p = (struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)o;
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->array);
Py_CLEAR(p->iv);
Py_CLEAR(p->_storage);
(*Py_TYPE(o)->tp_free)(o);
}
static int __pyx_tp_traverse_5HTSeq_6_HTSeq_ChromVector(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *p = (struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)o;
if (p->array) {
e = (*v)(p->array, a); if (e) return e;
}
if (p->iv) {
e = (*v)(((PyObject *)p->iv), a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_5HTSeq_6_HTSeq_ChromVector(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *p = (struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)o;
tmp = ((PyObject*)p->array);
p->array = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->iv);
p->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_sq_item_5HTSeq_6_HTSeq_ChromVector(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}
static int __pyx_mp_ass_subscript_5HTSeq_6_HTSeq_ChromVector(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_7__setitem__(o, i, v);
}
else {
PyErr_Format(PyExc_NotImplementedError,
"Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_array(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_array(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_iv(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_iv(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_offset(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_offset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_is_vector_of_sets(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_is_vector_of_sets(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector__storage(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector__storage(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_5__del__(o);
}
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_ChromVector[] = {
{"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_1create, METH_VARARGS|METH_KEYWORDS, 0},
{"_create_view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_3_create_view, METH_VARARGS|METH_KEYWORDS, 0},
{"values", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_13values, METH_NOARGS, 0},
{"steps", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_15steps, METH_NOARGS, 0},
{"apply", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17apply, METH_O, 0},
{"__reduce__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_21__reduce__, METH_NOARGS, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_ChromVector[] = {
{(char *)"array", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_array, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_array, (char *)0, 0},
{(char *)"iv", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_iv, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_iv, (char *)0, 0},
{(char *)"offset", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_offset, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_offset, (char *)0, 0},
{(char *)"is_vector_of_sets", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_is_vector_of_sets, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_is_vector_of_sets, (char *)0, 0},
{(char *)"_storage", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector__storage, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector__storage, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyNumberMethods __pyx_tp_as_number_ChromVector = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
0, /*nb_divide*/
#endif
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
0, /*nb_coerce*/
#endif
0, /*nb_int*/
#if PY_MAJOR_VERSION < 3
0, /*nb_long*/
#else
0, /*reserved*/
#endif
0, /*nb_float*/
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
0, /*nb_oct*/
#endif
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
0, /*nb_hex*/
#endif
__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_9__iadd__, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
0, /*nb_inplace_divide*/
#endif
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
0, /*nb_index*/
#if PY_VERSION_HEX >= 0x03050000
0, /*nb_matrix_multiply*/
#endif
#if PY_VERSION_HEX >= 0x03050000
0, /*nb_inplace_matrix_multiply*/
#endif
};
static PySequenceMethods __pyx_tp_as_sequence_ChromVector = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_5HTSeq_6_HTSeq_ChromVector, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_ChromVector = {
0, /*mp_length*/
__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5__getitem__, /*mp_subscript*/
__pyx_mp_ass_subscript_5HTSeq_6_HTSeq_ChromVector, /*mp_ass_subscript*/
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_ChromVector = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.ChromVector", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_ChromVector, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_19__repr__, /*tp_repr*/
&__pyx_tp_as_number_ChromVector, /*tp_as_number*/
&__pyx_tp_as_sequence_ChromVector, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ChromVector, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_5HTSeq_6_HTSeq_ChromVector, /*tp_traverse*/
__pyx_tp_clear_5HTSeq_6_HTSeq_ChromVector, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_11__iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_ChromVector, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_ChromVector, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_ChromVector, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicArray(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
} else {
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)o);
p->chrom_vectors = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->typecode = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->storage = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->memmap_dir = ((PyObject*)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicArray(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *p = (struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)o;
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->chrom_vectors);
Py_CLEAR(p->typecode);
Py_CLEAR(p->storage);
Py_CLEAR(p->memmap_dir);
(*Py_TYPE(o)->tp_free)(o);
}
static int __pyx_tp_traverse_5HTSeq_6_HTSeq_GenomicArray(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *p = (struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)o;
if (p->chrom_vectors) {
e = (*v)(p->chrom_vectors, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_5HTSeq_6_HTSeq_GenomicArray(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *p = (struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)o;
tmp = ((PyObject*)p->chrom_vectors);
p->chrom_vectors = ((PyObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_sq_item_5HTSeq_6_HTSeq_GenomicArray(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}
static int __pyx_mp_ass_subscript_5HTSeq_6_HTSeq_GenomicArray(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_5__setitem__(o, i, v);
}
else {
PyErr_Format(PyExc_NotImplementedError,
"Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_chrom_vectors(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_chrom_vectors(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_stranded(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8stranded_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_typecode(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8typecode_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_auto_add_chroms(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_auto_add_chroms(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_storage(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7storage_1__get__(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_memmap_dir(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir_1__get__(o);
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_GenomicArray[] = {
{"add_chrom", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom, METH_VARARGS|METH_KEYWORDS, 0},
{"__reduce__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__, METH_NOARGS, 0},
{"write_bedgraph_file", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_11write_bedgraph_file, METH_VARARGS|METH_KEYWORDS, 0},
{"steps", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13steps, METH_NOARGS, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_GenomicArray[] = {
{(char *)"chrom_vectors", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_chrom_vectors, __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_chrom_vectors, (char *)0, 0},
{(char *)"stranded", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_stranded, 0, (char *)0, 0},
{(char *)"typecode", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_typecode, 0, (char *)0, 0},
{(char *)"auto_add_chroms", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_auto_add_chroms, __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_auto_add_chroms, (char *)0, 0},
{(char *)"storage", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_storage, 0, (char *)0, 0},
{(char *)"memmap_dir", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_memmap_dir, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PySequenceMethods __pyx_tp_as_sequence_GenomicArray = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_5HTSeq_6_HTSeq_GenomicArray, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_GenomicArray = {
0, /*mp_length*/
__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_3__getitem__, /*mp_subscript*/
__pyx_mp_ass_subscript_5HTSeq_6_HTSeq_GenomicArray, /*mp_ass_subscript*/
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_GenomicArray = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.GenomicArray", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicArray, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
&__pyx_tp_as_sequence_GenomicArray, /*tp_as_sequence*/
&__pyx_tp_as_mapping_GenomicArray, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_5HTSeq_6_HTSeq_GenomicArray, /*tp_traverse*/
__pyx_tp_clear_5HTSeq_6_HTSeq_GenomicArray, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_GenomicArray, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_GenomicArray, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_GenomicArray, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_BowtieAlignment(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *p;
PyObject *o = __pyx_tp_new_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)o);
p->reserved = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->substitutions = ((PyObject*)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_BowtieAlignment(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)o;
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->reserved);
Py_CLEAR(p->substitutions);
PyObject_GC_Track(o);
__pyx_tp_dealloc_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(o);
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15BowtieAlignment_reserved(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_15BowtieAlignment_reserved(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15BowtieAlignment_substitutions(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_15BowtieAlignment_substitutions(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_5__del__(o);
}
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_BowtieAlignment[] = {
{"__reduce_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_3__reduce_cython__, METH_NOARGS, 0},
{"__setstate_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__, METH_O, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_BowtieAlignment[] = {
{(char *)"reserved", __pyx_getprop_5HTSeq_6_HTSeq_15BowtieAlignment_reserved, __pyx_setprop_5HTSeq_6_HTSeq_15BowtieAlignment_reserved, (char *)0, 0},
{(char *)"substitutions", __pyx_getprop_5HTSeq_6_HTSeq_15BowtieAlignment_substitutions, __pyx_setprop_5HTSeq_6_HTSeq_15BowtieAlignment_substitutions, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_BowtieAlignment = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.BowtieAlignment", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_BowtieAlignment, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"When reading in a Bowtie file, objects of the class BowtieAlignment\n are returned. In addition to the 'read' and 'iv' fields (see Alignment\n class), the fields 'reserved' and 'substitutions' are provided. These \n contain the content of the respective columns of the Bowtie output \n\n [A parser for the substitutions field will be added soon.]\n ", /*tp_doc*/
__pyx_tp_traverse_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_traverse*/
__pyx_tp_clear_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_BowtieAlignment, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_BowtieAlignment, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_BowtieAlignment, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_CigarOperation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
} else {
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)o);
p->type = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_CigarOperation(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *p = (struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)o;
#if CYTHON_USE_TP_FINALIZE
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->type);
Py_CLEAR(p->ref_iv);
(*Py_TYPE(o)->tp_free)(o);
}
static int __pyx_tp_traverse_5HTSeq_6_HTSeq_CigarOperation(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *p = (struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)o;
if (p->ref_iv) {
e = (*v)(((PyObject *)p->ref_iv), a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_5HTSeq_6_HTSeq_CigarOperation(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *p = (struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)o;
tmp = ((PyObject*)p->ref_iv);
p->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_type(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_size(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_ref_iv(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_ref_iv(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_3__set__(o, v);
}
else {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_5__del__(o);
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_query_from(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_query_from(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_query_to(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_1__get__(o);
}
static int __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_query_to(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
if (v) {
return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_3__set__(o, v);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "__del__");
return -1;
}
}
static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_CigarOperation[] = {
{"check", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_5check, METH_NOARGS, 0},
{"__reduce_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_7__reduce_cython__, METH_NOARGS, 0},
{"__setstate_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_9__setstate_cython__, METH_O, 0},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_CigarOperation[] = {
{(char *)"type", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_type, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_type, (char *)0, 0},
{(char *)"size", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_size, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_size, (char *)0, 0},
{(char *)"ref_iv", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_ref_iv, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_ref_iv, (char *)0, 0},
{(char *)"query_from", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_query_from, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_query_from, (char *)0, 0},
{(char *)"query_to", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_query_to, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_query_to, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_CigarOperation = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.CigarOperation", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq_CigarOperation, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_3__repr__, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_5HTSeq_6_HTSeq_CigarOperation, /*tp_traverse*/
__pyx_tp_clear_5HTSeq_6_HTSeq_CigarOperation, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5HTSeq_6_HTSeq_CigarOperation, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5HTSeq_6_HTSeq_CigarOperation, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq_CigarOperation, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *__pyx_freelist_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__[8];
static int __pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ = 0;
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__)))) {
o = (PyObject*)__pyx_freelist_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__[--__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__];
memset(o, 0, sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
return o;
}
static void __pyx_tp_dealloc_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(PyObject *o) {
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *p = (struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_value);
if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__)))) {
__pyx_freelist_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__[__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__++] = ((struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
static int __pyx_tp_traverse_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *p = (struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)o;
if (p->__pyx_v_value) {
e = (*v)(p->__pyx_v_value, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *p = (struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)o;
tmp = ((PyObject*)p->__pyx_v_value);
p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyTypeObject __pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ = {
PyVarObject_HEAD_INIT(0, 0)
"HTSeq._HTSeq.__pyx_scope_struct____iadd__", /*tp_name*/
sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, /*tp_traverse*/
__pyx_tp_clear_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
0, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyMethodDef __pyx_methods[] = {
{"reverse_complement", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_9reverse_complement, METH_O, __pyx_doc_5HTSeq_6_HTSeq_8reverse_complement},
{"parse_cigar", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11parse_cigar, METH_VARARGS|METH_KEYWORDS, 0},
{"build_cigar_list", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13build_cigar_list, METH_VARARGS|METH_KEYWORDS, 0},
{"quotesafe_split", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15quotesafe_split, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};
#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec__HTSeq(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
{Py_mod_create, (void*)__pyx_pymod_create},
{Py_mod_exec, (void*)__pyx_pymod_exec__HTSeq},
{0, NULL}
};
#endif
static struct PyModuleDef __pyx_moduledef = {
PyModuleDef_HEAD_INIT,
"_HTSeq",
0, /* m_doc */
#if CYTHON_PEP489_MULTI_PHASE_INIT
0, /* m_size */
#else
-1, /* m_size */
#endif
__pyx_methods /* m_methods */,
#if CYTHON_PEP489_MULTI_PHASE_INIT
__pyx_moduledef_slots, /* m_slots */
#else
NULL, /* m_reload */
#endif
NULL, /* m_traverse */
NULL, /* m_clear */
NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
#define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
#define CYTHON_SMALL_CODE __attribute__((cold))
#else
#define CYTHON_SMALL_CODE
#endif
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_u_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 1, 0, 1},
{&__pyx_n_b_ACGTacgt, __pyx_k_ACGTacgt, sizeof(__pyx_k_ACGTacgt), 0, 0, 0, 1},
{&__pyx_n_s_AlignedRead, __pyx_k_AlignedRead, sizeof(__pyx_k_AlignedRead), 0, 0, 1, 1},
{&__pyx_n_s_AlignedSegment, __pyx_k_AlignedSegment, sizeof(__pyx_k_AlignedSegment), 0, 0, 1, 1},
{&__pyx_n_s_Alignment, __pyx_k_Alignment, sizeof(__pyx_k_Alignment), 0, 0, 1, 1},
{&__pyx_n_s_AlignmentWithSequenceReversal, __pyx_k_AlignmentWithSequenceReversal, sizeof(__pyx_k_AlignmentWithSequenceReversal), 0, 0, 1, 1},
{&__pyx_kp_u_Automatic_adding_of_chromosomes, __pyx_k_Automatic_adding_of_chromosomes, sizeof(__pyx_k_Automatic_adding_of_chromosomes), 0, 1, 0, 0},
{&__pyx_n_s_BowtieAlignment, __pyx_k_BowtieAlignment, sizeof(__pyx_k_BowtieAlignment), 0, 0, 1, 1},
{&__pyx_n_u_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 1, 0, 1},
{&__pyx_kp_u_Cannot_assign_to_zero_length_int, __pyx_k_Cannot_assign_to_zero_length_int, sizeof(__pyx_k_Cannot_assign_to_zero_length_int), 0, 1, 0, 0},
{&__pyx_kp_u_Cannot_extend_an_interval_to_inc, __pyx_k_Cannot_extend_an_interval_to_inc, sizeof(__pyx_k_Cannot_extend_an_interval_to_inc), 0, 1, 0, 0},
{&__pyx_kp_u_Cannot_extend_an_interval_to_inc_2, __pyx_k_Cannot_extend_an_interval_to_inc_2, sizeof(__pyx_k_Cannot_extend_an_interval_to_inc_2), 0, 1, 0, 0},
{&__pyx_kp_u_Cannot_extend_an_interval_to_inc_3, __pyx_k_Cannot_extend_an_interval_to_inc_3, sizeof(__pyx_k_Cannot_extend_an_interval_to_inc_3), 0, 1, 0, 0},
{&__pyx_kp_u_Cannot_subset_to_zero_length_int, __pyx_k_Cannot_subset_to_zero_length_int, sizeof(__pyx_k_Cannot_subset_to_zero_length_int), 0, 1, 0, 0},
{&__pyx_n_s_ChromVector, __pyx_k_ChromVector, sizeof(__pyx_k_ChromVector), 0, 0, 1, 1},
{&__pyx_n_s_ChromVector_steps, __pyx_k_ChromVector_steps, sizeof(__pyx_k_ChromVector_steps), 0, 0, 1, 1},
{&__pyx_n_s_ChromVector_unpickle, __pyx_k_ChromVector_unpickle, sizeof(__pyx_k_ChromVector_unpickle), 0, 0, 1, 1},
{&__pyx_kp_u_Chromosome_name_mismatch, __pyx_k_Chromosome_name_mismatch, sizeof(__pyx_k_Chromosome_name_mismatch), 0, 1, 0, 0},
{&__pyx_n_s_CigarOperation, __pyx_k_CigarOperation, sizeof(__pyx_k_CigarOperation), 0, 0, 1, 1},
{&__pyx_n_u_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 1, 0, 1},
{&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
{&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
{&__pyx_n_u_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 1, 0, 1},
{&__pyx_n_s_GenomicArray, __pyx_k_GenomicArray, sizeof(__pyx_k_GenomicArray), 0, 0, 1, 1},
{&__pyx_n_s_GenomicArray_steps, __pyx_k_GenomicArray_steps, sizeof(__pyx_k_GenomicArray_steps), 0, 0, 1, 1},
{&__pyx_n_s_GenomicArray_unpickle, __pyx_k_GenomicArray_unpickle, sizeof(__pyx_k_GenomicArray_unpickle), 0, 0, 1, 1},
{&__pyx_n_s_GenomicInterval, __pyx_k_GenomicInterval, sizeof(__pyx_k_GenomicInterval), 0, 0, 1, 1},
{&__pyx_n_s_GenomicInterval_from_directional, __pyx_k_GenomicInterval_from_directional, sizeof(__pyx_k_GenomicInterval_from_directional), 0, 0, 1, 1},
{&__pyx_n_s_GenomicInterval_range, __pyx_k_GenomicInterval_range, sizeof(__pyx_k_GenomicInterval_range), 0, 0, 1, 1},
{&__pyx_n_s_GenomicInterval_ranged, __pyx_k_GenomicInterval_ranged, sizeof(__pyx_k_GenomicInterval_ranged), 0, 0, 1, 1},
{&__pyx_n_s_GenomicPosition, __pyx_k_GenomicPosition, sizeof(__pyx_k_GenomicPosition), 0, 0, 1, 1},
{&__pyx_n_u_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 1, 0, 1},
{&__pyx_n_s_HTSeq, __pyx_k_HTSeq, sizeof(__pyx_k_HTSeq), 0, 0, 1, 1},
{&__pyx_n_s_HTSeq__HTSeq, __pyx_k_HTSeq__HTSeq, sizeof(__pyx_k_HTSeq__HTSeq), 0, 0, 1, 1},
{&__pyx_n_s_HTSeq_internal, __pyx_k_HTSeq_internal, sizeof(__pyx_k_HTSeq_internal), 0, 0, 1, 1},
{&__pyx_n_u_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 1, 0, 1},
{&__pyx_kp_u_Illegal_CIGAR_string_s, __pyx_k_Illegal_CIGAR_string_s, sizeof(__pyx_k_Illegal_CIGAR_string_s), 0, 1, 0, 0},
{&__pyx_kp_u_Illegal_base_letter_encountered, __pyx_k_Illegal_base_letter_encountered, sizeof(__pyx_k_Illegal_base_letter_encountered), 0, 1, 0, 0},
{&__pyx_kp_u_Illegal_index_type, __pyx_k_Illegal_index_type, sizeof(__pyx_k_Illegal_index_type), 0, 1, 0, 0},
{&__pyx_kp_u_Illegal_index_type_2, __pyx_k_Illegal_index_type_2, sizeof(__pyx_k_Illegal_index_type_2), 0, 1, 0, 0},
{&__pyx_kp_u_Illegal_quality_scale_s, __pyx_k_Illegal_quality_scale_s, sizeof(__pyx_k_Illegal_quality_scale_s), 0, 1, 0, 0},
{&__pyx_kp_u_Illegal_storage_mode, __pyx_k_Illegal_storage_mode, sizeof(__pyx_k_Illegal_storage_mode), 0, 1, 0, 0},
{&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
{&__pyx_kp_s_Incompatible_checksums_s_vs_0x1b, __pyx_k_Incompatible_checksums_s_vs_0x1b, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x1b), 0, 0, 1, 0},
{&__pyx_kp_s_Incompatible_checksums_s_vs_0x48, __pyx_k_Incompatible_checksums_s_vs_0x48, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x48), 0, 0, 1, 0},
{&__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_k_Incompatible_checksums_s_vs_0x77, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x77), 0, 0, 1, 0},
{&__pyx_kp_s_Incompatible_checksums_s_vs_0xb5, __pyx_k_Incompatible_checksums_s_vs_0xb5, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb5), 0, 0, 1, 0},
{&__pyx_kp_s_Incompatible_checksums_s_vs_0xf6, __pyx_k_Incompatible_checksums_s_vs_0xf6, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xf6), 0, 0, 1, 0},
{&__pyx_kp_u_Inconsistent_CIGAR_operation, __pyx_k_Inconsistent_CIGAR_operation, sizeof(__pyx_k_Inconsistent_CIGAR_operation), 0, 1, 0, 0},
{&__pyx_kp_u_Indefinite_length_chromosomes_ca, __pyx_k_Indefinite_length_chromosomes_ca, sizeof(__pyx_k_Indefinite_length_chromosomes_ca), 0, 1, 0, 0},
{&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
{&__pyx_n_u_Inf, __pyx_k_Inf, sizeof(__pyx_k_Inf), 0, 1, 0, 1},
{&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
{&__pyx_n_u_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 1, 0, 1},
{&__pyx_kp_u_MIDNSHP_X, __pyx_k_MIDNSHP_X, sizeof(__pyx_k_MIDNSHP_X), 0, 1, 0, 0},
{&__pyx_kp_u_Malformatted_SAM_optional_field, __pyx_k_Malformatted_SAM_optional_field, sizeof(__pyx_k_Malformatted_SAM_optional_field), 0, 1, 0, 0},
{&__pyx_kp_u_Malformed_SAM_line_MRNM_although, __pyx_k_Malformed_SAM_line_MRNM_although, sizeof(__pyx_k_Malformed_SAM_line_MRNM_although), 0, 1, 0, 0},
{&__pyx_kp_u_Malformed_SAM_line_RNAME_althoug, __pyx_k_Malformed_SAM_line_RNAME_althoug, sizeof(__pyx_k_Malformed_SAM_line_RNAME_althoug), 0, 1, 0, 0},
{&__pyx_n_u_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 1, 0, 1},
{&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
{&__pyx_kp_u_Non_stranded_index_used_for_stra, __pyx_k_Non_stranded_index_used_for_stra, sizeof(__pyx_k_Non_stranded_index_used_for_stra), 0, 1, 0, 0},
{&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0},
{&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
{&__pyx_n_u_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 1, 0, 1},
{&__pyx_n_u_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 1, 0, 1},
{&__pyx_kp_u_Paired_end_read, __pyx_k_Paired_end_read, sizeof(__pyx_k_Paired_end_read), 0, 1, 0, 0},
{&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
{&__pyx_kp_u_Please_Install_PySam_to_use_this, __pyx_k_Please_Install_PySam_to_use_this, sizeof(__pyx_k_Please_Install_PySam_to_use_this), 0, 1, 0, 0},
{&__pyx_kp_u_Quality_string_has_not_the_same, __pyx_k_Quality_string_has_not_the_same, sizeof(__pyx_k_Quality_string_has_not_the_same), 0, 1, 0, 0},
{&__pyx_kp_u_Quality_string_missing, __pyx_k_Quality_string_missing, sizeof(__pyx_k_Quality_string_missing), 0, 1, 0, 0},
{&__pyx_kp_u_Quality_string_missing_2, __pyx_k_Quality_string_missing_2, sizeof(__pyx_k_Quality_string_missing_2), 0, 1, 0, 0},
{&__pyx_n_u_Read, __pyx_k_Read, sizeof(__pyx_k_Read), 0, 1, 0, 1},
{&__pyx_kp_u_Required_assignment_signature_no, __pyx_k_Required_assignment_signature_no, sizeof(__pyx_k_Required_assignment_signature_no), 0, 1, 0, 0},
{&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
{&__pyx_n_u_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 1, 0, 1},
{&__pyx_n_s_SAM_Alignment, __pyx_k_SAM_Alignment, sizeof(__pyx_k_SAM_Alignment), 0, 0, 1, 1},
{&__pyx_kp_u_SAM_line_does_not_contain_at_lea, __pyx_k_SAM_line_does_not_contain_at_lea, sizeof(__pyx_k_SAM_line_does_not_contain_at_lea), 0, 1, 0, 0},
{&__pyx_kp_u_SAM_optional_field_tag_s_not_fou, __pyx_k_SAM_optional_field_tag_s_not_fou, sizeof(__pyx_k_SAM_optional_field_tag_s_not_fou), 0, 1, 0, 0},
{&__pyx_kp_u_SAM_optional_field_tag_s_not_uni, __pyx_k_SAM_optional_field_tag_s_not_uni, sizeof(__pyx_k_SAM_optional_field_tag_s_not_uni), 0, 1, 0, 0},
{&__pyx_kp_u_SAM_optional_field_with_illegal, __pyx_k_SAM_optional_field_with_illegal, sizeof(__pyx_k_SAM_optional_field_with_illegal), 0, 1, 0, 0},
{&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
{&__pyx_n_s_SequenceWithQualities, __pyx_k_SequenceWithQualities, sizeof(__pyx_k_SequenceWithQualities), 0, 0, 1, 1},
{&__pyx_kp_u_Sequence_in_SAM_file_contains_wh, __pyx_k_Sequence_in_SAM_file_contains_wh, sizeof(__pyx_k_Sequence_in_SAM_file_contains_wh), 0, 1, 0, 0},
{&__pyx_kp_u_Sequence_in_SAM_file_contains_wh_2, __pyx_k_Sequence_in_SAM_file_contains_wh_2, sizeof(__pyx_k_Sequence_in_SAM_file_contains_wh_2), 0, 1, 0, 0},
{&__pyx_kp_u_Start_of_interval_is_after_its_e, __pyx_k_Start_of_interval_is_after_its_e, sizeof(__pyx_k_Start_of_interval_is_after_its_e), 0, 1, 0, 0},
{&__pyx_n_s_StepVector, __pyx_k_StepVector, sizeof(__pyx_k_StepVector), 0, 0, 1, 1},
{&__pyx_kp_u_Strand_mismatch, __pyx_k_Strand_mismatch, sizeof(__pyx_k_Strand_mismatch), 0, 1, 0, 0},
{&__pyx_kp_u_Strand_must_be_or, __pyx_k_Strand_must_be_or, sizeof(__pyx_k_Strand_must_be_or), 0, 1, 0, 0},
{&__pyx_kp_u_Strand_must_be_specified_for_str, __pyx_k_Strand_must_be_specified_for_str, sizeof(__pyx_k_Strand_must_be_specified_for_str), 0, 1, 0, 0},
{&__pyx_kp_u_Strand_specified_in_unstranded_G, __pyx_k_Strand_specified_in_unstranded_G, sizeof(__pyx_k_Strand_specified_in_unstranded_G), 0, 1, 0, 0},
{&__pyx_n_s_StringIO, __pyx_k_StringIO, sizeof(__pyx_k_StringIO), 0, 0, 1, 1},
{&__pyx_n_u_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 1, 0, 1},
{&__pyx_n_b_TGCAtgca, __pyx_k_TGCAtgca, sizeof(__pyx_k_TGCAtgca), 0, 0, 0, 1},
{&__pyx_kp_u_Too_large_quality_value_encounte, __pyx_k_Too_large_quality_value_encounte, sizeof(__pyx_k_Too_large_quality_value_encounte), 0, 1, 0, 0},
{&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
{&__pyx_kp_u_Unknown_CIGAR_code_s_encountered, __pyx_k_Unknown_CIGAR_code_s_encountered, sizeof(__pyx_k_Unknown_CIGAR_code_s_encountered), 0, 1, 0, 0},
{&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
{&__pyx_n_u_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 1, 0, 1},
{&__pyx_n_u_Z, __pyx_k_Z, sizeof(__pyx_k_Z), 0, 1, 0, 1},
{&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
{&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
{&__pyx_kp_b__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 0, 0},
{&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
{&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0},
{&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
{&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
{&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
{&__pyx_kp_u__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0},
{&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0},
{&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0},
{&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0},
{&__pyx_kp_b__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 0, 0},
{&__pyx_kp_u__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 1, 0, 0},
{&__pyx_kp_u__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 1, 0, 0},
{&__pyx_kp_u__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 1, 0, 0},
{&__pyx_kp_u__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 1, 0, 0},
{&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
{&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0},
{&__pyx_kp_u__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 1, 0, 0},
{&__pyx_kp_u__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 1, 0, 0},
{&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0},
{&__pyx_kp_b__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 0, 0},
{&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0},
{&__pyx_kp_b__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 0, 0, 0},
{&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
{&__pyx_kp_b__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 0, 0, 0},
{&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0},
{&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
{&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
{&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
{&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
{&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
{&__pyx_n_s_add_bases_to_count_array, __pyx_k_add_bases_to_count_array, sizeof(__pyx_k_add_bases_to_count_array), 0, 0, 1, 1},
{&__pyx_n_s_add_chrom, __pyx_k_add_chrom, sizeof(__pyx_k_add_chrom), 0, 0, 1, 1},
{&__pyx_n_s_add_qual_to_count_array, __pyx_k_add_qual_to_count_array, sizeof(__pyx_k_add_qual_to_count_array), 0, 0, 1, 1},
{&__pyx_n_s_addval, __pyx_k_addval, sizeof(__pyx_k_addval), 0, 0, 1, 1},
{&__pyx_n_s_aend, __pyx_k_aend, sizeof(__pyx_k_aend), 0, 0, 1, 1},
{&__pyx_n_s_aligned, __pyx_k_aligned, sizeof(__pyx_k_aligned), 0, 0, 1, 1},
{&__pyx_kp_u_aligned_to, __pyx_k_aligned_to, sizeof(__pyx_k_aligned_to), 0, 1, 0, 0},
{&__pyx_n_s_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 0, 0, 1, 1},
{&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
{&__pyx_kp_u_assignment_to_qual_with_illegal, __pyx_k_assignment_to_qual_with_illegal, sizeof(__pyx_k_assignment_to_qual_with_illegal), 0, 1, 0, 0},
{&__pyx_n_u_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 1, 0, 1},
{&__pyx_kp_u_base_s, __pyx_k_base_s, sizeof(__pyx_k_base_s), 0, 1, 0, 0},
{&__pyx_n_s_base_to_column, __pyx_k_base_to_column, sizeof(__pyx_k_base_to_column), 0, 0, 1, 1},
{&__pyx_n_s_bowtie_line, __pyx_k_bowtie_line, sizeof(__pyx_k_bowtie_line), 0, 0, 1, 1},
{&__pyx_n_s_cStringIO, __pyx_k_cStringIO, sizeof(__pyx_k_cStringIO), 0, 0, 1, 1},
{&__pyx_n_s_characters_per_line, __pyx_k_characters_per_line, sizeof(__pyx_k_characters_per_line), 0, 0, 1, 1},
{&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1},
{&__pyx_n_s_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 0, 0, 1, 1},
{&__pyx_n_s_chrom_vectors, __pyx_k_chrom_vectors, sizeof(__pyx_k_chrom_vectors), 0, 0, 1, 1},
{&__pyx_n_s_chroms, __pyx_k_chroms, sizeof(__pyx_k_chroms), 0, 0, 1, 1},
{&__pyx_kp_u_chroms_must_be_a_list_or_a_dict, __pyx_k_chroms_must_be_a_list_or_a_dict, sizeof(__pyx_k_chroms_must_be_a_list_or_a_dict), 0, 1, 0, 0},
{&__pyx_n_s_cigar, __pyx_k_cigar, sizeof(__pyx_k_cigar), 0, 0, 1, 1},
{&__pyx_n_s_cigar_operation_code_dict, __pyx_k_cigar_operation_code_dict, sizeof(__pyx_k_cigar_operation_code_dict), 0, 0, 1, 1},
{&__pyx_n_s_cigar_operation_codes, __pyx_k_cigar_operation_codes, sizeof(__pyx_k_cigar_operation_codes), 0, 0, 1, 1},
{&__pyx_n_s_cigar_operation_names, __pyx_k_cigar_operation_names, sizeof(__pyx_k_cigar_operation_names), 0, 0, 1, 1},
{&__pyx_n_s_cigar_pairs, __pyx_k_cigar_pairs, sizeof(__pyx_k_cigar_pairs), 0, 0, 1, 1},
{&__pyx_n_s_cigar_string, __pyx_k_cigar_string, sizeof(__pyx_k_cigar_string), 0, 0, 1, 1},
{&__pyx_n_s_cigartuples, __pyx_k_cigartuples, sizeof(__pyx_k_cigartuples), 0, 0, 1, 1},
{&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
{&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
{&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
{&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
{&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1},
{&__pyx_n_s_convert_to_phred, __pyx_k_convert_to_phred, sizeof(__pyx_k_convert_to_phred), 0, 0, 1, 1},
{&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
{&__pyx_kp_u_count_array_has_too_few_columns, __pyx_k_count_array_has_too_few_columns, sizeof(__pyx_k_count_array_has_too_few_columns), 0, 1, 0, 0},
{&__pyx_kp_u_count_array_too_small_for_seque, __pyx_k_count_array_too_small_for_seque, sizeof(__pyx_k_count_array_too_small_for_seque), 0, 1, 0, 0},
{&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1},
{&__pyx_n_s_create_view, __pyx_k_create_view, sizeof(__pyx_k_create_view), 0, 0, 1, 1},
{&__pyx_n_s_csv, __pyx_k_csv, sizeof(__pyx_k_csv), 0, 0, 1, 1},
{&__pyx_n_s_cv, __pyx_k_cv, sizeof(__pyx_k_cv), 0, 0, 1, 1},
{&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
{&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
{&__pyx_n_u_deleted, __pyx_k_deleted, sizeof(__pyx_k_deleted), 0, 1, 0, 1},
{&__pyx_n_u_descr, __pyx_k_descr, sizeof(__pyx_k_descr), 0, 1, 0, 1},
{&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
{&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
{&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
{&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
{&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
{&__pyx_n_s_end_d, __pyx_k_end_d, sizeof(__pyx_k_end_d), 0, 0, 1, 1},
{&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
{&__pyx_n_s_extend_to_include, __pyx_k_extend_to_include, sizeof(__pyx_k_extend_to_include), 0, 0, 1, 1},
{&__pyx_n_u_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 1, 0, 1},
{&__pyx_n_s_fasta_file, __pyx_k_fasta_file, sizeof(__pyx_k_fasta_file), 0, 0, 1, 1},
{&__pyx_n_s_file_or_filename, __pyx_k_file_or_filename, sizeof(__pyx_k_file_or_filename), 0, 0, 1, 1},
{&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
{&__pyx_n_u_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 1, 0, 1},
{&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1},
{&__pyx_n_s_from_SAM_line, __pyx_k_from_SAM_line, sizeof(__pyx_k_from_SAM_line), 0, 0, 1, 1},
{&__pyx_n_s_from_pysam_AlignedRead, __pyx_k_from_pysam_AlignedRead, sizeof(__pyx_k_from_pysam_AlignedRead), 0, 0, 1, 1},
{&__pyx_n_s_from_pysam_AlignedSegment, __pyx_k_from_pysam_AlignedSegment, sizeof(__pyx_k_from_pysam_AlignedSegment), 0, 0, 1, 1},
{&__pyx_n_s_ga, __pyx_k_ga, sizeof(__pyx_k_ga), 0, 0, 1, 1},
{&__pyx_n_s_get_reverse_complement, __pyx_k_get_reverse_complement, sizeof(__pyx_k_get_reverse_complement), 0, 0, 1, 1},
{&__pyx_n_s_getrname, __pyx_k_getrname, sizeof(__pyx_k_getrname), 0, 0, 1, 1},
{&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
{&__pyx_n_s_gettid, __pyx_k_gettid, sizeof(__pyx_k_gettid), 0, 0, 1, 1},
{&__pyx_n_s_getvalue, __pyx_k_getvalue, sizeof(__pyx_k_getvalue), 0, 0, 1, 1},
{&__pyx_n_s_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 0, 1, 1},
{&__pyx_kp_u_hard_clipped, __pyx_k_hard_clipped, sizeof(__pyx_k_hard_clipped), 0, 1, 0, 0},
{&__pyx_n_u_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 1, 0, 1},
{&__pyx_n_s_iadd, __pyx_k_iadd, sizeof(__pyx_k_iadd), 0, 0, 1, 1},
{&__pyx_n_s_iadd___locals_addval, __pyx_k_iadd___locals_addval, sizeof(__pyx_k_iadd___locals_addval), 0, 0, 1, 1},
{&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
{&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
{&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
{&__pyx_n_u_inserted, __pyx_k_inserted, sizeof(__pyx_k_inserted), 0, 1, 0, 1},
{&__pyx_n_s_is_contained_in, __pyx_k_is_contained_in, sizeof(__pyx_k_is_contained_in), 0, 0, 1, 1},
{&__pyx_n_s_is_duplicate, __pyx_k_is_duplicate, sizeof(__pyx_k_is_duplicate), 0, 0, 1, 1},
{&__pyx_n_s_is_paired, __pyx_k_is_paired, sizeof(__pyx_k_is_paired), 0, 0, 1, 1},
{&__pyx_n_s_is_proper_pair, __pyx_k_is_proper_pair, sizeof(__pyx_k_is_proper_pair), 0, 0, 1, 1},
{&__pyx_n_s_is_qcfail, __pyx_k_is_qcfail, sizeof(__pyx_k_is_qcfail), 0, 0, 1, 1},
{&__pyx_n_s_is_read1, __pyx_k_is_read1, sizeof(__pyx_k_is_read1), 0, 0, 1, 1},
{&__pyx_n_s_is_read2, __pyx_k_is_read2, sizeof(__pyx_k_is_read2), 0, 0, 1, 1},
{&__pyx_n_s_is_reverse, __pyx_k_is_reverse, sizeof(__pyx_k_is_reverse), 0, 0, 1, 1},
{&__pyx_n_s_is_secondary, __pyx_k_is_secondary, sizeof(__pyx_k_is_secondary), 0, 0, 1, 1},
{&__pyx_n_s_is_supplementary, __pyx_k_is_supplementary, sizeof(__pyx_k_is_supplementary), 0, 0, 1, 1},
{&__pyx_n_s_is_unmapped, __pyx_k_is_unmapped, sizeof(__pyx_k_is_unmapped), 0, 0, 1, 1},
{&__pyx_n_s_is_vector_of_sets, __pyx_k_is_vector_of_sets, sizeof(__pyx_k_is_vector_of_sets), 0, 0, 1, 1},
{&__pyx_n_s_isize, __pyx_k_isize, sizeof(__pyx_k_isize), 0, 0, 1, 1},
{&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
{&__pyx_n_s_iv, __pyx_k_iv, sizeof(__pyx_k_iv), 0, 0, 1, 1},
{&__pyx_n_u_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 1, 0, 1},
{&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
{&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
{&__pyx_kp_u_length_2, __pyx_k_length_2, sizeof(__pyx_k_length_2), 0, 1, 0, 0},
{&__pyx_n_s_log10, __pyx_k_log10, sizeof(__pyx_k_log10), 0, 0, 1, 1},
{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
{&__pyx_n_s_make_translation_table_for_comp, __pyx_k_make_translation_table_for_comp, sizeof(__pyx_k_make_translation_table_for_comp), 0, 0, 1, 1},
{&__pyx_n_s_maketrans, __pyx_k_maketrans, sizeof(__pyx_k_maketrans), 0, 0, 1, 1},
{&__pyx_n_s_mapping_quality, __pyx_k_mapping_quality, sizeof(__pyx_k_mapping_quality), 0, 0, 1, 1},
{&__pyx_n_s_mapq, __pyx_k_mapq, sizeof(__pyx_k_mapq), 0, 0, 1, 1},
{&__pyx_n_u_matched, __pyx_k_matched, sizeof(__pyx_k_matched), 0, 1, 0, 1},
{&__pyx_n_s_mate_aligned, __pyx_k_mate_aligned, sizeof(__pyx_k_mate_aligned), 0, 0, 1, 1},
{&__pyx_n_s_mate_is_reverse, __pyx_k_mate_is_reverse, sizeof(__pyx_k_mate_is_reverse), 0, 0, 1, 1},
{&__pyx_n_s_mate_is_unmapped, __pyx_k_mate_is_unmapped, sizeof(__pyx_k_mate_is_unmapped), 0, 0, 1, 1},
{&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
{&__pyx_n_s_max_mm_qual, __pyx_k_max_mm_qual, sizeof(__pyx_k_max_mm_qual), 0, 0, 1, 1},
{&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1},
{&__pyx_n_s_memmap, __pyx_k_memmap, sizeof(__pyx_k_memmap), 0, 0, 1, 1},
{&__pyx_n_u_memmap, __pyx_k_memmap, sizeof(__pyx_k_memmap), 0, 1, 0, 1},
{&__pyx_n_s_memmap_dir, __pyx_k_memmap_dir, sizeof(__pyx_k_memmap_dir), 0, 0, 1, 1},
{&__pyx_n_s_mismatch_prop, __pyx_k_mismatch_prop, sizeof(__pyx_k_mismatch_prop), 0, 0, 1, 1},
{&__pyx_n_u_missing, __pyx_k_missing, sizeof(__pyx_k_missing), 0, 1, 0, 1},
{&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
{&__pyx_n_s_mpos, __pyx_k_mpos, sizeof(__pyx_k_mpos), 0, 0, 1, 1},
{&__pyx_n_s_mrnm, __pyx_k_mrnm, sizeof(__pyx_k_mrnm), 0, 0, 1, 1},
{&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
{&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
{&__pyx_n_u_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 0, 1},
{&__pyx_n_u_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 1, 0, 1},
{&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
{&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
{&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
{&__pyx_n_s_next_reference_id, __pyx_k_next_reference_id, sizeof(__pyx_k_next_reference_id), 0, 0, 1, 1},
{&__pyx_n_s_next_reference_start, __pyx_k_next_reference_start, sizeof(__pyx_k_next_reference_start), 0, 0, 1, 1},
{&__pyx_kp_u_nmm, __pyx_k_nmm, sizeof(__pyx_k_nmm), 0, 1, 0, 0},
{&__pyx_n_u_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 1, 0, 1},
{&__pyx_n_u_noquals, __pyx_k_noquals, sizeof(__pyx_k_noquals), 0, 1, 0, 1},
{&__pyx_kp_u_not_aligned, __pyx_k_not_aligned, sizeof(__pyx_k_not_aligned), 0, 1, 0, 0},
{&__pyx_n_u_not_paired_end, __pyx_k_not_paired_end, sizeof(__pyx_k_not_paired_end), 0, 1, 0, 1},
{&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
{&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
{&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
{&__pyx_kp_u_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 1, 0, 0},
{&__pyx_kp_u_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 1, 0, 0},
{&__pyx_kp_u_object_3, __pyx_k_object_3, sizeof(__pyx_k_object_3), 0, 1, 0, 0},
{&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
{&__pyx_kp_u_on_ref_iv, __pyx_k_on_ref_iv, sizeof(__pyx_k_on_ref_iv), 0, 1, 0, 0},
{&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
{&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
{&__pyx_n_s_overlaps, __pyx_k_overlaps, sizeof(__pyx_k_overlaps), 0, 0, 1, 1},
{&__pyx_n_u_padded, __pyx_k_padded, sizeof(__pyx_k_padded), 0, 1, 0, 1},
{&__pyx_n_s_paired_end, __pyx_k_paired_end, sizeof(__pyx_k_paired_end), 0, 0, 1, 1},
{&__pyx_kp_u_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 1, 0, 0},
{&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
{&__pyx_n_s_pattern, __pyx_k_pattern, sizeof(__pyx_k_pattern), 0, 0, 1, 1},
{&__pyx_n_u_phred, __pyx_k_phred, sizeof(__pyx_k_phred), 0, 1, 0, 1},
{&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
{&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
{&__pyx_n_s_pysam, __pyx_k_pysam, sizeof(__pyx_k_pysam), 0, 0, 1, 1},
{&__pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_k_python3_src_HTSeq__HTSeq_pyx, sizeof(__pyx_k_python3_src_HTSeq__HTSeq_pyx), 0, 0, 1, 0},
{&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
{&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
{&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
{&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
{&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
{&__pyx_n_s_pyx_unpickle_Alignment, __pyx_k_pyx_unpickle_Alignment, sizeof(__pyx_k_pyx_unpickle_Alignment), 0, 0, 1, 1},
{&__pyx_n_s_pyx_unpickle_AlignmentWithSequ, __pyx_k_pyx_unpickle_AlignmentWithSequ, sizeof(__pyx_k_pyx_unpickle_AlignmentWithSequ), 0, 0, 1, 1},
{&__pyx_n_s_pyx_unpickle_BowtieAlignment, __pyx_k_pyx_unpickle_BowtieAlignment, sizeof(__pyx_k_pyx_unpickle_BowtieAlignment), 0, 0, 1, 1},
{&__pyx_n_s_pyx_unpickle_CigarOperation, __pyx_k_pyx_unpickle_CigarOperation, sizeof(__pyx_k_pyx_unpickle_CigarOperation), 0, 0, 1, 1},
{&__pyx_n_s_pyx_unpickle_SAM_Alignment, __pyx_k_pyx_unpickle_SAM_Alignment, sizeof(__pyx_k_pyx_unpickle_SAM_Alignment), 0, 0, 1, 1},
{&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
{&__pyx_n_s_qfrom, __pyx_k_qfrom, sizeof(__pyx_k_qfrom), 0, 0, 1, 1},
{&__pyx_n_s_qname, __pyx_k_qname, sizeof(__pyx_k_qname), 0, 0, 1, 1},
{&__pyx_n_s_qto, __pyx_k_qto, sizeof(__pyx_k_qto), 0, 0, 1, 1},
{&__pyx_n_s_qual, __pyx_k_qual, sizeof(__pyx_k_qual), 0, 0, 1, 1},
{&__pyx_kp_u_qual_can_only_be_assigned_a_nump, __pyx_k_qual_can_only_be_assigned_a_nump, sizeof(__pyx_k_qual_can_only_be_assigned_a_nump), 0, 1, 0, 0},
{&__pyx_n_s_qualscale, __pyx_k_qualscale, sizeof(__pyx_k_qualscale), 0, 0, 1, 1},
{&__pyx_n_s_qualstr, __pyx_k_qualstr, sizeof(__pyx_k_qualstr), 0, 0, 1, 1},
{&__pyx_kp_u_query_iv, __pyx_k_query_iv, sizeof(__pyx_k_query_iv), 0, 1, 0, 0},
{&__pyx_n_s_query_name, __pyx_k_query_name, sizeof(__pyx_k_query_name), 0, 0, 1, 1},
{&__pyx_n_s_query_qualities, __pyx_k_query_qualities, sizeof(__pyx_k_query_qualities), 0, 0, 1, 1},
{&__pyx_n_s_query_sequence, __pyx_k_query_sequence, sizeof(__pyx_k_query_sequence), 0, 0, 1, 1},
{&__pyx_n_s_quote, __pyx_k_quote, sizeof(__pyx_k_quote), 0, 0, 1, 1},
{&__pyx_kp_u_quote_must_be_length_1, __pyx_k_quote_must_be_length_1, sizeof(__pyx_k_quote_must_be_length_1), 0, 1, 0, 0},
{&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
{&__pyx_n_s_raw_optional_fields, __pyx_k_raw_optional_fields, sizeof(__pyx_k_raw_optional_fields), 0, 0, 1, 1},
{&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
{&__pyx_n_s_re_cigar_codes, __pyx_k_re_cigar_codes, sizeof(__pyx_k_re_cigar_codes), 0, 0, 1, 1},
{&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
{&__pyx_n_s_read_as_aligned, __pyx_k_read_as_aligned, sizeof(__pyx_k_read_as_aligned), 0, 0, 1, 1},
{&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
{&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
{&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
{&__pyx_n_s_ref_iv, __pyx_k_ref_iv, sizeof(__pyx_k_ref_iv), 0, 0, 1, 1},
{&__pyx_n_s_ref_left, __pyx_k_ref_left, sizeof(__pyx_k_ref_left), 0, 0, 1, 1},
{&__pyx_n_s_reference_end, __pyx_k_reference_end, sizeof(__pyx_k_reference_end), 0, 0, 1, 1},
{&__pyx_n_s_reference_id, __pyx_k_reference_id, sizeof(__pyx_k_reference_id), 0, 0, 1, 1},
{&__pyx_n_s_reference_start, __pyx_k_reference_start, sizeof(__pyx_k_reference_start), 0, 0, 1, 1},
{&__pyx_n_s_rename, __pyx_k_rename, sizeof(__pyx_k_rename), 0, 0, 1, 1},
{&__pyx_n_u_revcomp_of, __pyx_k_revcomp_of, sizeof(__pyx_k_revcomp_of), 0, 1, 0, 1},
{&__pyx_n_s_rfrom, __pyx_k_rfrom, sizeof(__pyx_k_rfrom), 0, 0, 1, 1},
{&__pyx_n_s_rstrip, __pyx_k_rstrip, sizeof(__pyx_k_rstrip), 0, 0, 1, 1},
{&__pyx_n_s_rto, __pyx_k_rto, sizeof(__pyx_k_rto), 0, 0, 1, 1},
{&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
{&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0},
{&__pyx_n_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 1},
{&__pyx_n_s_samfile, __pyx_k_samfile, sizeof(__pyx_k_samfile), 0, 0, 1, 1},
{&__pyx_n_s_se, __pyx_k_se, sizeof(__pyx_k_se), 0, 0, 1, 1},
{&__pyx_n_u_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 1, 0, 1},
{&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1},
{&__pyx_n_u_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 1, 0, 1},
{&__pyx_kp_u_seq_and_qualstr_do_not_have_the, __pyx_k_seq_and_qualstr_do_not_have_the, sizeof(__pyx_k_seq_and_qualstr_do_not_have_the), 0, 1, 0, 0},
{&__pyx_kp_u_sequence_matched, __pyx_k_sequence_matched, sizeof(__pyx_k_sequence_matched), 0, 1, 0, 0},
{&__pyx_kp_u_sequence_mismatched, __pyx_k_sequence_mismatched, sizeof(__pyx_k_sequence_mismatched), 0, 1, 0, 0},
{&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
{&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
{&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
{&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
{&__pyx_n_u_skipped, __pyx_k_skipped, sizeof(__pyx_k_skipped), 0, 1, 0, 1},
{&__pyx_kp_u_soft_clipped, __pyx_k_soft_clipped, sizeof(__pyx_k_soft_clipped), 0, 1, 0, 0},
{&__pyx_n_u_solexa, __pyx_k_solexa, sizeof(__pyx_k_solexa), 0, 1, 0, 1},
{&__pyx_kp_u_solexa_old, __pyx_k_solexa_old, sizeof(__pyx_k_solexa_old), 0, 1, 0, 0},
{&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
{&__pyx_kp_u_split_must_be_length_1, __pyx_k_split_must_be_length_1, sizeof(__pyx_k_split_must_be_length_1), 0, 1, 0, 0},
{&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
{&__pyx_n_s_start_d, __pyx_k_start_d, sizeof(__pyx_k_start_d), 0, 0, 1, 1},
{&__pyx_n_s_start_index, __pyx_k_start_index, sizeof(__pyx_k_start_index), 0, 0, 1, 1},
{&__pyx_kp_u_start_is_larger_than_end, __pyx_k_start_is_larger_than_end, sizeof(__pyx_k_start_is_larger_than_end), 0, 1, 0, 0},
{&__pyx_kp_u_start_too_small, __pyx_k_start_too_small, sizeof(__pyx_k_start_too_small), 0, 1, 0, 0},
{&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
{&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
{&__pyx_n_u_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 1, 0, 1},
{&__pyx_n_s_steps, __pyx_k_steps, sizeof(__pyx_k_steps), 0, 0, 1, 1},
{&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
{&__pyx_kp_u_stop_too_large, __pyx_k_stop_too_large, sizeof(__pyx_k_stop_too_large), 0, 1, 0, 0},
{&__pyx_n_s_storage, __pyx_k_storage, sizeof(__pyx_k_storage), 0, 0, 1, 1},
{&__pyx_n_s_storage_2, __pyx_k_storage_2, sizeof(__pyx_k_storage_2), 0, 0, 1, 1},
{&__pyx_n_s_strand, __pyx_k_strand, sizeof(__pyx_k_strand), 0, 0, 1, 1},
{&__pyx_kp_u_strand_2, __pyx_k_strand_2, sizeof(__pyx_k_strand_2), 0, 1, 0, 0},
{&__pyx_kp_u_strand_3, __pyx_k_strand_3, sizeof(__pyx_k_strand_3), 0, 1, 0, 0},
{&__pyx_n_s_stranded, __pyx_k_stranded, sizeof(__pyx_k_stranded), 0, 0, 1, 1},
{&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
{&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
{&__pyx_n_s_tags, __pyx_k_tags, sizeof(__pyx_k_tags), 0, 0, 1, 1},
{&__pyx_n_s_template_length, __pyx_k_template_length, sizeof(__pyx_k_template_length), 0, 0, 1, 1},
{&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
{&__pyx_n_s_tid, __pyx_k_tid, sizeof(__pyx_k_tid), 0, 0, 1, 1},
{&__pyx_n_s_track_options, __pyx_k_track_options, sizeof(__pyx_k_track_options), 0, 0, 1, 1},
{&__pyx_kp_u_track_type_bedGraph, __pyx_k_track_type_bedGraph, sizeof(__pyx_k_track_type_bedGraph), 0, 1, 0, 0},
{&__pyx_kp_u_track_type_bedGraph_s, __pyx_k_track_type_bedGraph_s, sizeof(__pyx_k_track_type_bedGraph_s), 0, 1, 0, 0},
{&__pyx_n_s_translate, __pyx_k_translate, sizeof(__pyx_k_translate), 0, 0, 1, 1},
{&__pyx_n_s_trim_left_end, __pyx_k_trim_left_end, sizeof(__pyx_k_trim_left_end), 0, 0, 1, 1},
{&__pyx_n_s_trim_left_end_with_quals, __pyx_k_trim_left_end_with_quals, sizeof(__pyx_k_trim_left_end_with_quals), 0, 0, 1, 1},
{&__pyx_n_s_trim_right_end, __pyx_k_trim_right_end, sizeof(__pyx_k_trim_right_end), 0, 0, 1, 1},
{&__pyx_n_s_trim_right_end_with_quals, __pyx_k_trim_right_end_with_quals, sizeof(__pyx_k_trim_right_end_with_quals), 0, 0, 1, 1},
{&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
{&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1},
{&__pyx_n_s_typecode, __pyx_k_typecode, sizeof(__pyx_k_typecode), 0, 0, 1, 1},
{&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
{&__pyx_n_u_unknown, __pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 1, 0, 1},
{&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
{&__pyx_kp_u_unmatched_quote, __pyx_k_unmatched_quote, sizeof(__pyx_k_unmatched_quote), 0, 1, 0, 0},
{&__pyx_n_u_unnamed, __pyx_k_unnamed, sizeof(__pyx_k_unnamed), 0, 1, 0, 1},
{&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
{&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
{&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
{&__pyx_n_s_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1},
{&__pyx_kp_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 0},
{&__pyx_n_u_w_2, __pyx_k_w_2, sizeof(__pyx_k_w_2), 0, 1, 0, 1},
{&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
{&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
{&__pyx_n_u_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 1, 0, 1},
{&__pyx_n_s_write_to_fastq_file, __pyx_k_write_to_fastq_file, sizeof(__pyx_k_write_to_fastq_file), 0, 0, 1, 1},
{&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
{&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
{&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
{0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
__pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 67, __pyx_L1_error)
__pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 166, __pyx_L1_error)
__pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 240, __pyx_L1_error)
__pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 352, __pyx_L1_error)
__pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 433, __pyx_L1_error)
__pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 597, __pyx_L1_error)
__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 723, __pyx_L1_error)
__pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1241, __pyx_L1_error)
__pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 1256, __pyx_L1_error)
__pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 856, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
}
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
/* "HTSeq/_HTSeq.pyx":335
* else:
* ncv.array = numpy.empty(shape=(iv.length, ), dtype=typecode)
* ncv.array[:] = None # <<<<<<<<<<<<<<
* elif storage == "memmap":
* ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
*/
__pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_slice__13);
__Pyx_GIVEREF(__pyx_slice__13);
/* "HTSeq/_HTSeq.pyx":447
* self.offset].__iadd__(value)
* else:
* def addval(x): # <<<<<<<<<<<<<<
* y = x.copy()
* y.add(value)
*/
__pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__14);
__Pyx_GIVEREF(__pyx_tuple__14);
__pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_n_s_addval, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 447, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":627
*
* def _make_translation_table_for_complementation():
* return bytes.maketrans(b'ACGTacgt', b'TGCAtgca') # <<<<<<<<<<<<<<
*
* cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation()
*/
__pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_b_ACGTacgt, __pyx_n_b_TGCAtgca); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 627, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__23);
__Pyx_GIVEREF(__pyx_tuple__23);
/* "HTSeq/_HTSeq.pyx":635
* work with extended IUPAC nucleotide letters or RNA."""
*
* return seq[::-1].translate(_translation_table_for_complementation) # <<<<<<<<<<<<<<
*
* base_to_column = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'N': 4}
*/
__pyx_slice__24 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__24)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_slice__24);
__Pyx_GIVEREF(__pyx_slice__24);
/* "HTSeq/_HTSeq.pyx":1420
* raise ValueError, "SAM line does not contain at least 11 tab-delimited fields."
* (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
* seq, qual) = fields[0:11] # <<<<<<<<<<<<<<
* optional_fields = fields[11:]
*
*/
__pyx_slice__35 = PySlice_New(__pyx_int_0, __pyx_int_11, Py_None); if (unlikely(!__pyx_slice__35)) __PYX_ERR(0, 1420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_slice__35);
__Pyx_GIVEREF(__pyx_slice__35);
/* "HTSeq/_HTSeq.pyx":1421
* (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
* seq, qual) = fields[0:11]
* optional_fields = fields[11:] # <<<<<<<<<<<<<<
*
* if seq.count("=") > 0:
*/
__pyx_slice__36 = PySlice_New(__pyx_int_11, Py_None, Py_None); if (unlikely(!__pyx_slice__36)) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_slice__36);
__Pyx_GIVEREF(__pyx_slice__36);
/* "HTSeq/_HTSeq.pyx":1456
* alnmt.cigar = cigarlist
* alnmt.optional_fields = [
* (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields] # <<<<<<<<<<<<<<
* alnmt.aQual = int(mapq)
* alnmt.inferred_insert_size = int(isize)
*/
__pyx_slice__37 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__37)) __PYX_ERR(0, 1456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_slice__37);
__Pyx_GIVEREF(__pyx_slice__37);
/* "HTSeq/_HTSeq.pyx":1517
* query_start = self.iv
* else:
* query_start = GenomicPosition("*", -1) # <<<<<<<<<<<<<<
*
* if self.mate_start is not None:
*/
__pyx_tuple__38 = PyTuple_Pack(2, __pyx_kp_u__34, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__38);
__Pyx_GIVEREF(__pyx_tuple__38);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
* raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
*/
__pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(3, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__41);
__Pyx_GIVEREF(__pyx_tuple__41);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
* raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
*
* info.buf = PyArray_DATA(self)
*/
__pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(3, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__42);
__Pyx_GIVEREF(__pyx_tuple__42);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
* if ((descr.byteorder == c'>' and little_endian) or
* (descr.byteorder == c'<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
*/
__pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(3, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__43);
__Pyx_GIVEREF(__pyx_tuple__43);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
*
* if (end - f) - (new_offset - offset[0]) < 15:
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
*
* if ((child.byteorder == c'>' and little_endian) or
*/
__pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(3, 856, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__44);
__Pyx_GIVEREF(__pyx_tuple__44);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
* t = child.type_num
* if end - f < 5:
* raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
*
* # Until ticket #99 is fixed, use integers to avoid warnings
*/
__pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(3, 880, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__45);
__Pyx_GIVEREF(__pyx_tuple__45);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
* _import_array()
* except Exception:
* raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
*
* cdef inline int import_umath() except -1:
*/
__pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(3, 1038, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__46);
__Pyx_GIVEREF(__pyx_tuple__46);
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
* _import_umath()
* except Exception:
* raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
*
* cdef inline int import_ufunc() except -1:
*/
__pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(3, 1044, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__47);
__Pyx_GIVEREF(__pyx_tuple__47);
/* "HTSeq/_HTSeq.pyx":253
*
*
* def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."): # <<<<<<<<<<<<<<
* strand = intern(strand)
* if strand.se is not strand_minus:
*/
__pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_chrom, __pyx_n_s_start_d, __pyx_n_s_length, __pyx_n_s_strand); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__48);
__Pyx_GIVEREF(__pyx_tuple__48);
__pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_n_s_GenomicInterval_from_directional, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 253, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":477
*
*
* def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage): # <<<<<<<<<<<<<<
* cv = ChromVector()
* cv.array = array
*/
__pyx_tuple__50 = PyTuple_Pack(6, __pyx_n_s_array, __pyx_n_s_iv, __pyx_n_s_offset, __pyx_n_s_is_vector_of_sets, __pyx_n_s_storage_2, __pyx_n_s_cv); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__50);
__Pyx_GIVEREF(__pyx_tuple__50);
__pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_n_s_ChromVector_unpickle, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 477, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":615
*
*
* def _GenomicArray_unpickle(stranded, typecode, chrom_vectors): # <<<<<<<<<<<<<<
* ga = GenomicArray({}, stranded, typecode)
* ga.chrom_vectors = chrom_vectors
*/
__pyx_tuple__52 = PyTuple_Pack(4, __pyx_n_s_stranded, __pyx_n_s_typecode, __pyx_n_s_chrom_vectors, __pyx_n_s_ga); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__52);
__Pyx_GIVEREF(__pyx_tuple__52);
__pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_n_s_GenomicArray_unpickle, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 615, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":626
*
*
* def _make_translation_table_for_complementation(): # <<<<<<<<<<<<<<
* return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
*
*/
__pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_n_s_make_translation_table_for_comp, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 626, __pyx_L1_error)
/* "HTSeq/_HTSeq.pyx":1160
* return True
*
* _re_cigar_codes = re.compile('([MIDNSHP=X])') # <<<<<<<<<<<<<<
*
* cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."):
*/
__pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_u_MIDNSHP_X); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__55);
__Pyx_GIVEREF(__pyx_tuple__55);
/* "(tree fragment)":1
* def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
__pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__56);
__Pyx_GIVEREF(__pyx_tuple__56);
__pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Alignment, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(2, 1, __pyx_L1_error)
__pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__58);
__Pyx_GIVEREF(__pyx_tuple__58);
__pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_AlignmentWithSequ, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(2, 1, __pyx_L1_error)
__pyx_tuple__60 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__60);
__Pyx_GIVEREF(__pyx_tuple__60);
__pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BowtieAlignment, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(2, 1, __pyx_L1_error)
__pyx_tuple__62 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__62);
__Pyx_GIVEREF(__pyx_tuple__62);
__pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CigarOperation, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(2, 1, __pyx_L1_error)
__pyx_tuple__64 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__64);
__Pyx_GIVEREF(__pyx_tuple__64);
__pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SAM_Alignment, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
__Pyx_RefNannyFinishContext();
return -1;
}
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
__pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_70 = PyInt_FromLong(70); if (unlikely(!__pyx_int_70)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_28831487 = PyInt_FromLong(28831487L); if (unlikely(!__pyx_int_28831487)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_75678070 = PyInt_FromLong(75678070L); if (unlikely(!__pyx_int_75678070)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_125566450 = PyInt_FromLong(125566450L); if (unlikely(!__pyx_int_125566450)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_190567068 = PyInt_FromLong(190567068L); if (unlikely(!__pyx_int_190567068)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_258552819 = PyInt_FromLong(258552819L); if (unlikely(!__pyx_int_258552819)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
}
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
static int __Pyx_modinit_global_init_code(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
/*--- Global init code ---*/
__pyx_v_5HTSeq_6_HTSeq_strand_plus = ((PyObject*)Py_None); Py_INCREF(Py_None);
__pyx_v_5HTSeq_6_HTSeq_strand_minus = ((PyObject*)Py_None); Py_INCREF(Py_None);
__pyx_v_5HTSeq_6_HTSeq_strand_nostrand = ((PyObject*)Py_None); Py_INCREF(Py_None);
__pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation = ((PyObject*)Py_None); Py_INCREF(Py_None);
__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i = Py_None; Py_INCREF(Py_None);
__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x = Py_None; Py_INCREF(Py_None);
__Pyx_RefNannyFinishContext();
return 0;
}
static int __Pyx_modinit_variable_export_code(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
/*--- Variable export code ---*/
__Pyx_RefNannyFinishContext();
return 0;
}
static int __Pyx_modinit_function_export_code(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
/*--- Function export code ---*/
__Pyx_RefNannyFinishContext();
return 0;
}
static int __Pyx_modinit_type_init_code(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
/*--- Type init code ---*/
__pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval = &__pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval;
__pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval.is_contained_in = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_is_contained_in;
__pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval.contains = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_contains;
__pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval.overlaps = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_overlaps;
__pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval.extend_to_include = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_extend_to_include;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_GenomicInterval) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_GenomicInterval.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_GenomicInterval.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_GenomicInterval.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_GenomicInterval.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5HTSeq_6_HTSeq_GenomicInterval, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 29, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_5HTSeq_6_HTSeq_15GenomicInterval___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_5HTSeq_6_HTSeq_15GenomicInterval___init__.doc = __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5HTSeq_6_HTSeq_15GenomicInterval___init__;
}
}
#endif
if (__Pyx_SetVtable(__pyx_type_5HTSeq_6_HTSeq_GenomicInterval.tp_dict, __pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GenomicInterval, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_GenomicInterval) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval = &__pyx_type_5HTSeq_6_HTSeq_GenomicInterval;
__pyx_vtabptr_5HTSeq_6_HTSeq_GenomicPosition = &__pyx_vtable_5HTSeq_6_HTSeq_GenomicPosition;
__pyx_vtable_5HTSeq_6_HTSeq_GenomicPosition.__pyx_base = *__pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval;
__pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_base = __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_GenomicPosition) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
if (__Pyx_SetVtable(__pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_dict, __pyx_vtabptr_5HTSeq_6_HTSeq_GenomicPosition) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GenomicPosition, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_GenomicPosition) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition = &__pyx_type_5HTSeq_6_HTSeq_GenomicPosition;
__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence = &__pyx_vtable_5HTSeq_6_HTSeq_Sequence;
__pyx_vtable_5HTSeq_6_HTSeq_Sequence.get_reverse_complement = (struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement;
__pyx_vtable_5HTSeq_6_HTSeq_Sequence.add_bases_to_count_array = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_8Sequence_add_bases_to_count_array;
__pyx_vtable_5HTSeq_6_HTSeq_Sequence.trim_left_end = (struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_left_end;
__pyx_vtable_5HTSeq_6_HTSeq_Sequence.trim_right_end = (struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_right_end;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_Sequence) < 0) __PYX_ERR(0, 639, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_Sequence.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_Sequence.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_Sequence.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_Sequence.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
if (__Pyx_SetVtable(__pyx_type_5HTSeq_6_HTSeq_Sequence.tp_dict, __pyx_vtabptr_5HTSeq_6_HTSeq_Sequence) < 0) __PYX_ERR(0, 639, __pyx_L1_error)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Sequence, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_Sequence) < 0) __PYX_ERR(0, 639, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_Sequence = &__pyx_type_5HTSeq_6_HTSeq_Sequence;
__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities = &__pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities;
__pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.__pyx_base = *__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence;
__pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.__pyx_base.get_reverse_complement = (struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement__pyx_wrap_1;
__pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities._fill_qual_arr = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities__fill_qual_arr;
__pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.add_qual_to_count_array = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_add_qual_to_count_array;
__pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.trim_left_end_with_quals = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals;
__pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.trim_right_end_with_quals = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals;
__pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.get_reverse_complement = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement;
__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_base = __pyx_ptype_5HTSeq_6_HTSeq_Sequence;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 789, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_5HTSeq_6_HTSeq_21SequenceWithQualities___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_5HTSeq_6_HTSeq_21SequenceWithQualities___init__.doc = __pyx_doc_5HTSeq_6_HTSeq_21SequenceWithQualities___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5HTSeq_6_HTSeq_21SequenceWithQualities___init__;
}
}
#endif
if (__Pyx_SetVtable(__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_dict, __pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SequenceWithQualities, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities = &__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_Alignment) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_Alignment.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_Alignment.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_Alignment.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_Alignment.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Alignment, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_Alignment) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)
if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5HTSeq_6_HTSeq_Alignment) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_Alignment = &__pyx_type_5HTSeq_6_HTSeq_Alignment;
__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal.tp_base = __pyx_ptype_5HTSeq_6_HTSeq_Alignment;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AlignmentWithSequenceReversal, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal = &__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment.tp_base = __pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_SAM_Alignment.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SAM_Alignment, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment = &__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_ChromVector) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_ChromVector.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_ChromVector.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_ChromVector.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_ChromVector.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ChromVector, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_ChromVector) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_ChromVector = &__pyx_type_5HTSeq_6_HTSeq_ChromVector;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_GenomicArray) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_GenomicArray.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_GenomicArray.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_GenomicArray.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_GenomicArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GenomicArray, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_GenomicArray) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray = &__pyx_type_5HTSeq_6_HTSeq_GenomicArray;
__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment.tp_base = __pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_BowtieAlignment.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BowtieAlignment, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment = &__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_CigarOperation) < 0) __PYX_ERR(0, 1118, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq_CigarOperation.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_CigarOperation.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_CigarOperation.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq_CigarOperation.tp_getattro = __Pyx_PyObject_GenericGetAttr;
}
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CigarOperation, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_CigarOperation) < 0) __PYX_ERR(0, 1118, __pyx_L1_error)
if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5HTSeq_6_HTSeq_CigarOperation) < 0) __PYX_ERR(0, 1118, __pyx_L1_error)
__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation = &__pyx_type_5HTSeq_6_HTSeq_CigarOperation;
if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__) < 0) __PYX_ERR(0, 442, __pyx_L1_error)
__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__.tp_print = 0;
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__.tp_getattro == PyObject_GenericGetAttr)) {
__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
}
__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ = &__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__;
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
__Pyx_RefNannyFinishContext();
return -1;
}
static int __Pyx_modinit_type_import_code(void) {
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
/*--- Type import code ---*/
__pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
sizeof(PyTypeObject),
#else
sizeof(PyHeapTypeObject),
#endif
__Pyx_ImportType_CheckSize_Warn);
if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 206, __pyx_L1_error)
__pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 229, __pyx_L1_error)
__pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 233, __pyx_L1_error)
__pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 242, __pyx_L1_error)
__pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 918, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_RefNannyFinishContext();
return -1;
}
static int __Pyx_modinit_variable_import_code(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
/*--- Variable import code ---*/
__Pyx_RefNannyFinishContext();
return 0;
}
static int __Pyx_modinit_function_import_code(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
/*--- Function import code ---*/
__Pyx_RefNannyFinishContext();
return 0;
}
#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif
#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC init_HTSeq(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC init_HTSeq(void)
#else
__Pyx_PyMODINIT_FUNC PyInit__HTSeq(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__HTSeq(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
#if PY_VERSION_HEX >= 0x030700A1
static PY_INT64_T main_interpreter_id = -1;
PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
if (main_interpreter_id == -1) {
main_interpreter_id = current_id;
return (unlikely(current_id == -1)) ? -1 : 0;
} else if (unlikely(main_interpreter_id != current_id))
#else
static PyInterpreterState *main_interpreter = NULL;
PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
if (!main_interpreter) {
main_interpreter = current_interpreter;
} else if (unlikely(main_interpreter != current_interpreter))
#endif
{
PyErr_SetString(
PyExc_ImportError,
"Interpreter change detected - this module can only be loaded into one interpreter per process.");
return -1;
}
return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
PyObject *value = PyObject_GetAttrString(spec, from_name);
int result = 0;
if (likely(value)) {
if (allow_none || value != Py_None) {
result = PyDict_SetItemString(moddict, to_name, value);
}
Py_DECREF(value);
} else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
PyErr_Clear();
} else {
result = -1;
}
return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
PyObject *module = NULL, *moddict, *modname;
if (__Pyx_check_single_interpreter())
return NULL;
if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
modname = PyObject_GetAttrString(spec, "name");
if (unlikely(!modname)) goto bad;
module = PyModule_NewObject(modname);
Py_DECREF(modname);
if (unlikely(!module)) goto bad;
moddict = PyModule_GetDict(module);
if (unlikely(!moddict)) goto bad;
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
return module;
bad:
Py_XDECREF(module);
return NULL;
}
static CYTHON_SMALL_CODE int __pyx_pymod_exec__HTSeq(PyObject *__pyx_pyinit_module)
#endif
#endif
{
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
Py_ssize_t __pyx_t_8;
PyObject *(*__pyx_t_9)(PyObject *);
__Pyx_RefNannyDeclarations
#if CYTHON_PEP489_MULTI_PHASE_INIT
if (__pyx_m) {
if (__pyx_m == __pyx_pyinit_module) return 0;
PyErr_SetString(PyExc_RuntimeError, "Module '_HTSeq' has already been imported. Re-initialisation is not supported.");
return -1;
}
#elif PY_MAJOR_VERSION >= 3
if (__pyx_m) return __Pyx_NewRef(__pyx_m);
#endif
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
PyErr_Clear();
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
if (!__Pyx_RefNanny)
Py_FatalError("failed to import 'refnanny' module");
}
#endif
__Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__HTSeq(void)", 0);
if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pxy_PyFrame_Initialize_Offsets
__Pxy_PyFrame_Initialize_Offsets();
#endif
__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_FusedFunction_USED
if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Coroutine_USED
if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_AsyncGen_USED
if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_StopAsyncIteration_USED
if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
#ifdef WITH_THREAD /* Python build with threading support? */
PyEval_InitThreads();
#endif
#endif
/*--- Module creation code ---*/
#if CYTHON_PEP489_MULTI_PHASE_INIT
__pyx_m = __pyx_pyinit_module;
Py_INCREF(__pyx_m);
#else
#if PY_MAJOR_VERSION < 3
__pyx_m = Py_InitModule4("_HTSeq", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
#else
__pyx_m = PyModule_Create(&__pyx_moduledef);
#endif
if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
__pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
if (__pyx_module_is_main_HTSeq___HTSeq) {
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
if (!PyDict_GetItemString(modules, "HTSeq._HTSeq")) {
if (unlikely(PyDict_SetItemString(modules, "HTSeq._HTSeq", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
}
}
#endif
/*--- Builtin init code ---*/
if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Constants init code ---*/
if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global type/function init code ---*/
(void)__Pyx_modinit_global_init_code();
(void)__Pyx_modinit_variable_export_code();
(void)__Pyx_modinit_function_export_code();
if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
(void)__Pyx_modinit_variable_import_code();
(void)__Pyx_modinit_function_import_code();
/*--- Execution code ---*/
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/* "HTSeq/_HTSeq.pyx":1
* import sys # <<<<<<<<<<<<<<
* import os
* import math
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":2
* import sys
* import os # <<<<<<<<<<<<<<
* import math
* import re
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":3
* import sys
* import os
* import math # <<<<<<<<<<<<<<
* import re
* import csv
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":4
* import os
* import math
* import re # <<<<<<<<<<<<<<
* import csv
* import gzip
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":5
* import math
* import re
* import csv # <<<<<<<<<<<<<<
* import gzip
* import itertools
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_csv, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_csv, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":6
* import re
* import csv
* import gzip # <<<<<<<<<<<<<<
* import itertools
* import collections
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_gzip, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_gzip, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":7
* import csv
* import gzip
* import itertools # <<<<<<<<<<<<<<
* import collections
* try:
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":8
* import gzip
* import itertools
* import collections # <<<<<<<<<<<<<<
* try:
* import cStringIO
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":9
* import itertools
* import collections
* try: # <<<<<<<<<<<<<<
* import cStringIO
* except:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
/*try:*/ {
/* "HTSeq/_HTSeq.pyx":10
* import collections
* try:
* import cStringIO # <<<<<<<<<<<<<<
* except:
* pass
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_cStringIO, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L2_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_cStringIO, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L2_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":9
* import itertools
* import collections
* try: # <<<<<<<<<<<<<<
* import cStringIO
* except:
*/
}
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L7_try_end;
__pyx_L2_error:;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":11
* try:
* import cStringIO
* except: # <<<<<<<<<<<<<<
* pass
* import warnings
*/
/*except:*/ {
__Pyx_ErrRestore(0,0,0);
goto __pyx_L3_exception_handled;
}
__pyx_L3_exception_handled:;
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
__pyx_L7_try_end:;
}
/* "HTSeq/_HTSeq.pyx":13
* except:
* pass
* import warnings # <<<<<<<<<<<<<<
* import numpy
* cimport numpy
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":14
* pass
* import warnings
* import numpy # <<<<<<<<<<<<<<
* cimport numpy
*
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":17
* cimport numpy
*
* from HTSeq import StepVector # <<<<<<<<<<<<<<
* from HTSeq import _HTSeq_internal
*
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_StepVector);
__Pyx_GIVEREF(__pyx_n_s_StepVector);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_StepVector);
__pyx_t_5 = __Pyx_Import(__pyx_n_s_HTSeq, __pyx_t_1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_StepVector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_StepVector, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":18
*
* from HTSeq import StepVector
* from HTSeq import _HTSeq_internal # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_n_s_HTSeq_internal);
__Pyx_GIVEREF(__pyx_n_s_HTSeq_internal);
PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_HTSeq_internal);
__pyx_t_1 = __Pyx_Import(__pyx_n_s_HTSeq, __pyx_t_5, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_HTSeq_internal); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_HTSeq_internal, __pyx_t_5) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":25
* ###########################
*
* cdef str strand_plus = intern("+") # <<<<<<<<<<<<<<
* cdef str strand_minus = intern("-")
* cdef str strand_nostrand = intern(".")
*/
__pyx_t_1 = __Pyx_Intern(__pyx_kp_u__19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 25, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_v_5HTSeq_6_HTSeq_strand_plus);
__Pyx_DECREF_SET(__pyx_v_5HTSeq_6_HTSeq_strand_plus, ((PyObject*)__pyx_t_1));
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":26
*
* cdef str strand_plus = intern("+")
* cdef str strand_minus = intern("-") # <<<<<<<<<<<<<<
* cdef str strand_nostrand = intern(".")
*
*/
__pyx_t_1 = __Pyx_Intern(__pyx_kp_u__20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 26, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_v_5HTSeq_6_HTSeq_strand_minus);
__Pyx_DECREF_SET(__pyx_v_5HTSeq_6_HTSeq_strand_minus, ((PyObject*)__pyx_t_1));
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":27
* cdef str strand_plus = intern("+")
* cdef str strand_minus = intern("-")
* cdef str strand_nostrand = intern(".") # <<<<<<<<<<<<<<
*
* cdef class GenomicInterval:
*/
__pyx_t_1 = __Pyx_Intern(__pyx_kp_u__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 27, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__Pyx_DECREF_SET(__pyx_v_5HTSeq_6_HTSeq_strand_nostrand, ((PyObject*)__pyx_t_1));
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":57
*
* def __init__(GenomicInterval self, str chrom, long start, long end,
* str strand=strand_nostrand): # <<<<<<<<<<<<<<
* """See the class docstring for the meaning of the slots. Note that
* there is also a factory function, 'from_directional', to be used if
*/
__Pyx_INCREF(__pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
__pyx_k_ = __pyx_v_5HTSeq_6_HTSeq_strand_nostrand;
__Pyx_GIVEREF(__pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
/* "HTSeq/_HTSeq.pyx":253
*
*
* def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."): # <<<<<<<<<<<<<<
* strand = intern(strand)
* if strand.se is not strand_minus:
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_1GenomicInterval_from_directional, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_GenomicInterval_from_directional, __pyx_t_1) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":327
*
* @classmethod
* def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""): # <<<<<<<<<<<<<<
* ncv = cls()
* ncv.iv = iv
*/
__Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "HTSeq/_HTSeq.pyx":326
* cdef public str _storage
*
* @classmethod # <<<<<<<<<<<<<<
* def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):
* ncv = cls()
*/
__pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyDict_SetItem((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector->tp_dict, __pyx_n_s_create, __pyx_t_5) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
PyType_Modified(__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
/* "HTSeq/_HTSeq.pyx":350
*
* @classmethod
* def _create_view(cls, ChromVector vec, GenomicInterval iv): # <<<<<<<<<<<<<<
* if iv.length == 0:
* raise IndexError, "Cannot subset to zero-length interval."
*/
__Pyx_GetNameInClass(__pyx_t_5, (PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_n_s_create_view); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
/* "HTSeq/_HTSeq.pyx":349
* return ncv
*
* @classmethod # <<<<<<<<<<<<<<
* def _create_view(cls, ChromVector vec, GenomicInterval iv):
* if iv.length == 0:
*/
__pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (PyDict_SetItem((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector->tp_dict, __pyx_n_s_create_view, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
/* "HTSeq/_HTSeq.pyx":477
*
*
* def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage): # <<<<<<<<<<<<<<
* cv = ChromVector()
* cv.array = array
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_3_ChromVector_unpickle, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ChromVector_unpickle, __pyx_t_1) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":563
* raise TypeError, "Illegal index type."
*
* def add_chrom(self, chrom, length=sys.maxsize, start_index=0): # <<<<<<<<<<<<<<
* cdef GenomicInterval iv
* if length == sys.maxsize:
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_k__18 = __pyx_t_5;
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":615
*
*
* def _GenomicArray_unpickle(stranded, typecode, chrom_vectors): # <<<<<<<<<<<<<<
* ga = GenomicArray({}, stranded, typecode)
* ga.chrom_vectors = chrom_vectors
*/
__pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_5_GenomicArray_unpickle, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_GenomicArray_unpickle, __pyx_t_5) < 0) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":626
*
*
* def _make_translation_table_for_complementation(): # <<<<<<<<<<<<<<
* return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
*
*/
__pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_translation_table_for_comp, __pyx_t_5) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":629
* return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
*
* cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation() # <<<<<<<<<<<<<<
*
* cpdef bytes reverse_complement(bytes seq):
*/
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_make_translation_table_for_comp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 629, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation);
__Pyx_DECREF_SET(__pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation, ((PyObject*)__pyx_t_1));
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":637
* return seq[::-1].translate(_translation_table_for_complementation)
*
* base_to_column = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'N': 4} # <<<<<<<<<<<<<<
*
* cdef class Sequence(object):
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_A, __pyx_int_0) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_C, __pyx_int_1) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_G, __pyx_int_2) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_T, __pyx_int_3) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_N, __pyx_int_4) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_base_to_column, __pyx_t_1) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1108
*
* cigar_operation_names = {
* 'M': 'matched', # <<<<<<<<<<<<<<
* 'I': 'inserted',
* 'D': 'deleted',
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_M, __pyx_n_u_matched) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_I, __pyx_n_u_inserted) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_D, __pyx_n_u_deleted) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_N, __pyx_n_u_skipped) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_S, __pyx_kp_u_soft_clipped) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_H, __pyx_kp_u_hard_clipped) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_P, __pyx_n_u_padded) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u__33, __pyx_kp_u_sequence_matched) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_X, __pyx_kp_u_sequence_mismatched) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_cigar_operation_names, __pyx_t_1) < 0) __PYX_ERR(0, 1107, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1160
* return True
*
* _re_cigar_codes = re.compile('([MIDNSHP=X])') # <<<<<<<<<<<<<<
*
* cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."):
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (PyDict_SetItem(__pyx_d, __pyx_n_s_re_cigar_codes, __pyx_t_1) < 0) __PYX_ERR(0, 1160, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1239
* raise ValueError, "SAM optional field with illegal type letter '%s'" % field[2]
*
* cigar_operation_codes = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X'] # <<<<<<<<<<<<<<
* cigar_operation_code_dict = dict(
* [(x, i) for i, x in enumerate(cigar_operation_codes)])
*/
__pyx_t_1 = PyList_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_u_M);
__Pyx_GIVEREF(__pyx_n_u_M);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_M);
__Pyx_INCREF(__pyx_n_u_I);
__Pyx_GIVEREF(__pyx_n_u_I);
PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_I);
__Pyx_INCREF(__pyx_n_u_D);
__Pyx_GIVEREF(__pyx_n_u_D);
PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_D);
__Pyx_INCREF(__pyx_n_u_N);
__Pyx_GIVEREF(__pyx_n_u_N);
PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_N);
__Pyx_INCREF(__pyx_n_u_S);
__Pyx_GIVEREF(__pyx_n_u_S);
PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_S);
__Pyx_INCREF(__pyx_n_u_H);
__Pyx_GIVEREF(__pyx_n_u_H);
PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_H);
__Pyx_INCREF(__pyx_n_u_P);
__Pyx_GIVEREF(__pyx_n_u_P);
PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_P);
__Pyx_INCREF(__pyx_kp_u__33);
__Pyx_GIVEREF(__pyx_kp_u__33);
PyList_SET_ITEM(__pyx_t_1, 7, __pyx_kp_u__33);
__Pyx_INCREF(__pyx_n_u_X);
__Pyx_GIVEREF(__pyx_n_u_X);
PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_u_X);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_cigar_operation_codes, __pyx_t_1) < 0) __PYX_ERR(0, 1239, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1240
*
* cigar_operation_codes = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X']
* cigar_operation_code_dict = dict( # <<<<<<<<<<<<<<
* [(x, i) for i, x in enumerate(cigar_operation_codes)])
*
*/
{ /* enter inner scope */
/* "HTSeq/_HTSeq.pyx":1241
* cigar_operation_codes = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X']
* cigar_operation_code_dict = dict(
* [(x, i) for i, x in enumerate(cigar_operation_codes)]) # <<<<<<<<<<<<<<
*
* cdef class SAM_Alignment(AlignmentWithSequenceReversal):
*/
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L10_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_int_0);
__pyx_t_5 = __pyx_int_0;
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_cigar_operation_codes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L10_error)
__Pyx_GOTREF(__pyx_t_6);
if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
__pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
__pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1241, __pyx_L10_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1241, __pyx_L10_error)
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_7))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1241, __pyx_L10_error)
#else
__pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L10_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1241, __pyx_L10_error)
#else
__pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L10_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
}
} else {
__pyx_t_6 = __pyx_t_9(__pyx_t_7);
if (unlikely(!__pyx_t_6)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 1241, __pyx_L10_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_6);
}
__Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
__Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
__pyx_t_6 = 0;
__Pyx_INCREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
__Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L10_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5);
__pyx_t_5 = __pyx_t_6;
__pyx_t_6 = 0;
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L10_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
__Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
__Pyx_INCREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
__Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1241, __pyx_L10_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
__Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i, Py_None);
__Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
__Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x, Py_None);
goto __pyx_L13_exit_scope;
__pyx_L10_error:;
__Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
__Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i, Py_None);
__Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
__Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x, Py_None);
goto __pyx_L1_error;
__pyx_L13_exit_scope:;
} /* exit inner scope */
/* "HTSeq/_HTSeq.pyx":1240
*
* cigar_operation_codes = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X']
* cigar_operation_code_dict = dict( # <<<<<<<<<<<<<<
* [(x, i) for i, x in enumerate(cigar_operation_codes)])
*
*/
__pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1240, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyDict_SetItem(__pyx_d, __pyx_n_s_cigar_operation_code_dict, __pyx_t_5) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "HTSeq/_HTSeq.pyx":1318
*
* @classmethod
* def from_pysam_AlignedRead(cls, read, samfile): # <<<<<<<<<<<<<<
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped:
*/
__Pyx_GetNameInClass(__pyx_t_5, (PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_n_s_from_pysam_AlignedRead); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1318, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
/* "HTSeq/_HTSeq.pyx":1317
* return a
*
* @classmethod # <<<<<<<<<<<<<<
* def from_pysam_AlignedRead(cls, read, samfile):
* strand = "-" if read.is_reverse else "+"
*/
__pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (PyDict_SetItem((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment->tp_dict, __pyx_n_s_from_pysam_AlignedRead, __pyx_t_1) < 0) __PYX_ERR(0, 1318, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment);
/* "HTSeq/_HTSeq.pyx":1363
*
* @classmethod
* def from_pysam_AlignedSegment(cls, read, samfile): # <<<<<<<<<<<<<<
* strand = "-" if read.is_reverse else "+"
* if not read.is_unmapped:
*/
__Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_n_s_from_pysam_AlignedSegment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "HTSeq/_HTSeq.pyx":1362
* return a
*
* @classmethod # <<<<<<<<<<<<<<
* def from_pysam_AlignedSegment(cls, read, samfile):
* strand = "-" if read.is_reverse else "+"
*/
__pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyDict_SetItem((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment->tp_dict, __pyx_n_s_from_pysam_AlignedSegment, __pyx_t_5) < 0) __PYX_ERR(0, 1363, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
PyType_Modified(__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment);
/* "HTSeq/_HTSeq.pyx":1407
*
* @classmethod
* def from_SAM_line(cls, line): # <<<<<<<<<<<<<<
* cdef str qname, flag, rname, pos, mapq, cigar,
* cdef str mrnm, mpos, isize, seq, qual
*/
__Pyx_GetNameInClass(__pyx_t_5, (PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_n_s_from_SAM_line); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
/* "HTSeq/_HTSeq.pyx":1406
* return a
*
* @classmethod # <<<<<<<<<<<<<<
* def from_SAM_line(cls, line):
* cdef str qname, flag, rname, pos, mapq, cigar,
*/
__pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (PyDict_SetItem((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment->tp_dict, __pyx_n_s_from_SAM_line, __pyx_t_1) < 0) __PYX_ERR(0, 1407, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment);
/* "(tree fragment)":1
* def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_17__pyx_unpickle_Alignment, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Alignment, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":11
* __pyx_unpickle_Alignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_19__pyx_unpickle_AlignmentWithSequenceReversal, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_AlignmentWithSequ, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":1
* def __pyx_unpickle_BowtieAlignment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_21__pyx_unpickle_BowtieAlignment, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BowtieAlignment, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":11
* __pyx_unpickle_BowtieAlignment__set_state( __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
* if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_23__pyx_unpickle_CigarOperation, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CigarOperation, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":1
* def __pyx_unpickle_SAM_Alignment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SAM_Alignment, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "HTSeq/_HTSeq.pyx":1
* import sys # <<<<<<<<<<<<<<
* import os
* import math
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
* raise ImportError("numpy.core.umath failed to import")
*
* cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
* try:
* _import_umath()
*/
/*--- Wrapped vars code ---*/
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
if (__pyx_m) {
if (__pyx_d) {
__Pyx_AddTraceback("init HTSeq._HTSeq", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
Py_CLEAR(__pyx_m);
} else if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_ImportError, "init HTSeq._HTSeq");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
#if CYTHON_PEP489_MULTI_PHASE_INIT
return (__pyx_m != NULL) ? 0 : -1;
#elif PY_MAJOR_VERSION >= 3
return __pyx_m;
#else
return;
#endif
}
/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
void *r = NULL;
m = PyImport_ImportModule(modname);
if (!m) goto end;
p = PyObject_GetAttrString(m, "RefNannyAPI");
if (!p) goto end;
r = PyLong_AsVoidPtr(p);
end:
Py_XDECREF(p);
Py_XDECREF(m);
return (__Pyx_RefNannyAPIStruct *)r;
}
#endif
/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
if (likely(tp->tp_getattr))
return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
return PyObject_GetAttr(obj, attr_name);
}
#endif
/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
"name '%U' is not defined", name);
#else
"name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
}
return result;
}
/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
Py_ssize_t num_min,
Py_ssize_t num_max,
Py_ssize_t num_found)
{
Py_ssize_t num_expected;
const char *more_or_less;
if (num_found < num_min) {
num_expected = num_min;
more_or_less = "at least";
} else {
num_expected = num_max;
more_or_less = "at most";
}
if (exact) {
more_or_less = "exactly";
}
PyErr_Format(PyExc_TypeError,
"%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
func_name, more_or_less, num_expected,
(num_expected == 1) ? "" : "s", num_found);
}
/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
{
PyErr_Format(PyExc_TypeError,
#if PY_MAJOR_VERSION >= 3
"%s() got multiple values for keyword argument '%U'", func_name, kw_name);
#else
"%s() got multiple values for keyword argument '%s'", func_name,
PyString_AsString(kw_name));
#endif
}
/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
PyObject *kwds2,
PyObject *values[],
Py_ssize_t num_pos_args,
const char* function_name)
{
PyObject *key = 0, *value = 0;
Py_ssize_t pos = 0;
PyObject*** name;
PyObject*** first_kw_arg = argnames + num_pos_args;
while (PyDict_Next(kwds, &pos, &key, &value)) {
name = first_kw_arg;
while (*name && (**name != key)) name++;
if (*name) {
values[name-argnames] = value;
continue;
}
name = first_kw_arg;
#if PY_MAJOR_VERSION < 3
if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
while (*name) {
if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
&& _PyString_Eq(**name, key)) {
values[name-argnames] = value;
break;
}
name++;
}
if (*name) continue;
else {
PyObject*** argname = argnames;
while (argname != first_kw_arg) {
if ((**argname == key) || (
(CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
&& _PyString_Eq(**argname, key))) {
goto arg_passed_twice;
}
argname++;
}
}
} else
#endif
if (likely(PyUnicode_Check(key))) {
while (*name) {
int cmp = (**name == key) ? 0 :
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
(PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
#endif
PyUnicode_Compare(**name, key);
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
if (cmp == 0) {
values[name-argnames] = value;
break;
}
name++;
}
if (*name) continue;
else {
PyObject*** argname = argnames;
while (argname != first_kw_arg) {
int cmp = (**argname == key) ? 0 :
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
#endif
PyUnicode_Compare(**argname, key);
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
if (cmp == 0) goto arg_passed_twice;
argname++;
}
}
} else
goto invalid_keyword_type;
if (kwds2) {
if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
} else {
goto invalid_keyword;
}
}
return 0;
arg_passed_twice:
__Pyx_RaiseDoubleKeywordsError(function_name, key);
goto bad;
invalid_keyword_type:
PyErr_Format(PyExc_TypeError,
"%.200s() keywords must be strings", function_name);
goto bad;
invalid_keyword:
PyErr_Format(PyExc_TypeError,
#if PY_MAJOR_VERSION < 3
"%.200s() got an unexpected keyword argument '%.200s'",
function_name, PyString_AsString(key));
#else
"%s() got an unexpected keyword argument '%U'",
function_name, key);
#endif
bad:
return -1;
}
/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
}
else if (exact) {
#if PY_MAJOR_VERSION == 2
if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
#endif
}
else {
if (likely(__Pyx_TypeCheck(obj, type))) return 1;
}
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
return 0;
}
/* Intern */
static PyObject* __Pyx_Intern(PyObject* s) {
if (!(likely(PyString_CheckExact(s)))) {
PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(s)->tp_name);
return 0;
}
Py_INCREF(s);
#if PY_MAJOR_VERSION >= 3
PyUnicode_InternInPlace(&s);
#else
PyString_InternInPlace(&s);
#endif
return s;
}
/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_setattro))
return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
if (likely(tp->tp_setattr))
return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
return PyObject_SetAttr(obj, attr_name, value);
}
#endif
/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
tstate->curexc_type = type;
tstate->curexc_value = value;
tstate->curexc_traceback = tb;
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
}
#endif
/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
__Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
else
Py_INCREF(value);
if (!tb || tb == Py_None)
tb = NULL;
else {
Py_INCREF(tb);
if (!PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto raise_error;
}
}
if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
if (!value) {
Py_INCREF(Py_None);
value = Py_None;
}
#endif
PyErr_NormalizeException(&type, &value, &tb);
} else {
if (value) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto raise_error;
}
value = type;
type = (PyObject*) Py_TYPE(type);
Py_INCREF(type);
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto raise_error;
}
}
__Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
Py_XDECREF(value);
Py_XDECREF(type);
Py_XDECREF(tb);
return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
PyObject* owned_instance = NULL;
if (tb == Py_None) {
tb = 0;
} else if (tb && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto bad;
}
if (value == Py_None)
value = 0;
if (PyExceptionInstance_Check(type)) {
if (value) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto bad;
}
value = type;
type = (PyObject*) Py_TYPE(value);
} else if (PyExceptionClass_Check(type)) {
PyObject *instance_class = NULL;
if (value && PyExceptionInstance_Check(value)) {
instance_class = (PyObject*) Py_TYPE(value);
if (instance_class != type) {
int is_subclass = PyObject_IsSubclass(instance_class, type);
if (!is_subclass) {
instance_class = NULL;
} else if (unlikely(is_subclass == -1)) {
goto bad;
} else {
type = instance_class;
}
}
}
if (!instance_class) {
PyObject *args;
if (!value)
args = PyTuple_New(0);
else if (PyTuple_Check(value)) {
Py_INCREF(value);
args = value;
} else
args = PyTuple_Pack(1, value);
if (!args)
goto bad;
owned_instance = PyObject_Call(type, args, NULL);
Py_DECREF(args);
if (!owned_instance)
goto bad;
value = owned_instance;
if (!PyExceptionInstance_Check(value)) {
PyErr_Format(PyExc_TypeError,
"calling %R should have returned an instance of "
"BaseException, not %R",
type, Py_TYPE(value));
goto bad;
}
}
} else {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto bad;
}
if (cause) {
PyObject *fixed_cause;
if (cause == Py_None) {
fixed_cause = NULL;
} else if (PyExceptionClass_Check(cause)) {
fixed_cause = PyObject_CallObject(cause, NULL);
if (fixed_cause == NULL)
goto bad;
} else if (PyExceptionInstance_Check(cause)) {
fixed_cause = cause;
Py_INCREF(fixed_cause);
} else {
PyErr_SetString(PyExc_TypeError,
"exception causes must derive from "
"BaseException");
goto bad;
}
PyException_SetCause(value, fixed_cause);
}
PyErr_SetObject(type, value);
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
Py_INCREF(tb);
PyErr_Restore(tmp_type, tmp_value, tb);
Py_XDECREF(tmp_tb);
#else
PyThreadState *tstate = __Pyx_PyThreadState_Current;
PyObject* tmp_tb = tstate->curexc_traceback;
if (tb != tmp_tb) {
Py_INCREF(tb);
tstate->curexc_traceback = tb;
Py_XDECREF(tmp_tb);
}
#endif
}
bad:
Py_XDECREF(owned_instance);
return;
}
#endif
/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
PyObject *globals) {
PyFrameObject *f;
PyThreadState *tstate = __Pyx_PyThreadState_Current;
PyObject **fastlocals;
Py_ssize_t i;
PyObject *result;
assert(globals != NULL);
/* XXX Perhaps we should create a specialized
PyFrame_New() that doesn't take locals, but does
take builtins without sanity checking them.
*/
assert(tstate != NULL);
f = PyFrame_New(tstate, co, globals, NULL);
if (f == NULL) {
return NULL;
}
fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
for (i = 0; i < na; i++) {
Py_INCREF(*args);
fastlocals[i] = *args++;
}
result = PyEval_EvalFrameEx(f,0);
++tstate->recursion_depth;
Py_DECREF(f);
--tstate->recursion_depth;
return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
PyObject *globals = PyFunction_GET_GLOBALS(func);
PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
PyObject *closure;
#if PY_MAJOR_VERSION >= 3
PyObject *kwdefs;
#endif
PyObject *kwtuple, **k;
PyObject **d;
Py_ssize_t nd;
Py_ssize_t nk;
PyObject *result;
assert(kwargs == NULL || PyDict_Check(kwargs));
nk = kwargs ? PyDict_Size(kwargs) : 0;
if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
return NULL;
}
if (
#if PY_MAJOR_VERSION >= 3
co->co_kwonlyargcount == 0 &&
#endif
likely(kwargs == NULL || nk == 0) &&
co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
if (argdefs == NULL && co->co_argcount == nargs) {
result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
goto done;
}
else if (nargs == 0 && argdefs != NULL
&& co->co_argcount == Py_SIZE(argdefs)) {
/* function called with no arguments, but all parameters have
a default value: use default values as arguments .*/
args = &PyTuple_GET_ITEM(argdefs, 0);
result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
goto done;
}
}
if (kwargs != NULL) {
Py_ssize_t pos, i;
kwtuple = PyTuple_New(2 * nk);
if (kwtuple == NULL) {
result = NULL;
goto done;
}
k = &PyTuple_GET_ITEM(kwtuple, 0);
pos = i = 0;
while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
Py_INCREF(k[i]);
Py_INCREF(k[i+1]);
i += 2;
}
nk = i / 2;
}
else {
kwtuple = NULL;
k = NULL;
}
closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
if (argdefs != NULL) {
d = &PyTuple_GET_ITEM(argdefs, 0);
nd = Py_SIZE(argdefs);
}
else {
d = NULL;
nd = 0;
}
#if PY_MAJOR_VERSION >= 3
result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
args, nargs,
k, (int)nk,
d, (int)nd, kwdefs, closure);
#else
result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
args, nargs,
k, (int)nk,
d, (int)nd, closure);
#endif
Py_XDECREF(kwtuple);
done:
Py_LeaveRecursiveCall();
return result;
}
#endif
#endif
/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
ternaryfunc call = func->ob_type->tp_call;
if (unlikely(!call))
return PyObject_Call(func, arg, kw);
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
return NULL;
result = (*call)(func, arg, kw);
Py_LeaveRecursiveCall();
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
PyErr_SetString(
PyExc_SystemError,
"NULL result without error in PyObject_Call");
}
return result;
}
#endif
/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
PyCFunction cfunc;
cfunc = PyCFunction_GET_FUNCTION(func);
self = PyCFunction_GET_SELF(func);
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
return NULL;
result = cfunc(self, arg);
Py_LeaveRecursiveCall();
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
PyErr_SetString(
PyExc_SystemError,
"NULL result without error in PyObject_Call");
}
return result;
}
#endif
/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(func)) {
return __Pyx_PyFunction_FastCall(func, NULL, 0);
}
#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
if (likely(PyCFunction_Check(func)))
#endif
{
if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
return __Pyx_PyObject_CallMethO(func, NULL);
}
}
return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif
/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
PyCFunction meth = PyCFunction_GET_FUNCTION(func);
PyObject *self = PyCFunction_GET_SELF(func);
int flags = PyCFunction_GET_FLAGS(func);
assert(PyCFunction_Check(func));
assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
assert(nargs >= 0);
assert(nargs == 0 || args != NULL);
/* _PyCFunction_FastCallDict() must not be called with an exception set,
because it may clear it (directly or indirectly) and so the
caller loses its exception */
assert(!PyErr_Occurred());
if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
} else {
return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
}
}
#endif
/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_New(1);
if (unlikely(!args)) return NULL;
Py_INCREF(arg);
PyTuple_SET_ITEM(args, 0, arg);
result = __Pyx_PyObject_Call(func, args, NULL);
Py_DECREF(args);
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(func)) {
return __Pyx_PyFunction_FastCall(func, &arg, 1);
}
#endif
if (likely(PyCFunction_Check(func))) {
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
} else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_Pack(1, arg);
if (unlikely(!args)) return NULL;
result = __Pyx_PyObject_Call(func, args, NULL);
Py_DECREF(args);
return result;
}
#endif
/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
PyThreadState *tstate = __Pyx_PyThreadState_Current;
PyObject* exc_type = tstate->curexc_type;
if (unlikely(exc_type)) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
PyObject *exc_value, *exc_tb;
exc_value = tstate->curexc_value;
exc_tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
Py_DECREF(exc_type);
Py_XDECREF(exc_value);
Py_XDECREF(exc_tb);
return 0;
} else {
return -1;
}
}
return 0;
#else
if (unlikely(PyErr_Occurred())) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
PyErr_Clear();
return 0;
} else {
return -1;
}
}
return 0;
#endif
}
/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
if (unlikely(retval)) {
Py_DECREF(retval);
__Pyx_RaiseTooManyValuesError(expected);
return -1;
} else {
return __Pyx_IterFinish();
}
return 0;
}
/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
if (unlikely(!s)) return NULL;
if (likely(PyUnicode_CheckExact(s))) return s;
#if PY_MAJOR_VERSION < 3
if (likely(PyString_CheckExact(s))) {
PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
Py_DECREF(s);
return result;
}
#endif
return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
PyObject *result = PyObject_Format(s, f);
Py_DECREF(s);
return result;
}
/* PyUnicode_Unicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
if (unlikely(obj == Py_None))
obj = __pyx_kp_u_None;
return __Pyx_NewRef(obj);
}
/* CIntToDigits */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
"00010203040506070809"
"10111213141516171819"
"20212223242526272829"
"30313233343536373839"
"40414243444546474849"
"50515253545556575859"
"60616263646566676869"
"70717273747576777879"
"80818283848586878889"
"90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
"0001020304050607"
"1011121314151617"
"2021222324252627"
"3031323334353637"
"4041424344454647"
"5051525354555657"
"6061626364656667"
"7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
"0123456789abcdef"
"0123456789ABCDEF"
};
/* BuildPyUnicode */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
int prepend_sign, char padding_char) {
PyObject *uval;
Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
Py_ssize_t i;
#if CYTHON_PEP393_ENABLED
void *udata;
uval = PyUnicode_New(ulength, 127);
if (unlikely(!uval)) return NULL;
udata = PyUnicode_DATA(uval);
#else
Py_UNICODE *udata;
uval = PyUnicode_FromUnicode(NULL, ulength);
if (unlikely(!uval)) return NULL;
udata = PyUnicode_AS_UNICODE(uval);
#endif
if (uoffset > 0) {
i = 0;
if (prepend_sign) {
__Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
i++;
}
for (; i < uoffset; i++) {
__Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
}
}
for (i=0; i < clength; i++) {
__Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
}
#else
{
uval = NULL;
PyObject *sign = NULL, *padding = NULL;
if (uoffset > 0) {
prepend_sign = !!prepend_sign;
if (uoffset > prepend_sign) {
padding = PyUnicode_FromOrdinal(padding_char);
if (likely(padding) && uoffset > prepend_sign + 1) {
PyObject *tmp;
PyObject *repeat = PyInt_FromSize_t(uoffset - prepend_sign);
if (unlikely(!repeat)) goto done_or_error;
tmp = PyNumber_Multiply(padding, repeat);
Py_DECREF(repeat);
Py_DECREF(padding);
padding = tmp;
}
if (unlikely(!padding)) goto done_or_error;
}
if (prepend_sign) {
sign = PyUnicode_FromOrdinal('-');
if (unlikely(!sign)) goto done_or_error;
}
}
uval = PyUnicode_DecodeASCII(chars, clength, NULL);
if (likely(uval) && padding) {
PyObject *tmp = PyNumber_Add(padding, uval);
Py_DECREF(uval);
uval = tmp;
}
if (likely(uval) && sign) {
PyObject *tmp = PyNumber_Add(sign, uval);
Py_DECREF(uval);
uval = tmp;
}
done_or_error:
Py_XDECREF(padding);
Py_XDECREF(sign);
}
#endif
return uval;
}
/* CIntToPyUnicode */
#ifdef _MSC_VER
#ifndef _MSC_STDINT_H_
#if _MSC_VER < 1300
typedef unsigned short uint16_t;
#else
typedef unsigned __int16 uint16_t;
#endif
#endif
#else
#include
#endif
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) {
char digits[sizeof(long)*3+2];
char *dpos, *end = digits + sizeof(long)*3+2;
const char *hex_digits = DIGITS_HEX;
Py_ssize_t length, ulength;
int prepend_sign, last_one_off;
long remaining;
const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
if (format_char == 'X') {
hex_digits += 16;
format_char = 'x';
}
remaining = value;
last_one_off = 0;
dpos = end;
do {
int digit_pos;
switch (format_char) {
case 'o':
digit_pos = abs((int)(remaining % (8*8)));
remaining = (long) (remaining / (8*8));
dpos -= 2;
*(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_8)[digit_pos];
last_one_off = (digit_pos < 8);
break;
case 'd':
digit_pos = abs((int)(remaining % (10*10)));
remaining = (long) (remaining / (10*10));
dpos -= 2;
*(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_10)[digit_pos];
last_one_off = (digit_pos < 10);
break;
case 'x':
*(--dpos) = hex_digits[abs((int)(remaining % 16))];
remaining = (long) (remaining / 16);
break;
default:
assert(0);
break;
}
} while (unlikely(remaining != 0));
if (last_one_off) {
assert(*dpos == '0');
dpos++;
}
length = end - dpos;
ulength = length;
prepend_sign = 0;
if (!is_unsigned && value <= neg_one) {
if (padding_char == ' ' || width <= length + 1) {
*(--dpos) = '-';
++length;
} else {
prepend_sign = 1;
}
++ulength;
}
if (width > ulength) {
ulength = width;
}
if (ulength == 1) {
return PyUnicode_FromOrdinal(*dpos);
}
return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}
/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
if (likely(result)) {
return __Pyx_NewRef(result);
} else if (unlikely(PyErr_Occurred())) {
return NULL;
}
#else
result = PyDict_GetItem(__pyx_d, name);
__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
if (likely(result)) {
return __Pyx_NewRef(result);
}
#endif
#else
result = PyObject_GetItem(__pyx_d, name);
__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
if (likely(result)) {
return __Pyx_NewRef(result);
}
PyErr_Clear();
#endif
return __Pyx_GetBuiltinName(name);
}
/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
PyObject *result_uval;
int result_ukind;
Py_ssize_t i, char_pos;
void *result_udata;
#if CYTHON_PEP393_ENABLED
result_uval = PyUnicode_New(result_ulength, max_char);
if (unlikely(!result_uval)) return NULL;
result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
result_udata = PyUnicode_DATA(result_uval);
#else
result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
if (unlikely(!result_uval)) return NULL;
result_ukind = sizeof(Py_UNICODE);
result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
char_pos = 0;
for (i=0; i < value_count; i++) {
int ukind;
Py_ssize_t ulength;
void *udata;
PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
if (unlikely(__Pyx_PyUnicode_READY(uval)))
goto bad;
ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
if (unlikely(!ulength))
continue;
if (unlikely(char_pos + ulength < 0))
goto overflow;
ukind = __Pyx_PyUnicode_KIND(uval);
udata = __Pyx_PyUnicode_DATA(uval);
if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
} else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
_PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
#else
Py_ssize_t j;
for (j=0; j < ulength; j++) {
Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
__Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
}
#endif
}
char_pos += ulength;
}
return result_uval;
overflow:
PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
Py_DECREF(result_uval);
return NULL;
#else
result_ulength++;
value_count++;
return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}
/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
PyObject *args, *result = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(function)) {
PyObject *args[2] = {arg1, arg2};
return __Pyx_PyFunction_FastCall(function, args, 2);
}
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(function)) {
PyObject *args[2] = {arg1, arg2};
return __Pyx_PyCFunction_FastCall(function, args, 2);
}
#endif
args = PyTuple_New(2);
if (unlikely(!args)) goto done;
Py_INCREF(arg1);
PyTuple_SET_ITEM(args, 0, arg1);
Py_INCREF(arg2);
PyTuple_SET_ITEM(args, 1, arg2);
Py_INCREF(function);
result = __Pyx_PyObject_Call(function, args, NULL);
Py_DECREF(args);
Py_DECREF(function);
done:
return result;
}
/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
if (s1 == s2) {
return (equals == Py_EQ);
} else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
const char *ps1, *ps2;
Py_ssize_t length = PyBytes_GET_SIZE(s1);
if (length != PyBytes_GET_SIZE(s2))
return (equals == Py_NE);
ps1 = PyBytes_AS_STRING(s1);
ps2 = PyBytes_AS_STRING(s2);
if (ps1[0] != ps2[0]) {
return (equals == Py_NE);
} else if (length == 1) {
return (equals == Py_EQ);
} else {
int result;
#if CYTHON_USE_UNICODE_INTERNALS
Py_hash_t hash1, hash2;
hash1 = ((PyBytesObject*)s1)->ob_shash;
hash2 = ((PyBytesObject*)s2)->ob_shash;
if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
return (equals == Py_NE);
}
#endif
result = memcmp(ps1, ps2, (size_t)length);
return (equals == Py_EQ) ? (result == 0) : (result != 0);
}
} else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
return (equals == Py_NE);
} else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
return (equals == Py_NE);
} else {
int result;
PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
if (!py_result)
return -1;
result = __Pyx_PyObject_IsTrue(py_result);
Py_DECREF(py_result);
return result;
}
#endif
}
/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
PyObject* owned_ref = NULL;
#endif
int s1_is_unicode, s2_is_unicode;
if (s1 == s2) {
goto return_eq;
}
s1_is_unicode = PyUnicode_CheckExact(s1);
s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
owned_ref = PyUnicode_FromObject(s2);
if (unlikely(!owned_ref))
return -1;
s2 = owned_ref;
s2_is_unicode = 1;
} else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
owned_ref = PyUnicode_FromObject(s1);
if (unlikely(!owned_ref))
return -1;
s1 = owned_ref;
s1_is_unicode = 1;
} else if (((!s2_is_unicode) & (!s1_is_unicode))) {
return __Pyx_PyBytes_Equals(s1, s2, equals);
}
#endif
if (s1_is_unicode & s2_is_unicode) {
Py_ssize_t length;
int kind;
void *data1, *data2;
if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
return -1;
length = __Pyx_PyUnicode_GET_LENGTH(s1);
if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
goto return_ne;
}
#if CYTHON_USE_UNICODE_INTERNALS
{
Py_hash_t hash1, hash2;
#if CYTHON_PEP393_ENABLED
hash1 = ((PyASCIIObject*)s1)->hash;
hash2 = ((PyASCIIObject*)s2)->hash;
#else
hash1 = ((PyUnicodeObject*)s1)->hash;
hash2 = ((PyUnicodeObject*)s2)->hash;
#endif
if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
goto return_ne;
}
}
#endif
kind = __Pyx_PyUnicode_KIND(s1);
if (kind != __Pyx_PyUnicode_KIND(s2)) {
goto return_ne;
}
data1 = __Pyx_PyUnicode_DATA(s1);
data2 = __Pyx_PyUnicode_DATA(s2);
if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
goto return_ne;
} else if (length == 1) {
goto return_eq;
} else {
int result = memcmp(data1, data2, (size_t)(length * kind));
#if PY_MAJOR_VERSION < 3
Py_XDECREF(owned_ref);
#endif
return (equals == Py_EQ) ? (result == 0) : (result != 0);
}
} else if ((s1 == Py_None) & s2_is_unicode) {
goto return_ne;
} else if ((s2 == Py_None) & s1_is_unicode) {
goto return_ne;
} else {
int result;
PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
#if PY_MAJOR_VERSION < 3
Py_XDECREF(owned_ref);
#endif
if (!py_result)
return -1;
result = __Pyx_PyObject_IsTrue(py_result);
Py_DECREF(py_result);
return result;
}
return_eq:
#if PY_MAJOR_VERSION < 3
Py_XDECREF(owned_ref);
#endif
return (equals == Py_EQ);
return_ne:
#if PY_MAJOR_VERSION < 3
Py_XDECREF(owned_ref);
#endif
return (equals == Py_NE);
#endif
}
/* PyObjectFormat */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
int ret;
_PyUnicodeWriter writer;
if (likely(PyFloat_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
_PyUnicodeWriter_Init(&writer, 0);
#else
_PyUnicodeWriter_Init(&writer);
#endif
ret = _PyFloat_FormatAdvancedWriter(
&writer,
obj,
format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
} else if (likely(PyLong_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
_PyUnicodeWriter_Init(&writer, 0);
#else
_PyUnicodeWriter_Init(&writer);
#endif
ret = _PyLong_FormatAdvancedWriter(
&writer,
obj,
format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
} else {
return PyObject_Format(obj, format_spec);
}
if (unlikely(ret == -1)) {
_PyUnicodeWriter_Dealloc(&writer);
return NULL;
}
return _PyUnicodeWriter_Finish(&writer);
}
#endif
/* SliceObject */
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
if (likely(ms && ms->sq_ass_slice)) {
if (!has_cstart) {
if (_py_start && (*_py_start != Py_None)) {
cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
} else
cstart = 0;
}
if (!has_cstop) {
if (_py_stop && (*_py_stop != Py_None)) {
cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
} else
cstop = PY_SSIZE_T_MAX;
}
if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
Py_ssize_t l = ms->sq_length(obj);
if (likely(l >= 0)) {
if (cstop < 0) {
cstop += l;
if (cstop < 0) cstop = 0;
}
if (cstart < 0) {
cstart += l;
if (cstart < 0) cstart = 0;
}
} else {
if (!PyErr_ExceptionMatches(PyExc_OverflowError))
goto bad;
PyErr_Clear();
}
}
return ms->sq_ass_slice(obj, cstart, cstop, value);
}
#endif
mp = Py_TYPE(obj)->tp_as_mapping;
if (likely(mp && mp->mp_ass_subscript))
#endif
{
int result;
PyObject *py_slice, *py_start, *py_stop;
if (_py_slice) {
py_slice = *_py_slice;
} else {
PyObject* owned_start = NULL;
PyObject* owned_stop = NULL;
if (_py_start) {
py_start = *_py_start;
} else {
if (has_cstart) {
owned_start = py_start = PyInt_FromSsize_t(cstart);
if (unlikely(!py_start)) goto bad;
} else
py_start = Py_None;
}
if (_py_stop) {
py_stop = *_py_stop;
} else {
if (has_cstop) {
owned_stop = py_stop = PyInt_FromSsize_t(cstop);
if (unlikely(!py_stop)) {
Py_XDECREF(owned_start);
goto bad;
}
} else
py_stop = Py_None;
}
py_slice = PySlice_New(py_start, py_stop, Py_None);
Py_XDECREF(owned_start);
Py_XDECREF(owned_stop);
if (unlikely(!py_slice)) goto bad;
}
#if CYTHON_USE_TYPE_SLOTS
result = mp->mp_ass_subscript(obj, py_slice, value);
#else
result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
#endif
if (!_py_slice) {
Py_DECREF(py_slice);
}
return result;
}
PyErr_Format(PyExc_TypeError,
"'%.200s' object does not support slice %.10s",
Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
bad:
return -1;
}
/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
if (op1 == op2) {
Py_RETURN_TRUE;
}
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_CheckExact(op1))) {
const long b = intval;
long a = PyInt_AS_LONG(op1);
if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
}
#endif
#if CYTHON_USE_PYLONG_INTERNALS
if (likely(PyLong_CheckExact(op1))) {
int unequal;
unsigned long uintval;
Py_ssize_t size = Py_SIZE(op1);
const digit* digits = ((PyLongObject*)op1)->ob_digit;
if (intval == 0) {
if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
} else if (intval < 0) {
if (size >= 0)
Py_RETURN_FALSE;
intval = -intval;
size = -size;
} else {
if (size <= 0)
Py_RETURN_FALSE;
}
uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
if (uintval >> (PyLong_SHIFT * 4)) {
unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
} else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
if (uintval >> (PyLong_SHIFT * 3)) {
unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
} else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
if (uintval >> (PyLong_SHIFT * 2)) {
unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
} else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
if (uintval >> (PyLong_SHIFT * 1)) {
unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
} else
#endif
unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
}
#endif
if (PyFloat_CheckExact(op1)) {
const long b = intval;
double a = PyFloat_AS_DOUBLE(op1);
if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
}
return (
PyObject_RichCompare(op1, op2, Py_EQ));
}
/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
Py_DECREF(j);
return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
CYTHON_NCP_UNUSED int wraparound,
CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
Py_ssize_t wrapped_i = i;
if (wraparound & unlikely(i < 0)) {
wrapped_i += PyList_GET_SIZE(o);
}
if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, wrapped_i);
Py_INCREF(r);
return r;
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
CYTHON_NCP_UNUSED int wraparound,
CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
Py_ssize_t wrapped_i = i;
if (wraparound & unlikely(i < 0)) {
wrapped_i += PyTuple_GET_SIZE(o);
}
if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
Py_INCREF(r);
return r;
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
CYTHON_NCP_UNUSED int wraparound,
CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
PyObject *r = PyList_GET_ITEM(o, n);
Py_INCREF(r);
return r;
}
}
else if (PyTuple_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, n);
Py_INCREF(r);
return r;
}
} else {
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
if (likely(m && m->sq_item)) {
if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
Py_ssize_t l = m->sq_length(o);
if (likely(l >= 0)) {
i += l;
} else {
if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
PyErr_Clear();
}
}
return m->sq_item(o, i);
}
}
#else
if (is_list || PySequence_Check(o)) {
return PySequence_GetItem(o, i);
}
#endif
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
}
if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
Py_TYPE(obj)->tp_name, type->tp_name);
return 0;
}
/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}
/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}
/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
if (likely(ms && ms->sq_slice)) {
if (!has_cstart) {
if (_py_start && (*_py_start != Py_None)) {
cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
} else
cstart = 0;
}
if (!has_cstop) {
if (_py_stop && (*_py_stop != Py_None)) {
cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
} else
cstop = PY_SSIZE_T_MAX;
}
if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
Py_ssize_t l = ms->sq_length(obj);
if (likely(l >= 0)) {
if (cstop < 0) {
cstop += l;
if (cstop < 0) cstop = 0;
}
if (cstart < 0) {
cstart += l;
if (cstart < 0) cstart = 0;
}
} else {
if (!PyErr_ExceptionMatches(PyExc_OverflowError))
goto bad;
PyErr_Clear();
}
}
return ms->sq_slice(obj, cstart, cstop);
}
#endif
mp = Py_TYPE(obj)->tp_as_mapping;
if (likely(mp && mp->mp_subscript))
#endif
{
PyObject* result;
PyObject *py_slice, *py_start, *py_stop;
if (_py_slice) {
py_slice = *_py_slice;
} else {
PyObject* owned_start = NULL;
PyObject* owned_stop = NULL;
if (_py_start) {
py_start = *_py_start;
} else {
if (has_cstart) {
owned_start = py_start = PyInt_FromSsize_t(cstart);
if (unlikely(!py_start)) goto bad;
} else
py_start = Py_None;
}
if (_py_stop) {
py_stop = *_py_stop;
} else {
if (has_cstop) {
owned_stop = py_stop = PyInt_FromSsize_t(cstop);
if (unlikely(!py_stop)) {
Py_XDECREF(owned_start);
goto bad;
}
} else
py_stop = Py_None;
}
py_slice = PySlice_New(py_start, py_stop, Py_None);
Py_XDECREF(owned_start);
Py_XDECREF(owned_stop);
if (unlikely(!py_slice)) goto bad;
}
#if CYTHON_USE_TYPE_SLOTS
result = mp->mp_subscript(obj, py_slice);
#else
result = PyObject_GetItem(obj, py_slice);
#endif
if (!_py_slice) {
Py_DECREF(py_slice);
}
return result;
}
PyErr_Format(PyExc_TypeError,
"'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
return NULL;
}
/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
PyObject* fake_module;
PyTypeObject* cached_type = NULL;
fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
if (!fake_module) return NULL;
Py_INCREF(fake_module);
cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
if (cached_type) {
if (!PyType_Check((PyObject*)cached_type)) {
PyErr_Format(PyExc_TypeError,
"Shared Cython type %.200s is not a type object",
type->tp_name);
goto bad;
}
if (cached_type->tp_basicsize != type->tp_basicsize) {
PyErr_Format(PyExc_TypeError,
"Shared Cython type %.200s has the wrong size, try recompiling",
type->tp_name);
goto bad;
}
} else {
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
PyErr_Clear();
if (PyType_Ready(type) < 0) goto bad;
if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
goto bad;
Py_INCREF(type);
cached_type = type;
}
done:
Py_DECREF(fake_module);
return cached_type;
bad:
Py_XDECREF(cached_type);
cached_type = NULL;
goto done;
}
/* CythonFunction */
#include
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
if (unlikely(op->func_doc == NULL)) {
if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
if (unlikely(op->func_doc == NULL))
return NULL;
} else {
Py_INCREF(Py_None);
return Py_None;
}
}
Py_INCREF(op->func_doc);
return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
PyObject *tmp = op->func_doc;
if (value == NULL) {
value = Py_None;
}
Py_INCREF(value);
op->func_doc = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
if (unlikely(op->func_name == NULL))
return NULL;
}
Py_INCREF(op->func_name);
return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
if (unlikely(value == NULL || !PyString_Check(value)))
#endif
{
PyErr_SetString(PyExc_TypeError,
"__name__ must be set to a string object");
return -1;
}
tmp = op->func_name;
Py_INCREF(value);
op->func_name = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
Py_INCREF(op->func_qualname);
return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
if (unlikely(value == NULL || !PyString_Check(value)))
#endif
{
PyErr_SetString(PyExc_TypeError,
"__qualname__ must be set to a string object");
return -1;
}
tmp = op->func_qualname;
Py_INCREF(value);
op->func_qualname = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
PyObject *self;
self = m->func_closure;
if (self == NULL)
self = Py_None;
Py_INCREF(self);
return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
if (unlikely(op->func_dict == NULL)) {
op->func_dict = PyDict_New();
if (unlikely(op->func_dict == NULL))
return NULL;
}
Py_INCREF(op->func_dict);
return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
PyObject *tmp;
if (unlikely(value == NULL)) {
PyErr_SetString(PyExc_TypeError,
"function's dictionary may not be deleted");
return -1;
}
if (unlikely(!PyDict_Check(value))) {
PyErr_SetString(PyExc_TypeError,
"setting function's dictionary to a non-dict");
return -1;
}
tmp = op->func_dict;
Py_INCREF(value);
op->func_dict = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
Py_INCREF(op->func_globals);
return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
PyObject* result = (op->func_code) ? op->func_code : Py_None;
Py_INCREF(result);
return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
int result = 0;
PyObject *res = op->defaults_getter((PyObject *) op);
if (unlikely(!res))
return -1;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
Py_INCREF(op->defaults_tuple);
op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
Py_INCREF(op->defaults_kwdict);
#else
op->defaults_tuple = PySequence_ITEM(res, 0);
if (unlikely(!op->defaults_tuple)) result = -1;
else {
op->defaults_kwdict = PySequence_ITEM(res, 1);
if (unlikely(!op->defaults_kwdict)) result = -1;
}
#endif
Py_DECREF(res);
return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
PyObject* tmp;
if (!value) {
value = Py_None;
} else if (value != Py_None && !PyTuple_Check(value)) {
PyErr_SetString(PyExc_TypeError,
"__defaults__ must be set to a tuple object");
return -1;
}
Py_INCREF(value);
tmp = op->defaults_tuple;
op->defaults_tuple = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
PyObject* result = op->defaults_tuple;
if (unlikely(!result)) {
if (op->defaults_getter) {
if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
result = op->defaults_tuple;
} else {
result = Py_None;
}
}
Py_INCREF(result);
return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
PyObject* tmp;
if (!value) {
value = Py_None;
} else if (value != Py_None && !PyDict_Check(value)) {
PyErr_SetString(PyExc_TypeError,
"__kwdefaults__ must be set to a dict object");
return -1;
}
Py_INCREF(value);
tmp = op->defaults_kwdict;
op->defaults_kwdict = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
PyObject* result = op->defaults_kwdict;
if (unlikely(!result)) {
if (op->defaults_getter) {
if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
result = op->defaults_kwdict;
} else {
result = Py_None;
}
}
Py_INCREF(result);
return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
PyObject* tmp;
if (!value || value == Py_None) {
value = NULL;
} else if (!PyDict_Check(value)) {
PyErr_SetString(PyExc_TypeError,
"__annotations__ must be set to a dict object");
return -1;
}
Py_XINCREF(value);
tmp = op->func_annotations;
op->func_annotations = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
PyObject* result = op->func_annotations;
if (unlikely(!result)) {
result = PyDict_New();
if (unlikely(!result)) return NULL;
op->func_annotations = result;
}
Py_INCREF(result);
return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
{(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
{(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
{(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
{(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
{(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
{(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
{(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
{(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
{(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
{(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
{(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
{(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
{(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
{(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
{(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
{(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
{(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
{(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
{0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
{(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
{0, 0, 0, 0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
{"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
{0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
__pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
if (op == NULL)
return NULL;
op->flags = flags;
__Pyx_CyFunction_weakreflist(op) = NULL;
op->func.m_ml = ml;
op->func.m_self = (PyObject *) op;
Py_XINCREF(closure);
op->func_closure = closure;
Py_XINCREF(module);
op->func.m_module = module;
op->func_dict = NULL;
op->func_name = NULL;
Py_INCREF(qualname);
op->func_qualname = qualname;
op->func_doc = NULL;
op->func_classobj = NULL;
op->func_globals = globals;
Py_INCREF(op->func_globals);
Py_XINCREF(code);
op->func_code = code;
op->defaults_pyobjects = 0;
op->defaults = NULL;
op->defaults_tuple = NULL;
op->defaults_kwdict = NULL;
op->defaults_getter = NULL;
op->func_annotations = NULL;
PyObject_GC_Track(op);
return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
Py_CLEAR(m->func_closure);
Py_CLEAR(m->func.m_module);
Py_CLEAR(m->func_dict);
Py_CLEAR(m->func_name);
Py_CLEAR(m->func_qualname);
Py_CLEAR(m->func_doc);
Py_CLEAR(m->func_globals);
Py_CLEAR(m->func_code);
Py_CLEAR(m->func_classobj);
Py_CLEAR(m->defaults_tuple);
Py_CLEAR(m->defaults_kwdict);
Py_CLEAR(m->func_annotations);
if (m->defaults) {
PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
int i;
for (i = 0; i < m->defaults_pyobjects; i++)
Py_XDECREF(pydefaults[i]);
PyObject_Free(m->defaults);
m->defaults = NULL;
}
return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
if (__Pyx_CyFunction_weakreflist(m) != NULL)
PyObject_ClearWeakRefs((PyObject *) m);
__Pyx_CyFunction_clear(m);
PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
PyObject_GC_UnTrack(m);
__Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
Py_VISIT(m->func_closure);
Py_VISIT(m->func.m_module);
Py_VISIT(m->func_dict);
Py_VISIT(m->func_name);
Py_VISIT(m->func_qualname);
Py_VISIT(m->func_doc);
Py_VISIT(m->func_globals);
Py_VISIT(m->func_code);
Py_VISIT(m->func_classobj);
Py_VISIT(m->defaults_tuple);
Py_VISIT(m->defaults_kwdict);
if (m->defaults) {
PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
int i;
for (i = 0; i < m->defaults_pyobjects; i++)
Py_VISIT(pydefaults[i]);
}
return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
Py_INCREF(func);
return func;
}
if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
if (type == NULL)
type = (PyObject *)(Py_TYPE(obj));
return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
}
if (obj == Py_None)
obj = NULL;
return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromFormat("",
op->func_qualname, (void *)op);
#else
return PyString_FromFormat("",
PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
PyCFunctionObject* f = (PyCFunctionObject*)func;
PyCFunction meth = f->m_ml->ml_meth;
Py_ssize_t size;
switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
case METH_VARARGS:
if (likely(kw == NULL || PyDict_Size(kw) == 0))
return (*meth)(self, arg);
break;
case METH_VARARGS | METH_KEYWORDS:
return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
case METH_NOARGS:
if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
if (likely(size == 0))
return (*meth)(self, NULL);
PyErr_Format(PyExc_TypeError,
"%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
break;
case METH_O:
if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
if (likely(size == 1)) {
PyObject *result, *arg0;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
arg0 = PyTuple_GET_ITEM(arg, 0);
#else
arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
#endif
result = (*meth)(self, arg0);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
Py_DECREF(arg0);
#endif
return result;
}
PyErr_Format(PyExc_TypeError,
"%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
break;
default:
PyErr_SetString(PyExc_SystemError, "Bad call flags in "
"__Pyx_CyFunction_Call. METH_OLDARGS is no "
"longer supported!");
return NULL;
}
PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
f->m_ml->ml_name);
return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
PyObject *result;
__pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
Py_ssize_t argc;
PyObject *new_args;
PyObject *self;
argc = PyTuple_GET_SIZE(args);
new_args = PyTuple_GetSlice(args, 1, argc);
if (unlikely(!new_args))
return NULL;
self = PyTuple_GetItem(args, 0);
if (unlikely(!self)) {
Py_DECREF(new_args);
return NULL;
}
result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
Py_DECREF(new_args);
} else {
result = __Pyx_CyFunction_Call(func, args, kw);
}
return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
PyVarObject_HEAD_INIT(0, 0)
"cython_function_or_method",
sizeof(__pyx_CyFunctionObject),
0,
(destructor) __Pyx_CyFunction_dealloc,
0,
0,
0,
#if PY_MAJOR_VERSION < 3
0,
#else
0,
#endif
(reprfunc) __Pyx_CyFunction_repr,
0,
0,
0,
0,
__Pyx_CyFunction_CallAsMethod,
0,
0,
0,
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
0,
(traverseproc) __Pyx_CyFunction_traverse,
(inquiry) __Pyx_CyFunction_clear,
0,
#if PY_VERSION_HEX < 0x030500A0
offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
offsetof(PyCFunctionObject, m_weakreflist),
#endif
0,
0,
__pyx_CyFunction_methods,
__pyx_CyFunction_members,
__pyx_CyFunction_getsets,
0,
0,
__Pyx_CyFunction_descr_get,
0,
offsetof(__pyx_CyFunctionObject, func_dict),
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
#if PY_VERSION_HEX >= 0x030400a1
0,
#endif
};
static int __pyx_CyFunction_init(void) {
__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
if (unlikely(__pyx_CyFunctionType == NULL)) {
return -1;
}
return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
m->defaults = PyObject_Malloc(size);
if (unlikely(!m->defaults))
return PyErr_NoMemory();
memset(m->defaults, 0, size);
m->defaults_pyobjects = pyobjects;
return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
m->defaults_tuple = tuple;
Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
m->defaults_kwdict = dict;
Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
m->func_annotations = dict;
Py_INCREF(dict);
}
/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
PyObject *runerr;
Py_ssize_t key_value;
PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
if (unlikely(!(m && m->sq_item))) {
PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
return NULL;
}
key_value = __Pyx_PyIndex_AsSsize_t(index);
if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
}
if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
PyErr_Clear();
PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
}
return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
if (likely(m && m->mp_subscript)) {
return m->mp_subscript(obj, key);
}
return __Pyx_PyObject_GetIndex(obj, key);
}
#endif
/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
PyObject *value;
value = PyDict_GetItemWithError(d, key);
if (unlikely(!value)) {
if (!PyErr_Occurred()) {
if (unlikely(PyTuple_Check(key))) {
PyObject* args = PyTuple_Pack(1, key);
if (likely(args)) {
PyErr_SetObject(PyExc_KeyError, args);
Py_DECREF(args);
}
} else {
PyErr_SetObject(PyExc_KeyError, key);
}
}
return NULL;
}
Py_INCREF(value);
return value;
}
#endif
/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
#else
if (likely(PyString_Check(n)))
#endif
return __Pyx_PyObject_GetAttrStr(o, n);
#endif
return PyObject_GetAttr(o, n);
}
/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
PyObject *r;
if (unlikely(!__Pyx_PyBaseString_Check(n))) {
PyErr_SetString(PyExc_TypeError,
"hasattr(): attribute name must be string");
return -1;
}
r = __Pyx_GetAttr(o, n);
if (unlikely(!r)) {
PyErr_Clear();
return 0;
} else {
Py_DECREF(r);
return 1;
}
}
/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
PyTypeObject *tp = Py_TYPE(obj);
PyObject *descr;
descrgetfunc f = NULL;
PyObject **dictptr, *dict;
int meth_found = 0;
assert (*method == NULL);
if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
attr = __Pyx_PyObject_GetAttrStr(obj, name);
goto try_unpack;
}
if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
return 0;
}
descr = _PyType_Lookup(tp, name);
if (likely(descr != NULL)) {
Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
#ifdef __Pyx_CyFunction_USED
if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
#else
if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
#endif
#else
#ifdef __Pyx_CyFunction_USED
if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
#else
if (likely(PyFunction_Check(descr)))
#endif
#endif
{
meth_found = 1;
} else {
f = Py_TYPE(descr)->tp_descr_get;
if (f != NULL && PyDescr_IsData(descr)) {
attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
Py_DECREF(descr);
goto try_unpack;
}
}
}
dictptr = _PyObject_GetDictPtr(obj);
if (dictptr != NULL && (dict = *dictptr) != NULL) {
Py_INCREF(dict);
attr = __Pyx_PyDict_GetItemStr(dict, name);
if (attr != NULL) {
Py_INCREF(attr);
Py_DECREF(dict);
Py_XDECREF(descr);
goto try_unpack;
}
Py_DECREF(dict);
}
if (meth_found) {
*method = descr;
return 1;
}
if (f != NULL) {
attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
Py_DECREF(descr);
goto try_unpack;
}
if (descr != NULL) {
*method = descr;
return 0;
}
PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
"'%.50s' object has no attribute '%U'",
tp->tp_name, name);
#else
"'%.50s' object has no attribute '%.400s'",
tp->tp_name, PyString_AS_STRING(name));
#endif
return 0;
#else
attr = __Pyx_PyObject_GetAttrStr(obj, name);
goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
PyObject *function = PyMethod_GET_FUNCTION(attr);
Py_INCREF(function);
Py_DECREF(attr);
*method = function;
return 1;
}
#endif
*method = attr;
return 0;
}
/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
PyObject *method = NULL, *result = NULL;
int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
if (likely(is_method)) {
result = __Pyx_PyObject_CallOneArg(method, obj);
Py_DECREF(method);
return result;
}
if (unlikely(!method)) goto bad;
result = __Pyx_PyObject_CallNoArg(method);
Py_DECREF(method);
bad:
return result;
}
/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}
/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
if (t == Py_None) {
__Pyx_RaiseNoneNotIterableError();
} else if (PyTuple_GET_SIZE(t) < index) {
__Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
} else {
__Pyx_RaiseTooManyValuesError(index);
}
}
/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
#else
value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
#endif
if (decref_tuple) {
Py_DECREF(tuple);
}
*pvalue1 = value1;
*pvalue2 = value2;
return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
Py_XDECREF(value1);
Py_XDECREF(value2);
if (decref_tuple) { Py_XDECREF(tuple); }
return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
int has_known_size, int decref_tuple) {
Py_ssize_t index;
PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
iternextfunc iternext;
iter = PyObject_GetIter(tuple);
if (unlikely(!iter)) goto bad;
if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
iternext = Py_TYPE(iter)->tp_iternext;
value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
Py_DECREF(iter);
*pvalue1 = value1;
*pvalue2 = value2;
return 0;
unpacking_failed:
if (!has_known_size && __Pyx_IterFinish() == 0)
__Pyx_RaiseNeedMoreValuesError(index);
bad:
Py_XDECREF(iter);
Py_XDECREF(value1);
Py_XDECREF(value2);
if (decref_tuple) { Py_XDECREF(tuple); }
return -1;
}
/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
Py_ssize_t* p_orig_length, int* p_source_is_dict) {
is_dict = is_dict || likely(PyDict_CheckExact(iterable));
*p_source_is_dict = is_dict;
if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
*p_orig_length = PyDict_Size(iterable);
Py_INCREF(iterable);
return iterable;
#elif PY_MAJOR_VERSION >= 3
static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
PyObject **pp = NULL;
if (method_name) {
const char *name = PyUnicode_AsUTF8(method_name);
if (strcmp(name, "iteritems") == 0) pp = &py_items;
else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
else if (strcmp(name, "itervalues") == 0) pp = &py_values;
if (pp) {
if (!*pp) {
*pp = PyUnicode_FromString(name + 4);
if (!*pp)
return NULL;
}
method_name = *pp;
}
}
#endif
}
*p_orig_length = 0;
if (method_name) {
PyObject* iter;
iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
if (!iterable)
return NULL;
#if !CYTHON_COMPILING_IN_PYPY
if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
return iterable;
#endif
iter = PyObject_GetIter(iterable);
Py_DECREF(iterable);
return iter;
}
return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
if (source_is_dict) {
PyObject *key, *value;
if (unlikely(orig_length != PyDict_Size(iter_obj))) {
PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
return -1;
}
if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
return 0;
}
if (pitem) {
PyObject* tuple = PyTuple_New(2);
if (unlikely(!tuple)) {
return -1;
}
Py_INCREF(key);
Py_INCREF(value);
PyTuple_SET_ITEM(tuple, 0, key);
PyTuple_SET_ITEM(tuple, 1, value);
*pitem = tuple;
} else {
if (pkey) {
Py_INCREF(key);
*pkey = key;
}
if (pvalue) {
Py_INCREF(value);
*pvalue = value;
}
}
return 1;
} else if (PyTuple_CheckExact(iter_obj)) {
Py_ssize_t pos = *ppos;
if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
*ppos = pos + 1;
next_item = PyTuple_GET_ITEM(iter_obj, pos);
Py_INCREF(next_item);
} else if (PyList_CheckExact(iter_obj)) {
Py_ssize_t pos = *ppos;
if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
*ppos = pos + 1;
next_item = PyList_GET_ITEM(iter_obj, pos);
Py_INCREF(next_item);
} else
#endif
{
next_item = PyIter_Next(iter_obj);
if (unlikely(!next_item)) {
return __Pyx_IterFinish();
}
}
if (pitem) {
*pitem = next_item;
} else if (pkey && pvalue) {
if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
return -1;
} else if (pkey) {
*pkey = next_item;
} else {
*pvalue = next_item;
}
return 1;
}
/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_CheckExact(op1))) {
const long b = intval;
long x;
long a = PyInt_AS_LONG(op1);
x = (long)((unsigned long)a - b);
if (likely((x^a) >= 0 || (x^~b) >= 0))
return PyInt_FromLong(x);
return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
}
#endif
#if CYTHON_USE_PYLONG_INTERNALS
if (likely(PyLong_CheckExact(op1))) {
const long b = intval;
long a, x;
#ifdef HAVE_LONG_LONG
const PY_LONG_LONG llb = intval;
PY_LONG_LONG lla, llx;
#endif
const digit* digits = ((PyLongObject*)op1)->ob_digit;
const Py_ssize_t size = Py_SIZE(op1);
if (likely(__Pyx_sst_abs(size) <= 1)) {
a = likely(size) ? digits[0] : 0;
if (size == -1) a = -a;
} else {
switch (size) {
case -2:
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
case 2:
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
case -3:
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
case 3:
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
case -4:
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
case 4:
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
}
}
x = a - b;
return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
long_long:
llx = lla - llb;
return PyLong_FromLongLong(llx);
#endif
}
#endif
if (PyFloat_CheckExact(op1)) {
const long b = intval;
double a = PyFloat_AS_DOUBLE(op1);
double result;
PyFPE_START_PROTECT("subtract", return NULL)
result = ((double)a) - (double)b;
PyFPE_END_PROTECT(result)
return PyFloat_FromDouble(result);
}
return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif
/* decode_c_bytes */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
if (unlikely((start < 0) | (stop < 0))) {
if (start < 0) {
start += length;
if (start < 0)
start = 0;
}
if (stop < 0)
stop += length;
}
if (stop > length)
stop = length;
length = stop - start;
if (unlikely(length <= 0))
return PyUnicode_FromUnicode(NULL, 0);
cstring += start;
if (decode_func) {
return decode_func(cstring, length, errors);
} else {
return PyUnicode_Decode(cstring, length, encoding, errors);
}
}
/* CIntToPyUnicode */
#ifdef _MSC_VER
#ifndef _MSC_STDINT_H_
#if _MSC_VER < 1300
typedef unsigned short uint16_t;
#else
typedef unsigned __int16 uint16_t;
#endif
#endif
#else
#include
#endif
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
char digits[sizeof(Py_ssize_t)*3+2];
char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
const char *hex_digits = DIGITS_HEX;
Py_ssize_t length, ulength;
int prepend_sign, last_one_off;
Py_ssize_t remaining;
const Py_ssize_t neg_one = (Py_ssize_t) ((Py_ssize_t) 0 - (Py_ssize_t) 1), const_zero = (Py_ssize_t) 0;
const int is_unsigned = neg_one > const_zero;
if (format_char == 'X') {
hex_digits += 16;
format_char = 'x';
}
remaining = value;
last_one_off = 0;
dpos = end;
do {
int digit_pos;
switch (format_char) {
case 'o':
digit_pos = abs((int)(remaining % (8*8)));
remaining = (Py_ssize_t) (remaining / (8*8));
dpos -= 2;
*(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_8)[digit_pos];
last_one_off = (digit_pos < 8);
break;
case 'd':
digit_pos = abs((int)(remaining % (10*10)));
remaining = (Py_ssize_t) (remaining / (10*10));
dpos -= 2;
*(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_10)[digit_pos];
last_one_off = (digit_pos < 10);
break;
case 'x':
*(--dpos) = hex_digits[abs((int)(remaining % 16))];
remaining = (Py_ssize_t) (remaining / 16);
break;
default:
assert(0);
break;
}
} while (unlikely(remaining != 0));
if (last_one_off) {
assert(*dpos == '0');
dpos++;
}
length = end - dpos;
ulength = length;
prepend_sign = 0;
if (!is_unsigned && value <= neg_one) {
if (padding_char == ' ' || width <= length + 1) {
*(--dpos) = '-';
++length;
} else {
prepend_sign = 1;
}
++ulength;
}
if (width > ulength) {
ulength = width;
}
if (ulength == 1) {
return PyUnicode_FromOrdinal(*dpos);
}
return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}
/* unicode_tailmatch */
static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings,
Py_ssize_t start, Py_ssize_t end, int direction) {
Py_ssize_t i, count = PyTuple_GET_SIZE(substrings);
for (i = 0; i < count; i++) {
Py_ssize_t result;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i),
start, end, direction);
#else
PyObject* sub = PySequence_ITEM(substrings, i);
if (unlikely(!sub)) return -1;
result = PyUnicode_Tailmatch(s, sub, start, end, direction);
Py_DECREF(sub);
#endif
if (result) {
return (int) result;
}
}
return 0;
}
static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
Py_ssize_t start, Py_ssize_t end, int direction) {
if (unlikely(PyTuple_Check(substr))) {
return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction);
}
return (int) PyUnicode_Tailmatch(s, substr, start, end, direction);
}
/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_CheckExact(op1))) {
const long b = intval;
long x;
long a = PyInt_AS_LONG(op1);
x = (long)((unsigned long)a + b);
if (likely((x^a) >= 0 || (x^b) >= 0))
return PyInt_FromLong(x);
return PyLong_Type.tp_as_number->nb_add(op1, op2);
}
#endif
#if CYTHON_USE_PYLONG_INTERNALS
if (likely(PyLong_CheckExact(op1))) {
const long b = intval;
long a, x;
#ifdef HAVE_LONG_LONG
const PY_LONG_LONG llb = intval;
PY_LONG_LONG lla, llx;
#endif
const digit* digits = ((PyLongObject*)op1)->ob_digit;
const Py_ssize_t size = Py_SIZE(op1);
if (likely(__Pyx_sst_abs(size) <= 1)) {
a = likely(size) ? digits[0] : 0;
if (size == -1) a = -a;
} else {
switch (size) {
case -2:
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
case 2:
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
case -3:
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
case 3:
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
case -4:
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
case 4:
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
#ifdef HAVE_LONG_LONG
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
goto long_long;
#endif
}
CYTHON_FALLTHROUGH;
default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
}
}
x = a + b;
return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
long_long:
llx = lla + llb;
return PyLong_FromLongLong(llx);
#endif
}
#endif
if (PyFloat_CheckExact(op1)) {
const long b = intval;
double a = PyFloat_AS_DOUBLE(op1);
double result;
PyFPE_START_PROTECT("add", return NULL)
result = ((double)a) + (double)b;
PyFPE_END_PROTECT(result)
return PyFloat_FromDouble(result);
}
return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif
/* IsLittleEndian */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
{
union {
uint32_t u32;
uint8_t u8[4];
} S;
S.u32 = 0x01020304;
return S.u8[0] == 4;
}
/* BufferFormatCheck */
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
__Pyx_BufFmt_StackElem* stack,
__Pyx_TypeInfo* type) {
stack[0].field = &ctx->root;
stack[0].parent_offset = 0;
ctx->root.type = type;
ctx->root.name = "buffer dtype";
ctx->root.offset = 0;
ctx->head = stack;
ctx->head->field = &ctx->root;
ctx->fmt_offset = 0;
ctx->head->parent_offset = 0;
ctx->new_packmode = '@';
ctx->enc_packmode = '@';
ctx->new_count = 1;
ctx->enc_count = 0;
ctx->enc_type = 0;
ctx->is_complex = 0;
ctx->is_valid_array = 0;
ctx->struct_alignment = 0;
while (type->typegroup == 'S') {
++ctx->head;
ctx->head->field = type->fields;
ctx->head->parent_offset = 0;
type = type->fields->type;
}
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
int count;
const char* t = *ts;
if (*t < '0' || *t > '9') {
return -1;
} else {
count = *t++ - '0';
while (*t >= '0' && *t < '9') {
count *= 10;
count += *t++ - '0';
}
}
*ts = t;
return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
int number = __Pyx_BufFmt_ParseNumber(ts);
if (number == -1)
PyErr_Format(PyExc_ValueError,\
"Does not understand character buffer dtype format string ('%c')", **ts);
return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
PyErr_Format(PyExc_ValueError,
"Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
switch (ch) {
case 'c': return "'char'";
case 'b': return "'signed char'";
case 'B': return "'unsigned char'";
case 'h': return "'short'";
case 'H': return "'unsigned short'";
case 'i': return "'int'";
case 'I': return "'unsigned int'";
case 'l': return "'long'";
case 'L': return "'unsigned long'";
case 'q': return "'long long'";
case 'Q': return "'unsigned long long'";
case 'f': return (is_complex ? "'complex float'" : "'float'");
case 'd': return (is_complex ? "'complex double'" : "'double'");
case 'g': return (is_complex ? "'complex long double'" : "'long double'");
case 'T': return "a struct";
case 'O': return "Python object";
case 'P': return "a pointer";
case 's': case 'p': return "a string";
case 0: return "end";
default: return "unparseable format string";
}
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
switch (ch) {
case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
case 'h': case 'H': return 2;
case 'i': case 'I': case 'l': case 'L': return 4;
case 'q': case 'Q': return 8;
case 'f': return (is_complex ? 8 : 4);
case 'd': return (is_complex ? 16 : 8);
case 'g': {
PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
return 0;
}
case 'O': case 'P': return sizeof(void*);
default:
__Pyx_BufFmt_RaiseUnexpectedChar(ch);
return 0;
}
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
switch (ch) {
case 'c': case 'b': case 'B': case 's': case 'p': return 1;
case 'h': case 'H': return sizeof(short);
case 'i': case 'I': return sizeof(int);
case 'l': case 'L': return sizeof(long);
#ifdef HAVE_LONG_LONG
case 'q': case 'Q': return sizeof(PY_LONG_LONG);
#endif
case 'f': return sizeof(float) * (is_complex ? 2 : 1);
case 'd': return sizeof(double) * (is_complex ? 2 : 1);
case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
case 'O': case 'P': return sizeof(void*);
default: {
__Pyx_BufFmt_RaiseUnexpectedChar(ch);
return 0;
}
}
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
switch (ch) {
case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
default:
__Pyx_BufFmt_RaiseUnexpectedChar(ch);
return 0;
}
}
/* These are for computing the padding at the end of the struct to align
on the first member of the struct. This will probably the same as above,
but we don't have any guarantees.
*/
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
switch (ch) {
case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
default:
__Pyx_BufFmt_RaiseUnexpectedChar(ch);
return 0;
}
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
switch (ch) {
case 'c':
return 'H';
case 'b': case 'h': case 'i':
case 'l': case 'q': case 's': case 'p':
return 'I';
case 'B': case 'H': case 'I': case 'L': case 'Q':
return 'U';
case 'f': case 'd': case 'g':
return (is_complex ? 'C' : 'R');
case 'O':
return 'O';
case 'P':
return 'P';
default: {
__Pyx_BufFmt_RaiseUnexpectedChar(ch);
return 0;
}
}
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
if (ctx->head == NULL || ctx->head->field == &ctx->root) {
const char* expected;
const char* quote;
if (ctx->head == NULL) {
expected = "end";
quote = "";
} else {
expected = ctx->head->field->type->name;
quote = "'";
}
PyErr_Format(PyExc_ValueError,
"Buffer dtype mismatch, expected %s%s%s but got %s",
quote, expected, quote,
__Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
} else {
__Pyx_StructField* field = ctx->head->field;
__Pyx_StructField* parent = (ctx->head - 1)->field;
PyErr_Format(PyExc_ValueError,
"Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
parent->type->name, field->name);
}
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
char group;
size_t size, offset, arraysize = 1;
if (ctx->enc_type == 0) return 0;
if (ctx->head->field->type->arraysize[0]) {
int i, ndim = 0;
if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
ctx->is_valid_array = ctx->head->field->type->ndim == 1;
ndim = 1;
if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
PyErr_Format(PyExc_ValueError,
"Expected a dimension of size %zu, got %zu",
ctx->head->field->type->arraysize[0], ctx->enc_count);
return -1;
}
}
if (!ctx->is_valid_array) {
PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
ctx->head->field->type->ndim, ndim);
return -1;
}
for (i = 0; i < ctx->head->field->type->ndim; i++) {
arraysize *= ctx->head->field->type->arraysize[i];
}
ctx->is_valid_array = 0;
ctx->enc_count = 1;
}
group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
do {
__Pyx_StructField* field = ctx->head->field;
__Pyx_TypeInfo* type = field->type;
if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
} else {
size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
}
if (ctx->enc_packmode == '@') {
size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
size_t align_mod_offset;
if (align_at == 0) return -1;
align_mod_offset = ctx->fmt_offset % align_at;
if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
if (ctx->struct_alignment == 0)
ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
ctx->is_complex);
}
if (type->size != size || type->typegroup != group) {
if (type->typegroup == 'C' && type->fields != NULL) {
size_t parent_offset = ctx->head->parent_offset + field->offset;
++ctx->head;
ctx->head->field = type->fields;
ctx->head->parent_offset = parent_offset;
continue;
}
if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
} else {
__Pyx_BufFmt_RaiseExpected(ctx);
return -1;
}
}
offset = ctx->head->parent_offset + field->offset;
if (ctx->fmt_offset != offset) {
PyErr_Format(PyExc_ValueError,
"Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
(Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
return -1;
}
ctx->fmt_offset += size;
if (arraysize)
ctx->fmt_offset += (arraysize - 1) * size;
--ctx->enc_count;
while (1) {
if (field == &ctx->root) {
ctx->head = NULL;
if (ctx->enc_count != 0) {
__Pyx_BufFmt_RaiseExpected(ctx);
return -1;
}
break;
}
ctx->head->field = ++field;
if (field->type == NULL) {
--ctx->head;
field = ctx->head->field;
continue;
} else if (field->type->typegroup == 'S') {
size_t parent_offset = ctx->head->parent_offset + field->offset;
if (field->type->fields->type == NULL) continue;
field = field->type->fields;
++ctx->head;
ctx->head->field = field;
ctx->head->parent_offset = parent_offset;
break;
} else {
break;
}
}
} while (ctx->enc_count);
ctx->enc_type = 0;
ctx->is_complex = 0;
return 0;
}
static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
const char *ts = *tsp;
int i = 0, number;
int ndim = ctx->head->field->type->ndim;
;
++ts;
if (ctx->new_count != 1) {
PyErr_SetString(PyExc_ValueError,
"Cannot handle repeated arrays in format string");
return NULL;
}
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
while (*ts && *ts != ')') {
switch (*ts) {
case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
default: break;
}
number = __Pyx_BufFmt_ExpectNumber(&ts);
if (number == -1) return NULL;
if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
return PyErr_Format(PyExc_ValueError,
"Expected a dimension of size %zu, got %d",
ctx->head->field->type->arraysize[i], number);
if (*ts != ',' && *ts != ')')
return PyErr_Format(PyExc_ValueError,
"Expected a comma in format string, got '%c'", *ts);
if (*ts == ',') ts++;
i++;
}
if (i != ndim)
return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
ctx->head->field->type->ndim, i);
if (!*ts) {
PyErr_SetString(PyExc_ValueError,
"Unexpected end of format string, expected ')'");
return NULL;
}
ctx->is_valid_array = 1;
ctx->new_count = 1;
*tsp = ++ts;
return Py_None;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
int got_Z = 0;
while (1) {
switch(*ts) {
case 0:
if (ctx->enc_type != 0 && ctx->head == NULL) {
__Pyx_BufFmt_RaiseExpected(ctx);
return NULL;
}
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
if (ctx->head != NULL) {
__Pyx_BufFmt_RaiseExpected(ctx);
return NULL;
}
return ts;
case ' ':
case '\r':
case '\n':
++ts;
break;
case '<':
if (!__Pyx_Is_Little_Endian()) {
PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
return NULL;
}
ctx->new_packmode = '=';
++ts;
break;
case '>':
case '!':
if (__Pyx_Is_Little_Endian()) {
PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
return NULL;
}
ctx->new_packmode = '=';
++ts;
break;
case '=':
case '@':
case '^':
ctx->new_packmode = *ts++;
break;
case 'T':
{
const char* ts_after_sub;
size_t i, struct_count = ctx->new_count;
size_t struct_alignment = ctx->struct_alignment;
ctx->new_count = 1;
++ts;
if (*ts != '{') {
PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
return NULL;
}
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
ctx->enc_type = 0;
ctx->enc_count = 0;
ctx->struct_alignment = 0;
++ts;
ts_after_sub = ts;
for (i = 0; i != struct_count; ++i) {
ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
if (!ts_after_sub) return NULL;
}
ts = ts_after_sub;
if (struct_alignment) ctx->struct_alignment = struct_alignment;
}
break;
case '}':
{
size_t alignment = ctx->struct_alignment;
++ts;
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
ctx->enc_type = 0;
if (alignment && ctx->fmt_offset % alignment) {
ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
}
}
return ts;
case 'x':
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
ctx->fmt_offset += ctx->new_count;
ctx->new_count = 1;
ctx->enc_count = 0;
ctx->enc_type = 0;
ctx->enc_packmode = ctx->new_packmode;
++ts;
break;
case 'Z':
got_Z = 1;
++ts;
if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
__Pyx_BufFmt_RaiseUnexpectedChar('Z');
return NULL;
}
CYTHON_FALLTHROUGH;
case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
case 'l': case 'L': case 'q': case 'Q':
case 'f': case 'd': case 'g':
case 'O': case 'p':
if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
ctx->enc_packmode == ctx->new_packmode) {
ctx->enc_count += ctx->new_count;
ctx->new_count = 1;
got_Z = 0;
++ts;
break;
}
CYTHON_FALLTHROUGH;
case 's':
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
ctx->enc_count = ctx->new_count;
ctx->enc_packmode = ctx->new_packmode;
ctx->enc_type = *ts;
ctx->is_complex = got_Z;
++ts;
ctx->new_count = 1;
got_Z = 0;
break;
case ':':
++ts;
while(*ts != ':') ++ts;
++ts;
break;
case '(':
if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
break;
default:
{
int number = __Pyx_BufFmt_ExpectNumber(&ts);
if (number == -1) return NULL;
ctx->new_count = (size_t)number;
}
}
}
}
/* BufferGetAndValidate */
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
if (unlikely(info->buf == NULL)) return;
if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
__Pyx_ReleaseBuffer(info);
}
static void __Pyx_ZeroBuffer(Py_buffer* buf) {
buf->buf = NULL;
buf->obj = NULL;
buf->strides = __Pyx_zeros;
buf->shape = __Pyx_zeros;
buf->suboffsets = __Pyx_minusones;
}
static int __Pyx__GetBufferAndValidate(
Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
buf->buf = NULL;
if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
__Pyx_ZeroBuffer(buf);
return -1;
}
if (unlikely(buf->ndim != nd)) {
PyErr_Format(PyExc_ValueError,
"Buffer has wrong number of dimensions (expected %d, got %d)",
nd, buf->ndim);
goto fail;
}
if (!cast) {
__Pyx_BufFmt_Context ctx;
__Pyx_BufFmt_Init(&ctx, stack, dtype);
if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
}
if (unlikely((unsigned)buf->itemsize != dtype->size)) {
PyErr_Format(PyExc_ValueError,
"Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
buf->itemsize, (buf->itemsize > 1) ? "s" : "",
dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
goto fail;
}
if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
return 0;
fail:;
__Pyx_SafeReleaseBuffer(buf);
return -1;
}
/* BufferIndexError */
static void __Pyx_RaiseBufferIndexError(int axis) {
PyErr_Format(PyExc_IndexError,
"Out of bounds on buffer access (axis %d)", axis);
}
/* BufferFallbackError */
static void __Pyx_RaiseBufferFallbackError(void) {
PyErr_SetString(PyExc_ValueError,
"Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}
/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
Py_ssize_t i, n;
n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
for (i=0; icurexc_type;
if (exc_type == err) return 1;
if (unlikely(!exc_type)) return 0;
if (unlikely(PyTuple_Check(err)))
return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif
/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
return NULL;
__Pyx_PyErr_Clear();
Py_INCREF(d);
return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
PyObject *r = __Pyx_GetAttr(o, n);
return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}
/* CIntToPyUnicode */
#ifdef _MSC_VER
#ifndef _MSC_STDINT_H_
#if _MSC_VER < 1300
typedef unsigned short uint16_t;
#else
typedef unsigned __int16 uint16_t;
#endif
#endif
#else
#include
#endif
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
char digits[sizeof(int)*3+2];
char *dpos, *end = digits + sizeof(int)*3+2;
const char *hex_digits = DIGITS_HEX;
Py_ssize_t length, ulength;
int prepend_sign, last_one_off;
int remaining;
const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
if (format_char == 'X') {
hex_digits += 16;
format_char = 'x';
}
remaining = value;
last_one_off = 0;
dpos = end;
do {
int digit_pos;
switch (format_char) {
case 'o':
digit_pos = abs((int)(remaining % (8*8)));
remaining = (int) (remaining / (8*8));
dpos -= 2;
*(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_8)[digit_pos];
last_one_off = (digit_pos < 8);
break;
case 'd':
digit_pos = abs((int)(remaining % (10*10)));
remaining = (int) (remaining / (10*10));
dpos -= 2;
*(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_10)[digit_pos];
last_one_off = (digit_pos < 10);
break;
case 'x':
*(--dpos) = hex_digits[abs((int)(remaining % 16))];
remaining = (int) (remaining / 16);
break;
default:
assert(0);
break;
}
} while (unlikely(remaining != 0));
if (last_one_off) {
assert(*dpos == '0');
dpos++;
}
length = end - dpos;
ulength = length;
prepend_sign = 0;
if (!is_unsigned && value <= neg_one) {
if (padding_char == ' ' || width <= length + 1) {
*(--dpos) = '-';
++length;
} else {
prepend_sign = 1;
}
++ulength;
}
if (width > ulength) {
ulength = width;
}
if (ulength == 1) {
return PyUnicode_FromOrdinal(*dpos);
}
return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}
/* None */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
Py_ssize_t r = a % b;
r += ((r != 0) & ((r ^ b) < 0)) * b;
return r;
}
/* None */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
Py_ssize_t q = a / b;
Py_ssize_t r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
_PyErr_StackItem *exc_info = tstate->exc_info;
while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
exc_info->previous_item != NULL)
{
exc_info = exc_info->previous_item;
}
return exc_info;
}
#endif
/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_USE_EXC_INFO_STACK
_PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
*type = exc_info->exc_type;
*value = exc_info->exc_value;
*tb = exc_info->exc_traceback;
#else
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
#endif
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
#if CYTHON_USE_EXC_INFO_STACK
_PyErr_StackItem *exc_info = tstate->exc_info;
tmp_type = exc_info->exc_type;
tmp_value = exc_info->exc_value;
tmp_tb = exc_info->exc_traceback;
exc_info->exc_type = type;
exc_info->exc_value = value;
exc_info->exc_traceback = tb;
#else
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
tstate->exc_type = type;
tstate->exc_value = value;
tstate->exc_traceback = tb;
#endif
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
}
#endif
/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
PyObject *tmp_type, *tmp_value, *tmp_tb;
local_type = tstate->curexc_type;
local_value = tstate->curexc_value;
local_tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
#else
PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
if (unlikely(tstate->curexc_type))
#else
if (unlikely(PyErr_Occurred()))
#endif
goto bad;
#if PY_MAJOR_VERSION >= 3
if (local_tb) {
if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
goto bad;
}
#endif
Py_XINCREF(local_tb);
Py_XINCREF(local_type);
Py_XINCREF(local_value);
*type = local_type;
*value = local_value;
*tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
#if CYTHON_USE_EXC_INFO_STACK
{
_PyErr_StackItem *exc_info = tstate->exc_info;
tmp_type = exc_info->exc_type;
tmp_value = exc_info->exc_value;
tmp_tb = exc_info->exc_traceback;
exc_info->exc_type = local_type;
exc_info->exc_value = local_value;
exc_info->exc_traceback = local_tb;
}
#else
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
tstate->exc_type = local_type;
tstate->exc_value = local_value;
tstate->exc_traceback = local_tb;
#endif
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
#else
PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
return 0;
bad:
*type = 0;
*value = 0;
*tb = 0;
Py_XDECREF(local_type);
Py_XDECREF(local_value);
Py_XDECREF(local_tb);
return -1;
}
/* GetItemIntUnicode */
static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i,
int wraparound, int boundscheck) {
Py_ssize_t length;
if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return (Py_UCS4)-1;
if (wraparound | boundscheck) {
length = __Pyx_PyUnicode_GET_LENGTH(ustring);
if (wraparound & unlikely(i < 0)) i += length;
if ((!boundscheck) || likely(__Pyx_is_valid_index(i, length))) {
return __Pyx_PyUnicode_READ_CHAR(ustring, i);
} else {
PyErr_SetString(PyExc_IndexError, "string index out of range");
return (Py_UCS4)-1;
}
} else {
return __Pyx_PyUnicode_READ_CHAR(ustring, i);
}
}
/* PyUnicode_Substring */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
PyObject* text, Py_ssize_t start, Py_ssize_t stop) {
Py_ssize_t length;
if (unlikely(__Pyx_PyUnicode_READY(text) == -1)) return NULL;
length = __Pyx_PyUnicode_GET_LENGTH(text);
if (start < 0) {
start += length;
if (start < 0)
start = 0;
}
if (stop < 0)
stop += length;
else if (stop > length)
stop = length;
length = stop - start;
if (length <= 0)
return PyUnicode_FromUnicode(NULL, 0);
#if CYTHON_PEP393_ENABLED
return PyUnicode_FromKindAndData(PyUnicode_KIND(text),
PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start);
#else
return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(text)+start, stop-start);
#endif
}
/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
PyObject *empty_list = 0;
PyObject *module = 0;
PyObject *global_dict = 0;
PyObject *empty_dict = 0;
PyObject *list;
#if PY_MAJOR_VERSION < 3
PyObject *py_import;
py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
if (!py_import)
goto bad;
#endif
if (from_list)
list = from_list;
else {
empty_list = PyList_New(0);
if (!empty_list)
goto bad;
list = empty_list;
}
global_dict = PyModule_GetDict(__pyx_m);
if (!global_dict)
goto bad;
empty_dict = PyDict_New();
if (!empty_dict)
goto bad;
{
#if PY_MAJOR_VERSION >= 3
if (level == -1) {
if (strchr(__Pyx_MODULE_NAME, '.')) {
module = PyImport_ImportModuleLevelObject(
name, global_dict, empty_dict, list, 1);
if (!module) {
if (!PyErr_ExceptionMatches(PyExc_ImportError))
goto bad;
PyErr_Clear();
}
}
level = 0;
}
#endif
if (!module) {
#if PY_MAJOR_VERSION < 3
PyObject *py_level = PyInt_FromLong(level);
if (!py_level)
goto bad;
module = PyObject_CallFunctionObjArgs(py_import,
name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
Py_DECREF(py_level);
#else
module = PyImport_ImportModuleLevelObject(
name, global_dict, empty_dict, list, level);
#endif
}
}
bad:
#if PY_MAJOR_VERSION < 3
Py_XDECREF(py_import);
#endif
Py_XDECREF(empty_list);
Py_XDECREF(empty_dict);
return module;
}
/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
if (op1 == op2) {
Py_RETURN_FALSE;
}
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_CheckExact(op1))) {
const long b = intval;
long a = PyInt_AS_LONG(op1);
if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
}
#endif
#if CYTHON_USE_PYLONG_INTERNALS
if (likely(PyLong_CheckExact(op1))) {
int unequal;
unsigned long uintval;
Py_ssize_t size = Py_SIZE(op1);
const digit* digits = ((PyLongObject*)op1)->ob_digit;
if (intval == 0) {
if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
} else if (intval < 0) {
if (size >= 0)
Py_RETURN_TRUE;
intval = -intval;
size = -size;
} else {
if (size <= 0)
Py_RETURN_TRUE;
}
uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
if (uintval >> (PyLong_SHIFT * 4)) {
unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
} else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
if (uintval >> (PyLong_SHIFT * 3)) {
unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
} else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
if (uintval >> (PyLong_SHIFT * 2)) {
unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
} else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
if (uintval >> (PyLong_SHIFT * 1)) {
unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
} else
#endif
unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
}
#endif
if (PyFloat_CheckExact(op1)) {
const long b = intval;
double a = PyFloat_AS_DOUBLE(op1);
if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
}
return (
PyObject_RichCompare(op1, op2, Py_NE));
}
/* bytes_index */
static CYTHON_INLINE char __Pyx_PyBytes_GetItemInt(PyObject* bytes, Py_ssize_t index, int check_bounds) {
if (index < 0)
index += PyBytes_GET_SIZE(bytes);
if (check_bounds) {
Py_ssize_t size = PyBytes_GET_SIZE(bytes);
if (unlikely(!__Pyx_is_valid_index(index, size))) {
PyErr_SetString(PyExc_IndexError, "string index out of range");
return (char) -1;
}
}
return PyBytes_AS_STRING(bytes)[index];
}
/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
PyErr_Format(PyExc_ImportError,
#if PY_MAJOR_VERSION < 3
"cannot import name %.230s", PyString_AS_STRING(name));
#else
"cannot import name %S", name);
#endif
}
return value;
}
/* CallNextTpTraverse */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
PyTypeObject* type = Py_TYPE(obj);
while (type && type->tp_traverse != current_tp_traverse)
type = type->tp_base;
while (type && type->tp_traverse == current_tp_traverse)
type = type->tp_base;
if (type && type->tp_traverse)
return type->tp_traverse(obj, v, a);
return 0;
}
/* CallNextTpClear */
static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
PyTypeObject* type = Py_TYPE(obj);
while (type && type->tp_clear != current_tp_clear)
type = type->tp_base;
while (type && type->tp_clear == current_tp_clear)
type = type->tp_base;
if (type && type->tp_clear)
type->tp_clear(obj);
}
/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
"'%.50s' object has no attribute '%U'",
tp->tp_name, attr_name);
#else
"'%.50s' object has no attribute '%.400s'",
tp->tp_name, PyString_AS_STRING(attr_name));
#endif
return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
PyObject *descr;
PyTypeObject *tp = Py_TYPE(obj);
if (unlikely(!PyString_Check(attr_name))) {
return PyObject_GenericGetAttr(obj, attr_name);
}
assert(!tp->tp_dictoffset);
descr = _PyType_Lookup(tp, attr_name);
if (unlikely(!descr)) {
return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
}
Py_INCREF(descr);
#if PY_MAJOR_VERSION < 3
if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
#endif
{
descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
if (unlikely(f)) {
PyObject *res = f(descr, obj, (PyObject *)tp);
Py_DECREF(descr);
return res;
}
}
return descr;
}
#endif
/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
return PyObject_GenericGetAttr(obj, attr_name);
}
return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif
/* SetVTable */
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
if (!ob)
goto bad;
if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
goto bad;
Py_DECREF(ob);
return 0;
bad:
Py_XDECREF(ob);
return -1;
}
/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
int ret;
PyObject *name_attr;
name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
if (likely(name_attr)) {
ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
} else {
ret = -1;
}
if (unlikely(ret < 0)) {
PyErr_Clear();
ret = 0;
}
Py_XDECREF(name_attr);
return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
int ret = 0;
PyObject *object_reduce = NULL;
PyObject *object_reduce_ex = NULL;
PyObject *reduce = NULL;
PyObject *reduce_ex = NULL;
PyObject *reduce_cython = NULL;
PyObject *setstate = NULL;
PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
#else
if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#else
object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#endif
reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#else
object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#endif
reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
if (!setstate) PyErr_Clear();
if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
}
PyType_Modified((PyTypeObject*)type_obj);
}
}
goto GOOD;
BAD:
if (!PyErr_Occurred())
PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
ret = -1;
GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
Py_XDECREF(object_reduce);
Py_XDECREF(object_reduce_ex);
#endif
Py_XDECREF(reduce);
Py_XDECREF(reduce_ex);
Py_XDECREF(reduce_cython);
Py_XDECREF(setstate);
Py_XDECREF(setstate_cython);
return ret;
}
/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
PyObject *result = 0;
char warning[200];
Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
PyObject *py_basicsize;
#endif
result = PyObject_GetAttrString(module, class_name);
if (!result)
goto bad;
if (!PyType_Check(result)) {
PyErr_Format(PyExc_TypeError,
"%.200s.%.200s is not a type object",
module_name, class_name);
goto bad;
}
#ifndef Py_LIMITED_API
basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
if (!py_basicsize)
goto bad;
basicsize = PyLong_AsSsize_t(py_basicsize);
Py_DECREF(py_basicsize);
py_basicsize = 0;
if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
goto bad;
#endif
if ((size_t)basicsize < size) {
PyErr_Format(PyExc_ValueError,
"%.200s.%.200s size changed, may indicate binary incompatibility. "
"Expected %zd from C header, got %zd from PyObject",
module_name, class_name, size, basicsize);
goto bad;
}
if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
PyErr_Format(PyExc_ValueError,
"%.200s.%.200s size changed, may indicate binary incompatibility. "
"Expected %zd from C header, got %zd from PyObject",
module_name, class_name, size, basicsize);
goto bad;
}
else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
PyOS_snprintf(warning, sizeof(warning),
"%s.%s size changed, may indicate binary incompatibility. "
"Expected %zd from C header, got %zd from PyObject",
module_name, class_name, size, basicsize);
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
}
return (PyTypeObject *)result;
bad:
Py_XDECREF(result);
return NULL;
}
#endif
/* ClassMethod */
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
return PyClassMethod_New(method);
}
#else
#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
if (PyMethodDescr_Check(method))
#else
static PyTypeObject *methoddescr_type = NULL;
if (methoddescr_type == NULL) {
PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
if (!meth) return NULL;
methoddescr_type = Py_TYPE(meth);
Py_DECREF(meth);
}
if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
{
PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
#if PY_VERSION_HEX < 0x03020000
PyTypeObject *d_type = descr->d_type;
#else
PyTypeObject *d_type = descr->d_common.d_type;
#endif
return PyDescr_NewClassMethod(d_type, descr->d_method);
}
#endif
else if (PyMethod_Check(method)) {
return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
}
else if (PyCFunction_Check(method)) {
return PyClassMethod_New(method);
}
#ifdef __Pyx_CyFunction_USED
else if (__Pyx_CyFunction_Check(method)) {
return PyClassMethod_New(method);
}
#endif
PyErr_SetString(PyExc_TypeError,
"Class-level classmethod() can only be called on "
"a method_descriptor or instance method.");
return NULL;
}
/* GetNameInClass */
static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
PyObject *result;
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
return NULL;
__Pyx_PyErr_Clear();
__Pyx_GetModuleGlobalNameUncached(result, name);
return result;
}
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
PyObject *result;
result = __Pyx_PyObject_GetAttrStr(nmspace, name);
if (!result) {
result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
}
return result;
}
/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
PyObject *use_cline;
PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
PyObject **cython_runtime_dict;
#endif
if (unlikely(!__pyx_cython_runtime)) {
return c_line;
}
__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
if (likely(cython_runtime_dict)) {
__PYX_PY_DICT_LOOKUP_IF_MODIFIED(
use_cline, *cython_runtime_dict,
__Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
} else
#endif
{
PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
if (use_cline_obj) {
use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
Py_DECREF(use_cline_obj);
} else {
PyErr_Clear();
use_cline = NULL;
}
}
if (!use_cline) {
c_line = 0;
PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
}
else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
c_line = 0;
}
__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
return c_line;
}
#endif
/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
start = mid + 1;
} else {
return mid;
}
}
if (code_line <= entries[mid].code_line) {
return mid;
} else {
return mid + 1;
}
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
PyCodeObject* code_object;
int pos;
if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
return NULL;
}
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
return NULL;
}
code_object = __pyx_code_cache.entries[pos].code_object;
Py_INCREF(code_object);
return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
int pos, i;
__Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
if (unlikely(!code_line)) {
return;
}
if (unlikely(!entries)) {
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
if (likely(entries)) {
__pyx_code_cache.entries = entries;
__pyx_code_cache.max_count = 64;
__pyx_code_cache.count = 1;
entries[0].code_line = code_line;
entries[0].code_object = code_object;
Py_INCREF(code_object);
}
return;
}
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
PyCodeObject* tmp = entries[pos].code_object;
entries[pos].code_object = code_object;
Py_DECREF(tmp);
return;
}
if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
int new_max = __pyx_code_cache.max_count + 64;
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
__pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
if (unlikely(!entries)) {
return;
}
__pyx_code_cache.entries = entries;
__pyx_code_cache.max_count = new_max;
}
for (i=__pyx_code_cache.count; i>pos; i--) {
entries[i] = entries[i-1];
}
entries[pos].code_line = code_line;
entries[pos].code_object = code_object;
__pyx_code_cache.count++;
Py_INCREF(code_object);
}
/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
const char *funcname, int c_line,
int py_line, const char *filename) {
PyCodeObject *py_code = 0;
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
#if PY_MAJOR_VERSION < 3
py_srcfile = PyString_FromString(filename);
#else
py_srcfile = PyUnicode_FromString(filename);
#endif
if (!py_srcfile) goto bad;
if (c_line) {
#if PY_MAJOR_VERSION < 3
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
#else
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
#endif
}
else {
#if PY_MAJOR_VERSION < 3
py_funcname = PyString_FromString(funcname);
#else
py_funcname = PyUnicode_FromString(funcname);
#endif
}
if (!py_funcname) goto bad;
py_code = __Pyx_PyCode_New(
0,
0,
0,
0,
0,
__pyx_empty_bytes, /*PyObject *code,*/
__pyx_empty_tuple, /*PyObject *consts,*/
__pyx_empty_tuple, /*PyObject *names,*/
__pyx_empty_tuple, /*PyObject *varnames,*/
__pyx_empty_tuple, /*PyObject *freevars,*/
__pyx_empty_tuple, /*PyObject *cellvars,*/
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *name,*/
py_line,
__pyx_empty_bytes /*PyObject *lnotab*/
);
Py_DECREF(py_srcfile);
Py_DECREF(py_funcname);
return py_code;
bad:
Py_XDECREF(py_srcfile);
Py_XDECREF(py_funcname);
return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename) {
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
PyThreadState *tstate = __Pyx_PyThreadState_Current;
if (c_line) {
c_line = __Pyx_CLineForTraceback(tstate, c_line);
}
py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
if (!py_code) {
py_code = __Pyx_CreateCodeObjectForTraceback(
funcname, c_line, py_line, filename);
if (!py_code) goto bad;
__pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
}
py_frame = PyFrame_New(
tstate, /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
__pyx_d, /*PyObject *globals,*/
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
__Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(int) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(int) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
}
} else {
if (sizeof(int) <= sizeof(long)) {
return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
}
}
{
int one = 1; int little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&value;
return _PyLong_FromByteArray(bytes, sizeof(int),
little, !is_unsigned);
}
}
/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
{\
func_type value = func_value;\
if (sizeof(target_type) < sizeof(func_type)) {\
if (unlikely(value != (func_type) (target_type) value)) {\
func_type zero = 0;\
if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
return (target_type) -1;\
if (is_unsigned && unlikely(value < zero))\
goto raise_neg_overflow;\
else\
goto raise_overflow;\
}\
}\
return (target_type) value;\
}
#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
PyObject *obj = view->obj;
if (!obj) return;
if (PyObject_CheckBuffer(obj)) {
PyBuffer_Release(view);
return;
}
if ((0)) {}
else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
view->obj = NULL;
Py_DECREF(obj);
}
#endif
/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(long) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(long) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
}
} else {
if (sizeof(long) <= sizeof(long)) {
return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
}
}
{
int one = 1; int little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&value;
return _PyLong_FromByteArray(bytes, sizeof(long),
little, !is_unsigned);
}
}
/* None */
static CYTHON_INLINE long __Pyx_pow_long(long b, long e) {
long t = b;
switch (e) {
case 3:
t *= b;
CYTHON_FALLTHROUGH;
case 2:
t *= b;
CYTHON_FALLTHROUGH;
case 1:
return t;
case 0:
return 1;
}
#if 1
if (unlikely(e<0)) return 0;
#endif
t = 1;
while (likely(e)) {
t *= (b * (e&1)) | ((~e)&1);
b *= b;
e >>= 1;
}
return t;
}
/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(Py_intptr_t) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
}
} else {
if (sizeof(Py_intptr_t) <= sizeof(long)) {
return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
}
}
{
int one = 1; int little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&value;
return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
little, !is_unsigned);
}
}
/* Declarations */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
return ::std::complex< float >(x, y);
}
#else
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
return x + y*(__pyx_t_float_complex)_Complex_I;
}
#endif
#else
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
__pyx_t_float_complex z;
z.real = x;
z.imag = y;
return z;
}
#endif
/* Arithmetic */
#if CYTHON_CCOMPLEX
#else
static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
return (a.real == b.real) && (a.imag == b.imag);
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
__pyx_t_float_complex z;
z.real = a.real + b.real;
z.imag = a.imag + b.imag;
return z;
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
__pyx_t_float_complex z;
z.real = a.real - b.real;
z.imag = a.imag - b.imag;
return z;
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
__pyx_t_float_complex z;
z.real = a.real * b.real - a.imag * b.imag;
z.imag = a.real * b.imag + a.imag * b.real;
return z;
}
#if 1
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
if (b.imag == 0) {
return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
} else if (fabsf(b.real) >= fabsf(b.imag)) {
if (b.real == 0 && b.imag == 0) {
return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
} else {
float r = b.imag / b.real;
float s = 1.0 / (b.real + b.imag * r);
return __pyx_t_float_complex_from_parts(
(a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
}
} else {
float r = b.real / b.imag;
float s = 1.0 / (b.imag + b.real * r);
return __pyx_t_float_complex_from_parts(
(a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
}
}
#else
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
if (b.imag == 0) {
return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
} else {
float denom = b.real * b.real + b.imag * b.imag;
return __pyx_t_float_complex_from_parts(
(a.real * b.real + a.imag * b.imag) / denom,
(a.imag * b.real - a.real * b.imag) / denom);
}
}
#endif
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
__pyx_t_float_complex z;
z.real = -a.real;
z.imag = -a.imag;
return z;
}
static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
return (a.real == 0) && (a.imag == 0);
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
__pyx_t_float_complex z;
z.real = a.real;
z.imag = -a.imag;
return z;
}
#if 1
static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
#if !defined(HAVE_HYPOT) || defined(_MSC_VER)
return sqrtf(z.real*z.real + z.imag*z.imag);
#else
return hypotf(z.real, z.imag);
#endif
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
__pyx_t_float_complex z;
float r, lnr, theta, z_r, z_theta;
if (b.imag == 0 && b.real == (int)b.real) {
if (b.real < 0) {
float denom = a.real * a.real + a.imag * a.imag;
a.real = a.real / denom;
a.imag = -a.imag / denom;
b.real = -b.real;
}
switch ((int)b.real) {
case 0:
z.real = 1;
z.imag = 0;
return z;
case 1:
return a;
case 2:
z = __Pyx_c_prod_float(a, a);
return __Pyx_c_prod_float(a, a);
case 3:
z = __Pyx_c_prod_float(a, a);
return __Pyx_c_prod_float(z, a);
case 4:
z = __Pyx_c_prod_float(a, a);
return __Pyx_c_prod_float(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
} else if (b.imag == 0) {
z.real = powf(a.real, b.real);
z.imag = 0;
return z;
} else if (a.real > 0) {
r = a.real;
theta = 0;
} else {
r = -a.real;
theta = atan2f(0, -1);
}
} else {
r = __Pyx_c_abs_float(a);
theta = atan2f(a.imag, a.real);
}
lnr = logf(r);
z_r = expf(lnr * b.real - theta * b.imag);
z_theta = theta * b.real + lnr * b.imag;
z.real = z_r * cosf(z_theta);
z.imag = z_r * sinf(z_theta);
return z;
}
#endif
#endif
/* Declarations */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
return ::std::complex< double >(x, y);
}
#else
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
return x + y*(__pyx_t_double_complex)_Complex_I;
}
#endif
#else
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
__pyx_t_double_complex z;
z.real = x;
z.imag = y;
return z;
}
#endif
/* Arithmetic */
#if CYTHON_CCOMPLEX
#else
static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
return (a.real == b.real) && (a.imag == b.imag);
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
__pyx_t_double_complex z;
z.real = a.real + b.real;
z.imag = a.imag + b.imag;
return z;
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
__pyx_t_double_complex z;
z.real = a.real - b.real;
z.imag = a.imag - b.imag;
return z;
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
__pyx_t_double_complex z;
z.real = a.real * b.real - a.imag * b.imag;
z.imag = a.real * b.imag + a.imag * b.real;
return z;
}
#if 1
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
if (b.imag == 0) {
return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
} else if (fabs(b.real) >= fabs(b.imag)) {
if (b.real == 0 && b.imag == 0) {
return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
} else {
double r = b.imag / b.real;
double s = 1.0 / (b.real + b.imag * r);
return __pyx_t_double_complex_from_parts(
(a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
}
} else {
double r = b.real / b.imag;
double s = 1.0 / (b.imag + b.real * r);
return __pyx_t_double_complex_from_parts(
(a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
}
}
#else
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
if (b.imag == 0) {
return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
} else {
double denom = b.real * b.real + b.imag * b.imag;
return __pyx_t_double_complex_from_parts(
(a.real * b.real + a.imag * b.imag) / denom,
(a.imag * b.real - a.real * b.imag) / denom);
}
}
#endif
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
__pyx_t_double_complex z;
z.real = -a.real;
z.imag = -a.imag;
return z;
}
static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
return (a.real == 0) && (a.imag == 0);
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
__pyx_t_double_complex z;
z.real = a.real;
z.imag = -a.imag;
return z;
}
#if 1
static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
#if !defined(HAVE_HYPOT) || defined(_MSC_VER)
return sqrt(z.real*z.real + z.imag*z.imag);
#else
return hypot(z.real, z.imag);
#endif
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
__pyx_t_double_complex z;
double r, lnr, theta, z_r, z_theta;
if (b.imag == 0 && b.real == (int)b.real) {
if (b.real < 0) {
double denom = a.real * a.real + a.imag * a.imag;
a.real = a.real / denom;
a.imag = -a.imag / denom;
b.real = -b.real;
}
switch ((int)b.real) {
case 0:
z.real = 1;
z.imag = 0;
return z;
case 1:
return a;
case 2:
z = __Pyx_c_prod_double(a, a);
return __Pyx_c_prod_double(a, a);
case 3:
z = __Pyx_c_prod_double(a, a);
return __Pyx_c_prod_double(z, a);
case 4:
z = __Pyx_c_prod_double(a, a);
return __Pyx_c_prod_double(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
} else if (b.imag == 0) {
z.real = pow(a.real, b.real);
z.imag = 0;
return z;
} else if (a.real > 0) {
r = a.real;
theta = 0;
} else {
r = -a.real;
theta = atan2(0, -1);
}
} else {
r = __Pyx_c_abs_double(a);
theta = atan2(a.imag, a.real);
}
lnr = log(r);
z_r = exp(lnr * b.real - theta * b.imag);
z_theta = theta * b.real + lnr * b.imag;
z.real = z_r * cos(z_theta);
z.imag = z_r * sin(z_theta);
return z;
}
#endif
#endif
/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(enum NPY_TYPES) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
}
} else {
if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
}
}
{
int one = 1; int little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&value;
return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
little, !is_unsigned);
}
}
/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
if (sizeof(int) < sizeof(long)) {
__PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
} else {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
goto raise_neg_overflow;
}
return (int) val;
}
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (int) 0;
case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
case 2:
if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
}
}
break;
case 3:
if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
}
}
break;
case 4:
if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
}
}
break;
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
#else
{
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
if (unlikely(result < 0))
return (int) -1;
if (unlikely(result == 1))
goto raise_neg_overflow;
}
#endif
if (sizeof(int) <= sizeof(unsigned long)) {
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
}
} else {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (int) 0;
case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
case -2:
if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
case 2:
if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
case -3:
if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
case 3:
if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
case -4:
if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
case 4:
if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
}
#endif
if (sizeof(int) <= sizeof(long)) {
__PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
}
}
{
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
int val;
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
v = PyNumber_Long(tmp);
Py_DECREF(tmp);
}
#endif
if (likely(v)) {
int one = 1; int is_little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&val;
int ret = _PyLong_AsByteArray((PyLongObject *)v,
bytes, sizeof(val),
is_little, !is_unsigned);
Py_DECREF(v);
if (likely(!ret))
return val;
}
#endif
return (int) -1;
}
} else {
int val;
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (int) -1;
val = __Pyx_PyInt_As_int(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
"value too large to convert to int");
return (int) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to int");
return (int) -1;
}
/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
if (sizeof(long) < sizeof(long)) {
__PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
} else {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
goto raise_neg_overflow;
}
return (long) val;
}
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (long) 0;
case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
case 2:
if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
}
}
break;
case 3:
if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
}
}
break;
case 4:
if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
}
}
break;
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
#else
{
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
if (unlikely(result < 0))
return (long) -1;
if (unlikely(result == 1))
goto raise_neg_overflow;
}
#endif
if (sizeof(long) <= sizeof(unsigned long)) {
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
}
} else {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (long) 0;
case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
case -2:
if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
case 2:
if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
case -3:
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
case 3:
if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
case -4:
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
case 4:
if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
}
#endif
if (sizeof(long) <= sizeof(long)) {
__PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
}
}
{
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
v = PyNumber_Long(tmp);
Py_DECREF(tmp);
}
#endif
if (likely(v)) {
int one = 1; int is_little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&val;
int ret = _PyLong_AsByteArray((PyLongObject *)v,
bytes, sizeof(val),
is_little, !is_unsigned);
Py_DECREF(v);
if (likely(!ret))
return val;
}
#endif
return (long) -1;
}
} else {
long val;
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
"value too large to convert to long");
return (long) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to long");
return (long) -1;
}
/* CIntFromPy */
static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
if (sizeof(Py_intptr_t) < sizeof(long)) {
__PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyInt_AS_LONG(x))
} else {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
goto raise_neg_overflow;
}
return (Py_intptr_t) val;
}
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (Py_intptr_t) 0;
case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
case 2:
if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
}
}
break;
case 3:
if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
}
}
break;
case 4:
if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
}
}
break;
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
#else
{
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
if (unlikely(result < 0))
return (Py_intptr_t) -1;
if (unlikely(result == 1))
goto raise_neg_overflow;
}
#endif
if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
__PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
}
} else {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (Py_intptr_t) 0;
case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0])
case -2:
if (8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
}
}
break;
case 2:
if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
}
}
break;
case -3:
if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
}
}
break;
case 3:
if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
}
}
break;
case -4:
if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
}
}
break;
case 4:
if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
}
}
break;
}
#endif
if (sizeof(Py_intptr_t) <= sizeof(long)) {
__PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
}
}
{
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
Py_intptr_t val;
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
v = PyNumber_Long(tmp);
Py_DECREF(tmp);
}
#endif
if (likely(v)) {
int one = 1; int is_little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&val;
int ret = _PyLong_AsByteArray((PyLongObject *)v,
bytes, sizeof(val),
is_little, !is_unsigned);
Py_DECREF(v);
if (likely(!ret))
return val;
}
#endif
return (Py_intptr_t) -1;
}
} else {
Py_intptr_t val;
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (Py_intptr_t) -1;
val = __Pyx_PyInt_As_Py_intptr_t(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
"value too large to convert to Py_intptr_t");
return (Py_intptr_t) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to Py_intptr_t");
return (Py_intptr_t) -1;
}
/* CIntFromPy */
static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) {
const npy_uint8 neg_one = (npy_uint8) ((npy_uint8) 0 - (npy_uint8) 1), const_zero = (npy_uint8) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
if (sizeof(npy_uint8) < sizeof(long)) {
__PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG(x))
} else {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
goto raise_neg_overflow;
}
return (npy_uint8) val;
}
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (npy_uint8) 0;
case 1: __PYX_VERIFY_RETURN_INT(npy_uint8, digit, digits[0])
case 2:
if (8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(npy_uint8) >= 2 * PyLong_SHIFT) {
return (npy_uint8) (((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
}
}
break;
case 3:
if (8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(npy_uint8) >= 3 * PyLong_SHIFT) {
return (npy_uint8) (((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
}
}
break;
case 4:
if (8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(npy_uint8) >= 4 * PyLong_SHIFT) {
return (npy_uint8) (((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
}
}
break;
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
#else
{
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
if (unlikely(result < 0))
return (npy_uint8) -1;
if (unlikely(result == 1))
goto raise_neg_overflow;
}
#endif
if (sizeof(npy_uint8) <= sizeof(unsigned long)) {
__PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
}
} else {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (npy_uint8) 0;
case -1: __PYX_VERIFY_RETURN_INT(npy_uint8, sdigit, (sdigit) (-(sdigit)digits[0]))
case 1: __PYX_VERIFY_RETURN_INT(npy_uint8, digit, +digits[0])
case -2:
if (8 * sizeof(npy_uint8) - 1 > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) {
return (npy_uint8) (((npy_uint8)-1)*(((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
}
}
break;
case 2:
if (8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) {
return (npy_uint8) ((((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
}
}
break;
case -3:
if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) {
return (npy_uint8) (((npy_uint8)-1)*(((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
}
}
break;
case 3:
if (8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) {
return (npy_uint8) ((((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
}
}
break;
case -4:
if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(npy_uint8) - 1 > 4 * PyLong_SHIFT) {
return (npy_uint8) (((npy_uint8)-1)*(((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
}
}
break;
case 4:
if (8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(npy_uint8) - 1 > 4 * PyLong_SHIFT) {
return (npy_uint8) ((((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
}
}
break;
}
#endif
if (sizeof(npy_uint8) <= sizeof(long)) {
__PYX_VERIFY_RETURN_INT_EXC(npy_uint8, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(npy_uint8, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
}
}
{
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
npy_uint8 val;
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
v = PyNumber_Long(tmp);
Py_DECREF(tmp);
}
#endif
if (likely(v)) {
int one = 1; int is_little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&val;
int ret = _PyLong_AsByteArray((PyLongObject *)v,
bytes, sizeof(val),
is_little, !is_unsigned);
Py_DECREF(v);
if (likely(!ret))
return val;
}
#endif
return (npy_uint8) -1;
}
} else {
npy_uint8 val;
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (npy_uint8) -1;
val = __Pyx_PyInt_As_npy_uint8(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
"value too large to convert to npy_uint8");
return (npy_uint8) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to npy_uint8");
return (npy_uint8) -1;
}
/* CIntFromPy */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
if (sizeof(char) < sizeof(long)) {
__PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
} else {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
goto raise_neg_overflow;
}
return (char) val;
}
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (char) 0;
case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
case 2:
if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
}
}
break;
case 3:
if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
}
}
break;
case 4:
if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
}
}
break;
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
#else
{
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
if (unlikely(result < 0))
return (char) -1;
if (unlikely(result == 1))
goto raise_neg_overflow;
}
#endif
if (sizeof(char) <= sizeof(unsigned long)) {
__PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
}
} else {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (char) 0;
case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
case -2:
if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
}
}
break;
case 2:
if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
}
}
break;
case -3:
if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
}
}
break;
case 3:
if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
}
}
break;
case -4:
if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
}
}
break;
case 4:
if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
}
}
break;
}
#endif
if (sizeof(char) <= sizeof(long)) {
__PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
}
}
{
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
char val;
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
v = PyNumber_Long(tmp);
Py_DECREF(tmp);
}
#endif
if (likely(v)) {
int one = 1; int is_little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&val;
int ret = _PyLong_AsByteArray((PyLongObject *)v,
bytes, sizeof(val),
is_little, !is_unsigned);
Py_DECREF(v);
if (likely(!ret))
return val;
}
#endif
return (char) -1;
}
} else {
char val;
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (char) -1;
val = __Pyx_PyInt_As_char(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
"value too large to convert to char");
return (char) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to char");
return (char) -1;
}
/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
while (a) {
a = a->tp_base;
if (a == b)
return 1;
}
return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
PyObject *mro;
if (a == b) return 1;
mro = a->tp_mro;
if (likely(mro)) {
Py_ssize_t i, n;
n = PyTuple_GET_SIZE(mro);
for (i = 0; i < n; i++) {
if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
return 1;
}
return 0;
}
return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
PyObject *exception, *value, *tb;
int res;
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ErrFetch(&exception, &value, &tb);
res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
if (unlikely(res == -1)) {
PyErr_WriteUnraisable(err);
res = 0;
}
if (!res) {
res = PyObject_IsSubclass(err, exc_type2);
if (unlikely(res == -1)) {
PyErr_WriteUnraisable(err);
res = 0;
}
}
__Pyx_ErrRestore(exception, value, tb);
return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
if (!res) {
res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
}
return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
Py_ssize_t i, n;
assert(PyExceptionClass_Check(exc_type));
n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
for (i=0; ip) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
} else if (t->intern) {
*t->p = PyString_InternFromString(t->s);
} else {
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
}
#else
if (t->is_unicode | t->is_str) {
if (t->intern) {
*t->p = PyUnicode_InternFromString(t->s);
} else if (t->encoding) {
*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
} else {
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
}
} else {
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
}
#endif
if (!*t->p)
return -1;
if (PyObject_Hash(*t->p) == -1)
return -1;
++t;
}
return 0;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
Py_ssize_t ignore;
return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
char* defenc_c;
PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
if (!defenc) return NULL;
defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
{
char* end = defenc_c + PyBytes_GET_SIZE(defenc);
char* c;
for (c = defenc_c; c < end; c++) {
if ((unsigned char) (*c) >= 128) {
PyUnicode_AsASCIIString(o);
return NULL;
}
}
}
#endif
*length = PyBytes_GET_SIZE(defenc);
return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
if (likely(PyUnicode_IS_ASCII(o))) {
*length = PyUnicode_GET_LENGTH(o);
return PyUnicode_AsUTF8(o);
} else {
PyUnicode_AsASCIIString(o);
return NULL;
}
#else
return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
#endif
PyUnicode_Check(o)) {
return __Pyx_PyUnicode_AsStringAndSize(o, length);
} else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
} else
#endif
{
char* result;
int r = PyBytes_AsStringAndSize(o, &result, length);
if (unlikely(r < 0)) {
return NULL;
} else {
return result;
}
}
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
int is_true = x == Py_True;
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
int retval;
if (unlikely(!x)) return -1;
retval = __Pyx_PyObject_IsTrue(x);
Py_DECREF(x);
return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
if (PyLong_Check(result)) {
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
"__int__ returned non-int (type %.200s). "
"The ability to return an instance of a strict subclass of int "
"is deprecated, and may be removed in a future version of Python.",
Py_TYPE(result)->tp_name)) {
Py_DECREF(result);
return NULL;
}
return result;
}
#endif
PyErr_Format(PyExc_TypeError,
"__%.4s__ returned non-%.4s (type %.200s)",
type_name, type_name, Py_TYPE(result)->tp_name);
Py_DECREF(result);
return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
if (likely(PyLong_Check(x)))
#endif
return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = m->nb_int(x);
}
else if (m && m->nb_long) {
name = "long";
res = m->nb_long(x);
}
#else
if (likely(m && m->nb_int)) {
name = "int";
res = m->nb_int(x);
}
#endif
#else
if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
res = PyNumber_Int(x);
}
#endif
if (likely(res)) {
#if PY_MAJOR_VERSION < 3
if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
if (unlikely(!PyLong_CheckExact(res))) {
#endif
return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
}
}
else if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError,
"an integer is required");
}
return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
Py_ssize_t ival;
PyObject *x;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_CheckExact(b))) {
if (sizeof(Py_ssize_t) >= sizeof(long))
return PyInt_AS_LONG(b);
else
return PyInt_AsSsize_t(b);
}
#endif
if (likely(PyLong_CheckExact(b))) {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)b)->ob_digit;
const Py_ssize_t size = Py_SIZE(b);
if (likely(__Pyx_sst_abs(size) <= 1)) {
ival = likely(size) ? digits[0] : 0;
if (size == -1) ival = -ival;
return ival;
} else {
switch (size) {
case 2:
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
case -2:
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
case 3:
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
case -3:
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
case 4:
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
case -4:
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
}
}
#endif
return PyLong_AsSsize_t(b);
}
x = PyNumber_Index(b);
if (!x) return -1;
ival = PyInt_AsSsize_t(x);
Py_DECREF(x);
return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
return PyInt_FromSize_t(ival);
}
#endif /* Py_PYTHON_H */
HTSeq-0.11.2/python3/src/AutoPyObjPtr.i 0000664 0000000 0000000 00000003436 13415006247 017436 0 ustar root root 0000000 0000000 /*
This file defines a smart pointer "AutoAutoPyObjPtr" for PyObjects that deals
with Python reference counting. This allows to store Python objects in a C++
container.
Typemaps are provided to transform to standard Python objects.
Simon Anders, 2009-08-28
*/
%{
struct AutoPyObjPtr {
PyObject * obj;
AutoPyObjPtr( PyObject * o = Py_None );
AutoPyObjPtr( const AutoPyObjPtr & op );
AutoPyObjPtr & operator= ( const AutoPyObjPtr & po );
bool operator== ( const AutoPyObjPtr & po ) const;
~AutoPyObjPtr( );
#ifdef AUTOPYOBJPTR_EXTRAOPS
AutoPyObjPtr & operator+=( const AutoPyObjPtr & po );
AutoPyObjPtr & operator+( const AutoPyObjPtr & po );
#endif
};
AutoPyObjPtr::AutoPyObjPtr( PyObject * o )
: obj( o )
{
Py_XINCREF( obj );
}
AutoPyObjPtr::AutoPyObjPtr( const AutoPyObjPtr & op )
: obj( op.obj )
{
Py_XINCREF( obj );
}
AutoPyObjPtr & AutoPyObjPtr::operator= ( const AutoPyObjPtr & po )
{
Py_XDECREF( obj );
obj = po.obj;
Py_XINCREF( obj );
return *this;
}
bool AutoPyObjPtr::operator== ( const AutoPyObjPtr & po ) const
{
int res = PyObject_RichCompareBool( obj, po.obj, Py_EQ );
assert( res == 0 || res == 1 );
return res;
}
AutoPyObjPtr::~AutoPyObjPtr( )
{
Py_XDECREF( obj );
}
#ifdef AUTOPYOBJPTR_EXTRAOPS
class type_error_non_arith {};
AutoPyObjPtr & AutoPyObjPtr::operator+= ( const AutoPyObjPtr & po )
{ throw type_error_non_arith(); }
AutoPyObjPtr & AutoPyObjPtr::operator+ ( const AutoPyObjPtr & po )
{ throw type_error_non_arith(); }
#endif
%}
%typemap(in) AutoPyObjPtr {
$1 = AutoPyObjPtr( $input );
}
%typemap(out) AutoPyObjPtr {
Py_XINCREF( $1.obj );
$result = $1.obj;
}
HTSeq-0.11.2/python3/src/StepVector.i 0000664 0000000 0000000 00000033431 13415006247 017170 0 ustar root root 0000000 0000000 %module StepVector
%include "exception.i"
%{ #define AUTOPYOBJPTR_EXTRAOPS %}
%include "AutoPyObjPtr.i"
%{
#include "step_vector.h"
class pystyle_stopiteration {};
template< class T >
class step_vector_pystyle_iterator
{
typename step_vector::const_iterator current;
typename step_vector::const_iterator last;
public:
step_vector_pystyle_iterator( typename step_vector::const_iterator first,
typename step_vector::const_iterator last_ );
std::pair< long int, T > next( );
step_vector_pystyle_iterator * __iter__( );
};
template< class T >
class step_vector_for_python : public step_vector
{
public:
step_vector_pystyle_iterator get_all_values_pystyle( ) const;
step_vector_pystyle_iterator get_values_pystyle( long int from ) const;
int num_values( ) const;
};
template< class T >
step_vector_pystyle_iterator::step_vector_pystyle_iterator(
typename step_vector::const_iterator first,
typename step_vector