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
f12f568c
Commit
f12f568c
authored
13 years ago
by
Aaron
Browse files
Options
Downloads
Patches
Plain Diff
Added -S to closestBed
parent
1348016b
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/closestBed/closestBed.cpp
+5
-3
5 additions, 3 deletions
src/closestBed/closestBed.cpp
src/closestBed/closestBed.h
+3
-2
3 additions, 2 deletions
src/closestBed/closestBed.h
src/closestBed/closestMain.cpp
+18
-5
18 additions, 5 deletions
src/closestBed/closestMain.cpp
with
26 additions
and
10 deletions
src/closestBed/closestBed.cpp
+
5
−
3
View file @
f12f568c
...
...
@@ -21,11 +21,13 @@ const int SLOPGROWTH = 2048000;
/*
Constructor
*/
BedClosest
::
BedClosest
(
string
&
bedAFile
,
string
&
bedBFile
,
bool
forceStrand
,
string
&
tieMode
,
bool
reportDistance
,
bool
ignoreOverlaps
)
BedClosest
::
BedClosest
(
string
&
bedAFile
,
string
&
bedBFile
,
bool
sameStrand
,
bool
diffStrand
,
string
&
tieMode
,
bool
reportDistance
,
bool
ignoreOverlaps
)
:
_bedAFile
(
bedAFile
)
,
_bedBFile
(
bedBFile
)
,
_tieMode
(
tieMode
)
,
_forceStrand
(
forceStrand
)
,
_sameStrand
(
sameStrand
)
,
_diffStrand
(
diffStrand
)
,
_reportDistance
(
reportDistance
)
,
_ignoreOverlaps
(
ignoreOverlaps
)
{
...
...
@@ -76,7 +78,7 @@ void BedClosest::FindWindowOverlaps(BED &a, vector<BED> &hits) {
// THE HEAVY LIFTING
// search for hits with the current slop added
_bedB
->
FindOverlapsPerBin
(
a
.
chrom
,
aFudgeStart
,
aFudgeEnd
,
a
.
strand
,
hits
,
_
force
Strand
);
_bedB
->
FindOverlapsPerBin
(
a
.
chrom
,
aFudgeStart
,
aFudgeEnd
,
a
.
strand
,
hits
,
_
sameStrand
,
_diff
Strand
);
vector
<
BED
>::
const_iterator
h
=
hits
.
begin
();
vector
<
BED
>::
const_iterator
hitsEnd
=
hits
.
end
();
...
...
This diff is collapsed.
Click to expand it.
src/closestBed/closestBed.h
+
3
−
2
View file @
f12f568c
...
...
@@ -28,7 +28,7 @@ public:
// constructor
BedClosest
(
string
&
bedAFile
,
string
&
bedBFile
,
bool
force
Strand
,
string
&
tieMode
,
bool
sameStrand
,
bool
diff
Strand
,
string
&
tieMode
,
bool
reportDistance
,
bool
ignoreOverlaps
);
// destructor
...
...
@@ -43,7 +43,8 @@ private:
string
_bedAFile
;
string
_bedBFile
;
string
_tieMode
;
bool
_forceStrand
;
bool
_sameStrand
;
bool
_diffStrand
;
bool
_reportDistance
;
bool
_ignoreOverlaps
;
...
...
This diff is collapsed.
Click to expand it.
src/closestBed/closestMain.cpp
+
18
−
5
View file @
f12f568c
...
...
@@ -36,7 +36,8 @@ int main(int argc, char* argv[]) {
bool
haveBedA
=
false
;
bool
haveBedB
=
false
;
bool
haveTieMode
=
false
;
bool
forceStrand
=
false
;
bool
sameStrand
=
false
;
bool
diffStrand
=
false
;
bool
ignoreOverlaps
=
false
;
bool
reportDistance
=
false
;
...
...
@@ -75,7 +76,10 @@ int main(int argc, char* argv[]) {
}
}
else
if
(
PARAMETER_CHECK
(
"-s"
,
2
,
parameterLength
))
{
forceStrand
=
true
;
sameStrand
=
true
;
}
else
if
(
PARAMETER_CHECK
(
"-S"
,
2
,
parameterLength
))
{
diffStrand
=
true
;
}
else
if
(
PARAMETER_CHECK
(
"-d"
,
2
,
parameterLength
))
{
reportDistance
=
true
;
...
...
@@ -108,8 +112,13 @@ int main(int argc, char* argv[]) {
showHelp
=
true
;
}
if
(
sameStrand
&&
diffStrand
)
{
cerr
<<
endl
<<
"*****"
<<
endl
<<
"*****ERROR: Request either -s OR -S, not both."
<<
endl
<<
"*****"
<<
endl
;
showHelp
=
true
;
}
if
(
!
showHelp
)
{
BedClosest
*
bc
=
new
BedClosest
(
bedAFile
,
bedBFile
,
force
Strand
,
tieMode
,
reportDistance
,
ignoreOverlaps
);
BedClosest
*
bc
=
new
BedClosest
(
bedAFile
,
bedBFile
,
sameStrand
,
diff
Strand
,
tieMode
,
reportDistance
,
ignoreOverlaps
);
delete
bc
;
return
0
;
}
...
...
@@ -131,8 +140,12 @@ void ShowHelp(void) {
cerr
<<
"Usage: "
<<
PROGRAM_NAME
<<
" [OPTIONS] -a <bed/gff/vcf> -b <bed/gff/vcf>"
<<
endl
<<
endl
;
cerr
<<
"Options: "
<<
endl
;
cerr
<<
"
\t
-s
\t
"
<<
"Force strandedness. That is, find the closest feature in B"
<<
endl
;
cerr
<<
"
\t\t
that overlaps A on the same strand."
<<
endl
;
cerr
<<
"
\t
-s
\t
"
<<
"Require same strandedness. That is, find the closest feature in B"
<<
endl
;
cerr
<<
"
\t\t
that overlaps A on the _same_ strand."
<<
endl
;
cerr
<<
"
\t\t
- By default, overlaps are reported without respect to strand."
<<
endl
<<
endl
;
cerr
<<
"
\t
-s
\t
"
<<
"Require opposite strandedness. That is, find the closest feature in B"
<<
endl
;
cerr
<<
"
\t\t
that overlaps A on the _opposite_ strand."
<<
endl
;
cerr
<<
"
\t\t
- By default, overlaps are reported without respect to strand."
<<
endl
<<
endl
;
cerr
<<
"
\t
-d
\t
"
<<
"In addition to the closest feature in B, "
<<
endl
;
...
...
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