Commits

Qian Zhu committed f947c95

Added function in SeekTest to allow statistical testing of gene sets from *.db
files.
Added debugging function in SeekPrep

Comments (0)

Files changed (10)

 				ostm << ", setlinewidth(" << (*pvecdBorders)[ i ] << ")";
 			ostm << "\"";
 			ostm << ", fillcolor = \"" << ( fHashes ? "#" : "" ) << ( pvecdColors ? CColor::Interpolate(
-				(*pvecdColors)[ i ], CColor::c_Cyan, CColor::c_White, CColor::c_Yellow ).ToRGB( ) :
+				(*pvecdColors)[ i ], 
+				CColor::c_Cyan, CColor::c_White, CColor::c_Yellow 
+				//CColor::c_White, CColor::c_Cyan, CColor::c_Yellow 
+				).ToRGB( ) :
 				"FFFFFF" ) << "\"";
 			if( fLabel )
 				ostm << ", label=\"" << strName << "\"";

tools/SeekIterative/cmdline.c

 /*
-  File autogenerated by gengetopt version 2.22
+  File autogenerated by gengetopt version 2.22.5
   generated with the following command:
-  /memex/qzhu/usr/bin/gengetopt -iSeekIterative.ggo --default-optional -u -N -e 
+  /usr/bin/gengetopt -iSeekIterative.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>
 
-#include "getopt.h"
+#ifndef FIX_UNUSED
+#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
+#endif
+
+#include <getopt.h>
 
 #include "cmdline.h"
 
 void clear_args (struct gengetopt_args_info *args_info);
 
 static int
-cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error);
 
 static int
 static
 void clear_args (struct gengetopt_args_info *args_info)
 {
+  FIX_UNUSED (args_info);
   args_info->dab_flag = 0;
   args_info->combined_flag = 0;
   args_info->test_flag = 0;
 void
 cmdline_parser_print_version (void)
 {
-  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
+  printf ("%s %s\n",
+     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
+     CMDLINE_PARSER_VERSION);
 }
 
 static void print_help_common(void) {
   printf("\n");
 
   if (strlen(gengetopt_args_info_description) > 0)
-    printf("%s\n", gengetopt_args_info_description);
+    printf("%s\n\n", gengetopt_args_info_description);
 }
 
 void
   clear_args (args_info);
   init_args_info (args_info);
 
-  args_info->inputs = NULL;
+  args_info->inputs = 0;
   args_info->inputs_num = 0;
 }
 
 
 
 static void
-write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
+write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
 {
+  FIX_UNUSED (values);
   if (arg) {
     fprintf(outfile, "%s=\"%s\"\n", opt, arg);
   } else {
 char *
 gengetopt_strdup (const char *s)
 {
-  char *result = NULL;
+  char *result = 0;
   if (!s)
     return result;
 
 }
 
 int
-cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
+cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
 {
   return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
 }
 
 int
-cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
                    struct cmdline_parser_params *params)
 {
   int result;
-  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
+  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
 
   return result;
 }
 
 int
-cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
+cmdline_parser2 (int argc, char **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, NULL);
+  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
 
   return result;
 }
 {
   int result = EXIT_SUCCESS;
 
-  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
+  if (cmdline_parser_required2(args_info, prog_name, 0) > 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->input_given)
 static
 int update_arg(void *field, char **orig_field,
                unsigned int *field_given, unsigned int *prev_given, 
-               char *value, char *possible_values[], const char *default_value,
+               char *value, const 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 * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (
+  int argc, char **argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error)
 {
   int c;	/* Character of the parsed option.  */
         { "dab_dir",	1, NULL, 'F' },
         { "not_query",	1, NULL, 'Q' },
         { "dir_out",	1, NULL, 'D' },
-        { NULL,	0, NULL, 0 }
+        { 0,  0, 0, 0 }
       };
 
       c = getopt_long (argc, argv, "defghvb:t:EPc:G:V:I:T:R:M:H:i:q:F:Q:D:", long_options, &option_index);

tools/SeekIterative/cmdline.h

 /** @file cmdline.h
  *  @brief The header file for the command line option parser
- *  generated by GNU Gengetopt version 2.22
+ *  generated by GNU Gengetopt version 2.22.5
  *  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 */
+/** @brief the program name (used for printing errors) */
 #define CMDLINE_PARSER_PACKAGE "SeekIterative"
 #endif
 
+#ifndef CMDLINE_PARSER_PACKAGE_NAME
+/** @brief the complete program name (used for help and version) */
+#define CMDLINE_PARSER_PACKAGE_NAME "SeekIterative"
+#endif
+
 #ifndef CMDLINE_PARSER_VERSION
 /** @brief the program version */
 #define CMDLINE_PARSER_VERSION "1.0"
  * @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 * const *argv,
+int cmdline_parser (int argc, char **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 * const *argv,
+int cmdline_parser2 (int argc, char **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 * const *argv,
+int cmdline_parser_ext (int argc, char **argv,
   struct gengetopt_args_info *args_info,
   struct cmdline_parser_params *params);
 

tools/SeekPrep/SeekPrep.cpp

 		vc[i]->ReadGeneAverage(strAvgPath);
 		vc[i]->ReadGenePresence(strPresencePath);
 		vc[i]->InitializeGeneMap();
+
+		//DEBUGGING==============
+		/*
+		fprintf(stderr, "==Dataset %d==\n", i);
+		CSeekIntIntMap *mapG = vc[i]->GetGeneMap();
+		const vector<utype> &allR = mapG->GetAllReverse();
+		for(j=0; j<mapG->GetNumSet(); j++){
+			utype ja = mapG->GetReverse(j);
+			fprintf(stderr, "%d\t%.3f\n", ja, vc[i]->GetGeneAverage(ja));
+		}*/			
 	}
 	return true;
 }
 	CFullMatrix<float> &platform_stdev, vector<string> &vecstrQuery,
 	const bool &logit){
 
-	size_t i, j, k;
+	size_t i, j, jj, k;
 
 	CDatabaselet CD(useNibble);
 	CD.Open(DBFile);
 		vecstrQuery.push_back(thisGene);
 		for(k=0; k<iDatasets; k++){
 			CSeekIntIntMap *mapQ = vc[k]->GetDBMap();
+			CSeekIntIntMap *mapG = vc[k]->GetGeneMap();
+			const vector<utype> &allR = mapG->GetAllReverse();
 			if(mapQ==NULL) continue;
 			unsigned char **f = vc[k]->GetMatrix();
 			utype iQ = mapQ->GetForward(geneID);
 				printf("Error, platforms are equal %d %d",
 					(int) platform_id, (int) numPlatforms); getchar();
 			}
-			for(j=0; j<m_iGenes; j++){
+
+			for(jj=0; jj<mapG->GetNumSet(); jj++){
+				j = mapG->GetReverse(jj);
 				unsigned char uc = f[iQ][j];
 				float v = 0;
 				if(uc==255) v = CMeta::GetNaN();
 					if(logit) vv = log(quant[uc]) - log((float)(1.0-quant[uc]));
 					else vv = quant[uc];
 					v = vv - vc[k]->GetGeneAverage(j);
-					/*if(isnan(vv) || isinf(vv) || isnan(vc[k]->GetGeneAverage(j)) ||
+					//fprintf(stderr, "%.5f\t%.5f\n", vv, v);
+					if(isnan(vv) || isinf(vv) || isnan(vc[k]->GetGeneAverage(j)) ||
 						isinf(vc[k]->GetGeneAverage(j))){
-						fprintf(stderr, "%d %.5f %.5f %.5f\n", (int) uc, quant[uc], 
-						vv, vc[k]->GetGeneAverage(j));
-					}*/
+						fprintf(stderr, "%d D%d %.5f %.5f %d\n", (int) j, (int) k, 
+						vv, vc[k]->GetGeneAverage(j), mapG->GetForward(j));
+					}
 					//v = quant[uc];
 					sum[platform_id] += v;
 					num[platform_id]++;
 			mean[k] = sum[k] / (float) num[k];
 			stdev[k] = sq_sum[k] / (float) num[k] - mean[k] * mean[k];
 			stdev[k] = sqrt(stdev[k]);
-			fprintf(stderr, "%.5f %.5f\n", mean[k], stdev[k]);
+			fprintf(stderr, "%d %.5f %.5f\n", geneID, mean[k], stdev[k]);
 			platform_avg.Set(k, geneID, mean[k]);
 			platform_stdev.Set(k, geneID, stdev[k]);
 		}
 				for(j=0; j<m_iGenes; j++){
 					platform_avg.Set(i, j, CMeta::GetNaN());
 					platform_stdev.Set(i, j, CMeta::GetNaN());
+					//platform_avg.Set(i, j, (float) 0);
+					//platform_stdev.Set(i, j, (float) 1.0);
 				}
 			}
 
 					for(k=0; k<m_iGenes; k++){
 						platform_avg_threads[i].Set(j, k, CMeta::GetNaN());
 						platform_stdev_threads[i].Set(j, k, CMeta::GetNaN());
+						//platform_avg_threads[i].Set(j, k, (float) 0);
+						//platform_stdev_threads[i].Set(j, k, (float) 1.0);
 					}
 				}
 			}

tools/SeekReader/cmdline.c

 /*
-  File autogenerated by gengetopt version 2.22
+  File autogenerated by gengetopt version 2.22.5
   generated with the following command:
-  gengetopt -iSeekReader.ggo --default-optional -u -N -e 
+  /usr/bin/gengetopt -iSeekReader.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>
 
-#include "getopt.h"
+#ifndef FIX_UNUSED
+#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
+#endif
+
+#include <getopt.h>
 
 #include "cmdline.h"
 
 void clear_args (struct gengetopt_args_info *args_info);
 
 static int
-cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error);
 
 
 static
 void clear_args (struct gengetopt_args_info *args_info)
 {
+  FIX_UNUSED (args_info);
   args_info->databaselet_flag = 0;
   args_info->dataset_flag = 0;
   args_info->weight_flag = 0;
 void
 cmdline_parser_print_version (void)
 {
-  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
+  printf ("%s %s\n",
+     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
+     CMDLINE_PARSER_VERSION);
 }
 
 static void print_help_common(void) {
   printf("\n");
 
   if (strlen(gengetopt_args_info_description) > 0)
-    printf("%s\n", gengetopt_args_info_description);
+    printf("%s\n\n", gengetopt_args_info_description);
 }
 
 void
   clear_args (args_info);
   init_args_info (args_info);
 
-  args_info->inputs = NULL;
+  args_info->inputs = 0;
   args_info->inputs_num = 0;
 }
 
 
 
 static void
-write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
+write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
 {
+  FIX_UNUSED (values);
   if (arg) {
     fprintf(outfile, "%s=\"%s\"\n", opt, arg);
   } else {
 char *
 gengetopt_strdup (const char *s)
 {
-  char *result = NULL;
+  char *result = 0;
   if (!s)
     return result;
 
 }
 
 int
-cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
+cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
 {
   return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
 }
 
 int
-cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
                    struct cmdline_parser_params *params)
 {
   int result;
-  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
+  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
 
   return result;
 }
 
 int
-cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
+cmdline_parser2 (int argc, char **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, NULL);
+  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
 
   return result;
 }
 int
 cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
 {
+  FIX_UNUSED (args_info);
+  FIX_UNUSED (prog_name);
   return EXIT_SUCCESS;
 }
 
 static
 int update_arg(void *field, char **orig_field,
                unsigned int *field_given, unsigned int *prev_given, 
-               char *value, char *possible_values[], const char *default_value,
+               char *value, const 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 * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (
+  int argc, char **argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error)
 {
   int c;	/* Character of the parsed option.  */
         { "gvar_cutoff",	1, NULL, 'v' },
         { "multi_query",	1, NULL, 'Q' },
         { "output_file",	1, NULL, 'o' },
-        { NULL,	0, NULL, 0 }
+        { 0,  0, 0, 0 }
       };
 
       c = getopt_long (argc, argv, "VDAWUCE:n:M:F:G:H:h:I:Ox:X:i:q:d:p:r:s:NP:v:Q:o:", long_options, &option_index);

tools/SeekReader/cmdline.h

 /** @file cmdline.h
  *  @brief The header file for the command line option parser
- *  generated by GNU Gengetopt version 2.22
+ *  generated by GNU Gengetopt version 2.22.5
  *  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 */
+/** @brief the program name (used for printing errors) */
 #define CMDLINE_PARSER_PACKAGE "SeekReader"
 #endif
 
+#ifndef CMDLINE_PARSER_PACKAGE_NAME
+/** @brief the complete program name (used for help and version) */
+#define CMDLINE_PARSER_PACKAGE_NAME "SeekReader"
+#endif
+
 #ifndef CMDLINE_PARSER_VERSION
 /** @brief the program version */
 #define CMDLINE_PARSER_VERSION "1.0"
  * @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 * const *argv,
+int cmdline_parser (int argc, char **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 * const *argv,
+int cmdline_parser2 (int argc, char **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 * const *argv,
+int cmdline_parser_ext (int argc, char **argv,
   struct gengetopt_args_info *args_info,
   struct cmdline_parser_params *params);
 

tools/SeekTest/SeekTest.cpp

 #include "cmdline.h"
 #include <iomanip>
 
+
 float** LoadGenes(const vector<string> struserGenes, 
 	const vector<utype> &veciGenes, const vector<string> &vecstrGenes, 
 	const vector<utype> &veciallGenes, CSeekIntIntMap *gmap, 
 	return true;
 }
 
+vector<string> Do_Pair_Proportion(){
+
+
+}
+
+
 vector<string> Do_T_Test(
 	gsl_rng *rnd,
 	float **vall, 
 	ost << "User " << setprecision (2) << user_mean << " " << setprecision (2) << user_stdev;
 	outstr.push_back(ost.str());
 	
-	
 	for(i=0; i<100; i++){
 		double pvalt, t;
 		CalculateWelch(rand_mean[i], rand_stdev[i], veciGenes.size(), 
 	for(i=0; i<100; i++){
 		ostringstream ost;
 		ost.setf(ios::fixed);
-		ost << s1[i] << " " << U1[i] << setprecision (2) << z[i] << " " << setprecision (2) << auc[i];
+		ost << s1[i] << " " << U1[i] << " " << setprecision (2) << z[i] << " " << setprecision (2) << auc[i];
 		outstr.push_back(ost.str());
 	}
 
 	return outstr;
 }
 
-vector<string> Do_One(const char *file, gsl_rng *rnd, 
-	CSeekDataset *vcd, float **vall,
+vector<string> Do_One(const char *file, gsl_rng *rnd, CSeekDataset *vcd, float **vall,
 	map<string, utype> &mapstrintGene, vector<string> &vecstrGenes){
 
-
 	size_t i, j, k;
 	vector<string> ostr;
 
 		veciallGenes[i] = mapstrintGene[vecstrGenes[i]];
 	}
 
-
 	//float** v2 = LoadGenes(struserGenes, veciGenes, vecstrGenes, 
 	//	veciallGenes, gmap, vcd, vall);
 
-
 	vector<string> outstr = 
 	//	Do_Mann_Whitney_U_Test_By_Gene(rnd, vall, struserGenes, veciGenes, vecstrGenes, veciallGenes, gmap);
 	Do_T_Test(rnd, vall, veciGenes, struserGenes, veciallGenes, vecstrGenes, gmap);
+	//Do_Mann_Whitney_U_Test(rnd, vall, veciGenes, struserGenes, veciallGenes, vecstrGenes, gmap);
 
 
 	for(i=0; i<outstr.size(); i++){
 	}
 	
 	//Do_T_Test(vall, veciGenes, struserGenes, veciallGenes, vecstrGenes, gmap);
-
 	//ostr = Do_Mann_Whitney_U_Test(vall, veciGenes, struserGenes, veciallGenes, vecstrGenes, gmap);
 
-
 	/*
 	int *a1 = (int*)malloc(2*sizeof(int));
 	int *a2 = (int*)malloc(size*sizeof(int));
 	//for(i=0; i<100; i++){
 	//	CSeekTools::Free2DArray(randomGenes[i]);
 	//}
-
 	return ostr;
-
 }
 
 
 int main( int iArgs, char** aszArgs ) {
 	static const size_t	c_iBuffer	= 1024;
-//#ifdef WIN32
-//	pthread_win32_process_attach_np( );
-//#endif // WIN32
 	gengetopt_args_info	sArgs;
 	ifstream			ifsm;
 	istream*			pistm;
 		fprintf(stderr, "Hello World %d\n", tid);
 	}*/
 
+
 	const gsl_rng_type *T;
 	gsl_rng *rnd;
 	gsl_rng_env_setup();
 	for(i=0; i<vecstrGenes.size(); i++)
 		mapstrintGene[vecstrGenes[i]] = i;
 
+	if(sArgs.db_flag==1){
+		vector<float> quant;
+		CSeekTools::ReadQuantFile(sArgs.quant_arg, quant);
+
+		vector<string> vecstrDataset, vDP;
+
+		if(!CSeekTools::ReadListTwoColumns(sArgs.dataset_list_arg, 
+		vecstrDataset, vDP))
+			return false;
+
+		CDatabase *DB = new CDatabase(false);
+		DB->Open(sArgs.db_dir_arg, vecstrGenes, vecstrDataset.size(), sArgs.db_num_arg);
+
+		string strPrepInputDirectory = sArgs.prep_arg;
+		string strSinfoInputDirectory = sArgs.sinfo_arg;
+		vector<CSeekDataset*> vc;
+		vc.resize(vecstrDataset.size());
+		size_t i, j, k;
+		for(i=0; i<vecstrDataset.size(); i++){
+			vc[i] = new CSeekDataset();
+			string strFileStem = vecstrDataset[i];
+			string strAvgPath = strPrepInputDirectory+"/"+
+				strFileStem + ".gavg";
+			string strPresencePath = strPrepInputDirectory+"/"+
+				strFileStem + ".gpres";
+			string strSinfoPath = strSinfoInputDirectory+"/"+
+				strFileStem + ".sinfo";
+			vc[i]->ReadGeneAverage(strAvgPath);
+			vc[i]->ReadGenePresence(strPresencePath);
+			vc[i]->ReadDatasetAverageStdev(strSinfoPath);
+			vc[i]->InitializeGeneMap();
+		}
+	
+		size_t iGenes = vecstrGenes.size();
+		size_t iDatasets = vecstrDataset.size();
+		
+		vector<string> vecstrQuery;
+		CSeekTools::ReadMultiGeneOneLine(sArgs.query_arg, vecstrQuery);
+		//Need to load the query
+
+		vector<char> cQuery;
+		CSeekTools::InitVector(cQuery, iGenes, (char)0);
+		for(i=0; i<vecstrQuery.size(); i++){
+			if(mapstrintGene.find(vecstrQuery[i])==mapstrintGene.end()) continue;
+			utype k = mapstrintGene.find(vecstrQuery[i])->second;
+			cQuery[k] = 1;
+		}
+		vector<utype> allQ;
+		for(i=0; i<cQuery.size(); i++)
+			if(cQuery[i]==1)
+				allQ.push_back(i);
+		allQ.resize(allQ.size());
+
+		for(i=0; i<iDatasets; i++)
+			if(vc[i]->GetDBMap()!=NULL)
+				vc[i]->DeleteQueryBlock();
+	
+		for(i=0; i<iDatasets; i++)
+			vc[i]->InitializeQueryBlock(allQ);
+
+		size_t m, d;
+		for(i=0; i<allQ.size(); i++){
+			m = allQ[i];
+			vector<unsigned char> Qi;
+			if(!DB->GetGene(m, Qi)){
+				cerr << "Gene does not exist" << endl;
+				continue;
+			}
+			utype db;
+			CSeekIntIntMap *qu = NULL;
+			unsigned char **r = NULL;
+			for(j=0; j<vecstrDataset.size(); j++){
+				if((qu=vc[j]->GetDBMap())==NULL)
+					continue;
+				if(CSeekTools::IsNaN(db=(qu->GetForward(m)))) 
+					continue;
+				for(r = vc[j]->GetMatrix(), k=0; k<iGenes; k++)
+					r[db][k] = Qi[k*vecstrDataset.size()+j];
+			}
+			Qi.clear();
+		}
+
+		map<float,vector<int> > countPairs;
+		float point = 0.0;
+		while(point<=5.0){
+			countPairs[point] = vector<int>();
+			CSeekTools::InitVector(countPairs[point], iDatasets, (int)0);
+			point+=0.25;
+		}
+
+		for(k=0; k<iDatasets; k++){
+			CSeekIntIntMap *mapQ = vc[k]->GetDBMap();
+			CSeekIntIntMap *mapG = vc[k]->GetGeneMap();
+			if(mapQ==NULL) continue;
+			unsigned char **f = vc[k]->GetMatrix();
+
+			size_t qi, qj;
+			for(qi=0; qi<allQ.size(); qi++){
+				utype gene_qi = allQ[qi];
+				utype iQ = mapQ->GetForward(gene_qi);
+				if(CSeekTools::IsNaN(iQ)) continue;
+				for(qj=qi+1; qj<allQ.size(); qj++){
+					utype gene_qj = allQ[qj];
+					utype jQ = mapG->GetForward(gene_qj);
+					if(CSeekTools::IsNaN(jQ)) continue;
+					unsigned char uc = f[iQ][gene_qj];
+					if(uc==255) continue;
+					float vv = quant[uc];
+					point = 0.0;
+					while(point<=5.0){
+						if(vv>point)
+							countPairs[point][k]++;
+						point+=0.25;
+					}
+				}
+			}
+		}
+		
+		for(i=0; i<iDatasets; i++)
+			vc[i]->DeleteQueryBlock();
+
+		point = 0.0;			
+		while(point<=5.0){
+			sort(countPairs[point].begin(), countPairs[point].end(), greater<int>());
+			float tmp = 0;
+			for(i=0; i<10; i++){
+				tmp+=(float)countPairs[point][i];
+			}
+			tmp/=10.0;
+			fprintf(stderr, "%.2f\t%.1f pairs\n", point, tmp);
+			point+=0.25;
+		}
+
+	}
+		
 	CSeekStrIntMap mapTmp;
 	vector<string> vecstrList;
 	if(!CSeekTools::ReadListOneColumn(sArgs.gene_set_list_arg, vecstrList, mapTmp))
 		string strPres = sArgs.gpres_input_arg;
 		vcd->ReadGeneAverage(strAvg);
 		vcd->ReadGenePresence(strPres);
+		vcd->InitializeGeneMap();
 
-		vcd->InitializeGeneMap();
 		CDataPair Dat;
 		if(!Dat.Open(sArgs.dabinput_arg, false, false)){
 			cerr << "Error opening dab file" << endl;

tools/SeekTest/SeekTest.ggo

 								flag	off
 option	"bin"				A	"PCL Bin mode"
 								flag	off
+option	"db"				d	"DB mode"
+								flag 	off
+
+section "DB mode"
+option	"db_dir"			E	"DB directory"
+								string typestr="directory"
+option	"db_num"			b	"Number of files in DB directory"
+								int default="1000"
+option	"prep"				P	"Prep directory (containing .gavg and .gpres files)"
+								string typestr="filename"
+option	"sinfo"				s	"Sinfo directory (containing .sinfo files)"
+								string typestr="filename"
+option	"dataset_list"		C	"Dataset list"
+								string typestr="filename"
+option	"query"				Q	"List of genes separated by spaces in one line"
+								string typestr="filename"
+option	"quant"				q	"Quant file"
+								string typestr="filename"
 
 section "DAB mode"
 option	"gene_set_list"		g	"List of gene-set files"
-								string typestr="filename"	yes
+								string typestr="filename"
 option	"input"				x	"Gene mapping file"
-								string typestr="filename"	yes
+								string typestr="filename"
 option	"dabinput"			B	"DAB dataset file"
 								string typestr="filename"
 option 	"gavg_input"		a	"Gene average (.gavg) input file"

tools/SeekTest/cmdline.c

 /*
-  File autogenerated by gengetopt version 2.22
+  File autogenerated by gengetopt version 2.22.5
   generated with the following command:
-  /memex/qzhu/usr/bin/gengetopt -iSeekTest.ggo --default-optional -u -N -e 
+  /usr/bin/gengetopt -iSeekTest.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>
 
-#include "getopt.h"
+#ifndef FIX_UNUSED
+#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
+#endif
+
+#include <getopt.h>
 
 #include "cmdline.h"
 
   "\nMode:",
   "  -D, --dab                     DAB mode  (default=off)",
   "  -A, --bin                     PCL Bin mode  (default=off)",
+  "  -d, --db                      DB mode  (default=off)",
+  "\nDB mode:",
+  "  -E, --db_dir=directory        DB directory",
+  "  -b, --db_num=INT              Number of files in DB directory  \n                                  (default=`1000')",
+  "  -P, --prep=filename           Prep directory (containing .gavg and .gpres \n                                  files)",
+  "  -s, --sinfo=filename          Sinfo directory (containing .sinfo files)",
+  "  -C, --dataset_list=filename   Dataset list",
+  "  -Q, --query=filename          List of genes separated by spaces in one line",
+  "  -q, --quant=filename          Quant file",
   "\nDAB mode:",
   "  -g, --gene_set_list=filename  List of gene-set files",
   "  -x, --input=filename          Gene mapping file",
 typedef enum {ARG_NO
   , ARG_FLAG
   , ARG_STRING
+  , ARG_INT
 } cmdline_parser_arg_type;
 
 static
 void clear_args (struct gengetopt_args_info *args_info);
 
 static int
-cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (int argc, char **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);
 
 static char *
 gengetopt_strdup (const char *s);
   args_info->version_given = 0 ;
   args_info->dab_given = 0 ;
   args_info->bin_given = 0 ;
+  args_info->db_given = 0 ;
+  args_info->db_dir_given = 0 ;
+  args_info->db_num_given = 0 ;
+  args_info->prep_given = 0 ;
+  args_info->sinfo_given = 0 ;
+  args_info->dataset_list_given = 0 ;
+  args_info->query_given = 0 ;
+  args_info->quant_given = 0 ;
   args_info->gene_set_list_given = 0 ;
   args_info->input_given = 0 ;
   args_info->dabinput_given = 0 ;
 static
 void clear_args (struct gengetopt_args_info *args_info)
 {
+  FIX_UNUSED (args_info);
   args_info->dab_flag = 0;
   args_info->bin_flag = 0;
+  args_info->db_flag = 0;
+  args_info->db_dir_arg = NULL;
+  args_info->db_dir_orig = NULL;
+  args_info->db_num_arg = 1000;
+  args_info->db_num_orig = NULL;
+  args_info->prep_arg = NULL;
+  args_info->prep_orig = NULL;
+  args_info->sinfo_arg = NULL;
+  args_info->sinfo_orig = NULL;
+  args_info->dataset_list_arg = NULL;
+  args_info->dataset_list_orig = NULL;
+  args_info->query_arg = NULL;
+  args_info->query_orig = NULL;
+  args_info->quant_arg = NULL;
+  args_info->quant_orig = NULL;
   args_info->gene_set_list_arg = NULL;
   args_info->gene_set_list_orig = NULL;
   args_info->input_arg = NULL;
   args_info->version_help = gengetopt_args_info_help[1] ;
   args_info->dab_help = gengetopt_args_info_help[3] ;
   args_info->bin_help = gengetopt_args_info_help[4] ;
-  args_info->gene_set_list_help = gengetopt_args_info_help[6] ;
-  args_info->input_help = gengetopt_args_info_help[7] ;
-  args_info->dabinput_help = gengetopt_args_info_help[8] ;
-  args_info->gavg_input_help = gengetopt_args_info_help[9] ;
-  args_info->gpres_input_help = gengetopt_args_info_help[10] ;
+  args_info->db_help = gengetopt_args_info_help[5] ;
+  args_info->db_dir_help = gengetopt_args_info_help[7] ;
+  args_info->db_num_help = gengetopt_args_info_help[8] ;
+  args_info->prep_help = gengetopt_args_info_help[9] ;
+  args_info->sinfo_help = gengetopt_args_info_help[10] ;
+  args_info->dataset_list_help = gengetopt_args_info_help[11] ;
+  args_info->query_help = gengetopt_args_info_help[12] ;
+  args_info->quant_help = gengetopt_args_info_help[13] ;
+  args_info->gene_set_list_help = gengetopt_args_info_help[15] ;
+  args_info->input_help = gengetopt_args_info_help[16] ;
+  args_info->dabinput_help = gengetopt_args_info_help[17] ;
+  args_info->gavg_input_help = gengetopt_args_info_help[18] ;
+  args_info->gpres_input_help = gengetopt_args_info_help[19] ;
   
 }
 
 void
 cmdline_parser_print_version (void)
 {
-  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
+  printf ("%s %s\n",
+     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
+     CMDLINE_PARSER_VERSION);
 }
 
 static void print_help_common(void) {
   printf("\n");
 
   if (strlen(gengetopt_args_info_description) > 0)
-    printf("%s\n", gengetopt_args_info_description);
+    printf("%s\n\n", gengetopt_args_info_description);
 }
 
 void
   clear_args (args_info);
   init_args_info (args_info);
 
-  args_info->inputs = NULL;
+  args_info->inputs = 0;
   args_info->inputs_num = 0;
 }
 
 cmdline_parser_release (struct gengetopt_args_info *args_info)
 {
   unsigned int i;
+  free_string_field (&(args_info->db_dir_arg));
+  free_string_field (&(args_info->db_dir_orig));
+  free_string_field (&(args_info->db_num_orig));
+  free_string_field (&(args_info->prep_arg));
+  free_string_field (&(args_info->prep_orig));
+  free_string_field (&(args_info->sinfo_arg));
+  free_string_field (&(args_info->sinfo_orig));
+  free_string_field (&(args_info->dataset_list_arg));
+  free_string_field (&(args_info->dataset_list_orig));
+  free_string_field (&(args_info->query_arg));
+  free_string_field (&(args_info->query_orig));
+  free_string_field (&(args_info->quant_arg));
+  free_string_field (&(args_info->quant_orig));
   free_string_field (&(args_info->gene_set_list_arg));
   free_string_field (&(args_info->gene_set_list_orig));
   free_string_field (&(args_info->input_arg));
 
 
 static void
-write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
+write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
 {
+  FIX_UNUSED (values);
   if (arg) {
     fprintf(outfile, "%s=\"%s\"\n", opt, arg);
   } else {
     write_into_file(outfile, "dab", 0, 0 );
   if (args_info->bin_given)
     write_into_file(outfile, "bin", 0, 0 );
+  if (args_info->db_given)
+    write_into_file(outfile, "db", 0, 0 );
+  if (args_info->db_dir_given)
+    write_into_file(outfile, "db_dir", args_info->db_dir_orig, 0);
+  if (args_info->db_num_given)
+    write_into_file(outfile, "db_num", args_info->db_num_orig, 0);
+  if (args_info->prep_given)
+    write_into_file(outfile, "prep", args_info->prep_orig, 0);
+  if (args_info->sinfo_given)
+    write_into_file(outfile, "sinfo", args_info->sinfo_orig, 0);
+  if (args_info->dataset_list_given)
+    write_into_file(outfile, "dataset_list", args_info->dataset_list_orig, 0);
+  if (args_info->query_given)
+    write_into_file(outfile, "query", args_info->query_orig, 0);
+  if (args_info->quant_given)
+    write_into_file(outfile, "quant", args_info->quant_orig, 0);
   if (args_info->gene_set_list_given)
     write_into_file(outfile, "gene_set_list", args_info->gene_set_list_orig, 0);
   if (args_info->input_given)
 char *
 gengetopt_strdup (const char *s)
 {
-  char *result = NULL;
+  char *result = 0;
   if (!s)
     return result;
 
 }
 
 int
-cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
+cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
 {
   return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
 }
 
 int
-cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
                    struct cmdline_parser_params *params)
 {
   int result;
-  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
+  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
 
   return result;
 }
 
 int
-cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
+cmdline_parser2 (int argc, char **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, NULL);
+  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
 
   return result;
 }
 int
 cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
 {
-  int result = EXIT_SUCCESS;
-
-  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
-    result = EXIT_FAILURE;
-
-  return result;
-}
-
-int
-cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
-{
-  int error = 0;
-
-  /* checks for required options */
-  if (! args_info->gene_set_list_given)
-    {
-      fprintf (stderr, "%s: '--gene_set_list' ('-g') option required%s\n", prog_name, (additional_error ? additional_error : ""));
-      error = 1;
-    }
-  
-  if (! args_info->input_given)
-    {
-      fprintf (stderr, "%s: '--input' ('-x') option required%s\n", prog_name, (additional_error ? additional_error : ""));
-      error = 1;
-    }
-  
-  
-  /* checks for dependences among options */
-
-  return error;
+  FIX_UNUSED (args_info);
+  FIX_UNUSED (prog_name);
+  return EXIT_SUCCESS;
 }
 
 
 static
 int update_arg(void *field, char **orig_field,
                unsigned int *field_given, unsigned int *prev_given, 
-               char *value, char *possible_values[], const char *default_value,
+               char *value, const 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;
   case ARG_FLAG:
     *((int *)field) = !*((int *)field);
     break;
+  case ARG_INT:
+    if (val) *((int *)field) = strtol (val, &stop_char, 0);
+    break;
   case ARG_STRING:
     if (val) {
       string_field = (char **)field;
     break;
   };
 
+  /* check numeric conversion */
+  switch(arg_type) {
+  case ARG_INT:
+    if (val && !(stop_char && *stop_char == '\0')) {
+      fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val);
+      return 1; /* failure */
+    }
+    break;
+  default:
+    ;
+  };
 
   /* store the original value */
   switch(arg_type) {
 
 
 int
-cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (
+  int argc, char **argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error)
 {
   int c;	/* Character of the parsed option.  */
         { "version",	0, NULL, 'V' },
         { "dab",	0, NULL, 'D' },
         { "bin",	0, NULL, 'A' },
+        { "db",	0, NULL, 'd' },
+        { "db_dir",	1, NULL, 'E' },
+        { "db_num",	1, NULL, 'b' },
+        { "prep",	1, NULL, 'P' },
+        { "sinfo",	1, NULL, 's' },
+        { "dataset_list",	1, NULL, 'C' },
+        { "query",	1, NULL, 'Q' },
+        { "quant",	1, NULL, 'q' },
         { "gene_set_list",	1, NULL, 'g' },
         { "input",	1, NULL, 'x' },
         { "dabinput",	1, NULL, 'B' },
         { "gavg_input",	1, NULL, 'a' },
         { "gpres_input",	1, NULL, 'p' },
-        { NULL,	0, NULL, 0 }
+        { 0,  0, 0, 0 }
       };
 
-      c = getopt_long (argc, argv, "hVDAg:x:B:a:p:", long_options, &option_index);
+      c = getopt_long (argc, argv, "hVDAdE:b:P:s:C:Q:q:g:x:B:a:p:", long_options, &option_index);
 
       if (c == -1) break;	/* Exit from `while (1)' loop.  */
 
             goto failure;
         
           break;
+        case 'd':	/* DB mode.  */
+        
+        
+          if (update_arg((void *)&(args_info->db_flag), 0, &(args_info->db_given),
+              &(local_args_info.db_given), optarg, 0, 0, ARG_FLAG,
+              check_ambiguity, override, 1, 0, "db", 'd',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'E':	/* DB directory.  */
+        
+        
+          if (update_arg( (void *)&(args_info->db_dir_arg), 
+               &(args_info->db_dir_orig), &(args_info->db_dir_given),
+              &(local_args_info.db_dir_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "db_dir", 'E',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'b':	/* Number of files in DB directory.  */
+        
+        
+          if (update_arg( (void *)&(args_info->db_num_arg), 
+               &(args_info->db_num_orig), &(args_info->db_num_given),
+              &(local_args_info.db_num_given), optarg, 0, "1000", ARG_INT,
+              check_ambiguity, override, 0, 0,
+              "db_num", 'b',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'P':	/* Prep directory (containing .gavg and .gpres files).  */
+        
+        
+          if (update_arg( (void *)&(args_info->prep_arg), 
+               &(args_info->prep_orig), &(args_info->prep_given),
+              &(local_args_info.prep_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "prep", 'P',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 's':	/* Sinfo directory (containing .sinfo files).  */
+        
+        
+          if (update_arg( (void *)&(args_info->sinfo_arg), 
+               &(args_info->sinfo_orig), &(args_info->sinfo_given),
+              &(local_args_info.sinfo_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "sinfo", 's',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'C':	/* Dataset list.  */
+        
+        
+          if (update_arg( (void *)&(args_info->dataset_list_arg), 
+               &(args_info->dataset_list_orig), &(args_info->dataset_list_given),
+              &(local_args_info.dataset_list_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "dataset_list", 'C',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'Q':	/* List of genes separated by spaces in one line.  */
+        
+        
+          if (update_arg( (void *)&(args_info->query_arg), 
+               &(args_info->query_orig), &(args_info->query_given),
+              &(local_args_info.query_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "query", 'Q',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'q':	/* Quant file.  */
+        
+        
+          if (update_arg( (void *)&(args_info->quant_arg), 
+               &(args_info->quant_orig), &(args_info->quant_given),
+              &(local_args_info.quant_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "quant", 'q',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'g':	/* List of gene-set files.  */
         
         
 
 
 
-  if (check_required)
-    {
-      error += cmdline_parser_required2 (args_info, argv[0], additional_error);
-    }
 
   cmdline_parser_release (&local_args_info);
 

tools/SeekTest/cmdline.h

 /** @file cmdline.h
  *  @brief The header file for the command line option parser
- *  generated by GNU Gengetopt version 2.22
+ *  generated by GNU Gengetopt version 2.22.5
  *  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 */
+/** @brief the program name (used for printing errors) */
 #define CMDLINE_PARSER_PACKAGE "SeekTest"
 #endif
 
+#ifndef CMDLINE_PARSER_PACKAGE_NAME
+/** @brief the complete program name (used for help and version) */
+#define CMDLINE_PARSER_PACKAGE_NAME "SeekTest"
+#endif
+
 #ifndef CMDLINE_PARSER_VERSION
 /** @brief the program version */
 #define CMDLINE_PARSER_VERSION "1.0"
   const char *dab_help; /**< @brief DAB mode help description.  */
   int bin_flag;	/**< @brief PCL Bin mode (default=off).  */
   const char *bin_help; /**< @brief PCL Bin mode help description.  */
+  int db_flag;	/**< @brief DB mode (default=off).  */
+  const char *db_help; /**< @brief DB mode help description.  */
+  char * db_dir_arg;	/**< @brief DB directory.  */
+  char * db_dir_orig;	/**< @brief DB directory original value given at command line.  */
+  const char *db_dir_help; /**< @brief DB directory help description.  */
+  int db_num_arg;	/**< @brief Number of files in DB directory (default='1000').  */
+  char * db_num_orig;	/**< @brief Number of files in DB directory original value given at command line.  */
+  const char *db_num_help; /**< @brief Number of files in DB directory help description.  */
+  char * prep_arg;	/**< @brief Prep directory (containing .gavg and .gpres files).  */
+  char * prep_orig;	/**< @brief Prep directory (containing .gavg and .gpres files) original value given at command line.  */
+  const char *prep_help; /**< @brief Prep directory (containing .gavg and .gpres files) help description.  */
+  char * sinfo_arg;	/**< @brief Sinfo directory (containing .sinfo files).  */
+  char * sinfo_orig;	/**< @brief Sinfo directory (containing .sinfo files) original value given at command line.  */
+  const char *sinfo_help; /**< @brief Sinfo directory (containing .sinfo files) help description.  */
+  char * dataset_list_arg;	/**< @brief Dataset list.  */
+  char * dataset_list_orig;	/**< @brief Dataset list original value given at command line.  */
+  const char *dataset_list_help; /**< @brief Dataset list help description.  */
+  char * query_arg;	/**< @brief List of genes separated by spaces in one line.  */
+  char * query_orig;	/**< @brief List of genes separated by spaces in one line original value given at command line.  */
+  const char *query_help; /**< @brief List of genes separated by spaces in one line help description.  */
+  char * quant_arg;	/**< @brief Quant file.  */
+  char * quant_orig;	/**< @brief Quant file original value given at command line.  */
+  const char *quant_help; /**< @brief Quant file help description.  */
   char * gene_set_list_arg;	/**< @brief List of gene-set files.  */
   char * gene_set_list_orig;	/**< @brief List of gene-set files original value given at command line.  */
   const char *gene_set_list_help; /**< @brief List of gene-set files help description.  */
   unsigned int version_given ;	/**< @brief Whether version was given.  */
   unsigned int dab_given ;	/**< @brief Whether dab was given.  */
   unsigned int bin_given ;	/**< @brief Whether bin was given.  */
+  unsigned int db_given ;	/**< @brief Whether db was given.  */
+  unsigned int db_dir_given ;	/**< @brief Whether db_dir was given.  */
+  unsigned int db_num_given ;	/**< @brief Whether db_num was given.  */
+  unsigned int prep_given ;	/**< @brief Whether prep was given.  */
+  unsigned int sinfo_given ;	/**< @brief Whether sinfo was given.  */
+  unsigned int dataset_list_given ;	/**< @brief Whether dataset_list was given.  */
+  unsigned int query_given ;	/**< @brief Whether query was given.  */
+  unsigned int quant_given ;	/**< @brief Whether quant was given.  */
   unsigned int gene_set_list_given ;	/**< @brief Whether gene_set_list was given.  */
   unsigned int input_given ;	/**< @brief Whether input was given.  */
   unsigned int dabinput_given ;	/**< @brief Whether dabinput 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 * const *argv,
+int cmdline_parser (int argc, char **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 * const *argv,
+int cmdline_parser2 (int argc, char **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 * const *argv,
+int cmdline_parser_ext (int argc, char **argv,
   struct gengetopt_args_info *args_info,
   struct cmdline_parser_params *params);