Skip to content
Snippets Groups Projects
Commit f2209cfc authored by Aaron's avatar Aaron
Browse files

Unmapped BAM alignments are now captured by -v in intersectBed and windowBed....

Unmapped BAM alignments are now captured by -v in intersectBed and windowBed. Thanks to Davide Cittaro.
parent 83ee0a43
No related branches found
No related tags found
No related merge requests found
...@@ -278,6 +278,10 @@ void BedIntersect::IntersectBam(string bamFile) { ...@@ -278,6 +278,10 @@ void BedIntersect::IntersectBam(string bamFile) {
bool overlapsFound = false; bool overlapsFound = false;
// treat the BAM alignment as a single "block" // treat the BAM alignment as a single "block"
if (_obeySplits == false) { 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); overlapsFound = FindOneOrMoreOverlap(a);
} }
// split the BAM alignment into discrete blocks and // split the BAM alignment into discrete blocks and
...@@ -327,6 +331,10 @@ void BedIntersect::IntersectBam(string bamFile) { ...@@ -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. // close the relevant BAM files.
......
...@@ -204,6 +204,10 @@ void BedWindow::WindowIntersectBam(string bamFile) { ...@@ -204,6 +204,10 @@ void BedWindow::WindowIntersectBam(string bamFile) {
hits.clear(); hits.clear();
} }
} }
// BAM IsMapped() is false
else if (_noHit == true) {
writer.SaveAlignment(bam);
}
} }
// close the relevant BAM files. // close the relevant BAM files.
......
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