Commits

Qian Zhu committed 95e5756

Added dataset weighting based on average-Z between query genes (SeekMiner)

Comments (0)

Files changed (8)

src/seekcentral.cpp

 
 	m_master_rank_threads = NULL;
 	m_sum_weight_threads = NULL;
+	m_sum_sq_weight_threads = NULL; //sum squared weight
 	m_counts_threads = NULL;
 	m_rank_normal_threads = NULL;
 	m_rank_threads = NULL;
 
 	m_master_rank.clear();
 	m_sum_weight.clear();
+	m_sum_sq_weight.clear();
 	m_weight.clear();
 	m_counts.clear();
 	m_mapLoadTime.clear();
 		CSeekTools::Free2DArray(m_sum_weight_threads);
 		m_sum_weight_threads = NULL;
 	}
+	if(m_sum_sq_weight_threads != NULL){
+		CSeekTools::Free2DArray(m_sum_sq_weight_threads);
+		m_sum_sq_weight_threads = NULL;
+	}
 	if(m_counts_threads !=NULL){
 		CSeekTools::Free2DArray(m_counts_threads);
 		m_counts_threads = NULL;
 
 	m_master_rank.clear();
 	m_sum_weight.clear();
+	m_sum_sq_weight.clear();
 	m_counts.clear();
 	m_weight.clear();
 	m_final.clear();
 		return false;
 	}
 
-	fprintf(stderr, "Finished CalculateRestart()\n");
+	//fprintf(stderr, "Finished CalculateRestart()\n");
 
 	if(!EnableNetwork(iClient)){
 		fprintf(stderr, "Error occurred during EnableNetwork()\n");
 		return false;
 	}
 
-	fprintf(stderr, "Finished EnableNetworks()\n");
+	//fprintf(stderr, "Finished EnableNetworks()\n");
 
 	if(!CheckDatasets(true)){ //replace parameter is true
 		fprintf(stderr, "Error occurred during CheckDatasets()\n");
 		return false;
 	}
 
-	fprintf(stderr, "Finished CheckDatasets()\n");
+	//fprintf(stderr, "Finished CheckDatasets()\n");
 	return true;
 }
 
 		fprintf(stderr, "Error occurred during CalculateRestart()\n");
 		return false;
 	}
-	fprintf(stderr, "Finished CalculateRestart()\n");
+	//fprintf(stderr, "Finished CalculateRestart()\n");
 
 	return true;
 }
 	CSeekIntIntMap &dMap, vector<float> &weight){
 
 	assert(m_master_rank_threads==NULL && m_counts_threads==NULL &&
-		m_sum_weight_threads==NULL);
+		m_sum_weight_threads==NULL && m_sum_sq_weight_threads==NULL);
 	assert(m_rank_normal_threads==NULL && m_rank_threads==NULL);
 	assert(m_rData==NULL);
 
 		CSeekTools::Init2DArray(m_numThreads, m_iGenes, (float)0);
 	m_sum_weight_threads =
 		CSeekTools::Init2DArray(m_numThreads, m_iGenes, (float)0);
+	m_sum_sq_weight_threads =
+		CSeekTools::Init2DArray(m_numThreads, m_iGenes, (float)0);
 	m_counts_threads =
 		CSeekTools::Init2DArray(m_numThreads, m_iGenes, (utype)0);
 	
 	
 	CSeekTools::InitVector(m_master_rank, m_iGenes, (float) 0);
 	CSeekTools::InitVector(m_sum_weight, m_iGenes, (float) 0);
+	CSeekTools::InitVector(m_sum_sq_weight, m_iGenes, (float) 0);
 	CSeekTools::InitVector(m_counts, m_iGenes, (utype) 0);
 	CSeekTools::InitVector(weight, m_iDatasets, (float)0);
 	
 
 bool CSeekCentral::AggregateThreads(){
 	assert(m_master_rank_threads!=NULL && m_counts_threads!=NULL &&
-		m_sum_weight_threads!=NULL);
+		m_sum_sq_weight_threads!=NULL && m_sum_weight_threads!=NULL);
 	assert(m_rank_normal_threads!=NULL && m_rank_threads!=NULL);
 
-	//Aggregate into three vectors: m_master_rank, m_counts, m_sum_weight
+	//Aggregate into three vectors: m_master_rank, m_counts, m_sum_weight, m_sum_sq_weight
 	utype j, k;
 	for(j=0; j<m_numThreads; j++){
 		for(k=0; k<m_iGenes; k++){
 			m_master_rank[k] += m_master_rank_threads[j][k];
 			m_counts[k] += m_counts_threads[j][k];
 			m_sum_weight[k]+=m_sum_weight_threads[j][k];
+			m_sum_sq_weight[k]+=m_sum_sq_weight_threads[j][k];
 		}
 	}
 
 	CSeekTools::Free2DArray(m_master_rank_threads);
 	CSeekTools::Free2DArray(m_counts_threads);
 	CSeekTools::Free2DArray(m_sum_weight_threads);
+	CSeekTools::Free2DArray(m_sum_sq_weight_threads);
 	m_master_rank_threads=NULL;
 	m_counts_threads=NULL;
 	m_sum_weight_threads = NULL;
+	m_sum_sq_weight_threads = NULL;
 
 	for(j=0; j<m_numThreads; j++){
 		m_rank_normal_threads[j].clear();
 			m_master_rank[j] = -320;
 		else{
 			m_master_rank[j] =
-				(m_master_rank[j] / m_sum_weight[j] - 320) / 100.0;
+				//(m_master_rank[j] / m_sum_weight[j] - 320) / 100.0;
+				(m_master_rank[j] - 320 * m_sum_weight[j]) / 100.0 / m_sum_weight[j];
+				//(m_master_rank[j] - 320 * m_sum_weight[j]) / 100.0 / sqrt(m_sum_sq_weight[j]);
 			if(m_eDistMeasure==CSeekDataset::CORRELATION){
 				m_master_rank[j] = m_master_rank[j] / 3.0;
 			}
 					}
 				}
 			}
+			else if(current_sm==AVERAGE_Z){
+				CSeekWeighter::AverageWeighting(query, *m_vc[d],
+					m_fPercentQueryAfterScoreCutOff, m_bSquareZ, w);
+				if(w==-1) continue;
+			}
 			else if(current_sm==EQUAL && redoWithEqual==0){
 				w = 1.0;
 			}
 			vector<utype> &Rank_Normal = m_rank_normal_threads[tid];
 			float* Master_Rank = &m_master_rank_threads[tid][0];
 			float* Sum_Weight = &m_sum_weight_threads[tid][0];
+			float* Sum_Sq_Weight = &m_sum_sq_weight_threads[tid][0];
 			utype* Counts = &m_counts_threads[tid][0];
 
 			if(current_sm==ORDER_STATISTICS)
 					//if(Rank_Normal[*iterR]==0) continue;
 					Master_Rank[*iterR] += (float) Rank_Normal[*iterR] * w;
 					Sum_Weight[*iterR] += w;
+					Sum_Sq_Weight[*iterR] += w * w;
 					Counts[*iterR]++;
 				}
 
 	return CSeekCentral::Common(sm);
 }
 
+bool CSeekCentral::AverageWeightSearch(){
+	CSeekCentral::SearchMode sm = AVERAGE_Z;
+	return CSeekCentral::Common(sm, NULL, NULL, NULL, NULL);
+}
+
 bool CSeekCentral::VarianceWeightSearch(){
 	vector<vector<float> > weights;
 	weights.resize(m_vecstrAllQuery.size());

src/seekcentral.h

         CV_CUSTOM=3, /**< Cross-validated weighting, 
                       but instead of using the query genes to cross-validate, use the user 
                       supplied gene-sets to validate each query partition */
-        ORDER_STATISTICS=4 /**< MEM algorithm */
+        ORDER_STATISTICS=4, /**< MEM algorithm */
+        AVERAGE_Z=5 /**< Average z-scores between query, SPELL algorithm */
 	};
     
     /*!
 	bool VarianceWeightSearch();
 
 	/*!
+	 * \brief Run Seek with the SPELL search
+	 *
+	 * \remark Assumes that the CSeekCentral::Initialize() has been called.
+	 */
+	bool AverageWeightSearch();
+
+	/*!
 	 * \brief Run Seek with the order statistics dataset weighting algorithm
 	 *
 	 * \remark Assumes that the CSeekCentral::Initialize() has been called.
 	/* multi-threaded programming */
 	float **m_master_rank_threads;
 	float **m_sum_weight_threads;
+	float **m_sum_sq_weight_threads;
 	utype **m_counts_threads;
 	vector<utype> *m_rank_normal_threads;
 	vector<utype> *m_rank_threads;
 	/* Essential search results */
 	vector<float> m_master_rank;
 	vector<float> m_sum_weight;
+	vector<float> m_sum_sq_weight;
 	vector<utype> m_counts;
 
 	/* Holds results for all queries */

src/seekweight.cpp

 	return true;
 }
 
+bool CSeekWeighter::AverageWeighting(CSeekQuery &sQuery, CSeekDataset &sDataset,
+	const float &percent_required, const bool &bSquareZ, float &w){
+
+	CSeekIntIntMap *mapQ = sDataset.GetQueryMap();
+	if(mapQ==NULL) return true;
+
+	utype i, j, qi, qj;
+
+	const vector<utype> &allQ = sQuery.GetQuery();
+	vector<utype> presentQ;
+	utype num_q = 0;
+	for(qi=0; qi<allQ.size(); qi++){
+		if(CSeekTools::IsNaN(mapQ->GetForward(allQ[qi]))) continue;
+		num_q++;
+		presentQ.push_back(allQ[qi]);
+	}
+
+	w = 0;
+	const utype MIN_QUERY_REQUIRED =
+		max((utype) 2, (utype) (percent_required * allQ.size()));
+
+	if(num_q<MIN_QUERY_REQUIRED){
+		w = -1;
+		return true;
+	}
+
+	utype **f = sDataset.GetDataMatrix();
+	/* as long as rank[g] does not overflow, due to too many queries, we are fine
+	 * should control query size to be <100. */
+	vector<utype> queryPos;
+	queryPos.resize(num_q);
+	for(i=0; i<num_q; i++)
+		queryPos[i] = mapQ->GetForward(presentQ[i]);
+
+	int pairs = 0;
+	if(bSquareZ){
+		for(qi=0; qi<presentQ.size(); qi++){
+			for(qj=0; qj<presentQ.size(); qj++){
+				if(qi==qj) continue;
+				float t = (float) f[presentQ[qj]][queryPos[qi]];
+				t = (t-320)/100.0;
+				t = t * t;
+				w += t;
+				pairs++;
+			}
+		}
+		w /= (float) pairs;
+
+	}else{
+		for(qi=0; qi<presentQ.size(); qi++){
+			for(qj=0; qj<presentQ.size(); qj++){
+				if(qi==qj) continue;
+				w += (float) f[presentQ[qj]][queryPos[qi]];
+				pairs++;
+			}
+		}
+		w /= (float) pairs;
+		w /= (float) 640;
+	}
+	return true;
+}
+
 bool CSeekWeighter::CVWeighting(CSeekQuery &sQuery, CSeekDataset &sDataset,
 	const float &rate, const float &percent_required, const bool &bSquareZ,
 	vector<utype> *rrank, const CSeekQuery *goldStd){
 	static bool OneGeneWeighting(CSeekQuery&, 
 		CSeekDataset&, const float&, const float&, const bool&, 
 		vector<utype>*, const CSeekQuery*);
+
+	static bool AverageWeighting(CSeekQuery &sQuery, CSeekDataset &sDataset,
+		const float &percent_required, const bool &bSquareZ, float &w);
 };
 
 

tools/SeekMiner/SeekMiner.cpp

 			return -1;
 		}
 		csfinal->VarianceWeightSearch();
+	}else if(method=="AVERAGE_Z"){
+		csfinal->AverageWeightSearch();
 	}
 	//csfinal->WeightSearch(csk_weight_copy);
 	//csfinal->CVCustomSearch(newQ, rnd, PART_M, FOLD, RATE);

tools/SeekMiner/SeekMiner.ggo

 								int	default="1000"	yes
 
 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)"
-								values="CV","EQUAL","ORDER_STAT","VAR","USER" default="CV"
+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)"
+								values="CV","EQUAL","ORDER_STAT","VAR","USER","AVERAGE_Z" default="CV"
 
 section "Optional - Functional Network Expansion"
 option	"func_db"			w	"Functional network db path"

tools/SeekMiner/cmdline.c

 /*
-  File autogenerated by gengetopt version 2.22
+  File autogenerated by gengetopt version 2.22.5
   generated with the following command:
-  gengetopt -iSeekMiner.ggo --default-optional -u -N -e 
+  /usr/bin/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>
 
-#include "getopt.h"
+#ifndef FIX_UNUSED
+#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
+#endif
+
+#include <getopt.h>
 
 #include "cmdline.h"
 
   "  -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')",
   "\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)  (possible values=\"CV\", \n                                  \"EQUAL\", \"ORDER_STAT\", \"VAR\", \"USER\" \n                                  default=`CV')",
+  "  -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:",
   "  -w, --func_db=directory       Functional network db path",
   "  -f, --func_n=INT              Functional network number of databaselets  \n                                  (default=`1000')",
 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);
 
-char *cmdline_parser_weighting_method_values[] = {"CV", "EQUAL", "ORDER_STAT", "VAR", "USER", 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.  */
+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. */
 
 static char *
 gengetopt_strdup (const char *s);
 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");
 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;
 }
 
  * -2 if more than one value has matched
  */
 static int
-check_possible_values(const char *val, char *values[])
+check_possible_values(const char *val, const char *values[])
 {
   int i, found, last;
   size_t len;
 
 
 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[])
 {
   int found = -1;
   if (arg) {
 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->dset_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;
 
 
 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.  */
         { "output_w_comp",	0, NULL, 'Y' },
         { "simulate_w",	0, NULL, 'E' },
         { "additional_db",	1, NULL, 'B' },
-        { NULL,	0, NULL, 0 }
+        { 0,  0, 0, 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);
             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).  */
+        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).  */
         
         
           if (update_arg( (void *)&(args_info->weighting_method_arg), 

tools/SeekMiner/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 "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.  */
-  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) (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) 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) 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.  */
   char * func_db_arg;	/**< @brief Functional network db path.  */
   char * func_db_orig;	/**< @brief Functional network db path original value given at command line.  */
   const char *func_db_help; /**< @brief Functional network db path help description.  */
  * @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);
 
 int cmdline_parser_required (struct gengetopt_args_info *args_info,
   const char *prog_name);
 
-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.  */
+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. */
 
 
 #ifdef __cplusplus
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.