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
7731f7f3
Commit
7731f7f3
authored
13 years ago
by
Aaron
Browse files
Options
Downloads
Patches
Plain Diff
Added -f to tagBam.
parent
0b3f2511
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/tagBam/tagBam.cpp
+4
-3
4 additions, 3 deletions
src/tagBam/tagBam.cpp
src/tagBam/tagBam.h
+2
-1
2 additions, 1 deletion
src/tagBam/tagBam.h
src/tagBam/tagBamMain.cpp
+13
-1
13 additions, 1 deletion
src/tagBam/tagBamMain.cpp
with
19 additions
and
5 deletions
src/tagBam/tagBam.cpp
+
4
−
3
View file @
7731f7f3
...
...
@@ -14,12 +14,13 @@
// build
TagBam
::
TagBam
(
const
string
&
bamFile
,
const
vector
<
string
>
&
annoFileNames
,
const
vector
<
string
>
&
annoLables
,
bool
forceStrand
)
:
const
vector
<
string
>
&
annoLables
,
bool
forceStrand
,
float
overlapFraction
)
:
_bamFile
(
bamFile
),
_annoFileNames
(
annoFileNames
),
_annoLabels
(
annoLables
),
_forceStrand
(
forceStrand
)
_forceStrand
(
forceStrand
),
_overlapFraction
(
overlapFraction
)
{}
...
...
@@ -49,7 +50,7 @@ void TagBam::CloseAnnoFiles() {
bool
TagBam
::
FindOneOrMoreOverlap
(
const
BED
&
a
,
BedFile
*
bedFile
)
{
return
bedFile
->
FindOneOrMoreOverlapsPerBin
(
a
.
chrom
,
a
.
start
,
a
.
end
,
a
.
strand
,
_forceStrand
,
0
);
_forceStrand
,
_overlapFraction
);
}
void
TagBam
::
Tag
()
{
...
...
This diff is collapsed.
Click to expand it.
src/tagBam/tagBam.h
+
2
−
1
View file @
7731f7f3
...
...
@@ -40,7 +40,7 @@ public:
// constructor
TagBam
(
const
string
&
bamFile
,
const
vector
<
string
>
&
annoFileNames
,
const
vector
<
string
>
&
annoLabels
,
bool
forceStrand
);
const
vector
<
string
>
&
annoLabels
,
bool
forceStrand
,
float
overlapFraction
);
// destructor
~
TagBam
(
void
);
...
...
@@ -61,6 +61,7 @@ private:
// do we care about strandedness when tagging?
bool
_forceStrand
;
float
_overlapFraction
;
// private function for reporting coverage information
void
ReportAnnotations
();
...
...
This diff is collapsed.
Click to expand it.
src/tagBam/tagBamMain.cpp
+
13
−
1
View file @
7731f7f3
...
...
@@ -30,8 +30,10 @@ int main(int argc, char* argv[]) {
// input file
string
bamFile
;
float
overlapFraction
=
1E-9
;
// parm flags
bool
haveFraction
=
false
;
bool
forceStrand
=
false
;
bool
haveBam
=
false
;
bool
haveFiles
=
false
;
...
...
@@ -98,6 +100,13 @@ int main(int argc, char* argv[]) {
else
if
(
PARAMETER_CHECK
(
"-s"
,
2
,
parameterLength
))
{
forceStrand
=
true
;
}
else
if
(
PARAMETER_CHECK
(
"-f"
,
2
,
parameterLength
))
{
if
((
i
+
1
)
<
argc
)
{
haveFraction
=
true
;
overlapFraction
=
atof
(
argv
[
i
+
1
]);
i
++
;
}
}
else
{
cerr
<<
endl
<<
"*****ERROR: Unrecognized parameter: "
<<
argv
[
i
]
<<
" *****"
<<
endl
<<
endl
;
showHelp
=
true
;
...
...
@@ -111,7 +120,7 @@ int main(int argc, char* argv[]) {
}
if
(
!
showHelp
)
{
TagBam
*
ba
=
new
TagBam
(
bamFile
,
inputFiles
,
inputLabels
,
forceStrand
);
TagBam
*
ba
=
new
TagBam
(
bamFile
,
inputFiles
,
inputLabels
,
forceStrand
,
overlapFraction
);
ba
->
Tag
();
delete
ba
;
return
0
;
...
...
@@ -137,5 +146,8 @@ void ShowHelp(void) {
cerr
<<
"
\t
-s
\t
"
<<
"Force strandedness. That is, only tag alignments that have the same"
<<
endl
;
cerr
<<
"
\t\t
strand as a feature in the annotation file(s)."
<<
endl
<<
endl
;
cerr
<<
"
\t
-f
\t
"
<<
"Minimum overlap required as a fraction of the alignment."
<<
endl
;
cerr
<<
"
\t\t
- Default is 1E-9 (i.e., 1bp)."
<<
endl
;
cerr
<<
"
\t\t
- FLOAT (e.g. 0.50)"
<<
endl
<<
endl
;
exit
(
1
);
}
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