question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OSError: no BGZF EOF marker; file may be truncated

See original GitHub issue

I have seen an issue with same names. However, I think this may be a new problem.

Using output of CellRanger 3.1.0,I’ve successfully run velocyto (version 0.17.17) with 3 samples. But I got the error information from another sample, by code

velocyto run10x /home/Script/GTE002/ /public-supool/home/Data/genes.gtf

:

Resource usage summary:

    CPU time :                                   11146.22 sec.
    Max Memory :                                 1743 MB
    Average Memory :                             1185.21 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              3
    Max Threads :                                26
    Run time :                                   11186 sec.

...
2020-03-13 13:13:45,346 - DEBUG - Read first 850 million reads
2020-03-13 13:14:01,793 - DEBUG - End of file. Reset index: start scanning from initial position.
2020-03-13 13:14:01,796 - DEBUG - 16951446 reads were skipped because no apropiate cell or umi barcode was found
2020-03-13 13:14:01,797 - DEBUG - Start molecule counting!
2020-03-13 13:14:05,705 - DEBUG - Features available for chromosomes : ['1-', '1+', '10-', '10+', '11-', '11+', '12-', '12+', '13-', '13+', '14-', '14+', '15-', '15+', '16-', '16+', '17-', '17+', '18-', '18+', '19-', '19+', '2-', '2+', '20-', '20+', '21-', '21+', '22-', '22+', '3-', '3+', '4-', '4+', '5-', '5+', '6-', '6+', '7-', '7+', '8-', '8+', '9-', '9+', 'GL000191.1-', 'GL000191.1+', 'GL000192.1-', 'GL000193.1-', 'GL000194.1-', 'GL000195.1-', 'GL000201.1-', 'GL000201.1+', 'GL000204.1-', 'GL000205.1+', 'GL000209.1+', 'GL000212.1+', 'GL000213.1-', 'GL000213.1+', 'GL000215.1-', 'GL000218.1-', 'GL000219.1-', 'GL000221.1-', 'GL000222.1-', 'GL000222.1+', 'GL000223.1-', 'GL000223.1+', 'GL000228.1-', 'GL000237.1-', 'GL000242.1+', 'MT-', 'MT+', 'X-', 'X+', 'Y-', 'Y+']
2020-03-13 13:14:05,706 - DEBUG - Mask available for chromosomes : []
2020-03-13 13:14:05,706 - DEBUG - Summarizing the results of intron validation.
2020-03-13 13:14:06,408 - DEBUG - Validated 634190 introns (of which unique intervals 204042) out of 964599 total possible introns (considering each possible transcript models).
2020-03-13 13:14:06,409 - DEBUG - Reading /home/script/GTE002/outs/cellsorted_possorted_genome_bam.bam


Traceback (most recent call last):
  File "/public-supool/home/wuhaoda/anaconda2/envs/Grim3.6.8/bin/velocyto", line 8, in <module>
    sys.exit(cli())
  File "/public-supool/home/wuhaoda/anaconda2/envs/Grim3.6.8/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/public-supool/home/wuhaoda/anaconda2/envs/Grim3.6.8/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/public-supool/home/wuhaoda/anaconda2/envs/Grim3.6.8/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/public-supool/home/wuhaoda/anaconda2/envs/Grim3.6.8/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/public-supool/home/wuhaoda/anaconda2/envs/Grim3.6.8/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/public-supool/home/wuhaoda/anaconda2/envs/Grim3.6.8/lib/python3.6/site-packages/velocyto/commands/run10x.py", line 115, in run10x
    samtools_memory=samtools_memory, dump=dump, loom_numeric_dtype=dtype, verbose=verbose, additional_ca=additional_ca)
  File "/public-supool/home/wuhaoda/anaconda2/envs/Grim3.6.8/lib/python3.6/site-packages/velocyto/commands/_run.py", line 229, in _run
    results = exincounter.count(bamfile_cellsorted, multimap=multimap)  # NOTE: we would avoid some millions of if statements evaluations if we write two function count and count_with output
  File "/public-supool/home/wuhaoda/anaconda2/envs/Grim3.6.8/lib/python3.6/site-packages/velocyto/counter.py", line 756, in count
    for r in self.iter_alignments(bamfile, unique=not multimap):
  File "/public-supool/home/wuhaoda/anaconda2/envs/Grim3.6.8/lib/python3.6/site-packages/velocyto/counter.py", line 251, in iter_alignments
    fin = pysam.AlignmentFile(bamfile)  # type: pysam.AlignmentFile
  File "pysam/libcalignmentfile.pyx", line 741, in pysam.libcalignmentfile.AlignmentFile.__cinit__
  File "pysam/libcalignmentfile.pyx", line 951, in pysam.libcalignmentfile.AlignmentFile._open
  File "pysam/libchtslib.pyx", line 365, in pysam.libchtslib.HTSFile.check_truncation

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
Arinze-BioXcommented, May 9, 2022

I can confirm that I tried @bjbouman’s suggestions and it worked for me. Just ensure that the files/folders in the outs folder are those mentioned here: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/output/overview

1reaction
bjboumancommented, Apr 19, 2021

Recently I came across the same error. In my case, there were still some temporary files in the “outs” folder from previous unsuccessful runs. After deleting those files and starting with a “clean” outs folder containing only the .bam, .bai files and the folder with the barcodes, features and matrix, velocyto ran successfully.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no BGZF EOF marker; file may be truncated #106 - GitHub
Hi velocyto team, I ran 10x cell ranger count output files with the following commend. But no loom. file that supposed to be...
Read more >
How to correct BAM file EOF marker absent error - SEQanswers
Hi, I am trying to run bamUtils's splitBam program to split my bam file into read groups but getting the error: BGZF EOF...
Read more >
[Samtools-help] EOF marker is absent. The input is probably ...
That means that the bam file has a problem. It is truncated, meaning incomplete. Very big files do get corrupted occasionally. You need...
Read more >
EOF marker is absent in merged bam file - Biostars
I figured out that the the merged BAM file was truncated because of errors at SAM validation steps reporting that MAPQ should be...
Read more >
python读取bam文件&&OSError: no BGZF EOF marker; file ...
File "pysam/libchtslib.pyx", line 365, in pysam.libchtslib.HTSFile.check_truncation. OSError: no BGZF EOF marker; file may be truncated.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found