Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
legacy
bedtools2
Commits
52b83aac
Commit
52b83aac
authored
Jan 24, 2012
by
Aaron
Browse files
added count_distinct to groupby
parent
c75487d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/groupBy/groupBy.cpp
View file @
52b83aac
...
...
@@ -165,7 +165,7 @@ int groupby_main(int argc, char* argv[]) {
for
(
size_t
i
=
0
;
i
<
ops
.
size
();
i
++
)
{
if
((
ops
[
i
]
!=
"sum"
)
&&
(
ops
[
i
]
!=
"max"
)
&&
(
ops
[
i
]
!=
"min"
)
&&
(
ops
[
i
]
!=
"mean"
)
&&
(
ops
[
i
]
!=
"mode"
)
&&
(
ops
[
i
]
!=
"median"
)
&&
(
ops
[
i
]
!=
"antimode"
)
&&
(
ops
[
i
]
!=
"stdev"
)
&&
(
ops
[
i
]
!=
"sstdev"
)
&&
(
ops
[
i
]
!=
"count"
)
&&
(
ops
[
i
]
!=
"collapse"
)
&&
(
ops
[
i
]
!=
"distinct"
)
&&
(
ops
[
i
]
!=
"sstdev"
)
&&
(
ops
[
i
]
!=
"count"
)
&&
(
ops
[
i
]
!=
"count_distinct"
)
&&
(
ops
[
i
]
!=
"collapse"
)
&&
(
ops
[
i
]
!=
"distinct"
)
&&
(
ops
[
i
]
!=
"concat"
)
&&
(
ops
[
i
]
!=
"freqdesc"
)
&&
(
ops
[
i
]
!=
"freqasc"
))
{
cerr
<<
endl
<<
"*****"
<<
endl
<<
"*****ERROR: Invalid operation selection
\"
"
<<
ops
[
i
]
<<
endl
<<
"
\"
*****"
<<
endl
;
...
...
@@ -237,7 +237,7 @@ void groupby_help(void) {
cerr
<<
"
\t
-o -ops
\t\t
"
<<
"Specify the operation that should be applied to opCol."
<<
endl
;
cerr
<<
"
\t\t\t
Valid operations:"
<<
endl
;
cerr
<<
"
\t\t\t
sum, count, min, max,"
<<
endl
;
cerr
<<
"
\t\t\t
sum, count,
count_distinct,
min, max,"
<<
endl
;
cerr
<<
"
\t\t\t
mean, median, mode, antimode,"
<<
endl
;
cerr
<<
"
\t\t\t
stdev, sstdev (sample standard dev.),"
<<
endl
;
cerr
<<
"
\t\t\t
collapse (i.e., print a comma separated list (duplicates allowed)), "
<<
endl
;
...
...
@@ -422,6 +422,10 @@ void ReportSummary(const vector<string> &group, const vector<vector<string> > &d
buffer
<<
setprecision
(
PRECISION
)
<<
data
[
i
].
size
();
result
.
push_back
(
buffer
.
str
());
}
else
if
(
op
==
"count_distinct"
)
{
buffer
<<
setprecision
(
PRECISION
)
<<
vo
.
GetCountDistinct
();
result
.
push_back
(
buffer
.
str
());
}
else
if
(
op
==
"mode"
)
{
result
.
push_back
(
vo
.
GetMode
());
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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