Skip to content
Snippets Groups Projects
Commit a16562f4 authored by nkindlon's avatar nkindlon
Browse files

Added fix for Bam files with empty headers. Added test for this to unit test.

parent b2f01dc8
No related branches found
No related tags found
No related merge requests found
......@@ -204,10 +204,7 @@ bool InputStreamMgr::detectBamOrBgzip(int &numChars, int currChar)
_bamReader = new BamTools::BamReader();
_bamReader->OpenStream(_finalInputStream);
QuickString bamHeader(_bamReader->GetHeaderText());
if (bamHeader.empty()) {
if (!_bamReader->OpenStream(_finalInputStream)) {
//This is NOT a bam file, but it is bgzipped.
_pushBackStreamBuf->clear();
//Put all bytes read so far back onto the scan buffer, then reset
......
File added
chr2L 10 15 None 255 + 10 15 0,0,0 1 5, 0,
chr2L 70 75 None 255 - 70 75 0,0,0 1 5, 0,
chr2L 70 75 None 255 - 70 75 0,0,0 1 5, 0,
chr2L 140 145 None 255 - 140 145 0,0,0 1 5, 0,
chr2L 140 145 None 255 - 140 145 0,0,0 1 5, 0,
chr2L 150 155 None 255 - 150 155 0,0,0 1 5, 0,
chr2L 210 215 None 255 + 210 215 0,0,0 1 5, 0,
chr2L 70 75 None 255 + 70 75 0,0,0 1 5, 0,
chr2L 70 75 None 255 + 70 75 0,0,0 1 5, 0,
chr2L 140 145 None 255 + 140 145 0,0,0 1 5, 0,
chr2L 140 145 None 255 + 140 145 0,0,0 1 5, 0,
chr2L 160 165 None 255 + 160 165 0,0,0 1 5, 0,
......@@ -605,6 +605,15 @@ check obs exp
rm obs exp
###########################################################
# Test that we can process a Bam file with no text in
# it's header.
############################################################
echo " intersect.new.t53...\c"
$BT intersect -a gdc.bam -b gdc.bam -bed > obs
check obs gdc_exp
rm obs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment