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
939d5390
Commit
939d5390
authored
Aug 16, 2010
by
Aaron
Browse files
Cleaned up groupBy and unionBedFiles.
parent
2ff5a753
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
939d5390
...
...
@@ -37,6 +37,7 @@ SUBDIRS = $(SRC_DIR)/bamToBed \
UTIL_SUBDIRS
=
$(SRC_DIR)
/utils/lineFileUtilities
\
$(SRC_DIR)
/utils/bedFile
\
$(SRC_DIR)
/utils/bedGraphFile
\
$(SRC_DIR)
/utils/tabFile
\
$(SRC_DIR)
/utils/genomeFile
\
$(SRC_DIR)
/utils/gzstream
\
...
...
src/groupBy/groupBy.cpp
View file @
939d5390
...
...
@@ -185,27 +185,26 @@ void ShowHelp(void) {
cerr
<<
"
\t
-grp
\t
"
<<
"Specify the columns (1-based) for the grouping."
<<
endl
;
cerr
<<
"
\t\t
The columns must be comma separated."
<<
endl
;
cerr
<<
"
\t\t
Default: 1,2,3"
<<
endl
<<
endl
;
cerr
<<
"
\t\t
-
Default: 1,2,3"
<<
endl
<<
endl
;
cerr
<<
"
\t
-opCol
\t
"
<<
"Specify the column (1-based) that should be summarized."
<<
endl
;
cerr
<<
"
\t\t
Required."
<<
endl
<<
endl
;
cerr
<<
"
\t
-opCol
s
\t
"
<<
"Specify the column (1-based) that should be summarized."
<<
endl
;
cerr
<<
"
\t\t
-
Required."
<<
endl
<<
endl
;
cerr
<<
"
\t
-op
\t
"
<<
"Specify the operation that should be applied to opCol."
<<
endl
;
cerr
<<
"
\t
-op
s
\t
"
<<
"Specify the operation that should be applied to opCol."
<<
endl
;
cerr
<<
"
\t\t
Valid operations: sum, count, min, max, mean, median,"
<<
endl
;
cerr
<<
"
\t\t
mode, antimode, stdev, collapse (i.e., print a comma separated list)"
<<
endl
;
cerr
<<
"
\t\t
Default: sum"
<<
endl
;
cerr
<<
"
\t\t
mode, antimode, stdev, sstdev (sample standard dev.), and"
<<
endl
;
cerr
<<
"
\t\t
collapse (i.e., print a comma separated list)"
<<
endl
;
cerr
<<
"
\t\t
- Default: sum"
<<
endl
<<
endl
;
cerr
<<
"Examples: "
<<
endl
;
cerr
<<
"
\t
$ cat
test
.out"
<<
endl
;
cerr
<<
"
\t
chr1 10 20 A chr1 15 25 1000"
<<
endl
;
cerr
<<
"
\t
chr1 10 20 A chr1 25 35 10000"
<<
endl
<<
endl
;
cerr
<<
"
\t
$
cat test.out |
groupBy -i
stdin
-grp 1,2,3,4 -opCol
8
-op sum"
<<
endl
;
cerr
<<
"
\t
$ cat
ex1
.out"
<<
endl
;
cerr
<<
"
\t
chr1 10 20 A chr1 15 25
B.1
1000"
<<
endl
;
cerr
<<
"
\t
chr1 10 20 A chr1 25 35
B.2
10000"
<<
endl
<<
endl
;
cerr
<<
"
\t
$ groupBy -i
ex1.out
-grp 1,2,3,4 -opCol
s 9
-op
s
sum"
<<
endl
;
cerr
<<
"
\t
chr1 10 20 A 11000"
<<
endl
<<
endl
;
cerr
<<
"
\t
$ cat test.out | groupBy -i stdin -grp 1,2,3,4 -opCol 8 -op max"
<<
endl
;
cerr
<<
"
\t
chr1 10 20 A 1000"
<<
endl
<<
endl
;
cerr
<<
"
\t
$ cat test.out | groupBy -i stdin -grp 1,2,3,4 -opCol 8 -op mean"
<<
endl
;
cerr
<<
"
\t
chr1 10 20 A 5500"
<<
endl
<<
endl
;
cerr
<<
"
\t
$ cat test.out | groupBy -i stdin -grp 1,2,3,4 -opCol 8 -op collapse"
<<
endl
;
cerr
<<
"
\t
$ groupBy -i ex1.out -grp 1,2,3,4 -opCols 9,9 -ops sum,max"
<<
endl
;
cerr
<<
"
\t
chr1 10 20 A 11000 10000"
<<
endl
<<
endl
;
cerr
<<
"
\t
$ groupBy -i ex1.out -grp 1,2,3,4 -opCols 8,9 -ops collapse,mean"
<<
endl
;
cerr
<<
"
\t
chr1 10 20 A 1000,10000,"
<<
endl
<<
endl
;
cerr
<<
"Notes: "
<<
endl
;
...
...
src/utils/bedFile/bedFile.cpp
View file @
939d5390
...
...
@@ -163,47 +163,6 @@ void BedFile::Open(void) {
cerr
<<
"Error: Unexpected file type ("
<<
bedFile
<<
"). Exiting!"
<<
endl
;
exit
(
1
);
}
// Old method.
/*
else {
size_t foundPos;
foundPos = bedFile.find_last_of(".gz");
// is this a GZIPPED BED file?
if (foundPos == bedFile.size() - 1) {
igzstream beds(bedFile.c_str(), ios::in);
if ( !beds ) {
cerr << "Error: The requested bed file (" << bedFile << ") could not be opened. Exiting!" << endl;
exit (1);
}
else {
// if so, close it (this was just a test)
beds.close();
// now set a pointer to the stream so that we
// can read the file later on.
// Thank God for Josuttis, p. 631!
_bedStream = new igzstream(bedFile.c_str(), ios::in);
}
}
// not GZIPPED.
else {
ifstream beds(bedFile.c_str(), ios::in);
// can we open the file?
if ( !beds ) {
cerr << "Error: The requested bed file (" << bedFile << ") could not be opened. Exiting!" << endl;
exit (1);
}
else {
// if so, close it (this was just a test)
beds.close();
// now set a pointer to the stream so that we
// can read the file later on.
// Thank God for Josuttis, p. 631!
_bedStream = new ifstream(bedFile.c_str(), ios::in);
}
}
}*/
}
...
...
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