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

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

Closed
hzpc-joostk opened this issue Dec 6, 2017 · 3 comments
Closed
Assignees
Milestone

Comments

@hzpc-joostk
Copy link

hzpc-joostk commented Dec 6, 2017

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.

@pjotrp
Copy link
Member

pjotrp commented Dec 6, 2017

I suppose debug output should be on stderr

@hzpc-joostk
Copy link
Author

hzpc-joostk commented Dec 6, 2017

That is what I would expect. These debug lines are output on stdout:

cram_read_container
COPIED #2

For me, it would be nicer to silence all debug messages, even on stderr, by default.

@pjotrp
Copy link
Member

pjotrp commented Dec 7, 2017

Oh, I see. If you use the real release of sambamba debug info should be off. I'll fix this at some point. If you want to use the debug version (nevertheless) don't pipe the output. Write it to a file.

@pjotrp pjotrp changed the title SAM output of CRAM file is populated with debug Debug version: SAM output of CRAM file is populated with debug on pipe Dec 7, 2017
@pjotrp pjotrp self-assigned this Dec 7, 2017
@pjotrp pjotrp added this to the v1.0.0 milestone Dec 7, 2017
pjotrp added a commit to pjotrp/sambamba that referenced this issue Dec 31, 2017
pjotrp added a commit to pjotrp/sambamba that referenced this issue Feb 7, 2018
pjotrp added a commit to pjotrp/sambamba that referenced this issue Feb 7, 2018
- Updated to BioD latest and added RELEASE NOTES
@pjotrp pjotrp closed this as completed Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants