From 548bcae0db988318f72742f1cd5cdeeb43e9f951 Mon Sep 17 00:00:00 2001 From: Brent Pedersen <bpederse@gmail.com> Date: Tue, 25 Nov 2014 14:41:26 -0700 Subject: [PATCH] add -m option to merge intervals --- src/fisher/fisherMain.cpp | 5 ++++- src/utils/Contexts/ContextFisher.cpp | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/fisher/fisherMain.cpp b/src/fisher/fisherMain.cpp index d35b2868..584664e1 100644 --- a/src/fisher/fisherMain.cpp +++ b/src/fisher/fisherMain.cpp @@ -34,7 +34,7 @@ void fisher_help(void) { cerr << "Summary: Calculate Fisher statistic b/w two feature files." << endl << endl; - cerr << "Usage: " << PROGRAM_NAME << " [OPTIONS] -a <bed/gff/vcf> -b <bed/gff/vcf> -c <possible counts>" << endl << endl; + cerr << "Usage: " << PROGRAM_NAME << " [OPTIONS] -a <bed/gff/vcf> -b <bed/gff/vcf> -g <genome file>" << endl << endl; cerr << "Options: " << endl; @@ -43,6 +43,9 @@ void fisher_help(void) { cerr << "\t\t- Default is 1E-9 (i.e., 1bp)." << endl; cerr << "\t\t- FLOAT (e.g. 0.50)" << endl << endl; + cerr << "\t-m\t" << "Merge overlapping intervals before" << endl; + cerr << "\t\t- looking at overlap." << endl << endl; + cerr << "\t-r\t" << "Require that the fraction overlap be reciprocal for A and B." << endl; cerr << "\t\t- In other words, if -f is 0.90 and -r is used, this requires" << endl; cerr << "\t\t that B overlap 90% of A and A _also_ overlaps 90% of B." << endl << endl; diff --git a/src/utils/Contexts/ContextFisher.cpp b/src/utils/Contexts/ContextFisher.cpp index fd00f982..2e9387dd 100644 --- a/src/utils/Contexts/ContextFisher.cpp +++ b/src/utils/Contexts/ContextFisher.cpp @@ -43,6 +43,10 @@ bool ContextFisher::parseCmdArgs(int argc, char **argv, int skipFirstArgs) if (strcmp(_argv[_i], "-g") == 0) { if (!handle_g()) return false; } + if(strcmp(_argv[_i], "-m") == 0) { + markUsed(_i - _skipFirstArgs); + setUseMergedIntervals(true); + } } return ContextIntersect::parseCmdArgs(argc, argv, _skipFirstArgs); } -- GitLab