Skip to content

samtools quickcheck fails to detect missing EOF in a bam file #1884

Description

@bsigurjonsson

Running samtools 1.17
OS: Darwin 22.4.0
arm64

gcc --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Steps to reproduce

  1. DL a bam & bai file from http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeUwRepliSeq/ (wgEncodeUwRepliSeqBg02esG1bAlnRep1.bam)
  2. ls -lh to see it is 64K size
  3. Truncate it: truncate -s 60K wgEncodeUwRepliSeqBg02esG1bAlnRep1.bam
  4. samtools quickcheck wgEncodeUwRepliSeqBg02esG1bAlnRep1.bam and there is no error
  5. samtools view wgEncodeUwRepliSeqBg02esG1bAlnRep1.bam | wc -l and you get [W::bam_hdr_read] EOF marker is absent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions