Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream read less than specified amount, expected 4, found 0 #197

Open
TinyTasy opened this issue Jan 19, 2023 · 2 comments
Open

stream read less than specified amount, expected 4, found 0 #197

TinyTasy opened this issue Jan 19, 2023 · 2 comments

Comments

@TinyTasy
Copy link

Dear Longbow team,

Thank you for your great tool! It is very helpful.

Nevertheless, I am running into some problems while using it.

I am trying to annotate a hifi.bam file with longbow annotate /path/to/hifi/.bam -o annotated.bam (thus using the default mas15 model).
However, I am always getting the error:

[INFO 2023-01-19 16:51:46 annotate] Invoked via: longbow annotate /vol/projects/agrinko/PacBio_K562_pilot_17_1_23/data/m64316_230110_175611.hifi_reads.bam -o /vol/projects/agrinko/PacBio_K562_pilot_17_1_23/data/annotated.bam
[INFO 2023-01-19 16:51:46 annotate] Running with 47 worker subprocess(es)
Traceback (most recent call last):
File "/home/agrinko/.local/bin/longbow", line 8, in
sys.exit(main_entry())
File "/home/agrinko/.local/lib/python3.7/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/home/agrinko/.local/lib/python3.7/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/agrinko/.local/lib/python3.7/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/agrinko/.local/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/agrinko/.local/lib/python3.7/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/agrinko/.local/lib/python3.7/site-packages/longbow/annotate/command.py", line 153, in main
read_count = bam_utils.load_read_count(pbi)
File "/home/agrinko/.local/lib/python3.7/site-packages/longbow/utils/bam_utils.py", line 77, in load_read_count
idx_contents = fmt.parse_stream(f)
File "/home/agrinko/.local/lib/python3.7/site-packages/construct/core.py", line 300, in parse_stream
return self._parsereport(stream, context, "(parsing)")
File "/home/agrinko/.local/lib/python3.7/site-packages/construct/core.py", line 312, in _parsereport
obj = self._parse(stream, context, path)
File "/home/agrinko/.local/lib/python3.7/site-packages/construct/core.py", line 2120, in _parse
subobj = sc._parsereport(stream, context, path)
File "/home/agrinko/.local/lib/python3.7/site-packages/construct/core.py", line 312, in _parsereport
obj = self._parse(stream, context, path)
File "/home/agrinko/.local/lib/python3.7/site-packages/construct/core.py", line 2653, in _parse
return self.subcon._parsereport(stream, context, path)
File "/home/agrinko/.local/lib/python3.7/site-packages/construct/core.py", line 312, in _parsereport
obj = self._parse(stream, context, path)
File "/home/agrinko/.local/lib/python3.7/site-packages/construct/core.py", line 2726, in _parse
obj = self.subcon._parsereport(stream, context, path)
File "/home/agrinko/.local/lib/python3.7/site-packages/construct/core.py", line 312, in _parsereport
obj = self._parse(stream, context, path)
File "/home/agrinko/.local/lib/python3.7/site-packages/construct/core.py", line 848, in _parse
return stream_read(stream, length, path)
File "/home/agrinko/.local/lib/python3.7/site-packages/construct/core.py", line 91, in stream_read
raise StreamError("stream read less than specified amount, expected %d, found %d" % (length, len(data)), path=path)
construct.core.StreamError: Error in path (parsing) -> magic
stream read less than specified amount, expected 4, found 0

Is there anything I can do here? It is my first time ever analyzing long-read data, not to speak of mas-iso-seq data.
My conda environment consists of your env.yml file and I am running the job via sbatch on Ubuntu.

I hope this is reproducible enough!

Best wishes,
Tasy

@jonn-smith
Copy link
Collaborator

Hi @TinyTasy

This looks like a problem with your bam index. Is it a valid .pbi (PacBio bam index)? A quick fix would be to rerun pbindex on your input bam to regenerate the .pbi file. I suspect after doing that it will work just fine.

@jonn-smith
Copy link
Collaborator

Alternatively, you could just move the .pbi file out of the directory containing the bam and it should run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants