Commit ed59faae authored by Neil Kindlon's avatar Neil Kindlon
Browse files

first check in for mass refactor from program to tools API

parent 1fcf780c
......@@ -79,6 +79,8 @@ UTIL_SUBDIRS = $(SRC_DIR)/utils/bedFile \
$(SRC_DIR)/utils/chromsweep \
$(SRC_DIR)/utils/Contexts \
$(SRC_DIR)/utils/FileRecordTools \
$(SRC_DIR)/utils/FileRecordTools/FileReaders \
$(SRC_DIR)/utils/FileRecordTools/Records \
$(SRC_DIR)/utils/general \
$(SRC_DIR)/utils/gzstream \
$(SRC_DIR)/utils/fileType \
......@@ -93,15 +95,47 @@ UTIL_SUBDIRS = $(SRC_DIR)/utils/bedFile \
$(SRC_DIR)/utils/Fasta \
$(SRC_DIR)/utils/VectorOps \
$(SRC_DIR)/utils/GenomeFile \
$(SRC_DIR)/utils/RecordOutputMgr
$(SRC_DIR)/utils/RecordOutputMgr \
$(SRC_DIR)/utils/ToolBase \
$(SRC_DIR)/utils/aux
BUILT_OBJECTS = $(OBJ_DIR)/*.o
INCLUDES = -I$(SRC_DIR)/utils/bedFile \
-I$(SRC_DIR)/utils/BinTree \
-I$(SRC_DIR)/utils/version \
-I$(SRC_DIR)/utils/bedGraphFile \
-I$(SRC_DIR)/utils/chromsweep \
-I$(SRC_DIR)/utils/Contexts \
-I$(SRC_DIR)/utils/FileRecordTools \
-I$(SRC_DIR)/utils/FileRecordTools/FileReaders \
-I$(SRC_DIR)/utils/FileRecordTools/Records \
-I$(SRC_DIR)/utils/general \
-I$(SRC_DIR)/utils/gzstream \
-I$(SRC_DIR)/utils/fileType \
-I$(SRC_DIR)/utils/bedFilePE \
-I$(SRC_DIR)/utils/KeyListOps \
-I$(SRC_DIR)/utils/NewChromsweep \
-I$(SRC_DIR)/utils/sequenceUtilities \
-I$(SRC_DIR)/utils/tabFile \
-I$(SRC_DIR)/utils/BamTools \
-I$(SRC_DIR)/utils/BamTools/include \
-I$(SRC_DIR)/utils/BamTools/src \
-I$(SRC_DIR)/utils/BamTools-Ancillary \
-I$(SRC_DIR)/utils/BlockedIntervals \
-I$(SRC_DIR)/utils/Fasta \
-I$(SRC_DIR)/utils/VectorOps \
-I$(SRC_DIR)/utils/GenomeFile \
-I$(SRC_DIR)/utils/RecordOutputMgr \
-I$(SRC_DIR)/utils/ToolBase \
-I$(SRC_DIR)/utils/aux \
all: print_banner $(OBJ_DIR) $(BIN_DIR) autoversion $(UTIL_SUBDIRS) $(SUBDIRS)
@echo "- Building main bedtools binary."
@$(CXX) $(CXXFLAGS) -c src/bedtools.cpp -o obj/bedtools.o -I$(UTIL_DIR)/version/
@$(CXX) $(CXXFLAGS) -o $(BIN_DIR)/bedtools $(BUILT_OBJECTS) -L$(UTIL_DIR)/BamTools/lib/ -lbamtools $(LIBS) $(LDFLAGS)
@$(CXX) $(CXXFLAGS) -c src/bedtools.cpp -o obj/bedtools.o $(INCLUDES)
@$(CXX) $(CXXFLAGS) -o $(BIN_DIR)/bedtools $(BUILT_OBJECTS) -L$(UTIL_DIR)/BamTools/lib/ -lbamtools $(LIBS) $(LDFLAGS) $(INCLUDES)
@echo "done."
@echo "- Creating executables for old CLI."
......
......@@ -17,8 +17,8 @@
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <string>
#include "version.h"
#include "BedtoolsDriver.h"
using namespace std;
......@@ -34,6 +34,9 @@ using namespace std;
// define our parameter checking macro
#define PARAMETER_CHECK(param, paramLen, actualLen) (strncmp(argv[i], param, min(actualLen, paramLen))== 0) && (actualLen == paramLen)
bool sub_main(const QuickString &subCmd);
void showHelp(const QuickString &subCmd);
int annotate_main(int argc, char* argv[]);//
int bamtobed_main(int argc, char* argv[]);//
int bamtofastq_main(int argc, char* argv[]);//
......@@ -41,7 +44,7 @@ int bed12tobed6_main(int argc, char* argv[]); //
int bedtobam_main(int argc, char* argv[]);//
int bedtoigv_main(int argc, char* argv[]);//
int bedpetobam_main(int argc, char* argv[]);//
int closest_main(int argc, char* argv[]); //
void closest_help();
int cluster_main(int argc, char* argv[]); //
int complement_main(int argc, char* argv[]);//
int coverage_main(int argc, char* argv[]); //
......@@ -52,13 +55,14 @@ int flank_main(int argc, char* argv[]); //
int genomecoverage_main(int argc, char* argv[]);//
int getoverlap_main(int argc, char* argv[]);//
int groupby_main(int argc, char* argv[]);//
int intersect_main(int argc, char* argv[]); //
int jaccard_main(int argc, char* argv[]); //
int fisher_main(int argc, char* argv[]); //
void intersect_help();
void map_help();
void jaccard_help(); //
void fisher_help();
int links_main(int argc, char* argv[]);//
int maskfastafrombed_main(int argc, char* argv[]);//
int map_main(int argc, char* argv[]); //
int merge_main(int argc, char* argv[]); //
void merge_help();
int multibamcov_main(int argc, char* argv[]);//
int multiintersect_main(int argc, char* argv[]);//
int nek_sandbox1_main(int argc, char* argv[]);//
......@@ -67,13 +71,13 @@ int pairtobed_main(int argc, char* argv[]);//
int pairtopair_main(int argc, char* argv[]);//
int random_main(int argc, char* argv[]); //
int reldist_main(int argc, char* argv[]); //
int sample_main(int argc, char* argv[]); //
void sample_help();
int shuffle_main(int argc, char* argv[]); //
int slop_main(int argc, char* argv[]); //
int split_main(int argc, char* argv[]); //
int sort_main(int argc, char* argv[]); //
int spacing_main(int argc, char* argv[]); //
int subtract_main(int argc, char* argv[]); //
void spacing_help();
void subtract_help();
int tagbam_main(int argc, char* argv[]);//
int unionbedgraphs_main(int argc, char* argv[]);//
int window_main(int argc, char* argv[]); //
......@@ -87,83 +91,83 @@ int main(int argc, char *argv[])
// make sure the user at least entered a sub_command
if (argc < 2) return bedtools_help();
std::string sub_cmd = argv[1];
QuickString subCmd(argv[1]);
BedtoolsDriver btDriver;
if (btDriver.supports(subCmd)) {
if (btDriver.subMain(argc, argv)) {
return 0;
} else {
showHelp(subCmd);
return 1;
}
}
// genome arithmetic tools
if (sub_cmd == "intersect") return intersect_main(argc-1, argv+1);
else if (sub_cmd == "window") return window_main(argc-1, argv+1);
else if (sub_cmd == "closest") return closest_main(argc-1, argv+1);
else if (sub_cmd == "coverage") return coverage_main(argc-1, argv+1);
else if (sub_cmd == "map") return map_main(argc-1, argv+1);
else if (sub_cmd == "genomecov") return genomecoverage_main(argc-1, argv+1);
else if (sub_cmd == "merge") return merge_main(argc-1, argv+1);
else if (sub_cmd == "cluster") return cluster_main(argc-1, argv+1);
else if (sub_cmd == "complement") return complement_main(argc-1, argv+1);
else if (sub_cmd == "subtract") return subtract_main(argc-1, argv+1);
else if (sub_cmd == "slop") return slop_main(argc-1, argv+1);
else if (sub_cmd == "split") return split_main(argc-1, argv+1);
else if (sub_cmd == "flank") return flank_main(argc-1, argv+1);
else if (sub_cmd == "sort") return sort_main(argc-1, argv+1);
else if (sub_cmd == "random") return random_main(argc-1, argv+1);
else if (sub_cmd == "shuffle") return shuffle_main(argc-1, argv+1);
else if (sub_cmd == "spacing") return spacing_main(argc-1, argv+1);
else if (sub_cmd == "annotate") return annotate_main(argc-1, argv+1);
else if (subCmd == "window") return window_main(argc-1, argv+1);
else if (subCmd == "coverage") return coverage_main(argc-1, argv+1);
else if (subCmd == "genomecov") return genomecoverage_main(argc-1, argv+1);
else if (subCmd == "cluster") return cluster_main(argc-1, argv+1);
else if (subCmd == "complement") return complement_main(argc-1, argv+1);
else if (subCmd == "slop") return slop_main(argc-1, argv+1);
else if (subCmd == "split") return split_main(argc-1, argv+1);
else if (subCmd == "flank") return flank_main(argc-1, argv+1);
else if (subCmd == "sort") return sort_main(argc-1, argv+1);
else if (subCmd == "random") return random_main(argc-1, argv+1);
else if (subCmd == "shuffle") return shuffle_main(argc-1, argv+1);
else if (subCmd == "annotate") return annotate_main(argc-1, argv+1);
// Multi-way file comparisonstools
else if (sub_cmd == "multiinter") return multiintersect_main(argc-1, argv+1);
else if (sub_cmd == "unionbedg") return unionbedgraphs_main(argc-1, argv+1);
else if (subCmd == "multiinter") return multiintersect_main(argc-1, argv+1);
else if (subCmd == "unionbedg") return unionbedgraphs_main(argc-1, argv+1);
// paired-end conversion tools
else if (sub_cmd == "pairtobed") return pairtobed_main(argc-1, argv+1);
else if (sub_cmd == "pairtopair") return pairtopair_main(argc-1, argv+1);
else if (subCmd == "pairtobed") return pairtobed_main(argc-1, argv+1);
else if (subCmd == "pairtopair") return pairtopair_main(argc-1, argv+1);
// format conversion tools
else if (sub_cmd == "bamtobed") return bamtobed_main(argc-1, argv+1);
else if (sub_cmd == "bedtobam") return bedtobam_main(argc-1, argv+1);
else if (sub_cmd == "bamtofastq") return bamtofastq_main(argc-1, argv+1);
else if (sub_cmd == "bedpetobam") return bedpetobam_main(argc-1, argv+1);
else if (sub_cmd == "bed12tobed6") return bed12tobed6_main(argc-1, argv+1);
else if (subCmd == "bamtobed") return bamtobed_main(argc-1, argv+1);
else if (subCmd == "bedtobam") return bedtobam_main(argc-1, argv+1);
else if (subCmd == "bamtofastq") return bamtofastq_main(argc-1, argv+1);
else if (subCmd == "bedpetobam") return bedpetobam_main(argc-1, argv+1);
else if (subCmd == "bed12tobed6") return bed12tobed6_main(argc-1, argv+1);
// BAM-specific tools
else if (sub_cmd == "multicov") return multibamcov_main(argc-1, argv+1);
else if (sub_cmd == "tag") return tagbam_main(argc-1, argv+1);
else if (subCmd == "multicov") return multibamcov_main(argc-1, argv+1);
else if (subCmd == "tag") return tagbam_main(argc-1, argv+1);
// fasta tools
else if (sub_cmd == "getfasta") return fastafrombed_main(argc-1, argv+1);
else if (sub_cmd == "maskfasta") return maskfastafrombed_main(argc-1, argv+1);
else if (sub_cmd == "nuc") return nuc_main(argc-1, argv+1);
else if (subCmd == "getfasta") return fastafrombed_main(argc-1, argv+1);
else if (subCmd == "maskfasta") return maskfastafrombed_main(argc-1, argv+1);
else if (subCmd == "nuc") return nuc_main(argc-1, argv+1);
// statistics tools
else if (sub_cmd == "jaccard") return jaccard_main(argc-1, argv+1);
else if (sub_cmd == "reldist") return reldist_main(argc-1, argv+1);
else if (sub_cmd == "fisher") return fisher_main(argc-1, argv+1);
else if (subCmd == "reldist") return reldist_main(argc-1, argv+1);
// misc. tools
else if (sub_cmd == "overlap") return getoverlap_main(argc-1, argv+1);
else if (sub_cmd == "igv") return bedtoigv_main(argc-1, argv+1);
else if (sub_cmd == "links") return links_main(argc-1, argv+1);
else if (sub_cmd == "makewindows") return windowmaker_main(argc-1, argv+1);
else if (sub_cmd == "groupby") return groupby_main(argc-1, argv+1);
else if (sub_cmd == "expand") return expand_main(argc-1, argv+1);
else if (sub_cmd == "sample") return sample_main(argc-1, argv+1);
else if (sub_cmd == "neksb1") return nek_sandbox1_main(argc-1, argv+1);
else if (sub_cmd == "regresstest") return regress_test_main(argc, argv); //this command does need all the orig args.
else if (subCmd == "overlap") return getoverlap_main(argc-1, argv+1);
else if (subCmd == "igv") return bedtoigv_main(argc-1, argv+1);
else if (subCmd == "links") return links_main(argc-1, argv+1);
else if (subCmd == "makewindows") return windowmaker_main(argc-1, argv+1);
else if (subCmd == "groupby") return groupby_main(argc-1, argv+1);
else if (subCmd == "expand") return expand_main(argc-1, argv+1);
else if (subCmd == "neksb1") return nek_sandbox1_main(argc-1, argv+1);
else if (subCmd == "regresstest") return regress_test_main(argc, argv); //this command does need all the orig args.
// help
else if (sub_cmd == "-h" || sub_cmd == "--help" ||
sub_cmd == "-help")
else if (subCmd == "-h" || subCmd == "--help" ||
subCmd == "-help")
return bedtools_help();
// frequently asked questions
else if (sub_cmd == "--FAQ" || sub_cmd == "--faq" ||
sub_cmd == "-FAQ" || sub_cmd == "-faq")
else if (subCmd == "--FAQ" || subCmd == "--faq" ||
subCmd == "-FAQ" || subCmd == "-faq")
return bedtools_faq();
// verison information
else if (sub_cmd == "-version" || sub_cmd == "--version")
else if (subCmd == "-version" || subCmd == "--version")
cout << "bedtools " << VERSION << endl;
// verison information
else if (sub_cmd == "-contact" || sub_cmd == "--contact")
else if (subCmd == "-contact" || subCmd == "--contact")
{
cout << endl;
cout << "- For further help, or to report a bug, please " << endl;
......@@ -282,3 +286,25 @@ int bedtools_faq(void)
cout << "\n";
return 0;
}
void showHelp(const QuickString &subCmd) {
if (subCmd == "intersect") {
intersect_help();
} else if (subCmd == "map") {
map_help();
} else if (subCmd == "closest") {
closest_help();
} else if (subCmd == "merge") {
merge_help();
} else if (subCmd == "jaccard") {
jaccard_help();
} else if (subCmd == "subtract") {
subtract_help();
} else if (subCmd == "sample") {
sample_help();
} else if (subCmd == "spacing") {
spacing_help();
} else if (subCmd == "fisher") {
fisher_help();
}
}
UTILITIES_DIR = ../utils/
OBJ_DIR = ../../obj/
BIN_DIR = ../../bin/
TOOL_DIR = ../../src/
# -------------------
# define our includes
......@@ -21,12 +22,15 @@ INCLUDES = -I$(UTILITIES_DIR)/Contexts/ \
-I$(UTILITIES_DIR)/RecordOutputMgr/ \
-I$(UTILITIES_DIR)/NewChromsweep \
-I$(UTILITIES_DIR)/BinTree \
-I$(UTILITIES_DIR)/version/
-I$(UTILITIES_DIR)/version/ \
-I$(UTILITIES_DIR)/ToolBase/ \
-I$(TOOL_DIR)/intersectFile/
# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= closestMain.cpp closestFile.cpp closestFile.h
OBJECTS= closestMain.o closestFile.o
SOURCES= closestHelp.cpp closestFile.cpp closestFile.h
OBJECTS= closestHelp.o closestFile.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
all: $(BUILT_OBJECTS)
......@@ -39,6 +43,6 @@ $(BUILT_OBJECTS): $(SOURCES)
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/closestMain.o $(OBJ_DIR)/closestFile.o
@rm -f $(OBJ_DIR)/closestHelp.o $(OBJ_DIR)/closestFile.o
.PHONY: clean
/*
* newClosestFile.cpp
*
* Created on: Sep 25, 2014
* Author: nek3d
*/
#include "FileRecordMgr.h"
#include "RecordOutputMgr.h"
#include "closestFile.h"
#include "CloseSweep.h"
ClosestFile::ClosestFile(ContextClosest *context)
: _context(context),
_recordOutputMgr(NULL)
{
_recordOutputMgr = new RecordOutputMgr();
_recordOutputMgr->init(_context);
}
ClosestFile::~ClosestFile() {
delete _recordOutputMgr;
}
bool ClosestFile::getClosest() {
CloseSweep sweep(_context);
if (!sweep.init()) {
return false;
}
RecordKeyVector hitSet;
while (sweep.next(hitSet)) {
if (_context->reportDistance()) {
_recordOutputMgr->printClosest(hitSet, &(sweep.getDistances()));
} else {
_recordOutputMgr->printClosest(hitSet, NULL);
}
}
if (!_context->hasGenomeFile()) {
sweep.closeOut(true);
}
return true;
}
/*
* closestFile.cpp
*
* Created on: Apr 22, 2015
* Author: nek3d
*/
#include "closestFile.h"
#include "CloseSweep.h"
ClosestFile::ClosestFile(ContextClosest *context)
: IntersectFile(context)
{
}
bool ClosestFile::findNext(RecordKeyVector &hits)
{
return nextSortedFind(hits);
}
void ClosestFile::processHits(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
{
if (upCast(_context)->reportDistance()) {
outputMgr->printClosest(hits, &(upCastSweep()->getDistances()));
} else {
outputMgr->printClosest(hits, NULL);
}
}
void ClosestFile::makeSweep() {
_sweep = new CloseSweep(upCast(_context));
}
/*
* newClosestFile.h
*
* Created on: Sep 25, 2014
* Author: nek3d
*/
#ifndef NEWCLOSESTFILE_H_
#define NEWCLOSESTFILE_H_
#include "ContextClosest.h"
using namespace std;
class RecordOutputMgr;
class ClosestFile {
public:
ClosestFile(ContextClosest *context);
~ClosestFile(void);
bool getClosest();
private:
ContextClosest *_context;
RecordOutputMgr *_recordOutputMgr;
};
#endif /* NEWCLOSESTFILE_H_ */
/*
* closestHeader.h
*
* Created on: Apr 22, 2015
* Author: nek3d
*/
#ifndef CLOSESTHEADER_H_
#define CLOSESTHEADER_H_
#include "intersectFile.h"
#include "ContextClosest.h"
#include "CloseSweep.h"
class ClosestFile : public IntersectFile {
public:
ClosestFile(ContextClosest *context);
bool findNext(RecordKeyVector &hits);
virtual void processHits(RecordOutputMgr *outputMgr, RecordKeyVector &hits);
protected:
virtual ContextClosest *upCast(ContextBase *context) { return static_cast<ContextClosest *>(context); }
virtual CloseSweep *upCastSweep() { return static_cast<CloseSweep *>(_sweep); }
virtual void makeSweep();
};
#endif /* CLOSESTHEADER_H_ */
/*
* newClosestMain.cpp
*
* Created on: Sep 25, 2014
* Author: nek3d
*/
using namespace std;
#include "closestFile.h"
#include "ContextClosest.h"
// define our program name
#define PROGRAM_NAME "bedtools closest"
void closest_help(void);
int closest_main(int argc, char* argv[]) {
ContextClosest *context = new ContextClosest();
if (!context->parseCmdArgs(argc, argv, 1) || context->getShowHelp() || !context->isValidState()) {
if (!context->getErrorMsg().empty()) {
cerr << context->getErrorMsg() << endl;
}
closest_help();
delete context;
return 1;
}
ClosestFile *closestFile = new ClosestFile(context);
bool retVal = closestFile->getClosest();
delete closestFile;
delete context;
return retVal ? 0 : 1;
}
void closest_help(void) {
cerr << "\nTool: bedtools closest (aka closestBed)" << endl;
cerr << "Version: " << VERSION << "\n";
cerr << "Summary: For each feature in A, finds the closest " << endl;
cerr << "\t feature (upstream or downstream) in B." << endl << endl;
cerr << "Usage: " << PROGRAM_NAME << " [OPTIONS] -a <bed/gff/vcf> -b <bed/gff/vcf>" << endl << endl;
cerr << "Options: " << endl;
cerr << "\t-s\t" << "Req. same strandedness. That is, find the closest feature in" << endl;
cerr << "\t\tB that overlaps A on the _same_ strand." << endl;
cerr << "\t\t- By default, overlaps are reported without respect to strand." << endl << endl;
cerr << "\t-S\t" << "Req. opposite strandedness. That is, find the closest feature" << endl;
cerr << "\t\tin B that overlaps A on the _opposite_ strand." << endl;
cerr << "\t\t- By default, overlaps are reported without respect to strand." << endl << endl;
cerr << "\t-d\t" << "In addition to the closest feature in B, " << endl;
cerr << "\t\treport its distance to A as an extra column." << endl;
cerr << "\t\t- The reported distance for overlapping features will be 0." << endl << endl;
cerr << "\t-D\t" << "Like -d, report the closest feature in B, and its distance to A" << endl;
cerr << "\t\tas an extra column. Unlike -d, use negative distances to report" << endl;
cerr << "\t\tupstream features." << endl;
cerr << "\t\tThe options for defining which orientation is \"upstream\" are:" << endl;
cerr << "\t\t- \"ref\" Report distance with respect to the reference genome. " << endl;
cerr << "\t\t B features with a lower (start, stop) are upstream" << endl;
cerr << "\t\t- \"a\" Report distance with respect to A." << endl;
cerr << "\t\t When A is on the - strand, \"upstream\" means B has a" << endl;
cerr << "\t\t higher (start,stop)." << endl;
cerr << "\t\t- \"b\" Report distance with respect to B." << endl;
cerr << "\t\t When B is on the - strand, \"upstream\" means A has a" << endl;
cerr << "\t\t higher (start,stop)." << endl << endl;
cerr << "\t-io\t" << "Ignore features in B that overlap A. That is, we want close," << endl;
cerr << "\t\tyet not touching features only." << endl << endl;
cerr << "\t-iu\t" << "Ignore features in B that are upstream of features in A." << endl;
cerr << "\t\tThis option requires -D and follows its orientation" << endl;
cerr << "\t\trules for determining what is \"upstream\"." << endl << endl;
cerr << "\t-id\t" << "Ignore features in B that are downstream of features in A." << endl;
cerr << "\t\tThis option requires -D and follows its orientation" << endl;
cerr << "\t\trules for determining what is \"downstream\"." << endl << endl;
cerr << "\t-fu\t" << "Choose first from features in B that are upstream of features in A." << endl;
cerr << "\t\tThis option requires -D and follows its orientation" << endl;
cerr << "\t\trules for determining what is \"upstream\"." << endl << endl;
cerr << "\t-fd\t" << "Choose first from features in B that are downstream of features in A." << endl;
cerr << "\t\tThis option requires -D and follows its orientation" << endl;
cerr << "\t\trules for determining what is \"downstream\"." << endl << endl;
cerr << "\t-t\t" << "How ties for closest feature are handled. This occurs when two" << endl;
cerr << "\t\tfeatures in B have exactly the same \"closeness\" with A." << endl;
cerr << "\t\tBy default, all such features in B are reported." << endl;
cerr << "\t\tHere are all the options:" << endl;
cerr << "\t\t- \"all\" Report all ties (default)." << endl;
cerr << "\t\t- \"first\" Report the first tie that occurred in the B file." << endl;
cerr << "\t\t- \"last\" Report the last tie that occurred in the B file." << endl << endl;
cerr << "\t-mdb\t" << "How multiple databases are resolved." << endl;
cerr << "\t\t- \"each\" Report closest records for each database (default)." << endl;
cerr << "\t\t- \"all\" Report closest records among all databases." << endl << endl;
cerr << "\t-names\t" << "When using multiple databases (-b), provide an alias for each that" << endl;
cerr <<"\t\twill appear instead of a fileId when also printing the DB record." << endl << endl;
cerr << "\t-filenames" << "\tWhen using multiple databases (-b), show each complete filename" << endl;
cerr <<"\t\t\tinstead of a fileId when also printing the DB record." << endl << endl;
cerr << "\t-k\t" << "Report the k closest hits. Default is 1. If tieMode = \"all\", " << endl;
cerr << "\t\t- all ties will still be reported." << endl << endl;
cerr << "\t-N\t" << "Require that the query and the closest hit have different names." << endl;
cerr << "\t\tFor BED, the 4th column is compared." << endl << endl;
cerr << "\t-header\t" << "Print the header from the A file prior to results." << endl << endl;
cerr << "\t-nonamecheck\t" << "For sorted data, don't throw an error if the file has different naming conventions" << endl;
cerr << "\t\t\tfor the same chromosome. ex. \"chr1\" vs \"chr01\"." << endl << endl;
cerr << "Notes: " << endl;
cerr << "\tReports \"none\" for chrom and \"-1\" for all other fields when a feature" << endl;
cerr << "\tis not found in B on the same chromosome as the feature in A." << endl;
cerr << "\tE.g. none\t-1\t-1" << endl << endl;
// end the program here
exit(1);