Commit 33d4cc21 authored by jayhesselberth's avatar jayhesselberth
Browse files

fix param parsing; add 1 to win number

parent 6eada05c
...@@ -115,14 +115,14 @@ string WindowMaker::GenerateID(const BED& interval, uint32_t window_index, uint3 ...@@ -115,14 +115,14 @@ string WindowMaker::GenerateID(const BED& interval, uint32_t window_index, uint3
break; break;
case ID_WINDOW_NUMBER: case ID_WINDOW_NUMBER:
if (_reverse == true) { if (_reverse == true) {
s << "\t" << num_windows - window_index; s << "\t" << num_windows - window_index + 1;
} else { } else {
s << "\t" << window_index; s << "\t" << window_index;
} }
break; break;
case ID_SOURCE_ID_WINDOW_NUMBER: case ID_SOURCE_ID_WINDOW_NUMBER:
if (_reverse == true) { if (_reverse == true) {
s << "\t" << interval.name << "_" << num_windows - window_index; s << "\t" << interval.name << "_" << num_windows - window_index + 1;
} else { } else {
s << "\t" << interval.name << "_" << window_index; s << "\t" << interval.name << "_" << window_index;
} }
......
...@@ -98,10 +98,8 @@ int windowmaker_main(int argc, char* argv[]) { ...@@ -98,10 +98,8 @@ int windowmaker_main(int argc, char* argv[]) {
i++; i++;
} }
} }
else if(PARAMETER_CHECK("-reverse", 1, parameterLength)) { else if(PARAMETER_CHECK("-reverse", 8, parameterLength)) {
if ((i+1) < argc) { reverse = true;
reverse = true;
}
} }
else if(PARAMETER_CHECK("-i", 2, parameterLength)) { else if(PARAMETER_CHECK("-i", 2, parameterLength)) {
if ((i+1) < argc) { if ((i+1) < argc) {
...@@ -197,6 +195,10 @@ void windowmaker_help(void) { ...@@ -197,6 +195,10 @@ void windowmaker_help(void) {
cerr << "\t\tto fixed number of windows (i.e. same number of windows, with" << endl; cerr << "\t\tto fixed number of windows (i.e. same number of windows, with" << endl;
cerr << "\t\tvarying window sizes)." << endl << endl; cerr << "\t\tvarying window sizes)." << endl << endl;
cerr << "\t-reverse" << endl;
cerr << "\t\t Reverse numbering of windows in the output, i.e. report " << endl;
cerr << "\t\t windows in decreasing order" << endl << endl;
cerr << "ID Naming Options: " << endl; cerr << "ID Naming Options: " << endl;
cerr << "\t-i src|winnum|srcwinnum" << endl; cerr << "\t-i src|winnum|srcwinnum" << endl;
cerr << "\t\tThe default output is 3 columns: chrom, start, end ." << endl; cerr << "\t\tThe default output is 3 columns: chrom, start, end ." << endl;
...@@ -206,10 +208,6 @@ void windowmaker_help(void) { ...@@ -206,10 +208,6 @@ void windowmaker_help(void) {
cerr << "\t\t \"-i srcwinnum\" - use the source interval's name with the window number." << endl; cerr << "\t\t \"-i srcwinnum\" - use the source interval's name with the window number." << endl;
cerr << "\t\tSee below for usage examples." << endl << endl; cerr << "\t\tSee below for usage examples." << endl << endl;
cerr << "\t-reverse" << endl;
cerr << "\t\t Reverse numbering of windows in the output, i.e. report " << endl;
cerr << "\t\t windows in decreasing order" << endl << endl;
cerr << "Notes: " << endl; cerr << "Notes: " << endl;
cerr << "\t(1) The genome file should tab delimited and structured as follows:" << endl; cerr << "\t(1) The genome file should tab delimited and structured as follows:" << endl;
cerr << "\t <chromName><TAB><chromSize>" << endl << endl; cerr << "\t <chromName><TAB><chromSize>" << endl << endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment