From 9628eca3ee28ece860518b28c0b29e9feb7926b6 Mon Sep 17 00:00:00 2001 From: Aaron <aaronquinlan@gmail.com> Date: Thu, 14 Apr 2011 10:44:41 -0400 Subject: [PATCH] Tweaked Makefile and added notboth option to pairToPair. --- Makefile | 2 -- src/pairToPair/pairToPair.cpp | 2 +- src/pairToPair/pairToPair.h | 2 +- src/pairToPair/pairToPairMain.cpp | 10 +++++----- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index a340d6a8..0f78c5ec 100644 --- a/Makefile +++ b/Makefile @@ -21,10 +21,8 @@ SUBDIRS = $(SRC_DIR)/annotateBed \ $(SRC_DIR)/closestBed \ $(SRC_DIR)/complementBed \ $(SRC_DIR)/coverageBed \ - $(SRC_DIR)/cuffToTrans \ $(SRC_DIR)/fastaFromBed \ $(SRC_DIR)/flankBed \ - $(SRC_DIR)/fjoin \ $(SRC_DIR)/genomeCoverageBed \ $(SRC_DIR)/intersectBed \ $(SRC_DIR)/linksBed \ diff --git a/src/pairToPair/pairToPair.cpp b/src/pairToPair/pairToPair.cpp index 00daa46c..8cc90e77 100644 --- a/src/pairToPair/pairToPair.cpp +++ b/src/pairToPair/pairToPair.cpp @@ -124,7 +124,7 @@ void PairToPair::FindOverlaps(const BEDPE &a) { if ((hitsA2B1.size() > 0) || (hitsA1B2.size() > 0)) found2 = FindHitsOnBothEnds(a, hitsA2B1, hitsA1B2); - if (!found1 && !found2) + if (!found1 || !found2) _bedA->reportBedPENewLine(a); } else if (_searchType == "either") { diff --git a/src/pairToPair/pairToPair.h b/src/pairToPair/pairToPair.h index d69c5724..77d739c2 100644 --- a/src/pairToPair/pairToPair.h +++ b/src/pairToPair/pairToPair.h @@ -65,7 +65,7 @@ private: void FindQualityHitsBetweenEnds(CHRPOS start, CHRPOS end, const vector<MATE> &hits, vector<MATE> &qualityHits, int &numOverlaps); - void FindHitsOnBothEnds(const BEDPE &a, const vector<MATE> &qualityHitsEnd1, + bool FindHitsOnBothEnds(const BEDPE &a, const vector<MATE> &qualityHitsEnd1, const vector<MATE> &qualityHitsEnd2); void FindHitsOnEitherEnd(const BEDPE &a, const vector<MATE> &qualityHitsEnd1, diff --git a/src/pairToPair/pairToPairMain.cpp b/src/pairToPair/pairToPairMain.cpp index 97115f68..7f5761d0 100644 --- a/src/pairToPair/pairToPairMain.cpp +++ b/src/pairToPair/pairToPairMain.cpp @@ -122,8 +122,8 @@ int main(int argc, char* argv[]) { showHelp = true; } - if (haveSearchType && (searchType != "neither") && (searchType != "both") && (searchType != "either")) { - cerr << endl << "*****" << endl << "*****ERROR: Request \"both\" or \"neither\"" << endl << "*****" << endl; + if (haveSearchType && (searchType != "neither") && (searchType != "both") && (searchType != "either") && (searchType != "notboth")) { + cerr << endl << "*****" << endl << "*****ERROR: Request \"both\",\"neither\",\"either\",or \"notboth\"" << endl << "*****" << endl; showHelp = true; } @@ -160,11 +160,11 @@ void ShowHelp(void) { cerr << "\t-type \t" << "Approach to reporting overlaps between A and B." << endl << endl; cerr << "\t\tneither\tReport overlaps if neither end of A overlaps B." << endl; - cerr << "\t\teither\tReport overlaps if either ends of A overlap B." << endl; - cerr << "\t\tboth\tReport overlaps if both ends of A overlap B." << endl; - cerr << "\t\t\t- Default = both." << endl << endl; + cerr << "\t\tnotboth\tReport overlaps if one or neither of ends of A overlap B." << endl; + + cerr << "\t\t- Default = both." << endl << endl; cerr << "\t-slop \t" << "The amount of slop (in b.p.). to be added to each footprint." << endl; cerr << "\t\t*Note*: Slop is subtracted from start1 and start2 and added to end1 and end2." << endl << endl; -- GitLab