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
3001efad
Commit
3001efad
authored
13 years ago
by
Aaron
Browse files
Options
Downloads
Patches
Plain Diff
New region checks for multiBamCov. Thanks to Derek Barnett.
parent
48f83463
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/multiBamCov/multiBamCov.cpp
+20
-17
20 additions, 17 deletions
src/multiBamCov/multiBamCov.cpp
with
20 additions
and
17 deletions
src/multiBamCov/multiBamCov.cpp
+
20
−
17
View file @
3001efad
...
...
@@ -64,25 +64,28 @@ void MultiCovBam::CollectCoverage()
{
if
(
bedStatus
==
BED_VALID
)
{
reader
.
SetRegion
(
reader
.
GetReferenceID
(
bed
.
chrom
),
(
int
)
bed
.
start
,
reader
.
GetReferenceID
(
bed
.
chrom
),
(
int
)
bed
.
end
);
// initialize counts for each file to 0
vector
<
int
>
counts
(
_bam_files
.
size
(),
0
);
// get the BAM refId for this chrom.
int
refId
=
reader
.
GetReferenceID
(
bed
.
chrom
);
// set up a BamRegion to which to attempt to jump
BamRegion
region
(
refId
,
(
int
)
bed
.
start
,
refId
,
(
int
)
bed
.
end
);
// everything checks out, just iterate through specified region, counting alignments
vector
<
int
>
counts
(
_bam_files
.
size
());
BamAlignment
al
;
while
(
reader
.
GetNextAlignment
(
al
)
)
{
// map qual must exceed minimum
if
(
al
.
MapQuality
>=
_minQual
)
{
// ignore if not properly paired and we actually care.
if
(
_properOnly
&&
!
al
.
IsProperPair
())
continue
;
if
(
(
refId
!=
-
1
)
&&
(
reader
.
SetRegion
(
region
))
)
{
BamAlignment
al
;
while
(
reader
.
GetNextAlignment
(
al
)
)
{
// map qual must exceed minimum
if
(
al
.
MapQuality
>=
_minQual
)
{
// ignore if not properly paired and we actually care.
if
(
_properOnly
&&
!
al
.
IsProperPair
())
continue
;
// lookup the offset of the file name and tabulate
//coverage for the appropriate file
counts
[
bamFileMap
[
al
.
Filename
]]
++
;
// lookup the offset of the file name and tabulate
//coverage for the appropriate file
counts
[
bamFileMap
[
al
.
Filename
]]
++
;
}
}
}
// report the cov at this interval for each file and reset
...
...
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