staden-2.0.0b11-2016-src/0000755000031500020650000000000012705661433013160 5ustar jkbteam117staden-2.0.0b11-2016-src/configure0000755000031500020650000122461312707372071015077 0ustar jkbteam117#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for staden 2.0.0b11-2016. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='staden' PACKAGE_TARNAME='staden' PACKAGE_VERSION='2.0.0b11-2016' PACKAGE_STRING='staden 2.0.0b11-2016' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS ITK_ROOT ITK_PATH ITCL_ROOT ITCL_PATH IWIDGETS_ROOT IWIDGETS_PATH TKLIB_PATH DL_LIBS CC_SEARCH_FLAGS TK_INCLUDE_SPEC TCL_INCLUDE_SPEC SHLIB_SUFFIX SHLIB_LDXX TK_XLIB_DIR_NATIVE TK_TOP_DIR_NATIVE TK_INCLUDES TCL_TOP_DIR_NATIVE TCL_INCLUDES TCLSH_PROG LD_LIBRARY_PATH_VAR SHLIB_CFLAGS SHLIB_LD_LIBS SHLIB_LD STLIB_LD CFLAGS_WARNING CFLAGS_OPTIMIZE CFLAGS_DEBUG RC CELIB_DIR AR RANLIB TK_XINCLUDES TK_LIBS TK_STUB_LIB_SPEC TK_STUB_LIB_FLAG TK_STUB_LIB_FILE TK_LIB_SPEC TK_LIB_FLAG TK_LIB_FILE TK_SRC_DIR TK_BIN_DIR TK_VERSION TCL_SHLIB_LD_LIBS TCL_LD_FLAGS TCL_EXTRA_CFLAGS TCL_DEFS TCL_LIBS CLEANFILES TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_LIB_FLAG TCL_LIB_FILE TCL_SRC_DIR TCL_BIN_DIR TCL_PATCH_LEVEL TCL_VERSION PKG_CFLAGS PKG_LIBS PKG_INCLUDES PKG_HEADERS PKG_TCL_SOURCES PKG_STUB_OBJECTS PKG_STUB_SOURCES PKG_STUB_LIB_FILE PKG_LIB_FILE CYGPATH SVNVERSION PWD HAVE_INLINE X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF HAVE_LIBCURSES_HEADER_FALSE HAVE_LIBCURSES_HEADER_TRUE HAVE_LIBCURSES_FALSE HAVE_LIBCURSES_TRUE CURSES_CFLAGS CURSES_LDFLAGS IO_LIB_LDFLAGS IO_LIB_CFLAGS IO_LIB_VERSION _io_lib_config HAVE_PNG_FALSE HAVE_PNG_TRUE PNG_CFLAGS PNG_LDFLAGS PNG_VERSION HAVE_LIBLZMA_FALSE HAVE_LIBLZMA_TRUE LZMA_CFLAGS LZMA_LDFLAGS LZMA_VERSION HAVE_ZLIB_FALSE HAVE_ZLIB_TRUE ZLIB_CFLAGS ZLIB_LDFLAGS ZLIB_VERSION EGREP GREP CPP LIBCURL LIBCURL_CPPFLAGS _libcurl_config AWK ac_ct_CXX CXXFLAGS CXX OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_libcurl with_zlib with_lzma with_png with_io_lib with_curses enable_largefile with_x with_tcl with_tk enable_64bit enable_64bit_vis enable_rpath enable_wince with_celib with_tclinclude with_tkinclude with_tklib with_iwidgets with_itcl with_itk ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures staden 2.0.0b11-2016 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/staden] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of staden 2.0.0b11-2016:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files --enable-64bit enable 64bit support (default: off) --enable-64bit-vis enable 64bit Sparc VIS support (default: off) --disable-rpath disable rpath support (default: on) --enable-wince enable Win/CE support (where applicable) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-libcurl=DIR look for the curl library in DIR --with-zlib=DIR look for zlib in DIR --with-lzma=DIR look for liblzma in DIR --with-png Look for png inc/lib in DIR --with-io_lib=DIR Look for io_lib root in DIR --with-curses=DIR look for libcurses in DIR --with-x use the X Window System --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) --with-celib=DIR use Windows/CE support library from DIR --with-tclinclude directory containing the public Tcl header files --with-tkinclude directory containing the public Tk header files --with-tklib=DIR look for tklib in DIR --with-iwidgets=DIR look for iwidgets in DIR --with-itcl=DIR look for itcl in DIR --with-itk=DIR look for itk in DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF staden configure 2.0.0b11-2016 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by staden $as_me 2.0.0b11-2016, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Check that we're running in a subdirectory. If not create one and rerun. # This ensures that the root directory does not get polluted with the # binary output files and also protects the root Makefile (not derived from # Makefile.in). ac_config_headers="$ac_config_headers staden_config.h" #----------------------------------------------------------------------------- # Checks for compiler programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #--- #Disabled for now, see fortran comments global.mk too. # AC_PROG_F77 # # If we're using gfortran we also need to add -lgfortran to our link line # # for programs that link against a shared-library built using (entirely or # # in part) gfortran. # case "$F77" in # gfortran*) # LIBS="$LIBS -lgfortran" # ;; # esac #----------------------------------------------------------------------------- # Check for library dependencies # Check whether --with-libcurl was given. if test "${with_libcurl+set}" = set; then : withval=$with_libcurl; _libcurl_with=$withval else _libcurl_with=yes fi if test "$_libcurl_with" != "no" ; then for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[1]+256*A[2]+A[3]; print X;}'" _libcurl_try_link=yes if test -d "$_libcurl_with" ; then LIBCURL_CPPFLAGS="-I$withval/include" _libcurl_ldflags="-L$withval/lib" # Extract the first word of ""$withval/bin/curl-config"", so it can be a program name with args. set dummy "$withval/bin/curl-config"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path__libcurl_config+:} false; then : $as_echo_n "(cached) " >&6 else case $_libcurl_config in [\\/]* | ?:[\\/]*) ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi _libcurl_config=$ac_cv_path__libcurl_config if test -n "$_libcurl_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5 $as_echo "$_libcurl_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path__libcurl_config+:} false; then : $as_echo_n "(cached) " >&6 else case $_libcurl_config in [\\/]* | ?:[\\/]*) ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi _libcurl_config=$ac_cv_path__libcurl_config if test -n "$_libcurl_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5 $as_echo "$_libcurl_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test x$_libcurl_config != "x" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the version of libcurl" >&5 $as_echo_n "checking for the version of libcurl... " >&6; } if ${libcurl_cv_lib_curl_version+:} false; then : $as_echo_n "(cached) " >&6 else libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_version" >&5 $as_echo "$libcurl_cv_lib_curl_version" >&6; } _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse` _libcurl_wanted=`echo 0 | $_libcurl_version_parse` if test $_libcurl_wanted -gt 0 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl >= version " >&5 $as_echo_n "checking for libcurl >= version ... " >&6; } if ${libcurl_cv_lib_version_ok+:} false; then : $as_echo_n "(cached) " >&6 else if test $_libcurl_version -ge $_libcurl_wanted ; then libcurl_cv_lib_version_ok=yes else libcurl_cv_lib_version_ok=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_version_ok" >&5 $as_echo "$libcurl_cv_lib_version_ok" >&6; } fi if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then if test x"$LIBCURL_CPPFLAGS" = "x" ; then LIBCURL_CPPFLAGS=`$_libcurl_config --cflags` fi if test x"$LIBCURL" = "x" ; then # libcurl-config --libs gives a ridiculous number of libraries # check to see if we can actually link just using -lcurl LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcurl just needs -lcurl" >&5 $as_echo_n "checking whether libcurl just needs -lcurl... " >&6; } if ${libcurl_cv_lib_curl_only_needs_minus_l_curl+:} false; then : $as_echo_n "(cached) " >&6 else _libcurl_save_cppflags=$CPPFLAGS CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS" _libcurl_save_libs=$LIBS LIBS="$LIBCURL $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { /* Try and use a few common options to force a failure if we are missing symbols or can't link. */ int x; curl_easy_setopt(NULL,CURLOPT_URL,NULL); x=CURL_ERROR_SIZE; x=CURLOPT_WRITEFUNCTION; x=CURLOPT_FILE; x=CURLOPT_ERRORBUFFER; x=CURLOPT_STDERR; x=CURLOPT_VERBOSE; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : libcurl_cv_lib_curl_only_needs_minus_l_curl=yes else libcurl_cv_lib_curl_only_needs_minus_l_curl=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS=$_libcurl_save_cppflags LIBS=$_libcurl_save_libs unset _libcurl_save_cppflags unset _libcurl_save_libs fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_only_needs_minus_l_curl" >&5 $as_echo "$libcurl_cv_lib_curl_only_needs_minus_l_curl" >&6; } if test "x$libcurl_cv_lib_curl_only_needs_minus_l_curl" != xyes ; then LIBCURL=`$_libcurl_config --libs` fi # This is so silly, but Apple actually has a bug in their # curl-config script. Fixed in Tiger, but there are still # lots of Panther installs around. case "${host}" in powerpc-apple-darwin7*) LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'` ;; esac fi # All curl-config scripts support --feature _libcurl_features=`$_libcurl_config --feature` # Is it modern enough to have --protocols? (7.12.4) if test $_libcurl_version -ge 461828 ; then _libcurl_protocols=`$_libcurl_config --protocols` fi else _libcurl_try_link=no fi unset _libcurl_wanted fi if test $_libcurl_try_link = yes ; then # we didn't find curl-config, so let's see if the user-supplied # link line (or failing that, "-lcurl") is enough. LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcurl is usable" >&5 $as_echo_n "checking whether libcurl is usable... " >&6; } if ${libcurl_cv_lib_curl_usable+:} false; then : $as_echo_n "(cached) " >&6 else _libcurl_save_cppflags=$CPPFLAGS CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS" _libcurl_save_libs=$LIBS LIBS="$LIBCURL $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { /* Try and use a few common options to force a failure if we are missing symbols or can't link. */ int x; curl_easy_setopt(NULL,CURLOPT_URL,NULL); x=CURL_ERROR_SIZE; x=CURLOPT_WRITEFUNCTION; x=CURLOPT_FILE; x=CURLOPT_ERRORBUFFER; x=CURLOPT_STDERR; x=CURLOPT_VERBOSE; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : libcurl_cv_lib_curl_usable=yes else libcurl_cv_lib_curl_usable=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS=$_libcurl_save_cppflags LIBS=$_libcurl_save_libs unset _libcurl_save_cppflags unset _libcurl_save_libs fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_usable" >&5 $as_echo "$libcurl_cv_lib_curl_usable" >&6; } if test $libcurl_cv_lib_curl_usable = yes ; then # Does curl_free() exist in this version of libcurl? # If not, fake it with free() _libcurl_save_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS" _libcurl_save_libs=$LIBS LIBS="$LIBS $LIBCURL" ac_fn_c_check_func "$LINENO" "curl_free" "ac_cv_func_curl_free" if test "x$ac_cv_func_curl_free" = xyes; then : else $as_echo "#define curl_free free" >>confdefs.h fi CPPFLAGS=$_libcurl_save_cppflags LIBS=$_libcurl_save_libs unset _libcurl_save_cppflags unset _libcurl_save_libs $as_echo "#define HAVE_LIBCURL 1" >>confdefs.h for _libcurl_feature in $_libcurl_features ; do cat >>confdefs.h <<_ACEOF #define `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1 _ACEOF eval `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes done if test "x$_libcurl_protocols" = "x" ; then # We don't have --protocols, so just assume that all # protocols are available _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT" if test x$libcurl_feature_SSL = xyes ; then _libcurl_protocols="$_libcurl_protocols HTTPS" # FTPS wasn't standards-compliant until version # 7.11.0 if test $_libcurl_version -ge 461568; then _libcurl_protocols="$_libcurl_protocols FTPS" fi fi fi for _libcurl_protocol in $_libcurl_protocols ; do cat >>confdefs.h <<_ACEOF #define `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1 _ACEOF eval `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes done else unset LIBCURL unset LIBCURL_CPPFLAGS fi fi unset _libcurl_try_link unset _libcurl_version_parse #unset _libcurl_config unset _libcurl_feature unset _libcurl_features unset _libcurl_protocol unset _libcurl_protocols unset _libcurl_version unset _libcurl_ldflags fi if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then # This is the IF-NO path have_curl=no else # This is the IF-YES path have_curl=yes fi unset _libcurl_with ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then : withval=$with_zlib; _zlib_with=$withval else _zlib_with="no" fi ZLIB_ROOT="" if test "$_zlib_with" != "no" then if test -f "$_zlib_with/include/zlib.h" then ZLIB_ROOT=$_zlib_with fi fi # Check if it's a working library zlib_ok=no if test "x$ZLIB_ROOT" != "x" then _cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I${ZLIB_ROOT}/include" _ldflags=$LDFLAGS LDFLAGS="$LFDLAGS -L${ZLIB_ROOT}/lib" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 $as_echo_n "checking for inflateEnd in -lz... " >&6; } if ${ac_cv_lib_z_inflateEnd+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inflateEnd (); int main () { return inflateEnd (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_inflateEnd=yes else ac_cv_lib_z_inflateEnd=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 $as_echo "$ac_cv_lib_z_inflateEnd" >&6; } if test "x$ac_cv_lib_z_inflateEnd" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : zlib_ok=yes else zlib_ok=no fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$zlib_ok" != "yes" then # Backout and whinge CPPFLAGS=$_cppflags LDFLAGS=$_ldflags { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"--with-zlib specified" >&5 $as_echo "$as_me: WARNING: \"--with-zlib specified" >&2;} fi else # Maybe it works "out of the box"? { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 $as_echo_n "checking for inflateEnd in -lz... " >&6; } if ${ac_cv_lib_z_inflateEnd+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inflateEnd (); int main () { return inflateEnd (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_inflateEnd=yes else ac_cv_lib_z_inflateEnd=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 $as_echo "$ac_cv_lib_z_inflateEnd" >&6; } if test "x$ac_cv_lib_z_inflateEnd" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : zlib_ok=yes else zlib_ok=no fi fi fi # Check version if test "x" != "x" && test "$zlib_ok" = "yes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if zlib version >= " >&5 $as_echo_n "checking if zlib version >= ... " >&6; } for i in "$ZLIB_ROOT/include" "/usr/include" "/usr/share/include" "/usr/local/include" do if test -f "$i/zlib.h" then ZLIB_VERSION=`sed -n 's/.*#define *ZLIB_VERSION *"\([^"]*\)"/\1/p' "$i/zlib.h"` break fi done v1=`expr "" : '\([0-9]*\)'` v2=`expr "" : '[0-9]*\.\([0-9]*\)'` v3=`expr "" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` want_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` v1=`expr "${ZLIB_VERSION:-}" : '\([0-9]*\)'` v2=`expr "${ZLIB_VERSION:-}" : '[0-9]*\.\([0-9]*\)'` v3=`expr "${ZLIB_VERSION:-}" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` have_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` if test `expr "$have_vers" ">=" "$want_vers"` = "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } zlib_ok="no" fi fi # perform substitutions if test "$zlib_ok" = "yes" then $as_echo "#define HAVE_ZLIB 1" >>confdefs.h if test "$ZLIB_ROOT" != "" then ZLIB_LDFLAGS="-L${ZLIB_ROOT}/lib -lz" ZLIB_CFLAGS="-I${ZLIB_ROOT}/include" else ZLIB_LDFLAGS="-lz" ZLIB_CFLAGS= fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"No functioning zlib found\"" >&5 $as_echo "$as_me: WARNING: \"No functioning zlib found\"" >&2;} fi # Not sure how many of these are needed, but it's belt-and-braces mode if test "$zlib_ok" = "yes"; then HAVE_ZLIB_TRUE= HAVE_ZLIB_FALSE='#' else HAVE_ZLIB_TRUE='#' HAVE_ZLIB_FALSE= fi # Execute the conditional expressions if test "$zlib_ok" = "yes" then # This is the IF-YES path have_zlib=yes else # This is the IF-NO path as_fn_error $? "Abort: no zlib. Please rerun configure using the --with-zlib=DIR option." "$LINENO" 5 fi # Tidy up unset zlib_ok unset _cppflags unset _ldflags # Check whether --with-lzma was given. if test "${with_lzma+set}" = set; then : withval=$with_lzma; _lzma_with=$withval else _lzma_with="no" fi LZMA_ROOT="" if test "$_lzma_with" != "no" then if test -f "$_lzma_with/include/lzma.h" then LZMA_ROOT=$_lzma_with fi fi # Check if it's a working library lzma_ok=no if test "x$LZMA_ROOT" != "x" then _cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I${LZMA_ROOT}/include" _ldflags=$LDFLAGS LDFLAGS="$LFDLAGS -L${LZMA_ROOT}/lib" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_easy_buffer_encode in -llzma" >&5 $as_echo_n "checking for lzma_easy_buffer_encode in -llzma... " >&6; } if ${ac_cv_lib_lzma_lzma_easy_buffer_encode+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzma $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lzma_easy_buffer_encode (); int main () { return lzma_easy_buffer_encode (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lzma_lzma_easy_buffer_encode=yes else ac_cv_lib_lzma_lzma_easy_buffer_encode=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_easy_buffer_encode" >&5 $as_echo "$ac_cv_lib_lzma_lzma_easy_buffer_encode" >&6; } if test "x$ac_cv_lib_lzma_lzma_easy_buffer_encode" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default" if test "x$ac_cv_header_lzma_h" = xyes; then : lzma_ok=yes else lzma_ok=no fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$lzma_ok" != "yes" then # Backout and whinge CPPFLAGS=$_cppflags LDFLAGS=$_ldflags { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"--with-lzma specified" >&5 $as_echo "$as_me: WARNING: \"--with-lzma specified" >&2;} fi else # Maybe it works "out of the box"? { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_easy_buffer_encode in -llzma" >&5 $as_echo_n "checking for lzma_easy_buffer_encode in -llzma... " >&6; } if ${ac_cv_lib_lzma_lzma_easy_buffer_encode+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzma $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lzma_easy_buffer_encode (); int main () { return lzma_easy_buffer_encode (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lzma_lzma_easy_buffer_encode=yes else ac_cv_lib_lzma_lzma_easy_buffer_encode=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_easy_buffer_encode" >&5 $as_echo "$ac_cv_lib_lzma_lzma_easy_buffer_encode" >&6; } if test "x$ac_cv_lib_lzma_lzma_easy_buffer_encode" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default" if test "x$ac_cv_header_lzma_h" = xyes; then : lzma_ok=yes else lzma_ok=no fi fi fi # Check version if test "x" != "x" && test "$lzma_ok" = "yes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if lzma version >= " >&5 $as_echo_n "checking if lzma version >= ... " >&6; } for i in "$LZMA_ROOT/include" "/usr/include" "/usr/share/include" "/usr/local/include" do if test -f "$i/lzma/version.h" then v1=`sed -n 's/.*#define *LZMA_VERSION_MAJOR *\(.*\)/\1/p' "$i/lzma/version.h"` v2=`sed -n 's/.*#define *LZMA_VERSION_MINOR *\(.*\)/\1/p' "$i/lzma/version.h"` v3=`sed -n 's/.*#define *LZMA_VERSION_PATCH *\(.*\)/\1/p' "$i/lzma/version.h"` LZMA_VERSION=$v1.$v2.$v3 break fi done have_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` v1=`expr "" : '\([0-9]*\)'` v2=`expr "" : '[0-9]*\.\([0-9]*\)'` v3=`expr "" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` want_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` if test `expr "$have_vers" ">=" "$want_vers"` = "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } lzma_ok="no" fi fi # perform substitutions if test "$lzma_ok" = "yes" then $as_echo "#define HAVE_LIBLZMA 1" >>confdefs.h if test "$LZMA_ROOT" != "" then LZMA_LDFLAGS="-L${LZMA_ROOT}/lib -llzma" LZMA_CFLAGS="-I${LZMA_ROOT}/include" else LZMA_LDFLAGS="-llzma" LZMA_CFLAGS= fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"No functioning lzma found\"" >&5 $as_echo "$as_me: WARNING: \"No functioning lzma found\"" >&2;} fi # Not sure how many of these are needed, but it's belt-and-braces mode if test "$lzma_ok" = "yes"; then HAVE_LIBLZMA_TRUE= HAVE_LIBLZMA_FALSE='#' else HAVE_LIBLZMA_TRUE='#' HAVE_LIBLZMA_FALSE= fi # Execute the conditional expressions if test "$lzma_ok" = "yes" then # This is the IF-YES path have_lzma=yes else # This is the IF-NO path { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No liblzma detected. Gap5 may be able to read some database. To fix this please install liblzma and rerun configure using the --with-lzma=DIR option." >&5 $as_echo "$as_me: WARNING: No liblzma detected. Gap5 may be able to read some database. To fix this please install liblzma and rerun configure using the --with-lzma=DIR option." >&2;} fi # Tidy up unset lzma_ok unset _cppflags unset _ldflags # Check whether --with-png was given. if test "${with_png+set}" = set; then : withval=$with_png; PNG_ROOT="$withval" else PNG_ROOT="" fi png_ok=no if test "x$PNG_ROOT" != "x" then _cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I${PNG_ROOT}/include" _ldflags=$LDFLAGS LDFLAGS="$LFDLAGS -L${PNG_ROOT}/lib" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_create_write_struct in -lpng" >&5 $as_echo_n "checking for png_create_write_struct in -lpng... " >&6; } if ${ac_cv_lib_png_png_create_write_struct+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char png_create_write_struct (); int main () { return png_create_write_struct (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_png_png_create_write_struct=yes else ac_cv_lib_png_png_create_write_struct=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_create_write_struct" >&5 $as_echo "$ac_cv_lib_png_png_create_write_struct" >&6; } if test "x$ac_cv_lib_png_png_create_write_struct" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" if test "x$ac_cv_header_png_h" = xyes; then : png_ok=yes else png_ok=no fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$png_ok" != "yes" then # Backout and whinge CPPFLAGS=$_cppflags LDFLAGS=$_ldflags { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"--with-png specified" >&5 $as_echo "$as_me: WARNING: \"--with-png specified" >&2;} fi else # Maybe it works "out of the box"? { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_create_write_struct in -lpng" >&5 $as_echo_n "checking for png_create_write_struct in -lpng... " >&6; } if ${ac_cv_lib_png_png_create_write_struct+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char png_create_write_struct (); int main () { return png_create_write_struct (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_png_png_create_write_struct=yes else ac_cv_lib_png_png_create_write_struct=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_create_write_struct" >&5 $as_echo "$ac_cv_lib_png_png_create_write_struct" >&6; } if test "x$ac_cv_lib_png_png_create_write_struct" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" if test "x$ac_cv_header_png_h" = xyes; then : png_ok=yes else png_ok=no fi fi fi # Check version if test "x" != "x" && test "$png_ok" = "yes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if png version >= " >&5 $as_echo_n "checking if png version >= ... " >&6; } for i in "$PNG_ROOT" "/usr/include" "/usr/share/include" "/usr/local/include" do if test -f "$i/png.h" then PNG_VERSION=`sed -n 's/.*#define *PNG_LIBPNG_VER_STRING *"\([^"]*\)"/\1/p' "$i/png.h"` break fi done v1=`expr "" : '\([0-9]*\)'` v2=`expr "" : '[0-9]*\.\([0-9]*\)'` v3=`expr "" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` want_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` v1=`expr "${PNG_VERSION:-}" : '\([0-9]*\)'` v2=`expr "${PNG_VERSION:-}" : '[0-9]*\.\([0-9]*\)'` v3=`expr "${PNG_VERSION:-}" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` have_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` if test `expr "$have_vers" ">=" "$want_vers"` = "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } png_ok="no" fi fi # perform substitutions if test "$png_ok" = "yes" then $as_echo "#define HAVE_PNG 1" >>confdefs.h if test "x$PNG_ROOT" != "x" then PNG_LDFLAGS="-L${PNG_ROOT}/lib -lpng" PNG_CFLAGS="-I${PNG_ROOT}/include" else PNG_LDFLAGS="-lpng" PNG_CFLAGS= fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"No functioning png found\"" >&5 $as_echo "$as_me: WARNING: \"No functioning png found\"" >&2;} fi # Not sure how many of these are needed, but it's belt-and-braces mode if test "$png_ok" = "yes"; then HAVE_PNG_TRUE= HAVE_PNG_FALSE='#' else HAVE_PNG_TRUE='#' HAVE_PNG_FALSE= fi # Execute the conditional expressions if test "$png_ok" = "yes" then # This is the IF-YES path have_png=yes else # This is the IF-NO path have_png=no; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No PNG library found. Gap4's Report Mutatations functionality will be absent." >&5 $as_echo "$as_me: WARNING: No PNG library found. Gap4's Report Mutatations functionality will be absent." >&2;} fi # Tidy up unset png_ok unset _cppflags unset _ldflags # Check whether --with-io_lib was given. if test "${with_io_lib+set}" = set; then : withval=$with_io_lib; _io_lib_with=$withval else _io_lib_with="" fi if test "x$_io_lib_with" = "x" then _iopath=$PATH else _iopath="$_io_lib_with/bin" fi # Extract the first word of "staden-io_lib-config", so it can be a program name with args. set dummy staden-io_lib-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path__io_lib_config+:} false; then : $as_echo_n "(cached) " >&6 else case $_io_lib_config in [\\/]* | ?:[\\/]*) ac_cv_path__io_lib_config="$_io_lib_config" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $_iopath do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path__io_lib_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi _io_lib_config=$ac_cv_path__io_lib_config if test -n "$_io_lib_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_io_lib_config" >&5 $as_echo "$_io_lib_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$_io_lib_config" = "x" then # Extract the first word of "io_lib-config", so it can be a program name with args. set dummy io_lib-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path__io_lib_config+:} false; then : $as_echo_n "(cached) " >&6 else case $_io_lib_config in [\\/]* | ?:[\\/]*) ac_cv_path__io_lib_config="$_io_lib_config" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $_iopath do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path__io_lib_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi _io_lib_config=$ac_cv_path__io_lib_config if test -n "$_io_lib_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_io_lib_config" >&5 $as_echo "$_io_lib_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$_io_lib_config" != "x" then # Check version is sufficient; sneakily entirely in sh syntax if test "x1.12.5" != "x" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if io_lib version >= 1.12.5" >&5 $as_echo_n "checking if io_lib version >= 1.12.5... " >&6; } _io_lib_version=`$_io_lib_config --version` SAVE_IFS=$IFS; IFS=. _val=0 for v in $_io_lib_version; do _val=`expr $_val '*' 1000 + $v`; done _io_lib_version=$_val IFS=$SAVE_IFS _io_lib_wanted=`echo 1.12.5` SAVE_IFS=$IFS; IFS=. _val=0 for v in $_io_lib_wanted; do _val=`expr $_val '*' 1000 + $v`; done _io_lib_wanted=$_val IFS=$SAVE_IFS if test $_io_lib_version -ge $_io_lib_wanted then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } io_lib_version_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } io_lib_version_ok=no fi else io_lib_version_ok=yes; fi # Check the header file also exists, as presence of the io_lib-config # script is not always sufficient to indicate a -dev install. _cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS `$_io_lib_config --cflags`" ac_fn_c_check_header_mongrel "$LINENO" "io_lib/Read.h" "ac_cv_header_io_lib_Read_h" "$ac_includes_default" if test "x$ac_cv_header_io_lib_Read_h" = xyes; then : io_lib_version_ok=yes else io_lib_version_ok=no fi CPPFLAGS=$_cppflags unset _cppflags if test $io_lib_version_ok = "yes" then # Configure IO_LIB_CFLAGS and IO_LIB_LDFLAGS test x"$IO_LIB_CFLAGS" = "x" && IO_LIB_CFLAGS=`$_io_lib_config --cflags` test x"$IO_LIB_LDFLAGS" = "x" && IO_LIB_LDFLAGS=`$_io_lib_config --libs` $as_echo "#define HAVE_IO_LIB 1" >>confdefs.h fi fi # Execute the conditional expressions if test "$io_lib_version_ok" = "yes" then # This is the IF-YES path have_io_lib=yes else # This is the IF-NO path as_fn_error $? "Abort: no compatible io_lib release found. Please rerun configure using the --with-io_lib=DIR option." "$LINENO" 5 fi # Check whether --with-curses was given. if test "${with_curses+set}" = set; then : withval=$with_curses; _curses_with=$withval else _curses_with="no" fi CURSES_ROOT="" if test "$_curses_with" != "no" then if test -f "$_curses_with/include/curses.h" then CURSES_ROOT=$_curses_with fi fi # Check if it's a working library curses_ok=no if test "x$CURSES_ROOT" != "x" then _cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I${CURSES_ROOT}/include" _ldflags=$LDFLAGS LDFLAGS="$LFDLAGS -L${CURSES_ROOT}/lib" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu _nl="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvwprintw in -lncurses" >&5 $as_echo_n "checking for mvwprintw in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_mvwprintw+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mvwprintw (); int main () { return mvwprintw (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses_mvwprintw=yes else ac_cv_lib_ncurses_mvwprintw=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_mvwprintw" >&5 $as_echo "$ac_cv_lib_ncurses_mvwprintw" >&6; } if test "x$ac_cv_lib_ncurses_mvwprintw" = xyes; then : _nl=ncurses; ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_h" = xyes; then : curses_ok=yes; _nh=1 else ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" if test "x$ac_cv_header_curses_h" = xyes; then : curses_ok=yes; _nh=0 else curses_ok=no fi fi else _nl=curses; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvwprintw in -lcurses" >&5 $as_echo_n "checking for mvwprintw in -lcurses... " >&6; } if ${ac_cv_lib_curses_mvwprintw+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mvwprintw (); int main () { return mvwprintw (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_curses_mvwprintw=yes else ac_cv_lib_curses_mvwprintw=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_mvwprintw" >&5 $as_echo "$ac_cv_lib_curses_mvwprintw" >&6; } if test "x$ac_cv_lib_curses_mvwprintw" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" if test "x$ac_cv_header_curses_h" = xyes; then : curses_ok=yes; _nh=0 else curses_ok=no fi fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$curses_ok" != "yes" then # Backout and whinge CPPFLAGS=$_cppflags LDFLAGS=$_ldflags { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"--with-curses specified" >&5 $as_echo "$as_me: WARNING: \"--with-curses specified" >&2;} fi else # Maybe it works "out of the box"? _nl="" _nh="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvwprintw in -lncurses" >&5 $as_echo_n "checking for mvwprintw in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_mvwprintw+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mvwprintw (); int main () { return mvwprintw (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses_mvwprintw=yes else ac_cv_lib_ncurses_mvwprintw=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_mvwprintw" >&5 $as_echo "$ac_cv_lib_ncurses_mvwprintw" >&6; } if test "x$ac_cv_lib_ncurses_mvwprintw" = xyes; then : _nl=ncurses; ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_h" = xyes; then : curses_ok=yes; _nh="" else ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" if test "x$ac_cv_header_curses_h" = xyes; then : curses_ok=yes; _nh="" else curses_ok=no fi fi fi if test "x$_nh" = "x" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvwprintw in -lcurses" >&5 $as_echo_n "checking for mvwprintw in -lcurses... " >&6; } if ${ac_cv_lib_curses_mvwprintw+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mvwprintw (); int main () { return mvwprintw (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_curses_mvwprintw=yes else ac_cv_lib_curses_mvwprintw=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_mvwprintw" >&5 $as_echo "$ac_cv_lib_curses_mvwprintw" >&6; } if test "x$ac_cv_lib_curses_mvwprintw" = xyes; then : _nl=curses; ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" if test "x$ac_cv_header_curses_h" = xyes; then : curses_ok=yes; _nh="" else curses_ok=no fi fi fi if test "x$_nh" = "x" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvwprintw in -lpdcurses" >&5 $as_echo_n "checking for mvwprintw in -lpdcurses... " >&6; } if ${ac_cv_lib_pdcurses_mvwprintw+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpdcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mvwprintw (); int main () { return mvwprintw (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pdcurses_mvwprintw=yes else ac_cv_lib_pdcurses_mvwprintw=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pdcurses_mvwprintw" >&5 $as_echo "$ac_cv_lib_pdcurses_mvwprintw" >&6; } if test "x$ac_cv_lib_pdcurses_mvwprintw" = xyes; then : _nl=pdcurses; ac_fn_c_check_header_mongrel "$LINENO" "pdcurses.h" "ac_cv_header_pdcurses_h" "$ac_includes_default" if test "x$ac_cv_header_pdcurses_h" = xyes; then : curses_ok=yes; _nh="" else ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" if test "x$ac_cv_header_curses_h" = xyes; then : curses_ok=yes; _nh="" else curses_ok=no fi fi fi fi fi # perform substitutions if test "$curses_ok" = "yes" then $as_echo "#define HAVE_LIBCURSES 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define LIBCURSES_HEADER $_nh _ACEOF if test "$CURSES_ROOT" != "" then CURSES_LDFLAGS="-L${CURSES_ROOT}/lib -l$_nl" CURSES_CFLAGS="-I${CURSES_ROOT}/include" else CURSES_LDFLAGS="-l$_nl" CURSES_CFLAGS= fi have_curses=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"No functioning curses found\"" >&5 $as_echo "$as_me: WARNING: \"No functioning curses found\"" >&2;} fi # Not sure how many of these are needed, but it's belt-and-braces mode if test "$curses_ok" = "yes"; then HAVE_LIBCURSES_TRUE= HAVE_LIBCURSES_FALSE='#' else HAVE_LIBCURSES_TRUE='#' HAVE_LIBCURSES_FALSE= fi if test "x$_nh" != "x"; then HAVE_LIBCURSES_HEADER_TRUE= HAVE_LIBCURSES_HEADER_FALSE='#' else HAVE_LIBCURSES_HEADER_TRUE='#' HAVE_LIBCURSES_HEADER_FALSE= fi # Execute the conditional expressions if test "$curses_ok" = "yes" then # This is the IF-YES path : else # This is the IF-NO path : fi # Tidy up unset curses_ok unset _cppflags unset _ldflags unset _nh unset _nl { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi for ac_header in fcntl.h limits.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : fi ac_fn_c_check_header_mongrel "$LINENO" "pwd.h" "ac_cv_header_pwd_h" "$ac_includes_default" if test "x$ac_cv_header_pwd_h" = xyes; then : $as_echo "#define HAVE_PWD_H 1" >>confdefs.h fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } if ${ac_cv_sys_largefile_source+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_largefile_source=no; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_largefile_source=1; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 $as_echo "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF ;; esac rm -rf conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cos" >&5 $as_echo_n "checking for library containing cos... " >&6; } if ${ac_cv_search_cos+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cos (); int main () { return cos (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_cos=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_cos+:} false; then : break fi done if ${ac_cv_search_cos+:} false; then : else ac_cv_search_cos=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cos" >&5 $as_echo "$ac_cv_search_cos" >&6; } ac_res=$ac_cv_search_cos if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi for ac_func in popen do : ac_fn_c_check_func "$LINENO" "popen" "ac_cv_func_popen" if test "x$ac_cv_func_popen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_POPEN 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac if test "$ac_cv_c_inline" != no ; then $as_echo "#define HAVE_INLINE 1" >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void va_test(va_list ap) { va_list ap_local; va_copy(ap_local, ap); va_end(ap_local); } int main(void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_VA_COPY 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu PWD=`pwd` #----------------------------------------------------------------------------- # Svn repository version, for use within program version numbers if svnversion --help >/dev/null 2>&1 then SVNVERSION=svnversion else SVNVERSION=true fi #----------------------------------------------------------------------------- # Tcl TEA usage # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.9" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct TEA configuration" >&5 $as_echo_n "checking for correct TEA configuration... " >&6; } if test x"${PACKAGE_NAME}" = x ; then as_fn_error $? " The PACKAGE_NAME variable must be defined by your TEA configure.in" "$LINENO" 5 fi if test x"3.9" = x ; then as_fn_error $? " TEA version not specified." "$LINENO" 5 elif test "3.9" != "${TEA_VERSION}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&5 $as_echo "warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (TEA ${TEA_VERSION})" >&5 $as_echo "ok (TEA ${TEA_VERSION})" >&6; } fi # If the user did not set CFLAGS, set it now to keep macros # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi case "`uname -s`" in *win32*|*WIN32*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CYGPATH+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -w" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 $as_echo "$CYGPATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *CYGWIN_*) CYGPATH=echo EXEEXT=".exe" # TEA_PLATFORM is determined later in LOAD_TCLCONFIG ;; *) CYGPATH=echo # Maybe we are cross-compiling.... case ${host_alias} in *mingw32*) EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) EXEEXT="" TEA_PLATFORM="unix" ;; esac ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi { $as_echo "$as_me:${as_lineno-$LINENO}: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&5 $as_echo "$as_me: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&6;} # This package name must be replaced statically for AC_SUBST to work # Substitute STUB_LIB_FILE in case package creates a stub library too. # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... # Load the tclConfig.sh and tkConfig.sh # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl was given. if test "${with_tcl+set}" = set; then : withval=$with_tcl; with_tclconfig="${withval}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 $as_echo_n "checking for Tcl configuration... " >&6; } if ${ac_cv_c_tclconfig+:} false; then : $as_echo_n "(cached) " >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case "${with_tclconfig}" in */tclConfig.sh ) if test -f "${with_tclconfig}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 $as_echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`" fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`" else as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5 fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/win; pwd)`" break fi if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/unix; pwd)`" break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`" break fi done fi # TEA specific: on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib/tcl* 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/lib64/tcl* 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/win; pwd)`" break fi if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/unix; pwd)`" break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5 else no_tcl= TCL_BIN_DIR="${ac_cv_c_tclconfig}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; } if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . "${TCL_BIN_DIR}/tclConfig.sh" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TCL_BIN_DIR}/Makefile" ; then TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}" TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}" TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}" elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tcl.framework installed in an arbitrary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then for i in "`cd "${TCL_BIN_DIR}"; pwd`" \ "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}" break fi done fi if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" { $as_echo "$as_me:${as_lineno-$LINENO}: checking platform" >&5 $as_echo_n "checking platform... " >&6; } hold_cc=$CC; CC="$TCL_CC" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifdef _WIN32 #error win32 #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : TEA_PLATFORM="unix" else TEA_PLATFORM="windows" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CC=$hold_cc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEA_PLATFORM" >&5 $as_echo "$TEA_PLATFORM" >&6; } # The BUILD_$pkg is to define the correct extern storage class # handling when making this package cat >>confdefs.h <<_ACEOF #define BUILD_${PACKAGE_NAME} /**/ _ACEOF # Do this here as we have fully defined TEA_PLATFORM now if test "${TEA_PLATFORM}" = "windows" ; then EXEEXT=".exe" CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp" fi # TEA specific: # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true # Check whether --with-tk was given. if test "${with_tk+set}" = set; then : withval=$with_tk; with_tkconfig="${withval}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk configuration" >&5 $as_echo_n "checking for Tk configuration... " >&6; } if ${ac_cv_c_tkconfig+:} false; then : $as_echo_n "(cached) " >&6 else # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case "${with_tkconfig}" in */tkConfig.sh ) if test -f "${with_tkconfig}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5 $as_echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;} with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`" fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`" else as_fn_error $? "${with_tkconfig} directory doesn't contain tkConfig.sh" "$LINENO" 5 fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do if test "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/win; pwd)`" break fi if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/unix; pwd)`" break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`" break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib/tk* 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/lib64/tk* 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i; pwd)`" break fi done fi # TEA specific: on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i; pwd)`" break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do if test "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/win; pwd)`" break fi if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/unix; pwd)`" break fi done fi fi if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" as_fn_error $? "Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh" "$LINENO" 5 else no_tk= TK_BIN_DIR="${ac_cv_c_tkconfig}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5 $as_echo "found ${TK_BIN_DIR}/tkConfig.sh" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 $as_echo_n "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... " >&6; } if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . "${TK_BIN_DIR}/tkConfig.sh" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 $as_echo "could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; } fi # eval is required to do the TK_DBGX substitution eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TK_BIN_DIR}/Makefile" ; then TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}" TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}" TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}" elif test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tk.framework installed in an arbitrary location. case ${TK_DEFS} in *TK_FRAMEWORK*) if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then for i in "`cd "${TK_BIN_DIR}"; pwd`" \ "`cd "${TK_BIN_DIR}"/../..; pwd`"; do if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}" break fi done fi if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TK_DBGX substitution eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" # TEA specific: Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) $as_echo "#define MAC_OSX_TK 1" >>confdefs.h TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi # TEA specific: # Override the TEA_PATH_TCLCONFIG for compilation options. # This allows us to do "./configure ... CC=/some/other/cc" and get SHLIB_LD # variables set correctly for our new compiler. if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Step 0.a: Enable 64 bit support? { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 $as_echo_n "checking if 64bit support is requested... " >&6; } # Check whether --enable-64bit was given. if test "${enable_64bit+set}" = set; then : enableval=$enable_64bit; do64bit=$enableval else do64bit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 $as_echo "$do64bit" >&6; } # Step 0.b: Enable Solaris 64 bit VIS support? { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 $as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; } # Check whether --enable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then : enableval=$enable_64bit_vis; do64bitVIS=$enableval else do64bitVIS=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 $as_echo "$do64bitVIS" >&6; } # Force 64bit on with VIS if test "$do64bitVIS" = "yes"; then : do64bit=yes fi # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 $as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; } if ${tcl_cv_cc_visibility_hidden+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) void f(void); void f(void) {} int main () { f(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_visibility_hidden=yes else tcl_cv_cc_visibility_hidden=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 $as_echo "$tcl_cv_cc_visibility_hidden" >&6; } if test $tcl_cv_cc_visibility_hidden = yes; then : $as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h fi # Step 0.d: Disable -rpath support? { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 $as_echo_n "checking if rpath support is requested... " >&6; } # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; doRpath=$enableval else doRpath=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 $as_echo "$doRpath" >&6; } # TEA specific: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = windows; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Windows/CE build is requested" >&5 $as_echo_n "checking if Windows/CE build is requested... " >&6; } # Check whether --enable-wince was given. if test "${enable_wince+set}" = set; then : enableval=$enable_wince; doWince=$enableval else doWince=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doWince" >&5 $as_echo "$doWince" >&6; } fi # Set the variable "system" to hold the name and version number # for the system. { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5 $as_echo_n "checking system version... " >&6; } if ${tcl_cv_sys_version+:} false; then : $as_echo_n "(cached) " >&6 else # TEA specific: if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 $as_echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 $as_echo "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version # Require ranlib early so we can override it in special cases below. # Set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case and removed some core-only vars. do64bit_ok=no # default to '{$LIBS}' and set to "" on per-platform necessary basis SHLIB_LD_LIBS='${LIBS}' # When ld needs options to work in 64-bit mode, put them in # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" UNSHARED_LIB_SUFFIX="" # TEA specific: use PACKAGE_VERSION instead of VERSION TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall" else CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" if test "x$SHLIB_VERSION" = x; then : SHLIB_VERSION="1.0" fi case $system in # TEA specific: windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 $as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ensure latest Platform SDK is installed" >&5 $as_echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 $as_echo " Using 64-bit $MACHINE mode" >&6; } do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then as_fn_error $? "Windows/CE and 64-bit builds incompatible" "$LINENO" 5 fi if test "$GCC" = "yes" ; then as_fn_error $? "Windows/CE and GCC builds incompatible" "$LINENO" 5 fi # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true # Check whether --with-celib was given. if test "${with_celib+set}" = set; then : withval=$with_celib; with_celibconfig=${withval} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows/CE celib directory" >&5 $as_echo_n "checking for Windows/CE celib directory... " >&6; } if ${ac_cv_c_celibconfig+:} false; then : $as_echo_n "(cached) " >&6 else # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else as_fn_error $? "${with_celibconfig} directory doesn't contain inc directory" "$LINENO" 5 fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi fi if test x"${ac_cv_c_celibconfig}" = x ; then as_fn_error $? "Cannot find celib support library directory" "$LINENO" 5 else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $CELIB_DIR" >&5 $as_echo "found $CELIB_DIR" >&6; } fi fi # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then as_fn_error $? "could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" "$LINENO" 5 doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 vars="bufferoverflowU.lib" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower($0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do cat >>confdefs.h <<_ACEOF #define $i 1 _ACEOF done cat >>confdefs.h <<_ACEOF #define _WIN32_WCE $CEVERSION _ACEOF cat >>confdefs.h <<_ACEOF #define UNDER_CE $CEVERSION _ACEOF CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RC"; then ac_cv_prog_RC="$RC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RC="${ac_tool_prefix}windres" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RC=$ac_cv_prog_RC if test -n "$RC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5 $as_echo "$RC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RC"; then ac_ct_RC=$RC # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RC"; then ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RC="windres" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RC=$ac_cv_prog_ac_ct_RC if test -n "$ac_ct_RC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5 $as_echo "$ac_ct_RC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RC" = x; then RC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RC=$ac_ct_RC fi else RC="$ac_cv_prog_RC" fi CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" SHLIB_LD='${CC} -shared' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cross-compile version of gcc" >&5 $as_echo_n "checking for cross-compile version of gcc... " >&6; } if ${ac_cv_cross+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __WIN32__ #error cross-compiler #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_cross=yes else ac_cv_cross=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cross" >&5 $as_echo "$ac_cv_cross" >&6; } if test "$ac_cv_cross" = "yes"; then case "$do64bit" in amd64|x64|yes) CC="x86_64-w64-mingw32-gcc" LD="x86_64-w64-mingw32-ld" AR="x86_64-w64-mingw32-ar" RANLIB="x86_64-w64-mingw32-ranlib" RC="x86_64-w64-mingw32-windres" ;; *) CC="i686-w64-mingw32-gcc" LD="i686-w64-mingw32-ld" AR="i686-w64-mingw32-ar" RANLIB="i686-w64-mingw32-ranlib" RC="i686-w64-mingw32-windres" ;; esac fi else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # and also # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx # This essentially turns it all on. LDFLAGS_DEBUG="-debug -debugtype:cv" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then : # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r|*_r\ *) # ok ... ;; *) # Make sure only first arg gets _r CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 $as_echo "Using $CC for compiling with threads" >&6; } fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes; then : if test "$GCC" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = ia64; then : # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" if test "$GCC" = yes; then : CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared -Wl,-bexpall' else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry" LDFLAGS="$LDFLAGS -brtl" fi SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -nostart' SHLIB_SUFFIX=".so" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 $as_echo_n "checking for inet_ntoa in -lbind... " >&6; } if ${ac_cv_lib_bind_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bind_inet_ntoa=yes else ac_cv_lib_bind_inet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 $as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; } if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then : LIBS="$LIBS -lbind -lsocket" fi ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".so" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; CYGWIN_*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".dll" EXEEXT=".exe" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; Haiku*) LDFLAGS="$LDFLAGS -Wl,--export-dynamic" SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 $as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; } if ${ac_cv_lib_network_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_network_inet_ntoa=yes else ac_cv_lib_network_inet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 $as_echo "$ac_cv_lib_network_inet_ntoa" >&6; } if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then : LIBS="$LIBS -lnetwork" fi ;; HP-UX-*.11.*) # Use updated header definitions where possible $as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h # TEA specific: Needed by Tcl, but not most extensions #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) #LIBS="$LIBS -lxnet" # Use the XOPEN network library if test "`uname -m`" = ia64; then : SHLIB_SUFFIX=".so" # Use newer C++ library for C++ extensions #if test "$GCC" != "yes" ; then # CPPFLAGS="-AA" #fi else SHLIB_SUFFIX=".sl" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then : LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else CFLAGS="$CFLAGS -z" # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes"; then : if test "$GCC" = yes; then : case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" fi fi ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi if test "$GCC" = yes; then : CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes; then : if test "$GCC" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" # TEA specific: CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' LDFLAGS="$LDFLAGS -Wl,--export-dynamic" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "`uname -m`" = "alpha"; then : CFLAGS="$CFLAGS -mieee" fi if test $do64bit = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 $as_echo_n "checking if compiler accepts -m64 flag... " >&6; } if ${tcl_cv_cc_m64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_m64=yes else tcl_cv_cc_m64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 $as_echo "$tcl_cv_cc_m64" >&6; } if test $tcl_cv_cc_m64 = yes; then : CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi fi # The combo of gcc + glibc has a bug related to inlining of # functions like strtod(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x; then : CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" SHLIB_LD='${CC} -shared' LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" if test "`uname -m`" = "alpha"; then : CFLAGS="$CFLAGS -mieee" fi ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD='${CC} -shared' LD_FLAGS="-Wl,--export-dynamic" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi ;; OpenBSD-*) arch=`arch -s` case "$arch" in m88k|vax) SHLIB_SUFFIX="" SHARED_LIB_SUFFIX="" ;; *) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' ;; esac case "$arch" in m88k|vax) CFLAGS_OPTIMIZE="-O1" ;; *) CFLAGS_OPTIMIZE="-O2" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF" >&5 $as_echo_n "checking for ELF... " >&6; } if ${tcl_cv_ld_elf+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : tcl_cv_ld_elf=yes else tcl_cv_ld_elf=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_elf" >&5 $as_echo "$tcl_cv_ld_elf" >&6; } if test $tcl_cv_ld_elf = yes; then : LDFLAGS=-Wl,-export-dynamic else LDFLAGS="" fi if test "${TCL_THREADS}" = "1"; then : # On OpenBSD: Compile with -pthread # Don't link with -lpthread LIBS=`echo $LIBS | sed s/-lpthread//` CFLAGS="$CFLAGS -pthread" fi # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; NetBSD-*|FreeBSD-[3-4].*) # FreeBSD 3.* and greater have ELF. # NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_SUFFIX=".so" LDFLAGS="$LDFLAGS -export-dynamic" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "${TCL_THREADS}" = "1"; then : # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; FreeBSD-*) # This configuration from FreeBSD Ports. SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CC} -shared" TCL_SHLIB_LD_EXTRAS="-soname \$@" SHLIB_SUFFIX=".so" LDFLAGS="" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi if test "${TCL_THREADS}" = "1"; then : # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" fi # Version numbers are dot-stripped by system policy. TCL_TRIM_DOTS=`echo ${VERSION} | tr -d .` UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1' TCL_LIB_VERSIONS_OK=nodots ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during # preprocessing tests and compiling tests, move any -isysroot and # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" if test $do64bit = yes; then : case `arch` in ppc) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 $as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; } if ${tcl_cv_cc_arch_ppc64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_ppc64=yes else tcl_cv_cc_arch_ppc64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 $as_echo "$tcl_cv_cc_arch_ppc64" >&6; } if test $tcl_cv_cc_arch_ppc64 = yes; then : CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes fi;; i386) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 $as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; } if ${tcl_cv_cc_arch_x86_64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_x86_64=yes else tcl_cv_cc_arch_x86_64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 $as_echo "$tcl_cv_cc_arch_x86_64" >&6; } if test $tcl_cv_cc_arch_x86_64 = yes; then : CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes fi;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 $as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac else # Check for combined 32-bit and 64-bit fat build if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then : fat_32_64=yes fi fi # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5 $as_echo_n "checking if ld accepts -single_module flag... " >&6; } if ${tcl_cv_ld_single_module+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_single_module=yes else tcl_cv_ld_single_module=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5 $as_echo "$tcl_cv_ld_single_module" >&6; } if test $tcl_cv_ld_single_module = yes; then : SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi # TEA specific: link shlib with current and compatibility version flags vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([0-9]\{1,5\}\)\(\(\.[0-9]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d` SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}" SHLIB_SUFFIX=".dylib" # Don't use -prebind when building for Mac OS X 10.4 or later only: if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then : LDFLAGS="$LDFLAGS -prebind" fi LDFLAGS="$LDFLAGS -headerpad_max_install_names" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 $as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; } if ${tcl_cv_ld_search_paths_first+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_search_paths_first=yes else tcl_cv_ld_search_paths_first=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 $as_echo "$tcl_cv_ld_search_paths_first" >&6; } if test $tcl_cv_ld_search_paths_first = yes; then : LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi if test "$tcl_cv_cc_visibility_hidden" != yes; then : $as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h tcl_cv_cc_visibility_hidden=yes fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for combined 32 & 64 bit fat builds of Tk # extensions, verify that 64-bit build is possible. if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then : if test "${TEA_WINDOWINGSYSTEM}" = x11; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5 $as_echo_n "checking for 64-bit X11... " >&6; } if ${tcl_cv_lib_x11_64+:} false; then : $as_echo_n "(cached) " >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_x11_64=yes else tcl_cv_lib_x11_64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5 $as_echo "$tcl_cv_lib_x11_64" >&6; } fi if test "${TEA_WINDOWINGSYSTEM}" = aqua; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit Tk" >&5 $as_echo_n "checking for 64-bit Tk... " >&6; } if ${tcl_cv_lib_tk_64+:} false; then : $as_echo_n "(cached) " >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}" LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { Tk_InitStubs(NULL, "", 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_tk_64=yes else tcl_cv_lib_tk_64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_tk_64" >&5 $as_echo "$tcl_cv_lib_tk_64" >&6; } fi # remove 64-bit arch flags from CFLAGS et al. if configuration # does not support 64-bit. if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5 $as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done fi fi ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy $as_echo "#define _OE_SOCKETS 1" >>confdefs.h ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = 1; then : SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi if test "$GCC" = yes; then : CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = 1; then : CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = yes; then : LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) if test "$GCC" = yes; then : SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-5.[0-6]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. $as_echo "#define _REENTRANT 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. $as_echo "#define _REENTRANT 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes; then : arch=`isainfo` if test "$arch" = "sparcv9 sparc"; then : if test "$GCC" = yes; then : if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" fi else do64bit_ok=yes if test "$do64bitVIS" = yes; then : CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi else if test "$arch" = "amd64 i386"; then : if test "$GCC" = yes; then : case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) do64bit_ok=yes CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; esac else do64bit_ok=yes case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi fi SHLIB_SUFFIX=".so" if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = yes; then : if test "$arch" = "sparcv9 sparc"; then : # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" else if test "$arch" = "amd64 i386"; then : # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" fi fi fi else case $system in SunOS-5.[1-9][0-9]*) # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';; *) SHLIB_LD='/usr/ccs/bin/ld -G -z text';; esac CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; esac if test "$do64bit" = yes -a "$do64bit_ok" = no; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 $as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi # Add in the arch flags late to ensure it wasn't removed. # Not necessary in TEA, but this is aligned with core LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$GCC" = yes; then : case $system in AIX-*) ;; BSD/OS*) ;; CYGWIN_*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Darwin-*) ;; SCO_SV-3.2*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi if test "$tcl_cv_cc_visibility_hidden" != yes; then : $as_echo "#define MODULE_SCOPE extern" >>confdefs.h $as_echo "#define NO_VIZ /**/" >>confdefs.h fi if test "$SHARED_LIB_SUFFIX" = ""; then : # TEA specific: use PACKAGE_VERSION instead of VERSION SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = ""; then : # TEA specific: use PACKAGE_VERSION instead of VERSION UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi if test "${GCC}" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SEH support in compiler" >&5 $as_echo_n "checking for SEH support in compiler... " >&6; } if ${tcl_cv_seh+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : tcl_cv_seh=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main(int argc, char** argv) { int a, b = 0; __try { a = 666 / b; } __except (EXCEPTION_EXECUTE_HANDLER) { return 0; } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : tcl_cv_seh=yes else tcl_cv_seh=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_seh" >&5 $as_echo "$tcl_cv_seh" >&6; } if test "$tcl_cv_seh" = "no" ; then $as_echo "#define HAVE_NO_SEH 1" >>confdefs.h fi # # Check to see if the excpt.h include file provided contains the # definition for EXCEPTION_DISPOSITION; if not, which is the case # with Cygwin's version as of 2002-04-10, define it to be int, # sufficient for getting the current code to work. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXCEPTION_DISPOSITION support in include files" >&5 $as_echo_n "checking for EXCEPTION_DISPOSITION support in include files... " >&6; } if ${tcl_cv_eh_disposition+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define WIN32_LEAN_AND_MEAN # include # undef WIN32_LEAN_AND_MEAN int main () { EXCEPTION_DISPOSITION x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_eh_disposition=yes else tcl_cv_eh_disposition=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_eh_disposition" >&5 $as_echo "$tcl_cv_eh_disposition" >&6; } if test "$tcl_cv_eh_disposition" = "no" ; then $as_echo "#define EXCEPTION_DISPOSITION int" >>confdefs.h fi # Check to see if winnt.h defines CHAR, SHORT, and LONG # even if VOID has already been #defined. The win32api # used by mingw and cygwin is known to do this. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winnt.h that ignores VOID define" >&5 $as_echo_n "checking for winnt.h that ignores VOID define... " >&6; } if ${tcl_cv_winnt_ignore_void+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define VOID void #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main () { CHAR c; SHORT s; LONG l; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_winnt_ignore_void=yes else tcl_cv_winnt_ignore_void=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_winnt_ignore_void" >&5 $as_echo "$tcl_cv_winnt_ignore_void" >&6; } if test "$tcl_cv_winnt_ignore_void" = "yes" ; then $as_echo "#define HAVE_WINNT_IGNORE_VOID 1" >>confdefs.h fi # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 $as_echo_n "checking for cast to union support... " >&6; } if ${tcl_cv_cast_to_union+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { union foo { int i; double d; }; union foo f = (union foo) (int) 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cast_to_union=yes else tcl_cv_cast_to_union=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 $as_echo "$tcl_cv_cast_to_union" >&6; } if test "$tcl_cv_cast_to_union" = "yes"; then $as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi fi # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 $as_echo_n "checking for required early compiler flags... " >&6; } tcl_flags="" if ${tcl_cv_flag__isoc99_source+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=yes else tcl_cv_flag__isoc99_source=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then $as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if test "x${tcl_flags}" = "x" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 $as_echo "${tcl_flags}" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5 $as_echo_n "checking for 64-bit integer type... " >&6; } if ${tcl_cv_type_64bit+:} false; then : $as_echo_n "(cached) " >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { __int64 value = (__int64) 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_type_64bit=__int64 else tcl_type_64bit="long long" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_64bit=${tcl_type_64bit} fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then $as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: using long" >&5 $as_echo "using long" >&6; } elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # TEA specific: We actually want to use the default tcl.h checks in # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Tcl header defaults" >&5 $as_echo "using Tcl header defaults" >&6; } else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5 $as_echo "${tcl_cv_type_64bit}" >&6; } # Now check for auxiliary declarations { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 $as_echo_n "checking for struct dirent64... " >&6; } if ${tcl_cv_struct_dirent64+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct dirent64 p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_dirent64=yes else tcl_cv_struct_dirent64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 $as_echo "$tcl_cv_struct_dirent64" >&6; } if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then $as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 $as_echo_n "checking for struct stat64... " >&6; } if ${tcl_cv_struct_stat64+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct stat64 p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_stat64=yes else tcl_cv_struct_stat64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 $as_echo "$tcl_cv_struct_stat64" >&6; } if test "x${tcl_cv_struct_stat64}" = "xyes" ; then $as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h fi for ac_func in open64 lseek64 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 $as_echo_n "checking for off64_t... " >&6; } if ${tcl_cv_type_off64_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { off64_t offset; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_off64_t=yes else tcl_cv_type_off64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then $as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # Identify tclsh executable { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 $as_echo_n "checking for tclsh... " >&6; } if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${TCLSH_PROG}" >&5 $as_echo "${TCLSH_PROG}" >&6; } TCLSH_PROG=`basename ${TCLSH_PROG}` # Handles --prefix option #TEA_PREFIX # We're naughty - for now need some internals of Tk, in particular canvas # bits and bobs { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5 $as_echo_n "checking for Tcl public headers... " >&6; } # Check whether --with-tclinclude was given. if test "${with_tclinclude+set}" = set; then : withval=$with_tclinclude; with_tclinclude=${withval} fi if ${ac_cv_c_tclh+:} false; then : $as_echo_n "(cached) " >&6 else # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else as_fn_error $? "${with_tclinclude} directory does not contain tcl.h" "$LINENO" 5 fi else list="" if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "${TCL_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then as_fn_error $? "tcl.h not found. Please specify its location with --with-tclinclude" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclh}" >&5 $as_echo "${ac_cv_c_tclh}" >&6; } fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" # Allow for --with-tclinclude to take effect and define ${ac_cv_c_tclh} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl private include files" >&5 $as_echo_n "checking for Tcl private include files... " >&6; } TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" # Check to see if tclPort.h isn't already with the public headers # Don't look for tclInt.h because that resides with tcl.h in the core # sources, but the Port headers are in a different directory if test "${TEA_PLATFORM}" = "windows" -a \ -f "${ac_cv_c_tclh}/tclWinPort.h"; then result="private headers found with public headers" elif test "${TEA_PLATFORM}" = "unix" -a \ -f "${ac_cv_c_tclh}/tclUnixPort.h"; then result="private headers found with public headers" else TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" if test "${TEA_PLATFORM}" = "windows"; then TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" else TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" fi # Overwrite the previous TCL_INCLUDES as this should capture both # public and private headers in the same set. # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -d "${TCL_BIN_DIR}/Headers" -a \ -d "${TCL_BIN_DIR}/PrivateHeaders"; then TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}" else TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`" fi ;; esac result="Using ${TCL_INCLUDES}" else if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then as_fn_error $? "Cannot find private header tclInt.h in ${TCL_SRC_DIR}" "$LINENO" 5 fi result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${result}" >&5 $as_echo "${result}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk public headers" >&5 $as_echo_n "checking for Tk public headers... " >&6; } # Check whether --with-tkinclude was given. if test "${with_tkinclude+set}" = set; then : withval=$with_tkinclude; with_tkinclude=${withval} fi if ${ac_cv_c_tkh+:} false; then : $as_echo_n "(cached) " >&6 else # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else as_fn_error $? "${with_tkinclude} directory does not contain tk.h" "$LINENO" 5 fi else list="" if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers directory. case ${TK_DEFS} in *TK_FRAMEWORK*) list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tk is not installed, # and in that situation, look there before installed locations. if test -f "${TK_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tk's --prefix location, # relative to directory of tkConfig.sh, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TK_INCLUDE_SPEC}" != x ; then d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then as_fn_error $? "tk.h not found. Please specify its location with --with-tkinclude" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tkh}" >&5 $as_echo "${ac_cv_c_tkh}" >&6; } fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then # On Windows and Aqua, we need the X compat headers { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5 $as_echo_n "checking for X11 header files... " >&6; } if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${INCLUDE_DIR_NATIVE}" >&5 $as_echo "${INCLUDE_DIR_NATIVE}" >&6; } fi # Allow for --with-tkinclude to take effect and define ${ac_cv_c_tkh} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk private include files" >&5 $as_echo_n "checking for Tk private include files... " >&6; } TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" # Check to see if tkPort.h isn't already with the public headers # Don't look for tkInt.h because that resides with tk.h in the core # sources, but the Port headers are in a different directory if test "${TEA_PLATFORM}" = "windows" -a \ -f "${ac_cv_c_tkh}/tkWinPort.h"; then result="private headers found with public headers" elif test "${TEA_PLATFORM}" = "unix" -a \ -f "${ac_cv_c_tkh}/tkUnixPort.h"; then result="private headers found with public headers" else TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" if test "${TEA_PLATFORM}" = "windows"; then TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" else TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" fi # Overwrite the previous TK_INCLUDES as this should capture both # public and private headers in the same set. # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" # Detect and add ttk subdir if test -d "${TK_SRC_DIR}/generic/ttk"; then TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" fi if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then TK_INCLUDES="${TK_INCLUDES} -I\"${TK_XLIB_DIR_NATIVE}\"" fi if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/macosx\"" fi if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TK_DEFS} in *TK_FRAMEWORK*) if test -d "${TK_BIN_DIR}/Headers" -a \ -d "${TK_BIN_DIR}/PrivateHeaders"; then TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}" else TK_INCLUDES="${TK_INCLUDES} ${TK_INCLUDE_SPEC} `echo "${TK_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`" fi ;; esac result="Using ${TK_INCLUDES}" else if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then as_fn_error $? "Cannot find private header tkInt.h in ${TK_SRC_DIR}" "$LINENO" 5 fi result="Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${result}" >&5 $as_echo "${result}" >&6; } # For MacOS X we don't current support the Aqua Tk version, only the X11 one if test "`uname -s`" = "Darwin" then case "${TCL_DEFS} ${TK_DEFS}" in *TK_FRAMEWORK* | *TCL_FRAMEWORK*) echo "" as_fn_error $? "Abort: the Tcl/Tk version found is the native Aqua interface, installed as a system framework. Unfortunately for compatibility reasons the Staden Package requires an X11 build of Tk instead. Please install (eg from MacPorts) and specify the location using --with-tcl and --with-tk." "$LINENO" 5 exit ;; esac fi # Guess C++ shared library generation from the C one. SHLIB_LDXX=`echo "$SHLIB_LD" | \ sed 's/{CC}/{CXX}/;s/{CFLAGS}/{CXXFLAGS}/;s/^[a-z]*cc /${CXX} /'` # tklib - extra widgets for Tk # Check whether --with-tklib was given. if test "${with_tklib+set}" = set; then : withval=$with_tklib; _tklib_with=$withval else _tklib_with="no" fi _ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking tklib directory" >&5 $as_echo_n "checking tklib directory... " >&6; } # Look in the place we requested and also in some standard best-guess # locations. for i in "$_tklib_with" /usr/share/tcl*/tklib* /usr/share/tklib* /usr/local/tklib* do if test -d "$i/tablelist" then # Check version if test "x" != "x" then v1=`expr "" : '\([0-9]*\)'` v2=`expr "" : '[0-9]*\.\([0-9]*\)'` v3=`expr "" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` want_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` # Guess version based on filename suffix v1=`expr "$i" : '.*tklib\([0-9]*\)'` v2=`expr "$i" : '.*tklib[0-9]*\.\([0-9]*\)'` v3=`expr "$i" : '.*tklib[0-9]*\.[0-9]*\.\([0-9]*\)'` have_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` if test `expr "$have_vers" ">=" "$want_vers"` = "1" then _ok="yes" else _ok="no" fi else _ok="yes" fi if test "x$_ok" = "xyes" then TKLIB_PATH=$i break fi fi done # Execute the conditional expressions if test "$_ok" = "yes" then # This is the IF-YES path { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($TKLIB_PATH)" >&5 $as_echo "yes ($TKLIB_PATH)" >&6; } have_tklib=yes else # This is the IF-NO path { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Abort: no tklib package found, use --with-tklib=DIR" "$LINENO" 5 fi # Check whether --with-iwidgets was given. if test "${with_iwidgets+set}" = set; then : withval=$with_iwidgets; _iwidgets_with=$withval else _iwidgets_with="no" fi _ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking iwidgets directory" >&5 $as_echo_n "checking iwidgets directory... " >&6; } # Look in the place we requested and also in some standard best-guess # locations. for i in $_iwidgets_with/iwidgets* $_iwidgets_with /usr/share/tcl*/iwidgets* /usr/share/iwidgets* /usr/lib/iwidgets* /usr/lib64/iwidgets* /usr/local/tcl*/iwidgets* do if test -e "$i/pkgIndex.tcl" then # Check version if test "x4" != "x" then v1=`expr "4" : '\([0-9]*\)'` v2=`expr "4" : '[0-9]*\.\([0-9]*\)'` v3=`expr "4" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` want_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` # Get version from pkgIndex.tcl p=`egrep 'package ifneeded Iwidgets' "$i/pkgIndex.tcl"` v1=`expr "$p" : '.*Iwidgets *\([0-9]*\)'` v2=`expr "$p" : '.*Iwidgets *[0-9]*\.\([0-9]*\)'` v3=`expr "$p" : '.*Iwidgets *[0-9]*\.[0-9]*\.\([0-9]*\)'` have_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` if test `expr "$have_vers" ">=" "$want_vers"` = "1" then _ok="yes" else _ok="no" fi else _ok="yes" fi if test "x$_ok" = "xyes" then IWIDGETS_PATH=`echo "$i" | sed 's:/*$::'` IWIDGETS_ROOT=`echo "$i" | sed 's:/[^/]*/*$::'` break fi fi done # Execute the conditional expressions if test "$_ok" = "yes" then # This is the IF-YES path { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($IWIDGETS_PATH)" >&5 $as_echo "yes ($IWIDGETS_PATH)" >&6; } have_iwidgets=yes else # This is the IF-NO path { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Warning: no iwidgets package found. The GUI for the auto-finishing tool will be unavailable. Rerun using --with-iwidgets=DIR if you need to correct this." >&5 $as_echo "$as_me: WARNING: Warning: no iwidgets package found. The GUI for the auto-finishing tool will be unavailable. Rerun using --with-iwidgets=DIR if you need to correct this." >&2;} fi # Check whether --with-itcl was given. if test "${with_itcl+set}" = set; then : withval=$with_itcl; _itcl_with=$withval else _itcl_with="no" fi _ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking itcl directory" >&5 $as_echo_n "checking itcl directory... " >&6; } # Look in the place we requested and also in some standard best-guess # locations. for i in $_itcl_with $_itcl_with/itcl* /usr/share/tcl*/itcl* /usr/local/tcl*/itcl* /usr/lib/tcl*/itcl* /usr/lib/itcl* /usr/lib64/tcl*/itcl* /usr/lib64/itcl* do if test -e "$i/pkgIndex.tcl" then # Check version if test "x3.2" != "x" then v1=`expr "3.2" : '\([0-9]*\)'` v2=`expr "3.2" : '[0-9]*\.\([0-9]*\)'` v3=`expr "3.2" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` want_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` # Get version from pkgIndex.tcl p=`egrep 'package ifneeded Itcl' "$i/pkgIndex.tcl"` v1=`expr "$p" : '.*Itcl *\([0-9]*\)'` v2=`expr "$p" : '.*Itcl *[0-9]*\.\([0-9]*\)'` v3=`expr "$p" : '.*Itcl *[0-9]*\.[0-9]*\.\([0-9]*\)'` have_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` echo vers=/$have_vers/ if test `expr "$have_vers" ">=" "$want_vers"` = "1" then _ok="yes" else _ok="no" fi else _ok="yes" fi if test "x$_ok" = "xyes" then ITCL_PATH=`echo "$i" | sed 's:/*$::'` ITCL_ROOT=`echo "$i" | sed 's:/[^/]*/*$::'` break fi fi done # Execute the conditional expressions if test "$_ok" = "yes" then # This is the IF-YES path { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($ITCL_PATH)" >&5 $as_echo "yes ($ITCL_PATH)" >&6; } have_itcl=yes else # This is the IF-NO path { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Warning: no ictl package found. The GUI for the auto-finishing tool will be unavailable. Rerun using --with-itcl=DIR if you need to correct this." >&5 $as_echo "$as_me: WARNING: Warning: no ictl package found. The GUI for the auto-finishing tool will be unavailable. Rerun using --with-itcl=DIR if you need to correct this." >&2;} fi # Check whether --with-itk was given. if test "${with_itk+set}" = set; then : withval=$with_itk; _itk_with=$withval else _itk_with="no" fi _ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking itk directory" >&5 $as_echo_n "checking itk directory... " >&6; } # Look in the place we requested and also in some standard best-guess # locations. for i in $_itk_with/itk* $_itk_with /usr/share/tcl*/itk* /usr/local/tcl*/itk* /usr/lib/tcl*/itk* /usr/lib/itk* /usr/lib64/tcl*/itk* /usr/lib64/itk* do if test -e "$i/pkgIndex.tcl" then # Check version if test "x3.2" != "x" then v1=`expr "3.2" : '\([0-9]*\)'` v2=`expr "3.2" : '[0-9]*\.\([0-9]*\)'` v3=`expr "3.2" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` want_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` # Get version from pkgIndex.tcl p=`egrep 'package ifneeded Itk' "$i/pkgIndex.tcl"` v1=`expr "$p" : '.*Itk *\([0-9]*\)'` v2=`expr "$p" : '.*Itk *[0-9]*\.\([0-9]*\)'` v3=`expr "$p" : '.*Itk *[0-9]*\.[0-9]*\.\([0-9]*\)'` have_vers=`expr "${v1:-0}" "*" 1000000 + "${v2:-0}" "*" 1000 + "${v3:-0}"` if test `expr "$have_vers" ">=" "$want_vers"` = "1" then _ok="yes" else _ok="no" fi else _ok="yes" fi if test "x$_ok" = "xyes" then ITK_PATH=`echo "$i" | sed 's:/*$::'` ITK_ROOT=`echo "$i" | sed 's:/[^/]*/*$::'` break fi fi done # Execute the conditional expressions if test "$_ok" = "yes" then # This is the IF-YES path { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($ITK_PATH)" >&5 $as_echo "yes ($ITK_PATH)" >&6; } have_itk=yes else # This is the IF-NO path { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Warning: no itk package found. The GUI for the auto-finishing tool will be unavailable. Rerun using --with-itk=DIR if you need to correct this." >&5 $as_echo "$as_me: WARNING: Warning: no itk package found. The GUI for the auto-finishing tool will be unavailable. Rerun using --with-itk=DIR if you need to correct this." >&2;} fi #----------------------------------------------------------------------------- ac_config_files="$ac_config_files Makefile" ac_config_files="$ac_config_files system.mk" ac_config_files="$ac_config_files shlib.conf" ac_config_files="$ac_config_files gap5/gap5" ac_config_files="$ac_config_files gap5/tg_view" ac_config_files="$ac_config_files gap5/tg_index" ac_config_files="$ac_config_files gap5/gap5_cmd" ac_config_files="$ac_config_files gap4/gap4" ac_config_files="$ac_config_files copy_reads/copy_reads" ac_config_files="$ac_config_files trev/trev" ac_config_files="$ac_config_files prefinish/prefinish" ac_config_files="$ac_config_files pregap4/pregap4" ac_config_files="$ac_config_files spin/spin" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then as_fn_error $? "conditional \"HAVE_ZLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBLZMA_TRUE}" && test -z "${HAVE_LIBLZMA_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBLZMA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PNG_TRUE}" && test -z "${HAVE_PNG_FALSE}"; then as_fn_error $? "conditional \"HAVE_PNG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBCURSES_TRUE}" && test -z "${HAVE_LIBCURSES_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBCURSES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBCURSES_HEADER_TRUE}" && test -z "${HAVE_LIBCURSES_HEADER_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBCURSES_HEADER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by staden $as_me 2.0.0b11-2016, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ staden config.status 2.0.0b11-2016 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "staden_config.h") CONFIG_HEADERS="$CONFIG_HEADERS staden_config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "system.mk") CONFIG_FILES="$CONFIG_FILES system.mk" ;; "shlib.conf") CONFIG_FILES="$CONFIG_FILES shlib.conf" ;; "gap5/gap5") CONFIG_FILES="$CONFIG_FILES gap5/gap5" ;; "gap5/tg_view") CONFIG_FILES="$CONFIG_FILES gap5/tg_view" ;; "gap5/tg_index") CONFIG_FILES="$CONFIG_FILES gap5/tg_index" ;; "gap5/gap5_cmd") CONFIG_FILES="$CONFIG_FILES gap5/gap5_cmd" ;; "gap4/gap4") CONFIG_FILES="$CONFIG_FILES gap4/gap4" ;; "copy_reads/copy_reads") CONFIG_FILES="$CONFIG_FILES copy_reads/copy_reads" ;; "trev/trev") CONFIG_FILES="$CONFIG_FILES trev/trev" ;; "prefinish/prefinish") CONFIG_FILES="$CONFIG_FILES prefinish/prefinish" ;; "pregap4/pregap4") CONFIG_FILES="$CONFIG_FILES pregap4/pregap4" ;; "spin/spin") CONFIG_FILES="$CONFIG_FILES spin/spin" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi #----------------------------------------------------------------------------- # Summary output echo echo ---------------------------------------------------------------------- echo External packages used: if test "$have_curl" = "yes" then echo "curl: via $_libcurl_config" else echo "curl: NOT FOUND" fi if test "x$ZLIB_ROOT" = "x" then echo "zlib: DIR (system)" else echo "zlib: DIR $ZLIB_ROOT" fi if test "$have_curses" = "yes" then echo "curses: DIR ${CURSES_ROOT:-(system)}" elif test "$have_ncurses" = "yes" then echo "ncurses: DIR ${CURSES_ROOT:-(system)}" else echo 'curses: ***NOT FOUND***' fi if test "$have_lzma" = "yes" then echo "liblzma: DIR $LZMA_ROOT" else echo 'liblzma: ***NOT FOUND***' fi echo "io_lib: via $_io_lib_config" echo "Tcl: via $TCL_BIN_DIR/tclConfig.sh" echo "Tk: via $TK_BIN_DIR/tkConfig.sh" echo "tklib: $TKLIB_PATH" if test "$have_iwidgets" = "yes" then echo "Iwidgets: $IWIDGETS_PATH" else echo 'Iwidgets: ***NOT FOUND***' fi if test "$have_itcl" = "yes" then echo "Itcl: $ITCL_PATH" else echo 'Itcl: ***NOT FOUND***' fi if test "$have_itk" = "yes" then echo "Itk: $ITK_PATH" else echo 'Itk: ***NOT FOUND***' fi echo ---------------------------------------------------------------------- staden-2.0.0b11-2016-src/Makefile.in0000644000031500020650000001201312707372071015221 0ustar jkbteam117# # Invoking this makefile with JOB set will pass that as the item to make onto # all sublevel makefiles. eg "gmake JOB=clean". # include system.mk DIRS = Misc\ tk_utils\ text_utils\ seq_utils\ mutlib\ abi\ alf\ g\ trev\ primer3\ primer3/src\ gap4\ prefinish\ haplo\ eba\ init_exp\ get_scf_field\ spin\ vector_clip\ tracediff\ screen_seq\ qclip\ polyA_clip\ stops\ pregap4\ make_weights\ find_renz\ spin_emboss\ copy_reads\ hetins\ mutscan\ convert\ gap5\ scripts\ data JOB = all all: $(DIRS) clean: $(MAKE) $(FLAGS) JOB=clean %.clean: $(MAKE) $* $(FLAGS) JOB=clean spotless: $(MAKE) $(FLAGS) JOB=spotless relink: $(MAKE) $(FLAGS) JOB=relink %.relink: $(MAKE) $* $(FLAGS) JOB=relink depend: $(MAKE) $(FLAGS) JOB=depend %.depend: $(MAKE) $* $(FLAGS) JOB=depend # Installs newly built executables into $STADENROOT/$(MACHINE)-bin # FIXME: install: -mkdir -p $(INSTALLLIB) -mkdir -p $(INSTALLBIN) -mkdir -p $(INSTALLETC) -mkdir -p $(INSTALLSHARE) -mkdir -p $(INSTALLSCRIPTS) -mkdir -p $(INSTALLTCL) -mkdir -p $(INSTALLDOC) -mkdir -p $(INSTALLMAN) cp shlib.conf $(INSTALLETC) cp @srcdir@/staden.profile $(INSTALLSHARE) $(MAKE) $(FLAGS) JOB=install .PHONY: distcommon distwindows distunix # Full source is available now, so we no longer need to copy any of this # when building a binary distribution. # Make install does most of the work, but this doesn't install the third # party libraries. So we'll do that here. NOTE: this only installs the # binary components. The tcl/itcl files are already in the ../lib directory # and will be copied over separately. This is because in some cases they will # have been manually hacked/bug fixed. distunix: -mkdir $(DIST)/lib/$(MACHINE)-binaries -cp -R lib/$(MACHINE)-binaries/libpng* $(DIST)/lib/$(MACHINE)-binaries -cp -R lib/$(MACHINE)-binaries/libtcl* $(DIST)/lib/$(MACHINE)-binaries -cp -R lib/$(MACHINE)-binaries/libtk* $(DIST)/lib/$(MACHINE)-binaries -cp -R lib/$(MACHINE)-binaries/libitcl* $(DIST)/lib/$(MACHINE)-binaries -cp -R lib/$(MACHINE)-binaries/libitk* $(DIST)/lib/$(MACHINE)-binaries distwindows: -mkdir $(DIST)/lib/windows-binaries -cp lib/windows-binaries/* $(DIST)/lib/windows-binaries -cp windows/run/sprun.exe $(DIST)/windows-bin/ -cp windows/run/sprun.exe $(DIST)/windows-bin/gap.exe -cp windows/run/sprun.exe $(DIST)/windows-bin/pregap4.exe -cp windows/run/sprun.exe $(DIST)/windows-bin/spin.exe -cp windows/run/sprun.exe $(DIST)/windows-bin/trev.exe -cp tk8.4.6/win/wish84.exe $(DIST)/windows-bin/wish.exe #-cp trev/trev.bat $(DIST)/windows-bin #-cp gap4/gap4.bat $(DIST)/windows-bin #-cp spin/spin.bat $(DIST)/windows-bin #-cp pregap4/pregap4.bat $(DIST)/windows-bin -cp ../windows-bin/*.exe $(DIST)/windows-bin $(MAKE) STADENROOT=$(DIST) MACHINE=windows install -rm $(DIST)/windows-bin/gap4 -rm $(DIST)/windows-bin/spin -rm $(DIST)/windows-bin/trev -rm $(DIST)/windows-bin/pregap4 -rm $(DIST)/windows-bin/assemble4 -rm $(DIST)/windows-bin/finish_sanger DS=staden-@PACKAGE_VERSION@-src S=$(SRCROOT) distsrc: # # General souce. Works best from a clean svn checkout. -mkdir $(DS) cp $(S)/configure $(S)/*.in $(S)/bootstrap $(S)/README.build \ $(S)/NEWS $(S)/ChangeLog $(S)/global.mk $(S)/staden.profile \ $(S)/LICENCE.txt $(S)/LICENCE.rtf $(DS) -mkdir $(DS)/ac_stubs cp $(S)/ac_stubs/*.m4 $(DS)/ac_stubs # # Recurse through sub-directories too $(MAKE) $(FLAGS) DISTSRC=$(PWD)/$(DS) JOB=distsrc chmod -R go-w $(DS) # # Windows compilation bits # -mkdir $(S)/windows # cp -R windows/include $(S) # -mkdir $(S)/mkdef # cp -R windows/mkdef/mkdef.* $(S)/mkdef # -mkdir $(S)/run # cp -R windows/run/run.* \ # windows/run/main.cpp\ # windows/run/notes.txt\ # windows/run/sprun.rc\ # windows/run/staden.ico\ # $(S)/run # mkdir $(S)/windows/dumpenv # cp -R windows/dumpenv/dumpenv.*\ # windows/dumpenv/main.cpp\ # $(S)/windows/dumpenv # mkdir $(S)/windows/stashmsg # cp -R windows/stashmsg/stashmsg.*\ # windows/stashmsg/icon1.ico\ # windows/stashmsg/messages.*\ # windows/stashmsg/msg00001.bin\ # windows/stashmsg/resource.h\ # windows/stashmsg/stadenmsg.rc\ # $(S)/windows/stashmsg # cp -R windows/install-2003 $(S)/windows tar cvfz $(DS).tar.gz $(DS) $(DIRS): FORCE @if ! test -f $@/.dir; \ then \ mkdir -p $@; \ cd $@; \ touch .dir; \ fi cd $@ && $(MAKE) -f $(SRCROOT)/$@/Makefile $(FLAGS) $(MFLAGS) BUILD=$(PWD) SRC=$(SRCROOT)/$@ SUBDIR=$@ $(JOB) %/: % # # dependencies so e.g. make -j4 works. tk_utils: Misc text_utils: Misc seq_utils: Misc text_utils tk_utils mutlib: Misc seq_utils abi: Misc alf: Misc eba: Misc get_scf_field: Misc hetins: Misc init_exp: Misc find_renz: seq_utils make_weights: seq_utils polyA_clip: seq_utils qclip: seq_utils screen_seq: seq_utils stops: seq_utils vector_clip: seq_utils mutscan: mutlib tracediff: mutlib spin: seq_utils g: Misc gap4: g seq_utils mutlib primer3/src convert: gap4 copy_reads: gap4 haplo: gap4 prefinish: gap4 gap5: seq_utils primer3/src FORCE: # DO NOT DELETE THIS LINE -- make depend depends on it. staden-2.0.0b11-2016-src/configure.in0000644000031500020650000001573312707372071015501 0ustar jkbteam117dnl Process this file with aclocal and autoconf to produce a configure script. AC_INIT([staden],[2.0.0b11-2016]) # Check that we're running in a subdirectory. If not create one and rerun. # This ensures that the root directory does not get polluted with the # binary output files and also protects the root Makefile (not derived from # Makefile.in). AC_CONFIG_HEADERS(staden_config.h) #----------------------------------------------------------------------------- # Checks for compiler programs. AC_PROG_CC AC_PROG_CXX #--- #Disabled for now, see fortran comments global.mk too. # AC_PROG_F77 # # If we're using gfortran we also need to add -lgfortran to our link line # # for programs that link against a shared-library built using (entirely or # # in part) gfortran. # case "$F77" in # gfortran*) # LIBS="$LIBS -lgfortran" # ;; # esac #----------------------------------------------------------------------------- # Check for library dependencies LIBCURL_CHECK_CONFIG(,,[have_curl=yes], [have_curl=no]) AX_LIB_ZLIB(,[have_zlib=yes], [AC_MSG_ERROR([Abort: no zlib. Please rerun configure using the --with-zlib=DIR option.])]) AX_LIB_LZMA(,[have_lzma=yes], [AC_MSG_WARN([No liblzma detected. Gap5 may be able to read some database. To fix this please install liblzma and rerun configure using the --with-lzma=DIR option.])]) AX_LIB_PNG(,[have_png=yes],[ have_png=no; AC_MSG_WARN([No PNG library found. Gap4's Report Mutatations functionality will be absent.])]) dnl AX_LIB_SAMTOOLS(0.1.3,[have_bam=yes],[AC_MSG_WARN([Gap5/tg_index will have reduced functionality])]) AX_LIB_IO_LIB(1.12.5,[have_io_lib=yes], [AC_MSG_ERROR([Abort: no compatible io_lib release found. Please rerun configure using the --with-io_lib=DIR option.])]) AX_LIB_CURSES dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h unistd.h) AC_CHECK_HEADER(zlib.h) AC_CHECK_HEADER(pwd.h, AC_DEFINE(HAVE_PWD_H, 1, [Define if you have pwd.h]),,) dnl Large file support AC_SYS_LARGEFILE AC_FUNC_FSEEKO dnl Checks for library functions. AC_SEARCH_LIBS(cos, m) AC_CHECK_FUNCS(popen) dnl X11 AC_PATH_XTRA dnl C compiler characteristics AC_C_BIGENDIAN AC_C_INLINE if test "$ac_cv_c_inline" != no ; then AC_DEFINE([HAVE_INLINE],1, [Define if the C compiler supports inline]) AC_SUBST([HAVE_INLINE]) fi dnl Do we have the va_copy function? AX_FUNC_VA_COPY PWD=`pwd` AC_SUBST([PWD]) #----------------------------------------------------------------------------- # Svn repository version, for use within program version numbers if svnversion --help >/dev/null 2>&1 then SVNVERSION=svnversion else SVNVERSION=true fi AC_SUBST([SVNVERSION]) #----------------------------------------------------------------------------- # Tcl TEA usage TEA_INIT([3.9]) # Load the tclConfig.sh and tkConfig.sh TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG TEA_PATH_TKCONFIG TEA_LOAD_TKCONFIG # Override the TEA_PATH_TCLCONFIG for compilation options. # This allows us to do "./configure ... CC=/some/other/cc" and get SHLIB_LD # variables set correctly for our new compiler. TEA_CONFIG_CFLAGS # Identify tclsh executable TEA_PROG_TCLSH TCLSH_PROG=`basename ${TCLSH_PROG}` # Handles --prefix option #TEA_PREFIX # We're naughty - for now need some internals of Tk, in particular canvas # bits and bobs TEA_PRIVATE_TCL_HEADERS TEA_PUBLIC_TK_HEADERS TEA_PRIVATE_TK_HEADERS # For MacOS X we don't current support the Aqua Tk version, only the X11 one if test "`uname -s`" = "Darwin" then case "${TCL_DEFS} ${TK_DEFS}" in *TK_FRAMEWORK* | *TCL_FRAMEWORK*) echo "" AC_MSG_ERROR([Abort: the Tcl/Tk version found is the native Aqua interface, installed as a system framework. Unfortunately for compatibility reasons the Staden Package requires an X11 build of Tk instead. Please install (eg from MacPorts) and specify the location using --with-tcl and --with-tk.]) exit ;; esac fi # Guess C++ shared library generation from the C one. [SHLIB_LDXX=`echo "$SHLIB_LD" | \ sed 's/{CC}/{CXX}/;s/{CFLAGS}/{CXXFLAGS}/;s/^[a-z]*cc /${CXX} /'` ] AC_SUBST([SHLIB_LDXX]) AC_SUBST([SHLIB_SUFFIX]) AC_SUBST([TCL_VERSION]) AC_SUBST([TCL_INCLUDE_SPEC]) AC_SUBST([TCL_LIB_SPEC]) AC_SUBST([TCL_LIBS]) AC_SUBST([TK_VERSION]) AC_SUBST([TK_INCLUDE_SPEC]) AC_SUBST([TK_LIB_SPEC]) AC_SUBST([TK_LIBS]) AC_SUBST([CC_SEARCH_FLAGS]) AC_SUBST([DL_LIBS]) # tklib - extra widgets for Tk AX_LIB_TKLIB(,[have_tklib=yes], [AC_MSG_ERROR([Abort: no tklib package found, use --with-tklib=DIR])]) AX_LIB_IWIDGETS(4,[have_iwidgets=yes], [AC_MSG_WARN([Warning: no iwidgets package found. The GUI for the auto-finishing tool will be unavailable. Rerun using --with-iwidgets=DIR if you need to correct this.])]) AX_LIB_ITCL(3.2,[have_itcl=yes], [AC_MSG_WARN([Warning: no ictl package found. The GUI for the auto-finishing tool will be unavailable. Rerun using --with-itcl=DIR if you need to correct this.])]) AX_LIB_ITK(3.2,[have_itk=yes], [AC_MSG_WARN([Warning: no itk package found. The GUI for the auto-finishing tool will be unavailable. Rerun using --with-itk=DIR if you need to correct this.])]) #----------------------------------------------------------------------------- AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([system.mk]) AC_CONFIG_FILES([shlib.conf]) AC_CONFIG_FILES([gap5/gap5]) AC_CONFIG_FILES([gap5/tg_view]) AC_CONFIG_FILES([gap5/tg_index]) AC_CONFIG_FILES([gap5/gap5_cmd]) AC_CONFIG_FILES([gap4/gap4]) AC_CONFIG_FILES([copy_reads/copy_reads]) AC_CONFIG_FILES([trev/trev]) AC_CONFIG_FILES([prefinish/prefinish]) AC_CONFIG_FILES([pregap4/pregap4]) AC_CONFIG_FILES([spin/spin]) AC_OUTPUT #----------------------------------------------------------------------------- # Summary output echo echo ---------------------------------------------------------------------- echo External packages used: if test "$have_curl" = "yes" then echo "curl: via $_libcurl_config" else echo "curl: NOT FOUND" fi if test "x$ZLIB_ROOT" = "x" then echo "zlib: DIR (system)" else echo "zlib: DIR $ZLIB_ROOT" fi if test "$have_curses" = "yes" then echo "curses: DIR ${CURSES_ROOT:-(system)}" elif test "$have_ncurses" = "yes" then echo "ncurses: DIR ${CURSES_ROOT:-(system)}" else echo 'curses: ***NOT FOUND***' fi if test "$have_lzma" = "yes" then echo "liblzma: DIR $LZMA_ROOT" else echo 'liblzma: ***NOT FOUND***' fi dnl if test "$have_bam" = "yes" dnl then dnl echo "samtools: DIR $SAMTOOLS_ROOT" dnl else dnl echo 'samtools: ***NOT FOUND***' dnl fi echo "io_lib: via $_io_lib_config" echo "Tcl: via $TCL_BIN_DIR/tclConfig.sh" echo "Tk: via $TK_BIN_DIR/tkConfig.sh" echo "tklib: $TKLIB_PATH" if test "$have_iwidgets" = "yes" then echo "Iwidgets: $IWIDGETS_PATH" else echo 'Iwidgets: ***NOT FOUND***' fi if test "$have_itcl" = "yes" then echo "Itcl: $ITCL_PATH" else echo 'Itcl: ***NOT FOUND***' fi if test "$have_itk" = "yes" then echo "Itk: $ITK_PATH" else echo 'Itk: ***NOT FOUND***' fi echo ---------------------------------------------------------------------- staden-2.0.0b11-2016-src/shlib.conf.in0000644000031500020650000000133012707372071015531 0ustar jkbteam117# Shared library support, so we know what to use in tcl load commands. set lib_prefix lib set lib_suffix @SHLIB_SUFFIX@ # Also for tcl loading, what extra bits to add to our auto_path foreach x $auto_path { set _p($x) 1 } foreach x [list "@TKLIB_PATH@" "@IWIDGETS_ROOT@"] { if {![info exists _p($x)]} { set _p($x) 1 lappend auto_path $x } } unset _p # Itcl/Itk use another method. Despite the presence of a perfectly # functioning auto_path system, instead they iterate around # directories that are "nearby" the tclsh/stash executable itself. # # Instead we override it manually as this is the only sane way to get # this working. set env(ITCL_LIBRARY) "@ITCL_PATH@" set env(ITK_LIBRARY) "@ITK_PATH@" staden-2.0.0b11-2016-src/staden_config.h.in0000644000031500020650000001433012707372071016541 0ustar jkbteam117/* staden_config.h.in. Generated from configure.in by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Defined when cygwin/mingw does not support EXCEPTION DISPOSITION */ #undef EXCEPTION_DISPOSITION /* Defined when compiler supports casting to union type. */ #undef HAVE_CAST_TO_UNION /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO /* Define if the C compiler supports inline */ #undef HAVE_INLINE /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have a working io_lib */ #undef HAVE_IO_LIB /* Define to 1 if you have a functional curl library. */ #undef HAVE_LIBCURL /* Define to 1 if you have a working curses/ncurses library. */ #undef HAVE_LIBCURSES /* Define if liblzma is installed */ #undef HAVE_LIBLZMA /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `lseek64' function. */ #undef HAVE_LSEEK64 /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Defined when mingw does not support SEH */ #undef HAVE_NO_SEH /* Define to 1 if you have the `open64' function. */ #undef HAVE_OPEN64 /* Define if png is installed */ #undef HAVE_PNG /* Define to 1 if you have the `popen' function. */ #undef HAVE_POPEN /* Define if you have pwd.h */ #undef HAVE_PWD_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Is 'struct dirent64' in ? */ #undef HAVE_STRUCT_DIRENT64 /* Is 'struct stat64' in ? */ #undef HAVE_STRUCT_STAT64 /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Is off64_t in ? */ #undef HAVE_TYPE_OFF64_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the va_copy() function. */ #undef HAVE_VA_COPY /* Defined when cygwin/mingw ignores VOID define in winnt.h */ #undef HAVE_WINNT_IGNORE_VOID /* Define if zlib is installed */ #undef HAVE_ZLIB /* Defined if libcurl supports AsynchDNS */ #undef LIBCURL_FEATURE_ASYNCHDNS /* Defined if libcurl supports IDN */ #undef LIBCURL_FEATURE_IDN /* Defined if libcurl supports IPv6 */ #undef LIBCURL_FEATURE_IPV6 /* Defined if libcurl supports KRB4 */ #undef LIBCURL_FEATURE_KRB4 /* Defined if libcurl supports libz */ #undef LIBCURL_FEATURE_LIBZ /* Defined if libcurl supports NTLM */ #undef LIBCURL_FEATURE_NTLM /* Defined if libcurl supports SSL */ #undef LIBCURL_FEATURE_SSL /* Defined if libcurl supports SSPI */ #undef LIBCURL_FEATURE_SSPI /* Defined if libcurl supports DICT */ #undef LIBCURL_PROTOCOL_DICT /* Defined if libcurl supports FILE */ #undef LIBCURL_PROTOCOL_FILE /* Defined if libcurl supports FTP */ #undef LIBCURL_PROTOCOL_FTP /* Defined if libcurl supports FTPS */ #undef LIBCURL_PROTOCOL_FTPS /* Defined if libcurl supports HTTP */ #undef LIBCURL_PROTOCOL_HTTP /* Defined if libcurl supports HTTPS */ #undef LIBCURL_PROTOCOL_HTTPS /* Defined if libcurl supports LDAP */ #undef LIBCURL_PROTOCOL_LDAP /* Defined if libcurl supports TELNET */ #undef LIBCURL_PROTOCOL_TELNET /* Defined if libcurl supports TFTP */ #undef LIBCURL_PROTOCOL_TFTP /* Define to the name of the curses header file to include */ #undef LIBCURSES_HEADER /* Are we building against Mac OS X TkAqua? */ #undef MAC_OSX_TK /* No Compiler support for module scope symbols */ #undef MODULE_SCOPE /* No visibility hidden passed to zlib? */ #undef NO_VIZ /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Are wide integers to be implemented with C 'long's? */ #undef TCL_WIDE_INT_IS_LONG /* What type should be used to define wide integers? */ #undef TCL_WIDE_INT_TYPE /* UNDER_CE version */ #undef UNDER_CE /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Add the _ISOC99_SOURCE flag when building */ #undef _ISOC99_SOURCE /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */ #undef _OE_SOCKETS /* Do we really want to follow the standard? Yes we do! */ #undef _POSIX_PTHREAD_SEMANTICS /* Do we want the reentrant OS API? */ #undef _REENTRANT /* _WIN32_WCE version */ #undef _WIN32_WCE /* Do we want to use the XOPEN network library? */ #undef _XOPEN_SOURCE_EXTENDED /* Define curl_free() as free() if our version of curl lacks curl_free. */ #undef curl_free /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif staden-2.0.0b11-2016-src/system.mk.in0000644000031500020650000001040612707372071015442 0ustar jkbteam117# Override the old bits that depended on $(MACHINE) PWD=@PWD@ SRCROOT=$(PWD)/@srcdir@ O=. L=$(PWD)/lib #----------------------------------------------------------------------------- # Third party package dependencies #-- libcurl CURL_LIB = @LIBCURL@ CURL_INC = @LIBCURL_CPPFLAGS@ #-- zlib ZLIB_LIB = @ZLIB_LDFLAGS@ ZLIB_INC = @ZLIB_CFLAGS@ #ZLIB_VERSION = @ZLIB_VERSION@ #-- liblzma LZMA_LIB = @LZMA_LDFLAGS@ LZMA_INC = @LZMA_CFLAGS@ #LZMA_VERSION = @LZMA_VERSION@ #-- libpng PNG_LIB = @PNG_LDFLAGS@ PNG_INC = @PNG_CFLAGS@ #-- staden-io_lib IOLIB_LIB = @IO_LIB_LDFLAGS@ IOLIB_INC = @IO_LIB_CFLAGS@ #-- Curses / NCurses CURSES_LIB = @CURSES_LDFLAGS@ CURSES_INC = @CURSES_CFLAGS@ #-- X windows X_LIB = @X_LIBS@ INCLUDES += @X_CFLAGS@ #-- Tcl/Tk #TCL_INC = @TCL_INCLUDE_SPEC@ TCL_INC = @TCL_INCLUDES@ TCL_LIB = @TCL_LIB_SPEC@ @TCL_LIBS@ TK_INC = @TK_INCLUDES@ @TCL_INCLUDES@ TK_LIB = @TK_LIB_SPEC@ @TCL_LIB_SPEC@ @TK_LIBS@ #----------------------------------------------------------------------------- # Compiler/linking options # -rpath-link is passed to the linker here to avoid needing to set # LD_LIBRARY_PATH during linking, although it will still be needed to be set # at run-time unless we modify these to -rpath instead of -rpath-link. # # We only do this currently for the other libraries within this package and # for staden-io_lib. # How else do we get commas in a subst text or pattern? comma = , SVNVERS := $(shell expr "`@SVNVERSION@ 2>&1 $(SRCROOT)`" : '\([0-9].*\)') LIB_RUNTIME_DIR = ${prefix}/lib/staden CC = @CC@ #CDEBUG = -Wall -Wno-sign-compare -Wno-pointer-sign -Wno-parentheses -Wno-unused -Wno-char-subscripts -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast CFLAGS = @CFLAGS@ $(DEFINES) $(INCLUDES) -DSVN_VERSION="$(SVNVERS)" CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ $(DEFINES) $(INCLUDES) -DSVN_VERSION="$(SVNVERS)" CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = -L$(L) @LDFLAGS@ @CC_SEARCH_FLAGS@ #CLDFLAGS = -L$(L) -Wl,-rpath-link,$(L) $(subst -L,-Wl$(comma)-rpath-link$(comma),$(filter -L%,$(IOLIB_LIB))) CLDFLAGS = -L$(L) @LDFLAGS@ @CC_SEARCH_FLAGS@ CXXLDFLAGS = $(CLDFLAGS) F77 = @F77@ FFLAGS = @FFLAGS@ EXTRA_LIBS = @LIBS@ # System type OS := $(shell uname -s) # Large file support # (Enabled automatically due to AC_SYS_LARGEFILE & AC_FUNC_FSEEKO ?) # Dynamic linking options. These mainly come from querying how Tcl worked. # Note for windows we'll need to change SHLIB_PREFIX. (TODO) # Do we also need to add SHLIB_SONAME somewhere? On irix this is: # SHLIB_SONAME = $(@:$(L)/%=-soname %) # SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LDFLAGS = $(CFLAGS) $(LDFLAGS) SHLIB_PREFIX = lib SHLIB_SUFFIX = @SHLIB_SUFFIX@ SHLIB_SONAME = SHLIB_OUTFLAG = -o $(SPACE) EXTRA_LIBS += @DL_LIBS@ # Best guess for C++ SHLIB_CXXFLAGS = $(SHLIB_CFLAGS) SHLIB_LDXX = @SHLIB_LDXX@ SHLIB_LDXXFLAGS = $(SHLIB_LDFLAGS) # Best guess for fortran SHLIB_FFLAGS = $(SHLIB_CFLAGS) #----------------------------------------------------------------------------- # Install options # Installer for executables. Most are executable already, but some # need chmodding such as the ones created from .in via autoconf. # # We can either do this explicitly via cp and chmod, or use the # preferred BSD install program instead. Uncomment as appropriate if your # system lacks install. # INSTALL = ifunc() { chmod +xr $${@+"$$@"}; cp $${@+"$$@"}; }; ifunc INSTALL = install # Our libraries are I think exclusively used by us, hence we pick # our own subdirectory. prefix = @prefix@ exec_prefix = @exec_prefix@ INSTALLLIB = ${DESTDIR}@libdir@/staden INSTALLBIN = ${DESTDIR}@bindir@ #INSTALLETC = ${DESTDIR}@sysconfdir@/staden INSTALLSHARE = ${DESTDIR}@datadir@/staden INSTALLDOC = ${DESTDIR}@datadir@/doc INSTALLMAN = ${DESTDIR}@mandir@ INSTALLSCRIPTS = $(INSTALLSHARE)/scripts INSTALLTCL = $(INSTALLSHARE)/tcl # Data and etc config files are shoehorned into one place for now, as # traditionally this all ended up in $STADTABL INSTALLETC = $(INSTALLSHARE)/etc INSTALLDATA = $(INSTALLSHARE)/etc # Keep autoconf happy datarootdir = @datarootdir@ staden-2.0.0b11-2016-src/bootstrap0000755000031500020650000000034312707372071015122 0ustar jkbteam117#!/bin/sh set -x rm -rf install-sh missing mkinstalldirs depcomp aclocal.m4 acinclude.m4 config.cache config.log config.status configure autom4te.cache config.sub config.guess aclocal -I ac_stubs && \ autoheader && \ autoconf staden-2.0.0b11-2016-src/README.build0000644000031500020650000003020312707372071015133 0ustar jkbteam117 General build instructions, 7th Feb 2011 ======================================== See NEWS and/or ChangeLog for version updates. See below for platform specific build instructions. External dependencies ===================== In order to compile the Staden source tree you also need a few extra libraries. Some of these may be considered as internal (eg io_lib), but they are not included within this source tree and need to be downloaded and installed before hand. Packages required (newer versions should work; older versions may work but are untested - please tell me if they work too). * staden-io_lib >=1.13.8 * tcl >=8.4 * tk >=8.4 * zlib >=1.2.x * liblzma >=4.999 (optional[2]) * libpng >=1.2.x (optional[1]) * curl >=7.x (needed by io_lib) * tklib >=0.3? (for tablelist widget) * itcl >=3.2 (optional[3]) * itk >=3.2 (optional[3]) * iwidgets >=4.0 (optional[3]) [1] Libpng development packages are only needed for some obscure output from Gap4: the editor Report Mutations function. [2] liblzma-dev linux packages or the XZ utils source tarball includes the liblzma library. If present it may be used for Gap5 to perform better compression, but it is not mandatory. [3] itcl/itk/iwidgets are now needed only by the GUI for the auto-finishing system used in Gap4 ("prefinish"). However it is a run-time dependency and the package will build without these installed. Note that if you link against Tcl/Tk 8.5 then the minimum version of itcl/itk is 3.4 and not 3.2. If your operating system separates out run-time from development files then you will need both installed. For example on Debian you need tcl8.5 and tcl8.5-dev packages (or tcl8.4 + tcl8.4-dev). Other system prerequisites: * C compiler (eg gcc, icc) * C++ compiler (eg g++) * FORTRAN compiler (eg g77, but see src/gap4/legacy_f2c.c and the src/gap4/Makefile if this is an issue) * GNU make * TexInfo (for documentation only) * Perl, Awk, Sed (for documentation only) Note that if you are using gfortran then the GNU autoconf system does not automatically detect the requirement of -lgfortran on link lines while building libraries. To fix this add "LIBS=-lgfortran" on to the end of your ./configure command. Building the package consists of two main components: source code and documentation plus course material. Source code =========== The program source is all held within the src directory. It now uses the GNU autoconf system on all systems, but we recommend using it in the following manner. cd src mkdir build.myhost cd build.myhost ../configure [options] make You may need to specify options to the configure script in order to find certain third-party packages: --with-io_lib=DIR Specifies the prefix for an io_lib install. --with-zlib=DIR Specifies the prefix for a zlib install. --with-lzma=DIR Specifies the prefix for an XZ Utils install, containing the lzma library. --with-libcurl=DIR Specifies the prefix for a curl install. --with-tcl=DIR Specifies the directory containing a tclConfig.sh file. --with-tk=DIR Specifies the directory containing a tkConfig.sh file. --with-tclinclude=DIR If not found in the place specified in tclConfig.sh, this specifies the root directory of a tcl source tree (so it should have generic, unix, etc subdirectories). --with-tkinclude=DIR If not found in the place specified in tkConfig.sh, this specifies the root directory of a tcl source tree (so it should have generic, unix, etc subdirectories). --with-tklib=DIR Specifies the root directory of the tklib package; that is the package directory for tk extensions, written in pure tcl code, rather than the Tk library itself (which is specified using --with-tk). You may also want to use the --prefix=DIR option to control the install prefix (defaults to /usr/local/staden). Note that on some systems it is not sufficient to simply use the --with-x=y syntax, but you also need to setup LD_LIBRARY_PATH to include the location of any run-time libraries prior to linking against them. This shouldn't be an issue for libraries installed in the default system locations. Examples for standard systems follow. Try first with a minimum of --with parameters and then read the summary at the end (if it gets that far) to see whether it correctly detected the packages. You should see something like this: External packages used: curl: via /usr/bin/curl-config zlib: DIR (system) curses: DIR (system) liblzma: DIR /software/badger/opt/xz_utils io_lib: via /software/badger/bin/io_lib-config Tcl: via /usr/lib/tcl8.4/tclConfig.sh Tk: via /usr/lib/tk8.4/tkConfig.sh tklib: /software/badger/opt/tcl_packages/tklib0.5 Iwidgets: /usr/lib/iwidgets4.0.1 Itcl: /usr/lib/itcl3.2 Itk: /usr/lib/itk3.2 As noted above, do not be concerned if it reports "***NOT FOUND***" for some of the optional packages, in particularly iwidgets, itcl and itk. Linux / Debian -------------- (My local build system, which produced the configure summary above.) mkdir src/build.debian cd src/build.debian ../configure \ --with-tcl=/usr/lib/tcl8.4 --with-tk=/usr/lib/tk8.4 \ --with-tklib=/software/badger/opt/tcl_packages/tklib0.5 \ --with-lzma=/software/badger/opt/xz_utils \ --with-io_lib=/software/badger \ --prefix=$HOME/staden.install Linux / Ubuntu 10 ----------------- Packages used (may be incomplete): apt-get install g++ apt-get install zlib1g-dev apt-get install tk-dev apt-get install liblzma-dev apt-get install tklib apt-get install libcurl3-gnutls-dev apt-get install libncurses5-dev Linux / Fedora -------------- Much the same as other linux systems, but I took note of the packages I had to install: yum install gcc yum install gcc-c++ yum install zlib-devel yum install tk-devel yum install tklib yum install curl-devel yum install ncurses-devel yum install libpng-devel yum install libXt-devel (for X11/Intrinsic.h) After compiling and installing you may see errors like this: ".../lib/staden/libtk_utils.so: cannot restore segment prot after reloc: Permission denied" This is due to SElinux being set to enforcing. The correct way to resolve this is to use the chcon command as follows: chcon -t texrel_shlib_t /PREFIX/lib/staden/lib* where PREFIX is the --prefix value used in autoconf. (Alternatively SElinux can be made less picky by running "/usr/sbin/setenforce 0") Note that if you are running a 64-bit system and have 32-bit compatibility libraries installed then RedHat systems will try to tempt configure scripts to use old 32-bit libraries in preference. To solve this you can manually override the search paths. Eg: ../configure --with-tcl=/usr/lib64 --with-tk=/usr/lib64 Linux / Centos -------------- yum install xz-devel yum install tk-devel yum install zlib-devel Other packages as listed in Fedora, but appeared to be installed as part of the base OS. Note the comment under Fedora for building on 64-bit systems with 32-bit libraries. Microsoft Windows ----------------- 1. Main source tree The Windows build can use the same configure script as the Unix build, provided you have the GNU tools installed. I used MinGW and Msys as the compiler / environment, but it may build in other environments. Please let me know of any necessary changes if you try this. I used the automated mingw installer (https://sourceforge.net/projects/mingw/files/) however it wasn't entirely trouble free to get a working install. You may also need to run "mingw-get install libz" to get a working zlib with include files. (Mileage seems to vary per person on this which is confusing; perhaps the installer is changing rapidly.) 2. src/windows/run Once the main package has built, you'll also want to cd into the src/windows/run directory and build that. This is a little executable front end that replaces the bourne shell startup scripts used on unix (eg the "gap4" or "trev" scripts and similar). The purpose is simply to set up environment variables before running tclsh on the appropriate GUI program. 3. WiX installer and .msi files Install WiX somewhere. It can be found on sourceforge or via google. This takes an XML config and uses it to create a Microsoft Installer file (.msi). You need a full Staden Package "make install" and any additional files you wish manually placed there. I typically put tcl/tk in that directory too and any additional run time libraries (zlib, lzma, etc) to make the code self contained. # See the README file in this directory too cd src/windows/wix # The c:/jkb/staden/install_root is the target of my --prefix earlier, # but with proper windows-style drive letter naming. # # You may also need Strawberry Perl here as the msys one munges # pathnames when it generates the .wxi file, which wix then will reject. perl generate_wxs.pl c:/jkb/staden/install_root > staden_files.wxi # This produces the staden.msi file DISTROOT=/c/jkb/staden/install_root candle staden.wxs light -ext WixUIExtension staden.wixobj MacOS X ------- [31st Oct 2013] Fetch latest tcl/tk (8.6.1 at time of writing) and use the "unix" build. Export MACOSX_DEPLOYMENT_TARGET=10.5 (environ) and Configure with --prefix=$HOME/sys "CFLAGS=-arch i386 -arch x86_64". Do a make, make install, and then copy in the ../license.terms file to the $HOME/sys/lib/{tcl,tk}* directories too to comply with the redistribution clause. (Or maybe -macosx_version_min 10.5.0 on cflags too) Similarly for tcllib and tklib, do configure, make install, and copy those licences as well. Io_lib: as per tcl/tk above, but also add --disable-dependency-tracking and --with-libcurl=$HOME/sys too. The curl copy in $HOME/sys is needed purely for linking against to get a dependency on an old API, but it can be removed from the distributed tarball I believe. The dependency tracking bit is there because it is incompatible with cross compiling. [older] Tested on both 10.5 and 10.6. Just use the configure script as per any normal Unix system, but be aware of a few specifics regarding tcl/tk. Tk comes in two forms - a native Aqua look-and-feel (with Frameworks) and an X11 version. The latter is simply the product of building tcl/tk using the "unix" subdirectory instead of the "macosx" directory. *** NOTE: The staden package needs the X11 version of Tk *** It's quite likely you will have the aqua Tk already installed too, and configure will probably detect this first. In this case manually specify the tcl & tk locations. Eg if using MacPorts: ./configure --with-tcl=/opt/local/lib --with-tk=/opt/local/lib Macport packages used (not an exhaustive list): tcllib 1.11 tklib 0.5 tcl/tk 8.5.9 MacOS X - native libs --------------------- If you want to build a fat (universal) binary you will need to use the native install of X11 libraries in /usr/X11R6/lib instead, as the MacPort libraries are not cross-platform. To do this, you'll need to build third party packages yourself, including tcl/tk in X11 mode. As an example, in bourne shell syntax: $ cd src/tcl8.5.9/unix $ CFLAGS="-O -arch i386 -arch x86_64 -arch ppc -arch ppc64" ./configure --prefix=/nfs/sam_scratch/jkb/src/tcltk_inst $ make; make install $ cd ../../src/tk8.5.9/unix $ CFLAGS="-O -arch i386 -arch x86_64 -arch ppc -arch ppc64" ./configure --prefix=/nfs/sam_scratch/jkb/src/tcltk_inst --with-tcl=/nfs/sam_scratch/jkb/src/tcltk_inst8.5/lib $ make; make install When compiling the Staden Package remember that there are one or two C++ libraries too, so you need to redefine CXXFLAGS as CFLAGS on the command line. Tracking down problems can be tricky in fat binaries. A handy hint for telling what dependencies and architectures binaries and libraries have is to use otool. $ otool -arch all -h libstaden-read.dylib ... $ otool -L libstaden-read.dylib ... $ lipo -info libstaden-read.dylib ... A more verbose version of otool -L is otool -l. It's the same data. However it lists the libraries the program wants to load and not the libraries it finally resolves and does load. To see those use: DYLD_PRINT_LIBRARIES=1 DYLD_PRINT_RPATHS=1 DYLD_PRINT_OPTS=1 ./bin/gap5 Documentation / Course notes ============================ These have now been moved to their own package named "staden_doc-2.0.0b8-src.tar.gz" (and subsequent releases). Please download this from sourceforge and read the building and install documentation within there. staden-2.0.0b11-2016-src/NEWS0000644000031500020650000025002312707372071013660 0ustar jkbteam117April 2016 - 2.0.0b11 ========== Gap5 Updates ------------ * Find Haplotypes function for use within the contig editor. This replaces the old Sort By Sequence mode as well as generating lists of read IDs per haplotype. It also creates a master "haplotypes" list of lists. * Disassemble Readings now handles list of lists (in addition to normal lists of readings), for use with the haplotype output. * Improvements to Shuffle Pads. It can now use cutoff/soft-clip data to detect concordant soft-clips (regions where all the soft-clip data agrees with one another). It auto-detects likely adapter sequences to avoid extending these. It also now detects short tandem repeats and handles these more carefully. An STR overlapping a heterozygous indel can be clipped back if the read doesn't span the entire STR, in order to not cause bias in the copy numbers. * The Realign Selection option now brings up a user interface if invoked from the main menu, but not when right clicked via the popup menu (unless Control key is held down while right-clicking). * Export Contigs has an additional depadded option to use original reference sequence coordinates. Note this isn't 100% robust as it depends on which edits have happened, in particular joining and breaking contigs. * Export SAM, BAM and CRAM should now be much faster in excessively deep regions with soft-clips. * The quality values can now be overriden when importing FASTQ or the default quality changed when importing FASTA. * Gap5_cmd has gained Contig Extend and Contig Trim commands. * Gap5_cmd auto_join now honours the -min_overlap and -max_overlap parameters. * Improved the consensus discrepancy score by taking into account a per-base difference rather than joining all together. * Check Assembly text results are now more verbose, for easier comparison between databases. * The current selected reading list in the Contig Editor now shows the number of items in that list. * Highlight Disagreements for cutoff data now defaults to displaying foreground coloured differences. * The consensus algorithm has been tweaked to cope with different overcall and undercall likelihoods. This is tied to sequencing technology, for which the default can be adjusted in the Options menu. This uses the @RG "PL"atform heading in BAM files. The List Libraries window permits editing of this field after import. * Small tweaks to Find Internal Joins block alignments. * Save Consensus can now optionally emit ambiguity codes for heterozygous positions. * Added back Mask/Mark consensus filtering modes to Find Internal Joins. * Read name indexing should uses less temporary disk space in tg_index. * The multi-column reading list viewer now has Template Status and Library Name columns for display/sorting. * The Template Display now has hot-keys for configurations. Use Shift-Function-Key to remember the current settings and Function-Key to switch to that setting. The File -> Save Settings option will write these to your ~/.gap5rc. Gap5 Fixes ---------- * Fixed a bug where using the contig selector / contig list to fill out a dialogue box without then doing anything else at all could cause the name to be considered invalid. * Removed used of some unintialised data in Shuffle Pads. - Validate_clip_regions could process annotation record numbers that have been removed already. - Functions setting sequence clip points could potentially set clips beyond the sequence ends. * Fixed a bin corruption caused by updates to read pairs spanning two contigs, eg with one editor open on each end. (See r3996 for the long description.) * Auto-scrolling int he template display now takes into account the contig start location. * Many bug fixes to Shuffle Pads, but there is also a lot of new code in there too (hopefully without new bugs!). * Tg_index -g mode was erroneously adding columns of pads in some cases. Also fixed an issue with tg_index -a -g not working in some situations. * Fixed rounding issues when zooming the template display quality plot. * Some more (rather obscure) gap5 database corruptions have been fixed. * Improved robustness in the presence of database corruptions. While not foolproof, the program shouldn't crash as often. * Import Reads no longer clears the "readings" list. * Corrected the (reversed) insertion / deletion percentages in List Base Confidence. * Quality value "*" in BAM is no longer treated as quality -1. * Fixed a potential buffer overrun in querying individual items in the contig selector. * Overhauled the base insertion and deletion code in the Contig Editor, fixing several problems (in particular with Undo). * Various fixes to keep the contig start / end coordinates correct, removing bin errors. * Fixed issues with annotation positions after using the editor commands to move sequences. Similarly consensus tags at the ends of contigs should be more robust when inserting and removing consensus columns. * SAM/BAM export should now correct the mate-pair flags and positions. * Fixed exporting CRAM in padded mode. It was outputting a depadded consensus, causing CRAM to work excessively hard in encoding reference differences. * Added back fsync to main .g5d file. This should resolve some database corruptions caused by running gap5 on a cluster, saving the gap5 database (but not closing gap5) and then manually copying the database from a different cluster node. Gap4 ---- * The contig editor should now work better with newer X11 window managers. * Fixed a bug in showing the reading frame translations. It overflowed the buffer by 1 byte (a ~2002 bug). Misc ---- * Applied patches from Debian https://anonscm.debian.org/viewvc/debian-med/trunk/packages/staden/trunk/debian/patches/spelling.patch?revision=21433&view=markup https://anonscm.debian.org/viewvc/debian-med/trunk/packages/staden/trunk/debian/patches/hardening.patch?revision=16751&view=markup https://anonscm.debian.org/viewvc/debian-med/trunk/packages/staden/trunk/debian/patches/hardening_format-security.patch?revision=15859&view=markup * The usual round of compiler warning fixes; mostly missing prototypes, casts and unused variables. This also includes two bug fixes: - join_move_bins() now returns non-zero on error. - sam_export_seq() could calculate the wrong index bin number when exporting bam if the contig started at position <= 0 dut to the offset being added to the sequence end position twice. * Added a debugging tool to replay events listed in gap5 log files (staden/trunk/src/gap5/replay_log.tcl). December 2013 - 2.0.0b10 ============= Gap5 Updates ------------ NOTE: Due to the nature of many of these updates, the Gap5 database has had the internal version number increased. This means that while the new Gap5 can read old Gap5 databases, old Gap5s will not be able to read databases created by the latest Gap5 and/or Tg_index. * Find Internal Joins - This has had a major face lift due to the addition of several new features. It uses a tabbed notebook now to avoid the dialogue growing excessively. - More join filtering; by min/max (joined) depth, maximum overlap length, containments vs end/end joins, read-pairs and uniqueness. Uniqueness here refers to only having one link out from each contig end, for example a contig end matching 2 or more other contigs would not be considered as unique. For read-pair filtering each potential match is checked to ensure there are both a minimum number of read pairs and that a minimum percentage of contig-spanning read pairs are between the two specific contigs. - Better control over which contigs to compare. We now have two sets of contigs, A and B, and compare all contigs in set A with all in set B. This is a generalisation of the old "all vs all" and "single vs all" modes. - The Hidden Data search mode now works. - Fewer hits missed in the quick alignment mode. In particular some blatant exact matches were sometimes missing. - Small speed increase. * Contig Editor - Realign Selection feature. Underline a region and this will realign it against the consensus. - The Tag Editor now has Copy and Move buttons, as per Gap4. These even allow moving tags between different editors. - The names panel now allows bulk selection with button-1 click followed by Shift-button-1 to select all reads between the two clicked points. This is particularly powerful when combined with the various Settings -> Group By orderings. When selecting names we can now also (de)select the mate-pair at the same time by using Control+click instead of normal unmodified clicks. (This is also listed in the right-click pop up menu.) - We can now control which list is being updated when clicking on read names. The editor also shows the size of this list and has options to load, save, delete and clear. - The Settings -> Group By dialogue now has a "by sequence" mode. This attempts to sort sequences by similarity to the underlined (selected) sequence fragment. - The sequence search now permits searching within individual sequences, instead of only within the consensus. - More key bindings: - Keypad Enter is now an alternative for the Return key. - Control-S within the search window is the same as next search. - Control-L and Control-R now move pads under the editor cursor left or right. Alt-L/R is similar, but for any base type (be careful). - Control-Z is Undo - Shift-Insert, Shift-Backspace and Shift-Delete act as per their unmodified key presses but keep the right hand portion of the alignment stationary, while moving the left portion instead. - Holding down keys in the editor and allowing auto-repeat to operate should no longer run on after the key is released. - We can now bring up the Template Display (via the Commands menu) centred on a specific consensus base. - Shuffle Pads can now operatate over regions of a contig instead of the entire thing. This is also available within the editor by selecting (underlining) a region and using the Commands menu. The scoring function has been slightly updated to provide better alignments. Also sped up Shuffle Pads (typically 4-5x faster, more so on deep data). * Template Display - We can now selectively filter by library. - The average template insert size is now drawn superimposed on top of the main display. - Tags/annotations can now be displayed as their own track (they are also visible in the Contig Selector). - Improved the calculation of read-pairs. It now considers the bulk of the library to work out the expected orientation and insert sizes. - Spanning read-pairs now get a variety of colours, determined by the other pairing contig record. This helps to visually identify when read-pairs link to a mass of contigs or just 1 or 2 specific contigs. - Substantial speed increases in some modes, especially "accurate mode". This has been achieved by caching the read-pair locations. This information can become outdated by joining, breaking and other edits, but will be automatically recomputed as needed. (Hence the template display speed can temporarily be variable while it's recomputing this cached information.) - Zooming via the mouse wheel is now centred on the mouse cursor. Mouse wheel is now also support on Windows (also in the Contig Editor). - The default mapping quality colouration is now minimum instead of average. * Contig Selector / Lists Contigs - This now shows clipped lengths. The clipped contig lengths are also displayed in the List Contigs window. - There are now options to save and load plots, tying in with the "gap5_cmd fij" command too. - There are now rudimentary tools for grouping contigs into scaffolds in the List Contigs window. Internally we also support contig links, potentially allowing a full graph (as in FASTG), but this is not yet exposed to the GUI. * Lists - Created an extended version of the List viewer for the readings list, showing location of both ends of a read-pair and allowing collation by pairing contigs. This provides an easy way to select and produce sub-lists. Also updated the general list handling to be more robust when containing readings or contigs that have been removed. - Added an in-memory list called "new_contigs". This is automatically appended to for each new contig we create, such as by Break Contig, Disassemble Readings or assembling in new data. - The Search Sequence Names function now generates a list of "#num name" instead of "name", correctly disambiguating cases with duplicate reading names. Similarly with Sequence Search and the seqs_hits list. * Input/Output - There are now File -> New and File -> Import Sequences commands. These allow creation of new databases without needing to run tg_index on the command line (although it may still be desirable due to not needing a GUI running.) - The gap5_export, gap5_consensus, gap5_check (etc) commands are now merged into a single gap5_cmd command using the gap5_cmd syntax. Added shuffle_pads, fij, auto_join and auto_break to the available sub-commands. - Fastq export now automatically strips pads. - ACE import now handles WR{} records, treats clip points -1 as unaligned data, and also handles the lack of DS lines. - Overhauled the GFF import and export code: it now works with gzipped files; GFF tags are now mini-GUIs controlled by the #!acdtag syntax in the GTAGDB; Importing is more liberal when given malformed escape codes. - Export Sequences can now also export in BAM and CRAM format. When exporting in CRAM the consensus sequence is embedded to act as a self-reference. - Temporary files used by tg_index can now honour the TMP_DIR and/or TEMP environment variables. This may be helpful if /tmp is too small. Also changing the sorting algorithm to no longer depend on the external Unix "sort" program. - Improved on attempts to auto-detect manual removal of the BUSY lock file and updating of the gap5 database from multiple simultaneous programs. If this happens the programs should abort before corrupting the database. - Tg_index should be more efficient when indexing the reading names. - Gap5_cmd now opens the database in read-only mode when appropriate. * Other new functions / commands - "Extend Contigs". This looks at the cutoff data at the ends of contigs and un-hides portions if the bulk of the cutoff data is in agreement with each other. - "Pair Reading List" in the Lists menu. This takes a list of read IDs and produces a new list containing those reads plus their mate-pairs. - New function "Bulk rename contig". This permits, for example, renaming from contig* to Contig\1 (\1 being whatever the first * matched in the pattern) or contig* to Contig_%06d with auto-generated names (6 digits with leading zeros). - New function "Reading #numbers to names" list option. - New function "Delete Tags" option to remove all tags of a specific type. - New "Contig Trim" function to clip back straggly low-depth contig ends. - Gap5_cmd auto_break: automatically break misassembled contigs based on a whole slew of alignment / read-pair metrics. * Miscellaneous - Internally we now group 1024 contigs into a single ContigBlock, reducing disk I/O times and speeding up the Contig Selector. - Various speed increases to Delete Contig, Disassemble Readings, Find Read Pairs and the Contig Selector. - Gap5_cmd now opens the database in read-only mode when appropriate. - Tg_index should be more efficient when indexing the reading names. Gap5 bug fixes -------------- Many internal bug fixes not so easily describable have been omitted from this list as they have no single apparent end-user affect. * Added numerous robustness checks to prevent crashes. * Removed a few memory leaks. * Fixed a large category of bugs that surfaced when closing one database and opening a new one without shutting down Gap5 inbetween. * Fixed a crashes in the contig editor and join editor when exiting with the trace display open. * Editor search by position now works when the cursor is not on the consensus. * The editor was sometimes reporting the << and >> sequence orientations incorrectly after joining. This could also occur when exporting back to SAM format. * Editor insertion/deletion into tags now correctly works with Undo in all cases. * Renaming the contig in the editor and then using undo was causing problems with the contig name index. * Bug fixes to contig shift (Control Left/Right arrow in the editor), which could occasionally cause bin start/end errors. * Fixed sporadic crashes after lots of contig joining. * Reference position markers when updated by Join Contigs should behave better; previously they sometimes caused bin "used start/end range are incorrect" warnings. * The Join Editor when invoked from a Find Internal Joins line in the contig selector should now come up at more sensible positions, especially in the case of reverse alignments. * Fixed an error causing Find Internal Joins to miss some blatantly obvious joins. Also tweaked the block-stitching heuristics; typically finding 2% more joins, with slightly lower percentage mismatches. * Fixed an issue with consensus caching whereby after joining we would sometimes get incorrect consensus being used / exported. Caching was also applying multiple times over, causing slow downs. In a related fix the last base would (rarely) be omitted. * Fixed a few errors in the consensus caching code. * Extra checking when importing and exporting annotations, preventing crashes when faced with corrupted data. * Export Contigs is now more robust to various sorts of data corruptions, making it a more viable tool for reconstructing dataabses. * Importing MAQ and Fasta data no longer leaves the template name with random values. Also fixed potential crash in MAQ import. * Fixed error in CAF files where the last quality value per sequence could be loaded incorrectly. * Fixed SAM/BAM output when requesting to fix mate-pair data and only exporting a single contig. * More robust handling of SAM cigar strings starting with I or P operators. * CAF/AFG bug fixes when reading lines longer than 32Kb. * Fixed errors in Map Reads / Import Reads, also updated the name to match the newer bwa options. * Saving consensus quality would sometimes produce incorrect output due to qualities being interpreted as UTF8 codes. * Attempting to save a consensus from a list containing duplicate contigs (specified by different reads within the same contig) no longer creates duplicate consensus output. The contig names are now also output instead of #number. * Check Database can now fix tags that extend beyond the contig extents. * Break Contig was sometimes failing after making correctly making a break. When faced with very long sequences it could also break into too many pieces. * Break contig now ensures the cached number of sequences and annotations are always updated correctly in the child contigs. * Disassemble Readings can no longer corrupt consensus annotations. * Disassembling a set of reads where some reads are invalid (no longer exist) no longer aborts mid-way. * Fixed a memory corruption bug in Shuffle Pads that could cause crashes. It is also more resilient to errors in the input data. * Shuffle Pads would sometimes leave tags in the incorrect location. * The Template Display has better analysis of the consistency of templates that span regions that have been joined together. * Fixed crashes in the Template Display when making joins. * Fixed occasional Template Display crash during Y zooming. * Double clicking on a hyperlinked contig name no longer crashes when that contig doesn't exist any more. Similarly attempting to edit a disassembled/deleted contig via #number or =number no longer dies. * The Contig ID portions of dialogues now always update the start/end ranges correctly when selecting new contigs. * Fixed occasional errors when updating the name and contig B+Tree index, which showed up as being unable to edit contigs by name. * Fixed a bug in the Sequence Search function which caused it to find the same match multiple times if the match started on a pad. * Fixed off-by-one error in Find Repeats and also prevented it from occasionally finding matches off the ends of the contigs. * The Results Manager was displaying incorrect #ID values. * Fixed a bug in decoding of PT/CT tags in SAM files when multiple tags are combined into a single auxiliary field. * Attempting to open a previously deleted contig via #number should no longer apparently work. * Many code tidyups to remove compilation warning messages. * Improved compilation on Ubuntu 11.10 and RedHat. * The code should now compile with zlib-1.2.6 and newer. * Fixed a bizarre Template Display red/blue colour swap on Windows. * More hardening against corrupted databases leading to crashes. * Bug fixes to Find Internal Joins in end-all mode and checking for spanning read pairs. * Fixed various corner cases in using Undo after base deletion in the contig editor (eg when entirely removing a read). * Fixed bug in Contig Extend where zero base extension matches could lead to sequence trimming. * Export Contigs to SAM works better with read-names containing slashes. * Delete Contigs now flushes per contig, reducing memory usage. * Break Contig now duplicates consensus tags when they overlap both left and right contig; this is how Gap4 worked too. Io_lib Updates -------------- * New tool - scramble. This converts between various NGS formats including SAM, BAM and CRAM. Misc ---- * Pregap4: Fixed vector_clip crash on exit caused by tk_utils vs text_utils in linking. * Pregap4: Interactive Clipping now copes with spaces in filenames. * We now support cross-compiling of windows binaries from linux. * Tcl/Tk 8.6 is now used. * Better support for Windows MinGW. * Improved application launcher on MacOS X. * Removed deprecated tg_view application. ----------------------------------------------------------------------------- 5th Dec 2011 - 2.0.0b9 ============ Gap5 Updates ------------ * Code tidy up - removed old defunct C header files. * Minor edits to allow the package to use Tcl v8.5 instead of 8.4. (Locally we're still using 8.4 on unix, but the windows build is on 8.5 now.) Gap5 Fixes ---------- * Fixed parsing of quotes in CAF files. It's still not a full CAF parser, but sufficient for observed real-world data. Also fixed CAF parsing on windows by opening in binary mode. * Fixed key=value parsing in the new SAM tag format. * Removed "default" as the default tag comment. * Fixed a recent bug introduced by allowing contig renaming. The contig names were being added twice to the index, causing problems when later removing them. * Force the mapping quality for fasta/fastq imports to 0 rather than leaving it undefined. * Bug fix to the code that invalidates the consensus cache. 22nd Nov 2011 ============= Gap5 Updates ------------ * Simplified the Save Consensus menu and fixed mishandling of error dialogues. * Renamed Disassemble Contigs to Delete Contigs and rearranged the Edit menu a bit. * Added the ability to rename contigs and to change their starting location. * Improved (hopefully) the choices made in the fast-mode Find Internal Joins. This should remove the occasional missed match. * Code reorganisation: removed function io-reg.h and merged in tg_register.h. (Also fixed restriction enzymes registration in the process.) Gap5 Fixes ---------- * Protect against invalid contig data in get_contig_name() function. This should avoid a crash in certain inconsistent databases. * The editor backwards sequence search was missing maybe 1 in 1000 searches. * Fix to the editor From File search so it only steps through entries for the current contig. * Attempt to avoid crashes when running out of memory in edview_visible_items(). * Fixed bug in template depth display due to the inconsistant colour being set to zero. * Added back the count of the number of sequences indexed in SAM (tg_index). Somehow this got lost in a recent update. * More unpadded coordinate fixes (padded calculation this time). 4th Nov 2011 ============ Gap5 Fixes ---------- * Changed unpadded GFF coordinates to agree with the new unpadded coords in the editor: base 1 is the left base, regardless of where the contig start coordinate is. This fixes both GFF export and GFF import. (Note it breaks it for users expecting gap5 to preserve reference based coordinate systems.) * Replaced RT with CT for consensus tags in SAM I/O. * Fixed Check Database in fix mode to actually fix bin parenting issues, rather than failing to commit the changes. * Improved error handling in contig_seqs_in_range2. 3rd Nov 2011 ============ Gap5 Fixes ---------- * Fixed potential bug in joining contigs causing it to fail to delete the old right hand contig. (We have seen this, but not 100% sure this fixes it.) Also updated Check Database to be able to fix these problems. * Fixed a rather common crash & assertion failure in the contig editor (caused by mismatching reference counting on copy-on-write objects). * Robustness improvements: consensus when faced with corrupted databses and the contig selector when trying to draw zero contigs. * Disassemble Contigs now correctly unpairs reads too. This was leading to crashes before. Also this function now correctly flushes changes to disk. * Shuffle Pads should no longer cause some sequences to get out of alignment. * When quitting the Join Editor and not making a join, it would only offer to save changes to 1 of the 2 contigs. It now does both. * The differences line in the join editor should no longer find false matches when searching backwards. Misc ---- * Bug fixed the "File does not exist" error dialogue 1st Nov 2011 ============ Gap5 Updates ------------ * Added an option to Break Contig at a specific position within the contig editor. * Tag directions are now stored in the database, and can be edited/set using the Tag Editor within the contig editor. * tg_index now has a "-v version" option to request generating older format gap5 databases. * The contig editor now allows "n" or "-" to be typed in. Also added Insert keybinding as for insertng pads ("i" still works). Gap5 Fixes ---------- * The recent consensus change to call Ns was bugged and could cause them to appear elsewhere. Check Database in fix mode will now also clear any cached consensus. * Fixed a bug in Export Contigs to SAM format involving the handling of template names. It could sometimes cause a crash. * Fixed issues with tag parsing in SAM. 25th Oct 2011 ============= Gap5 Updates ------------ * Protect against attempts to create annotations off the ends of contigs (in cutoff). * New function: Disassemble Contigs (needs more testing). * New function: Lists -> Contigs to Readings * Bulk trimming in the editor using < and > bindings. * Added grouping by base type to the contig editor. * Removed contig editor's cache of the contig structure. This is just an internal change, but it avoids a potential cause of inconsistencies. * Added the ability to copy and paste contig names as well as reading names from the editor window. Also rebound Button-2 to be copy by #number, with Button-1 still being "name". Gap5 Fixes ---------- * Major Join Editor bug fix. If editing cursor is not visible and lock mode is not enabled, the save while joining caused the contigs to shift positions, breaking alignment. * Fixed the consensus when consisting soley of reads of N. * It's no longer possible to attempt a join to itself. (Could be achieved before by using multiple join editor windows up simultaneously.) * Improved robustness of Disassemble Readings when given a list of sequence record numbers that don't exist or aren't sequences. * Fixed editor redisplay bugs when edits are made in a join editor being updated in another window. * Fixed typo in editor. 18th Oct 2011 ============= Gap5 Updates ------------ * Added the ability to copy and paste contig names as well as reading names from the editor window. Also rebound Button-2 to be copy by #number, with Button-1 still being "name". Gap5 Fixes ---------- * Fixed a Disassemble Readings corruption that could leave zero-read contigs in some cases. * Added No.Annotations to the copy buffer of the List Contigs window. * Fixed some caching bugs with the B+Tree code, showing up as crashes or corruptions. * Bug fixes to the new SAM tag exporting. - Blank tags no longer get an additional '|' character. - Consensus tags are now sorted correctly, removing the need to use samtools sort. 13th Oct 2011 ============= Gap5 Updates ============ * The contig editor now has functions to select and deselect all sequences at a particular consensus column (or overlapping or within a given range). * Find Read Pairs now has an option to filter the results to only display contig pairings spanned by more than a certain number of read-pairs. * Added Check Assembly function. This compares the used/visible portion of a sequence against the consensus to identify sequences that align badly. (It doesn't yet have the gap4 functionality of aligning the cutoff data too.) * Added experimental code for importing and exporting tags in the latest SAM format. This is still ongoing work, and an ongoing discussion on the samtools-devel mailing list. Gap5 Fixes ========== * Using # in the contig_name_to_number() function no longer crashes gap5. Instead it figures out what you meant and converts the sequence number to a contig number. * Removed a source of Check Database crashes, although as yet I don't understand the underlying cause. 7th Oct 2011 ============ Gap5 Updates ============ * The contig editor has two new search modes: "depth <" and "depth >" to look for low and high depth regions. * Added a Search From File editor search mode. This is identical to the Gap4 equivalent and reads the same format "gapNav" files. * Improved robustness of databases; crashes while flushing writes should now roll back to the previous state rather than giving a corrupted DB. * The List Contigs window now has a Control-A keybinding. Additionally Copy and Paste should now copy all selected rather than just the first 4Kb or so. * Improved support for "*" in sequence records within SAM. (They get treated as "N" for now, in the absense of any reference.) Also improved error handling for malformed files. * Increased the default size of the tag editor window. Also disabled the line wrapping, so the horizontal scrollbar should be used for long lines. Gap5 Fixes ========== * The editor Join To system will now automatically complement contigs if required. * The join editor now has the top and bottom contigs correctly ordered, once again agreeing with the title bar ("a / b" meaning contig a on top and contig b on the bottom. * The contig editor should no longer keep claiming you have changed data even when you simply scroll along. * Fixed a memory corruption in the consensus caching code, caused when a bin considerably shrinks. * The tags added by the Find Primer-Walk function in the editor are now positioned correctly for both strands (reverse was incorrect before). * Added back the ability to use F11/F12 in the editor for quick tag editing. This was accidentally lost in the 30th Sep release. * Fixed a bug that caused empty Tk error dialogues to appear when clicking on locations with no sequence data within the contig editor, but only after attempting to edit a contig with an invalid name. Sep 30th 2011 ------------- Gap5 Updates ============ * First implementation of Group Readings in the contig editor. This provides options to vertically reorder the sequences by a variety of primary and secondary collations. * When invoking the editor by reading name it now brings the editor up on the first visible base of that sequence, instead of the first potentially-clipped base. * Added a Remove Pad Columns function. It's a faster and simpler alternative to Shuffle Pads, designed specifically to only remove consensus columns entirely made up of pads. * The Restriction Enzyme Plot from gap4 has been added to gap5. This works as expected in gap4 except for the ability to create tags, which can be added at a later stage if desired. * Exporting in SAM format now provides an option to use unpadded reference coordinates rather than the old mode of padded only. This is more alike the pair-wise alignments that are expected from short-read aligners. * The Editor search dialogue window now has Page Up and Page Down keybindings to perform previous and next search (as per Gap4's key bindings). * The editor Trace Display is now aligned against sequences. This means scrolling and dragging also works. In addition the Lock button has been fixed. Gap5 Fixes ========== * Fix to a severe bug in shuffle pads. In rare cases it could introduce a column of pads itself, and then remove it again in the final step. If during this stage it didn't make any other edits then it did not save the data and so the column being removed was incorrect - effectively deleting a real column of bases. We also now check more carefully to prevent similar mistakes. * When using dialogues asking for a single contig and a range within it (eg Save Consensus) it now correctly sets the default start and end positions based on the clipped consensus coordinates, instead of just 1 to contig-length. * It should no longer be possible to duplicate contig names when importing new reads. * Lists containing the same contig multiple times (either explicitly or implicitly by using different read IDs within the same contig) are now filtered out in functions taking lists of contigs (eg Find Internal Joins). * Remove Contig Holes now shuts down editors and updates the Contig Selector upon completion. * Fixed various disassembly related issues. - We now remove the correct reading name entry from the B+Tree when there are multiples with the same name. (We check name,rec pairing) - Fixed an error in the b+tree code when completely removing nodes. It was causing assertion failures in the next save. - Better error handling for when faced with a record number that no longer exists (due to the bug above). We now bring up error dialogues instead of crashing. * Check Database on a single contig now honours the "fix" option. It also now reports the number of attempted fixes to problems found. * Exporting a portion of a single contig in Export Sequences now correctly outputs all the annotations, even if they're outside the desired range (by attached to readings that are overlapping the range). * Removed extraneous newline that sometimes appears in fasta or fastq outputs. * Unpadded consensus coordinates in the contig editor now always start at base 1, regardless of the displayed unpadded starting position. * Fixed some editor sizing issues when using non-standard font sizes. This was showing up as the consensus line sometimes being invisible in the Join Editor. * Removed a few gap5-cache related bugs (assertions, corruptions, crashes). * Complemeted contigs in the Template Display sometimes wrongly caused templates to be flagged as inconsistent. Now fixed. * Fixed a bug with Break Contigs sometimes causing the contig start and end points to be inconsistent. (Usually showing up as scrolling issues.) Sep 14th 2011 ------------- Gap5 Updates ============ * Searching by sequence name or #number in the editor now positions the editing cursor on the first used base instead of the first base (whether or not in cutoff data). * Any case where the editor cursor goes off screen due to using left/right arrow keys or performing a search now scrolls the editor so the last 10 characters are now the first 10 characters, meaning it jumps by almost one screen full. Previously it scrolled such that 10 more characters would appear. * We now disallow tags at the ends of contigs in the "cutoff" portion of a contig. Ie where sequence cutoff data resides, but no more non-cutoff bases exist. It is still permitted to have tags within a "hole" inside a contig, just not at the ends. * The contig editor width and height and the horizontal position of the name / sequence split pane is now remembered if the Settings -> Save Settings menu item is used. Gap5 Fixes ========== * Many fixes to Disassemble Readings, including data corruptions, tag misplacements, and occasionally incorrectly complementing sequence data causing misalignments. * Major overhaul of insertion and deletion of pads in the consensus. These used to insert to or delete from every sequence overlapping that point regardless of whether that position was in the sequence cutoff data. Now we only edit sequences that overlap in used non-cutoff data. * Several more fixes to Break Contig including reference counting errors (which usually showed up as assertion failures). Also fixed tag misplacement errors here too. * Internal change to storage of annotations. If attached to a sequence they now should always be placed in the same internal contig-bin as their associated sequence. This fixes a number of bugs and simplifies some algorithms. Older databases are not restricted in this manner and so the change is backwards compatible. * Moving sequences could sometimes cause them to flip orientation. * Avoided a crash while making a join in the Join Editor. I'm not sure of the exact cause, however sometimes we received a message to move the cursor after the join but with no data found at that point now. * Sequences imported via Assembly -> Import... now have their sequence names indexed, meaning we can search for them by name. * Fixed some reference counting bugs while using the Contig Editor and Join Editors. These typically showed up as crashes and assertion failures. * Removed a memory overrun when running Find Internal Joins or Find Repeats with lots of small contigs. * Complement Contig via the List Contigs window now works. * The program now knows the proper filename of the database when opened using the File -> Open dialogue and browsing to another directory. This was causing errors in Check Database. Aug 11th 2011 ------------- Aug 1st 2011 ------------ Gap5 Updates ============ * Further improvements and checks in Check Database; more checks for bin layouts and parentage, can automatically upgrade bins to v2 database format (with nanno set), checking of in-memory cached data vs on-disk data. * Break Contig now has an option to further split the right-hand contig up if the break caused "holes" to appear. * Also added a Remove Contig Holes command to break contigs around sequence holes. * Removed a lot of the debugging output. It can be reenabled by running "gap5 -debug 1". Gap5 Fixes ========== * Fixes for building on MacOS X. * Fixed a major issue with using Save in the Contig Editor followed by continued editing. The items saved then became "live" and any changes made could end up being automatically written to disk regardless of whether the user did a second save. * Worked around issues with metacity window manager and refusals to raise windows. Ensure that as many dialogues as possible are correctly parented, otherwise metacity can gift focus to a window that isn't even visible. (This is a WM bug.) * The lowest level of Gap5 I/O code no longer simply aborts on an error, but now whinges instead and passes the error up one level. (The calling procedure may still abort though.) * Fixed parsing errors with CAF format; quality lines starting with white space are no longer a problem. * Removed crashes when parsing malformed FASTA files. * The contig-hole detection in Disassemble Readings now checks "visible holes" by looking at the sequence cutoff values, rather than a hole being defined as no data at all. * Further break contig bug fixes: - Overlapping bins were causing a variety of issues, from miscalculating contig start/end to moving annotations incorrectly. - Improved tag clipping at the ends of contigs. - Fixed cache reference counting issues. - Fixed out by one error in determining whether to move data to right contig. * Several bug fixes involving detection of empty bins. * Removed various bugs with allocating and deallocating tags (caused by misunderstanding my own code and the meaning of the "idx" field). * Removing tags via the editor was still leaving them in bin hierarchies, causing corruptions in some cases. Fixed. * Fixed issues with complementing of cached consensus sequences. July 20th 2011 -------------- Gap5 Updates ============ * Added a gap5_check command. This is a CLI version of Check Database. * Improved debugging tools and checking for validity of data via checksums. * Code reorganisation: merged the tgap and gap5 directories for reasons of sanity and removal of circular dependencies between the two. * The Contig ID component of dialogues now uses the visible start/end portion of a contig instead of just going from base 1 to the contig length. This mainly prevents cases of runs of Ns appearing on the ends of consensus when saving just a single contig. Gap Fixes ========= * Many more bug fixes to break contig. - Breaking at a position where the right contig ends before base 0 (so entirely negative, prior to shifting) was not setting contig boundaries correctly. - Incorrect computation of annotation start coordinates, meaning we could accidentally move them to the right hand contig when they overlapped the left hand contig. - Was Incorrtly claiming bin is empty when it infact is just 1 base long (eg contains only a single bp tag). - More issues with single bp tags being the only thing in a contig: another < vs <= bug. - Fixed an issue where tags were not copied to the right copy. This happens when tags start to the left of the break point that are on a sequence with visible start to the right of the break point. - Fixed an issue where cached consensus sequences were sometimes counted in the number of sequences within a contig. - Added a check to see if breaking at this position will produce a contig with zero sequences. If so abort early rather than create an inconsistency. - Fixed an error in remove_empty_bins where the first non-empty bin recursing down from the root is complemented. It was setting the bin offset incorrectly. * Reverted to the older group-reorder code when reading and writing seq blocks. It's slower, but the new code has subtle bugs. I will fix these later, but for now the SVN trunk needs to be working. * Fixed a contig editor bug where attempting to remove a column in the contig cutoff regions (before first or after last visible base) would work if the first/last base was "*". * Shuffle pads no longer dies when the contig starts at a negative position. * Inserting columns in the consensus now behaves better at extreme places (eg 1st base in far-left cutoff). * Fixed a bug when writing bins that previously contained data but no longer do. * Fixed crashes in Complement Contig in some cases (typically very deep data). * Added bin simple loop detection in the various functions to increment or decrement the number of seqs, annotations and reference position markers. (This shouldn't happen, but it's a robustness improvement.) * When removing a consensus column causes removal of an item from the contig, we now also update the bin and contig extents incase the removal changed them. Similarly inserting columns could sometimes fail to update contig extents. July 8th 2011 ------------- Gap Fixes ========= * Improvements to the check database code - more checks, more fixing. * Tags are now displayed in strict left to right order rather than the broken right to left order as before. * Fixed (contig) reference count leaks. Harmless? * Added protection against malformed tags in SAM files. We trim them to overlap sequences if they go off the edge. * Deleting consensus bases such that entire tags or sequences are removed now correctly updates no.seq and no.anno fields in the bins. * Fixed a bug in undo of tag removal in the contig editor (again). * Added write-lock to bins when removing items. This could cause some data to not be written back to disk if unmodified by another function, or for editor edits to be pushed to main gap5 I/O without hitting Save. (A potentially major corruption) * Fixed bugs in range updates when inserting and removing to sequences. (Minor issue) * Fixed a major corruption involving reuse of bin-range slots. This could cause overwriting of some data once we've managed to remove 2 or more items from a bin and then start to reuse those slots. * Many bug fixes to editor Undo, especially in relation to inserting and removing columns at the first and last bases in sequences or the contig. * Fixed a bug in reference counting in the consensus algorithm, sometimes showing up as crashes in gap5_consensus tool. * Fixed a memory corruption when we remove the last item from a bin. July 1st 2011 ------------- Gap5 Updates ============ * Added a Check Database function. It's slow, but a useful sanity check for me during development, and maybe for others. Gap5 Fixes ========== * Importing from fasta files should be more robust now. * Fixed a stack corruption when importing from ACE. Sequences imported now also have a mapping score of 255. * Fixed a memory corruption in the new consensus algorithm. * Removed several reference count leaks in List Contigs, Save Consensus and consensus iterators. This included things like the consensus computed for Find Internal Joins. * Improved handling of contig identifiers: fixed a crash when given # where is neither a contig or a reading; contig lists now work when the entries are sequence names. * The contig editor now correctly responds to notifications that the program is trying to shut down, asking the user if they wish to save. Formly it would sometimes simply crash. * Fixed another Break Contig bug that caused data to be moved within the contig rather than starting at base 1. This only happened after some combinations of complementing and joining. Jun 23rd 2011 ------------- Gap5 Updates ============ * Sequence Search (main menu, outside of the editor) no longer brings up a separate editor every time the Next button is pressed, instead preferring to reuse existing ones if available. It also underlines the matched sequence in the contig editor. * The contig editor window now colours the sequence names according to the consistency/validity of the templates. The colours are: white = ok pair blue = single ended orange = pair, spanning contigs red = inconsistent orientation grey = consistent orientation, but distance too large or too small. This also required a few tweaks to the colouring of the name display and UI controls. The Quality button now only turns quality grey-scales on and off for sequence bases, not the mapping qualities. Instead the Settings menu has two radio buttons to toggle between template status and mapping quality for the names panel. This only has an effect when in Pack Sequences mode; the one sequence per line mode has room to display both pieces of information and so always does so. * Implemented a simplistic approach for computing unpadded consensus coordinates. This uses the cached consensus sequence, which can now be updated from within the contig editor too (so it may ask to save changes even when it's simply to add more cached data), so it is far faster than gap4. However it is still linear time based on the number of fragments and consensus length. The editor "goto" box in the bottom left still works on padded or reference coordinates as listed by the P or R button, but manually adding the letter 'u' after a number will request unpadded coord. The P/R button hasn't been made P/R/U yet as the display of coordinates will be too slow still. There are more explicit padded vs unpadded options in the search dialogue, or hitting Return in the editor consensus will also show that coordinate. * The Template display now has various quality plots. They're turned off by default as they incur a substantial speed penalty. * The Find Read Pairs plot now has the option to filter the reported hits by the library. By default it uses all. Note filtering slows down the code substantially. * Added the first draft of a Shuffle Pads algorithm, much the same as in Gap4. * Improved editor search UI. Hovering over the Search button in the dialogue window will now highlight which editor of an join editor pair will be searched in. (As before, left-clicking in an editor will change this, only now it's obvious this happens.) Plus the editor cursor of an inactive editor in a join-editor pair is no longer solid, when visible. Instead it is a hollow square. Also fixed control-S/control-R so they don't bring up a separate dialogue window to just hitting the Search button. * Clicking on a base within the tag now displays the summary data of the base underneath it instead of repeating the mouse-over text. This is the same interface as gap4 now. * Added SVN revision numbers to the version strings reported by most of the main programs. * Removed error signal handlers in gap4 and gap5 so that crashes are easier to debug on linux. For some reason calling abort from a signal handler often ends up with a stack that gdb will not list. Gap5 Fixes ========== * Adding new sequences to complemented contigs could create incorrect sequencing positionings if the smallest bin had grown, triggering a new leaf node. Also correted some house-keeping coordinates (start/end used) for complemented bins. 26th May 2011 ------------- Gap4 bug fixes ============== * Fix crash in Find Internal Joins when faces with lots of small contigs and insufficient reserved space for the consensus. Gap5 Updates ============ * Major overhaul of the consensus algorithm. It now allows for the possibility of SNPs. Also added a discrepancy calculation where it compares the number of observed differences against the expected differences given the quality scores. The editor has several new search tools relating to these features. * Added editor Join To menu command for read-pairs that span contigs. The Go To menu item has also been updated to report the observed insert size. * Added an editor method to shift entire portions of an alignment left/right. * Bringing up the join editor should now set the editing cursor to the correct sequence. * Increased the word size in Find Repeats and some other optimisations - now dramatically faster, often 100x improvement. Removing the Contig Selector plots is also now far faster (approx 1500x faster in the extreme case of 1 million repeat hits). * Further improvements to Find Internal Joins speeds. * Various minor compilation improvements, removing warnings and fixing compilation issues with gcc 4.4.4 onwards and use of _FORTIFY_SOURCE. Gap5 Fixes ========== * Removal of bugs in sequence insertion/deletion code, causing assertion failures. Typically observed when inserting entire columns of pads. * Create Tag now works on both editors in a Join Editor. * Fixed issues when shifting individual sequences left/right in the editor. * Cut and pasting of complemented sequences now works. * Improved robustness of specifying malformed contig names (plus allow #contig_rec in addition to the old =contig_rec syntax). * Gap5 now checks the master database version and will no longer automatically start updating individual records to the latest encoding/formats if the database is an older format. This allows testing of newer versions without risking the inability to revert back. 21st Mar 2011 ------------- Gap5 updates ============ * We now keep track of original reference positions during a SAM/BAM import. These can be displayed in the contig editor and we can also go to coordinates by either padded (as before) or reference base coordinates. * The number of annotations is now tracked per bin, and hence per contig, as per sequences. Using this we now also have a far faster algorithm for searching through annotations when very few exist. (The needle in haystack problem.) ----------------------------------------------------------------------------- Staden 2.0.0b8p1, 21st Mar 2011 (SANGER) ================================ General changes --------------- * Various compilation improvements: PPC64 detection for MacOS X; rpath support. Gap5 new features ================= * We no longer need headers (eg @SQ) when reading SAM files. * Improved contig number handling: # now works in addition to =; List Contigs report improved. * Tg_index now automatically removes duplicates marked in a BAM/SAM file. Use tg_index -D to force these to be entered. Gap5 bug fixes -------------- * Major bug fix to moving contigs in the contig selector - it can no longer duplicate contigs and in the process remove an existing one. * Fixed a bug in fasta import where the last sequence in a fasta file often generated a blank contig. * Truncated read system calls now handled in bam reading, instead of interpreting these as EOF. * Use of binary I/O modes on Windows (BAM). * Added support for backslash \ continuation lines in CAF. * Fix for 1bp long sequences and updating the bin ranges. * Fixed a reference counting bug in the contig editor. This sometimes showed up as crashes through assertion failures when saving or making a join. * The consensus cache can no longer return sections of blank N data. This happened when a contig start precisely matched the root bin start point. * Saved settings in various dialogues now write to .gap5rc instead of .gaprc. * Breaking contigs could sometimes leave tags in the wrong contig in certain circumstances. Now fixed. * The template display now correctly starts up showing the start of a contig when that contig does not start as base 1. * The depth plot in the template display should more accurately reflect the actual depth at a variety of zoom levels instead of artificially increasing depth as we zoom out. Gap4 bug fixes -------------- * Fixed a (rare) infinite loop in the trace display code. Staden 2.0.0b8, 8th Feb 2011 ============================= Gap5/tg_index 1.2.11 General changes --------------- * Microsoft Windows version. The code should now compile and run under MinGW/Msys on windows. * MacOS X updates: improved compilation and fixed a few Mac specific display glitches. * Various code tidyups - less compiler warnings, more portable for linux variants (eg Centos). * Removed dependency on samtools. (This also avoids a few samtools related bugs, but hopefully not creating new ones to replace them.) * Removed dependency on IncrTcl, IncrTk, IncrWidgets. These can still be used for one part of Gap4 (prefinish GUI) but the code will build and execute without these now. Gap5 changes ------------ * In-program help should now be working. * A Disassemble Readings option has been added to the main Edit menu. (This performs the same task as in Gap4.) * Tg_index now supports the CAF, fasta and fastq formats. When importing fasta/fastq we just create single-read contigs, so it's simply an easy way of importing consensus sequences or a *few* finishing reads. CAF support will import entire assemblies though. Also improved the CAF exporting code. * First draft of a Find Read Pairs function (as in Gap4). At present read-pair orientation needs some work still, but the basic plot and searching is working. * Internal record numbers are now 64-bit instead of 32-bit, removing the need for reserving sequence record IDs in tg_index (-r option) and allowing for more than 2 billion sequences in a gap5 db. * Contig editor "tag macros" (from gap4) have been added. Use Shift + function key to define a tag macro and then that function key to apply it. * A "readings" list now exists (as in Gap4) which is displayed and can be populated using the contig editor "names" panel. The copying (cut/paste) of read names binding has also changed from left-click+drag to middle-click, now matching Gap4. * Quality value 100 now has a special meaning for the consensus algorithm, as in Gap4. It forces the base to be considered as true (as it's only possible via a manual edit). * More contig editor key bindings: Page up/down (already existed for scrolling in 1Kb) can be modified by Shift, Control or Shift+Control to scroll in 10, 100 and 1000Kb steps; [,] keys for setting base quality to 0 or 100; Shift Up/Down arrow and Control Up/Down arrow for incrementing/decrementing base qualities by 1 or 10. * Editor Delete now only works on pad characters unless Control Delete is used, in order to prevent accidental removal of real data. * Added contig editor "Save Settings" command. * Internal changes to the template display and Tk canvas. * Sped up contig editor when dealing with excessively deep alignments. * Reading names in the contig editor are now be selected for copy and pasting using the left mouse button. * Tg_index now has a -q option to limit the number of unpaired reads held in memory (for the "-p" option). This significantly reduces the memory usage on large data sets, at the expense of longer running times. Bug fixes --------- * Various fixes to compilation: parallel makes, improved DESTDIR support. * Big tidy up on the cache refence counting system, fixing multiple sporadic crashes and rarely even data corruptions. * Fixes to consensus caching sometimes storing corrupted data. * More robust when we run out of disc space. * Import GFF should be more robust. This now also supports "colour=<0-17>" tags to match those used in Artemis. * The insert size in the Libraries panel is now displayed correctly (when filled out) instead of at 1/100th of the size. * Reduced excessive memory usage of tg_index -t on large data sets. Also fixed a few memory leaks and reference count leaks (appear like memory leaks). * SAM export now works correctly when auxillary fields or read-group data is present. * Removed a small memory corruption when shutting down plots. This sometimes caused crashes when quitting the contig editor. * Fixed occasional crash when joining contigs. * Editor searching crash fixes. ----------------------------------------------------------------------------- Staden 2.0.0b7, July 14th 2010 =============================== Gap5/tg_index v1.2.9. Gap5 changes ------------ * Added an Import GFF Annotations option to Gap5. This deals with padded and unpadded data, although for now the GFF types are not used, instead using the "type=;" attribute in the last GFF column to select a gap5 tag type. GFF Export has been improved too. * Tg_index now has support for spliced alignments in SAM/BAM, using the CIGAR "N" character. This isn't fully implemented yet as the read-pairing breaks in this case, but the data at least can be imported now. * Gap5 should now compile under MacOS X, provided the X11 version of Tcl/Tk is used rather than native aqua. * Extra contig-editor search methods - by annotation, by tag type. * Selecting large regions is easier in the contig editor now. It either auto-scrolls at the window edge or we can use shift+click to extend. * Gap5 now has basic primer-walking oligo picking support. (PCR to come later.) * Improvements to SAM support: fixed flags when exporting; tags are supported (via user-defined key=value auxillary data - Zs and Zc record types) in both import/export; faster export; output is now sorted; protection against quality values higher than ASCII ~; now parse the PL field in read-group lines in tg_index. * The Join Editor now displays overlap length and match score, confirming whether we still wish to make a join. Also bug-fixed the align button when one or both contigs didn't start at base position 1. * Two new scripts: gap5_consensus, gap5_export. These wrap up gap5 menu items as non-interactive command line tools. * The contig editor has a Goto... menu to jump to other sequences on this template. * It should be easier to keep track of sequences when scrolling in the editor as it attempts to adjust the Y scrollbar to keep data on screen. Additionally the Y-layout doesn't change so much when scrolling rightwards (although left scrolling still changes Y layout). Improved efficiency by caching some more data. * The contig editor now sorts by sequence technology first and then X coordinate, meaning that ABI capillary sequences are always at the top of the display. NOTE: This requires the platform tag (PL) in SAM/BAM @RG read-group header lines. * Bug fix writing reading names when importing a mixture of data with and without read-groups. * Fixed the Map Reads interface, when adding to contigs that do not start at base 1. Also fixed some memory free issues here. * The Show Diagonal and Clear All commands of the contig selector window now work. The results menu (and Results Manager window) now update too. * Disable a few more options and buttons when in read-only mode. Previously it wouldn't actually have written data, but tried and aborted. * Fixed a rare bug with single base-pair tags vanishing under certainc onditions. Other changes ------------- * [Gap4/Gap5] Updated the primer melting temperature code to use the latest published formulae. * Various compilation improvements: better detection of Large File Support under some linux systems; control over the location of curses/ncurses libraries (and which to use); fixed "make depend" when running from a subdirectory instead of the top src root; forced use of the staden os.h instead of sometimes picking up a copy in io_lib. Staden 2.0.0b6, March 26th 2010 ================================ Gap5/tg_index v1.2.8. This is just a bug-fix release to spot a major problem that slipped through into 1.2.7. Gap5 bug fixes since 1.2.7 -------------------------- * Fixed an error causing crashes when decoding sequence names of varying lengths coming from multiple read-groups. Staden 2.0.0b5, March 22nd 2010 ================================ Gap5 1.2.7 Gap4 4.11.2 This release requires io_lib 1.12.2 or newer. Gap5 changes since 1.2.6 ------------------------ * Numerous contig editor bug fixes: - Major undo overhaul. It should work far better now. - Moving sequences moves tags with them - Issues with saving giving "error -1" resolved. - We can now adjust the read clip points using < and > keys. - Fixed an editing-cache problem where cancelling a join and reopening the join editor sometimes had the old edits retained in memory (but not saved on disk). * Joining and complementing contigs is now handled better by various plots. For example joining two contigs no longer clears the contig selector window and plots, but updates them correctly instead. * Fixed some compilation issues. - libpng problems resolved. - helped compilation when linking against io_lib releases that aren't yet in your LD_LIBRARY_PATH. - LARGEFILE_SOURCE64 definitions removed, which caused problems on Ubuntu 9 (and others?). * Opening a database we do not have write access to (but read access) now works. Read-only mode is more obvious in the title bar too. * BAF export now includes consensus tags. We can also export in CAF too (although it's not a recommended output format). * The consensus can now be saved in fastq format. * Tg_index gained the option to store SAM/BAM auxillary records with "-x". This is experimental at the moment. * Tg_index can now stored unmapped data with the "-u" option, although it is still visible within the contig editor. This is experimental and a work in progress. * Improved SAM output - the data is now written in the same order it was read (assuming no edits). There is also an option to try and fix the flags and mate-pair data when writing out SAM, but be warned this is information substantially slower to compute and output. * Put back the old staden.profile script, but it's now in $STADENROOT/share/staden instead of the main root. Also added a stash binary to wrap up tclsh so old stash scripts should work again. * Various speed ups to the template display. * The editor control-a and control-e keys (beginning and end of sequence) now take heed of whether cutoff data is shown. * Export Contigs now picks sensible filenames when changing format. Other Gap5 Bug fixes -------------------- * Very long sequences (>64kb) could sometimes cause the cached consensus to omit some regions, giving problems for find internal joins and save consensus. * Block attempts to join a contig to itself. * Removed various minor memory leaks. * Inserting bases to sequences could previously rarely cause memory corruptions. * Complement contig no longer moves the used (unclipped) start/end positions of a contig. * Exporting complementing contigs in ace/sam/baf fixes. * Using tg_index -a to add data to an existing database now works when the existing contigs have been complemented. * Reenabled the Results Manager window in normal mode, rather than hiding it for experts only. * Gap5's File->New menu item has been removed, use tg_index to create databases. * Creating a 1bp long annotation in the editor no longer crashes if you haven't dragged a selection to cover 1bp. Gap4 ---- * Alignments in find internal joins fast-mode should have their 5' end aligned better. (Also true for gap5) Staden 2.0.0b4, January 15th 2010 ================================== (Gap5 1.2.6) Gap5 Changes since 1.2.4 ------------------------ * Added support for lzma (via XZ Utils' liblzma library) compression in addition to the existing zlib code. This is about 14% smaller than zlib, although at a cost of 2-3x slower. Use "tg_index -c lzma" to enable this. Also reordered data somewhat for both lzma and libz compression, reducing file size by another ~7% when dealing data mixed from multiple read-groups. * Added an Export Tags function to write GFF data. (Largely untested and experimental.) * Improved BAF output so it now contains tags. * Tg_index now has the ability to select the types of data to store using -d. These can one or more from seq, qual, anno or name (or "all" - the default). This allows for more compact databases at the cost of missing some data. * Substantially rduced the amount of I/O operations needed when reading the aux file. * Sam/Bam @RG records and the RG:Z:* auxillary tags are now parsed. These are used to place sequences into libraries, although we may wish to rename these as read-groups in gap5 too. * Added some simple search tools within the contig editor: by sequence, name (if indexed), consensus quality. * The template display should now be substantially faster at drawing large numbers of sequences. * Gap5 has a simple mapped assembly menu, currently using bwa (which must be installed). Behind the scenes this uses the new tg_index -g option to append to the existing assembly. * Tg_index -a -g (gapped) mode; this assumes that the sam/bam file being added has been aligned against a ungapped copy of the consensus from the gap5 database we are appending too. Tg_index will add gaps to either the existing consensus or the newly input data as appropriate, to merge the two assemblies together. Gap5 Bug fixes -------------- * Various cached consensus fixes. * Removed occasional memory corruptions while editing sequences. * Fixes to the "align" button in the join editor. * Improved saving the consensus, involving contig clip point changes and pad stripping. * Fixed cases of inserting to contigs formed by joining complemented contigs together. * Fixed several sam parsing bugs. * Break contig should produce fewer (hopefully no) inconsistent contigs. * Export Sequences in SAM format no longer shifts the coordinates by 1. * Improved maq long/short format autodetection. Gap4 ---- * Fixed an issue with turning off undo in the "remove pad columns" editor function. * Fixed an ancient bug involving the C to Fortran interface. * Fixed a problem with incorrectly sized trace windows. Staden 2.0.0b3 ============== (internal test only of Gap5 1.2.5) Staden 2.0.0b2, October 16th 2009 ================================= (Gap5 1.2.4) Gap5 Changes ------------ * Tags can be created and/or removed within the contig editor now, rather than just imported. * Gap4's "Sequence Search" function has been added to Gap5, allowing for DNA string matches against either the consensus and/or the sequences themselves. * Name indexing (tg_index -t) now operates much faster (sometimes 100x speed-ups). It also occupies far less space in the gap5 database, but note that this comes at a cost of incompatibility with older Gap5 formats. (This gap5 should be able to load up old Gap5 databases, just not vice-versa.) * (Experimental) The consensus algorithm can now cache the consensus, when in read-write mode. This dramatically speeds up computing the consensus for subsequent functions at a cost of a bit more storage space. * Improvements to the build system, especially on 64-bit machines and RedHat derived systems. The --with-iwidgets=DIR parameter now has more leeway too and works when given either the parent directory or the iwidgets sub-directory. "Make depend" is no longer mandatory either. * Tg_index now attempts to automatically work out the file format (eg sam, bam, ace, baf, etc). The old "aln" default format has been removed. * Tg_index now supports reading sam files provided they have @SQ header lines. In addition to this ace, baf and sam files may now be gzipped. * Tg_index now has faster read-pairing, using temporary files in /tmp. The -f (fast mode) parameter still exists, but should not be so significant an improvement now. * Added a "-r nseqs" option to tg_index. This change, which has been in the code for some time, but commented out, allows tg_index to build gap5 databases in excess of 1 billion reads. (The largest here so far was 1.9 billion.) Do not use though unless tg_index fails or you are going to be indexing a very large genome and need to reserve sequence space. See ChangeLog for more discussion on this. * Tags now interpret "\n" as newline within BAF files. Gap5 bug fixes -------------- * Selecting a region in the contig editor that spans a tag no longer crashes Gap5. * Fixed a crash when highlighting reading some names in the contig editor (buffer overrun). * When exporting to ACE format we now write DS lines again, as they're needed by consed. Also fixed generation of BS segments when adjoining zero-depth regions. * Export to SAM format should generate better behaved flags. Additionally all positions should now be >= 1, even if not positioned that way in gap5 itself. (A shift occurs to ensure this is true.) * BAF files with blank annotations no longer crash tg_index. * (Plus many minor fixes - see ChangeLog) Staden 2.0.0b1, August 7th 2009 =============================== (Gap5 1.2.3) Gap5 Minor changes ------------------ * Added a -f (fast mode) parameter to tg_index. When linking read-pairs this links A' to A but not A back to A'. This reverse link is desireable, but currently causes major I/O bottlenecks on very large data sets. I'll address this later in a better fix, so -f will probably be only a temporary option. * The code can now build without samtools support, although obviously it loses the ability to read .bam files. * Compilation from source is vastly easier, as is the rest of the staden package. Bug fixes --------- * Break contig and join contig are no longer crashing. They also now keep track of the number of sequences in the contigs and break-contig moves annotations where appropriate too. * Fixed a bug that incorrectly caused tags to be considered as sequences in some case, causing crashes. * The mouse-over for the contig editor names display now works better, no longer attempting to display tag information. * Fixed for copy-on-write of seq/anno blocks, sometimes causing crashes when saving the contig editor. * Clicking on an annotation in the editor no longer causes crashes. * Removed buffer overrun in the editor get_number method. Gap5 1.2.2, June 22nd 2009 =========================== Minor bug fix release. Minor changes ------------- * Added a Hide Annotation setting in the contig editor. This is also bound to control-Q (as per Gap4). This allows us a quick way to see the quality values underneath a tag. * Annotion contents are now visible in the editor information line, but the "Tag editor" itself still hasn't been ported over from Gap4. * Changed SAM reading of LB tags to use TG tags. In practice libraries rarely seem to appear directly in the sequence lines, but instead occur in read-groups. In theory we should then check the main read-group header for LB links from there, but for now treating a library as a group (eg a run or a lane) is perhaps more useful than a genuine library grouping. * Lots of internal code tweaking to support newer versions of Tcl/Tk (tested with 8.6b1). For now we still ship with 8.4, but this is the first stage of making the code more portable and easier to build from source. * Extra slider (there's too many I know - it's overdue a redesign) in the template display. This governs the "stacking" y-mode, controlling where the data gets binned into groups. Eg every 1k so that templates 0-1000 are stacked together, 1000-2000bp are below, 2000-3000 below those, etc. Bug fixes --------- * Removed a memory corruption when displaying long sequence tags (> 1Kb). * Removed issues with diagonal lines appearing at the start of the library insert-size distribution plot. * Removed unneeded dependency on C++ (libstdc++.so.5) and FORTRAN (libg2c0.so) libraries. * The contig selector window now internally uses more 64-bit integers. This fixes issues where the total contig length grew beyond 2Gb. * Initialised more elements in some of the data structures. Previously some parts of range_t struct were uninitialised. Hopefully this resolves some of the random ACE related errors (unknown). Gap5 1.2.1, June 15th 2009 =========================== Mostly just a bug fix release. Bug fixes / minor changes ------------------------- * caf2baf now supports annotations. * Fixed a crash when storing sequences with trace names that substantially differ to the read names. * Compiling with optimisation now works correctly. (Previous release was built with debugging and no optimisation, so the errors were not apparent.) Gap5 1.2.0, June 10th 2009 =========================== *INCOMPATIBILITY* The files written by tg_index and read/written by gap5 are not in the same format as those produced by v1.1.x. If you wish to migrate existing gap5 databases then it is recommended that you use the Export Sequences function in 1.1.3 to output in BAF format, and reindex them using tg_index v1.2.0 with the -B option. Key changes ----------- * Major reduction in disk space required. Gap5 databases are now (de)compressed on the fly and so are a fraction of their original size. In most cases they'll be ~20-30% smaller than an input BAM file too. This change has also meant less I/O and in particular fewer random file seeks. Hence Gap5 is better behaved on the Lustre filesystem, although local storage of NFS are still faster. * Minimal support for libraries. This is still work in progress, but the LB tag in sam/bam format is now used to separate sequences into libraries. (More work on this to follow, including better use of this information and adding library support to other input file formats.) * Can now export in ACE format too. * Added a -z option to tg_index to allow user specified block sizes. I'd suggest using this (eg "tg_index -z 64k") on sparse alignment files. * Annotatons (aka "tags" in Gap4) have been added. For now these are visible by colouration, but no interaction is possible yet. The full tag editor is planned for later 1.2.x releases. Bug fixes / minor changes ------------------------- * Fixed a bug in the Export Sequences function. It occasionally missed sequences at the very start of a contig. * Fixed ACE file reading of complemented data. * The file format changes also included better error checking. The encoding of each data type now includes the data type itself (to ensure we've found the expected type of data) and a format code. The format codes should allow for more graceful file format changes in the future. * Fixed a bug in the count of how many sequences are in each contig. Gap5 1.1.3.1, May 15th 2009 ============================ A minor change to support exporting the data in a variety of formats, to facilitate migrating from one Gap5 release to the next. (The next one will have substantially smaller database sizes and faster I/O.) Key changes ----------- * Added an "Export Sequences" function to the main File menu. This can output in fasta, fastq, sam or baf format. Gap5 1.1.3, April 24th 2009 ============================ This version is backwards compatible with v1.1.2 file formats. Key changes ----------- * The contig editor "pack sequences" mode now behaves much better. The editing cursor, mouse overs, editing and selecting all now correctly compensate for the layout change. Additionally the names panel, which was useless in pack sequences mode, now displays a reduced ascii layout of the sequences allowing for the mapping quality to be shaded there and to easily visualise the sequence orientation. * The contig editor cursor (editing cursor, not scrollbar position) is now both visible and dragable from within the template display. * ACE format support in tg_index is back, and it no longer chokes on RT, CT and WA lines. Although at present I do not add this data to the gap5 database. * The contig selector no longer automatically displays at start up if there are more than 1000 contigs. Using the -csel command line option will forcibly override this check (along with the previously implemented -no_csel option to never display the contig selector on startup). * The join editor settings now apply to both editors rather than just one. Undo/Redo apply to the last used editor and on mouse- over they highlight which editor they currently apply to. Bug fixes / minor changes ------------------------- * The compute_ypos() function used for the pack sequences mode of the editor now uses the faster algorithm developed for the template display. Hence "Stacking" mode is now faster. * Undo/Redo now behaves better when multiple editors are in use on the same contig. Similarly the edits are redrawn instantly in other editor views. * (Transparent to users, for now.) The initial implementation of annotations is in place. This is listed as a minor change for now as currently there are no user-defined ways to add tags to the database. Warning: this will lead to a file format change soon. Gap5 1.1.2, April 3rd 2009 =========================== Features -------- * The template display now sports a "Filter" button. This allows certain types of data to be filtered in/out by mapping quality, template consistency, whether it spans contigs and whether single/paired. (Future plans here include by ligation and/or instrument type.) * The template display Y-mode of "stacking" should now be MUCH faster when given deep data sets. * Added the ability to select regions of a sequence or a reading name from the contig editor so that cut and paste works. (From the editor, but not into it yet.) * The number of sequences in a contig is now displayed in the contig selector and contig list windows. Bug fixes / minor adjustments ----------------------------- * The template display crosshair now correctly displays the Y coordinate in the bottom status line. * Fixed a bug in the consensus algorithm; the last base was incorrect when the contig was 1 base longer than an exact multiple of 1024bp. * Sped up the Save Consensus command when dealing with many contigs. * Tweaked the Y-spread function of the template display so that multiple sequences with both identical X and Y coordinates now get spread apart. * The contig editor now instantly displays the impact of making insertions or deletions instead of only correctly displaying all sequences on the next scroll. * Fixed an issue of opening contigs when given a reading name instead of a contig name. * The contig editor sequence no longer vanishes temporarily when scrolling the sequence names. Gap5 1.1.1, March 19th 2009 ============================ staden-2.0.0b11-2016-src/ChangeLog0000644000031500020650000264460412707372071014751 0ustar jkbteam117======================================================================== RELEASED 2.0.0b11-2016 ------------------------------------------------------------------------ r4067 | jkbonfield | 2016-04-20 12:04:17 +0100 (Wed, 20 Apr 2016) | 2 lines Changed paths: M /staden/trunk/src/eba/conf.c Due to io_lib changes, change from min() to MIN(). ------------------------------------------------------------------------ r4065 | jkbonfield | 2016-04-19 14:56:02 +0100 (Tue, 19 Apr 2016) | 7 lines Changed paths: M /staden/trunk/src/README.build Fixed io_lib version number needed. This may not be absolutely correct (no doubt a few versions before is also fine), but for certain it doesn't work with the stated version number and I don't have time to exhaustively check which version is new enough. ------------------------------------------------------------------------ r4058 | jkbonfield | 2016-03-24 10:26:12 +0000 (Thu, 24 Mar 2016) | 5 lines Changed paths: M /staden/trunk/src/gap5/interval_tree.c Interval_tree and interval_node no longer have typedef twice. This tripped up early gcc versions (4.4 is fine, 4.1 is not). Bug reported by Martin Mokrejs. ------------------------------------------------------------------------ r4045 | jkbonfield | 2016-03-21 12:49:04 +0000 (Mon, 21 Mar 2016) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5_cmd.tcl Fixed broken commit r3930 in gap5_cmd.tcl. This caused a syntax error. ------------------------------------------------------------------------ r4021 | jkbonfield | 2016-02-23 14:40:25 +0000 (Tue, 23 Feb 2016) | 7 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tg_tcl.c Fixed tcl_read_depth call to actually compute the depth rather than use the unfinished tracks. Added copy_refpos function to C and Tcl. At present these are unused, but being present in Tcl means we can use these during debugging or experimentation within the Tcl console. ------------------------------------------------------------------------ r4020 | jkbonfield | 2016-02-23 12:37:49 +0000 (Tue, 23 Feb 2016) | 2 lines Changed paths: M /staden/trunk/src/gap5/ace.c M /staden/trunk/src/gap5/baf.c M /staden/trunk/src/gap5/fasta.c M /staden/trunk/src/gap5/import_gff.c M /staden/trunk/src/gap5/tg_index.c M /staden/trunk/src/gap5/tg_index_common.c D /staden/trunk/src/gap5/zfio.c D /staden/trunk/src/gap5/zfio.h Removed zfio.c in favour of io_lib's copy. ------------------------------------------------------------------------ r4016 | jkbonfield | 2016-02-22 11:43:26 +0000 (Mon, 22 Feb 2016) | 4 lines Changed paths: M /staden/trunk/src/copy_reads/copy_reads.c M /staden/trunk/src/gap5/do_fij.c M /staden/trunk/src/gap5/tg_index.c M /staden/trunk/src/primer3/src/ntdpal_main.c M /staden/trunk/src/primer3/src/primer3_lib.c Applied Debian spelling patch: https://anonscm.debian.org/viewvc/debian-med/trunk/packages/staden/trunk/debian/patches/spelling.patch?revision=21433&view=markup ------------------------------------------------------------------------ r4015 | jkbonfield | 2016-02-22 11:33:20 +0000 (Mon, 22 Feb 2016) | 6 lines Changed paths: M /staden/trunk/src/gap4/gap-error.c M /staden/trunk/src/gap4/show_relationships.c M /staden/trunk/src/system.mk.in Applied debian hardening patch: https://anonscm.debian.org/viewvc/debian-med/trunk/packages/staden/trunk/debian/patches/hardening.patch?revision=16751&view=markup https://anonscm.debian.org/viewvc/debian-med/trunk/packages/staden/trunk/debian/patches/hardening_format-security.patch?revision=15859&view=markup ------------------------------------------------------------------------ r4014 | jkbonfield | 2016-02-22 11:29:21 +0000 (Mon, 22 Feb 2016) | 4 lines Changed paths: M /staden/trunk/src/gap4/contig_editor.tcl Fix to cope with newer window managers. The contig editor should no longer appear at zero height. ------------------------------------------------------------------------ r4002 | jkbonfield | 2016-02-03 18:08:33 +0000 (Wed, 03 Feb 2016) | 2 lines Changed paths: M /staden/trunk/src/gap5/consen.tcl M /staden/trunk/src/gap5/contig_id.tcl Fixed a bug where using the contig selector or contig list to fill out a contig name in a dialogue box, without then doing anything else at all except hitting OK in that dialogue, could cause the contig name validity check to fail. ------------------------------------------------------------------------ r3999 | daviesrob | 2016-01-25 10:20:34 +0000 (Mon, 25 Jan 2016) | 12 lines Changed paths: M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/auto_break.c M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/contig_extend.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/do_fij.c M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/export_snps.c M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/find_haplotypes.c M /staden/trunk/src/gap5/gap_canvas_box.c M /staden/trunk/src/gap5/interval_tree.c M /staden/trunk/src/gap5/interval_tree.h M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/str_finder.c M /staden/trunk/src/gap5/tag_plot.c M /staden/trunk/src/gap5/template_display.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_tcl.c M /staden/trunk/src/gap5/tman_interface.c Fix some compiler warnings. Mainly unused variables, plus a couple of missing prototypes. Includes two bug fixes: join_move_bins now returns non-zero on error. sam_export_seq could calculate the wrong index bin number when exporting bam if the contig started at position <= 0 dut to the offset being added to the sequence end position twice. ------------------------------------------------------------------------ r3998 | daviesrob | 2016-01-20 12:08:13 +0000 (Wed, 20 Jan 2016) | 5 lines Changed paths: A /staden/trunk/src/gap5/replay_log.tcl Add basic script to allow replaying of events in gap5 log files. Incomplete, but good enough for tracking down bugs with pair_rec updates and shuffle_pads. ------------------------------------------------------------------------ r3997 | daviesrob | 2016-01-19 16:41:51 +0000 (Tue, 19 Jan 2016) | 15 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/tg_sequence.c Prevent use of uninitialised values in shuffle_pads. validate_clip_regions goes through a list of annotation record numbers that is passed in to it. It's possible that the annotations have been removed beforehand, so it needs to check the result of anno_get_position to ensure that it has set start, end and crec. Possibly related: Ensure that sequence_set_left, sequence_set_right sequence_set_left_no_invalidate and sequence_set_right_no_invalidate do not set a clip point that is outside the extents of the sequence. It's unclear if this can be made to happen in normal use of the contig editor, but it did happen when tracking down the problem in validate_clip_regions. ------------------------------------------------------------------------ r3996 | daviesrob | 2016-01-19 14:14:48 +0000 (Tue, 19 Jan 2016) | 42 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_gio.c M /staden/trunk/src/gap5/tg_gio.h M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h M /staden/trunk/src/gap5/tg_tcl.c Fix bin corruption caused by updates to read pairs spanning two contigs. Updating information on read pairs could lead to bin records being updated differently in two or more child IOs. This could cause database corruption when the child IOs were flushed and the bin data overwritten. The data being updated were the cached location of read pairs, and pair_rec which is a pointer to the other read in a pair. The location information is fixed by simply not updating it on the paired read (it was only being invalidated, anyway). This is safe as sequence_get_range_pair_position includes sufficient checks to ensure that the information is still valid. Updates to pair_rec on the paired read are no longer made while editing but instead deferred until cache_flush is called. At this point the changes are applied by new function apply_pair_rec_updates in tg_cache.c. This function updates any bins affected both in the base IO and also in child IOs, so all copies of the data should be consistent. gio_child and gio_close are updated to maintain a linked list of child IOs to allow apply_pair_rec_updates to iterate through all of the children. Between an edit being made and 'save' being pressed, there is a problem with pair_rec possibly pointing to an unmapped read. Some other changes have been made to deal with this possibility: * sequence_cmd gains a 'get_mapped' function to allow TCL to check for unmapped reads. * The contig_editor tcl function was using the base IO to get sequences when the -reading or -reading2 options were used. This was incorrect, it now uses the child IO instead. It also checks that the sequences are mapped. * sequence_get_pair checks that the paired read is mapped. * edSetCursorPos to a sequence position checks that the sequence is mapped. * ListEditMultiUpdate ignores unmapped sequences. It's likely that more edge cases remain, but the changes above fix the ones seen so far. ------------------------------------------------------------------------ r3959 | jkbonfield | 2015-09-24 17:34:52 +0100 (Thu, 24 Sep 2015) | 14 lines Changed paths: M /staden/trunk/src/gap5/assemble_single.tcl M /staden/trunk/src/gap5/fasta.c M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tg_index.c M /staden/trunk/src/gap5/tg_index.h Added a default quality to use for bases without quality. This defaults to 3 and is used by fasta and SAM without qual. (Maybe there are other formats to do.) In the GUI this is now controllable via an additional entry box. In the C code, this is -ve to indicate a *default* value and positive to indicate an override value, used for fastq only at present. This permits us to import a fasta/fastq set of consensus sequences and forcibly set confidence high (even to 100, forcing consensus) or low as desired irrespective of what the actual fastq qualities claim. Useful for manipulating consenusii. (jkb) ------------------------------------------------------------------------ r3934 | jkbonfield | 2015-07-02 17:06:58 +0100 (Thu, 02 Jul 2015) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_utils.c Fixed u72intw with the same fix that appears to already be in s72intw. When decoding a value > 31bits it wrapped around to become negative as the shift operator is applying on int and not int64_t. ------------------------------------------------------------------------ r3931 | jkbonfield | 2015-07-02 12:13:10 +0100 (Thu, 02 Jul 2015) | 2 lines Changed paths: M /staden/trunk/src/Makefile.in Fixed a missing dependency, causing parallel makes to sometimes fail. ------------------------------------------------------------------------ r3930 | jkbonfield | 2015-07-02 12:09:18 +0100 (Thu, 02 Jul 2015) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/newgap5_cmds.c Revert accidental commit of shuffle pads changes in the last commit. These introduced compilation errors due to a partial update. ------------------------------------------------------------------------ r3925 | jkbonfield | 2015-06-04 11:27:40 +0100 (Thu, 04 Jun 2015) | 5 lines Changed paths: M /staden/trunk/src/gap5/find_haplotypes.c M /staden/trunk/src/gap5/find_haplotypes.h M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h M /staden/trunk/src/gap5/tg_contig.c Fixed Find Haplotypes left/right settings when faced with inconsistent data. Also made it so that the various parameters are adjustable. ------------------------------------------------------------------------ r3921 | jkbonfield | 2015-05-29 12:07:41 +0100 (Fri, 29 May 2015) | 7 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl M /staden/trunk/src/gap5/gap5rc Fixed the template display auto-scrolling. It wasn't taking into account the contig start location when computing the scrollbar position. Also made the margins for when to scroll and how much by adjustable in the gap5rc. ------------------------------------------------------------------------ r3831 | jkbonfield | 2015-02-23 16:52:09 +0000 (Mon, 23 Feb 2015) | 10 lines Changed paths: M /staden/trunk/src/gap5/cs-object.h M /staden/trunk/src/gap5/fij.c Auto-join now honours the -min_overlap and -max_overlap parameters. This is important for cases where we have two very long contigs (L1, L2) both overlapping a short contig S. We find the two short matches (L1/S and L2/S) and probably didn't even attempt to detect L1/L2 overlap due to -max_overlap. After automatically joining L1+S however we then have L1+S / L2 due to inheriting the overlaps during merging. We now recheck max_overlap before each and every alignment. ------------------------------------------------------------------------ r3830 | jkbonfield | 2015-02-23 11:44:09 +0000 (Mon, 23 Feb 2015) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Removal of debugging output ------------------------------------------------------------------------ r3829 | jkbonfield | 2015-02-23 11:28:48 +0000 (Mon, 23 Feb 2015) | 3 lines Changed paths: M /staden/trunk/src/Misc/Makefile M /staden/trunk/src/abi/Makefile M /staden/trunk/src/alf/Makefile M /staden/trunk/src/convert/Makefile M /staden/trunk/src/copy_reads/Makefile M /staden/trunk/src/eba/Makefile M /staden/trunk/src/find_renz/Makefile M /staden/trunk/src/g/Makefile M /staden/trunk/src/gap4/Makefile M /staden/trunk/src/get_scf_field/Makefile M /staden/trunk/src/global.mk M /staden/trunk/src/haplo/Makefile M /staden/trunk/src/init_exp/Makefile M /staden/trunk/src/make_weights/Makefile M /staden/trunk/src/mutlib/Makefile M /staden/trunk/src/polyA_clip/Makefile M /staden/trunk/src/prefinish/Makefile M /staden/trunk/src/qclip/Makefile M /staden/trunk/src/screen_seq/Makefile M /staden/trunk/src/seq_utils/Makefile M /staden/trunk/src/spin/Makefile M /staden/trunk/src/stops/Makefile M /staden/trunk/src/text_utils/Makefile M /staden/trunk/src/tk_utils/Makefile M /staden/trunk/src/tracediff/Makefile M /staden/trunk/src/vector_clip/Makefile Fixed an issue in "make depend" not working in all cases. Reran to update our local Makefiles. ------------------------------------------------------------------------ r3828 | jkbonfield | 2015-02-23 11:25:53 +0000 (Mon, 23 Feb 2015) | 2 lines Changed paths: M /staden/trunk/src/gap5/find_haplotypes.c Fixed minor compiler warning. ------------------------------------------------------------------------ r3827 | jkbonfield | 2015-02-23 11:25:32 +0000 (Mon, 23 Feb 2015) | 3 lines Changed paths: M /staden/trunk/src/gap5/Makefile Added interval_tree to Makefile. (Also minor updates caused by make depend) ------------------------------------------------------------------------ r3826 | jkbonfield | 2015-02-20 17:52:19 +0000 (Fri, 20 Feb 2015) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Allow for dotter -q NUM -s NUM ------------------------------------------------------------------------ r3825 | jkbonfield | 2015-02-20 16:28:00 +0000 (Fri, 20 Feb 2015) | 8 lines Changed paths: M /staden/trunk/src/gap5/find_haplotypes.c A /staden/trunk/src/gap5/interval_tree.c A /staden/trunk/src/gap5/interval_tree.h Find Haplotypes revamp. - Read pairs are now considered. - Better merging of haplotype strings. Instead of aggressive merging at time of collation, we only early-merge exact dups and then merge by frequency after the full data has been gathered. Also added an interval tree implementation (used in the new haplotype code). ------------------------------------------------------------------------ r3824 | jkbonfield | 2015-02-20 16:25:25 +0000 (Fri, 20 Feb 2015) | 3 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Improved the consensus discrepancy score by taking into account a per-base difference rather than joining all together. ------------------------------------------------------------------------ r3823 | jkbonfield | 2015-02-18 17:42:58 +0000 (Wed, 18 Feb 2015) | 6 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/tk_utils/init.tcl Added a <> binding to the contig editor so that it is considered as a power-click, asking for more dialogue if appropriate. Ie it is considered the same as using the main menu bar. For now this only controls read selection and realignment. ------------------------------------------------------------------------ r3822 | jkbonfield | 2015-02-18 17:32:13 +0000 (Wed, 18 Feb 2015) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Fixed end range in Realign Selection dialogue. ------------------------------------------------------------------------ r3821 | jkbonfield | 2015-02-18 17:29:48 +0000 (Wed, 18 Feb 2015) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5rc The Realign Selection option now brings up a user interface if invoked from the main menu, but not when right clicked via the popup menu. ------------------------------------------------------------------------ r3820 | jkbonfield | 2015-02-17 15:16:36 +0000 (Tue, 17 Feb 2015) | 10 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/shuffle_pads.h Fixed rewrite_soft_clips so it doesn't treat clips that fall partially outside the current start..end sub-range as scoring 0. This was causing it to falsely accept some clips. Fixed a bug in the main loop which chunks the contig into sections. It now tracks the number of pads added during update_io so it can validate the soft-clips over the now extended region. Previously some reads at the end of the region were not validated if we introduced a lot of pads. ------------------------------------------------------------------------ r3819 | jkbonfield | 2015-02-17 12:38:31 +0000 (Tue, 17 Feb 2015) | 3 lines Changed paths: M /staden/trunk/src/gap5/check_assembly.c Improved the Show Information output to include the read name, making it easier to compare two databases. ------------------------------------------------------------------------ r3818 | jkbonfield | 2015-02-17 12:37:43 +0000 (Tue, 17 Feb 2015) | 2 lines Changed paths: M /staden/trunk/src/Misc/array.c M /staden/trunk/src/Misc/array.h Added ArrayConcat() function. ------------------------------------------------------------------------ r3812 | jkbonfield | 2015-02-05 12:42:36 +0000 (Thu, 05 Feb 2015) | 3 lines Changed paths: M /staden/trunk/src/seq_utils/align_lib.c Minor tweak to get_malign_counts() to persuade any non-N base to be counted. This avoids issues with sequences full of N. ------------------------------------------------------------------------ r3811 | jkbonfield | 2015-02-05 12:39:26 +0000 (Thu, 05 Feb 2015) | 9 lines Changed paths: M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/shuffle_pads.tcl Fixed a bug where we could realign data that we had previously realigned in an earlier chunk, but against less depth. This caused misalignments. We now skip data previously aligned, but it has to be included in the malign->contigl struct still for the fresh data to align against. Also added a maximum number of passes field to the GUI. ------------------------------------------------------------------------ r3788 | jkbonfield | 2015-01-14 16:31:34 +0000 (Wed, 14 Jan 2015) | 4 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c Fixed a bug in the tg_index -g mode where it erroneously added extra columns of pads to the contig if an incoming sequence has an insertion 1 base after a pre-existing gap in the consensus. ------------------------------------------------------------------------ r3787 | jkbonfield | 2015-01-14 16:30:21 +0000 (Wed, 14 Jan 2015) | 6 lines Changed paths: M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/seq_utils/dna_utils.c M /staden/trunk/src/seq_utils/dna_utils.h Removed the complementary_base[] and initialisation functions from tg_sequence.c and exported the version from seq_utils lib. The seq_utils copy is now also statically initialised without needed to call the set_dna_lookup() function so we cannot accidentally forget to initialise it. ------------------------------------------------------------------------ r3786 | jkbonfield | 2015-01-13 14:39:15 +0000 (Tue, 13 Jan 2015) | 7 lines Changed paths: M /staden/trunk/src/gap5/tg_sequence.c Added a complementary_base_init function to build the complementary_base[] array and then use this in more places than the one function it came from. This fixes a bug with tg_index -a -g not working due to an complementary_base[] being unset during sequence_insert_bases() call. ------------------------------------------------------------------------ r3778 | daviesrob | 2015-01-06 11:29:22 +0000 (Tue, 06 Jan 2015) | 14 lines Changed paths: M /staden/trunk/src/gap5/quality_plot.c Fix rounding error in qplot_redraw which triggered an assertion failure. Inverted the xzoom factor (xz) so that the x coordinate in the plot can be worked out by multiplying by xz instead of dividing. This seems to fix a rounding error that could make the x position go out of bounds when zoomed out a long way. Multiplying should also be slightly faster. In a belt-and-braces approach, also allocated the xs array one bigger than strictly necessary so any remaining rounding errors shouldn't cause a problem. The assertions on x are adjusted to reflect this. Only one of the xp and xs arrays is used, depending on the value of xz. So now only the one that is needed gets allocated. ------------------------------------------------------------------------ r3772 | jkbonfield | 2014-12-15 10:18:27 +0000 (Mon, 15 Dec 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/g-alloc.c Updated the list of known record types in the debug HeapChecker tool. ------------------------------------------------------------------------ r3767 | jkbonfield | 2014-11-14 11:20:17 +0000 (Fri, 14 Nov 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl The list size is now shown in the contig editor, giving an indication of how many fragments are in each haplotype. ------------------------------------------------------------------------ r3766 | jkbonfield | 2014-11-14 10:27:27 +0000 (Fri, 14 Nov 2014) | 13 lines Changed paths: M /staden/trunk/src/gap5/find_haplotypes.c Reduced complexity in haplotype_str_add(). With long sections this can become over 100x less cpu, and growing more. It is still a linear scan though so needs futher optimisation yet, using a tree instead to find snp overlaps. Also amended it to consider sites with too many discrepancies rather than pure consensus SNP call. Finally, added a minimum count of 2 seqs to filter most of the singleton haplotypes. The minimum count figure isn't yet user adjustable, but should be made so before this becomes production ready. ------------------------------------------------------------------------ r3765 | jkbonfield | 2014-11-14 10:25:31 +0000 (Fri, 14 Nov 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/tk-io-reg.c Improve error messages. ------------------------------------------------------------------------ r3764 | jkbonfield | 2014-11-11 12:32:11 +0000 (Tue, 11 Nov 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Changed highlight disagreements for cutoff data to always show in foreground instead of background (if selected), so it is more easily distinguishable. ------------------------------------------------------------------------ r3762 | jkbonfield | 2014-11-03 09:47:27 +0000 (Mon, 03 Nov 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5_cmd.tcl Fix typo in the trim command, causing it to fail. ------------------------------------------------------------------------ r3761 | jkbonfield | 2014-10-31 14:45:20 +0000 (Fri, 31 Oct 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Delete old haplotype_* lists when creating new ones, so as not to confuse people as to how many haplotypes are present. ------------------------------------------------------------------------ r3760 | jkbonfield | 2014-10-31 14:21:21 +0000 (Fri, 31 Oct 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Added the option to view the readings/haplotype lists on the ednames right click menu. ------------------------------------------------------------------------ r3759 | jkbonfield | 2014-10-31 12:36:37 +0000 (Fri, 31 Oct 2014) | 3 lines Changed paths: M /staden/trunk/src/tk_utils/xcombobox.tcl The popup listbox from the combobox now shares the width from the entry box. ------------------------------------------------------------------------ r3758 | jkbonfield | 2014-10-31 11:20:21 +0000 (Fri, 31 Oct 2014) | 9 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Fixed contig_export_sam (used for SAM, BAM and CRAM formats) to be much faster in excessively deep regions where soft-clipping is being used. Gap5 has to convert from coordinates sorted by object start including soft-clipped bases, to coordinates sorted by first unclipped site (SAM). This sorting could become O(N^2) in the worst case, but is now O(NlogN) - possibly better if soft-clip lengths co-locate. ------------------------------------------------------------------------ r3757 | daviesrob | 2014-10-29 15:32:53 +0000 (Wed, 29 Oct 2014) | 9 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c haplo_hash bug fixes. In cache_dup, ensure that haplo_hash and haplo_timestamp are initialized when duplicating a contig. This prevents a dangling pointer from being left in the parent if haplo_hash is freed in the child. In cache_flush, ensure that haplo_hash is freed from the parent where necessary when flushing a contig block. ------------------------------------------------------------------------ r3756 | jkbonfield | 2014-10-29 15:13:29 +0000 (Wed, 29 Oct 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Fixed a crash when being unable to load an annotation. ------------------------------------------------------------------------ r3755 | jkbonfield | 2014-10-29 15:12:42 +0000 (Wed, 29 Oct 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/Makefile Removed zfio.[ch] as these have been in io_lib for some time and causes compilation problems if attempting to link against a static build of io_lib. ------------------------------------------------------------------------ r3754 | jkbonfield | 2014-10-21 17:24:22 +0100 (Tue, 21 Oct 2014) | 9 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Rewrote the fix for r->end - r->start + 1 == ABS(s->len). Previously I modified s->len, but this breaks all sorts of other things, most notably it makes s->conf - s->seq not equal to s->len, then leading to broken confidence values and also to sequence insertion possibly calling memmove off the end of the buffer. (Oddly not detected by valgrind.) We now fix the far more likely error; r->end instead. ------------------------------------------------------------------------ r3753 | jkbonfield | 2014-10-17 17:01:49 +0100 (Fri, 17 Oct 2014) | 16 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Work around for a bug where some bins are not covered by child bins. Ie: :-----------------------------------: Parent :-------------: Left :------------------------: Right I don't know what causes this yet, but it makes calculate_consensus_simple sometiems find very large bins (the parent) on which to compute the cached consensus, taking a lot of time. For now we simply reject an attempt to compute a very long cached consensus as it is probably not the write thing to do. (This really needs a total rewrite.) ------------------------------------------------------------------------ r3752 | jkbonfield | 2014-10-17 16:43:05 +0100 (Fri, 17 Oct 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Removal of debugging info. ------------------------------------------------------------------------ r3751 | jkbonfield | 2014-10-16 17:40:58 +0100 (Thu, 16 Oct 2014) | 13 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Made contig_insert_base2() more robust with respect to corrupted data or other sources of errors. Previously it just bailed out of the recursion, leaving a half inserted column. This is complicated to deal with and often turns a small problem into a bigger problem. Now it boldly carries on regardless, completing as much as it can, before then returning -1 to the calling function to indicate the failure. Ideally the calling function would execute this in a child io so it can be backed out of to revert the change, but in the absence of this we have at least maintained consistency where able. ------------------------------------------------------------------------ r3750 | jkbonfield | 2014-10-16 16:48:56 +0100 (Thu, 16 Oct 2014) | 13 lines Changed paths: M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/dis_readings.tcl M /staden/trunk/src/gap5/editor_view.c A /staden/trunk/src/gap5/find_haplotypes.c A /staden/trunk/src/gap5/find_haplotypes.h M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/tclIndex M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tkEditor.c M /staden/trunk/src/gap5/tkEditor.h First draft of a new haplotype finder. It replaces the Sort By Sequence mode in the contig editor as well as generating lists of read IDs per haplotype and creating a master "haplotypes" list of lists. Disassemble readings now knows how to handle list of lists, so that it disassembles each sub-list into its own set of contigs. There is more to do on this to tidy it up: handling read-pairs, optimising it for larger contigs, improving the consensus algorithm to label more things as SNPs by avoiding the dominance of depth. However it's a good starting point and users are already wanting to use it so we'll see how it goes in the current state. ------------------------------------------------------------------------ r3749 | jkbonfield | 2014-10-13 12:38:17 +0100 (Mon, 13 Oct 2014) | 9 lines Changed paths: A /staden/trunk/src/tk_utils/func_edit.tcl M /staden/trunk/src/tk_utils/tclIndex A new debugging tool: func_edit From the console (type "con" into the Gap5 Error window) you will be able to type "func_edit UpdateReadingDisplays", for example, to locally change the function definition without needing to quit and restart the program. All changes are temporary. ------------------------------------------------------------------------ r3748 | jkbonfield | 2014-10-07 17:45:30 +0100 (Tue, 07 Oct 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/import_contigs.tcl M /staden/trunk/src/gap5/tclIndex Same fix as previous: Import Reads no longer clears "readings" list. ------------------------------------------------------------------------ r3747 | jkbonfield | 2014-10-07 13:58:37 +0100 (Tue, 07 Oct 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/assemble_single.tcl Replace the call to PostLoadSetup with a lighter-weight setup, so we don't clear "readings" list on loading new contigs. ------------------------------------------------------------------------ r3741 | jkbonfield | 2014-09-22 15:13:56 +0100 (Mon, 22 Sep 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/hash_lib.c More compiler warning removal; this time clang. ------------------------------------------------------------------------ r3740 | jkbonfield | 2014-09-22 14:55:49 +0100 (Mon, 22 Sep 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/actf.c M /staden/trunk/src/gap5/auto_break.c M /staden/trunk/src/gap5/b+tree2.c M /staden/trunk/src/gap5/editor_search.c M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/export_snps.c M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/g-alloc.c M /staden/trunk/src/gap5/qualIO.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/str_finder.c M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_index_common.c M /staden/trunk/src/gap5/tg_library.c M /staden/trunk/src/gap5/zfio.c M /staden/trunk/src/seq_utils/align_lib.h Various compiler warnings removed. Most are of the form "variable x may be used uninitialised" and most of the time it is untrue, however there are a few legitimate coding errors fixed too. ------------------------------------------------------------------------ r3739 | jkbonfield | 2014-09-22 14:02:43 +0100 (Mon, 22 Sep 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c Removed append_int as this is now exported from libstaden-read (bam.c). ------------------------------------------------------------------------ r3730 | jkbonfield | 2014-09-11 18:26:02 +0100 (Thu, 11 Sep 2014) | 9 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Fixed memory leak and slow down caused by last patch to STR finder calling. Added seed_malign_region() to perform a rudimentary screen on the heterozygous consensus to only request realignment in regions that are heterozygous in nature. TODO: Make this an optional 3 way - all regions, all hets, het indel only. ------------------------------------------------------------------------ r3729 | jkbonfield | 2014-09-11 18:07:41 +0100 (Thu, 11 Sep 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/str_finder.c TEST_MAIN2 version of main() for testing on larger inputs, read from stdin rather than argv[1] as a string. ------------------------------------------------------------------------ r3727 | jkbonfield | 2014-09-10 17:35:40 +0100 (Wed, 10 Sep 2014) | 10 lines Changed paths: M /staden/trunk/src/gap5/str_finder.c Fixed the STR finder to not step forward by 'extra' bytes as an optimisation. It was causing overlapping repeats to sometimes be missed by 1 bp. Eg: $ ./a.out CTAAATAAATAAAC 2 .. 12 AAATAAATAAA (Should be 1 .. 12) ------------------------------------------------------------------------ r3726 | jkbonfield | 2014-09-10 16:56:35 +0100 (Wed, 10 Sep 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_tcl.c Fixed a crash introduced in r3497, triggered when using control-left or right arrows in the editor to move a sequence location. ------------------------------------------------------------------------ r3725 | jkbonfield | 2014-09-10 11:25:50 +0100 (Wed, 10 Sep 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/str_finder.c Fixed buffer underrun. ------------------------------------------------------------------------ r3724 | jkbonfield | 2014-09-09 15:29:18 +0100 (Tue, 09 Sep 2014) | 8 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Fixed rewrite_soft_clips() to correctly trim when handling overlapping STRs. Previously it could reset s->left/right multiple times, overwriting the result each time, instead of taking the inner-most union of the values. Also tidied up the code to not needlessly compute consensus and STRs on the first pass. ------------------------------------------------------------------------ r3723 | jkbonfield | 2014-09-08 16:24:07 +0100 (Mon, 08 Sep 2014) | 39 lines Changed paths: M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/shuffle_pads.c A /staden/trunk/src/gap5/str_finder.c A /staden/trunk/src/gap5/str_finder.h A /staden/trunk/src/gap5/utlist.h Added a short tandem read detector. This looks for repeated strings between 1 and 8 bases long and returns a utlist of start..end ranges. These may be overlapping in some situations. Eg: $ ./a.out TGCAGAGCAGAGAGAGGGT 1 .. 11 GCAGAGCAGAG 8 .. 15 AGAGAGAG 15 .. 17 GGG Compile str_finder.c with TEST_MAIN to get a command line tool. Within Shuffle Pads this is used to identify STRs that overlap a heterozygous indel region and then in turn to adjust the soft-clipping of any reads that do not span that region as they cannot be relied upon to indicate the copy number. Eg: S1 GATCGGACGAGAG S2 GATCGGACGAGAGAGAGAGAGT S3 GATCGGACGAGAGAGAGAG**TCGGAC S4 GGACGAGAGAGAGAGAGTCGGAC S5 CGAGAGAGAGAG**TCGGAC S6 AGAGAGAGTCGGAC We have subseq of GAGAGAGAGAG** vs GAGAGAGAGAGAG. The first and last (S1 and S6) sequences do not span and so we do not know which allele they match. Specifically as the pad is at the right hand end, the alignment of S6 gives incorrect weight to the consensus as it is stating AG when it may actually be ** at that point. By identifying the repeats we can soft clip as follows: S1 GATCGGACgagag S2 GATCGGACGAGAGAGAGAGAGT S3 GATCGGACGAGAGAGAGAG**TCGGAC S4 GGACGAGAGAGAGAGAGTCGGAC S5 CGAGAGAGAGAG**TCGGAC S6 agagagagTCGGAC ------------------------------------------------------------------------ r3722 | jkbonfield | 2014-09-05 15:31:51 +0100 (Fri, 05 Sep 2014) | 8 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Switched to using older method of handling ONT consensus (based on a one-liner perl/awk combo). It just has a single parameter for how much more likely it is to have overcall vs undercall. This is simple to understand and more robust. It corrects issues with the old system, which was causing * in columns of illumina data to be downweighted too much. ------------------------------------------------------------------------ r3721 | jkbonfield | 2014-09-05 15:29:36 +0100 (Fri, 05 Sep 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/qualIO.c Bug fixes the insertion/deletion counting in List Base Confidence (they were reversed). Also updated it to report percentages. ------------------------------------------------------------------------ r3719 | jkbonfield | 2014-09-05 12:01:38 +0100 (Fri, 05 Sep 2014) | 9 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Changed the simple consensus qualities to be Phred scores instead of log-odds scores. This fixes a bug where negative consensus qualities were appearing in CAF and ACE outputs. The change also impacts some other code, such as searching for consensus quality in the editor and fastq outputs, but only at the very low end as log-odds and phred scales rapidly converge. It is only very poor quality data that changes. ------------------------------------------------------------------------ r3718 | jkbonfield | 2014-09-01 09:37:22 +0100 (Mon, 01 Sep 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5_cmd.tcl Added Contig Extend/Trim options to gap5_cmd ------------------------------------------------------------------------ r3717 | jkbonfield | 2014-08-29 15:51:26 +0100 (Fri, 29 Aug 2014) | 5 lines Changed paths: M /staden/trunk/src/gap5/configure.tcl M /staden/trunk/src/gap5/gap_globals.tcl Fixed configuring consenus mode when in read only mode. Fixed using File->Open to swap databases, ensuring it now correctly sets the default_seq_tech back to Illumina. ------------------------------------------------------------------------ r3716 | jkbonfield | 2014-08-29 15:42:53 +0100 (Fri, 29 Aug 2014) | 30 lines Changed paths: M /staden/trunk/src/gap5/configure.tcl M /staden/trunk/src/gap5/gap5.tcl M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/gap5rc_menu_full A /staden/trunk/src/gap5/gap_globals.tcl M /staden/trunk/src/gap5/ng_fb_cmds.tcl M /staden/trunk/src/gap5/tclIndex M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tg_tcl.c Allowed the default_seq_tech parameter to be modified from Gap5 GUI. To do this required several things. 1) The cached consensus may be incorrect after changing this, so it has to be purged. 2) The parameter needs to be remembered in the database itself so it can be set the next time we open a database. I tidied up the setting of default parameters in multiple locations and put them into gap_globals.tcl. 3) To store an arbitrary variable without modifying the database format required some lateral thinking. WARNING: ugliness ahead. Those of a nervous disposition should look away now. We create an anno_ele object with parent_type of GT_Database; ie an annotation on the database rather than a contig or sequence. A scaffold of name __g5::CONFIG is created whose record number points to this annotation instead of a scaffold. The annotation contains a series of 'set key val' tuples, which are carefully checked for validty so we don't blindly trust everything. We can extend this with other __g5::* fields for different types of data, replacing the old Gap4 "Notes" mechanism as tags attached to a database are essentially the same thing as notes. 4) Added various C/Tcl interfaces to set and get the config_anno field. ------------------------------------------------------------------------ r3715 | jkbonfield | 2014-08-29 15:35:02 +0100 (Fri, 29 Aug 2014) | 12 lines Changed paths: M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/gap_globals.c M /staden/trunk/src/gap5/gap_globals.h Updated the consensus algorithm to cope with different overcall and undercall probabilities per machine platform, permitting mixing of different technologies to form a single consensus. At present these are complete guesses with only a minimal nod to reality and have no measurements backing them up (yet). Expect them to be tuned in the future. However they act as a good proof of concept. The Tcl variable default_seq_tech may be modified to change what the Unknown sequencing tech is treated as. ------------------------------------------------------------------------ r3714 | jkbonfield | 2014-08-28 17:20:08 +0100 (Thu, 28 Aug 2014) | 5 lines Changed paths: M /staden/trunk/src/gap5/fasta.c Fasta data now has a default quality of 3 instead of 0, as this was causing problems with my experimental consensus algorithm. It makes more sense at 3 anyway. Confidence 0 implies it is 100% chance of being incorrect. ------------------------------------------------------------------------ r3713 | jkbonfield | 2014-08-28 17:19:17 +0100 (Thu, 28 Aug 2014) | 6 lines Changed paths: M /staden/trunk/src/gap5/hash_lib.c Further tweakage of the align_blocks function. This was necessary in order to get alignments scoring positive when using very weakly aligning data. It doesn't seem to overly harm my other tests for Illumina. ------------------------------------------------------------------------ r3712 | jkbonfield | 2014-08-28 17:18:11 +0100 (Thu, 28 Aug 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c Prevent treatment of confidence 255 ("*" in qual field for BAM) as confidence -1 (or 255). Instead set it to a minimal confidence of 3. ------------------------------------------------------------------------ r3711 | jkbonfield | 2014-08-26 17:35:51 +0100 (Tue, 26 Aug 2014) | 9 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl Fixed the mapping quality filter range from 0-80 to 0-255 as we are seeing data with >80 as mquals. Fixed the use of TEMPLATE_DISPLAY.SETTINGS_$i library records. These could be for another database, so it already attempted to blank out the libraries-list when they don't match up, but it failed to clear the undo versions causing the filter window to possibly blank the data when it's invoked. ------------------------------------------------------------------------ r3710 | jkbonfield | 2014-08-26 15:20:32 +0100 (Tue, 26 Aug 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap_range.c Fixed spacing ------------------------------------------------------------------------ r3709 | jkbonfield | 2014-08-26 11:58:00 +0100 (Tue, 26 Aug 2014) | 32 lines Changed paths: M /staden/trunk/src/gap5/libraries.tcl M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_library.c M /staden/trunk/src/gap5/tg_library.h M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tg_tcl.c Further work on read-group machine types. 1) Bug fix to the tg_index process so that it looks up "PL"atform RG tag correctly. Previously it was doing something bizarre with attempting to find the library name as a 2 character key. 2) Changed seq_tech to be an int instead of int:3 in the seq_t struct as it has 9 possible values now. 3) Changed the on-disk format, which also packs 3 bits, to steal 2 bits from the parent_type field and use these for seq_tech. This is backwards compatible as these top bits have always been zero and we've also never needed more than 7 for seq_tech either. This limits the available number of GT_* types to 64, but we're only using 18 at the moment and I don't see us adding that many more table types to gap5. It gives us up to 32 instrument types. 4) Added set_name and set_machine_type methods to the library tcl object. 5) The List Libraries window now allows editing of the library name too, also also saves both this and edits to library machine type. Note that editing the machine type here does not actually modify all the sequence structures as the library type has been cached in both seq and range structures during tg_index. I do not know how to prevent that in an efficient manner, so for now editing the type is purely for informational purposes. ------------------------------------------------------------------------ r3708 | jkbonfield | 2014-08-22 17:17:51 +0100 (Fri, 22 Aug 2014) | 6 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/libraries.tcl M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/tk_utils/xcombobox.tcl Updated Gap5 to support a richer list of machine platforms in the SAM @RG tag. (Ongoing: the platform type can also now be edited, but not yet saved, in the ListLibraries window.) ------------------------------------------------------------------------ r3707 | jkbonfield | 2014-08-21 09:29:53 +0100 (Thu, 21 Aug 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Removed memory leak in sam_refbased_cigar(). Also removed debugging output from the output GFF function. ------------------------------------------------------------------------ r3706 | jkbonfield | 2014-08-21 09:28:56 +0100 (Thu, 21 Aug 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Removed memory leak in padded_to_reference_array(). ------------------------------------------------------------------------ r3705 | jkbonfield | 2014-08-01 14:45:41 +0100 (Fri, 01 Aug 2014) | 7 lines Changed paths: M /staden/trunk/src/gap5/Makefile Added code to provide an export_snps command. This is *PURELY TEST ONLY*. It has hard coded names (like "chr20") and has a few bugs too, but it serves as a useful starting point for if/when we want to do proper VCF output at some stage. For now it is not supported by the GUI. ------------------------------------------------------------------------ r3704 | jkbonfield | 2014-08-01 14:45:22 +0100 (Fri, 01 Aug 2014) | 7 lines Changed paths: M /staden/trunk/src/gap5/consen.tcl A /staden/trunk/src/gap5/export_snps.c A /staden/trunk/src/gap5/export_snps.h M /staden/trunk/src/gap5/newgap5_cmds.c Added code to provide an export_snps command. This is *PURELY TEST ONLY*. It has hard coded names (like "chr20") and has a few bugs too, but it serves as a useful starting point for if/when we want to do proper VCF output at some stage. For now it is not supported by the GUI. ------------------------------------------------------------------------ r3703 | jkbonfield | 2014-07-31 11:28:25 +0100 (Thu, 31 Jul 2014) | 8 lines Changed paths: M /staden/trunk/src/gap5/check_assembly.c M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/find_oligo.c M /staden/trunk/src/gap5/find_repeats.c Fixed the buffer size for the OBJ_GET_BRIEF callback to be 160 instead of 80. This fixes buffer overruns when dealing with large databases and long record numbers. Worked it out on paper the maximum length is around 120 for FIJ, and a few bytes more for the others (but under 130). Set the new buffer size to 160. ------------------------------------------------------------------------ r3702 | jkbonfield | 2014-07-16 10:31:55 +0100 (Wed, 16 Jul 2014) | 7 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Put back the line of code to output BAM_FPROPER_PAIR flag for reads in ---> <--- paired orientation. While this isn't strictly correct for all library types, making this assumption is still usually correct and far better than simply never setting this flag at all. ------------------------------------------------------------------------ r3701 | jkbonfield | 2014-07-08 17:49:20 +0100 (Tue, 08 Jul 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_struct.h Added explanatory note to GRANGE_FLAG_REFPOS_HAVE_* fields so we don't accidentally recreate the same bug as before. (Fake warnings from Check Database.) ------------------------------------------------------------------------ r3700 | jkbonfield | 2014-07-08 17:44:14 +0100 (Tue, 08 Jul 2014) | 10 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Remove the code attempting to set GRANGE_FLAG_REFPOS_HAVE_* fields. These are used internally in tg_iface_g.c to determine whether we need to store the Position, Size or ID fields via a simplistic delta mechanism. Outside of that file they should never be set or queried. This fix removes a warning about the in-memory and on-disc representations differing, which is bogus as these bit fields are zeroed after reading anyway. ------------------------------------------------------------------------ r3699 | jkbonfield | 2014-07-08 16:31:10 +0100 (Tue, 08 Jul 2014) | 7 lines Changed paths: M /staden/trunk/src/gap5/consen.tcl M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/consensus.h M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/newgap5_cmds.c Added an interface to save heterozygous bases in the consensus. Internally there are some new functions for this too (eg calculate_consensus_simple_het) as well as some experimental only functions for evaluation of SNP calling. (It is not expected that Gap5 will perform well here.) ------------------------------------------------------------------------ r3698 | jkbonfield | 2014-07-08 15:29:41 +0100 (Tue, 08 Jul 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Fixed a bug in r3655 caused by failure to save bin ranges after modifying. This causes thousands of errors after inserting columns of bases (eg via shuffle_pads). ------------------------------------------------------------------------ r3697 | jkbonfield | 2014-07-02 15:31:59 +0100 (Wed, 02 Jul 2014) | 7 lines Changed paths: M /staden/trunk/course/data/shotgun_data/DEMO.0.log M /staden/trunk/course/data/shotgun_data/xb54f3.s1ta.exp M /staden/trunk/course/data/shotgun_data/xb56a5.s1.exp M /staden/trunk/demo/gap4/DEMO.0 M /staden/trunk/demo/gap4/DEMO.0.aux M /staden/trunk/doc/Makefile A /staden/trunk/doc/manual/test.texi M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/seq_utils/align_lib.c Tweaks to the shuffle pads scoring system, in particular what tables it uses for the non-linear transforms (sinh vs log) as both have their particular strengths and weaknesses. The default is now to use soft-clips in the editor too for realignment. ------------------------------------------------------------------------ r3696 | jkbonfield | 2014-07-02 15:17:33 +0100 (Wed, 02 Jul 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/fij.tcl Added back Mask/Mark consensus filtering modes to Find Internal Joins. ------------------------------------------------------------------------ r3683 | jkbonfield | 2014-06-27 14:02:07 +0100 (Fri, 27 Jun 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/consen.c M /staden/trunk/src/gap5/consen.h M /staden/trunk/src/gap5/consen.tcl M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/gap_globals.c Fixed Mask/Mark consensus and also updated the gap5_cmd consensus function to allow specifying of arbitrary maps for masking purposes. ------------------------------------------------------------------------ r3674 | jkbonfield | 2014-06-11 16:28:22 +0100 (Wed, 11 Jun 2014) | 7 lines Changed paths: M /staden/trunk/src/gap5/Makefile Sanitise TGILIBS to use GAP5_LIBS and also removed the duplicate SEQUTILS_LIBS from GAP5_LIBS. This fix will also prevent the explicit -L/usr/lib64 -ltcl8.5 link line on Fedora from capturing a system libstaden-read.so in preference to the one we attempted to link against. ------------------------------------------------------------------------ r3661 | daviesrob | 2014-05-28 15:15:35 +0100 (Wed, 28 May 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Stop undo list from being converted to a string, just to see if it's empty. ------------------------------------------------------------------------ r3658 | daviesrob | 2014-05-22 09:40:29 +0100 (Thu, 22 May 2014) | 5 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Rewrite of contig_insert_base2. The new version is much shorter and less byzantine than the previous one. ------------------------------------------------------------------------ r3657 | jkbonfield | 2014-05-21 12:35:46 +0100 (Wed, 21 May 2014) | 34 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/seq_utils/align_lib.c M /staden/trunk/src/seq_utils/align_lib.h Many changes to shuffle pads implementation. The malign code in align_lib now copes with start/end range being something other than 1..length. This makes it far more efficient at dealing with sub-sections of a contig. Added a EDGE_GAPS_MAXY cost to block shifting the consensus to match the sequence (vice versa is OK). In essence this is moving the sequence beyond the end of the consensus, which can cause problems in BAM world if we get coordinates < 1. Adjusted the malign scores. It's now hard coded for DNA only, but it was never used on proteins anyway. The scaling of scores is still 0 to 128, but now it is nonlinear and not in direct proportion to the fraction of base type in the consensus vector. This was arrived at by experimentation. There is also an optional second scoring method for pads, which works in some cases and not in others. This is selected by specifying gap_extend to be 0 (gap_extend has been ignored for years, since we switched from affine alignments). The shuffle pads code now executes both modes in an attempt to find the best alignments. When evaluating our realigned soft-clips we first undo the clipped before recomputing the new consensus vector. This avoids a circular argument and means we can only extend into heterozygous cutoffs when there was already the same heterozygosity in the originally clipped data. Finally, adjusted the soft clipped scoring method to promote more extension before realignment, but harsher when validating whether to keep the alignments. ------------------------------------------------------------------------ r3656 | jkbonfield | 2014-05-21 12:17:34 +0100 (Wed, 21 May 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_index.c Rename g_index to tg_index in usage output. ------------------------------------------------------------------------ r3655 | daviesrob | 2014-05-20 16:30:34 +0100 (Tue, 20 May 2014) | 85 lines Changed paths: M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5_del_test.tcl M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h M /staden/trunk/src/gap5/tg_tcl.c More reworking of contig insertion / deletion code. The tcl code to undo consensus base deletion has been simplified by creating a contig insert_column interface, which takes the list of reads and base calls in the undo stack and applies it to the column being inserted. This allows the C code to do a much more complete job than the old insert_base code, so the tcl part does not need to do as much cleaning up. This also means there is less need to iterate around the bin tree. Consensus base deletion now also stores undo information for reference position markers. As deleting a base may cause markers to be merged, the only way to get them back when undoing is to know what markers were present in the first place. Various edge cases and problems with complemented bins have been fixed. tg_tcl.c Added contig insert_column, find_refpos_marker, set_refpos_marker and delete_refpos_marker interfaces. tg_contig.c tg_contig.h Made it easier to turn debugging code on and off. Added new contig_insert_column() function. This is like contig_insert_base, but can be passed an array listing the base and confidence value to be inserted into each read in the column. This is used to make a hash table which is passed to contig_insert_base_common and then contig_insert_base2 so the updates can be made reasonably efficiently without having to do too many traverses of the bin tree. Update contig_insert_base2 to take the pileup hash, and to fix more edge case and complemented bin issues. Ensure bin_incr_nseq() is only called for sequences in contig_delete_base2. Improved calculation of moved_left, moved_right and fixed_right in contig_delete_base2. Allow deletion of the first base of the contig in contig_delete_base_common. Reworked refpos marker code to simplify it and to fix a bug where some deletion markers were not removed in contig_delete_base_common causing them to pile up. Added set_refpos_marker() and delete_refpos_marker() functions. These are called from the tcl interfaces in tg_tcl.c tg_sequence.c tg_sequence.h Pass in comp to sequence_insert_bases, which should be 1 if the current bin is complemented. This means it's possible to work out if the base call should be complemented or not when inserting in bin orientation. The value passed in is ignored if in contig_orientation. tg_check.c In bin_walk, when an incorrect nseqs or nanno count is found, print out what the stored and actual values were. contig_editor.tcl C_INS undo code now uses $contig insert_column instead of insert_base. This allowed a lot of code that was fixing eveything $contig insert_base had not done correctly to be removed. Added RP_SET and RP_DEL undo commands. Made editor_delete_cons_base store undo for any reference position markers that could be affected. This is the only way to guarantee that the undo operation can get them back as they were before. gap5_del_test.tcl Made the basic test run on a complemented bin as well as an uncomplemented one. Make do_test compare sam files for the before and after complemented case. Makefile Recalculated dependencies. ------------------------------------------------------------------------ r3651 | jkbonfield | 2014-05-08 15:25:15 +0100 (Thu, 08 May 2014) | 6 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Bug fix to bounds checking of cons[p]. Remember it's not start..end but 0..end-start. Inconsequential update to the scoring functions; the match and mismatch costs are now #defines (but the same as before). ------------------------------------------------------------------------ r3650 | jkbonfield | 2014-05-06 17:10:18 +0100 (Tue, 06 May 2014) | 8 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Now more rigorous bounds checking in rewrite_soft_clips(), curing some crashes. concordant_soft_clips() is now more liberal with the scoring when extending into cutoff, to allow for misalignments of the cutoff data. The final assessment post re-alignment within rewrite_soft_clips() is still using the original scores so this shouldn't cause problems. ------------------------------------------------------------------------ r3649 | jkbonfield | 2014-05-06 17:07:14 +0100 (Tue, 06 May 2014) | 7 lines Changed paths: M /staden/trunk/src/seq_utils/align_lib.c Cull some of the old malign scoring methods in scale_malign_scores(). Switched to a new version that scores based on log(count) instead of count. This allows for better multiple sequence alignments within heterozygous regions, so that we don't overly penalise the rare allele but still prefer to align correctly. ------------------------------------------------------------------------ r3648 | jkbonfield | 2014-05-02 14:20:48 +0100 (Fri, 02 May 2014) | 10 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Bug fix to the recent update to look at consensus heterozygous bases (typo leading to crash). Make the concordant clip detection more liberal to start with (it'll filter out those with turn out to be incorrect). Remove pad columns both both and after rewriting the clips, as series of pads left in the consensus was causing the seq-matches-cons check to fail early. ------------------------------------------------------------------------ r3647 | jkbonfield | 2014-05-02 12:26:52 +0100 (Fri, 02 May 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/shuffle_pads.h Renamed coherent to concordant for the soft-clipping strategy. This is the more appropriate English word. ------------------------------------------------------------------------ r3646 | jkbonfield | 2014-05-02 12:20:38 +0100 (Fri, 02 May 2014) | 6 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Fixed missing output of print_malign (unused unless uncommented out). Changed the cutoff evaluation and extension to align against heterozygous calls rather than single base consensus call. This allows it to extend reads into cutoffs in more situations. ------------------------------------------------------------------------ r3645 | jkbonfield | 2014-05-02 09:46:53 +0100 (Fri, 02 May 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Fixed @SQ line LN: field to use the clipped contig length instead of unclipped. ------------------------------------------------------------------------ r3644 | jkbonfield | 2014-05-01 16:52:07 +0100 (Thu, 01 May 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Further improvements to samtools output with fixmates. ------------------------------------------------------------------------ r3643 | jkbonfield | 2014-05-01 14:59:20 +0100 (Thu, 01 May 2014) | 7 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c When realigning including cutoffs, the trim and re-extend process at the end extends the sequence for as far as it matches the consensus. We now have a small caveat on this such that it will backtrack to the first non-pad character after the extension, to avoid leaving trailing pads on the ends of reads. ------------------------------------------------------------------------ r3642 | jkbonfield | 2014-05-01 14:57:59 +0100 (Thu, 01 May 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Attempt to improve mate pos when using fix-mates output of SAM in conjunction with refpos depadding. ------------------------------------------------------------------------ r3641 | jkbonfield | 2014-05-01 11:50:26 +0100 (Thu, 01 May 2014) | 26 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/export_contigs.tcl M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/sam_pileup.h M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h 1. Added an extra depadding option to Export Contigs; reference sequence positions (in addition to the old padded and unpadded consensus mode). The purpose of this is to allow tg_index to import a sam/bam/cram, run tools like Shuffle Pads on it, and then export back in the same coordinate system as the original BAM. It is not expected to work after joining and breaking has been applied, although it needs better error handling to cope with this more gracefully. Updated the padded_to_reference_array() function to aid this work. 2. Fixed a bug in create_ref_seq(). It was producing incorrect .fai files for contigs that do not start at base 1. 3. Fixed memory corruption in sam_add_seq() caused when using excessive padding in CIGAR ops during tg_index. 4. Bug fix to contig_insert_base_common() when manipulating the REF_POS markers. It wasn't coping correctly with this in some complemented scenarios and with nbases > 1. ------------------------------------------------------------------------ r3640 | daviesrob | 2014-04-29 10:16:55 +0100 (Tue, 29 Apr 2014) | 38 lines Changed paths: M /staden/trunk/src/gap5/gap5_del_test.tcl M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_sequence.c Various fixes to keep contig start/end correct. tg_check.c In check_contig, print out start and end positions in the contig and those from the bin walk when they disagree. tg_bin.c Fixed bug in bin_remove_item_from_bin where used start/end were not swapped for complemented bins when mapping to the position in the parent. This could lead to the contig unclipped start/end not being recalculated when they should have been. tg_sequence.c Add code to update contig used start/end and clipped_timestamp when necessary in sequence_move. tg_contig.c Altered the way that contig_insert_base and contig_delete_base keep track of which ends of the contig may have changed. This fixes several cases where the contig start/end were not updated as they should have been. Modified read shifting code in contig_insert_base2 and contig_delete_base2. The new version moves the same reads for both complemented and uncomplemented bins. Renamed some variables to make the operation of the code less obscure, e.g. r_start, r_end to v_start,v_end in contig_insert_base2 and contig_delete_base2; ins,no_ins to del,no_del in contig_delete_base2. Added some comments. gap5_del_test.tcl Added test to ensure cutoff data at the start/end of the contig is handled correctly. Made the test script stop but not exit on failure. This allows the situation to be checked manually. Made some tests run on complemented contigs as well. Temporarily disabled the pattern tests to allow a faster iteration through the random ones. ------------------------------------------------------------------------ r3639 | jkbonfield | 2014-04-28 12:23:03 +0100 (Mon, 28 Apr 2014) | 9 lines Changed paths: M /staden/trunk/src/tracediff/main.cpp Replaced the potentially ambiguous copyright notice with the full root copyright notice (although we don't actually bother to have any in most of the files). When MRC open-sourced the software they sent me the original (LICENCE.txt) copyright notice for it to be applied to all the software. Any internal MRC specific copyrights left in place are an accidental and superceded. ------------------------------------------------------------------------ r3636 | jkbonfield | 2014-04-14 11:29:30 +0100 (Mon, 14 Apr 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Minor comment tidyup ------------------------------------------------------------------------ r3622 | daviesrob | 2014-04-07 12:45:07 +0100 (Mon, 07 Apr 2014) | 8 lines Changed paths: M /staden/trunk/src/gap5/tg_bin.c Made bin_add_to_range explicitly check for sequences beyond clipped_start/end bin_add_to_range would fail to set (*c)->clipped_timestamp = 0 if a sequence being added was within the existing contig used start/end but caused the clipped_start/end to change. Added a check to see if the new range may go beyond clipped_start or clipped_end, and reset clipped_timestamp if this is the case. ------------------------------------------------------------------------ r3616 | daviesrob | 2014-04-04 13:43:20 +0100 (Fri, 04 Apr 2014) | 1 line Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5_del_test.tcl Debugging aids for contig deletion/insertion ------------------------------------------------------------------------ r3615 | daviesrob | 2014-04-04 13:40:08 +0100 (Fri, 04 Apr 2014) | 7 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Fixed occasional incorrect update of contig used end position. Put in check that seq_end has actually been set in contig_insert_base2 before using the value. Removed some dead code. ------------------------------------------------------------------------ r3612 | daviesrob | 2014-04-02 12:44:48 +0100 (Wed, 02 Apr 2014) | 12 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h M /staden/trunk/src/gap5/tg_tcl.c Remove duplicate move_seq code and ensure annotations are in same bin as seq. The code for MOVE_SEQ in contig_cmd could move sequences to new bins without ensuring that the annotations were moved as well. The version in sequence_move did fix the annotations, so made contig_cmd call this instead of using its own code. sequence_move now takes a contig_t ** so it can update the location of the contig record in the caller should it get checked out. It also gets a prototype in tg_sequence.h ------------------------------------------------------------------------ r3611 | daviesrob | 2014-04-02 12:43:45 +0100 (Wed, 02 Apr 2014) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_contig.c Stop tags from extending at the contig end when inserting consensus bases ------------------------------------------------------------------------ r3600 | daviesrob | 2014-03-19 16:33:20 +0000 (Wed, 19 Mar 2014) | 8 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Disabled fix for annotations that do not overlap the annotated object. Trying to move the annotation to a new bin causes problems in bin_walk which expects the items in the bins to remain stable. This leads it to try to fix problems that aren't really there resulting in a database that is in a much worse state that it was to start with. Disabling the annotation fix prevents this. ------------------------------------------------------------------------ r3598 | daviesrob | 2014-03-14 17:02:32 +0000 (Fri, 14 Mar 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c M /staden/trunk/src/gap5/contig_extend.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/template_display.c M /staden/trunk/src/gap5/template_draw.c M /staden/trunk/src/gap5/tg_index.h M /staden/trunk/src/gap5/tg_index_common.c Fix compiler warnings. Mainly missing prototypes, a few char subscripts and some missing braces. ------------------------------------------------------------------------ r3597 | daviesrob | 2014-03-14 15:10:31 +0000 (Fri, 14 Mar 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_struct.h Changed flags in contig_t struct from tg_rec to uint32_t Done to match what is stored in the database. ------------------------------------------------------------------------ r3596 | daviesrob | 2014-03-14 12:28:38 +0000 (Fri, 14 Mar 2014) | 8 lines Changed paths: A /staden/trunk/src/gap5/test A /staden/trunk/src/gap5/test/test_tg_utils.c M /staden/trunk/src/gap5/tg_utils.c Fixed handling of INT32_MIN in s72int and INT64_MIN in s72intw int2s7 and intw2s7 both encode the lowest possible integer value with the output code 1, which was converted to 0 by s72int and s72intw. Fixed the latter so they output the correct value instead. Also added some test code to exercise these functions, including testing all the extreme values. ------------------------------------------------------------------------ r3595 | jkbonfield | 2014-03-11 14:46:58 +0000 (Tue, 11 Mar 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Fixed exporting CRAM in padded mode. It was outputting a depadded consensus, causing CRAM to work excessively hard in encoding reference differences. ------------------------------------------------------------------------ r3594 | jkbonfield | 2014-03-11 09:35:36 +0000 (Tue, 11 Mar 2014) | 13 lines Changed paths: M /staden/trunk/src/gap5/g-request.c Added back fsync of main .g5d file when flushing. This will slow things down slightly, depending on how often flushes occur, but resolves some database corruptions we've been seeing. Specifically if a user has gap5 open on one machine, makes changes and saves the DB, then creates a backup of the database on the command line on a different machine[1] then there is a chance that NFS hasn't correctrly synced the changes yet. This call forces that to happen. [1] This happens a lot here due to using load-sharing to launch gap5 on one of several nodes in a cluster. ------------------------------------------------------------------------ r3591 | jkbonfield | 2014-03-04 17:17:20 +0000 (Tue, 04 Mar 2014) | 8 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/shuffle_pads.h Added an automatic adapter detector. This works by hashing the soft-clip and hashing the used data (FIXME: need to strip pads) and then comparing the distributions. Also reduced memory and potentially sped up on very long contigs by doing shuffle pads in 32Kb windows. This avoids purging of memory cache. ------------------------------------------------------------------------ r3590 | jkbonfield | 2014-03-04 14:35:38 +0000 (Tue, 04 Mar 2014) | 3 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Fixed bug in ed_set_sequence_sort(). It wasn't correctly handling the variation of selection end < start. ------------------------------------------------------------------------ r3588 | jkbonfield | 2014-02-28 15:30:34 +0000 (Fri, 28 Feb 2014) | 6 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Improvements to Shuffle Pads's validate_clip() function. Using a similar method to rewrite_soft_clips (possibly the validation should be merged into that code), it now counts differences to the consensus. This is often more reliable than counting SNP consensus bases when faced with highly varying read depth. ------------------------------------------------------------------------ r3587 | jkbonfield | 2014-02-28 12:44:58 +0000 (Fri, 28 Feb 2014) | 3 lines Changed paths: M /staden/trunk/src/gap4/edMutations.c Fixed a bug in showing the reading-frame translations. It's a 1 byte buffer overrun that has existed since ~2002. ------------------------------------------------------------------------ r3583 | jkbonfield | 2014-02-27 11:19:20 +0000 (Thu, 27 Feb 2014) | 19 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/gap5_thrash.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/shuffle_pads.h M /staden/trunk/src/gap5/shuffle_pads.tcl Added an option to Shuffle Pads to use the cutoff/soft-clip data. This is quite complex as it performs multiple passes. Firstly it looks for "coherent soft-clips"; regions with multiple sequences soft-clipped with the cutoffs in agreement with one another. Then it extends sequences into the cutoffs before running shuffle pads. Once realigned, it then inspects the data to check that the unclipped reads align. If so then they are kept, if not then they are tagged with CLIP and the clips are trimmed back to where they agree with the consensus. Finally special care is taken around consensus Ns. These are included in local conventions by faking scaffolds, placing contigs next to each other in the same "contig". Sometimes the realignment will resolve and join them together, but often it produces unaligned data. In that case we attempt to unclip and recreate the N as a internal scaffold marker, but it's not bullet proof. ------------------------------------------------------------------------ r3582 | jkbonfield | 2014-02-26 12:10:55 +0000 (Wed, 26 Feb 2014) | 9 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Optimised contig_insert_base2 and contig_delete_base2. The main change is avoiding recomputing contig ends all the while. Often we can work out what the change will be (eg we're in a bin in the middle of the contig) and it's only at the boundary bins where it gets more complex. So we avoid brute force calculations where possible. Also updated contig_shift_base to accept +N and -N to shift by more than 1 bp. ------------------------------------------------------------------------ r3581 | jkbonfield | 2014-02-26 12:08:33 +0000 (Wed, 26 Feb 2014) | 3 lines Changed paths: M /staden/trunk/src/Misc/array.h Added an ArrayPush macro. Basically it's just a short-hand for appending to the end of an array. ------------------------------------------------------------------------ r3580 | jkbonfield | 2014-02-24 17:33:57 +0000 (Mon, 24 Feb 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_struct.h Fix to ANNO_DIR_REV, but apparently it is unused. ------------------------------------------------------------------------ r3565 | awhitwham | 2014-01-24 10:16:04 +0000 (Fri, 24 Jan 2014) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_index.c M /staden/trunk/src/gap5/tg_index.h M /staden/trunk/src/gap5/tg_index_common.c Changed the name index sorting mechanism of tg_index. Should be faster. ------------------------------------------------------------------------ r3564 | jkbonfield | 2014-01-17 09:45:44 +0000 (Fri, 17 Jan 2014) | 16 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_gio.h M /staden/trunk/src/gap5/tg_index_common.c Reduced the volume of read-pair entries dumped to the /tmp file. Previously when we saw Read.1st we recorded it in a hash table and then when we found Read.2nd we linked it back to Read.1st and recorded in the temporary file a request to link Read.1st to Read.2nd in a second pass. (As doing this immediately causes a lot of disk thrashing due to chimeras, mismatches, genome shuffling etc.) Now we also make the forward link of Read.1st to Read.2nd if it is within a bin that is still held in the in-memory cache and is still locked for read-write (meaning it is yet to be saved/flushed). On a 3Gb bam file test this reduced the number of entries stored in the tmp file for 2nd pass from 15.9 million down to 0.6 million. The effect on speed was slight - only 3% quicker overall. ------------------------------------------------------------------------ r3563 | jkbonfield | 2014-01-16 16:19:54 +0000 (Thu, 16 Jan 2014) | 6 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/tg_tcl.c Added Template Status and Library Name to the multi-column list viewer. Also fixed a bug discovered in edview_items_between() which could return record numbers for cached consensus. ------------------------------------------------------------------------ r3562 | jkbonfield | 2014-01-16 14:10:04 +0000 (Thu, 16 Jan 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl Changed the click and drag bindings to check whether the initial press came from a double-1 binding to move the editor cursor. If so drag the cursor, otherwise do the old plot-drag code. ------------------------------------------------------------------------ r3561 | jkbonfield | 2014-01-16 11:53:37 +0000 (Thu, 16 Jan 2014) | 4 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl M /staden/trunk/src/gap5/gap5rc_menu_full Added Shift-Function-key and Function-key bindings to the template display to store and restore the current configuration. Additionally this can be saved to ~/.gap5rc via the File->Save Settings option. ======================================================================== RELEASED 2.0.0b10 ------------------------------------------------------------------------ r3554 | jkbonfield | 2013-12-18 16:36:35 +0000 (Wed, 18 Dec 2013) | 8 lines Changed paths: M /staden/trunk/src/seq_utils/Makefile Use text_utils instead of tk_utils as vector_clip was inheriting a dependency on tk86.dll which bizarrely then crashes on program exit. The reason we switched to tk_utils instead of text_utils was, I think, originally due to inanities of the macosx linker disallowing linking against seq_utils and tk_utils within, say, gap4. But both that and windows now work. ------------------------------------------------------------------------ r3553 | jkbonfield | 2013-12-18 16:33:41 +0000 (Wed, 18 Dec 2013) | 2 lines Changed paths: M /staden/trunk/src/pregap4/modules/interactive_clip.p4m Fixed launching of Trev to avoid knowing the wish executable name. ------------------------------------------------------------------------ r3552 | jkbonfield | 2013-12-18 12:37:05 +0000 (Wed, 18 Dec 2013) | 2 lines Changed paths: M /staden/trunk/auto_build/remote.windows-i386 M /staden/trunk/auto_build/remote.windows-x86_64 Bug fix to Gap4 - it's gap.exe and not gap4.exe that we need. ------------------------------------------------------------------------ r3551 | jkbonfield | 2013-12-18 12:28:28 +0000 (Wed, 18 Dec 2013) | 2 lines Changed paths: M /staden/trunk/src/windows/inno_setup/staden_config.iss Minor updates to windows setup: icon file locations; Start menu contents. ------------------------------------------------------------------------ r3550 | jkbonfield | 2013-12-18 12:27:28 +0000 (Wed, 18 Dec 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/g-files.c Bug fix for Windows - force opening in O_BINARY mode. ------------------------------------------------------------------------ r3545 | jkbonfield | 2013-12-16 14:31:51 +0000 (Mon, 16 Dec 2013) | 3 lines Changed paths: M /staden/trunk/auto_build/Makefile M /staden/trunk/auto_build/local.lucid-i386 M /staden/trunk/auto_build/local.macosx M /staden/trunk/auto_build/local.precise-x86_64 M /staden/trunk/auto_build/local.windows-i386 M /staden/trunk/auto_build/local.windows-x86_64 M /staden/trunk/auto_build/remote.lucid-i386 M /staden/trunk/auto_build/remote.macosx M /staden/trunk/auto_build/remote.precise-x86_64 M /staden/trunk/auto_build/remote.windows-i386 M /staden/trunk/auto_build/remote.windows-x86_64 Added documentation to the generated tarballs. Also produce lzma versions for linux. ------------------------------------------------------------------------ r3544 | jkbonfield | 2013-12-16 11:35:02 +0000 (Mon, 16 Dec 2013) | 2 lines Changed paths: M /staden/trunk/auto_build/Makefile M /staden/trunk/auto_build/config M /staden/trunk/auto_build/local.macosx M /staden/trunk/auto_build/local.windows-i386 M /staden/trunk/auto_build/local.windows-x86_64 Fixes to cope with moving the auto_build directory. ------------------------------------------------------------------------ r3543 | jkbonfield | 2013-12-16 11:28:11 +0000 (Mon, 16 Dec 2013) | 2 lines Changed paths: A /staden/trunk/auto_build/README A /staden/trunk/auto_build/README.linux A /staden/trunk/auto_build/README.macosx A /staden/trunk/auto_build/README.windows Docs for local machines. ------------------------------------------------------------------------ r3542 | jkbonfield | 2013-12-16 11:08:55 +0000 (Mon, 16 Dec 2013) | 6 lines Changed paths: A /staden/trunk/auto_build A /staden/trunk/auto_build/Makefile A /staden/trunk/auto_build/config A /staden/trunk/auto_build/local.lucid-i386 A /staden/trunk/auto_build/local.macosx A /staden/trunk/auto_build/local.precise-x86_64 A /staden/trunk/auto_build/local.windows-i386 A /staden/trunk/auto_build/local.windows-x86_64 A /staden/trunk/auto_build/remote.lucid-i386 A /staden/trunk/auto_build/remote.macosx A /staden/trunk/auto_build/remote.precise-x86_64 A /staden/trunk/auto_build/remote.windows-i386 A /staden/trunk/auto_build/remote.windows-x86_64 Added auto_build directory. This contains Makefiles and shell scripts for local use in Sanger to build distributions on a variety of platforms. It is designed to speed up the release cycle. (Still a work in progress.) ------------------------------------------------------------------------ r3541 | jkbonfield | 2013-12-13 17:56:44 +0000 (Fri, 13 Dec 2013) | 2 lines Changed paths: A /staden/trunk/src/windows/inno_setup A /staden/trunk/src/windows/inno_setup/splash.bmp A /staden/trunk/src/windows/inno_setup/staden_config.iss Added InnoSetup configuration for building windows installations. ------------------------------------------------------------------------ r3539 | jkbonfield | 2013-12-13 16:55:30 +0000 (Fri, 13 Dec 2013) | 3 lines Changed paths: M /staden/trunk/src/ac_stubs/tcl.m4 M /staden/trunk/src/configure.in M /staden/trunk/src/staden_config.h.in Updated to newer version of tcl.m4 to better support cross-compiling for windows. ------------------------------------------------------------------------ r3538 | jkbonfield | 2013-12-13 14:18:15 +0000 (Fri, 13 Dec 2013) | 2 lines Changed paths: M /staden/trunk/src/tk_utils/tkTraceDisp.c Renamed Winport to WinPort as case matters when cross-compiling from linux. ------------------------------------------------------------------------ r3537 | jkbonfield | 2013-12-13 14:17:42 +0000 (Fri, 13 Dec 2013) | 4 lines Changed paths: M /staden/trunk/src/gap5/fasta.c Added staden_config.h for belt and braces. I don't think it's needed now that I fixed an issue elsewhere, but it ought to have it explicitly included anyway. ------------------------------------------------------------------------ r3536 | jkbonfield | 2013-12-13 14:16:56 +0000 (Fri, 13 Dec 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/Makefile Removed tg_view. It doesn't work on windows (unless we build our own curses) and is pretty pointless now anyway. ------------------------------------------------------------------------ r3535 | jkbonfield | 2013-12-13 14:16:28 +0000 (Fri, 13 Dec 2013) | 3 lines Changed paths: M /staden/trunk/src/windows/run/main.cpp Updated to work with tcl8.6 and also now adds lib directory to PATH so dlls don't need to be in the main bin directory. ------------------------------------------------------------------------ r3534 | jkbonfield | 2013-12-13 14:15:36 +0000 (Fri, 13 Dec 2013) | 3 lines Changed paths: M /staden/trunk/src/windows/run/Makefile Added $(COMPILER) to Makefile as a command prefix so we can override it for cross-compilers. ------------------------------------------------------------------------ r3527 | jkbonfield | 2013-11-29 10:13:20 +0000 (Fri, 29 Nov 2013) | 2 lines Changed paths: M /staden/trunk/src/pregap4/modules/interactive_clip.p4m M /staden/trunk/src/tk_utils/stash Fixes to cope with spaces in filenames. ------------------------------------------------------------------------ r3526 | jkbonfield | 2013-11-21 15:36:07 +0000 (Thu, 21 Nov 2013) | 9 lines Changed paths: M /staden/trunk/src/gap5/template_draw.c Fixed a bizarre red/blue colour swap on Windows. It seems to have been there several years. I'm not sure of the reason for it, but also see http://sourceforge.net/p/tktoolkit/bugs/1049/ for further discussion on the matter. That bug was rejected, but I do wonder if it's still there. Tested against Windows Server 2008 R2 and Win XP, both had the error and both now display correctly. ------------------------------------------------------------------------ r3525 | jkbonfield | 2013-11-21 15:34:16 +0000 (Thu, 21 Nov 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/b+tree2.h Fix when cross-compiling. (Missing int*_t) ------------------------------------------------------------------------ r3524 | jkbonfield | 2013-11-21 14:15:26 +0000 (Thu, 21 Nov 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/template_draw.c A better fix to the template X Image handling. Blinding calling ckalloc and ckfree works for Windows, but then causes crashes on Unix for the same reasons we had crashes on Windows when using malloc/free. We now pick and choose which functions to use based on the OS. ------------------------------------------------------------------------ r3523 | jkbonfield | 2013-11-21 10:44:50 +0000 (Thu, 21 Nov 2013) | 3 lines Changed paths: M /staden/trunk/src/eba/conf.c M /staden/trunk/src/gap5/tg_tcl.c M /staden/trunk/src/hetins/hetins.c M /staden/trunk/src/init_exp/init_exp.c Minor compilation warnings removed, particularly with respect to Windows building. ------------------------------------------------------------------------ r3522 | jkbonfield | 2013-11-20 17:29:17 +0000 (Wed, 20 Nov 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/depth.tcl Fixed mouse wheel bindings for Windows in template display and contig editor. ------------------------------------------------------------------------ r3521 | jkbonfield | 2013-11-20 16:32:07 +0000 (Wed, 20 Nov 2013) | 2 lines Changed paths: M /staden/trunk/src/gap4/IO1.h Renamed #ifdef _IO_H_ guard. Forgot this in io to io1 rename. ------------------------------------------------------------------------ r3520 | jkbonfield | 2013-11-20 15:36:21 +0000 (Wed, 20 Nov 2013) | 4 lines Changed paths: M /staden/trunk/src/gap5/template_draw.c Switched to using ckalloc and ckfree for image->buf as this is copied into the XImage and sometimes freed by Tcl. (On windows if tcl frees it we must allocate it using ckalloc.) ------------------------------------------------------------------------ r3519 | jkbonfield | 2013-11-20 15:33:35 +0000 (Wed, 20 Nov 2013) | 3 lines Changed paths: M /staden/trunk/src/tk_utils/tkWinX.c Renamed tkpWinRopModes to a static sp_tkpWinRopModes to avoid clashes with the same named variable in tk8.6 distribution. ------------------------------------------------------------------------ r3518 | jkbonfield | 2013-11-20 15:32:25 +0000 (Wed, 20 Nov 2013) | 9 lines Changed paths: M /staden/trunk/src/Misc/Makefile M /staden/trunk/src/Misc/os.h M /staden/trunk/src/abi/Makefile M /staden/trunk/src/alf/Makefile M /staden/trunk/src/convert/Makefile M /staden/trunk/src/convert/gapDB.c M /staden/trunk/src/copy_reads/Makefile M /staden/trunk/src/eba/Makefile M /staden/trunk/src/find_renz/Makefile M /staden/trunk/src/g/Makefile D /staden/trunk/src/gap4/IO.c D /staden/trunk/src/gap4/IO.h A /staden/trunk/src/gap4/IO1.c (from /staden/trunk/src/gap4/IO.c:3509) A /staden/trunk/src/gap4/IO1.h (from /staden/trunk/src/gap4/IO.h:3509) M /staden/trunk/src/gap4/IO2.c M /staden/trunk/src/gap4/IO3.c M /staden/trunk/src/gap4/Makefile M /staden/trunk/src/gap4/alter_rel.c M /staden/trunk/src/gap4/alter_rel.h M /staden/trunk/src/gap4/assemble_direct.c M /staden/trunk/src/gap4/assemble_direct.h M /staden/trunk/src/gap4/auto_assemble.c M /staden/trunk/src/gap4/auto_break.c M /staden/trunk/src/gap4/break_contig.c M /staden/trunk/src/gap4/break_contig.h M /staden/trunk/src/gap4/check_assembly.c M /staden/trunk/src/gap4/clip.h M /staden/trunk/src/gap4/clones.c M /staden/trunk/src/gap4/clones.h M /staden/trunk/src/gap4/complement.c M /staden/trunk/src/gap4/confidence_graph.c M /staden/trunk/src/gap4/consen.c M /staden/trunk/src/gap4/consen.h M /staden/trunk/src/gap4/contigEditor.c M /staden/trunk/src/gap4/contig_order.c M /staden/trunk/src/gap4/contig_order.h M /staden/trunk/src/gap4/contig_selector.c M /staden/trunk/src/gap4/copy_db.c M /staden/trunk/src/gap4/copy_db.h M /staden/trunk/src/gap4/cs-object.h M /staden/trunk/src/gap4/dbcheck.c M /staden/trunk/src/gap4/dis_readings.c M /staden/trunk/src/gap4/edStructs.h M /staden/trunk/src/gap4/edUtils.h M /staden/trunk/src/gap4/edUtils2.c M /staden/trunk/src/gap4/extract.c M /staden/trunk/src/gap4/fij.c M /staden/trunk/src/gap4/fij.h M /staden/trunk/src/gap4/find_fragments.c M /staden/trunk/src/gap4/find_oligo.c M /staden/trunk/src/gap4/find_repeats.c M /staden/trunk/src/gap4/find_repeats.h M /staden/trunk/src/gap4/gap-tcl.c M /staden/trunk/src/gap4/gap-thrash2.c M /staden/trunk/src/gap4/gap-thrash2bug.c M /staden/trunk/src/gap4/gap-thrash3.c M /staden/trunk/src/gap4/gap-thrash_main.c M /staden/trunk/src/gap4/gap_canvas_box.h M /staden/trunk/src/gap4/io-reg.c M /staden/trunk/src/gap4/io-reg.h M /staden/trunk/src/gap4/io_handle.c M /staden/trunk/src/gap4/io_utils.h M /staden/trunk/src/gap4/join.c M /staden/trunk/src/gap4/list_proc.h M /staden/trunk/src/gap4/newgap_cmds.c M /staden/trunk/src/gap4/newgap_cmds.h M /staden/trunk/src/gap4/newgap_structs.h M /staden/trunk/src/gap4/notes.c M /staden/trunk/src/gap4/oligo.c M /staden/trunk/src/gap4/oligo_sel.c M /staden/trunk/src/gap4/plot_quality.c M /staden/trunk/src/gap4/preass.c M /staden/trunk/src/gap4/probe.h M /staden/trunk/src/gap4/qualIO.c M /staden/trunk/src/gap4/quality_plot.c M /staden/trunk/src/gap4/reactions.c M /staden/trunk/src/gap4/reading_coverage.c M /staden/trunk/src/gap4/readpair.c M /staden/trunk/src/gap4/readpair_coverage.c M /staden/trunk/src/gap4/restriction_enzymes.h M /staden/trunk/src/gap4/ruler_display.c M /staden/trunk/src/gap4/ruler_display.h M /staden/trunk/src/gap4/seqInfo.c M /staden/trunk/src/gap4/shuffle_pads.c M /staden/trunk/src/gap4/shuffle_pads.h M /staden/trunk/src/gap4/strand_coverage.c M /staden/trunk/src/gap4/tagU2.c M /staden/trunk/src/gap4/tagUtils.h M /staden/trunk/src/gap4/template.c M /staden/trunk/src/gap4/template.h M /staden/trunk/src/gap4/template_display.h M /staden/trunk/src/gap4/text-io-reg.c M /staden/trunk/src/gap4/tk-io-reg.c M /staden/trunk/src/gap4/tman_display.h M /staden/trunk/src/gap4/vseqs.c M /staden/trunk/src/gap4/vseqs.h M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/gap5_thrash.tcl M /staden/trunk/src/get_scf_field/Makefile M /staden/trunk/src/haplo/Makefile M /staden/trunk/src/haplo/haplo.h M /staden/trunk/src/haplo/haplo_cons.c M /staden/trunk/src/haplo/haplo_snps.c M /staden/trunk/src/haplo/haplo_split.c M /staden/trunk/src/haplo/haplo_tcl.c M /staden/trunk/src/init_exp/Makefile M /staden/trunk/src/make_weights/Makefile M /staden/trunk/src/mutlib/Makefile M /staden/trunk/src/polyA_clip/Makefile M /staden/trunk/src/prefinish/Makefile M /staden/trunk/src/prefinish/finish.c M /staden/trunk/src/prefinish/finish.h M /staden/trunk/src/prefinish/finish_long.c M /staden/trunk/src/prefinish/finish_main.c M /staden/trunk/src/prefinish/finish_pcr.c M /staden/trunk/src/prefinish/finish_pcr.h M /staden/trunk/src/prefinish/finish_reverse.c M /staden/trunk/src/prefinish/finish_utils.c M /staden/trunk/src/prefinish/finish_utils.h M /staden/trunk/src/prefinish/finish_walk.c M /staden/trunk/src/prefinish/insert_size_dist.c M /staden/trunk/src/prefinish/read_conf_dist.c M /staden/trunk/src/prefinish/read_size_dist.c M /staden/trunk/src/qclip/Makefile M /staden/trunk/src/screen_seq/Makefile M /staden/trunk/src/seq_utils/Makefile M /staden/trunk/src/spin/Makefile M /staden/trunk/src/stops/Makefile M /staden/trunk/src/text_utils/Makefile M /staden/trunk/src/tk_utils/Makefile M /staden/trunk/src/tracediff/Makefile M /staden/trunk/src/vector_clip/Makefile Added #include to the MINGW part of os.h so the chdir() macro is applied after the system definition. This avoids errors if we include os.h before io.h and then get an illegal system head file. Unfortunately adding this breaks Gap4's IO.h (and .c) as on windows IO.h and io.h are the same file. So renamed these to IO1.c and IO1.h, given we have IO2.c and IO3.c already, updated the myriad of places they were included from and reran make depend too. ------------------------------------------------------------------------ r3517 | daviesrob | 2013-11-20 15:19:00 +0000 (Wed, 20 Nov 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Stopped parse_acd_tag from returning pointers beyond the end of the string. If parse_acd_tag tag was handed a string that did not end in \n, it would return a pointer to 1 past the NUL byte on the end. This would cause it to attempt to read uninitialized memory when called next time. ------------------------------------------------------------------------ r3516 | jkbonfield | 2013-11-20 15:15:10 +0000 (Wed, 20 Nov 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/readpair.c Cosmetic code tidyup. Lines longer than 80 characters offend me! ------------------------------------------------------------------------ r3515 | jkbonfield | 2013-11-20 15:14:21 +0000 (Wed, 20 Nov 2013) | 3 lines Changed paths: M /staden/trunk/src/ChangeLog M /staden/trunk/src/configure.in Nearing the next release so updated version and changelog. More to go still, specifically Windows and a few bugs uncovered. ------------------------------------------------------------------------ r3514 | jkbonfield | 2013-11-20 15:13:41 +0000 (Wed, 20 Nov 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl Minor optimisation ------------------------------------------------------------------------ r3513 | jkbonfield | 2013-11-20 15:12:00 +0000 (Wed, 20 Nov 2013) | 5 lines Changed paths: M /staden/trunk/src/staden.profile Added $STADENROOT/lib to LD_LIBRARY_PATH too so we can add any third-party libraries (ie not part of the staden package) in there to override any system versions or to ensure libraries exist. This is particularly relevant to the MacOS X build. ------------------------------------------------------------------------ r3512 | jkbonfield | 2013-11-20 15:10:29 +0000 (Wed, 20 Nov 2013) | 2 lines Changed paths: M /staden/trunk/src/Makefile.in Make distsrc now also generates a tarball ------------------------------------------------------------------------ r3511 | jkbonfield | 2013-11-20 15:10:05 +0000 (Wed, 20 Nov 2013) | 7 lines Changed paths: M /staden/trunk/src/gap5/gap5_cmd.tcl Make FIJ and Find Read Pairs sub-commands open in read-only mode as they have no strong need to be read-write. However possibly we should add a -rw command line option to force read-write still as some actions of these tools could generate data which is best cached (eg consensus, read-pair locations). ------------------------------------------------------------------------ r3510 | daviesrob | 2013-11-20 09:34:09 +0000 (Wed, 20 Nov 2013) | 13 lines Changed paths: M /staden/trunk/src/gap5/readpair.c Fix bugs in spanning_pairs when run in end_all mode. When spanning_pairs had to use sequence_get_position to look up pair positions, it was not filling in all the needed parts of r2, leading to the use of uninitialized values later on. It now fills in everything that is needed, which makes the results much more deterministic. This only affected end_all mode, as none of the others needed to look up pairs by this method. Using sequence_get_position could also bring back links to contigs that were not in the original list passed to spanning_pairs. These are now filtered out. This also fixes a failed assertion in Find Internal Joins that was triggered by spanning_pairs returning such unexpected links. ------------------------------------------------------------------------ r3508 | jkbonfield | 2013-11-07 16:53:38 +0000 (Thu, 07 Nov 2013) | 7 lines Changed paths: M /staden/trunk/src/MacOSX/Gap4.app/Contents/Info.plist A /staden/trunk/src/MacOSX/Gap4.app/Contents/MacOS/gap4 (from /staden/trunk/src/MacOSX/Gap4.app/Contents/MacOS/run.sh:3506) D /staden/trunk/src/MacOSX/Gap4.app/Contents/MacOS/run.sh M /staden/trunk/src/MacOSX/Gap5.app/Contents/Info.plist A /staden/trunk/src/MacOSX/Gap5.app/Contents/MacOS/gap5 (from /staden/trunk/src/MacOSX/Gap5.app/Contents/MacOS/run.sh:3506) D /staden/trunk/src/MacOSX/Gap5.app/Contents/MacOS/run.sh M /staden/trunk/src/MacOSX/Makefile M /staden/trunk/src/MacOSX/Pregap4.app/Contents/Info.plist A /staden/trunk/src/MacOSX/Pregap4.app/Contents/MacOS/pregap4 (from /staden/trunk/src/MacOSX/Pregap4.app/Contents/MacOS/run.sh:3506) D /staden/trunk/src/MacOSX/Pregap4.app/Contents/MacOS/run.sh M /staden/trunk/src/MacOSX/Spin.app/Contents/Info.plist D /staden/trunk/src/MacOSX/Spin.app/Contents/MacOS/run.sh A /staden/trunk/src/MacOSX/Spin.app/Contents/MacOS/spin (from /staden/trunk/src/MacOSX/Spin.app/Contents/MacOS/run.sh:3506) M /staden/trunk/src/MacOSX/Trev.app/Contents/Info.plist D /staden/trunk/src/MacOSX/Trev.app/Contents/MacOS/run.sh A /staden/trunk/src/MacOSX/Trev.app/Contents/MacOS/trev (from /staden/trunk/src/MacOSX/Trev.app/Contents/MacOS/run.sh:3506) M /staden/trunk/src/MacOSX/wrapper.c Replaced the wrapper script with a shell script now I figured out what was causing the failures in the past (Launch Service changes Contents/MacOS/gap5 to Contents/MacOS/Gap5 and then caused the sed part to fail). This avoids the whole 32-bit vs 64-bit Carbon woes. ------------------------------------------------------------------------ r3507 | jkbonfield | 2013-11-06 17:38:19 +0000 (Wed, 06 Nov 2013) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_index_common.c Fixed the merge sorting of the sequence name index when only one file is needed. In this case it was closing the file descriptor early and then attempting to read it. ------------------------------------------------------------------------ r3506 | jkbonfield | 2013-11-06 17:03:39 +0000 (Wed, 06 Nov 2013) | 2 lines Changed paths: A /staden/trunk/src/MacOSX/Gap4.app/Contents/MacOS/run.sh A /staden/trunk/src/MacOSX/Gap5.app/Contents/MacOS/run.sh A /staden/trunk/src/MacOSX/Makefile A /staden/trunk/src/MacOSX/Pregap4.app/Contents/MacOS/run.sh A /staden/trunk/src/MacOSX/Spin.app/Contents/MacOS/run.sh A /staden/trunk/src/MacOSX/Trev.app/Contents/MacOS/run.sh M /staden/trunk/src/MacOSX/wrapper.c Added code to help build and update the application bundles. ------------------------------------------------------------------------ r3505 | jkbonfield | 2013-11-06 09:19:24 +0000 (Wed, 06 Nov 2013) | 2 lines Changed paths: M /staden/trunk/src/README.build M /staden/trunk/src/staden.profile MacOS X updates for building and running. ------------------------------------------------------------------------ r3504 | jkbonfield | 2013-10-31 09:32:16 +0000 (Thu, 31 Oct 2013) | 2 lines Changed paths: M /staden/trunk/src/eba/qual.c Removed CTF support as it's been purged from io_lib. ------------------------------------------------------------------------ r3497 | daviesrob | 2013-10-24 15:33:32 +0100 (Thu, 24 Oct 2013) | 54 lines Changed paths: M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/contig_editor.tcl A /staden/trunk/src/gap5/gap5_del_test.tcl M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tg_tcl.c Much work on base deletion and associated undo. Added flag for unmapped seqs. Re-factor edit_delete_base to pull consensus and sequence cases into separate functions. Remove reads when the last base is deleted, unless it's the last base of the last read in the contig, in which case do nothing. Add undo command to add removed reads back to the assembly. Break link with pair for sequences that have been removed. When adding reads (for undo), restore pair link for paired reads. Reset orientation for removed sequences to the original one so that undo can get them the right way round. Set a flag on sequences that get unmapped, and set the bin number to -1. Upgrade various routines to sensibly handle sequences that are unmapped. Correctly handle shrinking and removing annotations, and replacing or growing them for undo. Make anno_ele move tcl function use anno_get_range to get the object record number. Contig delete base/insert base only delete/insert to visible parts of reads, so remove cut-off bases from the pileup stored in the undo array. Allow contig_insert_base and contig_delete_base to insert/delete the first visible base. When inserting bases (for undo), ensure sequences get promoted to a new bin if they exceed the boundaries on the one that they are in. Added new sequence_move function to tg_sequence.c to do this. Get the correct object record number when moving contig annotations. Made delete consensus base move the entire contig left when removing the leftmost base. Rewrote sequence_range_length (used to fix sequence position in a contig after it has changed length). The new version is simpler and does a better job of fixing the contig start/end positions (both clipped and unclipped). Make consensus_valid_range better at handling completely clipped reads. Set clipped_timestamp to zero in bin_add_to_range and bin_remove_item_from_bin to force recalculation of clipped start/end. Recalculate contig start/end earlier in contig_insert_base_common so contig iterators used later start from the correct point. Included somewhat dodgy gap5_del_test.tcl script to exercise the delete and undo code. Currently only really tests the consensus case. ------------------------------------------------------------------------ r3496 | awhitwham | 2013-10-23 14:35:08 +0100 (Wed, 23 Oct 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tg_index.c M /staden/trunk/src/gap5/tg_index.h M /staden/trunk/src/gap5/tg_index_common.c M /staden/trunk/src/gap5/tg_index_common.h Made the name sorting code more efficient. Should now work with larger numbers of names. Still needs work. ------------------------------------------------------------------------ r3491 | jkbonfield | 2013-10-17 09:49:12 +0100 (Thu, 17 Oct 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_extend.c Fixed Extend Contigs to cope with columns containing pads. ------------------------------------------------------------------------ r3490 | jkbonfield | 2013-10-16 12:34:21 +0100 (Wed, 16 Oct 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/contig_extend.c M /staden/trunk/src/gap5/contig_extend.h M /staden/trunk/src/gap5/contig_extend.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/newgap5_cmds.c Fixed a bug in the Contig Extend code, where extensions containing zero base matches would sometimes trim the sequence rather than extend it. Also added Contig Trim, to clip back straggly low-depth contig ends. ------------------------------------------------------------------------ r3488 | jkbonfield | 2013-10-14 16:56:14 +0100 (Mon, 14 Oct 2013) | 8 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl M /staden/trunk/src/gap5/gap_range.c Changed the min/max mapping quality sliders to be the actual mapping quality instead of 3*mqual. (That was an error, multiplied up purely for obtaining a colour.) Also changed the default colour mode to be minimum mapping quality instead of average, as minimum is typically what we want when evaluating the reliability of an assembly. ------------------------------------------------------------------------ r3487 | jkbonfield | 2013-10-11 14:45:07 +0100 (Fri, 11 Oct 2013) | 5 lines Changed paths: M /staden/trunk/src/Misc/misc.h M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/consensus.h M /staden/trunk/src/gap5/tg_sequence.c Added a consensus_pileup() function to iterate through a contig in column by column order instead of sequence by sequence. This reuses the MIN4 macro from tg_sequence, so I moved this to misc.h ------------------------------------------------------------------------ r3486 | jkbonfield | 2013-10-11 11:33:47 +0100 (Fri, 11 Oct 2013) | 3 lines Changed paths: M /staden/trunk/src/ac_stubs/ax_lib_samtools.m4 Even though we no longer use samtools, here are the corrected M4 macros that work with Ubuntu Precise and with multi-threaded samtools. ------------------------------------------------------------------------ r3485 | jkbonfield | 2013-10-10 12:48:31 +0100 (Thu, 10 Oct 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c M /staden/trunk/src/gap5/auto_break.h M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h Split the singleton and spanning read pair categories/scores into uniquely and non-uniquely mapping sets. ------------------------------------------------------------------------ r3484 | jkbonfield | 2013-10-09 11:19:36 +0100 (Wed, 09 Oct 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/do_fij.c Removal of debugging output. ------------------------------------------------------------------------ r3483 | jkbonfield | 2013-10-09 11:19:08 +0100 (Wed, 09 Oct 2013) | 10 lines Changed paths: M /staden/trunk/src/gap5/do_fij.c Corrected check_overlap_pairs() to only count failed pairs in the overlap region specified. This isn't ideal, but at least it's the same count used for good pairs, so it doesn't artificially think the worst about all joins. Ideally we should switch to the pair analysis used in auto-break, on a simulated joined up contig. (Or maybe just make the join in a child io, evaluate it, and then destroy the io). ------------------------------------------------------------------------ r3482 | jkbonfield | 2013-10-08 15:11:40 +0100 (Tue, 08 Oct 2013) | 10 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tg_cache.c Switch to allocating sequence record numbers at the time of finding the last base in a sequence rather than the first base. This means we can correct estimate the sequence of the SeqBlock. Also updated the maximum SeqBlock size to 1Mb (was 250Kb). Flush more often if the total number of bases added is high. This is useful when dealing with technologies using very long sequence lengths as it writes data more often (although it doesn't yet purge from the cache, as that also needs knowledge of object size - TO DO). ------------------------------------------------------------------------ r3481 | jkbonfield | 2013-10-08 12:27:37 +0100 (Tue, 08 Oct 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c When exporting in SAM, don't just take any foo/bar to mean foo, but explicitly check for foo/1 and foo/2 as they are the only forms where we have historically meant "foo" and not foo/bar as a name. This was tripping up on PacBio generated read names. ------------------------------------------------------------------------ r3480 | jkbonfield | 2013-10-07 15:21:34 +0100 (Mon, 07 Oct 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap5_cmd.tcl Changed default parameters to be less severe. These have been tuned for a few specific datasets on known problems. ------------------------------------------------------------------------ r3479 | jkbonfield | 2013-10-07 15:20:58 +0100 (Mon, 07 Oct 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c Bug fix to correct buffer underrun on clip_depth[] ------------------------------------------------------------------------ r3478 | jkbonfield | 2013-10-07 15:20:25 +0100 (Mon, 07 Oct 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap_range.c Protect against potentially corrupted databases leading to crashes. ------------------------------------------------------------------------ r3477 | jkbonfield | 2013-10-04 17:11:07 +0100 (Fri, 04 Oct 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/tg_library.c Various fixes to prevent crashes when dealing with inconsistent data. ------------------------------------------------------------------------ r3476 | jkbonfield | 2013-10-04 17:10:48 +0100 (Fri, 04 Oct 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5_cmd.tcl Exposed -end_skip param to command line interface too. ------------------------------------------------------------------------ r3475 | jkbonfield | 2013-10-04 17:09:40 +0100 (Fri, 04 Oct 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c M /staden/trunk/src/gap5/auto_break.h M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h Added the option to skip problems near the ends of contigs, as these are often poor quality. ------------------------------------------------------------------------ r3474 | jkbonfield | 2013-10-04 15:02:43 +0100 (Fri, 04 Oct 2013) | 24 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c Many auto_break tidyups. * Don't break on every negative issue. Instead look for lowest -ve issue within a short span and break that, under the assumption that the other neighbouring ones will get fixed in the process (we don't yet check this so it'd require a second pass). * Searches for soft clipping errors where more than a certain percentage of reads are clipped at the same base position. * Be more rigid in the dinucleotide repeat screening to try and speed up the program. It didn't add to much I think. * Improved detection of library insertion size so that we don't count reads too distant from the problem as verifying or conflicting against a candidate break. This is particularly necessary when dealing with mixed libraries of differing sizes. * (Debugging tool: gc() function to compute GC content over a given region. It was used in investigations of whether GC biases insertion size.) * Gap merging now applies to contig end gaps too. ------------------------------------------------------------------------ r3473 | jkbonfield | 2013-09-27 15:59:25 +0100 (Fri, 27 Sep 2013) | 10 lines Changed paths: M /staden/trunk/src/gap5/g-alloc.c Added some debugging code, now #ifdefed out, to time how long the heap_allocate function takes and how many iterations looking for blocks. The intention is to bail out after a fixed number of iterations incase of pathologically bad conditions. Also bumped up the assertion size in the (debug) heap checker as we were hitting it on real data. ------------------------------------------------------------------------ r3472 | jkbonfield | 2013-09-27 15:57:12 +0100 (Fri, 27 Sep 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Delete Contigs now flushes per contig. This seems excessive, but it reduces the memory usage of the B+Tree name index (at the expense of slowing things down as we may rewrite the same nodes). [This was causing Delete Contigs on HAEM to use 32Gb of memory up.] ------------------------------------------------------------------------ r3471 | jkbonfield | 2013-09-27 15:56:08 +0100 (Fri, 27 Sep 2013) | 5 lines Changed paths: M /staden/trunk/src/gap5/b+tree2.c Fixed a reference count leak in the B+Tree code. Also modified the TEST_MAIN debugging code to check for reference counting errors. ------------------------------------------------------------------------ r3469 | jkbonfield | 2013-09-23 10:03:42 +0100 (Mon, 23 Sep 2013) | 5 lines Changed paths: M /staden/trunk/src/gap5/depth_track.c Removed the -5 adjustment from Y position depth tracks. I'm not sure why it was there and it made the plot incorrect, implying we don't hit zero when we do. ------------------------------------------------------------------------ r3465 | jkbonfield | 2013-09-19 13:39:49 +0100 (Thu, 19 Sep 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c M /staden/trunk/src/gap5/auto_break.h M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h Updated auto_break. It now has more categories of read pair, breaking them down into ones with uniquely mapping reads and non-unique. There is now also the option to detect conesnsus repeat words and filter by them. ------------------------------------------------------------------------ r3464 | jkbonfield | 2013-09-16 12:14:38 +0100 (Mon, 16 Sep 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl M /staden/trunk/src/gap5/depth_track.c M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/gap_range.h M /staden/trunk/src/gap5/template_display.c The average template insert size is now drawn superimposed on top of the template display. ------------------------------------------------------------------------ r3463 | jkbonfield | 2013-09-16 10:29:13 +0100 (Mon, 16 Sep 2013) | 3 lines Changed paths: M /staden/trunk/src/gap4/GTAGDB M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/gap5_cmd.tcl Minor tweaks to auto-break; adding the correct tag type and an option to prevent breakage (just tagging). ------------------------------------------------------------------------ r3462 | jkbonfield | 2013-09-16 10:24:24 +0100 (Mon, 16 Sep 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/newgap5_cmds.c Fixed Import Reads to work with the newer bttmp_sort_t structures. (It was crashing before.) ------------------------------------------------------------------------ r3459 | jkbonfield | 2013-09-11 12:21:37 +0100 (Wed, 11 Sep 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c Tags are now addwed to the contigs prior to breaking. ------------------------------------------------------------------------ r3458 | jkbonfield | 2013-09-11 11:55:53 +0100 (Wed, 11 Sep 2013) | 4 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Break contig now duplicates consensus tags when they overlap both the left and right contig. This was the gap4 behaviour and also what we need for auto_break. ------------------------------------------------------------------------ r3457 | jkbonfield | 2013-09-11 10:10:00 +0100 (Wed, 11 Sep 2013) | 4 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Added run_cons_command function. It's unused in the existing code, but allows for local invocation from gap5rc.local menus. Eg to run Dotter on an underlined section of the sequence. ------------------------------------------------------------------------ r3456 | jkbonfield | 2013-09-11 10:08:53 +0100 (Wed, 11 Sep 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_anno.c Improved error checking in anno_ele_add() ------------------------------------------------------------------------ r3455 | jkbonfield | 2013-09-11 10:08:16 +0100 (Wed, 11 Sep 2013) | 5 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tg_index_common.c Call contig_visible_start/end after importing each contig so it can correct for any mistakes in the SAM file where annotations overlap the visible end of the contig. This helps to make gap5->sam->gap5 round trips a better auto-fix mechanism. ------------------------------------------------------------------------ r3454 | jkbonfield | 2013-09-09 11:38:01 +0100 (Mon, 09 Sep 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/map_reads.tcl Type of bam vs bwa. See https://sourceforge.net/p/staden/patches/10/ ------------------------------------------------------------------------ r3451 | jkbonfield | 2013-09-06 17:04:27 +0100 (Fri, 06 Sep 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl M /staden/trunk/src/gap5/depth_track.c M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/gap_range.h M /staden/trunk/src/gap5/tclIndex M /staden/trunk/src/gap5/template_display.c The template display can now filter by libraries. Also a lot of the template display options now come from the gap5rc file. There is still more to be done here though, such as allowing the startup list of tracks. ------------------------------------------------------------------------ r3450 | jkbonfield | 2013-09-06 17:02:56 +0100 (Fri, 06 Sep 2013) | 2 lines Changed paths: D /staden/trunk/src/gap5/template_display.tcl Removed defunct gap4 code. ------------------------------------------------------------------------ r3449 | daviesrob | 2013-09-06 11:28:47 +0100 (Fri, 06 Sep 2013) | 7 lines Changed paths: M /staden/trunk/src/gap5/g-files.c Fix double free if the database doesn't exist. find_db_files passed values back in *fndb and *fnaux even if it failed, and had therefore called free on them. This cause a segfault when an invalid database name was given on the command line. Now it only sets them if it succeeds. ------------------------------------------------------------------------ r3448 | daviesrob | 2013-09-05 12:26:32 +0100 (Thu, 05 Sep 2013) | 19 lines Changed paths: M /staden/trunk/src/gap5/actf.c M /staden/trunk/src/gap5/g-files.c M /staden/trunk/src/gap5/g-files.h M /staden/trunk/src/gap5/g-struct.c M /staden/trunk/src/gap5/g-struct.h M /staden/trunk/src/gap5/tg_gio.c Fix bug where g_check_header used the wrong .aux filename. g_check_header constructed the wrong name for the .g5x file when the database name was given with a suffix on the command-line. This caused it to incorrectly complain about the database being renamed, and (due to it not stopping then and checking for the wrong value from gfile->low_level_vector) also that the timestamp had changed. g_open_file now stores the actual aux file name in the GFile struct, so g_check_header can use it later. g_check_header now calls panic_shutdown() immediately on failure, and also checks for the right return value from gfile->low_level_vector. Took the opportunity to remove various fixed-size buffers when dealing with filenames, especially in find_db_files and actf_lock. Fixed an invalid read in open_log_file when log files are enabled and the database name is very short. ------------------------------------------------------------------------ r3447 | jkbonfield | 2013-09-05 12:20:37 +0100 (Thu, 05 Sep 2013) | 17 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c M /staden/trunk/src/gap5/auto_break.h M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h Split the unknown score into (sligtly too) large and (contig) spanning scores. Tweaks to the auto-break parameters: - Increased MIN_OVERLAP - Valid read pairs need to span the region by at least MIN_OVERLAP rather than just 1 bp. We may wish to improve this further by more than that amount; eg based on library insert size. - Read mapping quality is taken into account for the good score. Low mapping still counts, but at about 1/3rd benefit. Added some currently unusued code for dump_template_dist(). This is an experiment to see whether sampling the insert size distribution at a specific consensus base is accurate enough to predict small indels. [It seems yes, if small is >20bp or so.] ------------------------------------------------------------------------ r3446 | jkbonfield | 2013-09-05 12:15:12 +0100 (Thu, 05 Sep 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h Added a CITER_PAIR option to the contig iterators to call the read-pairing code to update COMP1/2 flags. This isn't perfect as it's done in blocks, but for the reads that get their pairs recomputed the timestamp is updated meaning code that explicitly calls sequence_get_range_pair_position will now be far faster. ------------------------------------------------------------------------ r3445 | jkbonfield | 2013-09-05 12:13:51 +0100 (Thu, 05 Sep 2013) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_sequence.c sequence_get_range_pair_position() now also updates GRANGE_FLAG_COMP[12] flags for this range (but not the pair) if the contig is known. ------------------------------------------------------------------------ r3444 | jkbonfield | 2013-09-05 12:12:29 +0100 (Thu, 05 Sep 2013) | 10 lines Changed paths: M /staden/trunk/src/seq_utils/filter_words.c Fix to the various filter functions. Previously they struck out up to the maximum score whenever the running total crossed zero, but that means a match like ...==========.....=====.. would only strike out the first match as the bit between the two isn't enough to reduce the score to zero while the aggregate score still isn't higher than the peak score after the first match. It now resets the score to -1 (and strikes out the previous match if appropriate) whenever the drop is higher than the minimum score for a match. ------------------------------------------------------------------------ r3443 | daviesrob | 2013-08-16 12:18:18 +0100 (Fri, 16 Aug 2013) | 5 lines Changed paths: M /staden/trunk/src/gap5/gap5rc_menu_full Make selecting highlight disagreements mode also turn it on. Saves having to open the menu twice - once to turn H.D. on, and again to select the mode. ------------------------------------------------------------------------ r3442 | daviesrob | 2013-08-15 11:05:00 +0100 (Thu, 15 Aug 2013) | 12 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c Fixed reference count on libraries in auto break. compute_lib_type was not calling cache_incr on the library_t pointers that it stored in a hash table. This meant the pointers could go stale if the library information later got pushed out of the cache, leading to a segmentation fault. compute_lib_type now calls cache_incr on the library_t pointer to prevent this. confirm_gaps calls cache_decr on all of the items in the hash table when it has finished with them. ------------------------------------------------------------------------ r3441 | jkbonfield | 2013-08-09 16:41:31 +0100 (Fri, 09 Aug 2013) | 10 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c M /staden/trunk/src/gap5/auto_break.h M /staden/trunk/src/gap5/do_fij.c M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h M /staden/trunk/src/gap5/tg_tcl.c More auto-break updates. - Weightings for scores are now adjustable external and are gap5_cmd parameters. - Tweaks to default scores - Allow for a minimum score (so not just 0). Also updated sequence_get_range_pair_position() to take extra argument indicating the contigs to check timestamps on. This is useful if we know both ends for the pair already. ------------------------------------------------------------------------ r3440 | jkbonfield | 2013-08-09 12:22:21 +0100 (Fri, 09 Aug 2013) | 9 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c More rigorous calculation of invalid read-pairs. We ensure contig-spanning pairs have an sequence pointing towards the problem rather than away from it, and also that it's not close to the contig end and pointing off it as it may then be a real join. Singletons for reads from paired end libraries now also get their own scoring category (currently set to 0 while I test they're worth). ------------------------------------------------------------------------ r3436 | jkbonfield | 2013-08-07 12:16:56 +0100 (Wed, 07 Aug 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c Removal of debugging output. ------------------------------------------------------------------------ r3435 | jkbonfield | 2013-08-07 11:59:20 +0100 (Wed, 07 Aug 2013) | 5 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c Fixed the calculation of insert size for swapped fwd/rev pairs: rev--> <--fwd. Also adjusted the min/max to be 3*sd instead of 2*sd. ------------------------------------------------------------------------ r3434 | jkbonfield | 2013-08-07 11:24:50 +0100 (Wed, 07 Aug 2013) | 2 lines Changed paths: M /staden/trunk/src/ChangeLog M /staden/trunk/src/NEWS M /staden/trunk/src/ReleaseNotes Collated changes since the last official release. ------------------------------------------------------------------------ r3433 | jkbonfield | 2013-08-06 11:19:32 +0100 (Tue, 06 Aug 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_struct.h Deleted contigs now get flagged specifically as DELETED. Calling cache_search on a deleted contig now returns NULL. This fixes crashes where people could delete a contig and then attempt to edit the contig via the old #record_number. ------------------------------------------------------------------------ r3432 | jkbonfield | 2013-08-06 10:17:36 +0100 (Tue, 06 Aug 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/auto_break.c Fix minor printf formatting error. ------------------------------------------------------------------------ r3431 | jkbonfield | 2013-08-06 10:15:48 +0100 (Tue, 06 Aug 2013) | 2 lines Changed paths: A /staden/trunk/src/gap5/auto_break.c A /staden/trunk/src/gap5/auto_break.h Adding auto_break code itself (forgot to svn add it). ------------------------------------------------------------------------ r3430 | jkbonfield | 2013-08-06 10:08:57 +0100 (Tue, 06 Aug 2013) | 7 lines Changed paths: M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/newgap5_cmds.c Implemented auto_break command for gap5_cmd. This is similar to Gap4's auto-splitter, but primarily uses mapping qualities over word uniqueness analysis (although it still contains low complexity checking). It identifies suspicious joins and then verifies them via read pairs. ------------------------------------------------------------------------ r3429 | jkbonfield | 2013-08-06 10:01:55 +0100 (Tue, 06 Aug 2013) | 2 lines Changed paths: M /staden/trunk/src/seq_utils/dna_utils.c M /staden/trunk/src/seq_utils/dna_utils.h M /staden/trunk/src/seq_utils/filter_words.c M /staden/trunk/src/seq_utils/filter_words.h Optimised ambiguity2basebit and filter_words_local functions. ------------------------------------------------------------------------ r3428 | jkbonfield | 2013-08-01 17:49:08 +0100 (Thu, 01 Aug 2013) | 12 lines Changed paths: M /staden/trunk/src/gap5/g-files.c M /staden/trunk/src/gap5/g-request.c Improved on the g_check_header() and related functions. This attempts to spot when the global .g5x aux timestamp changes under the feet of the current process, indicating that someone was naughty and either removed the BUSY file to open up a second r/w gap5 or copied another database version over the top of our own one. Unfortunately due to filesystem caching it was too slow to spot a lot of errors. We now use a new filedescriptor each time to do the disk vs memory comparison and we also explicitly call fsync after updating this to ensure the time is flushed out. ------------------------------------------------------------------------ r3427 | daviesrob | 2013-07-30 14:31:45 +0100 (Tue, 30 Jul 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/hash_lib.c Ensure min_match is always at least word_length in init_hash8n. Prevents a segfault in reps_nocount. ------------------------------------------------------------------------ r3426 | awhitwham | 2013-07-29 10:26:53 +0100 (Mon, 29 Jul 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_index.c M /staden/trunk/src/gap5/tg_index.h M /staden/trunk/src/gap5/tg_index_common.c M /staden/trunk/src/gap5/tg_index_common.h Now able to control where tmp files go using either TMP_DIR or TEMP environment variables. Also changed the sorting routine for the name index so it does not use the standard unix sort. This is an interim release as there is too much code duplication in the sorting functions. ------------------------------------------------------------------------ r3424 | jkbonfield | 2013-07-18 17:53:37 +0100 (Thu, 18 Jul 2013) | 7 lines Changed paths: M /staden/trunk/src/gap5/do_fij.c Updated FIJ calculation of percentage good read-pairs. It was only counting the number of read-pairs between contig A and B (for efficiency), but we needed to know the number of read-pairs between contigs A+B and any other contig. We now also compute this when necessary. ------------------------------------------------------------------------ r3423 | jkbonfield | 2013-07-18 17:51:35 +0100 (Thu, 18 Jul 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/gap_range.c Be more aggressive in the clearing of r->pair_contig if the timestamp is invalid. We were seeing strange effects when data has been joined into the same contig. ------------------------------------------------------------------------ r3422 | daviesrob | 2013-07-12 12:24:20 +0100 (Fri, 12 Jul 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/import_contigs.tcl Set repad to 0 if not merging contigs, and ensure the names are indexed ------------------------------------------------------------------------ r3417 | jkbonfield | 2013-07-05 12:22:17 +0100 (Fri, 05 Jul 2013) | 5 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/tk_utils/tclIndex M /staden/trunk/src/tk_utils/utils.tcl Added a mechanism to swallow auto-repeat generated keypresses (under Unix X11 only) where the program is lagging and failing to keep up. This is utilised in the contig editor. ------------------------------------------------------------------------ r3416 | jkbonfield | 2013-07-05 12:20:45 +0100 (Fri, 05 Jul 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/find_oligo.c Add "#number name" to seq_hits instead of "name", as name may not be unique. ------------------------------------------------------------------------ r3415 | jkbonfield | 2013-07-05 12:16:09 +0100 (Fri, 05 Jul 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Code layout tidyness. ------------------------------------------------------------------------ r3414 | jkbonfield | 2013-07-04 17:19:43 +0100 (Thu, 04 Jul 2013) | 4 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Try to fix cases of lost focus, where the user clicking in the toplevel window grants focus to the toplevel window (eg .e1) but we require it to be given to the internal sheet component. ------------------------------------------------------------------------ r3413 | jkbonfield | 2013-07-04 17:14:21 +0100 (Thu, 04 Jul 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/fij.tcl Fixed a bug where trying to bring up a second FIJ window when one already existed was clearing the $w.ops() states. ------------------------------------------------------------------------ r3412 | jkbonfield | 2013-07-04 12:26:01 +0100 (Thu, 04 Jul 2013) | 2 lines Changed paths: M /staden/trunk/src/seq_utils/dna_utils.c Added the length to the alignment pretty-printer. ------------------------------------------------------------------------ r3411 | jkbonfield | 2013-07-04 12:17:06 +0100 (Thu, 04 Jul 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/fij.tcl Changed keybindings for tab traversal as straight arrow keys prevents editing within entry fields. ------------------------------------------------------------------------ r3410 | jkbonfield | 2013-07-04 12:07:23 +0100 (Thu, 04 Jul 2013) | 12 lines Changed paths: M /staden/trunk/src/gap5/fij.tcl Fixed issues with the FIJ GUI: - The cancel button now correctly destroys the window. - Selecting libraries works again. - Updating the contig identifier by clicking in the contig list or contig selector no longer errors. (In some cases it still only updates 1 of the 2 Ids, which I am still investigating.) ------------------------------------------------------------------------ r3409 | jkbonfield | 2013-07-02 16:55:22 +0100 (Tue, 02 Jul 2013) | 15 lines Changed paths: M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/fij.tcl M /staden/trunk/src/gap5/gap5rc Minor tweaks to new FIJ: - %age mismatch is back to 30 by default as users suggested that they like the high default as it allows spotting joins that were missed due to misassembly errors (requiring manual editing before making of course). - The FIJ parameters are now listed at the start of FIJ rather than the end, meaning the end line still contains the summary of number of joins found. - Fixed a bug where the last edited parameters were being used as the defaults for the next FIJ window. ------------------------------------------------------------------------ r3408 | jkbonfield | 2013-07-02 14:57:29 +0100 (Tue, 02 Jul 2013) | 7 lines Changed paths: M /staden/trunk/src/gap5/contig_id.tcl M /staden/trunk/src/gap5/do_fij.c M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/fij.tcl M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h M /staden/trunk/src/gap5/readpair.c Added min/max (joined) depth, max overlap length, containment vs end, minimum valid read-pair percentage and unique-ends filters to Find Internal Joins. Also updated the gap5_cmd tool and reorganised the FIJ GUI to be smaller, using a tabbed notebook. ------------------------------------------------------------------------ r3407 | jkbonfield | 2013-07-02 14:55:17 +0100 (Tue, 02 Jul 2013) | 4 lines Changed paths: M /staden/trunk/src/gap5/check_assembly.c M /staden/trunk/src/gap5/consen.c M /staden/trunk/src/gap5/consen.h M /staden/trunk/src/gap5/find_oligo.c M /staden/trunk/src/gap5/find_repeats.c M /staden/trunk/src/gap5/restriction_enzymes.c Removed the use of io_clnbr() in various plots. These just caused the "Information" query to take excessively long while gaining nothing important. ------------------------------------------------------------------------ r3404 | jkbonfield | 2013-06-26 12:24:22 +0100 (Wed, 26 Jun 2013) | 5 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Fixed a bug with uninitialised memory in unlink_read. It sometimes failed when it should have succeeded, but didn't corrupt data. The error seen by the user was "failure to unlink sequence #"... ------------------------------------------------------------------------ r3393 | jkbonfield | 2013-06-24 09:39:44 +0100 (Mon, 24 Jun 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/fij.c Flush auto-join joins every contig rather than only at the end. ------------------------------------------------------------------------ r3385 | jkbonfield | 2013-06-20 11:17:31 +0100 (Thu, 20 Jun 2013) | 7 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Fixed a cache ref count bug in consensus code, when faced with inconsistent consensus records. Added further checks for inconsistent cached consensus sequences, now checking that range length matches seq length. I do not know why this differs at times, but this works around such data corruptions. ------------------------------------------------------------------------ r3384 | daviesrob | 2013-06-19 15:30:38 +0100 (Wed, 19 Jun 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Clear the selection in edview_renumber if it is the contig id that is changing. ------------------------------------------------------------------------ r3382 | awhitwham | 2013-06-19 15:25:18 +0100 (Wed, 19 Jun 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Set panedwindow opaqueresize to resolve the different defaults between Tk 8.4 and 8.5. Removed the proxy sync_panes code as it is no longer needed. ------------------------------------------------------------------------ r3373 | daviesrob | 2013-06-13 17:17:17 +0100 (Thu, 13 Jun 2013) | 7 lines Changed paths: M /staden/trunk/src/gap5/check_assembly.c M /staden/trunk/src/gap5/cs-object.c M /staden/trunk/src/gap5/cs-object.h M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/editor_join.h M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/fij.h M /staden/trunk/src/gap5/find_oligo.c M /staden/trunk/src/gap5/find_repeats.c M /staden/trunk/src/gap5/find_repeats.h M /staden/trunk/src/gap5/readpair.c M /staden/trunk/src/gap5/readpair.h M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_sequence.h Fixed compiler warnings and bug in cache_item_remove. Sorted several compiler warnings, mainly due to missing prototypes. Fixed bug in cache_item_remove where it attempted to cache_rw the wrong pointer for GT_Scaffold objects. ------------------------------------------------------------------------ r3371 | daviesrob | 2013-06-13 15:07:04 +0100 (Thu, 13 Jun 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_sequence.c Fixed reference count leak in sequence_get_clipped_position ------------------------------------------------------------------------ r3370 | jkbonfield | 2013-06-13 15:00:48 +0100 (Thu, 13 Jun 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_selector.tcl Removed object reference count leak in PopUpCSContigMenu(). ------------------------------------------------------------------------ r3365 | jkbonfield | 2013-06-10 16:24:14 +0100 (Mon, 10 Jun 2013) | 4 lines Changed paths: M /staden/trunk/src/gap5/consen.tcl Also fixed the contig names output from get_consensus to use [$c get_name] instead of the original identifier (which is possibly a reading name of #number). ------------------------------------------------------------------------ r3364 | jkbonfield | 2013-06-10 11:13:18 +0100 (Mon, 10 Jun 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/consen.tcl get_consensus no longer outputs the same contig multiple times if it is specified by a reading list with multiple seqs per contig. ------------------------------------------------------------------------ r3363 | jkbonfield | 2013-06-03 16:50:05 +0100 (Mon, 03 Jun 2013) | 16 lines Changed paths: M /staden/trunk/src/gap5/g-request.c Observed a database corruption where the same record had been freed twice in a row, forming a tight loop in the free list. This then subsequently causes the same record to be allocated twice in a row, causing mayhem. This workaround is in two parts. 1) g_free_rec_ (which returns a free record, not frees it) now checks for the tight loop and corrects the free list if it finds this case, returning G_NO_REC too (ie create a new record as none are free). 2) g_unlock_views with a view of flag G_VIEW_DELETED now does an assertion for attempting to delete it twice in a row. I've no idea where this happens, but if it happens again then the assert should help to pinpoint where. ------------------------------------------------------------------------ r3361 | jkbonfield | 2013-05-31 11:35:53 +0100 (Fri, 31 May 2013) | 2 lines Changed paths: M /staden/trunk/src/copy_reads/Makefile M /staden/trunk/src/gap4/Makefile M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/prefinish/Makefile M /staden/trunk/src/pregap4/Makefile M /staden/trunk/src/spin/Makefile M /staden/trunk/src/trev/Makefile Bug fixes to "make distsrc". ------------------------------------------------------------------------ r3360 | jkbonfield | 2013-05-31 11:24:28 +0100 (Fri, 31 May 2013) | 3 lines Changed paths: M /staden/trunk/src/Makefile.in M /staden/trunk/src/gap4/tkAppInit.c M /staden/trunk/src/gap5/editor_search.c M /staden/trunk/src/gap5/tkAppInit.c M /staden/trunk/src/prefinish/tkMain.c M /staden/trunk/src/spin2/tkAppInit.c A /staden/trunk/src/tcl-license.terms M /staden/trunk/src/tk_utils/html_library.tcl M /staden/trunk/src/tk_utils/tclAppInit.c Added copy of the Tcl license.terms file, to comply with their licencing policy. ------------------------------------------------------------------------ r3359 | jkbonfield | 2013-05-31 11:16:29 +0100 (Fri, 31 May 2013) | 2 lines Changed paths: D /staden/trunk/LICENCE.txt A /staden/trunk/src/LICENCE.txt (from /staden/trunk/LICENCE.txt:3358) Moved to source tree so it can be including in "make dist" ------------------------------------------------------------------------ r3358 | jkbonfield | 2013-05-31 11:16:11 +0100 (Fri, 31 May 2013) | 2 lines Changed paths: D /staden/trunk/LICENCE.rtf A /staden/trunk/src/LICENCE.rtf (from /staden/trunk/LICENCE.rtf:3357) Moved to source tree so it can be including in "make dist" ------------------------------------------------------------------------ r3348 | jkbonfield | 2013-05-28 17:46:03 +0100 (Tue, 28 May 2013) | 11 lines Changed paths: M /staden/trunk/src/gap5/check_assembly.c M /staden/trunk/src/gap5/check_assembly.h M /staden/trunk/src/gap5/check_assembly.tcl M /staden/trunk/src/gap5/contig_selector.c M /staden/trunk/src/gap5/contig_selector.tcl M /staden/trunk/src/gap5/cs-object.c M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/find_oligo.c M /staden/trunk/src/gap5/find_oligo.h M /staden/trunk/src/gap5/find_repeats.c M /staden/trunk/src/gap5/find_repeats.tcl M /staden/trunk/src/gap5/gap5_cmd.tcl M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/readpair.c M /staden/trunk/src/gap5/readpair.tcl M /staden/trunk/src/gap5/result_manager.tcl M /staden/trunk/src/gap5/tk-io-reg.c Added the ability to split apart Contig Comparator plot generation from the actual plotting. This works for Find Internal Joins, Find Repeats, Find Oligos (Sequence Search), Find Read Pairs and Check Assembly. Plots can now also be saved and loaded from the comparator window. Combined this means we can also generate plots off-line, although they become out of date very quickly - on the first contig edit. The gap5_cmd script has an interface to these 5 plotting methods. ------------------------------------------------------------------------ r3347 | jkbonfield | 2013-05-24 15:11:03 +0100 (Fri, 24 May 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/export_contigs.tcl M /staden/trunk/src/gap5/gap5rc Added CRAM to the list of export formats. When writing to cram it also writes a consensus fasta and fasta.fai file to use as the reference, although it embeds this in the CRAM file so it does not need to be preserved. ------------------------------------------------------------------------ r3342 | jkbonfield | 2013-05-22 14:50:26 +0100 (Wed, 22 May 2013) | 8 lines Changed paths: M /staden/trunk/src/gap5/fij.c Bug fix to updating join overlap regions for previously joined contigs. Also added some belt and braces code after this to double check for possible local alignments, forcing them to be global alignments instead, just incase we still have lurking bugs in the overlap computation. ------------------------------------------------------------------------ r3341 | jkbonfield | 2013-05-22 14:18:59 +0100 (Wed, 22 May 2013) | 6 lines Changed paths: M /staden/trunk/src/gap4/GTAGDB M /staden/trunk/src/gap5/cs-object.c M /staden/trunk/src/gap5/fij.c Fixed setting the OBJ_FLAG_JOINED to mark contigs involved in joins. It was only detecting one of the two contigs. Auto-join now creates a JOIN tag to mark the region spanning automatic joins. ------------------------------------------------------------------------ r3340 | jkbonfield | 2013-05-22 12:27:36 +0100 (Wed, 22 May 2013) | 7 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/sam_index.h M /staden/trunk/src/gap5/sam_pileup.c M /staden/trunk/src/gap5/sam_pileup.h M /staden/trunk/src/gap5/tg_index.c M /staden/trunk/src/gap5/tg_index_common.c Switched from bam_open function to scram_open and ancillary methods. This means we can now read CRAM too. Also fixed a bug in PT/CT handling of multiple tags. It was missing the first character on 2nd tag onwards due to the str++ but - this is now outside the function rather than inside and per-tag. ------------------------------------------------------------------------ r3335 | jkbonfield | 2013-05-21 14:43:48 +0100 (Tue, 21 May 2013) | 6 lines Changed paths: M /staden/trunk/src/configure.in M /staden/trunk/src/gap5/Makefile D /staden/trunk/src/gap5/gap5_check.in D /staden/trunk/src/gap5/gap5_check.tcl A /staden/trunk/src/gap5/gap5_cmd.in A /staden/trunk/src/gap5/gap5_cmd.tcl D /staden/trunk/src/gap5/gap5_command.tcl D /staden/trunk/src/gap5/gap5_consensus.in D /staden/trunk/src/gap5/gap5_consensus.tcl D /staden/trunk/src/gap5/gap5_export.in D /staden/trunk/src/gap5/gap5_export.tcl D /staden/trunk/src/gap5/gap5_shuffle_pads.in D /staden/trunk/src/gap5/gap5_shuffle_pads.tcl M /staden/trunk/src/staden_config.h.in Replaced the gap5_{export,shuffle_pads,check,consensus} with a generic gap5_cmd tool (this replaces the previous and unfinished gap5_command program). Also included in gap5_cmd is the interface to auto_join. ------------------------------------------------------------------------ r3334 | jkbonfield | 2013-05-20 17:26:43 +0100 (Mon, 20 May 2013) | 14 lines Changed paths: M /staden/trunk/src/gap5/contig_selector.c M /staden/trunk/src/gap5/contig_selector.h M /staden/trunk/src/gap5/cs-object.c M /staden/trunk/src/gap5/cs-object.h M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/editor_join.h M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/fij.h M /staden/trunk/src/gap5/fij.tcl M /staden/trunk/src/gap5/find_oligo.c M /staden/trunk/src/gap5/find_oligo.tcl M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/readpair.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_register.c M /staden/trunk/src/gap5/tg_register.h M /staden/trunk/src/gap5/tk-io-reg.c Updated the FIJ and Find Oligos (more to come) to be split into searching and plotting methods at the scripting level. The search function now returns a registration ID and we then send a method to this to plot (task TASK_CS_PLOT). Experimented with task TASK_CS_SAVE (but no load implemented yet). Added TASK_CS_AUTO_JOIN. This is the bulk of this commit. It runs the join editor Align button code (now also split up into separate algorithms to avoid needing the editor up) and if it finds a high enough quality alignment it'll run the joining code. The command line script to perform auto-join will follow. ------------------------------------------------------------------------ r3332 | jkbonfield | 2013-05-17 17:38:44 +0100 (Fri, 17 May 2013) | 8 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Bug fix to tag shifting. It wasn't correctly taking into account the s->left value in the position. It also wasn't allowing for entire reads to be shifting, also requiring tags to shift. ------------------------------------------------------------------------ r3328 | jkbonfield | 2013-05-15 11:23:11 +0100 (Wed, 15 May 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/result_manager.tcl Fixed display to show #ID instead of #0 (contig number). ------------------------------------------------------------------------ r3326 | daviesrob | 2013-05-13 15:23:44 +0100 (Mon, 13 May 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/import_contigs.tcl Fixed New->From Imported File ------------------------------------------------------------------------ r3325 | daviesrob | 2013-05-13 13:51:39 +0100 (Mon, 13 May 2013) | 18 lines Changed paths: M /staden/trunk/src/gap5/assemble_single.tcl M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/fasta.c M /staden/trunk/src/gap5/import_contigs.tcl M /staden/trunk/src/gap5/map_reads.tcl M /staden/trunk/src/gap5/tg_index_common.c M /staden/trunk/src/tk_utils/text_output.c Reworked fasta/fastq import; map reads fixes. Unified fasta and fastq reading code. The new code works out which sort of file is being read, so it's no longer necessary to specify the file type. Improved error detection and handing of out of memory conditions. Messages are now output using vmessage/verror so they go to the gap5 GUI and not the user's terminal. Wrapped tcl calls to import_reads in catch blocks to stop the GUI from being left in busy mode if the import fails. Made MapReads_tidyup actually tidy up the temporary files. Fixed bwa sampe map_reads so that it actually completes. Made UpdateTextOutput flush stdout in text mode. ------------------------------------------------------------------------ r3324 | jkbonfield | 2013-05-13 13:46:50 +0100 (Mon, 13 May 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5.tcl Added citation to startup text. ------------------------------------------------------------------------ r3323 | jkbonfield | 2013-05-13 12:11:48 +0100 (Mon, 13 May 2013) | 13 lines Changed paths: M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/tg_contig.c Without accurate mode on, the template display takes the pair start/end values as gospel even with the timestamps indicate they are out of date. This is fine, but a couple fixes rationalise it further: - Make sure we set timestamp in tg_contig so fewer are considerdd out of date. (This was just an omission.) - When the read pair is in this same contig but beyond the contig extents due to Break Contig, it's obviously not correct. Mark these as spanning instead. ------------------------------------------------------------------------ r3322 | jkbonfield | 2013-05-13 11:47:47 +0100 (Mon, 13 May 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/Makefile Removed rogue dependency, put there by accidentally running "make depend" on a configuration using a local lzma dependency. ------------------------------------------------------------------------ r3320 | jkbonfield | 2013-05-10 14:35:05 +0100 (Fri, 10 May 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/g-alloc.c M /staden/trunk/src/gap5/gap-error.c M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/sam_pileup.h M /staden/trunk/src/gap5/tg_gio.c Various minor compilation warning fixes (ok and sam_pileup.h which I forgot to add to the previous commit). In the case of the error functions this removes potential crashes if the error message contained percent-codes. ------------------------------------------------------------------------ r3319 | jkbonfield | 2013-05-10 14:28:54 +0100 (Fri, 10 May 2013) | 3 lines Changed paths: M /staden/trunk/src/Misc/os.h M /staden/trunk/src/gap5/Makefile D /staden/trunk/src/gap5/bam.c D /staden/trunk/src/gap5/bam.h M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tg_index.c Removed Gap5's own SAM/BAM reading code and made it use the latest io_lib version. ------------------------------------------------------------------------ r3318 | jkbonfield | 2013-05-09 15:02:54 +0100 (Thu, 09 May 2013) | 8 lines Changed paths: M /staden/trunk/src/gap5/hash_lib.c Fixed an error causing FIJ to miss some joins consisting of only one hash hit. Also substantially modified the block-stitching heuristics. Typically it's finding ~2% more joins now and generally at a better percentage mismatch (averaging 4% better). ------------------------------------------------------------------------ r3317 | daviesrob | 2013-05-07 17:57:45 +0100 (Tue, 07 May 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_gio.c Reverted accidental commit of tg_gio.c ------------------------------------------------------------------------ r3316 | daviesrob | 2013-05-07 17:55:41 +0100 (Tue, 07 May 2013) | 14 lines Changed paths: M /staden/trunk/src/gap5/find_repeats.c M /staden/trunk/src/gap5/gap_hash.c M /staden/trunk/src/gap5/hash_lib.c M /staden/trunk/src/gap5/tg_gio.c Find Repeats fixes - malloc error handling and incorrectly recorded matches. Improved handling of out-of-memory conditions in repeat_search, repeat_search_depadded and gap_realloc_matches. Stopped match_fwd_back from running beyond the end of a sequence. This could lead to matches being allocated to the wrong contigs. Removed call to remdup in reps_nocount. The duplicates shouldn't be there anyway, and it seemed to remove some reverse matches that were not duplicates. Fixed off-by-one errors in find_repeats, caused by confusion between counting positions from 1 and zero. The new version appears to give the right answer. ------------------------------------------------------------------------ r3315 | jkbonfield | 2013-05-07 15:05:59 +0100 (Tue, 07 May 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_selector.c This time testing it builds! Ooops ------------------------------------------------------------------------ r3314 | jkbonfield | 2013-05-07 14:27:12 +0100 (Tue, 07 May 2013) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_selector.c Speed up - no need to compute the total contig length twice. ------------------------------------------------------------------------ r3313 | jkbonfield | 2013-05-07 12:50:17 +0100 (Tue, 07 May 2013) | 4 lines Changed paths: M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/template_display.c Bug fix to template display drawing, fixing a crash. Occasionally it could attempt to draw in an unallocated colour, caused by zooming up in Y and then selecting the uninitialised fwd/rev_col3. ------------------------------------------------------------------------ r3272 | daviesrob | 2013-04-12 14:27:59 +0100 (Fri, 12 Apr 2013) | 8 lines Changed paths: M /staden/trunk/src/gap5/tg_register.c Fixed iteration on wrong contig number in contig_register_join. Iterator hit searches on cto, but the next search incorrectly used cfrom. This could lead to hit returning entries for cfrom if cto and cfrom happened to hash into the same bin. If it did, they were incorrectly deleted which could lead to a crash later on in contig_reg_remove when it tries to access the deleted item. Changing HacheTableNext to use cto fixes this. ------------------------------------------------------------------------ r3271 | jkbonfield | 2013-04-11 14:46:25 +0100 (Thu, 11 Apr 2013) | 11 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Bug fix to r3240 which added contig_insert_bases() function to perform multi-base insertions. This was used by shuffle pads and join editor align button. MAJOR ERROR: It produced alignment errors downstream where the next bin started as that was still ch->pos++ instead of ch->pos += nbases. Also tidied up the logic surrounding reference base coordinates, although less of a major issue. I'm still not 100% certain refpos updates are correct though. ------------------------------------------------------------------------ r3267 | daviesrob | 2013-04-10 11:24:19 +0100 (Wed, 10 Apr 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/find_oligo.c Speed up OBJ_GET_BRIEF by showing contig numbers instead of leftmost read ------------------------------------------------------------------------ r3266 | daviesrob | 2013-04-09 09:39:07 +0100 (Tue, 09 Apr 2013) | 16 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/editor_view.h M /staden/trunk/src/gap5/tkEditor.c Fixed cache look-up of edview structs. edview_hash now allows duplicate keys so that it can handle the same contig being open in multiple views. edview_destroy has been updated so that it searches for the correct edview struct when removing items. Added edview_renumber, which changes the contig record number associated with an editor (e.g. when joining). It also updates edview_hash so that the edview struct is refiled under the new record number. This fixes a crash caused by an old edview being used after a join as it wasn't cleaned up correctly. Simplified edview_find. It can only return one edview pointer, so it returns the first one it finds for the contig record number. This is likely to be the last one that was opened. ------------------------------------------------------------------------ r3240 | jkbonfield | 2013-03-25 16:25:28 +0000 (Mon, 25 Mar 2013) | 5 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h Added contig_insert_bases() and sequence_insert_bases() functions to insert multiple bases of the same base/conf. Practically speaking that just means runs of pads, however it sometimes has a major speed improvement to the join editor and possibly shuffle pads. ------------------------------------------------------------------------ r3231 | daviesrob | 2013-03-21 12:03:02 +0000 (Thu, 21 Mar 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Fixed handling of JOIN_TO registration events. Calls io_detach for the old contig number. Properly sets opt(io), opt(io2), opt(contig), opt(contig2) depending on which contig(s) have been joined. ------------------------------------------------------------------------ r3210 | daviesrob | 2013-03-19 09:28:36 +0000 (Tue, 19 Mar 2013) | 33 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/depth.tcl M /staden/trunk/src/gap5/gap5.tcl M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/ng_fb_cmds.tcl Clean up windows when closing the database; various list editor improvements. Stop Gap_Open from trying to exit if the user presses cancel when asked to save contig changes. Clean up old windows when closing the database. This prevents crashes caused by stale $io references in the old windows. Raise the contig editor window before asking if changes should be saved. Reduces the chance of the save changes dialogue from being obscured by other windows. Also makes it easier to see which contig editor is being referred to. List editor windows are now tracked using an array variable instead of by creating unmapped child windows of the main window. List editor toplevel windows are now direct children of the main window, which allows the window clean-up code to find them more easily. Only bring up the extended reads list view for lists that have the appropriate magic enabled. Normal lists, along with the contigs and allcontigs lists, get the standard list editor instead. Prevent the pop-up menu from appearing in the extended read list view if the user right clicks on an entry that is not a valid read identifier. When outputting to another list from the extended reads list, properly filter out entries that are not valid reads. Fixed a couple of contig reference leaks in list_proc.tcl Try to speed up saving long read lists when closing the list editor. ------------------------------------------------------------------------ r3197 | daviesrob | 2013-03-12 15:12:14 +0000 (Tue, 12 Mar 2013) | 5 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/import_gff.tcl Added more logging. Log calls to import_gff, and edJoinAlign. edJoinAlign logging includes the positions of the two contig editor windows. ------------------------------------------------------------------------ r3196 | daviesrob | 2013-03-12 15:09:19 +0000 (Tue, 12 Mar 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_index_common.c Set r.y in save_range_sequence ------------------------------------------------------------------------ r3194 | jkbonfield | 2013-03-11 11:18:41 +0000 (Mon, 11 Mar 2013) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Fixed a memory error where I accessed a pointer immediately after freeing it in cache_flush(). ------------------------------------------------------------------------ r3193 | daviesrob | 2013-03-11 10:08:33 +0000 (Mon, 11 Mar 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/assemble_single.tcl Enable menus after loading single reads from a fasta file. ------------------------------------------------------------------------ r3190 | daviesrob | 2013-03-08 11:30:44 +0000 (Fri, 08 Mar 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_gio.c Remove .g5d/.g5x suffix when making log file name ------------------------------------------------------------------------ r3189 | daviesrob | 2013-03-07 17:15:10 +0000 (Thu, 07 Mar 2013) | 5 lines Changed paths: M /staden/trunk/src/gap5/select_contig.tcl Stop UpdateContigLimits from complaining about an empty entrybox. Makes deleting whatever is there and then going to find something to paste in much less annoying. ------------------------------------------------------------------------ r3188 | daviesrob | 2013-03-07 14:19:42 +0000 (Thu, 07 Mar 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/contig_extend.tcl Added SetBusy/ClearBusy around contig_extend ------------------------------------------------------------------------ r3187 | daviesrob | 2013-03-07 14:13:07 +0000 (Thu, 07 Mar 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/contig_extend.c M /staden/trunk/src/gap5/gap4_compat.c M /staden/trunk/src/gap5/select_contig.tcl Improved handling of invalid contig/read record numbers entered by the user ------------------------------------------------------------------------ r3186 | daviesrob | 2013-03-07 11:39:18 +0000 (Thu, 07 Mar 2013) | 31 lines Changed paths: M /staden/trunk/src/gap5/assemble_single.tcl M /staden/trunk/src/gap5/break_contig.tcl M /staden/trunk/src/gap5/check_assembly.tcl M /staden/trunk/src/gap5/check_database.tcl M /staden/trunk/src/gap5/complement.tcl M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/contig_extend.tcl M /staden/trunk/src/gap5/contig_selector.tcl M /staden/trunk/src/gap5/dis_readings.tcl M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/fij.tcl M /staden/trunk/src/gap5/find_oligo.tcl M /staden/trunk/src/gap5/find_repeats.tcl M /staden/trunk/src/gap5/gap4_compat.c M /staden/trunk/src/gap5/gap_cli_arg.c M /staden/trunk/src/gap5/import_contigs.tcl M /staden/trunk/src/gap5/list_contigs.tcl M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/map_reads.tcl M /staden/trunk/src/gap5/shuffle_pads.tcl M /staden/trunk/src/gap5/tag_checklist.tcl M /staden/trunk/src/gap5/tag_editor.tcl M /staden/trunk/src/gap5/tg_gio.c M /staden/trunk/src/gap5/tg_register.c M /staden/trunk/src/text_utils/text_output.h M /staden/trunk/src/text_utils/text_output_stubs.c M /staden/trunk/src/tk_utils/text_output.c M /staden/trunk/src/tk_utils/text_output.h Added logging and improved list handling. Added code to create .log files, in a similar manner to gap4. Currently disabled, but can be turned on by uncommenting #define DO_LOGGING in tg_gio.c. Improved logging code in tk_utils/text_output.c, including adding new tcl interfaces log_str, log_call and log_vmessage. log_str writes its parameters to the log file. log_call does the same, but then calls Tcl_EvalObjv on the parameter list. This allows tcl function calls to be logged by simply putting 'log_call' in front of them. log_vmessage is a tcl interface to the C log_vmessage function. It controls whether messages written to the gap5 message window are also written to the log file. log_vmessage now returns the previous setting. Put logging statements everywhere so pretty much anything the user does that changes the database gets recorded when logging is enabled. Made some improvements to handling of unusual contig names. Gave up on ones with spaces in, and just prevented the contig rename dialogues from allowing you to put a space in a contig name. They are not allowed in most other formats anyway. Simplified lget_contig_num_base. It now uses tcl list handling functions and removes duplicates while building the list instead of filtering them out later. The extended reads list now checks that the items in the list really are reads. Stops get_sequence from throwing an error if the user tries to get an extended view of the contig list. ------------------------------------------------------------------------ r3183 | daviesrob | 2013-03-05 17:36:26 +0000 (Tue, 05 Mar 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Fixed crash in shuffle pads caused by out-of-bounds read clip points ------------------------------------------------------------------------ r3157 | daviesrob | 2013-02-21 09:42:47 +0000 (Thu, 21 Feb 2013) | 11 lines Changed paths: M /staden/trunk/src/gap5/gap5.tcl M /staden/trunk/src/gap5/gap5rc_menu_full A /staden/trunk/src/gap5/import_contigs.tcl M /staden/trunk/src/gap5/ng_fb_cmds.tcl M /staden/trunk/src/gap5/tclIndex Added user interface to import_reads and to make an empty database. Added menu items and interfaces to allow users to import reads without having to use tg_index. Also allow them to create an empty database. Fixed bitmap values for the main menus so that items are enabled and disabled correctly as the state changes from started to database open but empty to open with data in it. Prevented divide by zero in DatabaseInfo when run on an empty database. ------------------------------------------------------------------------ r3152 | daviesrob | 2013-02-19 15:04:54 +0000 (Tue, 19 Feb 2013) | 7 lines Changed paths: M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_tcl.c Fixed attempt to remove GT_AnnoEle range records twice. GT_AnnoEle were being removed by bin_remove_item, and then again by anno_ele_destroy. The latter couldn't find them, so returned an error code which caused delete_tag_single_contig to stop after only removing one tag. Fixed by declaring anno_ele_destroy obsolete and not calling it any more. ------------------------------------------------------------------------ r3149 | daviesrob | 2013-02-14 15:36:21 +0000 (Thu, 14 Feb 2013) | 37 lines Changed paths: M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/ace.c M /staden/trunk/src/gap5/actf.c M /staden/trunk/src/gap5/afg.c M /staden/trunk/src/gap5/baf.c M /staden/trunk/src/gap5/bam.c M /staden/trunk/src/gap5/bam.h M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/caf.c M /staden/trunk/src/gap5/check_assembly.c M /staden/trunk/src/gap5/consen.c M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/contig_extend.c M /staden/trunk/src/gap5/contig_selector.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/editor_search.c M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/fasta.c M /staden/trunk/src/gap5/gap4_compat.c M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/import_gff.c M /staden/trunk/src/gap5/list_proc.c M /staden/trunk/src/gap5/maq.c M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/qualIO.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/sam_pileup.c M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_gio.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_index.c M /staden/trunk/src/gap5/tg_register.c M /staden/trunk/src/gap5/tg_scaffold.c M /staden/trunk/src/gap5/tg_scaffold.h M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tg_tcl.c M /staden/trunk/src/gap5/tg_view.c M /staden/trunk/src/gap5/tk-io-reg.c M /staden/trunk/src/gap5/tkAppInit.c M /staden/trunk/src/gap5/tkEdNames.c M /staden/trunk/src/gap5/zfio.c Fix compiler warnings and few bugs. Fixes for lots of compiler warnings, make compilation with -Wall much less chatty. Also fix some bugs that were flagged up by the warnings. The changes to remove warnings are: * Added missing include files and prototypes. * Fixed lots of signed / unsigned issues, especially for char types. * Ensure indexes into look-up tables are unsigned * Removed redundant variables. * Assignments used as truth values. A notable change is that confidence values are now type int8_t instead of char. They need to be signed as log-odds scores can be negative. The other fixes are: caf.c - removed use of isblank (requires C99) consensus.c - misplaced bracket in get_uniqueness. export_contigs.c - in sam_depadded_cigar, fix use of & instead of && newgap5_cmds.c - In tcl_reformat_sequence, set default max cut-off to 127. This is consistent with using signed confidence values. tg_anno.c - delete_tag_single_contig no longer tries to carry on in the fact of errors. tg_tcl.c - Wrong parameter index used for l.score in ADD_LINK case of contig_cmd - sequence_cmd cases GET_CONF and GET_CONF4 now return a ByteArrayObj instead of a StringObj. This stops Tcl from trying to interpret negative confidence values as UTF-8 characters. ------------------------------------------------------------------------ r3146 | daviesrob | 2013-02-13 17:21:08 +0000 (Wed, 13 Feb 2013) | 16 lines Changed paths: M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/map_reads.tcl M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/sam_index.c Fixes for bugs in map_reads, import_reads and calculate_consensus_bit_het. Fix various bugs: Attempt to read a closed filehandle in MapReads_run (map_reads.tcl). Not setting link_pairs parameter in tcl_import_reads (newgap5_cmds.c). Failure to resize s->pad in sam_add_seq, leading to a buffer overflow if enough pads get added (sam_index.c). Reading past the end of a sequence in calculate_consensus_bit_het if the right clip point is past the end. This shouldn't happen, but databases do exist with clipping broken in this way. ------------------------------------------------------------------------ r3135 | daviesrob | 2013-02-08 12:35:20 +0000 (Fri, 08 Feb 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/editor_view.c Put in work-around for crash due to edGetSelection being called with a massive value for offset. Not sure what the root cause is at the moment, it needs more investigation. ------------------------------------------------------------------------ r3118 | daviesrob | 2013-02-01 14:42:34 +0000 (Fri, 01 Feb 2013) | 8 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c Disable rounding up of bin sizes in extend_root_bin Rounding up the new bin size to a power of 2 gives a more balanced tree structure. Unfortunately it also leads to the bins growing in size very rapidly under certain conditions during long sequences of joins. In view of this, the rounding up code has been disabled for now until we come up with a better solution. ------------------------------------------------------------------------ r3117 | daviesrob | 2013-01-30 11:59:20 +0000 (Wed, 30 Jan 2013) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c Made off[] array the right size in unpack_rng_array ------------------------------------------------------------------------ r3116 | daviesrob | 2013-01-28 09:29:32 +0000 (Mon, 28 Jan 2013) | 6 lines Changed paths: M /staden/trunk/src/gap5/tman_interface.c Always set edc->dc = NULL in tman_unhighlight Fixes bug where shutting down the join editor without first closing the trace display causes a crash the next time an attempt is made to view a trace. ------------------------------------------------------------------------ r3105 | jkbonfield | 2013-01-07 15:02:05 +0000 (Mon, 07 Jan 2013) | 14 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap_utils.tcl M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_tcl.c Fixed an issue with renaming contigs within or outside of the contig selector while edits are being made. The contig name is held in two places - the contig name B+Tree providing name->rec mapping, and the contig_t struct itself. To avoid clashes when renaming multiple contigs within the contig editors the B+Tree is not updated until we hit Save. Similarly edits are now made on the child IO rather than the base I/O. The act of flushing the child I/O is what performs the B+Tree update. Also made the Contig List window perform a contig_lock_write call, forcing any existing editors to prompt for saving. ------------------------------------------------------------------------ r3104 | jkbonfield | 2013-01-07 11:51:45 +0000 (Mon, 07 Jan 2013) | 10 lines Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c Initialise c->clipped_timestamp when loading single contigs in the older database format. Without this we could generate random timestamps and so sometimes use a cached (zero length) contig size when the cache wasn't valid, leading to truncated contigs from Save Consensus (and elsewhere). This only happened when using the newer gap5 on a database built with the older tg_index. ------------------------------------------------------------------------ r3103 | awhitwham | 2012-12-21 10:12:25 +0000 (Fri, 21 Dec 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/editor_view.h M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tg_struct.h Moved sort settings into the editor view. Not entirely happy with the behaviour in the Join Editor but at least it should not crash. ------------------------------------------------------------------------ r3102 | jkbonfield | 2012-11-27 10:26:43 +0000 (Tue, 27 Nov 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/tg_bin.c Fixed a bug with cached consensus lengths and sequence clipping. Adjusting clip points at left/right end could leave trailing Ns at the end of the contig. We now increment the contig timestamp to force the cached size to be recomputed. ------------------------------------------------------------------------ r3101 | jkbonfield | 2012-11-20 17:16:31 +0000 (Tue, 20 Nov 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Implemented a newer resort_contigl() function that uses qsort() instead of a weak bubble (or even worse!) sort variant. This was becoming the dominant part of performance in very deep assemblies, but acted fine elsewhere. The newer code has better worst case implementation, given that qsort() isn't pure quick-sort. ------------------------------------------------------------------------ r3100 | daviesrob | 2012-11-08 14:35:44 +0000 (Thu, 08 Nov 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Update timestamps to prevent contig_visible_start/end from using stale cached data. ------------------------------------------------------------------------ r3099 | jkbonfield | 2012-11-06 16:15:25 +0000 (Tue, 06 Nov 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Fixed calculate_consensus_bit_het() to assign confidence for an N call to all of A,C,G,T but not *. This fixes issues of N vs * being * while A vs * is A, given equal quality for all bases (eg after import of a fasta file). ------------------------------------------------------------------------ r3098 | jkbonfield | 2012-11-05 16:28:07 +0000 (Mon, 05 Nov 2012) | 10 lines Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl M /staden/trunk/src/gap5/tg_tcl.c The "$io contig_order" method now permits setting of the order as well as querying. This can be used interactively to fix broken DBs. Save Order in the List Contigs window now generates a list based on =num instead of contig names. This means when a contig name is missing from the name B+Tree index it doesn't silently throw away contigs. This doesn't fix the bug that renaming sometimes fails, but it stops it from causing subsequent data loss. ------------------------------------------------------------------------ r3097 | jkbonfield | 2012-10-30 16:57:54 +0000 (Tue, 30 Oct 2012) | 9 lines Changed paths: M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/gap_range.h M /staden/trunk/src/gap5/template_display.c M /staden/trunk/src/gap5/template_draw.h Added 10 alternative colour choices for the template display spanning contigs. I'm open to other colours as the 10 chosen are a bit arbitrary, but I tried to pick things that didn't get confused with blues, reds and greys already in use. This doesn't guarantee neighbouring spanning read pairs in two different contigs come up in two different colours (as to do so would mean changing colours as we scroll), but it's a good start I think. ------------------------------------------------------------------------ r3096 | jkbonfield | 2012-10-30 12:21:29 +0000 (Tue, 30 Oct 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/tg_sequence.c Fixed uninitialised access of pair_contig in sequence_get_rangec(). Also removal of some debugging output. ------------------------------------------------------------------------ r3095 | jkbonfield | 2012-10-29 14:48:57 +0000 (Mon, 29 Oct 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/tclIndex M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h M /staden/trunk/src/gap5/tg_tcl.c Added a multi-column List viewer. It's much like the old Readings list editor/viewer, but showing the location of boths ends if a read-pair. The reads are shown in a tablelist widget with sortable columns, permitting selection of sub-lists for further refinement. ------------------------------------------------------------------------ r3094 | jkbonfield | 2012-10-29 14:46:32 +0000 (Mon, 29 Oct 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap4_compat.c Fix to CalcTotalContigLen to use clipped contig lengths. ------------------------------------------------------------------------ r3093 | jkbonfield | 2012-10-29 14:33:23 +0000 (Mon, 29 Oct 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl Fix and issue with Scaffold name sorting when a scaffold doesn't exist. ------------------------------------------------------------------------ r3092 | daviesrob | 2012-10-17 11:27:22 +0100 (Wed, 17 Oct 2012) | 3 lines Changed paths: M /staden/trunk/src/configure.in M /staden/trunk/src/gap5/tg_gio.h Added a check for inline to configure.in, and use it in tg_gio.h to remove an annoying warning about DB_VERS. ------------------------------------------------------------------------ r3091 | jkbonfield | 2012-10-17 11:13:45 +0100 (Wed, 17 Oct 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/Makefile Dependency updates via "make depend" ------------------------------------------------------------------------ r3090 | jkbonfield | 2012-10-16 17:08:33 +0100 (Tue, 16 Oct 2012) | 8 lines Changed paths: M /staden/trunk/src/gap5/contig_selector.c M /staden/trunk/src/gap5/contig_selector.h M /staden/trunk/src/gap5/contig_selector.tcl The contig selector now shows clipped lengths. Note this may be slow on older format databases, but with the new clipped length caching it is fast on modern ones and also once it's computed and cached on old DBs. Also fixed a bug where the X/Y coords displayed and invoked (editor) didn't compensate for contigs that start somewhere other than base 1. ------------------------------------------------------------------------ r3089 | jkbonfield | 2012-10-15 17:08:44 +0100 (Mon, 15 Oct 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/gap4_compat.c M /staden/trunk/src/gap5/gap4_compat.h M /staden/trunk/src/gap5/list_contigs.tcl M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tg_tcl.c Use the contig timestamp to verify if the cached clipped start/end positions are valid. In-memory contig structs do this via the clipped_timestamp value, but to preserve compatibility with the existing disc format this is convert to a CONTIG_FLAG_CLIPPED_VALID flag on disc. ------------------------------------------------------------------------ r3088 | jkbonfield | 2012-10-12 17:20:43 +0100 (Fri, 12 Oct 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h Added rangec_t sort modes by template status (single, paired, bad, etc) and by library record number. ------------------------------------------------------------------------ r3087 | jkbonfield | 2012-10-12 15:27:34 +0100 (Fri, 12 Oct 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl M /staden/trunk/src/gap5/tg_tcl.c Fixed the default width of the contig list when faced with exceptionally long contig names. Also (commented out for now, as debugging only) added the ability to show a column of contig timestamps. ------------------------------------------------------------------------ r3086 | jkbonfield | 2012-10-12 15:12:02 +0100 (Fri, 12 Oct 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/ace.c M /staden/trunk/src/gap5/afg.c M /staden/trunk/src/gap5/baf.c M /staden/trunk/src/gap5/caf.c M /staden/trunk/src/gap5/maq.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tg_index.c M /staden/trunk/src/gap5/tg_index.h M /staden/trunk/src/gap5/tg_index_common.c M /staden/trunk/src/gap5/tg_index_common.h When using tg_index on multiple files (eg tg_index a.bam b.bam c.bam) or appending to an existing database (tg_index -a) we will now automatically check for read-pairing between files. Use -L option to disable this. ------------------------------------------------------------------------ r3085 | jkbonfield | 2012-10-12 12:34:51 +0100 (Fri, 12 Oct 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c Initialise bio->libs so that "tg_index -a" or "tg_index *.bam" don't cause duplicate libraries to appear. ------------------------------------------------------------------------ r3084 | jkbonfield | 2012-10-11 16:03:23 +0100 (Thu, 11 Oct 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl Disabled Accurate mode by default again as it's too slow when run on older format databases. (Ideally we should make it user controllable by putting this in the gap5rc file.) ------------------------------------------------------------------------ r3083 | jkbonfield | 2012-10-11 15:33:10 +0100 (Thu, 11 Oct 2012) | 35 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/depth.tcl M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/gap4_compat.c M /staden/trunk/src/gap5/gap5_thrash.tcl M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/hache_table.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_gio.c M /staden/trunk/src/gap5/tg_gio.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_index_common.c M /staden/trunk/src/gap5/tg_index_common.h M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_struct.h Major addition (and corresponding database format version change) involving caching of read pair data. The Bin GRange arrays now hold pair_{start, end, mqual, contig} in addition to the previously held pair_rec value. This means the absolute position of a read-pair can be obtained fast (faster even than the absolute position of "yourself") without needing to resort to extra seeks and I/O. However this data can become outdated if edits occur, such as breaking/joining, complementing or even just insertion and deletion to contigs and/or sequences. So every range element also now has a pair_timestamp indicating when the pair_* records were last validated. The timestamp is compared against the pair_contig, if it still exists, and against the main database timestamp. (The timestamps are simply incremental numbers rather than actual times.) There is a high chance of an error in this caching code given the complexity and number of places that we could invalidate the cache, but it has been well tested. Benchmarks ========== After initial tg_index (which sets valid timestamps) I see approx 100x reduction in seeks and I/O for the template display in "Acc"urate mode (this is now the default mode). ~1.1k vs 107k seeks. After editing a contig, scrolling in the template display then drastically slows down while the data is recomputed, but not by as much as the old template display was at all times. It's maybe 5-6x slower than a fully up to date version, and soon speeds up again. ------------------------------------------------------------------------ r3082 | jkbonfield | 2012-10-11 14:38:09 +0100 (Thu, 11 Oct 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Switch of xx->edname to xx->seq_win given edname is blank (not filled out). I'm not sure why the code didn't fail before. ------------------------------------------------------------------------ r3081 | jkbonfield | 2012-10-11 14:34:41 +0100 (Thu, 11 Oct 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Added #ifdef CACHE_STATS around various debugging options (previously #if 0). Improved the debugging output a bit too. ------------------------------------------------------------------------ r3080 | daviesrob | 2012-10-10 17:22:05 +0100 (Wed, 10 Oct 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/do_fij.c Try to make the join editor come up in the right place for joins in cutoff sequences. It will also now automatically turn cutoffs on in these cases. ------------------------------------------------------------------------ r3079 | jkbonfield | 2012-10-09 15:35:16 +0100 (Tue, 09 Oct 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/consen.c M /staden/trunk/src/gap5/consen.h M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/find_repeats.c M /staden/trunk/src/gap5/gap4_compat.h Removed an absent "Make join" option from the FIJ results in the contig selector. Also updated the broken entries in gap4_compat.h for io_rdonly and io_name and removed the unused io_dbsize define. ------------------------------------------------------------------------ r3078 | daviesrob | 2012-10-09 14:21:51 +0100 (Tue, 09 Oct 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/find_repeats.c M /staden/trunk/src/gap5/readpair.c Go back to complementing the shortest contig when bringing up the join editor, by popular request. ------------------------------------------------------------------------ r3077 | jkbonfield | 2012-10-08 16:31:13 +0100 (Mon, 08 Oct 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/consen.c Remove minor compilation warning. ------------------------------------------------------------------------ r3076 | jkbonfield | 2012-10-08 16:28:38 +0100 (Mon, 08 Oct 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/qualIO.c Fixed vmessage format: %d vs %ld ------------------------------------------------------------------------ r3075 | jkbonfield | 2012-10-05 11:55:59 +0100 (Fri, 05 Oct 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Shifting sequences now forces that sequence to be visible on screen still. ------------------------------------------------------------------------ r3074 | daviesrob | 2012-10-05 10:26:53 +0100 (Fri, 05 Oct 2012) | 11 lines Changed paths: M /staden/trunk/src/gap5/consen.c M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/read_depth.c M /staden/trunk/src/gap5/tag_plot.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_tcl.c M /staden/trunk/src/gap5/tg_tracks.c Made contig_objects_in_range return a valid pointer and zero count when nothing is found in the desired range. It still returns NULL if it fails. Ensured that everything that calls it does something sensible with the results. Put in some more checks for NULL return values, mainly from memory allocations and cache_search. Fixed bug in get_hidden_end, which was not calculating the correct position in the cons[] array for the start of the alignment. ------------------------------------------------------------------------ r3073 | jkbonfield | 2012-10-05 10:22:02 +0100 (Fri, 05 Oct 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Protect against the range of shuffle pads ending at a position with no sequences (eg an internal run of Ns in a contig). In this case the iterator returned no next seq, causing a crash in the range extension logic. ------------------------------------------------------------------------ r3072 | jkbonfield | 2012-10-04 15:17:53 +0100 (Thu, 04 Oct 2012) | 8 lines Changed paths: M /staden/trunk/src/gap5/gap_range.c Removed triggers for the various "error, start/end do not match template pos" error messages. These came about for two reasons: 1) Containments, where start>pair_start and enddb is NULL. Also boosted the default cache from 1024 to 2048 items, based on experimental evidence of our existing DBs and the number of items in the typical template display. ------------------------------------------------------------------------ r3070 | jkbonfield | 2012-10-01 11:45:12 +0100 (Mon, 01 Oct 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Fixed bug in SAM/BAM contig export when requesting "fixmates" mate-pair data. This is a long-standing bug that existing before the latest updates. If exporting just one contig, we still needed to output all @SQ lines incase that one contig has spanning read-pairs. ------------------------------------------------------------------------ r3069 | daviesrob | 2012-09-28 15:53:10 +0100 (Fri, 28 Sep 2012) | 24 lines Changed paths: M /staden/trunk/src/gap5/check_assembly.c M /staden/trunk/src/gap5/consen.c M /staden/trunk/src/gap5/contig_selector.c M /staden/trunk/src/gap5/cs-object.c M /staden/trunk/src/gap5/cs-object.h M /staden/trunk/src/gap5/do_fij.c M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/fij.h M /staden/trunk/src/gap5/find_oligo.c M /staden/trunk/src/gap5/find_repeats.c M /staden/trunk/src/gap5/gap_hash.c M /staden/trunk/src/gap5/gap_hash.h M /staden/trunk/src/gap5/readpair.c M /staden/trunk/src/seq_utils/dna_utils.c M /staden/trunk/src/seq_utils/dna_utils.h Made the join editor open at more sensible positions for each contig, especially in the case of reverse alignments. The obj_match, obj_checkass, obj_read_pair and obj_fij structs have all had end1 and end2 fields added which store the padded position of the end of the alignment in each contig. This means the positions can be accurately recalculated when one or other contig is complemented. Adjusted the code in FIJ, Find Repeats, Check Assembly, Find Read Pairs and Sequence Search (find_oligo) to work with the revised data structure. At the same time made some efficency improvements to FIJ and Find Repeats. Those two also now show the contig record number instead of the left read number in the contig selector when hovering over a match. The contig selector now draws matches from (pos1,pos2) to (end1,end2) which means some of the match lines are no longer at exactly 45 degrees. csmatch_join_to and csmatch_complement in cs-object.c update the pos1/2 and end1/2 locations as necessary. Added a new function to dna_utils.c to copy and complement sequences at the same time. Also added functions to allocate a complemented sequence, and allocate a depadded sequence. ------------------------------------------------------------------------ r3068 | jkbonfield | 2012-09-27 17:35:49 +0100 (Thu, 27 Sep 2012) | 13 lines Changed paths: M /staden/trunk/src/gap5/complement.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/search.tcl M /staden/trunk/src/gap5/tclIndex Added an option to perform bulk contig renaming. This operates either on a list or on a pattern to check against all contig names. The replacement text has a single printf rule to replace %d by an automatically iterated contig number. Eg replacing everything with "Contig_%06d" to get Contig_000001 upwards. If operating in pattern mode it can use filename glob style wildcards ("Node*Contig*"). In this case the replacement pattern can also use \1, \2 etc regexp matches to utilise whatever the * matched. This allows for renaming of "Contig*" to "C\1". (Should this be "C*" too for ease?) ------------------------------------------------------------------------ r3067 | jkbonfield | 2012-09-27 17:31:40 +0100 (Thu, 27 Sep 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap_utils.tcl Fixed Select Readings to operate over the underlined region of the consensus rather than the current single position. Also, for use in next commit, changed contig_rename to return the new name rather than 0 or 1 and for it to optionally try alternative names (name#%d) when the existing name clashes. ------------------------------------------------------------------------ r3066 | jkbonfield | 2012-09-27 12:31:02 +0100 (Thu, 27 Sep 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/bam.c M /staden/trunk/src/gap5/export_contigs.c Added a SAM header and sort order definition to SAM/BAM export. Fixed a memory leak when parsing SAM headers containing read-groups with duplicate IDs. (Shouldn't happen, but can do if we have duplicated libraries for some reason.) ------------------------------------------------------------------------ r3065 | jkbonfield | 2012-09-27 10:06:23 +0100 (Thu, 27 Sep 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/bam.c M /staden/trunk/src/gap5/bam.h M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/export_contigs.tcl Rewrote the SAM exporter and added a BAM exporter. These are all in bam.c now instead instead of input in bam.c and output in export_contigs.c. Now BAM format is an option from gap5_export script and Gap5 Export Sequences dialogue. ------------------------------------------------------------------------ r3064 | daviesrob | 2012-09-25 09:57:10 +0100 (Tue, 25 Sep 2012) | 39 lines Changed paths: M /staden/trunk/src/gap5/do_fij.c M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/fij.h M /staden/trunk/src/gap5/fij.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/hash_lib.c M /staden/trunk/src/gap5/hash_lib.h M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h M /staden/trunk/src/gap5/readpair.c M /staden/trunk/src/gap5/readpair.h Added read pair filtering option to Find Internal Joins. Turning this on make FIJ check each match to see how many read pairs span between the two contigs in the neighborhood of the aligned region. The alignments are only kept if the number of read pairs exceeds a given threshold. The read pair screen actually runs in two stages. In the first stage, fij calls fij_prefilter_repeats on the combined contig list. This calls spanning_pairs (the guts of Find Read Pairs) to get a list of contigs that are linked by the desired number of pairs. It uses this list to make a HashTable of contig_pair structs and also to prune any contigs with no read pair links from the list being searched. The idea is that spanning_pairs is fairly quick, so using it to reduce the search space should save time later. do_it_fij, compare_b_bulk and align_blocks_bulk all now take the HashTable of contig pairs. Any word matches that do not match an item in the HashTable are filtered out so they do not have to be aligned later. The second stage of filtering takes place in check_overlap_pairs which is called by add_fij_overlap and add_fij_overlap_r. This scans for read pairs over the aligned region, plus a little extra to account for templates that extend beyond the alignment. It ensures that any spanning pairs found are a reasonable distance apart and in the correct orientation for the library. Other minor changes are: * In buffij, pos1 and pos2 are no longer swapped * The code to convert a list of libraries to a HashTable has moved from spanning_pairs to create_lib_hash. This allows the library HashTable to be used later on in check_overlap_pairs. * fij and do_it_fij now take a fij_arg * parameter to vastly reduce the number of separate parameters passed in. * Read pair screening options have been added to the FIJ dialog box. ------------------------------------------------------------------------ r3063 | jkbonfield | 2012-09-18 17:30:37 +0100 (Tue, 18 Sep 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Fixed a memory corruption bug. ------------------------------------------------------------------------ r3062 | jkbonfield | 2012-09-18 17:29:43 +0100 (Tue, 18 Sep 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_gio.h Improvements to the CACHE_REF_DEBUG code (not enabled normally). It's still not foolproof when using cache_rw on child I/Os, but cache_incr and cache_decr for child I/Os now works better. ------------------------------------------------------------------------ r3061 | jkbonfield | 2012-09-17 12:29:10 +0100 (Mon, 17 Sep 2012) | 10 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/search.tcl Fixed search sequence names to generate a list of "#num name" form instead of just "name". The text output window is still names though, but the SEQID tag handler has been updated to also look for SEQID: to allow numerical IDs to be used instead of name lookup. These fixes make it possible to click on the read names and bring up the correct read of a pair. Likewise also added SEQID tag to the (already #numeric) output of ContigsToReadings. ------------------------------------------------------------------------ r3060 | jkbonfield | 2012-09-14 16:23:48 +0100 (Fri, 14 Sep 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/find_oligo.c Fixed a bug in Sequence Search (inexact_pad_match) causing it to find the same match multiple times if the match starts with a pad. ------------------------------------------------------------------------ r3059 | jkbonfield | 2012-09-14 15:09:25 +0100 (Fri, 14 Sep 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/tg_library.c M /staden/trunk/src/gap5/tg_sequence.c Fix to sequence_get_template_info() for when a library has insufficient data. Now we just call it paired if it is paired, but don't pontificate on the whether it is consistent. Previously it could access uninitialised memory and return inconsistent results. ------------------------------------------------------------------------ r3058 | jkbonfield | 2012-09-14 15:07:48 +0100 (Fri, 14 Sep 2012) | 10 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_gio.c M /staden/trunk/src/gap5/tg_gio.h M /staden/trunk/src/gap5/tg_scaffold.c M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tg_tcl.c M /staden/trunk/src/gap5/tkEditor.c Updates to the copy-on-write caching layer to allow for the possibility of child IOs of child IOs (ie grandchild IOs). In practice it's not finished, but it doesn't harm normal operation either and the commenting has been improved, with a few extra asserts too. So we'll keep this variant. There is also a new gio_base(io) function to return the base io rather than just using io->base ? io->base : io. ------------------------------------------------------------------------ r3057 | jkbonfield | 2012-09-14 15:03:47 +0100 (Fri, 14 Sep 2012) | 21 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h M /staden/trunk/src/gap5/qualIO.c M /staden/trunk/src/gap5/qualIO.h M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/shuffle_pads.h M /staden/trunk/src/gap5/shuffle_pads.tcl M /staden/trunk/src/seq_utils/align_lib.c M /staden/trunk/src/seq_utils/align_lib.h Shuffle pads can now operate over regions of contigs in addition to an entire contig. This means it is callable from the contig editor too by selecting (underlining) a region in the consensus and picking the Realign Seqs command from the consensus. Given this shuffle pads was also updated to remember which regions are modified on pass 1 and supply these regions to the next pass recursively. This considerably speeds up the algorithm, typically by 4-5x faster. Also increased the default band width, given it's now faster. The scoring function in align_lib has been updated too. Previously it purely counted differences, but this meant a better alignment (matching other common alignment trends) that doesn't alter the number of differences to the consensus could yield no overall change. Now we take into account the fractional base matches. Finally, improved diagnostics from List Base Confidence so we can more accurately see the impact of shuffle pads. It breaks down the match and mismatch scores by base types and provides a summary of counts of substitutions and indels. ------------------------------------------------------------------------ r3056 | jkbonfield | 2012-09-14 14:55:01 +0100 (Fri, 14 Sep 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Protect against attempting to store cached consensus in child IOs. This does not work due to accessing io->db. ------------------------------------------------------------------------ r3055 | daviesrob | 2012-09-11 09:23:01 +0100 (Tue, 11 Sep 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/readpair.c spanning_pairs now uses the library record in the range structs (if present) when filtering by library. This makes it much faster as it no longer has to read the sequences. It will fall back to the old method if it finds any ranges without a library record (e.g. when looking at an old format database). Also added more error checking and cleanup code. ------------------------------------------------------------------------ r3054 | daviesrob | 2012-09-07 16:28:23 +0100 (Fri, 07 Sep 2012) | 46 lines Changed paths: M /staden/trunk/src/gap5/template_display.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_gio.c M /staden/trunk/src/gap5/tg_gio.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_library.c M /staden/trunk/src/gap5/tg_struct.h Got rid of various static variables that should really only have the same lifetime as the GapIO struct instead of that of the program. The variables have been moved to either the GapIO, database_t or g_io structs. The result is that repeatedly opening and closing databases without restarting gap5 now works as you would expect. It should also be possible to have two databases open simultaneously in a single process without them interfering with each other. Specific changes follow. tg_iface_g.c: * File-level wrstats, wrcounts, rdstats, rdcounts are now in the g_io struct. * File-level other_record and other_record_start have been removed (not needed). * In allocate(), record is now in the g_io struct. allocate is also much simpler. * In btree_node_create(), hd did not need to be static. * io_database_read() and io_database_create() call init_block_record_numbers(), see tg_cache.c tg_cache.c: tg_struct.h: * In cache_item_create_{seq,contig,scaffold,anno_ele}, moved brec and sub_rec in each function to the database_t struct. Added a new function init_block_record_numbers() to initialize them all. * cache_flush now checks io->last_bin to see if any outstanding updates are needed in bin_add_range(). See tg_bin.c tg_bin.c: tg_gio.h: * File-level last_bin and incr_{s,r,a}value variables moved to the GapIO struct. These are used by bin_add_range(). tg_library.c: tg_gio.h: * In template_max_size(), moved max_size to max_template_size in the GapIO struct. tg_gio.c: * gio_open() initializes io->last_bin, io->incr_{s,r,a}value and io->max_template_size. * gio_child asserts that io_p->last_bin == 0 (i.e. no outstanding updates are needed in bin_add_range) and copies io->max_template_size from the base. template_display.c: * In redraw_template_image(), removed redundant last_zoom. ------------------------------------------------------------------------ r3053 | daviesrob | 2012-09-06 17:27:45 +0100 (Thu, 06 Sep 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/newgap5_cmds.c Fixed tcl_import_reads so that it sets more of the parameters in the tg_args struct args.a - previously these were being used uninitialized. Added code to call parse_caf and parse_afg which were supported by tg_index but not tcl_import_reads. Also improved the error handling a bit. ------------------------------------------------------------------------ r3052 | jkbonfield | 2012-09-06 12:11:12 +0100 (Thu, 06 Sep 2012) | 3 lines Changed paths: M /staden/trunk/src/configure.in M /staden/trunk/src/gap5/Makefile A /staden/trunk/src/gap5/gap5_shuffle_pads.in A /staden/trunk/src/gap5/gap5_shuffle_pads.tcl M /staden/trunk/src/staden_config.h.in Added a gap5_shuffle_pads command to allow batch execution of the Shuffle Pads menu item. ------------------------------------------------------------------------ r3051 | jkbonfield | 2012-09-06 12:09:26 +0100 (Thu, 06 Sep 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap4_compat.c Robustness improvements (error handling). ------------------------------------------------------------------------ r3050 | jkbonfield | 2012-09-04 17:24:28 +0100 (Tue, 04 Sep 2012) | 10 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/tk_utils/init.tcl Added a mode for allowing (de)selection of reads with their mate-pairs. In the editor names panel this is by using the Control key, so click-drag is the reads under cursor only while control-click-drag is also their mate-pairs. In the right-click menu this has been split into two menu entries: with and without mate-pairs. ------------------------------------------------------------------------ r3049 | jkbonfield | 2012-09-04 16:19:31 +0100 (Tue, 04 Sep 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap4_compat.h M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/list_proc.c M /staden/trunk/src/gap5/list_proc.h M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/newgap5_cmds.c Added a Pair Reading List menu item. This takes a list of reads and produces a list containing those reads and their mate-pairs. ------------------------------------------------------------------------ r3048 | jkbonfield | 2012-09-04 14:01:25 +0100 (Tue, 04 Sep 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap_utils.tcl Bug fix to error dialogue in contig_rename. (Nil effect until it gets an error.) ------------------------------------------------------------------------ r3047 | jkbonfield | 2012-09-04 12:35:07 +0100 (Tue, 04 Sep 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Bug fix to contig_shift_base(). In some cases it was causing bins to grow beyond their parent boundaries. The fix was to use the same logic we already have for when inserting or deleting consensus columns. ------------------------------------------------------------------------ r3046 | jkbonfield | 2012-09-04 12:32:04 +0100 (Tue, 04 Sep 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_scaffold.h Add missing prototype for complement_scaffold() ------------------------------------------------------------------------ r3045 | jkbonfield | 2012-09-04 12:31:36 +0100 (Tue, 04 Sep 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/readpair.c Fix potential buffer overrun in the mouse-over text in the read pair plot. ------------------------------------------------------------------------ r3044 | jkbonfield | 2012-09-04 12:30:59 +0100 (Tue, 04 Sep 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5_thrash.tcl Added contig shift (control+left/right arrows in editor) checking. ------------------------------------------------------------------------ r3043 | jkbonfield | 2012-09-04 09:47:26 +0100 (Tue, 04 Sep 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_bin.c Additional assert, just to be sure: spotting that the free range list in bins always contains items that are genuingly tagged as UNUSUED. ------------------------------------------------------------------------ r3042 | jkbonfield | 2012-09-04 09:36:58 +0100 (Tue, 04 Sep 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/gap4_compat.h Increased the maximum contig name length (largely unused now) DB_NAMELEN to be 1024. This was causing truncation of display within the contig editor and I suspect in fasta/fastq output. I think the scrollbar in the editor name display needs fixing still though. ------------------------------------------------------------------------ r3041 | jkbonfield | 2012-09-04 09:35:24 +0100 (Tue, 04 Sep 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap_utils.tcl Fixed a bug causing contig renaming in the editor to produce a tcl error. ------------------------------------------------------------------------ r3040 | jkbonfield | 2012-08-31 15:22:37 +0100 (Fri, 31 Aug 2012) | 9 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c Removed an assumption in recursive_grow_bins() that the bin siblings being recursed down never overlap each other. (I'm not sure what causes this - likely contig indels.) Previously this created errors like: bin 879: used start/end range beyond the bin boundaries (size 2042 vs start=1,end=2042). ------------------------------------------------------------------------ r3039 | daviesrob | 2012-08-31 12:17:15 +0100 (Fri, 31 Aug 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c Added assertions to ensure that bins never shrink in recursive_grow_bins and that extend_root_bin always makes a parent bin bigger than the existing one. ------------------------------------------------------------------------ r3038 | jkbonfield | 2012-08-30 11:33:47 +0100 (Thu, 30 Aug 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/tg_index.c Added an additional cache_flush after the final updating of nseqs, but before the slow process of updating the name index. It's not needed, but is a preventative issue incase of errors or interrupted tg_index later on. ------------------------------------------------------------------------ r3037 | daviesrob | 2012-08-24 16:35:04 +0100 (Fri, 24 Aug 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/hash_lib.c More tweaks to find internal joins. Notably the band in align_wrap has been made wider and shifted slightly when aligning non-square regions. Also added code to avoid calling align_bit in trivial cases (1 base against 1 base or zero bases against anything) which gives a small speed-up. align_blocks has also been rearranged a little so that it can avoid doing some pointless work in fast mode if it is going to bail out anyway. ------------------------------------------------------------------------ r3036 | jkbonfield | 2012-08-23 12:54:18 +0100 (Thu, 23 Aug 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap4_compat.c Improved handling of failure conditions (failure to cache_search()). ------------------------------------------------------------------------ r3035 | jkbonfield | 2012-08-23 12:42:56 +0100 (Thu, 23 Aug 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Fixed an uninitialised memory access when working out if the sequences are visible on screen, triggered when there are zero sequences display in the editor range. ------------------------------------------------------------------------ r3034 | jkbonfield | 2012-08-23 12:42:21 +0100 (Thu, 23 Aug 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/import_gff.c Bug fix when importing GFF files that could lead to crashes. It wasn't correctly incrementing and decrementing the reference count on the contig, and due to calculate_consensus_simple() this could be pushed out of scope. ------------------------------------------------------------------------ r3033 | jkbonfield | 2012-08-23 12:41:06 +0100 (Thu, 23 Aug 2012) | 8 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_tcl.c Major bug fix to contig linking code. The "$c invalidate_consensus" method had no break statement forcing it to flow into the add_link code, creating uninitialised links. Also added some extra initialising of links, just incase of corruptions anywhere. (Shouldn't ever matter.) ------------------------------------------------------------------------ r3032 | daviesrob | 2012-08-20 17:17:44 +0100 (Mon, 20 Aug 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/do_fij.c Removed debugging output ------------------------------------------------------------------------ r3031 | daviesrob | 2012-08-20 15:35:03 +0100 (Mon, 20 Aug 2012) | 15 lines Changed paths: M /staden/trunk/src/gap5/do_fij.c M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/fij.h M /staden/trunk/src/gap5/fij.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/hash_lib.c M /staden/trunk/src/gap5/hash_lib.h M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h Updated find internal joins. Previously it could only compare a single contig to a list, or all the contigs in a list with each other. Now it accepts two contig lists, and compares all the contigs in list 1 with each of the contigs in list 2. Also made some improvements to the quick alignment code so that it misses fewer hits. Notably align_blocks now works out the best scoring chain after stitching all of the blocks together instead of trying to keep track on the way through, and it also adds a penalty for stopping short of the end of the diagonal. align_blocks also now sorts the blocks by the manhatten distance to the end of each match instead of (manhatten distance to the start + length). Some redundant code has been removed, and the near-duplicate hash_wordXXn and hash_seqXXn functions have been amalgamated into hash_word_n and hash_seq_n, although stubs still exist for the old functions for now. ------------------------------------------------------------------------ r3030 | daviesrob | 2012-08-20 13:48:18 +0100 (Mon, 20 Aug 2012) | 4 lines Changed paths: M /staden/trunk/src/seq_utils/align_lib.c Fixed bug in affine_align. If the alignment was predicted to use more than MAX_MEMORY2 bytes, params->band was halved twice, leading to a segfault in affine_align_bits. ------------------------------------------------------------------------ r3029 | jkbonfield | 2012-08-17 16:34:59 +0100 (Fri, 17 Aug 2012) | 17 lines Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c Two fixes. 1) In g_read_alloc check that vi.used is not G_NO_IMAGE before attempting to read. Our previous assumption that vi.used length is non-zero is not solely enough as the record may have been re-allocated from an earlier free record in which case only the image has been reset. (This is perhaps a bug.) 2) When writing contig links we now forcibly check that data is within the desired range, in particular that end1, end2 and orientation are booleans. Failure to be so means we could have underallocated memory and leads to a corruption. This is to work around an unknown bug elsehwere which corrupted this link data. We need to find and fix that too! (On going work.) ------------------------------------------------------------------------ r3028 | jkbonfield | 2012-08-17 12:05:25 +0100 (Fri, 17 Aug 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tag_editor.tcl Protect against attempts to use tag-macros on read only databases. ------------------------------------------------------------------------ r3027 | jkbonfield | 2012-08-17 10:15:39 +0100 (Fri, 17 Aug 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl Bug fix in ListContigsRepopulate(). This is called via an "after idle" handler, but could sometimes be called after the window has been shut down, producing (harmless) Tk error messages. ------------------------------------------------------------------------ r3026 | jkbonfield | 2012-08-17 10:14:39 +0100 (Fri, 17 Aug 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Bug fix to marking a selection. If we start the selection off the right hand end of a sequence it was forcing the start point to right+1 instead of right-1. ------------------------------------------------------------------------ r3025 | jkbonfield | 2012-08-17 10:13:52 +0100 (Fri, 17 Aug 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/tkEditor.c Removed harmless access of uninitialised variable. We check bounds of f1 when scrolling, even when it hasn't been set. But in the same situation it hasn't been set we also then never use it again. ------------------------------------------------------------------------ r3024 | jkbonfield | 2012-08-17 10:11:56 +0100 (Fri, 17 Aug 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Fixed a bug with check-db when run from a child I/O (ie the hidden keybinding for checking internal editor state). ------------------------------------------------------------------------ r3023 | jkbonfield | 2012-08-16 09:46:07 +0100 (Thu, 16 Aug 2012) | 3 lines Changed paths: M /staden/trunk/src/gap4/consen.c Bug fix to fastq output. Values above 94 were becoming negative and then rounded up to 0 quality ('!') when printed out. ------------------------------------------------------------------------ r3022 | jkbonfield | 2012-08-15 16:33:50 +0100 (Wed, 15 Aug 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl Fixed an error causing errors like: registration_callback: expected integer but got "-26848.744" Generated when joining contigs together with the template display up. ------------------------------------------------------------------------ r3021 | jkbonfield | 2012-08-15 15:30:29 +0100 (Wed, 15 Aug 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c Fixed a bug in writing scaffolds with zero items. It was writing the scaffold still (with 0 items and name) instead of just 0 only. This caused failure to read due to corrupted format. ------------------------------------------------------------------------ r3020 | awhitwham | 2012-08-15 14:15:42 +0100 (Wed, 15 Aug 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl M /staden/trunk/src/gap5/tag_plot.c Stop tag code being called when the tag plot is not being displayed. ------------------------------------------------------------------------ r3019 | jkbonfield | 2012-08-15 12:47:08 +0100 (Wed, 15 Aug 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/quality_plot.c Fixed the XFillRectangle in qual plot to be after the check for whether the display is drawn. (Minor speed improvement.) ------------------------------------------------------------------------ r3018 | jkbonfield | 2012-08-15 12:32:00 +0100 (Wed, 15 Aug 2012) | 8 lines Changed paths: M /staden/trunk/src/gap5/gap_range.c Fixed the library type query (--> <-- vs <-- --> vs <-- <--). It previously called update_library_stats over and over again when using mixed libraries. We now cache the results in a hash table. This new code is now much faster, within 5% of the speed of the original template display before we took into account the library type field. ------------------------------------------------------------------------ r3017 | jkbonfield | 2012-08-14 10:01:32 +0100 (Tue, 14 Aug 2012) | 15 lines Changed paths: M /staden/trunk/src/Misc/misc.h M /staden/trunk/src/Misc/strings.c M /staden/trunk/src/gap4/GTAGDB M /staden/trunk/src/gap4/acd2tag.tcl M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/import_gff.c M /staden/trunk/src/gap5/tag_editor.tcl Major overhaul of GFF import and export in Gap5. (Some of this changes code in Gap4 as the tag database and ACD parsing is shared between the two, but in an invisible manner.) We now have a GUI for GFF tags using the #!acdtag syntax. The ACD tag code was extended slightly to allow querying of ACD variables so the unhandled key=value attribute pairs in GFF can be placed inside a text box. Also moved the various escaping and unescaping functions out from export_contigs.c to Misc/strings.c as it's now used in multiple places - all in gap5 atm, but Misc is the right spot. ------------------------------------------------------------------------ r3016 | jkbonfield | 2012-08-10 17:29:56 +0100 (Fri, 10 Aug 2012) | 8 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl Zooming with mouse wheel now operates around the cursor position instead of the centre of the screen. Also reduced the width of the editor cursor line from 5 to 2. It's less intrusive, but harder to select. At some stage we should replace this with a canvas item instead of a frame window and allow for dragging via canvas closest item selection. ------------------------------------------------------------------------ r3015 | jkbonfield | 2012-08-09 14:38:16 +0100 (Thu, 09 Aug 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/import_gff.c Use zfopen (etc) instead of fopen to support gzipped GFF files. ------------------------------------------------------------------------ r3014 | jkbonfield | 2012-08-09 11:20:45 +0100 (Thu, 09 Aug 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Fixed a typo in the contig renaming code preventing it from working. ------------------------------------------------------------------------ r3013 | jkbonfield | 2012-08-08 14:35:15 +0100 (Wed, 08 Aug 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/afg.c M /staden/trunk/src/gap5/caf.c Fix to resolve crash parsing extremely long lines (32Kb or more). ------------------------------------------------------------------------ r3012 | jkbonfield | 2012-08-08 12:07:36 +0100 (Wed, 08 Aug 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_anno.c Improved diagnostics while running Delete Tags. ------------------------------------------------------------------------ r3011 | jkbonfield | 2012-08-06 12:16:44 +0100 (Mon, 06 Aug 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/gap4_compat.c M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/io_utils.h M /staden/trunk/src/gap5/list_proc.c M /staden/trunk/src/gap5/list_proc.h M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/tag_checklist.tcl M /staden/trunk/src/gap5/tclIndex M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_anno.h M /staden/trunk/src/gap5/tg_gio.h Added Delete Tags feature. This removes all tags of specific types in specific contigs. (Warning: with no Undo functionality.) In the process of this I revamped the rec_list_t used by active_list_scaffold et al to just use a tg_rec array. This avoids conflict with rec_list already used elsewhere. ------------------------------------------------------------------------ r3010 | jkbonfield | 2012-08-01 15:25:02 +0100 (Wed, 01 Aug 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5_thrash.tcl Even more muppetry! Added code for testing random sequence moves. ------------------------------------------------------------------------ r3009 | jkbonfield | 2012-08-01 15:24:04 +0100 (Wed, 01 Aug 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/scaffold.tcl M /staden/trunk/src/gap5/tclIndex M /staden/trunk/src/gap5/tg_scaffold.c M /staden/trunk/src/gap5/tg_scaffold.h Added Scaffold exporting code. ------------------------------------------------------------------------ r3008 | awhitwham | 2012-07-26 17:17:36 +0100 (Thu, 26 Jul 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/template_draw.c Fixed potential memory leak. ------------------------------------------------------------------------ r3007 | jkbonfield | 2012-07-25 17:49:04 +0100 (Wed, 25 Jul 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_check.h M /staden/trunk/src/gap5/tg_tcl.c Added Check Database code for checking, and sometimes fixing (untested), scaffolds. ------------------------------------------------------------------------ r3006 | awhitwham | 2012-07-25 17:36:17 +0100 (Wed, 25 Jul 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl Tidy up adding tracks to the tk grid. Also, x zoom by mouse wheel now sets x zoom control. ------------------------------------------------------------------------ r3005 | jkbonfield | 2012-07-25 16:52:40 +0100 (Wed, 25 Jul 2012) | 31 lines Changed paths: M /staden/trunk/src/gap5/complement.tcl M /staden/trunk/src/gap5/contig_id.tcl M /staden/trunk/src/gap5/gap4_compat.c M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/io_utils.h M /staden/trunk/src/gap5/list_contigs.tcl M /staden/trunk/src/gap5/list_proc.c M /staden/trunk/src/gap5/list_proc.h M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h A /staden/trunk/src/gap5/scaffold.tcl M /staden/trunk/src/gap5/tclIndex M /staden/trunk/src/gap5/tg_iface.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_scaffold.c M /staden/trunk/src/gap5/tg_scaffold.h M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tg_tcl.c More updates involving scaffolds. - Scaffold names now have their own index instead of abusing the contig index. - Btree index nodes are now forcibly written on creation, rather than delaying until subsequent adds and updates. This resolves a problem where we create an index but do not enter a single item (as it typically for scaffold_index). - Added code to import an AGP file creating new scaffolds. If contigs are already in a scaffold they'll be silently moved to the new scaffold, but it does not clear any scaffold IDs for existing contigs not mentioned in the AGP file. (Maybe we need a clear scaffolds function? or a bulk remove? Via list contigs?) - contig_id megawidget has a -scaffold option which, when not using -range 1, will permit scaffold names to be used. - Complement Contigs is now Complement Contigs or Scaffolds. Complementing a scaffold complements all members of that scaffold and also reverses the order of members. At present it can only complement a single scaffold. - Added various C->Tcl interface scaffold bits: $io num_scaffolds, $io scaffold_order, db_info get_scaffold_num. - List Contigs ^ and v (up and down) buttons are now autorepeating. They also auto-scroll to keep the data being moved visible on screen. ------------------------------------------------------------------------ r3004 | jkbonfield | 2012-07-25 16:44:12 +0100 (Wed, 25 Jul 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/ace.c We now create a library for all records in an ACE file. Technically this isn't correct as we should honour the WR{lib:} field, but this doesn't seem to be present in most ACE files anyway. ------------------------------------------------------------------------ r3003 | daviesrob | 2012-07-25 11:54:14 +0100 (Wed, 25 Jul 2012) | 10 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c Major rewrite of join_contigs. Instead of simply overlapping the bin structures of the two contigs, it now tries to merge them together by transplanting bins where possible or by moving sequences. It falls back to the old method if it looks like this will be too much work. Most of the activity now takes place in a child IO, so if anything goes wrong the changes so far can be abandoned leaving the database unchanged (at least until it gets to cache_flush). A small amount of activity still takes place on the base IO, mainly the contig notifications and removing the remains of the unwanted contig. ------------------------------------------------------------------------ r3002 | daviesrob | 2012-07-25 11:44:09 +0100 (Wed, 25 Jul 2012) | 8 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_contig.c Only allow bin_unload and contig_unload to destroy bins/contigs on the base IO. Made cache debugging messages more detailed. Fixed various memory leaks in cache_flush. Also changed contig_destroy to use cache_deallocate instead of cache_rec_deallocate as the latter also leaks memory if the caller does not tidy up correctly. ------------------------------------------------------------------------ r3001 | daviesrob | 2012-07-25 11:35:35 +0100 (Wed, 25 Jul 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_bin.c Stop bin_get_item_position from crashing if a bin is missing ------------------------------------------------------------------------ r3000 | daviesrob | 2012-07-24 16:43:17 +0100 (Tue, 24 Jul 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c s/ANNO_ELE_BLOCK/CONTIG_BLOCK/ in io_contig_block_read. Luckily the different block types were both the same size, so the change is just cosmetic. ------------------------------------------------------------------------ r2999 | awhitwham | 2012-07-24 14:44:33 +0100 (Tue, 24 Jul 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/depth.tcl M /staden/trunk/src/gap5/newgap5_cmds.c A /staden/trunk/src/gap5/tag_plot.c A /staden/trunk/src/gap5/tag_plot.h Interim check-in. Add a tag plot to the template display. Needs some further work. ------------------------------------------------------------------------ r2998 | daviesrob | 2012-07-23 12:41:31 +0100 (Mon, 23 Jul 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/tg_bin.c Re-wrote the part of bin_for_range that creates child bins. The new version is a bit shorter, and removes an assumption about the order of the child bins that caused the parent to be incorrectly used instead under certain conditions. ------------------------------------------------------------------------ r2997 | daviesrob | 2012-07-23 11:59:21 +0100 (Mon, 23 Jul 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/hache_table.c Put #ifdef DEBUG around "Resizing HacheTable..." message. ------------------------------------------------------------------------ r2996 | daviesrob | 2012-07-23 11:52:43 +0100 (Mon, 23 Jul 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_gio.c Copy debug_level and debug_fp to child io. ------------------------------------------------------------------------ r2995 | daviesrob | 2012-07-23 11:44:50 +0100 (Mon, 23 Jul 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c When dumping to postscript, fill rows from right to left. This helps to keep each row filled as much as possible. ------------------------------------------------------------------------ r2994 | daviesrob | 2012-07-13 16:54:55 +0100 (Fri, 13 Jul 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/newgap5_cmds.c Use byte arrays instead of strings in tcl_calc_quality and tcl_reformat_sequence. Fixes problems with negative quality values being misinterpreted as UTF8 character codes. ------------------------------------------------------------------------ r2993 | daviesrob | 2012-07-10 13:45:58 +0100 (Tue, 10 Jul 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Fixed bug in calculate_consensus_simple that caused the last base to be missed out if it was immediately after the end of a cached region. ------------------------------------------------------------------------ r2992 | jkbonfield | 2012-07-06 17:04:51 +0100 (Fri, 06 Jul 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/template_display.c Added support for LENGTH, COMPLEMENT and JOIN_TO registration events. This fixes crashes where editing and joining data displayed in the template display is changed by external (to it) edits; eg Join Editor. ------------------------------------------------------------------------ r2991 | jkbonfield | 2012-07-06 13:48:44 +0100 (Fri, 06 Jul 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl Added support for LENGTH, COMPLEMENT and JOIN_TO registration events. This fixes crashes where editing and joining data displayed in the template display is changed by external (to it) edits; eg Join Editor. ------------------------------------------------------------------------ r2990 | jkbonfield | 2012-07-05 15:04:01 +0100 (Thu, 05 Jul 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/gap_range.h Remove the cached contig_t pointer from the gap_range. This can become out of date after contig editing, causing subsequent crashes in the template display. It's only accessed once per redraw, so instead we re-search it every time using the cached record number instead. ------------------------------------------------------------------------ r2989 | jkbonfield | 2012-07-05 15:02:30 +0100 (Thu, 05 Jul 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/tclIndex Added a "Reading #Numbers to Names" list option to convert reading lists generated as #[0-9]+ into sequence names. ------------------------------------------------------------------------ r2988 | jkbonfield | 2012-07-05 12:14:21 +0100 (Thu, 05 Jul 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Initialise range_t.library_rec=0 for consensus sequences. This removes an uninitialised memory access in tg_iface_g.c, although it's largely irrelevant as the data is never used (it just marginally increased storage by a few bytes). ------------------------------------------------------------------------ r2987 | jkbonfield | 2012-07-05 11:26:07 +0100 (Thu, 05 Jul 2012) | 8 lines Changed paths: M /staden/trunk/src/gap5/depth_track.c M /staden/trunk/src/gap5/gap_range.h M /staden/trunk/src/gap5/template_display.c M /staden/trunk/src/gap5/tg_library.c M /staden/trunk/src/gap5/tg_library.h Added a function to work out the maximum expected insert size (mean + 3 standard deviations) of all the libraries. This is used to set the extra query range added to the templay display searches to improve read-pairing. It has the effect of removing 99% of the orange mismatched pairs when viewing plots with large insert libraries. ------------------------------------------------------------------------ r2986 | jkbonfield | 2012-07-04 17:03:45 +0100 (Wed, 04 Jul 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c Fixed a buffer overflow in pack_rng_array (nparts[] array). Also removed some debugging output. ------------------------------------------------------------------------ r2985 | jkbonfield | 2012-07-04 16:47:48 +0100 (Wed, 04 Jul 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl M /staden/trunk/src/gap5/tg_scaffold.c Correction for List Contigs dialogue when using an older database version. We no longer display the scaffold name, permit changing scaffold or attempt to adjust the scaffold order when saving. ------------------------------------------------------------------------ r2984 | jkbonfield | 2012-07-04 16:40:47 +0100 (Wed, 04 Jul 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/editor_search.c M /staden/trunk/src/gap5/editor_search.tcl Code for a basic search by edit. It's incomplete as it only finds confidence 0 or 100. The users deemed this insufficient, so for now it is commented out of the search dialogue, but the code exists and may be extended to provide full edit searching at a later stage. ------------------------------------------------------------------------ r2983 | jkbonfield | 2012-07-04 16:27:37 +0100 (Wed, 04 Jul 2012) | 30 lines Changed paths: M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/contig_editor.tcl A /staden/trunk/src/gap5/contig_graph.tcl M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/gap_utils.tcl M /staden/trunk/src/gap5/list_contigs.tcl M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/tclIndex M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tg_gio.c M /staden/trunk/src/gap5/tg_gio.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_index_common.c A /staden/trunk/src/gap5/tg_scaffold.c A /staden/trunk/src/gap5/tg_scaffold.h M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tg_tcl.c First draft: major addition of scaffolding structures. The GUI support is minimal at present, being limited purely to the List Contigs dialogue, but the underlying data structures seem to be OK. We can now rename contigs from the List Contigs window too (using a new rename_contig proc rather than the old code in the contig editor), in addition to moving contigs between scaffolds. The order can now also be changed using the up and down arrow buttons. (These are unicode - if we get display issues we can change them to bitmaps.) The order of contigs within scaffolds is desired from the main contig order. Part of the implementation adds a scaffold object to Tcl, created by e.g. "set f [$io get_scaffold [$c get_scaffold]]" Also added contig links, although these are currently unused. These provide the ability to form a full graph (eg like FASTG) rather than just a linear scaffold. It is expected that we can use these to store hits from find read pairs, find repeats and find internal joins, with suitable functions to cull or recompute as desired. A noddy and currently unused contig_graph.tcl implementation experiments with ways to draw these graphs. This needs much more work still. The library record is now also stored in the range_t structure. This means that it is fast to detect the correct orientation of sequences in the template display (now implemented) and also in future to provide fast filtering by library methods. Todo: update find read pairs filtering to use this too. ------------------------------------------------------------------------ r2982 | jkbonfield | 2012-07-04 15:21:50 +0100 (Wed, 04 Jul 2012) | 3 lines Changed paths: M /staden/trunk/src/tk_utils/tclIndex M /staden/trunk/src/tk_utils/utils.tcl Added lreverse for when using tcl8.4 or below. Tcl 8.5 or higher uses the builtin version. ------------------------------------------------------------------------ r2981 | jkbonfield | 2012-07-04 15:21:08 +0100 (Wed, 04 Jul 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Unprintable characters in sequences can now be fixed too. ------------------------------------------------------------------------ r2980 | jkbonfield | 2012-07-04 15:19:07 +0100 (Wed, 04 Jul 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c A tidier implementation of Rob's fix to Break Contig. There already existed a function to update the contig cached nseq/nanno values. ------------------------------------------------------------------------ r2979 | jkbonfield | 2012-07-04 15:18:27 +0100 (Wed, 04 Jul 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c Fixed missing prototype. ------------------------------------------------------------------------ r2978 | jkbonfield | 2012-07-04 15:18:04 +0100 (Wed, 04 Jul 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c Fixed potential issue with using add_pads(). This can modify the contig and so change the contig pointer (via cache_rw), but the calling function (align) was using cache_decr on the original pointer. ------------------------------------------------------------------------ r2977 | jkbonfield | 2012-07-04 15:16:30 +0100 (Wed, 04 Jul 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_selector.c M /staden/trunk/src/gap5/tg_sequence.c Fixed minor compiler warnings. ------------------------------------------------------------------------ r2976 | daviesrob | 2012-06-22 09:18:07 +0100 (Fri, 22 Jun 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/break_contig.c Ensure contig seq/refpos/anno counts are up to date in break_contig. ------------------------------------------------------------------------ r2975 | jkbonfield | 2012-06-21 12:47:21 +0100 (Thu, 21 Jun 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Typo in error report for nrefpos. ------------------------------------------------------------------------ r2974 | daviesrob | 2012-06-21 12:24:25 +0100 (Thu, 21 Jun 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Fixed bug in cache_dup. It was returning the wrong pointer for sub-records that has already been duplicated if the pointer to the original was passed in. It now returns the pointer to the copy instead. ------------------------------------------------------------------------ r2973 | jkbonfield | 2012-06-20 12:35:21 +0100 (Wed, 20 Jun 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Added memory cache vs disk checks for GT_ContigBlock type. This avoids the "rec %d of type 26 mismatches" error messages. ------------------------------------------------------------------------ r2972 | awhitwham | 2012-06-18 14:59:44 +0100 (Mon, 18 Jun 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5rc Save "Group By" settings added. ------------------------------------------------------------------------ r2971 | awhitwham | 2012-06-15 12:21:24 +0100 (Fri, 15 Jun 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_struct.h Added a hash value to the group by sequence function in order to group the non matching similar sequences together. ------------------------------------------------------------------------ r2970 | awhitwham | 2012-06-14 12:42:53 +0100 (Thu, 14 Jun 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c More group by selection. On a right to left selection the start is now before the end. Stops the program trying to allocate negative memory. ------------------------------------------------------------------------ r2969 | awhitwham | 2012-06-14 12:20:32 +0100 (Thu, 14 Jun 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Changed the group by selection to act like the other options and no longer needs to be chosen from the selection right click menu. Should have been added to the last commit. ------------------------------------------------------------------------ r2968 | awhitwham | 2012-06-14 12:16:39 +0100 (Thu, 14 Jun 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Changed the group by selection to act like the other options and no longer needs to be chosen from the selection right click menu. ------------------------------------------------------------------------ r2967 | daviesrob | 2012-06-11 17:19:29 +0100 (Mon, 11 Jun 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_bin.c Remember to check incr_avalue when testing if bin seq/repos/anno counts need to be updated ------------------------------------------------------------------------ r2966 | jkbonfield | 2012-05-30 12:32:44 +0100 (Wed, 30 May 2012) | 22 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_iface.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tg_tcl.c Merged multiple GT_Contig records into a single GT_ContigBlock. Internally contigs are still fetched by individual cache_search(io, GT_Contig, crec) calls but like SeqBlock and AnnoEleBlock this populates 1024 entries at a time. For backwards compatibility reasons this is only done on databases with version 5 or higher (previous was v4). To create databases compatible with the old gap5 use "tg_index -v 4". This dramatically reduces the I/O load on bringing up the contig selector. To further reduce I/O for the List Contigs window I also copied the nseqs, nanno and nrefpos fields from the root bin into the contig_t struct too. At the same time I also added placeholders for future work so the format doesn't (hopefully) change too much. [Be warned: even if it does I won't boost the database version number unless I've pushed a new public release out since the initial v5 mods.] These include adding flags and clipped_start/end to contigs (currently flag is never set to indicate validity) and parent scaffold records to contigs and a scaffold order to database_t. ------------------------------------------------------------------------ r2965 | jkbonfield | 2012-05-30 12:16:15 +0100 (Wed, 30 May 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/g-request.c Removed bogus seek calls to pos -4 caused by image being zero instead of G_NO_IMAGE. I'm not sure when this occurs, but we know 0 is invalid too as that will be the file header. ------------------------------------------------------------------------ r2964 | jkbonfield | 2012-05-24 17:51:13 +0100 (Thu, 24 May 2012) | 10 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Added code to range_populate() when sorting by clipped sequence end. If a sequence overlaps the start..end range but after clipping it does not, throw it away so we deal with it later. The reason for this is it was providing out of order sorting between one bucket of data in from range_populate and the next bucket of data in range_populate, causing iterators to give incorrect ordering. This in turn shows up as contig holes leading to erroneous contig breaking around sequences with long cutoff regions. ------------------------------------------------------------------------ r2963 | jkbonfield | 2012-05-15 16:48:39 +0100 (Tue, 15 May 2012) | 11 lines Changed paths: M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_sequence.c Fixed analysis of template status. For the contig editor, via sequence_get_template_info(), we now consider TEMPLATE_ORIENT as a valid return status. For the template display, fixed a bug where assumptions were that r1->comp and r2->comp would be identical. This meant templates spanning bins could sometimes be considered in the wrong orientation. We now correct the COMP1 and COMP2 flags taking this into account. ------------------------------------------------------------------------ r2962 | jkbonfield | 2012-05-15 16:43:44 +0100 (Tue, 15 May 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tkEditor.c Cosmetic improvements to template status colours, to make the contrast easier for those with poor colour vision. ------------------------------------------------------------------------ r2961 | jkbonfield | 2012-05-14 15:29:09 +0100 (Mon, 14 May 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/map_reads.tcl M /staden/trunk/src/gap5/tclIndex Renamed bwa dbwtsw as bwa bwasw, in accordance with the renaming in bwa itself (thank goodness!). Also added an option to specify an output filename. When set this outputs unmapped sequences to a new fasta or fastq file to allow subsequent analysis or import as single-read contigs,. ------------------------------------------------------------------------ r2960 | jkbonfield | 2012-05-10 17:46:47 +0100 (Thu, 10 May 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c Fixed tg_index -g mode. This loads a SAM file that has been aligned against a depadded consensus sequence. It didn't take into consideration that the contig may not start at base 1. (It now does.) ------------------------------------------------------------------------ r2958 | jkbonfield | 2012-04-20 17:21:15 +0100 (Fri, 20 Apr 2012) | 12 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_bin.h Sped up Disassemble Readings by delaying a lot of the consistency updates until after all the reads have been removed. This involved creating a replacement for bin_remove_item_from_bin() called fast_remove_item_from_bin() as well as bulk identifying annotations for sets of reads instead of individual reads and delaying of fixing contig start/end values. Also sped up the bin_get_item_position() function when sequences are used; it can utilise the seq->bin_index field to prevent a full bin search. ------------------------------------------------------------------------ r2957 | jkbonfield | 2012-04-20 17:14:52 +0100 (Fri, 20 Apr 2012) | 3 lines Changed paths: M /staden/trunk/src/Misc/vlen.c Support for long long via %lld. This is automatically generated on 32-bit machines when using %"PRId64". ------------------------------------------------------------------------ r2956 | awhitwham | 2012-04-20 12:04:04 +0100 (Fri, 20 Apr 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/editor_view.h M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tkEditor.c Added group by sequence. This uses niave match scoring but should be good enough for proof of concept. ------------------------------------------------------------------------ r2955 | jkbonfield | 2012-04-19 16:34:41 +0100 (Thu, 19 Apr 2012) | 8 lines Changed paths: M /staden/trunk/src/gap5/contig_selector.c M /staden/trunk/src/gap5/contig_selector.tcl M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/tg_tcl.c Added the ability to show tags in the contig selector. Performance is adequate, but not great. On a database with ~1000 contigs and ~1000 tags it adds 6-7s. With ~400,000 tags it adds 12s or so. (The initial bulk time is due to scanning bins.) By default tags are not shown. ------------------------------------------------------------------------ r2954 | daviesrob | 2012-04-19 12:22:35 +0100 (Thu, 19 Apr 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tg_tcl.c Rewrote code to dump the bin structure as a postscript file. Also added a dump_graph version that outputs graphviz format. ------------------------------------------------------------------------ r2953 | jkbonfield | 2012-04-17 15:21:00 +0100 (Tue, 17 Apr 2012) | 11 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/tkEditor.c M /staden/trunk/src/gap5/tkEditor.h M /staden/trunk/src/tk_utils/xcombobox.tcl Added the ability to switch between multiple lists for selecting reads in the contig editor. For fast use, the list name and number of elements in the list are visible in the editor tool bar. New lists can be created simply by typing in a new name. A little oddly, the displayed list size is also a menubutton allowing actions to load, save, delete and clear. I'm open to ideas on more conventional UI wisdom for how to manage this in a compact manner. Also added a -postcommand to the emulated combobox, needed for this UI. ------------------------------------------------------------------------ r2952 | jkbonfield | 2012-04-16 12:34:38 +0100 (Mon, 16 Apr 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/editor_view.h M /staden/trunk/src/gap5/tkEdNames.c Added Shift+B1 binding for the contig editor names panel for bulk selection of sequences. This only acts in the vertical orientation. An attempt to select, scroll in X and then shift+click will be ignored as this is an altogether trickier operation (if not impossible) to complete. ------------------------------------------------------------------------ r2951 | jkbonfield | 2012-04-13 15:11:53 +0100 (Fri, 13 Apr 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Bug fix to editor_return function. It wasn't changing the status line due to non-global variable access. ------------------------------------------------------------------------ r2950 | jkbonfield | 2012-04-13 14:56:05 +0100 (Fri, 13 Apr 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/depth.tcl M /staden/trunk/src/gap5/gap5rc_menu_full Added a "Template Display" entry to the Commands menu in the contig editor. This brings up the standard template display centred on the current editor x-view location. ------------------------------------------------------------------------ r2949 | jkbonfield | 2012-04-13 11:53:30 +0100 (Fri, 13 Apr 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/tag_editor.tcl Fixed an issue with copy/move tags when no region has been selected. This now follows gap4 behaviour and copies or moves to a single bp tag. ------------------------------------------------------------------------ r2948 | jkbonfield | 2012-04-13 10:55:31 +0100 (Fri, 13 Apr 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/tg_tcl.c M /staden/trunk/src/tk_utils/tclIndex M /staden/trunk/src/tk_utils/utils.tcl Fixed insertion and deletion impact on tags, with correctly working Undo too. This also involved adding an lprepend analogue to the lappend function. ------------------------------------------------------------------------ r2947 | jkbonfield | 2012-04-11 12:45:08 +0100 (Wed, 11 Apr 2012) | 17 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Found a cause of consensus caching to sometimes use different bins, causing unnecessary work. Even when we have a fully cached consensus, updated by doing "Save consensus" for all contigs, asking for smaller ranges of consensus (eg search by consensus quality) would sometimes return a different set of bins to hold the cached consensus, causing recomputation of the consensus again. The cause is that the function returns the first (ie largest) bins within a range smaller than a fixed size (100Kb). If we have a bin with only one child node to the right, then on a full range query that child node may be returned, but on a smaller range query it may be excluded and the parent node is instead returned. The code now explictly checks for this case and filters such bins. ------------------------------------------------------------------------ r2946 | jkbonfield | 2012-04-10 17:41:36 +0100 (Tue, 10 Apr 2012) | 3 lines Changed paths: M /staden/trunk/src/tk_utils/xentry.tcl Fixed missing brace in xentry (sorry for not checking the KP_Enter binding fix). ------------------------------------------------------------------------ r2945 | jkbonfield | 2012-04-10 12:36:10 +0100 (Tue, 10 Apr 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/tg_bin.c Improvements to editor delete vs backspace code. Also fixed a rare data consistency error when removing data from bins. ------------------------------------------------------------------------ r2944 | jkbonfield | 2012-04-05 14:08:10 +0100 (Thu, 05 Apr 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Added several key bindings for inserting and deleting while keeping the right side of the alignment stationary. These are Shift + key, eg shift-Backspace, shift-Delete, shift-Insert. Also added a control-z binding for Undo. ------------------------------------------------------------------------ r2943 | jkbonfield | 2012-04-05 09:58:55 +0100 (Thu, 05 Apr 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/tag_editor.tcl M /staden/trunk/src/gap5/tg_tcl.c Added Copy and Move functionality to the Tag Editor, as in Gap4. These even allow moving and copying of tags between editors. ------------------------------------------------------------------------ r2942 | jkbonfield | 2012-04-03 16:59:52 +0100 (Tue, 03 Apr 2012) | 10 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Added KP_Enter binding for position panel (in addition to existing Return key binding). Changed Delete key to delete under the cursor and not move, vs remove from left of cursor and move for Backspace. Added functionality to move pads left and right with Control-L and Control-R. For those that like to live dangerously, bases can also be moved if you use Alt-L and Alt-R bindings. ------------------------------------------------------------------------ r2941 | jkbonfield | 2012-04-03 16:57:55 +0100 (Tue, 03 Apr 2012) | 2 lines Changed paths: M /staden/trunk/src/tk_utils/entrybox.tcl M /staden/trunk/src/tk_utils/xentry.tcl Added keypad Enter key bindings where we bound to Return key. ------------------------------------------------------------------------ r2940 | jkbonfield | 2012-04-03 09:56:21 +0100 (Tue, 03 Apr 2012) | 4 lines Changed paths: M /staden/trunk/src/gap4/editor_search.tcl https://sourceforge.net/tracker/?func=detail&aid=3276158&group_id=100316&atid=627060 Added patch from Bastien to bind Control-S "next search" in search window. ------------------------------------------------------------------------ r2939 | jkbonfield | 2012-04-02 14:44:41 +0100 (Mon, 02 Apr 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/find_oligo.tcl Use =rec syntax for All Contigs list to work around broken contig indices ------------------------------------------------------------------------ r2938 | jkbonfield | 2012-04-02 14:44:12 +0100 (Mon, 02 Apr 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/sam_pileup.c Changes to handle nasties with SAM cigar strings starting in I or P operators (or I/P after S/H). Also fixed output to cope with these cases too. ------------------------------------------------------------------------ r2937 | jkbonfield | 2012-03-29 17:52:01 +0100 (Thu, 29 Mar 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/bam.c M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/fasta.c Fixed issues with zero length template names. These were used in FASTA import, but they caused oddities in SAM export and some other formats where we ended up with a blank read name and the entire name being fitted into the FS:Z: field. (Fixed in both import and export code.) Also changed the default SAM/BAM quality values to be 2, from 0. ------------------------------------------------------------------------ r2936 | jkbonfield | 2012-03-28 09:44:49 +0100 (Wed, 28 Mar 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Fixed an issue with consensus caching. We identify that a specific bin misses a cached consensus sequence and compute it, but then use bin_add_range to add it instead of bin_add_to_range. This meant that after joining where we can have multiple bins spanning the same physical coordinates that we could be piling up duplicate consensus sequences in one bin due to failing to find them in another. ------------------------------------------------------------------------ r2935 | jkbonfield | 2012-03-27 16:40:05 +0100 (Tue, 27 Mar 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c More bin_set_used_range() calls - missed out in the earlier commit? ------------------------------------------------------------------------ r2934 | jkbonfield | 2012-03-27 16:39:23 +0100 (Tue, 27 Mar 2012) | 10 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/export_contigs.c Fixed sequence orientation bugs. One is in the editor view where "<<" and ">>" were reported in the information line incorrectly on complemented contigs. The other is more serious and in the export to SAM code. It was incorrectly setting the orientation flags. This mean exporting a "--> <--" pair in a complemented contig and re-importing turned them into a "<-- -->" pair, showing up as red in the template display. ------------------------------------------------------------------------ r2933 | jkbonfield | 2012-03-27 16:37:31 +0100 (Tue, 27 Mar 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Fixed some editor cursor starting positions. When bringing up the editor on a specific sequence, it should now be visible. ------------------------------------------------------------------------ r2932 | jkbonfield | 2012-03-27 10:28:29 +0100 (Tue, 27 Mar 2012) | 12 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/gap5_thrash.tcl M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_bin.h Further bug fixes to reference position handling, discovered by the million monkeys script. We now have a new function bin_set_used_range() that brute force iterates through bin contents and sets start_used and end_used fields. We call this any time we remove something from the bin that also happens to be at the current start_used or end_used boundaries (meaning it *may* require a change). Also fixed a bug in contig_delete_base_fix(). It needed to recurse down with +1 on the bin extents, as this corresponds to the refpos edits applied elsewhere. ------------------------------------------------------------------------ r2931 | jkbonfield | 2012-03-23 16:12:59 +0000 (Fri, 23 Mar 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/tg_bin.c More refpos & bin range bug fixes, including a fix to the last fix. (Checking nrefpos==0 is not sufficient as it is hierarchical - an empty bin may has full child bins.) ------------------------------------------------------------------------ r2930 | jkbonfield | 2012-03-23 11:52:26 +0000 (Fri, 23 Mar 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c Further fix to contig_remove_refpos_markers() called when making joins. As per previous fix, but note that removing a refpos marker that is the first or last thing in a bin also means we have to adjust the start_used and end_used too. ------------------------------------------------------------------------ r2929 | jkbonfield | 2012-03-23 11:24:57 +0000 (Fri, 23 Mar 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c Fix for a bug causing "bin 1741: used start/end range are incorrect" style errors from Check Database. When we remove the last reference position marker from a bin and there is nothing else in the bin either, we now zero the start/end range to mark the bin as empty. ------------------------------------------------------------------------ r2928 | jkbonfield | 2012-03-23 11:24:00 +0000 (Fri, 23 Mar 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Improvements to cope with data corruptions better. ------------------------------------------------------------------------ r2927 | jkbonfield | 2012-03-23 11:23:20 +0000 (Fri, 23 Mar 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/gap5_thrash.tcl Minor output tidyup ------------------------------------------------------------------------ r2926 | jkbonfield | 2012-03-22 17:51:32 +0000 (Thu, 22 Mar 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Fixed tag corruption in disassemble readings. Consensus annotations that are shared between original and new contigs had their tag type and direction fields swapped, causing errors. ------------------------------------------------------------------------ r2925 | jkbonfield | 2012-03-22 09:28:54 +0000 (Thu, 22 Mar 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/b+tree2.c M /staden/trunk/src/gap5/fij.c A couple more minor tweaks to stop compiler whinges - shouldn't affect any actual code paths. ------------------------------------------------------------------------ r2924 | jkbonfield | 2012-03-21 16:33:40 +0000 (Wed, 21 Mar 2012) | 16 lines Changed paths: M /staden/trunk/src/gap5/ace.c M /staden/trunk/src/gap5/consen.c M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/fasta.c M /staden/trunk/src/gap5/find_repeats.c M /staden/trunk/src/gap5/gap-error.c M /staden/trunk/src/gap5/gap_hash.c M /staden/trunk/src/gap5/hache_table.c M /staden/trunk/src/gap5/hash_lib.c M /staden/trunk/src/gap5/qual.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_gio.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_tcl.c M /staden/trunk/src/gap5/tk-io-reg.c Code tidy up, looking at various gcc -W warning output and complaints from the \ clang static analyser. Most are warnings about things that cannot happen, incorrect handling of error cases that "should not" happen, or just warnings about pointless code and unused variables. A few are genuine: - The (currently unused) uniqueness plot access uninitialised memory in var W. - Various verror calls using strings which could contain %s and fail (but I don't think they were exploitable and under user control). ------------------------------------------------------------------------ r2923 | daviesrob | 2012-03-20 17:34:02 +0000 (Tue, 20 Mar 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Sort cached_items forwards by record_number instead of backwards by view in cache_flush. This puts the file contents in a more sensible order when building the database. ------------------------------------------------------------------------ r2922 | jkbonfield | 2012-03-20 17:31:44 +0000 (Tue, 20 Mar 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/zfio.h Fixed an error with using gzFile* instead of gzFile. This didn't matter in zlib 1.2.5 and before as all function prototypes took a void pointer for this argument. With zlib-1.2.6 this is now a structure and so now producing errors. ------------------------------------------------------------------------ r2921 | jkbonfield | 2012-03-16 17:19:08 +0000 (Fri, 16 Mar 2012) | 2 lines Changed paths: M /staden/trunk/src/seq_utils/align_lib.c Protect against alignments of nul data. ------------------------------------------------------------------------ r2920 | jkbonfield | 2012-03-16 17:18:46 +0000 (Fri, 16 Mar 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Protect against zero length reads. ------------------------------------------------------------------------ r2919 | jkbonfield | 2012-03-16 17:18:29 +0000 (Fri, 16 Mar 2012) | 12 lines Changed paths: M /staden/trunk/src/gap5/ace.c Bug fixes to the ACE format reading code. It now handles (ie ignores instead of choking) WR{} records. It also now spots left/right clip points as both -1 and discards such entries and unaligned data. Finally it handles the lack of DS lines. Previously it added reads when seeing a DS line. Now it adds reads when it sees either a new CO or RD line so the lack of DS lines does not mean a total lack of imported data. ------------------------------------------------------------------------ r2918 | jkbonfield | 2012-03-16 17:14:30 +0000 (Fri, 16 Mar 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Removal of debugging. ------------------------------------------------------------------------ r2917 | jkbonfield | 2012-03-16 12:31:49 +0000 (Fri, 16 Mar 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/maq.c Removed a rogue free statement. I'm not sure why this didn't die before, but we haven't tested maq support for a couple of years. ------------------------------------------------------------------------ r2916 | jkbonfield | 2012-03-16 12:31:25 +0000 (Fri, 16 Mar 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/restriction_enzymes.c M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/tg_cache.c Fixed various %d vs %"PRIrec" issues. ------------------------------------------------------------------------ r2915 | jkbonfield | 2012-03-16 12:30:41 +0000 (Fri, 16 Mar 2012) | 13 lines Changed paths: M /staden/trunk/src/gap5/b+tree2.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_iface.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_struct.h Fixed various losses in the name and contig indices. The bug was that when creating a new root node, we did not always spot this and left the old db->contig_index and db->seq_name_index pointing to the original root node. This has the effect of removing data from the tree. Both insert and delete could cause this. Note we did sometimes update correctly, it was just omitted in a few places. Related to this was the fact that deletion never returned the root correctly (but it's a rare issue) and both insert/delete were returning int instead of tg_rec. ------------------------------------------------------------------------ r2914 | jkbonfield | 2012-03-12 16:42:10 +0000 (Mon, 12 Mar 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/gap4_compat.tcl Fixed a minor memory leak in the consensus algorithm. Fixed another memory leak (potentially very large) in the Tcl code for cname2crec when faced with a database with a corrupted B-Tree. ------------------------------------------------------------------------ r2913 | jkbonfield | 2012-03-12 10:23:20 +0000 (Mon, 12 Mar 2012) | 11 lines Changed paths: M /staden/trunk/src/gap5/b+tree2.c Fixed some B+Tree update errors when dealing with large numbers of duplicate strings (more than an entire nodes worth). Fixed a tree error when updating the parent after a deletion of the right-most entry in a node. I'm not sure if this was capable of recreating the issues users sometimes see (entries going missing from the tree), but it's an inconsistency which may lead to more errors downstream. Also improved debugging with -DTEST_MAIN. ------------------------------------------------------------------------ r2912 | jkbonfield | 2012-03-12 10:20:11 +0000 (Mon, 12 Mar 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Fixed potential uninitialise memory access in update_io(). The effect was harmless though - it would sometimes write data back to disc that didn't need to be written as it had not changed. ------------------------------------------------------------------------ r2911 | jkbonfield | 2012-03-08 11:23:47 +0000 (Thu, 08 Mar 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Fixed an illegal cache_decr call if edGetBriefSeq() is called with a nul format string (not really a valid case). Also fixed the %*.*c printf argument case. Precision (the .* bit) is not permitted in %c expansion. ------------------------------------------------------------------------ r2910 | jkbonfield | 2012-03-08 10:32:44 +0000 (Thu, 08 Mar 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Fixed simple_sort_by_base() error when given broken input (if the records are not sequences it accessed uninitialised memory). ------------------------------------------------------------------------ r2909 | jkbonfield | 2012-03-08 10:15:59 +0000 (Thu, 08 Mar 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Fixed a bug spotted by Rob, via clang. In build_malign, the recent code to handle zero length sequences was using an uninitialised variable in the fix-up. ------------------------------------------------------------------------ r2908 | jkbonfield | 2012-03-07 15:21:50 +0000 (Wed, 07 Mar 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/editor_search.c Fixed a bug in the editor Sequence Search. It was failing to correctly record the best match position for sequences that overlapped the starting position of the search range. Similarly fixed reverse searches. ------------------------------------------------------------------------ r2907 | jkbonfield | 2012-03-02 16:26:59 +0000 (Fri, 02 Mar 2012) | 10 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Warning: I'm not *100%* certain this is correct! Swapped the unlock and commit calls during the flush procedure. Previously this was causing B+Tree writes to be auto-flushed giving lots of index updates. Now they'll also be appended on the "to flush" list due to the lock and updated in one step along with the other records recently written. The theory was to improve performance, but I'm not sure it makes much difference. ------------------------------------------------------------------------ r2906 | jkbonfield | 2012-03-02 16:25:14 +0000 (Fri, 02 Mar 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_index.c More frequent flushing of B+Tree to reduce max memory usage ------------------------------------------------------------------------ r2905 | jkbonfield | 2012-03-02 16:24:13 +0000 (Fri, 02 Mar 2012) | 3 lines Changed paths: A /staden/trunk/src/tk_utils/console.tcl M /staden/trunk/src/tk_utils/tclIndex M /staden/trunk/src/tk_utils/text_output.tcl Replaced the Console mode with newer code (triggered by typing "con" into the error window). ------------------------------------------------------------------------ r2904 | jkbonfield | 2012-03-02 16:23:23 +0000 (Fri, 02 Mar 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/contig_id.tcl M /staden/trunk/src/gap5/select_contig.tcl M /staden/trunk/src/tk_utils/scalebox.tcl Fixed the setting of the contig start/end range in the contig ID selector. This sometimes worked, but not in all cases. Now it should always use the visible start/end coordinates. ------------------------------------------------------------------------ r2903 | jkbonfield | 2012-03-02 16:21:41 +0000 (Fri, 02 Mar 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/gap4_compat.c Improved warning messages to the user ------------------------------------------------------------------------ r2902 | jkbonfield | 2012-03-02 16:21:25 +0000 (Fri, 02 Mar 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/consen.c Fixed illegal cache_decr in error handling code (so not normally triggered). ------------------------------------------------------------------------ r2901 | jkbonfield | 2012-03-02 16:20:46 +0000 (Fri, 02 Mar 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Faster implementation of Delete Contig. The code to unlink other sequences from ones we have deleted has an additional sort step to iterate through sequences in order, to reduce disc thrashing. It also periodically flushes and reports progress. ------------------------------------------------------------------------ r2900 | jkbonfield | 2012-03-02 16:17:59 +0000 (Fri, 02 Mar 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap5_export.tcl Protect against broken name B+Tree by operating on =number contig list by default. ------------------------------------------------------------------------ r2899 | daviesrob | 2012-03-02 13:59:46 +0000 (Fri, 02 Mar 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/check_assembly.c M /staden/trunk/src/gap5/consen.c M /staden/trunk/src/gap5/contig_extend.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/editor_join.c A /staden/trunk/src/gap5/editor_join.h M /staden/trunk/src/gap5/editor_search.c M /staden/trunk/src/gap5/editor_view.h M /staden/trunk/src/gap5/find_oligo.c M /staden/trunk/src/gap5/gap4_compat.h M /staden/trunk/src/gap5/gap_canvas_box.c M /staden/trunk/src/gap5/init.c M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/restriction_enzymes.c M /staden/trunk/src/gap5/restriction_enzymes.h M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/stack_dump.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_tcl.c M /staden/trunk/src/gap5/tg_tcl.h M /staden/trunk/src/gap5/tk-io-reg.c M /staden/trunk/src/gap5/tkAppInit.c Fixed lots of implicit function declarations ------------------------------------------------------------------------ r2898 | daviesrob | 2012-03-01 17:13:51 +0000 (Thu, 01 Mar 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/caf.c Fixed accidental assignment in if statement ------------------------------------------------------------------------ r2897 | jkbonfield | 2012-02-24 17:28:57 +0000 (Fri, 24 Feb 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Protect against negative or zero length sequences. The assertion has simply been replaced by code that fixes the errors. ------------------------------------------------------------------------ r2896 | jkbonfield | 2012-02-16 12:12:59 +0000 (Thu, 16 Feb 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/search.tcl Now with improved error reporting. ------------------------------------------------------------------------ r2895 | jkbonfield | 2012-02-16 12:08:19 +0000 (Thu, 16 Feb 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/search.tcl Protect against crashes when trying to bring double click on a hyperlinked contig that no longer exists. ------------------------------------------------------------------------ r2894 | jkbonfield | 2012-02-16 12:07:18 +0000 (Thu, 16 Feb 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_gio.c Protect against attempts to read contigs via location in contig order when using a child I/O. ------------------------------------------------------------------------ r2893 | jkbonfield | 2012-02-16 12:06:43 +0000 (Thu, 16 Feb 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/consen.c M /staden/trunk/src/gap5/fij.tcl Implemented the hidden data search mode of FIJ. Removed from the GUI the unimplemented mask/mark parameters. ------------------------------------------------------------------------ r2892 | jkbonfield | 2012-02-13 16:23:23 +0000 (Mon, 13 Feb 2012) | 9 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/gap5rc Fixed a bug in remove_contig_holes() called by Break Contig and Disassemble Readings. When remove_contig_holes() found a hole and called break_contig it was incorrectly checking the return code, causing falsely reported failures. On a related topic I also changed Break Contig in the contig editor to default to not removing holes. This can be overridden by modifying the CONTIG_EDITOR.REMOVE_HOLES setting in ~/.gap5rc. ------------------------------------------------------------------------ r2891 | jkbonfield | 2012-02-09 15:29:43 +0000 (Thu, 09 Feb 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/import_gff.c Made the GFF import more liberal when facing percent escaping that is invalid. Ie %xx where x are not hex digits will just treat it as unescaped text instead (which is typically output from a badly coded GFF generator). ------------------------------------------------------------------------ r2890 | jkbonfield | 2012-02-08 17:29:26 +0000 (Wed, 08 Feb 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/Makefile A /staden/trunk/src/gap5/contig_extend.c A /staden/trunk/src/gap5/contig_extend.h A /staden/trunk/src/gap5/contig_extend.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/tclIndex Added the implementation of the Extend Contigs function. This looks into the cutoff data at the ends of contigs and where the bulk of cutoff data aligns with each other it is unclipped and the contig extended. ------------------------------------------------------------------------ r2889 | jkbonfield | 2012-02-03 12:39:33 +0000 (Fri, 03 Feb 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Export to fastq now automatically strips pads. If users request then this could be made optional, but it seems logical that the use of fastq export is to realign data again so pad stripped makes most sense. ------------------------------------------------------------------------ r2888 | jkbonfield | 2012-02-03 12:38:39 +0000 (Fri, 03 Feb 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Bug fix to the fix mode of Check Contig. It was failing to correct contig annotations that overlapped the end of the consensus, due to changing the bin to uninitialised values. ------------------------------------------------------------------------ r2887 | jkbonfield | 2012-02-03 12:37:46 +0000 (Fri, 03 Feb 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/break_contig.c Fixed typo in error message ------------------------------------------------------------------------ r2886 | jkbonfield | 2012-02-03 12:37:27 +0000 (Fri, 03 Feb 2012) | 7 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h Fixed the %d operator in the editor sequence information line. This is for the direction of a read, but it was giving the same data as sense (ie complemented or not). Now we can get +>> -<< as well as ->> +<< combinations to indicate whether a sequence is the 1st or 2nd in a pair. ------------------------------------------------------------------------ r2885 | jkbonfield | 2012-01-31 17:26:59 +0000 (Tue, 31 Jan 2012) | 8 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/newgap5_cmds.c First draft of editor Realign Selection function. This takes a region of a sequence and realigns it against the consensus, editing sequence and/or consensus accordingly. It also adjusts the cutoff regions to make any selection visible if appropriate. ------------------------------------------------------------------------ r2884 | jkbonfield | 2012-01-27 14:44:17 +0000 (Fri, 27 Jan 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Robustness improvement - handle more cases of xx->r == NULL. (Why is this happening?) ------------------------------------------------------------------------ r2883 | jkbonfield | 2012-01-27 14:43:57 +0000 (Fri, 27 Jan 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/b+tree2.c Improved debugging and thrash/test code. ------------------------------------------------------------------------ r2882 | jkbonfield | 2012-01-24 12:32:11 +0000 (Tue, 24 Jan 2012) | 2 lines Changed paths: M /staden/trunk/src/README.build Information to help those on broken RedHat based systems. ------------------------------------------------------------------------ r2881 | jkbonfield | 2012-01-23 17:27:35 +0000 (Mon, 23 Jan 2012) | 3 lines Changed paths: M /staden/trunk/src/mutscan/Makefile M /staden/trunk/src/tracediff/Makefile Fixed the order of library linking so that these programs link on Ubuntu 11.10. ------------------------------------------------------------------------ r2880 | jkbonfield | 2012-01-20 11:28:09 +0000 (Fri, 20 Jan 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/editor_search.c edview_search_position() on a contig position failed if the cursor was not on the consensus as it thought the contigs mismatched. We now correctly check against xx->cnum instead xx->cursor_rec. ------------------------------------------------------------------------ r2879 | jkbonfield | 2012-01-19 09:10:36 +0000 (Thu, 19 Jan 2012) | 7 lines Changed paths: M /staden/trunk/src/staden.profile Allow for GTAGDB to be specified before sourcing staden.profile instead of simply overriding it. [The change of the wrapper scripts to call this file directly instead of each replicating parts of each removed the ability to override several variables.] ------------------------------------------------------------------------ r2878 | jkbonfield | 2012-01-18 14:52:38 +0000 (Wed, 18 Jan 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_index_common.c Protect against tmpnam + open failing. (Race condition?). I've seen this happen, but cannot explain why. ------------------------------------------------------------------------ r2877 | jkbonfield | 2012-01-18 14:51:56 +0000 (Wed, 18 Jan 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Improved reliability in the face of contigs that fail to be read. This is important as gap5_export + tg_index together form a database fixer. ------------------------------------------------------------------------ r2876 | jkbonfield | 2012-01-18 14:45:27 +0000 (Wed, 18 Jan 2012) | 6 lines Changed paths: M /staden/trunk/src/gap5/fasta.c M /staden/trunk/src/gap5/maq.c M /staden/trunk/src/gap5/tg_iface_g.c Added code to initialise template name length in maq and fasta import. This was giving random values which caused exports to die. We now check for sane values when loading a seq_block and reinitialise if appropriate to recover from past mistakes. ------------------------------------------------------------------------ r2875 | jkbonfield | 2012-01-16 11:56:34 +0000 (Mon, 16 Jan 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/tg_contig.c Improved error handling for when sequence records fail to load. ------------------------------------------------------------------------ r2874 | jkbonfield | 2012-01-16 11:40:32 +0000 (Mon, 16 Jan 2012) | 12 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.tcl M /staden/trunk/src/gap5/gap4_compat.c M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/tclIndex Fixed export contigs to cope with a broken contig name B+Tree. I'm not sure what is corrupting this tree, but when faced with a large number of contigs not in the tree two main issues occured: 1) We couldn't export all contigs. We now generate a contig list of "=rec ..." instead of "name ...", completely avoiding the lookup to the index. 2) The contig uniqness part in lget_contig_num ironically introduced a duplicate if any contigs returned 0 for their name lookup. ------------------------------------------------------------------------ r2873 | jkbonfield | 2012-01-12 12:28:53 +0000 (Thu, 12 Jan 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Added code to fix tags that are extended beyond the bounds of the item they annotate. ------------------------------------------------------------------------ r2872 | jkbonfield | 2012-01-12 12:05:16 +0000 (Thu, 12 Jan 2012) | 3 lines Changed paths: M /staden/trunk/src/tk_utils/init.c Further fix needed to make tg_index work after the "new_contigs" list addition. ------------------------------------------------------------------------ r2871 | jkbonfield | 2012-01-12 12:04:52 +0000 (Thu, 12 Jan 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/sam_index.c Added bounds checking for tags on both import and exported. This prevents crashes when faced with invalid data and also means that export+import can act as a way to tidy up inconsistencies. ------------------------------------------------------------------------ r2870 | jkbonfield | 2012-01-12 12:03:44 +0000 (Thu, 12 Jan 2012) | 1 line Changed paths: M /staden/trunk/src/gap5/editor_view.c Added a comment to explain some rather obfuscated looking code ------------------------------------------------------------------------ r2869 | jkbonfield | 2012-01-12 12:03:16 +0000 (Thu, 12 Jan 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/list_proc.c Bug fix to recent addition of "new_contigs" list in gap5. It was breaking tg_index, which runs without a Tcl interpreter and therefore generated errors when attempting to append to a list. ------------------------------------------------------------------------ r2868 | jkbonfield | 2012-01-10 17:00:45 +0000 (Tue, 10 Jan 2012) | 4 lines Changed paths: M /staden/trunk/src/gap5/editor_search.c M /staden/trunk/src/gap5/editor_search.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/seq_utils/search_utils.c M /staden/trunk/src/seq_utils/search_utils.h Added a new sequence search to the contig editor in gap5. This is like the consensus search, but on sequences instead (and correspondingly slower of course). ------------------------------------------------------------------------ r2867 | jkbonfield | 2012-01-10 16:45:19 +0000 (Tue, 10 Jan 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Added a list named "new_contigs". This is automatically appended to every time the contig_new() function is called, so Break Contig, Disassemble Readings, Assembly etc all append the new contig names to this list. It can be cleared at any time to reset it. ------------------------------------------------------------------------ r2866 | jkbonfield | 2012-01-10 16:44:17 +0000 (Tue, 10 Jan 2012) | 5 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Changed by user request: disassembling a set of reads where some reads in the set do not exist in the database will no longer terminate the disassembly process. Instead it continues and disassembles the ones that do exist. ------------------------------------------------------------------------ r2865 | jkbonfield | 2012-01-10 15:25:30 +0000 (Tue, 10 Jan 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Improve debugging output for Break Contig so we can distinguish which error case is which. ------------------------------------------------------------------------ r2864 | jkbonfield | 2012-01-09 15:29:47 +0000 (Mon, 09 Jan 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/tman_interface.c Fixed crashes in join editor when making a join with the trace display open. ------------------------------------------------------------------------ r2863 | jkbonfield | 2012-01-09 09:34:14 +0000 (Mon, 09 Jan 2012) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_tcl.c Improved error handling (report err instead of crash). ------------------------------------------------------------------------ r2862 | jkbonfield | 2012-01-06 17:41:17 +0000 (Fri, 06 Jan 2012) | 3 lines Changed paths: M /staden/trunk/src/gap5/depth.tcl Fixed a bug with the initial placement of data in the template display. ------------------------------------------------------------------------ r2861 | jkbonfield | 2012-01-04 12:28:12 +0000 (Wed, 04 Jan 2012) | 4 lines Changed paths: M /staden/trunk/src/system.mk.in Removed ^ from expr BRE. It was generating warnings on some systems, and it's not needed either as all BREs are anchored from the start of the string anyway in expr. ------------------------------------------------------------------------ r2860 | jkbonfield | 2012-01-04 11:58:03 +0000 (Wed, 04 Jan 2012) | 8 lines Changed paths: M /staden/trunk/src/copy_reads/Makefile M /staden/trunk/src/copy_reads/copy_reads.in M /staden/trunk/src/gap4/Makefile M /staden/trunk/src/gap4/gap4.in M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/gap5.in M /staden/trunk/src/gap5/gap5_check.in M /staden/trunk/src/gap5/gap5_consensus.in M /staden/trunk/src/gap5/gap5_export.in M /staden/trunk/src/gap5/tg_index.in M /staden/trunk/src/gap5/tg_view.in M /staden/trunk/src/prefinish/Makefile M /staden/trunk/src/prefinish/prefinish.in M /staden/trunk/src/pregap4/Makefile M /staden/trunk/src/pregap4/pregap4.in M /staden/trunk/src/spin/Makefile M /staden/trunk/src/spin/spin.in M /staden/trunk/src/system.mk.in M /staden/trunk/src/trev/Makefile M /staden/trunk/src/trev/trev.in Fixed the wrapper scripts to handle STADENROOT having spaces in the path name. Added use of the BSD install program instead of cp for the wrapper scripts. When they're generated from .in they don't automatically get the execute bit set, so we need to explictly do this while installing. See system.mk.in for an alternative solution. ------------------------------------------------------------------------ r2859 | jkbonfield | 2012-01-04 11:53:09 +0000 (Wed, 04 Jan 2012) | 1 line Changed paths: M /staden/trunk/src/README.macosx ------------------------------------------------------------------------ r2858 | jkbonfield | 2011-12-15 16:52:16 +0000 (Thu, 15 Dec 2011) | 6 lines Changed paths: A /staden/trunk/src/MacOSX A /staden/trunk/src/MacOSX/Gap4.app A /staden/trunk/src/MacOSX/Gap4.app/Contents A /staden/trunk/src/MacOSX/Gap4.app/Contents/Info.plist A /staden/trunk/src/MacOSX/Gap4.app/Contents/MacOS A /staden/trunk/src/MacOSX/Gap4.app/Contents/Resources A /staden/trunk/src/MacOSX/Gap4.app/Contents/Resources/appIcon.icns A /staden/trunk/src/MacOSX/Gap5.app A /staden/trunk/src/MacOSX/Gap5.app/Contents A /staden/trunk/src/MacOSX/Gap5.app/Contents/Info.plist A /staden/trunk/src/MacOSX/Gap5.app/Contents/MacOS A /staden/trunk/src/MacOSX/Gap5.app/Contents/Resources A /staden/trunk/src/MacOSX/Gap5.app/Contents/Resources/appIcon.icns A /staden/trunk/src/MacOSX/Pregap4.app A /staden/trunk/src/MacOSX/Pregap4.app/Contents A /staden/trunk/src/MacOSX/Pregap4.app/Contents/Info.plist A /staden/trunk/src/MacOSX/Pregap4.app/Contents/MacOS A /staden/trunk/src/MacOSX/Pregap4.app/Contents/Resources A /staden/trunk/src/MacOSX/Pregap4.app/Contents/Resources/appIcon.icns A /staden/trunk/src/MacOSX/Spin.app A /staden/trunk/src/MacOSX/Spin.app/Contents A /staden/trunk/src/MacOSX/Spin.app/Contents/Info.plist A /staden/trunk/src/MacOSX/Spin.app/Contents/MacOS A /staden/trunk/src/MacOSX/Spin.app/Contents/Resources A /staden/trunk/src/MacOSX/Spin.app/Contents/Resources/appIcon.icns A /staden/trunk/src/MacOSX/Trev.app A /staden/trunk/src/MacOSX/Trev.app/Contents A /staden/trunk/src/MacOSX/Trev.app/Contents/Info.plist A /staden/trunk/src/MacOSX/Trev.app/Contents/MacOS A /staden/trunk/src/MacOSX/Trev.app/Contents/Resources A /staden/trunk/src/MacOSX/Trev.app/Contents/Resources/appIcon.icns A /staden/trunk/src/MacOSX/wrapper.c Added additional components for MacOS X. Each .app needs a program name in the Contents/MacOS directory (eg Contents/MacOS/gap5). This will then be redirected to bin/gap5 instead. The source for the program is wrapper.c ------------------------------------------------------------------------ r2857 | jkbonfield | 2011-12-14 16:58:21 +0000 (Wed, 14 Dec 2011) | 2 lines Changed paths: M /staden/trunk/src/tk_utils/tkTrace.c Fixed use of setjmp for libpng (required for newer libpng versions). ------------------------------------------------------------------------ r2856 | awhitwham | 2011-12-14 09:38:24 +0000 (Wed, 14 Dec 2011) | 2 lines Changed paths: M /staden/trunk/src/windows/wix/splash.bmp Changed for version b9. ------------------------------------------------------------------------ r2855 | jkbonfield | 2011-12-13 13:54:59 +0000 (Tue, 13 Dec 2011) | 7 lines Changed paths: M /staden/trunk/src/configure.in M /staden/trunk/src/copy_reads/Makefile D /staden/trunk/src/copy_reads/copy_reads A /staden/trunk/src/copy_reads/copy_reads.in (from /staden/trunk/src/copy_reads/copy_reads:2849) M /staden/trunk/src/gap4/Makefile D /staden/trunk/src/gap4/gap4 A /staden/trunk/src/gap4/gap4.in (from /staden/trunk/src/gap4/gap4:2849) M /staden/trunk/src/gap5/Makefile D /staden/trunk/src/gap5/gap5 A /staden/trunk/src/gap5/gap5.in (from /staden/trunk/src/gap5/gap5:2849) D /staden/trunk/src/gap5/gap5_check A /staden/trunk/src/gap5/gap5_check.in (from /staden/trunk/src/gap5/gap5_check:2849) D /staden/trunk/src/gap5/gap5_consensus A /staden/trunk/src/gap5/gap5_consensus.in (from /staden/trunk/src/gap5/gap5_consensus:2849) D /staden/trunk/src/gap5/gap5_export A /staden/trunk/src/gap5/gap5_export.in (from /staden/trunk/src/gap5/gap5_export:2849) D /staden/trunk/src/gap5/tg_index A /staden/trunk/src/gap5/tg_index.in (from /staden/trunk/src/gap5/tg_index:2849) D /staden/trunk/src/gap5/tg_view A /staden/trunk/src/gap5/tg_view.in (from /staden/trunk/src/gap5/tg_view:2849) M /staden/trunk/src/prefinish/Makefile D /staden/trunk/src/prefinish/prefinish A /staden/trunk/src/prefinish/prefinish.in (from /staden/trunk/src/prefinish/prefinish:2849) M /staden/trunk/src/pregap4/Makefile D /staden/trunk/src/pregap4/pregap4 A /staden/trunk/src/pregap4/pregap4.in (from /staden/trunk/src/pregap4/pregap4:2849) M /staden/trunk/src/spin/Makefile D /staden/trunk/src/spin/spin A /staden/trunk/src/spin/spin.in (from /staden/trunk/src/spin/spin:2849) M /staden/trunk/src/staden.profile M /staden/trunk/src/trev/Makefile D /staden/trunk/src/trev/trev A /staden/trunk/src/trev/trev.in (from /staden/trunk/src/trev/trev:2849) Replaced tclsh in the wrapper scripts with @TCLSH_PROG@ coming from tcl.m4 via autoconf. Also changed the tg_view and tg_index binaries to be .bin, so as not to conflict with the wrapper scripts when configuring and building in the main source directory rather than a subdirectory (recommended). ------------------------------------------------------------------------ r2854 | jkbonfield | 2011-12-13 10:22:06 +0000 (Tue, 13 Dec 2011) | 2 lines Changed paths: M /staden/trunk/src/gap4/template_display.c Removal of debugging data. ------------------------------------------------------------------------ r2853 | jkbonfield | 2011-12-13 10:09:28 +0000 (Tue, 13 Dec 2011) | 3 lines Changed paths: M /staden/trunk/src/system.mk.in Improvements to use of svnversion: quoting the result and also a check for it looking legitimate (starting with a numeric value). ======================================================================== RELEASED 2.0.0b9 r2852 | jkbonfield | 2011-12-05 12:26:04 +0000 (Mon, 05 Dec 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_gio.c Changed the Open Database error message to be classified as an error instead of text output. This means it goes to stderr and/or the error window. ------------------------------------------------------------------------ r2850 | jkbonfield | 2011-12-05 10:31:10 +0000 (Mon, 05 Dec 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS M /staden/trunk/src/ReleaseNotes ------------------------------------------------------------------------ r2849 | awhitwham | 2011-12-01 16:32:45 +0000 (Thu, 01 Dec 2011) | 2 lines Changed paths: M /staden/trunk/src/gap4/list_contigs.tcl Changed to work with tk8.5. ------------------------------------------------------------------------ r2848 | jkbonfield | 2011-12-01 14:14:21 +0000 (Thu, 01 Dec 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/tg_bin.c Changed bin_invalidate_consensus() to invalidate more bins rather than just leaf nodes at a fixed size. This is partly because sometimes contig_bins_in_range returns other sets of leaf nodes (I'm not sure why), but also because it's safer this way given bins can and do change size due to edits. ------------------------------------------------------------------------ r2847 | awhitwham | 2011-12-01 12:34:42 +0000 (Thu, 01 Dec 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl Removed subscript from global that is now illegal in tk8.5 ------------------------------------------------------------------------ r2846 | awhitwham | 2011-11-30 16:21:31 +0000 (Wed, 30 Nov 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/caf.c Put in code to deal with DOS text format and file opening changes for Windows. ------------------------------------------------------------------------ r2845 | jkbonfield | 2011-11-29 09:47:58 +0000 (Tue, 29 Nov 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Fixed illegal memory access in contig_set_name(). ------------------------------------------------------------------------ r2844 | jkbonfield | 2011-11-28 13:55:24 +0000 (Mon, 28 Nov 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/Makefile Added gap5_check to distsrc target. ------------------------------------------------------------------------ r2843 | jkbonfield | 2011-11-28 13:55:01 +0000 (Mon, 28 Nov 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/fasta.c Set maping qual to zero. Previously it was undefined and resulted in "mapping_qual disagrees with range" from check database. ------------------------------------------------------------------------ r2842 | jkbonfield | 2011-11-28 13:54:33 +0000 (Mon, 28 Nov 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/tg_index_common.c Removed contig_index_update calls as contig_set_name, called by contig_new, now does this. It was causing double entries in the contig index. ------------------------------------------------------------------------ r2841 | jkbonfield | 2011-11-25 15:23:41 +0000 (Fri, 25 Nov 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Removed "default" as the default tag comment. ------------------------------------------------------------------------ r2840 | jkbonfield | 2011-11-25 15:00:32 +0000 (Fri, 25 Nov 2011) | 2 lines Changed paths: M /staden/trunk/src/configure.in Update to 2.0.0b9 ------------------------------------------------------------------------ r2839 | jkbonfield | 2011-11-25 14:58:27 +0000 (Fri, 25 Nov 2011) | 8 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/sam_index.c Improved SAM tag format handling. Previously we ignored all key=value syntax and just read the data as-is. This is fine for Gap5 given we don't actually use key=value pairing yet, however it meant gap5 could output data which other programs may not understand. Now we always prepend Note= to the annotations so that other tools aren't confused. ------------------------------------------------------------------------ r2838 | jkbonfield | 2011-11-25 10:44:20 +0000 (Fri, 25 Nov 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/caf.c Added code to remove quotes from (for example) template lines in CAF files, which was causing failure messages. Also added some experimental code to trim template suffixes, where MIRA's templates almost but not quite match a prefix of the sequence name. ------------------------------------------------------------------------ r2837 | jkbonfield | 2011-11-24 17:47:08 +0000 (Thu, 24 Nov 2011) | 5 lines Changed paths: D /staden/trunk/src/gap5/IO.h D /staden/trunk/src/gap5/IO2.h M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/check_assembly.c M /staden/trunk/src/gap5/consen.c M /staden/trunk/src/gap5/consen.h M /staden/trunk/src/gap5/contig_selector.c M /staden/trunk/src/gap5/contig_selector.h M /staden/trunk/src/gap5/cs-object.h M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/fij.h M /staden/trunk/src/gap5/find_oligo.c M /staden/trunk/src/gap5/find_oligo.h M /staden/trunk/src/gap5/find_repeats.c M /staden/trunk/src/gap5/find_repeats.h D /staden/trunk/src/gap5/gap-dbstruct.h M /staden/trunk/src/gap5/gap_canvas_box.h M /staden/trunk/src/gap5/io_utils.h M /staden/trunk/src/gap5/list_proc.h M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_cmds.h M /staden/trunk/src/gap5/newgap_structs.h M /staden/trunk/src/gap5/qualIO.c M /staden/trunk/src/gap5/readpair.c M /staden/trunk/src/gap5/restriction_enzymes.h Removed defunct Gap4 copies of header files and replaced where included with appropriate tg_gio or io_utils.h includes. Removed: IO.h, IO2.h, gap-dbstruct.h ------------------------------------------------------------------------ r2836 | jkbonfield | 2011-11-23 16:51:57 +0000 (Wed, 23 Nov 2011) | 2 lines Changed paths: M /staden/trunk/ChangeLog M /staden/trunk/doc/Makefile M /staden/trunk/doc/manual/dependencies M /staden/trunk/doc/manual/gap5-t.texi M /staden/trunk/doc/manual/gap5_break_contig.png A /staden/trunk/doc/manual/gap5_check_ass.png A /staden/trunk/doc/manual/gap5_check_database.png A /staden/trunk/doc/manual/gap5_check_db-t.texi M /staden/trunk/doc/manual/gap5_contig_editor-t.texi M /staden/trunk/doc/manual/gap5_contig_editor.names1.png M /staden/trunk/doc/manual/gap5_contig_editor.names2.png M /staden/trunk/doc/manual/gap5_contig_editor.search.png A /staden/trunk/doc/manual/gap5_delete_contigs.png M /staden/trunk/doc/manual/gap5_disassembly-t.texi M /staden/trunk/doc/manual/gap5_export-t.texi M /staden/trunk/doc/manual/gap5_export_sequences.png M /staden/trunk/doc/manual/gap5_fij-t.texi A /staden/trunk/doc/manual/gap5_fij.dialogue.png M /staden/trunk/doc/manual/gap5_list_libraries.png A /staden/trunk/doc/manual/gap5_org-t.texi A /staden/trunk/doc/manual/gap5_remove_contig_holes.png A /staden/trunk/doc/manual/gap5_remove_pad_columns.png A /staden/trunk/doc/manual/gap5_shuffle-t.texi A /staden/trunk/doc/manual/gap5_shuffle_pads.png M /staden/trunk/doc/manual/list_libraries-t.texi M /staden/trunk/doc/manual/lists-t.texi M /staden/trunk/doc/manual/restrict_enzymes-t.texi M /staden/trunk/src/gap5/check_database.tcl M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/dis_readings.tcl M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/shuffle_pads.tcl Updated documentation for gap5. ------------------------------------------------------------------------ r2835 | jkbonfield | 2011-11-22 14:44:49 +0000 (Tue, 22 Nov 2011) | 1 line Changed paths: M /staden/trunk/src/ReleaseNotes ------------------------------------------------------------------------ r2834 | jkbonfield | 2011-11-22 14:42:18 +0000 (Tue, 22 Nov 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS ------------------------------------------------------------------------ r2833 | jkbonfield | 2011-11-22 14:17:14 +0000 (Tue, 22 Nov 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/gap4_compat.c Protect against invalid contig in get_contig_name(). This showed up as a crash when highlighting a sequence name where the sequence is paired with one that is no longer attached to a contig - itself a bug in the delete contig code (now fixed). ------------------------------------------------------------------------ r2832 | jkbonfield | 2011-11-22 12:40:23 +0000 (Tue, 22 Nov 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.tcl M /staden/trunk/src/gap5/gap5rc_menu_full Reordered entries in the Edit menu to group contig oriented and sequence oriented functions. Also renamed Disassemble Contigs as Delete Contigs and put a warning message in it too as some users accidentally used this in place of Disassemble Readings. ------------------------------------------------------------------------ r2831 | jkbonfield | 2011-11-22 12:36:30 +0000 (Tue, 22 Nov 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/editor_search.c Fixed a bug in backward sequence search. It was failing to handle block overlaps when scanning backwards meaning a 65 base pattern would fail to be spotted 1 in 1000 times due to spanning blocks. ------------------------------------------------------------------------ r2830 | jkbonfield | 2011-11-22 12:35:25 +0000 (Tue, 22 Nov 2011) | 5 lines Changed paths: M /staden/trunk/src/gap4/consen.tcl M /staden/trunk/src/gap5/consen.tcl M /staden/trunk/src/gap5/export_contigs.tcl M /staden/trunk/src/gap5/gap5rc_menu_full Fixed a broken error window in various dialogues that save files. Also simplified the save consensus option for gap5: no need to select from the pointless sub-menu. ------------------------------------------------------------------------ r2829 | jkbonfield | 2011-11-17 16:16:19 +0000 (Thu, 17 Nov 2011) | 10 lines Changed paths: M /staden/trunk/src/gap5/hash_lib.c M /staden/trunk/src/gap5/hash_lib.h Fixed a bug in align_blocks(). It wasn't resetting gap_pen correctly in one step. Also tweaked this to downgrade scores when stitching blocks together, based on a rough heuristic on the number of mismatches in inter-block regions. Reduced the MINMAT parameter from 20 to 12, allowing the sensitive algorithm to potentially find more hits. ------------------------------------------------------------------------ r2828 | jkbonfield | 2011-11-16 17:11:11 +0000 (Wed, 16 Nov 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/gap_restriction_enzymes.tcl M /staden/trunk/src/gap5/list_contigs.tcl M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tg_tcl.c M /staden/trunk/src/gap5/tkEditor.c Added the ability to rename contigs and change the contig start location. This is available by the scripting interface in tg_tcl, and exposed to the users by Contig editor dialogues. ------------------------------------------------------------------------ r2827 | jkbonfield | 2011-11-16 16:47:13 +0000 (Wed, 16 Nov 2011) | 12 lines Changed paths: M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/check_assembly.c M /staden/trunk/src/gap5/contig_selector.c M /staden/trunk/src/gap5/cs-object.h M /staden/trunk/src/gap5/fij.c M /staden/trunk/src/gap5/gap_canvas_box.c M /staden/trunk/src/gap5/gap_canvas_box.h D /staden/trunk/src/gap5/io-reg.h M /staden/trunk/src/gap5/restriction_enzymes.c M /staden/trunk/src/gap5/restriction_enzymes.h R /staden/trunk/src/gap5/tg_register.h M /staden/trunk/src/gap5/tk-io-reg.c Removed the defunct io-reg.h, which in most places was being included but ignored due to the correct tg_register.h having replaced it already. The exception to this is in restriction_enzymes.c which was only including the old io-reg.h, and it turns out in doing so was making some registration handling bugs due to int vs tg_rec on for record IDs. Also added RENAME as a registration type. This is sent when a contig changes name. ------------------------------------------------------------------------ r2826 | jkbonfield | 2011-11-16 10:32:27 +0000 (Wed, 16 Nov 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/editor_search.c Fixed edview_search_position to check contig number matches. (This has the effect of fixing the From File search to skip matches in other contigs.) ------------------------------------------------------------------------ r2825 | jkbonfield | 2011-11-16 10:03:03 +0000 (Wed, 16 Nov 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/tg_anno.c More error checking, this time in anno_ele_add() for when bin_add_to_range() fails. I can't yet figure out why this function would fail though, so for now it just emits a suitable error to aid in bug reporting. ------------------------------------------------------------------------ r2824 | jkbonfield | 2011-11-16 09:57:46 +0000 (Wed, 16 Nov 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Attempt to avoid crashes when running out of memory in edview_visible_items(). ------------------------------------------------------------------------ r2823 | jkbonfield | 2011-11-16 09:39:03 +0000 (Wed, 16 Nov 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_index_common.c Additional check in bttmp_file_open() to see if fdopen fails. It appears to have done based on a core dump, but maybe it was simply malloc failure. Unknown at present. ------------------------------------------------------------------------ r2822 | awhitwham | 2011-11-09 16:35:20 +0000 (Wed, 09 Nov 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/depth_track.c Fixed bug in template depth display due to the inconsistant colour being set to zero. ------------------------------------------------------------------------ r2821 | jkbonfield | 2011-11-07 16:31:04 +0000 (Mon, 07 Nov 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c Added back the count of the number of sequences indexed in SAM. Somehow this got lost in a recent update. ------------------------------------------------------------------------ r2820 | jkbonfield | 2011-11-07 12:02:13 +0000 (Mon, 07 Nov 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/consensus.c More unpadded coordinate fixes - this time to consensus_padded_pos() so it's now the correct analogue to consensus_unpadded_pos(). ------------------------------------------------------------------------ r2819 | jkbonfield | 2011-11-04 17:34:04 +0000 (Fri, 04 Nov 2011) | 11 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/import_gff.c Changed unpadded GFF coordinates to agree with the new unpadded coords in the editor: base 1 is the left base, regardless of where the contig start coordinate is. This works well for local users and it matches up with coordinates in a FASTA file, but may cause issues for people using gap5 in a reference coordinate system. (Right now this isn't common, if at all, given there are better viewers for such things. If it becomes a problem we can revisit this and make the unpadded coordinate start point optional.) ------------------------------------------------------------------------ r2818 | jkbonfield | 2011-11-04 17:31:28 +0000 (Fri, 04 Nov 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Improved error recovery. ------------------------------------------------------------------------ r2817 | jkbonfield | 2011-11-04 16:31:16 +0000 (Fri, 04 Nov 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Check Database now correctly fixes bin parenting issues. It was failing to set BIN_BIN_UPDATED flag so the previous fix was silently being dropped when flushing to disk. ------------------------------------------------------------------------ r2816 | jkbonfield | 2011-11-04 12:07:14 +0000 (Fri, 04 Nov 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/sam_index.c Replaced RT with CT for consensus tags. I thought I'd already done this, but it seems I'd merely updated the format and not the type code. ------------------------------------------------------------------------ r2815 | jkbonfield | 2011-11-04 10:41:27 +0000 (Fri, 04 Nov 2011) | 1 line Changed paths: A /staden/trunk/src/ReleaseNotes Don't get too excited - but it's on the way ------------------------------------------------------------------------ r2814 | jkbonfield | 2011-11-03 17:20:20 +0000 (Thu, 03 Nov 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS ------------------------------------------------------------------------ r2813 | jkbonfield | 2011-11-03 17:00:37 +0000 (Thu, 03 Nov 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Better error handling in consensus_valid_range when faced with corrupted data. ------------------------------------------------------------------------ r2812 | jkbonfield | 2011-11-03 16:37:29 +0000 (Thu, 03 Nov 2011) | 8 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_check.h M /staden/trunk/src/gap5/tg_tcl.c Updated to Check Database to fix an observed problem where failure part way through joining a contig could leave a residual contig behind, but containing data already corrected linked in to another contig. When fixing this we now destroy the contig if we can determine that the root bin has a two-way linkage with the true parent. ------------------------------------------------------------------------ r2811 | jkbonfield | 2011-11-03 15:15:47 +0000 (Thu, 03 Nov 2011) | 12 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c Fixed reference count handling in join_contigs(). A user was rarely seeing the right hand contig not being destroyed after a contig join. The only possible code route I can see for this happening is cr being freed during one of the plots redrawing via contig_notify callbacks, and cr memory being reused to point to, say, a bin object. Then contig_destroy(io, cr->rec) later on fails as the object isn't valid. At least I hope that's the cause of that bug... Whatever the case this is a bug and it's fixed. ------------------------------------------------------------------------ r2810 | jkbonfield | 2011-11-03 14:44:25 +0000 (Thu, 03 Nov 2011) | 33 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Scary change, but I *think* a correct one... It seems to pass my gap5_thrash tests anyway. When doing cache_rw on an object from a derived (aka child) io, we use copy-on-write methods to duplicate the object from the parent io into the child io. The address we return to the caller is now the child io object instead. This is implemented via cache_dup(). This is used within the contig editor to allow for edits to be not live and also to allow exit without saving. When incremementing or decrementing the reference count on a child io object we were previously just working on that object itself. However the cache_dup function didn't copy the full reference count from the parent - this is perhaps a bug. Consequentially it's possible to perform several cache_incr on a read-only object, call cache_rw to get a new one (now with ref count 1 again), and then cache_decr on the read-write object and trigger an error due to negative reference counts. Rather than attempt to fix this via copying the master ref count into the child io object, which itself causes other errors, I now do all reference counting on the master object instead. Hence a cache_incr or cache_decr on an object in the child io will update the ref count in the parent io. (This is perhaps not implemented in the most efficient manner, using a separate cache_search, but if it has performance issues consider implementing a master pointer to cached_item struct.) I believe this is robust given the child io only contains cache_rw objects and we'll never be wanting to purge from the child - making it more hash than hache. ------------------------------------------------------------------------ r2809 | jkbonfield | 2011-11-03 14:23:29 +0000 (Thu, 03 Nov 2011) | 1 line Changed paths: M /staden/trunk/src/tk_utils/filebrowser.tcl Bug fix to the 'file does not exist' error dialogue ------------------------------------------------------------------------ r2808 | jkbonfield | 2011-11-03 14:23:09 +0000 (Thu, 03 Nov 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_selector.tcl Protect against some strange case where the bounding box is empty, perhaps due to firing a scroll event that occurs during redraw. ------------------------------------------------------------------------ r2807 | jkbonfield | 2011-11-03 14:22:32 +0000 (Thu, 03 Nov 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Minor cache ref fix ------------------------------------------------------------------------ r2806 | jkbonfield | 2011-11-03 14:22:11 +0000 (Thu, 03 Nov 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Fixed a bug in Disassemble Contigs - it now unpairs paired reads that point to one of the disassembled readings. Also added minor speedup to unlink_read(). ------------------------------------------------------------------------ r2805 | jkbonfield | 2011-11-03 11:34:06 +0000 (Thu, 03 Nov 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/tg_check.c Don't report bin memory/disk conflicts when dealing with known issues of older DB formats ------------------------------------------------------------------------ r2804 | jkbonfield | 2011-11-03 11:32:45 +0000 (Thu, 03 Nov 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/dis_readings.c Added io flush to Disassemble Contigs ------------------------------------------------------------------------ r2803 | jkbonfield | 2011-11-02 17:13:59 +0000 (Wed, 02 Nov 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/tg_contig.c Fixed some shuffle pads bugs where it could produce out of alignment data (due to incorrectly adjusting clip points) and also trigger oddities with removing columns of pads when there exists an out of date cached consensus (having no *). ------------------------------------------------------------------------ r2802 | jkbonfield | 2011-11-02 16:51:05 +0000 (Wed, 02 Nov 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_sequence.c Comment only. (A question about complementing seqs.) ------------------------------------------------------------------------ r2801 | jkbonfield | 2011-11-02 09:54:51 +0000 (Wed, 02 Nov 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Fixed the Join Editor quitting/saving. It was previously only checking for edits and offering to save in the active contig (with the solid editor cursor). This only impacted the join editor where changes were made and then we decided not to make a join, but to save the changed regardless. ------------------------------------------------------------------------ r2800 | jkbonfield | 2011-11-02 09:53:35 +0000 (Wed, 02 Nov 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Fixed edPrevDifference; it was finding a false difference every 1024 bases. ------------------------------------------------------------------------ r2799 | jkbonfield | 2011-11-01 16:48:01 +0000 (Tue, 01 Nov 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Check Database in fix mode now clears any consensus cache. This has been added due to the recent (fortunately short-lived) bug that sometimes cached Ns in valid consensus bases. ------------------------------------------------------------------------ r2798 | jkbonfield | 2011-11-01 16:47:22 +0000 (Tue, 01 Nov 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/shuffle_pads.tcl Fix window title for Remove Pad Columns ------------------------------------------------------------------------ r2797 | jkbonfield | 2011-11-01 14:01:47 +0000 (Tue, 01 Nov 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Fix to consensus calling for N when reads contain only N. It previously only did this in certain cases (when flags & CONS_COUNTS is set). This showed up as cut and pasting of consensus giving A instead of N. ------------------------------------------------------------------------ r2796 | jkbonfield | 2011-11-01 12:26:18 +0000 (Tue, 01 Nov 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Improved speed of fetching consensus when we're in read-only mode and no consensus cache exists. (Don't bother trying.) Bug fix to consensus_unpadded_pos(). Now starts from base 1 in all cases. ------------------------------------------------------------------------ r2795 | jkbonfield | 2011-10-31 17:08:56 +0000 (Mon, 31 Oct 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Fixed a bug in Export Contigs to SAM format involving the handling of template names. It could sometimes cause a crash. ------------------------------------------------------------------------ r2794 | jkbonfield | 2011-10-31 17:08:35 +0000 (Mon, 31 Oct 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/break_contig.h M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/tg_tcl.c Added an option to Break Contig at a specific position within the contig editor. ------------------------------------------------------------------------ r2793 | jkbonfield | 2011-10-26 16:53:16 +0100 (Wed, 26 Oct 2011) | 12 lines Changed paths: M /staden/trunk/src/gap5/baf.c M /staden/trunk/src/gap5/caf.c M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/import_gff.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tag_editor.tcl M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_anno.h M /staden/trunk/src/gap5/tg_gio.c M /staden/trunk/src/gap5/tg_gio.h M /staden/trunk/src/gap5/tg_iface.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_index.c M /staden/trunk/src/gap5/tg_index.h M /staden/trunk/src/gap5/tg_struct.h M /staden/trunk/src/gap5/tg_tcl.c Tag directions are now stored in the database, and can be edited/set using the Tag Editor within the contig editor. This required a change of database format, with the master format number now being 4, meaning that older gap5s will not be able to load the latest databases (but vice versa is true). I also added the ability of tg_index to create databases in older formats. In this case run "tg_index -v 3". However doing so will mean attempts to set tag strands will silently fail as they cannot be written back to disc. ------------------------------------------------------------------------ r2792 | jkbonfield | 2011-10-26 12:00:13 +0100 (Wed, 26 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Added n/- bindings for editing sequence. Also Insert key for inserting pads. ------------------------------------------------------------------------ r2791 | jkbonfield | 2011-10-26 10:23:18 +0100 (Wed, 26 Oct 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/sam_pileup.c M /staden/trunk/src/gap5/sam_pileup.h Fixed the tag export format to use ; instead of | for field separators in CT and PT tags. Fixed parsing of tags in padded SAM files. It now takes note of whether a base is explicitly added via cigar-P or implicitly added via another sequences cigar-I. ------------------------------------------------------------------------ r2790 | jkbonfield | 2011-10-25 14:21:42 +0100 (Tue, 25 Oct 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS ------------------------------------------------------------------------ r2789 | jkbonfield | 2011-10-25 14:05:08 +0100 (Tue, 25 Oct 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Fixed consensus when consisting solely of reads of N. We now force the consensus to be N too. Also included some currently unused code for uniqueness testing. ------------------------------------------------------------------------ r2788 | awhitwham | 2011-10-25 11:52:59 +0100 (Tue, 25 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_sequence.h Some code tidying on tg_contig. ------------------------------------------------------------------------ r2787 | jkbonfield | 2011-10-24 16:55:13 +0100 (Mon, 24 Oct 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Protect against users trying to create annotations off the ends of contigs (in the cutoff data). ------------------------------------------------------------------------ r2786 | jkbonfield | 2011-10-24 12:31:49 +0100 (Mon, 24 Oct 2011) | 21 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_join.c Major join editor bug fix. When making a join, the first thing the editor does is to save both contigs. This causes a redraw of both editors and in doing so was causing the editors to adjust the X scrollbar to ensure the editing cursor is visible on screen. If the join Lock mode wasn't enable and the editor cursors weren't both visible this would shift one editor with respect to the other, immediately before making the join. It happens so fast you can't see it. The effect was a catastrophically broken join with sequences out of alignment. The fix was changing the REG_LENGTH event callback in the editor to not request the cursor to be visible when calling $ed set_cursor. I also added an explicit recalculation of xx->link->lockOffset in edJoin as it assumes this to be valid, but it appears something already recomputes this (maybe the save). I left that fix there though for belt-n-braces extra checking. ------------------------------------------------------------------------ r2785 | jkbonfield | 2011-10-21 12:11:46 +0100 (Fri, 21 Oct 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/dis_readings.h M /staden/trunk/src/gap5/dis_readings.tcl M /staden/trunk/src/gap5/gap5.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/tclIndex First draft of Disassemble Contigs. (It works in the limited testing I have time to do before local site shutdown.) ------------------------------------------------------------------------ r2784 | jkbonfield | 2011-10-20 15:03:21 +0100 (Thu, 20 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h M /staden/trunk/src/gap5/tg_tcl.c Added a bulk trimming function using < and > in the contig editor. ------------------------------------------------------------------------ r2783 | awhitwham | 2011-10-20 14:54:20 +0100 (Thu, 20 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/editor_view.h M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tkEditor.c Added group by base. Still some tidying to be done on the grouping code. ------------------------------------------------------------------------ r2782 | jkbonfield | 2011-10-19 16:46:23 +0100 (Wed, 19 Oct 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Protect against attempts to join a contig to itself. This was possible if you deliberately brought up the same pair twice and then made the join in the first one, leaving the second join editor still in existance with a still functioning Join button. ------------------------------------------------------------------------ r2781 | jkbonfield | 2011-10-19 16:38:37 +0100 (Wed, 19 Oct 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Removed the edview->contig cached contig_t. We now always load on demand using cache_search. This avoids the need to use incr_contig and decr_contig methods for keeping it up to date when we modify it somehow. It's perhaps marginally slower, but more robust. ------------------------------------------------------------------------ r2780 | jkbonfield | 2011-10-19 16:37:59 +0100 (Wed, 19 Oct 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/editor_oligo.c M /staden/trunk/src/gap5/editor_search.c M /staden/trunk/src/gap5/editor_view.h M /staden/trunk/src/gap5/tkEdNames.c M /staden/trunk/src/gap5/tkEditor.c Removed the edview->contig cached contig_t. We now always load on demand using cache_search. This avoids the need to use incr_contig and decr_contig methods for keeping it up to date when we modify it somehow. It's perhaps marginally slower, but more robust. ------------------------------------------------------------------------ r2779 | jkbonfield | 2011-10-19 12:28:58 +0100 (Wed, 19 Oct 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Protect against malformed data - no longer crashing when a read-pair record number fails to load. ------------------------------------------------------------------------ r2778 | jkbonfield | 2011-10-19 11:21:48 +0100 (Wed, 19 Oct 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_join.c Fixed redrawing bugs when using the Join Editor and having existing contig editors on screen for the same contig. This is mainly a problem of cached xx->contig structs, but I will be removing these soon I think. This patch is simply to mark the best version so far with using cached contigs. ------------------------------------------------------------------------ r2777 | jkbonfield | 2011-10-19 09:47:28 +0100 (Wed, 19 Oct 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl fix typo ------------------------------------------------------------------------ r2776 | jkbonfield | 2011-10-19 09:47:18 +0100 (Wed, 19 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/list_proc.tcl Added "Contigs to readings" function ------------------------------------------------------------------------ r2775 | jkbonfield | 2011-10-18 16:46:57 +0100 (Tue, 18 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Correct the window title of joined editors. ------------------------------------------------------------------------ r2774 | jkbonfield | 2011-10-18 12:02:45 +0100 (Tue, 18 Oct 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Added a %B expansion for the sequence information line. This expands to the bin record number containing the sequence. It is intended to be used for debugging purposes. ------------------------------------------------------------------------ r2773 | jkbonfield | 2011-10-18 12:02:04 +0100 (Tue, 18 Oct 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Added the ability to copy and paste contig names as well as reading names from the editor window. Also rebound <2> to be copy by #number, with <1> still being "name". ------------------------------------------------------------------------ r2772 | jkbonfield | 2011-10-17 18:09:25 +0100 (Mon, 17 Oct 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Fixed a bug where we failed to check for empty contigs properly when removing readings coming from multiple contigs. ------------------------------------------------------------------------ r2771 | jkbonfield | 2011-10-17 18:08:43 +0100 (Mon, 17 Oct 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl Added No.Annotations field to the copy buffer ------------------------------------------------------------------------ r2770 | jkbonfield | 2011-10-17 18:08:30 +0100 (Mon, 17 Oct 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/b+tree2.c M /staden/trunk/src/gap5/tg_iface_g.c Fixed some caching bugs with the B+Tree code, showing up as crashes or corruptions. ------------------------------------------------------------------------ r2769 | jkbonfield | 2011-10-13 17:05:22 +0100 (Thu, 13 Oct 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c Bug fix to new SAM exporting: - Blank tags no longer get an additional '|' character. - Consensus tags are now sorted correctly, removing the need to use samtools sort. ------------------------------------------------------------------------ r2768 | jkbonfield | 2011-10-13 17:04:39 +0100 (Thu, 13 Oct 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS ------------------------------------------------------------------------ r2767 | jkbonfield | 2011-10-13 16:28:10 +0100 (Thu, 13 Oct 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Protect against a crash due to a data error. I don't know how this can happen yet, but it's possible to have old data in the cache for a record which no longer exists. This causes Check Database to explode when verifying the cache against the disk copies. (Now it just complains and keeps going.) ------------------------------------------------------------------------ r2766 | jkbonfield | 2011-10-13 16:26:45 +0100 (Thu, 13 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap4_compat.c Improved contig_name_to_number() to handle #. ------------------------------------------------------------------------ r2765 | jkbonfield | 2011-10-13 14:33:05 +0100 (Thu, 13 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/Misc/dstring.c M /staden/trunk/src/gap5/sam_index.c Fixes to the new SAM tag encodings and their URL style escaping. ------------------------------------------------------------------------ r2764 | jkbonfield | 2011-10-12 17:44:57 +0100 (Wed, 12 Oct 2011) | 3 lines Changed paths: M /staden/trunk/src/Misc/dstring.c M /staden/trunk/src/Misc/dstring.h M /staden/trunk/src/gap5/bam.c M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/sam_pileup.c Added experimental code for supporting the new tag format within SAM. Ongoing work - see samtools-devel mailing list. ------------------------------------------------------------------------ r2763 | jkbonfield | 2011-10-12 10:04:58 +0100 (Wed, 12 Oct 2011) | 13 lines Changed paths: M /staden/trunk/src/gap5/Makefile A /staden/trunk/src/gap5/check_assembly.c A /staden/trunk/src/gap5/check_assembly.h A /staden/trunk/src/gap5/check_assembly.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h M /staden/trunk/src/gap5/tclIndex Added Check Assembly to Gap5. It doesn't have the option of Gap4 to align cutoff data to the consensus, but that is best served in a different route now. Instead this implementation is simply comparing used/visible data against the consensus over a window length to find highly discrepant regions of sequences. Cutoff plan: I observe lots of places where a whole raft of data has been clipped back to make it align. For individual sequences this probably isn't an issue - maybe it's chimeric or poor quality - but if multiple sequences have been clipped at the same position and the clipped data matches then it is indicative of a problem such as a collapsed repeat. ------------------------------------------------------------------------ r2762 | jkbonfield | 2011-10-10 17:16:08 +0100 (Mon, 10 Oct 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Extended the read selector/deselector to ask whether we want to select reads entirely within the range or overlapping the range. ------------------------------------------------------------------------ r2761 | jkbonfield | 2011-10-10 14:32:05 +0100 (Mon, 10 Oct 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h M /staden/trunk/src/gap5/readpair.c M /staden/trunk/src/gap5/readpair.h M /staden/trunk/src/gap5/readpair.tcl Find Read Pairs now has an option to filter the results to only display contig pairings spanned by more than a certain number of read-pairs. ------------------------------------------------------------------------ r2760 | jkbonfield | 2011-10-10 14:30:29 +0100 (Mon, 10 Oct 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/list_proc.tcl The contig editor now has functions to select and deselect all sequences at a particular consensus column (or range). ------------------------------------------------------------------------ r2759 | jkbonfield | 2011-10-10 14:29:23 +0100 (Mon, 10 Oct 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS ------------------------------------------------------------------------ r2758 | jkbonfield | 2011-10-07 14:34:25 +0100 (Fri, 07 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/editor_search.c M /staden/trunk/src/gap5/editor_search.tcl M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/gap5rc Added "depth <" and "depth >" searches in the contig editor. ------------------------------------------------------------------------ r2757 | jkbonfield | 2011-10-07 12:23:44 +0100 (Fri, 07 Oct 2011) | 12 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c When displaying the editor we now call update_library_stats regularly on reads with libraries in order to check consistency. This in turn does cache_rw and attempts to cache_dup from base io to child io, causing a "FIXME: implement library_dup" warning message as this hadn't been implemented yet. However it also causes another side effect - the editor thinks we've modified something and asks if we want to save; annoying too. For now I just changed the cache_rw on libraries to always work on the base io even if we're trying to cache_rw on the child io, solving both issues at once. It's not ideal from a code purist view, but it works. ------------------------------------------------------------------------ r2756 | jkbonfield | 2011-10-07 12:06:15 +0100 (Fri, 07 Oct 2011) | 14 lines Changed paths: M /staden/trunk/src/gap5/g-files.c M /staden/trunk/src/gap5/g-files.h M /staden/trunk/src/gap5/g-request.c Scary updates to the low level DB code. The previous rewrite of g_write_aux_index() had the side effect of only ever using one pair of the twinned image/time/use arrays in the index. Consequentially crashing or killing the program mid-write could leave an inconsistent database. We now store the old index values and put those into ind[1] with ind[0] being the new ones and delay the dheap_free calls until after the update_header() call. This means the single transaction and rollback code now works again and we can recover from partial commits. ------------------------------------------------------------------------ r2755 | jkbonfield | 2011-10-06 16:46:24 +0100 (Thu, 06 Oct 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Fixed memory corruption in consensus caching. If a bin dramatically shrinks, the old cached consensus could be larger than the bstart..bend range which then caused an overflow. ------------------------------------------------------------------------ r2754 | jkbonfield | 2011-10-06 16:14:14 +0100 (Thu, 06 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl Control-A keybinding now selects all in the List Contigs window. ------------------------------------------------------------------------ r2753 | jkbonfield | 2011-10-06 15:30:30 +0100 (Thu, 06 Oct 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/list_contigs.tcl Fixed tcl selection handlers when pasting long strings. The most significant of this is the Contig List window. ------------------------------------------------------------------------ r2752 | jkbonfield | 2011-10-06 14:58:25 +0100 (Thu, 06 Oct 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/tg_tcl.c Added a method to determine the effective orientation of a template from a sequence. Use this within the contig editor Join To command, so we can reverse complement the other contig if appropriate. ------------------------------------------------------------------------ r2751 | jkbonfield | 2011-10-06 10:10:24 +0100 (Thu, 06 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/bam.c M /staden/trunk/src/gap5/bam.h M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/sam_pileup.c Bug fixes to cope with sequence of "*" in SAM/BAM files. ------------------------------------------------------------------------ r2750 | jkbonfield | 2011-10-05 14:44:59 +0100 (Wed, 05 Oct 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/tag_editor.tcl - Increased the default size of the tag editor. - Changed the line wrapping to "none", meaning the horizontal scroll bar becomes useful. ------------------------------------------------------------------------ r2749 | jkbonfield | 2011-10-05 14:44:23 +0100 (Wed, 05 Oct 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/bam.c M /staden/trunk/src/gap5/bam.h M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/sam_pileup.c Improved error handling of SAM/BAM I/O. It can now distinguish between eof and an early termination due to an error. It also reports the line number in SAM (or equivalent SAM if reading BAM). ------------------------------------------------------------------------ r2748 | jkbonfield | 2011-10-05 11:57:19 +0100 (Wed, 05 Oct 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl The join editor now has the top editor being the first contig listed (in both the initial join editor dialogue and in the "contig1 / contig2" window header) and the bottom is the second contig. They were reversed before. ------------------------------------------------------------------------ r2747 | jkbonfield | 2011-10-03 16:57:40 +0100 (Mon, 03 Oct 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/editor_search.c M /staden/trunk/src/gap5/editor_search.tcl Added the Gap4 "search from file" functionality to Gap5's contig editor. ------------------------------------------------------------------------ r2746 | jkbonfield | 2011-10-03 14:34:16 +0100 (Mon, 03 Oct 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/editor_oligo.c M /staden/trunk/src/gap5/primlib.c Bug fix to the editor Find Primer-walk function. It was adding tags to the wrong place for reverse strand oligos. Also removed some debugging output. ------------------------------------------------------------------------ r2745 | jkbonfield | 2011-10-03 14:33:21 +0100 (Mon, 03 Oct 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS ------------------------------------------------------------------------ r2744 | jkbonfield | 2011-10-03 12:29:27 +0100 (Mon, 03 Oct 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Added back compute_ypos_tags() call (accidentally removed in the Group Readings revamp). This showed up as an inability to edit tags by pressing F11 in the contig editor. ------------------------------------------------------------------------ r2743 | jkbonfield | 2011-10-03 11:38:30 +0100 (Mon, 03 Oct 2011) | 15 lines Changed paths: M /staden/trunk/src/tk_utils/entrybox.tcl Removed the tkwait call in entrybox_get, to remove the wait-forever idea. I cannot remember why we use this now, so who knows what affects this will have. However removing it cures one very strange bug: 1) In Gap5 bring up a contig editor via Edit Contig menu item 2) Go to the Edit Contig menu item again and deliberately type in an invalid name, then attempt to hit OK to invoke the editor (does nothing). 3) In the first editor, which should still be visible, position the editor cursor on a location not covered by a base. At this point you'll get a Tk error message. ------------------------------------------------------------------------ r2742 | jkbonfield | 2011-09-30 12:34:47 +0100 (Fri, 30 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_index_common.c create_new_contig() now checks for duplicate contig names and automatically renames them to prevent this happening. ------------------------------------------------------------------------ r2741 | jkbonfield | 2011-09-30 12:16:20 +0100 (Fri, 30 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap4_compat.c Duplicate contig names are now removed in lget_contig_num, meaning FIJ etc won't find self matches when given duplicates. ------------------------------------------------------------------------ r2740 | awhitwham | 2011-09-30 12:12:03 +0100 (Fri, 30 Sep 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/editor_view.h M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tkEditor.c M /staden/trunk/src/gap5/tkEditor.h Initial Group Readings check in. Gives the option in the editor to order readings in various ways. Default setting matches current ordering. Some more work needs to be done. ------------------------------------------------------------------------ r2739 | jkbonfield | 2011-09-30 11:54:54 +0100 (Fri, 30 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.tcl Fixed Remove Contig Holes to request read/write lock access before proceeding and to shut down and restart the contig selector window. ------------------------------------------------------------------------ r2738 | jkbonfield | 2011-09-30 11:08:42 +0100 (Fri, 30 Sep 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c Removal of B+Tree debugging output. ------------------------------------------------------------------------ r2737 | jkbonfield | 2011-09-29 16:11:08 +0100 (Thu, 29 Sep 2011) | 12 lines Changed paths: M /staden/trunk/src/gap5/b+tree2.c M /staden/trunk/src/gap5/b+tree2.h M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/g-alloc.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_iface.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_sequence.c Fixed various disassembly issues. - We now remove the correct reading name entry from the B+Tree when there are multiples with the same name. (We check name,rec pairing) - Fixed an error in the b+tree code when completely removing nodes. It was causing errors when flushing later on. - Better error handling for when faced with a record number that no longer exists (due to the bug above). - Also tidied up some g-alloc debugging info with an extraneous "d". ------------------------------------------------------------------------ r2736 | jkbonfield | 2011-09-29 09:57:39 +0100 (Thu, 29 Sep 2011) | 11 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h M /staden/trunk/src/gap5/tg_sequence.c Fix to severe bug in shuffle pads. In rare cases it could introduce a column of pads itself, and then remove it again in the final step. If during this stage it didn't make any other edits then it did not save the data and so the column being removed was incorrect - effectively deleting a real column of bases. This has now been fixed, but also added a contig_delete_pad function which acts as contig_delete_base but with additional checks to ensure it doesn't accidentally delete something else. ------------------------------------------------------------------------ r2735 | jkbonfield | 2011-09-28 12:45:12 +0100 (Wed, 28 Sep 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Bug fix to recent change for positioning the cursor at 1st used base. This broke editing with #contig_num (but =contig_num was working). ------------------------------------------------------------------------ r2734 | jkbonfield | 2011-09-28 12:41:34 +0100 (Wed, 28 Sep 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/check_database.tcl M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_check.h M /staden/trunk/src/gap5/tg_tcl.c Check Database on a single contig now honours the "fix" option - it was ignored before. We now also report the number of errors we attempted to fix, given that we don't yet attempt to fix everything. ------------------------------------------------------------------------ r2733 | jkbonfield | 2011-09-28 12:03:02 +0100 (Wed, 28 Sep 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl When invoking the editor by a reading name instead of a contig name, the cursor position is now set to be the first visible base rather than the first possibly-clipped base. ------------------------------------------------------------------------ r2732 | jkbonfield | 2011-09-28 11:52:44 +0100 (Wed, 28 Sep 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/contig_selector.tcl M /staden/trunk/src/gap5/gap_utils.tcl Fixed the start/end ranges for the Contig ID widget within dialogues. This was already working when being updated by the contig selector or contig list windows, but ContigParams called from (say) editing a contig or the default initial values when opening a database incorrectly set the range from 1 to $length instead of clipped_start to clipped_end. ------------------------------------------------------------------------ r2731 | jkbonfield | 2011-09-28 11:51:00 +0100 (Wed, 28 Sep 2011) | 14 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/export_contigs.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h Improvements in Export Contigs: - It now has entries in gap5rc for changing the default dialogue options. - When outputting subsets of a contig in SAM, CAF or BAF, we now ensure we output tags that are outside the requested range but attached to readings that overlap the requested range. To implement this I added an iterator_expand_range() function. - Fixed a bug introduced in the last update to this file for padded alignment output, involving pads next to soft-clips. ------------------------------------------------------------------------ r2730 | jkbonfield | 2011-09-28 11:46:46 +0100 (Wed, 28 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/newgap5_cmds.c Fixed bug when outputting fasta or fastq sequences that are a multiple of 60 bp. We no longer have an additional newline in the output. ------------------------------------------------------------------------ r2729 | jkbonfield | 2011-09-27 11:53:59 +0100 (Tue, 27 Sep 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Fixed unpaddec consensus coords to always start from base-pair 1. ------------------------------------------------------------------------ r2728 | jkbonfield | 2011-09-26 11:37:30 +0100 (Mon, 26 Sep 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Fixed a recent change to break_check_counts(). It now finds the left-most read that starts >= cpos and not the right-most overlapping it. This bug was introduced in r2715. ------------------------------------------------------------------------ r2727 | jkbonfield | 2011-09-23 17:57:02 +0100 (Fri, 23 Sep 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/export_contigs.tcl M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/sam_pileup.c M /staden/trunk/src/gap5/sam_pileup.h Added an unpadded mode to the SAM output code. ------------------------------------------------------------------------ r2726 | jkbonfield | 2011-09-23 16:24:36 +0100 (Fri, 23 Sep 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/tclIndex Added export of CreateAllContigListNumbers ------------------------------------------------------------------------ r2725 | jkbonfield | 2011-09-21 17:34:43 +0100 (Wed, 21 Sep 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/consensus.h M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/shuffle_pads.h M /staden/trunk/src/gap5/shuffle_pads.tcl M /staden/trunk/src/gap5/tclIndex Added a "Remove Pad Columns" function to gap5. Also fixed a potential cache ref count bug in the consensus calculation. ------------------------------------------------------------------------ r2724 | jkbonfield | 2011-09-20 17:45:23 +0100 (Tue, 20 Sep 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Fixed sizing of jog control in contig and join editor, to take into account height of pos entry and pos_type buttons. This was the cause of Alan's vanishing consensus, caused by the name and sequence sheet widgets being slightly different sizes due to an overlarge button and a too-small scalebar (jog). ------------------------------------------------------------------------ r2723 | jkbonfield | 2011-09-20 15:23:42 +0100 (Tue, 20 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/editor_search.tcl Added Page Up/Down bindings to the editor Search dialogue for next and previous search. ------------------------------------------------------------------------ r2722 | jkbonfield | 2011-09-20 15:15:45 +0100 (Tue, 20 Sep 2011) | 11 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/editor_view.h M /staden/trunk/src/gap5/tkEditor.c M /staden/trunk/src/gap5/tman_interface.c M /staden/trunk/src/gap5/trace_display.tcl Fixed the trace display: 1) It now scrolls in the correct orientation when dragging a complemented trace. 2) It keeps in sync with edits & pads. It does a sequence alignment against the (cached) trace to work out this mapping, although the alignment itself isn't cached yet. 3) The Lock button no longer produces errors. ------------------------------------------------------------------------ r2721 | jkbonfield | 2011-09-20 11:58:12 +0100 (Tue, 20 Sep 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_register.c Remove small memory leak from broadcast_event(). ------------------------------------------------------------------------ r2720 | jkbonfield | 2011-09-16 17:35:48 +0100 (Fri, 16 Sep 2011) | 8 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_contig.c Added debugging code to tg_cache to blat any unreferenced cached objects on each and every call to cache_search(). This is a brutal way of finding places where we make assumptions rather than properly calling cache_incr and cache_decr. This is enabled by adding -DCACHE_REF_PURGE to your CFLAGS in the configured system.mk. Also fixed a few issues discovered via this technique. ------------------------------------------------------------------------ r2719 | jkbonfield | 2011-09-16 17:33:13 +0100 (Fri, 16 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap_range.c Fixed a bug in the template display where complemented contigs were often shown as being inconsistent templates. ------------------------------------------------------------------------ r2718 | jkbonfield | 2011-09-16 17:32:38 +0100 (Fri, 16 Sep 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/Makefile M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5rc_menu_full A /staden/trunk/src/gap5/gap_canvas_box.c A /staden/trunk/src/gap5/gap_canvas_box.h M /staden/trunk/src/gap5/gap_canvas_box.tcl A /staden/trunk/src/gap5/gap_restriction_enzymes.tcl M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h A /staden/trunk/src/gap5/restriction_enzymes.c A /staden/trunk/src/gap5/restriction_enzymes.h M /staden/trunk/src/gap5/tclIndex Added the Gap4 restriction enzymes plot to Gap5. It's pretty warty and confusing code and would be better off done these days using pure Tcl for the window and just having a C function purely for finding restriction enzymes on the consensus. However this was a couple hours work to port so it'll do for now. ------------------------------------------------------------------------ r2717 | jkbonfield | 2011-09-16 14:16:20 +0100 (Fri, 16 Sep 2011) | 9 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Fudged the iterators to add slack either side of the contig. This works around catch-22 problems with trying to use the iterators to work out the next contig extents. We need to replace this hack with a dedicated function for just this purpose though. (One that doesn't use the iterators.) Also fixed contig_insert_base2() to call contig_visible_start/end so it can double check and correct the contig extents. ------------------------------------------------------------------------ r2716 | jkbonfield | 2011-09-16 11:13:23 +0100 (Fri, 16 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_bin.h M /staden/trunk/src/gap5/tg_check.c Added a bin_remove_refpos() function. Also fixed Check Database when facing REFPOS markers so stop producing false warnings. ------------------------------------------------------------------------ r2715 | jkbonfield | 2011-09-16 11:10:06 +0100 (Fri, 16 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Bug fix to contig_visible_start/contig_visible_end. These now also trim REFPOS items. ------------------------------------------------------------------------ r2714 | jkbonfield | 2011-09-16 11:09:15 +0100 (Fri, 16 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Added extra cache_incr/decr guards around tk_redisplaySeqSequences code (due to sequence_get_template_info loading a lot of data). ------------------------------------------------------------------------ r2713 | jkbonfield | 2011-09-15 16:52:50 +0100 (Thu, 15 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/staden.profile Replaced == with = in 'test' expression. This accidental ksh/bashism breaks when using a real bourne shell. ------------------------------------------------------------------------ r2712 | jkbonfield | 2011-09-15 11:47:46 +0100 (Thu, 15 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_tcl.c Improved robustness when a sequence points to a pair (via r->pair_rec) which no longer exists. We just whinge instead of crashing now. ------------------------------------------------------------------------ r2711 | jkbonfield | 2011-09-14 17:16:41 +0100 (Wed, 14 Sep 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS ------------------------------------------------------------------------ r2710 | jkbonfield | 2011-09-14 16:53:57 +0100 (Wed, 14 Sep 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5_thrash.tcl Added support for testing disassemble readings. ------------------------------------------------------------------------ r2709 | jkbonfield | 2011-09-14 16:53:38 +0100 (Wed, 14 Sep 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/tg_bin.c Reverse previous fix as it broke Break Contig (it calls bin_remove_item_from_bin during a phase where the data hasn't yet been tidied up so it's incorrect to try and fix contig length then). Instead added the consensus_unclipped_range code into disassemble readings directly. Messy, but sufficient for now. ------------------------------------------------------------------------ r2708 | jkbonfield | 2011-09-14 16:18:52 +0100 (Wed, 14 Sep 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/tg_bin.c Fixed error bin_remove_item_from_bin called from diasassemble readings. It wasn't always recomputing the contig extents when it should. For now I disabled some of the optimisations and recompute this more often than is strictly necessary. ------------------------------------------------------------------------ r2707 | jkbonfield | 2011-09-14 09:58:15 +0100 (Wed, 14 Sep 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Fixed bug in Disassemble Readings when the set of reads being removed from a contig have the left-most unclipped read not being the left-most clipped read. ------------------------------------------------------------------------ r2706 | jkbonfield | 2011-09-13 17:28:10 +0100 (Tue, 13 Sep 2011) | 12 lines Changed paths: M /staden/trunk/src/gap5/editor_search.c M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h Improved sequence name searching as per RT#231099 When looking for a sequence name/number we now jump to the first visible (unclipped) base of the sequence instead of the first clipped base. To implement this I've created a new sequence_get_clipped_position function to replace the sequence_get_position version. I also changed the editor X position so that new searches that have to reposition the scrollbar to make the match visible does so with the match 10 bases in from the left edge instead of the right edge as before. ------------------------------------------------------------------------ r2705 | jkbonfield | 2011-09-13 15:24:49 +0100 (Tue, 13 Sep 2011) | 16 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/tg_contig.c Fixed bug when deleting the last base of a sequence (so the sequence is removed) which is the last base in the contig and there was a hole between this sequence and the previous, meaning that the contig now shrinks substantially more than just one base, *and* that we had annotations between the old last sequence and the new last sequence. Eg: Cons: CG....Tag....Tag.....* Seq1 CG Seq2 * Also removed some debugging output from this code and disassemble readings. ------------------------------------------------------------------------ r2704 | jkbonfield | 2011-09-13 15:05:48 +0100 (Tue, 13 Sep 2011) | 11 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Further fixes to contig_delete_base2(). 1) We now correctly deal with annotations on a sequence that we've entirely removed due to deleting the last base in it. 2) Fixed < vs <= conditions when deciding whether to move or shrink tags. 3) Added code to entirely remove tags when the only base they cover is deleted. ------------------------------------------------------------------------ r2703 | jkbonfield | 2011-09-13 15:03:54 +0100 (Tue, 13 Sep 2011) | 9 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/break_contig.h M /staden/trunk/src/gap5/dis_readings.c Fixed a couple more bugs in disassemble readings. 1) Moving a sequence that has been clipped to zero bases (clipped to 1 base, a pad, and then delete that column) no longer produces zero length contigs and errors. 2) Fixed some more cases of failure to trim tags in consensus cutoff regions after moving data at the end of contigs. ------------------------------------------------------------------------ r2702 | jkbonfield | 2011-09-13 10:00:10 +0100 (Tue, 13 Sep 2011) | 10 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Further consensus tag handling bug fixes - we now track the clipped seq coords when tracking which consensus tags to move/clip to. Fixed an orientation bug when moving data from one contig to another. Previously we could change the orientation of sequences sometimes, meaning moving data from a previously joined contig (a merge of complemented and uncomplemented contigs) could yield out of alignment data in the newly created contig due to swapping the sequence orientations back. ------------------------------------------------------------------------ r2701 | jkbonfield | 2011-09-13 09:57:43 +0100 (Tue, 13 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Fixed a reference counting crash in grow_bin() caused when we're attempting to grow the root bin of the contig. ------------------------------------------------------------------------ r2700 | jkbonfield | 2011-09-12 16:11:31 +0100 (Mon, 12 Sep 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/dis_readings.c Major overhaul of consensus annotation support in Disassemble Readings. We now copy consensus tags to new contigs when the used portion overlaps, and improved trimming of old tags at contig ends or internal holes. ------------------------------------------------------------------------ r2699 | jkbonfield | 2011-09-12 16:10:29 +0100 (Mon, 12 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Fixed reference count corruption. We failed to cache_incr earlier enough in contig_visible_start and contig_visible_end functions. ------------------------------------------------------------------------ r2698 | jkbonfield | 2011-09-09 15:25:50 +0100 (Fri, 09 Sep 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_check.h Altered the consensus tag clipped code to clip/remove tags based on the cutoff data. Ie consensus tags should only be kept when they're on visible consensus sequence and not within clipped regions. Also added checks in Check Database for this and the "tags in sequence bins" change. ------------------------------------------------------------------------ r2697 | jkbonfield | 2011-09-09 15:24:13 +0100 (Fri, 09 Sep 2011) | 24 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Major rewrite of contig_insert_base and contig_delete_base. These now take into account the sequence cutoff data and don't insert or delete within those portions. The implementation is considerably trickier to get right however. Eg on insertion: 1) It is no longer the case that all tags to the right get shifted to the right. If they're right-hand cutoff data they will not. 2) It is no longer the case that all tags to the left will not get shifted right. If they're in left-hand cutoff data and the read starts to the right, then the read will be moved right causing the left tags to move too. 3) Inserting a column of pads may not actually grow the contig (likewise deleting may not shrink it). If the contig extents were defined by cutoff data of a sequence and we're inserting a column that doesn't insert into the sequence that is furhest right (so we're inserting at a pos covering the right-hand cutoff data of it) then the contig will not grow. These and other problems lead to the requirement that tags should no longer be created within the cutoff regions of the consensus. ------------------------------------------------------------------------ r2696 | jkbonfield | 2011-09-09 15:16:45 +0100 (Fri, 09 Sep 2011) | 23 lines Changed paths: M /staden/trunk/src/gap5/ace.c M /staden/trunk/src/gap5/afg.c M /staden/trunk/src/gap5/baf.c M /staden/trunk/src/gap5/caf.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/fasta.c M /staden/trunk/src/gap5/import_gff.c M /staden/trunk/src/gap5/maq.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_bin.h M /staden/trunk/src/gap5/tg_index_common.c M /staden/trunk/src/gap5/tg_index_common.h M /staden/trunk/src/gap5/tg_sequence.c M /staden/trunk/src/gap5/tg_sequence.h M /staden/trunk/src/gap5/tg_tcl.c Policy change - tags should belong in the same bin as the sequences they are attached to (unless they're attached to the contig consensus). This greatly simplifies many algorithms (although by and large they haven't been simplified yet) and also fixes some obscure bugs. Specifically it makes inserting and deleting columns of pads work easier. This has been implemented by adding a bin_add_to_range() function which adds a range to a specific bin rather than finding its own appropriate bin. Reimplemented bin_add_range() as a special case variant of the new bin_add_to_range() function. Also fixed a bug in the tcl interface $contig add_sequence and $contig move_sequence interfaces. They were incorrectly setting the complemented status of a sequence when it gets moved from a bin of one orientation into a bin of the opposite orientation, causing conflicts between on disc and in memory representations. Bug fix to bin_plus_children_empty(). It now considers bins that have no sequence/tags beneath them but *do* contained cached consensus sequences as empty still. This was preventing disassemble readings from deleting contigs in some cases. ------------------------------------------------------------------------ r2695 | jkbonfield | 2011-09-09 10:11:54 +0100 (Fri, 09 Sep 2011) | 8 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Protect against a crash while joining. I'm not sure of the circumstances to trigger it, but while handling the contig registration events for a join, the editor can sometimes end up trying to run show_cursor on a position where no range data has been returned. We now gloss over this and refuse to show the cursor (as we're about to shut down anyway). ------------------------------------------------------------------------ r2694 | jkbonfield | 2011-09-07 10:16:30 +0100 (Wed, 07 Sep 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/gap5rc Made the editor dimensions and the position of the names/seq pane configurable in .gap5rc. These values are now also saved when using Save Settings menu item. ------------------------------------------------------------------------ r2693 | jkbonfield | 2011-09-05 12:46:51 +0100 (Mon, 05 Sep 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/break_contig.tcl Catch errors in break_contig Tcl-interface and report appropriately. This avoids leaving a SetBusy on the database, which previously wasn't being cleared and so blocked out the GUI from the error onwards. ------------------------------------------------------------------------ r2692 | jkbonfield | 2011-09-05 12:30:38 +0100 (Mon, 05 Sep 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/newgap5_cmds.c Fixed the handling of the -index_names option of import_reads command. It was negated in operation. ------------------------------------------------------------------------ r2691 | jkbonfield | 2011-08-18 17:41:06 +0100 (Thu, 18 Aug 2011) | 42 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_tcl.c Fixed issues with reference counting and making records r/o again. An earlier commit to fix the issues of contig editors operating on live data after an initial cache_flush introduced a bug such that objects shared by multiple editors would erroneously be set back to read-only copies despite another editor still having a copy-on-write portion of that data. This sounds unlikely to happen, but occurs due to seq_blocks being split between two contigs. The same seq_block can have reads in two editors, both of which are being actively edited as they form the halves of a join editor. When we made the join it flushed the changes to the seq_block from the first editor, making it read-only, and then died while flushing the changes to the seq_block from the second editor. We now keep better track of reference counting when dealing with multiple child IOs and also changed the cache_rw code to call cache_dup any time a cached_item is in a parent io rather than simply relying on a check for ro/rw (which was the original bug I should have fixed). In tg_tcl there are also some reference count leaks still. I fixed the main ones related to sequence editing though with this patch. Consider the following scenario. "set s [$io get_sequence 100]" where $io is a child io. This does a cache_incr(child_io, seq). "$s replace_base ..." on this object will then call cache_rw() and replace_base(). The ts->seq pointer gets replaced with a new one as cache_rw has done a copy-on-write from master to child-io. However the initial cache_incr from [$io get_sequence] is no longer valid as it's in another io entirely. I'm not sure what the best general purpose fix is other than to track which ref count came from where (messy). Instead I simply cache_decr / cache_rw / cache_incr to move the $s ref count from master to child i/o. This fix needs applying to anno and contig objects too, but it's not so easy as it's unclear whether we'll accidentally lose an object in the middle. ------------------------------------------------------------------------ r2690 | jkbonfield | 2011-08-18 17:29:09 +0100 (Thu, 18 Aug 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/hash_lib.c Fixed memory overrun on small contigs. ------------------------------------------------------------------------ r2689 | jkbonfield | 2011-08-17 14:30:12 +0100 (Wed, 17 Aug 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl Fixed Complement Contig via the list contigs window. ------------------------------------------------------------------------ r2688 | jkbonfield | 2011-08-10 16:39:27 +0100 (Wed, 10 Aug 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_gio.c Fixed the setting of io->name when opening via full pathname (eg using the File->Open dialogue). This was also causing errors in Check Database. ------------------------------------------------------------------------ r2687 | jkbonfield | 2011-08-10 12:40:23 +0100 (Wed, 10 Aug 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Smaller cache size when compiled with WAS_CACHE_REF_DEBUG, to further stress-test the reference counting. ------------------------------------------------------------------------ r2686 | jkbonfield | 2011-08-10 12:39:52 +0100 (Wed, 10 Aug 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5.tcl Minor version bump to 1.2.14 - long overdue! ------------------------------------------------------------------------ r2685 | jkbonfield | 2011-08-10 12:39:40 +0100 (Wed, 10 Aug 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/ace.c M /staden/trunk/src/gap5/baf.c M /staden/trunk/src/gap5/caf.c M /staden/trunk/src/gap5/export_contigs.c M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/sam_index.c M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_struct.h Added proper template name support, albeit requiring it to be a prefix of the read-name. This then parses/generates the appropriate Template fields in caf, baf, ace and the FS aux tag in SAM. ------------------------------------------------------------------------ r2684 | jkbonfield | 2011-08-10 11:54:26 +0100 (Wed, 10 Aug 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/tman_display.c Fixed crash when failing to bring up 1000 traces at one point. Also no longer attempt to bring up illumina or solid traces when double clicking on the consensus. You can still bring up individual ones by clicking on them though. ------------------------------------------------------------------------ r2683 | jkbonfield | 2011-08-08 12:15:23 +0100 (Mon, 08 Aug 2011) | 14 lines Changed paths: M /staden/trunk/src/gap5/consensus.c I now have a better undertstanding of the causes of bin consensus sequences being invalid, so removed the warning. The cached consensus will be correct, just not always spanninig the entire bin. This can happen when bin_add_range adds the cached cons to a larger bin than the one we were computing it for. We could of course force it to only ever add to the bin we expected, and I tried this. For some reason it caused yet more errors though, so for now I'm glossing over this by simply gracefully handling the case. It's not as fficient as it could be therefore as it sometimes has to recompute the consensus again as the bin has grown, but it's sufficient and I believe reliable. ------------------------------------------------------------------------ r2682 | jkbonfield | 2011-08-08 11:13:23 +0100 (Mon, 08 Aug 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_sequence.c More checks for cached items being purged, primarily fixed by adding cache_incr/decr calls. ------------------------------------------------------------------------ r2681 | jkbonfield | 2011-08-08 11:11:48 +0100 (Mon, 08 Aug 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Improved reference counting. Fixed a bug where failure to call invalidate_consensus could yield a crash in this code. We now still check whether the cached consequence sequence spans the correct region when it claims to be up to date, and recompute if not. ------------------------------------------------------------------------ r2680 | jkbonfield | 2011-08-05 12:12:23 +0100 (Fri, 05 Aug 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Fixed a bug in caching consensus for read-only mode. It was sometimes complementing the contig when it didn't need to. ------------------------------------------------------------------------ r2679 | jkbonfield | 2011-08-04 15:29:21 +0100 (Thu, 04 Aug 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/check_database.tcl Added "$io flush" so changes are written immediately after fixing a database. ------------------------------------------------------------------------ r2678 | jkbonfield | 2011-08-02 17:10:37 +0100 (Tue, 02 Aug 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/find_oligo.c M /staden/trunk/src/gap5/list_proc.c M /staden/trunk/src/gap5/list_proc.h Sequence Search now creates a list named "seq_hits" for each sequence found by the sequence search. (Only when matching vs sequences.) ------------------------------------------------------------------------ r2677 | jkbonfield | 2011-08-02 16:29:34 +0100 (Tue, 02 Aug 2011) | 9 lines Changed paths: M /staden/trunk/src/gap5/cs-object.h M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/find_oligo.c Fixed Sequence Search (main menu, not the method inside editor). It was falsely reporting locatations when searching on complemented reads instead of the usual mode of looking in consensus. Also updated it to start the editor on the specific sequence we found rather than the consensus, and fixed a bug in the edit_contig() startup function in the process. ------------------------------------------------------------------------ r2676 | jkbonfield | 2011-08-01 17:11:18 +0100 (Mon, 01 Aug 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS ------------------------------------------------------------------------ r2675 | jkbonfield | 2011-08-01 17:08:44 +0100 (Mon, 01 Aug 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Fixed out by one error in code to determine whether to move data to right or left contig. ------------------------------------------------------------------------ r2674 | jkbonfield | 2011-08-01 12:26:22 +0100 (Mon, 01 Aug 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5_thrash.tcl Added test to compute the consensus, testing cached consensus code. ------------------------------------------------------------------------ r2673 | jkbonfield | 2011-08-01 12:25:56 +0100 (Mon, 01 Aug 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Improved diagnostics in cache ref checking code. We no longer give false errors in some cases. ------------------------------------------------------------------------ r2672 | jkbonfield | 2011-08-01 10:04:55 +0100 (Mon, 01 Aug 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Fixed bug in complementing of existing cached consensus. We weren't setting/clearing the SEQ_COMPLEMENTED flag correctly, meaning on-disk and in-memory structs became out of sync. ------------------------------------------------------------------------ r2671 | jkbonfield | 2011-07-29 15:02:14 +0100 (Fri, 29 Jul 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/gap5_thrash.tcl Enabled debugging output. Prevent clipping of data to 0 base visible sequences (as this is disallowed in the editor too). ------------------------------------------------------------------------ r2670 | jkbonfield | 2011-07-29 15:00:14 +0100 (Fri, 29 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/dis_readings.c Protect against cycles in break_contig/remove_contig_holes. This can happen when a contig starts with a zero length sequence, which is interpreted as a hole if it doesn't overlap anything else. ------------------------------------------------------------------------ r2669 | jkbonfield | 2011-07-29 12:18:29 +0100 (Fri, 29 Jul 2011) | 19 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Fixed an error caused in the contig editor whereby edits to data previously edited and then saved could either not be saved correctly or instead accidentally saved when you exit without saving. More specifically, when using a child I/O editing uses copy-on-write to take a local writable version of the master I/O record. Saving flushed this data out and pushed the child I/O record back to the master I/O, but it didn't reset the lock from r/w to read-only. Consequentially the next edit to that record did not perform a copy-on-write again as the child I/O believed it had a writeable version already. Corrected this by adding a cache_upgrade(io, ci, G_LOCK_RO) call. There still a (new?) bug in that the data is not correctly referenced counted and so edited data wastes cache, however this is simply a small memory leak rather than a substantial problem with the possibility to break data. I'll submit a new patch with corrected reference counting when I figure out where that problem comes from. ------------------------------------------------------------------------ r2668 | jkbonfield | 2011-07-29 11:18:04 +0100 (Fri, 29 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Moved the cache_decr lines later down, to after running remove_contig_holes. This was occasionally causing crashes. ------------------------------------------------------------------------ r2667 | jkbonfield | 2011-07-29 09:50:10 +0100 (Fri, 29 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c Moved free(io) in io_database_disconnect. Likely a harmless change (on our systems at least), but safer and preventing a valgrind error. ------------------------------------------------------------------------ r2666 | jkbonfield | 2011-07-28 17:28:05 +0100 (Thu, 28 Jul 2011) | 6 lines Changed paths: M /staden/trunk/src/NEWS M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/consensus.c M /staden/trunk/src/gap5/contig_selector.c M /staden/trunk/src/gap5/depad_seq_tree.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/g-struct.c M /staden/trunk/src/gap5/gap5.tcl M /staden/trunk/src/gap5/gap_hash.c M /staden/trunk/src/gap5/gap_range.c M /staden/trunk/src/gap5/hash_lib.c M /staden/trunk/src/gap5/import_gff.c M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/ng_fb_cmds.tcl M /staden/trunk/src/gap5/template_display.c M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_gio.c M /staden/trunk/src/gap5/tg_gio.h M /staden/trunk/src/gap5/tg_iface.h M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_register.c M /staden/trunk/src/gap5/tg_tcl.c M /staden/trunk/src/gap5/tg_view.c Moved a lot of debugging output to only appear when running "gap5 -debug 1". This uses a new gio_debug() function to print up the messages instead of printf, which checks the debug level before printing. Call gio_debug_level() to set it or "$io debug_level N" in Tcl. ------------------------------------------------------------------------ r2665 | jkbonfield | 2011-07-28 17:26:36 +0100 (Thu, 28 Jul 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/gap5_thrash.tcl Added sequence clipping tests too. ------------------------------------------------------------------------ r2664 | jkbonfield | 2011-07-28 15:26:32 +0100 (Thu, 28 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_gio.h Fixed false errors from the reference count debugging mode. These occurred when we ran cache_item_resize() and changed an item pointer, breaking the hache entry. ------------------------------------------------------------------------ r2663 | jkbonfield | 2011-07-28 12:27:54 +0100 (Thu, 28 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap5_thrash.tcl M /staden/trunk/src/gap5/tg_tcl.c Fixed bug in removing tags via the tcl interface. It wasn't removing the item from the bin. ------------------------------------------------------------------------ r2662 | jkbonfield | 2011-07-28 12:02:57 +0100 (Thu, 28 Jul 2011) | 9 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/tg_anno.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_bin.h M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_contig.c Revamped how I detect for empty bins in various pieces of code. Added a bin_empty() function to do this now so it's consistent in all locations. This cures a bug in bin_add_range fails to set bin->start_used correctly. This happens when adding data to a bin containing a bin->rng array with bin->rng->max != 0, but containing only ranges flagged as UNUSED. ------------------------------------------------------------------------ r2661 | jkbonfield | 2011-07-28 12:00:12 +0100 (Thu, 28 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Added protection against contig_iter_new returning NULL. This caused crashes when trying to open the contig editor on a contig containing no data. (An error in itself, but it shouldn't crash.) ------------------------------------------------------------------------ r2660 | jkbonfield | 2011-07-28 11:59:26 +0100 (Thu, 28 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/fasta.c M /staden/trunk/src/gap5/newgap5_cmds.c Fixed crashes when importing malformed fasta files. Also added a missing cache_flush() call. ------------------------------------------------------------------------ r2659 | jkbonfield | 2011-07-28 09:56:00 +0100 (Thu, 28 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Made the chksum code optional via an #ifdef. Yet to decide if it's robust enough to leave in place for all situations. ------------------------------------------------------------------------ r2658 | jkbonfield | 2011-07-28 09:54:00 +0100 (Thu, 28 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_contig.c Similar checks to bin->rng being set but empty. I don't believe these caused bugs, but being extra safe and checking "bin->rng && ArrayMax(bin->rng)" now. ------------------------------------------------------------------------ r2657 | jkbonfield | 2011-07-28 09:49:31 +0100 (Thu, 28 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_bin.c Fixed a bug in bin_add_range when updating bin start/end used on a bin with an existing bin->rng array containing zero items (ie it used to have data). ------------------------------------------------------------------------ r2656 | jkbonfield | 2011-07-27 17:42:33 +0100 (Wed, 27 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c Initialise seq_t->sam_aux to NULL when not filled out. Technically it's not an issue as aux_len is zero in such cases, but it feels tidier. ------------------------------------------------------------------------ r2655 | jkbonfield | 2011-07-27 17:13:42 +0100 (Wed, 27 Jul 2011) | 8 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Added code to check that the in-memory cached structures match those on disk. We do this check by reopening the database and comparing against it, which may not work if we changed directory. However it's sufficient for current evaluation purposes. Unfortunately this also causes a lot of spam to stderr at the moment too due to close_db, but we should resolve that elsewhere. ------------------------------------------------------------------------ r2654 | jkbonfield | 2011-07-27 17:12:12 +0100 (Wed, 27 Jul 2011) | 11 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/shuffle_pads.c M /staden/trunk/src/gap5/tg_bin.c M /staden/trunk/src/gap5/tg_sequence.c Fixed wide spread false meme about anno_ele_t struct. The idx field is an index into the anno_ele_block array, but in many places it was used in a manner as if it was the bin_index (ie like seq_t->bin_index vs seq_t->idx). There is no bin_index in the anno_ele_t struct, rightly or wrongly. Rather than simply remove the code I changed it to access a->bin_idx (which doesn't exist yet) and commented it out so I can add the code back to update this if and when I extend the structure to contain the bin index. ------------------------------------------------------------------------ r2653 | jkbonfield | 2011-07-27 17:09:23 +0100 (Wed, 27 Jul 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Added check sum code for bin->rng too. ------------------------------------------------------------------------ r2652 | jkbonfield | 2011-07-27 11:25:57 +0100 (Wed, 27 Jul 2011) | 8 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Fixed an issue with computing the overlapping extents during break contig. We now have pos2 and pos3 both and compute these upfront before breaking. These are the overlap extents for the rightmost edge of the left contig and the leftmost edge of the right contig respectively. The latter wasn't being computed before, but is necessary when determining whether the a bin can be moved left or whether it needs splitting incase it contains a tag. ------------------------------------------------------------------------ r2651 | jkbonfield | 2011-07-26 16:46:44 +0100 (Tue, 26 Jul 2011) | 7 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Added code that's currently #ifdefed out. When ANNO_LOWER_CHECK is defined we check for tags being in the same bin or a child bin of the object they are tagging. This turns out to be an invalid assertion currently unless we fix join contigs to refuse to create overlapping bins. ------------------------------------------------------------------------ r2650 | jkbonfield | 2011-07-26 16:45:26 +0100 (Tue, 26 Jul 2011) | 8 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Added code to cope with overlapping bins. This causes our assumption that tags will only occur in the same bin or a child bin that contains sequences to be false. After joining we have overlapping bins, and new tags added could take a different branch down that tree. Similarly the incremental setting of pos2 is invalid too for the same reason, so we compute it upfront. ------------------------------------------------------------------------ r2649 | jkbonfield | 2011-07-26 11:52:35 +0100 (Tue, 26 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Fixed a bug with tags when breaking a contig containing holes and tags within those holes. They were previously ended up off the ends of contigs, but now we remove them completely. ------------------------------------------------------------------------ r2648 | jkbonfield | 2011-07-26 10:18:37 +0100 (Tue, 26 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/gap5_thrash.tcl M /staden/trunk/src/gap5/newgap5_cmds.c Added -break_holes option to the break_contig function. Use this in the thrash test code. ------------------------------------------------------------------------ r2647 | jkbonfield | 2011-07-26 09:41:45 +0100 (Tue, 26 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/dis_readings.c Sorry last version didn't compile! Adding contig_start/end declarations ------------------------------------------------------------------------ r2646 | jkbonfield | 2011-07-26 08:34:35 +0100 (Tue, 26 Jul 2011) | 10 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/gap5/break_contig.h M /staden/trunk/src/gap5/break_contig.tcl M /staden/trunk/src/gap5/dis_readings.c M /staden/trunk/src/gap5/dis_readings.h M /staden/trunk/src/gap5/dis_readings.tcl M /staden/trunk/src/gap5/gap5rc M /staden/trunk/src/gap5/gap5rc_menu_full M /staden/trunk/src/gap5/tclIndex M /staden/trunk/src/gap5/tg_contig.c M /staden/trunk/src/gap5/tg_contig.h Fixed the hole detection code in Disassemble Readings to check clipped visible-only portion of reads rather than the entire thing. This involved adding new sort modes to the contig iterators. Added an option to Break Contig to break the right hand contig up further if holes were introduced. Also fixed a bug in the Break Contig code that checks whether one of the contig-portions would contain zero sequences. ------------------------------------------------------------------------ r2645 | jkbonfield | 2011-07-25 14:36:04 +0100 (Mon, 25 Jul 2011) | 12 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c M /staden/trunk/src/gap5/tg_iface.h M /staden/trunk/src/gap5/tg_iface_g.c Improvements to the database checking/fixing. - The database is automatically updated to v2 format if it's v1. This is simply a matter of filling out the nanno and nrefpos fields in bins. - Check for and correct various bin boundary issues. It's complex to fix, but when a bin extends beyond the parent we adjust the parent pos/size and bubble up to the root. - Also check that bin parent_type/rec are valid. ------------------------------------------------------------------------ r2644 | jkbonfield | 2011-07-25 14:33:29 +0100 (Mon, 25 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Protect against crashes when faced with negative reference coordinates. (I'm not sure how this happens, but it's more robust now.) ------------------------------------------------------------------------ r2643 | jkbonfield | 2011-07-22 10:21:58 +0100 (Fri, 22 Jul 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/tg_check.c Improved checking of bins with two new checks: - That start_used/end_used fits within the bin extents. - That bin pos/pos+size-1 fits entirely within the parent bin. As yet no auto-fixes have been implemented though. ------------------------------------------------------------------------ r2642 | awhitwham | 2011-07-21 17:07:50 +0100 (Thu, 21 Jul 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/caf.c Fixed parsing error where a space at the begining of the line within a qualities block was being interpreted as the end of the qualities. ------------------------------------------------------------------------ r2641 | jkbonfield | 2011-07-21 16:49:20 +0100 (Thu, 21 Jul 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/tg_iface_g.c Changed some asserts (more to do still) in the low level I/O code to be g_assert instead. This new macro outputs an error and then returns an appropriate error code to the calling function, enabling us to catch low level errors more gracefully than calling abort(). ------------------------------------------------------------------------ r2640 | jkbonfield | 2011-07-21 16:48:15 +0100 (Thu, 21 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/tclIndex ------------------------------------------------------------------------ r2639 | jkbonfield | 2011-07-21 16:37:32 +0100 (Thu, 21 Jul 2011) | 8 lines Changed paths: M /staden/trunk/src/gap4/find_oligo.tcl M /staden/trunk/src/gap4/ng_fb_cmds.tcl M /staden/trunk/src/gap4/select_contig.tcl M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/gap5/find_oligo.tcl M /staden/trunk/src/gap5/gap5.tcl M /staden/trunk/src/gap5/list_proc.tcl M /staden/trunk/src/gap5/ng_fb_cmds.tcl M /staden/trunk/src/gap5/select_contig.tcl M /staden/trunk/src/tk_utils/entrybox.tcl M /staden/trunk/src/tk_utils/filebrowser.tcl M /staden/trunk/src/tk_utils/xentry.tcl M /staden/trunk/src/tk_utils/xfilebrowser.tcl Various tk raise window changes to compensate for issues with Gnome's metacity window manager woes. We now try harder to ensure any tk_messageBox dialogues are childs of the appropriate window. We also make sure the contig editor is raised when receiving a CURSOR_NOTIFY event from another window, eg the template display. ------------------------------------------------------------------------ r2638 | jkbonfield | 2011-07-21 10:00:22 +0100 (Thu, 21 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/Makefile Added LZMA_LIB to tg_index library list. It's no longer automatically brought in via libtgap dependencies on MacOS X. ------------------------------------------------------------------------ r2637 | jkbonfield | 2011-07-20 12:29:00 +0100 (Wed, 20 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS ------------------------------------------------------------------------ r2636 | jkbonfield | 2011-07-20 12:15:27 +0100 (Wed, 20 Jul 2011) | 6 lines Changed paths: A /staden/trunk/src/gap5/gap5_thrash.tcl Debugging program - thrashes a database with random edits to random contigs and continuously runs Check Database to ensure we haven't corrupted things. A very handy way of spotting errors. ------------------------------------------------------------------------ r2635 | jkbonfield | 2011-07-20 12:10:33 +0100 (Wed, 20 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/gap5_check Added execute permission ------------------------------------------------------------------------ r2634 | jkbonfield | 2011-07-20 12:03:30 +0100 (Wed, 20 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/Makefile A /staden/trunk/src/gap5/gap5_check M /staden/trunk/src/gap5/gap5_check.tcl Add gap5_check as a callable program and updated the tcl code to use the same argument parsing as gap5_consensus / gap5_export. ------------------------------------------------------------------------ r2633 | jkbonfield | 2011-07-20 11:42:46 +0100 (Wed, 20 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c More chksum fixes for libraries - this time when CACHE_REF_DEBUG debugging mode is enabled. ------------------------------------------------------------------------ r2632 | jkbonfield | 2011-07-20 11:39:40 +0100 (Wed, 20 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/tg_cache.c Disable cache checksum for library objects as we tend to update the insert size and standard deviation figures on-the-fly, even in read-only mode. So it's expected the struct may differ. ------------------------------------------------------------------------ r2631 | jkbonfield | 2011-07-20 10:38:39 +0100 (Wed, 20 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/staden_config.h.in ------------------------------------------------------------------------ r2630 | jkbonfield | 2011-07-20 10:38:28 +0100 (Wed, 20 Jul 2011) | 8 lines Changed paths: M /staden/trunk/src/gap5/consen.tcl M /staden/trunk/src/gap5/contig_id.tcl M /staden/trunk/src/gap5/tg_tcl.c Added get_visible_{start,end,length} methods to the contig object. They're analogous to the existing start/end/length ones but return the clipped/visible region of a cotnig. The contig_id selector now uses these visible versions when setting the scalebars and the defaults when output contig consensus via the command-line tool also default to these values too. ------------------------------------------------------------------------ r2629 | jkbonfield | 2011-07-20 09:59:32 +0100 (Wed, 20 Jul 2011) | 8 lines Changed paths: M /staden/trunk/src/ac_stubs/tcl.m4 M /staden/trunk/src/gap5/gap_range.h M /staden/trunk/src/primer3/src/Makefile Fixed a linking issue on MacOS X due to use of common symbols: range_option declared in gap_range.h has now been listed as external. Furthermore adjusted the linker arguments when building under linux/gcc to use --warn-common. This directs the linux linker to warn about issues which may cause link errors on other platforms, so hopefully we'll spot these earlier on. ------------------------------------------------------------------------ r2628 | jkbonfield | 2011-07-20 09:55:15 +0100 (Wed, 20 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/actf.c M /staden/trunk/src/gap5/g-struct.c M /staden/trunk/src/gap5/tg_cache.c M /staden/trunk/src/gap5/tg_iface_g.c M /staden/trunk/src/gap5/tg_view.c Made the debugging outputs when opening and closing database appear to stderr instead of stdout. This helps scripts that may want to extract data and print to stdout. ------------------------------------------------------------------------ r2627 | jkbonfield | 2011-07-18 16:33:00 +0100 (Mon, 18 Jul 2011) | 6 lines Changed paths: A /staden/trunk/src/gap5/gap5_command.tcl Combined multiple gap5_* commands into a single tool: gap5_command [options ...] This provides consensus, export and check methods so far. ------------------------------------------------------------------------ r2626 | jkbonfield | 2011-07-18 12:22:07 +0100 (Mon, 18 Jul 2011) | 2 lines Changed paths: M /staden/trunk/src/gap5/init.c Fixed initialisation of old tgap library. ------------------------------------------------------------------------ r2625 | jkbonfield | 2011-07-18 11:51:34 +0100 (Mon, 18 Jul 2011) | 2 lines Changed paths: M /staden/trunk/src/Makefile.in M /staden/trunk/src/Misc/Makefile M /staden/trunk/src/NEWS M /staden/trunk/src/gap4/Makefile M /staden/trunk/src/gap5/Makefile A /staden/trunk/src/gap5/ace_reorder.pl (from /staden/trunk/src/tgap/ace_reorder.pl:2608) A /staden/trunk/src/gap5/actf.c (from /staden/trunk/src/tgap/actf.c:2608) A /staden/trunk/src/gap5/actf.h (from /staden/trunk/src/tgap/actf.h:2608) A /staden/trunk/src/gap5/b+tree2.c (from /staden/trunk/src/tgap/b+tree2.c:2608) A /staden/trunk/src/gap5/b+tree2.h (from /staden/trunk/src/tgap/b+tree2.h:2608) A /staden/trunk/src/gap5/caf2baf.pl (from /staden/trunk/src/tgap/caf2baf.pl:2608) M /staden/trunk/src/gap5/depth.tcl A /staden/trunk/src/gap5/docs/BAF (from /staden/trunk/src/tgap/BAF:2608) A /staden/trunk/src/gap5/g-alloc.c (from /staden/trunk/src/tgap/g-alloc.c:2608) A /staden/trunk/src/gap5/g-alloc.h (from /staden/trunk/src/tgap/g-alloc.h:2608) A /staden/trunk/src/gap5/g-connect.c (from /staden/trunk/src/tgap/g-connect.c:2608) A /staden/trunk/src/gap5/g-connect.h (from /staden/trunk/src/tgap/g-connect.h:2608) A /staden/trunk/src/gap5/g-db.c (from /staden/trunk/src/tgap/g-db.c:2608) A /staden/trunk/src/gap5/g-db.h (from /staden/trunk/src/tgap/g-db.h:2608) A /staden/trunk/src/gap5/g-defs.h (from /staden/trunk/src/tgap/g-defs.h:2608) A /staden/trunk/src/gap5/g-error.c (from /staden/trunk/src/tgap/g-error.c:2608) A /staden/trunk/src/gap5/g-error.h (from /staden/trunk/src/tgap/g-error.h:2608) A /staden/trunk/src/gap5/g-filedefs.h (from /staden/trunk/src/tgap/g-filedefs.h:2608) A /staden/trunk/src/gap5/g-files.c (from /staden/trunk/src/tgap/g-files.c:2608) A /staden/trunk/src/gap5/g-files.h (from /staden/trunk/src/tgap/g-files.h:2608) A /staden/trunk/src/gap5/g-io.c (from /staden/trunk/src/tgap/g-io.c:2608) A /staden/trunk/src/gap5/g-io.h (from /staden/trunk/src/tgap/g-io.h:2608) A /staden/trunk/src/gap5/g-misc.h (from /staden/trunk/src/tgap/g-misc.h:2608) A /staden/trunk/src/gap5/g-os.h (from /staden/trunk/src/tgap/g-os.h:2608) A /staden/trunk/src/gap5/g-request.c (from /staden/trunk/src/tgap/g-request.c:2608) A /staden/trunk/src/gap5/g-request.h (from /staden/trunk/src/tgap/g-request.h:2608) A /staden/trunk/src/gap5/g-struct.c (from /staden/trunk/src/tgap/g-struct.c:2608) A /staden/trunk/src/gap5/g-struct.h (from /staden/trunk/src/tgap/g-struct.h:2608) A /staden/trunk/src/gap5/g.h (from /staden/trunk/src/tgap/g.h:2608) M /staden/trunk/src/gap5/gap5.tcl M /staden/trunk/src/gap5/gap5_check.tcl M /staden/trunk/src/gap5/gap5_consensus.tcl M /staden/trunk/src/gap5/gap5_export.tcl A /staden/trunk/src/gap5/gap_cli_arg.c (from /staden/trunk/src/tgap/gap_cli_arg.c:2608) A /staden/trunk/src/gap5/gap_cli_arg.h (from /staden/trunk/src/tgap/gap_cli_arg.h:2608) A /staden/trunk/src/gap5/hache_table.c (from /staden/trunk/src/tgap/hache_table.c:2608) A /staden/trunk/src/gap5/hache_table.h (from /staden/trunk/src/tgap/hache_table.h:2608) A /staden/trunk/src/gap5/mkdefs.c (from /staden/trunk/src/tgap/mkdefs.c:2608) A /staden/trunk/src/gap5/sam2fai.pl (from /staden/trunk/src/tgap/sam2fai.pl:2608) A /staden/trunk/src/gap5/tg_anno.c (from /staden/trunk/src/tgap/tg_anno.c:2608) A /staden/trunk/src/gap5/tg_anno.h (from /staden/trunk/src/tgap/tg_anno.h:2608) A /staden/trunk/src/gap5/tg_bin.c (from /staden/trunk/src/tgap/tg_bin.c:2620) A /staden/trunk/src/gap5/tg_bin.h (from /staden/trunk/src/tgap/tg_bin.h:2608) A /staden/trunk/src/gap5/tg_cache.c (from /staden/trunk/src/tgap/tg_cache.c:2616) A /staden/trunk/src/gap5/tg_cache_item.h (from /staden/trunk/src/tgap/tg_cache_item.h:2616) A /staden/trunk/src/gap5/tg_check.c (from /staden/trunk/src/tgap/tg_check.c:2623) A /staden/trunk/src/gap5/tg_check.h (from /staden/trunk/src/tgap/tg_check.h:2608) A /staden/trunk/src/gap5/tg_contig.c (from /staden/trunk/src/tgap/tg_contig.c:2621) A /staden/trunk/src/gap5/tg_contig.h (from /staden/trunk/src/tgap/tg_contig.h:2608) A /staden/trunk/src/gap5/tg_gio.c (from /staden/trunk/src/tgap/tg_gio.c:2608) A /staden/trunk/src/gap5/tg_gio.h (from /staden/trunk/src/tgap/tg_gio.h:2611) A /staden/trunk/src/gap5/tg_iface.h (from /staden/trunk/src/tgap/tg_iface.h:2608) A /staden/trunk/src/gap5/tg_iface_g.c (from /staden/trunk/src/tgap/tg_iface_g.c:2622) A /staden/trunk/src/gap5/tg_iface_g.h (from /staden/trunk/src/tgap/tg_iface_g.h:2608) A /staden/trunk/src/gap5/tg_library.c (from /staden/trunk/src/tgap/tg_library.c:2608) A /staden/trunk/src/gap5/tg_library.h (from /staden/trunk/src/tgap/tg_library.h:2608) A /staden/trunk/src/gap5/tg_register.c (from /staden/trunk/src/tgap/tg_register.c:2608) A /staden/trunk/src/gap5/tg_register.h (from /staden/trunk/src/tgap/tg_register.h:2608) A /staden/trunk/src/gap5/tg_sequence.c (from /staden/trunk/src/tgap/tg_sequence.c:2608) A /staden/trunk/src/gap5/tg_sequence.h (from /staden/trunk/src/tgap/tg_sequence.h:2608) A /staden/trunk/src/gap5/tg_struct.h (from /staden/trunk/src/tgap/tg_struct.h:2608) A /staden/trunk/src/gap5/tg_tcl.c (from /staden/trunk/src/tgap/tg_tcl.c:2608) A /staden/trunk/src/gap5/tg_tcl.h (from /staden/trunk/src/tgap/tg_tcl.h:2608) A /staden/trunk/src/gap5/tg_track.c (from /staden/trunk/src/tgap/tg_track.c:2608) A /staden/trunk/src/gap5/tg_track.h (from /staden/trunk/src/tgap/tg_track.h:2608) A /staden/trunk/src/gap5/tg_tracks.c (from /staden/trunk/src/tgap/tg_tracks.c:2608) A /staden/trunk/src/gap5/tg_tracks.h (from /staden/trunk/src/tgap/tg_tracks.h:2608) A /staden/trunk/src/gap5/tg_utils.c (from /staden/trunk/src/tgap/tg_utils.c:2608) A /staden/trunk/src/gap5/tg_utils.h (from /staden/trunk/src/tgap/tg_utils.h:2608) A /staden/trunk/src/gap5/xalloc.h (from /staden/trunk/src/tgap/xalloc.h:2608) A /staden/trunk/src/gap5/zfio.c (from /staden/trunk/src/tgap/zfio.c:2608) A /staden/trunk/src/gap5/zfio.h (from /staden/trunk/src/tgap/zfio.h:2608) D /staden/trunk/src/tgap M /staden/trunk/src/tk_utils/Makefile Merged tgap directory into gap5. ------------------------------------------------------------------------ r2624 | jkbonfield | 2011-07-18 10:12:54 +0100 (Mon, 18 Jul 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/newgap5_cmds.c Allow calc_consensus and calc_quality to request regions outside of the contig visible extents. This fixes an error in the contig editor that allows us to remove bases at the extreme left or right of the contig if the first or last visible consensus base is *. ------------------------------------------------------------------------ r2623 | jkbonfield | 2011-07-18 10:11:59 +0100 (Mon, 18 Jul 2011) | 5 lines Changed paths: M /staden/trunk/src/tgap/tg_check.c Fixed check for seq leftnseqs==0 when setting a bin start_used/end_used to zero. Empty bins may have children with data, so the recent assertion is infact sometimes false. ------------------------------------------------------------------------ r2620 | jkbonfield | 2011-07-15 17:21:29 +0100 (Fri, 15 Jul 2011) | 2 lines Changed paths: M /staden/trunk/src/tgap/tg_bin.c Rewrite of how bin_remove_item_from_bin handles bin start/end used parameters. ------------------------------------------------------------------------ r2619 | jkbonfield | 2011-07-15 16:36:28 +0100 (Fri, 15 Jul 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Fixed an issue where cached consensus sequences were sometimes counted as seqs for the bin->nseq value. Removed some debugging left in during last commit. ------------------------------------------------------------------------ r2618 | jkbonfield | 2011-07-15 15:22:35 +0100 (Fri, 15 Jul 2011) | 10 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Yet more break contig fixes. 1) More issues with single bp tags being the only thing in a contig: another < vs <= bug. 2) Fixed an issue where tags were not copied to the right copy. This happens when tags start to the left of the break point that are on a sequence with visible start to the right of the break point. Rechecked all the combinations of this. ------------------------------------------------------------------------ r2617 | jkbonfield | 2011-07-15 15:20:49 +0100 (Fri, 15 Jul 2011) | 7 lines Changed paths: M /staden/trunk/src/tgap/tg_contig.c Bug fix to contig_insert_bases2(). If we insert in a region containing no sequences, but still adjust the bin size, then we weren't returning a status to indicate an insert took place and so didn't update the contig dimensions. Now we ensure any time bin->size is increased we will update contig size. ------------------------------------------------------------------------ r2616 | jkbonfield | 2011-07-15 15:19:30 +0100 (Fri, 15 Jul 2011) | 6 lines Changed paths: M /staden/trunk/src/tgap/tg_cache.c M /staden/trunk/src/tgap/tg_cache_item.h Added a checksum to cached items. When we populate the cache we compute a checksum. When we unload we recompute the checksum and only permit it to differ if the item was locked for RW at some stage. This will identify places where we forgot to call cache_rw() causing in-memory and on-disk structures to potentially differ. ------------------------------------------------------------------------ r2615 | jkbonfield | 2011-07-15 10:06:33 +0100 (Fri, 15 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/tgap/tg_contig.c Do a full recalculation of bin start/end used when removing an item at the boundary of start/end used. ------------------------------------------------------------------------ r2614 | jkbonfield | 2011-07-14 14:51:53 +0100 (Thu, 14 Jul 2011) | 13 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Fixed multiple data corruption bugs in break contig. 1) Breaking at a position where the right contig ends before base 0 (so entirely negative, prior to shifting) was not setting contig boundaries correctly. 2) Incorrect computation of annotation start coordinates, meaning we could accidentally move them to the right hand contig when they overlapped the left hand contig. 3) Was Incorrtly claiming bin is empty when it infact is just 1 base long (eg contains only a single bp tag). ------------------------------------------------------------------------ r2613 | jkbonfield | 2011-07-14 11:46:03 +0100 (Thu, 14 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Fixed ref count leak, albeit only in occasions when we have already met an earlier error. ------------------------------------------------------------------------ r2612 | jkbonfield | 2011-07-14 11:45:33 +0100 (Thu, 14 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/tgap/tg_bin.c Added loop detection in bin_incr_nseq/nref/nanno code. This has triggered from time to time, but not sure why and cannot yet repeat. ------------------------------------------------------------------------ r2611 | jkbonfield | 2011-07-14 11:44:56 +0100 (Thu, 14 Jul 2011) | 6 lines Changed paths: M /staden/trunk/src/tgap/tg_cache.c M /staden/trunk/src/tgap/tg_gio.h Improved the CACHE_REF_DEBUG ref counting debugging code. If we cache_incr(), cache_rw() and then cache_decr() we failed to remove the debugging indicating the first cache_incr as cache_rw has changed our ref count. This was showing up as falsely reporting reference leaks that didn't actually happen. ------------------------------------------------------------------------ r2610 | jkbonfield | 2011-07-13 15:06:06 +0100 (Wed, 13 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/gap4_compat.c Fixed complement_contig crashes by using cache_incr() and cache_decr() on the contig. Previously these could cause the contig to be purged out of memory and result in crashes. ------------------------------------------------------------------------ r2609 | jkbonfield | 2011-07-13 12:36:48 +0100 (Wed, 13 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/tgap/tg_contig.c Fixed a bug when removing a column of pads causes the last item in a bin to be removed. It wasn't setting start_used/end_used to zero. ------------------------------------------------------------------------ r2608 | jkbonfield | 2011-07-13 11:43:17 +0100 (Wed, 13 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Ugly hack - protection against failing to load a cached consensus in case of corrupted databases or other I/O failures. ------------------------------------------------------------------------ r2607 | jkbonfield | 2011-07-13 11:42:18 +0100 (Wed, 13 Jul 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/gap5/newgap5_cmds.c M /staden/trunk/src/gap5/newgap_structs.h Juggled the code a little bit to allow the join contigs implementation to be executed outside of an edview struct. Exposed this as a join_contigs command callable from Tcl. (This allows the gap5 dummy-user thrashing code to try joining.) ------------------------------------------------------------------------ r2606 | jkbonfield | 2011-07-13 11:40:31 +0100 (Wed, 13 Jul 2011) | 5 lines Changed paths: M /staden/trunk/src/tgap/tg_check.c Improved the fixing of cases where seq len doesn't match range end-start+1. We try to adjust start now for complemented sequences instead of always fixing end. This hopefully keeps things in the same position as is visually displayed. ------------------------------------------------------------------------ r2605 | jkbonfield | 2011-07-13 11:39:17 +0100 (Wed, 13 Jul 2011) | 7 lines Changed paths: M /staden/trunk/src/tgap/tg_contig.c Fixes to inserting data when at the extreme end of a complemented contig, in the cutoff data. The fix was to give up attempting to track the exact behaviour of bin start_used and end_used and simply recompute it verbatim. Not as fast, but robust. ------------------------------------------------------------------------ r2604 | jkbonfield | 2011-07-13 11:36:14 +0100 (Wed, 13 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/tgap/tg_iface_g.c Added code to protect against attempting to write a bin range with a record but no data. This can happen when we end up removing all items within a bin. ------------------------------------------------------------------------ r2603 | jkbonfield | 2011-07-13 11:33:48 +0100 (Wed, 13 Jul 2011) | 9 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Fixes to break contig. 1) We check if breaking here will produce a contig with no data, which causes inconsistencies. Quit early if so. 2) Fixed an error in remove_empty_bins where the first non-empty bin recursing down from the root is complemented. It was setting the bin offset incorrectly. ------------------------------------------------------------------------ r2602 | jkbonfield | 2011-07-11 11:33:27 +0100 (Mon, 11 Jul 2011) | 5 lines Changed paths: M /staden/trunk/src/gap5/shuffle_pads.c Worked around issues with the malign code in seq_utils. This assumes contigs start at base 1 and go to base N, so we now shift data to ensure this is so before running the algorithm, and shift it back at the end. ------------------------------------------------------------------------ r2601 | jkbonfield | 2011-07-08 16:54:34 +0100 (Fri, 08 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/NEWS ------------------------------------------------------------------------ r2600 | jkbonfield | 2011-07-08 16:42:15 +0100 (Fri, 08 Jul 2011) | 1 line Changed paths: A /staden/trunk/src/gap5/gap5_check.tcl CLI interface to check database ------------------------------------------------------------------------ r2599 | jkbonfield | 2011-07-08 16:24:08 +0100 (Fri, 08 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/tgap/tg_check.c Fixed check_seq for consensus seqs - blank base-calls is expected ------------------------------------------------------------------------ r2598 | jkbonfield | 2011-07-08 16:23:32 +0100 (Fri, 08 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/tkEditor.c Adding debugging method 'ref_count' for reporting contig ref counts ------------------------------------------------------------------------ r2597 | jkbonfield | 2011-07-08 16:23:08 +0100 (Fri, 08 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Fixed ref count leak in editor_undo_info ------------------------------------------------------------------------ r2596 | jkbonfield | 2011-07-08 14:21:02 +0100 (Fri, 08 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/sam_index.c Protect against tags in SAM being beyond the extent of a sequence. We now warn about this and clip the tag appropriately. ------------------------------------------------------------------------ r2595 | jkbonfield | 2011-07-08 12:08:16 +0100 (Fri, 08 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/tgap/tg_contig.c When deleting sequences or tags in contig_delete_base2() we now correctly update the nseq and nanno bin fields. ------------------------------------------------------------------------ r2594 | jkbonfield | 2011-07-08 11:43:05 +0100 (Fri, 08 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/tgap/tg_tcl.c Fixed Tcl $contig move_anno method. It was incorrectly setting obj_rec to obj_type (silly error), and also wasn't correct compensating for sequence positions. Ie I previously tested it on consensus tags only... ------------------------------------------------------------------------ r2593 | jkbonfield | 2011-07-07 17:32:08 +0100 (Thu, 07 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/tgap/tg_bin.c Added missing cache_rw() to bin_remove_item_from_bin, causing some data to be not written back to disk sometimes (or for the editor to modify base io instead of its child io). ------------------------------------------------------------------------ r2592 | jkbonfield | 2011-07-07 17:16:02 +0100 (Thu, 07 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl Added keyboard short-cut for checking consistency of the contig being edited, using the editor's child-io struct ------------------------------------------------------------------------ r2591 | jkbonfield | 2011-07-07 17:15:30 +0100 (Thu, 07 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/tgap/tg_sequence.c Improved (ie bug fixed) range updating in sequence_range_length function ------------------------------------------------------------------------ r2590 | jkbonfield | 2011-07-07 17:14:50 +0100 (Thu, 07 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/Misc/shell.c Removal of warning msg ------------------------------------------------------------------------ r2589 | jkbonfield | 2011-07-07 16:22:41 +0100 (Thu, 07 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c M /staden/trunk/src/tgap/hache_table.c M /staden/trunk/src/tgap/hache_table.h Added code to reverse the linked lists in hash tables. Use this in the contig editor, which fixes issues of overlapping tags not displaying correctly. ------------------------------------------------------------------------ r2588 | jkbonfield | 2011-07-07 16:21:41 +0100 (Thu, 07 Jul 2011) | 2 lines Changed paths: M /staden/trunk/src/tgap/tg_cache.c Improved debugging with CACHE_REF_DEBUG. ------------------------------------------------------------------------ r2587 | jkbonfield | 2011-07-07 14:11:33 +0100 (Thu, 07 Jul 2011) | 14 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c M /staden/trunk/src/tgap/tg_bin.c M /staden/trunk/src/tgap/tg_iface_g.c Fixed a major corruption involving reuse of old GRange slots. The free-list, if containing at least one item, was failing to terminate with record -1, instead pointing at record 0. This has been fixed in the unpack_rng_array() function to prevent possible data corruption, but at a cost of sometimes leaking bin slots (freeing them up and never reusing them). The correct solution will involve a minor change to the packed range format which I'll work on later. Also added extra code for ensuring bin flags get updated to request data changed is written back to disk (this is almost certainly done already, but it's clearer to do at source rather than later on). ------------------------------------------------------------------------ r2586 | jkbonfield | 2011-07-07 14:07:58 +0100 (Thu, 07 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/tgap/tg_check.c Further checks and fixes: bin->free_rec list ------------------------------------------------------------------------ r2585 | jkbonfield | 2011-07-06 17:08:36 +0100 (Wed, 06 Jul 2011) | 9 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/tgap/tg_tcl.c Lots of overhauls to editor Undo, which also involved adding a new move_seq method to the tg-tcl interface. These fix undo of removal of pad columns for the first or last base in a contig and the first or last base in a sequence. They also fix undo of tag deletion - we now recreate the tag using the old record number instead of a new one (which broke subsequent undo ops on that same tag). ------------------------------------------------------------------------ r2584 | jkbonfield | 2011-07-06 17:06:50 +0100 (Wed, 06 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/tgap/tg_contig.c Correct errors introduced in insert/delete by the patch to allow these functions to shift data instead of insert data. They were causing the bin start/end used portion to be updated incorrectly in some special cases. ------------------------------------------------------------------------ r2583 | jkbonfield | 2011-07-06 17:05:09 +0100 (Wed, 06 Jul 2011) | 7 lines Changed paths: M /staden/trunk/src/tgap/tg_sequence.c Replaced an assert with a warning message instead, now that we have a dedicated checker. Corrected error in sequence_delete_base() when removing the very last base. Also added much more code to sequence_range_length() to update bin used ranges and contig sizes as appropriate. ------------------------------------------------------------------------ r2582 | jkbonfield | 2011-07-06 17:02:31 +0100 (Wed, 06 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/tgap/tg_check.c Changes to allow check_contig to run on child IOs ------------------------------------------------------------------------ r2581 | jkbonfield | 2011-07-06 17:01:52 +0100 (Wed, 06 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/tgap/tg_cache.c Comments ------------------------------------------------------------------------ r2580 | jkbonfield | 2011-07-05 12:18:11 +0100 (Tue, 05 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Added a reference count (lock) to the contig in calculate_consensus_simple2. This fixes a crash that sometimes happened due in gap5_consensus. ------------------------------------------------------------------------ r2579 | jkbonfield | 2011-07-04 17:42:04 +0100 (Mon, 04 Jul 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/editor_view.c Fixed edReadEnd() to set the cursor to 1 past the contig end when cutoffs are not shown. It's now in agreement with the with-cutoffs implementation. ------------------------------------------------------------------------ r2578 | jkbonfield | 2011-07-04 15:17:35 +0100 (Mon, 04 Jul 2011) | 9 lines Changed paths: M /staden/trunk/src/tgap/tg_iface_g.c Removed memory corruption when we have stored a range containing zero array elements. This leads to calling ArrayCreate with dim 0 which secretly gets converted to dim 1, but we reset the array pointer to one of size 0 causing later corruptions when we try to extend. Also reverted the order of checks in the seq block decoding to check in[i].bin before parent_rec. While perhaps a bit slower on our benchmarks, it avoids spurious valgrind complaints. ------------------------------------------------------------------------ r2577 | jkbonfield | 2011-07-04 15:15:18 +0100 (Mon, 04 Jul 2011) | 2 lines Changed paths: M /staden/trunk/src/tgap/tg_bin.c Added assertion to next_range(). Not triggered (yet). ------------------------------------------------------------------------ r2576 | jkbonfield | 2011-07-01 17:17:28 +0100 (Fri, 01 Jul 2011) | 1 line Changed paths: M /staden/trunk/src/ChangeLog M /staden/trunk/src/NEWS M /staden/trunk/src/gap5/docs/TODO ------------------------------------------------------------------------ r2575 | jkbonfield | 2011-07-01 17:06:10 +0100 (Fri, 01 Jul 2011) | 9 lines Changed paths: M /staden/trunk/src/gap5/editor_join.c Changed the amount of data we tack on to the end of consensus sequences when computing overlaps. Previously it was a fixed 30%, but since we modified the band size for the alignment algorithm this was pushing the alignment beyond the band causing broken alignments in the join editor. Now we use the same calculation to keep this in sync with the alignment algorithm, incase we change the parameters again. ------------------------------------------------------------------------ r2574 | jkbonfield | 2011-07-01 16:42:53 +0100 (Fri, 01 Jul 2011) | 6 lines Changed paths: M /staden/trunk/src/gap5/break_contig.c Further fix to start/end ranges after breaking. This fix is for the left-hand contigs start coordinate, which can change if the right hand contig happened to contain the furthest-left sequence (in cutoff). ------------------------------------------------------------------------ r2573 | jkbonfield | 2011-07-01 12:38:36 +0100 (Fri, 01 Jul 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/contig_id.tcl M /staden/trunk/src/gap5/gap4_compat.tcl Fixed a crash caused by typing # into a contig identifier dialogue where was neither a GT_Contig or GT_Seq record id. ------------------------------------------------------------------------ r2572 | jkbonfield | 2011-07-01 12:37:34 +0100 (Fri, 01 Jul 2011) | 12 lines Changed paths: M /staden/trunk/src/gap5/contig_editor.tcl M /staden/trunk/src/tgap/tg_anno.c M /staden/trunk/src/tgap/tg_check.c M /staden/trunk/src/tgap/tg_contig.c M /staden/trunk/src/tgap/tg_tcl.c Fixed the usage of obj_rec in anno_ele_t. Obj_type/obj_rec (and pair_rec in range_t) point to the record that is being annotated. This works well for sequences, but is problematic for contigs. Eg consider breaking a contig in two; all consensus annotations in the right hand half will need their obj_rec (and pair_rec) fields changing. Mostly this worked as we simply didn't bother and instead took consensus annotations to be on the contig they are within, regardless of the contents of obj_rec or pair_rec, but not in all cases. Now we force obj_rec to be zero when obj_type is GT_Contig and fixed the exceptions where we failed to ignore the field. ------------------------------------------------------------------------ r2571 | jkbonfield | 2011-06-30 17:27:13 +0100 (Thu, 30 Jun 2011) | 4 lines Changed paths: M /staden/trunk/src/tgap/tg_contig.c Changed assert ABS(r->end - r->start) + 1 != ABS(s->len) to be less aggressive. It's now a verror message and we gloss over it, as the assert served its purpose - to find and fix the bug. ------------------------------------------------------------------------ r2570 | jkbonfield | 2011-06-30 17:11:23 +0100 (Thu, 30 Jun 2011) | 1 line Changed paths: M /staden/trunk/src/gap5/list_contigs.tcl Corrected handling of REG_QUIT events ------------------------------------------------------------------------ r2569 | jkbonfield | 2011-06-30 17:11:01 +0100 (Thu, 30 Jun 2011) | 4 lines Changed paths: M /staden/trunk/src/gap5/consensus.c Speed increase wheni n read-only mode and asking for sequence only. It no longer attempts to get quality data as well to store in the cache, as it cannot (and will not) do this due to r/o mode. ------------------------------------------------------------------------ r2568 | jkbonfield | 2011-06-30 17:10:05 +0100 (Thu, 30 Jun 2011) | 1 line Changed paths: M /staden/trunk/src/tgap/tg_check.c Allow 'n' as well as 'N' in seqs ------------------------------------------------------------------------ r2567 | jkbonfield | 2011-06-30 17:09:48 +0100 (Thu, 30 Jun 2011) | 4 lines Changed paths: M /staden/trunk/src/tgap/tg_iface_g.c Sped up io_seq_block_read when there are a large number of libraries. Sometimes it can be 3x faster, but for the usual case there is little difference. ------------------------------------------------------------------------ r2566 | jkbonfield | 2011-06-30 12:04:27 +0100 (Thu, 30 Jun 2011) | 3 lines Changed paths: M /staden/trunk/src/gap5/consen.tcl Bug fix when saving fastq. We always computed the quality for the entire contig rather than just the region we specified. ----------------------------------------------------------------------------- Older ChangeLog format below. 2011-06-30 jkbonfield * tgap/tg_check.c: Extra check for where a child bin has a non-zero record but cannot be read. Also fixable. * gap5/break_contig.c, tgap/tg_bin.c, tgap/tg_bin.h, tgap/tg_tracks.c: Fixed bin_get_position() to deal with complemented bins correctly, and also return relative orientation of the query bin to the contig now. This and changes in Break Contig together have fixed a bug where breaking a contig could sometimes cause the bin position to be incorrect and at odds with contig->start/end. * gap5/consen.tcl: Fixed a reference count leak in the Save Consensus code. 2011-06-29 jkbonfield * gap5/contig_editor.tcl, gap5/tk-io-reg.c, tgap/tg_register.c: Fixed quit_displays and REG_QUIT notifications so that the contig editor correctly cets a chance to veto any attempts at shutting down gap5 if there are unsaved changes. * gap5/gap4_compat.c: contig_name_to_number() now accepts reading numbers too, used after the contig index lookup fails. This means using fofn or lists for contigs containing reading names works again, as per Gap4 style. 2011-06-28 jkbonfield * tgap/tg_check.c: Removal of false positives (empty bins). Added fix-up for contig order size. * tgap/tg_contig.c: Removed a reference count leak in the contig iterator (leaking bins at times). Made contig_destroy() decrement the size of the contig_order array. This wasn't strictly a problem as we always use io->db.Ncontigs to work out how many contigs there are, but it's inefficient (writing out more data than we need to) and the new check_database code just happened to notice it due to extra-anal checking. 2011-06-28 awhitwham * gap5/fasta.c: Fixed double free. 2011-06-27 jkbonfield * gap5/check_database.tcl, gap5/gap5.tcl, gap5/gap5rc, gap5/gap5rc_menu_full, gap5/tclIndex, tgap/tg_check.c, tgap/tg_check.h, tgap/tg_tcl.c: Further work on Check Database. * It now has a user interface. * The fix mode can now correct for more things. * Uses vmessage() instead of fprintf(). * Added annotation and refpos checks. * Added checks for libraries and contig order. * tgap/tg_iface_g.c: Fixed lock/view leak in io_rec_exists(). * gap5/list_contigs.tcl, gap5/list_proc.tcl: Removal of reference count leak ($io get_contig). * tgap/tg_gio.c, tgap/xerror.c, tgap/xerror.h: Removed unused error handling code. Improved error messages reported when failing to create a new database. * tgap/tg_bin.c: Removal of debugging info 2011-06-24 jkbonfield * gap5/sam_index.c: Fix for consensus tags. The anno_ele_t struct was previously claiming it annotations the sequence the Zc:A:* aux record was found on, rather than the contig. However the range_t for that anno was correct which is why the affect was invisible. The bug fix is purely a consistency fix. * gap5/consensus.c: Fixed memory corruption in the consensus algorithm. Recomputing an existing cached consensus due to changes to the contig, when the contig also grew, was sometimes overflowing a buffer. * gap5/ace.c: Two fixes to ACE importing. 1) The mapping quality has now changed to 255 (the SAM synonym for unknown), both consistently in range_t and seq_t structs. Previously it was 0 and 50 which caused check_contig() to complain. 2) Fixed a stack corruption when copying over the sequence data. I've no idea why this ever worked, but it used to. 2011-06-23 jkbonfield * tgap/Makefile, tgap/tg_check.c, tgap/tg_check.h, tgap/tg_tcl.c: Added a check_contig() function for internal consistency checking. It's a work in progress: functional now and already identifying some issues, but without a UI. * NEWS: Collation of change logs * gap5/consensus.c, gap5/consensus.h, tgap/tg_bin.c: Bug fixes to removal of data from a contig (utilised when moving data). This wasn't updating the bin start_used and end_used fields where the sequence being removed was the cause of the bin extents being that large. When this happens, it also now triggers a check on the contig extents, as the contig start/end may also need updating. 2011-06-21 jkbonfield * gap5/tg_index_common.c, gap5/tg_index_common.h: Accidentally commited half a test-change in tg_index_common.c. So commented it out and the associated code in tg_index_common.h. (The change was to track mapping quality and only build insert size distributions from good quality alignments. Potentially useful, hence commented out instead of removed completely.) * tk_utils/init.tcl: We now check whether the editor "Sheet" font is fixed width. Some Tk version and font package combinations (eg Tk8.5 when specifying font name "Fixed") didn't work too well and chose alternatives, not always sensible ones. In these cases we fall back to a default Courier which should work everywhere. * gap5/contig_selector.tcl: Removed List Notes from the context menu. * gap5/consensus.c: I'm not sure it matters greatly, but explicitly allow for extending the search range in iterators within consensus_valid_range. (In theory the CITER_CSTART and CITER_CEND already indicate this, but to be honest I forget whether this change was the one that fixed the clip point code so I'm keeping it!) * gap4/shuffle_pads.c: Improved alignment positioning. Instead of +/-3 for the length we allow half a band-width. This improves alignments in many cases. * NEWS, gap5/Makefile, gap5/gap5rc_menu_full, gap5/newgap5_cmds.c, gap5/shuffle_pads.c, gap5/shuffle_pads.h, gap5/shuffle_pads.tcl, seq_utils/align_lib.c, seq_utils/align_lib.h: Added the first version of Shuffle Pads to gap5. This is based on the Gap4 version, which in turn is based on Gene Myers' ReAligner program. It's not desparately fast, but functional. 2011-06-17 jkbonfield * tgap/tg_contig.c, tgap/tg_contig.h: Fixed two bugs with the contig iterators, introduced in the recent change to try and speed them up. Firstly, CITER_SMALL_BS had a value which clashed with CITER_IEND causing data to always be sorted on right hand end even when explicitly asked to sort of left end. This means iterators could skip data. Secondly, we jumped CITER_BS into the contig for each range search, even when the first one only fetched CITER_SMALL_BS worth of data. The affects were ride ranging, but mostly hard to detect. The most obvious impact is control-a and control-e to jump to the start and end of the contig in the contig editor would sometimes not take us all the way there when faced with widely varying sequence lengths (eg capillary assemblies). 2011-06-16 jkbonfield * tgap/tg_bin.c: Identified a bug in bin_add_range and bin_for_range. When creating new bins as the smallest bin is larger than io->min_bin_size and we're in a complemented orientation (our parent or one of its parents has been complemented), then we were setting offset incorrect. This meant that sequences were put in the incorrect location. This bug was in bin_for_range(). Also in bin_add_range() we updated the start_used and end_used bin fields incorrectly for complemented bins. 2011-06-14 jkbonfield * system.mk.in: More SVN_VERSION fixes * system.mk.in: Patch to fix latest SVN_VERSION string. * gap5/bam.c: Removed harmless icc compiler warning * Misc/misc.h, configure.in, gap4/gap.tcl, gap5/gap5.tcl, gap5/tg_index.c, gap5/tg_index_common.c, gap5/tg_view.c, pregap4/gui.tcl, staden_config.h.in, system.mk.in, tk_utils/init.c, trev/trev.tcl: Added the svn head revision number to C define and Tcl global variables. We use these when reporting program version numbers, so even minor revision updates become obvious for users running the programs. 2011-06-13 jkbonfield * gap4/init.c: Remove signal handlers for Gap4 too. This is because abort() within a signal handler very often ends up in a core file which gdb cannot produce stack traces from (on linux). I'd rather have no messages on a crash then a broken core file. * tgap/actf.c: Fixed uninitialised memory access. Could occasionally result in failure to open databases. * gap5/editor_view.c, gap5/editor_view.h, gap5/find_oligo.c: Added an editor method to find existing editors for a specific contig. Used this within the Sequence Search function so that the Next button won't keep bringing up new editors each time. This allowed resolving a user request, as we can (and do) now underline the appropriate section of the editor too. * gap5/gap-error.c, gap5/init.c, gap5/stack_dump.c: Added stack dump printing for the linux signal handlers, but I now decided the signal handler itself is a bad idea given how it prevents gdb from working. I'd rather have no stack trace and a working gdb than a stack trace and a core file I cannot debug. 2011-06-10 jkbonfield * tgap/tg_struct.h: (Forgot with previous commit) Added in-memory-only fields to library_t for caching. * gap5/editor_view.c, gap5/gap5rc, gap5/gap5rc_menu_full, gap5/libraries.tcl, gap5/tkEditor.c, tgap/tg_iface_g.c, tgap/tg_library.c, tgap/tg_sequence.c, tgap/tg_sequence.h: Added some template status colours to the contig editor: white = ok pair blue = single ended orange = pair, spanning contigs red = inconsistent orientation grey = consistent orientation, but distance too large or too small. In the process of this I also added some in-memory only fields to the library_t struct for tracking whether the library stats are up to date. Also improved the library mean and s.d. calculations to be iterative, attempting to home in on a suitable peak and remove outliers. This doesn't change the mean significantly, but dramatically reduces the variance to a sensible figure by excluding likely invalid templates. In the editor names display, this also caused a few tweaks to mapping quality display. Now in packed mode the names are always coloured, either by template status or by mapping quality. (Ie the Quality button no longer controls the colouring of the names.) The unpacked dir+readname name display has room for showing both template and mapping quality data, so both are always shown. * tk_utils/init.tcl, tk_utils/sheet.c, tk_utils/sheet.h, tk_utils/tkSheet_common.c, tk_utils/tkSheet_common.h, tk_utils/tkSheet_config.h, tk_utils/tk_utilsrc: Finally implemented the sh_bold highlight mode, some 10+ years after it was first added to the bit-field. * gap5/consensus.c, gap5/consensus.h, gap5/contig_editor.tcl, gap5/editor_search.c, gap5/editor_search.tcl, gap5/newgap5_cmds.c, gap5/newgap_structs.h: Added unpadded position display/search to the contig editor. Right now this is a noddy approach operating by simply computing the consensus and counting '*'s, although it's rescued to some extent by the consensus cache. (I had to enable this again for child IO's, but hopefully it now works fully.) The editor "goto" box in the bottom left still works on padded or reference coordinates as listed by the P or R button, but manually adding the letter 'u' after a number will request unpadded coord. The P/R button hasn't been made P/R/U yet as the display of coordinates will be too slow still. There are more explicit padded vs unpadded options in the search dialogue, or hitting Return in the editor consensus will also show that coordinate. 2011-06-07 jkbonfield * gap5/newgap5_cmds.c, gap5/newgap_structs.h, gap5/readpair.c, gap5/readpair.h, gap5/readpair.tcl: The Find Read Pairs plot now has the option to filter the reported hits by the library. By default it uses all. Note filtering slows down the code substantially. * gap5/consensus.c, tgap/tg_contig.c, tgap/tg_contig.h: Speed increase to the contig iterator when supplied with whence & CITER_SMALL_BS. Then it only uses 100 bp window instead of a 10Kb window for the initial range query. This is optimal when being called from consensus_valid_range as the chances are 100bp from the end is sufficient to find the real contig clip point, while still not affecting efficiency for range queries beyond the ends. 2011-06-06 jkbonfield * gap5/gap_range.c: Bug fix to the template pairing. The recent change to add the quality plot changed how the detection of "done this pair" code worked, from zeroing record number to setting a flag (as we needed the record left intact). Unfortunately it was bugged. The impact was that using filters would lose many pairs and they'd stay lost until we had to query a new range. * gap5/contig_editor.tcl, tk_utils/sheet.c, tk_utils/sheet.h, tk_utils/tkSheet_config.h: The sheet widget now has an option to control whether a cursor is solid or a hollow box. This isn't automatically tied to focus, but is controlled explicitly from the join editor to indicate which of the pair is the "curr_editor". * gap5/contig_editor.tcl, gap5/editor_search.tcl: Improved editor search UI. Hovering over the Search button in the dialogue window will now highlight which editor of an join editor pair will be searched in. (As before, left-clicking in an editor will change this, only now it's obvious this happens.) Also fixed control-S/control-R so they don't bring up a separate dialogue window. * gap5/contig_editor.tcl: Clicking on a base within the tag now displays the summary data of the base underneath it instead of repeating the mouse-over text. This is the same interface as gap4 now. 2011-06-03 jkbonfield * Misc/dstring.c, gap4/newgap_cmds.c, gap4/tkEditor.c, gap4/tman_interface.c, gap5/consensus.c, gap5/editor_search.c, gap5/hash_lib.c, gap5/hash_lib.h, gap5/readpair.c, gap5/sam_index.c, gap5/tg_index.c, spin/seq_results.c, spin/seqed_search.c, tgap/tg_gio.c, tgap/tg_iface_g.c, tgap/tg_library.c, tk_utils/tcl_io_lib.c: Another rag-tag batch of compiler warning removals. 90% of these are unused variables, but there's a few missing prototypes and the occasional printf arguments issue (in error handling code). * spin2/Makefile, spin2/seq_reg_cmds.c, spin2/spin.tcl: Spin2 is still unused program, but minor tweaks to get it to compile should we ever need to release it again. * gap5/Makefile, gap5/depth.tcl, gap5/depth_track.c, gap5/gap5rc, gap5/gap_range.c, gap5/gap_range.h, gap5/newgap5_cmds.c, gap5/quality_plot.c, gap5/quality_plot.h, gap5/template_display.c: Added various consensus quality plots to the template display. By default they are turned off as they incur a heavy CPU cost: unlike the main template display, computing the consensus needs to fetch all the seq_t objects rather than just the bin/range arrays. The quality plots occupy one single track but are configuration to show consensus quality, discrepancies or heterozygosity (the highest log-odds score for any het mixture). * gap5/consensus.c, gap5/consensus.h: Speed optimisations to calculate_consensus_bit_het. Also exposed it outside the scope of this file so it can be called directly when a rangec_t array is already know. This also allows direct control of what to compute, to skip some things. Eg don't bother filling out the 7-way log-odds scores if all we're going to be using is the phred score. * tgap/tg_iface_g.c: Minor speed optimisation to unpack_rng_array() 2011-06-01 awhitwham * tgap/actf.c, tgap/g-files.c, tgap/g-files.h: Fixed bug where gap5 couldn't open a db in another directory from the File menu. 2011-05-31 jkbonfield * gap4/fij.c: Fixed free ordering, which was causing glibc malloc checking to fail. Only happened when make_consensus() failed (eg due to too small a max-consensus size). 2011-05-26 jkbonfield * gap5/contig_editor.tcl, tgap/tg_contig.c, tgap/tg_tcl.c: Added editor Undo support for the contig-shift operations. This was a bit complex, so needed a $contig move_anno method adding in the tcl interface too. 2011-05-25 jkbonfield * tgap/tg_contig.c: Fixed moving of annotation tags when using the new contig shift left/right functions. Sped up the shift functions by tweaking hache table configuration. 2011-05-24 jkbonfield * gap5/contig_editor.tcl, tgap/tg_contig.c, tgap/tg_contig.h, tgap/tg_tcl.c: Added commands to shift data in a contig. These move all data to the right of the editing cursor to the right or left by one base (bound to control-left and control-right arrow keys in th editor with the cursor on the consensus). This is implemented using the existing code to insert or remove columns of pads, but without the actual sequence-editing step. * tgap/tg_sequence.c, tgap/tg_sequence.h, tgap/tg_tcl.c: Fixed a bug where the tcl interface to sequence_insert_bases and sequence_delete_bases didn't update the range_t structure. Consequentially the sequence length and the start..end length in the range struct could differ. This was detected via the assertions added in svn update #2493, so we now know what was altering the data that triggered the bug fixed there. From C the only other use of the sequence ins/del functions are from the code in tg_contig.c to insert/delete entire columns of pads, and these already updated the range arrays correctly. Resolved the issue by creating a new sequence_range_length() function to update the range data any time we feel it's been invalidated due to changing sequence length. 2011-05-20 jkbonfield * gap5/contig_editor.tcl, gap5/gap5rc_menu_full: Fixed the Commands menu to work properly in a join editor. Now Create Tag on the top window adds tags to that window and not the bottom one. 2011-05-19 awhitwham * gap5/afg.h: Added missing header file. 2011-05-19 jkbonfield * gap5/consensus.c, gap5/consensus.h, gap5/editor_search.c, gap5/editor_search.tcl, gap5/gap5rc: Added a discrepancy calculation to the consensus algorithm too. This attempts to score discrpeancies based on the number of mismatching bases vs the expected number given depth and confidence values. It then expresses this in a (half-baked?) way that takes into account significance through sample-size. Exposed both this and the previous het score[6] value to the contig editor search window. * tgap/tg_anno.c: Unused code at present - for future work on tag orientation 2011-05-18 awhitwham * gap5/Makefile, gap5/afg.c, gap5/tg_index.c: Experimental Velvet afg file indexing added. 2011-05-18 jkbonfield * gap5/contig_editor.tcl: Added a Join To function for read-pairs that span contigs. * gap5/contig_editor.tcl, gap5/editor_view.c, gap5/editor_view.h, gap5/fij.c, gap5/tkEditor.c: Added next_difference and prev_difference methods to the editor widget. These search through the join editor consensus sequences looking for differences. The join editor "differences" line now has < and > buttons to call these. Also bug fixed the FIJ "Invoke Join Editor" menu item so that it positions the editor cursor on the correct consensus base instead of the first read in the contig (often being beyond the end of it leading to an invisible cursor). * gap5/consensus.c: Remove the code in calculate_consensus_simple() to convert a call to N if the scores[call] < Q_CUTOFF. This often happens now due to it preferring say A/C over A, but we'd rather the consensus is still kept as A for ease of algorithms elsewhere. 2011-05-17 awhitwham * gap5/caf.c: Replaced zf file functions with normal ones. CAF does not work with compressed files. 2011-05-17 jkbonfield * gap5/consensus.c, gap5/consensus.h, gap5/editor_view.c, gap5/gap5rc: Implemented a new consensus algorithm to compute probabilities for both pure single-base columns of data and mixed heterozygous columns. This means it can call the consensus as likely consisting of, say, an AT mix instead of pure A or pure T. We still also call the most likely homozygous consensus, but if it is more likely to be a heterozygous mix then the probability assigned to a homozygous call is therefore far lower than before. My belief is that this will prevent major conflicts still being given very high homozygous consensus values simply because one base type outweighs another. This work also forms the basis of SNP calling or misassembly detection. 2011-05-13 jkbonfield * gap5/consensus.c: Removed the fixed confidence of pads, now using the score listed on that base. Also permit confidence 100 on pads to force consensus. * gap5/gap5: Don't override $GTAGDB if already set. * tgap/tg_tcl.c: Fix to inserting sequences in certain combinations of complemented bins. This becomes visible when using control-left/control-right in the editor to move sequences around, which sometimes had the impact of reverse complementing data too. 2011-05-06 jkbonfield * gap5/docs/TODO, tgap/tg_bin.c, tgap/tg_bin.h: Fixed issues with moving sequences using control-left/right arrow keys. In some situations it would reverse complement data due to incorrectly checking BIN_COMPLEMENT flag rather than XORing it with the full path back to the root bin. It also incorrectly returned the complement flag when using CACHE_LAST_BIN optimisations. * gap5/editor_view.c: Fixed cut and paste of complemented sequences when in a bin that has been complemented. * tgap/tg_sequence.c: typo * tgap/tg_contig.c, tgap/tg_sequence.c: In attempts to track down crashes when inserting columns of pads to contigs that have been highly broken, complemented and joined I temporary implemented a new version of contig_insert_base(). For now this is #ifdef-ed out though as it turns out the cause is a disparity between s->len and r->end - r->start + 1: cause unknown! So, added some asserts to check for this. This doesn't fix the bug and data corruption! It just means it'll hopefully it'll be pointed out far sooner after it occurs, giving a more obvious link between cause and effect. Also improved robustness of sequence insertion to check for attempting to insert off the end of a sequence. * gap5/contig_editor.tcl: The Goto... feature now attempts to list gap size between template pairs. Fixed a display error where the contig record was not re-cached when inserting or deleting columns of pads. * gap5/libraries.tcl: Added a key and scrollbars to the plot interface. * gap5/ace.c, gap5/baf.c, gap5/caf.c, gap5/fasta.c, gap5/maq.c, gap5/sam_index.c, gap5/tg_index_common.c, tgap/tg_iface_g.c, tgap/tg_struct.h: Modified contig_t, seq_t, anno_ele_t and library_t data structures to use "char data[1]" as the terminating entry rather than "char *data". This is both more in line with what I intended (actually "char data[]" would be better, but may not be supported everywhere yet) and also works around a bug(?) in GCC 4.4.4 onwards giving false-hits in the buffer overrun detection code of _FORTIFY_SOURCE. * gap5/docs/TODO: 2011-05-04 jkbonfield * tgap/tg_cache.c, tgap/tg_cache_item.h: Fixed undefined behaviour in construct_key() and the use of structure assignments. It had an accidental assumption on structure copying preserving the contents of structure padding bytes. This exhibited itself as problems when compiling on gcc 4.4. Also reworked the cached_item struct to remove excessive use of bit-fields and instead moved them into the recently creating structure padding caused by changing tg_rec to 64-bit. * tgap/tg_iface_g.c: Debugging support (disabled atm) 2011-04-21 jkbonfield * gap5/readpair.c: Removal of debugging output. * gap5/gap_hash.c: Enable word size 14 in find repeats on large data-sets; > 100Mb of consensus * gap5/contig_editor.tcl, gap5/editor_view.c, gap5/readpair.c: Fixed Find Read Pairs. It now should work better with reversed matches and it now also invokes the join editor at the correct locations. * gap5/consensus.c: Fix an issue with the new consensus valid range code. When faced with inconsistent data where all reads are outside the claimed start..end range, or simply contigs with no data, we no longer return INT_MIN/INT_MAX as values. Instead we return 0. * gap5/fasta.c, tgap/tg_bin.c, tgap/tg_cache.c: Some tweaks to improve handling *really* large single sequences (> 1Gb). It's still not robust in that situation and not to be recommended. 2011-04-20 jkbonfield * gap5/editor_search.c: Allow #record_number to be used for reading name search * gap5/contig_editor.tcl: Fixed bug when right clicking on reading names * Misc/Makefile, Misc/misc.h, Misc/strtol64.c: Added strtol32/strtol64 and atoi equiv implementations. These avoid having to check everywhere whether strtol or strtoll is the appropriate function to return an int64_t data type. 2011-04-19 jkbonfield * gap5/gap5.tcl, gap5/tg_index.c: Bump version to 1.2.12 for local test release. * gap5/hash_lib.c: fast_mode is now off by default. It was always set/unset explicitly by FIJ, but the "align" button in the join editor just uses the default. * gap5/gap_hash.c, gap5/hash_lib.c, gap5/hash_lib.h: Further speed up of Find Repeats, along with a memory reduction. We now have versions of init_hashn, store_hashn and reps that don't use the h->counts[] array. * gap5/consensus.c: Rewrite of consensus_valid_range() to use contig iterators. The new version is generally substantially faster. * tgap/tg_iface_g.c: Check the master database version and don't attempt to write structures in formats newer than the master version indicates. This has currently only been implemented for version 1 vs 2, which covers the addition of reference positions in bin Ranges and nannotations in bin structs. * Misc/Makefile, gap4/Makefile, get_scf_field/Makefile, haplo/Makefile, polyA_clip/Makefile, qclip/Makefile, spin/Makefile, text_utils/Makefile, tk_utils/Makefile: Auto-updates from "make depend" * gap5/Makefile, gap5/actf.c, gap5/actf.h, gap5/fij.c, gap5/find_repeats.c, gap5/fort.h, gap5/gap_globals.c, gap5/gap_hash.c, tgap/Makefile, tgap/actf.c, tgap/actf.h: Moved actf.c from gap5 to tgap as it's used by libtgap. This fixes MacOS X build issues. Also removed the redundant fort.h 2011-04-18 jkbonfield * gap5/contig_editor.tcl: Fixed the editor Join command. It saved the two contigs but then gave the option to bail out after saving if the mismatch was two high. Now the order of this logic has been reversed. * gap5/contig_editor.tcl, gap5/editor_join.c, tgap/tg_sequence.c, tgap/tg_tcl.c: Quality values inserted (manually or automatically by the join editor Align button) to the consensus and/or sequences now default to quality -1. This is interpreted as MIN(left_qual,right_qual). 2011-04-15 jkbonfield * gap5/do_fij.c: Reverse the order of comparisons when doing single vs all in FIJ. The outer loop is now the single contig with the inner loop being each contig in turn to compare against it. This sounds like it should be slower than hashing all at once and comparing a single contig against it, but benchmarking says otherwise. * gap5/assemble_single.tcl, gap5/gap5rc, gap5/map_reads.tcl, gap5/tclIndex, tk_utils/Makefile, tk_utils/init.c, tk_utils/tcl_io_lib.c, tk_utils/tcl_io_lib.h: Extended the Map Reads functions of gap5 to be able to use a file of filenames, using io_lib to read from experiment files and trace files (either as local files or remote via URLs). * gap5/consen.tcl: Removal of debugging output * gap4/cs-object.c: Speed increase to DeleteRepeats (as per gap5 change). * gap5/cs-object.c, gap5/cs-object.h: Huge speed increase in destroying the contig selector "canvas item ID to C pointer" hash table. With ~1 million find repeat hits it's now 1500 times faster to shut down the display. 2011-04-14 jkbonfield * tgap/g-files.c: Minor update to finding files by old vs new filename. Previously it sometimes modified the database filename during the first pass, causing it to fail 2nd as well. * gap4/tagEditor.c: Fix accessing of free memory by minor moving of TagEdDestroy call * gap5/do_fij.c, gap5/docs/TODO, gap5/editor_join.c, gap5/fij.c, gap5/fij.h, gap5/fij.tcl, gap5/gap5rc, gap5/gap_hash.c, gap5/hash_lib.c, gap5/hash_lib.h, gap5/newgap5_cmds.c, gap5/newgap_structs.h, seq_utils/align_lib.h, seq_utils/dna_utils.c, seq_utils/dna_utils.h: Major speed improvements to Find Internal Joins and Find Repeats. FIJ is around 10x faster in quick mode, and I also added a fastest mode that takes a few more liberties in order to speed things up further (another 2-3x over quick mode). Speed gains will vary by size of project and number of contigs. The above was on a project with ~1500 contigs and ~20Mb of consensus. Some related speed ups may be possible in the sensitive mode, but for now I've left that code largely as-is. One of the speeds to FIJ involved the hashing code, which is the core of Find Repeats. Consequentially Find Repeats is somewhere around 100x faster! Again, depending on the project. * seq_utils/align_lib.c: Minor improvements to debug calls * tk_utils/tkTrace.c: Removed use of png_set_compression_level, to avoid issues with Z_BEST_COMPRESSION not being found on some Macs. Why? * tk_utils/text_output.c: Allow for \r at start of a vmessage() call to request overwriting the current output line * tk_utils/scalebox.tcl: Added a -variable option to scalebox * gap5/contig_selector.c: Faster repeat/FIJ plotting * gap5/consensus.c: Fixed a bug involving consensus being spaces at the ends of contig. Removed debugging printfs. 2011-03-24 jkbonfield * gap5/contig_editor.tcl: Modified Page Up and Page Down to scroll 1 screen full at a time instead of 1 Kb. The modified Page Up/Down (shift, control shift+control) have been updated to do the old 1k and beyond scroll incremements. Also added Home and End keybindings to mimic control-a and control-e. * gap5/gap5rc_menu_full, gap5/search.tcl: Added a prefix search for sequence names, using the new iterator prefix mechanism. * tgap/b+tree2.c, tgap/b+tree2.h, tgap/tg_gio.h, tgap/tg_iface.h, tgap/tg_iface_g.c, tgap/tg_sequence.c, tgap/tg_sequence.h, tgap/tg_tcl.c: Added an iterator to the B+Tree implementation (currently only "next" and no "previous"). Exposed this to the Tcl interface. 2011-03-23 jkbonfield * gap5/tkEditor.c: Added bounds checking to the X scrollbar * gap5/depth.tcl, gap5/template_display.c: Removed excessive debugging output. * gap5/consensus.c, gap5/editor_view.c: The consensus off the ends of contigs is now " " (space) rather than "N". Also put bounds checking in for user-selections in the consensus line, preventing users from attempting to create tags off the ends of contigs. * gap5/contig_editor.tcl: Added more incr/decr contig calls as tag creation/deletion can modify the contig struct. This had the effect of causing data to temporarily vanish due to out of date caches. * tgap/tg_contig.c: Fixed typo in postscript generation 2011-03-22 jkbonfield * gap5/sam_index.c, gap5/sam_pileup.c, gap5/sam_pileup.h: Added handling for cigar N (reference skip) alignments. For now we just create a separate sequence, but we need a more general purpose mechanism of dealing with templates with more than 2 sequences. TODO: Check the TC field in sam aux as an indicator of whether it's acceptable to remove the hashed template name when we see the second record. Also set this mode when finding a cigar N op. * gap5/bam.c: Improved error messages when parsing BAM headers - with line numbers and report of erroneous text. We no longer simply exit on bad formatted data, but attempt to gracefully continue albeit with messages to stderr. * tk_utils/text_output.c: Changed default value of "noisy" to 0. This also has the effect of reducing the need for our_interp to be initialised before calling verror. 2011-03-21 jkbonfield * gap5/gap_range.c: Minor bug fix to handle cases when depth is zero. * ChangeLog, NEWS: * gap5/depth.tcl, gap5/gap_range.c, gap5/gap_range.h: Improvements to the template display: 1) It now deals better with contigs that do not start as base 1. 2) The depth plot should no longer change Y values so drastically when zooming in and out. This still exists in part due to aliasing, but it's far better than it was. 2011-03-18 jkbonfield * gap5/actf.c: Fix to actf_lock(); don't complain of missing database files when we're attempting to create a new one. * gap5/actf.c, gap5/actf.h, tgap/g-files.c, tgap/g-files.h, tgap/tg_gio.c: Added BUSY file locking for Gap5, as per Gap4. * gap5/tag_editor.tcl: Temporarily removed the tag editor Move and Copy buttons as they haven't yet been implemented. * gap5/bam.c: Removed buffer overrun in sam_next_seq() when processing SAM files with no @SQ lines. It wasn't null terminating the reference string. 2011-03-17 jkbonfield * gap5/fasta.c, gap5/fasta.h, gap5/newgap5_cmds.c: Fixed fasta import: It now correctly terminates the last reading. Previously it would produce a blank contig for the last sequence. It also now calls bin_add_range at the end to flush any cached nseq values, so contigs no longer claim to have zero sequences in them. * gap5/contig_selector.c: Fixed a bug with reordering contigs. It could cause a contig to be duplicated and another to be overwritten when the user moved contigs around. 2011-03-16 jkbonfield * gap5/break_contig.c, gap5/consensus.c, gap5/contig_editor.tcl, gap5/contig_selector.tcl, gap5/editor_join.c, gap5/editor_search.c, gap5/editor_search.tcl, gap5/editor_view.c, gap5/gap5.tcl, gap5/gap5rc, gap5/gap5rc_menu_full, gap5/list_contigs.tcl, gap5/newgap5_cmds.c, gap5/sam_index.c, gap5/tg_index.c, gap5/tg_index.h, gap5/tkEditor.c, gap5/tkEditor.h, tgap/g-files.c, tgap/tg_anno.c, tgap/tg_bin.c, tgap/tg_bin.h, tgap/tg_contig.c, tgap/tg_contig.h, tgap/tg_iface_g.c, tgap/tg_struct.h, tgap/tg_tcl.c: Reference base coordinates are now tracked when the input is a SAM/BAM file. This required adjustments to the on-disc file formats for bins, although the code will still read the old format data too. In the editor window the position box in the bottom left now has a P or R label next to it. Clicking this toggles padded vs reference coordinates. It can be adjusted from the settings menu too. When in Reference mode the contig coordinate line also updates too. An editor search mode of "reference indel" has been added, to skip ahead to the next consensus insertion or deletion to the reference. Do not confuse these with pads - it's specifically where the data has been removed. Even when all the sequences have a D operator, if they have all had a * added then the consensus is the correct length and still has a 1:1 mapping to the reference, meaning there are no missing bases to find. A future useful addition though would be to add markers for consensus pads that align against a reference base (deletion of zero length maybe?) so we can search for these. We also need to decide how to fit unpadded coordinates into this system still. Implementation wise, a bin range now has an additional type REFPOS. A refpos object has no actual record, but instead uses these range fields to hold a mapping to the absolute reference ID and coordinate. Added nrefpos and nanno to the bin struct in addition to the existing nseqs field. Much like nseqs these count the number of objects in this bin and child bins in a recursive manner. Updated the contig iterators to use nseqs, nrefpos and nanno fields to short-cut the searches for next/previous item. Basically this is my "needle in a haystack" algorithm allowing us to rapidly skip forward to e.g. the next annotation simply by noting which bins have nanno == 0, and not requiring a linear read of every bin range. Other passenger updates that appeared in this large update: - Editor "stripe mode" or "fanfold mode" has reappeared. This is just a visual tweak to make visualising columns easier in deep repetitive data. - Fixed contig annotations in SAM to no longer claim to be on sequences. - Relaxed the SAM data out of order check as it's currently triggered by alignments starting with a deletion in the cigar string. We need a better check for this. - SAM/BAM reading code now automatically removes duplicates unless tg_index -D flag is specified. - Fixed a break contig bug where tags to the right of the break point are on readings that start to the left of the break point were not always moved to the left hand contig (when the tags happened to also fall into a new bin further to the right). * gap5/dis_readings.c, gap5/readpair.c: Minor printf formatting tweaks - ensure we use PRIrec instead of %d. * gap5/list_contigs.tcl: Minor change to report =number instead of #number for contig records. * gap5/gap4_compat.c: Improved robustness when given incorrect inputs - eg contigs that don't exist, or a contig number to rnumtocnum(). * gap5/docs/IMPLEMENTATION, gap5/docs/TODO: * gap5/dis_readings.c: Fixed algorithm for detecting empty bins. Previously a bin with no sequences but having annotations was labelled as empty and removed. * gap5/bam.c: Fixed parsing of SAM files that have "*" as the quality string. 2011-03-15 jkbonfield * gap5/configure.tcl, gap5/tag_checklist.tcl, gap5/trace_display.tcl: Fix for SF bug 3213620: Saving settings now writes to ~/.gap5rc instead of .gaprc. 2011-03-08 jkbonfield * tk_utils/sheet.c, tk_utils/sheet.h, tk_utils/tkSheet_common.c, tk_utils/tkSheet_config.h, tk_utils/tkSheet_struct.h: Added more 'sh_' highlight options: caret for deletion markers between characters; sh_indel for an alternative colouring scheme to highlight specific bases. The sh_underline highlight is now an extra pixel lower provided the font has sufficient descender room. 2011-03-03 jkbonfield * tgap/tg_contig.c: Correction to last fix - extra check in case of overlapping bins * tgap/tg_contig.c: Fixed a major bug with contig_delete_base: it was no longer correctly moving the data in the right hand bin leftwards due to an earlier bug fix. 2011-03-02 jkbonfield * tgap/tg_cache.c: Fix to previous fix! Reverted back some of the incr/decr ref counting code. This still cures the original bug with join contigs (I believe), but doesn't now crash with assertion failures elsewhere. It *does* still have a reference count leak somewhere though which I was attempting to fix and clearly failed. Anyway - working with leak is clearly a big improvement over not working at all. More to come. * gap5/bam.c, gap5/sam_pileup.c, gap5/sam_pileup.h: Improved handling of SAM files. We now properly deal with unpadded data correctly when it has no reference at all. We also cope with SAM files with missing @SQ records or even header lines at all. (Instead we just figure them out as we go.) * gap5/consensus.c: Fixed use of consensus cache when contig start exactly matches the bin start. Previously it failed to copy out of the cached bin, leaving blanks in the consensus. 2011-03-01 jkbonfield * tgap/tg_cache.c: Fixed reference counting bug in cache_dup. It wasn't incrementing the ref count of the base object, potentially allowing it to go out of scope. This in turn meant that subsequent writes of that object from the child io could attempt to flush data back to the wrong record (if the view had been reused). This was fortunately caught via an assert, but is likely the cause of some early corruptions we saw. The reference counting in copy-on-write scenarios still isn't ideal and I think there's a reference count leak here, albeit small. This is still preferable though than data corruption so I'm submitting the partial fix already. * gap5/contig_editor.tcl, gap5/contig_id.tcl, gap5/gap_utils.tcl: Removed various minor reference count leaks. * tgap/tg_bin.c: Fixed bin used size updating when being given length 1 sequences. 2011-02-25 jkbonfield * gap5/caf.c: Applied patch from Rob Davies to fix get_line(). The new version honours the \ continuation lines in CAF, making multi-line tags now work OK. * gap5/tg_index_common.c: Bug fix to unescape_line when finding \ on the end of lines. 2011-02-24 jkbonfield * gap5/bam.c, gap5/bam.h: Fixed binary mode on windows (need to check - unable at present). Added cigar_len field to the bam struct as a 32-bit int. This means we can now support sam files with cigar length > 64k, although bam by design still has this limitation. 2011-02-23 jkbonfield * gap5/tg_index.c: Fixed minor bug in memory allocation for argument parsing. 2011-02-22 jkbonfield * gap5/bam.c: Fixed issue in bam_more_output() (the decompression output, but on "input" side) when faced with truncated reads. We now keep going until either real eof or read enough. 2011-02-21 jkbonfield * gap4/tman_interface.c: Protection against a infinitely recursive loop. We observed this happening, apparently due to a sequence not being loaded into memory yet while scrolling off the end of it. (I cannot see how it is possible to bring up a trace for a sequence you haven't yet observed, but apparently some clever user discovered a way.) 2011-02-18 jkbonfield * incrTcl-3.3cvs: Header files are no longer needed given we do not depend on itcl any more. 2011-02-15 jkbonfield * ac_stubs/tcl.m4, staden.profile, system.mk.in: Improvements to help find libraries in /lib/staden. The tcl.m4 already had code for --enable-rpath (default) and --disable-rpath, so we now expose these to the Makefile properly. 2011-02-10 jkbonfield * README.build: More MacOS X build hints * Misc/os.h: ppc64 detection too 2011-02-09 jkbonfield * windows/wix/splash.bmp: Correct version number this time (2.0.0b8) * windows/wix/splash.bmp: Version number change 2011-02-08 jkbonfield * README.build, gap5/gap5.tcl, gap5/tg_index.c, gap5/tg_view.c: Updates to gap5 versions (1.2.11). 1.2.9 was last beta release, but 1.2.10 has been used as several internal interim releases. 2011-02-07 jkbonfield * tgap/tg_iface_g.c: Better handling of error case in io_seq_index_query_all() 2011-02-04 jkbonfield * tgap/tg_iface_g.c: Added extra paranoia after observing a corrupted database, where another record type got written to aux slot 0 (should be a GDatabase record), despite an apparent check for this with an assert. The cached_item struct holds both a record and a View; a handle to that record. The View in turn has a cache of the aux data for this record, which in turn holds the record number again. Double check that these two are identical so at least we die rather than corrupt (and hopefully help to point out what went wrong if so). * README.macosx: * gap5/template_display.c: Fixed error in XPutImage macro for windows. * tk_utils/tkAquaX.c: Not used, but there incase we wish to restart the aqua port some day. * gap5/ng_fb_cmds.tcl: Fixed DB_Load to work with the new file suffixes. 2011-02-03 jkbonfield * configure.in: Added check for the Aqua framework version of tcl/tk. These aren't supported currently as we need the X11 build of Tk. Rather than accept this at configure time and barf mysteriously mid compile, we now spot the issue and fail early. * gap5/template_display.c: Replaced TkPutImage calls with XPutImage and a check for _WIN32 to #define back to TkPutImage. The reason for this is that Windows is the exception here, not vice versa. Plus TkPutImage requires use of the internal tkInt.h, which causes compilation problems on many platforms. 2011-02-02 jkbonfield * gap5/editor_search.c: Fixed crash when searching (name, tag type, tag contents) with the editor cursor at the end of the contig. This caused the iterator to (validly) be NULL. I now check. * gap5/contig_selector.tcl: Fixed ContigParams to work when CurContig is a contig that has just been removed (eg by joining it to another) and CurContig is specified using the =cnum notation. To trigger the bug before, try: tg_index -z 65536 NT_113898.bam; # produces 1 contig gap5 NT_113898.0 & Break Contig dialogue, pos 1000000, OK [ CurContig is now eg =5] Complement Contig via contig selector popup menu Find Internal Joins "Next" button -> Join editor -> "Join" button [ We now have joined eg contig =5 to contig =581] Complement Contig via contig selector poup menu [ Calls ContigParams with CurContig =5, which crashed. ] * tgap/tg_struct.h: Removal of duplicate #define * tgap/g-alloc.c: Improvements to the debug program built when using -DHEAP_CHECK. (No affect on gap5.) We now output the object type and compression method used. * ChangeLog, NEWS: Updates from svn log 2011-02-01 jkbonfield * staden/trunk/doc/manual/dependencies, staden/trunk/doc/manual/gap5-t.texi, staden/trunk/doc/manual/gap5_list_libraries.png, staden/trunk/doc/manual/list_libraries-t.texi, gap5/depth.tcl, gap5/gap5rc_menu_full, gap5/libraries.tcl, tgap/tg_library.c, tgap/tg_tcl.c: Improved List Libraries interface in gap5 and also added it to the documentatiopn. Other minor gap5 doc changes too. * tgap/tg_cache.c: Fixed bug where attempting to call cache_rw() in read-only mode would grant access, but then cause a crash later on. It now properly returns NULL. 2011-01-31 jkbonfield * staden/trunk/doc/manual/Makefile, staden/trunk/doc/manual/calc_consensus-t.texi, staden/trunk/doc/manual/comparator-t.texi, staden/trunk/doc/manual/contig_selector-t.texi, staden/trunk/doc/manual/find_oligo-t.texi, staden/trunk/doc/manual/gap4-t.texi, staden/trunk/doc/manual/gap4.texi, staden/trunk/doc/manual/gap5-t.texi, staden/trunk/doc/manual/gap5.texi, staden/trunk/doc/manual/gap5_assembly-t.texi, staden/trunk/doc/manual/gap5_break_contig.png, staden/trunk/doc/manual/gap5_contig_editor-t.texi, staden/trunk/doc/manual/gap5_disassembly-t.texi, staden/trunk/doc/manual/gap5_disassembly.png, staden/trunk/doc/manual/gap5_export-t.texi, staden/trunk/doc/manual/gap5_export_sequences.png, staden/trunk/doc/manual/gap5_export_tags.png, staden/trunk/doc/manual/gap5_fij-t.texi, staden/trunk/doc/manual/gap5_find_read_pairs.png, staden/trunk/doc/manual/gap5_read_pairs-t.texi, staden/trunk/doc/manual/gap5_repeats-t.texi, staden/trunk/doc/manual/gap5_rp_comparator.png, staden/trunk/doc/manual/header.m4, staden/trunk/doc/manual/lists-t.texi, staden/trunk/doc/manual/results-t.texi, gap5/break_contig.tcl, gap5/configure.tcl, gap5/contig_editor.tcl, gap5/depth.tcl, gap5/dis_readings.tcl, gap5/editor_search.tcl, gap5/find_oligo.tcl, gap5/find_repeats.tcl, gap5/gap5rc_menu_full, gap5/list_contigs.tcl, gap5/list_proc.tcl, gap5/map_reads.tcl, gap5/ng_fb_cmds.tcl, gap5/qual.tcl, gap5/readpair.tcl, gap5/result_manager.tcl, gap5/search.tcl, gap5/tag_checklist.tcl, gap5/tag_editor.tcl, gap5/template_display.tcl, gap5/trace_display.tcl, tk_utils/help_netscape.tcl: Fixes to gap5 documentation. (Unsure what happened to last commit...) * gap5/export_contigs.tcl: Removed BAF output as it's unimplemented atm. * gap5/qualIO.c: Implemented get_base_confidences() function at last. 2011-01-28 jkbonfield * gap5/contig_editor.tcl: Fixed default colours for contig editor window. * gap5/ng_fb_cmds.tcl, gap5/tg_index.c, tgap/g-defs.h, tgap/g-files.c, tgap/tg_iface_g.c: Renamed Gap5 database suffixes. We now have .g5d/.g5x instead of ""/.aux. Also adjusted tg_index to generate a sensible default database name instead of g_db, named after the input filename. * gap5/gap.tcl, gap5/gap5, gap5/gap5.tcl: Renamed gap.tcl to gap5.tcl to make sprun.exe work on Windows. * gap4/tagdb.c, gap5/tagdb.c: Changed the default tagdb file to GTAGDB. Previously with GTAGDB environ unset it looked in $STADTABL/TAGDB which didn't exist, causing gap4 to die. * windows/wix/generate_wxs.pl: Added manual to the startup menu. 2011-01-27 jkbonfield * Misc/win_funcs.h, gap5/bam.c, tgap/zfio.c, tk_utils/text_output.c: Minor updates to remove warnings under Windows. * Misc/os.h, Misc/win_funcs.h: Enabled large file support when building under mingw. Tested on a 32-bit vista system, but we need to verify these defines are needed when building on a native 64bit system. * windows/wix/generate_wxs.pl: Improved handling of file associations. * gap5/tk-io-reg.c: Removed bizarre memset of regs in the tk_contig_deregister function. It was overflowing the struct and corrupting memory. 2011-01-26 jkbonfield * windows/run/main.cpp, windows/wix/README, windows/wix/banner.bmp, windows/wix/generate_wxs.pl, windows/wix/splash.bmp, windows/wix/staden.wxs, windows/wix/ui.wxi: More windows tweaks, this time for the installer. Upgraded the wix generation code to work with the latest WiX release (3.5). 2011-01-25 jkbonfield * tgap/tg_iface_g.c: Reversed earlier change to i32 data type (int to uint). It's meant to be signed due to the older range format. This was an error in the past (and has already been fixed for newer format databases), but we can't just fix the datatype to remove compiler warnings without doing more work as we introduce decoding bugs. * gap5/template_draw.h, staden_config.h.in: Report back to unix. Required inttypes.h added after the previous change from u_int32_t to uint32_t. * Misc/Makefile, Misc/getfile.c, Misc/os.h, Misc/win_funcs.c, Misc/win_funcs.h, ac_stubs/ax_lib_curses.m4, ac_stubs/ax_lib_lzma.m4, ac_stubs/ax_lib_png.m4, ac_stubs/ax_lib_zlib.m4, configure.in, copy_reads/copy_reads, gap4/IO.c, gap4/gap4, gap5/contig_editor.tcl, gap5/depth_track.c, gap5/gap5, gap5/gap5_consensus, gap5/gap5_export, gap5/template_display.c, gap5/template_draw.c, gap5/template_draw.h, gap5/tg_index, gap5/tg_view, gap5/tg_view.c, prefinish/prefinish, pregap4/pregap4, spin/spin, spin_emboss/create_emboss_files, staden_config.h.in, system.mk.in, tgap/zfio.c, tk_utils/Makefile, trev/trev: Windows port - misc and minor edits mainly. * gap5/tg_view.c: Removed incorrect cache_decr calls. 2011-01-19 jkbonfield * Misc/dstring.c, Misc/dstring.h, Misc/error.c, Misc/error.h, Misc/misc.h, Misc/vlen.c, Misc/vlen.h, gap4/gap-error.c, gap4/gap-error.h, gap4/gap_hash.c, gap4/tkEditor.c, gap5/cs-object.h, gap5/dis_readings.c, gap5/do_fij.c, gap5/fij.c, gap5/find_oligo.c, gap5/find_repeats.c, gap5/gap-error.c, gap5/gap-error.h, gap5/gap_hash.c, gap5/newgap5_cmds.c, gap5/qual.c, gap5/qualIO.c, gap5/readpair.c, gap5/tk-io-reg.c, gap5/tkEditor.c, polyA_clip/seqInfo.c, polyA_clip/seqInfo.h, qclip/seqInfo.c, qclip/seqInfo.h, text_utils/text_output.h, text_utils/text_output_stubs.c, tk_utils/tcl_utils.c, tk_utils/tcl_utils.h, tk_utils/text_output.c, tk_utils/text_output.h: Added gcc printf format checking via __attribute__ (if using gcc). This spotted a myriad of minor bugs (mostly in error handling code), even including some 10+ years old. Now fixed. 2011-01-18 jkbonfield * gap5/bam.c, gap5/bam.h, gap5/sam_index.c, gap5/sam_pileup.c, tgap/tg_iface_g.c: Minor signed vs unsigned changes to prevent compiler warnings. * ac_stubs/ax_lib_staden_io_lib.m4: Extra checks for header files, incase we have io_lib-config but no headers installed * gap5/bam.c: Bug fixed endianness reversal code after testing on a PowerPC iMac. * tgap/g-files.c: Rearranged code to remove (incorrect?) gcc warning on gcc 3.3 2011-01-17 jkbonfield * gap5/dis_readings.c: Bug fix to disassemble readings with the "remove reads from database" option. The order of this is critical to not produce errors and abort early, which it was doing. Also since the addition of a proper bin removal system the r->rec == s->rec assert could be hit; we now only perform this section if the bin index hasn't already been updated to be BIN_RANGE_UNUSED. * gap5/assemble_single.tcl, gap5/gap5rc, gap5/gap5rc_menu_full, gap5/newgap5_cmds.c, gap5/tclIndex: Added a basic GUI to support import of fasta/fastq files (equiv to tg_index -a foo.fasta). * gap5/fasta.c: Bug fix to fasta parsing * gap5/fasta.c: Bug fix to fasta parsing 2011-01-14 jkbonfield * seq_utils/sequence_formats.h: Fixed potential single byte buffer overflow in parse_feat(). On all mainstream platforms the single byte coincides with structure padding so it had nil effect anyway. * gap5/Makefile, gap5/fasta.c, gap5/tg_index.c, gap5/tg_index_common.c, tgap/zfio.c, tgap/zfio.h: Added fasta and fastq reading code to tg_index. It just creates single read contigs, but this can be useful for pulling in consensus sequences or a few finishing reads with the aim to then searches for matches within gap5. * Misc/misc.h, convert/gapDB.c, convert/list.h, copy_reads/copy_reads.c, eba/qual.c, gap4/assemble_direct.c, gap4/clones.c, gap4/oligo.c, gap4/shuffle_pads.c, gap4/tman_cons.c, gap4/tman_diff.c, gap4/tman_interface.c, gap5/ace.c, gap5/bam.c, gap5/editor_join.c, gap5/editor_search.c, gap5/find_oligo.c, gap5/import_gff.c, gap5/readpair.c, gap5/sam_index.c, gap5/tg_index.c, gap5/tg_index_common.c, gap5/tman_interface.c, get_scf_field/get_scf_field.c, haplo/haplo_snps.c, hetins/hetins.c, make_weights/make_weights.c, prefinish/finish_pcr.c, primer3/src/dpal.c, primer3/src/primer3_lib.c, screen_seq/screen_seq.c, seq_utils/align_lib.c, seq_utils/filter_words.c, seq_utils/renz_utils.c, spin/nip_splice_search.c, spin/seq_plot_funcs.c, spin/seq_raster.c, spin/seqed_write.c, spin/sim.c, spin/sip_find_identity.c, spin/splice_search.c, spin/tkSeqed.c, spin/trna_search.c, stops/stops.c, tgap/g-alloc.c, tgap/tg_anno.c, tgap/tg_bin.c, tgap/tg_cache.c, tgap/tg_contig.c, tgap/tg_sequence.c, vector_clip/vector_clip.c: Many updates to fix gcc warnings. - Removal of type punned casts to resolve strict aliasing problems. - Initialising more variables to avoid "may be used uninitialised" warnings. Note most of these are invalid gcc warnings, but a few cases are real when faced with invalid data or abnormal errors. * gap5/export_contigs.c: Bug fix to export SAM format. When outputting aux fields (if stored in gap5) we were missing a tab before the first aux record. * convert/main.c: Bug fix to rev 2344: replacing gets by fgets isn't the whole story. I now also remove the \n which is left in by fgets but removed by gets. 2011-01-13 jkbonfield * gap4/confidence_graph.c, gap4/gap-error.c, gap5/gap-error.c, prefinish/finish_hash.c, tgap/tg_cache.c: More minor warning removal - mostly around string literals. * convert/main.c: Replaced use of gets by fgets. Not that it matters much in such old code, but I'm on a roll with warning removal. * Misc/parse_db.c, seq_utils/align_lib.c: Added initialisations to variables to remove compiler warnings about "may be used uninitialised". The compiler is wrong, but this keeps things happy. * Misc/misc.h, Misc/vlen.c, Misc/vlen.h, mutlib/sp_align_lib.cpp, text_utils/text_output.h, tgap/misc.h, tk_utils/misc.c, tk_utils/text_output.c, tk_utils/text_output.h: Added const to various functions. By no means is this all, but it's the ones we're passing string constants into, eg vmessage("foobar"), which with gcc 4.5 now emits warnings about removing const from string literal. * Misc/Makefile, copy_reads/Makefile, gap4/Makefile, gap5/Makefile, polyA_clip/Makefile, prefinish/Makefile, spin/Makefile, tgap/Makefile, tk_utils/Makefile: Updates from 'make depend' 2011-01-12 jkbonfield * seq_utils/filter_words.c: Fixed potential (but rare) buffer overflow * mutlib/tracealign_helper.cpp: Fixed transposed memset arguments (thank you gcc!) 2011-01-07 jkbonfield * tk_utils/user_defaults.tcl: Fix to make this work on MacOS X. I'm not sure on the cause of bdir not ending in a /, but by ensuring it is so we now find the libraries correctly. * configure.in: Bug fix to previous itcl* changes * README.build, configure.in: Made itcl/itk/iwidgets optional * tk_utils/xcombobox.tcl: Added -command option for ttk::combobox version * spin/comborange.tcl: Bugfix with xcombobox -text vs -label * spin/nip_translation.tcl: Removal of debugging info * spin_emboss/acd2tcl.tcl, spin_emboss/acdtcl/aaindexextract.acd, spin_emboss/acdtcl/abiview.acd, spin_emboss/acdtcl/ajbad.acd, spin_emboss/acdtcl/ajfeatest.acd, spin_emboss/acdtcl/ajtest.acd, spin_emboss/acdtcl/antigenic.acd, spin_emboss/acdtcl/backtranseq.acd, spin_emboss/acdtcl/banana.acd, spin_emboss/acdtcl/biosed.acd, spin_emboss/acdtcl/btwisted.acd, spin_emboss/acdtcl/cai.acd, spin_emboss/acdtcl/chaos.acd, spin_emboss/acdtcl/charge.acd, spin_emboss/acdtcl/checktrans.acd, spin_emboss/acdtcl/chips.acd, spin_emboss/acdtcl/cirdna.acd, spin_emboss/acdtcl/codcmp.acd, spin_emboss/acdtcl/coderet.acd, spin_emboss/acdtcl/complex.acd, spin_emboss/acdtcl/compseq.acd, spin_emboss/acdtcl/cons.acd, spin_emboss/acdtcl/contacts.acd, spin_emboss/acdtcl/corbatest.acd, spin_emboss/acdtcl/cpgplot.acd, spin_emboss/acdtcl/cpgreport.acd, spin_emboss/acdtcl/cusp.acd, spin_emboss/acdtcl/cutgextract.acd, spin_emboss/acdtcl/cutseq.acd, spin_emboss/acdtcl/dan.acd, spin_emboss/acdtcl/dbiblast.acd, spin_emboss/acdtcl/dbifasta.acd, spin_emboss/acdtcl/dbiflat.acd, spin_emboss/acdtcl/dbigcg.acd, spin_emboss/acdtcl/degapseq.acd, spin_emboss/acdtcl/demoalign.acd, spin_emboss/acdtcl/demofeatures.acd, spin_emboss/acdtcl/demolist.acd, spin_emboss/acdtcl/demoreport.acd, spin_emboss/acdtcl/demosequence.acd, spin_emboss/acdtcl/demostring.acd, spin_emboss/acdtcl/demotable.acd, spin_emboss/acdtcl/descseq.acd, spin_emboss/acdtcl/diffseq.acd, spin_emboss/acdtcl/digest.acd, spin_emboss/acdtcl/distmat.acd, spin_emboss/acdtcl/domainer.acd, spin_emboss/acdtcl/dotmatcher.acd, spin_emboss/acdtcl/dotpath.acd, spin_emboss/acdtcl/dottup.acd, spin_emboss/acdtcl/dreg.acd, spin_emboss/acdtcl/einverted.acd, spin_emboss/acdtcl/embossdata.acd, spin_emboss/acdtcl/embossversion.acd, spin_emboss/acdtcl/emma.acd, spin_emboss/acdtcl/emowse.acd, spin_emboss/acdtcl/entrails.acd, spin_emboss/acdtcl/entret.acd, spin_emboss/acdtcl/epestfind.acd, spin_emboss/acdtcl/eprimer3.acd, spin_emboss/acdtcl/equicktandem.acd, spin_emboss/acdtcl/est2genome.acd, spin_emboss/acdtcl/etandem.acd, spin_emboss/acdtcl/extractfeat.acd, spin_emboss/acdtcl/extractseq.acd, spin_emboss/acdtcl/findkm.acd, spin_emboss/acdtcl/fraggle.acd, spin_emboss/acdtcl/freak.acd, spin_emboss/acdtcl/funky.acd, spin_emboss/acdtcl/fuzznuc.acd, spin_emboss/acdtcl/fuzzpro.acd, spin_emboss/acdtcl/fuzztran.acd, spin_emboss/acdtcl/garnier.acd, spin_emboss/acdtcl/geecee.acd, spin_emboss/acdtcl/getorf.acd, spin_emboss/acdtcl/helixturnhelix.acd, spin_emboss/acdtcl/hetparse.acd, spin_emboss/acdtcl/histogramtest.acd, spin_emboss/acdtcl/hmmgen.acd, spin_emboss/acdtcl/hmoment.acd, spin_emboss/acdtcl/iep.acd, spin_emboss/acdtcl/infoalign.acd, spin_emboss/acdtcl/infoseq.acd, spin_emboss/acdtcl/interface.acd, spin_emboss/acdtcl/isochore.acd, spin_emboss/acdtcl/lindna.acd, spin_emboss/acdtcl/listor.acd, spin_emboss/acdtcl/marscan.acd, spin_emboss/acdtcl/maskfeat.acd, spin_emboss/acdtcl/maskseq.acd, spin_emboss/acdtcl/matcher.acd, spin_emboss/acdtcl/megamerger.acd, spin_emboss/acdtcl/merger.acd, spin_emboss/acdtcl/msbar.acd, spin_emboss/acdtcl/mwcontam.acd, spin_emboss/acdtcl/mwfilter.acd, spin_emboss/acdtcl/needle.acd, spin_emboss/acdtcl/newcoils.acd, spin_emboss/acdtcl/newcpgreport.acd, spin_emboss/acdtcl/newcpgseek.acd, spin_emboss/acdtcl/newseq.acd, spin_emboss/acdtcl/noreturn.acd, spin_emboss/acdtcl/notseq.acd, spin_emboss/acdtcl/nthseq.acd, spin_emboss/acdtcl/octanol.acd, spin_emboss/acdtcl/oddcomp.acd, spin_emboss/acdtcl/palindrome.acd, spin_emboss/acdtcl/pasteseq.acd, spin_emboss/acdtcl/patmatdb.acd, spin_emboss/acdtcl/patmatmotifs.acd, spin_emboss/acdtcl/patmattest.acd, spin_emboss/acdtcl/pdbparse.acd, spin_emboss/acdtcl/pdbtosp.acd, spin_emboss/acdtcl/pepcoil.acd, spin_emboss/acdtcl/pepinfo.acd, spin_emboss/acdtcl/pepnet.acd, spin_emboss/acdtcl/pepstats.acd, spin_emboss/acdtcl/pepwheel.acd, spin_emboss/acdtcl/pepwindow.acd, spin_emboss/acdtcl/pepwindowall.acd, spin_emboss/acdtcl/plotcon.acd, spin_emboss/acdtcl/plotorf.acd, spin_emboss/acdtcl/polydot.acd, spin_emboss/acdtcl/preg.acd, spin_emboss/acdtcl/prettyplot.acd, spin_emboss/acdtcl/prettyseq.acd, spin_emboss/acdtcl/prima.acd, spin_emboss/acdtcl/primers.acd, spin_emboss/acdtcl/primersearch.acd, spin_emboss/acdtcl/printsextract.acd, spin_emboss/acdtcl/profgen.acd, spin_emboss/acdtcl/profit.acd, spin_emboss/acdtcl/prophecy.acd, spin_emboss/acdtcl/prophet.acd, spin_emboss/acdtcl/prosextract.acd, spin_emboss/acdtcl/pscan.acd, spin_emboss/acdtcl/qatest.acd, spin_emboss/acdtcl/qatestcalcfeat.acd, spin_emboss/acdtcl/qatestcalcregexp.acd, spin_emboss/acdtcl/qatestcalcseq.acd, spin_emboss/acdtcl/qatestcalcseqall.acd, spin_emboss/acdtcl/qatestcalcseqset.acd, spin_emboss/acdtcl/qatestcalcstring.acd, spin_emboss/acdtcl/rebaseextract.acd, spin_emboss/acdtcl/recoder.acd, spin_emboss/acdtcl/redata.acd, spin_emboss/acdtcl/remap.acd, spin_emboss/acdtcl/restover.acd, spin_emboss/acdtcl/restrict.acd, spin_emboss/acdtcl/revseq.acd, spin_emboss/acdtcl/scopalign.acd, spin_emboss/acdtcl/scopnr.acd, spin_emboss/acdtcl/scopparse.acd, spin_emboss/acdtcl/scoprep.acd, spin_emboss/acdtcl/scopreso.acd, spin_emboss/acdtcl/scopseqs.acd, spin_emboss/acdtcl/seealso.acd, spin_emboss/acdtcl/seqalign.acd, spin_emboss/acdtcl/seqinfo.acd, spin_emboss/acdtcl/seqmatchall.acd, spin_emboss/acdtcl/seqnr.acd, spin_emboss/acdtcl/seqret.acd, spin_emboss/acdtcl/seqretall.acd, spin_emboss/acdtcl/seqretallfeat.acd, spin_emboss/acdtcl/seqretset.acd, spin_emboss/acdtcl/seqretsingle.acd, spin_emboss/acdtcl/seqretsplit.acd, spin_emboss/acdtcl/seqrettype.acd, spin_emboss/acdtcl/seqsearch.acd, spin_emboss/acdtcl/seqsort.acd, spin_emboss/acdtcl/seqwords.acd, spin_emboss/acdtcl/showalign.acd, spin_emboss/acdtcl/showdb.acd, spin_emboss/acdtcl/showfeat.acd, spin_emboss/acdtcl/showorf.acd, spin_emboss/acdtcl/showseq.acd, spin_emboss/acdtcl/shuffleseq.acd, spin_emboss/acdtcl/sigcleave.acd, spin_emboss/acdtcl/siggen.acd, spin_emboss/acdtcl/sigplot.acd, spin_emboss/acdtcl/sigscan.acd, spin_emboss/acdtcl/silent.acd, spin_emboss/acdtcl/sirna.acd, spin_emboss/acdtcl/sixpack.acd, spin_emboss/acdtcl/skipseq.acd, spin_emboss/acdtcl/splitter.acd, spin_emboss/acdtcl/stretcher.acd, spin_emboss/acdtcl/stssearch.acd, spin_emboss/acdtcl/supermatcher.acd, spin_emboss/acdtcl/syco.acd, spin_emboss/acdtcl/tclIndex, spin_emboss/acdtcl/tcode.acd, spin_emboss/acdtcl/testplot.acd, spin_emboss/acdtcl/textsearch.acd, spin_emboss/acdtcl/tfextract.acd, spin_emboss/acdtcl/tfm.acd, spin_emboss/acdtcl/tfscan.acd, spin_emboss/acdtcl/tmap.acd, spin_emboss/acdtcl/tranalign.acd, spin_emboss/acdtcl/transeq.acd, spin_emboss/acdtcl/treetypedisplay.acd, spin_emboss/acdtcl/trimest.acd, spin_emboss/acdtcl/trimseq.acd, spin_emboss/acdtcl/twofeat.acd, spin_emboss/acdtcl/union.acd, spin_emboss/acdtcl/vectorstrip.acd, spin_emboss/acdtcl/water.acd, spin_emboss/acdtcl/whichdb.acd, spin_emboss/acdtcl/wobble.acd, spin_emboss/acdtcl/wordcount.acd, spin_emboss/acdtcl/wordmatch.acd, spin_emboss/acdtcl/wossname.acd, spin_emboss/acdtcl/yank.acd, spin_emboss/create_emboss_files.tcl, spin_emboss/tclIndex: Removed the Tcl generated from .acd files and instead made the tclIndex auto-generate them as needed. The create_emboss_files program may still be used to create and save them though if desired. 2011-01-07 awhitwham * gap5/sam_index.c: Removed line causing double free. 2011-01-06 jkbonfield * gap4/gap_prefinish.tcl: Added a error window to cope with Iwidgets package possibly being absent. When it is absent, we simply warn the user that the prefinish GUI is unavailable. This is a reasonable alternative to completely rewriting it to avoid itcl (which is non-trivial). * gap4/tag_editor.tcl: Removal of debugging output * gap4/acd2tag.tcl, gap5/contig_editor.tcl, spin/comborange.tcl, spin_emboss/acd2tcl.tcl, spin_emboss/emboss_utils.tcl, tk_utils/tclIndex, tk_utils/xcombo.tcl, tk_utils/xcombobox.tcl: Replaced a hacky xcombo with a proper mega-widget implementation of xcombobox, which uses either native tk 8.4 or the ttk::combobox from tk8.5. Rewrote the acd2tcl (and derived acd2tag) code to remove all iwidgets uses. 2011-01-05 jkbonfield * pregap4/gui.tcl, pregap4/pregap4.tcl, spin/Makefile, spin/comborange.itk, spin/comborange.tcl, spin/dataentry.itk, spin/dataentry.tcl, spin/nip_translation.tcl, spin/nip_trna_search.c, spin/orientedradiobox.itk, spin/radioboxn.itk, spin/seq_id.tcl, spin/seqentry.tcl, spin/sequence_manager.tcl, spin/sip_similar_spans.tcl, spin/spin.tcl, spin/spinrange.itk, spin/spinrc, spin/tclIndex, spin/twinnedrange.itk: Removal of itcl/itk/iwidgets dependencies for pregap4 and spin. Tested on Tcl8.4, but if 8.5 is present we'll use some of those ttk widgets in preference (specifically ttk:notebook for now). * tk_utils/init.tcl, tk_utils/tabnotebook.tcl, tk_utils/tclIndex, tk_utils/xcombo.tcl, tk_utils/xentry.tcl, tk_utils/xfilebrowser.tcl, tk_utils/xget_fname.tcl, tk_utils/xradiobox.tcl, tk_utils/xscrolledlistbox.tcl, tk_utils/xscrolledtext.tcl, tk_utils/xspinbox.tcl, tk_utils/xtwinspin.tcl: Added various new mega-widgets and tweaked existing ones. This is part of a larger goal to totally remove any dependency on incrtcl, incrtk and incrwidgets. * tk_utils/tk_utilsrc: Minor font changes for MacOS X * gap5/depth.tcl: Use canvas "-dash -.." instead of the numeric equivalent "-dash {6 4 2 4 2 4}". I've no idea why this matters, but it fixes a crash in the MacOS Tk implementation (or X libraries?). * tgap/tg_iface_g.c: Improved handling of HAVE_LIBLZMA macro for when lzma isn't found by autoconf * copy_reads/copy_reads.c, gap4/init.c, gap5/init.c, haplo/haplo_tcl.c, prefinish/finish.c, spin/seq_reg_cmds.c, tgap/tg_tcl.c, tk_utils/init.c: Added Unload and SafeUnload tcl init functions. These aren't used by our code, but Tcl looks for them on load and the MacOS X symbol table querying library seems to spit out unsightly error messages. 2010-12-16 jkbonfield * gap5/cs-object.h: Bug fixed FIJ. After adding find read pairs I chanegd the size of some structures, but forgot to make obj_fij the same size. I should be using a union instead, but it's nastily coded with casting (supposedly) compatible data structs. 2010-12-15 awhitwham * find_renz/Makefile, gap4/Makefile: Added explicit io_lib links for Centos compilation. * make_weights/Makefile: Added an explicit link to io_lib. Centos-5.5 seems to prefer it this way. * gap5/caf.c: Cosmetic file changes. 2010-12-13 awhitwham * gap5/tg_index_common.c, gap5/tg_index_common.h: Replaced the useful, but non-standard, getline with one of my own making. 2010-12-09 awhitwham * Misc/string_alloc.c: Removed the size limitations to make it more flexible. 2010-12-08 awhitwham * gap5/ace.c, gap5/baf.c, gap5/caf.c, gap5/maq.c, gap5/sam_index.c, gap5/tg_index.c, gap5/tg_index.h, gap5/tg_index_common.c, gap5/tg_index_common.h: Added a -q option to tg_index to limit the amount of unpaired reads held in memory. This should significantly reduce the memory usage of tg_index at the cost of longer running times. * tgap/hache_table.c, tgap/hache_table.h: Added a table empty function to remove all data but keep the data structures in place. 2010-12-02 jkbonfield * gap4/gap-tcl.c: Added io_read_array and io_write_array Tcl commands. These also copy to the internal cached copies of arrays if the record number matches. The purpose is to ease implementation of code to reorder contigs at the scripting level. 2010-12-01 jkbonfield * tgap/tg_bin.c, tgap/tg_cache.c, tgap/tg_gio.h: Removed a reference count leak (which looks like a memory leak, but isn't traceable by valgrind) in the bin_for_range() function. Also added extra cache leak detection code. This can be enabled by adding -DCACHE_REF_DEBUG to the CFLAGS in system.mk and recompiling everything. * gap5/sam_index.c, gap5/sam_pileup.c, gap5/tg_index_common.c: Various minor memory leaks fixed 2010-11-30 jkbonfield * gap5/tg_index.c: Added a cache_flush call while indexing read names. This resolves excessive memory using during tg_index -t on large data sets. 2010-11-29 jkbonfield * gap5/cs-object.h, gap5/gap5rc, gap5/newgap5_cmds.c, gap5/newgap_structs.h, gap5/readpair.c, gap5/readpair.h, gap5/readpair.tcl: Added a minimum mapping quality filter to the Find Read Pairs plot. 2010-11-29 awhitwham * gap4/newgap_cmds.c: Removed header include. 2010-11-29 jkbonfield * gap5/bam.c, gap5/bam.h: Forgot to add these with previous commit. Reimplementation of portions of samtools library for use in new pileup code.s 2010-11-26 jkbonfield * gap5/editor_view.c: When displaying tags we now draw a box around bases that have multiple tags on them, so it's visually obvious there is more information available than the top-most one being displayed. * gap5/caf.c, gap5/export_contigs.c, tgap/tg_library.c, tgap/tg_library.h: Improvements to the CAF import and export. - We now use the CAF Ligation_no line (or Insert_size if not present) to generate a library for each sequence record. These records get output again too when using export sequences. - The library handling code has been improved to automatically compute mean and standard deviations. - On export, "-" now gets converted to "N" correctly instead of being interpreted as a pad. - Now exports consensus tags too. 2010-11-25 jkbonfield * gap5/contig_editor.tcl: 3 minor changes to the contig editor. - We now create primer tags with the oligo name earlier in the tag and the sequence later. This helps the editor status line contain more useful information. - The editor status line now replaces multiple spaces and tabs with a single space, in order to reduce horizontal space. It also no longer lists newlines as "\n" but "//" instead, hoping that this is more indicative of a break in data that an escaped newline symbol. - Names are cut (for pasting) with the left mouse button now as well as the middle. * gap5/tg_index.c: Made name indexing the default now; use -T to disable. * tgap/tg_bin.c: Fixed a bug in the adding items to bins. The delayed increment of the number of sequences in a bin could corrupt memory and/or crash if the cached last_bin value pointed to a bin object which has been purged from the cache. Rather than increment the reference count to block this, we now just cache the record number and look up the bin as and when needed. * tgap/tg_tcl.c: Fixed library insert size data - previously we were dividing by 100, but this was a misunderstanding between in-memory and on-disk formats. * gap4/dbcheck.c: Grammar fix in error message 2010-11-24 jkbonfield * gap4/newgap_cmds.c, gap5/Makefile, gap5/gap5rc, gap5/gap5rc_menu_full, gap5/newgap5_cmds.c, gap5/newgap_structs.h, gap5/readpair.c, gap5/readpair.h, gap5/readpair.tcl: Added "Find Read Pairs" first draft. This supports plotting read-pairs using all vs all, all vs end and end vs end search modes. * gap5/contig_editor.tcl: Fixed a bug with highlighting reading names when we start making the selection from outside a reading name. * gap5/consensus.c: Removed small memory leak 2010-11-19 jkbonfield * gap5/sam_pileup.c: Append new sequences to the end of the pileup list instead of the start, effectively reversing the order of data within columns. This now means we add data in the same order as the old tg_index and the same order as viewed within samtools tview. * gap4/GTAGDB, gap5/import_gff.c: Bug fix to gap5 import_gff function. Added generic GFF tags for lines with "colour=<0-17>" to match up with those used in Artemis. 2010-11-18 jkbonfield * configure.in, gap5/Makefile, gap5/docs/TODO, gap5/newgap5_cmds.c, gap5/sam_index.c, gap5/sam_index.h, gap5/sam_index2.c, gap5/sam_pileup.c, gap5/sam_pileup.h, gap5/tg_index.c, staden_config.h.in, system.mk.in: Major update of bam/sam reading code. We no longer have any dependency on the samtools package, instead rewriting the bam/sam reading code and the pileup code ourselves. This has several consequences. - BAM/SAM reading should be slightly faster in most cases, and considerably faster in highly padded regions. - Cases of deletions immediately following insertions in CIGAR strings will now produce the correct alignments. - No need for --with-samtools in configure scripts and the need to recompile samtools with -fPIC. - Support for gzipped SAM files. * gap5/depad_seq_tree.c: Bug fix in get_padded_coord(). When asking for a coordinate beyond the last pad we were just returning the unpadded value rather than the using the unpadded distance since the last known pad. 2010-11-16 jkbonfield * gap5/sam_pileup.c: Minor reformatting of append_int() 2010-10-29 jkbonfield * tgap/tg_iface_g.c: Improved error checking to handle cases of running out of disk space. We make sure we never flush any changes like this now, instead either reporting an error or just plain aborting. (Not ideal, but 100% better than corrupting the database.) 2010-10-28 jkbonfield * gap5/sam_index2.c, gap5/sam_pileup.c, gap5/sam_pileup.h: A work in progress and currently not linked in. These implement an alternative pileup interface to using samtool's own pileup code. It's both faster and less buggy (it handles neighbouring insertions and deletions), but also less complete at current in that it doesn't deal with tg_index -g. * gap4/auto_break.c, gap4/find_oligo.c, gap4/join.c, gap5/break_contig.c, gap5/caf.c, gap5/consensus.c, gap5/contig_selector.c, gap5/dis_readings.c, gap5/editor_join.c, gap5/export_contigs.c, gap5/find_oligo.c, gap5/import_gff.c, gap5/qual.c, gap5/template_draw.c, gap5/tg_index_common.c, gap5/tman_interface.c, primer3/src/oligotm.c, spin/seq_plot_funcs.c, tgap/g-request.c, tgap/tg_contig.c, tgap/tg_register.c, tgap/tg_tcl.c, tk_utils/tkTraceDisp.c: More code tidy ups: appropriately dealt with unused variables and functions. * configure.in, gap5/docs/TODO, gap5/gap.tcl, gap5/tg_index.c, gap5/tg_view.c: Various updates preparing for new release - version number changes and the like. * gap4/edUtils2.c, gap5/editor_join.c, gap5/editor_search.c, gap5/tkEditor.c, gap5/tman_display.c, gap5/tman_interface.c, polyA_clip/seqInfo.c, seq_utils/align_sv.c, seq_utils/dna_utils.c, seq_utils/genetic_code.c, spin/init.c, spin/seqed.c, spin/seqed_restriction_enzymes.c, spin/seqed_search.c, spin/seqed_translate.c, spin/seqed_write.c, spin/tkSeqed.c, spin/tkSeqedNames.c, spin/tkSeqedUtils.c, tgap/tg_iface.h, tgap/tg_library.c, tgap/tg_tcl.c, tk_utils/sheet.c, tk_utils/tkSheet.c: Remove various (harmless) compiler warnings. 2010-10-27 jkbonfield * ChangeLog, NEWS: Preparation for 2.0.0b8 (internal test version) * gap5/baf.c, gap5/caf.c, gap5/consensus.c, gap5/dis_readings.c, gap5/import_gff.c, gap5/sam_index.c, gap5/tg_index.c, gap5/tg_index_common.c, tgap/tg_anno.c, tgap/tg_bin.c, tgap/tg_bin.h, tgap/tg_sequence.c, tgap/tg_tcl.c: bin_add_range() now has the option of grouping up calls to bin_incr_nseq to increment once for all items in the bin rather than once for every item. This dramatically reduces the number of calls to bin_incr_nseq, sometimes speeding up import by 10% or so. 2010-10-25 jkbonfield * gap5/tg_index.c, tgap/tg_iface_g.c: Added -1 to -9 parameters to tg_index to allow manual control over the compression levels used. * tgap/hache_table.h: Remove external prototypes for Hache* functions. * tgap/hache_table.c: Optimisation of the hashing code for keys of length 16. These are the dominant keys in Gap5 due to cache_serch and cache_key_t. Also made the hash functions static to permit better inlining. * tgap/g-request.c: Consider record 0 to be non-free as well as G_NO_REC. Fixes data corruption where free_record could become 0 and then cause overwrite of the GDatabase record. * gap5/editor_view.c: Protect against regions of zero depth in edview_row_for_item(). This function previously crashed. 2010-10-19 jkbonfield * tgap/tg_iface_g.c: Added assertions to block attempts to write to record 0 (which should only ever be a GDatabase record). * gap5/fast2sam: * gap5/docs/UNPADDED, gap5/docs/wishlist.txt: Added missing docs * README.fedora8, README.macosx, staden.login: Added inconsequential missing files. (Not for distrib, just svn purposes.) * tgap/tg_iface_g.c: 32-bit vs 64-bit fix for bin ranges. 2010-10-07 awhitwham * gap4/notedb.h, gap4/tagdb.h, gap5/notedb.h, gap5/tagdb.h, seqed/feature_colour.h, seqed/tagdb.h, spin2/feature_selector.h, tk_utils/intrinsic_type.h, tk_utils/sheet.h: Removed dependency on Xintrinsic.h. Use local definitions now. 2010-10-07 jkbonfield * gap5/gap.tcl: Correct "gap5 -h" output. 2010-10-05 awhitwham * convert/Makefile, gap5/Makefile, prefinish/Makefile: Added io_lib to required libraries to correct Centos5.5 compilation problems. 2010-09-30 jkbonfield * system.mk.in: Move placement of ${DESTDIR} so that manual override of e.g. --mandir after specifying --prefix still works. 2010-09-21 awhitwham * tgap/tg_struct.h: Removed old struct. 2010-09-15 awhitwham * gap5/depth.tcl: Added invoke editor from depth track. * gap5/caf.c: Changed to improve speed and memory use on large files. * Misc/Makefile, Misc/string_alloc.c, Misc/string_alloc.h: Added pooled string allocation. 2010-09-14 jkbonfield * tgap/tg_iface_g.c: Bug fix when reading old data. (Technically working around an old bug.) The range record deltas were previously stored as uint32_t, meaning some were written out as, say, 4294967291 instead of -5. We should have been using int2s7/s72int instead of int2u7/u72int. However it didn't matter (except for size of storage) as the unsigned value was written into the address of a signed 32-bit int and it worked anyway. Now we load as 64-bit we obtain the full glory of a large integer. Fixed by changing the temporary data type I load into. 2010-09-13 jkbonfield * gap5/contig_editor.tcl, gap5/list_proc.tcl, gap5/tk-io-reg.c: Allow HIGHLIGHT_READ to be a contig_notify option from Tcl. We use this now as a generic notification, to contig 0, that something somewhere has changed highlight. The targetted approach still works via reg_highlight_read, but we're using the new call instead to avoid spamming potentially thousands of events when we load a new readings list or hit the Clear button. * gap5/docs/DONE, gap5/docs/TODO, gap5/editor_view.c: Fixed a bug in the highlight and selection of reads in the EdName panel. The coordinate handling differed slightly between querying the read under the cursor and the drawing code, meaning we sometimes couldn't select what we thought was visible. * gap5/contig_editor.tcl: Removal of debugging output. * gap5/docs/DONE, tgap/tg_cache.c: Fixed, I hope, a reference counting problem. When running cache_rw on a child io cache for an item which is blocked (ie seq or anno), the first time through we create a new (eg) SeqBlock record. Subsuquent cache_rw on other sequences within the same block were not updating the reference count on the cache_master object, but cache_decr did still want to decrememnt them. This shows up as an assertion failure if you try to edit two neighbouring sequences (I tried adjusting clip points, but I expect it happens with other edits too). * gap5/contig_editor.tcl, gap5/docs/TODO, gap5/editor_view.c, gap5/list_proc.tcl, gap5/tkEditor.c, gap5/tkEditor.h, tgap/tg_iface_g.c: First stab at implementing the "readings" list. The contig editor can (de)select members on this list as well as view them. It's not perfect yet though as the list holds reading numbers instead of names. Also moved the <> editor-names binding for copying sequence names to middle click <2> instead. * tgap/tg_cache.c, tgap/tg_gio.h, tgap/tg_iface.h, tgap/tg_tcl.c: Added both C and Tcl interfaces to check whether a record exists with the given type. This allows the higher level layers of Gap5 to check validity of user input without triggering the low level asserts in tg_iface_g.c. See cache_exists() in C and $io rec_exists in Tcl. * tk_utils/sheet.c, tk_utils/sheet.h: Added a new sh_box mode (and sh_box_alt). As expected, these draw a box around a group of characters. The sh_box_alt exists to allow two boxes concatenated together; the display modes are identical, but the toggle from sh_box to sh_box_alt forces the end of one style and the start of a new one. * gap5/list_proc.c, gap5/list_proc.h: Removal of dead code - FORTRAN interfaces! 2010-09-10 jkbonfield * tgap/tg_iface_g.c: Protect against tg_rec being large when encoding bin ranges. The previous worst-case malloc of 5 bytes per record id has been upped to 10 to permit full 64-bit data (ceil(64/7)). 2010-09-09 jkbonfield * tgap/tg_iface_g.c: Fixed a bug with the 64-bit tg_rec code. When reading a database in the older formats with 32-bit records, we were only filling out the bottom 32-bits of the record ID leaving the top 32-bits undefined. * gap5/editor_search.c, tgap/b+tree2.c, tgap/b+tree2.h, tgap/tg_contig.c, tgap/tg_contig.h, tgap/tg_iface.h, tgap/tg_iface_g.c, tgap/tg_sequence.c, tgap/tg_sequence.h: Editor searching by sequence name now accepts a prefix match. This required an extra parameter to the b+tree search code. Also the mechanism of searching is now different as we search both through a list of names pulled out of the btree (finding the closest one in the direction we search) and also using a positional iterator on the contig. This resolves issues where we may have 10,000 sequences matching a prefix string, but only 5 sequences away is the first occurence of this so a linear scan would have found the match faster. (Potentially we could modify this to allow searching by names even if no name index exists, albeit at a time cost.) 2010-09-08 jkbonfield * abi/Makefile, eba/Makefile, gap5/Makefile, gap5/ace.c, gap5/baf.c, gap5/break_contig.c, gap5/break_contig.h, gap5/caf.c, gap5/consen.c, gap5/consen.h, gap5/consensus.c, gap5/consensus.h, gap5/contig_selector.c, gap5/contig_selector.h, gap5/cs-object.c, gap5/cs-object.h, gap5/depad_seq_tree.c, gap5/depad_seq_tree.h, gap5/dis_readings.c, gap5/dis_readings.h, gap5/do_fij.c, gap5/docs/TODO, gap5/editor_join.c, gap5/editor_oligo.c, gap5/editor_search.c, gap5/editor_view.c, gap5/editor_view.h, gap5/export_contigs.c, gap5/fij.c, gap5/find_oligo.c, gap5/find_repeats.c, gap5/gap4_compat.c, gap5/gap4_compat.h, gap5/gap_cli_arg.h, gap5/gap_range.c, gap5/gap_range.h, gap5/import_gff.c, gap5/io-reg.h, gap5/io_utils.h, gap5/list_proc.c, gap5/list_proc.h, gap5/maq.c, gap5/newgap5_cmds.c, gap5/newgap_structs.h, gap5/primlib.c, gap5/qual.c, gap5/qual.h, gap5/qualIO.c, gap5/qualIO.h, gap5/read_depth.c, gap5/read_depth.h, gap5/sam_index.c, gap5/template_draw.h, gap5/tg_index.c, gap5/tg_index.h, gap5/tg_index_common.c, gap5/tg_index_common.h, gap5/tg_view.c, gap5/tk-io-reg.c, gap5/tkEdNames.c, gap5/tkEditor.c, gap5/tman_interface.c, gap5/tman_interface.h, get_scf_field/Makefile, init_exp/Makefile, polyA_clip/Makefile, qclip/Makefile, spin/Makefile, stops/Makefile, tgap/Makefile, tgap/b+tree2.c, tgap/b+tree2.h, tgap/g-request.c, tgap/gap_cli_arg.c, tgap/gap_cli_arg.h, tgap/tg_anno.c, tgap/tg_anno.h, tgap/tg_bin.c, tgap/tg_bin.h, tgap/tg_cache.c, tgap/tg_cache_item.h, tgap/tg_contig.c, tgap/tg_contig.h, tgap/tg_gio.c, tgap/tg_gio.h, tgap/tg_iface.h, tgap/tg_iface_g.c, tgap/tg_iface_g.h, tgap/tg_library.c, tgap/tg_library.h, tgap/tg_register.c, tgap/tg_register.h, tgap/tg_sequence.c, tgap/tg_sequence.h, tgap/tg_struct.h, tgap/tg_tcl.c, tgap/tg_tracks.c, tgap/tg_utils.c, tgap/tg_utils.h, tk_utils/Makefile, tracediff/Makefile: MAJOR overhaul of record numbers. We now must use tg_rec throughout all the code as the data type for record numbers instead of int or GRec. GRec still exists, but it should only be within the tgap/g-* code and tgap/tg_iface_g.c interface. Basically GRec is the data type for the underlying "g" library, which is still 32-bit, while tg_rec is used throughout gap5 proper for records. The purpose of this is: A) Allow for more sequence record numbers. The given bottom 10-bits of a sequence (or anno) record are an index into a SeqBlock and the upper bits the SeqBlock record. This previously meant just 21 bits of record space for SeqBlock or about 2 million records. B) Allow for future changes of record number to be an ID into other storage media. Right now they're an index into the g-layer aux file, but we plan on using them as an index into a bam file if we permit copy-on-write (or even an index into Arcturus). For bam the obvious way is to use the record number as a file offset, which therefore needs more than 2Gb worth of address space. Change summary: 1) All use of types for records are now tg_rec. For Tcl interfaces, we use Tcl_WideInt instead of int and functions like Tcl_GetWideInt instead of Tcl_GetInt. (These are defined to be at least 64-bit.) Use atorec() instead of atoi() when converting from string to tg_rec. 2) All uses of %d in printing record IDs are now %"PRIrec" instead. (Similarly PRIbtr for BTRec types in b+tree2.c) 3) Removed the option to reserve sequence record numbers from tg_index and allocate() function. 4) Changed the format of some data structures. This means the new gap5 databases are INCOMPATIBLE with the old ones. This gap5 will still read old data, but not vice versa. This was required to handle 64-bit values. 5) Split GDatabase into GDatabase (g-layer) and database_t (gap5 layer) types. In theory the G data structures are interface specific ("g" layer in this case) and shouldn't ever be used by the gap5 code. Not important right now, but a necessary split to enforce if we ever switch to, say, sqlite as a storage engine. 6) The parse_args functions for tcl interfaces now have a new data type ARG_REC, to replace the usual ARG_INT used before. 7) Added index_del interfaces for sequence and contig names. Not strictly part of the tg_rec code, but discovered their omission during these changes. 8) Bug fix to btree_search for when looking at an item at the current root. 9) Removed bin_id field from bin_index_t. It was never filled out properly and was essentially the same as rec. 10) Removed rec arrays from SeqBlock and AnnoEleBlock internal structures. The arrays were pointless as they were all sequential anyway given we have no reallocation system (and they're were not written to disc). 11) Bug fix to bin_get_position when recursing over complemented data (not part of tg_rec fixes). 2010-09-01 jkbonfield * gap5/docs/DONE, gap5/docs/TODO: 2010-08-31 jkbonfield * tgap/g-request.c: g_unlock_views() now sorts the views by record number so that writing out to the aux file is in file offset order. I'm not sure if this makes a big difference or not, but it seems wise to not do things in random (or as was actually regularly happen, reverse) file offset. Also fixed update_record to check against 0 as well as G_NO_IMAGE. This prevents (ignored) errors from heap_free(), although I'm unsure why we get image of zero anyway. * tgap/tg_iface.h, tgap/tg_iface_g.c: More mid-level deallocation code. * gap5/dis_readings.c: Added lots of code for deallocating data Also lots of extra checking code: check_contig_bins(). Now also trims contig left/right ends if we disassemble data at the end. * gap5/break_contig.c: Implemented remove_empty_bins() function to recurse through a contig tidying up dead and useless bins after a break. It's easier to do this here than during the break itself. Fixed memory leak in contig_visible_start/end - now deallocate the contig iterator. * tgap/tg_cache.c, tgap/tg_cache_item.h, tgap/tg_contig.c, tgap/tg_gio.h: Mid-level item deallocation: Cache items now have a forgetme bit-flag. When set it indicates the record should be removed. The cache_rec_deallocate function does this. This is turn then calls the 'iface' destroy methods. Added asserts to cache_decr. We should never get to negative ref counts. Equally so we should never hit a zero ref count on a modified item. (This was the cause of a corruption recently.) * tgap/tg_bin.c: Protect against invalid records in bin_get_item_position - no longer crash, but return -1 instead. bin_invalidate_consensus() no longer forces bin to be rewritten if it already had no valid cached consensus present. * tgap/g-filedefs.h, tgap/g-io.c, tgap/g-os.h, tgap/g-request.c, tgap/g-request.h, tgap/g-struct.h: Store free record numbers in a linked list (starting with AuxHeader.free_record). Add G_VIEW_DELETED as a view type, which triggers the adding to this free list upon unlocking. The new g_free_rec_() interface removes the most recent record item from the list and returns it. (Or G_NO_REC if none available.) * tgap/g-alloc.c: Tweaks to output when DEBUG is defined. Otherwise no impact. Also added a debug function, heap_largest_check(), to aid in looking for allocation problems. (It found none, but will leave the debug code in place.) 2010-08-25 awhitwham * gap5/Makefile, gap5/caf.c, gap5/caf.h, gap5/tg_index.c, gap5/tg_index_common.c: Added CAF format to tg_index. 2010-08-20 jkbonfield * gap5/dis_readings.c: Various tweaks and improvements to the hole detection and contig-end trimming algorithms. Previously we could either end up with contigs containing no data or contigs with holes in. * gap5/ace.c, gap5/baf.c, gap5/break_contig.c, gap5/dis_readings.tcl, gap5/editor_view.c, gap5/export_contigs.c, gap5/gap_range.c, gap5/maq.c, gap5/sam_index.c, tgap/tg_bin.c, tgap/tg_cache.c, tgap/tg_contig.c, tgap/tg_gio.c, tgap/tg_sequence.c: Mass tidy up of cache_incr and cache_decr calls. This fixes several bugs which often revealed themselves as "cache_unload: Assertion `io->base || ci->updated == 0' failed." This happens when we cache_decr too much, making the ref count go to zero and removing the item from the hachetable in_use list. The in_use list is scanned through looking for ci->updated==1 when flushing changes, so a record which has been modified and then decrememented doesn't get written on a flush. Instead it's identified in the above insert upon closing the io handle. * gap5/dis_readings.c, gap5/newgap5_cmds.c: Bug fixes to disassemble readings: 1) Don't crash when called with zero reads to disassemble. 2) Handle unknown read names, instead of trying to disassemble rec -1. 3) The iter_next and iter_prev code in remove_contig_holes now has auto-extend on the range. The reason is that the start/end we have is the range for a region that we've just removed a read from and may not be guaranteed to have overlapping data on (eg if the contig already had a hole). * tgap/hache_table.c: We now issue a warning when attempting to decrement a reference count of an item with zero reference count already. This is nearly always a symptom of buggy reference count updates in the calling code. Also fixed a bug in the ref-info code for haches with cache_size of zero. * tgap/g-files.c, tgap/g-files.h, tgap/g-request.c: Aded g_remember_index as an analog to the g_forget_index. This is called when explicitly locking a record. Also we no longer call g_forget_index when flushing, only when explicitly unlocking. Combined these should ensure that the reference counting of idx_hash works correctly. 2010-08-19 jkbonfield * gap5/Makefile, gap5/dis_readings.c, gap5/dis_readings.h, gap5/dis_readings.tcl, gap5/docs/TODO, gap5/gap5rc, gap5/gap5rc_menu_full, gap5/newgap5_cmds.c, gap5/newgap_structs.h: First draft of disassemble readings. * tgap/tg_bin.c, tgap/tg_bin.h, tgap/tg_sequence.c: Generalised the sequence_invalidate_consensus as bin_invalidate_consensus which now takes arbitrary ranges, rather than just the range a sequence covers. (We need this for disassemble readings.) * tgap/tg_bin.c: Invalidate the consensus cache in more places. The best catch-all of this is bin_incr_nseq() as any time we add or remove from a bin we have to call this, which automatically invalidates any consensus in all bins from here on up. What about if the consensus is in a bin below? We still need to check for this, but a belt-and-braces approach means this change is still viable. * gap5/break_contig.c: Fixed contig_visible_start - it was returning 1 mostly rather than the actual start. * gap5/consensus.c: Removed assert as it still seems to be triggered. I know this sounds bad, but given the comment above it I concluded it was overly aggressive. I'm not *100%* sure on that though... * gap5/gap.tcl, gap5/sam_index.c, gap5/tg_index.c, tgap/b+tree2.c, tgap/tg_gio.c, tgap/tg_iface_g.c: Improved handling of errors when indexing broken files or opening corrupted databases. We shouldn't crash (either via deliberate assert/abort or due to not checking returns) and should also now exit with an error code. 2010-08-17 jkbonfield * gap5/consensus.c: Fixed the "perfect base" handling code. We no longer explicitly check * and N (which was wrong as "-" is an ambiguous base). We now check the primary quality for the called base using lookup[base]. * gap5/gap5rc: Added missing CONTIG_EDITOR.SHOW_CUTOFFS definition. * gap5/gap5rc_menu_full: Removal of unimplemented items from menus (Check Database, Extract Readings, Reading coverage). Moved Import GFF from Edit to File menu. * gap5/editor_view.c: Further fixes to the Y-caching code to prevent crashes: this time in tk_redisplayCursor. * gap5/trace_display.tcl: Remove the "compact" button/mode. Removed the Diff button/option as it's not in gap5 yet. Fixed complement so it no longer causes a tk error. 2010-08-13 jkbonfield * gap5/consensus.c: Fixed 'perfect' base check (manually edited at Q100) to only apply to real bases and not N or *. These previously had all-zero for scores of acgt which was interpreted as perfect too. 2010-08-12 jkbonfield * gap5/contig_editor.tcl, gap5/gap5rc, gap5/gap5rc_menu_full: Added a contig editor "Save Settings" command. * gap4/contig_editor.tcl: Removal of debugging output * gap5/consensus.c, tgap/tg_sequence.c: Integer quality values of 100 (phred or logodds) for the called base are now treated as probability 1.0 for correctness, regardless of contrary evidence (unless it's another Q100). This means that manually edited bases now always take precedence in the consensus. * gap5/contig_editor.tcl: The Undo button now updates the information line with a summary of the change it will make when pressed. Added C-s and C-r keybindings for searching forwards and backwards. 2010-08-12 awhitwham * gap5/depth.tcl: Now redraws contig edit cursor on scroll. 2010-08-12 jkbonfield * gap5/tag_editor.tcl: Fixed tag_macro_copy * gap5/contig_editor.tcl, gap5/gap5rc_menu_full, gap5/tag_editor.tcl: Added the Save Tag Macros command to the editor Settings menu (and also load them up at editor start). This stores them in $HOME/.gap5rc * gap5/contig_editor.tcl, gap5/tag_editor.tcl: Added "tag macros" - as per Gap4. Also added the tag_editor.tcl file which was forgotten before. (It's in the tarballs, but oddly not svn.) * gap5/editor_view.c: Protect against xx->rec_hash being NULL. This was added to lots of functions, but I suspect most already check by dint of checking xx->nr too. The one we fixed a crash in is edview_row_for_item. It died when attempting to launch an editor at a region with zero data. * gap5/gap5_consensus.tcl: Added a tk_messageBox equivalent so that errors reported from consen.tcl generate a decent message instead of a tcl error about tk_messageBox not existing. * gap5/contig_editor.tcl, gap5/docs/TODO, gap5/editor_view.c, gap5/editor_view.h, gap5/tkEditor.c: Added two new editor widget methods: getxy and show_cursor. F11/F12 for fast tag editing or removal now only operate on the item under the editing cursor, rather than under the mouse pointer. This brings it back inline with Gap4. Deletion of data has been made safer. We only permit deletion of pads now unless Control+Delete is used, which will revert to the old behaviour of removing anything (even entire columns). 2010-08-11 jkbonfield * gap5/contig_editor.tcl: More key bindings: Page up/down already scrolled in X by 1Kb, but with Shift, Control or Shift+Control this now moves by 10, 100 and 1000Kb. We can now adjust the base confidence values using [, ] Shift+Up/Down arrows and Control+Up/Down arrows - much as we did in gap4. 2010-08-06 jkbonfield * gap5/docs/TODO: * gap5/tkEditor.c: Protect against attempts of -ve Y scroll positions * tgap/tg_contig.c: Fixed sort order when sorting by technology and some samples have seq_tech while others do not. Bug fix to the update_range_y calls in contig_items_in_range(). We update these as we go along, rather than at end, meaning multiple technologies should compensate correctly for the shift in start. 2010-08-05 awhitwham * gap5/template_display.c: Added scrolling offset to xhair return values. 2010-08-03 jkbonfield * gap5/editor_view.c: Fixed bugs in the new Y-layout code. - Protect against scrolling off end of contig and having no visible rows to try and match. - We can now get entirely blank lines due to preserving Y, so make sure we draw them to avoid ghosting. 2010-08-03 awhitwham * gap5/depth.tcl, gap5/depth_track.c, gap5/gap_range.c, gap5/gap_range.h, gap5/template_display.c: Tweaks to the track view filters. 2010-08-03 jkbonfield * system.mk.in: Honour DESTDIR variable (which by default is blank and has no impact). See http://www.gnu.org/software/hello/manual/automake/DESTDIR.html for more information. 2010-08-03 awhitwham * gap5/depth.tcl, gap5/depth_track.c, gap5/depth_track.h, gap5/gap5rc_menu_full, gap5/newgap5_cmds.c, gap5/template_display.c, gap5/template_display.h, gap5/template_draw.c: Changed template display to use custom canvas item types rather than tkRaster for track display. 2010-08-02 jkbonfield * primer3/src/Makefile: Added $(L)/.dir dependency to the $(L)/$(SHLIB_PREFIX)... targets. This means that when outputting -o lib/libfoo.so we ensure that lib/ is created first. This should resolve some parallel make problems. * copy_reads/Makefile, g/Makefile, gap4/Makefile, gap5/Makefile, haplo/Makefile, mutlib/Makefile, prefinish/Makefile, seq_utils/Makefile, spin/Makefile, text_utils/Makefile, tgap/Makefile, tk_utils/Makefile: Added $(L)/.dir dependency to the $(L)/$(SHLIB_PREFIX)... targets. This means that when outputting -o lib/libfoo.so we ensure that lib/ is created first. This should resolve some parallel make problems. * ac_stubs/ax_lib_samtools.m4: Added -lbam to SAMTOOLS_LDFLAGS when not using --with-samtools, but detecting a working bam.a/h. * ac_stubs/ax_lib_samtools.m4: Fixed typo in comment * Makefile.in: Added primer3/src as dependency to gap5, given the recent addition to using this library. Hopefully this fixed some parallel make failures. * ac_stubs/ax_lib_samtools.m4: Fixed elseif/elif issue in --with-samtools option. 2010-07-16 jkbonfield * gap5/editor_view.c, gap5/editor_view.h: Sped up the contig editor when dealing with excessively deep alignments. Specifically we now have a hash to go from record numbers to index into xx->r[i], allowing rapid identification of object location. Conversely we also now binary search xx->r[] when looking for items at specific Y coords. * gap5/contig_editor.tcl, gap5/editor_view.c: Avoid calling consensus_valid_range() for as long as possible, as it can be slow to compute. Instead we first check if a consensus position is valid when moving the editor cursor simply by checking if the consensus is non-N. 2010-07-15 jkbonfield * tgap/tg_contig.c: Now only call update_range_y when COMPUTE_YPOS job is set. Also removed a debugging printf. 2010-07-14 jkbonfield * Tagged VERSION 2.0.0b7 * ChangeLog, NEWS, configure.in, gap5/docs/DONE, gap5/docs/TODO: 1.2.9 (aka 2.0.0b7) release 2010-07-14 jkbonfield * gap5/template_display.c, tgap/tg_cache.c, tgap/tg_contig.c, tgap/tg_contig.h, tgap/tg_gio.h, tgap/tg_iface_g.c, tgap/tg_struct.h: Updated the compute_ypos function in tg_contig.c (note, not the one in template_display.c) to keep track of previous Y coordinates. We achieve this by modifying the low-level cached bin-range structures to also include a Y (in memory and not written to disk). If our next query already has Y coordinates used then we prefer these over allocating new ones. This prevents the "rotating" effect of short-read data when scrolling right in the contig editor, although at the moment this still happens when scrolling left. 2010-07-09 jkbonfield * gap5/docs/TODO: * ChangeLog, NEWS, gap5/docs/TODO: * tgap/tg_bin.c, tgap/tg_contig.c: Fixed our check for bin->{start_used,start_end} being valid from comparing whether they are equal to checking whether bin->rng is blank. The former method meant that a bin consisting solely of a 1 base tag (eg start_used=1000, end_used=1000) was considered empty. The next time we add another tag to the bin, start/end weren't extended but instead moved as-if initialising an empty bin. This caused tags to be invisible in some corner cases. 2010-07-08 jkbonfield * gap5/Makefile, gap5/gap5rc_menu_full, gap5/import_gff.c, gap5/import_gff.h, gap5/import_gff.tcl, gap5/newgap5_cmds.c, gap5/tclIndex: Added an Import GFF function to act as the reverse of the tag export code in export_contigs.c. It handles both padded and unpadded coordinates, although unpadded import is far slower. Also right now the GFF type field is ignored, instead using a type= attribute at the end. * gap5/export_contigs.c: Fixed writing unpadded coordinates for GFF tags when not-mapping from sequence to consensus positions. 2010-07-07 jkbonfield * gap5/export_contigs.c: Now use active_list_contigs_extended() when exporting tags in GFF format. Fixed separator in GFF attrib section, from "," to ";". * gap5/gap4_compat.c, gap5/io_utils.h, gap5/list_proc.c, gap5/list_proc.h: When expanding a list of contig names to contig recs, start and end coordinates we now have the option of using the full unclipped contig length instead of the previous clipped length. This is through using the new active_list_contigs_extended() function instead of active_list_contigs(). Functions will need to use what is appropriate. Outputting consensus makes sense to only have the clipped portion as the extensions are just poly-N. Outputting all sequence and tags may make sense to use extended mode. * gap5/baf.c: Bug fix to parsing of consensus tags in BAF 2010-07-02 jkbonfield * gap5/editor_view.c: Disabled the debugging output: accidentally left on from earlier commit. * gap5/sam_index.c: Prevented crash when dealing with CIGAR strings using "N" (skipped bases). These can come from TopHat's spliced alignments. The samtools pileup interface treats a single input sequence as having multiple start and end coordinates (unfortunately without a flag indicating whether it's a true or spliced end). We need a better method of handling this, especially with regards to templates and more than 2 reads on it. (We actually know how many we expect due to previous scanning of CIGAR.) 2010-07-02 awhitwham * gap5/depth.tcl: Fixed the resizing issues on the template tracks. 2010-07-01 jkbonfield * gap5/break_contig.c: Added two new utility functions which we may later wish to move to a more general purpose location: contig_visible_start and contig_visible_end. Visible here including cutoff data but excluding the invisible cached consensus data. * gap5/editor_view.c, gap5/export_contigs.c: Updated the way we interpret consensus tags. Previously the range (flags & GRANGE_FLAG_TAG_SEQ) bit was used to distinguish sequence tags vs consensus tags, but also the range pair_rec held the record number the tag was bound to. This makes sense for sequences, but we also stored the consensus record for consensus tags. The problem comes when breaking a contig. We reparent an entire section of bin tree, attaching it to a new contig record. We do not wish to go through the entire bin tree changing r->pair_rec to be the new contig ID. Fortunately checking the GRANGE_FLAG_TAG_SEQ bit is sufficient to know if the tag is for the consensus instead. So... changed cases where we checked r->pair_rec == contig_rec to instead use !(r->flags & GRANGE_FLAG_TAG_SEQ). Also updated the GFF export code in export_contigs.c so it does hex escaping instead of C-string escaped (as mandated in GFF3 spec at http://www.sequenceontology.org/gff3.shtml). * gap5/docs/TODO: * tgap/tg_contig.c, tgap/tg_contig.h: Overloaded the "whence" type to the iterator to also control whether we sort by start (default and old mode) or end of read. This is particularly useful when using whence of CITER_LAST and using contig_iter_prev to walk through the list backwards, allowing us to iterate along the order in which sequences become visible while going backwards. * tk_utils/sheet.c, tk_utils/sheet.h: Removed the maximum number of rows/columns. It wasn't functioning correctly anyway, being only checked in some cases and consequentially causing memory corruptions. (Albeit hard to hit unless using nil2 font.) * gap5/editor_view.c: Protect against potentiallty uninitialised values returned from edview_item_at_pos when nothing is visible. (This makes it easier for error checking in the calling function.) Fixed buffer overflow when an editor sheet is at the maximum display width. 2010-06-30 jkbonfield * gap5/baf.c: Fixed a bug with consensus tags. We were incorrectly setting the flag to indicate they were sequence tags. (This was causing crashes in break contig too.) 2010-06-28 jkbonfield * gap5/editor_view.c: Attempted to improve the positioning of the Y scrollbar when scrolling around in X. This is somewhat tricky to get right, especially when multiple sequences are packed in a line as the Y coordinates of them jump around a lot anyway. However our method is as follows. - Attempt to keep the top sequence still in the top position after scrolling, adjusting Y scrollbar as necessary. - If top sequence is no longer overlapping, repeat for bottom sequence. - If the editing cursor was on screen before, and is still within X-bounds of the new scrolled position, it should be still be visible after. Also fixed horizontal cursor movement keys (eg left/right arrows) so that they also checked to make sure the cursor is visible. Previously it didn't snap back to visibility if the X cursor position was still on screen but it had been manually scrolled off the top of bottom. * tgap/tg_contig.c: Fixed bug in Y-allocation by sequence technology type - we now exclude tags during this. Previously we chose Y ranges too large. * gap5/contig_editor.tcl, gap5/editor_view.c, gap5/gap5rc, gap5/tkEditor.c, tgap/tg_contig.c, tgap/tg_contig.h, tgap/tg_struct.h: Added a CSIR_SORT_BY_SEQ_TECH flag for the contig_items_in_range function. This required adding seq_tech to the rangec_t struct (in-memory, not on-disk version) too. Should this be added to on-disk struct at some stage for efficiency? For now the editor always passes this flag in so capillary sequences are always on top. I need to make this adjustable. The editor also no longer calls contig_items_in_range continually (even on mouse overs) as it now correctly tracks edits and so caches this data. Finally the seq_tech field can now be (and is) displayed in the brief status line of the editor. * gap5/sam_index.c: Fill out sequencing technology field from read-group PL string. Also attempt to guess this from sequence names when no read-group is available, although this is highly error prone. * gap5/libraries.tcl: Changed solexa for illumina in output * gap5/contig_editor.tcl: Moved the calls to store_undo when adjusting read clip points or read positions to after the edit takes place. This fixes a redisplay bug in other copies of the editor window as it is the store_undo code that sends the event message around to redisplay. 2010-06-23 jkbonfield * gap5/export_contigs.c: Fixed SAM quality strings to cap at quality 94 (ASCII ~ after adding 33). This prevents Picard from throwing an error. * gap5/contig_editor.tcl, gap5/depth.tcl, tgap/tg_register.c: Added a context sensitive menu to the sequence name panel in the editor. This sports a "Goto ..." function to jump to other reads on this same template, even when they're in another contig (it'll bring up a new editor). 2010-06-21 jkbonfield * gap5/export_contigs.c: SAM output is now sorted by clipped position instead of unclipped position, removing the need to convert from sam to bam and then run samtools sort. * gap5/baf.c, gap5/export_contigs.c, gap5/sam_index.c, gap5/tg_index_common.c, gap5/tg_index_common.h: Added experimental tag support to the SAM format, both for export and import. This uses Zc (consensus) and Zs (sequence) SAM auxillary tag records. * Misc/dstring.c, Misc/dstring.h: Added more functions to append single characters, an integer (in ascii form) or to zero (empty) a string for reuse again. 2010-06-17 awhitwham * gap5/depth.tcl, gap5/depth_track.c, gap5/gap_range.c: Fixed some of the template display's scrolling bugs. 2010-06-17 jkbonfield * gap5/Makefile: Added back PROGS definition as it prevented any targets from being built. Oops. 2010-06-16 jkbonfield * gap5/Makefile, gap5/gap5_consensus, gap5/gap5_consensus.tcl, gap5/gap5_export, gap5/gap5_export.tcl, gap5/tg_index, gap5/tg_view: Added wrapper scripts for tg_index and tg_view so they set the correct LD_LIBRARY_PATH environment without explicitly requiring the user to source staden.profile. Also added (with wrappers) gap5_consensus and gap5_export command line toos to dump out data from a gap5 database non-interactively. * gap5/gap.tcl, gap5/tg_index.c, gap5/tg_view.c: Bumped gap5 version to 1.2.9 for local test release * gap5/gap_range.c: Removed some extra depth code that appeared to add template depth on to sequence depth. I'm not sure of the intent for this original code, but I'm sure we'll find out sooner or later. (Right now it's less bugged than before though.) Changed the colouring of reads to use the true forward/reverse sequence attributes instead of uncomplemented / complemented status. * gap5/template_draw.c: Fixed a colour allocation bug causing colour number 18 to end up as blue instead of grey. 2010-06-11 jkbonfield * gap5/contig_editor.tcl, gap5/editor_oligo.c: Improvements to the primer selection interface. It can now create tags. Also applied a minor fix to the Join button reenabling it and removing the debug message. * tk_utils/tclIndex, tk_utils/xcombo.tcl: Added a basic combobox as an alternative to the one in tk8.5 (as it's not as common as 8.4 yet) or iwidgets (which I'd prefer to not have a dependency on given lack of improvements to it). 2010-06-09 jkbonfield * gap5/export_contigs.c, gap5/sam_index.c: Sped up SAM export. The [sb]am_aux_stringify functions now generate the string form directly rather than using dozens of sprintf calls. Also implemented a trial version of a faster fprintf implementation, although right now it is unused. Finally, the sam export function now permits saving to final "-" to signify stdout. This is of no use in the GUI, but will be useful when scripting gap5. * gap5/gap4_compat.c: Sanitised lget_contig_num - given broken input with start or end positions off the end of the contig, we now clip correctly. * gap5/contig_editor.tcl, gap5/editor_join.c, gap5/tkEditor.c: Updated the "Join" button in the editor to display the overlap length and percentage mismatch. We now also get a question confirmed whether we wish to make the join. Also bug fixed the "align" button. It had an error in computing the coordinates of the overlap when one or both contigs did not start at base position 1. * gap5/newgap5_cmds.c: Added a Tcl interface to consensus_valid_range: this returns the used (akas "clipped") portion of a contig. * gap5/depth.tcl: Minor tweak to prevent an infinite loop when the template display is initially brought up on a region with no visible data. * tgap/tg_utils.c, tgap/tg_utils.h: Updated the [us]72int and int2[us]7 functions so that they're faster (maybe 30% or so, depending on compiler and options). Also implemented macro equivalents which are faster still, although as yet these aren't used. * seq_utils/dna_utils.c, tgap/tg_sequence.c: Replaced complementing functions with a marginally faster version. 2010-06-03 jkbonfield * gap5/contig_editor.tcl, gap5/gap5rc, gap5/primlib.c, gap5/primlib.h, primer3/src/boulder_input.c, primer3/src/oligotm.c, primer3/src/oligotm.h, primer3/src/primer3.h, primer3/src/primer3_lib.c: Updated the primer3 melting temperature calculation to take into account the more recent formulae described in SantaLucia et al 1998, and Ahsen et al 1999 (see source for full refs). These are enabled via a #define and by default are turned on. For Gap5 (not gap4 currently), the extra parameters required are now configurable too, along with a few more of the existing parameters. 2010-05-20 jkbonfield * gap5/export_contigs.c, gap5/sam_index.c, gap5/tg_index_common.c: Improvements to SAM support, both input and output. - We now correctly populate the COMP2 (other pair complemented) range flag. Improved on PAIRED flag too. - PEND_REV flags (other end reverse) are now also set during tg_index of sam. - When exporting, we now attempt to set the strand fields better. (This fixes a bug where export to sam and reimport lost some of the strand information.) 2010-05-14 awhitwham * gap5/docs/TODO: Added a couple of template display bugs. * gap5/depth.tcl, gap5/template_display.c: Improved y scrolling on the template track. 2010-05-12 jkbonfield * gap4/join.c, gap4/searchUtils.c, gap4/tagU2.c, gap4/tkEditor.c, gap5/ace.c, gap5/baf.c, gap5/break_contig.c, gap5/consensus.c, gap5/contig_selector.c, gap5/cs-object.c, gap5/depad_seq_tree.c, gap5/depad_seq_tree.h, gap5/do_fij.c, gap5/docs/TODO, gap5/editor_join.c, gap5/editor_oligo.c, gap5/editor_oligo.h, gap5/editor_search.c, gap5/editor_view.c, gap5/export_contigs.c, gap5/fij.c, gap5/find_oligo.c, gap5/find_repeats.c, gap5/gap4_compat.h, gap5/gap_globals.c, gap5/gap_hash.c, gap5/hash_lib.c, gap5/maq.c, gap5/maq.h, gap5/newgap5_cmds.c, gap5/qual.c, gap5/sam_index.c, gap5/tg_index.c, gap5/tg_index_common.c, gap5/tg_view.c, gap5/tkEditor.c, gap5/tman_interface.c, primer3/src/boulder_input.c, primer3/src/primer3_lib.c, seq_utils/align_lib.c, seq_utils/dna_utils.c, seq_utils/renz_utils.c, seq_utils/sequence_formats.c, spin/seq_reg.c, tgap/b+tree2.c, tgap/g-alloc.c, tgap/g-io.c, tgap/g-request.c, tgap/hache_table.c, tgap/tg_bin.c, tgap/tg_bin.h, tgap/tg_cache.c, tgap/tg_contig.c, tgap/tg_gio.h, tgap/tg_iface_g.c, tgap/tg_sequence.c, tgap/tg_sequence.h, tgap/tg_tcl.c, tk_utils/element_canvas.c, tk_utils/restriction_enzyme_map.c, tk_utils/tkTrace.c, tk_utils/trace_print.c: Mass tidy up of minor compilation warning issues. These cover unused variables, variable names shadowing "parent" ones, missing prototypes, enum lists ending with comma, etc. 2010-05-12 awhitwham * gap5/depth_track.c, gap5/gap_range.c, gap5/template_display.c: Code tidy to get rid of some warnings. 2010-05-12 jkbonfield * mutscan/Makefile, mutscan/staden.h, tracediff/Makefile, tracediff/staden.h: A few more tweaks when building with icc with regards to os.h 2010-05-11 jkbonfield * Misc/os.h, abi/Makefile, abi/abiIO.h, eba/Makefile, eba/conf.c, eba/qual.c, gap4/seqInfo.c, get_scf_field/get_scf_field.c, hetins/Makefile, hetins/hetins.c, init_exp/init_exp.c, polyA_clip/polyA_clip.c, polyA_clip/seqInfo.c, qclip/consen.c, qclip/seqInfo.c, qclip/seqInfo.h, stops/Makefile, stops/stops.c, tk_utils/misc.c, tk_utils/tkTrace.c, tk_utils/tkTraceComp.c, tk_utils/tkTraceDisp.c, tk_utils/tkTraceIO.c, tk_utils/trace_print.c: Forced use of the Staden Package instead of relying on picking up one from an io_lib installation. The key difference is that the local one will honour HAVE_CONFIG_H and pick up little vs big endian definitions from our autoconf derived values, while including a remote io_lib one will not. (This should still work, but it requires the auto-detection macros based on processor type instead.) * gap5/docs/TODO: * gap5/docs/TODO: * gap5/map_reads.tcl, gap5/newgap5_cmds.c, gap5/sam_index.c, tgap/tg_iface.h, tgap/tg_iface_g.c: Improved Mapped Assembly. When we ask to index sequence names, if a name index doesn't already exist we create it. In the process of this we extended the database interface to add an index creation method; fixed memory dup/free issues with the btree code (harmless change); fixed uninitialised variables (store unmapped data / aux records) for sam input via this route; and moved some of the puts statements to use vmessage so they appear in the editor window instead of stdout. 2010-05-11 awhitwham * tgap/tg_contig.c, tk_utils/tkRaster.c, tk_utils/tkRaster.h: More changes to improve the template display. * gap5/Makefile, gap5/depth.tcl, gap5/depth_track.c, gap5/depth_track.h, gap5/gap5rc_menu_full, gap5/gap_range.c, gap5/gap_range.h, gap5/newgap5_cmds.c, gap5/template_display.c, gap5/template_display.h: Improvements to the template display. 2010-05-10 jkbonfield * gap5/gap.tcl: Fixed error with starting gap5 -ro and not specifying a database name. 2010-05-07 jkbonfield * gap5/contig_editor.tcl, gap5/editor_view.c, gap5/editor_view.h, gap5/gap5rc, gap5/gap5rc_menu_full, gap5/tkEditor.c: Added draft of primer picking within the contig editor. This still needs more work and currently just lists primers rather than picking templates for them and adding tags. 2010-05-06 jkbonfield * gap5/editor_oligo.c, gap5/editor_oligo.h: First draft of oligo selection code within the editor. * gap5/primlib.c, gap5/primlib.h: Added primer3 wrapper layer code. 2010-05-05 jkbonfield * tgap/tg_library.h: Added missing prototype * tgap/tg_tcl.c: Protection against NULL tc->contig when destroying the command. * convert/Makefile, global.mk, mutlib/Makefile, mutscan/Makefile, prefinish/Makefile, seq_utils/Makefile, seqed/Makefile, spin/Makefile, spin2/Makefile, tgap/Makefile, tk_utils/Makefile, tracediff/Makefile, trev/Makefile: We're now more explicit about our library dependencies. This should aid compilation on MacOS X and Windows (untested). Also made sure that for TCL only we add $(TCL_LIB) and for Tcl/Tk both we use only $(TK_LIB) and not both. This is because adding @TCL_LIBS@ and @TK_LIBS@ to the system.mk.in has lead to some dependent libraries being specified twice if we explicitly ask to use both $(TCL_LIB) and $(TK_LIB). For libieee.a this causes problems due to a global version symbol, causing a link error. * ac_stubs/ax_lib_curses.m4, configure.in, gap5/Makefile, gap5/docs/DONE, gap5/docs/TODO, gap5/tg_view.c, staden_config.h.in, system.mk.in, tgap/tg_library.c: Added curses/ncurses to autoconf. It now detects which is installed on the system automatically and allows an alternative path to be specified too. * ac_stubs/ax_lib_lzma.m4: Misc cut and paste errors of samtools & libz instead of lzma. 2010-04-29 jkbonfield * gap4/list_contigs.tcl, gap5/contig_selector.tcl, gap5/gap.tcl, gap5/gap5rc_menu_full, gap5/list_contigs.tcl, gap5/ng_fb_cmds.tcl: Improvements to read-only mode. We no longer allow Save Contig Order from the List Contig windows to be tried when we opened a database in read-only mode. (It didn't work as it was caught later on, but ungracefully.) 2010-04-28 jkbonfield * gap5/break_contig.c: Commented out the remove_redundant_bins() call in break contig for now as this does not correctly shift the start coordinate when removing the parent bin and leaving only a right-child bin. (This still needs fixing, but without the optimisation in place we at least get correct results once again.) * gap5/docs/DONE, gap5/docs/TODO: * Misc/Makefile, abi/Makefile, convert/Makefile, copy_reads/Makefile, eba/Makefile, find_renz/Makefile, g/Makefile, gap4/Makefile, gap5/Makefile, global.mk, haplo/Makefile, make_weights/Makefile, mutlib/Makefile, polyA_clip/Makefile, prefinish/Makefile, qclip/Makefile, screen_seq/Makefile, seq_utils/Makefile, spin/Makefile, stops/Makefile, tgap/Makefile, tk_utils/Makefile, tracediff/Makefile, vector_clip/Makefile: Fixed the "make depend" code so that it works when run from a sub-directory rather than only just in the top-level checkout. This commit also includes the results of running this - ie makefiles with updated dependencies. * Misc/getfile.c, Misc/misc.h, Misc/os.h, Misc/parse_db.c, abi/abiIO.c, abi/getABIfield.c, alf/alfsplit.c, convert/bapIO.c, convert/dapIO.c, convert/flat_sd.c, find_renz/find_renz.c, g/freetree.c, g/g-db.c, g/g-request.c, gap4/actf.c, gap4/consen.c, gap4/edCommands.c, gap4/extract.c, gap4/gap-create.c, gap4/newgap_cmds.c, gap4/tagU2.c, gap5/actf.c, gap5/export_contigs.c, gap5/newgap5_cmds.c, gap5/tg_index_common.c, make_weights/make_weights.c, mutlib/align.cpp, mutlib/read_matrix.cpp, mutscan/main.cpp, polyA_clip/polyA_clip.c, prefinish/finish.c, prefinish/finish_walk.c, qclip/qclip.c, screen_seq/screen_seq.c, seq_utils/genetic_code.c, seq_utils/read_matrix.c, seq_utils/renz_utils.c, seq_utils/sequence_formats.c, spin/codon_content.c, spin/emboss_input_funcs.c, spin/nip_cmds.c, spin/readpam.c, spin/seq_reg_cmds.c, spin/splice_search.c, spin/tkSeqedUtils.c, stops/stops.c, tgap/b+tree2.c, tgap/g-alloc.c, tgap/g-files.c, tgap/g-io.c, tgap/g-request.c, tgap/tg_contig.c, tgap/zfio.c, tk_utils/capture.c, tk_utils/postscript.c, tk_utils/text_output.c, tracediff/main.cpp, vector_clip/vector_clip.c: Fixed various large file support issues for linux. These include additional includes of and use of fseeko in place of fseek. * g/g-files.c: When opening in read-only mode we no longer attempt to register items with the freetree structure. This is only a minor speedup, but more importantly it allows us to use copy_db to attempt to recover some corrupted databases. 2010-04-20 jkbonfield * gap5/gap4_compat.c: Fixed contig_name_to_number to recognise "=" syntax. 2010-04-19 jkbonfield * gap5/contig_editor.tcl: Added auto-scrolling when selecting a region (underlining it). Also enabled shift+click to extend a selection. * gap5/gap.tcl: Fixed Database Information output. * gap5/libraries.tcl, gap5/tclIndex: Updated the List Libraries window to use Plotchart. It now has axis and things, but needs more work still. 2010-04-14 jkbonfield * gap5/contig_selector.c, gap5/contig_selector.h, gap5/newgap5_cmds.c, gap5/tk-io-reg.h: Added back tk_matchresult_configure function, now in contig_selector.c. This fixes an error when trying to configure a contig comparator plot, such as changing colour or line width. * gap5/contig_selector.c, gap5/contig_selector.h, gap5/contig_selector.tcl, gap5/cs-object.c, gap5/fij.c, gap5/find_oligo.c, gap5/find_repeats.c, gap5/gap5rc_menu_full, gap5/newgap5_cmds.c, gap5/result_manager.tcl, gap5/tk-io-reg.h: The contig order can now be saved, from both the contig selector and contig list windows. Furthermore we can now move contigs around in the contig selector. The "show diagonal" and "Clear all" commands work in the contig selector. The results manager and the results menu in the contig selector now update properly. * tgap/tg_register.c: Remove old debugging output * gap5/do_fij.c: Remove duplicates from the contig_list[] as we go through it. These occured when doing single vs all as the single contig is in the list twice (as first and then later on in the "all" bit). * gap5/depad_seq_tree.c, gap5/map_reads.tcl, gap5/newgap5_cmds.c: The Map Reads dialogues now have an option whether to index the sequence names (and this was renamed from -no_tree to -index_names at the API level). Also fixed a bug with the tg_index -g mode, where the input bam file is assumed to have been aligned against an ungapped copy of the contig already in the gap5 DB. We failed to take into account that contigs may not start at base 1. * gap5/editor_search.c, gap5/editor_search.tcl, gap5/gap5rc: Added by-annotation and by-tag-type search methods to the contig editor. Also fixed searching by name so it no longer tried to jump to sequence names that are found in another contig. * tgap/tg_iface_g.c: Fixed a bug when writing out SeqBlocks containing a mixture of data with libraries and without libraries. (This can happen when writing the cached consensus to a db generated from a bam file.) We incorrectly handled the no-library cases, causing corrupt data to be written to the DB when the first read in a block was missing. * gap4/gap-tcl.c: Fixed a memory corruption when using tcl in debugging mode (where Tcl_Free is not the same as free). 2010-04-01 jkbonfield * convert/Makefile, copy_reads/copy_reads, gap4/gap4, gap5/gap.tcl, gap5/gap5, gap5/gap5rc, prefinish/finish_sanger, pregap4/pregap4, spin/spin, spin_emboss/create_emboss_files, system.mk.in, tgap/Makefile, tgap/tg_tcl.c, tk_utils/Makefile, tk_utils/init.c, trev/trev: Various fixes for building on MacOS X. - The sh wrapper scripts seem to need a trailing / on $STADLIB otherwise tcl "load" doesn't add one. I'm not sure why yet. - Removed tkCanvGraph.c and tclCanvGraph.c from tk_utils build. These caused all sorts of problems with needing internal tcl/tk header files, but they're only used by spin2 which we no longer support nor build. We can cross that bridge if we ever go back to it. - Similarly removed tclInt.h from tg_tcl.c. In theory this was added to get a prototype for Tcl_GetCommandFromObj, but it doesn't always seem to be there anyway. Perhaps a Tcl version issue. - Added various more extra libs to explicitly link against in the Makefiles as MacOS X doesn't like the implicit chains. - Removed load of iwidgets from gap5rc. Not sure if we need this, but it seems to have been commented out some time ago for gap4 so it seems unlikely. - Use @TK_LIBS@ and @TCL_LIBS@ again in system.mk.in. I do not know why I commented those out (which is worrying), but they're definitely required for MacOS. - Similarly disabled -rpath-link for now as it doesn't exist on MacOS X. I'm hoping the explicit library linking will remove the need for using this anyway... to test on other platforms. * Misc/os.h: Updated os.h to handle endianness is a better fashion. This is taken from io_lib's copy of it and hopefully works better now on intel based MacOS X systems or Mac systems building "fat binaries". 2010-03-26 jkbonfield * rel-2-0-0-b6 gap5-1-2-8 * NEWS, configure.in: 2.0.0b6 updates. * gap5/gap.tcl, gap5/tg_index.c, gap5/tg_view.c: Bumped g5 versions to 1.2.8 * tk_utils/tk_utilsrc: Use a smaller font for the contig editor on unix * tgap/tg_iface_g.c: Fixed memory allocation error (causing crashes) when dealing with multiple read-groups and read-names with substantially different lengths. 2010-03-24 James Bonfield * Tagged rel-2-0-0-b5 * Tagged gap5-1-2-7 2010-03-24 jkbonfield * gap5/docs/ChangeLog: * gap4/join.c: We now temporarily set the two editor panels in the join editor to be "StateDown" during the dojoin() call. This prevents them from receiving the REG_LENGTH event and therefore from reloading the entire contig into memory (unless another display exists for the same contig in another window). This substantially reduces the amount of I/O when performing a join. * gap5/break_contig.c: Fixed a bug where seq->bin_index wasn't updated when moving sequences from one bin to another during break contig. 2010-03-22 jkbonfield * gap5/docs/TODO: * gap5/gap_utils.tcl, gap5/tclIndex: Updated c_length proc to use the contig get_length method. This avoids the old io_read_contig emulation, which spends a lot of time and I/O needlessly figuring out the first and last reading in the contig. * gap5/export_contigs.c: Improvements to CAF export. - We use - instead of * now for pads. - We generate new names using the record ID. This avoids the problem of duplicate read names in gap5. * gap5/map_reads.tcl: We now enable B+Tree indexing of finishing read sequence names. * gap5/tg_view.c: Minor change to tg_view -l to deal with *DEEP* data * tgap/tg_contig.c: Minor speed improvement to the y-layout algorithm. compute_ypos_tags() now checks whether any tags are visible and short-cuts the hash table building step if it's not needed. Still not optimal, but a step in the right direction. 2010-03-12 jkbonfield * gap5/sam_index.c: Fixed a crash that occured when adding unaligned data and the unaligned read was the first read to be added to a contig. * gap4/tag_checklist.tcl, gap5/tag_checklist.tcl: Used "extended" mode of the listbox instead of our old local hack of extended2. This difference is in how it handles toggling and whether we can select multiples without using control, but at least it's now functional again when using a native Tk instead of a locally hacked one. * gap4/acd2tag.tcl: Fixed some issues with incorrectly resizing notebooks. Also fixed using variables with acd dependencies. 2010-03-08 jkbonfield * ChangeLog: * NEWS, tk_utils/Makefile: * ac_stubs/ax_lib_lzma.m4, gap5/contig_id.tcl, gap5/gap4_compat.tcl: Remove debugging chatter * gap5/tclIndex: Added io_read_contig * gap5/export_contigs.c, gap5/export_contigs.tcl: Added CAF format to the export contigs dialogue. Not a recommended format, but users are requesting it still. * tgap/tg_cache.c: Bug fixed an earlier fix to cache_rw(). If we lock, flush and attempt to relock a record the change to the function meant we failed to set the updated flag. (An example of it causing a problem is crashing when computing the consensus after exiting the database and reopening it.) This perhaps needs a fix elsewhere too. Should roll back the lock to RO after a flush? 2010-03-05 jkbonfield * gap5/maqmap.c, gap5/sam_index.c, tgap/tg_anno.c, tgap/tg_register.c, tgap/tg_sequence.c, tk_utils/sheet.c: Fixed various compilation warnings * ChangeLog, NEWS, README.build, configure.in: Updates to prepare for 2.0.0b5 * gap5/contig_editor.tcl, gap5/docs/DONE, gap5/docs/TODO, tgap/tg_anno.c, tgap/tg_anno.h, tgap/tg_bin.c, tgap/tg_bin.h, tgap/tg_sequence.c, tgap/tg_tcl.c: Added anno_get_position and anno_get_position2 functions, analogous to the sequence_get_position* funcs. The two share common code so internally they now call the same function, bin_get_item_position(), that takes a type field. Added a move_annos method of the tcl seq object. This calls the C sequence_move_annos() function. It's used within the contig editor to ensure that annotations are moved with a sequence. Still to do: allow partial moves, in the case of inserting or deleting with a sequence. Fixed a bug with the bin_for_range function where the database had smaller bins than the current default minimum bin size. Sometimes we were putting things in larger bins than we need to. The Contig Editor Undo command now undoes changes to tag type and tag comment. * gap5/tkEditor.c: The "select get" editor method now returns the base under the editing cursor when no selection has been made. This prevents a crash when attempting to create a tag without marking a region. * tgap/tg_cache.c: Prevented excessive item duplications when we attempt to cache_rw the same object multiple times within the editor. * tgap/tg_contig.c: Extended contig_dump_ps to output sequence lines too * gap4/gap.tcl: Moved the -menu_file code to after the load_package section (to fix a problem with Sanger's exoseq_make_gapdb). 2010-03-04 jkbonfield * ac_stubs/ax_lib_png.m4: Fixed bug where PNG_LDFLAGS defaults to -lz when no --with-png is used. Also fixed an issue where --with-png was assumed to be used even when not explicitly specified, by virtue of picking up the previous $withval used within the --with-lzma section. * ac_stubs/ax_lib_lzma.m4: Fixed AC_CHECK_LIB test 2010-03-03 jkbonfield * prefinish/finish_cDNA, prefinish/finish_cDNA_ends_only, prefinish/finish_sanger.tcl: Fixed the scripts so that when run as an executable rather than from tclsh the auto-restarting code computes STADENROOT based on the assumption of $0 being in the share/staden/scripts/$0 location. * tk_utils/stash: Fixed argc 2010-03-02 jkbonfield * tk_utils/Makefile, tk_utils/stash: Added a new stash script to the installed bin directory. This pretends to be the old stash executable, by virtue of running the system tclsh and running a little bit of startup code. It's not a recommended route, but will be kept for backwards compatibility for old scripts. * gap4/gap.tcl, gap5/gap.tcl, gap5/tg_index.c: Bumped some version numbers: gap4 2.11.2 gap5 1.2.7 tg_index 1.2.7 * gap5/contig_selector.tcl: Removed excessing debugging output * gap5/docs/DONE, gap5/docs/TODO, global.mk, system.mk.in: Fixed compilation when no libpng is found. 2010-03-01 jkbonfield * gap5/docs/DONE: * gap5/contig_editor.tcl, gap5/gap4_compat.c, gap5/tkEditor.c: Further event handling. Complement contig now requests contig_lock_write() access. This in turn is now handled by the editor, bringing up a dialogue box as appropriate. The editor also handles JOIN_TO requests better now. For this to happen it may need to change the contig we're associated with, which in turn means updating the $ed io and contig_rec values. These methods are now set/get rather than pure get, allowing them to be updated after "$ed init". * gap5/tk-io-reg.c, tgap/tg_register.c: Moved busy_dialog() from tk-io-reg.c to tg_register.c and also make use of it in the locking code. * gap5/tk-io-reg.c: Improved calling of tcl-registered contig_reg items. To protect against memory corruptions when a function is contig_deregister()ed while processing an event, we now do some basic reference counting in the cr_type object. Also added code for handling the return value for REG_GET_LOCK queries. * gap5/gap5rc_menu_full, gap5/tclIndex: Reenabled the Results Manager window - it's no longer hidden behind the expert mode flag. * gap5/editor_join.c: Fixed the REG_JOIN_TO event we send out to include the correct contig number (was right, now left). * tgap/hache_table.c, tgap/hache_table.h, tgap/tg_register.c: - Added a HacheTableRehash function. This allows an item to be assigned to a new key without needing to remove and reinsert it. - Fixed contig_register_join to use HashTableRehash instead of remove/insert. This means that the hacheItem doesn't change and hence we fixed a bug with incorrect tracking this. Also added asserts to better protect against similar bugs. * tgap/tg_cache.c: When unloading items from the cache we no longer also unlock the record if this is a child i/o and the record is still in the base i/o. Previously by doing this we could end up attempting to write to already-freed views, leading to cryptic "Error: -1" from save contig. 2010-02-25 jkbonfield * seq_utils/align_lib.h: Added comments so I can remember what the cryptic edge_mode values mean in the future. * gap5/cs-object.c, gap5/fij.c: Fixed issues with complementing match objects. These used to just use "contig_length - pos", but the contig length includes cutoff data now. Calling consensus_valid_range cures this, although we may want to cache that data to speed up the process. * tgap/hache_table.c: Minor improvements to the hache dump debug code. * gap5/contig_editor.tcl, gap5/contig_selector.c, gap5/docs/DONE, gap5/docs/TODO, gap5/editor_join.c, gap5/find_oligo.c, gap5/find_repeats.c, gap5/gap4_compat.c, gap5/tkEditor.c, tgap/tg_contig.c, tgap/tg_register.c, tgap/tg_register.h: Fixed missing contig notifications on events like complementing a contig, joining contigs or simply just saving from the editor. Now we handle these the clearing of the FIJ plot has been removed as it updates correctly. Plots that used to register with all contigs in a verbatim manner now register with contig 0. (And indeed in many case they were incorrect anyway as they registered with contig 1..Ncontigs rather than the actual contig record numbers.) To facilitate this the send_event function has been improved so that sending to contig -N will send the message to all plots registered against contig zero, but claiming to been an event sent to contig N rather than 0 so that the receiver knows the request. This change is internal to how tg_register works and not something that is visible outside of that file. * gap4/hash_lib.c, gap5/hash_lib.c: Fixed a bug introduced in svn rev 919 (Dec 9 2005) when I changed (amongst other things) the edge_mode parameter from fixed constants to symbolic names. The edge_mode parameter was incorrectly set for the first block, meaning that left-end pads were penalised for. We now explicitly mask off the bit requesting this and consequentially our alignments now improve. Impressive it lasted this long without anyone complaining about broken alignments when using FIJ in fast-mode. 2010-02-19 jkbonfield * tgap/tg_contig.c: Fixed bug in contig_set_name(). It reset *c too early, but now sets it after cache_item_resize call. 2010-02-18 jkbonfield * gap5/consensus.c, gap5/contig_editor.tcl, gap5/editor_search.c, gap5/editor_view.c, gap5/editor_view.h, gap5/tkEditor.c, gap5/tman_interface.c, tgap/tg_sequence.c, tgap/tg_sequence.h, tgap/tg_tcl.c: 1) More work on undo, especially when undoing a base deletion that is the first/last base in hidden data, at the junction of clipped vs used. Normally when we manually insert here we want the base to be in the used visible portion, but if we're inserting as a result of undoing a deletion then it's probably cutoff data we're adding back instead. This involved changing sequence_get_base to return whether a base is in used or cutoff data, along with everything that calls it. Lots of cursor work involving cutoff data. When we turn off cutoffs and our cursor is in the cutoff region of a sequence the cursor now gets moved to the consensus. Moving around with arrow keys will also skip cutoff data when cutoffs are not shown, similarly for making selections. Finally when undoing changes that occured in the cutoff data we now automatically make the cutoffs visible again if they were not already. This also involved modifying the parameters to edSetCursorPos. 2010-02-17 jkbonfield * gap5/docs/DONE, gap5/docs/TODO: * gap5/contig_editor.tcl, gap5/ng_fb_cmds.tcl, tgap/tg_gio.c: Better handling of read-only databases. We now open them instead of just aborting requiring the user to re-run using -ro. We also check the read-only status in the contig editor to block attempted edits and saves. * gap5/gap5rc_menu_full: Fixed the File->New removal (previously accidentally removed the "note" menu part, which isn't visible anyway). * gap5/contig_editor.tcl, tgap/tg_sequence.c, tgap/tg_tcl.c: Added methods to adjust the sequence left/right clip points in the contig editor. These are bound to the < and > keys, as in gap4. * gap5/baf.c, gap5/export_contigs.c, tgap/BAF: Added consensus tags to input/output via BAF. 2010-02-16 jkbonfield * gap5/export_contigs.tcl: Change the output file name based on file format, and automatically pick something appropriate based on the DB name too. * gap5/gap.tcl, gap5/newgap5_cmds.c, tgap/tg_gio.c, tgap/tg_gio.h, tgap/tg_iface_g.c, tgap/tg_struct.h, tgap/tg_tcl.c: The main database record now has a version number (starting with 1 for v1.2.6). This relates to the global version of the database format. Also added $io methods to query the version, the database name and read-only status. These are now used to update the main title bar. * gap5/editor_view.c, tgap/tg_sequence.c, tgap/tg_sequence.h: Control-a and control-e now look at the cutoffs editor parameter to determine whether they should jump to the visible start/end of the sequence/contig or the hidden start/end. In a similar vein, the left/right arrow keys no longer scroll past the visible end either unless cutoffs are shown even when complemented (previously this was bugged). To simplify the implementation of this, I added a new function sequence_get_orient() which returns the relative orientation of this sequence vs the contig. This is more than just "s->len < 0" now considering the complemented status of bins en-route to the root node and so fixes a bug the bug in scrolling along sequences in a complemented contig. * tgap/tg_cache.c: Fixed a memory corruption involved with cache_item_resize(). We now always update the data_size pointer, rather than only when realloc moves the memory. 2010-02-15 jkbonfield * gap5/consensus.c, gap5/docs/DONE, gap5/docs/TODO, tgap/tg_bin.c, tgap/tg_tcl.c: Fixed issues with consensus caching in complemented contigs. Related to this is the issue of moving sequences in complemented contigs too, which may cause creation of a new root bin which itself will not be complemented. (Also fixed) 2010-02-12 jkbonfield * gap5/contig_editor.tcl, gap5/editor_view.c, tgap/tg_anno.c, tgap/tg_anno.h, tgap/tg_tcl.c: Further editor undo fixes - this time annotations. This involved adding an extra option to anno_get_range to allow returning the relative location instead of absolute, and adding a method to the tcl $tag object to query this. * convert/Makefile: Added an explicit -lg to the convert link line. Some systems didn't automatically follow the dependency from -lgap. * gap5/tg_index_common.c: We now complement data correctly when using tg_index -a to append to an existing contig and that contig has been complemented. * gap5/export_contigs.c: Further fixes to ace, baf and sam output when exporting a complemented contig. * tgap/tg_bin.c: Allow for adding to a complement contig. * gap5/gap4_compat.c: complement_contig() now maintains the same clipped start/end position, so a contig with used (uncutoff) portion of data from A to B and total coverage including hidden data from A' to B' will now flip around the midpoint of A to B, such that the complemented contig covers the same range of visible data. This is now equivalent to Gap4 for contigs starting at base 1. * gap5/sam_index.c: Compile bam_aux_stringify even when HAVE_SAMTOOLS isn't set so we can export to sam format still. 2010-02-11 jkbonfield * gap5/export_contigs.c: Fixed export contigs when running on complemented contigs. 2010-02-09 jkbonfield * gap5/gap5rc_menu_full: Remove the unimplemented File->New menu option * gap5/sam_index.c: Major speed up when dealing with very deep data. We replaced the array of recnos with a linked list, for faster adding/removal. Removed the memmove call from bio_del_seq and instead do an in-situ copy while iterating over the items. This essentially means one array copy per column instead of one per sequencing ending per column. Estimations are about 27x speed up on a contig of ~50000 depth. 2010-02-08 jkbonfield * gap5/contig_editor.tcl, gap5/tkEditor.c: Fixed display and undo issues relating to moving sequences, especially moving them left from the start of the contig into negative coorindates. We're now more careful about caching of data which may change, such as the contig struct and the root bin it points to. In Tcl we resolve this largely by not caching the object, but only the record number. In C we resolved it by implementing a manual way to repopulate cached contig struct on demand (the decr_contig and incr_contig editor methods), although it may be preferable to replace these by record number caching instead at some stage. * tgap/tg_contig.c, tgap/tg_sequence.c: sequence_insert_base() now updates *s with the new seq_t struct. Previously this didn't happen so if it moved via cache_item_resize the caller kept a broken pointer. Also moved the location of these updates in various other related functions, to better handle the error cases. * tgap/tg_bin.c: Fixed the last_bin caching in bin_for_range(). It now caches the bin record number and not the pointer. While perhaps not quite as efficient, this works even when the pointer changes due to a realloc or cache_rw change (eg moving from base-io to child-io in the case of contig editor handling). This fixes a bug with undo in the editor. * gap5/sam_index.c: Fixed an efficiency bug when not storing unmapped data. We allocated a record number for these reads and didn't use it, nor remove from the pending record number list. The DB was correct, but we gradually got slower and slower. 2010-02-05 jkbonfield * tgap/tg_bin.c: Comment for later * tgap/tg_tcl.c: The remove_sequence and add_sequence seq methods now return and accept range pair-record and range flags, so a sequence can be moved while retaining all data about it. Also fixed a bug where reinserting a sequence did not correct update the seq->bin_index field. * tgap/tg_gio.c: Set min_bin_size for child io so bin based edits on the contig editor work properly. (Ideally the min_bin_size should be remembered from tg_index, stored in the database record.) * README.build: Added note about -fPIC and Samtools 2010-02-04 awhitwham * gap5/depth.tcl, gap5/template_display.c, gap5/template_display.h, gap5/template_draw.c: Intermediate Template Display changes. 2010-02-03 jkbonfield * staden.profile: Resurrected (and majorly rewrote, hence no real history) the old staden.profile script. It's not required to source this, but some programs tightly linking with the staden package or people wishing to run the smaller tools rather than the main GUI apps will need to get their environment set up properly: LD_LIBRARY_PATH, MANPATH, etc. This script does that and so should be sourced from a bourne-shell syntax login script as desired. * gap5/ace.c, tgap/g-files.c: Further memory leak fixes * gap5/docs/TODO: * tgap/tg_cache.c: Allow for child io to have the cache destroyed. In this case, such as quitting an editor and not saving changes, we relax the assert to allow for updated records to be thrown away without saving first. * tgap/g-files.c: When preloading neighbouring index records from the aux file we now do so for the block the requested record resides in, rather than for the record we request and the next 256. This means we generally load the data in fewer requests and also don't attempt to load the same records multiple times (which lead to a memory leak). * gap5/contig_editor.tcl, tgap/tg_gio.c: Removed a memory leak - the editor now deallocates the child io and any cached data held within it upon exit. * gap5/contig_editor.tcl, tgap/tg_tcl.c: Substantial improvements to undo: Removed the Redo functionality for now. I may add this back when undo itself is finished. Deleting an entire column of data in the consensus now remembers the old data so undo works (previously it just added pads). To implement this a new contig obj method was added, pileup, to return a column of data. * gap5/contig_selector.c: Removed a minor memory leak * gap5/newgap5_cmds.c: Extra debugging and a leak_check command if VALGRIND is defined * tgap/tg_sequence.c: Removed a memory leak in sequence_invalidate_consensus(). Fixed sequence_delete_base() - it sometimes used the old pre-cache_rw copy of the seq_t struct leading to undefined behaviour. 2010-02-01 jkbonfield * gap5/contig_editor.tcl: Fixed a bug whereby the child IO of a top editor in a join editor was not detached properly. This meant that exiting editing (eg pressing "align") and then cancelling the join and closing the window would still have the edits cached. Subsequent invocations of an editor for that contig would see these edits still. * tgap/tg_cache.c, tgap/tg_iface_g.c: Removed a recently added memory leak in reading sequence blocks. Also worked around a malloc(0) size issue which while technically not incorrect, caused valgrind to whinge a bit. * tgap/tg_iface_g.c: Fixed a bug with the new code to reorder read names by their read group. Happened when a seq block contained blank entries. * gap5/export_contigs.c: Removal of debugging output 2010-01-28 jkbonfield * gap5/ace.c, gap5/baf.c, gap5/export_contigs.c, gap5/export_contigs.tcl, gap5/maq.c, gap5/sam_index.c, gap5/sam_index.h, gap5/tg_index.c, gap5/tg_index.h, tgap/tg_cache.c, tgap/tg_contig.c, tgap/tg_iface_g.c, tgap/tg_sequence.c, tgap/tg_sequence.h, tgap/tg_struct.h: Multiple improvements in input/output of SAM/BAM format. - We now support storing SAM auxillary records (other than the old RG: tag). This is disabled by default, but enabled using tg_index -x. - We can now also store unmapped data, although at present it is still visible in the contig editor. This is enabled with tg_index -u. - Fixed the ordering of adding reads to the database. Previously reads were added as their right hand end went past the sam 'pileup' position hence we sorted by right end. Now we create records in the same order they appear in the input file, meaning export contigs should output in the correct order too. To do this cache_item_create has been split into creation and initialisation stages, allowing for record numbers to be allocated and then filled out later. - When querying and sorting sequences by X, we now disambiguate matches by secondary sorting on record number. This also allows for the editor or output functions to match the input sam order. - Export contig now allows for "fixmates" sam output, similar to the samtools sub-command. Warning: this is substantially slower. Also improved flags with respect to unmapped data. * gap5/editor_join.c: Fixed joining of contigs where the start position is not 1. * ac_stubs/tcl.m4, staden_config.h.in: Removed the tcl LARGEFILE_SOURCE64 and LARGEFILE64_SOURCE defines. These confused autoconf on Ubuntu 9 and aren't needed by the Staden Package. * gap5/docs/TODO: 2010-01-25 jkbonfield * configure.in: Fixed io_lib version we require (to >= 1.12.2). 2010-01-22 jkbonfield * gap5/contig_editor.tcl: Prevent attempts to join a contig to itself. * tk_utils/canvas_box.tcl: Better handling in error conditions, when highling/unhighlighting matches * gap4/consen.c, gap4/consen.tcl, gap4/gaprc: Added fastq output for consensus. * gap5/consensus.c: Fixed bug in consensus generation. Very long sequences (>64Kb), meaning no small leaf nodes in the bin tree, could omit filling out the final portion of the consensus in the calculate_consensus_simple function. This manifested itself as FIJ failing when given sequences that were consensus seqs from another DB. 2010-01-21 jkbonfield * global.mk, system.mk.in: Removed the LD_LIBRARY_PATH definitions in global.mk (they wouldn't work on MacOS X anyway) and added -Wl,-rpath-link,$(L) to the linker flags instead. Similarly added -rpath-link for io_lib's install directory. This is because typically it may be built along side the staden package with neither yet installed or without the user yet setting LD_LIBRARY_PATH up. This also has provision to switching to -rpath later if desired, although rpath is - of course - evil. 2010-01-19 jkbonfield * tk_utils/sheet.c: Fixed a crash when resizing a sheet widget to zero width and back again. The problem was that zero width widgets are classified as unmapped by Tk_IsMapped, causing reallocation failures. 2010-01-18 jkbonfield * primer3/src/Makefile: Fix to permit parallel makes * Makefile.in: Added dependencies between directories so parallel makes work. 2010-01-16 James Bonfield * Tagged rel-2-0-0-b4 * Tagged gap5-1-2-6 2010-01-15 James Bonfield * gap5/tg_index.c: Made the repad option public (was -x, not -g). Tidied up the usage message. * gap5/depad_seq_tree.c, gap5/depad_seq_tree.h, gap5/sam_index.c: Fix memory leak - we can now deallocate the pad tree. * ac_stubs/ax_lib_lzma.m4: Fixed link bug: -llzma and not -lzma * gap5/newgap5_cmds.c: Also initialise a.pair_reads in tcl_import_reads interface. * README.build, configure.in, staden_config.h.in, system.mk.in, tgap/Makefile: Added --with-lzma to specify the liblzma (xz utils) install root. Modified the makefiles and to support this. * gap5/maq.c, gap5/maqmap.c: Improved short/long maq format autodetection 2010-01-14 James Bonfield * ac_stubs/ax_lib_itcl.m4, ac_stubs/ax_lib_itk.m4, ac_stubs/ax_lib_iwidgets.m4, ac_stubs/ax_lib_lzma.m4, ac_stubs/ax_lib_png.m4, ac_stubs/ax_lib_samtools.m4, ac_stubs/ax_lib_tklib.m4, ac_stubs/ax_lib_zlib.m4: Added a AX_LIB_LZMA configure option. Fixed many of the expr regexp matches for version checking. These used . instead of \., sometimes causing 4.12 to be interpreted as 4,12,2 major,minor,patch levels. Also fixed the [0-9]* patterns which in a few cases was typo as [0-9*]. 2010-01-13 James Bonfield * gap5/export_contigs.c: Fixed the offset so that output to sam does not shift the data by 1. Also (#ifdefed out) added some experimental code to shrink cigar strings, assuming the consensus to be the reference. * gap5/gap5rc, gap5/gap5rc_menu_full, gap5/map_reads.tcl, gap5/search.tcl, gap5/tclIndex: Added an Assembly -> Map Reads menu. This allows running bwa externally to align data to our consensus sequences, and then importing them into Gap5. Experimental at the moment. * gap5/newgap5_cmds.c: Added tcl_import_reads interface. This is effectively an interface to the guts of the tg_index command. * tgap/tg_cache.c: Allow for 250k per seqblock instead of 150k. * gap5/depad_seq_tree.c, gap5/depad_seq_tree.h: Newer depadding functions that represent the unpadded to padded coordinate mapping in a sorted red-black tree instead of the usual array method. It is hoped that this will be smaller than a full array, assuming the pad density is not too high. * gap5/maq.c, gap5/maq.h: Moved tg_index and tg_view from tgap to gap5. This allows tg_index to start using gap5 functionality, eg calculating the consensus. This is used in an experimental repad option where the alignment of incoming data is padded to match an existing consensus. * gap5/Makefile, gap5/ace.c, gap5/ace.h, gap5/baf.c, gap5/baf.h, gap5/maqmap.c, gap5/maqmap.h, gap5/sam_index.c, gap5/sam_index.h, gap5/tg_index.c, gap5/tg_index.h, gap5/tg_index_common.c, gap5/tg_index_common.h, gap5/tg_view.c, tgap/Makefile, tgap/ace.c, tgap/ace.h, tgap/baf.c, tgap/baf.h, tgap/maq.c, tgap/maq.h, tgap/maqmap.c, tgap/maqmap.h, tgap/sam_index.c, tgap/sam_index.h, tgap/tg_index.c, tgap/tg_index.h, tgap/tg_index_common.c, tgap/tg_index_common.h, tgap/tg_view.c: Moved tg_index and tg_view from tgap to gap5. This allows tg_index to start using gap5 functionality, eg calculating the consensus. This is used in an experimental repad option where the alignment of incoming data is padded to match an existing consensus. * gap4/trace_display.tcl, gap5/trace_display.tcl: Fix a bug with poorly sized trace windows when initially brought up. This only happens sometimes, and only on some window managers. 2010-01-12 awhitwham * gap5/Makefile, gap5/template_display.c, gap5/template_display.h, gap5/template_draw.c, gap5/template_draw.h, tgap/hache_table.c, tgap/hache_table.h, tgap/tg_contig.c, tgap/tg_contig.h, tgap/tg_struct.h, tk_utils/tkRaster.c, tk_utils/tkRaster.h: Changes to speed up the template display showing large numbers of reads. 2010-01-04 James Bonfield * tgap/tg_iface_g.c: Fixed bug in reorder_by_read_group mode while decoding. * gap4/list_contigs.tcl: Honour the contig order 2009-12-08 James Bonfield * gap5/consensus.c: Fixed a memory corruption / cache counting problem when working on complemented contigs. * gap5/consen.tcl: Honour the Strip Pads dialogue option. * gap5/docs/TODO: * gap5/hash_lib.c: Random musings in comments * tgap/zfio.c: Added so that R_OK is defined. 2009-12-04 James Bonfield * tgap/tg_gio.c, tgap/tg_gio.h, tgap/tg_iface.h, tgap/tg_iface_g.c, tgap/tg_index.c, tgap/tg_index.h: Added a -c to tg_index. This in turn gets passed all the way down into tg_iface_g.c which now properly supports switching from zlib to either no compression or liblzma. The top bits of the format bytes now encode the compression method. This will still be disabled though unless -DHAVE_LIBLZMA is specified in CFLAGS of the Makefile, which currently there is no autoconf setting for. Also adjusted the format for GT_SeqBlocks to reorder quality and names by the read-group (parent_rec field). This improves compression of mixed assemblies. 2009-11-30 James Bonfield * gap5/Makefile, gap5/contig_editor.tcl, gap5/editor_search.c, gap5/editor_search.tcl, gap5/editor_view.h, gap5/tkEditor.c: Added some basic editor searching. It's not as complete as Gap4, but supports consensus sequences, read names and consensus quality scores. * tgap/tg_gio.c: Bug fix to child IO: we now inherit the read-only flag too. This prevents the editor from crashing due to consensus caching when cutting and pasting out of the editor consensus line. 2009-11-27 James Bonfield * tgap/tg_iface_g.c: Added experimental code to support liblzma instead of zlib for compression of data. The results vary based on input data, but appear to be around 15% smaller at a cost of 2-4x CPU usage. Also added code to reorder quality values and names when writing a seq block so that sequences from the same library are adjacent to one another. This further improves compression ratio, depending on whether mixed libraries are in use: about 7% smaller on a 1000genomes mixed sample. Both of these changes are hidden behind #ifdefs and are currently disabled. 2009-11-23 James Bonfield * tgap/tg_struct.h: Increased size_hist[] dimensions. The values can be 0 to 1792 inclusive, so it now reads [LIB_BINS+1]. This fixes a corruption when dealing with values over 1Mb in size. * gap5/break_contig.c: Fixed a bug with break contig due to over-ambitious optimisation. 2009-11-18 James Bonfield * gap4/legacy_f2c.c: Fixed ancient bug involving elipses and function prototypes. I'm not sure why it's only surfaced now, but perhaps it's a compiler version thing. On AMD64 gcc generates different code when calling a function with ... args than when calling a function with specific types args, even when the types are the default C promotion rules. Fixed the various extern int declarations of swrt*_ functions to use ... instead of the auto-generated full argument list. These now match those in f2c.c and so fixes an illegal instruction and crash. 2009-11-17 James Bonfield * tgap/tg_cache.c: More minor stats on exit. * gap4/edCommands.c: Fixed an issue with turning off undo in remove pad columns. It still turns it off in some cases, but it now clears the existing undo history and it reactivates it once all the pad insertions have happened. * gap4/gap4: Allowed for GTAGDB to be set outside the wrapper script. * tgap/sam_index.c: Fixed several sam parsing bugs. 1) We now reset the number of insertions to zero for each new contig. This was causing data to be shifted in susbequent contigs. 2) Pads can no longer get inserted at the end of a read. 3) The lowercase letters immediately prior to a deletion are now uppercase again. 2009-11-16 James Bonfield * tgap/tg_bin.c: Fixed a bug in bin_for_range(). When recursing down bins it could only create one extra layer of bin on the right hand child of a bin. This was because it didn't reset the f_a and f_b variables used by NORM/NMIN/NMAX macros. (Bug added when we fixed this code to handle inserting to complemented bins.) * gap5/editor_join.c: Fixed a bug in join_invalidate(). It was invalidating all of the right hand contig rather than just the overlapping region. 2009-11-12 James Bonfield * gap5/export_contigs.c: Added @RG header lines and RG:Z:* auxillary sequence records, using the new name field from libraries. * gap5/libraries.tcl, tgap/maq.c, tgap/sam_index.c, tgap/tg_iface_g.c, tgap/tg_index_common.c, tgap/tg_library.c, tgap/tg_library.h, tgap/tg_struct.h, tgap/tg_tcl.c: Added a name field to libraries, so we can track their original names in SAM. 2009-11-09 James Bonfield * configure.in, gap5/gap.tcl, tgap/tg_index.c, tgap/tg_view.c: Version updates - for a local 2.0.0b3 test release internal to Sanger (or those that wish to fish out the source from SVN). Primary changes are bug fixes. * gap5/consen.tcl, gap5/gap4_compat.c: Fixed the lget_contig_num to always clip off cutoff data when interpreting the contig start/end values. This allows for consensus saving to always behave better now too. * gap5/editor_join.c: Fixed bugs with the "align" join editor button. * gap5/consensus.c: Fixed bug in consensus_valid_range where a right hand cutoff of > 1Kb was reported as 1Kb only. Fixed a bug with using cached consensus data from bins that don't quite butt up to one another. Why this happens I am unsure still (likely a bug in contig joining), but the defensive approach is to detect it and fall back to filling in the consensus gaps using the old technique. Also fixed a consensus algorithm bug where we could overflow the cache and break things. We use cache_incr/decr now to protect against this. * tgap/tg_cache.c: Fix the internal seq_t pointers if we've had to realloc it during a resize request. 2009-11-05 James Bonfield * tgap/g-files.c, tgap/g-io.c: The read_aux_index_* functions now return the number of entries read, rather than just 0 or -1. This allows for us to ask to read 256 and only get back 200 without being in error. This is now utilised in g_read_index() which reads blocks of index records rather than 1 at a time, vastly reducing the number of seek/read system calls needed. 2009-10-30 James Bonfield * tgap/sam_index.c: Added a "-d data_type_list" option to tg_index. By default we store everything, but now we have the option of skipping the read names or qualities, or just storing nothing at all (except layout data). * tgap/baf.c, tgap/maq.c, tgap/tg_index.c, tgap/tg_index.h, tgap/tg_index_common.c: Added a "-d data_type_list" option to tg_index. By default we store everything, but now we have the option of skipping the read names or qualities, or just storing nothing at all (except layout data). Also fixed the library size histograms generated in tg_index_common.c. * gap5/export_contigs.c: Improved BAF output. It now contains tags, listed in the correct location with respect to their sequences. (This proved harder than expected.) 2009-10-28 James Bonfield * gap5/docs/TODO: * gap5/newgap5_cmds.c: Added export_tags C-to-Tcl binding 2009-10-26 James Bonfield * gap5/export_contigs.c, gap5/export_contigs.h, gap5/export_contigs.tcl, gap5/gap5rc_menu_full, gap5/tclIndex: Added an Export Tags function. Currently it only outputs in GFF format and it requires testing yet to see whether it is fully GFF conformant. 2009-10-22 James Bonfield * gap5/result_manager.tcl: Added missing file - forgot to check this in! * tgap/tg_contig.c, tgap/tg_contig.h, tgap/tg_struct.h: The contig iterators can now be given a type too to iterate sequences only (the previous mechanism), annotations only, or anything. * tgap/tg_iface_g.c: Fixed a bug in AnnoEleBlock encoding where the obj_rec was invalid. (Typically this has no effect due to it being in the range array too.) 2009-10-19 James Bonfield * ac_stubs/ax_lib_iwidgets.m4: Added default install path as used by Debian. 2009-10-16 James Bonfield * Tagged VERSION 2.0.0b2 2009-10-16 James Bonfield * tgap/tg_gio.h, tgap/tg_iface_g.c, tgap/tg_index.c, tgap/tg_index.h: Added a "-r nseqs" option to tg_index to reserve space in the aux file. This is an interim solution for the internal record number (ie not the actual index into the aux) not being a 64-bit number. Problems currently arise due to packing 1024 sequences into a SeqBlock record. We simulate individual sequence records by taking the record number of the SeqBlock and multiplying by 1024, then adding in the element number. However this means we have 2^21 instead of 2^31 records avaalable in total, meaning 2 million bins is enough to make it impossible to allocate any sequences unless we ensure that we reserve the lower record numbers for the sequence/anno blocked structures. The correct solution, to be implemented later, would be to use a 64-bit record type. 2009-10-16 Andrew Whitwham * tgap/tg_index_common.c, tgap/tg_index_common.h: Faster pair indexing. * tgap/ace.c, tgap/baf.c, tgap/maq.c, tgap/sam_index.c: Faster two directional pairing. 2009-10-15 James Bonfield * tgap/g-alloc.c: turned off VALGRIND mode * tgap/sam_index.c: Added a comment * gap5/docs/TODO: * tgap/baf.c: Allow for extra blank lines in the baf file. Report time %age more often, also listing the number of contigs created since last checkpoint as this has a significant impact on speed. 2009-10-14 James Bonfield * tgap/tg_anno.c: Fixed return value from anno_ele_set_type(), This sometimes caused saving a tag in the contig editor to fail with an error dialogue. * configure.in: version change to 2.0.0b2 * gap5/docs/TODO: * tgap/baf.c: Fix bug when processing annotations with no text comment. * tgap/ace.c, tgap/tg_tcl.c, tgap/zfio.c: Bug fix for zlib.h and LARGE_FILE support; move or add staden_config.h include * copy_reads/copy_reads, gap4/gap4, gap5/gap5, prefinish/prefinish, pregap4/pregap4, spin/spin, spin_emboss/create_emboss_files, trev/trev: Bug fix for when LD_LIBRARY_PATH hasn't already been exported in user's environment * Makefile.in: Small update to distsrc * Misc/array_arith.h, Misc/find.c, Misc/usleep.c, gap4/tman_cons.c, pregap4/Makefile, scripts/Makefile, seq_utils/sequence_formats.c, spin/nip_cmds.h, spin/nip_structs.h, spin/nip_translation.tcl, spin/resource.h, spin/seq_id.tcl, spin/seq_results.h, tk_utils/biolimsbox.tcl: Fixed rogue executable property 2009-10-13 James Bonfield * Gap5 VERSION 1.2.4 * 2009-10-13 James Bonfield * ac_stubs/ax_lib_itcl.m4, ac_stubs/ax_lib_itk.m4: Now detects the default itcl/itk install on 32-bit fedora 11 systems. * tgap/g-files.c: Removed the large integer constant from assert. It just causes warnings as there's no real portable way to define it as long long (eg 0x7fffLL). * gap5/gap5: Set execute property * gap5/ChangeLog, gap5/NEWS: * gap5/gap.tcl: Bumped version to 1.2.4 * gap5/gap4_compat.tcl: removal of debugging info * gap5/editor_view.c, tgap/tg_contig.c, tgap/tg_contig.h: #ifdef-ed out the code to allow cached consensus sequences to be visible in the editor and/or template displays. See tg_contig.h for the #define to reenable this if further debugging is required. 2009-10-12 James Bonfield * tgap/zfio.c, tgap/zfio.h: Added the zfopen/zfgets/zfclose interface. This is required by the gzip support added a couple checkins ago, but was omitted through error. * copy_reads/copy_reads, copy_reads/copy_reads_main.tcl, gap4/gap4, gap5/gap5, pregap4/pregap4, spin/spin, spin_emboss/acd2tcl.tcl, spin_emboss/create_emboss_files, spin_emboss/create_emboss_files.tcl, tk_utils/Makefile, tk_utils/init.c, tk_utils/init.tcl, trev/trev: Replaced use of stash by tclsh. This means that the setting of TCL_LIBRARY is pushed over to the system install of Tcl rather than us having to work it out for stash instead. To facilitate this, the tkinit function is no more and the few bits it did have been moved into Tk_Utils_Init instead. Replaced the odd required use of tkinit with "package require Tk". Also fixed create_emboss_files to run in the correct directory. * gap5/export_contigs.c: We now output @SQ header lines to SAM format, meaning it can be used to load in again via tg_index or converted to bam directly without using a .fai file. Also ensure that all contig coordinates are positive, shifting data if required, as SAM requires positions >= 1. * tgap/tg_index.c: Removed the old "aln" format from tg_index. Tg_index now attempts to automatically work out the file type for the data files (eg sam vs ace etc). * configure.in, staden_config.h.in, tgap/Makefile, tgap/ace.c, tgap/baf.c, tgap/baf.h, tgap/sam.c, tgap/sam.h, tgap/sam_index.c, tgap/sam_index.h: Renamed sam.[ch] to sam_index.[ch] to avoid header file clash with samtools. Added gzipped file support for ACE/BAF. Removed the old "aln" format from tg_index. Tg_index now attempts to automatically work out the file type for the data files (eg sam vs ace etc). 2009-10-09 James Bonfield * gap5/contig_editor.tcl, gap5/editor_view.c: The editor now starts up at the reading specified rather than base 1 of the contig. * tgap/tg_tcl.c: Bug fixed the sequence object. Fetching the record from the sequence appears to have broken when we moved to SeqBlock structs. * tgap/sam.c: Added code to generate SAMX type tags from the SAM auxillary tags. For now this is #ifdefed out via SAM_AUX_AS_TAG, as it adds unnecessarily to file size. * gap5/export_contigs.c: Improved SAM file generation, specifically the flags. Also added code to generate the insert size and position columns. This majorly slows down the code so for now it's disabled, but I plan on making it an option at some stage. * tgap/ace.c: Minor reformatting * tgap/tg_index.c, tgap/tg_index.h, tgap/tg_index_common.c, tgap/tg_index_common.h: When using tg_index -t to index sequence names, the B+Tree index is now built at the end rather than while adding sequences. To do this is writes to a temporary file, sorts the result, and then adds the items in an already sorted fashion. This *dramatically* reduces the number of cache misses in btree nodes. Testing on a project with 24million sequences the wall-clock time dropped from ~126000 seconds to 750 seconds. Without name indexing it took 549 seconds, implying only a small overhead to index names now. * tgap/b+tree2.c, tgap/b+tree2.h, tgap/tg_iface_g.c: Improved the encoding of B+Tree nodes. These are packed in a better manner now and compressed too. Gap5 can still read the old format data, but newer gap5 databases will not be readable by old gap5 versions if name indexing is used. 2009-10-07 James Bonfield * gap5/docs/TODO: * gap5/export_contigs.c: For ACE format output, added back the DS lines as they appear to be mandatory for consed, even if often pointless. Also adjusted the BS line generation to work better when contigs have holes. * gap5/Makefile: Added find_oligo.o to objs list * gap5/consensus.c: In calculate_consensus_simple we no longer skip bins with no range data as this prevented us from caching the consensus in a blank bin. 2009-10-02 Andrew Whitwham * tgap/Makefile, tgap/ace.c, tgap/baf.c, tgap/g-alloc.c, tgap/maq.c, tgap/sam.c, tgap/tg_index_common.c: Moved common functions to tg_index_common. * tgap/tg_index_common.c, tgap/tg_index_common.h: Initial version. 2009-10-02 James Bonfield * gap5/newgap5_cmds.c: Added the Tcl interface to find_oligos (sequence search). Accidentally missed in earlier checkin. * tgap/tg_bin.c: Now invalidate consensus cache when adding new sequences in bin_add_range() 2009-10-01 James Bonfield * gap5/find_oligo.c, gap5/find_oligo.h, gap5/find_oligo.tcl, gap5/gap5rc, gap5/gap5rc_menu_full: Added the Sequence Search option. Missing (compared to gap4) right now is the ability to search the sequence covered by a specific tag type to then find all other occurences of that sequence elsewhere. It's a bit specific and likely not of top most priority, so it's disabled for now. 2009-09-30 James Bonfield * tgap/tg_contig.c: Fixed bug where inserting/deleting a base to the consensus crashed if we have an annotation at that position. * gap5/break_contig.c, gap5/consensus.c, gap5/editor_join.c, gap5/editor_view.c, tgap/tg_contig.c, tgap/tg_contig.h, tgap/tg_iface_g.c, tgap/tg_sequence.c, tgap/tg_sequence.h, tgap/tg_struct.h: Added a new experimental consensus caching system. The consensus is stored as a fragmented sequence along with other sequences, breaking it into (approximately) 64k blocks to be stored in bins at the appropriate level. To achieve this, the range flags have been extended from seq vs "isanno" to a mask and a set of values, allowing for ISCONS and (unimplemented) ISREF too. Consequently a lot of code needed to be modified; more still does too including the contig editor, where cached consensus is currently visible purely for debugging purposes. Editing, breaking and joining contigs invalidates cached consensus. A new contig_bins_in_range function has been created to look for the candidate bins that may contain cached consensus data. Also fixed sequence_copy so that it didn't zero rec, block and idx subfields. * gap5/newgap5_cmds.c: Fixed memory leak in tcl_reformat_sequence * tgap/ace.c, tgap/baf.c, tgap/maq.c, tgap/sam.c, tgap/tg_anno.c, tgap/tg_bin.c, tgap/tg_bin.h, tgap/tg_index.c, tgap/tg_tcl.c: bin_add_range and bin_for_range functions now take an extra argument to return whether the bin in complemented relative to the contig. * tgap/tg_gio.c, tgap/tg_gio.h: Added a read_only flag to GapIO so we can easily query if we can modify the database. 2009-09-24 James Bonfield * tgap/tg_cache.c: Newly created sequences now get their seq->rec field set correctly. * Makefile.in, gap4/Makefile, global.mk, mutlib/Makefile: More small tweaks regarding make depend. * seqed/Makefile, spin2/Makefile, tracediff/Makefile: Futher dependency tweaks * copy_reads/copy_reads, gap4/gap4, gap5/gap5, prefinish/prefinish, pregap4/pregap4, spin/spin, spin_emboss/create_emboss_files, trev/trev: Improvements to setting LD_LIBRARY_PATH. * Misc/Makefile, Misc/dependencies, abi/Makefile, abi/dependencies, alf/Makefile, alf/dependencies, convert/Makefile, convert/dependencies, copy_reads/Makefile, copy_reads/dependencies, eba/Makefile, eba/dependencies, find_renz/Makefile, find_renz/dependencies, g/Makefile, g/dependencies, gap4/Makefile, gap4/dependencies, gap5/Makefile, get_scf_field/Makefile, get_scf_field/dependencies, global.mk, haplo/Makefile, haplo/dependencies, hetins/Makefile, hetins/dependencies, init_exp/Makefile, init_exp/dependencies, make_weights/Makefile, make_weights/dependencies, mutlib/Makefile, mutlib/dependencies, mutscan/Makefile, mutscan/dependencies, polyA_clip/Makefile, polyA_clip/dependencies, prefinish/Makefile, prefinish/dependencies, primer3/src/Makefile, primer3/src/dependencies, qclip/Makefile, qclip/dependencies, screen_seq/Makefile, screen_seq/dependencies, seq_utils/Makefile, seq_utils/dependencies, seqed/Makefile, seqed/dependencies, spin/Makefile, spin/dependencies, spin2/Makefile, spin2/dependencies, stops/Makefile, stops/dependencies, text_utils/Makefile, text_utils/dependencies, tgap/Makefile, tk_utils/Makefile, tk_utils/dependencies, tracediff/Makefile, tracediff/dependencies, trev/Makefile, vector_clip/Makefile, vector_clip/dependencies: Major overhaul of the "make depend" system. We no longer use the make include directive to load in a prebuilt dependencies file. Instead this is appended to the Makefile itself. Furthermore the users can just do a direct make without having the auto-dependency code to run, removing the requirement on imake (for makedepend) to build. Developers will still want to use make depend from time to time. 2009-09-18 James Bonfield * gap5/tkEdNames.c: Fixed buffer overflow in the get_number method. (Previously fixed for the tkEditor widget.) 2009-09-15 James Bonfield * tgap/sam.c, tgap/tg_iface_g.c, tgap/tg_index.c, tk_utils/tkTrace.c: Added more #include statements, or in some cases moved them so they appear before sys/types.h gets included. This fixes some compilation issues on 32-bit fedora. * global.mk: Switched from using LD_RUN_PATH to LD_LIBRARY_PATH during linking. We need one of these so (for example) libmisc.so, referenced by libtk_utils.so, is found when we use only -ltk_utils (and no explicit -lmisc is used). LD_RUN_PATH however had the undesireable effect of forcing the build directory to be searched even after a make install. * ac_stubs/ax_lib_itcl.m4, ac_stubs/ax_lib_itk.m4, ac_stubs/ax_lib_iwidgets.m4, ac_stubs/ax_lib_tklib.m4, shlib.conf.in: Improvements for handling itcl/itk on Centos (and presmuably other OSes). 2009-09-10 James Bonfield * gap5/contig_editor.tcl: Improvements to undo for tag editing. * gap5/consensus.c: Added code (currently "#if 0"ed out) to attempt to cache the consensus in tracks per bin. Specifically the plan was to store the A,C,G,T,* accumulated log(probability) values for data held within that bin as a track. It means we can compute the consensus without having to load all the invdividual sequences. In practice, it does speed up the consensus generation when cached (usually only barely, but occasionally by > 10x), but the downsides are considerable. It needs read-write access, and worst of all the space it takes up is very substantial - often far more than the rest of the database. The existing implementation also is only approximate as we store the floating point values in very low precision. Given the size problems I'm planning on reimplementing this via another means, but the code is checked in here (disabled) so I can revert or refer back to it at some stage if required. Also see the code changes to tg_iface_g.c. * gap5/newgap5_cmds.c: Use ckfree instead of free to fix memory corruption, in tcl_calc_consensus() * README.build: Fixed typo * tgap/tg_bin.c, tgap/tg_bin.h, tgap/tg_cache.c, tgap/tg_iface_g.c, tgap/tg_struct.h: Added a bin_track_t struct to house the in-memory track data, instead of using the GBinTrack struct which should only be known by the "g" interface code. This has also allowed the addition of a track pointer to be cached within the bin_track_t struct, meaning we can add fake / temporary tracks to a bin structure (they're not written back to disk) and still query them back again without having to load from a record number. 2009-09-07 James Bonfield * tgap/tg_iface_g.c: Removed debugging information. 2009-09-04 James Bonfield * convert/bapDB.h, gap4/gap-error.c, gap4/legacy_f2c.c, gap4/shuffle_pads.c, gap5/editor_view.c, gap5/gap-error.c, gap5/gap4_compat.c, gap5/newgap5_cmds.c, gap5/qualIO.c, polyA_clip/Makefile, polyA_clip/polyA_clip.c, qclip/Makefile, qclip/qclip.c, tgap/b+tree2.c, tgap/baf.c, tgap/g-request.c, tgap/tg_anno.h, tgap/tg_iface_g.c, tgap/tg_register.h, tgap/tg_view.c, tk_utils/capture.c, tk_utils/tkTraceIO.c: General warning tidyup to remove complaints from the SunStudio C compiler. * configure.in, staden_config.h.in, system.mk.in: Use TEA_CONFIG_CFLAGS to override the predefined vars loaded by TEA_LOAD_TCLCONFIG. This means we can work out how to build shared libraries if we pick a different compiler than the one used to build the system tcl. Eg ./configure ... CC=foocc 2009-09-03 James Bonfield * gap5/docs/TODO: * gap5/contig_editor.tcl, gap5/gap5rc_menu_full, gap5/tkEditor.c: The contig editor now has add/remove tags functionality. * tgap/tg_cache.c: Fixed cache_item_create_anno_ele to initialise anno_ele_t->rec field. * tgap/tg_anno.c, tgap/tg_anno.h, tgap/tg_tcl.c: Created a anno_ele_add and anno_ele_destroy function to make adding and removing tags easier. These can be called from the Tcl object interface too. The tcl obj interface also has other additional functions: new_contig/sequence/anno_ele (from $io), * gap5/break_contig.c, tgap/tg_bin.c, tgap/tg_contig.c, tgap/tg_iface_g.c, tgap/tg_sequence.c, tgap/tg_struct.h: Allow for range items to be marked as unused (free). They form a linked list, with a new rng_free member of the bin_index_t structure pointing to the head of the list. (If this isn't present due to an older format database it'll automatically get created when it's next written to, although this will migrate the DB to be unusable by the old gap5.) 2009-09-01 James Bonfield * ac_stubs/ax_lib_iwidgets.m4: Allow the --with-iwidgets=DIR parameter to include the iwidgets package directory itself too, rather than just the prefix * ac_stubs/ax_lib_itcl.m4, ac_stubs/ax_lib_itk.m4: Adding /usr/lib64 to the search path, helping it to work out of the box on 64-bit fedora * ac_stubs/ax_lib_tklib.m4: Fix cut and paste error - no means yes in some diagnostic output... * ac_stubs/tcl.m4: Removed error output when /usr/include/tcl* doesn't match anything * gap5/editor_view.c, gap5/editor_view.h, gap5/tkEdNames.c, gap5/tkEditor.c: Modified edview_item_at_pos to control whether we want only sequences returned or also tags. This allows selecting a region to work over a tag, which previously caused gap5 to crash. * tgap/tg_anno.c, tgap/tg_anno.h, tgap/tg_tcl.c: Added various set methods to the anno_ele struct, both from C and also via the tcl interface. * tgap/baf.c: Tags now interpret "\n" as a newline, enabling multi-line annotations. 2009-08-25 James Bonfield * ac_stubs/ax_lib_itcl.m4, ac_stubs/ax_lib_itk.m4, ac_stubs/tcl.m4: Added /usr/lib64 to search paths. 2009-08-12 Andrew Whitwham * tgap/tg_struct.h: Added define to make build work. 2009-08-07 James Bonfield * Gap5 VERSION 1.2.3 * 2009-08-07 James Bonfield * staden/trunk/doc/Makefile, configure.in, gap5/NEWS: Minor tweaks to set version to 2.0.0b1 * tgap/ace.c, tgap/ace.h, tgap/baf.c, tgap/baf.h, tgap/maq.c, tgap/maq.h, tgap/sam.c, tgap/sam.h, tgap/tg_index.c, tgap/tg_index.h: Added a -f (fast mode) parameter to tg_index. When linking read-pairs this links A' to A but not A back to A'. This reverse link is desireable, but currently causes major I/O bottlenecks on very large data sets. I'll address this later in a better fix, so -f will probably be only a temporary option. * gap5/contig_editor.tcl, gap5/editor_view.c, gap5/tkEdNames.c: Fixesd bugs with mouse-over events in the editor names panel. We now always display a name, rather than accidentally picking a tag. In one-per-line non-stacking mode we now also correctly display the name. * gap5/docs/TODO: 2009-08-06 James Bonfield * gap5/break_contig.c, gap5/editor_join.c: Both breaking and joining contigs now track the number of sequences per bin correctly. For break contig only: - Fixed a common crash. - Annotations now get moved correctly too. * gap5/editor_view.c: Minor debugging changes. * tgap/tg_contig.c: Minor change to contig_dump_ps(). * gap5/docs/PLANS, gap5/docs/TODO: * gap5/docs, gap5/docs/DESIGN, gap5/docs/IMPLEMENTATION, gap5/docs/TRACKS, gap5/docs/Tree_format: Added some gap5 code/design documentation. A lot of it is out of date now or is information on how I thought things would go rather than how they ultimately got implemented, but hopefully it's of use to curious browsers still. 2009-08-05 James Bonfield * tgap/tg_iface_g.c: Fixed bug in io_anno_ele_block_read. The sub cached_item records were all set to be type GT_Seq rather than type GT_AnnoEle meaning cache_rw would crash later. * gap5/gap4_compat.c: Protect against contigs with zero sequences in io_clnbr and io_crnbr. 2009-08-03 James Bonfield * configure.in: typo fix 2009-07-31 James Bonfield * gap5/tkEditor.c: Fixed a buffer overrun in the editor get_number method. 2009-07-30 James Bonfield * tk_utils/help_choose.tcl, tk_utils/help_config: Fixed paths for displaying help 2009-07-28 James Bonfield * Makefile.in, configure.in, io_lib: Removed io_lib stub directory and also removed the option of compiling using a local io_lib directory in the staden package Makefiles. * io_lib/branches, io_lib/tags, io_lib/trunk, io_lib/trunk/CHANGES, io_lib/trunk/COPYRIGHT, io_lib/trunk/ChangeLog, io_lib/trunk/Makefile, io_lib/trunk/Makefile.am, io_lib/trunk/README, io_lib/trunk/acinclude.m4, io_lib/trunk/bootstrap, io_lib/trunk/configure.in, io_lib/trunk/dependencies, io_lib/trunk/docs, io_lib/trunk/include, io_lib/trunk/io_lib, io_lib/trunk/io_lib-config.in, io_lib/trunk/io_lib.m4, io_lib/trunk/man, io_lib/trunk/options.mk, io_lib/trunk/progs, io_lib/trunk/tests, io_lib/CHANGES, io_lib/COPYRIGHT, io_lib/ChangeLog, io_lib/Makefile, io_lib/Makefile.am, io_lib/README, io_lib/acinclude.m4, io_lib/bootstrap, io_lib/configure.in, io_lib/dependencies, io_lib/docs, io_lib/include, io_lib/io_lib, io_lib/io_lib-config.in, io_lib/io_lib.m4, io_lib/man, io_lib/options.mk, io_lib/progs, io_lib/tests: Moved io_lib from staden source tree into it's own top-level subversion directory, complete with tags, branches, and trunk. For now the old tagged copies of io_lib are still in the staden/tags/ directory with tag names io_lib-, but that is perhaps right and proper (as it's where the code actually resided at that release number). * io_lib/abi, io_lib/alf, io_lib/ctf, io_lib/exp_file, io_lib/plain, io_lib/read, io_lib/scf, io_lib/sff, io_lib/srf, io_lib/utils, io_lib/ztr: Remove old stub directories; these come from the earlier CVS tree when we had the library split into per-format directories. * io_lib/progs/Makefile.am, io_lib/progs/solexa2srf.c, io_lib/progs/srf2solexa.c: Removed Illumina/Solexa specific programs. These are now out of date with respect to Illumina's own fork, plus I don't think they belong in the largely platform agnostic library. * io_lib/CHANGES, io_lib/ChangeLog, io_lib/README, io_lib/configure.in, io_lib/io_lib/Makefile.am: Preparations for 1.12.0 release. There is now proper versioning support for the library too. The soname used here is libstaden-read.so.1, to distinguish from any earlier dynamic libraries. (The ABI definitely has changed over the years in incompatible manners.) * io_lib/tests/data/slx_out/both.info, io_lib/tests/data/slx_out/raw.info: Updated for new format srf_info output * io_lib/tests/data/slx_out/proc.info: Updated with new format output. 2009-07-27 James Bonfield * io_lib/io_lib/vlen.c: Include os.h so we can pick up NEED_VA_COPY definition. * io_lib/progs/srf_filter.c: Reorganisation to allow chunks to be added as well as removed. At present this only supports adding REGN chunks. (Patch supplied by Steven Leonard.) * io_lib/progs/index_tar.c: Handle GNU tar extensions: LongLink notation. (Patch supplied by Steven Leonard). * io_lib/progs/srf2fasta.c, io_lib/progs/srf2fastq.c, io_lib/progs/srf_extract_hash.c: Changed the maximum read length from 1024 to 10000. This allows for capillary traces to be stored in SRF. (Patch supplied by Steven Leonard) * io_lib/progs/srf_info.c: Use int64_t instead of long for base counts and chunk sizes. (Supplied by Steven Leonard.) * io_lib/man/man1/srf_info.1, io_lib/progs/srf_info.c: Added compressed chunk size to the per-chunk type output. This allows us to see what takes up the most storage in an SRF. * io_lib/io_lib/ztr.c: removed C9Xism * io_lib/configure.in, io_lib/io_lib/Makefile.am, io_lib/progs/Makefile.am: Re-enabled libtool, with a workaround to remove the infuriating rpath nonsense. (It's now 2x slower to configure, 3x slower to compile and 10x more anguish to debug, but at least I can sleep at night knowing rpath hasn't had it's wicked way with the code.) * data/Makefile: * ac_stubs/ax_lib_itcl.m4, ac_stubs/ax_lib_itk.m4, ac_stubs/ax_lib_iwidgets.m4, ac_stubs/ax_lib_png.m4, configure.in, shlib.conf.in, staden_config.h.in, system.mk.in, tk_utils/tkTrace.c: More autoconf checks; for itcl, itk, and png. In the case of png it's an optional --with and if not found we simply disable the one piece of code that relies on it. 2009-07-24 James Bonfield * ac_stubs/ax_func_va_copy.m4, ac_stubs/ax_lib_iwidgets.m4, ac_stubs/ax_lib_tklib.m4, shlib.conf.in: More autoconf checks. * configure.in, global.mk: Removed the dependency on Fortran for building. For now we'll use the f2c converted code. It may not be quite as efficient (not tested that), but it's trivial to build everywhere and we're not modifying the code at all. * Makefile.in, io_lib/io_lib/Makefile: Added a Makefile for io_lib/io_lib; so the library itself. This isn't expected to be used normally, but it allows me to test local copies of io_lib (under a different library name) in conjunction with the staden source tree before releasing either. * tgap/tg_iface_g.c: Changed allocate() to take a data type argument too. The plan for this (#ifed out at the moment) is to reserve different record-spaces for blocked data vs nonblocked data. Without this we hit problems when the number of records goes above 2 million, meaning the 10-bits of sub-record used for sequence indexing takes us over 31-bits record size. (Maybe long-term we should just use 64-bit record IDs; this is a temporary hack and commented out in the main source tree.) * tgap/sam.c, tgap/tg_index.c: Fixed HAVE_SAMTOOLS macro name. 2009-07-23 James Bonfield * vector_clip/vector_clip.c: Removed rotate_seq() and use the identical copy in seq_utils. 2009-07-22 James Bonfield * prefinish/prefinish_lib.tcl, prefinish/prefinishrc, pregap4/modules/interactive_clip.p4m, pregap4/modules/screen_seq.p4m, pregap4/modules/sequence_vector_clip.p4m, pregap4/pregap4.tcl, pregap4/templates.tcl, spin_emboss/emboss_utils.tcl, tk_utils/help.tcl, tk_utils/help_macosx.tcl: Various pathname tweaks to use STADLIB and/or STADTCL variables correctly. * gap4/acd2tag.tcl, gap4/gap_prefinish.tcl, gap5/gap5rc, prefinish/prefinish.tcl, spin_emboss/acd2tcl.tcl: Use package require instead of load_package for iwidgets. * README.build: Minor update listing system specifics * ac_stubs/ax_lib_staden_io_lib.m4, ac_stubs/libcurl_check_config.m4, configure.in: Improved output messages while running autoconf. Samtools is also now permitted to not exist, rather than aborting. * ac_stubs/tcl.m4: Fixed --with-tcl/tk and --with-tkinclude to also search the default install locations used by Debian. * tk_utils/xmclistbox.tcl: Fix tab stops so the code works with tk8.5 * tk_utils/sheet.c, tk_utils/sheet.h: Updated to work with Tk 8.5 font methods. * mutlib/staden.h: Work around problem in io_lib/compress.h on newer linux. The pipe2() function has been added and clashes. * tgap/sam.c, tgap/tg_index.c: Check for HAVE_SAMTOOLS_H, so we can compile without samtools being installed. 2009-07-20 James Bonfield * tgap/tg_tcl.c: Include staden_config.h so HAVE_UNISTD_H is defined prior to tcl includes. This prevents a conflict between Tcl's compat/unistd.h when building against Tcl 8.5. * seq_utils/Makefile, spin/Makefile, spin_emboss/Makefile, trev/Makefile: Further tweaks to distsrc Makefile target * spin/seq_reg_cmds.c: Removed remnant of licence checking * pregap4/pregap4.tcl, spin/spinrc: Replaced our local load_package interface witht he standard package require => Iwidgets now found * pregap4/pregap4rc: Fixed search path for pregap4 modules * README.build, configure.in, system.mk.in: Added FORTRAN checks into autoconf. * tk_utils/tkRaster.c: Removed debugging output * Makefile.in, Misc/Makefile, README.build, abi/Makefile, alf/Makefile, configure.in, convert/Makefile, copy_reads/Makefile, eba/Makefile, find_renz/Makefile, g/Makefile, gap4/Makefile, gap4/fak2rc, gap4/gap4, gap5/Makefile, gap5/gap5, get_scf_field/Makefile, global.mk, haplo/Makefile, hetins/Makefile, init_exp/Makefile, make_weights/Makefile, mutlib/Makefile, mutscan/Makefile, polyA_clip/Makefile, prefinish/Makefile, pregap4/Makefile, primer3/Makefile, primer3/src/Makefile, qclip/Makefile, screen_seq/Makefile, scripts/Makefile, seq_utils/Makefile, shlib.conf.in, spin/Makefile, spin_emboss/Makefile, stops/Makefile, system.mk.in, text_utils/Makefile, tgap/Makefile, tk_utils/Makefile, tracediff/Makefile, trev/Makefile, vector_clip/Makefile: "make distsrc" should now work. It creates a subdirectory containing the files necessary for distribution. Note for now this isn't the entire tree as some programs are unfinished and unsupported (spin2, seqed). 2009-07-17 James Bonfield * gap4/newgap_cmds.c, gap4/tkEditor.c, gap5/newgap5_cmds.c, gap5/tkEditor.c, tk_utils/capture.c: Further changes to do with TCL_DYNAMIC and not using ckalloc. We now use TCL_VOLATILE where appropriate (or ckalloc). * Makefile.in, Misc/Makefile, Misc/vlen.c, abi/Makefile, ac_stubs/ax_lib_samtools.m4, alf/Makefile, configure.in, convert/Makefile, copy_reads/Makefile, copy_reads/copy_reads, copy_reads/copy_reads_main.tcl, copy_reads/copy_readsrc, data, data/RENZYM.4, data/RENZYM.6, data/RENZYM.ALL, data/alus, data/blast_data, data/gcodes, data/m13mp18_primers, data/pam250, data/renzyme_bairoch, data/vector_primer, data/vectors, eba/Makefile, find_renz/Makefile, g/Makefile, gap4/GTAGDB, gap4/Makefile, gap4/NOTEDB, gap4/cap2rc, gap4/cap3rc, gap4/checked.gif, gap4/fak2rc, gap4/follow.bitmap, gap4/gap-tcl.c, gap4/gap.tcl, gap4/gap4, gap4/gap4_defs.mk, gap4/gap_prefinish.tcl, gap4/gaprc, gap4/gaprc_menu_demo, gap4/gaprc_menu_full, gap4/gaprc_menu_mito, gap4/gaprc_menu_viewer, gap4/list_contigs.tcl, gap4/phraprc, gap4/unchecked.gif, gap5/Makefile, gap5/depth.tcl, gap5/gap.tcl, gap5/gap5, gap5/gap5rc, gap5/gap5rc_menu_full, get_scf_field/Makefile, haplo/Makefile, haplo/haplorc, hetins/Makefile, init_exp/Makefile, make_weights/Makefile, mutlib/Makefile, mutscan/Makefile, polyA_clip/Makefile, prefinish/Makefile, prefinish/args.template, prefinish/config.prefinish, prefinish/finish_sanger, prefinish/prefinish, prefinish/prefinish.tcl, prefinish/prefinishrc, pregap4/Makefile, pregap4/pregap4, pregap4/pregap4.tcl, pregap4/pregap4rc, primer3/src/Makefile, qclip/Makefile, screen_seq/Makefile, scripts/Makefile, seq_utils/Makefile, seq_utils/align_lib_nuc_matrix, seq_utils/nuc_matrix, seqed/seqedrc, spin/Makefile, spin/eia.wts, spin/ied.wts, spin/niprc, spin/perceptron.wts, spin/prokprom_10.wts, spin/prokprom_35.wts, spin/siprc, spin/spin, spin/spin.tcl, spin/spinrc, spin2/FEATCOLDB, spin2/FEATQUALDB, spin2/FEATUREDB, spin2/spin2rc, spin2_emboss/spin2_embossrc, spin_emboss/Makefile, spin_emboss/create_emboss_files, spin_emboss/emboss_menu, spin_emboss/spin_embossrc, staden_config.h.in, stops/Makefile, system.mk.in, text_utils/Makefile, tgap/Makefile, tk_utils/2bars_h.bmp, tk_utils/2bars_v.bmp, tk_utils/Makefile, tk_utils/help_config, tk_utils/init.c, tk_utils/shlib.conf, tk_utils/stash.c, tk_utils/tk_utilsrc, tk_utils/user_defaults.tcl, tracediff/Makefile, trev/Makefile, trev/trev, trev/trev.tcl, trev/trevrc, vector_clip/Makefile: Further upheaval of build system: - Make install now works. - Removal of excessive $(O) (was $(machine)-binaries) and similarly unnecessary fluff in the makefiles. - Moved files from tables/* to appropriate src/*. There are a few exeptions (small blast databases, alu sequences, etc) which have been added to a src/data directory. Not technically source I guess, but it means the src tree contains everything necessary to obtain a run-time environment (minus documentation and test/training data). - Overhauled the directory layout to be more friendly to using a prefix of /usr, rather than something dedicated to the staden package. - Extra autoconf code to check for and utilise va_copy(). - Fix to samtools autoconf. Other fixes: - Removed use of $(MACHINE)-binaries as it's no longer needed. - Fixed gap-tcl.c's io_read_text function to work with thread enabled Tcl. This is almost certainly the tip of the iceberg. When using threads Tcl must be given memory allocated using ckalloc rather than malloc. One trivial solution (used here) is simply to pass data over as TCL_VOLATILE instead of TCL_DYNAMIC which forces it to allocate it's own copy in whatever method it deems appropriate. Obviously we then have to free up our own copy. - Gap4's List Contigs feature has been updated to use reading numbers instead of reading names internally. This avoids issues when (corrupted) databases exist with duplicate read names. Not elegant, but defensive. 2009-07-16 James Bonfield * staden/trunk/README.build, abi/abiIO.h, abi/getABIfield.c, bootstrap, global.mk, tk_utils/tclAppInit.c, tracediff/Makefile: Fixes to new autoconf build. Now actually builds on Debian etch. * Makefile, Makefile.in, Makefile.thirdparty, Misc/Makefile, Misc/os.h, abi/Makefile, ac_stubs, ac_stubs/ax_lib_samtools.m4, ac_stubs/ax_lib_staden_io_lib.m4, ac_stubs/ax_lib_zlib.m4, ac_stubs/libcurl_check_config.m4, ac_stubs/tcl.m4, alf/Makefile, configure.in, convert/Makefile, copy_reads/Makefile, copy_reads/copy_reads.c, eba/Makefile, eba/conf.c, eba/conf.h, eba/qual.c, find_renz/Makefile, g/Makefile, gap4/IO.c, gap4/IO2.c, gap4/Makefile, gap4/assemble_direct.c, gap4/consen.c, gap4/copy_db_main.c, gap4/extract.c, gap4/extract.h, gap4/gap4_defs.mk, gap4/newgap_cmds.c, gap4/preass.c, gap4/seqInfo.c, gap4/seqInfo.h, gap4/tagU2.c, gap4/tkEditor.c, gap4/tman_cons.c, gap4/tman_diff.c, gap4/tman_display.h, gap4/tman_interface.c, gap5/Makefile, gap5/consen.c, gap5/extract.h, gap5/tkEditor.c, gap5/tman_display.h, gap5/tman_interface.c, get_scf_field/Makefile, get_scf_field/get_scf_field.c, global.mk, haplo/Makefile, hetins/Makefile, hetins/hetins.c, init_exp/Makefile, init_exp/init_exp.c, licence, make_weights/Makefile, make_weights/make_weights.c, mk, mutlib/Makefile, mutscan/Makefile, mutscan/main.cpp, mutscan/staden.h, polyA_clip/Makefile, polyA_clip/polyA_clip.c, polyA_clip/seqInfo.c, polyA_clip/seqInfo.h, prefinish/Makefile, pregap4/Makefile, primer3/Makefile, primer3/src/Makefile, qclip/Makefile, qclip/consen.c, qclip/qclip.c, qclip/seqInfo.c, qclip/seqInfo.h, screen_seq/Makefile, screen_seq/screen_seq.c, scripts/Makefile, seq_utils/Makefile, spin/Makefile, spin/nip_cmds.c, spin/seq_reg_cmds.c, spin/sip_cmds.c, spin_emboss/Makefile, staden_config.h.in, stops/Makefile, stops/stops.c, system.mk.in, tcl8.4.0, text_utils/Makefile, tgap/Makefile, tk8.4.0, tk_utils/Makefile, tk_utils/init.c, tk_utils/misc.c, tk_utils/postscript.h, tk_utils/tkCanvGraph.c, tk_utils/tkTrace.c, tk_utils/tkTrace.h, tk_utils/tkTraceComp.c, tk_utils/tkTraceDisp.c, tk_utils/tkTraceIO.c, tk_utils/trace_print.c, tracediff/Makefile, tracediff/main.cpp, tracediff/staden.h, trev/Makefile, vector_clip/Makefile, vector_clip/vector_clip.c: Major tidyup of build system: * We now use autoconf to generate a system.mk tailored for this machine. This replaces the old mk/$(MACHINE).mk stubs. * We no longer have Makefile.thirdparty and the local copies of tcl, tk, itcl, itk, etc. * Removed the defunct licencing code. It is recommended when using this that you make a subdirectory and use ../configure. This keeps binaries and source code neatly separated. 2009-06-26 James Bonfield * tgap/tg_cache.c: fix for copy-on-write of GT_SeqBlock and GT_AnnoEleBlock structs. This was causing save after edits in the contig editor to crash. * gap5/editor_view.c: Fixed annotation viewing. Clicking on an annotation caused crashes and also display glitches due to not expected xx->cursor_type to be GT_AnnoEle. 2009-06-25 James Bonfield * tk_utils/tclIndex, tk_utils/xscrolledlistbox.tcl, tk_utils/xscrolledtext.tcl: Added xscrolledtext and xscrolledlistbox widgets - to replace iwidget equivalents. (Not 100%, but sufficient for our purposes.) 2009-06-22 James Bonfield * VERSION 1.2.2 * 2009-06-22 James Bonfield * gap5/contig_selector.c, * gap5/contig_selector.h, * gap5/contig_selector.tcl, * gap5/gap4_compat.c, * gap5/gap4_compat.h: (11:31:05) Updated various functions to use int64_t instead of int for contig coordinates. Specifically anything using the total contig length or coordinates in the contig selector. This means that the contig selector now displays data when the total contig length is > 2Gb. * gap5/IO.h, * gap5/Makefile, * gap5/editor_join.c, * gap5/editor_view.h, * gap5/qual.c, * gap5/template_display.c: (11:33:18) Removal of minor compilation warnings. Fixed the main build to no longer link against fortran or C++ libraries as these aren't used in Gap5 and they hamper portability. 2009-06-19 James Bonfield * tgap/ace.c: (14:16:03) Initialise more elements in range_t. They were left uninitialised so all sorts of things could happen! * gap5/template_display.c, * gap5/template_display.h: (14:17:44) Added a template size blocking factor for use in the Stacking Y-mode. This groups like-sized templates together, causing extra-long templates to appear beneath the smaller ones and so rearrangements become easier to spot. * gap5/depth.tcl: (16:11:56) Added an interface to changing the "stacking y size" (only used in stacking mode). The entire GUI for this needs an overhaul, but that's for later. * gap5/template_display.c: (16:16:35) Removal of some debugging info. * tgap/maq.c: (16:18:02) Added timing stats. * tgap/maq.c, * tgap/sam.c, * tgap/tg_cache.c, * tgap/tg_gio.h, * tgap/tg_iface_g.c, * tgap/tg_index.c, * tgap/tg_register.c, * tgap/tg_sequence.c, * tgap/tg_sequence.h: (16:35:07) General code tidyup. Removal of unused variables; deleted old #if 0 code (will get it back if we need afterall); tidied up some const vs non-const warnings, etc. * tgap/tg_contig.h: (16:40:57) Export more functions 2009-06-18 James Bonfield * gap5/editor_view.c: (11:25:17) Improved the editor information line to show contig names when a read-pair has the position in another contig rather than this one. 2009-06-17 James Bonfield * tgap/tg_anno.c, * tgap/tg_anno.h: (11:27:17) Added an anno_get_range() function to return the range_t struct associated with an annotation. This allows us to query positional data, flags, etc. * tgap/tg_contig.c: (11:27:51) Annotations now have their Y coordinates allocated too (if requested) so that they reside on top of the correct sequence Y location. * gap5/contig_editor.tcl, * gap5/editor_view.c, * gap5/editor_view.h, * gap5/tkEditor.c: (11:29:51) The get_seq_status editor method (calling edview_item_at_pos in C) can return AnnoEle records as well as the usual sequence/contig records. Thefore we can now show tag summary data in the editor information bar too. * tgap/ace.c: (14:03:28) Now set seq.bin_index too. Without this it was causing assertion failures in sequence_get_pair() during viewing in gap5. 2009-06-16 James Bonfield * tgap/Attic/tg_depth.c: (09:14:59) removed * tgap/Makefile, * gap5/Makefile: (11:11:50) Minor makefile changes - CXX vs CXXLD etc * gap5/contig_editor.tcl: (11:13:14) Extra options on panedwindow to show sash. This was made invisible with later Tk releases. (A bad case of form over function.) * gap5/libraries.tcl: (11:14:12) Fix issues with apparent diagonal lines at the start of the library plot. These come from having no values between 0 and the first observed insert size. * gap5/contig_selector.c, * gap5/cs-object.c, * gap5/editor_view.c, * gap5/list_contigs.tcl, * gap5/tk-io-reg.c, * gap5/tman_display.c: (11:18:14) Removal of interp->result to use the appropriate Tcl functions. Mainly Tcl_SetResult (plus our Tcl_vSetResult for printf style args) and Tcl_GetStringResult(). It's not done in the best manner, but a way that works. Eg we regularly do things like changing atoi(interp->result) into atoi(Tcl_GetStringReslt(interp)). This would be better done using Tcl_GetInt instead, but the changes were formulaic and simply implemented. If I was to tailor each one carefully then optimally we should be using Tcl_Obj based methods anyway. The requirement for this change comes from Tcl8.6 where the result element from Tcl_Interp has finally been removed (rather than simply labelled as deprecated, which it has been for many years). Also tweaked a few other bits here and there regarding removal of deprecated features (especially in tkRaster.c). * tgap/sam.c: (11:20:06) Changed search of LB tag to RG tag. It appears this is normally how libraries are implemented in SAM. In theory I should then read the RG header lines and redirect those to the LB header lines too, but by region is perhaps more useful for now as even though it's not a genuine library it allows for splitting data by lane or by run. * gap5/editor_view.c: (11:40:32) Removed memory corruption when displaying long sequence tags. * gap5/contig_editor.tcl, * gap5/editor_view.c, * gap5/tkEditor.c, * gap5/tkEditor.h: (15:31:14) Added a Hide Annotations setting in the contig editor, also bound to control-Q. This allows us to see the quality values underneath a tag. 2009-06-15 James Bonfield * VERSION 1.2.1 * 2009-06-15 James Bonfield * tgap/tg_index.c, * tgap/tg_view.c, * gap5/gap.tcl: (10:43:54) Bumped version to 1.2.1 2009-06-12 James Bonfield * tgap/tg_iface_g.c: (14:17:29) Fixed memory corruption when writing out seq blocks if trace_name disagrees with sequence name. (We didn't allocate enough storage.) Also insure seq_block and anno_ele_block est_size field is always initialised to zero. * tgap/caf2baf.pl: (15:13:08) *** empty log message *** * tgap/maq.c, * tgap/tg_iface_g.c: (16:24:28) Fixed use of assert. Nasties like assert(*cp++ == GT_Seq) are invalid as compiled used NDEBUG to disable assert also no longer increments cp. 2009-06-10 James Bonfield * VERSION 1.2.0 * 2009-06-10 James Bonfield * tgap/tg_register.c: (13:19:21) Protect against io_cursor_reg(io) being NULL in io_cursor_get(). This can happen when shutting down all displays. * tgap/g-request.c: (13:19:58) Added use of pwrite instead of lseek and write (similar to the already in-use pread calls). * tgap/tg_cache.c: (13:20:27) Set cache size to 1024 (from 8192). More applicable now we have compound "blocked" data structs. * tgap/tg_iface_g.c, * tgap/tg_struct.h: (13:22:25) *INCOMPATIBILITY* Major overhaul on encoded data formats. Every record written to disk now starts with a byte for the data type and a byte for the encoding format (starting at zero for now). Every time we read a record we assert that the type and format are correct. This should help spot potential data corruptions before they take place. The error handling could be improved, but assert/abort is sufficient for now and (in theory) these should never happen anyway. * gap5/contig_editor.tcl: (13:27:44) Added pageup/pagedown bindings (+/- 1k at a time). * tgap/tg_index.c, * tgap/tg_view.c, * gap5/gap.tcl: (13:28:38) Bumped version to 1.2.0 2009-06-09 James Bonfield * tgap/tg_contig.c, * tgap/tg_contig.h: (09:23:34) Added a flag to distinguish between the first range and subsequent ranges in the contig iterators. The first range needs to allow objects that overlap the range to be included while subsequent objects need to only allow objects that start entirely within the new range (in order to remove duplicates). This fixes a bug where the first few sequences in a contig were rejected when exporting to varying file formats. * tgap/Makefile: (12:38:18) Link libtgap.so against ptmalloc3 library. This replaces the system malloc as we've seen some *dire* performance issues. In one case tg_index sped up 24 fold after linking with the new library. * tgap/baf.c: (12:39:17) Count all object types rather than just sequences when deciding to flush. Improved outputs, giving timings per block of data. * tgap/tg_bin.c: (12:40:12) Fix buf where bin->nseqs changes weren't always written back to disk. * tgap/tg_cache.c: (12:40:45) Bug fix: remove empty case statement (illegal C?). Minor debug output changes. * tgap/tg_iface_g.c: (12:41:05) Minor change to improve portability. * tgap/tg_index.c: (12:42:44) The default value of merge_contigs is now dependant on whether or not we are appending. This removes the need to search through contig existing names when we're not appending. ASSUMPTION: per input file, all data for a single contig is collated together rather than intermingled. * tgap/sam.c: (14:00:31) Fixed bug with handling 'Z' aux sam type. 2009-06-04 James Bonfield * gap5/export_contigs.c: (13:32:07) #ifdefed out code; for evaluating size of fastq files when complementing sequences to keep in assembly orientation. * gap5/editor_view.c, * gap5/tkEditor.c: (13:32:43) Added support for displaying annotation colours. * tgap/ace.c, * tgap/g-struct.c, * tgap/hache_table.c, * tgap/hache_table.h, * tgap/maq.c, * tgap/sam.c, * tgap/tg_contig.c, * tgap/tg_index.c, * tgap/tg_register.c: (13:49:25) Strictly for debugging purposes, hache tables now have a name field. If set this outputs the name string in debugging output instead of using %p and the hache table pointer. * tgap/tg_cache.c, * tgap/tg_iface.h, * tgap/tg_iface_g.c, * tgap/tg_struct.h: (13:50:04) GT_AnnoEle items are now blocked like sequences in a GT_AnnoEleBlock items instead. This massively reduces the file size for tag-rich databases. Also improved I/O stats output. * tgap/tg_sequence.c: (13:50:13) Added sequence_reset_ptr and sequence_copy functions to remove code duplication. * tgap/baf.c, * tgap/tg_bin.c: (13:50:27) Fixed reference count leaks * tgap/tg_anno.c, * tgap/tg_anno.h: (13:50:53) Added tag types to anno_ele so we can get away with not using anno structs at all for the simple case of a tag marking just one region. Tag types are now stored in the range_t struct too, using the mqual field (TODO: use a union instead). Old old_type was stored here, but now fits in a flag instead. 2009-06-01 James Bonfield * gap5/editor_view.c: (10:36:47) Bug fix cases where the item in xx->r[] is an annotation instead of a sequence (eg in edCursorUp, edCursorDown and edview_item_at_pos). 2009-05-29 James Bonfield * tgap/BAF, * tgap/baf.c, * tgap/baf.h: (10:57:28) Added annotation support. * tgap/sam2fai.pl: (10:58:00) Now preserves the order in the input sam file when producing the output list. (Not needed, but useful for debugging purposes sometimes.) * tgap/tg_bin.c: (10:58:23) Fixed the nseqs counter so it isn't incremented by annotations. * tgap/tg_contig.c: (10:59:05) compute_ypos() when operating in non-stacking mode no longer counts tags in computing Y coordinates. * tgap/tg_iface_g.c: (16:32:29) Fixed bug in decoding of SeqBlocks and seq->bin_index. * tgap/tg_sequence.c: (16:32:54) Assert in sequence_get_pair() - spotted bin_index decoding issues. 2009-05-28 James Bonfield * gap5/libraries.tcl: (14:23:34) Improved the auto-scaling and added a simple key. 2009-05-27 James Bonfield * tgap/tg_contig.c: (15:31:35) Upped the size of the range queries used in the contig_iter system from 1k to 10k. * gap5/NEWS: (15:40:35) *** empty log message *** * gap5/export_contigs.c: (15:41:27) Improved cigar string generation for SAM format. Added ACE format output. * gap5/export_contigs.tcl: (15:41:41) Added ACE format output. * gap5/libraries.tcl, * gap5/tclIndex: (15:42:18) Added a rudimentary libraries Tk interface. 2009-05-26 James Bonfield * tgap/ace.c: (14:21:41) Fixed ACE file reading of complemented data. * tgap/Makefile, * tgap/maq.c, * tgap/sam.c, * tgap/tg_cache.c, * tgap/tg_gio.c, * tgap/tg_gio.h, * tgap/tg_iface.h, * tgap/tg_iface_g.c, * tgap/tg_library.c, * tgap/tg_library.h, * tgap/tg_struct.h, * tgap/tg_tcl.c: (14:24:21) Added libraries as a data type. These replace the (unimplemented) DNASrc data type. For now only MAQ and SAM input formats populate these fields, but more will follow shortly. * tgap/tg_contig.c: (14:27:50) Fixed contig_iter_next and contig_iter_prev. When faced with sequences of varying length these sometimes caused duplicates during iteration. 2009-05-15 James Bonfield * VERSION 1.1.3.1 * 2009-05-15 James Bonfield * tgap/baf.c: (09:05:14) Only flush changes every 65536 sequences now, as this improves data locality and reduces database fragmentation. Fixed issues with incorrect quality values for soft-clipped data in SAM. * tgap/maq.c, * tgap/sam.c: (09:05:15) Only flush changes every 65536 sequences now, as this improves data locality and reduces database fragmentation. Fixed issues with incorrect quality values for soft-clipped data in SAM. * tgap/tg_cache.c: (09:16:16) Tweaked the maximum data size of an uncompressed sequence block from 200k to 150k as this appears to be marginally more optimal in disk usage. 2009-05-13 James Bonfield * tgap/sam2fai.pl: (15:56:47) Added a simple tool to index sam files, building a .fai file suitable for use with "samtools import". * gap5/export_contigs.c, * gap5/export_contigs.h, * gap5/export_contigs.tcl, * gap5/newgap5_cmds.c, * gap5/tclIndex: (16:01:05) Added a "File->Export Sequences" command. This outputs data in SAM, Fasta, Fastq or BAF format and can be used for migrating between gap5 releases or from gap5 back to samtools. Note that right now it's not robust with regards to CIGAR alignments though - it writes out padded data currently. * gap5/Makefile: (16:02:13) Added export_contigs.c * tgap/sam.c: (16:03:25) Fixed contig names - we now use the references listed in the sam file. Fixed sequence position - they were out by 1. Removed the old sam reading code (previously #if-ed out). 2009-05-12 James Bonfield * tgap/tg_bin.c, * tgap/tg_bin.h, * tgap/tg_contig.c, * tgap/tg_gio.c, * tgap/tg_gio.h, * tgap/tg_index.c: (16:40:21) Made the minimum bin size a parameter of tg_index. This allows for a great improvement of speed and compression size when dealing with very low coverage data sets (eg many 1000G runs). * tgap/tg_iface_g.c: (16:41:07) We now store GT_Bin structs in a more optimal fashion. This doesn't have a big impact mostly unless using lots of small bins with shallow depth data. * tgap/tg_bin.c, * tgap/tg_iface_g.c: (16:58:16) The io->iface->bin.create method no longer creates a bin from a template, instead preferring simply to just allocate the record. This along with bin_new() changes means we don't write the bin struct to disk multiple times. It has a minor change on deep projects, but a substantial speed improvement on very shallow ones (with admittedly too many bins for the depth). 2009-05-11 James Bonfield * gap5/editor_view.c: (09:07:02) Handle sequences longer than MAX_SEQ_LEN. The #define should only be for static memory allocation for speed, and not a hard limit. * gap5/editor_view.c: (16:27:38) Fixed memory leak: free memory for anno_hash. * gap5/consensus.c, * gap5/editor_view.c: (16:28:20) Don't decrement the seq_t cache. This is unnecessary as it's not auto-incremented and it now produces issues for referencing counting of block data. * tgap/tg_contig.c: (16:29:24) Fixed memory leak in compute_ypos(). * tgap/tg_utils.c, * tgap/tg_utils.h: (16:30:16) Added signed versions of the 7-bit int encoding; int2s7 and s72int. * tgap/tg_cache.c, * tgap/tg_iface.h, * tgap/tg_iface_g.c, * tgap/tg_sequence.c, * tgap/tg_struct.h: (16:35:38) *MAJOR AND INCOMPATIBLE CHANGE* First draft of a new data type: SeqBlock. This implements a block of sequences, rather than a single sequence object. The purpose is to improve compression by allowing for multiple sequences (up to 1024) to be compressed as a single block of data at the g-layer. This requires a LOT of smoke and mirrors in the caching layer to get right, and a few tweaks to allocation of new sequence objects too (in tg_sequence.c). Currently it's a mess of code, but the implementation appears to now be working. The compression achieve is quite amazing; typically beating bzip2 of the old gap5 database size while still being faster. The actual compression ratios vary, but 5:1 isn't unexpected. Note that it works far better with deep assemblies and less well with very shallow (eg 1000 genomes) data sets. This is partly due to the inherent compression from having lots of similar (ie overlapping) strings and partly due to a better ratio of sequences to bins. (Lots of almost empty bins is inefficient). 2009-05-08 James Bonfield * tgap/tg_bin.c: (13:23:22) When extending contigs and adding a new root bin we now inherit the count of sequences from the old root. Previously it restarted the count at zero, giving incorrect sequence counts. 2009-04-24 James Bonfield * VERSION 1.1.3 * 2009-04-24 James Bonfield * gap5/ChangeLog, * gap5/NEWS: (13:26:43) *** empty log message *** * gap5/depth.tcl: (14:01:24) Added an "update idletasks" when moving the cursor window. This prevents oscillation as we scroll by generating motion events that are applied to the location of the old window, pre-move. * gap5/depth.tcl: (16:10:08) Fixed an issue with resize events occurring all the time. This was due to changes in resize1.5 and subtracting the scrollbar size from ${w}(width). Now using a separate variable for this. Also fixed an issue where bringing up a contig editor first, followed by the template display. Then double left clicking to move the editor was giving errors. 2009-04-23 James Bonfield * tgap/baf.c, * tgap/baf.h: (14:23:26) Added PR (primer type) parsing. * gap5/contig_editor.tcl: (14:24:27) Handle incoming CURSOR_NOTIFY events requesting the cursor to be moved. * gap5/depth.tcl: (14:25:25) This plot now registers itself with the contig registration system. As such it now appears in the Results Manager and can display/control the contig editor editing cursors. * gap5/editor_view.c, * gap5/editor_view.h, * gap5/tkEditor.c: (14:27:11) The contig editor edview struct now contains a cursor_t element, holding the private cursor to use used in CURSOR_MOVE messages. This allows integration with other windows. * gap5/depth.tcl: (16:30:41) Fixed an issue with the template display and ruler track not being on the same scale - the width of the Y scrollbar impacted the scaling. Also dramatically simplified the calculation of the world coordinates. What was I thinking of? 2009-04-21 James Bonfield * tgap/hache_table.c: (14:03:46) HacheItemDestroy now also unlinks the in_use links. This caused crashes previously. * tgap/tg_register.c, * tgap/tg_register.h: (14:07:51) Overhauled the contig deregistration system. Specifically in how we handle removal from the hache table. Also changed the meaning of contig 0. This is not a way to broadcast to all contigs (although we still have a broadcast_event function for this purpose) but rather a registration list for windows that wish to receive events that take place on any contig. (Such as the contig selector or Results Manager.) * gap5/contig_selector.c: (14:09:30) Switched from registering with all contigs to just contig 0. * gap5/contig_editor.tcl, * gap5/tk-io-reg.c: (14:19:18) Added REG_CHILD_EDIT callback instead of sending REG_LENGTH so that windows like the contig selector do not automatically redraw on every contig editor update. * gap5/editor_view.c: (15:36:45) Fixed a bug with sequences sometimes being drawn as tags too due to assumptions on precedence rules. 2009-04-17 James Bonfield * gap5/template_display.c: (10:46:44) Now using X position + record number in the Y spread function instead of X position + array index. This means that scrolling in X will give the same Y-spread variation for a sequence so it doesn't jump up and down now. * tgap/maqmap.c: (14:52:52) Added include to remove warnings. * tgap/tg_sequence.c: (14:55:26) Protect against trace_name and alignment being NULL in sequence_new_from(). * tgap/Makefile, * tgap/tg_anno.c, * tgap/tg_anno.h, * tgap/tg_bin.c, * tgap/tg_cache.c, * tgap/tg_contig.c, * tgap/tg_contig.h, * tgap/tg_gio.h, * tgap/tg_iface.h, * tgap/tg_iface_g.c, * tgap/tg_struct.h, * tgap/tg_tcl.c: (15:03:06) Added starting code for annotations. These consist of anno elements and annotations (possibly I'll later rename these to annotations and annotation_link respectively). This involves two new files (tg_anno.c and tg_anno.h), plus support for the anno_t and anno_ele_t data structure in tg_iface* and tg_cache.c. So far anno_t is largely unimplemented, but anno_ele_t is the guts of it and where the link to sequences or contigs occur. Right now this means we support single tags in a similar style to Gap4, without the link concept. Annotations are indexed in the same bin range arrays as sequences, utilising a flag to distinguish between seq_t and anno_ele_t references. This code needs more work as range_t should become a union (partly done, but commented out in tg_struct.h). This is being checked in now as to do this properly requires a file format change. The contig_seqs_in_range function had been extended to be part of a family, now including contig_anno_in_range and contig_items_in_range. The latter of these can return both sequences and annotations in one query. * tgap/tg_bin.h: (15:03:51) Added prototype for bin_remove_item(). Changed the minimum bin size from 1K to 4K. * gap5/break_contig.c: (15:04:32) Removal of debugging calls to contig_dump_ps(). * gap5/editor_view.c, * gap5/editor_view.h: (15:06:40) Fixed a bug with the stacked-reads view of the editor where the dots in the names panel would overflow the names array. Added test support for viewing tags. This is unfinished and for now they're simply highlighted in inverse, but it's a proof of concept to help test the storage of tags (aka annotations). * gap5/break_contig.tcl, * gap5/complement.tcl, * gap5/configure.tcl, * gap5/do_fij.c: (15:09:47) Added files. Not new - but apparently I forgot to commit these! Sorry. * gap5/Attic/complement.h: (15:10:19) Redundant and removed. 2009-04-16 James Bonfield * tgap/ace.c, * tgap/tg_index.c: (16:34:37) Fixed the ACE format code to work with the newer pair_rec mechanism (in bin rather than seq object). Added minimal support for RT, CT and WA. For now it just skips over them as opposed to dying, so it doesn't yet add the tags for real. 2009-04-15 James Bonfield * gap5/gap.tcl, * gap5/newgap5_cmds.c, * gap5/ng_fb_cmds.tcl: (11:14:16) Fixed db_info num_contigs to return the correct value. Opening the database now checks for num_contigs <= 1000 before deciding whether to display the contig selector, unless -csel has been explicitly requested on the command line. 2009-04-14 James Bonfield * gap5/contig_editor.tcl: (15:31:11) Improved undo/redo when using the join editor. I think there still maybe bugs, but it interoperates with other editors in a far saner fashion now with regards to which buttons are greyed out. Made the undo/redo buttons highlight the editor they will apply to. This is changed by clicking in an editor window to change focus. (Only makes sense for the join editor.) * gap5/contig_editor.tcl, * gap5/editor_view.c, * gap5/editor_view.h, * gap5/tkEdNames.c, * gap5/tkEditor.c: (16:16:03) The edview_item_at_pos functions now takes an extra "exact" argument to indicate if the query should find closest or exact only. This is now used in the editor <> "+%W activate \[%W index @%x,%y\]" bind $m.name <> \ "+font_name_change $w \[%W get active\];" bind $m.name {focus %W} foreach i [font names] { $m.name insert end $i } listbox $m.family -yscrollcommand "$m.familyy set" -exportselection 0 \ -selectmode browse scrollbar $m.familyy -orient vert -command "$m.family yview" bind $m.family <> "+%W activate \[%W index @%x,%y\]" bind $m.size <> \ "+font_size_change $w \[%W get active\];" bind $m.size {focus %W} for {set i 5} {$i <= 24} {incr i} { $m.size insert end "$i" } frame $w.f3 checkbutton $w.f3.bold -text "Bold" \ -command [list font_style_change $w -weight $w.f3.Bold] \ -variable $w.f3.Bold \ -onvalue bold -offvalue normal checkbutton $w.f3.italic -text "Italic" \ -command [list font_style_change $w -slant $w.f3.Italic] \ -variable $w.f3.Italic \ -onvalue italic -offvalue roman checkbutton $w.f3.fixed -text "Fixed" \ -command [list font_filter $w] \ -variable $w.f3.Fixed checkbutton $w.f3.underline -text "Underline" \ -command [list font_style_change $w -underline $w.f3.Underline] \ -variable $w.f3.Underline pack $m.name $m.namey $m.family $m.familyy $m.size $m.sizey \ -side left -fill both pack $w.f3.bold $w.f3.italic $w.f3.fixed $w.f3.underline -side left pack $w.def $w.l $w.f2 $w.f3 -side bottom -fill both $w.f2.name activate 0 $w.f2.name selection set 0 font_filter $w font_name_change $w [lindex [font names] 0] } proc font_small {w} { font configure menu_font -family Helvetica -weight bold -size -12 font configure menu_title_font -family Helvetica -weight bold -slant italic -size -12 font configure text_font -family Courier -size -12 font configure button_font -family Helvetica -weight bold -size -12 font configure listbox_font -family Helvetica -weight bold -size -12 font configure title_font -family Helvetica -size -16 -weight bold font configure sheet_font -family Fixed -size -20 font configure trace_font -family Helvetica -size -12 font configure enzyme_font -family Helvetica -size -11 font configure trace_conf_font -family Helvetica -size -9 font_name_change $w [lindex [font names] 0] } proc font_large {w} { font configure menu_font -family Helvetica -weight bold -size -14 font configure menu_title_font -family Helvetica -weight bold -slant italic -size -16 font configure text_font -family Courier -size -16 font configure button_font -family Helvetica -weight bold -size -15 font configure listbox_font -family Helvetica -weight bold -size -16 font configure title_font -family Helvetica -size -16 -weight bold font configure sheet_font -family Fixed -size -20 font configure trace_font -family Helvetica -size -12 font configure enzyme_font -family Helvetica -size -11 font configure trace_conf_font -family Helvetica -size -9 font_name_change $w [lindex [font names] 0] } proc SetFontsReset {old} { foreach i $old { eval font configure $i } } proc SetFontsPerm {} { global env tk_utils_defs foreach i [font names] { regsub {_font$} $i {} fn set fn FONT.[string toupper $fn] keylset tk_utils_defs $fn [font configure $i] update_defs tk_utils_defs $env(HOME)/.tk_utilsrc $fn } } #----------------------------------------------------------------------------- # Sets the general colour scheme - foreground and background. proc ConfigureColours {} { set t .colour if {[xtoplevel $t -resizable 0] == ""} return wm title $t "Set colours" label $t.eg -text "Example text" -bd 2 -relief raised -height 2 frame $t.fg -bd 2 -relief groove frame $t.bg -bd 2 -relief groove label $t.fg.label -text Foreground label $t.bg.label -text Background frame $t.fg.col frame $t.bg.col ColourSel $t.fg.col foreground "ColourSet $t.eg foreground" ColourSel $t.bg.col background "ColourSet $t.eg background" okcancelhelp $t.ok -bd 2 -relief groove \ -ok_command "ConfigureColours2 0 $t" \ -perm_command "ConfigureColours2 1 $t" \ -cancel_command "destroy $t" \ -help_command "show_help interface {UI-Colour}" pack $t.ok -side bottom -fill both pack $t.eg -side bottom -fill both -pady 2m -padx 2m pack $t.fg.label $t.bg.label -side top -fill both pack $t.fg.col $t.bg.col -side top -fill both -expand 1 pack $t.fg $t.bg -side left -expand 1 -fill both } proc RecolourWidgets {fg bg} { #Dont support colour changing under windows #othwerwise things get just too complicated #users can still change colours using the standard windows properties global tcl_platform if { "$tcl_platform(platform)" != "windows" } { foreach {fga(r) fga(g) fga(b)} [winfo rgb . $fg] {} foreach {bga(r) bga(g) bga(b)} [winfo rgb . $bg] {} set bg_dark [format #%04x%04x%04x \ [expr int(.9*$bga(r))] [expr int(.9*$bga(g))] [expr int(.9*$bga(b))]] set fg_dis [format #%04x%04x%04x \ [expr {int(.75*$bga(r)+.25*$fga(r))}] \ [expr {int(.75*$bga(g)+.25*$fga(g))}] \ [expr {int(.75*$bga(b)+.25*$fga(b))}]] foreach i {r g b} { set inc1 [expr ($bga($i)*15)/100] set inc2 [expr (65535-$bga($i))/3] set bgl($i) [expr $bga($i) + ($inc1>$inc2?$inc1:$inc2)] if {$bgl($i) > 65535} { set bgl($i) 65535 } } set bg_light [format #%04x%04x%04x $bgl(r) $bgl(g) $bgl(b)] tk_setPalette \ background $bg \ backPageColor $bg \ highlightBackground $bg \ sliderForeground $bg \ inactiveBackground $bg_dark \ selectBackground $bg_dark \ troughColor $bg_dark \ activeBackground $bg_light \ sliderBackground $bg_light \ foreground $fg \ activeForeground $fg \ insertBackground $fg \ selectForeground $fg \ highlightColor $fg \ disabledForeground $fg_dis catch {destroy .tmp} button .tmp option add *Entry.background [tk::Darken [.tmp cget -background] 115] 100 option add *Text.background [tk::Darken [.tmp cget -background] 115] 100 option add *Listbox.background [tk::Darken [.tmp cget -background] 115] 100 option add *EdNames.background [tk::Darken [.tmp cget -background] 115] 100 option add *Editor.background [tk::Darken [.tmp cget -background] 115] 100 destroy .tmp } } proc ConfigureColours2 {perm t} { global tk_utils_defs env set fg [format #%02x%02x%02x \ [$t.fg.col.r get] [$t.fg.col.g get] [$t.fg.col.b get]] set bg [format #%02x%02x%02x \ [$t.bg.col.r get] [$t.bg.col.g get] [$t.bg.col.b get]] RecolourWidgets $fg $bg keylset tk_utils_defs FOREGROUND $fg keylset tk_utils_defs BACKGROUND $bg if {$perm} { update_defs tk_utils_defs $env(HOME)/.tk_utilsrc FOREGROUND BACKGROUND } destroy $t } proc ColourSet {eg part w args} { $eg configure -$part [format #%02x%02x%02x \ [$w.r get] [$w.g get] [$w.b get]] } proc ColourSel {w part cmd} { scale $w.r -label red -from 0 -to 255 -orient horiz -length 5c \ -command "$cmd $w" scale $w.g -label green -from 0 -to 255 -orient horiz -length 5c \ -command "$cmd $w" scale $w.b -label blue -from 0 -to 255 -orient horiz -length 5c \ -command "$cmd $w" set rgb [winfo rgb . [$w.r cget -$part]] $w.r set [expr [lindex $rgb 0]/256] $w.g set [expr [lindex $rgb 1]/256] $w.b set [expr [lindex $rgb 2]/256] pack $w.r $w.g $w.b -side top -fill both } #----------------------------------------------------------------------------- # Handles storing data in the .rc files. # Processes a *rc config file to look for the automatic positioning lines. # Anything within this region is considered fair game for auto- # configuration. # # The data returned is the contents of the config file in a structure used only # by update_config and write_config. proc read_config {file} { if {[catch {set fd [open $file r]}]} { return {{} {} {}} } set part1 {} set part2 {} set part3 {} set part part1 while {[gets $fd line] != -1} { if {$line == "# DO NOT EDIT: start of auto-config"} { set part part2 continue } if {$line == "# DO NOT EDIT: end of auto-config"} { set part part3 continue } lappend $part $line } close $fd return [list $part1 $part2 $part3] } proc display_config {cf} { puts part1:[lindex $cf 0] puts part2:[lindex $cf 1] puts part3:[lindex $cf 2] } proc write_config {cf file} { catch {file rename -force $file $file.bak} if {[catch {set fd [open $file w 0644]}]} { puts "Couldn't save config to $file" return } foreach i [lindex $cf 0] { puts $fd $i } puts $fd "# DO NOT EDIT: start of auto-config" foreach i [lindex $cf 1] { puts $fd $i } puts $fd "# DO NOT EDIT: end of auto-config" foreach i [lindex $cf 2] { puts $fd $i } close $fd return } proc update_config {cfp name value} { upvar $cfp cf set p1 [lindex $cf 0] set p2 [lindex $cf 1] set p3 [lindex $cf 2] set p2new {} set done 0 foreach i $p2 { if {[string match "set_def $name\[ \t\]*" $i] == 1} { lappend p2new "set_def $name [list $value]" set done 1 } else { lappend p2new $i } } if {!$done} { lappend p2new "set_def $name [list $value]" } set cf [list $p1 $p2new $p3] } proc update_config_def {cfp def name} { global $def update_config $cfg $name [keylget $def $name] } # Updates a series of defaults proc update_defs {def_name file args} { global $def_name set cf [read_config $file] foreach i $args { update_config cf $i [keylget $def_name $i] } write_config $cf $file } staden-2.0.0b11-2016-src/tk_utils/console.tcl0000644000031500020650000001657312707372072017200 0ustar jkbteam117# FILE: console.tcl # # Provides a console window. # # Last modified on: $Date: 2005-10-15 06:00:15 $ # Last modified by: $Author: jcw $ # # This file is evaluated to provide a console window interface to the # root Tcl interpreter of an OOMMF application. It calls on a script # included with the Tk script library to do most of the work, making use # of Tk interface details which are only semi-public. For this reason, # there is some risk that future versions of Tk will no longer support # this script. That is why this script has been isolated in a file of # its own. ######################################################################## # If the Tcl command 'console' is already in the interpreter, our work # is done. ######################################################################## if {![catch {console show}]} { return } ######################################################################## # Check Tcl/Tk support ######################################################################## if {[catch {package require Tcl 8}]} { package require Tcl 7.5 } if {[catch {package require Tk 8}]} { if {[catch {package require Tk 4.1}]} { return -code error "Tk required but not loaded." } } set _ [file join $tk_library console.tcl] if {![file readable $_]} { return -code error "File not readable: $_" } ######################################################################## # Provide the support which the Tk library script console.tcl assumes ######################################################################## # 1. Create an interpreter for the console window widget and load Tk set consoleInterp [interp create] $consoleInterp eval [list set tk_library $tk_library] $consoleInterp alias exit exit load "" Tk $consoleInterp # 2. A command 'console' in the application interpreter ;proc console {sub {optarg {}}} [subst -nocommands { switch -exact -- \$sub { title { $consoleInterp eval wm title . [list \$optarg] } hide { $consoleInterp eval wm withdraw . } show { $consoleInterp eval wm deiconify . } eval { $consoleInterp eval \$optarg } default { error "bad option \\\"\$sub\\\": should be hide, show, or title" } } }] # 3. Alias a command 'consoleinterp' in the console window interpreter # to cause evaluation of the command 'consoleinterp' in the # application interpreter. ;proc consoleinterp {sub cmd} { switch -exact -- $sub { eval { uplevel #0 $cmd } record { history add $cmd catch {uplevel #0 $cmd} retval return $retval } default { error "bad option \"$sub\": should be eval or record" } } } if {[package vsatisfies [package provide Tk] 4]} { $consoleInterp alias interp consoleinterp } else { $consoleInterp alias consoleinterp consoleinterp } # 4. Bind the event of the application interpreter's main # window to kill the console (via tkConsoleExit) bind . [list +if {[string match . %W]} [list catch \ [list $consoleInterp eval tkConsoleExit]]] # 5. Redefine the Tcl command 'puts' in the application interpreter # so that messages to stdout and stderr appear in the console. rename puts tcl_puts ;proc puts {args} [subst -nocommands { switch -exact -- [llength \$args] { 1 { if {[string match -nonewline \$args]} { if {[catch {uplevel 1 [linsert \$args 0 tcl_puts]} msg]} { regsub -all tcl_puts \$msg puts msg return -code error \$msg } } else { $consoleInterp eval [list tkConsoleOutput stdout \ "[lindex \$args 0]\n"] } } 2 { if {[string match -nonewline [lindex \$args 0]]} { $consoleInterp eval [list tkConsoleOutput stdout \ [lindex \$args 1]] } elseif {[string match stdout [lindex \$args 0]]} { $consoleInterp eval [list tkConsoleOutput stdout \ "[lindex \$args 1]\n"] } elseif {[string match stderr [lindex \$args 0]]} { $consoleInterp eval [list tkConsoleOutput stderr \ "[lindex \$args 1]\n"] } else { if {[catch {uplevel 1 [linsert \$args 0 tcl_puts]} msg]} { regsub -all tcl_puts \$msg puts msg return -code error \$msg } } } 3 { if {![string match -nonewline [lindex \$args 0]]} { if {[catch {uplevel 1 [linsert \$args 0 tcl_puts]} msg]} { regsub -all tcl_puts \$msg puts msg return -code error \$msg } } elseif {[string match stdout [lindex \$args 1]]} { $consoleInterp eval [list tkConsoleOutput stdout \ [lindex \$args 2]] } elseif {[string match stderr [lindex \$args 1]]} { $consoleInterp eval [list tkConsoleOutput stderr \ [lindex \$args 2]] } else { if {[catch {uplevel 1 [linsert \$args 0 tcl_puts]} msg]} { regsub -all tcl_puts \$msg puts msg return -code error \$msg } } } default { if {[catch {uplevel 1 [linsert \$args 0 tcl_puts]} msg]} { regsub -all tcl_puts \$msg puts msg return -code error \$msg } } } }] $consoleInterp alias puts puts # 6. No matter what Tk_Main says, insist that this is an interactive shell set tcl_interactive 1 ######################################################################## # Evaluate the Tk library script console.tcl in the console interpreter ######################################################################## $consoleInterp eval source [list [file join $tk_library console.tcl]] $consoleInterp eval { if {![llength [info commands tkConsoleExit]]} { tk::unsupported::ExposePrivateCommand tkConsoleExit } } $consoleInterp eval { if {![llength [info commands tkConsoleOutput]]} { tk::unsupported::ExposePrivateCommand tkConsoleOutput } } if {[string match 8.3.4 $tk_patchLevel]} { # Workaround bug in first draft of the tkcon enhancments $consoleInterp eval { bind Console {} } } # Restore normal [puts] if console widget goes away... proc Oc_RestorePuts {slave} { rename puts {} rename tcl_puts puts interp delete $slave } $consoleInterp alias Oc_RestorePuts Oc_RestorePuts $consoleInterp $consoleInterp eval { bind Console +Oc_RestorePuts } # Allow functional pasting with the middle mouse button $consoleInterp eval { bind Console <> { if {$tk_strictMotif || ![info exists tk::Priv(mouseMoved)] \ || !$tk::Priv(mouseMoved)} { catch { set clip [::tk::GetSelection %W PRIMARY] set list [split $clip \n\r] tk::ConsoleInsert %W [lindex $list 0] foreach x [lrange $list 1 end] { %W mark set insert {end - 1c} tk::ConsoleInsert %W "\n" tk::ConsoleInvoke tk::ConsoleInsert %W $x } } } } } unset consoleInterp console title "[wm title .] Console" staden-2.0.0b11-2016-src/tk_utils/container.tcl0000644000031500020650000003466112707372072017516 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # proc container_start_shutdown {c_win c_id} { global $c_win.crosshair set $c_win.crosshair 0 container_shutdown -container_id $c_id destroy $c_win } proc container_results_manager {help_cmd args} { global tk_utils_defs #puts "***************** container_results_manager ******************" set t [keylget tk_utils_defs CONTAINER.RESULTS.WIN] if {[xtoplevel $t] == ""} return wm title $t "Results manager" result_list_create $t $help_cmd eval result_list_update $args } proc container_menubar {c_win c_id menu} { global container_menu tk_utils_defs set mb [keylget tk_utils_defs CONTAINER.MENUBAR] if {![winfo exists $c_win$mb]} { $c_win configure -menu $c_win$mb menu $c_win$mb } merge_menus $menu $c_win$mb } proc container_buttonbar {t buttons zoom_cmd} { global tk_utils_defs $t.crosshair #crosshair checkbutton checkbutton $buttons.cross -text crosshairs -variable $t.crosshair #position labels set pos1 [keylget tk_utils_defs CONTAINER.POS1.NAME] set pos2 [keylget tk_utils_defs CONTAINER.POS2.NAME] label $buttons$pos1 -bd 2 -relief sunken -width [keylget tk_utils_defs CONTAINER.POS1.WIDTH] label $buttons$pos2 -bd 2 -relief sunken -width [keylget tk_utils_defs CONTAINER.POS1.WIDTH] #zoom out button button $buttons.zoom_out -text "zoom out" -command "eval $zoom_cmd" #zoom in buttons button $buttons.zoomin10 -text "+10%" \ -command "eval $zoom_cmd -amount 0.05" button $buttons.zoomin50 -text "+50%" \ -command "eval $zoom_cmd -amount 0.1666" pack $buttons.zoomin10 $buttons.zoomin50 $buttons.zoom_out $buttons.cross \ $buttons$pos1 $buttons$pos2 -side left -fill x -expand yes } proc add_container_column {c_win container_id column} { global tk_utils_defs set MAX_ROW [keylget tk_utils_defs CONTAINER.MAX_ROW] #Horizontal scrollbar set sb_h [keylget tk_utils_defs CONTAINER.HSCROLL.WIN]$column scrollbar $c_win$sb_h -orient horizontal \ -command "scroll_x $container_id $column" grid $c_win$sb_h -row [expr $MAX_ROW - 1] -column $column -sticky ew } proc create_container {t container_id title} { global tk_utils_defs global $t.info HORIZONTAL set MAX_ROW [keylget tk_utils_defs CONTAINER.MAX_ROW] set MAX_COL [keylget tk_utils_defs CONTAINER.MAX_COL] set RULER_ROW [keylget tk_utils_defs CONTAINER.RULER_ROW] set RULER_COL [keylget tk_utils_defs CONTAINER.RULER_COL] if {[xtoplevel $t] == ""} return #fix_maxsize $t wm protocol $t WM_DELETE_WINDOW "container_start_shutdown $t $container_id" wm title $t $title #initialise info structure keylset $t.info row_top [expr $RULER_ROW/2] keylset $t.info row_bottom $RULER_ROW keylset $t.info row_first 2 keylset $t.info column $RULER_COL keylset $t.info column_left [expr $RULER_COL + ($MAX_COL/2)] ########################################################################## # Main Menu Bar #container_menubar $t $container_id ########################################################################## #Button bar set buttons [keylget tk_utils_defs CONTAINER.BUTTONS.WIN] frame $t$buttons set zoom_cmd "container_zoom -container_id $container_id" container_buttonbar $t $t$buttons $zoom_cmd #add_container_column $t $container_id [expr $RULER_COL + 1] ########################################################################## #Brief line set brief [keylget tk_utils_defs CONTAINER.BRIEF.WIN] label $t$brief #puts "BRIEF [expr $RULER_COL + 0]" grid $t$buttons -row 2 -column 0 -sticky ew -columnspan $MAX_COL grid $t$brief -row $MAX_ROW -column [expr $RULER_COL + 0] -sticky ew -columnspan $MAX_COL } proc get_prev_row {c_win strand} { global $c_win.info TOP_S BOTTOM_S if {[expr $strand & $TOP_S]} { set top [keylget $c_win.info row_top] incr top -1 keylset $c_win.info row_top $top return $top } elseif {[expr $strand & $BOTTOM_S]} { set bottom [keylget $c_win.info row_bottom] incr bottom -1 keylset $c_win.info row_bottom $bottom return $bottom } } proc get_next_row {c_win strand} { global $c_win.info TOP_S BOTTOM_S #puts "get_next_row $strand" if {[expr $strand & $TOP_S]} { set top [keylget $c_win.info row_top] incr top keylset $c_win.info row_top $top return $top } elseif [expr $strand & $BOTTOM_S] { set bottom [keylget $c_win.info row_bottom] incr bottom keylset $c_win.info row_bottom $bottom return $bottom } } proc get_current_column {c_win} { global $c_win.info set column [keylget $c_win.info column] return $column } proc get_next_column {c_win} { global $c_win.info set column [keylget $c_win.info column] #puts "get_next_column $c_win $column" incr column keylset $c_win.info column $column return $column } #the element id is always the last number of the element_win proc get_element_id {element_win} { regexp {[0-9]+$} $element_win id return $id } proc get_element_row { e_win} { if {[winfo exists $e_win]} { set einfo [get_element_info $e_win] if {$einfo == ""} { set e_frame $e_win } else { set e_frame [keylget einfo container_win][keylget einfo container_id].f[keylget einfo element_id] } array set info [grid info $e_frame] #parray info #puts "array size [array size info]" if {[array size info] == 0} { return -1 } #puts "get_element_row $e_win $info(-row)" return $info(-row) } else { return -1 } } proc get_element_column { e_win} { #puts "get_element_column $e_win" if {[winfo exists $e_win]} { set einfo [get_element_info $e_win] if {$einfo == ""} { set e_frame $e_win } else { set e_frame [keylget einfo container_win][keylget einfo container_id].f[keylget einfo element_id] } array set info [grid info $e_frame] #puts "get_element_column $e_win $info(-row)" return $info(-column) } else { return -1 } } proc extract_element_name {e_frame} { global tk_utils_defs if {[winfo exists $e_frame]} { set c [keylget tk_utils_defs CONTAINER.WIN] regexp "($c)(\[0-9\]*).f(\[0-9\]*)" $e_frame win c_win c_id e_id return $c_win$c_id[keylget tk_utils_defs ELEMENT.WIN]$e_id } else { return $e_frame } } proc scroll_x {container_id column args } { #puts "container_scroll_x $container_id $column $args" container_scroll_x -container_id $container_id -column $column -command $args } proc scroll_y {container_id row args } { #puts "container_scroll_y $container_id $column $args" container_scroll_y -container_id $container_id -row $row -command $args } proc container_position_label {label position format } { eval scan $position $format pos $label configure -text $pos } #draw a crosshair proc add_container_crosshair {c_win e_id x y} { global $c_win.crosshair if {[set $c_win.crosshair]} { draw_container_crosshair -element_id $e_id -x $x -y $y } else { delete_container_crosshair -element_id $e_id } } proc get_container_info {element} { global tk_utils_defs set c [keylget tk_utils_defs CONTAINER.WIN] regexp "($c)(\[0-9\]*)" $element win c_win c_id #puts "get_container_id $element $win $c_win $c_id" keylset info container_id $c_id keylset info container_win $c_win return $info } proc get_element_info {element} { global tk_utils_defs set c [keylget tk_utils_defs CONTAINER.WIN] set e [keylget tk_utils_defs ELEMENT.WIN] if {[regexp "($c)(\[0-9\]*)($e)(\[0-9\]*)" $element win c_win c_id e_win e_id] == 0} { return "" } #puts "get_container_id $element $win $c_win $c_id $e_win $e_id" keylset info container_id $c_id keylset info container_win $c_win keylset info element_id $e_id keylset info element_win $e_win return $info } proc set_element_specs {e_win list} { global $e_win.specs #puts "set_element_specs $list" foreach {label value} $list { keylset $e_win.specs $label $value } } proc get_element_specs {e_win} { global $e_win.specs if {[info exists $e_win.specs]} { return [set $e_win.specs] } else { return "" } } proc result_config {result_id line_width colour e_id e_win} { if {[xtoplevel [set f .cbox] -resizable 0] == ""} return frame $f.lw # Line width scale $f.lw.scale \ -label "Line width" \ -from 0 \ -to 10 \ -orient horiz $f.lw.scale set $line_width pack $f.lw -side top -fill both pack $f.lw.scale -side top -fill x #cmd to execute when ok button on colourbox pressed set e_specs [get_element_specs $e_win] set e_type [keylget e_specs type] if {$e_type == "CANVAS"} { set ok_cmd "configure_canvas_result $e_id $e_win $result_id \[$f.lw.scale get\]" #cmd to execute when changing colours on colourbox set update_cmd "update_canvas_result $e_id $e_win $result_id \[$f.lw.scale get\]" } elseif {$e_type == "RASTER"} { set ok_cmd "ConfigureRasterPlot $result_id \[$f.lw.scale get\]" #cmd to execute when changing colours on colourbox set update_cmd "UpdateRasterPlot $result_id" } #cmd to execute when cancel button on colourbox pressed set cancel_cmd "set dummy 0" ColourBox $f $colour $ok_cmd $update_cmd $cancel_cmd } proc delete_sb_h {c_win column} { global tk_utils_defs #puts "&&&&&&&&& delete_sb_h $c_win $column" set sb_h [keylget tk_utils_defs CONTAINER.HSCROLL.WIN]$column destroy $c_win$sb_h } proc delete_sb_v {c_win row} { global tk_utils_defs #puts "&&&&&&&&& delete_sb_v $c_win $row" set sb_v [keylget tk_utils_defs CONTAINER.VSCROLL.WIN]$row destroy $c_win$sb_v } #if only have rulers proc shuffle_rulers {ruler_win } { global tk_utils_defs set row [get_element_row $ruler_win] set len_row [keylget tk_utils_defs CONTAINER.RULER_ROW] puts "shuffle_rulers $row $len_row $ruler_win [winfo parent $ruler_win]" foreach win [grid slaves [winfo parent $ruler_win]] { #puts "win $win [grid info $win]" array set info [grid info $win] #puts "$win [winfo class $win] $info(-row)" #puts "[pack slaves $win]" set e_win [pack slaves $win] if {[string compare $e_win ""] != 0} { puts "e_win $e_win" set e_specs [get_element_specs $e_win] if {[llength $e_specs] > 0} { set e_type [keylget e_specs type] if {[string compare $e_type CANVAS] != 0} { puts "ruler $e_win" } } } } } proc rotate_element {e_win ruler_win seq_id result_id orientation row} { global tk_utils_defs set_element_specs $e_win "orientation $orientation" #puts ROTATE #set column [expr [get_current_column [winfo parent $e_win]] - 1] set column [seq_find_column -seq_id $seq_id] #find all ruler elements and move 1 to left #set wins [keylget tk_utils_defs ELEMENT.WIN] #foreach win [grid slaves [winfo parent $e_win] -column $column] { #puts "win $win" #if {[string first $wins $win] != -1} { #array set info_$win [grid info $win] #grid forget $win #set info_${win}(-column) [expr $column - 1] #eval grid $win [array get info_$win] #} #} #puts "rotate_element row = $row" move_result_new $e_win $e_win $result_id $row $column } proc tcl_delete_row {c_win row} { set list [grid_find $c_win row $row] #puts "&&&&&&&&& tcl_delete_row $row $list" foreach win $list { #need to destroy element windows packed inside packing frame foreach i [pack slaves $win] { destroy $i } grid rowconfig $c_win $row -weight 0 destroy $win } } proc tcl_delete_column {c_win column} { set list [grid_find $c_win column $column] #puts "&&&&&&&&& tcl_delete_column $column $list" foreach win $list { #need to destroy element windows packed inside packing frame foreach i [pack slaves $win] { destroy $i } grid columnconfig $c_win $column -weight 0 destroy $win } } proc update_container_menu {c_win c_id e_win} { global container_menu tk_utils_defs if {![catch [set e_specs [get_element_specs $e_win]]]} { return } if {![catch [set menu [keylget e_specs menu]]]} { return } global $menu container_menubar $c_win $c_id $menu result_list_update $c_win } proc delete_menubar {c_win} { global tk_utils_defs menulist set mb [keylget tk_utils_defs CONTAINER.MENUBAR] set mn $c_win$mb global $mn.MS destroy $mn foreach menu $menulist { global $menu if {[info exists $menu]} { unset $menu } } set menulist {} } #check if column is empty except for win proc is_empty_column {win} { set parent [winfo parent $win] set column [get_element_column $win] set list [grid_find $parent column $column] if {[llength $list] > 1} { return 0 } return 1 } proc is_empty_row {win} { set parent [winfo parent $win] set row [get_element_row $win] set list [grid_find $parent row $row] if {[llength $list] > 1} { return 0 } return 1 } proc tcl_delete_element {e_win} { if {[winfo exists $e_win]} { set einfo [get_element_info $e_win] if {$einfo == ""} { set e_frame $e_win } else { set e_frame [keylget einfo container_win][keylget einfo container_id].f[keylget einfo element_id] } destroy $e_win destroy $e_frame } } #find the next available column when moving e_to to LEFT or RIGHT of e_from proc find_next_column {e_to pos} { global LEFT RIGHT set found 0 set column [get_element_column $e_to] set c_win [winfo parent $e_to] if {$pos == $LEFT} { incr column -1 while {!$found} { set list [grid_find $c_win column $column] if {[llength $list] == 0} { set found 1 } else { set win [lindex $list 0] set name [extract_element_name $win] set e_struct [element_struct [get_element_id $name]] if {[keylget e_struct parent] == -1} { set found 1 } else { incr column -1 } } } } if {$pos == $RIGHT} { incr column 1 while {!$found} { set list [grid_find $c_win column $column] if {[llength $list] == 0} { set found 1 } else { set win [lindex $list 0] set name [extract_element_name $win] set e_struct [element_struct [get_element_id $name]] if {[keylget e_struct parent] == -1} { set found 1 } else { incr column 1 } } } } return $column } staden-2.0.0b11-2016-src/tk_utils/element_canvas.tcl0000644000031500020650000012665412707372072020524 0ustar jkbteam117#job can be NEW_ROW, proc create_canvas_element {c_win c_id e_win e_id width height row column orientation scale job} { global tk_utils_defs HORIZONTAL VERTICAL BOTH $e_win.column $e_win.row TOP_S BOTTOM_S canvas_menu env #puts "**************** create_canvas_element $c_win $e_win o=$orientation r=$row c=$column job=$job scale=$scale width=$width height=$height" set RULER_ROW [keylget tk_utils_defs CONTAINER.RULER_ROW] set RULER_COL [keylget tk_utils_defs CONTAINER.RULER_COL] set MAX_ROW [keylget tk_utils_defs CONTAINER.MAX_ROW] container_menubar $c_win $c_id $canvas_menu set_element_specs $e_win "menu [list $canvas_menu]" #puts "RULER_ROW $RULER_ROW $RULER_COL" #FIXME set e_specs [get_element_specs $e_win] #wm geometry $c_win {} set strand [keylget e_specs strand] #location of length ruler if {$orientation == $HORIZONTAL || $orientation == $BOTH} { set sb_h [find_widget_path $c_win[keylget tk_utils_defs CONTAINER.HSCROLL.WIN] column $column] set hscroll_cmd "$sb_h set " } if {$orientation == $VERTICAL || $orientation == $BOTH} { set sb_v [find_widget_path $c_win[keylget tk_utils_defs CONTAINER.VSCROLL.WIN] row $row] set vscroll_cmd "$sb_v set " } if {$orientation == $HORIZONTAL || $orientation == $BOTH} { #grid_insert $c_win row $row 1 if {[expr $strand & $TOP_S]} { #always ensure that RULER_ROW is always RULER_ROW! #puts "RULER_ROW $RULER_ROW" #grid_delete $c_win row [expr $RULER_ROW - 2] 1 } else { #always ensure that MAX_ROW is always MAX_ROW! #grid_delete $c_win row [expr $MAX_ROW - 2] 1 } } else { #grid_insert $c_win column $column 1 } if {$scale == "XY"} { #vertical length ruler scrollbar if {[info exists vscroll_cmd]} { if {![winfo exists $sb_v]} { scrollbar $sb_v -orient vertical \ -command "scroll_y $c_id \[get_element_row $sb_v\]" #grid $sb_v -row $row -column [expr $column+1] -sticky ns grid $sb_v -row $row -column [keylget tk_utils_defs CONTAINER.MAX_COL] -sticky ns } } #horizontal length ruler scrollbar if {[info exists hscroll_cmd]} { if {![winfo exists $sb_h]} { scrollbar $sb_h -orient horizontal \ -command "scroll_x $c_id \[get_element_column $sb_h\]" grid $sb_h -row [expr $MAX_ROW - 1] -column $column -sticky ew } } if {![info exists hscroll_cmd]} { #puts "HORIZONTAL AMPLITUDE " set sb_h [find_widget_path $c_win[keylget tk_utils_defs CONTAINER.HSCROLL.WIN] column $column] set hscroll_cmd "$sb_h set " scrollbar $sb_h -orient horizontal \ -command "scroll_x $c_id \[get_element_column $sb_h\]" grid $sb_h -row [expr $MAX_ROW - 1] -column $column -sticky ew } #horizontal length, therefore vertical amplitude if {![info exists vscroll_cmd]} { set sb_v [find_widget_path $c_win[keylget tk_utils_defs CONTAINER.VSCROLL.WIN] row $row] #puts "VERTICAL $sb_v $row [expr $column+1]" set vscroll_cmd "$sb_v set " if {![winfo exists $sb_v]} { scrollbar $sb_v -orient vertical \ -command "scroll_y $c_id \[get_element_row $sb_v\]" #grid $sb_v -row $row -column [expr $column+1] -sticky ns grid $sb_v -row $row -column [keylget tk_utils_defs CONTAINER.MAX_COL] -sticky ns } } } if {$scale == "X"} { #horizontal length ruler scrollbar if {[info exists hscroll_cmd]} { if {![winfo exists $sb_h]} { scrollbar $sb_h -orient horizontal \ -command "scroll_x $c_id \[get_element_column $sb_h\]" grid $sb_h -row [expr $MAX_ROW - 1] -column $column -sticky ew } } } if {$scale == "Y"} { } #puts "canvasbox $e_win -width $width -height $height -bg green \ -bd 0 -highlightthickness 0 -xscrollcommand $hscroll_cmd\ -zoom_command $zoom_cmd" set zoom_cmd "container_zoom -container_id $c_id" if {[info exists hscroll_cmd] && [info exists vscroll_cmd]} { frame $c_win.f$e_id -bd 2 -relief groove canvasbox $e_win -width $width -height $height\ -bd 0 -highlightthickness 0 -xscrollcommand $hscroll_cmd\ -yscrollcommand $vscroll_cmd -zoom_command $zoom_cmd } elseif {[info exists hscroll_cmd]} { frame $c_win.f$e_id -bd 2 -relief groove canvasbox $e_win -width $width -height $height\ -bd 0 -highlightthickness 0 -xscrollcommand $hscroll_cmd\ -zoom_command $zoom_cmd } elseif {[info exists vscroll_cmd]} { frame $c_win.f$e_id -bd 2 -relief groove canvasbox $e_win -width $width -height $height \ -bd 0 -highlightthickness 0 -yscrollcommand $vscroll_cmd\ -zoom_command $zoom_cmd } canvas $c_win.f$e_id.l -width 8 -height 16 $c_win.f$e_id.l create bitmap 5 10 -bitmap @[file join $env(STADTABL) 2bars_v.bmp] grid rowconfig $c_win $row -weight 1 grid columnconfig $c_win $column -weight 1 grid $c_win.f$e_id -row $row -column $column -sticky ewns pack $c_win.f$e_id.l -side left -anchor n pack $e_win -in $c_win.f$e_id -fill both -expand yes set $e_win.row $row set $e_win.column $column #set keypath [find_widget_path $c_win[keylget tk_utils_defs CONTAINER.KEYBOX.WIN] row $row] #if {![winfo exists $keypath]} { #keybox $keypath #add key for all results #keybox_add $keypath $row -text all \ -background white \ -motion motion_canvas \ -enter "enter_key $e_win -1" \ -leave "leave_key $e_win" \ -drop "drop_element $e_win" \ -menu "seq_result_keybox_update -1 \[seq_result_names -element_id $e_id\]" #grid $keypath -row $row -column [expr $column+2] -sticky nsew #} canvas_element_bindings $c_win $e_id $e_win $c_win.f$e_id.l update idletasks if {[winfo height $c_win] != 1} { #wm geometry $c_win [winfo width $c_win]x$new_height } #puts "GRID [grid slaves $c_win -row 251]" #foreach win [grid slaves $c_win ] { #puts "GRID $win [grid info $win]" #} } #certain widgets (scrollbars, keyboxes) are defined per row/column (orient) #but are given a unique number (w_cnt) so need to search if widget already #exists for a row/column. proc find_widget_path {widget orient num {job ""}} { global w_cnt #puts "find_widget $widget $orient $num" if {![info exists w_cnt]} { set w_cnt 0 #puts "here1 $widget$w_cnt" return $widget$w_cnt } elseif {[string compare $job "NEW"] == 0} { incr w_cnt #puts "here2 $widget$w_cnt" return $widget$w_cnt } else { regexp {^(\.[^.]+)(\.[^.]+)$} $widget dummy parent win set children [winfo children $parent] foreach child $children { if {[regexp "($win)(\[0-9\]*)$" $child dummy dummy val]} { if {[string compare $orient "row"] == 0} { set widget_orient [get_element_row $widget$val] } else { set widget_orient [get_element_column $widget$val] } if {$num == $widget_orient} { #puts "here3 $widget$val" return $widget$val } } } incr w_cnt #puts "here4 $widget$w_cnt" return $widget$w_cnt } } proc get_next_element_frame { } { global id if {![info exists id]} { set id 0 } else { incr id } return $id } proc create_canvas_ruler {c_win c_id orientation row column ruler_width ruler_height type} { global HORIZONTAL VERTICAL tk_utils_defs env #puts "***************create_canvas_ruler $c_win $c_id $orientation r=$row c=$column" set zoom_cmd "container_zoom -container_id $c_id" set element_info [get_new_element] set e_id [keylget element_info element_id] set e_win [keylget element_info element_win] set args "" if {$orientation == $HORIZONTAL} { set sb_h [find_widget_path $c_win[keylget tk_utils_defs CONTAINER.HSCROLL.WIN] column $column] set hscroll_cmd "$sb_h set " #puts "HORIZONTAL RULER $c_win$e_win $ruler_height $ruler_width $row $column" frame $c_win.f$e_id -bd 2 -relief groove canvasbox $c_win$e_win -width $ruler_width -height $ruler_height\ -bd 0 -highlightthickness 0\ -xscrollcommand $hscroll_cmd -zoom_command $zoom_cmd if {[string compare $type LENGTH] == 0} { canvas $c_win.f$e_id.l -width 8 -height 16 $c_win.f$e_id.l create bitmap 5 10 -bitmap @[file join $env(STADTABL) 2bars_v.bmp] pack $c_win.f$e_id.l -side left -anchor n set args $c_win.f$e_id.l } #need to ensure the row weight is 0 grid rowconfig $c_win $row -weight 0 grid $c_win.f$e_id -row $row -column $column -sticky ew pack $c_win$e_win -in $c_win.f$e_id -fill both -expand yes } if {$orientation == $VERTICAL} { set sb_v [find_widget_path $c_win[keylget tk_utils_defs CONTAINER.VSCROLL.WIN] row $row] set vscroll_cmd "$sb_v set " #puts "VERTICAL RULER $e_win $ruler_height $ruler_width $row $column" frame $c_win.f$e_id -bd 2 -relief groove canvasbox $c_win$e_win -width $ruler_width -height $ruler_height\ -bd 0 -highlightthickness 0 \ -yscrollcommand $vscroll_cmd -zoom_command $zoom_cmd if {[string compare $type LENGTH] == 0} { canvas $c_win.f$e_id.l -width 8 -height 16 $c_win.f$e_id.l create bitmap 5 10 -bitmap @[file join $env(STADTABL) 2bars_v.bmp] pack $c_win.f$e_id.l -side left -anchor n set args $c_win.f$e_id.l } grid $c_win.f$e_id -row $row -column $column -sticky ns pack $c_win$e_win -in $c_win.f$e_id -fill both -expand yes } canvas_element_bindings $c_win $e_id $c_win$e_win $args global $c_win$e_win.row $c_win$e_win.column set $c_win$e_win.row $row set $c_win$e_win.column $column update idletasks #foreach win [grid slaves $c_win ] { #puts "GRID $win [grid info $win]" #} return [list $e_id $c_win$e_win]; } proc handle_leave {handle e_win} { global e_from e_to cursor_win set e_from $e_win set e_to "" set cursor_win $handle #puts "LEAVE $e_from" } proc handle_popup_menu {h_win X Y e_id} { if [winfo exists $h_win.m] {destroy $h_win.m} set m [create_popup $h_win.m Commands] seq_result_keybox_update -1 [seq_result_names -element_id $e_id] $m tk_popup $m $X $Y } proc canvas_element_bindings {c_win e_id e_win handle} { if {$handle != ""} { bind $handle <> "+element_select_result %W %x %y" bind $e_win <> "+element_select_result %W %x %y" bind $e_win <> "+element_move_result %W %x %y %X %Y " bind $e_win <> "+element_drop_result %X %Y" } proc collapse_e_win {c_win e_win e_id handle} { global $e_win.pack_info tk_utils_defs HORIZONTAL env foreach i [$handle find all] { set bmap [lindex [$handle itemconfig $i -bitmap] 4] } $handle delete all if {[regexp {2bars_h.bmp} $bmap]} { #expanding element $handle configure -width 8 -height 16 $handle create bitmap 5 10 -bitmap @[file join $env(STADTABL) 2bars_v.bmp] set e_struct [element_struct $e_id] set ruler_id [keylget e_struct ruler_id] if {[keylget e_struct ruler_id] != -1} { set r_struct [element_struct [keylget e_struct ruler_id]] eval pack [keylget r_struct win] [keylget $e_win.pack_info ruler] grid $c_win.f$ruler_id if {[keylget e_struct orientation] == $HORIZONTAL} { grid [keylget $e_win.pack_info sb_v] } } eval pack $e_win [keylget $e_win.pack_info element] } else { #collapsing element $handle configure -width 16 -height 8 $handle create bitmap 10 5 -bitmap @[file join $env(STADTABL) 2bars_h.bmp] keylset $e_win.pack_info row [get_element_row $e_win] set e_struct [element_struct $e_id] set ruler_id [keylget e_struct ruler_id] if {[keylget e_struct ruler_id] != -1} { set r_struct [element_struct [keylget e_struct ruler_id]] set ruler_win [keylget r_struct win] keylset $e_win.pack_info ruler [pack info $ruler_win] pack forget $ruler_win grid remove $c_win.f$ruler_id if {[keylget e_struct orientation] == $HORIZONTAL} { set sb_v [find_widget_path $c_win[keylget tk_utils_defs CONTAINER.VSCROLL.WIN] row [keylget $e_win.pack_info row]] keylset $e_win.pack_info sb_v $sb_v grid remove $sb_v } } keylset $e_win.pack_info element [pack info $e_win] pack forget $e_win } } #called from C proc draw_canvas_crosshairX {c_win e_win cx wx} { global tk_utils_defs set colour [keylget tk_utils_defs CROSSHAIR.COLOUR] set line_width [keylget tk_utils_defs CROSSHAIR.LINE_WIDTH] set min_y [$e_win canvasy 0] set max_y [$e_win canvasy [winfo height $e_win]] if {[$e_win find withtag crosshair_x] == ""} { $e_win create line $cx $min_y $cx $max_y -tag "crosshair_x NS"\ -fill $colour -width $line_width $e_win lower crosshair_x } else { $e_win coords crosshair_x $cx $min_y $cx $max_y } set buttons [keylget tk_utils_defs CONTAINER.BUTTONS.WIN] set pos1 [keylget tk_utils_defs CONTAINER.POS1.NAME] set pos2 [keylget tk_utils_defs CONTAINER.POS2.NAME] set x_format %d container_position_label $c_win$buttons$pos1 $wx $x_format } ############################################################################## #called from C proc draw_canvas_crosshairY {c_win e_win cy wy} { global tk_utils_defs set colour [keylget tk_utils_defs CROSSHAIR.COLOUR] set line_width [keylget tk_utils_defs CROSSHAIR.LINE_WIDTH] set min_x [$e_win canvasx 0] set max_x [$e_win canvasx [winfo width $e_win]] if {[$e_win find withtag crosshair_y] == ""} { $e_win create line $min_x $cy $max_x $cy -tag crosshair_y\ -fill $colour -width $line_width $e_win lower crosshair_y } else { $e_win coords crosshair_y $min_x $cy $max_x $cy } set buttons [keylget tk_utils_defs CONTAINER.BUTTONS.WIN] set pos1 [keylget tk_utils_defs CONTAINER.POS1.NAME] set pos2 [keylget tk_utils_defs CONTAINER.POS2.NAME] set y_format %f container_position_label $c_win$buttons$pos2 $wy $y_format } proc motion_element {x y} { global e_to spin_defs e_from set win [winfo containing $x $y] if {$win == ""} { return } if {[string compare [winfo class $win] Canvas] != 0 && [string compare [winfo class $win] Seqed] != 0 } { return } #HACK to eliminate handle canvas set type [$win type 1] if {[string compare $type bitmap] == 0} { return } set e_to $win if {[string compare [winfo class $win] Canvas] == 0} { highlight_position_canvas $e_to $x $y } elseif {[string compare [winfo class $win] Seqed] == 0} { highlight_position_seqed $e_to $x $y } } proc enter_key {e_win result_id } { global tk_utils_defs if {$result_id == -1} { #if all - no status line return } set c_win [winfo parent $e_win] set brief [keylget tk_utils_defs CONTAINER.BRIEF.WIN] $c_win$brief config -text [seq_get_brief -index $result_id] } proc leave_key {e_win} { global e_from e_to set e_from $e_win set e_to "" #puts "LEAVE $e_from" } ############################################################################## proc drop_result {id x y} { after 50 [list where_result $id $x $y] } ############################################################################## proc drop_element {e_win x y} { after 50 [list where_element $e_win $x $y] } proc where_result {result_id x y} { global TOP MIDDLE BOTTOM e_to e_from prev_element HORIZONTAL if {![info exists e_from] || $e_from == ""} { return } global $e_from.location if {$e_to != ""} { set gr_type_from [get_element_gr_type [get_element_id $e_from]] set gr_type_to [get_element_gr_type [get_element_id $e_to]] set pos [find_result_position $e_from $e_to [set $e_from.location]] set row [lindex $pos 0] set column [lindex $pos 1] #puts "ROW $row COLUMN $column" if {$row == -2 } { #puts "DO NOTHING" } elseif {$row == -1} { #superimpose two elements #puts superimpose if {$gr_type_from == $gr_type_to} { move_result_superimpose $e_from $e_to $result_id } } else { #create new element for result #puts "new element $e_to" set c_win [winfo parent $e_to] #move_result_new $e_from $e_to $result_id $row [get_current_column $c_win] set seq_id_h [find_seq_id -result_id $result_id -orient $HORIZONTAL] #set column [seq_find_column -seq_id $seq_id_h] move_result_new $e_from $e_to $result_id $row $column } } else { #create new container window for result #puts "new container" init_result_container $e_from $result_id } #foreach win [grid slaves .container_win0] { #puts "$win [get_element_row $win]" #puts "$win [grid info $win]" #} remove_highlight_position_canvas catch {unset prev_element} set e_from "" set e_to "" } proc where_element {e_win x y} { global TOP MIDDLE BOTTOM e_to e_from prev_element if {![info exists e_from] || $e_from == ""} { return } global $e_from.location #puts "where_element e_from $e_from" if {$e_to != ""} { set gr_type_from [get_element_gr_type [get_element_id $e_from]] set gr_type_to [get_element_gr_type [get_element_id $e_to]] set pos [find_result_position $e_from $e_to [set $e_from.location]] set row [lindex $pos 0] set column [lindex $pos 1] #puts "ROW $row COLUMN $column" if {$row == -1} { #superimpose two elements #puts superimpose if {$gr_type_from == $gr_type_to} { move_element_superimpose $e_from $e_to } } elseif {[winfo parent $e_from] == [winfo parent $e_to]} { #move element in same container # move_element_same $e_from $e_to $row $column #seems easier to just recreate element rather than figure out what #to ungrid and grid again move_result_new $e_from $e_to -1 $row $column } else { #move element to a different container move_element_different $e_from $e_to $row } } else { #create new container window for result #puts "new container" init_element_container $e_from } remove_highlight_position_canvas catch {unset prev_element} set e_from "" set e_to "" } proc remove_highlight_position_canvas { } { global prev_element e_from cursor_win catch {$cursor_win configure -cursor left_ptr} #if {![info exists prev_element]} { #return #} #catch {$prev_element delete highlight_rect} } proc highlight_position_canvas {canvas x y} { global TOP MIDDLE BOTTOM LEFT RIGHT prev_element e_from cursor_win global $e_from.location moving_cursor #puts "highlight_position_canvas $canvas $e_from moving_cursor [info exists moving_cursor]" if {[info exists moving_cursor]} { return } if {$canvas == ""} { catch {unset prev_element} return } set posy [winfo rooty $canvas] set posx [winfo rootx $canvas] set win_ht [winfo height $canvas] set win_wd [winfo width $canvas] set ht3 [expr $win_ht / 3] set wd3 [expr $win_wd / 3] set top [expr $posy + $ht3] set bottom [expr $top + $ht3] set left [expr $posx + $wd3] set right [expr $left + $wd3] #puts "y $y posy $posy top $top bottom $bottom" set y1 [expr $posy - ($posy + $win_ht)] set x1 [expr $posx - ($posx + $win_wd)] set d1_m [expr double ($y1) / $x1] set d1_c [expr $posy - ($posx * $d1_m)] set y1 [expr ($posy + $win_ht) - $posy] set x1 [expr $posx - ($posx + $win_wd)] set d2_m [expr double ($y1) / $x1] set d2_c [expr ($posy + $win_ht) - ($posx * $d2_m)] set d1_x [expr double($y - $d1_c) / $d1_m] set d2_x [expr double($y - $d2_c) / $d2_m] set d1_y [expr $d1_m * $x + $d1_c] set d2_y [expr $d2_m * $x + $d2_c] #above d1 && above d2 if {[expr $y > $d1_y] && [expr $y > $d2_y]} { #puts BOTTOM set location $BOTTOM $cursor_win configure -cursor bottom_side } #above d1 && below d2 if {[expr $y > $d1_y] && [expr $y <= $d2_y]} { #puts LEFT set location $LEFT $cursor_win configure -cursor left_side } #below d1 && above d2 if {[expr $y <= $d1_y] && [expr $y > $d2_y]} { #puts RIGHT set location $RIGHT $cursor_win configure -cursor right_side } #below d1 && below d2 if {[expr $y <= $d1_y] && [expr $y <= $d2_y]} { #puts TOP set location $TOP $cursor_win configure -cursor top_side } if {$y >= $top && $y < $bottom && $x >= $left && $x < $right} { #puts MIDDLE set location $MIDDLE $cursor_win configure -cursor dotbox } set $e_from.location $location } #NB assume ruler to left and scrollbar to right proc get_element_num_columns {e_win job} { global RULER_AMP LEFT RIGHT #puts get_element_num_columns set num_column 0 set row [get_element_row $e_win] set column [get_element_column $e_win] set c_win [winfo parent $e_win] set e_struct [element_struct [get_element_id $e_win]] set children_pos [keylget e_struct children_position] if {$job == $LEFT} { #set win [grid slaves $c_win -row $row -column [expr $column - 1]] #check if next column is a ruler #set e_struct [element_struct [get_element_id $win]] if {$children_pos < 0} { set num_column [keylget e_struct num_children_left] } #puts "NUM_COL $num_column" } if {$job == $RIGHT} { #set win [grid slaves $c_win -row $row -column [expr $column + 1]] #if {[string compare [winfo class $win] scrollbar] == 0} { # incr num_column #} if {$children_pos > 0} { set num_column [keylget e_struct num_children_right] } } return $num_column } #automatic element positioning when create element proc get_element_position {c_win e_win_to strand orientation} { global tk_utils_defs HORIZONTAL VERTICAL TOP MIDDLE BOTTOM LEFT RIGHT if {$orientation & $HORIZONTAL} { if {[string compare $e_win_to ""] != 0 } { set row [expr [get_next_row $c_win $strand] - 1] set column [get_element_column $e_win_to] for {set i $row} {$i < [keylget tk_utils_defs CONTAINER.MAX_ROW]} {incr i} { if {[llength [grid slaves $c_win -row $i -column $column]] == 0} { set next_row $i break } } if {[llength [grid slaves $c_win -row [expr $row + 1] -column $column]] > 0} { grid_insert $c_win row $next_row } set row $next_row } else { set row [get_next_row $c_win $strand] set column [keylget tk_utils_defs CONTAINER.RULER_COL] } } else { if {[string compare $e_win_to ""] != 0 } { set list [find_result_position "" $e_win_to $LEFT] set row [lindex $list 0] set column [lindex $list 1] } else { set row [get_next_row $c_win $strand] set column [keylget tk_utils_defs CONTAINER.RULER_COL] } } return "$row $column" } ############################################################################## #find where to position the result when let go of the mouse proc find_result_position {e_from e_to location} { global tk_utils_defs TOP MIDDLE BOTTOM LEFT RIGHT $e_from.location RULER_AMP set c_win [winfo parent $e_to] global $c_win.info set row [get_element_row $e_to] set row_from [get_element_row $e_from] set first [keylget $c_win.info row_first] set column [get_element_column $e_to] set column_from [get_element_column $e_from] #puts "find_result_position $canvas $row_from $row $first [element_info [get_element_id $e_from] num_results]" if {$row == $row_from && [element_info [get_element_id $e_from] num_results] == 1 && $e_from == $e_to} { return -2 } if {$column == $column_from && [element_info [get_element_id $e_from] num_results] == 1 && $e_from == $e_to} { return -2 } if {$location == $MIDDLE} { return -1 } if {$location == $TOP} { if {[llength [grid slaves $c_win -row [expr $row - 1] -column $column]] > 0} { grid_insert $c_win row $row } else { set row [expr $row - 1] } #grid $canvas -row $row -column $column -sticky nesw #puts "TOP $row $column" return "$row $column" } if {$location == $BOTTOM} { if {[string compare $e_from ""] == 0} { for {set i $row} {$i < [keylget tk_utils_defs CONTAINER.MAX_ROW]} {incr i} { if {[llength [grid slaves $c_win -row $i -column $column]] == 0} { set next_row $i break } } } else { set next_row [expr $row + 1] } if {[llength [grid slaves $c_win -row [expr $row + 1] -column $column]] > 0} { grid_insert $c_win row $next_row } set row $next_row #puts "BOTTOM $row $column" return "$row $column" } if {$location == $RIGHT} { set next_column [find_next_column $e_to $RIGHT] if {[string compare $e_from ""] != 0} { set num_columns [get_element_num_columns $e_from $LEFT] } else { set num_columns 0 } if {[llength [grid slaves $c_win -row $row -column $next_column]] > 0} { grid_insert $c_win column $next_column [expr $num_columns + 1] } set column [expr $next_column + $num_columns] #puts "RIGHT $row $column $num_columns" return "$row $column" } if {$location == $LEFT} { set next_column [find_next_column $e_to $LEFT] #are there any windows to the left? if {[llength [grid slaves $c_win -row $row -column $next_column]] > 0} { #how many columns does e_from have? if {[string compare $e_from ""] != 0} { set num_columns [get_element_num_columns $e_from $LEFT] } else { set num_columns 0 } grid_insert $c_win column $next_column [expr $num_columns + 1] } #puts "LEFT $row $column" return "$row $next_column" } } proc find_result_positionOLD {e_from canvas} { global TOP MIDDLE BOTTOM LEFT RIGHT $e_from.location set c_win [winfo parent $canvas] global $c_win.info set row [get_element_row $canvas] set row_from [get_element_row $e_from] set first [keylget $c_win.info row_first] set column [get_element_column $canvas] set column_from [get_element_column $e_from] #puts "find_result_position $canvas $row_from $row $first [element_info [get_element_id $e_from] num_results]" if {$row == $row_from && [element_info [get_element_id $e_from] num_results] == 1 && $e_from == $canvas} { return -2 } if {$column == $column_from && [element_info [get_element_id $e_from] num_results] == 1 && $e_from == $canvas} { return -2 } #foreach tag [$canvas gettags highlight_rect] { #if {[string compare [string range $tag 0 1] p_] == 0} { # set pos [string trim $tag p_] # if {$pos == $TOP} { #} #} #} set r $row set c $column if {[set $e_from.location] == $TOP} { #set row [expr $row - 1] if {$row < $first} { set row $first } #puts "ROW1 $row" set r [expr $row - 1] } elseif {[set $e_from.location] == $MIDDLE} { return -1; } elseif {[set $e_from.location] == $BOTTOM} { #puts "ROW2 [expr $row + 1]" set r [expr $row + 1] } elseif {[set $e_from.location] == $LEFT} { set c [expr $column - 1] } else { set c [expr $column + 1] } return "$r $c" } #make new container by moving single result proc init_result_container {e_from result_id} { global TOP_S tk_utils_defs HORIZONTAL VERTICAL #puts init_result_container set c_info [get_element_info $e_from] set c_id_old [keylget c_info container_id] set c_win_old [keylget c_info container_win]$c_id_old set e_id_old [keylget c_info element_id] set e_win_old [keylget c_info element_win]$e_id_old #check if e_from container contains only 1 result set num [num_container_results -container_id $c_id_old] if {$num == 1} { return } set element_info [get_new_container] set c_id_new [keylget element_info container_id] set c_win_new [keylget element_info container_win] set element_info [get_new_element] set e_id_new [keylget element_info element_id] set e_win_new [keylget element_info element_win] set e_specs [get_element_specs $e_from] set orientation [keylget e_specs orientation] #if orientation is currently vertical, swap to horizontal for new container if {$orientation == $VERTICAL} { set orientation $HORIZONTAL } set_element_specs $e_from "orientation $orientation" create_container $c_win_new $c_id_new [keylget e_specs title] if {$result_id != -1} { set win_size [seq_result_info -index $result_id -option win_size] #puts "win_size $win_size $result_id" set width [lindex $win_size 0] set height [lindex $win_size 1] } else { set height [winfo height $e_from] set width [winfo width $e_from] } set_element_specs $c_win_new$e_win_new [join $e_specs] set seq_id_h [find_seq_id -result_id $result_id -orient $HORIZONTAL] set column [seq_find_column -seq_id $seq_id_h] create_canvas_element $c_win_new $c_id_new $c_win_new$e_win_new $e_id_new $width $height [get_next_row $c_win_new $TOP_S] $column $orientation [keylget e_specs scale] NEW_ROW #set row_old [element_info $e_id_old row] set row_old [get_element_row $c_win_old$e_win_old] update_container -new_container_id $c_id_new -new_container_win $c_win_new -old_container_id $c_id_old -new_element_id $e_id_new -new_element_win $c_win_new$e_win_new -old_element_id $e_id_old -job NEW -result_id $result_id -new_orientation $orientation set row_new [element_info $e_id_new row] result_list_update $c_win_old result_list_update $c_win_new } proc move_result_superimpose {e_win_old e_win_new result_id} { #puts move_result_superimpose #Don't bother to superimpose if not moving the window if {$e_win_old == $e_win_new} { return } set c_info [get_element_info $e_win_old] set c_id_old [keylget c_info container_id] set c_win_old [keylget c_info container_win]$c_id_old set e_id_old [keylget c_info element_id] set c_info [get_element_info $e_win_new] set c_win_new [keylget c_info container_win] set e_id_new [keylget c_info element_id] set row_old [get_element_row $e_win_old] set row_new [get_element_row $e_win_new] set e_specs [get_element_specs $e_win_old] set orientation [keylget e_specs orientation] update_container -old_container_id $c_id_old -old_element_id $e_id_old -new_element_id $e_id_new -job SUPERIMPOSE -result_id $result_id -new_orientation $orientation } #move result to new element proc move_result_new {e_win_old e_to result_id row column } { global TOP_S tk_utils_defs HORIZONTAL VERTICAL $e_win_old.location LEFT RIGHT TOP BOTTOM #puts "move_result_new $e_to $e_win_old $row $column $result_id" set c_info [get_element_info $e_to] set c_id [keylget c_info container_id] set c_win [keylget c_info container_win]$c_id set c_info [get_element_info $e_win_old] set e_id_old [keylget c_info element_id] set element_info [get_new_element] set e_id_new [keylget element_info element_id] set e_win_new [keylget element_info element_win] set e_specs [get_element_specs $e_win_old] #set from_orientation [keylget e_specs orientation] set e_struct [element_struct [get_element_id $e_win_old]] set from_orientation [keylget e_struct orientation] set from_row [get_element_row $e_win_old] set from_column [get_element_column $e_win_old] set e_struct [element_struct [get_element_id $e_to]] set to_orientation [keylget e_struct orientation] #puts "from_row $from_row $row from_column $from_column $column location [set $e_win_old.location] $from_orientation" if {($to_orientation & $VERTICAL && $from_orientation & $HORIZONTAL) || ($to_orientation & $HORIZONTAL && $from_orientation & $VERTICAL)} { #check if need to change orientation if {($from_orientation == $HORIZONTAL && ([set $e_win_old.location] == $LEFT || [set $e_win_old.location] == $RIGHT)) || ($from_orientation == $VERTICAL && ([set $e_win_old.location] == $TOP || [set $e_win_old.location] == $BOTTOM))} { if {$from_orientation & $HORIZONTAL} { set from_orientation $VERTICAL } else { set from_orientation $HORIZONTAL } } } if {$result_id == -1} { if {$from_orientation & $HORIZONTAL} { set width [winfo width $e_win_old] set height [winfo height $e_win_old] } if {$from_orientation & $VERTICAL} { set height [winfo width $e_win_old] set width [winfo height $e_win_old] } } else { if {$from_orientation & $HORIZONTAL} { set win_size [seq_result_info -index $result_id -option win_size] set width [lindex $win_size 0] set height [lindex $win_size 1] } if {$from_orientation == $VERTICAL} { set win_size [seq_result_info -index $result_id -option win_size] set height [lindex $win_size 0] set width [lindex $win_size 1] } } #puts "width $width height $height result_id $result_id [keylget e_specs scale]" #puts "e_specs $e_specs" set_element_specs $c_win$e_win_new [join $e_specs] set_element_specs $c_win$e_win_new "orientation $from_orientation" create_canvas_element $c_win $c_id $c_win$e_win_new $e_id_new $width $height $row $column $from_orientation [keylget e_specs scale] NEW_ROW set row_old [get_element_row $e_win_old] update_container -old_container_id $c_id -new_element_id $e_id_new -new_element_win $c_win$e_win_new -old_element_id $e_id_old -job NEW -result_id $result_id -new_container_id $c_id -new_orientation $from_orientation set row_new [element_info $e_id_new row] result_list_update $c_win #puts "END move_result_new" } #move element onto a existing element proc move_element_superimpose {e_from e_to} { #puts move_element_superimpose #Don't bother to superimpose if not moving the window if {$e_from == $e_to} { return } set einfo [get_element_info $e_from] set c_id_old [keylget einfo container_id] set c_win_old [keylget einfo container_win]$c_id_old set e_id_old [keylget einfo element_id] set e_win_old [keylget einfo element_win]$e_id_old set einfo [get_element_info $e_to] set c_id_new [keylget einfo container_id] set c_win_new [keylget einfo container_win]$c_id_new set e_id_new [keylget einfo element_id] #must move_key before update_container otherwise I delete the key before #had chance to move it! #move_key $c_win_old $c_win_new $e_id_old $e_id_new $c_win_old$e_win_old $e_to #puts "NEW $e_id_new OLD $e_id_old" set e_specs [get_element_specs $c_win_old$e_win_old] set orientation [keylget e_specs orientation] update_container -old_container_id $c_id_old -old_element_id $e_id_old -new_element_id $e_id_new -new_element_win $e_to -new_container_id $c_id_new -new_container_win $c_win_new -job SUPERIMPOSE -new_orientation $orientation } #move element to new element in same container proc move_element_same {e_from e_to row column} { global tk_utils_defs #puts move_element_same #don't bother to move if not moving element if {$e_from == $e_to} { return } set einfo [get_element_info $e_from] set e_id_old [keylget einfo element_id] set c_win [winfo parent $e_from] set frame_from [keylget einfo container_win][keylget einfo container_id].f[keylget einfo element_id] set einfo [get_element_info $e_to] set frame_to [keylget einfo container_win][keylget einfo container_id].f[keylget einfo element_id] array set info_from [grid info $frame_from] array set info_to [grid info $frame_to] set row_from [get_element_row $e_from] set column_from [get_element_column $e_from] #puts "row=$row column=$column from=$row_from $column_from" set win_list [grid_find $c_win row [get_element_row $e_from]] #set win_list [grid slaves $c_win] foreach win $win_list { array set info_$win [grid info $win] grid forget $win } #remove element row from grid grid_delete $c_win row $row_from $info_from(-rowspan) #insert new element row into grid grid_insert $c_win row $row $info_to(-rowspan) #repack the frames grid rowconfig $c_win $row -weight 1 -minsize 40 grid columnconfig $c_win $column -weight 1 -minsize 40 foreach win $win_list { set info_${win}(-row) $row #set info_${win}(-column) $column #puts "grid $win [array get info_$win]" eval grid $win [array get info_$win] } } #move element to new element in different container proc move_element_different {e_from e_to row} { global tk_utils_defs #puts move_element_different set einfo [get_element_info $e_from] set c_id_old [keylget einfo container_id] set c_win_old [keylget einfo container_win]$c_id_old set e_id_old [keylget einfo element_id] set e_win_old [keylget einfo element_win]$e_id_old set einfo [get_element_info $e_to] set c_id_new [keylget einfo container_id] set c_win_new [keylget einfo container_win]$c_id_new set element_info [get_new_element] set e_id_new [keylget element_info element_id] set e_win_new [keylget element_info element_win] set height [winfo height $e_from] set width [winfo width $e_from] set e_specs [get_element_specs $e_from] set orientation [keylget e_specs orientation] set_element_specs $c_win_new$e_win_new [join $e_specs] #puts "CURRENT COLUMN [get_current_column $c_win_new]" create_canvas_element $c_win_new $c_id_new $c_win_new$e_win_new $e_id_new $width $height $row [get_current_column $c_win_new] [keylget e_specs orientation] [keylget e_specs scale] NEW_ROW #must move_key before update_container otherwise I delete the key before #had chance to move it! #move_key $c_win_old $c_win_new $e_id_old $e_id_new $c_win_old$e_win_old $c_win_new$e_win_new #puts "move_element_different $c_win_new$e_win_new" update_container -new_container_id $c_id_new -new_container_win $c_win_new -old_container_id $c_id_old -new_element_id $e_id_new -new_element_win $c_win_new$e_win_new -old_element_id $e_id_old -job NEW -new_orientation $orientation } #create a new container for element proc init_element_container {e_from } { global TOP_S tk_utils_defs set seqed 0 set c_info [get_element_info $e_from] set c_id_old [keylget c_info container_id] set c_win_old [keylget c_info container_win]$c_id_old set e_id_old [keylget c_info element_id] set e_win_old [keylget c_info element_win]$e_id_old #check if e_from container contains only 1 result set num [num_container_elements -container_id $c_id_old] if {$num == 1} { return } set element_info [get_new_container] set c_id_new [keylget element_info container_id] set c_win_new [keylget element_info container_win] set e_specs [get_element_specs $e_from] set orientation [keylget e_specs orientation] create_container $c_win_new $c_id_new [keylget e_specs title] set_element_specs $c_win_new$e_win_old [join $e_specs] if {[string compare [winfo class $e_from] Seqed] == 0} { } elseif {[string compare [winfo class $e_from] Canvas] == 0} { set height [winfo height $e_from] set width [winfo width $e_from] create_canvas_element $c_win_new $c_id_new $c_win_new$e_win_old $e_id_old $width $height [get_next_row $c_win_new $TOP_S] [get_next_column $c_win_new] [keylget e_specs orientation] [keylget e_specs scale] NEW_ROW } #must move_key before update_container otherwise I delete the key before #had chance to move it! #move_key $c_win_old $c_win_new $e_id_old $e_id_old $c_win_old$e_win_old $c_win_new$e_win_old update_container -new_container_id $c_id_new -new_container_win $c_win_new -old_container_id $c_id_old -new_element_id $e_id_old -new_element_win $c_win_new$e_win_old -old_element_id $e_id_old -job NEW -new_orientation $orientation result_list_update $c_win_old result_list_update $c_win_new } proc configure_canvas_result {e_id e_win result_id line_width colour} { config_result -element_id $e_id -result_id $result_id -width $line_width -fill $colour #puts "configure_canvas_result id$result_id" $e_win itemconfigure id$result_id -width $line_width -fill $colour } proc update_canvas_result {e_id e_win result_id line_width colour} { $e_win itemconfigure id$result_id -width $line_width -fill $colour } proc get_result_id_tag {win item} { foreach tag [$win gettags $item] { if {[regexp {id([0-9]+)$} $tag dummy id]} { return $id } } return -1 } proc brief_tag {brief win item result_id} { foreach tag [$win gettags $item] { if {[regexp {d([0-9]+).([0-9]+)$} $tag dummy darrays darray]} { set line [seq_get_brief_tag -array_type "d" -arrays $darrays -array $darray -result_id $result_id] $brief configure -text $line } } } proc unhighlight_graph {e_win} { global $e_win.prev #puts "unhighlight_graph $e_win" if {[info exists $e_win.prev]} { if {[keylget $e_win.prev id] != -1} { set item [keylget $e_win.prev id] set colour [keylget $e_win.prev colour] set line_width [keylget $e_win.prev line_width] # puts " UNHIGHLIGHT [set $e_win.prev]" # puts [$e_win find all] #puts "UNHIGHLIGHT $item" $e_win itemconfig $item -fill $colour -width $line_width unset $e_win.prev } } } proc select_result {e_win x y cmd} { global $e_win.prev tk_utils_defs element_item current_item if {![info exists $e_win.prev]} { keylset $e_win.prev id -1 } set tags [$e_win find withtag NS] foreach tag $tags { $e_win itemconfigure $tag -state hidden } set item [$e_win find closest [$e_win canvasx $x] [$e_win canvasy $y]] set current_item $item #puts "item $current_item" foreach tag $tags { $e_win itemconfigure $tag -state normal } set tags [$e_win gettags $item] foreach tag $tags { if {[regexp {id([0-9]+)$} $tag dummy result_id]} { if {$item != [keylget $e_win.prev id]} { unhighlight_graph $e_win keylset $e_win.prev id $item keylset $e_win.prev colour [lindex [$e_win itemconfig $item -fill] 4] keylset $e_win.prev line_width [lindex [$e_win itemconfig $item -width] 4] #puts "PREV $e_win [set $e_win.prev]" } #puts "HIGHLIGHT $item $cmd" $e_win itemconfig $item -fill [keylget tk_utils_defs ELEMENT.SELECT_COLOUR] -width 0.0 eval $cmd } } } proc highlight_tag {c_win e_win x y} { global tk_utils_defs set brief $c_win[keylget tk_utils_defs CONTAINER.BRIEF.WIN] select_result $e_win $x $y "$brief configure -text \[seq_get_brief -index \$result_id\]" } proc element_popup_menu_cmd {e_win X Y result_id} { if [winfo exists $e_win.m] {destroy $e_win.m} set name [seq_result_key_name -index $result_id] set m [create_popup $e_win.m $name] tk_popup $m $X $Y seq_result_keybox_popup $m $result_id } proc element_popup_menu {e_win x y X Y} { select_result $e_win $x $y "element_popup_menu_cmd $e_win $X $Y \$result_id" } proc element_select_result {e_win x y} { global element_item e_from e_to cursor_win select_result $e_win $x $y "set element_item \$result_id" set e_from $e_win set e_to "" set cursor_win $e_win } proc element_set_result {e_win result_id} { global element_item e_from e_to set element_item $result_id set e_from $e_win set e_to "" set cursor_win $e_win } proc element_move_result {e_win x y X Y} { global e_to moving_cursor current_item moving_result set tags [$e_win gettags $current_item] foreach tag $tags { if {$tag == "cursor"} { return } } if {[info exists moving_cursor]} { return } set moving_result 1 set e_to "" motion_element $X $Y } proc element_drop_result { X Y } { global element_item moving_cursor moving_result if {[info exists moving_cursor]} { return } if {![info exists moving_result] && ![info exists moving_cursor]} { return } if {[info exists element_item]} { drop_result $element_item $X $Y } else { remove_highlight_position_canvas } if {[info exists moving_result]} { unset moving_result } } staden-2.0.0b11-2016-src/tk_utils/entrybox.tcl0000644000031500020650000002042112707372072017373 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # proc CheckInput { path } { set filename [expandpath [$path.entry get]] set response [CheckOpenFile $filename $path] return $response } proc CheckInputOptional { path } { set filename [expandpath [$path.entry get]] if {$filename != ""} { set response [CheckOpenFile $filename $path] } else { set response 1 } return $response } proc CheckInputOptionalDefault { default path } { set filename [expandpath [$path.entry get]] if {$filename != $default} { set response [CheckOpenFile $filename $path] } else { set response 1 } return $response } proc CheckContig {io path } { set stem [file rootname $path] set rreg [scalebox_get $stem.rreg] set name [$path.entry get] eval set response \{[CheckEntry $io $path $name $rreg]\} #response = 1 if not OK, 0 if OK if { $response == 1} { return 0 } return 1 } proc CheckContigName {io path } { set name [$path.entry get] eval set response \{[CheckGelName $io $name $path]\} if { $response == 1} { return 0 } return 1 } proc CheckOutput { path } { set filename [expandpath [$path.entry get]] set response [CheckSaveFile "$filename" $path] if {$response && [file exists "$filename"]} { DeleteFile $filename } return $response } proc CheckOutputOptional { path } { set filename [expandpath [$path.entry get]] if {$filename == ""} { return 1; } set response [CheckSaveFile "$filename" $path] if {$response && [file exists "$filename"]} { DeleteFile $filename } return $response } proc CheckDBOutput { path } { #HACK set file extension for new database to be ALWAYS 0 set ext 0 set filename [expandpath [$path.entry get]] set response1 [CheckSaveFile "$filename.$ext" $path] set response2 [CheckDBFilename $filename $path] #user wishes to overwrite file, must remove existing file if {$response1} { if {[file exists $filename.$ext] } { DeleteFile "$filename.$ext" } if {[file exists $filename.$ext.aux] } { DeleteFile "$filename.$ext.aux" } if {[file exists $filename.$ext.BUSY] } { DeleteFile "$filename.$ext.BUSY" } } #only return true if response1 and response2 are true if {$response1 && $response2} { return 1 } else { return 0 } } proc CheckStringExists { path } { set current [$path.entry get] if {[string length $current] == 0} { return 0 } return 1 } proc CheckString { path } { return 1 } proc CheckDNAString {path} { set current [$path.entry get] if {[regexp {^[ACGTacgt]+$} $current]} { return 1 } return 0 } proc CheckIUBCString {path} { set current [$path.entry get] if {[regexp {^[ACGTRYMKSWBDHVNacgtrymkswbdhvn?-]+$} $current]} { return 1 } return 0 } proc CheckInt { path } { global entry_ set current [$path.entry get] if {![isinteger $current]} { return 0 } return 1 } proc CheckIntRange { min max path } { global entry_ set current [$path.entry get] if {![isinteger $current]} { return 0 } if {$current < $min || $current > $max} { return 0 } return 1 } proc CheckIntMin { min path } { global entry_ set current [$path.entry get] if {![isinteger $current]} { return 0 } if {$current < $min} { return 0 } return 1 } proc CheckIntMax { max path } { global entry_ set current [$path.entry get] if {![isinteger $current]} { return 0 } if {$current > $max} { return 0 } return 1 } proc CheckFloat { path } { global entry_ set current [$path.entry get] if {![isfloat $current]} { return 0 } return 1 } proc CheckFloatRange { min max path} { global entry_ set current [$path.entry get] if {![isfloat $current]} { return 0 } if {$current < $min || $current > $max} { return 0 } return 1 } proc CheckList {path} { return [ListExists [$path.entry get]] } # # Configures an entrybox # proc entrybox_configure {path args} { global entry_ global CurContig set in_arg 0 set arglist "" set title "" set foreground "" set state "" set default "" set default_set 0 set width "" set font "" set $path.Type "" # Process command line args foreach i $args { if {$in_arg} { if {$option == "-title"} { set title "-text {$i}" } elseif {$option == "-state"} { set state "-state $i" } elseif {$option == "-type"} { if {"$i" != ""} { set entry_($path,type) "$i" } else { catch {unset entry_($path,type)} } } elseif {$option == "-default"} { set default $i incr default_set } elseif {$option == "-width"} { set width "-width $i" } elseif {$option == "-font"} { set font "-font {$i}" } elseif {$option == "-command"} { set entry_($path,command) "$i" } else { lappend arglist $option $i } set in_arg 0 } else { set option $i set in_arg 1 } } eval $path.entry configure $arglist if {"$title" != "" || "$foreground" != "" || "$font" != ""} { eval $path.label configure $title $foreground $font } if {"$state" != "" || "$foreground" != "" || "$width" != ""} { eval $path.entry configure $state $foreground $width eval $path.label configure $state $foreground } if {$default_set != 0} { $path.entry delete 0 end $path.entry insert 0 $default #eval $path.entry insert 0 $default } if {[info exists entry_($path,command)]} { bind $path.entry "entrybox_command $path" catch {bind $path.entry "entrybox_command $path"} } else { bind $path.entry "entrybox_get $path" catch {bind $path.entry "entrybox_get $path"} } } # # Creates an entrybox with an associated label. # Command line arguments are as per the frame widget, with the addition of: # -state normal/disabled # -title title # -type check function - eg "CheckInt", "CheckIntRange 1 10". # -width width # -font font for label only # -command for binding entrybox to Return # -default default value # bind EntryBox { catch {unset entry_(%W,type)}; catch {unset entry_(%W,command)}; } proc entrybox {path args} { global entry_ # Create the frame, label and entrybox frame $path -class EntryBox xlabel $path.label -anchor w entry $path.entry # bind $path.entry {tkEntryBackspace %W} # Configure eval entrybox_configure $path $args # Pack and return pack $path.label -side left -fill x pack $path.entry -side right -fill x return $path } # # entrybox_get: # # Given a entrybox path we return the current value # proc entrybox_get {path} { global entry_ set re_enter 0 if {[info exists entry_($path,type)]} { if {[eval $entry_($path,type) $path] == 0} { raise [winfo toplevel $path] focus $path.entry $path.entry icursor end bell # #wait forever... # tkwait variable re_enter return "" } } return [$path.entry get] } # # entrybox_insert: # # Given a entrybox path and text we insert the text in the entry box # proc entrybox_insert {path args} { eval $path.entry insert $args } # # entrybox_delete: # # Given a entrybox path and text we delete the text in the entry box # proc entrybox_delete {path args} { eval $path.entry delete $args } # # entrybox_focus: # # Given a entrybox path, put focus on entry box # proc entrybox_focus {path} { focus $path.entry } # # entrybox_destroy: # # Destroys a entrybox path # proc entrybox_destroy {path} { destroy $path } # # entrybox_command: # # Called when Return is pressed in the entry # proc entrybox_command {path} { global entry_ # Check for entry_(path,command) and execute if {[info exists entry_($path,command)]} { eval $entry_($path,command) \{[$path.entry get]\} #eval $entry_($path,command) \{[entrybox_get $path]\} } } # #returns the pathname for the widget # proc entrybox_path {path} { return $path.entry } staden-2.0.0b11-2016-src/tk_utils/exp_file.tcl0000644000031500020650000001000612707372072017312 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1998. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # # Reads an experiment file into an array structure. Returns the array # in [array get] format proc read_exp_file {file} { # Init array set lines {} set line_count 1 # Open and read file set fd [open $file r] set last_type "" while {[gets $fd line] != -1} { regsub {^(..).*} $line {\1} line_type if {[regsub {^.. (.*)} $line {\1} line_val] && $line_type == $last_type} { set append 1 } else { regsub {^.. (.*)} $line {\1} line_val set append 0 } if {$line_type == "SQ"} { set line_val "" while {[gets $fd line] != -1 && $line != "//"} { regsub -all "\[ \n\t\]*" $line {} line append line_val $line } set append 0 } if {$append} { set last [lindex $lines($line_type) end] set last2 [lindex $last 1] set lines($line_type) [lreplace $lines($line_type) \ end end [list $line_count "$last2\n$line_val"]] } else { if {[info exists lines($line_type)]} { lappend lines($line_type) [list $line_count $line_val] } else { set lines($line_type) [list [list $line_count $line_val]] } } incr line_count set last_type $line_type } set lines(__) $line_count close $fd array get lines } # Write an array (passed by reference) containing an experiment file to # the file named 'fname' proc write_exp_file {arr_name fname} { upvar $arr_name lines set fd [open $fname w] array set lcount {} foreach l [array names lines] { foreach i $lines($l) { set lcount([lindex $i 0]) [list $l [lindex $i 1]] } } #set highest $lines(__) set highest [count_lines lines] for {set i 1} {$i <= $highest} {incr i} { if {![info exists lcount($i)]} { continue } set type [lindex $lcount($i) 0] if {$type == "SQ"} { puts $fd "$type " set seq [lindex $lcount($i) 1] set len [string length $seq] set count 0 for {set j 0} {$j < $len} {incr j 10} { if {$count == 0} { puts -nonewline $fd " " } else { puts -nonewline $fd " " } puts -nonewline $fd [string range $seq $j [expr $j+9]] if {[incr count] == 6} { set count 0 puts $fd "" } } if {$count != 0} { puts $fd "" } puts $fd "//" } else { set first 1 foreach item [split [lindex $lcount($i) 1] \n] { if {$first} { puts $fd "$type $item" set first 0 } else { puts $fd "$type $item" } } } } close $fd } proc count_lines {arr_name} { upvar $arr_name lines set line_count 0 if {[info exists lines(__)]} { set line_count $lines(__) } else { foreach l [array names lines] { foreach i $lines($l) { incr line_count } } } return $line_count } # Adds a line to an experiment file proc add_to_exp_file {arr_name line_type line_val} { upvar $arr_name lines set line_count [count_lines lines] if {[info exists lines($line_type)]} { lappend lines($line_type) [list $line_count $line_val] } else { set lines($line_type) [list [list $line_count $line_val]] } incr line_count set lines(__) $line_count } # Queries a line from an experiment file. # In general it returns the last value. For the case of TG, TC, CC, EX and PS # lines it returns a list proc query_exp_file {arr_name line_type} { upvar $arr_name lines if {![info exists lines($line_type)]} { return "" } set l $lines($line_type) if {$line_type == "TG" || $line_type == "TC" || $line_type == "CC" || $line_type == "EX" || $line_type == "PS"} { set items {} foreach i $l { lappend items [lindex $i 1] } return $items } else { return [lindex [lindex $l end] 1] } } #array set l [read_exp_file a.exp] #query_exp_file l SQ #query_exp_file l ID #query_exp_file l TG #write_exp_file l z staden-2.0.0b11-2016-src/tk_utils/file_checking.tcl0000644000031500020650000000102512707372072020272 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # ############################################################################## #put the current directory path in the Selection entry proc ClearSel { path } { entrybox_delete $path 0 end entrybox_focus $path } #end ClearSel staden-2.0.0b11-2016-src/tk_utils/filebrowser.tcl0000644000031500020650000001504712707372072020054 0ustar jkbteam117#invoke a filebrowser from a browse button attached to entrybox fn #displays ALL files, no filetype has been implemented proc InvokeFileBrowser {fn type} { set filelist "" if {$type == "openmulti"} { set filelist [tk_getOpenFile -multiple 65000 -parent $fn] set fcount [llength $filelist] if { $fcount == 1 } { set file [lindex $filelist 0] } else { set file "" } } elseif {$type == "open"} { set file [tk_getOpenFile -parent $fn] } else { set file [tk_getSaveFile -parent $fn] } if { $file != "" || $filelist == ""} { if [string match [pwd]* $file] { set name [string range $file \ [expr [string length [pwd]]+1] end] } else { set name $file } } else { #Create a list, and keep the files there ... global $fn.Radio set baselist "#List_" for { set count 0 } { [ListExists2 "$baselist$count"] } { incr count } { #tk_messageBox -icon error -type ok -title "DEBUG" \ # -message "$baselist$count" } set name "$baselist$count" ListCreate $name $filelist #eval set \$\{$fn.Radio\} 1 } raise [winfo toplevel $fn] #if user has pressed cancel don't want to remove name from entrybox if {$name != ""} { entrybox_delete $fn 0 end entrybox_insert $fn 0 $name [entrybox_path $fn] xview [string last / $name] } if {$type == "save" && $file != ""} { DeleteFile $file } } #invoke a biolimsbrowser from a browse button attached to entrybox fn proc InvokeBiolimsBrowser {fn type} { set filelist "" if {$type == "openmulti"} { set filelist [spGetOpenBiolimsFile -multiple true -parent $fn] set fcount [llength $filelist] if { $fcount == 1 } { set file [lindex $filelist 0] } else { set file "" } } elseif {$type == "open"} { set file [spGetOpenBiolimsFile -parent $fn] } else { set file [spGetSaveBiolimsFile -parent $fn] } if { $file != "" || $filelist == ""} { set name $file } else { #Create a list, and keep the files there ... global $fn.Radio set baselist "#List_" for { set count 0 } { [ListExists2 "$baselist$count"] } { incr count } { } set name "$baselist$count" ListCreate $name $filelist #eval set \$\{$fn.Radio\} 1 } raise [winfo toplevel $fn] #if user has pressed cancel don't want to remove name from entrybox if {$name != ""} { entrybox_delete $fn 0 end entrybox_insert $fn 0 $name [entrybox_path $fn] xview [string last / $name] } } ############################################################################## #error handling procedures ############################################################################## ############################################################################## #check the filename to be loaded already exists and is readable by user #return 0 for failure #return 1 for success proc CheckOpenFile { filename {p .}} { #check file exists and have read permissions if { [FileExists $filename $p] && [FileReadable $filename $p] } { return 1 } #unable to load file return 0 } #end CheckOpenFile ############################################################################## #check the filename to be saved already exists and is writable by user #return 0 for failure #return 1 for success proc CheckSaveFile { filename {p .} } { #check to see if file already exists and if the user wishes to #overwrite the existing file #result = no if file exists and user does not wish to overwrite #result = yes if file exists and user does wish to overwrite #result = cancel if cancel if {[file isdir $filename]} { tk_messageBox -icon error -type ok -title "Permission denied" \ -message "$filename is a directory" \ -parent $p return 0 } set result [Overwrite "$filename" $p] case $result { 0 {return 0} 1 {if {![FileWritable $filename $p]} {return 0}} 2 {return 0} 3 { if {[catch {set fd [open $filename w]} err]} { tk_messageBox \ -icon error \ -type ok \ -title "error" \ -message "$err" \ -parent $p return 0 } else { close $fd file delete $filename } } } return 1 } #end CheckSaveFile ############################################################################### #check input file exists proc FileExists { filename {p .} } { set stem [file tail $filename] if {$stem == ""} { tk_messageBox -icon error -type ok -title "File does not exist" \ -message "No filename has been entered" \ -parent $p return 0 } if {![file exists $filename]} { tk_messageBox -icon error -type ok -title "File does not exist" \ -parent $p \ -message "$filename cannot be opened. \ Please check the filename and directory" return 0 } return 1 } #end FileExists ############################################################################## #check the user has permission to read the file. proc FileReadable { filename {p .} } { if {[file readable $filename] == 0} { tk_messageBox -icon error -type ok -title "Permission denied" \ -message "You do not have permission to read $filename" \ -parent $p return 0 } #do have permission return 1 } #end FileReadable ############################################################################## #check the user has permission to write the file. proc FileWritable { filename {p .} } { if {[file writable $filename] == 0} { tk_messageBox -icon error -type ok -title "Permission denied" \ -message "You do not have permission to write to $filename" \ -parent $p return 0 } #do have permission return 1 } #end FileWritable ############################################################################## #check to see if file already exists #return 0 if file exists and user does not wish to overwrite #return 1 if file exists and user does wish to overwrite #return 0 if Cancel #return 3 if file does not exist proc Overwrite { filename {p .} } { set stem [file tail $filename] if {$stem == ""} { tk_messageBox -icon error -type ok -title "File does not exist" \ -message "No filename has been entered" \ -parent $p return 0 } if {[file exists $filename]} { return [lsearch {no yes cancel} [tk_messageBox -icon warning -type yesnocancel \ -default no -title "File Exists" \ -message "Do you wish to overwrite $filename" \ -parent $p]] #return [tk_dialog .fileexists "File Exists" "Do you wish to overwrite $filename" warning 0 No Yes Cancel] } #file does not already exist return 3 } #end Overwrite staden-2.0.0b11-2016-src/tk_utils/func_edit.tcl0000644000031500020650000000100612707372072017457 0ustar jkbteam117# Allows editing of Tcl functions from within the console proc func_edit {func} { if {[catch {info arg $func} err]} { tk_messageBox -message $err return } set t "[tmpnam].tcl" set fd [open $t w] puts $fd "proc $func [list [info arg $func]] {[info body $func]}" close $fd #exec xterm -e emacs -nw $t exec xemacs $t set fd [open $t r] set code [read $fd] close $fd file delete $t if {[catch {uplevel #0 $code} err]} { tk_messageBox -message $err return } }staden-2.0.0b11-2016-src/tk_utils/grid.tcl0000644000031500020650000000417312707372072016454 0ustar jkbteam117# insert rows or columns into a grid # grid: the geometry master # what: row or column # index: where to insert # count: how many rows/cols to insert proc grid_insert {grid what index {count 1}} { #puts "grid_insert $grid $what $index" foreach slave [grid slaves $grid] { array set info [grid info $slave] #puts "$info(-$what) $index" if {$info(-$what) >= $index} { incr info(-$what) $count eval {grid $slave} [array get info] } elseif {$info(-$what) + $info(-${what}span) > $index} { incr info(-${what}span) $count eval {grid $slave} [array get info] } } } proc grid_delete {grid what index {count 1}} { #puts "grid_delete $grid $what $index" foreach slave [grid slaves $grid] { array set info [grid info $slave] if {$info(-$what) >= [expr $index + $count]} { incr info(-$what) -$count eval {grid $slave} [array get info] } elseif {$info(-$what)+$info(-${what}span) > [expr $index + $count + 1]} { incr info(-$what) -$count eval {grid $slave} [array get info] } } } proc grid_size {grid what} { set num 0 foreach slave [grid slaves $grid] { array set info [grid info $slave] #puts "slave $slave $info(-$what)" if {$info(-$what) > $num} { set num $info(-$what) } } return $num } #return list of all windows in row or column proc grid_find {grid what index} { #puts "****************grid_find $grid $what" set list "" foreach slave [grid slaves $grid] { array set info [grid info $slave] #puts "$slave $info(-$what)" if {$info(-$what) == $index} { lappend list $slave } } #puts "FOUND list $list" return $list } #insert single element in row column proc grid_insert_element {grid row column} { #puts "grid_insert $grid $row $column" foreach slave [grid slaves $grid] { array set info [grid info $slave] #puts "$info(-$what) $index" if {$info(-$what) >= $index} { incr info(-$what) $count eval {grid $slave} [array get info] } elseif {$info(-$what) + $info(-${what}span) > $index} { incr info(-${what}span) $count eval {grid $slave} [array get info] } } } staden-2.0.0b11-2016-src/tk_utils/help.tcl0000644000031500020650000002430112707372072016452 0ustar jkbteam117# # Copyright (c) 1995 Medical Research Council, Laboratory of Molecular Biology. # All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # # # Standalone HTML viewer (v 0.1) to use Stephen Uhler's html-library. # The HTML library is Copyright (c) 1995 by Sun Microsystems. # # # External functions: # help_display {name} # help_init {{top ""}} # # Internal functions: # help_* {} # HM* {} # # internal global variables # help_history # help_future # help_win # help_toplevel # help_file # help_recurse # Maximum number of links to remember for the "Back" command. global MAX_LINK_HISTORY set MAX_LINK_HISTORY 10 source $env(STADTABL)/help_config #----------------------------------------------------------------------------- # Externally callable interfaces proc help_display {name} { global help_path help_win help_toplevel if {$help_toplevel != ""} { wm deiconify $help_toplevel raise $help_toplevel } else { wm deiconify . raise . } HMlink_callback $help_win $name } proc help_init {{top ""} {external 0}} { global help_file help_recurse help_history help_future help_win global help_toplevel help_path set help_file "" set help_history "" set help_future "" set help_recurse 0 set help_toplevel $top if {$top != "" && ![winfo exists $top]} { xtoplevel $top wm title $top "Help" } else { set top . } # The main window. There's quite a bit to do to disable editing features # for this text display whilst retaining editing ability from the code. set t [text $help_toplevel.text -yscroll \ "$help_toplevel.scroll set" -insertontime -1] set help_win $t bind $t {break} bind $t {break} scrollbar $help_toplevel.scroll \ -command "$help_toplevel.text yview" wm protocol $top WM_DELETE_WINDOW "help_quit $top" # The menu bar set w [frame $help_toplevel.top -bd 2 -relief raised] menubutton $w.file -text "File" -menu $w.file.m set m [menu $w.file.m] if {$external} { $m add command -label "New window" -command "help_new_win" $m add separator } foreach i [glob $help_path/*_toc.html] { regsub "${help_path}/(.*)_toc.html" $i {\1} x $m add command -label "File '$x'" -command "HMlink_callback $t $i" } $m add separator $m add command -label "Quit" -command "help_quit $top" menubutton $w.font -text "Fonts" -menu $w.font.m set m [menu $w.font.m] $m add command -label "small" \ -command "HMset_state $t -size -5; help_redraw_link $t" $m add command -label "medium" \ -command "HMset_state $t -size -2; help_redraw_link $t" $m add command -label "large" \ -command "HMset_state $t -size 3; help_redraw_link $t" button $w.back -text "Back" -command "help_back_link $t" -state disabled button $w.forw -text "Forward" -command "help_forward_link $t" \ -state disabled button $w.stop -text "Stop" -command "HMstop_parse $t" # The status line entry $w.status -text "" bind $w.status \ "HMlink_callback $help_toplevel.text \[%W get\]" pack $w.file $w.font -side left pack $w.stop $w.forw $w.back -side right pack $w.status -padx 0.5c -side left -fill both -expand 1 pack $w -side top -fill both pack $help_toplevel.scroll -side right -fill both pack $help_toplevel.text -side left -fill both -expand 1 #tk_focusFollowsMouse #bind Entry [bind Entry ] trace variable help_history w help_history_trace trace variable help_future w help_future_trace HMinit_win $t HM_our_init HMset_state $t -size -2 HMset_indent $t 1.5 return $t } #----------------------------------------------------------------------------- # Internal help display functions proc help_new_win {} { exec stash -f ./help.tcl -init & } proc help_quit {top} { global help_win help_history help_future HMstop_parse $help_win catch {unset help_history help_future}; #remove traces destroy $top } proc help_back_link {win} { global help_history help_future set l [expr [llength $help_history]-2] if {$l < 0} { bell return } lappend help_future [lrange $help_history end end] set url [lrange $help_history $l $l] incr l -1 set help_history [lrange $help_history 0 $l] HMlink_callback $win $url keep } proc help_forward_link {win} { global help_future set l [expr [llength $help_future]-1] if {$l < 0} { bell return } set url [lrange $help_future $l $l] incr l -1 set help_future [lrange $help_future 0 $l] HMlink_callback $win $url keep } proc help_redraw_link {win} { global help_history help_file set l [expr [llength $help_history]-1] set url [lrange $help_history $l $l] incr l -1 set help_history [lrange $help_history 0 $l] set help_file "" HMlink_callback $win $url keep } proc help_set_status {text} { global help_toplevel $help_toplevel.top.status delete 0 end $help_toplevel.top.status insert end $text } proc help_set_stop {mode} { global help_toplevel if [winfo exist $help_toplevel] { $help_toplevel.top.stop configure -state $mode } } proc help_history_trace {name element op} { global $name help_toplevel if {[llength [set $name]] < 2} { $help_toplevel.top.back configure -state disabled } else { $help_toplevel.top.back configure -state normal } } proc help_future_trace {name element op} { global $name help_toplevel if {[set $name] == ""} { $help_toplevel.top.forw configure -state disabled } else { $help_toplevel.top.forw configure -state normal } } #----------------------------------------------------------------------------- # html-library callbacks # Wrap these up in a procedure so we can redefine them again # regardless of which order autoloading takes place. proc HM_our_init {} { # Stop and start parsing of html. These should be done using # "HMset_state $win -stop 1" (or -stop 0), but this doesn't appear to work. # For the time being we're hacking directly into the library. proc HMstop_parse {win} { upvar #0 HM$win var set var(stop) 1 } proc HMstart_parse {win} { upvar #0 HM$win var set var(stop) 0 } # Callback for when an image is loaded. proc HMset_image {win handle src} { update idletasks global TRANSPARENT_GIF_COLOR help_path set TRANSPARENT_GIF_COLOR [$win cget -bg] image create photo $src -file $help_path/$src -palette 7/7/4 HMgot_image $handle $src } # Callback for when a link is followed. Complicated greatly by the fact that # it needs to be reentrant for the case where people follow a link before # the displaying of the current link has finished. proc HMlink_callback {win link {future clear}} { global help_file help_recurse help_history help_future global MAX_LINK_HISTORY help_toplevel if [string match *:* $link] { set x [string first : $link] set service [string range $link 0 [expr $x-1]] set link [string range $link [expr $x+1] end] if {$service != "file"} { # tk_dialog $help_toplevel.error "Error" \ # "Couldn't follow link '$link'. \ # Only file: based URLs are supported" \ # error 0 Ok bell return } } if {[string index $link 0] != "/"} { global help_path if {[file exists [regsub {([^#]*)(#.*)?} $link "$help_path/\\1"]]} { set link "$help_path/$link" } else { set link "$help_path/../$link" } } if [string match *#* $link] { set x [string first # $link] set file [string range $link 0 [expr $x-1]] set mark [string range $link [expr $x+1] end] } else { set file $link set mark "" } update idletasks # Add to history. Chop off oldest element if we're getting too long. set old_hist $help_history set old_future $help_future lappend help_history $link if {$future == "clear"} { set help_future "" } if {[llength $help_history] > $MAX_LINK_HISTORY+1} { set help_history [lrange $help_history 1 end] } # If we've got a new file, load and render it if {$file != $help_file} { # Read the file into $html if [catch {set fd [open $file]}] { set help_history $old_hist set help_future $old_future tk_dialog $help_toplevel.error "Error" \ "Couldn't follow link '$link'. The file doesn't exist" \ error 0 Ok return } set html [read $fd] close $fd HMreset_win $win # Flag our loop incr help_recurse set help_file $file # Goto the correct position (which is allowed to be done before # it's visible) and then render. if {$mark != ""} { HMgoto $win $mark } help_set_status $link help_set_stop normal HMparse_html $html "HMrender $win" # This bit's horrid. We need to check whether we've been told to # redraw before finishing the current rendering. In this case this # routine will have been called again, the HMparse_html will have # finished, and recurse will be > 1. Hence we then disable any # future rendering thus causing the HMparse_html call of higher stacks # (which are still present) to exit. When the original HMparse_html has # exited we must reenable the rendering once more. Sorry if it seems # complicated, but it is. if {$help_recurse > 1} { # stopping rendering for higher stacks HMstop_parse $win } if {[incr help_recurse -1] == 0} { # reenabling rendering when original call of this routine ends. HMstart_parse $win help_set_stop disabled } # Otherwise, (ie when we've ONLY changed mark) perform a goto request. } elseif {$mark != ""} { help_set_status $link HMgoto $win $mark } else { $win yview 1.0 } } # from "proc HM_our_init {} ..." } # Called after a goto; normally flashes orange, but we've disabled it. proc HMwent_to {win where} { } #----------------------------------------------------------------------------- # Main startup code # When running as a standalone program, we bring up the display automatically if {[info exists argv] && $argv == "-init"} { set auto_path "$env(STADTCL)/tkutils $auto_path" tkinit help_init "" 1 cd $help_path } #HMlink_callback [help_init] registration_toc.html #HMlink_callback [help_init] test.html staden-2.0.0b11-2016-src/tk_utils/help_choose.tcl0000644000031500020650000000656012707372072020021 0ustar jkbteam117# The guts of the show_help command, common to all implementations. # This does the topic/index searching and returns the filename # # There are two styles of help system. The old method uses double indirection # via searching for $topic in the $file.topic file. This returns a heading # name which is then searched for in the $file.index file. # # The new mode works from texinfo node names. It doens't have double # indirection. It searches only in ${file}.index. # # For backwards compatibility with third party modules (eg Pride), we # look for the presence of a .topic file. If we find one then we'll # use the old method. # proc show_help_common {file {topic Contents}} { global help_path package_dir if {$file == ""} { return "" } if {$file == "url"} { return $topic } set dir $help_path if {[string range $file 0 0] == "%"} { set file [string range $file 1 end] set dir $package_dir($file) } set file $dir/$file # This bit's inefficient on large indexes (eg ~10000 entries). (2.8 secs) # Could try building an awk script and executing it. # eg: # # awk '$1 == "{contig_register_ini}" {print $2}' # (1.9 for awk, 0.4 for gawk) # # or: # # sed -n 's/^{contig_register_init}[ ]*\(.*\)/\1/p' # (0.9 secs) # # or: # egrep '^\{contig_register_ini\}' < registration.index # (1.5 secs) # # However, we're typically going to have indexes well under a tenth of # those tested above. if {[file exists $file.topic]} { # Old method # Convert from topic to section set fd [open ${file}.topic] while {[gets $fd l] != -1} { if {[lindex $l 0] == $topic} { close $fd set section [lindex $l 1] # Convert from section to URL set fd [open ${file}.index] while {[gets $fd l] != -1} { if {[lindex $l 0] == $section} { close $fd return file:$dir/[lindex $l 1] } } break } } } else { # New method # Convert from topic to section set fd [open ${file}.index] while {[gets $fd l] != -1} { if {[string compare [lindex $l 0] $topic] == 0} { close $fd return file:$dir/[lindex $l 1] } } } bell puts "Couldn't find help for subject '$topic'" close $fd return "" } proc load_help_system {dir} { global tk_utils_defs set version [keylget tk_utils_defs HELP_PROGRAM] if {$version == "tcl-external"} { uplevel #0 "source {$dir/help_ext.tcl}" } elseif {$version == "netscape" || \ $version == "mozilla" || \ $version == "konqueror"} { uplevel #0 "source {$dir/help_netscape.tcl}" } elseif {$version == "galeon"} { uplevel #0 "source {$dir/help_galeon.tcl}" } elseif {$version == "windows"} { # 7/1/99 johnt - added windows support uplevel #0 "source {$dir/help_windows.tcl}" } elseif {$version == "macosx"} { uplevel #0 "source {$dir/help_macosx.tcl}" } elseif {$version == "tcl-internal"} { uplevel #0 "source {$dir/help_int.tcl}" } else { # Auto global errorCode catch {exec mozilla -version} if {$errorCode == "NONE"} { keylset tk_utils_defs HELP_PROGRAM mozilla } else { catch {exec netscape -version} if {$errorCode == "NONE"} { keylset tk_utils_defs HELP_PROGRAM netscape } else { keylset tk_utils_defs HELP_PROGRAM tcl-internal } } load_help_system $dir } } load_help_system $env(STADTCL)/tk_utils staden-2.0.0b11-2016-src/tk_utils/help_ext.tcl0000644000031500020650000000220712707372072017333 0ustar jkbteam117#!/usr/local/bin/wish4.0 # # Copyright (c) 1995 Medical Research Council, Laboratory of Molecular Biology. # All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # # # Library to communicate with the help viewer. This should be the only file # with internal knowledge of the help code; and it should be minimal knowledge # at that. # # The "show_help" function requests for help to be viewed from a given file # and topic. The help is viewed using a standalone help viewer (help.tcl). # source $env(STADTABL)/help_config proc find_help_interp {} { foreach i [winfo interps] { if [string match help.tcl* $i] { return $i } } return "" } proc show_help {file {topic Contents}} { if {[set i [find_help_interp]]==""} { global auto_index regsub "source " $auto_index(help_init) "" z exec stash -f $z -init & exec sleep 1 return [show_help $file $topic] } set url [show_help_common $file $topic] if {$url != ""} { send -async $i "help_display $url" } } staden-2.0.0b11-2016-src/tk_utils/help_galeon.tcl0000644000031500020650000000127012707372072017777 0ustar jkbteam117#!/usr/local/bin/wish4.0 # # Copyright (c) 1995 Medical Research Council, Laboratory of Molecular Biology. # All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # # # Library to communicate with netscape as a help viewer. # # The "show_help" function requests for help to be viewed from a given file # and topic. # source $env(STADTABL)/help_config proc show_url {url} { exec galeon -x $url & } proc show_help {file {topic Contents}} { set url [show_help_common $file $topic] if {$url != ""} { show_url $url } } staden-2.0.0b11-2016-src/tk_utils/help_int.tcl0000644000031500020650000000163512707372072017331 0ustar jkbteam117#!/usr/local/bin/wish4.0 # # Copyright (c) 1995 Medical Research Council, Laboratory of Molecular Biology. # All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # # # Library to communicate with the help viewer. This should be the only file # with internal knowledge of the help code; and it should be minimal knowledge # at that. # # The "show_help" function requests for help to be viewed from a given file # and topic. The help is viewed using a window in the current tcl application. # source $env(STADTABL)/help_config proc show_url {url} { if {![winfo exists .help]} { help_init ".help" } if {$url != ""} { help_display $url } } proc show_help {file {topic Contents}} { set url [show_help_common $file $topic] show_url $url } staden-2.0.0b11-2016-src/tk_utils/help_macosx.tcl0000644000031500020650000000207512707372072020030 0ustar jkbteam117# # Copyright (c) 1995 Medical Research Council, Laboratory of Molecular Biology. # All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # # # The "show_help" function requests for help to be viewed from a given file # and topic. # source $env(STADTABL)/help_config proc show_url {url} { global env # MacOS file associations do not like urls such as # "document.html#section" - we need to remove the #section bit. regsub {#[^#]*$} $url {} url regsub {^file:/+} $url {/} url # The mac open command can fail if we are in fullscreen X windows mode # and we try to bring up a help browser that cannot deal with X (eg # internet explorer). if {[catch {exec open $url}]} { source $env(STADTCL)/tk_utils/help_int.tcl return [show_url $url] } } proc show_help {file {topic Contents}} { set url [show_help_common $file $topic] if {$url != ""} { show_url $url } } staden-2.0.0b11-2016-src/tk_utils/help_netscape.tcl0000644000031500020650000000156612707372072020344 0ustar jkbteam117#!/usr/local/bin/wish4.0 # # Copyright (c) 1995 Medical Research Council, Laboratory of Molecular Biology. # All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # # # Library to communicate with netscape as a help viewer. # # The "show_help" function requests for help to be viewed from a given file # and topic. # source $env(STADTABL)/help_config proc show_url {url} { global tk_utils_defs set prog [keylget tk_utils_defs HELP_PROGRAM] set cmd [format {[ "`%s -remote 'OpenUrl(%s,new-tab)' 2>&1`" != "" ] \ && %s '%s'} $prog $url $prog $url] exec sh -c "$cmd" & } proc show_help {file {topic Contents}} { set url [show_help_common $file $topic] if {$url != ""} { show_url $url } } staden-2.0.0b11-2016-src/tk_utils/help_windows.tcl0000644000031500020650000000261412707372072020227 0ustar jkbteam117#!/usr/local/bin/wish4.0 # # Copyright (c) 1995 Medical Research Council, Laboratory of Molecular Biology. # All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # # # Library to communicate with netscape as a help viewer. # # The "show_help" function requests for help to be viewed from a given file # and topic. # source $env(STADTABL)/help_config proc show_url {url} { global env global env tcl_platform # Windows file associations do not like urls such as # "document.html#section" - we need to remove the #section bit. regsub {#[^#]*$} $url {} url # The start programs are different on windows 9x and windows NT/2000 # On NT/2000 we must insert quotes as the first argument (window title). # On win9x there is no such option. if { $tcl_platform(os) == "Windows NT" } { if [ regexp -nocase -- {COMMAND\.COM$} $env(COMSPEC) ] { exec start "" $url & } else { exec $env(COMSPEC) /c start "" $url & } } else { if [ regexp -nocase -- {COMMAND\.COM$} $env(COMSPEC) ] { exec start $url & } else { exec $env(COMSPEC) /c start $url & } } } proc show_help {file {topic Contents}} { set url [show_help_common $file $topic] if {$url != ""} { show_url $url } } staden-2.0.0b11-2016-src/tk_utils/html_library.tcl0000644000031500020650000011714712707372072020225 0ustar jkbteam117# Simple HTML display library by Stephen Uhler (stephen.uhler@sun.com) # Copyright (c) 1995 by Sun Microsystems # Version 0.3 Fri Sep 1 10:47:17 PDT 1995 # # See the file "tcl-license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # To use this package, create a text widget (say, .text) # and set a variable full of html, (say $html), and issue: # HMinit_win .text # HMparse_html $html "HMrender .text" # You also need to supply the routine: # proc HMlink_callback {win href} { ...} # win: The name of the text widget # href The name of the link # which will be called anytime the user "clicks" on a link. # The supplied version just prints the link to stdout. # In addition, if you wish to use embedded images, you will need to write # proc HMset_image {handle src} # handle an arbitrary handle (not really) # src The name of the image # Which calls # HMgot_image $handle $image # with the TK image. # # To return a "used" text widget to its initialized state, call: # HMreset_win .text # See "sample.tcl" for sample usage ################################################################## ############################################ # mapping of html tags to text tag properties # properties beginning with "T" map directly to text tags # These are Defined in HTML 2.0 array set HMtag_map { b {weight bold} blockquote {style i indent 1 Trindent rindent} bq {style i indent 1 Trindent rindent} cite {style i} code {family courier} dfn {style i} dir {indent 1} dl {indent 1} em {style i} h1 {size 24 weight bold} h2 {size 22} h3 {size 20} h4 {size 18} h5 {size 16} h6 {style i} i {style i} kbd {family courier weight bold} menu {indent 1} ol {indent 1} pre {fill 0 family courier Tnowrap nowrap} samp {family courier} strong {weight bold} tt {family courier} u {Tunderline underline} ul {indent 1} var {style i} } # These are in common(?) use, but not defined in html2.0 array set HMtag_map { center {Tcenter center} strike {Tstrike strike} u {Tunderline underline} } # initial values set HMtag_map(hmstart) { family times weight medium style r size 14 Tcenter "" Tlink "" Tnowrap "" Tunderline "" list list fill 1 indent "" counter 0 adjust 0 } # html tags that insert white space array set HMinsert_map { blockquote "\n\n" /blockquote "\n" br "\n" dd "\n" /dd "\n" dl "\n" /dl "\n" dt "\n" form "\n" /form "\n" h1 "\n\n\n" /h1 "\n" h2 "\n\n\n" /h2 "\n" h3 "\n\n\n" /h3 "\n" h4 "\n\n" /h4 "\n" h5 "\n\n" /h5 "\n" h6 "\n\n" /h6 "\n" li "\n" /dir "\n" /ul "\n" /ol "\n" /menu "\n" p "\n\n" pre "\n" /pre "\n" } # tags that are list elements, that support "compact" rendering array set HMlist_elements { ol 1 ul 1 menu 1 dl 1 dir 1 } ############################################ # initialize the window and stack state proc HMinit_win {win} { upvar #0 HM$win var HMinit_state $win $win tag configure underline -underline 1 $win tag configure center -justify center $win tag configure nowrap -wrap none $win tag configure rindent -rmargin $var(S_tab)c $win tag configure strike -overstrike 1 $win tag configure mark -foreground red ;# list markers $win tag configure list -spacing1 3p -spacing3 3p ;# regular lists $win tag configure compact -spacing1 0p ;# compact lists $win tag configure link -borderwidth 2 -foreground blue ;# hypertext links HMset_indent $win $var(S_tab) $win configure -wrap word # configure the text insertion point $win mark set $var(S_insert) 1.0 # for horizontal rules if {[catch {$win tag configure thin \ -font [HMx_font times 2 medium r]}]} { if {[catch {$win tag configure thin \ -font [HMx_font times 6 medium r]}]} { $win tag configure thin -font [HMx_font times 8 medium r] } } $win tag configure hr -relief sunken -borderwidth 2 -wrap none \ -tabs [winfo width $win] bind $win { %W tag configure hr -tabs %w %W tag configure last -spacing3 %h } # generic link enter callback $win tag bind link <1> "HMlink_hit $win %x %y" } # set the indent spacing (in cm) for lists # TK uses a "weird" tabbing model that causes \t to insert a single # space if the current line position is past the tab setting proc HMset_indent {win cm} { set tabs [expr $cm / 2.0] $win configure -tabs ${tabs}c foreach i {1 2 3 4 5 6 7 8 9} { set tab [expr $i * $cm] $win tag configure indent$i -lmargin1 ${tab}c -lmargin2 ${tab}c \ -tabs "[expr $tab + $tabs]c [expr $tab + 2*$tabs]c" } } # reset the state of window - get ready for the next page # remove all but the font tags, and remove all form state proc HMreset_win {win} { upvar #0 HM$win var regsub -all { +[^L ][^ ]*} " [$win tag names] " {} tags catch "$win tag delete $tags" eval $win mark unset [$win mark names] $win delete 0.0 end $win tag configure hr -tabs [winfo width $win] # configure the text insertion point $win mark set $var(S_insert) 1.0 # remove form state. If any check/radio buttons still exists, # their variables will be magically re-created, and never get # cleaned up. catch unset [info globals HM$win.form*] HMinit_state $win return HM$win } # initialize the window's state array # Parameters beginning with S_ are NOT reset # adjust_size: global font size adjuster # unknown: character to use for unknown entities # tab: tab stop (in cm) # stop: enabled to stop processing # update: how many tags between update calls # tags: number of tags processed so far # symbols: Symbols to use on un-ordered lists proc HMinit_state {win} { upvar #0 HM$win var array set tmp [array get var S_*] catch {unset var} array set var { stop 0 tags 0 fill 0 list list S_adjust_size 0 S_tab 1.0 S_unknown \xb7 S_update 10 S_symbols O*=+-o\xd7\xb0>:\xb7 S_insert Insert } array set var [array get tmp] } # alter the parameters of the text state # this allows an application to over-ride the default settings # it is called as: HMset_state -param value -param value ... array set HMparam_map { -update S_update -tab S_tab -unknown S_unknown -stop S_stop -size S_adjust_size -symbols S_symbols -insert S_insert } proc HMset_state {win args} { upvar #0 HM$win var global HMparam_map set bad 0 if {[catch {array set params $args}]} {return 0} foreach i [array names params] { incr bad [catch {set var($HMparam_map($i)) $params($i)}] } return [expr $bad == 0] } ############################################ # manage the display of html # HMrender gets called for every html tag # win: The name of the text widget to render into # tag: The html tag (in arbitrary case) # not: a "/" or the empty string # param: The un-interpreted parameter list # text: The plain text until the next html tag proc HMrender {win tag not param text} { upvar #0 HM$win var if {$var(stop)} return global HMtag_map HMinsert_map HMlist_elements set tag [string tolower $tag] set text [HMmap_esc $text] # manage compact rendering of lists if {[info exists HMlist_elements($tag)]} { set list "list [expr {[HMextract_param $param compact] ? "compact" : "list"}]" } else { set list "" } # Allow text to be diverted to a different window (for tables) # this is not currently used if {[info exists var(divert)]} { set win $var(divert) upvar #0 HM$win var } # adjust (push or pop) tag state catch {HMstack $win $not "$HMtag_map($tag) $list"} # insert white space (with current font) # adding white space can get a bit tricky. This isn't quite right set bad [catch {$win insert $var(S_insert) $HMinsert_map($not$tag) "space $var(font)"}] if {!$bad && [lindex $var(fill) end]} { set text [string trimleft $text] } # to fill or not to fill if {[lindex $var(fill) end]} { set text [HMzap_white $text] } # generic mark hook catch {HMmark $not$tag $win $param text} err # do any special tag processing catch {HMtag_$not$tag $win $param text} msg # add the text with proper tags set tags [HMcurrent_tags $win] $win insert $var(S_insert) $text $tags # We need to do an update every so often to insure interactive response. # This can cause us to re-enter the event loop, and cause recursive # invocations of HMrender, so we need to be careful. if {!([incr var(tags)] % $var(S_update))} { update } } # html tags requiring special processing # Procs of the form HMtag_ or HMtag_ get called just before # the text for this tag is displayed. These procs are called inside a # "catch" so it is OK to fail. # win: The name of the text widget to render into # param: The un-interpreted parameter list # text: A pass-by-reference name of the plain text until the next html tag # Tag commands may change this to affect what text will be inserted # next. # A pair of pseudo tags are added automatically as the 1st and last html # tags in the document. The default is and . # Append enough blank space at the end of the text widget while # rendering so HMgoto can place the target near the top of the page, # then remove the extra space when done rendering. proc HMtag_hmstart {win param text} { upvar #0 HM$win var $win mark gravity $var(S_insert) left $win insert end "\n " last $win mark gravity $var(S_insert) right } proc HMtag_/hmstart {win param text} { $win delete last.first end } # put the document title in the window banner, and remove the title text # from the document proc HMtag_title {win param text} { upvar $text data wm title [winfo toplevel $win] $data set data "" } proc HMtag_hr {win param text} { upvar #0 HM$win var $win insert $var(S_insert) "\n" space "\n" thin "\t" "thin hr" "\n" thin } # list element tags proc HMtag_ol {win param text} { upvar #0 HM$win var set var(count$var(level)) 0 } proc HMtag_ul {win param text} { upvar #0 HM$win var catch {unset var(count$var(level))} } proc HMtag_menu {win param text} { upvar #0 HM$win var set var(menu) -> set var(compact) 1 } proc HMtag_/menu {win param text} { upvar #0 HM$win var catch {unset var(menu)} catch {unset var(compact)} } proc HMtag_dt {win param text} { upvar #0 HM$win var upvar $text data set level $var(level) incr level -1 $win insert $var(S_insert) "$data" \ "hi [lindex $var(list) end] indent$level $var(font)" set data {} } proc HMtag_li {win param text} { upvar #0 HM$win var set level $var(level) incr level -1 set x [string index $var(S_symbols)+-+-+-+-" $level] catch {set x [incr var(count$level)]} catch {set x $var(menu)} $win insert $var(S_insert) "\t$x " "mark [lindex $var(list) end] indent$level $var(font)" } # Manage hypertext "anchor" links. A link can be either a source (href) # a destination (name) or both. If its a source, register it via a callback, # and set its default behavior. If its a destination, check to see if we need # to go there now, as a result of a previous HMgoto request. If so, schedule # it to happen with the closing tag, so we can highlight the text up to # the . proc HMtag_a {win param text} { upvar #0 HM$win var # a source if {[HMextract_param $param href]} { set var(Tref) [list L:$href] HMstack $win "" "Tlink link" HMlink_setup $win $href } # a destination if {[HMextract_param $param name]} { set var(Tname) [list N:$name] HMstack $win "" "Tanchor anchor" $win mark set N:$name "$var(S_insert) - 1 chars" $win mark gravity N:$name left if {[info exists var(goto)] && $var(goto) == $name} { unset var(goto) set var(going) $name } } } # The application should call here with the fragment name # to cause the display to go to this spot. # If the target exists, go there (and do the callback), # otherwise schedule the goto to happen when we see the reference. proc HMgoto {win where {callback HMwent_to}} { upvar #0 HM$win var if {[regexp "N:${where}( |\$)" [$win mark names]]} { $win see N:$where update eval $callback $win [list $where] return 1 } else { set var(goto) $where return 0 } } # We actually got to the spot, so highlight it! # This should/could be replaced by the application # We'll flash it orange a couple of times. proc HMwent_to {win where {count 0} {color orange}} { upvar #0 HM$win var if {$count > 5} return catch {$win tag configure N:$where -foreground $color} update after 200 [list HMwent_to $win $where [incr count] \ [expr {$color=="orange" ? "" : "orange"}]] } proc HMtag_/a {win param text} { upvar #0 HM$win var if {[info exists var(Tref)]} { unset var(Tref) HMstack $win / "Tlink link" } # goto this link, then invoke the call-back. if {[info exists var(going)]} { $win yview N:$var(going) update HMwent_to $win $var(going) unset var(going) } if {[info exists var(Tname)]} { unset var(Tname) HMstack $win / "Tanchor anchor" } } # Inline Images # This interface is subject to change # Most of the work is getting around a limitation of TK that prevents # setting the size of a label to a widthxheight in pixels # # Images have the following parameters: # align: top,middle,bottom # alt: alternate text # ismap: A clickable image map # src: The URL link # Netscape supports (and so do we) # width: A width hint (in pixels) # height: A height hint (in pixels) # border: The size of the window border proc HMtag_img {win param text} { upvar #0 HM$win var # get alignment array set align_map {top top middle center bottom bottom} set align bottom ;# The spec isn't clear what the default should be HMextract_param $param align catch {set align $align_map([string tolower $align])} # get alternate text set alt "" HMextract_param $param alt set alt [HMmap_esc $alt] # get the border width set border 1 HMextract_param $param border # see if we have an image size hint # If so, make a frame the "hint" size to put the label in # otherwise just make the label set item $win.$var(tags) # catch {destroy $item} if {[HMextract_param $param width] && [HMextract_param $param height]} { frame $item -width $width -height $height pack propagate $item 0 set label $item.label label $label pack $label -expand 1 -fill both } else { set label $item label $label } $label configure -relief ridge -fg orange -text $alt catch {$label configure -bd $border} $win window create $var(S_insert) -align $align -window $item -pady 2 -padx 2 # add in all the current tags (this is overkill) set tags [HMcurrent_tags $win] foreach tag $tags { $win tag add $tag $item } # set link callback set link [lindex $tags [lsearch -glob $tags L:*]] if {$link != ""} { global HMevents regsub L: $link {} link regsub -all {%} $link {%%} link2 foreach i [array names HMevents] { bind $label <$i> "catch \{%W configure $HMevents($i)\}" } bind $label <1> "+HMlink_callback $win $link2" } # set imagemap callbacks if {[HMextract_param $param ismap]} { # regsub -all {[^L]*L:([^ ]*).*} $tags {\1} link set link [lindex $tags [lsearch -glob $tags L:*]] regsub L: $link {} link global HMevents regsub -all {%} $link {%%} link2 foreach i [array names HMevents] { bind $label <$i> "catch \{%W configure $HMevents($i)\}" } bind $label <1> "+HMlink_callback $win $link2?%x,%y" } # now callback to the application set src "" HMextract_param $param src HMset_image $win $label $src return $label ;# used by the forms package for input_image types } # The app needs to supply one of these proc HMset_image {win handle src} { HMgot_image $handle "can't get\n$src" } # When the image is available, the application should call back here. # If we have the image, put it in the label, otherwise display the error # message. If we don't get a callback, the "alt" text remains. # if we have a clickable image, arrange for a callback proc HMgot_image {win image_error} { # if we're in a frame turn on geometry propogation if {[winfo name $win] == "label"} { pack propagate [winfo parent $win] 1 } if {[catch {$win configure -image $image_error}]} { $win configure -image {} $win configure -text $image_error } } # Sample hypertext link callback routine - should be replaced by app # This proc is called once for each tag. # Applications can overwrite this procedure, as required, or # replace the HMevents array # win: The name of the text widget to render into # href: The HREF link for this tag. array set HMevents { Enter {-borderwidth 2 -relief raised } Leave {-borderwidth 2 -relief flat } 1 {-borderwidth 2 -relief sunken} ButtonRelease-1 {-borderwidth 2 -relief raised} } # We need to escape any %'s in the href tag name so the bind command # doesn't try to substitute them. proc HMlink_setup {win href} { global HMevents regsub -all {%} $href {%%} href2 foreach i [array names HMevents] { eval {$win tag bind L:$href <$i>} \ \{$win tag configure \{L:$href2\} $HMevents($i)\} } } # generic link-hit callback # This gets called upon button hits on hypertext links # Applications are expected to supply ther own HMlink_callback routine # win: The name of the text widget to render into # x,y: The cursor position at the "click" proc HMlink_hit {win x y} { set tags [$win tag names @$x,$y] set link [lindex $tags [lsearch -glob $tags L:*]] # regsub -all {[^L]*L:([^ ]*).*} $tags {\1} link regsub L: $link {} link HMlink_callback $win $link } # replace this! # win: The name of the text widget to render into # href: The HREF link for this tag. proc HMlink_callback {win href} { puts "Got hit on $win, link $href" } # extract a value from parameter list (this needs a re-do) # returns "1" if the keyword is found, "0" otherwise # param: A parameter list. It should alredy have been processed to # remove any entity references # key: The parameter name # val: The variable to put the value into (use key as default) proc HMextract_param {param key {val ""}} { if {$val == ""} { upvar $key result } else { upvar $val result } set ws " \n\r" # look for name=value combinations. Either (') or (") are valid delimeters if { [regsub -nocase [format {.*%s[%s]*=[%s]*"([^"]*).*} $key $ws $ws] $param {\1} value] || [regsub -nocase [format {.*%s[%s]*=[%s]*'([^']*).*} $key $ws $ws] $param {\1} value] || [regsub -nocase [format {.*%s[%s]*=[%s]*([^%s]+).*} $key $ws $ws $ws] $param {\1} value] } { set result $value return 1 } # now look for valueless names # I should strip out name=value pairs, so we don't end up with "name" # inside the "value" part of some other key word - some day set bad \[^a-zA-Z\]+ if {[regexp -nocase "$bad$key$bad" -$param-]} { return 1 } else { return 0 } } # These next two routines manage the display state of the page. # Push or pop tags to/from stack. # Each orthogonal text property has its own stack, stored as a list. # The current (most recent) tag is the last item on the list. # Push is {} for pushing and {/} for popping proc HMstack {win push list} { upvar #0 HM$win var array set tags $list if {$push == ""} { foreach tag [array names tags] { lappend var($tag) $tags($tag) } } else { foreach tag [array names tags] { # set cnt [regsub { *[^ ]+$} $var($tag) {} var($tag)] set var($tag) [lreplace $var($tag) end end] } } } # extract set of current text tags # tags starting with T map directly to text tags, all others are # handled specially. There is an application callback, HMset_font # to allow the application to do font error handling proc HMcurrent_tags {win} { upvar #0 HM$win var set font font foreach i {family size weight style} { set $i [lindex $var($i) end] append font :[set $i] } set xfont [HMx_font $family $size $weight $style $var(S_adjust_size)] HMset_font $win $font $xfont set indent [llength $var(indent)] incr indent -1 lappend tags $font indent$indent foreach tag [array names var T*] { lappend tags [lindex $var($tag) end] ;# test } set var(font) $font set var(xfont) [$win tag cget $font -font] set var(level) $indent return $tags } # allow the application to do do better font management # by overriding this procedure proc HMset_font {win tag font} { catch {$win tag configure $tag -font $font} msg } # generate an X font name proc HMx_font {family size weight style {adjust_size 0}} { catch {incr size $adjust_size} return "-*-$family-$weight-$style-normal-*-*-${size}0-*-*-*-*-*-*" } # Optimize HMrender (hee hee) # This is experimental proc HMoptimize {} { regsub -all "\n\[ \]*(#\[^\n]*)?" [info body HMrender] "\n" body regsub -all ";\[ \]*(#\[^\n]*)?" $body ";" body regsub -all "\n\n+" $body \n body proc HMrender {win tag not param text} $body } ############################################ # Turn HTML into TCL commands # html A string containing an html document # cmd A command to run for each html tag found # start The name of the dummy html start/stop tags proc HMparse_html {html {cmd HMtest_parse} {start hmstart}} { regsub -all \{ $html {\&ob;} html regsub -all \} $html {\&cb;} html set w " \t\r\n" ;# white space proc HMcl x {return "\[$x\]"} set exp <(/?)([HMcl ^$w>]+)[HMcl $w]*([HMcl ^>]*)> set sub "\}\n$cmd {\\2} {\\1} {\\3} \{" regsub -all $exp $html $sub html eval "$cmd {$start} {} {} \{ $html \}" eval "$cmd {$start} / {} {}" } proc HMtest_parse {command tag slash text_after_tag} { puts "==> $command $tag $slash $text_after_tag" } # Convert multiple white space into a single space proc HMzap_white {data} { regsub -all "\[ \t\r\n\]+" $data " " data return $data } # find HTML escape characters of the form &xxx; proc HMmap_esc {text} { if {![regexp & $text]} {return $text} regsub -all {([][$\\])} $text {\\\1} new regsub -all {&#([0-9][0-9]?[0-9]?);?} \ $new {[format %c [scan \1 %d tmp;set tmp]]} new regsub -all {&([a-zA-Z]+);?} $new {[HMdo_map \1]} new return [subst $new] } # convert an HTML escape sequence into character proc HMdo_map {text {unknown ?}} { global HMesc_map set result $unknown catch {set result $HMesc_map($text)} return $result } # table of escape characters (ISO latin-1 esc's are in a different table) array set HMesc_map { lt < gt > amp & quot \" copy \xa9 reg \xae ob \x7b cb \x7d nbsp \xa0 } ############################################################# # ISO Latin-1 escape codes array set HMesc_map { nbsp \xa0 iexcl \xa1 cent \xa2 pound \xa3 curren \xa4 yen \xa5 brvbar \xa6 sect \xa7 uml \xa8 copy \xa9 ordf \xaa laquo \xab not \xac shy \xad reg \xae hibar \xaf deg \xb0 plusmn \xb1 sup2 \xb2 sup3 \xb3 acute \xb4 micro \xb5 para \xb6 middot \xb7 cedil \xb8 sup1 \xb9 ordm \xba raquo \xbb frac14 \xbc frac12 \xbd frac34 \xbe iquest \xbf Agrave \xc0 Aacute \xc1 Acirc \xc2 Atilde \xc3 Auml \xc4 Aring \xc5 AElig \xc6 Ccedil \xc7 Egrave \xc8 Eacute \xc9 Ecirc \xca Euml \xcb Igrave \xcc Iacute \xcd Icirc \xce Iuml \xcf ETH \xd0 Ntilde \xd1 Ograve \xd2 Oacute \xd3 Ocirc \xd4 Otilde \xd5 Ouml \xd6 times \xd7 Oslash \xd8 Ugrave \xd9 Uacute \xda Ucirc \xdb Uuml \xdc Yacute \xdd THORN \xde szlig \xdf agrave \xe0 aacute \xe1 acirc \xe2 atilde \xe3 auml \xe4 aring \xe5 aelig \xe6 ccedil \xe7 egrave \xe8 eacute \xe9 ecirc \xea euml \xeb igrave \xec iacute \xed icirc \xee iuml \xef eth \xf0 ntilde \xf1 ograve \xf2 oacute \xf3 ocirc \xf4 otilde \xf5 ouml \xf6 divide \xf7 oslash \xf8 ugrave \xf9 uacute \xfa ucirc \xfb uuml \xfc yacute \xfd thorn \xfe yuml \xff } ########################################################## # html forms management commands # As each form element is located, it is created and rendered. Additional # state is stored in a form specific global variable to be processed at # the end of the form, including the "reset" and "submit" options. # Remember, there can be multiple forms existing on multiple pages. When # HTML tables are added, a single form could be spread out over multiple # text widgets, which makes it impractical to hang the form state off the # HM$win structure. We don't need to check for the existance of required # parameters, we just "fail" and get caught in HMrender # This causes line breaks to be preserved in the inital values # of text areas array set HMtag_map { textarea {fill 0} } ########################################################## # html isindex tag. Although not strictly forms, they're close enough # to be in this file # is-index forms # make a frame with a label, entry, and submit button proc HMtag_isindex {win param text} { upvar #0 HM$win var set item $win.$var(tags) if {[winfo exists $item]} { destroy $item } frame $item -relief ridge -bd 3 set prompt "Enter search keywords here" HMextract_param $param prompt label $item.label -text [HMmap_esc $prompt] -font $var(xfont) entry $item.entry bind $item.entry "$item.submit invoke" button $item.submit -text search -font $var(xfont) -command \ [format {HMsubmit_index %s {%s} [HMmap_reply [%s get]]} \ $win $param $item.entry] pack $item.label -side top pack $item.entry $item.submit -side left # insert window into text widget $win insert $var(S_insert) \n isindex HMwin_install $win $item $win insert $var(S_insert) \n isindex bind $item {focus %W.entry} } # This is called when the isindex form is submitted. # The default version calls HMlink_callback. Isindex tags should either # be deprecated, or fully supported (e.g. they need an href parameter) proc HMsubmit_index {win param text} { HMlink_callback $win ?$text } # initialize form state. All of the state for this form is kept # in a global array whose name is stored in the form_id field of # the main window array. # Parameters: ACTION, METHOD, ENCTYPE proc HMtag_form {win param text} { upvar #0 HM$win var # create a global array for the form set id HM$win.form$var(tags) upvar #0 $id form # missing /form tag, simulate it if {[info exists var(form_id)]} { puts "Missing end-form tag !!!! $var(form_id)" HMtag_/form $win {} {} } catch {unset form} set var(form_id) $id set form(param) $param ;# form initial parameter list set form(reset) "" ;# command to reset the form set form(reset_button) "" ;# list of all reset buttons set form(submit) "" ;# command to submit the form set form(submit_button) "" ;# list of all submit buttons } # Where we're done try to get all of the state into the widgets so # we can free up the form structure here. Unfortunately, we can't! proc HMtag_/form {win param text} { upvar #0 HM$win var upvar #0 $var(form_id) form # make submit button entries for all radio buttons foreach name [array names form radio_*] { regsub radio_ $name {} name lappend form(submit) [list $name \$form(radio_$name)] } # process the reset button(s) foreach item $form(reset_button) { $item configure -command $form(reset) } # no submit button - add one if {$form(submit_button) == ""} { HMinput_submit $win {} } # process the "submit" command(s) # each submit button could have its own name,value pair foreach item $form(submit_button) { set submit $form(submit) catch {lappend submit $form(submit_$item)} $item configure -command \ [list HMsubmit_button $win $var(form_id) $form(param) \ $submit] } # unset all unused fields here unset form(reset) form(submit) form(reset_button) form(submit_button) unset var(form_id) } ################################################################### # handle form input items # each item type is handled in a separate procedure # Each "type" procedure needs to: # - create the window # - initialize it # - add the "submit" and "reset" commands onto the proper Q's # "submit" is subst'd # "reset" is eval'd proc HMtag_input {win param text} { upvar #0 HM$win var set type text ;# the default HMextract_param $param type set type [string tolower $type] if {[catch {HMinput_$type $win $param} err]} { puts stderr $err } } # input type=text # parameters NAME (reqd), MAXLENGTH, SIZE, VALUE proc HMinput_text {win param {show {}}} { upvar #0 HM$win var upvar #0 $var(form_id) form # make the entry HMextract_param $param name ;# required set item $win.input_text,$var(tags) set size 20; HMextract_param $param size set maxlength 0; HMextract_param $param maxlength entry $item -width $size -show $show # set the initial value set value ""; HMextract_param $param value $item insert 0 $value # insert the entry HMwin_install $win $item # set the "reset" and "submit" commands append form(reset) ";$item delete 0 end;$item insert 0 [list $value]" lappend form(submit) [list $name "\[$item get]"] # handle the maximum length (broken - no way to cleanup bindtags state) if {$maxlength} { bindtags $item "[bindtags $item] max$maxlength" bind max$maxlength "%W delete $maxlength end" } } # password fields - same as text, only don't show data # parameters NAME (reqd), MAXLENGTH, SIZE, VALUE proc HMinput_password {win param} { HMinput_text $win $param * } # checkbuttons are missing a "get" option, so we must use a global # variable to store the value. # Parameters NAME, VALUE, (reqd), CHECKED proc HMinput_checkbox {win param} { upvar #0 HM$win var upvar #0 $var(form_id) form HMextract_param $param name HMextract_param $param value # Set the global variable, don't use the "form" alias as it is not # defined in the global scope of the button set variable $var(form_id)(check_$var(tags)) set item $win.input_checkbutton,$var(tags) checkbutton $item -variable $variable -off {} -on $value -text " " if {[HMextract_param $param checked]} { $item select append form(reset) ";$item select" } else { append form(reset) ";$item deselect" } HMwin_install $win $item lappend form(submit) [list $name \$form(check_$var(tags))] } # radio buttons. These are like check buttons, but only one can be selected proc HMinput_radio {win param} { upvar #0 HM$win var upvar #0 $var(form_id) form HMextract_param $param name HMextract_param $param value set first [expr ![info exists form(radio_$name)]] set variable $var(form_id)(radio_$name) set variable $var(form_id)(radio_$name) set item $win.input_radiobutton,$var(tags) radiobutton $item -variable $variable -value $value -text " " HMwin_install $win $item if {$first || [HMextract_param $param checked]} { $item select append form(reset) ";$item select" } else { append form(reset) ";$item deselect" } # do the "submit" actions in /form so we only end up with 1 per button grouping # contributing to the submission } # hidden fields, just append to the "submit" data # params: NAME, VALUE (reqd) proc HMinput_hidden {win param} { upvar #0 HM$win var upvar #0 $var(form_id) form HMextract_param $param name HMextract_param $param value lappend form(submit) [list $name $value] } # handle input images. The spec isn't very clear on these, so I'm not # sure its quite right # Use std image tag, only set up our own callbacks # (e.g. make sure ismap isn't set) # params: NAME, SRC (reqd) ALIGN proc HMinput_image {win param} { upvar #0 HM$win var upvar #0 $var(form_id) form HMextract_param $param name set name ;# barf if no name is specified set item [HMtag_img $win $param {}] $item configure -relief raised -bd 2 -bg blue # make a dummy "submit" button, and invoke it to send the form. # We have to get the %x,%y in the value somehow, so calculate it during # binding, and save it in the form array for later processing set submit $win.dummy_submit,$var(tags) if {[winfo exists $submit]} { destroy $submit } button $submit -takefocus 0;# this never gets mapped! lappend form(submit_button) $submit set form(submit_$submit) [list $name $name.\$form(X).\$form(Y)] $item configure -takefocus 1 bind $item "catch \{$win see $item\}" bind $item <1> "$item configure -relief sunken" bind $item " set $var(form_id)(X) 0 set $var(form_id)(Y) 0 $submit invoke " bind $item " set $var(form_id)(X) %x set $var(form_id)(Y) %y $item configure -relief raised $submit invoke " } # Set up the reset button. Wait for the /form to attach # the -command option. There could be more that 1 reset button # params VALUE proc HMinput_reset {win param} { upvar #0 HM$win var upvar #0 $var(form_id) form set value reset HMextract_param $param value set item $win.input_reset,$var(tags) button $item -text [HMmap_esc $value] HMwin_install $win $item lappend form(reset_button) $item } # Set up the submit button. Wait for the /form to attach # the -command option. There could be more that 1 submit button # params: NAME, VALUE proc HMinput_submit {win param} { upvar #0 HM$win var upvar #0 $var(form_id) form HMextract_param $param name set value submit HMextract_param $param value set item $win.input_submit,$var(tags) button $item -text [HMmap_esc $value] -fg blue HMwin_install $win $item lappend form(submit_button) $item # need to tie the "name=value" to this button # save the pair and do it when we finish the submit button catch {set form(submit_$item) [list $name $value]} } ######################################################################### # selection items # They all go into a list box. We don't what to do with the listbox until # we know how many items end up in it. Gather up the data for the "options" # and finish up in the /select tag # params: NAME (reqd), MULTIPLE, SIZE proc HMtag_select {win param text} { upvar #0 HM$win var upvar #0 $var(form_id) form HMextract_param $param name set size 5; HMextract_param $param size set form(select_size) $size set form(select_name) $name set form(select_values) "" ;# list of values to submit if {[HMextract_param $param multiple]} { set mode multiple } else { set mode single } set item $win.select,$var(tags) frame $item set form(select_frame) $item listbox $item.list -selectmode $mode -width 0 -exportselection 0 HMwin_install $win $item } # select options # The values returned in the query may be different from those # displayed in the listbox, so we need to keep a separate list of # query values. # form(select_default) - contains the default query value # form(select_frame) - name of the listbox's containing frame # form(select_values) - list of query values # params: VALUE, SELECTED proc HMtag_option {win param text} { upvar #0 HM$win var upvar #0 $var(form_id) form upvar $text data set frame $form(select_frame) # set default option (or options) if {[HMextract_param $param selected]} { lappend form(select_default) [$form(select_frame).list size] } set value [string trimright $data " \n"] $frame.list insert end $value HMextract_param $param value lappend form(select_values) $value set data "" } # do most of the work here! # if SIZE>1, make the listbox. Otherwise make a "drop-down" # listbox with a label in it # If the # of items > size, add a scroll bar # This should probably be broken up into callbacks to make it # easier to override the "look". proc HMtag_/select {win param text} { upvar #0 HM$win var upvar #0 $var(form_id) form set frame $form(select_frame) set size $form(select_size) set items [$frame.list size] # set the defaults and reset button append form(reset) ";$frame.list selection clear 0 $items" if {[info exists form(select_default)]} { foreach i $form(select_default) { $frame.list selection set $i append form(reset) ";$frame.list selection set $i" } } else { $frame.list selection set 0 append form(reset) ";$frame.list selection set 0" } # set up the submit button. This is the general case. For single # selections we could be smarter for {set i 0} {$i < $size} {incr i} { set value [format {[expr {[%s selection includes %s] ? {%s} : {}}]} \ $frame.list $i [lindex $form(select_values) $i]] lappend form(submit) [list $form(select_name) $value] } # show the listbox - no scroll bar if {$size > 1 && $items <= $size} { $frame.list configure -height $items pack $frame.list # Listbox with scrollbar } elseif {$size > 1} { scrollbar $frame.scroll -command "$frame.list yview" \ -orient v -takefocus 0 $frame.list configure -height $size \ -yscrollcommand "$frame.scroll set" pack $frame.list $frame.scroll -side right -fill y # This is a joke! } else { scrollbar $frame.scroll -command "$frame.list yview" \ -orient h -takefocus 0 $frame.list configure -height 1 \ -yscrollcommand "$frame.scroll set" pack $frame.list $frame.scroll -side top -fill x } # cleanup foreach i [array names form select_*] { unset form($i) } } # do a text area (multi-line text) # params: COLS, NAME, ROWS (all reqd, but default rows and cols anyway) proc HMtag_textarea {win param text} { upvar #0 HM$win var upvar #0 $var(form_id) form upvar $text data set rows 5; HMextract_param $param rows set cols 30; HMextract_param $param cols HMextract_param $param name set item $win.textarea,$var(tags) frame $item text $item.text -width $cols -height $rows -wrap none \ -yscrollcommand "$item.scroll set" -padx 3 -pady 3 scrollbar $item.scroll -command "$item.text yview" -orient v $item.text insert 1.0 $data HMwin_install $win $item pack $item.text $item.scroll -side right -fill y lappend form(submit) [list $name "\[$item.text get 0.0 end]"] append form(reset) ";$item.text delete 1.0 end; \ $item.text insert 1.0 [list $data]" set data "" } # procedure to install windows into the text widget # - win: name of the text widget # - item: name of widget to install proc HMwin_install {win item} { upvar #0 HM$win var $win window create $var(S_insert) -window $item -align bottom $win tag add indent$var(level) $item set focus [expr {[winfo class $item] != "Frame"}] $item configure -takefocus $focus bind $item "$win see $item" } ##################################################################### # Assemble and submit the query # each list element in "stuff" is a name/value pair # - The names are the NAME parameters of the various fields # - The values get run through "subst" to extract the values # - We do the user callback with the list of name value pairs proc HMsubmit_button {win form_id param stuff} { upvar #0 HM$win var upvar #0 $form_id form set query "" foreach pair $stuff { set value [subst [lindex $pair 1]] if {$value != ""} { set item [lindex $pair 0] lappend query $item $value } } # this is the user callback. HMsubmit_form $win $param $query } # sample user callback for form submission # should be replaced by the application # Sample version generates a string suitable for http proc HMsubmit_form {win param query} { set result "" set sep "" foreach i $query { append result $sep [HMmap_reply $i] if {$sep != "="} {set sep =} {set sep &} } puts $result } # do x-www-urlencoded character mapping # The spec says: "non-alphanumeric characters are replaced by '%HH'" set HMalphanumeric a-zA-Z0-9 ;# definition of alphanumeric character class for {set i 1} {$i <= 256} {incr i} { set c [format %c $i] if {![string match \[$HMalphanumeric\] $c]} { set HMform_map($c) %[format %.2x $i] } } # These are handled specially array set HMform_map { " " + \n %0d%0a } # 1 leave alphanumerics characters alone # 2 Convert every other character to an array lookup # 3 Escape constructs that are "special" to the tcl parser # 4 "subst" the result, doing all the array substitutions proc HMmap_reply {string} { global HMform_map HMalphanumeric regsub -all \[^$HMalphanumeric\] $string {$HMform_map(&)} string regsub -all \n $string {\\n} string regsub -all \t $string {\\t} string regsub -all {[][{})\\]\)} $string {\\&} string return [subst $string] } # convert a x-www-urlencoded string int a a list of name/value pairs # 1 convert a=b&c=d... to {a} {b} {c} {d}... # 2, convert + to " " # 3, convert %xx to char equiv proc HMcgiDecode {data} { set data [split $data "&="] foreach i $data { lappend result [cgiMap $i] } return $result } proc HMcgiMap {data} { regsub -all {\+} $data " " data if {[regexp % $data]} { regsub -all {([][$\\])} $data {\\\1} data regsub -all {%([0-9a-fA-F][0-9a-fA-F])} $data {[format %c 0x\1]} data return [subst $data] } else { return $data } } staden-2.0.0b11-2016-src/tk_utils/images.tcl0000644000031500020650000000165012707372072016771 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1998. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # proc init_images {} { image create bitmap ::Images::tick -data \ {#define tick_width 14 #define tick_height 14 static char tick_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x38, 0x00, 0x1c, 0x00, 0x0e, 0x00, 0x07, 0x80, 0x03, 0xc2, 0x01, 0xe7, 0x00, 0x7f, 0x00, 0x3e, 0x00, 0x1c, 0x00, 0x08, 0x00};} image create bitmap ::Images::cross -data \ {#define blank_width 14 #define blank_height 14 static char blank_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; } } staden-2.0.0b11-2016-src/tk_utils/init.tcl0000644000031500020650000003060112707372072016465 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # lappend auto_path $env(STADLIB) if {[info command button] != ""} { catch {::tk::Darken} # FIXME! # On Aqua-Tk the minimum valid size for button's -padx is # 11. Trying lower than that yields clipped text. if {$tcl_platform(os) == "Darwin"} { rename button _button proc button {args} { set ind [lsearch $args "-padx"] if {$ind != -1} { incr ind set padx [lindex $args $ind] if {$padx < 11} {set padx 11} } else { set padx 11 } return [uplevel _button $args -padx $padx] } } #----------------------------------------------------------------------------- # Virtual bindings #----------------------------------------------------------------------------- if {$tcl_platform(os) == "Darwin"} { # Selecting items event add <> <1> event add <> event add <> <1> event add <> <2> <3> event add <> event add <> event add <> event add <> event add <> event add <> event add <> # Moving items event add <> <2> event add <> event add <> event add <> event add <> event add <> # Zooming event add <> event add <> event add <> # Popup menus event add <> <3> event add <> # Editor bits event add <> event add <> s event add <> event add <> event add <> # Cut and Pasting event add <> event add <> event add <> } #----------------------------------------------------------------------------- # Font specifications #----------------------------------------------------------------------------- global tk_utils_defs eval font create trace_font [keylget tk_utils_defs FONT.TRACE] eval font create trace_conf_font [keylget tk_utils_defs FONT.TRACE_CONF] eval font create title_font [keylget tk_utils_defs FONT.TITLE] eval font create text_font [keylget tk_utils_defs FONT.TEXT] eval font create sheet_font [keylget tk_utils_defs FONT.SHEET] eval font create sheet_bold_font [keylget tk_utils_defs FONT.SHEET] -weight bold eval font create menu_title_font [keylget tk_utils_defs FONT.MENU_TITLE] eval font create menu_font [keylget tk_utils_defs FONT.MENU] eval font create listbox_font [keylget tk_utils_defs FONT.LISTBOX] eval font create button_font [keylget tk_utils_defs FONT.BUTTON] eval font create enzyme_font [keylget tk_utils_defs FONT.ENZYME] # Sometimes asking for a bold font will give us a different shaped font as # the exact match wasn't available. Double check this and revert to normal # if necessary. if {[lindex [regexp -inline -- {-fixed (\d)} [font metrics sheet_font]] 1] == 0} { puts stderr "sheet_font is proportional - picking a new font" font delete sheet_font if {[lsearch [font names] TkFixedFont] != -1} { eval font create sheet_font [font actual TkFixedFont] } else { font create sheet_font -family Courier -size 10 -weight normal -slant roman -underline 0 -overstrike 0 } font delete sheet_bold_font eval font create sheet_bold_font [font actual sheet_font] -weight bold } if {[font metrics sheet_font] != [font metrics sheet_bold_font] || \ [font measure sheet_font lllM] != [font measure sheet_bold_font lllM]} { puts stderr "Warning: Normal and bold sheet fonts differ in size." font delete sheet_bold_font eval font create sheet_bold_font [keylget tk_utils_defs FONT.SHEET] } option add *Menu.font menu_font option add *Text.font text_font option add *Entry.font text_font option add *Button.font button_font option add *Menubutton.font button_font option add *Checkbutton.font button_font option add *Radiobutton.font button_font option add *Label.font button_font option add *labelFont button_font option add *Listbox.font listbox_font option add *trace*colour1 [keylget tk_utils_defs TRACE.COLOUR_A] option add *trace*colour2 [keylget tk_utils_defs TRACE.COLOUR_C] option add *trace*colour3 [keylget tk_utils_defs TRACE.COLOUR_G] option add *trace*colour4 [keylget tk_utils_defs TRACE.COLOUR_T] option add *trace*cursorColour [keylget tk_utils_defs TRACE.COLOUR_CURSOR] option add *trace*qualColour [keylget tk_utils_defs TRACE.COLOUR_QUALITY] option add *trace*vectorColour [keylget tk_utils_defs TRACE.COLOUR_VECTOR] option add *trace*vectorColour [keylget tk_utils_defs TRACE.COLOUR_VECTOR] option add *trace*lineWidth [keylget tk_utils_defs TRACE.LINE_WIDTH] foreach binding [bind Text] { bind TextRO $binding [bind Text $binding] } bind TextRO {} bind TextRO {} bind TextRO {} bind TextRO {} bind TextRO {} bind TextRO <> {} bind TextRO <> {} bind TextRO <> {} bind TextRO {} bind TextRO {} bind TextRO {} bind TextRO {} bind TextRO {} bind TextRO {} bind TextRO {} bind TextRO {} bind TextRO {} bind TextRO {} } proc fix_raise {} { bind Toplevel {set visibilityState(%W) %s} , bind Toplevel {catch {unset visibilityState(%W)}} rename raise raise_orig proc raise {toplevel {aboveThis ""}} { if {![info exists ::visibilityState($toplevel)] || ![string equal $::visibilityState($toplevel) "VisibilityUnobscured"]} { eval raise_orig $toplevel $aboveThis } } } proc tk_utils_init {} { global tk_utils_defs tcl_platform global tcl_pkgPath global env # Add STADLIB to package path lappend tcl_pkgPath $env(STADLIB) # Abort now if we're being used in a non-graphical environment. if {![namespace exists ::tk]} { return } global ::tk::MotifFilebrowser set ::tk::MotifFilebrowser 1 entry .e set bgg [.e cget -background] set fgg [.e cget -foreground] button .tmp set bg [.tmp cget -background] set fg [.tmp cget -foreground] if {$tcl_platform(platform) == "unix"} { #set bg [keylget tk_utils_defs BACKGROUND] #if {$bg == ""} {set bg "#d9d9d9"} option add *background $bg userDefault #button .tmp #option add *disabledForeground [.tmp cget -disabledforeground] widgetDefault #set bg [.tmp cget -background] #set fg [.tmp cget -foreground] option add *background $bg userDefault option add *highlightBackground $bg userDefault option add *tabBackground $bg userDefault option add *foreground $fg userDefault option add *tabForeground $fg userDefault option add *selectBackground lightblue userDefault option add *selectBorderWidth 0 userDefault set bgl [tk::Darken $bg 115] option add *backdrop $bg userDefault option add *Entry.background $bgl userDefault option add *Text.background $bgl userDefault option add *Listbox.background $bgl userDefault option add *Spinbox.background $bgl userDefault # option add *Xentry.background $bgl userDefault option add *TixHList.background $bgl userDefault option add *Tablelist.background $bgl userDefault #option add *Comborange*entry.disabledForeground $fg userDefault #option add *Comborange*entry.disabledBackground $bgl userDefault option add *textBackground $bgl widgetDefault destroy .tmp if {[keylget tk_utils_defs FOREGROUND] != {} || \ [keylget tk_utils_defs BACKGROUND] != {}} { RecolourWidgets [keylget tk_utils_defs FOREGROUND] \ [keylget tk_utils_defs BACKGROUND] } #Fix raise for fvwm. #fix_raise } else { # Fix bug in Windows event propagation mechanisms # MJ: See CHANGES\TK803\CHANGE1.TXT - Fix no longer required here. # global env # source $env(STADENROOT)/lib/tk_utils/winfix.tcl option add *Tablelist.background SystemWindow userDefault } option add *Combobox*entry.disabledForeground $fgg userDefault option add *Combobox*entry.disabledBackground $bgg userDefault option add *Tabnotebook.background $bg userDefault option add *Tabnotebook.backdrop $bg userDefault option add *Tabnotebook.tabBackground $bg userDefault catch { if {[wm protocol . WM_DELETE_WINDOW] == ""} { wm protocol . WM_DELETE_WINDOW exit } } destroy .e destroy .tmp } #----------------------------------------------------------------------------- # Map new 8.5 widgets to 8.4 coded alternatives if not available #----------------------------------------------------------------------------- if {[info command ttk::notebook] == {}} { # Emulate ttk::notebook via Jeffrey Hobbs' widget package namespace eval ttk { proc notebook {args} { set nb [eval tabnotebook $args -linewidth 1] if {[info command ::_$nb] != {}} { rename ::_$nb {} } rename ::$nb ::_$nb global ::$nb set ::${nb}(count) 0 proc ::$nb {cmd args} { set nb [lindex [info level [info level]] 0] upvar \#0 ::$nb data switch $cmd { "add" { foreach {k v} [lrange $args 1 end] { set a($k) $v } set data(map_$data(count)) $a(-text) incr data(count) return [eval [list _$nb add $a(-text) \ -window [lindex $args 0]]] } "select" { if {[llength $args] == 0} { return [eval [list _$nb select]] } else { return [eval [list _$nb activate \ $data(map_[lindex $args 0])]] } } default { return [eval [list _$nb $cmd $args]] } } } return $nb } } } staden-2.0.0b11-2016-src/tk_utils/licence.tcl0000644000031500020650000001460512707372072017132 0ustar jkbteam117proc ShowLicence {} { global licence licence licence # Create the window set w .licence modal $w wm title $w "Licence" pack [frame $w.l -bd 2 -relief sunken] -side top -fill both set width 90 # Show the Licence Type label $w.l.type_l -text "Licence Type" switch $licence(type) { f {set type full} v {set type viewer} default {set type demo} } entry $w.l.type_v -width $width $w.l.type_v insert 0 $type $w.l.type_v configure -state disabled grid $w.l.type_l $w.l.type_v # Show the Licence OS label $w.l.os_l -text "Licence Type" switch $licence(os) { u {set os Unix} w {set os {MS Windows}} m {set os {MacOS X}} default {set os Unknown} } entry $w.l.os_v -width $width $w.l.os_v insert 0 $os $w.l.os_v configure -state disabled grid $w.l.os_l $w.l.os_v # Show the expiry date if {$licence(expire) == 0} { set expire "never" } else { set expire [clock format $licence(expire)] } label $w.l.expire_l -text "Expiry date" entry $w.l.expire_v -width $width $w.l.expire_v insert 0 $expire $w.l.expire_v configure -state disabled grid $w.l.expire_l $w.l.expire_v # Show the number of users if {$licence(users) == 0} { set users "unlimited" } else { set users $licence(users) } label $w.l.users_l -text "No. of users" entry $w.l.users_v -width $width $w.l.users_v insert 0 $users $w.l.users_v configure -state disabled grid $w.l.users_l $w.l.users_v # Show the Host ID label $w.l.hostid_l -text "Host ID" entry $w.l.hostid_v -width $width $w.l.hostid_v insert 0 $licence(hostid) grid $w.l.hostid_l $w.l.hostid_v -pady 5 # Info. on how to obtain a valid licence if {$licence(type) == "d" || $expire != "never"} { label $w.message1 \ -text "To obtain a full permanent licence please contact" entry $w.message2 -bd 0 $w.message2 insert 0 "\tstaden-admin@mrc-lmb.cam.ac.uk" label $w.message3 -text "or read" entry $w.message4 -bd 0 $w.message4 insert 0 "\thttp://www.mrc-lmb.cam.ac.uk/pubseq/licence.html" pack $w.message1 -side top -anchor w pack $w.message2 -side top -fill both pack $w.message3 -side top -anchor w pack $w.message4 -side top -fill both if {$licence(type) == "d"} { label $w.message5 -text \ "Alternatively free time-limited full licences are also available." \ -justify left pack $w.message5 -side top -anchor w } } button $w.button -text OK -command "destroy $w" pack $w.button -side bottom -anchor c focus $w.button } # Display licence information for demonstration versions. # # Prog is the program name # # demo_mode is how the program handles demonstration mode. # 0 => does not work at all # 1 => works fully with a limited data set # 2 => limited functionality (any data) # 3 => works fully with a limited data set and read-only with other data proc LicenceSplash {prog demo_mode} { global licence tcl_platform xtoplevel [set w .licence_warning] wm resizable $w 0 0 wm withdraw $w wm protocol $w WM_DELETE_WINDOW exit pack [text $w.t -width 100 -height 18 -wrap word] -fill both -expand 1 $w.t tag configure title -font {Helvetica 10 bold} -justify center $w.t tag configure bold -font {Courier 10 bold} -justify center $w.t tag configure hid -font {Courier 10 bold} -justify center $w.t insert end "$prog Demonstration Version" title $w.t insert end "\n\nThis is a demonstration release of the Staden Package. " if {$demo_mode == 1} { $w.t insert end "$prog will only be able to load and edit the\ supplied demonstration files.\n" } elseif {$demo_mode == 2} { $w.t insert end "$prog will run, but with limited functionality.\n" } elseif {$demo_mode == 3} { $w.t insert end "$prog will only be able to load and edit the\ supplied demonstration files. \ Other data may be loaded in a read-only mode.\n" } else { $w.t insert end "$prog is not available in demonstration mode.\n" } if {$tcl_platform(platform) == "unix"} { $w.t insert end "\nTo obtain a free time-limited licence enabling\ full use of the package, or to obtain (free to academics) an\ unlimited licence, please connect to the following URL:" } else { $w.t insert end "\nTo obtain a free time-limited licence enabling\ full use of the package, or to purchase an unlimited licence,\ please connect to the following URL:" } $w.t insert end "\n\nhttp://www.mrc-lmb.cam.ac.uk/pubseq/licence.html" bold $w.t insert end "\n\nTo obtain a licence you will need to know your\ Host ID. This is:\n\n" if {[llength [split $licence(hostid) /]] > 5} { regsub {(/[^/]*/[^/]*/[^/]*)} $licence(hostid) "\\1\n" h } else { set h $licence(hostid) } $w.t insert end $h hid frame $w.f pack $w.f -side bottom -fill both if {$tcl_platform(platform) == "unix"} { button $w.f.c -text "Copy HostID to cut-buffer" \ -command "LicenceSelectionOwn $w PRIMARY" } else { button $w.f.c -text "Copy HostID to clipboard" \ -command "LicenceSelectionOwn $w CLIPBOARD" } pack $w.f.c -side right -fill both -expand 1 button $w.f.b -text "OK" -command "destroy $w; set .licence_acknowledged 1" pack $w.f.b -side left -fill both -expand 1 focus $w.f.b update idletasks set x [expr {[winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \ - [winfo vrootx [winfo parent $w]]}] set y [expr {[winfo screenheight $w]/2 - [winfo reqheight $w]/2 \ - [winfo vrooty [winfo parent $w]]}] wm geom $w +$x+$y wm deiconify $w global .licence_acknowledged vwait .licence_acknowledged unset .licence_acknowledged if {$demo_mode == 0} { exit } } proc LicenceSelectionOwn {w where} { # Grab selection selection own -selection $where -command "LicenceSelectionCancel $w" . if {[selection own -selection $where] == "."} { $w.t tag configure hid -background #d0d0ff } if {$where == "CLIPBOARD"} { global licence clipboard clear clipboard append $licence(hostid) } else { selection handle \ -selection $where \ . LicenceSelectionHandler bind $w "selection handle -selection $where . {}" } } proc LicenceSelectionCancel {w} { $w.t tag configure hid -background [$w.t cget -background] } proc LicenceSelectionHandler {args} { global licence return $licence(hostid) } #tkinit #wm withdraw . #ShowLicence staden-2.0.0b11-2016-src/tk_utils/list_or_file.tcl0000644000031500020650000002617512707372072020207 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # #----------------------------------------------------------------------------- # Input/Output File only dialogue #----------------------------------------------------------------------------- proc getFname {t title type {command {}} args} { frame $t if {"$type" == "load"} { set ty "CheckInput" button $t.browse -text "Browse" \ -command "InvokeFileBrowser $t.entry open; focus \[entrybox_path $t.entry\]" } elseif {"$type" == "load_optional"} { set ty "CheckInputOptional" button $t.browse -text "Browse" \ -command "InvokeFileBrowser $t.entry open" } elseif {"$type" == "load_optional_default"} { set ty "CheckInputOptionalDefault $args" button $t.browse -text "Browse" \ -command "InvokeFileBrowser $t.entry open" } elseif {"$type" == "save_optional"} { set ty "CheckOutputOptional" button $t.browse -text "Browse" \ -command "InvokeFileBrowser $t.entry save" } else { set ty "CheckOutput" button $t.browse -text "Browse" \ -command "InvokeFileBrowser $t.entry save" } entrybox $t.entry \ -title $title \ -width 15 \ -type $ty \ -default $args raise $t.browse pack $t.entry -side left -expand 1 -fill x pack $t.browse -side right return $t.entry } # # Returns the entrybox list component # proc getFname_in_name {f} { return [expandpath [entrybox_get $f.entry]] } # # Returns the temp. list name for a given file name # proc FileListName {file} { return "#$file" } # # Configures a getFname box # proc getFname_configure {path args} { eval entrybox_configure $path.entry $args eval $path.browse configure $args } #----------------------------------------------------------------------------- # Input/Output List only dialogue #----------------------------------------------------------------------------- proc getLname {t title type} { frame $t entrybox $t.entry \ -title $title \ -width 15 button $t.browse -text "Browse" -command "ListBrowse $t $t.entry $type" pack $t.entry -side left -expand 1 -fill x pack $t.browse -side right return $t.entry } # # Returns the entrybox list component # proc getLname_in_name {f} { return [entrybox_get $f.entry] } # # Configures a getLname box # proc getLname_configure {path args} { getFname_configure "$args" } #----------------------------------------------------------------------------- # Input only List/File dialogue # # Apologies for the mess! # In the past, the position on the list of radiobuttons was the key to knowing # which button meant what. the rightmost (1) is list, 2nd from right is file, # 3rd from right is 'single file', and anything else disables the browse # button. # # This is inflexible, but the old syntax still holds. Now if we specify a # command for the radiolist buttons, this command may end with "#type" where # "type" is one of "list", "fofn", "selection" or "biolims". (Selection allows # for multiple files to be selected, but works for just a single file too and # so it replaces single mode.) #----------------------------------------------------------------------------- # # The "Input list or file?" dialogues # proc lorf_in {f l cmds args} { eval frame $f $args global $f.Format set val 0 foreach b [keylget l WHICH.BUTTONS] { set cmd [lindex $cmds $val] if {![regexp {.*#([^#]*)} $cmd dummy type]} { set type [lindex {list fofn} $val] } lappend buts "$b -command {lorf_in_set $f [list $type] [list $cmd]; global $f.Format; set $f.Format [list $type]}" incr val } # The name entrybox frame $f.name entrybox $f.name.entry \ -title [keylget l NAME.NAME] \ -default [keylget l NAME.VALUE] \ -width 15 button $f.name.browse \ -text [keylget l NAME.BROWSE] # The format selector radiolist $f.format \ -title [keylget l WHICH.NAME] \ -buttons [set buts] \ -default [keylget l WHICH.VALUE] \ -orient horizontal pack $f.name.browse -side right -fill x pack $f.name.entry -side left -fill x -expand 1 pack $f.format $f.name -side top -fill both -expand 1 raise $f.name return $f } # # configures an list of file box # proc lorf_in_configure {path args} { set in_arg 0 set arglist "" set state "" # Process command line args foreach i $args { if {$in_arg} { if {$option == "-state"} { set state "-state $i" } else { lappend arglist $option $i } set in_arg 0 } else { set option $i set in_arg 1 } } eval radiolist_configure $path.format -state $i eval entrybox_configure $path.name.entry -state $i eval $path.name.browse configure -state $i } # # Called from (or called to) set the radiolist component of the file/list # selection dialogues. If command is set, this will be called. # # 'type' controls the operation of the Browse command. It may be one of: # selection Direct multiple selection of files # fofn A filebrowser to choose a file of filenames # list A list browser to choose a list of filenames # other Disables the entry box. proc lorf_in_set {w type command} { set entry_w $w.name.entry set browse_w $w.name.browse switch $type { "selection" { $browse_w configure \ -state normal \ -command "InvokeFileBrowser $entry_w openmulti" entrybox_configure $entry_w \ -state normal -type "" } "biolims" { $browse_w configure \ -state normal \ -command "InvokeBiolimsBrowser $entry_w openmulti" entrybox_configure $entry_w \ -state normal -type "" } "fofn" { $browse_w configure \ -state normal \ -command "InvokeFileBrowser $entry_w open" entrybox_configure $entry_w -type CheckInput \ -state normal } "list" { $browse_w configure \ -state normal \ -command "ListBrowse $w $entry_w read" entrybox_configure $entry_w -type CheckList \ -state normal } default { $browse_w configure \ -state disabled entrybox_configure $entry_w \ -state disabled } } if {$command != ""} { eval $command } } # # Returns the radio list component # # Too many functions are now using this to make it easy to change. They expect # a numerical number, rather than a proper string type. So we have to convert # to the appropriate value. # proc lorf_in_get {w} { global $w.Format if {[set $w.Format] == "selection" || [set $w.Format] == "biolims"} { if {[string match "#*" [entrybox_get $w.name.entry]]} { return 1; # List type } else { if {[CheckInput $w.name.entry] == 0} { tkwait variable forever } return 3; # Single file } } else { return [radiolist_get $w.format] } } # # Returns the entrybox list component # proc lorf_in_name {f} { return [expandpath [entrybox_get $f.name.entry]] } # # Returns a list for a specific 'lorf' box. Loads the file to a list if # appropriate. # Uses temporary lists named "#name" for files. # proc lorf_get_list {f} { set name [lorf_in_name $f] global $f.Format if {[set form [set $f.Format]] == ""} { set form [lorf_in_get $f] } if {"$name" == ""} { return "" } # Find or generate a list name switch -regexp $form { list|2 { set lname $name } fofn|1 { set lname "#$name" if {![ListWritable "$lname"]} {return ""} if {[ListLoad $name "$lname"] == ""} { ListDelete $lname tk_messageBox \ -icon error \ -title "Empty list" \ -message "'$name' contains zero names. Aborting." \ -type ok \ -parent $f #wait forever... set re_enter 0 tkwait variable re_enter return "" } } selection { set lname $name } biolims { set lname $name } default { return "" } } # Load the list set items "" foreach i [ListToItems "$lname"] { if {"[file dirname $i]" == "[pwd]"} { lappend items [file tail $i] } else { lappend items $i } } if {$items == ""} { tk_messageBox \ -icon error \ -title "Empty list" \ -message "'$name' contains zero names. Aborting." \ -type ok \ -parent $f #wait forever... set re_enter 0 tkwait variable re_enter return "" } # For temporary lists - delete them if {$form != "list"} { ListDelete $lname } return $items } #----------------------------------------------------------------------------- # Output only List/File dialogue #----------------------------------------------------------------------------- # # The "Output list or file?" dialogues # proc lorf_out {f l cmds args} { eval frame $f $args set val 1 foreach b [keylget l WHICH.BUTTONS] { lappend buts \ "$b -command {lorf_out_set $f $val \ {[lindex $cmds [expr $val-1]]}}" incr val } # The name entrybox frame $f.name entrybox $f.name.entry \ -title [keylget l NAME.NAME] \ -default [keylget l NAME.VALUE] \ -width 15 button $f.name.browse \ -text [keylget l NAME.BROWSE] # The format selector radiolist $f.format \ -title [keylget l WHICH.NAME] \ -buttons [set buts] \ -default [keylget l WHICH.VALUE] \ -orient horizontal pack $f.name.browse -side right -fill x pack $f.name.entry -side left -fill x -expand 1 pack $f.format $f.name -side top -fill both -expand 1 raise $f.name return $f } # # Sets the radiolist component (invoking commands as appropriate) # # 1 for list # 2 for file # 3 for something else (disables the entrybox) # proc lorf_out_set {f value ocmd} { if {"$value" == 2} { $f.name.browse configure -state normal \ -command "InvokeFileBrowser $f.name.entry save" entrybox_configure $f.name.entry -state normal -type CheckOutput } elseif {"$value" == 1} { $f.name.browse configure -state normal \ -command "ListBrowse $f $f.name.entry create" entrybox_configure $f.name.entry -state normal \ -type CheckOutList } else { entrybox_configure $f.name.entry -state disabled $f.name.browse configure -state disabled } eval $ocmd } # # Returns the radio list component # proc lorf_out_get {f} { return [radiolist_get $f.format] } # # Returns the entrybox list component # Uses temporary lists named "#name" for files. # Also ensures that the list is clear before writing to it. # proc lorf_out_name {f} { set form [radiolist_get $f.format] set name [entrybox_get $f.name.entry] if {$name == ""} { return "" } if { "$form" == 2} { #file set lname "#$name" } else { set lname "$name" } #if [ListWritable $lname] {return $lname} ListCreate2 $lname "" return $lname #return "" } # # Saves a list to a file. Also removes the temporary list name. # proc lorf_out_save {name} { scan $name #%s f ListSave $f $name ListDelete $name } #----------------------------------------------------------------------------- # Misc utils #----------------------------------------------------------------------------- proc lorf_focus {f} { entrybox_focus $f.name.entry } staden-2.0.0b11-2016-src/tk_utils/menu.tcl0000644000031500020650000003421412707372072016472 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # proc set_menu {name} { global menu_name $name set menu_name $name if ![info exists $name] { global $name set $name "" } } # 'pos' is now ignored. proc add_menu {name onval offval {pos {}} {class {}}} { global menu_name global $menu_name regsub -all { } $name _ n set n [string tolower $n] regsub {.*\.} $name {} name keylset $menu_name $n.M [list $onval $offval $name $class] } proc add_cascade {name onval offval {class {}}} { global menu_name global $menu_name regsub -all { } $name _ n set n [string tolower $n] regsub {.*\.} $name {} name keylset $menu_name $n.m [list $onval $offval $name $class] } proc add_command {name onval offval comm {class {}}} { global menu_name global $menu_name regsub -all { } $name _ n set n [string tolower $n] regsub {.*\.} $name {} name keylset $menu_name $n.C [list $onval $offval $name $comm $class] } proc add_separator {name {class {}}} { global menu_name global $menu_name regsub -all { } $name _ n set n [string tolower $n] keylset $menu_name $n.S [list $class] } proc add_radio {name onval offval variable value comm {class {}}} { global menu_name global $menu_name regsub -all { } $name _ n set n [string tolower $n] regsub {.*\.} $name {} name keylset $menu_name $n.r [list $onval $offval $name $variable $value $comm \ $class] } proc add_check {name onval offval variable comm {class {}}} { global menu_name global $menu_name regsub -all { } $name _ n set n [string tolower $n] regsub {.*\.} $name {} name keylset $menu_name $n.c [list $onval $offval $name $variable $comm $class] } proc add_label {name} { global menu_name global $menu_name regsub -all { } $name _ n set n [string tolower $n] regsub {.*\.} $name {} name keylset $menu_name $n.L [list $name] } proc del_menu_item {name} { global menu_name global $menu_name regsub -all { } $name _ n set n [string tolower $n] regsub {.*\.} $name {} name keyldel $menu_name $n } proc menu_path {name} { regsub -all { } $name _ n set n [string tolower $n] return $n } #proc menu_path {name} { # regsub -all {[ ]} $name _ name # regsub -all {\.} $name ._ name # return $name.m #} # Create a menu from the 'menu' specification. All the menu buttons are created # and packed in 'name'. This is probably the pathname of a frame - eg .menubar. # The mn and level parameters are used internally for recursion and shouldn't # be specified. # Create a menu from the 'menu' specification. All the top level menus are # created as children of 'name'. This menu name needs to be given as the # "-menu" option to a toplevel window. # The mn and level parameters are used internally for recursion and shouldn't # be specified. proc create_menus {menu {mn {}} {class {}} {level {2}}} { global tcl_platform if {$tcl_platform(os) == "Darwin"} { set tearoffs 0 } else { set tearoffs 1 } set menu_state 0 if {$class == ""} { set use_class 0 } else { set use_class 1 } foreach k [keylkeys menu] { switch [lindex [set j [lindex [set i [keylget menu $k]] 0]] 0] { M { set j [lindex $j 1] if {!($use_class && [lindex $j 3] != "" && \ [lsearch -exact [lindex $j 3] $class] == -1)} { $mn add cascade -label [lindex $j 2] -menu $mn.$k menu $mn.$k -title [lindex $j 2] -tearoff $tearoffs set s [create_menus "[lrange $i 1 end]" $mn.$k $class] set s [expr ([lindex $j 0]&1)|$s] $mn entryconfigure [lindex $j 2] \ -state [lindex {disabled normal} $s] global $mn.MS set $mn.MS([lindex $j 2]) $s } } m { set j [lindex $j 1] if {!($use_class && [lindex $j 3] != "" && \ [lsearch -exact [lindex $j 3] $class] == -1)} { set s [expr [lindex $j 0]&1] global $mn.MS set $mn.MS([lindex $j 2]) $s $mn add cascade \ -label [lindex $j 2] \ -menu $mn.$k \ -state [lindex {disabled normal} $s] menu $mn.$k -tearoff $tearoffs create_menus "[lrange $i 1 end]" $mn.$k $class \ [expr $level+1] } } C { set j [lindex $j 1] if {!($use_class && [lindex $j 4] != "" && \ [lsearch -exact [lindex $j 4] $class] == -1)} { regsub -all {"} [lindex $j 3] {\"} com set s [expr [lindex $j 0]&1] global $mn.MS set $mn.MS([lindex $j 2]) $s set c "$mn add command \ -label \"[lindex $j 2]\" \ -command \"eval [list $com]\" \ -state [lindex {disabled normal} $s]" uplevel $level "$c" } } L { set j [lindex $j 1] regsub -all {"} [lindex $j 3] {\"} com set c "$mn add command \ -label \"[lindex $j 0]\" \ -state disabled" uplevel $level "$c" } r { set j [lindex $j 1] if {!($use_class && [lindex $j 6] != "" && \ [lsearch -exact [lindex $j 6] $class] == -1)} { regsub -all {"} [lindex $j 5] {\"} com set s [expr [lindex $j 0]&1] global $mn.MS set $mn.MS([lindex $j 2]) $s set c "$mn add radiobutton \ -label \"[lindex $j 2]\" \ -command \"eval [list $com]\" \ -state [lindex {disabled normal} $s] \ -variable [lindex $j 3] \ -value [lindex $j 4]" uplevel $level "$c" } } c { set j [lindex $j 1] if {!($use_class && [lindex $j 5] != "" && \ [lsearch -exact [lindex $j 5] $class] == -1)} { regsub -all {"} [lindex $j 4] {\"} com set s [expr [lindex $j 0]&1] global $mn.MS set $mn.MS([lindex $j 2]) $s set c "$mn add checkbutton \ -label \"[lindex $j 2]\" \ -command \"eval [list $com]\" \ -state [lindex {disabled normal} $s] \ -variable [lindex $j 3]" uplevel $level "$c" } } S { set j [lindex $j 1] if {!($use_class && [lindex $j 0] != "" && \ [lsearch -exact [lindex $j 0] $class] == -1)} { $mn add separator } } } } return $menu_state } proc merge_menus {menu {mn {}} {class {}} {level {3}}} { global tcl_platform menulist if {$tcl_platform(os) == "Darwin"} { set tearoffs 0 } else { set tearoffs 1 } set menu_state 0 if {$class == ""} { set use_class 0 } else { set use_class 1 } lappend menulist $mn.MS foreach k [keylkeys menu] { switch [lindex [set j [lindex [set i [keylget menu $k]] 0]] 0] { M { set j [lindex $j 1] if {!($use_class && [lindex $j 3] != "" && \ [lsearch -exact [lindex $j 3] $class] == -1)} { if {![winfo exists $mn.$k]} { $mn add cascade -label [lindex $j 2] -menu $mn.$k menu $mn.$k -title [lindex $j 2] -tearoff $tearoffs } set s [merge_menus "[lrange $i 1 end]" $mn.$k $class] set s [expr ([lindex $j 0]&1)|$s] $mn entryconfigure [lindex $j 2] \ -state [lindex {disabled normal} $s] global $mn.MS set $mn.MS([lindex $j 2]) $s } } m { set j [lindex $j 1] if {!($use_class && [lindex $j 3] != "" && \ [lsearch -exact [lindex $j 3] $class] == -1)} { set s [expr [lindex $j 0]&1] global $mn.MS if {![info exists $mn.MS([lindex $j 2])]} { set $mn.MS([lindex $j 2]) $s $mn add cascade \ -label [lindex $j 2] \ -menu $mn.$k \ -state [lindex {disabled normal} $s] menu $mn.$k -tearoff $tearoffs merge_menus "[lrange $i 1 end]" $mn.$k $class \ [expr $level+1] } } } C { set j [lindex $j 1] if {!($use_class && [lindex $j 4] != "" && \ [lsearch -exact [lindex $j 4] $class] == -1)} { regsub -all {"} [lindex $j 3] {\"} com set s [expr [lindex $j 0]&1] global $mn.MS if {![info exists $mn.MS([lindex $j 2])]} { set $mn.MS([lindex $j 2]) $s set c "$mn add command \ -label \"[lindex $j 2]\" \ -command \"eval [list $com]\" \ -state [lindex {disabled normal} $s]" uplevel $level "$c" } } } L { set j [lindex $j 1] regsub -all {"} [lindex $j 3] {\"} com set c "$mn add command \ -label \"[lindex $j 0]\" \ -state disabled" uplevel $level "$c" } r { set j [lindex $j 1] if {!($use_class && [lindex $j 6] != "" && \ [lsearch -exact [lindex $j 6] $class] == -1)} { regsub -all {"} [lindex $j 5] {\"} com set s [expr [lindex $j 0]&1] global $mn.MS if {![info exists $mn.MS([lindex $j 2])]} { set $mn.MS([lindex $j 2]) $s set c "$mn add radiobutton \ -label \"[lindex $j 2]\" \ -command \"eval [list $com]\" \ -state [lindex {disabled normal} $s] \ -variable [lindex $j 3] \ -value [lindex $j 4]" uplevel $level "$c" } } } c { set j [lindex $j 1] if {!($use_class && [lindex $j 5] != "" && \ [lsearch -exact [lindex $j 5] $class] == -1)} { regsub -all {"} [lindex $j 4] {\"} com set s [expr [lindex $j 0]&1] global $mn.MS if {![info exists $mn.MS([lindex $j 2])]} { set $mn.MS([lindex $j 2]) $s set c "$mn add checkbutton \ -label \"[lindex $j 2]\" \ -command \"eval [list $com]\" \ -state [lindex {disabled normal} $s] \ -variable [lindex $j 3]" uplevel $level "$c" } } } S { set j [lindex $j 1] if {!($use_class && [lindex $j 0] != "" && \ [lsearch -exact [lindex $j 0] $class] == -1)} { $mn add separator } } } } return $menu_state } proc menu_state_on {menu b {mn {}}} { global busy_mode set menu_state 0 foreach k [keylkeys menu] { switch -glob [lindex [set j [lindex [set i [keylget menu $k]] 0]] 0] { M { set j [lindex $j 1] set s [menu_state_on "[lrange $i 1 end]" $b $mn.$k] if {[expr (([lindex $j 0]&$b)!=0)|$s]} { catch {$mn entryconfigure [lindex $j 2] -state normal} global $mn.MS set $mn.MS([lindex $j 2]) 1 } } m { set j [lindex $j 1] if {[expr ([lindex $j 0]&$b)!=0]} { set menu_state 1 catch {$mn entryconfigure [lindex $j 2] -state normal} global $mn.MS set $mn.MS([lindex $j 2]) 1 menu_state_on "[lrange $i 1 end]" $b $mn.$k } } {[Ccr]} { set j [lindex $j 1] if {[expr ([lindex $j 0]&$b)!=0]} { set menu_state 1 catch {$mn entryconfigure [lindex $j 2] -state normal} global $mn.MS set $mn.MS([lindex $j 2]) 1 } } } } return $menu_state } proc menu_state_off {menu b {mn {}}} { set menu_state 0 foreach k [keylkeys menu] { switch -glob [lindex [set j [lindex [set i [keylget menu $k]] 0]] 0] { M { set j [lindex $j 1] set s [menu_state_off "[lrange $i 1 end]" $b $mn.$k] if {$s==0 && [expr (([lindex $j 1]&$b)!=0)|$s]} { catch {$mn entryconfigure [lindex $j 2] -state disabled} global $mn.MS set $mn.MS([lindex $j 2]) 0 } } m { set j [lindex $j 1] if {[expr ([lindex $j 1]&$b)!=0]} { catch {$mn entryconfigure [lindex $j 2] -state disabled} global $mn.MS set $mn.MS([lindex $j 2]) 0 menu_state_off "[lrange $i 1 end]" $b $mn.$k } else { set menu_state 1 } } {[Ccr]} { set j [lindex $j 1] if {[expr ([lindex $j 1]&$b)!=0]} { catch {$mn entryconfigure [lindex $j 2] -state disabled} global $mn.MS set $mn.MS([lindex $j 2]) 0 } else { set menu_state 1 } } } } return $menu_state } proc menu_state_save {menu menu_name {state {}}} { global $menu.MS $menu.LIST ${menu_name}_list if {$menu_name != "" && [info exists ${menu_name}_list]} { global ${menu_name}_list set $menu.LIST [set ${menu_name}_list] } if {[info exists $menu.MS]} { lappend state [array get $menu.MS] } foreach w [winfo children $menu] { if {[winfo children $w] != {}} { set state [menu_state_save $w {} $state] } else { global $w.MS if {[info exists $w.MS]} { lappend state [array get $w.MS] } } } return $state } proc menu_state_restore {menu menu_name state {first 1}} { global $menu.MS $menu.LIST ${menu_name}_list if {$menu_name != "" && [info exists ${menu_name}_list]} { global ${menu_name}_list catch {set ${menu_name}_list [set $menu.LIST]} } if {$first == 1 && [info exists $menu.MS]} { array set s [lindex $state 0] foreach i [array names s] { catch {$menu entryconfigure $i \ -state [lindex {disabled normal} $s($i)]} global $menu.MS set $menu.MS($i) $s($i) } set state [lrange $state 1 end] } foreach w [winfo children $menu] { if [info exists s] {unset s} array set s [lindex $state 0] foreach i [array names s] { catch {$w entryconfigure $i \ -state [lindex {disabled normal} $s($i)]} global $w.MS set $w.MS($i) $s($i) } set state [lrange $state 1 end] if {[winfo children $w] != {}} { set state [menu_state_restore $w {} $state 0] } } return $state } # Set the menu enable/disable information to the state specified in 'bit'. # Note that 'menu_name' here is the _name_ of the global menu variable rather # than the contents. This is so that we can store extra information in the # name pertaining to the current state. # # The 'bit' (state) value should be a power of 2 rather than the bit number. # # The 'prefix' parameter is a prefix to add to the pathname (eg it's the frame # pathname that the menus are packed in). proc menu_state_set {menu_name bit {prefix {}}} { global $menu_name global ${menu_name}_list lappend ${menu_name}_list $bit if {$bit > 0} { menu_state_on [set $menu_name] $bit $prefix } else { menu_state_off [set $menu_name] [expr -$bit] $prefix } } # # Sets the menu states to their current settings. # This may sound useless, but it's needed when the menus change so that we # can add any new menu items with the correct menu state. # proc reset_menu_state {menu_name {prefix {}}} { global $menu_name global ${menu_name}_list if {[info exists ${menu_name}_list]} { set tmp_list [set ${menu_name}_list] foreach bit [set ${menu_name}_list] { menu_state_set $menu_name $bit $prefix } set ${menu_name}_list $tmp_list } }staden-2.0.0b11-2016-src/tk_utils/messagebox.tcl0000644000031500020650000000314112707372072017656 0ustar jkbteam117proc messagebox_append { f str } { $f.text config -state normal $f.text insert end $str $f.text config -state disabled } #message box for information proc messagebox {w str} { set f $w.mbox if {[winfo exists $f]} {messagebox_append $f $str; return} toplevel $f wm title $f Information wm transient $f [winfo toplevel [winfo parent $f]] text $f.text -wrap none -xscrollcommand "$f.sb_h set" \ -yscrollcommand "$f.sb_v set" \ -width 60 -height 15 -bd 2 -relief groove scrollbar $f.sb_h -orient horizontal -relief sunken \ -command "$f.text xview" scrollbar $f.sb_v -orient vertical -relief sunken \ -command "$f.text yview" button $f.ok -text OK -command "grab release $f; destroy $f" grid columnconfig $f 0 -weight 1 grid rowconfig $f 0 -weight 1 grid $f.text -row 0 -column 0 -sticky nsew grid $f.sb_v -row 0 -column 1 -sticky ns grid $f.sb_h -row 1 -column 0 -sticky ew grid $f.ok -row 2 -column 0 # 6. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the # display and de-iconify it. wm withdraw $f update idletasks set x [expr [winfo screenwidth $f]/2 - [winfo reqwidth $f]/2 \ - [winfo vrootx [winfo parent $f]]] set y [expr [winfo screenheight $f]/2 - [winfo reqheight $f]/2 \ - [winfo vrooty [winfo parent $f]]] wm geom $f +$x+$y wm deiconify $f # 7. Set a grab and claim the focus too. #grab $f focus $f.ok $f.text insert end $str $f.text config -state disabled } staden-2.0.0b11-2016-src/tk_utils/r_enzyme_box.tcl0000644000031500020650000002273612707372072020234 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # ############################################################################## proc ReadREnzFile { input file list l } { global tk_utils_defs $l.filename set ok_pressed 0 keylset f E_FILE [keylget tk_utils_defs R_ENZ.E_FILE] set filetype [radiolist_get $input] #read standard filenames defined in user-defaults set $l.filename [keylget f E_FILE.$filetype] #empty the list box $list delete 0 end #user has entered own filename if {[set $l.filename] == ""} { entrybox_delete $l.infile.entry 0 end return } #fill in list box with contents of the file set renz_list [read_enz_file -file [set $l.filename]] eval $list insert end $renz_list } ############################################################################## #execute this bit of code if user has entered personal r enzyme file proc ReadUserFileCheck {entry list l} { set e [entrybox_path $entry] if {[$e cget -state] != "normal" || [$e get] == ""} { return 0 } ReadUserFile $entry $list $l [$e get] } proc ReadUserFile {entry list l file_name} { global $l.filename set e [entrybox_path $entry] if {[$e get] == "" || ![file exists [$e get]]} { bell return 0 } set $l.filename $file_name #fill in list box with contents of the file #read_enz_file -file [set $l.filename] -window $list set renz_list [read_enz_file -file [set $l.filename]] if {[string compare $renz_list [$list get 0 end]]} { #empty the list box $list delete 0 end eval $list insert end $renz_list } return 1 } ############################################################################## proc GetSelection {list} { return [$list curselection] } ############################################################################# #create a list box for restriction enzymes proc renzBox { l contig io seq_id scale from to start_value end_value} { global tk_utils_defs $l.retval #if [winfo exists $l] {raise $l; return} #toplevel $l wm protocol $l WM_DELETE_WINDOW "destroy $l" wm resizable $l 0 0 ######################################################################### #create listbox frame $l.t -borderwidth 0 listbox $l.t.lists -selectmode extended -yscrollcommand "$l.t.scrolly set" #canvas $l.col -yscrollcommand "$l.scrolly set" -width 50 -height 218 bind $l.t.lists <1> {+focus %W} bind $l.t.lists {%W selection set 0 end} focus $l.t.lists scrollbar $l.t.scrolly -command "$l.t.lists yview" -orient vertical ######################################################################### #file name selection for entering personal file getFname $l.infile [keylget tk_utils_defs R_ENZ.INFILE.NAME] load #need to redefine the browse button command to update the list box with #the renz names in the personal file $l.infile.browse configure -command "InvokeFileBrowser $l.infile.entry open;\ ReadUserFileCheck $l.infile.entry $l.t.lists $l" #add binding for entrybox entrybox_configure $l.infile.entry \ -command "ReadUserFile $l.infile.entry $l.t.lists $l" bind [entrybox_path $l.infile.entry] \ "ReadUserFileCheck $l.infile.entry $l.t.lists $l" #remove toplevel Return key binding which invokes the ok button bindtags [entrybox_path $l.infile.entry] "[entrybox_path $l.infile.entry] Entry all" ######################################################################### #keyboard entry of enzyme name and target sequence keylset n E_NAME [keylget tk_utils_defs R_ENZ.E_NAME] entrybox $l.r_name \ -title "[keylget n E_NAME.NAME]" \ -width 20 \ -type "CheckString" entrybox $l.r_seq \ -title "[keylget n E_NAME.SEQ]" \ -width 20 \ -type "CheckString" ######################################################################### #radiobuttons to select file of enzyme names keylset st SELFILE [keylget tk_utils_defs R_ENZ.SELFILE] set b1 [keylget st SELFILE.BUTTON.1] set b2 [keylget st SELFILE.BUTTON.2] set b3 [keylget st SELFILE.BUTTON.3] set b4 [keylget st SELFILE.BUTTON.4] frame $l.but radiolist $l.sel_file \ -title [keylget st SELFILE.NAME]\ -bd 2 \ -relief groove \ -orient vertical \ -default [keylget st SELFILE.VALUE] \ -buttons [format { \ {%s -command {getFname_configure %s -state disabled; \ ReadREnzFile %s %s %s %s} } \ {%s -command {getFname_configure %s -state disabled; \ ReadREnzFile %s %s %s %s} } \ {%s -command {getFname_configure %s -state disabled; \ ReadREnzFile %s %s %s %s} } \ {%s -command {getFname_configure %s -state normal;\ ReadREnzFile %s %s %s %s} } } \ [list $b1] [list $l.infile] [list $l.sel_file] [list $l.infile]\ [list $l.t.lists] [list $l]\ [list $b2] [list $l.infile] [list $l.sel_file] [list $l.infile]\ [list $l.t.lists] [list $l]\ [list $b3] [list $l.infile] [list $l.sel_file] [list $l.infile]\ [list $l.t.lists] [list $l]\ [list $b4] [list $l.infile] [list $l.sel_file] [list $l.infile]\ [list $l.t.lists] [list $l] ] ######################################################################### #if contig_id required if {$contig} { contig_id $l.sc -io $io } if {$seq_id > -1} { #FIXME - if I ever want to do restriction enzyme search in anything #other than nip seq_id $l.range -range 1 -browse 1 -from $from -to $to \ -start_value $start_value -end_value $end_value -min_value 1 \ -default [seq_info $seq_id name] \ -update_cmd [list [list seq_range_updates $l.range]] \ -browse_cmd nip_seq_browser } ######################################################################### #if scale range is required keylset us RANGE [keylget tk_utils_defs R_ENZ.RANGE] if {$scale} { scale_range $l.range -title [keylget us RANGE.NAME] \ -from $from -to $to -start_value $start_value \ -end_value $end_value -bd 2 -relief groove\ -min_value 1 } if {$contig} { set help "show_help gap4 {Restrict-Selecting}" } else { set help "show_help spin {SPIN-Restrict-Selecting}" } ######################################################################### #OK and Cancel buttons okcancelhelp $l.ok_cancel \ -ok_command "renzbox_OK_Pressed $l $seq_id" \ -cancel_command "renzbox_Cancel_Pressed $l $seq_id" \ -help_command $help \ -bd 2 \ -relief groove #final packing #pack $l.ok_cancel -side bottom -fill x #pack $l.infile -side bottom -fill x #pack $l.sel_file -side bottom -fill x #pack $l.scrolly -side right -fill y #pack $l.lists -fill both pack $l.t -fill both pack $l.t.scrolly -side right -fill y pack $l.t.lists -fill both pack $l.sel_file -fill x pack $l.infile -fill x if {$contig} { pack $l.sc -fill x } if {$seq_id > -1} { pack $l.range -fill x } if {$scale} { pack $l.range -fill x } pack $l.ok_cancel -fill x #number of items in the list box set num_items [$l.t.lists size] tkwait variable $l.retval destroy $l return [set $l.retval] } proc renzbox_OK_Pressed { l seq_id} { global $l.list $l.retval set list_name [renzbox_path $l] set filename [renzbox_filename $l] set $l.list [GetSelection $list_name] if {[winfo exists $l.sc]} { global $l.contig_name $l.from $l.to set $l.contig_name [contig_id_gel $l.sc] set $l.from [contig_id_lreg $l.sc] set $l.to [contig_id_rreg $l.sc] } if {$seq_id > -1} { global $l.seqid set $l.seqid "{[seq_id_name $l.range]} [seq_id_from $l.range] [seq_id_to $l.range]" seq_id_destroy $l.range } elseif {[winfo exists $l.range]} { global $l.from $l.to set $l.from [scale_range_from $l.range] set $l.to [scale_range_to $l.range] } set num_items [llength [set $l.list]] #if the user has not selected any enzymes if {[llength [set $l.list]] == 0} { tk_messageBox -title "Error" -message "No selection has been made" -icon error -type ok raise $l return } set $l.retval 1 } proc renzbox_Cancel_Pressed { l seq_id} { global $l.retval set $l.retval 0 if {$seq_id > -1} { seq_id_destroy $l.range } } proc renzbox_path { l } { return $l.t.lists } proc renzbox_filename { l } { global $l.filename return [set $l.filename] } proc renzbox_contig_name { l } { global $l.contig_name return [set $l.contig_name] } proc renzbox_from {l} { global $l.from return [set $l.from] } proc renzbox_to {l} { global $l.to return [set $l.to] } proc renzbox_get_seqid {l} { global $l.seqid return [set $l.seqid] } #restriction enzyme selection box only proc renzbox { l } { return [renzBox $l 0 0 -1 0 0 0 0 0] } #restriction enzyme selection box plus contig_id selection proc contig_renzbox {l io } { return [renzBox $l 1 $io -1 0 0 0 0 0] } #restriction enzyme selection box with ranges only proc scale_renzbox { l from to start_value end_value} { return [renzBox $l 0 0 -1 1 $from $to $start_value $end_value] } #restriction enzyme selection box plus seq_id selection proc seq_renzbox { l seq_id from to start_value end_value} { return [renzBox $l 0 0 $seq_id 0 $from $to $start_value $end_value] } staden-2.0.0b11-2016-src/tk_utils/radiobutton.tcl0000644000031500020650000000620012707372072020052 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # # jkb: 9/2/00 # Why does this widget pack items with the last button left-most for # horizontal packing and first button top-most for vertical packing!? # Too late to change... # # Configures a radiolist dialogue # proc radiolist_configure {path args} { global $path.Radio global $path.num_buts set in_arg 0 set buttons "" set arglist "" set title "" set orient "" set font "" set state "" set foreground "" # Process command line args foreach i $args { if {$in_arg} { if {$option == "-buttons"} { set buttons $i } elseif {$option == "-default"} { set $path.Radio $i } elseif {$option == "-title"} { set title "-text {$i}" } elseif {$option == "-orient"} { set orient "$i" } elseif {$option == "-font"} { set font "-font {$i}" } elseif {$option == "-state"} { set state "-state $i" } else { lappend arglist $option $i } set in_arg 0 } else { set option $i set in_arg 1 } } eval $path configure $arglist if {"$title" != "" || "$foreground" != "" || "$font" != "" || $state != ""} { eval $path.label configure $title $foreground $font $state } if {"$state" != ""} { for {set i 1} {$i < [set $path.num_buts]} {incr i} { eval $path.r$i configure $state } } # Add the items set count 1 set comm "" foreach i $buttons { set args [lrange $i 1 end] eval radiobutton $path.r$count -text {[lindex $i 0]} -value $count \ -variable $path.Radio $args if {"$orient" == "horizontal"} { pack $path.r$count -side right set comm "raise [list $path.r$count]; $comm" } else { pack $path.r$count -side top -anchor w } incr count set $path.num_buts $count } if {$comm != ""} {eval $comm} return $orient } # # radiolist: # # Creates a radiolist frame containing a title and a collection of buttons. # Command line arguments are as per the frame widget, with the addition of: # -buttons {{button ?args?} {button ?args?} ...} # -default default_value # -title title # proc radiolist {path args} { global $path.Radio # Create the frame and label frame $path -class RadioList xlabel $path.label # Configure, which also adds the buttons set orient [eval radiolist_configure $path $args] if {"$orient" == "horizontal"} { pack $path.label -side left } else { pack $path.label -side top -before $path.r1 } # Invoke the default operations eval set r \$\{$path.Radio\} eval $path.r$r invoke return $path } # # radiolist_get: # # Given a radiolist path we return the currently selected item # proc radiolist_get {path} { global $path.Radio eval return \$\{$path.Radio\} } # # radiolist_destroy: # # Destroys a radiolist path # proc radiolist_destroy {path} { global $path.Radio unset $path.Radio destroy $path } staden-2.0.0b11-2016-src/tk_utils/repeater.tcl0000644000031500020650000000155712707372072017341 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # proc do_repeat {state script} { upvar #0 $state s if {$s > 0} { eval $script if {$s == 1} { set s 2 after 500 "do_repeat $state \"$script\"" } else { after 50 "do_repeat $state \"$script\"" } } } proc repeater {path callback args} { eval button $path $args bind $path "+ set $path.State 1 do_repeat $path.State \"$callback\" " bind $path "+ set $path.State 0 after cancel \"do_repeat $path.State \\\"$callback\\\"\" " return $path } staden-2.0.0b11-2016-src/tk_utils/restriction_enzyme_map.tcl0000644000031500020650000005674512707372072022334 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # proc renz_map_configure {w args} { global $w.zoom_cmd $w.zoomback_cmd $w.scrollbar_x_cmd $w.scrollbar_y_cmd global $w.cursor_cmd $w.renz_name_cmd $w.renz_info_cmd $w.invoke_cmd global $w.tick_ht $w.text_offset $w.text_fill $w.config_cmd set in_arg 0 set arglist "" set height "" set width "" set ruler_height "" set names_width "" set selectbackground "" set tick_ht "" set $w.zoom_cmd "" set $w.zoomback_cmd "" set $w.scrollbar_x_cmd "" set $w.scrollbar_y_cmd "" set $w.cursor_cmd "" set $w.renz_name_cmd "" set $w.renz_info_cmd "" set $w.invoke_cmd "" set $w.tick_ht "" set $w.text_offset "" set $w.text_fill "" set $w.config_cmd "" # Process command line args foreach i $args { if {$in_arg} { if {$option == "-zoom_command"} { set $w.zoom_cmd "{$i}" } elseif {$option == "-zoomback_command"} { set $w.zoomback_cmd "{$i}" } elseif {$option == "-scrollbar_x_cmd"} { set $w.scrollbar_x_cmd "{$i}" } elseif {$option == "-scrollbar_y_cmd"} { set $w.scrollbar_y_cmd "{$i}" } elseif {$option == "-cursor_cmd"} { set $w.cursor_cmd "{$i}" } elseif {$option == "-renz_name_cmd"} { set $w.renz_name_cmd "{$i}" } elseif {$option == "-renz_info_cmd"} { set $w.renz_info_cmd "{$i}" } elseif {$option == "-width"} { set width "-width $i" } elseif {$option == "-height"} { set height "-height $i" } elseif {$option == "-ruler_height"} { set ruler_height "-height $i" } elseif {$option == "-names_width"} { set names_width "-width $i" } elseif {$option == "-tick_ht"} { set $w.tick_ht "{$i}" } elseif {$option == "-selectbackground"} { set selectbackground "-selectbackground $i" } elseif {$option == "-text_offset"} { set $w.text_offset "{$i}" } elseif {$option == "-text_fill"} { set $w.text_fill "{$i}" } elseif {$option == "-invoke_cmd"} { set $w.invoke_cmd "{$i}" } elseif {$option == "-config_cmd"} { set $w.config_cmd "{$i}" } else { lappend arglist $option $i } set in_arg 0 } else { set option $i set in_arg 1 } } eval $w.renz configure $arglist if {$height != ""} { eval $w.renz config $height eval $w.names config $height } if {$ruler_height != ""} { eval $w.ruler config $ruler_height } if {$width != ""} { eval $w.renz config $width eval $w.ruler config $width } if {$names_width != ""} { eval $w.names config $names_width } if {$selectbackground != ""} { eval $w.names config $selectbackground } if {[set $w.scrollbar_x_cmd] != ""} { eval $w.hscroll config -command [set $w.scrollbar_x_cmd] } if {[set $w.scrollbar_y_cmd] != ""} { eval $w.vscroll config -command [set $w.scrollbar_y_cmd] } if {[set $w.zoom_cmd] != ""} { set zoom_cmd "[set $w.zoom_cmd] -direction b" eval canvasbox_configure $w.renz -zoom_command [list $zoom_cmd] set zoom_cmd "[set $w.zoom_cmd] -direction x" eval canvasbox_configure $w.ruler -zoom_command [list $zoom_cmd] } if {[set $w.zoomback_cmd] != ""} { eval $w.buttons.back config -command [set $w.zoomback_cmd] } } #create restriction enzyme canvas proc renz_map {w args} { global tk_utils_defs global $w.cursor_cmd $w.renz_name_cmd $w.renz_info_cmd $w.invoke_cmd global $w.config_cmd xtoplevel $w canvasbox $w.renz -yscrollcommand "$w.vscroll set" \ -bd 0 -highlightthickness 0 scrollbar $w.hscroll -orient horizontal -relief sunken scrollbar $w.vscroll -orient vertical -relief sunken frame $w.menubar -relief raised -borderwidth 2 frame $w.buttons #zoom back button button $w.buttons.back -text "zoom out" button $w.buttons.zoomin10 -text "+10%" \ -command "ZoomInCanvas $w.renz 0.05" button $w.buttons.zoomin50 -text "+50%" \ -command "ZoomInCanvas $w.renz 0.1666" #cursor checkbutton global $w.cursor checkbutton $w.buttons.cursor -text crosshairs -variable $w.cursor #cursor position label set cursor_t [keylget tk_utils_defs R_ENZ.CURSOR] label $w$cursor_t -bd 2 -relief sunken -width 6 #restriction enzyme distance label label $w.buttons.dist -relief sunken -bd 2 -width 6 pack $w.buttons.zoomin10 $w.buttons.zoomin50 $w.buttons.back \ $w.buttons.cursor -expand yes -side left pack $w$cursor_t -in $w.buttons -side left -expand yes pack $w.buttons.dist -side left -expand yes ########################################################################## #create canvas of names of restriction enzymes canvasbox $w.names \ -selectbackground [keylget tk_utils_defs R_ENZ.SELECT_COLOUR] \ -bd 0 -highlightthickness 0 ########################################################################## #create ruler canvas canvasbox $w.ruler -xscrollcommand "$w.hscroll set" \ -bd 0 -highlightthickness 0 ########################################################################## label $w.brief grid columnconfig $w 1 -weight 1 grid rowconfig $w 2 -weight 1 grid $w.menubar -row 0 -column 0 -sticky ew -columnspan 3 grid $w.buttons -row 1 -column 0 -sticky ew -columnspan 3 grid $w.names -row 2 -column 0 -sticky ns grid $w.renz -row 2 -column 1 -sticky nsew grid $w.ruler -row 3 -column 1 -sticky ew grid $w.hscroll -row 4 -column 1 -sticky ew grid $w.brief -row 5 -column 1 -sticky ew grid $w.vscroll -row 2 -column 2 -sticky ns eval renz_map_configure $w $args global $w.renz.prev_item $w.renz.item_num set $w.renz.prev_item 0 set $w.renz.item_num 0 set $w.sel_enz "" SetREnzBindings $w $w.renz $w.ruler $w.names $w.brief $w.buttons.dist \ [set $w.cursor_cmd] [set $w.renz_name_cmd] [set $w.renz_info_cmd] \ [set $w.invoke_cmd] [set $w.config_cmd] SetREnzRulerBindings $w $w.renz $w.ruler [set $w.cursor_cmd] [set $w.invoke_cmd] } ############################################################################## proc next_renz_display { } { global next_r_display if {![info exists next_r_display]} { set next_r_display 0 return $next_r_display } incr next_r_display return $next_r_display } ############################################################################## proc renz_map_plot {w cmd} { global $w.scrollbar_x_cmd $w.scrollbar_y_cmd global $w.tick_ht $w.text_offset $w.text_fill return [eval $cmd -frame $w -win_names $w.names -window $w.renz \ -win_ruler $w.ruler \ -text_offset [set $w.text_offset] \ -text_fill [set $w.text_fill] \ -tick_height [set $w.tick_ht] -yoffset [set $w.tick_ht]] } ############################################################################## #called from C #delete stand alone restriction enzyme display proc DeleteREnzPlot { w re_win} { global REnzyme global $w.renz_id global $w.cursor global $w.pos global $w.plot if {[info exists REnzyme]} { unset REnzyme } unset $w.renz_id unset $w.cursor if {[info exists $w.pos]} { unset $w.pos } if {[info exists $w.plot]} { unset $w.plot } $re_win delete all destroy $re_win destroy $w } #create selectable rectangle proc CreateSelRect {names item_num } { global tk_utils_defs set colour [keylget tk_utils_defs R_ENZ.SELECT_COLOUR] set box [$names bbox re_$item_num] set x1 [lindex $box 0] set y1 [lindex $box 1] set x2 [winfo width $names] set y2 [lindex $box 3] $names lower [$names create rectangle $x1 $y1 $x2 $y2 -fill $colour \ -outline "" -tag r_$item_num] } #after a redraw, add selections back again #called from C proc ReSelectRect {f names} { global $f.sel_enz if {[info exists $f.sel_enz]} { foreach tag [set $f.sel_enz] { CreateSelRect $names [string trim $tag re_] } } } ############################################################################## # proc AddREnzCursor {f re_win r_win x cursor_cmd} { global $f.cursor if {[set $f.cursor]} { uplevel #0 eval $cursor_cmd -x [$re_win canvasx $x] } else { DeleteREnzCursor $re_win $r_win } } ############################################################################## # proc DeleteREnzCursor {re_win r_win} { $re_win delete cursor_x $r_win delete cursor_x } ############################################################################## #invoked by moving the mouse over a restriction enzyme cut line proc HighlightREnz {f plot label name_cmd} { global restoreCmd global $plot.prev_item $plot.item_num set nearest [$plot find withtag current] #only do this code if the nearest item is different from the previous one if {$nearest != [set $plot.prev_item]} { #unhighlight object if {[set $plot.item_num] != 0} { eval $restoreCmd($plot,r_enz) } if {$nearest != 0} { InitialSettings $plot $plot $nearest r_enz $plot itemconfig $nearest -fill white $plot raise $nearest set $plot.item_num $nearest $label configure -text "[GetREnzName $f $plot $nearest $name_cmd] cut position [GetREnzPos $plot $nearest]" } } #set previous item set $plot.prev_item $nearest } proc RenzInvokeCmd {re_win x invoke_cmd} { uplevel #0 eval $invoke_cmd $x $re_win } ############################################################################## #bindings specific to the stand alone restriction enzyme proc SetREnzBindings {f re_win r_win names_win label dist cursor_cmd renz_name_cmd renz_info_cmd invoke_cmd config_cmd} { global REnzY1 global $f.renz_id $names_win.Move bind $re_win "DeleteREnzCursor $re_win $r_win" bind $re_win "AddREnzCursor $f $re_win $r_win %x $cursor_cmd" #any mouse motion - highlight nearest cut line $re_win bind S \ "HighlightREnz $f $re_win $label $renz_name_cmd" $re_win bind S {;} #button-1 in plot canvas find the distance between 2 cut lines $re_win bind S <> "PickREnz $names_win $f" #button-2 in names canvas - move a name and assoc cut lines set $names_win.Move 0 $names_win bind S <> \ "if {\[SelectREnzPlot $f $names_win $re_win %y\] == -1} {set $names_win.Move 0} else {set $names_win.Move 1} " $names_win bind S <> \ "if {\[set $names_win.Move\] == 1} { MoveREnzPlot $names_win $re_win %y }" $names_win bind S <> \ "if {\[set $names_win.Move\] == 1} { DropREnzPlot $f $names_win $re_win %y set $names_win.Move 0 }" #button-2 in plot canvas - disable binding which scrolls the entire canvas #bind $re_win <2> {} #bind $re_win {} #auto scrolling bind $names_win <> "set $f.auto_scroll 1; REnzAutoScroll $names_win $re_win %y $f y" bind $names_win <> "+REnzStopScroll $f" #button-3 in plot canvas - invoke a popup menu $re_win bind S <> "PopUpREnzMenu $f $re_win %X %Y $renz_info_cmd" #Double button 1 or 2 to move or create an editor bind $re_win <> "RenzInvokeCmd $re_win %x $invoke_cmd" bind $re_win <> "RenzInvokeCmd $re_win %x $invoke_cmd" #must bind names_win here as it is the last window to be updated by the #Configure callback. If use re_win, the scrollregion is calculated #incorrectly for the names win as it hasn't been updated #07.03.00 #changed this back again because it introduces another bug because #increasing the re_win in x only doesn't cause the binding to be activated #solution for now: change back again but alter nip so that the canvas #canvas can't be resized in y. This should be fixed at a later date to #show more enzymes rather than just increase their size bind $re_win "uplevel #0 eval $config_cmd" #bind $names_win "uplevel #0 eval $config_cmd" } ############################################################################## proc SetREnzRulerBindings {f re_win r_win cursor_cmd invoke_cmd} { global $f.renz_id bind $r_win "DeleteREnzCursor $re_win $r_win" bind $r_win "AddREnzCursor $f $re_win $r_win %x $cursor_cmd" # Double button 2 to move or create an editor bind $r_win <> "RenzInvokeCmd $re_win %x $invoke_cmd" } ############################################################################## #return the index of a restriction enzyme proc GetREnzIndex {plot item } { foreach tag [$plot gettags $item] { if {[string compare [string range $tag 0 2] re_] == 0} { return [string trim $tag re_] } } #no tags return -1 } ############################################################################## #return the name of a restriction enzyme proc GetREnzName { f plot item name_cmd} { set index [GetREnzIndex $plot $item] set name [uplevel #0 eval $name_cmd -enzyme $index] return $name } ############################################################################## #return the restriction enzyme cut position proc GetREnzPos { plot id } { foreach tag [$plot gettags $id] { if {[string compare [string range $tag 0 3] pos_] == 0} { return [string trim $tag pos_] } } } ############################################################################## #return the entire restriction enzyme tag proc GetREnzTag { c i} { foreach tag [$c gettags $i] { if {[string compare [string range $tag 0 2] re_] ==0} { return $tag } } } ############################################################################## #find the distance between two restriction enzyme cuts proc FindDistance { f re_win label dist text} { global $f.pos global $f.plot if {[info exists $f.plot]} { if {[set $f.plot] != $re_win} { return } } set x [GetREnzPos $re_win current] if { [info exists $f.pos]} { $dist configure -text [expr abs($x - [set $f.pos])] $label configure -text "Distance: [expr abs($x - [set $f.pos])]" unset $f.pos unset $f.plot bell } else { set $f.pos $x set $f.plot $re_win $label configure -text "Select another $text" bell } } ############################################################################## #highlight selected enzyme name with a selectable rectangle proc PickREnz { names f} { global $f.sel_enz #check the current selection is valid if {[$names find withtag current] == ""} { return } #check tag is selectable (ie exclude the rectangles) if {[lsearch [$names gettag [$names find withtag current]] S] == -1} { return } set tag [GetREnzTag $names current] set item_num [GetREnzIndex $names current] #remove rectangle if it already exists - ie toggle off if {[info exists $f.sel_enz]} { set pos [lsearch [set $f.sel_enz] $tag] } else { set pos -1 } if { $pos > -1} { $names delete r_$item_num set $f.sel_enz [lreplace [set $f.sel_enz] $pos $pos] return } CreateSelRect $names $item_num lappend $f.sel_enz $tag } ############################################################################## #stand alone restriction enzyme display #selected enzyme name and plot to move - set up extents of movement and first #y position proc SelectREnzPlot {f names r_enz y} { global REnzyme global REnzY1 global NGConst #puts "start SELECTRENZPLOT" #if no cuts, don't allow user to move if {[$r_enz coords S] == ""} { return -1 } set REnzyme($f,smallest) [winfo height $names] set REnzyme($f,largest) 0 set REnzY1 [$names canvasy $y] set REnzyme($f,orig_pos) [lindex [$names coord current] 1] foreach i [$names find withtag S] { set item_pos [lindex [$names coords $i] 1] if {$item_pos < $REnzyme($f,smallest)} { set REnzyme($f,smallest) $item_pos } #find largest coord if {$item_pos > $REnzyme($f,largest)} { set REnzyme($f,largest) $item_pos } } return 0 } ############################################################################## #move a restriction enzyme plot in the stand alone display #must move the enzyme name, its associated 'selecting' rectangle and its plot proc MoveREnzPlot { names r_enz y} { global REnzY1 #puts "start MOVERENZPLOT" #set min_x $NGConst(ymargin) #set max_x [expr $NGConst($names,win_len) - $NGConst(ymargin)] #set min_y $NGConst(xmargin) #set max_y [expr $NGConst($names,win_ht) - $NGConst(xmargin)] set min_x 1 set max_x [winfo width $names] set min_y 1 set max_y [winfo height $names] if {($y > $min_y) && ($y < $max_y)} { set y [$names canvasy $y] set dx 0 set dy [expr $y - $REnzY1] set tag [GetREnzTag $names current] set item_num [GetREnzIndex $names current] #move both name and cuts $names move $tag $dx $dy $names move r_$item_num $dx $dy $r_enz move $tag $dx $dy set REnzY1 $y } } ############################################################################## #drop a restriction enzyme plot in the stand alone display #must move the enzyme name, its associated 'selecting' rectangle and its plot proc DropREnzPlot {f names r_enz y} { global REnzyme global gap_defs #puts "start DROPRENZPLOT [$r_enz coords S]" REnzStopScroll $f set current [$names find withtag current]; #moved item set cur_pos [lindex [$names coord $current] 1]; #y coord of moved item #set offset to be tick height set offset [expr [lindex [$r_enz coords S] 3] - \ [lindex [$r_enz coords S] 1]] #set text_offset to be the distance to the first text item set text_offset $REnzyme($f,smallest) #fudge factor necessary due to precision errors set multiplier [expr int((($cur_pos - $text_offset)/$offset) + 0.0001)] set final_pos [expr $text_offset + ($multiplier * $offset)] if {$final_pos == $REnzyme($f,orig_pos)} { set tag [GetREnzTag $names $current]; #corresponding cut plot tag set item_num [GetREnzIndex $names $current] $names move $current 0 [expr $final_pos - $cur_pos] $names move r_$item_num 0 [expr $final_pos - $cur_pos] $r_enz move $tag 0 [expr $final_pos - $cur_pos] return } if {$cur_pos >= $REnzyme($f,orig_pos)} { foreach i [$names find withtag S] { set item_pos [lindex [$names coords $i] 1] if {($item_pos > $REnzyme($f,orig_pos)) && \ ($item_pos <= $cur_pos) && ($i != $current)} { set tag [GetREnzTag $names $i] set item_num [GetREnzIndex $names $i] $names move $i 0 [expr $offset * -1] $names move r_$item_num 0 [expr $offset * -1] $r_enz move $tag 0 [expr $offset * -1] } } if {$final_pos > $REnzyme($f,largest)} { set final_pos $REnzyme($f,largest) } set tag [GetREnzTag $names $current]; #corresponding cut plot tag set item_num [GetREnzIndex $names $current] $names move $current 0 [expr $final_pos - $cur_pos] $names move r_$item_num 0 [expr $final_pos - $cur_pos] $r_enz move $tag 0 [expr $final_pos - $cur_pos] } elseif {$cur_pos < $REnzyme($f,orig_pos)} { #must round up here set multiplier [expr ceil(($cur_pos - $text_offset)/$offset)] set final_pos [expr $text_offset + ($multiplier * $offset)] foreach i [$names find withtag S] { set item_pos [lindex [$names coords $i] 1] if {($item_pos < $REnzyme($f,orig_pos)) && \ ($item_pos >= $cur_pos) && ($i != $current)} { set tag [GetREnzTag $names $i] set item_num [GetREnzIndex $names $i] $names move $i 0 $offset $names move r_$item_num 0 $offset $r_enz move $tag 0 $offset } } if {$final_pos < $REnzyme($f,smallest)} { set final_pos $REnzyme($f,smallest) } set tag [GetREnzTag $names $current]; #corresponding cut plot tag set item_num [GetREnzIndex $names $current]; #corresponding rectangle $names move $current 0 [expr $final_pos - $cur_pos] $names move r_$item_num 0 [expr $final_pos - $cur_pos] $r_enz move $tag 0 [expr $final_pos - $cur_pos] } } ############################################################################## #stand alone restriction enzyme display #auto scrolls whilst the mouse pointer is outside the canvas proc REnzDoScroll { f names_win re_win direction scroll } { global CanvasConst global $f.auto_scroll if {[set $f.auto_scroll] && [winfo exists $names_win]} { set bbox [$names_win bbox S] set min_y [lindex $bbox 1] set max_y [lindex $bbox 3] set first_unit [lindex [$f.vscroll get] 0] set unit [expr double($CanvasConst(auto_incr))/($max_y - $min_y)] $re_win yview moveto [expr $first_unit + ($direction * $unit)] $names_win yview moveto [expr $first_unit + ($direction * $unit)] after 100 "REnzDoScroll $f $names_win $re_win $direction $scroll" } } ############################################################################## #stand alone restriction enzyme display proc REnzAutoScroll {names_win re_win y f scroll} { global CanvasConst #puts "start AUTOSCROLL y $y" set min_y 1 set max_y [winfo height $names_win] if {$y < $min_y } { after $CanvasConst(auto_time) \ "REnzDoScroll $f $names_win $re_win -1 $scroll" } elseif {$y > $max_y} { after $CanvasConst(auto_time) \ "REnzDoScroll $f $names_win $re_win +1 $scroll" } } ############################################################################## # proc REnzStopScroll {f} { global $f.auto_scroll set $f.auto_scroll 0 } ############################################################################## #popup menu invoked when click on cut line with button-3 proc PopUpREnzMenu { f re_win X Y renz_info_cmd} { global initialCol global $re_win.prev_item if [winfo exists $re_win.m] {destroy $re_win.m} set item [GetREnzTag $re_win current] set index [GetREnzIndex $re_win $item] #starting colour set colour $initialCol($re_win,r_enz) #cmd to execute when ok button on colourbox pressed set ok_cmd "ConfigureREnzPlot $re_win $item" #cmd to execute when changing colours on colourbox set update_cmd "UpdateREnzPlot $re_win $item" #cmd to execute when cancel button on colourbox pressed set cancel_cmd "$re_win itemconfigure $item -fill $colour; InitialSettings $re_win $re_win $item r_enz" create_popup $re_win.m Commands #$re_win.m add command -label information \ -command "destroy $re_win.m; \ get_r_enz_info -id $id -enzyme $index -io $io -cnum $contig" $re_win.m add command -label information \ -command "destroy $re_win.m; \ uplevel #0 eval $renz_info_cmd -enzyme $index" $re_win.m add command -label configure \ -command "destroy $re_win.m; if {[winfo exists $re_win.cbox]} {return}; \ xtoplevel $re_win.cbox -resizable 0;\ wm title $re_win.cbox {Configure colours}; \ ColourBox $re_win.cbox $colour {$ok_cmd} {$update_cmd} {$cancel_cmd};\ set $re_win.prev_item 0" tk_popup $re_win.m [expr $X-20] [expr $Y-10] } ############################################################################## proc UpdateREnzPlot {canvas item colour } { #puts "update item $item colour $colour" $canvas itemconfigure $item -fill $colour InitialSettings $canvas $canvas $item r_enz } ############################################################################# proc ConfigureREnzPlot {canvas item colour } { global restoreCmd #puts "configure item $item colour $colour" eval $restoreCmd($canvas,r_enz) UpdateREnzPlot $canvas $item $colour InitialSettings $canvas $canvas $item r_enz eval $restoreCmd($canvas,r_enz) } staden-2.0.0b11-2016-src/tk_utils/scale_range.tcl0000644000031500020650000001213012707372072017762 0ustar jkbteam117# # Copyrightquer (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # ############################################################################## #ensure start scale bar does not become larger than the end scale bar proc CheckStartLimits { start end min_value value} { if {$value > [expr {[$end.scale get] - $min_value}]} { $end.scale set [expr {[$start.scale get] + $min_value}] if {[$end.scale get] < [expr {[$start.scale get] + $min_value}]} { $start.scale set [expr {[$end.scale get] - $min_value}] } } } ############################################################################## #ensure end scale bar does not become smaller than the start scale bar proc CheckEndLimits { start end min_value value} { if {$value < [expr {[$start.scale get] + $min_value}]} { $start.scale set [expr {[$end.scale get] - $min_value}] if {[$start.scale get] == 1} { $end.scale set [expr {$min_value+1}] } } } # #Configure a scale_range widget # proc scale_range_configureOLD {path args} { if {[winfo exists $path.from] } { eval scalebox_configure $path.from $args eval scalebox_configure $path.to $args } } proc scale_range_configure {path args} { set title "" set in_arg 0 set arglist "" set command "" set checked_ok 0 set end_value "" set start_value "" set start_name "" set end_name "" set min_value "" foreach i $args { if {$in_arg} { if {$option == "-title"} { set title $i } elseif {$option == "-end_value"} { set end_value $i } elseif {$option == "-start_value"} { set start_value $i } elseif {$option == "-end_name"} { set end_name $i } elseif {$option == "-start_name"} { set start_name $i } elseif {$option == "-min_value"} { set min_value $i } else { lappend arglist $option $i set in_arg 0 } set in_arg 0 } else { set option $i set in_arg 1 } } if {[winfo exists $path.from] } { eval scalebox_configure $path.from $arglist eval scalebox_configure $path.to $arglist } if {$title != ""} { $path.l.label configure -text $title } if {$start_value != "" && [winfo exists $path.from]} { scalebox_configure $path.from -default $start_value } if {$end_value != "" && [winfo exists $path.to]} { scalebox_configure $path.to -default $end_value } if {$start_name != "" && [winfo exists $path.from]} { scalebox_configure $path.from -title $start_name } if {$end_name != "" && [winfo exists $path.to]} { scalebox_configure $path.to -title $end_name } if {$min_value != "" && [winfo exists $path.from]} { scalebox_configure $path.from -command "CheckStartLimits $path.from $path.to $min_value" scalebox_configure $path.from -command "CheckEndLimits $path.from $path.to $min_value" } } # #Creates a scale_range widget #from is the minimum value #to is the maximum value #start_value is the starting default for the from scale #end_value is the starting default for the to scale #min_value is the minimum difference allowed between the from & to scales # proc scale_range {path args} { set title "" set in_arg 0 set arglist "" set command "" set checked_ok 0 set from 1 set to 1 set end_value 0 set start_value 0 set start_name "Start position" set end_name "End position" set min_value 0 foreach i $args { if {$in_arg} { if {$option == "-title"} { set title $i } elseif {$option == "-from"} { set from $i } elseif {$option == "-to"} { set to $i } elseif {$option == "-end_value"} { set end_value $i } elseif {$option == "-start_value"} { set start_value $i } elseif {$option == "-end_name"} { set end_name $i } elseif {$option == "-start_name"} { set start_name $i } elseif {$option == "-min_value"} { set min_value $i } elseif {$option == "-command"} { set command "$i" } else { lappend arglist $option $i set in_arg 0 } set in_arg 0 } else { set option $i set in_arg 1 } } eval frame $path $arglist if {$title != ""} { frame $path.l label $path.l.label -text $title pack $path.l.label -side left pack $path.l -fill x } scalebox $path.from \ -title $start_name \ -orient horizontal \ -from $from \ -to $to \ -default $start_value\ -width 7 \ -type CheckInt \ -command "CheckStartLimits $path.from $path.to $min_value" scalebox $path.to \ -title $end_name \ -orient horizontal \ -from $from \ -to $to \ -default $end_value \ -width 7 \ -type CheckInt \ -command "CheckEndLimits $path.from $path.to $min_value" eval scale_range_configure $path $arglist pack $path.from -side top -fill x pack $path.to -side top -fill x } # #Return the from value # proc scale_range_from {path} { return [scalebox_get $path.from] } # #Return the to value # proc scale_range_to {path} { return [scalebox_get $path.to] } staden-2.0.0b11-2016-src/tk_utils/scalebox.tcl0000644000031500020650000001224212707372072017323 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # ############################################################################## #convert entry values to scale values proc scalevalue { path } { global entry_ set entryvalue [$path.entry get] if {[info exists entry_($path,type)] } { #check entry is of correct type if { ![eval $entry_($path,type) $path] } { bell } else { set v [$path.scale get] #HACK - to deal simply with the problem that once the scale is #at it's limits, it doesn't update and therefore the #scalebox_update_entry function is never called and the entrybox #isn't set to the scale limit $path.scale set [expr $v-1] $path.scale set [expr $v+1] $path.scale set $entryvalue } #$path.entry delete 0 end } } # # Configures a scalebox # proc scalebox_configure {path args} { global entry_ set in_arg 0 set arglist "" set title "" set command "" set type CheckInt set orient "" set from "" set to "" set state "" set sarg 0 set earg 0 set default "" set resolution "" set digits "" set varg "" #set default type to be CheckInt set entry_($path,type) $type # Process command line args foreach i $args { if {$in_arg} { if {$option == "-title"} { set title "-text {$i}" } elseif {$option == "-type"} { set entry_($path,type) "$i" } elseif {$option == "-orient" || $option == "orientation"} { set orient "-orient $i" set sarg 1 } elseif {$option == "-resolution"} { set from "-resolution $i" set sarg 1 } elseif {$option == "-digits"} { set from "-digits $i" set sarg 1 } elseif {$option == "-from"} { set from "-from $i" set sarg 1 } elseif {$option == "-to"} { set to "-to $i" set sarg 1 } elseif {$option == "-default"} { set default $i } elseif {$option == "-state"} { set state "$i" } elseif {$option == "-width"} { set width "-width $i" set earg 1 } elseif {$option == "-variable"} { set varg $i } elseif {$option == "-command"} { #add new command before original command set comm [lindex [$path.scale configure -command] 4] set command [format \ {-command {%s [%s get]; %s} } \ $i [list $path.scale] $comm] #set command "-command {$i}" set sarg 1 } else { lappend arglist $option $i } set in_arg 0 } else { set option $i set in_arg 1 } } eval $path.scale configure $arglist if {"$title" != ""} { eval $path.label configure $title } if {$sarg} { eval $path.scale configure $from $to $orient $command $digits $resolution } if {$earg} { eval $path.entry configure $width } if {$varg != ""} { eval $path.entry configure -textvariable $varg } if {$default != ""} { eval $path.scale set $default scalebox_update_entry $path.scale $path.entry $default } if {"$state" == "normal"} { $path.label configure -state normal $path.scale configure -state normal $path.entry configure -state normal } elseif {"$state" == "disabled"} { $path.label configure -state disabled $path.scale configure -state disabled $path.entry configure -state disabled } } proc scalebox_update_entry {path entry value } { $entry delete 0 end #must use [$path get] here and NOT value $entry insert 0 [$path get] } # # Creates a scalebox # Command line arguments are as per the frame widget, with the addition of: # -title title # -command script # -default value # -resolution value # -digits value # -from value # -to value # -orient vert/horiz # -state normal/disabled # -type CheckInt/CheckFloat # proc scalebox { path args } { global entry_ # Create the frame, label, entry and scale frame $path -class ScaleBox #create label and entry frame frame $path.le xlabel $path.label -anchor w entry $path.entry scale $path.scale -showvalue 0 -command "scalebox_update_entry $path.scale $path.entry" # Configure eval scalebox_configure $path $args pack $path.label -side left -in $path.le pack $path.entry -side right -in $path.le pack $path.scale -side right pack $path.le -side bottom -pady 2 -fill x #update slider value from entrybox value bind $path.entry "scalevalue $path" bind $path.entry "CheckLeave $path" bind $path.entry "CheckLeave $path" return $path } proc CheckLeave { path } { if {[$path.entry get] != ""} { scalevalue $path } } # # scalebox_get: # # Given a scalebox path we return the current value # proc scalebox_get {path} { CheckLeave $path return [$path.scale get] } proc scalebox_set {path val} { $path.scale set $val scalebox_update_entry $path.scale $path.entry $val } # # scalebox_destroy: # # Destroys a scalebox path # proc scalebox_destroy {path} { global $path.Scale unset $path.Scale destroy $path } staden-2.0.0b11-2016-src/tk_utils/search.tcl0000644000031500020650000000531312707372072016771 0ustar jkbteam117# search.tcl -- # # This demonstration script creates a collection of widgets that # allow you to load a file into a text widget, then perform searches # on that file. # # @(#) search.tcl 1.2 95/06/21 09:17:11 # textSearchPos -- # Search for all instances of a given string in a text widget and # apply a given tag to each instance found and move the cursor to the # position # # Arguments: # w - The window in which to search. Must be a text widget. # string - The string to search for. The search is done using # exact matching only; no special characters. # tag - Tag to apply to each instance of a matching string. proc textSearchPos {w string tag direction} { global prev_cur cur #set position of search to the current position of the cursor if {![info exists cur]} { set prev_cur [$w index insert] } set cur [$w index insert] if {$string == ""} { return } if {$direction == 1} { set cur [$w index "$cur + 1 char"] set cur [$w search -forwards -nocase -count length -- $string $cur end] } else { set cur [$w index "$cur - 1 char"] set cur [$w search -backwards -nocase -count length -- $string $cur 1.0] } if {$cur == ""} { bell set cur $prev_cur return } else { set prev_cur $cur } $w see $cur $w tag remove search 0.0 end $w tag add $tag $cur "$cur + $length char" $w mark set insert $cur } # textSearch -- # Search for all instances of a given string in a text widget and # apply a given tag to each instance found. # # Arguments: # w - The window in which to search. Must be a text widget. # string - The string to search for. The search is done using # exact matching only; no special characters. # tag - Tag to apply to each instance of a matching string. proc textSearch {w string tag} { $w tag remove search 0.0 end if {$string == ""} { return } set cur 1.0 while 1 { set cur [$w search -count length -- $string $cur end] if {$cur == ""} { break } $w tag add $tag $cur "$cur + $length char" set cur [$w index "$cur + $length char"] } } # textToggle -- # This procedure is invoked repeatedly to invoke two commands at # periodic intervals. It normally reschedules itself after each # execution but if an error occurs (e.g. because the window was # deleted) then it doesn't reschedule itself. # # Arguments: # cmd1 - Command to execute when procedure is called. # sleep1 - Ms to sleep after executing cmd1 before executing cmd2. # cmd2 - Command to execute in the *next* invocation of this # procedure. # sleep2 - Ms to sleep after executing cmd2 before executing cmd1 again. proc textToggle {cmd1 sleep1 cmd2 sleep2} { catch { eval $cmd1 after $sleep1 [list textToggle $cmd2 $sleep2 $cmd1 $sleep1] } } staden-2.0.0b11-2016-src/tk_utils/tabnotebook.tcl0000644000031500020650000004374412707372072020045 0ustar jkbteam117## ## Copyright 1997-8 Jeffrey Hobbs, jeff at hobbs org, CADIX International ## #package require Widget 2.0 package provide Tabnotebook 2.0 ## FIX: ## option state of subitems could be kept in a clearer array ## -relief for .tab.hold should be flat initially ##------------------------------------------------------------------------ ## PROCEDURE ## tabnotebook ## ## DESCRIPTION ## Implements a Tabbed Notebook megawidget ## ## ARGUMENTS ## tabnote ## ## OPTIONS ## (Any entry widget option may be used in addition to these) ## ## -activebackground color DEFAULT: {} ## The background color given to the active tab. A value of {} ## means these items will pick up the widget's background color. ## ## -background color DEFAULT: DEFAULT ## The background color for the container subwidgets. ## ## -browsecmd script DEFAULT: {} ## A script that is evaluated each time a tab changes. It appends ## the old tab and the new tab to the script. An empty string ({}) ## represents the blank (empty) tab. This is eval'ed before the ## tab actually changes, allowing tab transitions to be aborted by ## returning an error value in this script. ## ## -disabledbackground color DEFAULT: #c0c0c0 (dark gray) ## The background color given to disabled tabs. ## ## -font DEFAULT: {Helvetica -12} ## The font for the tab text. All tabs use the same font. ## ## -justify justification DEFAULT: center ## The justification applied to the text in multi-line tabs. ## Must be one of: left, right, center. ## ## -linewidth pixels DEFAULT: 2 ## The width of the line surrounding the tabs. Must be at least 1. ## ## -linecolor color DEFAULT: black ## The color of the line surrounding the tabs. ## ## -normalbackground DEFAULT: {} ## The background color of items with normal state. A value of {} ## means these items will pick up the widget's background color. ## ## -padx pixels DEFAULT: 8 ## The X padding for folder tabs around the items. ## ## -pady pixels DEFAULT: 6 ## The Y padding for folder tabs around the items. ## ## RETURNS: the window pathname ## ## BINDINGS (in addition to default widget bindings) ## ## <1> in a tabs activates that tab. ## ## METHODS ## These are the methods that the Tabnote widget recognizes. Aside from ## these, it accepts methods that are valid for entry widgets. ## ## activate id ## Activates the tab specified by id. id may either by the unique id ## returned by the add command or the string used in the add command. ## ## add string ?options? ## Adds a tab to the tab notebook with the specified string, unless ## the string is the name of an image, in which case the image is used. ## Each string must be unique. See ITEM OPTIONS for the options. ## A unique tab id is returned. ## ## delete id ## Deletes the tab specified by id. id may either by the unique id ## returned by the add command or the string used in the add command. ## ## itemconfigure ?option? ?value option value ...? ## itemcget option ## Configure or retrieve the option of a tab notebook item. ## ## name tabId ## Returns the text name for a given tabId. ## ## subwidget widget ## Returns the true widget path of the specified widget. Valid ## widgets are hold (a frame), tabs (a canvas), blank (a frame). ## ## ITEM OPTIONS ## These are options for the items (tabs) of the notebook ## ## -window widget DEFAULT: {} ## Specifies the widget to show when the tab is pressed. It must be ## a child of the tab notebook (required for grid management) and exist ## prior to this command. ## ## -state normal|disabled|active DEFAULT: normal ## The optional state can be normal, active or disabled. ## If active, then this tab becomes the active (displayed) tab. ## ## NAMESPACE & STATE ## The megawidget creates a global array with the classname, and a ## global array which is the name of each megawidget is created. The latter ## array is deleted when the megawidget is destroyed. ## Public procs of $CLASSNAME and [string tolower $CLASSNAME] are used. ## Other procs that begin with $CLASSNAME are private. For each widget, ## commands named .$widgetname and $CLASSNAME$widgetname are created. ## ## EXAMPLE USAGE: ## ## pack [tabnotebook .t] -fill both -expand 1 ## text .t.t -height 10 -width 20 ## .t add "Text Widget" -window .t.t ##------------------------------------------------------------------------ # Create this to make sure there are registered in auto_mkindex # these must come before the [widget create ...] proc Tabnotebook args {} proc tabnotebook args {} widget create Tabnotebook -type frame -base frame -components { {frame hold hold {-relief raised -bd 1}} {frame blank} {frame hide hide {-background $data(-background) -height 1 -width 40}} {canvas tabs tabs {-bg $data(-background) -highlightthick 0 -takefocus 0}} } -options { {-activebackground activeBackground ActiveBackground {}} {-bg -background} {-background ALIAS frame -background} {-bd -borderwidth} {-borderwidth ALIAS frame -borderwidth} {-browsecmd browseCmd BrowseCommand {}} {-disabledbackground disabledBackground DisabledBackground #a3a3a3} {-normalbackground normalBackground normalBackground #c3c3c3} {-font font Font {Helvetica -12}} {-justify justify Justify center} {-minwidth minWidth Width -1} {-minheight minHeight Height -1} {-padx padX PadX 8} {-pady padY PadY 6} {-relief ALIAS frame -relief} {-linewidth lineWidth LineWidth 2} {-linecolor lineColor LineColor black} } namespace eval ::Widget::Tabnotebook {; ;proc construct {w} { upvar \#0 [namespace current]::$w data ## Private variables array set data { curtab {} numtabs 0 width 0 height 0 ids {} } $data(tabs) itemconfigure TEXT -font $data(-font) $data(tabs) yview moveto 0 $data(tabs) xview moveto 0 grid $data(tabs) -sticky ew grid $data(hold) -sticky news grid $data(blank) -in $data(hold) -row 0 -column 0 -sticky nsew grid columnconfig $w 0 -weight 1 grid rowconfigure $w 1 -weight 1 grid columnconfig $data(hold) 0 -weight 1 grid rowconfigure $data(hold) 0 -weight 1 bind $data(tabs) [namespace code \ "if {!\[string compare $data(tabs) %W\]} { resize [list $w] %w }"] bind $data(tabs) <2> { %W scan mark %x 0 } bind $data(tabs) [namespace code { %W scan dragto %x 0 resize [winfo parent %W] [winfo width %W] } ] } ;proc configure {w args} { upvar \#0 [namespace current]::$w data set truth {^(1|yes|true|on)$} set post {} foreach {key val} $args { switch -- $key { -activebackground { if {[string compare $data(curtab) {}]} { $data(tabs) itemconfig POLY:$data(curtab) -fill $val } if {[string compare $val {}]} { $data(hide) config -bg $val } else { lappend post \ [list $data(hide) config -bg $data(-background)] } } -background { $data(tabs) config -bg $val $data(hold) config -bg $val $data(blank) config -bg $val } -borderwidth { $data(hold) config -bd $val $data(hide) config -height $val } -disabledbackground { foreach i $data(ids) { if {[string match disabled $data(:$i:-state)]} { $data(tabs) itemconfig POLY:$i -fill $val } } } -font { $data(tabs) itemconfigure TEXT -font $val recalculate $w } -justify { $data(tabs) itemconfigure TEXT -justify $val } -linewidth { $data(tabs) itemconfigure LINE -width $val } -linecolor { $data(tabs) itemconfigure LINE -fill $val } -minwidth { if {$val < 0} { set val 0 } grid columnconfig $w 0 -minsize $val } -minheight { if {$val < 0} { set val 0 } grid rowconfigure $w 1 -minsize $val } -normalbackground { foreach i $data(ids) { if {[string match normal $data(:$i:-state)]} { $data(tabs) itemconfig POLY:$i -fill $val } } } -padx - -pady { if {$val < 1} { set val 1 } } -relief { $data(hold) config -relief $val } } set data($key) $val } if {[string compare $post {}]} { eval [join $post \n] } } ;proc _add { w text args } { upvar \#0 [namespace current]::$w data set c $data(tabs) if {[string match {} $text]} { return -code error "non-empty text required for noteboook label" } elseif {[string compare {} [$c find withtag ID:$text]]} { return -code error "tab \"$text\" already exists" } array set s { -window {} -state normal } foreach {key val} $args { switch -glob -- $key { -w* { if {[string compare $val {}]} { if {![winfo exist $val]} { return -code error "window \"$val\" does not exist" } elseif {[string comp $w [winfo parent $val]] && \ [string comp $data(hold) [winfo parent $val]]} { return -code error "window \"$val\" must be a\ child of the tab notebook ($w)" } } set s(-window) $val } -s* { if {![regexp {^(normal|disabled|active)$} $val]} { return -code error "unknown state \"$val\", must be:\ normal, disabled or active" } set s(-state) $val } default { return -code error "unknown option '$key', must be:\ [join [array names s] {, }]" } } } set tab [incr data(numtabs)] set px [expr {int(ceil($data(-padx)/2))}] set py [expr {int(ceil($data(-pady)/2))}] set py2 $data(-pady) if {[lsearch -exact [image names] $text] != -1} { set i [$c create image $px $py -image $text -anchor nw \ -tags [list IMG M:$tab ID:$text TAB:$tab]] } else { set i [$c create text [expr {$px+1}] $py2 -text " $text " -anchor nw \ -tags [list TEXT M:$tab ID:$text TAB:$tab] \ -justify $data(-justify) -font $data(-font)] } foreach {x1 y1 x2 y2} [$c bbox $i] { set W [expr {$x2-$x1+$px}] set FW [expr {$W+$px}] set FH [expr {$y2-$y1+3*$py}] } set diff [expr {$FH-$data(height)}] if {$diff > 0} { $c move all 0 $diff $c move $i 0 -$diff set data(height) $FH } $c create poly 0 $FH $px $py $W $py $FW $FH -fill {} \ -tags [list POLY POLY:$tab TAB:$tab] $c create line 0 $FH $px $py $W $py $FW $FH -joinstyle round \ -tags [list LINE LINE:$tab TAB:$tab] \ -width $data(-linewidth) -fill $data(-linecolor) $c move TAB:$tab $data(width) [expr {($diff<0)?-$diff:0}] $c raise $i $c raise LINE:$tab incr data(width) $FW $c configure -width $data(width) -height $data(height) \ -scrollregion "0 0 $data(width) $data(height)" $c bind TAB:$tab <1> [namespace code [list _activate $w $tab]] array set data [list :$tab:-window $s(-window) :$tab:-state $s(-state)] if {[string compare $s(-window) {}]} { grid $s(-window) -in $data(hold) -row 0 -column 0 -sticky nsew lower $s(-window) } switch $s(-state) { active {_activate $w $tab} disabled {$c itemconfig POLY:$tab -fill $data(-disabledbackground)} normal {$c itemconfig POLY:$tab -fill $data(-normalbackground)} } lappend data(ids) $tab return $tab } # Return current active tab ID as a numerical value, for compatibility with # Tk8.5 ttk::notebook widget. ;proc _select { w } { upvar \#0 [namespace current]::$w data return [expr {$data(curtab)-1}] } ;proc _activate { w id } { upvar \#0 [namespace current]::$w data if {[string compare $id {}]} { set tab [verify $w $id] if {[string match disabled $data(:$tab:-state)]} return } else { set tab {} } if {[string compare $data(-browsecmd) {}] && \ [catch {uplevel \#0 $data(-browsecmd) \ [list [_name $w $data(curtab)] [_name $w $tab]]}]} { return } if {[string match $data(curtab) $tab]} return set c $data(tabs) set oldtab $data(curtab) if {[string compare $oldtab {}]} { $c itemconfig POLY:$oldtab -fill $data(-normalbackground) $c move TAB:$oldtab 0 2 set data(:$oldtab:-state) normal } set data(curtab) $tab if {[string compare $tab {}]} { set data(:$tab:-state) active $c itemconfig POLY:$tab -fill $data(-activebackground) $c move TAB:$tab 0 -2 } if {[info exists data(:$tab:-window)] && \ [winfo exists $data(:$tab:-window)]} { raise $data(:$tab:-window) } else { raise $data(blank) } resize $w [winfo width $w] } ;proc _delete { w id } { upvar \#0 [namespace current]::$w data set tab [verify $w $id] set c $data(tabs) foreach {x1 y1 x2 y2} [$c bbox TAB:$tab] { set W [expr {$x2-$x1-3}] } $c delete TAB:$tab for { set i [expr {$tab+1}] } { $i <= $data(numtabs) } { incr i } { $c move TAB:$i -$W 0 } foreach {x1 y1 x2 y2} [$c bbox all] { set H [expr {$y2-$y1-3}] } if {$H<$data(height)} { $c move all 0 [expr {$H-$data(height)}] set data(height) $H } incr data(width) -$W $c config -width $data(width) -height $data(height) \ -scrollregion "0 0 $data(width) $data(height)" set i [lsearch $data(ids) $tab] set data(ids) [lreplace $data(ids) $i $i] catch {grid forget $data(:$tab:-window)} unset data(:$tab:-state) data(:$tab:-window) if {[string match $tab $data(curtab)]} { set data(curtab) {} raise $data(blank) } } ;proc _itemcget { w id key } { upvar \#0 [namespace current]::$w data set tab [verify $w $id] set opt [array names data :$tab:$key*] set len [llength $opt] if {$len == 1} { return $data($opt) } elseif {$len == 0} { set all [array names data :$tab:-*] foreach o $all { lappend opts [lindex [split $o :] end] } return -code error "unknown option \"$key\", must be one of:\ [join $opts {, }]" } else { foreach o $opt { lappend opts [lindex [split $o :] end] } return -code error "ambiguous option \"$key\", must be one of:\ [join $opts {, }]" } } ;proc _itemconfigure { w id args } { upvar \#0 [namespace current]::$w data set tab [verify $w $id] set len [llength $args] if {$len == 1} { return [uplevel 1 _itemcget $w $tab $args] } elseif {$len&1} { return -code error "uneven set of key/value pairs in \"$args\"" } if {[string match {} $args]} { set all [array names data :$tab:-*] foreach o $all { lappend res [lindex [split $o :] end] $data($o) } return $res } foreach {key val} $args { switch -glob -- $key { -w* { if {[string comp $val {}]} { if {![winfo exist $val]} { return -code error "window \"$val\" does not exist" } elseif {[string comp $w [winfo parent $val]] && \ [string comp $data(hold) [winfo parent $val]]} { return -code error "window \"$val\" must be a\ child of the tab notebook ($w)" } } set old $data(:$tab:-window) if {[winfo exists $old]} { grid forget $old } set data(:$tab:-window) $val if {[string comp $val {}]} { grid $val -in $data(hold) -row 0 -column 0 \ -sticky nsew lower $val } if {[string match active $data(:$tab:-state)]} { if {[string comp $val {}]} { raise $val } else { raise $data(blank) } } } -s* { if {![regexp {^(normal|disabled|active)$} $val]} { return -code error "unknown state \"$val\", must be:\ normal, disabled or active" } if {[string match $val $data(:$tab:-state)]} return set old $data(:$tab:-state) switch $val { active { set data(:$tab:-state) $val _activate $w $tab } disabled { if {[string match active $old]} { _activate $w {} } $data(tabs) itemconfig POLY:$tab \ -fill $data(-disabledbackground) set data(:$tab:-state) $val } normal { if {[string match active $old]} { _activate $w {} } $data(tabs) itemconfig POLY:$tab -fill {} set data(:$tab:-state) $val } } } default { return -code error "unknown option '$key', must be:\ [join [array names s] {, }]" } } } } ## given a tab number, return the text ;proc _name { w id } { upvar \#0 [namespace current]::$w data if {[string match {} $id]} return set text {} foreach item [$data(tabs) find withtag TAB:$id] { set tags [$data(tabs) gettags $item] if {[set i [lsearch -glob $tags {ID:*}]] != -1} { set text [string range [lindex $tags $i] 3 end] break } } return $text } #;proc _order {w args} { # upvar \#0 [namespace current]::$w data # # foreach i $data(ids) { # } #} ## Take all the tabs and reculate space requirements ;proc recalculate {w} { upvar \#0 [namespace current]::$w data set c $data(tabs) set px [expr {int(ceil($data(-padx)/2))}] set py [expr {int(ceil($data(-pady)/2))}] set data(width) 0 set data(height) 0 foreach i $data(ids) { $c coords M:$i [expr \ {[string match text [$c type M:$i]]?$px+1:$px}] $py foreach {x1 y1 x2 y2} [$c bbox M:$i] { set W [expr {$x2-$x1+$px}] set FW [expr {$W+$px}] set FH [expr {$y2-$y1+3*$py}] } set diff [expr {$FH-$data(height)}] if {$diff > 0} { $c move all 0 $diff $c move M:$i 0 -$diff set data(height) $FH } $c coords POLY:$i 0 $FH $px $py $W $py $FW $FH $c coords LINE:$i 0 $FH $px $py $W $py $FW $FH $c move TAB:$i $data(width) [expr {($diff<0)?-$diff:0}] incr data(width) $FW } $c configure -width $data(width) -height $data(height) \ -scrollregion "0 0 $data(width) $data(height)" } ;proc resize {w x} { upvar \#0 [namespace current]::$w data if {[string compare $data(curtab) {}]} { set x [expr {round(-[$data(tabs) canvasx 0])}] foreach {x1 y1 x2 y2} [$data(tabs) bbox TAB:$data(curtab)] { place $data(hide) -y [winfo y $data(hold)] -x [expr {$x1+$x+3}] $data(hide) config -width [expr {$x2-$x1-5}] } } else { place forget $data(hide) } } ;proc see {w id} { upvar \#0 [namespace current]::$w data set c $data(tabs) set box [$c bbox $id] if {[string match {} $box]} return foreach {x y x1 y1} $box {left right} [$c xview] \ {p q xmax ymax} [$c cget -scrollregion] { set xpos [expr {(($x1+$x)/2.0)/$xmax - ($right-$left)/2.0}] } $c xview moveto $xpos } ;proc verify { w id } { upvar \#0 [namespace current]::$w data set c $data(tabs) if {[string compare [set i [$c find withtag ID:$id]] {}]} { if {[regexp {TAB:([0-9]+)} [$c gettags [lindex $i 0]] junk id]} { return $id } } elseif {[string compare [$c find withtag TAB:$id] {}]} { return $id } return -code error "unrecognized tab \"$id\"" } }; #end of namespace ::Widget::Tabnotebook staden-2.0.0b11-2016-src/tk_utils/text_output.tcl0000644000031500020650000003735212707372072020140 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # # # Adds text output windows - called from CreateMain # proc XXConsole {} { set w .xxconsole toplevel $w wm title $w "Tcl console window" pack [text $w.t] -fill both -expand 1 $w.t insert end "% " bind $w.t { set __line [%W get "current linestart" "current lineend"] regsub "^%%\[ \n\]*" $__line {} __line %W insert end "\n" catch {uplevel #0 eval $__line} __result %W insert end "$__result\n" %W insert end "%% " } } proc tout_create_wins {f {width 81}} { global tk_utils_defs global $f.stdout.Scr $f.stderr.Scr $f.stdout.Redir $f.stderr.Redir \ $f.stderr.Bell # # The output window section # frame $f.stdout -bd 2 -relief raised frame $f.stderr -bd 2 -relief raised frame $f.stdout.bar frame $f.stderr.bar frame $f.stdout.x frame $f.stderr.x frame $f.stdout.x.padding frame $f.stderr.x.padding # The button bars label $f.stdout.bar.label -text "Output window:" label $f.stdout.bar.redirl -textvariable $f.stdout.Redir \ -fg blue label $f.stderr.bar.label -text "Error window:" label $f.stderr.bar.redirl -textvariable $f.stderr.Redir \ -fg blue xmenubutton $f.stdout.bar.redir -text "Redirect >>" \ -menu $f.stdout.bar.redir.m xmenubutton $f.stderr.bar.redir -text "Redirect >>" \ -menu $f.stderr.bar.redir.m menu $f.stdout.bar.redir.m -tearoff 0 $f.stdout.bar.redir.m add command -label "Open"\ -command "tout_redir_open $f.stdout.Redir stdout $f.stdout.bar.redir.m" $f.stdout.bar.redir.m add command -label "Close" -state disabled \ -command "tout_redir_close $f.stdout.Redir stdout $f.stdout.bar.redir.m" menu $f.stderr.bar.redir.m -tearoff 0 $f.stderr.bar.redir.m add command -label "Open" \ -command "tout_redir_open $f.stderr.Redir stderr $f.stderr.bar.redir.m" $f.stderr.bar.redir.m add command -label "Close" -state disabled \ -command "tout_redir_close $f.stderr.Redir stderr $f.stderr.bar.redir.m" button $f.stdout.bar.clear -text "Clear" \ -command "tout_clear $f.stdout.t" button $f.stderr.bar.clear -text "Clear" \ -command "tout_clear $f.stderr.t" checkbutton $f.stdout.bar.scroll -text "Scroll on output " \ -variable $f.stdout.Scr \ -command "tout_scroll stdout \[set $f.stdout.Scr\]" \ -bd 2 -relief raised -padx 4 checkbutton $f.stderr.bar.scroll -text "Scroll on output" \ -variable $f.stderr.Scr \ -command "tout_scroll stderr \[set $f.stderr.Scr\]" \ -bd 2 -relief raised -padx 4 button $f.stdout.bar.search -text "Search" \ -command "tout_search $f.stdout.t" button $f.stderr.bar.search -text "Search" \ -command "tout_search $f.stderr.t" checkbutton $f.stderr.bar.bell -text "Bell" \ -variable $f.stderr.Bell \ -command "error_bell \[set $f.stderr.Bell\]" \ -bd 2 -relief raised -padx 4 set $f.stdout.Scr [keylget tk_utils_defs OUTPUT_SCROLL] set $f.stderr.Scr [keylget tk_utils_defs OUTPUT_SCROLL] set $f.stderr.Bell [keylget tk_utils_defs ERROR_BELL] error_bell [set $f.stderr.Bell] tout_scroll stdout [set $f.stdout.Scr] tout_scroll stderr [set $f.stderr.Scr] # The text displays text $f.stdout.t -width $width -height 16 -wrap none \ -yscrollcommand "$f.stdout.y set" \ -xscrollcommand "$f.stdout.x.sb set" text $f.stderr.t -width $width -height 4 -wrap none \ -yscrollcommand "$f.stderr.y set" \ -xscrollcommand "$f.stderr.x.sb set" if {[winfo screenwidth $f] < 1024 || \ [winfo screenheight $f] < 768} { $f.stderr.t tag configure error -font title_font $f.stderr.t insert end \ "WARNING: This program operates best at resolutions of 1024x768\n\ and higher.\n" error } # The scrollbars scrollbar $f.stdout.y -orient vert -command "$f.stdout.t yview" scrollbar $f.stderr.y -orient vert -command "$f.stderr.t yview" scrollbar $f.stdout.x.sb -orient horiz -command "$f.stdout.t xview" scrollbar $f.stderr.x.sb -orient horiz -command "$f.stderr.t xview" # Packing pack $f.stdout -fill both -expand 1 pack $f.stderr -fill both pack $f.stdout.bar $f.stderr.bar -side top -fill x pack $f.stdout.bar.label $f.stdout.bar.redirl -side left -fill both pack $f.stderr.bar.label $f.stderr.bar.redirl -side left -fill both pack $f.stdout.bar.redir $f.stdout.bar.clear $f.stdout.bar.scroll $f.stdout.bar.search\ -side right -fill both pack $f.stderr.bar.redir $f.stderr.bar.clear $f.stderr.bar.scroll $f.stderr.bar.bell $f.stderr.bar.search\ -side right -fill both pack $f.stdout.x $f.stderr.x -side bottom -fill x pack $f.stdout.y $f.stderr.y -side right -fill y pack $f.stdout.t $f.stderr.t -fill both -expand 1 pack $f.stdout.x.sb $f.stderr.x.sb -side left -fill x -expand 1 pack $f.stdout.x.padding $f.stderr.x.padding -side right # Here come those padding hacks again... pack propagate $f.stdout.x.padding 0 pack propagate $f.stderr.x.padding 0 $f.stdout.x.padding configure -width 22 $f.stderr.x.padding configure -width 22 # update idletasks # $f.stdout.x.padding configure \ # -width [winfo width $f.stdout.y] \ # -height [winfo width $f.stdout.y] # $f.stderr.x.padding configure \ # -width [winfo width $f.stderr.y] \ # -height [winfo width $f.stderr.y] tout_init $f.stdout.t $f.stderr.t bind $f.stderr.t "console show" } proc tout_tag_params {w tag params} { global param_$tag set param_$tag $params } # # Adds a new header to the output window # proc tout_new_header {w tag name} { $w tag bind ${tag}_h <> "tout_popup $w $tag %X %Y" $w tag bind ${tag}_t <> "tout_popup $w $tag %X %Y" $w tag bind ${tag}_p <> "tout_popup $w $tag %X %Y" set bg [lindex [$w configure -bg] 4] $w tag configure ${tag}_h -background [tk::Darken $bg 80] $w tag configure ${tag}_p -background [tk::Darken $bg 60] -wrap word } # # Pops up a menu for the text output display # proc tout_popup {w tag X Y} { global tcl_platform .tout_popup if {[winfo exists $w.m]} {destroy $w.m} create_popup $w.m Commands if {![info exists .tout_popup]} { set ".tout_popup(Show input parameters)" 1 set ".tout_popup(Print)" 1 set ".tout_popup(Output to disk)" 1 set ".tout_popup(Output to list)" 1 set ".tout_popup(Output to command)" 1 } if {[info exists ".tout_popup(Show input parameters)"]} { $w.m add command -label "Show input parameters" \ -command "destroy $w.m; tout_in_params $w $tag" } if {$tcl_platform(platform) == "unix" && \ [info exists ".tout_popup(Print)"]} { $w.m add command -label "Print" \ -command "destroy $w.m; tout_print $w $tag" } if {[info exists ".tout_popup(Output to disk)"]} { $w.m add command -label "Output to disk" \ -command "destroy $w.m; tout_output_disk $w $tag" } if {[info exists ".tout_popup(Output to list)"]} { $w.m add command -label "Output to list" \ -command "destroy $w.m; tout_output_list $w $tag" } if {$tcl_platform(platform) == "unix" && \ [info exists ".tout_popup(Output to command)"]} { $w.m add command -label "Output to command" \ -command "destroy $w.m; tout_output_command $w $tag" } $w.m add separator $w.m add command -label "Remove" \ -command "destroy $w.m; tout_remove $w $tag" tk_popup $w.m [expr $X-20] [expr $Y-10] } # # Inserts input parameters associated with header # proc tout_in_params {w tag} { global param_$tag if {![info exists param_$tag]} { return } set end [lindex [$w tag ranges ${tag}_h] 1] #param_$tag is the the input parameter text with tag ${tag}_p $w insert $end [set param_$tag] ${tag}_p } # # Removes some text from the output display # proc tout_remove {w tag} { global param_$tag if {[set r [$w tag ranges ${tag}_h]] != ""} { eval $w delete $r } if {[set r [$w tag ranges ${tag}_t]] != ""} { eval $w delete $r } if {[set r [$w tag ranges ${tag}_p]] != ""} { eval $w delete $r } $w tag delete ${tag}_h $w tag delete ${tag}_t $w tag delete ${tag}_p if {[info exists param_$tag]} { unset param_$tag } } proc tout_output_checks { t } { global tk_utils_defs $t.b1 $t.b2 $t.b3 frame $t set b1 [keylget tk_utils_defs TEXT_OUTPUT.OUTPUT.1.NAME] set b2 [keylget tk_utils_defs TEXT_OUTPUT.OUTPUT.2.NAME] set b3 [keylget tk_utils_defs TEXT_OUTPUT.OUTPUT.3.NAME] set $t.b1 [keylget tk_utils_defs TEXT_OUTPUT.OUTPUT.1.VALUE] set $t.b2 [keylget tk_utils_defs TEXT_OUTPUT.OUTPUT.2.VALUE] set $t.b3 [keylget tk_utils_defs TEXT_OUTPUT.OUTPUT.3.VALUE] checkbutton $t.b1 -text $b1 -variable $t.b1 checkbutton $t.b2 -text $b2 -variable $t.b2 checkbutton $t.b3 -text $b3 -variable $t.b3 pack $t.b1 $t.b2 $t.b3 -anchor w } proc tout_output_get_checks {w t tag output } { global $t.Header $t.Params $t.Text global $output.b1 $output.b2 $output.b3 set $t.Header "" set $t.Params "" set $t.Text "" if {[set $output.b1]} { if {[set r [$w tag ranges ${tag}_h]] != ""} { set $t.Header [eval $w get $r] } } if {[set $output.b2]} { if {[set r [$w tag ranges ${tag}_p]] != ""} { set $t.Params [eval $w get $r] } } if {[set $output.b3]} { if {[set r [$w tag ranges ${tag}_t]] != ""} { set $t.Text [eval $w get $r] } } } # # Prints a section of output # proc tout_print {w tag} { global tk_utils_defs set t [keylget tk_utils_defs TEXT_OUTPUT.WIN] xtoplevel $t -resizable 0 wm title $t "Print" tout_output_checks $t.output okcancelhelp $t.ok \ -ok_command "tout_print2 $w $t $tag $t.output" \ -cancel_command "destroy $t" \ -help_command "show_help interface {UI-Output}"\ -bd 2 -relief groove pack $t.output $t.ok -side top -fill x } proc tout_print2 {w t tag output} { global $t.Header $t.Params $t.Text tk_utils_defs tout_output_get_checks $w $t $tag $output if {[catch {set f [open "|[keylget tk_utils_defs PRINT_COMMAND]" w]}]} { destroy $t bell return } puts $f "[set $t.Header][set $t.Params][set $t.Text]" close $f destroy $t } # # Outputs a section to disk # proc tout_output_disk {w tag} { global tk_utils_defs set t [keylget tk_utils_defs TEXT_OUTPUT.WIN] xtoplevel $t -resizable 0 wm title $t "Output to disk" getFname $t.list [keylget tk_utils_defs TEXT_OUTPUT.FILENAME] save tout_output_checks $t.output okcancelhelp $t.ok \ -ok_command "tout_output_disk2 $t $w $tag $t.output $t.list.entry" \ -cancel_command "destroy $t" \ -help_command "show_help interface {UI-Output}"\ -bd 2 -relief groove pack $t.list $t.output $t.ok -side top -fill x } proc tout_output_disk2 {t w tag output entryw} { global $t.Header $t.Params $t.Text if {[set name [entrybox_get $entryw]] == ""} { return } tout_output_get_checks $w $t $tag $output if {![string match file* [set f [open $name w]]]} { bell return } destroy $t puts $f "[set $t.Header][set $t.Params][set $t.Text]" close $f unset $t.Header $t.Params $t.Text } # # Outputs a section to list # proc tout_output_list {w tag} { global tk_utils_defs set t [keylget tk_utils_defs TEXT_OUTPUT.WIN] xtoplevel $t -resizable 0 wm title $t "Output to list" getLname $t.list [keylget tk_utils_defs TEXT_OUTPUT.LISTNAME] create tout_output_checks $t.output okcancelhelp $t.ok \ -ok_command "tout_output_list2 $w $t $tag $t.list.entry $t.output" \ -cancel_command "destroy $t" \ -help_command "show_help interface {UI-Output}"\ -bd 2 -relief groove pack $t.list $t.output $t.ok -side top -fill x } proc tout_output_list2 {w t tag namew output} { global $t.Header $t.Params $t.Text if {[set name [entrybox_get $namew]] == ""} { tk_messageBox -icon error -type ok -title "No list" \ -message "No list name has been entered" return } tout_output_get_checks $w $t $tag $output if [ListCreate $name [StringToList "[set $t.Header][set $t.Params][set $t.Text]"]] { destroy $t unset $t.Header $t.Params $t.Text ListEdit $name } } proc tout_search_OK_Pressed { text entry direction} { set dir [radiolist_get $direction] set string [entrybox_get $entry] textSearchPos $text $string search $dir } # # Searches for a string text display # proc tout_search {text} { set s $text.search if {[xtoplevel $s -resizable 0] == ""} { return } wm title $s "Search" entrybox $s.entry \ -title "Search string"\ -width 20 \ -type CheckString set b1 "forward" set b2 "backward" radiolist $s.direction \ -orient horizontal \ -default 1\ -buttons [format { \ { %s } \ { %s } } \ [list $b1] \ [list $b2] ] okcancelhelp $s.ok_cancel \ -ok_command "tout_search_OK_Pressed $text $s.entry $s.direction"\ -cancel_command "destroy $s"\ -help_command "show_help interface {UI-Output}"\ -bd 2 \ -relief groove pack $s.entry -fill both -expand 1 pack $s.direction -fill both -expand 1 pack $s.ok_cancel -fill both -expand 1 $text tag configure search -background #ffff00 } # # Clears the text display # proc tout_clear {text} { $text delete 1.0 end } # # Sets the "scroll to bottom upon text output" mode for this # proc tout_scroll {win_name value} { tout_set_scroll $win_name $value } # # Redirect all output to a specific file # proc tout_redir_open {label_var stream menu} { global tk_utils_defs set t [keylget tk_utils_defs TEXT_REDIR.WIN] xtoplevel $t -resizable 0 wm title $t "Open redirection file" getFname $t.file [keylget tk_utils_defs TEXT_REDIR.FILENAME] save okcancelhelp $t.ok \ -ok_command "tout_redir_open2 $t \[entrybox_get $t.file.entry\] \ $label_var $stream $menu" \ -cancel_command "destroy $t" \ -help_command "show_help interface {UI-Output}"\ -bd 2 -relief groove pack $t.file $t.ok -side top -fill x } proc tout_redir_open2 {t name label_var stream menu} { global $label_var if {[tout_set_redir $stream $name]} { set $label_var [file tail $name] $menu entryconfigure 1 -state normal } else { bell } destroy $t } proc tout_redir_close {label_var stream menu} { global $label_var if {[tout_set_redir $stream ""]} { set $label_var "" $menu entryconfigure 1 -state disabled } else { bell } } # # Outputs to a command # proc tout_output_command {w tag} { global tk_utils_defs set t [keylget tk_utils_defs TEXT_OUTPUT.WIN] xtoplevel $t -resizable 0 wm title $t "Output to command" entrybox $t.command -title "Command" tout_output_checks $t.output okcancelhelp $t.ok \ -ok_command "tout_output_command2 $t $w $tag $t.output \[entrybox_get $t.command\]" \ -cancel_command "destroy $t" \ -help_command "show_help interface {UI-Output}"\ -bd 2 -relief groove pack $t.command $t.output $t.ok -side top -fill x } proc tout_output_command2 {t w tag output comm} { global $t.Header $t.Params $t.Text destroy $t tout_output_get_checks $w $t $tag $output tout_pipe $comm "[set $t.Header][set $t.Params][set $t.Text]" 0 unset $t.Header $t.Params $t.Text } # Configures which items appear in text-output popup menu. # # Commands is a Tcl list matching the command names listed in tout_popup. proc tout_config_popup {commands} { global .tout_popup catch {unset .tout_popup} foreach com $commands { set .tout_popup($com) 1 } } staden-2.0.0b11-2016-src/tk_utils/user_defaults.tcl0000644000031500020650000001663212707372072020377 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # source $env(STADTABL)/shlib.conf set defn "" set packages() "" set package_dir() "" # Load a package # tcldir is the directory containing the tcl sources to add to auto_path # libdir is the location of a dynamically loadable module to link with # name is the stub for the initialisation routine of libdir # The presence of urther 'args' implies to ignore errors when loading. proc load_package {tcldir {libdir {}} {name {}} {init {}}} { global packages package_dir env if {$libdir == {} && $name == {} && $init == {}} { simple_load_package $tcldir return } global auto_path lib_prefix lib_suffix packages env #puts "Loading package $name" if {[info exists packages($name)]} { if {$packages($name)==3} { return } } else { set packages($name) 0 } # Replace %L by $env(STADLIB), %S with src, %% with % regsub -all {%L} $tcldir $env(STADLIB) tcldir regsub -all {%L} $libdir $env(STADLIB) libdir regsub -all {%T} $tcldir $env(STADTCL) tcldir regsub -all {%T} $libdir $env(STADTCL) libdir regsub -all {%S} $tcldir $env(STADENROOT)/src tcldir regsub -all {%S} $libdir $env(STADENROOT)/src libdir regsub -all {%%} $tcldir %% tcldir regsub -all {%%} $libdir %% libdir set package_dir($name) $tcldir if {$tcldir != ""} { lappend auto_path $tcldir if {!($packages($name) & 1)} { set packages($name) [expr $packages($name) | 1] SetDefaults $env(STADTABL) ${name}rc ${name}_defs $tcldir/${name}rc # catch {eval ${name}_init} } } if {!($packages($name) & 2) && $libdir != "-"} { if {$libdir != ""} { set libdir "$libdir/" } if {[info exists env(STADEN_DEBUG)]} { puts -nonewline "load ${libdir}${lib_prefix}${name}${lib_suffix}" flush stdout } set err "" if {$init == 1} { if {[file exists ${libdir}${lib_prefix}${name}${lib_suffix}]} { load ${libdir}${lib_prefix}${name}${lib_suffix} $name } } else { if {[file exists ${libdir}${lib_prefix}${name}${lib_suffix}]} { catch {load ${libdir}${lib_prefix}${name}${lib_suffix}} err set err "($err)" } } if {[info exists env(STADEN_DEBUG)]} { puts " => $err" } global ${name}_defs if {[info exists ${name}_defs] && [set ${name}_defs] == "NULL"} { set ${name}_defs "" } set packages($name) [expr $packages($name) | 2] } # puts "Finished loading $name" } # # A simpler form of load_package; called when load_package is only given # one argument (the package name). # # We always load the rc file, which we assume to be called ${name}rc and # to be held within the $STADTABL directory. # # Tcl code is assumed to be within $STADLIB/name, unless a ${name}_tcldir # variable has previously been set. # # A dynamic library of (eg) $STADLIB/${lib_prefix}${name}${lib_suffix} is # loaded, if it exists. # proc simple_load_package {name} { global packages env ${name}_tcldir lib_prefix lib_suffix auto_path global package_dir tcl_platform tcl_version # puts "start simple_load_package $name" regsub -all {%L} $name $env(STADLIB) name regsub -all {%T} $name $env(STADTCL) name regsub -all {%S} $name $env(STADENROOT)/src name regsub -all {%%} $name %% name if {[file pathtype $name] != "relative"} { set dir [file dirname $name] set name [file tail $name] set tdir $dir set ldir $dir set adir $dir set bdir $ldir } else { set tdir $env(STADTABL) set ldir $env(STADLIB) set adir $env(STADTCL)/$name if {$tcl_platform(os) == "Darwin" || $tcl_version < "8.3"} { set bdir "$ldir" } else { set bdir "" } } set package_dir($name) $ldir lappend auto_path $adir if {![info exists packages($name)]} { set packages($name) 0 } if {!($packages($name) & 1)} { set packages($name) [expr $packages($name) | 1] SetDefaults $tdir ${name}rc ${name}_defs } if {$bdir != ""} { set bdir "$bdir/" } set fname $bdir${lib_prefix}${name}${lib_suffix} #read local libraries if {[info exists env(STADEN_LIB_PATH)]} { foreach path "$env(STADEN_LIB_PATH)" { set tmp_name $path/[file tail $fname] if {[file exists $tmp_name]} { set fname $tmp_name } } } if {!($packages($name) & 2)} { if {[info exists env(STADEN_DEBUG)]} { puts -nonewline "load $fname" flush stdout } set err "" if {($tcl_platform(os) == "Darwin" && [file exists $fname]) || \ $tcl_platform(os) != "Darwin"} { catch {load $fname} err } if {[info exists env(STADEN_DEBUG)]} { puts " => $err" } elseif {[regexp {.*[Uu]n(resolv|defin).*} $err]} { puts "load $fname => $err" } set packages($name) [expr $packages($name) | 2] global ${name}_defs if {[info exists ${name}_defs] && [set ${name}_defs] == "NULL"} { set ${name}_defs "" } } # puts "end simple_load_package $name" } proc set_defs {name} { global defn set defn $name } proc set_def {a1 a2} { global defn global $defn keylset $defn $a1 $a2 } proc set_defx {a1 a2 a3} { uplevel 1 global $a1\; keylset $a1 $a2 \"$a3\" } proc SetDefaults {dirname filename defname args} { # puts "setdefaults $defname start" global packages env $defname defn global normal_bg root_dir set normal_bg "#d9d9d9" set root_dir $dirname set tmp $defn set defn $defname global $defname if {![info exists $defname] || [set $defname] == "NULL"} { set $defname "" } if ![info exists packages] { set packages "" } # 11/1/99 johnt - convert WINNT \ to proper / regsub -all {\\} $env(HOME) / env(HOME) # We need to do this out of order. The sourcing of the rc file in STADTABL # is dependent on some user's values, so we parse their rc file first # to look for MENU_FILE lines. if {$filename != ""} { foreach i [list $env(HOME)/.$filename .$filename] { if {[file exists $i]} { set fd [open $i r] foreach line [split [read $fd] "\n"] { if {[regexp "^\[ \t\]*set_def\[ \t\]+MENU_FILE\[ \t\]+(\[^ \t\]+)" \ $line dummy level]} { keylset $defname MENU_FILE $level } } close $fd } } } # Load RC file if {$filename != ""} { foreach i [list $args $dirname/$filename $env(HOME)/.$filename .$filename] { if {$i != "" && [file exists $i]} { uplevel #0 [list source $i] } if {$i != "" && [file exists $i.local]} { uplevel #0 [list source $i.local] } } } set defn $tmp } proc LoadLibs {name} { global packages env set packages($name) 1 SetDefaults $env(STADTABL) ${name}rc ${name}_defs } proc load_menus {} { global defn root_dir licence global $defn regsub {_defs$} $defn {} tmp if {[catch {keylget $defn MENU_FILE}]} { switch $licence(type) { f {set_def MENU_FILE full} v {set_def MENU_FILE viewer} default {set_def MENU_FILE demo} } } set f $root_dir/${tmp}rc_menu_[keylget $defn MENU_FILE] if {[file exists $f]} { uplevel #0 [list source $f] } # set body [info body add_command] # append body { # global ${menu_name}_extras # keylset ${menu_name}_extras $n.C [list $onval $offval $name $comm] # } # proc add_command [info args add_command] $body } staden-2.0.0b11-2016-src/tk_utils/utils.tcl0000644000031500020650000002424412707372072016670 0ustar jkbteam117# # Copyright (c) Medical Research Council, Laboratory of Molecular Biology, # 1995. All rights reserved. # # This file is part of the Staden Package. See the Staden Package copyright # notice for information on the restrictions for usage and distribution, and # for a disclaimer of all warranties. # ############################################################################## # displays a stack dump for tcl proc stack_dump {} { puts "ERROR!!! - Tcl stackframe follows" for {set i [info level]} {$i > 0} {incr i -1} { puts "Level $i: [info level $i]" } } ############################################################################## # checks if an input is an integer proc isinteger { value } { return [regexp {^[+-]?[0-9]+$} $value] } ############################################################################## # checks if an input is an float proc isfloat { value } { return [regexp {^[+-]?[0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?$} $value] } ############################################################################## #Set busy mode proc InitBusy {main menu name} { global busy_main_path busy_menu_path busy_menu_name set busy_main_path $main set busy_menu_path $menu set busy_menu_name $name } proc SetBusy {} { global busy_main_path busy_menu_path busy_menu_name busy_menu_state set busy_menu_state [menu_state_save $busy_menu_path $busy_menu_name] menu_state_set $busy_menu_name -2 $busy_menu_path foreach win "[winfo children .]" { if {$win != "$busy_main_path"} { catch {$win configure -cursor watch} } } grab $busy_main_path } proc ClearBusy {} { global busy_main_path busy_menu_path busy_menu_name busy_menu_state menu_state_restore $busy_menu_path $busy_menu_name $busy_menu_state foreach win "[winfo children .]" { catch {$win configure -cursor top_left_arrow} } grab release $busy_main_path } ############################################################################## #Creates a popup menu proc create_popup {w title} { if {[winfo exists $w]} {destroy $w} menu $w -tearoff 0 -disabledforeground blue set bg [lindex [$w configure -bg] 4] $w add command -state disabled -label "$title" \ -background [tk::Darken $bg 80] \ -font menu_title_font return $w } ############################################################################## #two functions to set and get the "current frame" - useful for instances #when you have two frames and you wish to differentiate between them by, #say clicking in one proc SetCurFrame {s frame} { global $s.frame $s.frame_index set $s.frame_index 0 set $s.frame $frame } proc GetCurFrame {s} { global $s.frame $s.frame_index set f [lindex [set $s.frame] [set $s.frame_index]] incr $s.frame_index if {[set $s.frame_index] >= [llength [set $s.frame]]} { set $s.frame_index 0 } return $f } ############################################################################## #deletes a file with error checking proc DeleteFile { file } { catch {file delete $file} e if {$e != ""} { tk_messageBox -icon error -type ok -title "Delete file" \ -message $e } } ############################################################################## # Fixes the maximum size of a toplevel window to take into account screen # borders, such as the Windows task bar or a CDE desktop. proc fix_maxsize {w} { global tk_utils_defs set border_x [keylget tk_utils_defs X_BORDER_SIZE] set border_y [keylget tk_utils_defs Y_BORDER_SIZE] foreach {width height} [wm maxsize $w] {} if {$width > [winfo screenwidth .]} { set width [winfo screenwidth .] } if {$height > [winfo screenheight .]} { set height [winfo screenheight .] } incr width -$border_x incr height -$border_y wm maxsize $w $width $height } ############################################################################## # Fixes the maximum size of a toplevel window that contains a gridded text # window (so needs character coords) to take into account screen borders, # such as the Windows task bar or a CDE desktop. proc fix_maxsize_text {w font_width font_height extra_width extra_height} { global tk_utils_defs set border_x [keylget tk_utils_defs X_BORDER_SIZE] set border_y [keylget tk_utils_defs Y_BORDER_SIZE] set width [winfo screenwidth .] set height [winfo screenheight .] incr width -$border_x incr height -$border_y set width [expr ($width - $extra_width) / $font_width] set height [expr ($height - $extra_height) / $font_height] wm maxsize $w $width $height } # # Force window size using wm geometry. This is needed in addition to # fix_maxsize as on some window managers (AfterStep, MacOS X, etc) the # wm maxsize command is ignored. # proc fit_on_screen2 {w} { global tk_utils_defs puts fit_on_screen2 #10.10.02 (added but commented out - see fit_on_screen comment below) #wm geometry $w {} set border_x [keylget tk_utils_defs X_BORDER_SIZE] set border_y [keylget tk_utils_defs Y_BORDER_SIZE] foreach {width height} [wm maxsize $w] {} if {$width > [winfo screenwidth .]} { set width [winfo screenwidth .] } if {$height > [winfo screenheight .]} { set height [winfo screenheight .] } incr width -$border_x incr height -$border_y update idletasks set wid [lindex [split [wm geometry $w] x+] 0] set hei [lindex [split [wm geometry $w] x+] 1] if {$wid > $width} { set wid $width } if {$hei > $height} { set hei $height } wm geometry $w ${wid}x$hei } proc fit_on_screen {w} { # FIXME: MacOS X hack to deal with ignoring wm maxsize. This fixed # delay may still cause problems on slow macs, but this code will # be rewritten once the container class has been implemented. #after 1000 "catch {fit_on_screen2 $w}" #kfs/jkb 10.10.02 #fit_on_screen currently causes problems - especially the 1 second delay #which makes bringing up lots of plots at the same time (eg codon pref) #very slow. Also, if you bring up 2 comparison plots, separate them out #and then superimpose them again, the new plot does not shrink in size as #it should. Tried adding a wm geometry $w {} (see above) which solved this #problem but it also lost manual resizing information. #We think fit_on_screen's only purpose was to solve resizing issues on #on the mac, specifically, using wm geometry to force resizing windows #when they grow too large for the screen. Ideally wm maxsize will solve #this, but apparently not on all window managers. #Since we are about to upgrade the mac, we need to see if this is still #necessary. return } # # Implements a "do