Skip to content

Debug version: SAM output of CRAM file is populated with debug on pipe #328

@hzpc-joostk

Description

@hzpc-joostk

The SAM output of a CRAM file is unintentionally populated with debug lines.

  • version of sambamba
sambamba 0.6.7

This version was built with:
    LDC 1.1.1
    using DMD v2.071.2
    using LLVM 3.8.1
    bootstrapped with LDC - the LLVM D compiler (0.17.4)
  • version of samtools that did bam2cram
samtools 1.6
Using htslib 1.6
Copyright (C) 2017 Genome Research Ltd.

System version:

uname --kernel-release && cat /etc/system-release
2.6.32-696.3.1.el6.x86_64
CentOS release 6.9 (Final)
  • the command line or bash script used (feel free to shorten paths and filenames)
htsfile sampleX.aln.cram
sampleX.aln.cram:	CRAM version 3.0 compressed sequence data
sambamba view -C -h sampleX.aln.cram 2>/dev/null | less -S

Would return SAM format on stdout:

  1. the header
  2. debug lines
cram_read_container
COPIED #2
COPIED #2
COPIED #2
cram_read_container
COPIED #3
COPIED #3
COPIED #3
...
cram_read_container
COPIED #4
COPIED #4
COPIED #4
COPIED #4
COPIED #4
COPIED #5
COPIED #69
COPIED #69
COPIED #69
cram_read_container
COPIED #5
COPIED #5
COPIED #5
COPIED #5
COPIED #5
  1. alignments

Looking at stderr:

sambamba view -C -h sampleX.aln.cram 2>&1 1>/dev/null | less

The output is:

Init cram_fd* #1
Init cram_fd* #2
Init _Anonymous_25* #1
cram_read_slice (1/1)
Init cram_slice* #1
Init _Anonymous_25* #2
cram_read_slice (1/1)
Init cram_slice* #2
Init _Anonymous_25* #3
cram_read_slice (1/1)
...
Init cram_slice* #69
Init _Anonymous_5* #4
Free _Anonymous_5* #3
Free cram_slice* #3
Free _Anonymous_25* #3

The debug line on stdout is written on this line: cram/wrappers.d#L162

Problem occurs in both Zsh and Bash.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions