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
adf85fd4
Commit
adf85fd4
authored
13 years ago
by
Aaron
Browse files
Options
Downloads
Patches
Plain Diff
Added -Sm to windowBed
parent
39ce5531
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/windowBed/windowBed.cpp
+5
-4
5 additions, 4 deletions
src/windowBed/windowBed.cpp
src/windowBed/windowBed.h
+3
-2
3 additions, 2 deletions
src/windowBed/windowBed.h
src/windowBed/windowMain.cpp
+16
-4
16 additions, 4 deletions
src/windowBed/windowMain.cpp
with
24 additions
and
10 deletions
src/windowBed/windowBed.cpp
+
5
−
4
View file @
adf85fd4
...
...
@@ -18,7 +18,7 @@
*/
BedWindow
::
BedWindow
(
string
bedAFile
,
string
bedBFile
,
int
leftSlop
,
int
rightSlop
,
bool
anyHit
,
bool
noHit
,
bool
writeCount
,
bool
strandWindows
,
bool
matchOnStrand
,
bool
bamInput
,
bool
bamOutput
,
bool
isUncompressedBam
)
{
bool
matchOnS
ameStrand
,
bool
matchOnDiffS
trand
,
bool
bamInput
,
bool
bamOutput
,
bool
isUncompressedBam
)
{
_bedAFile
=
bedAFile
;
_bedBFile
=
bedBFile
;
...
...
@@ -30,7 +30,8 @@ BedWindow::BedWindow(string bedAFile, string bedBFile, int leftSlop, int rightSl
_noHit
=
noHit
;
_writeCount
=
writeCount
;
_strandWindows
=
strandWindows
;
_matchOnStrand
=
matchOnStrand
;
_matchOnSameStrand
=
matchOnSameStrand
;
_matchOnDiffStrand
=
matchOnDiffStrand
;
_bamInput
=
bamInput
;
_bamOutput
=
bamOutput
;
_isUncompressedBam
=
isUncompressedBam
;
...
...
@@ -70,7 +71,7 @@ void BedWindow::FindWindowOverlaps(const BED &a, vector<BED> &hits) {
Now report the hits (if any) based on the window around a.
*/
// get the hits in B for the A feature
_bedB
->
FindOverlapsPerBin
(
a
.
chrom
,
aFudgeStart
,
aFudgeEnd
,
a
.
strand
,
hits
,
_matchOnStrand
);
_bedB
->
FindOverlapsPerBin
(
a
.
chrom
,
aFudgeStart
,
aFudgeEnd
,
a
.
strand
,
hits
,
_matchOnS
ameStrand
,
_matchOnDiffS
trand
);
int
numOverlaps
=
0
;
...
...
@@ -114,7 +115,7 @@ bool BedWindow::FindOneOrMoreWindowOverlaps(const BED &a) {
CHRPOS
aFudgeEnd
;
AddWindow
(
a
,
aFudgeStart
,
aFudgeEnd
);
bool
overlapsFound
=
_bedB
->
FindOneOrMoreOverlapsPerBin
(
a
.
chrom
,
a
.
start
,
a
.
end
,
a
.
strand
,
_matchOnStrand
);
bool
overlapsFound
=
_bedB
->
FindOneOrMoreOverlapsPerBin
(
a
.
chrom
,
a
.
start
,
a
.
end
,
a
.
strand
,
_matchOnS
ameStrand
,
_matchOnDiffS
trand
);
return
overlapsFound
;
}
...
...
This diff is collapsed.
Click to expand it.
src/windowBed/windowBed.h
+
3
−
2
View file @
adf85fd4
...
...
@@ -34,7 +34,7 @@ public:
// constructor
BedWindow
(
string
bedAFile
,
string
bedBFile
,
int
leftSlop
,
int
rightSlop
,
bool
anyHit
,
bool
noHit
,
bool
writeCount
,
bool
strandWindows
,
bool
matchOnStrand
,
bool
bamInput
,
bool
bamOutput
,
bool
isUncompressedBam
);
bool
matchOnS
ameStrand
,
bool
matchOnDiffS
trand
,
bool
bamInput
,
bool
bamOutput
,
bool
isUncompressedBam
);
// destructor
~
BedWindow
(
void
);
...
...
@@ -49,7 +49,8 @@ private:
int
_rightSlop
;
bool
_noHit
;
bool
_strandWindows
;
bool
_matchOnStrand
;
bool
_matchOnSameStrand
;
bool
_matchOnDiffStrand
;
bool
_bamInput
;
bool
_bamOutput
;
bool
_isUncompressedBam
;
...
...
This diff is collapsed.
Click to expand it.
src/windowBed/windowMain.cpp
+
16
−
4
View file @
adf85fd4
...
...
@@ -46,7 +46,8 @@ int main(int argc, char* argv[]) {
bool
haveLeft
=
false
;
bool
haveRight
=
false
;
bool
strandWindows
=
false
;
bool
matchOnStrand
=
false
;
bool
matchOnSameStrand
=
false
;
bool
matchOnDiffStrand
=
false
;
bool
inputIsBam
=
false
;
bool
outputIsBam
=
true
;
bool
uncompressedBam
=
false
;
...
...
@@ -108,7 +109,10 @@ int main(int argc, char* argv[]) {
strandWindows
=
true
;
}
else
if
(
PARAMETER_CHECK
(
"-sm"
,
3
,
parameterLength
))
{
matchOnStrand
=
true
;
matchOnSameStrand
=
true
;
}
else
if
(
PARAMETER_CHECK
(
"-sm"
,
3
,
parameterLength
))
{
matchOnDiffStrand
=
true
;
}
else
if
(
PARAMETER_CHECK
(
"-w"
,
2
,
parameterLength
))
{
if
((
i
+
1
)
<
argc
)
{
...
...
@@ -177,9 +181,14 @@ int main(int argc, char* argv[]) {
showHelp
=
true
;
}
if
(
matchOnSameStrand
&&
matchOnDiffStrand
)
{
cerr
<<
endl
<<
"*****"
<<
endl
<<
"*****ERROR: Use either -sm or -Sm, not both."
<<
endl
<<
"*****"
<<
endl
;
showHelp
=
true
;
}
if
(
!
showHelp
)
{
BedWindow
*
bi
=
new
BedWindow
(
bedAFile
,
bedBFile
,
leftSlop
,
rightSlop
,
anyHit
,
noHit
,
writeCount
,
strandWindows
,
matchOnStrand
,
noHit
,
writeCount
,
strandWindows
,
matchOnS
ameStrand
,
matchOnDiffS
trand
,
inputIsBam
,
outputIsBam
,
uncompressedBam
);
delete
bi
;
return
0
;
...
...
@@ -233,7 +242,10 @@ void ShowHelp(void) {
cerr
<<
"
\t\t
for a negative-stranded feature will add 500 bp downstream."
<<
endl
;
cerr
<<
"
\t\t
- Default = disabled."
<<
endl
<<
endl
;
cerr
<<
"
\t
-sm
\t
"
<<
"Only report hits in B that overlap A on the same strand."
<<
endl
;
cerr
<<
"
\t
-sm
\t
"
<<
"Only report hits in B that overlap A on the _same_ strand."
<<
endl
;
cerr
<<
"
\t\t
- By default, overlaps are reported without respect to strand."
<<
endl
<<
endl
;
cerr
<<
"
\t
-Sm
\t
"
<<
"Only report hits in B that overlap A on the _opposite_ strand."
<<
endl
;
cerr
<<
"
\t\t
- By default, overlaps are reported without respect to strand."
<<
endl
<<
endl
;
cerr
<<
"
\t
-u
\t
"
<<
"Write the original A entry _once_ if _any_ overlaps found 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