1. libsleipnir
  2. sleipnir

Commits

chuttenh  committed ab965e2

[svn r422] Add Linux build and tweaks for SVDer

  • Participants
  • Parent commits e358caa
  • Branches sleipnir

Comments (0)

Files changed (12)

File configure

View file
  • Ignore whitespace
 fi
 
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ac_config_files="$ac_config_files Makefile src/Makefile tools/Makefile tools/Answerer/Makefile tools/Cliquer/Makefile tools/Clusterer/Makefile tools/Clusters2Dab/Makefile tools/COALESCE/Makefile tools/Combiner/Makefile tools/DChecker/Makefile tools/Dat2Dab/Makefile tools/Dat2Graph/Makefile tools/Data2Bnt/Makefile tools/Data2Features/Makefile tools/Data2Sql/Makefile tools/DataDumper/Makefile tools/Distancer/Makefile tools/Explainer/Makefile tools/Funcaeologist/Makefile tools/Funcifier/Makefile tools/Funcographer/Makefile tools/Hubber/Makefile tools/KNNImputer/Makefile tools/Mat2Txt/Makefile tools/MCluster/Makefile tools/Matcher/Makefile tools/MIer/Makefile tools/Normalizer/Makefile tools/Orthologer/Makefile tools/Overlapper/Makefile tools/PCLPlotter/Makefile tools/Randomizer/Makefile tools/Seqs2Ngrams/Makefile tools/Synthesizer/Makefile tools/Txt2Bin/Makefile tools/BNConverter/Makefile tools/BNCreator/Makefile tools/BNEvaluator/Makefile tools/BNFunc/Makefile tools/BNTester/Makefile tools/BNTruster/Makefile tools/BNs2Txt/Makefile tools/BNUnraveler/Makefile tools/BNWeaver/Makefile tools/Contexter/Makefile tools/Counter/Makefile tools/Data2DB/Makefile tools/DSLConverter/Makefile tools/Dab2Dad/Makefile tools/Edges2Posteriors/Makefile tools/MEFIT/Makefile tools/Data2Svm/Makefile tools/SVMer/Makefile tools/OntoShell/Makefile tools/BNServer/Makefile"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ac_config_files="$ac_config_files Makefile src/Makefile tools/Makefile tools/Answerer/Makefile tools/Cliquer/Makefile tools/Clusterer/Makefile tools/Clusters2Dab/Makefile tools/COALESCE/Makefile tools/Combiner/Makefile tools/DChecker/Makefile tools/Dat2Dab/Makefile tools/Dat2Graph/Makefile tools/Data2Bnt/Makefile tools/Data2Features/Makefile tools/Data2Sql/Makefile tools/DataDumper/Makefile tools/Distancer/Makefile tools/Explainer/Makefile tools/Funcaeologist/Makefile tools/Funcifier/Makefile tools/Funcographer/Makefile tools/Hubber/Makefile tools/KNNImputer/Makefile tools/Mat2Txt/Makefile tools/MCluster/Makefile tools/Matcher/Makefile tools/MIer/Makefile tools/Netwalker/Makefile tools/Normalizer/Makefile tools/Orthologer/Makefile tools/Overlapper/Makefile tools/PCLPlotter/Makefile tools/Randomizer/Makefile tools/Seqs2Ngrams/Makefile tools/SVDer/Makefile tools/Synthesizer/Makefile tools/Txt2Bin/Makefile tools/BNConverter/Makefile tools/BNCreator/Makefile tools/BNEvaluator/Makefile tools/BNFunc/Makefile tools/BNTester/Makefile tools/BNTruster/Makefile tools/BNs2Txt/Makefile tools/BNUnraveler/Makefile tools/BNWeaver/Makefile tools/Contexter/Makefile tools/Counter/Makefile tools/Data2DB/Makefile tools/DSLConverter/Makefile tools/Dab2Dad/Makefile tools/Edges2Posteriors/Makefile tools/MEFIT/Makefile tools/Data2Svm/Makefile tools/SVMer/Makefile tools/OntoShell/Makefile tools/BNServer/Makefile"
 
 
 
   "tools/MCluster/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/MCluster/Makefile" ;;
   "tools/Matcher/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Matcher/Makefile" ;;
   "tools/MIer/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/MIer/Makefile" ;;
+  "tools/Netwalker/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Netwalker/Makefile" ;;
   "tools/Normalizer/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Normalizer/Makefile" ;;
   "tools/Orthologer/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Orthologer/Makefile" ;;
   "tools/Overlapper/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Overlapper/Makefile" ;;
   "tools/PCLPlotter/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/PCLPlotter/Makefile" ;;
   "tools/Randomizer/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Randomizer/Makefile" ;;
   "tools/Seqs2Ngrams/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Seqs2Ngrams/Makefile" ;;
+  "tools/SVDer/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/SVDer/Makefile" ;;
   "tools/Synthesizer/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Synthesizer/Makefile" ;;
   "tools/Txt2Bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Txt2Bin/Makefile" ;;
   "tools/BNConverter/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/BNConverter/Makefile" ;;

File configure.ac

View file
  • Ignore whitespace
 		 tools/MCluster/Makefile \
 		 tools/Matcher/Makefile \
 		 tools/MIer/Makefile \
+		 tools/Netwalker/Makefile \
 		 tools/Normalizer/Makefile \
 		 tools/Orthologer/Makefile \
 		 tools/Overlapper/Makefile \
 		 tools/PCLPlotter/Makefile \
 		 tools/Randomizer/Makefile \
 		 tools/Seqs2Ngrams/Makefile \
+		 tools/SVDer/Makefile \
 		 tools/Synthesizer/Makefile \
 		 tools/Txt2Bin/Makefile \
                  tools/BNConverter/Makefile \

File src/fullmatrix.h

View file
  • Ignore whitespace
 		// in s and the super-diagonal elements in e.
 		fU = fV = true;
 		iCT = min( GetRows( ) - 1, GetColumns( ) );
-		iRT = max( 0, min( GetColumns( ) - 2, GetRows( ) ) );
+		iRT = max( (size_t)0, min( GetColumns( ) - 2, GetRows( ) ) );
 		for( k = 0; k < max( iCT, iRT ); ++k ) {
 			if( k < iCT ) {
 				// Compute the transformation for the k-th column and

File tools/COALESCE/cmdline.c

View file
  • Ignore whitespace
   "  -o, --output=directory        Directory for output files (PCLs/motifs)",
   "\nAlgorithm Parameters:",
   "  -p, --prob_gene=DOUBLE        Probability threshhold for gene inclusion  \n                                  (default=`0.95')",
-  "  -P, --pvalue_cond=DOUBLE      P-value threshhold for condition inclusion  \n                                  (default=`0.05')",
+  "  -c, --pvalue_cond=DOUBLE      P-value threshhold for condition inclusion  \n                                  (default=`0.05')",
   "  -m, --pvalue_motif=DOUBLE     P-value threshhold for motif inclusion  \n                                  (default=`0.05')",
+  "  -C, --zscore_cond=DOUBLE      Z-score threshhold for condition inclusion  \n                                  (default=`0.5')",
+  "  -M, --zscore_motif=DOUBLE     Z-score threshhold for motif inclusion  \n                                  (default=`0.5')",
   "\nSequence Parameters:",
   "  -k, --k=INT                   Sequence kmer length  (default=`7')",
   "  -g, --pvalue_merge=DOUBLE     P-value threshhold for motif merging  \n                                  (default=`0.05')",
   "  -y, --penalty_gap=DOUBLE      Edit distance penalty for gaps  (default=`1')",
   "  -Y, --penalty_mismatch=DOUBLE Edit distance penalty for mismatches  \n                                  (default=`2.1')",
   "\nPerformance Parameters:",
-  "  -c, --pvalue_correl=DOUBLE    P-value threshhold for significant correlation  \n                                  (default=`0.05')",
-  "  -C, --number_correl=INT       Maximum number of pairs to sample for \n                                  significant correlation  (default=`100000')",
+  "  -n, --pvalue_correl=DOUBLE    P-value threshhold for significant correlation  \n                                  (default=`0.05')",
+  "  -N, --number_correl=INT       Maximum number of pairs to sample for \n                                  significant correlation  (default=`100000')",
   "  -q, --sequences=STRING        Sequence types to use (comma separated)",
   "  -b, --bases=INT               Resolution of bases per motif match  \n                                  (default=`5000')",
   "  -z, --size_minimum=INT        Minimum gene count for clusters of interest  \n                                  (default=`5')",
   "  -E, --size_merge=INT          Maximum motif count for realtime merging  \n                                  (default=`100')",
   "  -Z, --size_maximum=INT        Maximum motif count to consider a cluster \n                                  saturated  (default=`1000')",
-  "\nAdditional Data:",
-  "  -n, --nucleosomes=filename    Nucleosome position file (WIG)",
-  "  -a, --conservation=filename   Evolutionary conservation file (WIG)",
   "\nPostprocessing Parameters:",
   "  -j, --postprocess=directory   Input directory of clusters to postprocess",
   "  -K, --known_motifs=filename   File containing known motifs",
-  "  -F, --known_cutoff=DOUBLE     P-value cutoff for known motif labeling  \n                                  (default=`0.05')",
-  "  -J, --cutoff_postprocess=DOUBLE\n                                Similarity cutoff for cluster merging  \n                                  (default=`0.75')",
+  "  -F, --known_cutoff=DOUBLE     Score cutoff for known motif labeling  \n                                  (default=`0.05')",
+  "  -S, --known_type=STRING       Type of known motif matching  (possible \n                                  values=\"pvalue\", \"rmse\", \"js\" \n                                  default=`pvalue')",
+  "  -J, --cutoff_postprocess=DOUBLE\n                                Similarity cutoff for cluster merging  \n                                  (default=`1')",
   "  -L, --fraction_postprocess=DOUBLE\n                                Overlap fraction for postprocessing \n                                  gene/condition inclusion  (default=`0.5')",
   "  -T, --cutoff_trim=DOUBLE      Cocluster stdev cutoff for cluster trimming  \n                                  (default=`1')",
   "  -R, --remove_rcs              Convert RCs and RC-like PSTs to single strand  \n                                  (default=on)",
   "  -u, --min_info=DOUBLE         Uninformative motif threshhold (bits)  \n                                  (default=`0.3')",
-  "  -U, --min_zscore=DOUBLE       Minimum motif z-score magnitude  \n                                  (default=`0.2')",
   "  -x, --max_motifs=INT          Maximum motifs to merge exactly  \n                                  (default=`2500')",
   "\nMiscellaneous:",
   "  -e, --cache=filename          Cache file for sequence analysis",
+  "  -O, --progressive             Generate output progressively  (default=on)",
   "\nOptional:",
   "  -t, --threads=INT             Maximum number of concurrent threads  \n                                  (default=`1')",
   "  -s, --skip=INT                Columns to skip in input PCL  (default=`2')",
                         struct cmdline_parser_params *params, const char *additional_error);
 
 
+char *cmdline_parser_known_type_values[] = {"pvalue", "rmse", "js", 0} ;	/* Possible values for known_type.  */
+
 static char *
 gengetopt_strdup (const char *s);
 
   args_info->prob_gene_given = 0 ;
   args_info->pvalue_cond_given = 0 ;
   args_info->pvalue_motif_given = 0 ;
+  args_info->zscore_cond_given = 0 ;
+  args_info->zscore_motif_given = 0 ;
   args_info->k_given = 0 ;
   args_info->pvalue_merge_given = 0 ;
   args_info->cutoff_merge_given = 0 ;
   args_info->size_minimum_given = 0 ;
   args_info->size_merge_given = 0 ;
   args_info->size_maximum_given = 0 ;
-  args_info->nucleosomes_given = 0 ;
-  args_info->conservation_given = 0 ;
   args_info->postprocess_given = 0 ;
   args_info->known_motifs_given = 0 ;
   args_info->known_cutoff_given = 0 ;
+  args_info->known_type_given = 0 ;
   args_info->cutoff_postprocess_given = 0 ;
   args_info->fraction_postprocess_given = 0 ;
   args_info->cutoff_trim_given = 0 ;
   args_info->remove_rcs_given = 0 ;
   args_info->min_info_given = 0 ;
-  args_info->min_zscore_given = 0 ;
   args_info->max_motifs_given = 0 ;
   args_info->cache_given = 0 ;
+  args_info->progressive_given = 0 ;
   args_info->threads_given = 0 ;
   args_info->skip_given = 0 ;
   args_info->random_given = 0 ;
   args_info->pvalue_cond_orig = NULL;
   args_info->pvalue_motif_arg = 0.05;
   args_info->pvalue_motif_orig = NULL;
+  args_info->zscore_cond_arg = 0.5;
+  args_info->zscore_cond_orig = NULL;
+  args_info->zscore_motif_arg = 0.5;
+  args_info->zscore_motif_orig = NULL;
   args_info->k_arg = 7;
   args_info->k_orig = NULL;
   args_info->pvalue_merge_arg = 0.05;
   args_info->size_merge_orig = NULL;
   args_info->size_maximum_arg = 1000;
   args_info->size_maximum_orig = NULL;
-  args_info->nucleosomes_arg = NULL;
-  args_info->nucleosomes_orig = NULL;
-  args_info->conservation_arg = NULL;
-  args_info->conservation_orig = NULL;
   args_info->postprocess_arg = NULL;
   args_info->postprocess_orig = NULL;
   args_info->known_motifs_arg = NULL;
   args_info->known_motifs_orig = NULL;
   args_info->known_cutoff_arg = 0.05;
   args_info->known_cutoff_orig = NULL;
-  args_info->cutoff_postprocess_arg = 0.75;
+  args_info->known_type_arg = gengetopt_strdup ("pvalue");
+  args_info->known_type_orig = NULL;
+  args_info->cutoff_postprocess_arg = 1;
   args_info->cutoff_postprocess_orig = NULL;
   args_info->fraction_postprocess_arg = 0.5;
   args_info->fraction_postprocess_orig = NULL;
   args_info->remove_rcs_flag = 1;
   args_info->min_info_arg = 0.3;
   args_info->min_info_orig = NULL;
-  args_info->min_zscore_arg = 0.2;
-  args_info->min_zscore_orig = NULL;
   args_info->max_motifs_arg = 2500;
   args_info->max_motifs_orig = NULL;
   args_info->cache_arg = NULL;
   args_info->cache_orig = NULL;
+  args_info->progressive_flag = 1;
   args_info->threads_arg = 1;
   args_info->threads_orig = NULL;
   args_info->skip_arg = 2;
   args_info->prob_gene_help = gengetopt_args_info_help[8] ;
   args_info->pvalue_cond_help = gengetopt_args_info_help[9] ;
   args_info->pvalue_motif_help = gengetopt_args_info_help[10] ;
-  args_info->k_help = gengetopt_args_info_help[12] ;
-  args_info->pvalue_merge_help = gengetopt_args_info_help[13] ;
-  args_info->cutoff_merge_help = gengetopt_args_info_help[14] ;
-  args_info->penalty_gap_help = gengetopt_args_info_help[15] ;
-  args_info->penalty_mismatch_help = gengetopt_args_info_help[16] ;
-  args_info->pvalue_correl_help = gengetopt_args_info_help[18] ;
-  args_info->number_correl_help = gengetopt_args_info_help[19] ;
-  args_info->sequences_help = gengetopt_args_info_help[20] ;
-  args_info->bases_help = gengetopt_args_info_help[21] ;
-  args_info->size_minimum_help = gengetopt_args_info_help[22] ;
-  args_info->size_merge_help = gengetopt_args_info_help[23] ;
-  args_info->size_maximum_help = gengetopt_args_info_help[24] ;
-  args_info->nucleosomes_help = gengetopt_args_info_help[26] ;
-  args_info->conservation_help = gengetopt_args_info_help[27] ;
-  args_info->postprocess_help = gengetopt_args_info_help[29] ;
-  args_info->known_motifs_help = gengetopt_args_info_help[30] ;
-  args_info->known_cutoff_help = gengetopt_args_info_help[31] ;
+  args_info->zscore_cond_help = gengetopt_args_info_help[11] ;
+  args_info->zscore_motif_help = gengetopt_args_info_help[12] ;
+  args_info->k_help = gengetopt_args_info_help[14] ;
+  args_info->pvalue_merge_help = gengetopt_args_info_help[15] ;
+  args_info->cutoff_merge_help = gengetopt_args_info_help[16] ;
+  args_info->penalty_gap_help = gengetopt_args_info_help[17] ;
+  args_info->penalty_mismatch_help = gengetopt_args_info_help[18] ;
+  args_info->pvalue_correl_help = gengetopt_args_info_help[20] ;
+  args_info->number_correl_help = gengetopt_args_info_help[21] ;
+  args_info->sequences_help = gengetopt_args_info_help[22] ;
+  args_info->bases_help = gengetopt_args_info_help[23] ;
+  args_info->size_minimum_help = gengetopt_args_info_help[24] ;
+  args_info->size_merge_help = gengetopt_args_info_help[25] ;
+  args_info->size_maximum_help = gengetopt_args_info_help[26] ;
+  args_info->postprocess_help = gengetopt_args_info_help[28] ;
+  args_info->known_motifs_help = gengetopt_args_info_help[29] ;
+  args_info->known_cutoff_help = gengetopt_args_info_help[30] ;
+  args_info->known_type_help = gengetopt_args_info_help[31] ;
   args_info->cutoff_postprocess_help = gengetopt_args_info_help[32] ;
   args_info->fraction_postprocess_help = gengetopt_args_info_help[33] ;
   args_info->cutoff_trim_help = gengetopt_args_info_help[34] ;
   args_info->remove_rcs_help = gengetopt_args_info_help[35] ;
   args_info->min_info_help = gengetopt_args_info_help[36] ;
-  args_info->min_zscore_help = gengetopt_args_info_help[37] ;
-  args_info->max_motifs_help = gengetopt_args_info_help[38] ;
-  args_info->cache_help = gengetopt_args_info_help[40] ;
+  args_info->max_motifs_help = gengetopt_args_info_help[37] ;
+  args_info->cache_help = gengetopt_args_info_help[39] ;
+  args_info->progressive_help = gengetopt_args_info_help[40] ;
   args_info->threads_help = gengetopt_args_info_help[42] ;
   args_info->skip_help = gengetopt_args_info_help[43] ;
   args_info->random_help = gengetopt_args_info_help[44] ;
   free_string_field (&(args_info->prob_gene_orig));
   free_string_field (&(args_info->pvalue_cond_orig));
   free_string_field (&(args_info->pvalue_motif_orig));
+  free_string_field (&(args_info->zscore_cond_orig));
+  free_string_field (&(args_info->zscore_motif_orig));
   free_string_field (&(args_info->k_orig));
   free_string_field (&(args_info->pvalue_merge_orig));
   free_string_field (&(args_info->cutoff_merge_orig));
   free_string_field (&(args_info->size_minimum_orig));
   free_string_field (&(args_info->size_merge_orig));
   free_string_field (&(args_info->size_maximum_orig));
-  free_string_field (&(args_info->nucleosomes_arg));
-  free_string_field (&(args_info->nucleosomes_orig));
-  free_string_field (&(args_info->conservation_arg));
-  free_string_field (&(args_info->conservation_orig));
   free_string_field (&(args_info->postprocess_arg));
   free_string_field (&(args_info->postprocess_orig));
   free_string_field (&(args_info->known_motifs_arg));
   free_string_field (&(args_info->known_motifs_orig));
   free_string_field (&(args_info->known_cutoff_orig));
+  free_string_field (&(args_info->known_type_arg));
+  free_string_field (&(args_info->known_type_orig));
   free_string_field (&(args_info->cutoff_postprocess_orig));
   free_string_field (&(args_info->fraction_postprocess_orig));
   free_string_field (&(args_info->cutoff_trim_orig));
   free_string_field (&(args_info->min_info_orig));
-  free_string_field (&(args_info->min_zscore_orig));
   free_string_field (&(args_info->max_motifs_orig));
   free_string_field (&(args_info->cache_arg));
   free_string_field (&(args_info->cache_orig));
   clear_given (args_info);
 }
 
+/**
+ * @param val the value to check
+ * @param values the possible values
+ * @return the index of the matched value:
+ * -1 if no value matched,
+ * -2 if more than one value has matched
+ */
+static int
+check_possible_values(const char *val, char *values[])
+{
+  int i, found, last;
+  size_t len;
+
+  if (!val)   /* otherwise strlen() crashes below */
+    return -1; /* -1 means no argument for the option */
+
+  found = last = 0;
+
+  for (i = 0, len = strlen(val); values[i]; ++i)
+    {
+      if (strncmp(val, values[i], len) == 0)
+        {
+          ++found;
+          last = i;
+          if (strlen(values[i]) == len)
+            return i; /* exact macth no need to check more */
+        }
+    }
+
+  if (found == 1) /* one match: OK */
+    return last;
+
+  return (found ? -2 : -1); /* return many values or none matched */
+}
+
 
 static void
 write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
 {
+  int found = -1;
   if (arg) {
-    fprintf(outfile, "%s=\"%s\"\n", opt, arg);
+    if (values) {
+      found = check_possible_values(arg, values);      
+    }
+    if (found >= 0)
+      fprintf(outfile, "%s=\"%s\" # %s\n", opt, arg, values[found]);
+    else
+      fprintf(outfile, "%s=\"%s\"\n", opt, arg);
   } else {
     fprintf(outfile, "%s\n", opt);
   }
     write_into_file(outfile, "pvalue_cond", args_info->pvalue_cond_orig, 0);
   if (args_info->pvalue_motif_given)
     write_into_file(outfile, "pvalue_motif", args_info->pvalue_motif_orig, 0);
+  if (args_info->zscore_cond_given)
+    write_into_file(outfile, "zscore_cond", args_info->zscore_cond_orig, 0);
+  if (args_info->zscore_motif_given)
+    write_into_file(outfile, "zscore_motif", args_info->zscore_motif_orig, 0);
   if (args_info->k_given)
     write_into_file(outfile, "k", args_info->k_orig, 0);
   if (args_info->pvalue_merge_given)
     write_into_file(outfile, "size_merge", args_info->size_merge_orig, 0);
   if (args_info->size_maximum_given)
     write_into_file(outfile, "size_maximum", args_info->size_maximum_orig, 0);
-  if (args_info->nucleosomes_given)
-    write_into_file(outfile, "nucleosomes", args_info->nucleosomes_orig, 0);
-  if (args_info->conservation_given)
-    write_into_file(outfile, "conservation", args_info->conservation_orig, 0);
   if (args_info->postprocess_given)
     write_into_file(outfile, "postprocess", args_info->postprocess_orig, 0);
   if (args_info->known_motifs_given)
     write_into_file(outfile, "known_motifs", args_info->known_motifs_orig, 0);
   if (args_info->known_cutoff_given)
     write_into_file(outfile, "known_cutoff", args_info->known_cutoff_orig, 0);
+  if (args_info->known_type_given)
+    write_into_file(outfile, "known_type", args_info->known_type_orig, cmdline_parser_known_type_values);
   if (args_info->cutoff_postprocess_given)
     write_into_file(outfile, "cutoff_postprocess", args_info->cutoff_postprocess_orig, 0);
   if (args_info->fraction_postprocess_given)
     write_into_file(outfile, "remove_rcs", 0, 0 );
   if (args_info->min_info_given)
     write_into_file(outfile, "min_info", args_info->min_info_orig, 0);
-  if (args_info->min_zscore_given)
-    write_into_file(outfile, "min_zscore", args_info->min_zscore_orig, 0);
   if (args_info->max_motifs_given)
     write_into_file(outfile, "max_motifs", args_info->max_motifs_orig, 0);
   if (args_info->cache_given)
     write_into_file(outfile, "cache", args_info->cache_orig, 0);
+  if (args_info->progressive_given)
+    write_into_file(outfile, "progressive", 0, 0 );
   if (args_info->threads_given)
     write_into_file(outfile, "threads", args_info->threads_orig, 0);
   if (args_info->skip_given)
       return 1; /* failure */
     }
 
+  if (possible_values && (found = check_possible_values((value ? value : default_value), possible_values)) < 0)
+    {
+      if (short_opt != '-')
+        fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s' (`-%c')%s\n", 
+          package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt, short_opt,
+          (additional_error ? additional_error : ""));
+      else
+        fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s'%s\n", 
+          package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt,
+          (additional_error ? additional_error : ""));
+      return 1; /* failure */
+    }
     
   if (field_given && *field_given && ! override)
     return 0;
         { "datasets",	1, NULL, 'd' },
         { "output",	1, NULL, 'o' },
         { "prob_gene",	1, NULL, 'p' },
-        { "pvalue_cond",	1, NULL, 'P' },
+        { "pvalue_cond",	1, NULL, 'c' },
         { "pvalue_motif",	1, NULL, 'm' },
+        { "zscore_cond",	1, NULL, 'C' },
+        { "zscore_motif",	1, NULL, 'M' },
         { "k",	1, NULL, 'k' },
         { "pvalue_merge",	1, NULL, 'g' },
         { "cutoff_merge",	1, NULL, 'G' },
         { "penalty_gap",	1, NULL, 'y' },
         { "penalty_mismatch",	1, NULL, 'Y' },
-        { "pvalue_correl",	1, NULL, 'c' },
-        { "number_correl",	1, NULL, 'C' },
+        { "pvalue_correl",	1, NULL, 'n' },
+        { "number_correl",	1, NULL, 'N' },
         { "sequences",	1, NULL, 'q' },
         { "bases",	1, NULL, 'b' },
         { "size_minimum",	1, NULL, 'z' },
         { "size_merge",	1, NULL, 'E' },
         { "size_maximum",	1, NULL, 'Z' },
-        { "nucleosomes",	1, NULL, 'n' },
-        { "conservation",	1, NULL, 'a' },
         { "postprocess",	1, NULL, 'j' },
         { "known_motifs",	1, NULL, 'K' },
         { "known_cutoff",	1, NULL, 'F' },
+        { "known_type",	1, NULL, 'S' },
         { "cutoff_postprocess",	1, NULL, 'J' },
         { "fraction_postprocess",	1, NULL, 'L' },
         { "cutoff_trim",	1, NULL, 'T' },
         { "remove_rcs",	0, NULL, 'R' },
         { "min_info",	1, NULL, 'u' },
-        { "min_zscore",	1, NULL, 'U' },
         { "max_motifs",	1, NULL, 'x' },
         { "cache",	1, NULL, 'e' },
+        { "progressive",	0, NULL, 'O' },
         { "threads",	1, NULL, 't' },
         { "skip",	1, NULL, 's' },
         { "random",	1, NULL, 'r' },
         { NULL,	0, NULL, 0 }
       };
 
-      c = getopt_long (argc, argv, "hVi:f:d:o:p:P:m:k:g:G:y:Y:c:C:q:b:z:E:Z:n:a:j:K:F:J:L:T:Ru:U:x:e:t:s:r:v:", long_options, &option_index);
+      c = getopt_long (argc, argv, "hVi:f:d:o:p:c:m:C:M:k:g:G:y:Y:n:N:q:b:z:E:Z:j:K:F:S:J:L:T:Ru:x:e:Ot:s:r:v:", long_options, &option_index);
 
       if (c == -1) break;	/* Exit from `while (1)' loop.  */
 
             goto failure;
         
           break;
-        case 'P':	/* P-value threshhold for condition inclusion.  */
+        case 'c':	/* P-value threshhold for condition inclusion.  */
         
         
           if (update_arg( (void *)&(args_info->pvalue_cond_arg), 
                &(args_info->pvalue_cond_orig), &(args_info->pvalue_cond_given),
               &(local_args_info.pvalue_cond_given), optarg, 0, "0.05", ARG_DOUBLE,
               check_ambiguity, override, 0, 0,
-              "pvalue_cond", 'P',
+              "pvalue_cond", 'c',
               additional_error))
             goto failure;
         
             goto failure;
         
           break;
+        case 'C':	/* Z-score threshhold for condition inclusion.  */
+        
+        
+          if (update_arg( (void *)&(args_info->zscore_cond_arg), 
+               &(args_info->zscore_cond_orig), &(args_info->zscore_cond_given),
+              &(local_args_info.zscore_cond_given), optarg, 0, "0.5", ARG_DOUBLE,
+              check_ambiguity, override, 0, 0,
+              "zscore_cond", 'C',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'M':	/* Z-score threshhold for motif inclusion.  */
+        
+        
+          if (update_arg( (void *)&(args_info->zscore_motif_arg), 
+               &(args_info->zscore_motif_orig), &(args_info->zscore_motif_given),
+              &(local_args_info.zscore_motif_given), optarg, 0, "0.5", ARG_DOUBLE,
+              check_ambiguity, override, 0, 0,
+              "zscore_motif", 'M',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'k':	/* Sequence kmer length.  */
         
         
             goto failure;
         
           break;
-        case 'c':	/* P-value threshhold for significant correlation.  */
+        case 'n':	/* P-value threshhold for significant correlation.  */
         
         
           if (update_arg( (void *)&(args_info->pvalue_correl_arg), 
                &(args_info->pvalue_correl_orig), &(args_info->pvalue_correl_given),
               &(local_args_info.pvalue_correl_given), optarg, 0, "0.05", ARG_DOUBLE,
               check_ambiguity, override, 0, 0,
-              "pvalue_correl", 'c',
+              "pvalue_correl", 'n',
               additional_error))
             goto failure;
         
           break;
-        case 'C':	/* Maximum number of pairs to sample for significant correlation.  */
+        case 'N':	/* Maximum number of pairs to sample for significant correlation.  */
         
         
           if (update_arg( (void *)&(args_info->number_correl_arg), 
                &(args_info->number_correl_orig), &(args_info->number_correl_given),
               &(local_args_info.number_correl_given), optarg, 0, "100000", ARG_INT,
               check_ambiguity, override, 0, 0,
-              "number_correl", 'C',
+              "number_correl", 'N',
               additional_error))
             goto failure;
         
             goto failure;
         
           break;
-        case 'n':	/* Nucleosome position file (WIG).  */
-        
-        
-          if (update_arg( (void *)&(args_info->nucleosomes_arg), 
-               &(args_info->nucleosomes_orig), &(args_info->nucleosomes_given),
-              &(local_args_info.nucleosomes_given), optarg, 0, 0, ARG_STRING,
-              check_ambiguity, override, 0, 0,
-              "nucleosomes", 'n',
-              additional_error))
-            goto failure;
-        
-          break;
-        case 'a':	/* Evolutionary conservation file (WIG).  */
-        
-        
-          if (update_arg( (void *)&(args_info->conservation_arg), 
-               &(args_info->conservation_orig), &(args_info->conservation_given),
-              &(local_args_info.conservation_given), optarg, 0, 0, ARG_STRING,
-              check_ambiguity, override, 0, 0,
-              "conservation", 'a',
-              additional_error))
-            goto failure;
-        
-          break;
         case 'j':	/* Input directory of clusters to postprocess.  */
         
         
             goto failure;
         
           break;
-        case 'F':	/* P-value cutoff for known motif labeling.  */
+        case 'F':	/* Score cutoff for known motif labeling.  */
         
         
           if (update_arg( (void *)&(args_info->known_cutoff_arg), 
             goto failure;
         
           break;
+        case 'S':	/* Type of known motif matching.  */
+        
+        
+          if (update_arg( (void *)&(args_info->known_type_arg), 
+               &(args_info->known_type_orig), &(args_info->known_type_given),
+              &(local_args_info.known_type_given), optarg, cmdline_parser_known_type_values, "pvalue", ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "known_type", 'S',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'J':	/* Similarity cutoff for cluster merging.  */
         
         
           if (update_arg( (void *)&(args_info->cutoff_postprocess_arg), 
                &(args_info->cutoff_postprocess_orig), &(args_info->cutoff_postprocess_given),
-              &(local_args_info.cutoff_postprocess_given), optarg, 0, "0.75", ARG_DOUBLE,
+              &(local_args_info.cutoff_postprocess_given), optarg, 0, "1", ARG_DOUBLE,
               check_ambiguity, override, 0, 0,
               "cutoff_postprocess", 'J',
               additional_error))
             goto failure;
         
           break;
-        case 'U':	/* Minimum motif z-score magnitude.  */
-        
-        
-          if (update_arg( (void *)&(args_info->min_zscore_arg), 
-               &(args_info->min_zscore_orig), &(args_info->min_zscore_given),
-              &(local_args_info.min_zscore_given), optarg, 0, "0.2", ARG_DOUBLE,
-              check_ambiguity, override, 0, 0,
-              "min_zscore", 'U',
-              additional_error))
-            goto failure;
-        
-          break;
         case 'x':	/* Maximum motifs to merge exactly.  */
         
         
             goto failure;
         
           break;
+        case 'O':	/* Generate output progressively.  */
+        
+        
+          if (update_arg((void *)&(args_info->progressive_flag), 0, &(args_info->progressive_given),
+              &(local_args_info.progressive_given), optarg, 0, 0, ARG_FLAG,
+              check_ambiguity, override, 1, 0, "progressive", 'O',
+              additional_error))
+            goto failure;
+        
+          break;
         case 't':	/* Maximum number of concurrent threads.  */
         
         

File tools/COALESCE/cmdline.h

View file
  • Ignore whitespace
   double pvalue_motif_arg;	/**< @brief P-value threshhold for motif inclusion (default='0.05').  */
   char * pvalue_motif_orig;	/**< @brief P-value threshhold for motif inclusion original value given at command line.  */
   const char *pvalue_motif_help; /**< @brief P-value threshhold for motif inclusion help description.  */
+  double zscore_cond_arg;	/**< @brief Z-score threshhold for condition inclusion (default='0.5').  */
+  char * zscore_cond_orig;	/**< @brief Z-score threshhold for condition inclusion original value given at command line.  */
+  const char *zscore_cond_help; /**< @brief Z-score threshhold for condition inclusion help description.  */
+  double zscore_motif_arg;	/**< @brief Z-score threshhold for motif inclusion (default='0.5').  */
+  char * zscore_motif_orig;	/**< @brief Z-score threshhold for motif inclusion original value given at command line.  */
+  const char *zscore_motif_help; /**< @brief Z-score threshhold for motif inclusion help description.  */
   int k_arg;	/**< @brief Sequence kmer length (default='7').  */
   char * k_orig;	/**< @brief Sequence kmer length original value given at command line.  */
   const char *k_help; /**< @brief Sequence kmer length help description.  */
   int size_maximum_arg;	/**< @brief Maximum motif count to consider a cluster saturated (default='1000').  */
   char * size_maximum_orig;	/**< @brief Maximum motif count to consider a cluster saturated original value given at command line.  */
   const char *size_maximum_help; /**< @brief Maximum motif count to consider a cluster saturated help description.  */
-  char * nucleosomes_arg;	/**< @brief Nucleosome position file (WIG).  */
-  char * nucleosomes_orig;	/**< @brief Nucleosome position file (WIG) original value given at command line.  */
-  const char *nucleosomes_help; /**< @brief Nucleosome position file (WIG) help description.  */
-  char * conservation_arg;	/**< @brief Evolutionary conservation file (WIG).  */
-  char * conservation_orig;	/**< @brief Evolutionary conservation file (WIG) original value given at command line.  */
-  const char *conservation_help; /**< @brief Evolutionary conservation file (WIG) help description.  */
   char * postprocess_arg;	/**< @brief Input directory of clusters to postprocess.  */
   char * postprocess_orig;	/**< @brief Input directory of clusters to postprocess original value given at command line.  */
   const char *postprocess_help; /**< @brief Input directory of clusters to postprocess help description.  */
   char * known_motifs_arg;	/**< @brief File containing known motifs.  */
   char * known_motifs_orig;	/**< @brief File containing known motifs original value given at command line.  */
   const char *known_motifs_help; /**< @brief File containing known motifs help description.  */
-  double known_cutoff_arg;	/**< @brief P-value cutoff for known motif labeling (default='0.05').  */
-  char * known_cutoff_orig;	/**< @brief P-value cutoff for known motif labeling original value given at command line.  */
-  const char *known_cutoff_help; /**< @brief P-value cutoff for known motif labeling help description.  */
-  double cutoff_postprocess_arg;	/**< @brief Similarity cutoff for cluster merging (default='0.75').  */
+  double known_cutoff_arg;	/**< @brief Score cutoff for known motif labeling (default='0.05').  */
+  char * known_cutoff_orig;	/**< @brief Score cutoff for known motif labeling original value given at command line.  */
+  const char *known_cutoff_help; /**< @brief Score cutoff for known motif labeling help description.  */
+  char * known_type_arg;	/**< @brief Type of known motif matching (default='pvalue').  */
+  char * known_type_orig;	/**< @brief Type of known motif matching original value given at command line.  */
+  const char *known_type_help; /**< @brief Type of known motif matching help description.  */
+  double cutoff_postprocess_arg;	/**< @brief Similarity cutoff for cluster merging (default='1').  */
   char * cutoff_postprocess_orig;	/**< @brief Similarity cutoff for cluster merging original value given at command line.  */
   const char *cutoff_postprocess_help; /**< @brief Similarity cutoff for cluster merging help description.  */
   double fraction_postprocess_arg;	/**< @brief Overlap fraction for postprocessing gene/condition inclusion (default='0.5').  */
   double min_info_arg;	/**< @brief Uninformative motif threshhold (bits) (default='0.3').  */
   char * min_info_orig;	/**< @brief Uninformative motif threshhold (bits) original value given at command line.  */
   const char *min_info_help; /**< @brief Uninformative motif threshhold (bits) help description.  */
-  double min_zscore_arg;	/**< @brief Minimum motif z-score magnitude (default='0.2').  */
-  char * min_zscore_orig;	/**< @brief Minimum motif z-score magnitude original value given at command line.  */
-  const char *min_zscore_help; /**< @brief Minimum motif z-score magnitude help description.  */
   int max_motifs_arg;	/**< @brief Maximum motifs to merge exactly (default='2500').  */
   char * max_motifs_orig;	/**< @brief Maximum motifs to merge exactly original value given at command line.  */
   const char *max_motifs_help; /**< @brief Maximum motifs to merge exactly help description.  */
   char * cache_arg;	/**< @brief Cache file for sequence analysis.  */
   char * cache_orig;	/**< @brief Cache file for sequence analysis original value given at command line.  */
   const char *cache_help; /**< @brief Cache file for sequence analysis help description.  */
+  int progressive_flag;	/**< @brief Generate output progressively (default=on).  */
+  const char *progressive_help; /**< @brief Generate output progressively help description.  */
   int threads_arg;	/**< @brief Maximum number of concurrent threads (default='1').  */
   char * threads_orig;	/**< @brief Maximum number of concurrent threads original value given at command line.  */
   const char *threads_help; /**< @brief Maximum number of concurrent threads help description.  */
   unsigned int prob_gene_given ;	/**< @brief Whether prob_gene was given.  */
   unsigned int pvalue_cond_given ;	/**< @brief Whether pvalue_cond was given.  */
   unsigned int pvalue_motif_given ;	/**< @brief Whether pvalue_motif was given.  */
+  unsigned int zscore_cond_given ;	/**< @brief Whether zscore_cond was given.  */
+  unsigned int zscore_motif_given ;	/**< @brief Whether zscore_motif was given.  */
   unsigned int k_given ;	/**< @brief Whether k was given.  */
   unsigned int pvalue_merge_given ;	/**< @brief Whether pvalue_merge was given.  */
   unsigned int cutoff_merge_given ;	/**< @brief Whether cutoff_merge was given.  */
   unsigned int size_minimum_given ;	/**< @brief Whether size_minimum was given.  */
   unsigned int size_merge_given ;	/**< @brief Whether size_merge was given.  */
   unsigned int size_maximum_given ;	/**< @brief Whether size_maximum was given.  */
-  unsigned int nucleosomes_given ;	/**< @brief Whether nucleosomes was given.  */
-  unsigned int conservation_given ;	/**< @brief Whether conservation was given.  */
   unsigned int postprocess_given ;	/**< @brief Whether postprocess was given.  */
   unsigned int known_motifs_given ;	/**< @brief Whether known_motifs was given.  */
   unsigned int known_cutoff_given ;	/**< @brief Whether known_cutoff was given.  */
+  unsigned int known_type_given ;	/**< @brief Whether known_type was given.  */
   unsigned int cutoff_postprocess_given ;	/**< @brief Whether cutoff_postprocess was given.  */
   unsigned int fraction_postprocess_given ;	/**< @brief Whether fraction_postprocess was given.  */
   unsigned int cutoff_trim_given ;	/**< @brief Whether cutoff_trim was given.  */
   unsigned int remove_rcs_given ;	/**< @brief Whether remove_rcs was given.  */
   unsigned int min_info_given ;	/**< @brief Whether min_info was given.  */
-  unsigned int min_zscore_given ;	/**< @brief Whether min_zscore was given.  */
   unsigned int max_motifs_given ;	/**< @brief Whether max_motifs was given.  */
   unsigned int cache_given ;	/**< @brief Whether cache was given.  */
+  unsigned int progressive_given ;	/**< @brief Whether progressive was given.  */
   unsigned int threads_given ;	/**< @brief Whether threads was given.  */
   unsigned int skip_given ;	/**< @brief Whether skip was given.  */
   unsigned int random_given ;	/**< @brief Whether random was given.  */
 int cmdline_parser_required (struct gengetopt_args_info *args_info,
   const char *prog_name);
 
+extern char *cmdline_parser_known_type_values[] ;	/**< @brief Possible values for known_type.  */
+
 
 #ifdef __cplusplus
 }

File tools/Makefile.am

View file
  • Ignore whitespace
 	  MCluster \
 	  Matcher \
 	  MIer \
+	  Netwalker \
 	  Normalizer \
 	  Orthologer \
 	  Overlapper \
 	  PCLPlotter \
 	  Randomizer \
 	  Seqs2Ngrams \
+	  SVDer \
 	  Synthesizer \
 	  Txt2Bin
 if WITH_SMILE_TOOLS

File tools/PCLPlotter/cmdline.c

View file
  • Ignore whitespace
 const char *gengetopt_args_info_description = "";
 
 const char *gengetopt_args_info_help[] = {
-  "  -h, --help            Print help and exit",
-  "  -V, --version         Print version and exit",
+  "  -h, --help                 Print help and exit",
+  "  -V, --version              Print version and exit",
   "\nMain:",
-  "  -i, --input=filename  Input PCL file",
+  "  -i, --input=filename       Input PCL file",
+  "  -f, --fasta=filename       Gene sequence file",
+  "\n Group: Foreground_Background",
+  "  -b, --background=filename  Background PCL file",
+  "  -g, --genes=filename       Foreground gene list",
+  "  -m, --motifs=filename      Known motif list",
   "\nOptional:",
-  "  -s, --skip=INT        Columns to skip in input PCL  (default=`2')",
-  "  -v, --verbosity=INT   Message verbosity  (default=`5')",
+  "  -k, --k=INT                Length of motif words  (default=`7')",
+  "  -d, --degree=INT           Degree of HMM for sequence summary  (default=`0')",
+  "  -s, --skip=INT             Columns to skip in input PCL  (default=`2')",
+  "  -v, --verbosity=INT        Message verbosity  (default=`5')",
     0
 };
 
   args_info->help_given = 0 ;
   args_info->version_given = 0 ;
   args_info->input_given = 0 ;
+  args_info->fasta_given = 0 ;
+  args_info->background_given = 0 ;
+  args_info->genes_given = 0 ;
+  args_info->motifs_given = 0 ;
+  args_info->k_given = 0 ;
+  args_info->degree_given = 0 ;
   args_info->skip_given = 0 ;
   args_info->verbosity_given = 0 ;
+  args_info->Foreground_Background_group_counter = 0 ;
 }
 
 static
 {
   args_info->input_arg = NULL;
   args_info->input_orig = NULL;
+  args_info->fasta_arg = NULL;
+  args_info->fasta_orig = NULL;
+  args_info->background_arg = NULL;
+  args_info->background_orig = NULL;
+  args_info->genes_arg = NULL;
+  args_info->genes_orig = NULL;
+  args_info->motifs_arg = NULL;
+  args_info->motifs_orig = NULL;
+  args_info->k_arg = 7;
+  args_info->k_orig = NULL;
+  args_info->degree_arg = 0;
+  args_info->degree_orig = NULL;
   args_info->skip_arg = 2;
   args_info->skip_orig = NULL;
   args_info->verbosity_arg = 5;
   args_info->help_help = gengetopt_args_info_help[0] ;
   args_info->version_help = gengetopt_args_info_help[1] ;
   args_info->input_help = gengetopt_args_info_help[3] ;
-  args_info->skip_help = gengetopt_args_info_help[5] ;
-  args_info->verbosity_help = gengetopt_args_info_help[6] ;
+  args_info->fasta_help = gengetopt_args_info_help[4] ;
+  args_info->background_help = gengetopt_args_info_help[6] ;
+  args_info->genes_help = gengetopt_args_info_help[7] ;
+  args_info->motifs_help = gengetopt_args_info_help[8] ;
+  args_info->k_help = gengetopt_args_info_help[10] ;
+  args_info->degree_help = gengetopt_args_info_help[11] ;
+  args_info->skip_help = gengetopt_args_info_help[12] ;
+  args_info->verbosity_help = gengetopt_args_info_help[13] ;
   
 }
 
   unsigned int i;
   free_string_field (&(args_info->input_arg));
   free_string_field (&(args_info->input_orig));
+  free_string_field (&(args_info->fasta_arg));
+  free_string_field (&(args_info->fasta_orig));
+  free_string_field (&(args_info->background_arg));
+  free_string_field (&(args_info->background_orig));
+  free_string_field (&(args_info->genes_arg));
+  free_string_field (&(args_info->genes_orig));
+  free_string_field (&(args_info->motifs_arg));
+  free_string_field (&(args_info->motifs_orig));
+  free_string_field (&(args_info->k_orig));
+  free_string_field (&(args_info->degree_orig));
   free_string_field (&(args_info->skip_orig));
   free_string_field (&(args_info->verbosity_orig));
   
     write_into_file(outfile, "version", 0, 0 );
   if (args_info->input_given)
     write_into_file(outfile, "input", args_info->input_orig, 0);
+  if (args_info->fasta_given)
+    write_into_file(outfile, "fasta", args_info->fasta_orig, 0);
+  if (args_info->background_given)
+    write_into_file(outfile, "background", args_info->background_orig, 0);
+  if (args_info->genes_given)
+    write_into_file(outfile, "genes", args_info->genes_orig, 0);
+  if (args_info->motifs_given)
+    write_into_file(outfile, "motifs", args_info->motifs_orig, 0);
+  if (args_info->k_given)
+    write_into_file(outfile, "k", args_info->k_orig, 0);
+  if (args_info->degree_given)
+    write_into_file(outfile, "degree", args_info->degree_orig, 0);
   if (args_info->skip_given)
     write_into_file(outfile, "skip", args_info->skip_orig, 0);
   if (args_info->verbosity_given)
   return result;
 }
 
+static void
+reset_group_Foreground_Background(struct gengetopt_args_info *args_info)
+{
+  if (! args_info->Foreground_Background_group_counter)
+    return;
+  
+  args_info->background_given = 0 ;
+  free_string_field (&(args_info->background_arg));
+  free_string_field (&(args_info->background_orig));
+  args_info->genes_given = 0 ;
+  free_string_field (&(args_info->genes_arg));
+  free_string_field (&(args_info->genes_orig));
+  args_info->motifs_given = 0 ;
+  free_string_field (&(args_info->motifs_arg));
+  free_string_field (&(args_info->motifs_orig));
+
+  args_info->Foreground_Background_group_counter = 0;
+}
+
 int
 cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
 {
         { "help",	0, NULL, 'h' },
         { "version",	0, NULL, 'V' },
         { "input",	1, NULL, 'i' },
+        { "fasta",	1, NULL, 'f' },
+        { "background",	1, NULL, 'b' },
+        { "genes",	1, NULL, 'g' },
+        { "motifs",	1, NULL, 'm' },
+        { "k",	1, NULL, 'k' },
+        { "degree",	1, NULL, 'd' },
         { "skip",	1, NULL, 's' },
         { "verbosity",	1, NULL, 'v' },
         { NULL,	0, NULL, 0 }
       };
 
-      c = getopt_long (argc, argv, "hVi:s:v:", long_options, &option_index);
+      c = getopt_long (argc, argv, "hVi:f:b:g:m:k:d:s:v:", long_options, &option_index);
 
       if (c == -1) break;	/* Exit from `while (1)' loop.  */
 
             goto failure;
         
           break;
+        case 'f':	/* Gene sequence file.  */
+        
+        
+          if (update_arg( (void *)&(args_info->fasta_arg), 
+               &(args_info->fasta_orig), &(args_info->fasta_given),
+              &(local_args_info.fasta_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "fasta", 'f',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'b':	/* Background PCL file.  */
+        
+          if (args_info->Foreground_Background_group_counter && override)
+            reset_group_Foreground_Background (args_info);
+          args_info->Foreground_Background_group_counter += 1;
+        
+          if (update_arg( (void *)&(args_info->background_arg), 
+               &(args_info->background_orig), &(args_info->background_given),
+              &(local_args_info.background_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "background", 'b',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'g':	/* Foreground gene list.  */
+        
+          if (args_info->Foreground_Background_group_counter && override)
+            reset_group_Foreground_Background (args_info);
+          args_info->Foreground_Background_group_counter += 1;
+        
+          if (update_arg( (void *)&(args_info->genes_arg), 
+               &(args_info->genes_orig), &(args_info->genes_given),
+              &(local_args_info.genes_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "genes", 'g',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'm':	/* Known motif list.  */
+        
+          if (args_info->Foreground_Background_group_counter && override)
+            reset_group_Foreground_Background (args_info);
+          args_info->Foreground_Background_group_counter += 1;
+        
+          if (update_arg( (void *)&(args_info->motifs_arg), 
+               &(args_info->motifs_orig), &(args_info->motifs_given),
+              &(local_args_info.motifs_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "motifs", 'm',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'k':	/* Length of motif words.  */
+        
+        
+          if (update_arg( (void *)&(args_info->k_arg), 
+               &(args_info->k_orig), &(args_info->k_given),
+              &(local_args_info.k_given), optarg, 0, "7", ARG_INT,
+              check_ambiguity, override, 0, 0,
+              "k", 'k',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'd':	/* Degree of HMM for sequence summary.  */
+        
+        
+          if (update_arg( (void *)&(args_info->degree_arg), 
+               &(args_info->degree_orig), &(args_info->degree_given),
+              &(local_args_info.degree_given), optarg, 0, "0", ARG_INT,
+              check_ambiguity, override, 0, 0,
+              "degree", 'd',
+              additional_error))
+            goto failure;
+        
+          break;
         case 's':	/* Columns to skip in input PCL.  */
         
         
         } /* switch */
     } /* while */
 
+  if (args_info->Foreground_Background_group_counter > 1)
+    {
+      fprintf (stderr, "%s: %d options of group Foreground_Background were given. At most one is required.%s\n", argv[0], args_info->Foreground_Background_group_counter, (additional_error ? additional_error : ""));
+      error = 1;
+    }
+  
 
 
 

File tools/PCLPlotter/cmdline.h

View file
  • Ignore whitespace
   char * input_arg;	/**< @brief Input PCL file.  */
   char * input_orig;	/**< @brief Input PCL file original value given at command line.  */
   const char *input_help; /**< @brief Input PCL file help description.  */
+  char * fasta_arg;	/**< @brief Gene sequence file.  */
+  char * fasta_orig;	/**< @brief Gene sequence file original value given at command line.  */
+  const char *fasta_help; /**< @brief Gene sequence file help description.  */
+  char * background_arg;	/**< @brief Background PCL file.  */
+  char * background_orig;	/**< @brief Background PCL file original value given at command line.  */
+  const char *background_help; /**< @brief Background PCL file help description.  */
+  char * genes_arg;	/**< @brief Foreground gene list.  */
+  char * genes_orig;	/**< @brief Foreground gene list original value given at command line.  */
+  const char *genes_help; /**< @brief Foreground gene list help description.  */
+  char * motifs_arg;	/**< @brief Known motif list.  */
+  char * motifs_orig;	/**< @brief Known motif list original value given at command line.  */
+  const char *motifs_help; /**< @brief Known motif list help description.  */
+  int k_arg;	/**< @brief Length of motif words (default='7').  */
+  char * k_orig;	/**< @brief Length of motif words original value given at command line.  */
+  const char *k_help; /**< @brief Length of motif words help description.  */
+  int degree_arg;	/**< @brief Degree of HMM for sequence summary (default='0').  */
+  char * degree_orig;	/**< @brief Degree of HMM for sequence summary original value given at command line.  */
+  const char *degree_help; /**< @brief Degree of HMM for sequence summary help description.  */
   int skip_arg;	/**< @brief Columns to skip in input PCL (default='2').  */
   char * skip_orig;	/**< @brief Columns to skip in input PCL original value given at command line.  */
   const char *skip_help; /**< @brief Columns to skip in input PCL help description.  */
   unsigned int help_given ;	/**< @brief Whether help was given.  */
   unsigned int version_given ;	/**< @brief Whether version was given.  */
   unsigned int input_given ;	/**< @brief Whether input was given.  */
+  unsigned int fasta_given ;	/**< @brief Whether fasta was given.  */
+  unsigned int background_given ;	/**< @brief Whether background was given.  */
+  unsigned int genes_given ;	/**< @brief Whether genes was given.  */
+  unsigned int motifs_given ;	/**< @brief Whether motifs was given.  */
+  unsigned int k_given ;	/**< @brief Whether k was given.  */
+  unsigned int degree_given ;	/**< @brief Whether degree was given.  */
   unsigned int skip_given ;	/**< @brief Whether skip was given.  */
   unsigned int verbosity_given ;	/**< @brief Whether verbosity was given.  */
 
   char **inputs ; /**< @brief unamed options (options without names) */
   unsigned inputs_num ; /**< @brief unamed options number */
+  int Foreground_Background_group_counter; /**< @brief Counter for group Foreground_Background */
 } ;
 
 /** @brief The additional parameters to pass to parser functions */

File tools/SVDer/cmdline.c

View file
  • Ignore whitespace
-/*
-  File autogenerated by gengetopt version 2.22
-  generated with the following command:
-  ..\..\..\..\extlib\proj\vs2008\release\gengetopt.exe --default-optional -N -e --output-dir=c:\Documents and Settings\eblis\My Documents\Visual Studio 2008\Projects\Sleipnir\trunk\tools\SVDer\ -i ..\..\..\tools\SVDer\SVDer.ggo 
-
-  The developers of gengetopt consider the fixed text that goes in all
-  gengetopt output files to be in the public domain:
-  we make no copyright claims on it.
-*/
-
-/* If we use autoconf.  */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "getopt.h"
-
-#include "cmdline.h"
-
-const char *gengetopt_args_info_purpose = "Transforms PCL data through Support Vector Decomposition";
-
-const char *gengetopt_args_info_usage = "Usage: SVDer [OPTIONS]...";
-
-const char *gengetopt_args_info_description = "";
-
-const char *gengetopt_args_info_help[] = {
-  "  -h, --help                 Print help and exit",
-  "  -V, --version              Print version and exit",
-  "\nMain:",
-  "  -i, --input=filename       Input PCL file",
-  "  -o, --output=filename      Output PCL file",
-  "  -u, --umatrix=filename     Output U matrix PCL file",
-  "\nSVD:",
-  "  -r, --reprojection=DOUBLE  Fraction of variance to reproject  (default=`1')",
-  "  -t, --transform=DOUBLE     Transformation function parameter  (default=`1')",
-  "  -b, --signal_balance       Equally weight all SVs  (default=off)",
-  "\nOptional:",
-  "  -s, --skip=INT             Columns to skip in input PCL  (default=`2')",
-  "  -v, --verbosity=INT        Message verbosity  (default=`5')",
-    0
-};
-
-typedef enum {ARG_NO
-  , ARG_FLAG
-  , ARG_STRING
-  , ARG_INT
-  , ARG_DOUBLE
-} cmdline_parser_arg_type;
-
-static
-void clear_given (struct gengetopt_args_info *args_info);
-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,
-                        struct cmdline_parser_params *params, const char *additional_error);
-
-
-static char *
-gengetopt_strdup (const char *s);
-
-static
-void clear_given (struct gengetopt_args_info *args_info)
-{
-  args_info->help_given = 0 ;
-  args_info->version_given = 0 ;
-  args_info->input_given = 0 ;
-  args_info->output_given = 0 ;
-  args_info->umatrix_given = 0 ;
-  args_info->reprojection_given = 0 ;
-  args_info->transform_given = 0 ;
-  args_info->signal_balance_given = 0 ;
-  args_info->skip_given = 0 ;
-  args_info->verbosity_given = 0 ;
-}
-
-static
-void clear_args (struct gengetopt_args_info *args_info)
-{
-  args_info->input_arg = NULL;
-  args_info->input_orig = NULL;
-  args_info->output_arg = NULL;
-  args_info->output_orig = NULL;
-  args_info->umatrix_arg = NULL;
-  args_info->umatrix_orig = NULL;
-  args_info->reprojection_arg = 1;
-  args_info->reprojection_orig = NULL;
-  args_info->transform_arg = 1;
-  args_info->transform_orig = NULL;
-  args_info->signal_balance_flag = 0;
-  args_info->skip_arg = 2;
-  args_info->skip_orig = NULL;
-  args_info->verbosity_arg = 5;
-  args_info->verbosity_orig = NULL;
-  
-}
-
-static
-void init_args_info(struct gengetopt_args_info *args_info)
-{
-
-
-  args_info->help_help = gengetopt_args_info_help[0] ;
-  args_info->version_help = gengetopt_args_info_help[1] ;
-  args_info->input_help = gengetopt_args_info_help[3] ;
-  args_info->output_help = gengetopt_args_info_help[4] ;
-  args_info->umatrix_help = gengetopt_args_info_help[5] ;
-  args_info->reprojection_help = gengetopt_args_info_help[7] ;
-  args_info->transform_help = gengetopt_args_info_help[8] ;
-  args_info->signal_balance_help = gengetopt_args_info_help[9] ;
-  args_info->skip_help = gengetopt_args_info_help[11] ;
-  args_info->verbosity_help = gengetopt_args_info_help[12] ;
-  
-}
-
-void
-cmdline_parser_print_version (void)
-{
-  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
-}
-
-static void print_help_common(void) {
-  cmdline_parser_print_version ();
-
-  if (strlen(gengetopt_args_info_purpose) > 0)
-    printf("\n%s\n", gengetopt_args_info_purpose);
-
-  if (strlen(gengetopt_args_info_usage) > 0)
-    printf("\n%s\n", gengetopt_args_info_usage);
-
-  printf("\n");
-
-  if (strlen(gengetopt_args_info_description) > 0)
-    printf("%s\n", gengetopt_args_info_description);
-}
-
-void
-cmdline_parser_print_help (void)
-{
-  int i = 0;
-  print_help_common();
-  while (gengetopt_args_info_help[i])
-    printf("%s\n", gengetopt_args_info_help[i++]);
-}
-
-void
-cmdline_parser_init (struct gengetopt_args_info *args_info)
-{
-  clear_given (args_info);
-  clear_args (args_info);
-  init_args_info (args_info);
-}
-
-void
-cmdline_parser_params_init(struct cmdline_parser_params *params)
-{
-  if (params)
-    { 
-      params->override = 0;
-      params->initialize = 1;
-      params->check_required = 1;
-      params->check_ambiguity = 0;
-      params->print_errors = 1;
-    }
-}
-
-struct cmdline_parser_params *
-cmdline_parser_params_create(void)
-{
-  struct cmdline_parser_params *params = 
-    (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params));
-  cmdline_parser_params_init(params);  
-  return params;
-}
-
-static void
-free_string_field (char **s)
-{
-  if (*s)
-    {
-      free (*s);
-      *s = 0;
-    }
-}
-
-
-static void
-cmdline_parser_release (struct gengetopt_args_info *args_info)
-{
-
-  free_string_field (&(args_info->input_arg));
-  free_string_field (&(args_info->input_orig));
-  free_string_field (&(args_info->output_arg));
-  free_string_field (&(args_info->output_orig));
-  free_string_field (&(args_info->umatrix_arg));
-  free_string_field (&(args_info->umatrix_orig));
-  free_string_field (&(args_info->reprojection_orig));
-  free_string_field (&(args_info->transform_orig));
-  free_string_field (&(args_info->skip_orig));
-  free_string_field (&(args_info->verbosity_orig));
-  
-  
-
-  clear_given (args_info);
-}
-
-
-static void
-write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
-{
-  if (arg) {
-    fprintf(outfile, "%s=\"%s\"\n", opt, arg);
-  } else {
-    fprintf(outfile, "%s\n", opt);
-  }
-}
-
-
-int
-cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
-{
-  int i = 0;
-
-  if (!outfile)
-    {
-      fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE);
-      return EXIT_FAILURE;
-    }
-
-  if (args_info->help_given)
-    write_into_file(outfile, "help", 0, 0 );
-  if (args_info->version_given)
-    write_into_file(outfile, "version", 0, 0 );
-  if (args_info->input_given)
-    write_into_file(outfile, "input", args_info->input_orig, 0);
-  if (args_info->output_given)
-    write_into_file(outfile, "output", args_info->output_orig, 0);
-  if (args_info->umatrix_given)
-    write_into_file(outfile, "umatrix", args_info->umatrix_orig, 0);
-  if (args_info->reprojection_given)
-    write_into_file(outfile, "reprojection", args_info->reprojection_orig, 0);
-  if (args_info->transform_given)
-    write_into_file(outfile, "transform", args_info->transform_orig, 0);
-  if (args_info->signal_balance_given)
-    write_into_file(outfile, "signal_balance", 0, 0 );
-  if (args_info->skip_given)
-    write_into_file(outfile, "skip", args_info->skip_orig, 0);
-  if (args_info->verbosity_given)
-    write_into_file(outfile, "verbosity", args_info->verbosity_orig, 0);
-  
-
-  i = EXIT_SUCCESS;
-  return i;
-}
-
-int
-cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
-{
-  FILE *outfile;
-  int i = 0;
-
-  outfile = fopen(filename, "w");
-
-  if (!outfile)
-    {
-      fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
-      return EXIT_FAILURE;
-    }
-
-  i = cmdline_parser_dump(outfile, args_info);
-  fclose (outfile);
-
-  return i;
-}
-
-void
-cmdline_parser_free (struct gengetopt_args_info *args_info)
-{
-  cmdline_parser_release (args_info);
-}
-
-/** @brief replacement of strdup, which is not standard */
-char *
-gengetopt_strdup (const char *s)
-{
-  char *result = NULL;
-  if (!s)
-    return result;
-
-  result = (char*)malloc(strlen(s) + 1);
-  if (result == (char*)0)
-    return (char*)0;
-  strcpy(result, s);
-  return result;
-}
-
-int
-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 * const *argv, struct gengetopt_args_info *args_info,
-                   struct cmdline_parser_params *params)
-{
-  int result;
-  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
-
-  return result;
-}
-
-int
-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.override = override;
-  params.initialize = initialize;
-  params.check_required = check_required;
-  params.check_ambiguity = 0;
-  params.print_errors = 1;
-
-  result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
-
-  return result;
-}
-
-int
-cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
-{
-  return EXIT_SUCCESS;
-}
-
-
-static char *package_name = 0;
-
-/**
- * @brief updates an option
- * @param field the generic pointer to the field to update
- * @param orig_field the pointer to the orig field
- * @param field_given the pointer to the number of occurrence of this option
- * @param prev_given the pointer to the number of occurrence already seen
- * @param value the argument for this option (if null no arg was specified)
- * @param possible_values the possible values for this option (if specified)
- * @param default_value the default value (in case the option only accepts fixed values)
- * @param arg_type the type of this option
- * @param check_ambiguity @see cmdline_parser_params.check_ambiguity
- * @param override @see cmdline_parser_params.override
- * @param no_free whether to free a possible previous value
- * @param multiple_option whether this is a multiple option
- * @param long_opt the corresponding long option
- * @param short_opt the corresponding short option (or '-' if none)
- * @param additional_error possible further error specification
- */
-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,
-               cmdline_parser_arg_type arg_type,
-               int check_ambiguity, int override,
-               int no_free, int multiple_option,
-               const char *long_opt, char short_opt,
-               const char *additional_error)
-{
-  char *stop_char = 0;
-  const char *val = value;
-  int found;
-  char **string_field;
-
-  stop_char = 0;
-  found = 0;
-
-  if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
-    {
-      if (short_opt != '-')
-        fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", 
-               package_name, long_opt, short_opt,
-               (additional_error ? additional_error : ""));
-      else
-        fprintf (stderr, "%s: `--%s' option given more than once%s\n", 
-               package_name, long_opt,
-               (additional_error ? additional_error : ""));
-      return 1; /* failure */
-    }
-
-    
-  if (field_given && *field_given && ! override)
-    return 0;
-  if (prev_given)
-    (*prev_given)++;
-  if (field_given)
-    (*field_given)++;
-  if (possible_values)
-    val = possible_values[found];
-
-  switch(arg_type) {
-  case ARG_FLAG:
-    *((int *)field) = !*((int *)field);
-    break;
-  case ARG_INT:
-    if (val) *((int *)field) = strtol (val, &stop_char, 0);
-    break;
-  case ARG_DOUBLE:
-    if (val) *((double *)field) = strtod (val, &stop_char);
-    break;
-  case ARG_STRING:
-    if (val) {
-      string_field = (char **)field;
-      if (!no_free && *string_field)
-        free (*string_field); /* free previous string */
-      *string_field = gengetopt_strdup (val);
-    }
-    break;
-  default:
-    break;
-  };
-
-  /* check numeric conversion */
-  switch(arg_type) {
-  case ARG_INT:
-  case ARG_DOUBLE:
-    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) {
-  case ARG_NO:
-  case ARG_FLAG:
-    break;
-  default:
-    if (value && orig_field) {
-      if (no_free) {
-        *orig_field = value;
-      } else {
-        if (*orig_field)
-          free (*orig_field); /* free previous string */
-        *orig_field = gengetopt_strdup (value);
-      }
-    }
-  };
-
-  return 0; /* OK */
-}
-
-
-int
-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.  */
-
-  int error = 0;
-  struct gengetopt_args_info local_args_info;
-  
-  int override;
-  int initialize;
-  int check_required;
-  int check_ambiguity;
-  
-  package_name = argv[0];
-  
-  override = params->override;
-  initialize = params->initialize;
-  check_required = params->check_required;
-  check_ambiguity = params->check_ambiguity;
-
-  if (initialize)
-    cmdline_parser_init (args_info);
-
-  cmdline_parser_init (&local_args_info);
-
-  optarg = 0;
-  optind = 0;
-  opterr = params->print_errors;
-  optopt = '?';
-
-  while (1)
-    {
-      int option_index = 0;
-
-      static struct option long_options[] = {
-        { "help",	0, NULL, 'h' },
-        { "version",	0, NULL, 'V' },
-        { "input",	1, NULL, 'i' },
-        { "output",	1, NULL, 'o' },
-        { "umatrix",	1, NULL, 'u' },
-        { "reprojection",	1, NULL, 'r' },
-        { "transform",	1, NULL, 't' },
-        { "signal_balance",	0, NULL, 'b' },
-        { "skip",	1, NULL, 's' },
-        { "verbosity",	1, NULL, 'v' },
-        { NULL,	0, NULL, 0 }
-      };
-
-      c = getopt_long (argc, argv, "hVi:o:u:r:t:bs:v:", long_options, &option_index);
-
-      if (c == -1) break;	/* Exit from `while (1)' loop.  */
-
-      switch (c)
-        {
-        case 'h':	/* Print help and exit.  */
-          cmdline_parser_print_help ();
-          cmdline_parser_free (&local_args_info);
-          exit (EXIT_SUCCESS);
-
-        case 'V':	/* Print version and exit.  */
-        
-        
-          if (update_arg( 0 , 
-               0 , &(args_info->version_given),
-              &(local_args_info.version_given), optarg, 0, 0, ARG_NO,
-              check_ambiguity, override, 0, 0,
-              "version", 'V',
-              additional_error))
-            goto failure;
-          cmdline_parser_free (&local_args_info);
-          return 0;
-        
-          break;
-        case 'i':	/* Input PCL file.  */
-        
-        
-          if (update_arg( (void *)&(args_info->input_arg), 
-               &(args_info->input_orig), &(args_info->input_given),
-              &(local_args_info.input_given), optarg, 0, 0, ARG_STRING,
-              check_ambiguity, override, 0, 0,
-              "input", 'i',
-              additional_error))
-            goto failure;
-        
-          break;
-        case 'o':	/* Output PCL file.  */
-        
-        
-          if (update_arg( (void *)&(args_info->output_arg), 
-               &(args_info->output_orig), &(args_info->output_given),
-              &(local_args_info.output_given), optarg, 0, 0, ARG_STRING,
-              check_ambiguity, override, 0, 0,
-              "output", 'o',
-              additional_error))
-            goto failure;
-        
-          break;
-        case 'u':	/* Output U matrix PCL file.  */
-        
-        
-          if (update_arg( (void *)&(args_info->umatrix_arg), 
-               &(args_info->umatrix_orig), &(args_info->umatrix_given),
-              &(local_args_info.umatrix_given), optarg, 0, 0, ARG_STRING,
-              check_ambiguity, override, 0, 0,
-              "umatrix", 'u',
-              additional_error))
-            goto failure;
-        
-          break;
-        case 'r':	/* Fraction of variance to reproject.  */
-        
-        
-          if (update_arg( (void *)&(args_info->reprojection_arg), 
-               &(args_info->reprojection_orig), &(args_info->reprojection_given),
-              &(local_args_info.reprojection_given), optarg, 0, "1", ARG_DOUBLE,
-              check_ambiguity, override, 0, 0,
-              "reprojection", 'r',
-              additional_error))
-            goto failure;
-        
-          break;
-        case 't':	/* Transformation function parameter.  */
-        
-        
-          if (update_arg( (void *)&(args_info->transform_arg), 
-               &(args_info->transform_orig), &(args_info->transform_given),
-              &(local_args_info.transform_given), optarg, 0, "1", ARG_DOUBLE,
-              check_ambiguity, override, 0, 0,
-              "transform", 't',
-              additional_error))
-            goto failure;
-        
-          break;
-        case 'b':	/* Equally weight all SVs.  */
-        
-        
-          if (update_arg((void *)&(args_info->signal_balance_flag), 0, &(args_info->signal_balance_given),
-              &(local_args_info.signal_balance_given), optarg, 0, 0, ARG_FLAG,
-              check_ambiguity, override, 1, 0, "signal_balance", 'b',
-              additional_error))
-            goto failure;
-        
-          break;
-        case 's':	/* Columns to skip in input PCL.  */
-        
-        
-          if (update_arg( (void *)&(args_info->skip_arg), 
-               &(args_info->skip_orig), &(args_info->skip_given),
-              &(local_args_info.skip_given), optarg, 0, "2", ARG_INT,
-              check_ambiguity, override, 0, 0,
-              "skip", 's',
-              additional_error))
-            goto failure;
-        
-          break;
-        case 'v':	/* Message verbosity.  */
-        
-        
-          if (update_arg( (void *)&(args_info->verbosity_arg), 
-               &(args_info->verbosity_orig), &(args_info->verbosity_given),
-              &(local_args_info.verbosity_given), optarg, 0, "5", ARG_INT,
-              check_ambiguity, override, 0, 0,
-              "verbosity", 'v',
-              additional_error))
-            goto failure;
-        
-          break;
-
-        case 0:	/* Long option with no short option */
-        case '?':	/* Invalid option.  */
-          /* `getopt_long' already printed an error message.  */
-          goto failure;
-
-        default:	/* bug: option not considered.  */
-          fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : ""));
-          abort ();
-        } /* switch */
-    } /* while */
-
-
-
-
-  cmdline_parser_release (&local_args_info);
-
-  if ( error )
-    return (EXIT_FAILURE);
-
-  return 0;
-
-failure:
-  
-  cmdline_parser_release (&local_args_info);
-  return (EXIT_FAILURE);
-}
+/*
+  File autogenerated by gengetopt version 2.22
+  generated with the following command:
+  /r01/tergeo/chuttenh/sleipnir/trunk/../extlib/gengetopt-2.22/bin/gengetopt -iSVDer.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:
+  we make no copyright claims on it.
+*/
+
+/* If we use autoconf.  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "getopt.h"
+
+#include "cmdline.h"
+
+const char *gengetopt_args_info_purpose = "Transforms PCL data through Support Vector Decomposition";
+
+const char *gengetopt_args_info_usage = "Usage: SVDer [OPTIONS]... [FILES]...";
+
+const char *gengetopt_args_info_description = "";
+
+const char *gengetopt_args_info_help[] = {
+  "  -h, --help                 Print help and exit",
+  "  -V, --version              Print version and exit",
+  "\nMain:",
+  "  -i, --input=filename       Input PCL file",
+  "  -o, --output=filename      Output PCL file",
+  "  -u, --umatrix=filename     Output U matrix PCL file",
+  "\nSVD:",
+  "  -r, --reprojection=DOUBLE  Fraction of variance to reproject  (default=`1')",
+  "  -t, --transform=DOUBLE     Transformation function parameter  (default=`1')",
+  "  -b, --signal_balance       Equally weight all SVs  (default=off)",
+  "\nOptional:",
+  "  -s, --skip=INT             Columns to skip in input PCL  (default=`2')",
+  "  -v, --verbosity=INT        Message verbosity  (default=`5')",
+    0
+};
+
+typedef enum {ARG_NO
+  , ARG_FLAG
+  , ARG_STRING
+  , ARG_INT
+  , ARG_DOUBLE
+} cmdline_parser_arg_type;
+
+static
+void clear_given (struct gengetopt_args_info *args_info);
+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,
+                        struct cmdline_parser_params *params, const char *additional_error);
+
+
+static char *
+gengetopt_strdup (const char *s);
+
+static
+void clear_given (struct gengetopt_args_info *args_info)
+{
+  args_info->help_given = 0 ;
+  args_info->version_given = 0 ;
+  args_info->input_given = 0 ;
+  args_info->output_given = 0 ;
+  args_info->umatrix_given = 0 ;
+  args_info->reprojection_given = 0 ;
+  args_info->transform_given = 0 ;
+  args_info->signal_balance_given = 0 ;
+  args_info->skip_given = 0 ;
+  args_info->verbosity_given = 0 ;
+}
+
+static
+void clear_args (struct gengetopt_args_info *args_info)
+{
+  args_info->input_arg = NULL;
+  args_info->input_orig = NULL;
+  args_info->output_arg = NULL;
+  args_info->output_orig = NULL;
+  args_info->umatrix_arg = NULL;
+  args_info->umatrix_orig = NULL;
+  args_info->reprojection_arg = 1;
+  args_info->reprojection_orig = NULL;
+  args_info->transform_arg = 1;
+  args_info->transform_orig = NULL;
+  args_info->signal_balance_flag = 0;
+  args_info->skip_arg = 2;
+  args_info->skip_orig = NULL;
+  args_info->verbosity_arg = 5;
+  args_info->verbosity_orig = NULL;
+  
+}
+
+static
+void init_args_info(struct gengetopt_args_info *args_info)
+{
+
+
+  args_info->help_help = gengetopt_args_info_help[0] ;
+  args_info->version_help = gengetopt_args_info_help[1] ;
+  args_info->input_help = gengetopt_args_info_help[3] ;
+  args_info->output_help = gengetopt_args_info_help[4] ;
+  args_info->umatrix_help = gengetopt_args_info_help[5] ;
+  args_info->reprojection_help = gengetopt_args_info_help[7] ;
+  args_info->transform_help = gengetopt_args_info_help[8] ;
+  args_info->signal_balance_help = gengetopt_args_info_help[9] ;
+  args_info->skip_help = gengetopt_args_info_help[11] ;
+  args_info->verbosity_help = gengetopt_args_info_help[12] ;
+  
+}
+
+void
+cmdline_parser_print_version (void)
+{
+  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
+}
+
+static void print_help_common(void) {
+  cmdline_parser_print_version ();
+
+  if (strlen(gengetopt_args_info_purpose) > 0)
+    printf("\n%s\n", gengetopt_args_info_purpose);
+
+  if (strlen(gengetopt_args_info_usage) > 0)
+    printf("\n%s\n", gengetopt_args_info_usage);
+
+  printf("\n");
+
+  if (strlen(gengetopt_args_info_description) > 0)
+    printf("%s\n", gengetopt_args_info_description);
+}
+
+void
+cmdline_parser_print_help (void)
+{
+  int i = 0;
+  print_help_common();
+  while (gengetopt_args_info_help[i])
+    printf("%s\n", gengetopt_args_info_help[i++]);
+}
+
+void
+cmdline_parser_init (struct gengetopt_args_info *args_info)
+{
+  clear_given (args_info);
+  clear_args (args_info);
+  init_args_info (args_info);
+
+  args_info->inputs = NULL;
+  args_info->inputs_num = 0;
+}
+
+void
+cmdline_parser_params_init(struct cmdline_parser_params *params)
+{
+  if (params)
+    { 
+      params->override = 0;
+      params->initialize = 1;
+      params->check_required = 1;
+      params->check_ambiguity = 0;
+      params->print_errors = 1;
+    }
+}
+
+struct cmdline_parser_params *
+cmdline_parser_params_create(void)
+{
+  struct cmdline_parser_params *params = 
+    (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params));
+  cmdline_parser_params_init(params);  
+  return params;
+}
+
+static void
+free_string_field (char **s)
+{
+  if (*s)
+    {
+      free (*s);
+      *s = 0;
+    }
+}
+
+
+static void
+cmdline_parser_release (struct gengetopt_args_info *args_info)
+{
+  unsigned int i;
+  free_string_field (&(args_info->input_arg));
+  free_string_field (&(args_info->input_orig));
+  free_string_field (&(args_info->output_arg));
+  free_string_field (&(args_info->output_orig));
+  free_string_field (&(args_info->umatrix_arg));
+  free_string_field (&(args_info->umatrix_orig));
+  free_string_field (&(args_info->reprojection_orig));
+  free_string_field (&(args_info->transform_orig));
+  free_string_field (&(args_info->skip_orig));
+  free_string_field (&(args_info->verbosity_orig));
+  
+  
+  for (i = 0; i < args_info->inputs_num; ++i)
+    free (args_info->inputs [i]);
+
+  if (args_info->inputs_num)
+    free (args_info->inputs);
+
+  clear_given (args_info);
+}
+
+
+static void
+write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
+{
+  if (arg) {
+    fprintf(outfile, "%s=\"%s\"\n", opt, arg);
+  } else {
+    fprintf(outfile, "%s\n", opt);
+  }
+}
+
+
+int
+cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
+{
+  int i = 0;
+
+  if (!outfile)
+    {
+      fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE);
+      return EXIT_FAILURE;
+    }
+
+  if (args_info->help_given)
+    write_into_file(outfile, "help", 0, 0 );
+  if (args_info->version_given)
+    write_into_file(outfile, "version", 0, 0 );
+  if (args_info->input_given)
+    write_into_file(outfile, "input", args_info->input_orig, 0);
+  if (args_info->output_given)
+    write_into_file(outfile, "output", args_info->output_orig, 0);
+  if (args_info->umatrix_given)
+    write_into_file(outfile, "umatrix", args_info->umatrix_orig, 0);
+  if (args_info->reprojection_given)
+    write_into_file(outfile, "reprojection", args_info->reprojection_orig, 0);
+  if (args_info->transform_given)
+    write_into_file(outfile, "transform", args_info->transform_orig, 0);
+  if (args_info->signal_balance_given)
+    write_into_file(outfile, "signal_balance", 0, 0 );
+  if (args_info->skip_given)
+    write_into_file(outfile, "skip", args_info->skip_orig, 0);
+  if (args_info->verbosity_given)
+    write_into_file(outfile, "verbosity", args_info->verbosity_orig, 0);
+  
+
+  i = EXIT_SUCCESS;
+  return i;
+}
+
+int
+cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
+{
+  FILE *outfile;
+  int i = 0;
+
+  outfile = fopen(filename, "w");
+
+  if (!outfile)
+    {
+      fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
+      return EXIT_FAILURE;
+    }
+
+  i = cmdline_parser_dump(outfile, args_info);
+  fclose (outfile);
+
+  return i;
+}
+
+void
+cmdline_parser_free (struct gengetopt_args_info *args_info)
+{
+  cmdline_parser_release (args_info);
+}
+
+/** @brief replacement of strdup, which is not standard */
+char *
+gengetopt_strdup (const char *s)
+{
+  char *result = NULL;
+  if (!s)
+    return result;
+
+  result = (char*)malloc(strlen(s) + 1);
+  if (result == (char*)0)
+    return (char*)0;
+  strcpy(result, s);
+  return result;
+}
+
+int
+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 * const *argv, struct gengetopt_args_info *args_info,
+                   struct cmdline_parser_params *params)
+{
+  int result;
+  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
+
+  return result;
+}
+
+int
+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.override = override;
+  params.initialize = initialize;
+  params.check_required = check_required;
+  params.check_ambiguity = 0;
+  params.print_errors = 1;
+
+  result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
+
+  return result;
+}
+
+int
+cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
+{
+  return EXIT_SUCCESS;
+}
+
+
+static char *package_name = 0;