Commits

Qian Zhu  committed f61882a

created parameters for SeekMiner, SeekServer:
- the number of threads
- the fraction of genome a dataset should cover

  • Participants
  • Parent commits 4ecf0d2

Comments (0)

Files changed (12)

File src/seekcentral.cpp

 bool CSeekCentral::Initialize(
 	const string &output_dir, const string &query,
 	const string &search_dset, CSeekCentral *src, const int iClient,
-	const float query_min_required,
+	const float query_min_required, const float genome_min_required,
 	const enum CSeekDataset::DistanceMeasure eDistMeasure,
 	const bool bSubtractGeneAvg, const bool bNormPlatform){
 
+	fprintf(stderr, "Request received from client\n");
+
 	m_output_dir = output_dir; //LATER, TO BE DELETED
 	m_maxNumDB = src->m_maxNumDB;
 	m_bSharedDB = true;
 	m_numThreads = src->m_numThreads;
 	m_fScoreCutOff = src->m_fScoreCutOff;
 	m_fPercentQueryAfterScoreCutOff = query_min_required;
+	m_fPercentGenomeRequired = genome_min_required;
 	m_bSquareZ = src->m_bSquareZ;
 	m_bOutputText = src->m_bOutputText;
 	m_bSubtractGeneAvg = bSubtractGeneAvg;
 bool CSeekCentral::CheckDatasets(const bool &replace){
 	utype dd, j;
 	utype l;
+
+	//estimate string length
+	/*size_t total_length = 0;
+	utype ii;
+	for(ii=0; ii<m_vecstrDatasets.size(); ii++)
+		total_length+=m_vecstrDatasets[ii].length()+1;
+	total_length*=m_searchdsetMap.size();
+	char *ss = new char[total_length]; //search dataset
+	char *pointer_ss = &ss[0];
+	*/
+
 	stringstream ss; //search dataset (new!)
 	stringstream sq; //query availability
 	stringstream aq; //query (new!)
 
+	int maxGCoverage = GetMaxGenomeCoverage();
+
 	for(l=0; l<m_searchdsetMap.size(); l++){
 		utype iUserDatasets = m_searchdsetMap[l]->GetNumSet();
 		const vector<utype> &allRDatasets = m_searchdsetMap[l]->GetAllReverse();	
 			//datasets that contains all query genes (very stringent)
 			//if(present==m_vecstrAllQuery[l].size()){
 
-			int minRequired = (int) (m_fPercentQueryAfterScoreCutOff * 
+			int minRequired = 0;
+			if(m_vecstrAllQuery[l].size()>=5){
+				minRequired = (int) (m_fPercentQueryAfterScoreCutOff * 
 				m_vecstrAllQuery[l].size());
+			}else if(m_vecstrAllQuery[l].size()<=2){
+				minRequired = m_vecstrAllQuery[l].size();
+			}else{
+				minRequired = 2;
+			}
+			
+			int minGRequired = (int)(m_fPercentGenomeRequired*
+			(float) maxGCoverage);
+
 			//datasets containing some query genes (relaxed) [ 0 ] 
-			if(present>0 && present>=minRequired){
+			if(present>0 && present>=minRequired && 
+			si->GetNumSet()>=minGRequired){
 				if(isFirst){
 					isFirst = false;
+					//strcpy(pointer_ss, m_vecstrDatasets[i].c_str()); 
+					//pointer_ss+=m_vecstrDatasets[i].length();
 					ss << m_vecstrDatasets[i];
 				}else{
+					//strcpy(pointer_ss, (" " + m_vecstrDatasets[i]).c_str()); 
+					//pointer_ss+=m_vecstrDatasets[i].length()+1;
 					ss << " " << m_vecstrDatasets[i];
 				}
 			}
 
 		if(l!=m_searchdsetMap.size()-1){
 			ss << "|";
+			//strcpy(pointer_ss, "|\0");
+			//pointer_ss+=1;
 		}
 
 		//fprintf(stderr, "ss %s\n", ss.str().c_str());
 
 	string refinedQuery = aq.str();
 	string refinedSearchDataset = ss.str();
+	//string refinedSearchDataset = ss;
+	//delete[] ss;
+
 	string refinedGeneCount = sq.str();
 	if(m_bEnableNetwork){
 		CSeekNetwork::Send(m_iClient, refinedSearchDataset);
 	const bool bOutputWeightComponent, const bool bSimulateWeight,
 	const enum CSeekDataset::DistanceMeasure dist_measure,
 	const bool bSubtractAvg, const bool bNormPlatform,
-	const bool bLogit, const float fCutOff, const float fPercentRequired,
+	const bool bLogit, const float fCutOff, const float fPercentQueryRequired,
+	const float fPercentGenomeRequired,
 	const bool bSquareZ, const bool bRandom, const int iNumRandom,
-	gsl_rng *rand, const bool useNibble){
+	gsl_rng *rand, const bool useNibble, const int numThreads){
 
 	m_maxNumDB = buffer;
-	m_numThreads = 8; //changed from 8
+	m_numThreads = numThreads; //changed from 8
+
 	m_fScoreCutOff = fCutOff;
-	m_fPercentQueryAfterScoreCutOff = fPercentRequired;
+	m_fPercentQueryAfterScoreCutOff = fPercentQueryRequired;
+	m_fPercentGenomeRequired = fPercentGenomeRequired; 
 	m_bSquareZ = bSquareZ;
 
 	m_bOutputWeightComponent = bOutputWeightComponent;
 	const bool bOutputWeightComponent, const bool bSimulateWeight,
 	const enum CSeekDataset::DistanceMeasure dist_measure,
 	const bool bSubtractAvg, const bool bNormPlatform,
-	const bool bLogit, const float fCutOff, const float fPercentRequired,
+	const bool bLogit, const float fCutOff, 
+	const float fPercentQueryRequired, const float fPercentGenomeRequired,
 	const bool bSquareZ, const bool bRandom, const int iNumRandom,
-	gsl_rng *rand, const bool useNibble){
+	gsl_rng *rand, const bool useNibble, const int numThreads){
 
 	if(!CSeekCentral::Initialize(vecDBSetting, buffer, to_output_text,
 		bOutputWeightComponent, bSimulateWeight, dist_measure,
-		bSubtractAvg, bNormPlatform, bLogit, fCutOff, fPercentRequired,
-		bSquareZ, bRandom, iNumRandom, rand, useNibble)){
+		bSubtractAvg, bNormPlatform, bLogit, fCutOff, 
+		fPercentQueryRequired, fPercentGenomeRequired,
+		bSquareZ, bRandom, iNumRandom, rand, useNibble, numThreads)){
 		return false;
 	}
 
 	return true;
 }
 
+int CSeekCentral::GetMaxGenomeCoverage(){
+	utype d;
+	int max = 0;
+	for(d=0; d<m_vecstrDatasets.size(); d++){
+		CSeekIntIntMap *mapG = m_vc[d]->GetGeneMap();
+		if(mapG->GetNumSet()>max){
+			max = mapG->GetNumSet();
+		}
+	}
+	return max;
+}
+
 
 bool CSeekCentral::Common(CSeekCentral::SearchMode &sm,
 	gsl_rng *rnd, const CSeekQuery::PartitionMode *PART_M,
 	//fprintf(stderr, "0 %lu\n", CMeta::GetMemoryUsage());
 	current_sm = sm;
 
+	int maxGCoverage = GetMaxGenomeCoverage();
+
+	//fprintf(stderr, "Min gene required %.2f %d %d\n", m_fPercentGenomeRequired,
+	//	maxGCoverage, (int)(m_fPercentGenomeRequired*(float) maxGCoverage));
+
 	for(i=0; i<m_vecstrAllQuery.size(); i++){
 		//simulated weight case ======================
 		/*if(simulateWeight && redoWithEqual>=1) //1 or 2 
 			CSeekIntIntMap *mapG = m_vc[d]->GetGeneMap();
 			CSeekIntIntMap *mapQ = m_vc[d]->GetQueryMap();
 
-			//if(mapG->GetNumSet()<10000){
-			//	continue;
-			//}
+			//if dataset contains less than required number of genes, skip
+			if(mapG->GetNumSet()<(int)(m_fPercentGenomeRequired*
+			(float) maxGCoverage)){ //10000
+				continue;
+			}
 
 			if(mapQ==NULL ||mapQ->GetNumSet()==0){
 				if(DEBUG) fprintf(stderr, "This dataset is skipped\n");

File src/seekcentral.h

 		const bool bOutputWeightComponent = false, const bool bSimulateWeight = false,
 		const enum CSeekDataset::DistanceMeasure dist_measure = CSeekDataset::Z_SCORE,
 		const bool bSubtractAvg = true, const bool bNormPlatform = false,
-		const bool bLogit = false, const float fCutOff = -9999, const float fPercentRequired = 0,
+		const bool bLogit = false, const float fCutOff = -9999, 
+		const float fPercentQueryRequired = 0, const float fPercentGenomeRequired = 0,
 		const bool bSquareZ = false, const bool bRandom = false, const int iNumRandom = 10,
-		gsl_rng *rand = NULL, const bool useNibble = false);
+		gsl_rng *rand = NULL, const bool useNibble = false, const int numThreads = 8);
 
     /*!
      * \brief Initialize function
 		const bool bOutputWeightComponent = false, const bool bSimulateWeight = false,
 		const enum CSeekDataset::DistanceMeasure dist_measure = CSeekDataset::Z_SCORE,
 		const bool bSubtractAvg = true, const bool bNormPlatform = false,
-		const bool bLogit = false, const float fCutOff = -9999, const float fPercentRequired = 0,
+		const bool bLogit = false, const float fCutOff = -9999, 
+		const float fPercentQueryRequired = 0, const float fPercentGenomeRequired = 0,
 		const bool bSquareZ = false, const bool bRandom = false, const int iNumRandom = 10,
-		gsl_rng *rand = NULL, const bool useNibble = false);
+		gsl_rng *rand = NULL, const bool useNibble = false, const int numThreads = 8);
 
     /*!
      * \brief Initialize function
      */
 	bool Initialize(const string &output_dir, const string &query,
 		const string &search_dset, CSeekCentral* src, const int iClient,
-		const float query_min_required = 0,
+		const float query_min_required = 0, const float genome_min_required = 0,
 		const enum CSeekDataset::DistanceMeasure = CSeekDataset::Z_SCORE,
 		const bool bSubtractGeneAvg = true, const bool bNormPlatform = false);
 
 	 */
 	bool Destruct();
 
+	/*!
+	 * \brief Get the maximum genome coverage among the 
+	 * datasets in the compendium.
+	 */
+	int GetMaxGenomeCoverage();
+
 private:
 	//network mode
 	bool EnableNetwork(const int&);
 	string m_output_dir;
 	float m_fScoreCutOff;
 	float m_fPercentQueryAfterScoreCutOff;
+	float m_fPercentGenomeRequired;
 
 	/* for order statistics, a datasets-by-genes matrix */
 	utype **m_rank_d;

File src/seekreader.cpp

 	int ret; //system call return
 
 	fprintf(stderr, "Initializing query map\n"); 
-	ret = system("date +%s%N 1>&2");
-	if(bNetwork && CSeekNetwork::Send(iClient, "Initializing query map")==-1){
+	//ret = system("date +%s%N 1>&2");
+	/*if(bNetwork && CSeekNetwork::Send(iClient, "Initializing query map")==-1){
 		fprintf(stderr, "Error sending client message\n");
 		return false;
-	}
+	}*/
 	
 	#pragma omp parallel for \
 	shared(allQ) private(i) schedule(dynamic)
 	}
 
 	fprintf(stderr, "Done initializing query map\n");
-	ret = system("date +%s%N 1>&2");
-	if(bNetwork && CSeekNetwork::Send(iClient, 
+	//ret = system("date +%s%N 1>&2");
+	/*if(bNetwork && CSeekNetwork::Send(iClient, 
 		"Done initializing query map")==-1){
 		fprintf(stderr, "Error sending client message\n");
 		return false;
-	}
+	}*/
 
 	fprintf(stderr, "Reading %lu query genes' correlations\n",
 		allQ.size());
 
 	int ret; //system call returns
 
-	fprintf(stderr, "Start reading average and presence files\n");
-	ret = system("date +%s%N 1>&2");
-	fprintf(stderr, "Done reading average and presence files\n");
-	ret = system("date +%s%N 1>&2");
+	//fprintf(stderr, "Start reading average and presence files (quick)\n");
+	//ret = system("date +%s%N 1>&2");
+	//fprintf(stderr, "Done reading average and presence files (quick)\n");
+	//ret = system("date +%s%N 1>&2");
 
-	fprintf(stderr, "Initializing gene map\n"); ret = system("date +%s%N 1>&2");
+	fprintf(stderr, "Initializing gene map\n");
+	//ret = system("date +%s%N 1>&2");
 	#pragma omp parallel for \
 	private(i) schedule(dynamic)
 	for(i=0; i<iDatasets; i++){
 		vc[i]->SetPlatform(vp[platform_id]);
 	}
 
-	fprintf(stderr, "Done initializing gene map\n"); ret = system("date +%s%N 1>&2");
+	fprintf(stderr, "Done initializing gene map\n"); 
+	//ret = system("date +%s%N 1>&2");
 	return true;
 }
 

File tools/PCLServer/PCLServer.cpp

 
 #define BACKLOG 10   // how many pending connections queue will hold
 char *PORT;
-int NUM_DSET_MEMORY = 300;
+int NUM_DSET_MEMORY = 2000;
 string pcl_input_dir;
 
 CPCL **pcl;

File tools/SeekMiner/SeekMiner.cpp

 	//vector<vector<string> > newQ;
 	//CSeekTools::ReadMultipleQueries("/tmp/ex_query2.txt", newQ);
 
+
 	enum CSeekDataset::DistanceMeasure eDistMeasure;
 	if(dist_measure=="pearson"){
 		eDistMeasure = CSeekDataset::CORRELATION;
 		eDistMeasure,
 		!!sArgs.norm_subavg_flag, !!sArgs.norm_subavg_plat_flag,
 		false,
-		sArgs.score_cutoff_arg, sArgs.per_q_required_arg, !!sArgs.square_z_flag,
-		!!sArgs.random_flag, sArgs.num_random_arg, random_ranking_rnd, useNibble))
+		sArgs.score_cutoff_arg, 
+		sArgs.per_q_required_arg, sArgs.per_g_required_arg,
+		!!sArgs.square_z_flag,
+		!!sArgs.random_flag, sArgs.num_random_arg, random_ranking_rnd, useNibble, 
+		sArgs.num_threads_arg))
 		return -1;
 
 	if(method=="CV"){

File tools/SeekMiner/SeekMiner.ggo

 								string	typestr="filename"	yes								
 option	"num_db"			n	"Number of databaselets in database"
 								int	default="1000"	yes
+option	"num_threads"		T	"Number of threads"
+								int default="8"
+option	"per_g_required"	H	"Fraction (max 1.0) of genome required to be present in a dataset. Datasets not meeting the minimum required genes are skipped."
+								float default="0.0"
 
 section "Dataset weighting"
 option	"weighting_method"	V	"Weighting method: query cross-validated weighting (CV), equal weighting (EQUAL), order statistics weighting (ORDER_STAT), variance weighting (VAR), user-given weighting (USER), SPELL weighting (AVERAGE_Z)"

File tools/SeekMiner/cmdline.c

 /*
-  File autogenerated by gengetopt version 2.22.5
+  File autogenerated by gengetopt version 2.22
   generated with the following command:
-  /usr/bin/gengetopt -iSeekMiner.ggo --default-optional -u -N -e 
+  gengetopt -iSeekMiner.ggo --default-optional -u -N -e 
 
   The developers of gengetopt consider the fixed text that goes in all
   gengetopt output files to be in the public domain:
 #include <stdlib.h>
 #include <string.h>
 
-#ifndef FIX_UNUSED
-#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
-#endif
-
-#include <getopt.h>
+#include "getopt.h"
 
 #include "cmdline.h"
 
   "  -U, --dir_gvar=directory      Gene variance directory (containing .gexpvar \n                                  files)  (default=`NA')",
   "  -Q, --quant=filename          quant file (assuming all datasets use the same \n                                  quantization)",
   "  -n, --num_db=INT              Number of databaselets in database  \n                                  (default=`1000')",
+  "  -T, --num_threads=INT         Number of threads  (default=`8')",
+  "  -H, --per_g_required=FLOAT    Fraction (max 1.0) of genome required to be \n                                  present in a dataset. Datasets not meeting \n                                  the minimum required genes are skipped.  \n                                  (default=`0.0')",
   "\nDataset weighting:",
   "  -V, --weighting_method=STRING Weighting method: query cross-validated \n                                  weighting (CV), equal weighting (EQUAL), \n                                  order statistics weighting (ORDER_STAT), \n                                  variance weighting (VAR), user-given \n                                  weighting (USER), SPELL weighting (AVERAGE_Z) \n                                   (possible values=\"CV\", \"EQUAL\", \n                                  \"ORDER_STAT\", \"VAR\", \"USER\", \n                                  \"AVERAGE_Z\" default=`CV')",
   "\nOptional - Functional Network Expansion:",
 void clear_args (struct gengetopt_args_info *args_info);
 
 static int
-cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error);
 
 static int
 cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error);
 
-const char *cmdline_parser_weighting_method_values[] = {"CV", "EQUAL", "ORDER_STAT", "VAR", "USER", "AVERAGE_Z", 0}; /*< Possible values for weighting_method. */
-const char *cmdline_parser_dist_measure_values[] = {"pearson", "z_score", 0}; /*< Possible values for dist_measure. */
-const char *cmdline_parser_CV_partition_values[] = {"LOI", "LOO", "XFOLD", 0}; /*< Possible values for CV_partition. */
+char *cmdline_parser_weighting_method_values[] = {"CV", "EQUAL", "ORDER_STAT", "VAR", "USER", "AVERAGE_Z", 0} ;	/* Possible values for weighting_method.  */
+char *cmdline_parser_dist_measure_values[] = {"pearson", "z_score", 0} ;	/* Possible values for dist_measure.  */
+char *cmdline_parser_CV_partition_values[] = {"LOI", "LOO", "XFOLD", 0} ;	/* Possible values for CV_partition.  */
 
 static char *
 gengetopt_strdup (const char *s);
   args_info->dir_gvar_given = 0 ;
   args_info->quant_given = 0 ;
   args_info->num_db_given = 0 ;
+  args_info->num_threads_given = 0 ;
+  args_info->per_g_required_given = 0 ;
   args_info->weighting_method_given = 0 ;
   args_info->func_db_given = 0 ;
   args_info->func_n_given = 0 ;
 static
 void clear_args (struct gengetopt_args_info *args_info)
 {
-  FIX_UNUSED (args_info);
   args_info->dset_arg = NULL;
   args_info->dset_orig = NULL;
   args_info->search_dset_arg = gengetopt_strdup ("NA");
   args_info->quant_orig = NULL;
   args_info->num_db_arg = 1000;
   args_info->num_db_orig = NULL;
+  args_info->num_threads_arg = 8;
+  args_info->num_threads_orig = NULL;
+  args_info->per_g_required_arg = 0.0;
+  args_info->per_g_required_orig = NULL;
   args_info->weighting_method_arg = gengetopt_strdup ("CV");
   args_info->weighting_method_orig = NULL;
   args_info->func_db_arg = NULL;
   args_info->dir_gvar_help = gengetopt_args_info_help[11] ;
   args_info->quant_help = gengetopt_args_info_help[12] ;
   args_info->num_db_help = gengetopt_args_info_help[13] ;
-  args_info->weighting_method_help = gengetopt_args_info_help[15] ;
-  args_info->func_db_help = gengetopt_args_info_help[17] ;
-  args_info->func_n_help = gengetopt_args_info_help[18] ;
-  args_info->func_prep_help = gengetopt_args_info_help[19] ;
-  args_info->func_quant_help = gengetopt_args_info_help[20] ;
-  args_info->func_dset_help = gengetopt_args_info_help[21] ;
-  args_info->func_logit_help = gengetopt_args_info_help[22] ;
-  args_info->user_weight_list_help = gengetopt_args_info_help[24] ;
-  args_info->random_help = gengetopt_args_info_help[26] ;
-  args_info->num_random_help = gengetopt_args_info_help[27] ;
-  args_info->dist_measure_help = gengetopt_args_info_help[29] ;
-  args_info->norm_subavg_help = gengetopt_args_info_help[30] ;
-  args_info->norm_subavg_plat_help = gengetopt_args_info_help[31] ;
-  args_info->score_cutoff_help = gengetopt_args_info_help[32] ;
-  args_info->square_z_help = gengetopt_args_info_help[33] ;
-  args_info->per_q_required_help = gengetopt_args_info_help[35] ;
-  args_info->CV_partition_help = gengetopt_args_info_help[37] ;
-  args_info->CV_fold_help = gengetopt_args_info_help[38] ;
-  args_info->CV_rbp_p_help = gengetopt_args_info_help[39] ;
-  args_info->is_nibble_help = gengetopt_args_info_help[41] ;
-  args_info->buffer_help = gengetopt_args_info_help[42] ;
-  args_info->output_text_help = gengetopt_args_info_help[43] ;
-  args_info->output_dir_help = gengetopt_args_info_help[44] ;
-  args_info->output_w_comp_help = gengetopt_args_info_help[45] ;
-  args_info->simulate_w_help = gengetopt_args_info_help[46] ;
-  args_info->additional_db_help = gengetopt_args_info_help[47] ;
+  args_info->num_threads_help = gengetopt_args_info_help[14] ;
+  args_info->per_g_required_help = gengetopt_args_info_help[15] ;
+  args_info->weighting_method_help = gengetopt_args_info_help[17] ;
+  args_info->func_db_help = gengetopt_args_info_help[19] ;
+  args_info->func_n_help = gengetopt_args_info_help[20] ;
+  args_info->func_prep_help = gengetopt_args_info_help[21] ;
+  args_info->func_quant_help = gengetopt_args_info_help[22] ;
+  args_info->func_dset_help = gengetopt_args_info_help[23] ;
+  args_info->func_logit_help = gengetopt_args_info_help[24] ;
+  args_info->user_weight_list_help = gengetopt_args_info_help[26] ;
+  args_info->random_help = gengetopt_args_info_help[28] ;
+  args_info->num_random_help = gengetopt_args_info_help[29] ;
+  args_info->dist_measure_help = gengetopt_args_info_help[31] ;
+  args_info->norm_subavg_help = gengetopt_args_info_help[32] ;
+  args_info->norm_subavg_plat_help = gengetopt_args_info_help[33] ;
+  args_info->score_cutoff_help = gengetopt_args_info_help[34] ;
+  args_info->square_z_help = gengetopt_args_info_help[35] ;
+  args_info->per_q_required_help = gengetopt_args_info_help[37] ;
+  args_info->CV_partition_help = gengetopt_args_info_help[39] ;
+  args_info->CV_fold_help = gengetopt_args_info_help[40] ;
+  args_info->CV_rbp_p_help = gengetopt_args_info_help[41] ;
+  args_info->is_nibble_help = gengetopt_args_info_help[43] ;
+  args_info->buffer_help = gengetopt_args_info_help[44] ;
+  args_info->output_text_help = gengetopt_args_info_help[45] ;
+  args_info->output_dir_help = gengetopt_args_info_help[46] ;
+  args_info->output_w_comp_help = gengetopt_args_info_help[47] ;
+  args_info->simulate_w_help = gengetopt_args_info_help[48] ;
+  args_info->additional_db_help = gengetopt_args_info_help[49] ;
   
 }
 
 void
 cmdline_parser_print_version (void)
 {
-  printf ("%s %s\n",
-     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
-     CMDLINE_PARSER_VERSION);
+  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
 }
 
 static void print_help_common(void) {
   printf("\n");
 
   if (strlen(gengetopt_args_info_description) > 0)
-    printf("%s\n\n", gengetopt_args_info_description);
+    printf("%s\n", gengetopt_args_info_description);
 }
 
 void
   clear_args (args_info);
   init_args_info (args_info);
 
-  args_info->inputs = 0;
+  args_info->inputs = NULL;
   args_info->inputs_num = 0;
 }
 
   free_string_field (&(args_info->quant_arg));
   free_string_field (&(args_info->quant_orig));
   free_string_field (&(args_info->num_db_orig));
+  free_string_field (&(args_info->num_threads_orig));
+  free_string_field (&(args_info->per_g_required_orig));
   free_string_field (&(args_info->weighting_method_arg));
   free_string_field (&(args_info->weighting_method_orig));
   free_string_field (&(args_info->func_db_arg));
  * -2 if more than one value has matched
  */
 static int
-check_possible_values(const char *val, const char *values[])
+check_possible_values(const char *val, char *values[])
 {
   int i, found, last;
   size_t len;
 
 
 static void
-write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
+write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
 {
   int found = -1;
   if (arg) {
     write_into_file(outfile, "quant", args_info->quant_orig, 0);
   if (args_info->num_db_given)
     write_into_file(outfile, "num_db", args_info->num_db_orig, 0);
+  if (args_info->num_threads_given)
+    write_into_file(outfile, "num_threads", args_info->num_threads_orig, 0);
+  if (args_info->per_g_required_given)
+    write_into_file(outfile, "per_g_required", args_info->per_g_required_orig, 0);
   if (args_info->weighting_method_given)
     write_into_file(outfile, "weighting_method", args_info->weighting_method_orig, cmdline_parser_weighting_method_values);
   if (args_info->func_db_given)
 char *
 gengetopt_strdup (const char *s)
 {
-  char *result = 0;
+  char *result = NULL;
   if (!s)
     return result;
 
 }
 
 int
-cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
+cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
 {
   return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
 }
 
 int
-cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
+cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
                    struct cmdline_parser_params *params)
 {
   int result;
-  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
+  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
 
   return result;
 }
 
 int
-cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
+cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
 {
   int result;
   struct cmdline_parser_params params;
   params.check_ambiguity = 0;
   params.print_errors = 1;
 
-  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
+  result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
 
   return result;
 }
 {
   int result = EXIT_SUCCESS;
 
-  if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
+  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
     result = EXIT_FAILURE;
 
   return result;
 cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
 {
   int error = 0;
-  FIX_UNUSED (additional_error);
 
   /* checks for required options */
   if (! args_info->dset_given)
 static
 int update_arg(void *field, char **orig_field,
                unsigned int *field_given, unsigned int *prev_given, 
-               char *value, const char *possible_values[],
-               const char *default_value,
+               char *value, char *possible_values[], const char *default_value,
                cmdline_parser_arg_type arg_type,
                int check_ambiguity, int override,
                int no_free, int multiple_option,
   const char *val = value;
   int found;
   char **string_field;
-  FIX_UNUSED (field);
 
   stop_char = 0;
   found = 0;
 
 
 int
-cmdline_parser_internal (
-  int argc, char **argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error)
 {
   int c;	/* Character of the parsed option.  */
         { "dir_gvar",	1, NULL, 'U' },
         { "quant",	1, NULL, 'Q' },
         { "num_db",	1, NULL, 'n' },
+        { "num_threads",	1, NULL, 'T' },
+        { "per_g_required",	1, NULL, 'H' },
         { "weighting_method",	1, NULL, 'V' },
         { "func_db",	1, NULL, 'w' },
         { "func_n",	1, NULL, 'f' },
         { "output_w_comp",	0, NULL, 'Y' },
         { "simulate_w",	0, NULL, 'E' },
         { "additional_db",	1, NULL, 'B' },
-        { 0,  0, 0, 0 }
+        { NULL,	0, NULL, 0 }
       };
 
-      c = getopt_long (argc, argv, "hx:D:i:q:d:p:P:u:U:Q:n:V:w:f:W:R:F:lJ:St:z:mMc:eC:I:X:G:Nb:Oo:YEB:", long_options, &option_index);
+      c = getopt_long (argc, argv, "hx:D:i:q:d:p:P:u:U:Q:n:T:H:V:w:f:W:R:F:lJ:St:z:mMc:eC:I:X:G:Nb:Oo:YEB:", long_options, &option_index);
 
       if (c == -1) break;	/* Exit from `while (1)' loop.  */
 
             goto failure;
         
           break;
+        case 'T':	/* Number of threads.  */
+        
+        
+          if (update_arg( (void *)&(args_info->num_threads_arg), 
+               &(args_info->num_threads_orig), &(args_info->num_threads_given),
+              &(local_args_info.num_threads_given), optarg, 0, "8", ARG_INT,
+              check_ambiguity, override, 0, 0,
+              "num_threads", 'T',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'H':	/* Fraction (max 1.0) of genome required to be present in a dataset. Datasets not meeting the minimum required genes are skipped..  */
+        
+        
+          if (update_arg( (void *)&(args_info->per_g_required_arg), 
+               &(args_info->per_g_required_orig), &(args_info->per_g_required_given),
+              &(local_args_info.per_g_required_given), optarg, 0, "0.0", ARG_FLOAT,
+              check_ambiguity, override, 0, 0,
+              "per_g_required", 'H',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'V':	/* Weighting method: query cross-validated weighting (CV), equal weighting (EQUAL), order statistics weighting (ORDER_STAT), variance weighting (VAR), user-given weighting (USER), SPELL weighting (AVERAGE_Z).  */
         
         

File tools/SeekMiner/cmdline.h

 /** @file cmdline.h
  *  @brief The header file for the command line option parser
- *  generated by GNU Gengetopt version 2.22.5
+ *  generated by GNU Gengetopt version 2.22
  *  http://www.gnu.org/software/gengetopt.
  *  DO NOT modify this file, since it can be overwritten
  *  @author GNU Gengetopt by Lorenzo Bettini */
 #endif /* __cplusplus */
 
 #ifndef CMDLINE_PARSER_PACKAGE
-/** @brief the program name (used for printing errors) */
+/** @brief the program name */
 #define CMDLINE_PARSER_PACKAGE "SeekMiner"
 #endif
 
-#ifndef CMDLINE_PARSER_PACKAGE_NAME
-/** @brief the complete program name (used for help and version) */
-#define CMDLINE_PARSER_PACKAGE_NAME "SeekMiner"
-#endif
-
 #ifndef CMDLINE_PARSER_VERSION
 /** @brief the program version */
 #define CMDLINE_PARSER_VERSION "1.0"
   int num_db_arg;	/**< @brief Number of databaselets in database (default='1000').  */
   char * num_db_orig;	/**< @brief Number of databaselets in database original value given at command line.  */
   const char *num_db_help; /**< @brief Number of databaselets in database help description.  */
+  int num_threads_arg;	/**< @brief Number of threads (default='8').  */
+  char * num_threads_orig;	/**< @brief Number of threads original value given at command line.  */
+  const char *num_threads_help; /**< @brief Number of threads help description.  */
+  float per_g_required_arg;	/**< @brief Fraction (max 1.0) of genome required to be present in a dataset. Datasets not meeting the minimum required genes are skipped. (default='0.0').  */
+  char * per_g_required_orig;	/**< @brief Fraction (max 1.0) of genome required to be present in a dataset. Datasets not meeting the minimum required genes are skipped. original value given at command line.  */
+  const char *per_g_required_help; /**< @brief Fraction (max 1.0) of genome required to be present in a dataset. Datasets not meeting the minimum required genes are skipped. help description.  */
   char * weighting_method_arg;	/**< @brief Weighting method: query cross-validated weighting (CV), equal weighting (EQUAL), order statistics weighting (ORDER_STAT), variance weighting (VAR), user-given weighting (USER), SPELL weighting (AVERAGE_Z) (default='CV').  */
   char * weighting_method_orig;	/**< @brief Weighting method: query cross-validated weighting (CV), equal weighting (EQUAL), order statistics weighting (ORDER_STAT), variance weighting (VAR), user-given weighting (USER), SPELL weighting (AVERAGE_Z) original value given at command line.  */
   const char *weighting_method_help; /**< @brief Weighting method: query cross-validated weighting (CV), equal weighting (EQUAL), order statistics weighting (ORDER_STAT), variance weighting (VAR), user-given weighting (USER), SPELL weighting (AVERAGE_Z) help description.  */
   unsigned int dir_gvar_given ;	/**< @brief Whether dir_gvar was given.  */
   unsigned int quant_given ;	/**< @brief Whether quant was given.  */
   unsigned int num_db_given ;	/**< @brief Whether num_db was given.  */
+  unsigned int num_threads_given ;	/**< @brief Whether num_threads was given.  */
+  unsigned int per_g_required_given ;	/**< @brief Whether per_g_required was given.  */
   unsigned int weighting_method_given ;	/**< @brief Whether weighting_method was given.  */
   unsigned int func_db_given ;	/**< @brief Whether func_db was given.  */
   unsigned int func_n_given ;	/**< @brief Whether func_n was given.  */
  * @param args_info the structure where option information will be stored
  * @return 0 if everything went fine, NON 0 if an error took place
  */
-int cmdline_parser (int argc, char **argv,
+int cmdline_parser (int argc, char * const *argv,
   struct gengetopt_args_info *args_info);
 
 /**
  * @return 0 if everything went fine, NON 0 if an error took place
  * @deprecated use cmdline_parser_ext() instead
  */
-int cmdline_parser2 (int argc, char **argv,
+int cmdline_parser2 (int argc, char * const *argv,
   struct gengetopt_args_info *args_info,
   int override, int initialize, int check_required);
 
  * @param params additional parameters for the parser
  * @return 0 if everything went fine, NON 0 if an error took place
  */
-int cmdline_parser_ext (int argc, char **argv,
+int cmdline_parser_ext (int argc, char * const *argv,
   struct gengetopt_args_info *args_info,
   struct cmdline_parser_params *params);
 
 int cmdline_parser_required (struct gengetopt_args_info *args_info,
   const char *prog_name);
 
-extern const char *cmdline_parser_weighting_method_values[];  /**< @brief Possible values for weighting_method. */
-extern const char *cmdline_parser_dist_measure_values[];  /**< @brief Possible values for dist_measure. */
-extern const char *cmdline_parser_CV_partition_values[];  /**< @brief Possible values for CV_partition. */
+extern char *cmdline_parser_weighting_method_values[] ;	/**< @brief Possible values for weighting_method.  */
+extern char *cmdline_parser_dist_measure_values[] ;	/**< @brief Possible values for dist_measure.  */
+extern char *cmdline_parser_CV_partition_values[] ;	/**< @brief Possible values for CV_partition.  */
 
 
 #ifdef __cplusplus

File tools/SeekServer/SeekServer.cpp

 
 	float rbp_p;
 	float query_fraction_required;
+	float genome_fraction_required;
 	string distanceMeasure; //Correlation, Zscore, or ZscoreHubbinessCorrected
 	string searchMethod; //RBP, EqualWeighting, or OrderStatistics
 
 	string searchMethod = my->searchMethod;
 	float rbp_p = my->rbp_p;
 	float query_fraction_required = my->query_fraction_required;
+	float genome_fraction_required = my->genome_fraction_required;
 
 	CSeekCentral *csu = new CSeekCentral();
 	enum CSeekDataset::DistanceMeasure eDM = CSeekDataset::Z_SCORE;
 	//fprintf(stderr, "%s\n%s\n%s\n%.2f\n", strOutputDir.c_str(), strQuery.c_str(), strSearchDatasets.c_str(), query_fraction_required);
 
 	bool r = csu->Initialize(strOutputDir, strQuery, strSearchDatasets, csfinal,
-		new_fd, query_fraction_required, eDM, bSubtractGeneAvg,
+		new_fd, query_fraction_required, genome_fraction_required, eDM, bSubtractGeneAvg,
 		bNormPlatform);
 
 	//if r is false, then one of the query has no datasets 
 		bLogit, //always false
 		sArgs.score_cutoff_arg, 
 		0.0, //min query fraction (to be overwrriten)
+		0.0, //min genome fraction (to be overwrriten)
 		!!sArgs.square_z_flag, //default
-		false, 1, NULL, useNibble)) //default
+		false, 1, NULL, useNibble, sArgs.num_threads_arg)) //default
 	{
 		fprintf(stderr, "Error occurred!\n");
 		return -1;
 		//[0]: search_method ("RBP", "OrderStatistics", or "EqualWeighting") 
 		//[1]: rbp_p
 		//[2]: minimum fraction of query required
-		//[3]: distance measure ("Correlation", "Zscore", or "ZscoreHubbinessCorrected")
+		//[3]: minimum fraction of genome required
+		//[4]: distance measure ("Correlation", "Zscore", or "ZscoreHubbinessCorrected")
 
 		if(CSeekNetwork::Receive(new_fd, strSearchDataset)==-1){
 			fprintf(stderr, "Error receiving from client!\n");
 		}
 
 		vector<string> searchParameterTokens;
+		fprintf(stderr, "%s\n", strSearchParameter.c_str());
 		CMeta::Tokenize(strSearchParameter.c_str(), searchParameterTokens, "_");
 		thread_arg[d].searchMethod = searchParameterTokens[0];
 		thread_arg[d].rbp_p = atof(searchParameterTokens[1].c_str());
 		thread_arg[d].query_fraction_required = 
 			atof(searchParameterTokens[2].c_str());
-		thread_arg[d].distanceMeasure = searchParameterTokens[3];
+		thread_arg[d].genome_fraction_required = 
+			atof(searchParameterTokens[3].c_str());
+		thread_arg[d].distanceMeasure = searchParameterTokens[4];
 
 		//=========================================================
 

File tools/SeekServer/SeekServer.ggo

 								string	typestr="filename"	yes								
 option	"num_db"			n	"Number of databaselets in database"
 								int	default="1000"	yes
+option	"num_threads"		T	"Number of threads"
+								int default="8"
 
 section "Optional - Parameter tweaking"
 option	"score_cutoff"		c	"Cutoff on the gene-gene score before adding, default: no cutoff"

File tools/SeekServer/cmdline.c

 /*
-  File autogenerated by gengetopt version 2.22.5
+  File autogenerated by gengetopt version 2.22
   generated with the following command:
-  /usr/bin/gengetopt -iSeekServer.ggo --default-optional -u -N -e 
+  gengetopt -iSeekServer.ggo --default-optional -u -N -e 
 
   The developers of gengetopt consider the fixed text that goes in all
   gengetopt output files to be in the public domain:
 #include <stdlib.h>
 #include <string.h>
 
-#ifndef FIX_UNUSED
-#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
-#endif
-
-#include <getopt.h>
+#include "getopt.h"
 
 #include "cmdline.h"
 
   "  -U, --dir_gvar=directory      Gene variance directory (containing .gexpvar \n                                  files)  (default=`NA')",
   "  -Q, --quant=filename          quant file (assuming all datasets use the same \n                                  quantization)",
   "  -n, --num_db=INT              Number of databaselets in database  \n                                  (default=`1000')",
+  "  -T, --num_threads=INT         Number of threads  (default=`8')",
   "\nOptional - Parameter tweaking:",
   "  -c, --score_cutoff=FLOAT      Cutoff on the gene-gene score before adding, \n                                  default: no cutoff  (default=`-9999')",
   "  -e, --square_z                If using z-score, square-transform z-scores. \n                                  Usually used in conjunction with \n                                  --score-cutoff  (default=off)",
 void clear_args (struct gengetopt_args_info *args_info);
 
 static int
-cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error);
 
 static int
   args_info->dir_gvar_given = 0 ;
   args_info->quant_given = 0 ;
   args_info->num_db_given = 0 ;
+  args_info->num_threads_given = 0 ;
   args_info->score_cutoff_given = 0 ;
   args_info->square_z_given = 0 ;
   args_info->is_nibble_given = 0 ;
 static
 void clear_args (struct gengetopt_args_info *args_info)
 {
-  FIX_UNUSED (args_info);
   args_info->port_arg = gengetopt_strdup ("9000");
   args_info->port_orig = NULL;
   args_info->dset_arg = NULL;
   args_info->quant_orig = NULL;
   args_info->num_db_arg = 1000;
   args_info->num_db_orig = NULL;
+  args_info->num_threads_arg = 8;
+  args_info->num_threads_orig = NULL;
   args_info->score_cutoff_arg = -9999;
   args_info->score_cutoff_orig = NULL;
   args_info->square_z_flag = 0;
   args_info->dir_gvar_help = gengetopt_args_info_help[10] ;
   args_info->quant_help = gengetopt_args_info_help[11] ;
   args_info->num_db_help = gengetopt_args_info_help[12] ;
-  args_info->score_cutoff_help = gengetopt_args_info_help[14] ;
-  args_info->square_z_help = gengetopt_args_info_help[15] ;
-  args_info->is_nibble_help = gengetopt_args_info_help[17] ;
-  args_info->buffer_help = gengetopt_args_info_help[18] ;
-  args_info->output_text_help = gengetopt_args_info_help[19] ;
-  args_info->additional_db_help = gengetopt_args_info_help[20] ;
+  args_info->num_threads_help = gengetopt_args_info_help[13] ;
+  args_info->score_cutoff_help = gengetopt_args_info_help[15] ;
+  args_info->square_z_help = gengetopt_args_info_help[16] ;
+  args_info->is_nibble_help = gengetopt_args_info_help[18] ;
+  args_info->buffer_help = gengetopt_args_info_help[19] ;
+  args_info->output_text_help = gengetopt_args_info_help[20] ;
+  args_info->additional_db_help = gengetopt_args_info_help[21] ;
   
 }
 
 void
 cmdline_parser_print_version (void)
 {
-  printf ("%s %s\n",
-     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
-     CMDLINE_PARSER_VERSION);
+  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
 }
 
 static void print_help_common(void) {
   printf("\n");
 
   if (strlen(gengetopt_args_info_description) > 0)
-    printf("%s\n\n", gengetopt_args_info_description);
+    printf("%s\n", gengetopt_args_info_description);
 }
 
 void
   clear_args (args_info);
   init_args_info (args_info);
 
-  args_info->inputs = 0;
+  args_info->inputs = NULL;
   args_info->inputs_num = 0;
 }
 
   free_string_field (&(args_info->quant_arg));
   free_string_field (&(args_info->quant_orig));
   free_string_field (&(args_info->num_db_orig));
+  free_string_field (&(args_info->num_threads_orig));
   free_string_field (&(args_info->score_cutoff_orig));
   free_string_field (&(args_info->buffer_orig));
   free_string_field (&(args_info->additional_db_arg));
 
 
 static void
-write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
+write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
 {
-  FIX_UNUSED (values);
   if (arg) {
     fprintf(outfile, "%s=\"%s\"\n", opt, arg);
   } else {
     write_into_file(outfile, "quant", args_info->quant_orig, 0);
   if (args_info->num_db_given)
     write_into_file(outfile, "num_db", args_info->num_db_orig, 0);
+  if (args_info->num_threads_given)
+    write_into_file(outfile, "num_threads", args_info->num_threads_orig, 0);
   if (args_info->score_cutoff_given)
     write_into_file(outfile, "score_cutoff", args_info->score_cutoff_orig, 0);
   if (args_info->square_z_given)
 char *
 gengetopt_strdup (const char *s)
 {
-  char *result = 0;
+  char *result = NULL;
   if (!s)
     return result;
 
 }
 
 int
-cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
+cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
 {
   return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
 }
 
 int
-cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
+cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
                    struct cmdline_parser_params *params)
 {
   int result;
-  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
+  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
 
   return result;
 }
 
 int
-cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
+cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
 {
   int result;
   struct cmdline_parser_params params;
   params.check_ambiguity = 0;
   params.print_errors = 1;
 
-  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
+  result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
 
   return result;
 }
 {
   int result = EXIT_SUCCESS;
 
-  if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
+  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
     result = EXIT_FAILURE;
 
   return result;
 cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
 {
   int error = 0;
-  FIX_UNUSED (additional_error);
 
   /* checks for required options */
   if (! args_info->port_given)
 static
 int update_arg(void *field, char **orig_field,
                unsigned int *field_given, unsigned int *prev_given, 
-               char *value, const char *possible_values[],
-               const char *default_value,
+               char *value, char *possible_values[], const char *default_value,
                cmdline_parser_arg_type arg_type,
                int check_ambiguity, int override,
                int no_free, int multiple_option,
   const char *val = value;
   int found;
   char **string_field;
-  FIX_UNUSED (field);
 
   stop_char = 0;
   found = 0;
       return 1; /* failure */
     }
 
-  FIX_UNUSED (default_value);
     
   if (field_given && *field_given && ! override)
     return 0;
 
 
 int
-cmdline_parser_internal (
-  int argc, char **argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error)
 {
   int c;	/* Character of the parsed option.  */
         { "dir_gvar",	1, NULL, 'U' },
         { "quant",	1, NULL, 'Q' },
         { "num_db",	1, NULL, 'n' },
+        { "num_threads",	1, NULL, 'T' },
         { "score_cutoff",	1, NULL, 'c' },
         { "square_z",	0, NULL, 'e' },
         { "is_nibble",	0, NULL, 'N' },
         { "buffer",	1, NULL, 'b' },
         { "output_text",	0, NULL, 'O' },
         { "additional_db",	1, NULL, 'B' },
-        { 0,  0, 0, 0 }
+        { NULL,	0, NULL, 0 }
       };
 
-      c = getopt_long (argc, argv, "hVt:x:i:d:p:P:u:U:Q:n:c:eNb:OB:", long_options, &option_index);
+      c = getopt_long (argc, argv, "hVt:x:i:d:p:P:u:U:Q:n:T:c:eNb:OB:", long_options, &option_index);
 
       if (c == -1) break;	/* Exit from `while (1)' loop.  */
 
             goto failure;
         
           break;
+        case 'T':	/* Number of threads.  */
+        
+        
+          if (update_arg( (void *)&(args_info->num_threads_arg), 
+               &(args_info->num_threads_orig), &(args_info->num_threads_given),
+              &(local_args_info.num_threads_given), optarg, 0, "8", ARG_INT,
+              check_ambiguity, override, 0, 0,
+              "num_threads", 'T',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'c':	/* Cutoff on the gene-gene score before adding, default: no cutoff.  */
         
         

File tools/SeekServer/cmdline.h

 /** @file cmdline.h
  *  @brief The header file for the command line option parser
- *  generated by GNU Gengetopt version 2.22.5
+ *  generated by GNU Gengetopt version 2.22
  *  http://www.gnu.org/software/gengetopt.
  *  DO NOT modify this file, since it can be overwritten
  *  @author GNU Gengetopt by Lorenzo Bettini */
 #endif /* __cplusplus */
 
 #ifndef CMDLINE_PARSER_PACKAGE
-/** @brief the program name (used for printing errors) */
+/** @brief the program name */
 #define CMDLINE_PARSER_PACKAGE "SeekServer"
 #endif
 
-#ifndef CMDLINE_PARSER_PACKAGE_NAME
-/** @brief the complete program name (used for help and version) */
-#define CMDLINE_PARSER_PACKAGE_NAME "SeekServer"
-#endif
-
 #ifndef CMDLINE_PARSER_VERSION
 /** @brief the program version */
 #define CMDLINE_PARSER_VERSION "1.0"
   int num_db_arg;	/**< @brief Number of databaselets in database (default='1000').  */
   char * num_db_orig;	/**< @brief Number of databaselets in database original value given at command line.  */
   const char *num_db_help; /**< @brief Number of databaselets in database help description.  */
+  int num_threads_arg;	/**< @brief Number of threads (default='8').  */
+  char * num_threads_orig;	/**< @brief Number of threads original value given at command line.  */
+  const char *num_threads_help; /**< @brief Number of threads help description.  */
   float score_cutoff_arg;	/**< @brief Cutoff on the gene-gene score before adding, default: no cutoff (default='-9999').  */
   char * score_cutoff_orig;	/**< @brief Cutoff on the gene-gene score before adding, default: no cutoff original value given at command line.  */
   const char *score_cutoff_help; /**< @brief Cutoff on the gene-gene score before adding, default: no cutoff help description.  */
   unsigned int dir_gvar_given ;	/**< @brief Whether dir_gvar was given.  */
   unsigned int quant_given ;	/**< @brief Whether quant was given.  */
   unsigned int num_db_given ;	/**< @brief Whether num_db was given.  */
+  unsigned int num_threads_given ;	/**< @brief Whether num_threads was given.  */
   unsigned int score_cutoff_given ;	/**< @brief Whether score_cutoff was given.  */
   unsigned int square_z_given ;	/**< @brief Whether square_z was given.  */
   unsigned int is_nibble_given ;	/**< @brief Whether is_nibble was given.  */
  * @param args_info the structure where option information will be stored
  * @return 0 if everything went fine, NON 0 if an error took place
  */
-int cmdline_parser (int argc, char **argv,
+int cmdline_parser (int argc, char * const *argv,
   struct gengetopt_args_info *args_info);
 
 /**
  * @return 0 if everything went fine, NON 0 if an error took place
  * @deprecated use cmdline_parser_ext() instead
  */
-int cmdline_parser2 (int argc, char **argv,
+int cmdline_parser2 (int argc, char * const *argv,
   struct gengetopt_args_info *args_info,
   int override, int initialize, int check_required);
 
  * @param params additional parameters for the parser
  * @return 0 if everything went fine, NON 0 if an error took place
  */
-int cmdline_parser_ext (int argc, char **argv,
+int cmdline_parser_ext (int argc, char * const *argv,
   struct gengetopt_args_info *args_info,
   struct cmdline_parser_params *params);