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
1348016b
Commit
1348016b
authored
13 years ago
by
Aaron
Browse files
Options
Downloads
Patches
Plain Diff
Added -S to annotateBed
parent
a3c8e702
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/annotateBed/annotateBed.cpp
+4
-3
4 additions, 3 deletions
src/annotateBed/annotateBed.cpp
src/annotateBed/annotateBed.h
+4
-2
4 additions, 2 deletions
src/annotateBed/annotateBed.h
src/annotateBed/annotateMain.cpp
+17
-6
17 additions, 6 deletions
src/annotateBed/annotateMain.cpp
with
25 additions
and
11 deletions
src/annotateBed/annotateBed.cpp
+
4
−
3
View file @
1348016b
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
// build
// build
BedAnnotate
::
BedAnnotate
(
const
string
&
mainFile
,
const
vector
<
string
>
&
annoFileNames
,
BedAnnotate
::
BedAnnotate
(
const
string
&
mainFile
,
const
vector
<
string
>
&
annoFileNames
,
const
vector
<
string
>
&
annoTitles
,
bool
force
Strand
,
bool
reportCounts
,
bool
reportBoth
)
:
const
vector
<
string
>
&
annoTitles
,
bool
sameStrand
,
bool
diff
Strand
,
bool
reportCounts
,
bool
reportBoth
)
:
_mainFile
(
mainFile
),
_mainFile
(
mainFile
),
_annoFileNames
(
annoFileNames
),
_annoFileNames
(
annoFileNames
),
_annoTitles
(
annoTitles
),
_annoTitles
(
annoTitles
),
_forceStrand
(
forceStrand
),
_sameStrand
(
sameStrand
),
_diffStrand
(
diffStrand
),
_reportCounts
(
reportCounts
),
_reportCounts
(
reportCounts
),
_reportBoth
(
reportBoth
)
_reportBoth
(
reportBoth
)
{
{
...
@@ -120,7 +121,7 @@ void BedAnnotate::AnnotateBed() {
...
@@ -120,7 +121,7 @@ void BedAnnotate::AnnotateBed() {
// process each entry in the current anno file
// process each entry in the current anno file
while
((
bedStatus
=
anno
->
GetNextBed
(
a
,
lineNum
))
!=
BED_INVALID
)
{
while
((
bedStatus
=
anno
->
GetNextBed
(
a
,
lineNum
))
!=
BED_INVALID
)
{
if
(
bedStatus
==
BED_VALID
)
{
if
(
bedStatus
==
BED_VALID
)
{
_bed
->
countListHits
(
a
,
annoIndex
,
_
force
Strand
);
_bed
->
countListHits
(
a
,
annoIndex
,
_
sameStrand
,
_diff
Strand
);
a
=
nullBed
;
a
=
nullBed
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/annotateBed/annotateBed.h
+
4
−
2
View file @
1348016b
...
@@ -31,7 +31,7 @@ public:
...
@@ -31,7 +31,7 @@ public:
// constructor
// constructor
BedAnnotate
(
const
string
&
mainFile
,
const
vector
<
string
>
&
annoFileNames
,
BedAnnotate
(
const
string
&
mainFile
,
const
vector
<
string
>
&
annoFileNames
,
const
vector
<
string
>
&
annoTitles
,
bool
force
Strand
,
bool
reportCounts
,
bool
reportBoth
);
const
vector
<
string
>
&
annoTitles
,
bool
sameStrand
,
bool
diff
Strand
,
bool
reportCounts
,
bool
reportBoth
);
// destructor
// destructor
~
BedAnnotate
(
void
);
~
BedAnnotate
(
void
);
...
@@ -51,7 +51,9 @@ private:
...
@@ -51,7 +51,9 @@ private:
vector
<
BedFile
*>
_annoFiles
;
vector
<
BedFile
*>
_annoFiles
;
// do we care about strandedness when counting coverage?
// do we care about strandedness when counting coverage?
bool
_forceStrand
;
bool
_sameStrand
;
bool
_diffStrand
;
bool
_reportCounts
;
bool
_reportCounts
;
bool
_reportBoth
;
bool
_reportBoth
;
...
...
This diff is collapsed.
Click to expand it.
src/annotateBed/annotateMain.cpp
+
17
−
6
View file @
1348016b
...
@@ -32,7 +32,8 @@ int main(int argc, char* argv[]) {
...
@@ -32,7 +32,8 @@ int main(int argc, char* argv[]) {
string
mainFile
;
string
mainFile
;
// parm flags
// parm flags
bool
forceStrand
=
false
;
bool
sameStrand
=
false
;
bool
diffStrand
=
false
;
bool
haveBed
=
false
;
bool
haveBed
=
false
;
bool
haveFiles
=
false
;
bool
haveFiles
=
false
;
bool
haveTitles
=
false
;
bool
haveTitles
=
false
;
...
@@ -104,7 +105,10 @@ int main(int argc, char* argv[]) {
...
@@ -104,7 +105,10 @@ int main(int argc, char* argv[]) {
reportBoth
=
true
;
reportBoth
=
true
;
}
}
else
if
(
PARAMETER_CHECK
(
"-s"
,
2
,
parameterLength
))
{
else
if
(
PARAMETER_CHECK
(
"-s"
,
2
,
parameterLength
))
{
forceStrand
=
true
;
sameStrand
=
true
;
}
else
if
(
PARAMETER_CHECK
(
"-S"
,
2
,
parameterLength
))
{
diffStrand
=
true
;
}
}
else
{
else
{
cerr
<<
endl
<<
"*****ERROR: Unrecognized parameter: "
<<
argv
[
i
]
<<
" *****"
<<
endl
<<
endl
;
cerr
<<
endl
<<
"*****ERROR: Unrecognized parameter: "
<<
argv
[
i
]
<<
" *****"
<<
endl
<<
endl
;
...
@@ -117,9 +121,13 @@ int main(int argc, char* argv[]) {
...
@@ -117,9 +121,13 @@ int main(int argc, char* argv[]) {
cerr
<<
endl
<<
"*****"
<<
endl
<<
"*****ERROR: Need -i and -files files. "
<<
endl
<<
"*****"
<<
endl
;
cerr
<<
endl
<<
"*****"
<<
endl
<<
"*****ERROR: Need -i and -files files. "
<<
endl
<<
"*****"
<<
endl
;
showHelp
=
true
;
showHelp
=
true
;
}
}
if
(
sameStrand
&&
diffStrand
)
{
cerr
<<
endl
<<
"*****"
<<
endl
<<
"*****ERROR: Request either -s OR -S, not both."
<<
endl
<<
"*****"
<<
endl
;
showHelp
=
true
;
}
if
(
!
showHelp
)
{
if
(
!
showHelp
)
{
BedAnnotate
*
ba
=
new
BedAnnotate
(
mainFile
,
inputFiles
,
inputTitles
,
force
Strand
,
reportCounts
,
reportBoth
);
BedAnnotate
*
ba
=
new
BedAnnotate
(
mainFile
,
inputFiles
,
inputTitles
,
sameStrand
,
diff
Strand
,
reportCounts
,
reportBoth
);
ba
->
AnnotateBed
();
ba
->
AnnotateBed
();
delete
ba
;
delete
ba
;
return
0
;
return
0
;
...
@@ -151,9 +159,12 @@ void ShowHelp(void) {
...
@@ -151,9 +159,12 @@ void ShowHelp(void) {
cerr
<<
"
\t
-both
\t
"
<<
"Report the counts followed by the % coverage."
<<
endl
;
cerr
<<
"
\t
-both
\t
"
<<
"Report the counts followed by the % coverage."
<<
endl
;
cerr
<<
"
\t\t
- Default is to report the fraction of -i covered by each file."
<<
endl
<<
endl
;
cerr
<<
"
\t\t
- Default is to report the fraction of -i covered by each file."
<<
endl
<<
endl
;
cerr
<<
"
\t
-s
\t
"
<<
"
Forc
e strandedness. That is, only
include hits in A that
"
<<
endl
;
cerr
<<
"
\t
-s
\t
"
<<
"
Require sam
e strandedness. That is, only
counts overlaps
"
<<
endl
;
cerr
<<
"
\t\t
overlap B
on the same strand."
<<
endl
;
cerr
<<
"
\t\t
on the
_
same
_
strand."
<<
endl
;
cerr
<<
"
\t\t
- By default,
hits are includ
ed without respect to strand."
<<
endl
<<
endl
;
cerr
<<
"
\t\t
- By default,
overlaps are count
ed without respect to strand."
<<
endl
<<
endl
;
cerr
<<
"
\t
-S
\t
"
<<
"Require different strandedness. That is, only count overlaps"
<<
endl
;
cerr
<<
"
\t\t
on the _opposite_ strand."
<<
endl
;
cerr
<<
"
\t\t
- By default, overlaps are counted without respect to strand."
<<
endl
<<
endl
;
exit
(
1
);
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