Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
legacy
bedtools2
Commits
78c266dc
Commit
78c266dc
authored
Feb 23, 2015
by
Neil Kindlon
Browse files
Fixed bug for -nonamecheck, added help, unit test
parent
33577de0
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/intersectFile/intersectMain.cpp
View file @
78c266dc
...
...
@@ -134,6 +134,9 @@ void intersect_help(void) {
cerr
<<
"
\t
-sortout
\t
"
<<
"When using multiple databases, sort the output DB hits"
<<
endl
;
cerr
<<
"
\t\t\t
for each record."
<<
endl
<<
endl
;
cerr
<<
"
\t
-nonamecheck
\t
"
<<
"For sorted data, don't throw an error if the file has different naming conventions"
<<
endl
;
cerr
<<
"
\t\t\t
for the same chromosome. ex.
\"
chr1
\"
vs
\"
chr01
\"
."
<<
endl
<<
endl
;
CommonHelp
();
cerr
<<
"Notes: "
<<
endl
;
...
...
src/utils/Contexts/ContextBase.cpp
View file @
78c266dc
...
...
@@ -199,7 +199,7 @@ bool ContextBase::parseCmdArgs(int argc, char **argv, int skipFirstArgs) {
if
(
!
handle_sortout
())
return
false
;
}
else
if
(
strcmp
(
_argv
[
_i
],
"-nonamecheck"
)
==
0
)
{
if
(
!
handle_
sortout
())
return
false
;
if
(
!
handle_
nonamecheck
())
return
false
;
}
}
...
...
src/utils/Contexts/ContextIntersect.cpp
View file @
78c266dc
...
...
@@ -168,6 +168,10 @@ bool ContextIntersect::isValidState()
if
(
_files
.
size
()
<
2
)
{
return
false
;
}
if
(
!
getSortedInput
()
&&
getNameCheckDisabled
())
{
_errorMsg
=
"
\n
***** ERROR: -nonamecheck option is only valid for sorted input. *****"
;
return
false
;
}
return
true
;
}
...
...
test/intersect/nonamecheck_a.bed
0 → 100644
View file @
78c266dc
chr1 10 20
test/intersect/nonamecheck_b.bed
0 → 100644
View file @
78c266dc
chr01 15 25
test/intersect/test-intersect.sh
View file @
78c266dc
...
...
@@ -536,6 +536,36 @@ $BT intersect -a bug187_a.bed -b bug187_b.bed -wao > obs
check exp obs
rm
exp obs
##################################################################
# see that -nonamecheck only works for sorted data
##################################################################
echo
" intersect.t44...
\c
"
echo
\
"***** ERROR: -nonamecheck option is only valid for sorted input. *****"
>
exp
$BT
intersect
-a
nonamecheck_a.bed
-b
nonamecheck_b.bed
-nonamecheck
2>&1
>
/dev/null |
cat
- |
head
-2
|
tail
-1
>
obs
check exp obs
rm
exp obs
##################################################################
# see that differently named chroms don't work with -sorted
##################################################################
echo
" intersect.t45...
\c
"
echo
\
"ERROR: File nonamecheck_b.bed has a record where naming convention (leading zero) is inconsistent with other files:
chr01 15 25"
>
exp
$BT
intersect
-a
nonamecheck_a.bed
-b
nonamecheck_b.bed
-sorted
2>&1
>
/dev/null |
cat
-
>
obs
check exp obs
rm
exp obs
##################################################################
# see that differently named chroms -sorted and -nonamecheck
# don't complain
##################################################################
echo
" intersect.t46...
\c
"
touch
exp
$BT
intersect
-a
nonamecheck_a.bed
-b
nonamecheck_b.bed
-sorted
-nonamecheck
2>&1
>
/dev/null |
cat
-
>
obs
check exp obs
rm
exp obs
cd
multi_intersect
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment