Timothy L. Bailey,
diff -r caa80f3ff934 -r 017b59926721 doc/fasta-get-markov.xml
--- a/doc/fasta-get-markov.xml Fri Oct 05 00:26:25 2012 -0700
+++ b/doc/fasta-get-markov.xml Thu Oct 25 11:57:42 2012 -0700
@@ -10,7 +10,7 @@
fasta-get-markov
-
Usage: fasta-get-markov <q> [options]
+
Usage: fasta-get-markov [options]
Description:
fasta-get-markov
diff -r caa80f3ff934 -r 017b59926721 doc/iupac2meme.html
--- a/doc/iupac2meme.html Fri Oct 05 00:26:25 2012 -0700
+++ b/doc/iupac2meme.html Thu Oct 25 11:57:42 2012 -0700
@@ -44,7 +44,9 @@
-bg <background file>file with background frequencies of letters; default: uniform background
-pseudo <total pseudocounts>add <total pseudocounts> times letter background to each frequency; default: 0
-logoddsoutput the log-odds (PSSM) and frequency (PSPM) motifs; default: PSPM motif only
-
-url <website>website for the motif; The motif name is substituted for MOTIF_NAME; default: no url
+
-url <website>website for the motif; a line with the tag
+ 'URL' followed by the provided website URL is added to the end of the output;
+ default: no URL line
Output:
diff -r caa80f3ff934 -r 017b59926721 doc/meme-install.html
--- a/doc/meme-install.html Fri Oct 05 00:26:25 2012 -0700
+++ b/doc/meme-install.html Thu Oct 25 11:57:42 2012 -0700
@@ -64,10 +64,13 @@
printed by the configure command.
$ tar zxf meme_VERSION.tar.gz
$ cd meme_VERSION
-
$ ./configure --prefix=$home/meme --with-url=http://meme.nbcr.net/meme
+
$ ./configure --prefix=$HOME/meme --with-url=http://meme.nbcr.net/meme
+
$ make
+
$ make test
+
$ make install
Edit your shell configuration file to add
-
$home/meme/bin
+
$HOME/meme/bin
to your shell's path.
@@ -83,7 +86,7 @@
This will overwrite any previously existing
- $home/meme directory
+ $HOME/meme directory
you may have. You can set the directory to something different in
the configure command using the
--prefix option.
diff -r caa80f3ff934 -r 017b59926721 etc/centrimo_graph.js
--- a/etc/centrimo_graph.js Fri Oct 05 00:26:25 2012 -0700
+++ b/etc/centrimo_graph.js Thu Oct 25 11:57:42 2012 -0700
@@ -498,7 +498,7 @@
length = this.end - this.start;
tick_max = length / 2;
nticks = 5;
- tick_inc = Math.round(tick_max / (10*nticks)) * 10;
+ tick_inc = Math.max(1, Math.round(tick_max / (10*nticks))) * 10;
scale_x = w / length;
ctx.beginPath();
ctx.moveTo(0.5, -5);
diff -r d1cae7820408 -r 3b69fb53ef3e src/binomial.c
--- a/src/binomial.c Mon Oct 29 12:30:07 2012 -0700
+++ b/src/binomial.c Tue Nov 06 14:53:23 2012 +1000
@@ -80,7 +80,11 @@
h *= del;
if (fabs(del - 1.0) < EPS) break; // Are we done?
}
- if (m > MAXIT) fprintf(stderr, "a or b too big, or MAXIT too small in betacf");
+ if (m > MAXIT) {
+ fprintf(stderr, "a (%g) or b (%g) too big, or MAXIT (%d) too small in"
+ " betacf. Input x is %g. Returning %g.\n",
+ a, b, MAXIT, x, h);
+ }
return h;
}
diff -r d1cae7820408 -r 3b69fb53ef3e src/glam2_glam2.c
--- a/src/glam2_glam2.c Mon Oct 29 12:30:07 2012 -0700
+++ b/src/glam2_glam2.c Tue Nov 06 14:53:23 2012 +1000
@@ -1,13 +1,14 @@
/* GLAM2 */
#include
#include /* DBL_MIN, DBL_EPSILON */
+#include /* WEXITSTATUS and associated macros */
#include "glam2_util.h"
#include "glam2_glam2.h"
#include "glam2_init.h"
#include "glam2_output.h"
#include "glam2_site_sample.h"
#include "glam2_column_sample.h"
-#include "dir.h" // MEME specific distribution
+#include "utils.h"
VERBOSE_T verbosity; // needed by meme utilities
@@ -144,6 +145,27 @@
return x < y ? +1 : x > y ? -1 : 0;
}
+inline void report_external_failure(const char *prog, int status) {
+ if (status == 0) {
+ // success
+ } if (status == -1) {
+ fprintf(stderr, "Program %s was not run due to a system error\n", prog);
+ } else if (WIFEXITED(status)) {
+ if (WEXITSTATUS(status) == 127) {
+ // shell error, maybe the program couldn't be found?
+ // the shell already prints out a message when this happens
+ } else {
+ fprintf(stderr, "Program %s exited with value %d\n", prog, WEXITSTATUS(status));
+ }
+ } else if (WIFSIGNALED(status)) {
+ fprintf(stderr, "Program %s died from signal %d, %s coredump\n", prog,
+ WTERMSIG(status), (WCOREDUMP(status) ? "with" : "without"));
+ } else {
+ fprintf(stderr, "Unknown error running %s, system returned status %d\n",
+ prog, status);
+ }
+}
+
int main(int argc, char **argv) {
data d;
glam2_aln *alns;
@@ -186,21 +208,29 @@
xfclose(d.out); // close text output file
// Create the HTML output and MEME format output
- // This depends on variable "MEME_DIR" containing the
- // path to the installation directory.
- int command_length = strlen(MEME_DIR) + strlen(d.txt_filename) +
- strlen(d.html_filename) + 50;
- char *command = xmalloc(command_length);
- sprintf(command, "%s/bin/glam2html < %s > %s",
- MEME_DIR, d.txt_filename, d.html_filename);
- if (!system(command)) {
+ char *glam2html, *glam2psfm, *command;
+ int command_length, command_ret;
+ // create the paths to the programs
+ glam2html = make_path_to_file(get_meme_bin_dir(), "glam2html");
+ glam2psfm = make_path_to_file(get_meme_bin_dir(), "glam2psfm");
+ // allocate memory for the command
+ command_length = strlen(glam2html) + strlen(d.txt_filename) + strlen(d.html_filename) + 50;
+ command = xmalloc(command_length);
+ // run glam2html
+ sprintf(command, "%s < %s > %s", glam2html, d.txt_filename, d.html_filename);
+ if ((command_ret = system(command)) != 0) {
+ report_external_failure("glam2html", command_ret);
fprintf(stderr, "Warning: failed to convert output to HTML!\n");
}
- sprintf(command, "%s/bin/glam2psfm < %s > %s",
- MEME_DIR, d.txt_filename, d.psfm_filename);
- if (system(command) != 0) {
+ // run glam2psfm
+ sprintf(command, "%s < %s > %s", glam2psfm, d.txt_filename, d.psfm_filename);
+ if ((command_ret = system(command)) != 0) {
+ report_external_failure("glam2psfm", command_ret);
fprintf(stderr, "Warning: failed to convert output to MEME format motif!\n");
}
+ free(command);
+ free(glam2psfm);
+ free(glam2html);
return 0;
}
diff -r d1cae7820408 -r 3b69fb53ef3e src/init.c
--- a/src/init.c Mon Oct 29 12:30:07 2012 -0700
+++ b/src/init.c Tue Nov 06 14:53:23 2012 +1000
@@ -20,9 +20,10 @@
#include "meme.h"
#include "general.h"
#include "banner.h"
-#include "dir.h"
+#include
#include
#include
+#include "utils.h"
#include "io.h"
#include "psp.h"
@@ -51,7 +52,6 @@
static char *default_output_dirname = "meme_out"; /* default name of output
directory */
static BOOLEAN clobber = FALSE; /* default is not to overwrite existing files */
-static char *plib_name = NULL; /* use default library */
static char *mod = "zoops"; /* model type input string; default ZOOPS */
static char *alph = "PROTEIN"; /* default alphabet IUPAC protein 1-letter */
static BOOLEAN revcomp = FALSE; /* don't use reverse complement strand of DNA */
@@ -105,7 +105,6 @@
static int maxsize= 100000; /* dataset size limit */
static int seed = 0; /* random number seed */
static double seqfrac = 1; /* fraction of input dataset sequences to use */
-static char *meme_directory = NULL; /* meme source directory */
static double max_time = 0; /* maximum allowed CPU time; ignore if 0 */
/*
@@ -156,6 +155,7 @@
DATASET *dataset=NULL, *neg_dataset=NULL;
double evt = BIG; /* no E-value cutoff */
BOOLEAN no_print = FALSE; /* turn off printing if parallel and not main */
+ char *plib_name = NULL; /* use default library */
#ifdef PARALLEL
/* turn off printing if parallel and not the main processor */
@@ -242,7 +242,7 @@
prior = _OPTION_);
DATA_OPTN(1, b, , \t\tstrength of the prior, beta = atof(_OPTION_));
DATA_OPTN(1, plib, , \t\tname of Dirichlet prior file,
- plib_name = _OPTION_);
+ plib_name = strdup(_OPTION_));
DATA_OPTN(1, spfuzz, , \tfuzziness of sequence to theta mapping,
map_scale = atof(_OPTION_));
DATA_OPTN(1, spmap, uni|pam, \tstarting point seq to theta mapping type,
@@ -342,11 +342,6 @@
exit(1);
}
- /* get the name of the directory where MEME is installed */
- if (!meme_directory) { /* not given on command line */
- meme_directory = MEME_DIR;
- }
-
/* get the objective function type */
if (!strcmp(obj, "pv")) {
objfun = Pv;
@@ -488,16 +483,11 @@
if (ptype == Dmix || ptype == Mega || ptype == MegaP) {
/* make the name of the prior library */
if (!plib_name) {
- char *tmp1, *tmp2;
- if (!strcmp(alphabet, PROTEIN0)) {
- plib_name = PROTEIN_PLIB; /* default mixture prior for proteins */
- } else {
- plib_name = DNA_PLIB; /* default mixture prior for DNA */
+ if (!strcmp(alphabet, PROTEIN0)) {/* default mixture prior for proteins */
+ plib_name = make_path_to_file(get_meme_etc_dir(), PROTEIN_PLIB);
+ } else {/* default mixture prior for DNA */
+ plib_name = make_path_to_file(get_meme_etc_dir(), DNA_PLIB);
}
- /* prepend meme_directory to file name */
- Strcat(tmp1, meme_directory, "/etc/");
- Strcat(tmp2, tmp1, plib_name);
- plib_name = tmp2;
}
}
if ((ptype == Mega || ptype == MegaP) && beta == -1) {
@@ -869,9 +859,9 @@
dataset->seqfrac = seqfrac;
/* save name of prior library */
if (plib_name) {
- dataset->plib_name = plib_name + strlen(plib_name);
- while (*dataset->plib_name != '/') dataset->plib_name--;
- dataset->plib_name++; /* strip off directory */
+ char *tmp, *base; // remove the directory, leaving just the file name
+ for (tmp = base = plib_name; *tmp; tmp++) if (*tmp == '/') base = tmp + 1;
+ dataset->plib_name = strdup(base); // copy the name
} else {
dataset->plib_name = NULL;
}
@@ -912,6 +902,9 @@
banner("MEME", *text_output);
fprintf(*text_output, "\n\n");
+ /* cleanup */
+ free(plib_name);
+
} /* init_meme */
/***************************************************************************/
diff -r d1cae7820408 -r 3b69fb53ef3e src/utils.c
--- a/src/utils.c Mon Oct 29 12:30:07 2012 -0700
+++ b/src/utils.c Tue Nov 06 14:53:23 2012 +1000
@@ -650,7 +650,7 @@
}
regfree(&re_evalue);
regfree(&re_inf);
- if (myerrno) errno = myerrno;
+ errno = myerrno;
return log_ev;
}
diff -r d1cae7820408 -r 3b69fb53ef3e website/html/fimo-intro.html
--- a/website/html/fimo-intro.html Mon Oct 29 12:30:07 2012 -0700
+++ b/website/html/fimo-intro.html Tue Nov 06 14:53:23 2012 +1000
@@ -111,7 +111,7 @@
(example)
GFF
(example)
-
Plain text (example)
+
Plain text (example)