Commits

Jian Zhou committed d2d337e

Weighted context: DChecker cmdline files update

Comments (0)

Files changed (2)

tools/DChecker/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 -iDChecker.ggo --default-optional -u -N -e 
+  /Genomics/grid/users/jzthree/bin/gengetopt -iDChecker.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"
 
   "  -J, --bridgeneg            Use bridging negatives between context and \n                               non-context genes  (default=on)",
   "  -u, --outpos               Use positive edges outside the context  \n                               (default=off)",
   "  -U, --outneg               Use negative edges outside the context  \n                               (default=off)",
+  "  -W, --weights=filename     Weight file",
+  "  -F, --flipneg              Flip weights(one minus original) for negative \n                               standards  (default=on)",
   "\nPreprocessing:",
   "  -n, --normalize            Normalize scores before processing  (default=off)",
   "  -t, --invert               Invert correlations to distances  (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->bridgeneg_given = 0 ;
   args_info->outpos_given = 0 ;
   args_info->outneg_given = 0 ;
+  args_info->weights_given = 0 ;
+  args_info->flipneg_given = 0 ;
   args_info->normalize_given = 0 ;
   args_info->invert_given = 0 ;
   args_info->sse_given = 0 ;
 static
 void clear_args (struct gengetopt_args_info *args_info)
 {
-  FIX_UNUSED (args_info);
   args_info->input_arg = NULL;
   args_info->input_orig = NULL;
   args_info->answers_arg = NULL;
   args_info->bridgeneg_flag = 1;
   args_info->outpos_flag = 0;
   args_info->outneg_flag = 0;
+  args_info->weights_arg = NULL;
+  args_info->weights_orig = NULL;
+  args_info->flipneg_flag = 1;
   args_info->normalize_flag = 0;
   args_info->invert_flag = 0;
   args_info->sse_flag = 0;
   args_info->bridgeneg_help = gengetopt_args_info_help[25] ;
   args_info->outpos_help = gengetopt_args_info_help[26] ;
   args_info->outneg_help = gengetopt_args_info_help[27] ;
-  args_info->normalize_help = gengetopt_args_info_help[29] ;
-  args_info->invert_help = gengetopt_args_info_help[30] ;
-  args_info->sse_help = gengetopt_args_info_help[32] ;
-  args_info->memmap_help = gengetopt_args_info_help[33] ;
-  args_info->verbosity_help = gengetopt_args_info_help[34] ;
+  args_info->weights_help = gengetopt_args_info_help[28] ;
+  args_info->flipneg_help = gengetopt_args_info_help[29] ;
+  args_info->normalize_help = gengetopt_args_info_help[31] ;
+  args_info->invert_help = gengetopt_args_info_help[32] ;
+  args_info->sse_help = gengetopt_args_info_help[34] ;
+  args_info->memmap_help = gengetopt_args_info_help[35] ;
+  args_info->verbosity_help = gengetopt_args_info_help[36] ;
   
 }
 
 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->genee_orig));
   free_string_field (&(args_info->genep_arg));
   free_string_field (&(args_info->genep_orig));
+  free_string_field (&(args_info->weights_arg));
+  free_string_field (&(args_info->weights_orig));
   free_string_field (&(args_info->verbosity_orig));
   
   
 
 
 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, "outpos", 0, 0 );
   if (args_info->outneg_given)
     write_into_file(outfile, "outneg", 0, 0 );
+  if (args_info->weights_given)
+    write_into_file(outfile, "weights", args_info->weights_orig, 0);
+  if (args_info->flipneg_given)
+    write_into_file(outfile, "flipneg", 0, 0 );
   if (args_info->normalize_given)
     write_into_file(outfile, "normalize", 0, 0 );
   if (args_info->invert_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->input_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.  */
         { "bridgeneg",	0, NULL, 'J' },
         { "outpos",	0, NULL, 'u' },
         { "outneg",	0, NULL, 'U' },
+        { "weights",	1, NULL, 'W' },
+        { "flipneg",	0, NULL, 'F' },
         { "normalize",	0, NULL, 'n' },
         { "invert",	0, NULL, 't' },
         { "sse",	0, NULL, 's' },
         { "memmap",	0, NULL, 'p' },
         { "verbosity",	1, NULL, 'v' },
-        { 0,  0, 0, 0 }
+        { NULL,	0, NULL, 0 }
       };
 
-      c = getopt_long (argc, argv, "hVi:w:d:a:R:b:fm:M:e:g:G:P:c:C:l:qQjJuUntspv:", long_options, &option_index);
+      c = getopt_long (argc, argv, "hVi:w:d:a:R:b:fm:M:e:g:G:P:c:C:l:qQjJuUW:Fntspv:", long_options, &option_index);
 
       if (c == -1) break;	/* Exit from `while (1)' loop.  */
 
             goto failure;
         
           break;
+        case 'W':	/* Weight file.  */
+        
+        
+          if (update_arg( (void *)&(args_info->weights_arg), 
+               &(args_info->weights_orig), &(args_info->weights_given),
+              &(local_args_info.weights_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "weights", 'W',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'F':	/* Flip weights(one minus original) for negative standards.  */
+        
+        
+          if (update_arg((void *)&(args_info->flipneg_flag), 0, &(args_info->flipneg_given),
+              &(local_args_info.flipneg_given), optarg, 0, 0, ARG_FLAG,
+              check_ambiguity, override, 1, 0, "flipneg", 'F',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'n':	/* Normalize scores before processing.  */
         
         

tools/DChecker/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 "DChecker"
 #endif
 
-#ifndef CMDLINE_PARSER_PACKAGE_NAME
-/** @brief the complete program name (used for help and version) */
-#define CMDLINE_PARSER_PACKAGE_NAME "DChecker"
-#endif
-
 #ifndef CMDLINE_PARSER_VERSION
 /** @brief the program version */
 #define CMDLINE_PARSER_VERSION "1.0"
   const char *outpos_help; /**< @brief Use positive edges outside the context help description.  */
   int outneg_flag;	/**< @brief Use negative edges outside the context (default=off).  */
   const char *outneg_help; /**< @brief Use negative edges outside the context help description.  */
+  char * weights_arg;	/**< @brief Weight file.  */
+  char * weights_orig;	/**< @brief Weight file original value given at command line.  */
+  const char *weights_help; /**< @brief Weight file help description.  */
+  int flipneg_flag;	/**< @brief Flip weights(one minus original) for negative standards (default=on).  */
+  const char *flipneg_help; /**< @brief Flip weights(one minus original) for negative standards help description.  */
   int normalize_flag;	/**< @brief Normalize scores before processing (default=off).  */
   const char *normalize_help; /**< @brief Normalize scores before processing help description.  */
   int invert_flag;	/**< @brief Invert correlations to distances (default=off).  */
   unsigned int bridgeneg_given ;	/**< @brief Whether bridgeneg was given.  */
   unsigned int outpos_given ;	/**< @brief Whether outpos was given.  */
   unsigned int outneg_given ;	/**< @brief Whether outneg was given.  */
+  unsigned int weights_given ;	/**< @brief Whether weights was given.  */
+  unsigned int flipneg_given ;	/**< @brief Whether flipneg was given.  */
   unsigned int normalize_given ;	/**< @brief Whether normalize was given.  */
   unsigned int invert_given ;	/**< @brief Whether invert was given.  */
   unsigned int sse_given ;	/**< @brief Whether sse 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);
 
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.