Skip to content

pysam output issue #199

@voyn

Description

@voyn

There seems to be some issue in the 0.6.12 related to pysam, I've copied the output of the small test below. The same issue was observed both in the docker version and when building from source.

The 0.5.37 version on PyPI is working. Also curious what processing rates to expect? I'm seeing ~12reads/sec rate on a 64 core 256Gb machine. Thanks!

(venv) root@31bf6990162e:/home/ccs# longbow annotate -m mas_15+sc_10x5p mas15_test_input.bam | tee ann.bam | longbow filter | longbow segment | longbow extract -o filter_passed.bam
[INFO 2023-03-28 16:43:07  segment] Invoked via: longbow segment
[INFO 2023-03-28 16:43:07   filter] Invoked via: longbow filter
[INFO 2023-03-28 16:43:07  segment] Running with 5 worker subprocess(es)
[INFO 2023-03-28 16:43:07  segment] Using simple splitting mode.
Traceback (most recent call last):
  File "/longbow/venv/bin/longbow", line 11, in <module>
Traceback (most recent call last):
  File "/longbow/venv/bin/longbow", line 11, in <module>
    load_entry_point('maslongbow', 'console_scripts', 'longbow')()
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1130, in __call__
    load_entry_point('maslongbow', 'console_scripts', 'longbow')()
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1055, in main
    return self.main(*args, **kwargs)
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1657, in invoke
    rv = self.invoke(ctx)
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 760, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/longbow/src/longbow/commands/filter.py", line 93, in main
    lb_model = bam_utils.load_model(model, input_bam)
  File "/longbow/src/longbow/utils/bam_utils.py", line 235, in load_model
    return __callback(*args, **kwargs)
  File "/longbow/src/longbow/commands/segment.py", line 108, in main
    with pysam.AlignmentFile(input_bam_path, "rb", check_sq=False, require_index=False) as bam_file:
  File "pysam/libcalignmentfile.pyx", line 751, in pysam.libcalignmentfile.AlignmentFile.__cinit__
    lb_model = bam_utils.load_model(model, input_bam)
  File "/longbow/src/longbow/utils/bam_utils.py", line 235, in load_model
    with pysam.AlignmentFile(input_bam_path, "rb", check_sq=False, require_index=False) as bam_file:
  File "pysam/libcalignmentfile.pyx", line 751, in pysam.libcalignmentfile.AlignmentFile.__cinit__
  File "pysam/libcalignmentfile.pyx", line 950, in pysam.libcalignmentfile.AlignmentFile._open
  File "pysam/libcalignmentfile.pyx", line 950, in pysam.libcalignmentfile.AlignmentFile._open
FileNotFoundError: [Errno 2] could not open alignment file `<stdin>`: No such file or directory
FileNotFoundError: [Errno 2] could not open alignment file `<stdin>`: No such file or directory
[INFO 2023-03-28 16:43:07 annotate] Invoked via: longbow annotate -m mas_15+sc_10x5p mas15_test_input.bam
[INFO 2023-03-28 16:43:07 annotate] Running with 5 worker subprocess(es)
[INFO 2023-03-28 16:43:07  extract] Invoked via: longbow extract -o filter_passed.bam
[INFO 2023-03-28 16:43:07  extract] Writing extracted read segments to: filter_passed.bam
[INFO 2023-03-28 16:43:07  extract] Including 2 flanking bases.
Traceback (most recent call last):
  File "/longbow/venv/bin/longbow", line 11, in <module>
    load_entry_point('maslongbow', 'console_scripts', 'longbow')()
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/longbow/venv/lib/python3.7/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/longbow/src/longbow/commands/extract.py", line 145, in main
    lb_model = bam_utils.load_model(model, input_bam)
  File "/longbow/src/longbow/utils/bam_utils.py", line 235, in load_model
    with pysam.AlignmentFile(input_bam_path, "rb", check_sq=False, require_index=False) as bam_file:
  File "pysam/libcalignmentfile.pyx", line 751, in pysam.libcalignmentfile.AlignmentFile.__cinit__
  File "pysam/libcalignmentfile.pyx", line 950, in pysam.libcalignmentfile.AlignmentFile._open
FileNotFoundError: [Errno 2] could not open alignment file `<stdin>`: No such file or directory
[INFO 2023-03-28 16:43:09 annotate] Using mas_15+sc_10x5p: 15-element MAS-ISO-seq array, single-cell 10x 5' kit
[INFO 2023-03-28 16:43:09 annotate] Annotating 8 reads
Progress:  38%|█████████████████████████████████████████████████▏                                                                                 | 3/8 [00:03<00:05,  1.15s/ read]
Process Process-7:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/local/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/longbow/src/longbow/commands/annotate.py", line 277, in _write_thread_fn
    bam_utils.write_annotated_read(read, ppath, is_rc, logp, lb_model, out_bam_file)
  File "/longbow/src/longbow/utils/bam_utils.py", line 380, in write_annotated_read
    out_bam_file.write(read)
  File "pysam/libcalignmentfile.pyx", line 1709, in pysam.libcalignmentfile.AlignmentFile.write
  File "pysam/libcalignmentfile.pyx", line 1741, in pysam.libcalignmentfile.AlignmentFile.write
OSError: sam_write1 failed with error code -1
[INFO 2023-03-28 16:43:15 annotate] Annotated 3 reads with 324 total sections.
[INFO 2023-03-28 16:43:15 annotate] Done. Elapsed time: 7.80s. Overall processing rate: 0.38 reads/s.
(venv) root@31bf6990162e:/home/ccs#

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions