diff --git a/src/intersectBed/intersectBed.cpp b/src/intersectBed/intersectBed.cpp index d6ec2c28db2f5e622e382a93c72085a9a8777702..53222ebc1a04c349c1ae48de6c2736c6c4cfd47e 100644 --- a/src/intersectBed/intersectBed.cpp +++ b/src/intersectBed/intersectBed.cpp @@ -278,6 +278,10 @@ void BedIntersect::IntersectBam(string bamFile) { bool overlapsFound = false; // treat the BAM alignment as a single "block" if (_obeySplits == false) { + // Toying with adding tags. Need new version of FindOverlaps. + // FindOverlaps(a, hits); + // bam.AddTag("YB", "i", static_cast<int>(hits.size())); + // hits.clear(); overlapsFound = FindOneOrMoreOverlap(a); } // split the BAM alignment into discrete blocks and @@ -327,6 +331,10 @@ void BedIntersect::IntersectBam(string bamFile) { } } } + // BAM IsMapped() is false + else if (_noHit == true) { + writer.SaveAlignment(bam); + } } // close the relevant BAM files. diff --git a/src/windowBed/windowBed.cpp b/src/windowBed/windowBed.cpp index 6b0336128d153363d466bf9b2aebafc508772557..b961f02c2049076a0da11b6faa744c583206a38a 100644 --- a/src/windowBed/windowBed.cpp +++ b/src/windowBed/windowBed.cpp @@ -204,6 +204,10 @@ void BedWindow::WindowIntersectBam(string bamFile) { hits.clear(); } } + // BAM IsMapped() is false + else if (_noHit == true) { + writer.SaveAlignment(bam); + } } // close the relevant BAM files.