<commit_before>/*****************************************************************************
  shuffleBedMain.cpp

  (c) 2009 - <NAME>
  Hall Laboratory
  Department of Biochemistry and Molecular Genetics
  University of Virginia
  <EMAIL>

  Licenced under the GNU General Public License 2.0+ license.
******************************************************************************/
#include "shuffleBed.h"
#include "version.h"

using namespace std;

// define our program name
#define PROGRAM_NAME "shuffleBed"


// define our parameter checking macro
#define PARAMETER_CHECK(param, paramLen, actualLen) (strncmp(argv[i], param, min(actualLen, paramLen))== 0) && (actualLen == paramLen)

// function declarations
void ShowHelp(void);

int main(int argc, char* argv[]) {

	// our configuration variables
	bool showHelp = false;

	// input files
	string bedFile;
	string excludeFile;	
	string genomeFile;
	
	bool haveBed = false;
	bool haveGenome = false;
	bool haveExclude = false;
	bool haveSeed = false;
	int seed = -1;
	bool sameChrom = false;

	// check to see if we should print out some help
	if(argc <= 1) showHelp = true;

	for(int i = 1; i < argc; i++) {
		int parameterLength = (int)strlen(argv[i]);

		if((PARAMETER_CHECK("-h", 2, parameterLength)) || 
		(PARAMETER_CHECK("--help", 5, parameterLength))) {
			showHelp = true;
		}
	}

	if(showHelp) ShowHelp();

	// do some parsing (all of these parameters require 2 strings)
	for(int i = 1; i < argc; i++) {

		int parameterLength = (int)strlen(argv[i]);

 		if(PARAMETER_CHECK("-i", 2, parameterLength)) {
			if ((i+1) < argc) {
				haveBed = true;
				bedFile = argv[i + 1];
				i++;
			}
		}
		else if(PARAMETER_CHECK("-g", 2, parameterLength)) {
			if ((i+1) < argc) {
				haveGenome = true;
				genomeFile = argv[i + 1];
				i++;
			}
		}
		else if(PARAMETER_CHECK("-excl", 5, parameterLength)) {
			if ((i+1) < argc) {
				haveExclude = true;
				excludeFile = argv[i + 1];
				i++;
			}<commit_msg>shuffleBed assumes stdin.<commit_after>/*****************************************************************************
  shuffleBedMain.cpp

  (c) 2009 - <NAME>
  Hall Laboratory
  Department of Biochemistry and Molecular Genetics
  University of Virginia
  <EMAIL>

  Licenced under the GNU General Public License 2.0+ license.
******************************************************************************/
#include "shuffleBed.h"
#include "version.h"

using namespace std;

// define our program name
#define PROGRAM_NAME "shuffleBed"


// define our parameter checking macro
#define PARAMETER_CHECK(param, paramLen, actualLen) (strncmp(argv[i], param, min(actualLen, paramLen))== 0) && (actualLen == paramLen)

// function declarations
void ShowHelp(void);

int main(int argc, char* argv[]) {

	// our configuration variables
	bool showHelp = false;

	// input files
	string bedFile = "stdin";
	string excludeFile;	
	string genomeFile;
	
	bool haveBed     = true;
	bool haveGenome  = false;
	bool haveExclude = false;
	bool haveSeed    = false;
	int seed         = -1;
	bool sameChrom   = false;


	for(int i = 1; i < argc; i++) {
		int parameterLength = (int)strlen(argv[i]);

		if((PARAMETER_CHECK("-h", 2, parameterLength)) || 
		(PARAMETER_CHECK("--help", 5, parameterLength))) {
			showHelp = true;
		}
	}

	if(showHelp) ShowHelp();

	// do some parsing (all of these parameters require 2 strings)
	for(int i = 1; i < argc; i++) {

		int parameterLength = (int)strlen(argv[i]);

 		if(PARAMETER_CHECK("-i", 2, parameterLength)) {
			if ((i+1) < argc) {
				bedFile = argv[i + 1];
				i++;
			}
		}
		else if(PARAMETER_CHECK("-g", 2, parameterLength)) {
			if ((i+1) < argc) {
				haveGenome = true;
				genomeFile = argv[i + 1];
				i++;
			}
		}
		else if(PARAMETER_CHECK("-excl", 5, parameterLength)) {
			if ((i+1) < argc) {
				haveExclude = true;
				excludeFile = argv[i + 1];
				i++;
			}
{'fraction_non_alphanumeric': 0.21028158098682512, 'fraction_numerical': 0.011624903125807285, 'mean_word_length': 3.81592039800995, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2116757', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1245, 'n_words': 361}