$ space_tracer --traced Bio.Align.PairwiseAligner.align scratch2.py
def align(self, seqA, seqB, strand="+"): | seqA = 'GATTACA' | seqB = 'GTCGACG' | strand = '+'
"""Return the alignments of two sequences using PairwiseAligner.""" |
if isinstance(seqA, (Seq, MutableSeq)): |
sA = bytes(seqA) |
else: |
sA = seqA | sA = 'GATTACA'
if strand == "+": |
sB = seqB | sB = 'GTCGACG'
else: # strand == "-": |
sB = reverse_complement(seqB) |
if isinstance(sB, (Seq, MutableSeq)): |
sB = bytes(sB) |
score, paths = _aligners.PairwiseAligner.align(self, sA, sB, strand) | (score, paths) = (-1.0, <Path generator object at 0x7f0005cf1f30>)
alignments = PairwiseAlignments(seqA, seqB, score, paths) |
return alignments | return <Bio.Align.PairwiseAlignments object at 0x7f00094b5070>
$ space_tracer --traced Bio.Align._aligners scratch2.py
-------------------------------------------------------------------------------------------------------------------------------- |
Traceback (most recent call last): |
File "scratch2.py", line 2, in <module> |
from Bio import Align |
File "<frozen importlib._bootstrap>", line 991, in _find_and_load |
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked |
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked |
File "/home/don/git/MiCall/venv_micall/lib/python3.8/site-packages/space_tracer/module_importers.py", line 181, in exec_module |
return original_loader.exec_module(module) |
File "/home/don/git/MiCall/venv_micall/lib/python3.8/site-packages/Bio/Align/__init__.py", line 18, in <module> |
from Bio.Align import _aligners |
File "<frozen importlib._bootstrap>", line 991, in _find_and_load |
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked |
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked |
File "/home/don/git/MiCall/venv_micall/lib/python3.8/site-packages/space_tracer/module_importers.py", line 155, in exec_module |
source_code = source_file.read() |
File "/usr/lib/python3.8/codecs.py", line 322, in decode |
(result, consumed) = self._buffer_decode(data, self.errors, final) |
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 24: invalid continuation byte |
-------------------------------------------------------------------------------------------------------------------------------- |
$
What happened
The first tracing call worked fine, but when I tried to trace the Bio.Align._aligners module, it failed.
What I wanted to happen
See what's happening in the _aligners module, or give a more understandable error.
Analysis
When I look in my virtual environment, it looks like that module is some kind of compiled C code, not Python. I guess we could use an error like, "Unable to trace Bio.Align._aligners module."
What I did
Align genetic sequence data with BioPython, and tried to trace it. Here's the Python code:
I tried to trace it:
What happened
The first tracing call worked fine, but when I tried to trace the
Bio.Align._aligners
module, it failed.What I wanted to happen
See what's happening in the
_aligners
module, or give a more understandable error.Analysis
When I look in my virtual environment, it looks like that module is some kind of compiled C code, not Python. I guess we could use an error like, "Unable to trace Bio.Align._aligners module."
My environment
Describe the versions of everything you were using: