Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bedtools2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
R3
legacy
bedtools2
Commits
e818f468
Commit
e818f468
authored
13 years ago
by
Aaron
Browse files
Options
Downloads
Patches
Plain Diff
Fixed major bug in intersectBed -split. Thanks to Sol Katzman.
parent
2e3c8f96
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/intersectBed/intersectBed.cpp
+7
-3
7 additions, 3 deletions
src/intersectBed/intersectBed.cpp
with
7 additions
and
3 deletions
src/intersectBed/intersectBed.cpp
+
7
−
3
View file @
e818f468
...
@@ -173,7 +173,7 @@ void BedIntersect::ReportOverlapSummary(const BED &a, const int &numOverlapsFoun
...
@@ -173,7 +173,7 @@ void BedIntersect::ReportOverlapSummary(const BED &a, const int &numOverlapsFoun
bool
BedIntersect
::
FindOneOrMoreOverlap
(
const
BED
&
a
)
{
bool
BedIntersect
::
FindOneOrMoreOverlap
(
const
BED
&
a
)
{
bool
overlapsFound
;
bool
overlapsFound
=
false
;
if
(
_reciprocal
==
false
)
{
if
(
_reciprocal
==
false
)
{
overlapsFound
=
_bedB
->
FindOneOrMoreOverlapsPerBin
(
a
.
chrom
,
a
.
start
,
a
.
end
,
a
.
strand
,
overlapsFound
=
_bedB
->
FindOneOrMoreOverlapsPerBin
(
a
.
chrom
,
a
.
start
,
a
.
end
,
a
.
strand
,
_sameStrand
,
_diffStrand
,
_overlapFraction
);
_sameStrand
,
_diffStrand
,
_overlapFraction
);
...
@@ -245,11 +245,13 @@ void BedIntersect::IntersectBam(string bamFile) {
...
@@ -245,11 +245,13 @@ void BedIntersect::IntersectBam(string bamFile) {
// load the "B" bed file into a map so
// load the "B" bed file into a map so
// that we can easily compare "A" to it for overlaps
// that we can easily compare "A" to it for overlaps
_bedB
=
new
BedFile
(
_bedBFile
);
_bedB
->
loadBedFileIntoMap
();
_bedB
->
loadBedFileIntoMap
();
// open the BAM file
// open the BAM file
BamReader
reader
;
BamReader
reader
;
BamWriter
writer
;
BamWriter
writer
;
reader
.
Open
(
bamFile
);
reader
.
Open
(
bamFile
);
// get header & reference information
// get header & reference information
...
@@ -270,8 +272,10 @@ void BedIntersect::IntersectBam(string bamFile) {
...
@@ -270,8 +272,10 @@ void BedIntersect::IntersectBam(string bamFile) {
// reserve some space
// reserve some space
hits
.
reserve
(
100
);
hits
.
reserve
(
100
);
_bedA
->
bedType
=
6
;
//_bedA->bedType = 6;
BamAlignment
bam
;
BamAlignment
bam
;
// get each set of alignments for each pair.
// get each set of alignments for each pair.
while
(
reader
.
GetNextAlignment
(
bam
))
{
while
(
reader
.
GetNextAlignment
(
bam
))
{
...
@@ -312,7 +316,7 @@ void BedIntersect::IntersectBam(string bamFile) {
...
@@ -312,7 +316,7 @@ void BedIntersect::IntersectBam(string bamFile) {
vector
<
BED
>::
const_iterator
bedItr
=
bedBlocks
.
begin
();
vector
<
BED
>::
const_iterator
bedItr
=
bedBlocks
.
begin
();
vector
<
BED
>::
const_iterator
bedEnd
=
bedBlocks
.
end
();
vector
<
BED
>::
const_iterator
bedEnd
=
bedBlocks
.
end
();
for
(;
bedItr
!=
bedEnd
;
++
bedItr
)
{
for
(;
bedItr
!=
bedEnd
;
++
bedItr
)
{
overlapFoundForBlock
=
FindOneOrMoreOverlap
(
a
);
overlapFoundForBlock
=
FindOneOrMoreOverlap
(
*
bedItr
);
if
(
overlapFoundForBlock
==
true
)
if
(
overlapFoundForBlock
==
true
)
overlapsFound
=
true
;
overlapsFound
=
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment