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 <<select-drag>> 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 <os.h>
	  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 <staden_config.h> 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
	  "=<recno>" 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  <jkb@sanger.ac.uk>

	* Tagged rel-2-0-0-b4
	* Tagged gap5-1-2-6

2010-01-15  James Bonfield  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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 <unistd.h> so that R_OK is defined.

2009-12-04  James Bonfield  <jkb@sanger.ac.uk>

	* 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
	  <compression_method> 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* gap5/docs/TODO:

	* gap5/newgap5_cmds.c: Added export_tags C-to-Tcl binding

2009-10-26  James Bonfield  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* ac_stubs/ax_lib_iwidgets.m4: Added default install path as used
	  by Debian.

2009-10-16  James Bonfield  <jkb@sanger.ac.uk>

	* Tagged VERSION 2.0.0b2

2009-10-16  James Bonfield  <jkb@sanger.ac.uk>

        * 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  <jkb@sanger.ac.uk>

        * 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  <jkb@sanger.ac.uk>

        * 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  <jkb@sanger.ac.uk>

 	* Gap5 VERSION 1.2.4 *

2009-10-13  James Bonfield  <jkb@sanger.ac.uk>
	* 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  <jkb@sanger.ac.uk>

        * 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* gap5/tkEdNames.c: Fixed buffer overflow in the get_number
	  method. (Previously fixed for the tkEditor widget.)

2009-09-15  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/sam.c, tgap/tg_iface_g.c, tgap/tg_index.c,
	  tk_utils/tkTrace.c: Added more #include <staden_config.h>
	  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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* tgap/tg_iface_g.c: Removed debugging information.

2009-09-04  James Bonfield  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

 	* Gap5 VERSION 1.2.3 *

2009-08-07  James Bonfield  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* configure.in: typo fix

2009-07-31  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/tkEditor.c: Fixed a buffer overrun in the editor get_number
	  method.

2009-07-30  James Bonfield  <jkb@sanger.ac.uk>

	* tk_utils/help_choose.tcl, tk_utils/help_config: Fixed paths for
	  displaying help

2009-07-28  James Bonfield  <jkb@sanger.ac.uk>

	* 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-<version>, 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* vector_clip/vector_clip.c: Removed rotate_seq() and use the
	  identical copy in seq_utils.

2009-07-22  James Bonfield  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

 	* VERSION 1.2.2 *

2009-06-22  James Bonfield  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* VERSION 1.2.1 *
	
2009-06-15  James Bonfield  <jkb@sanger.ac.uk>

        * 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  <jkb@sanger.ac.uk>

        * 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  <jkb@sanger.ac.uk>

	* VERSION 1.2.0 *
	
2009-06-10  James Bonfield  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* gap5/libraries.tcl:
	(14:23:34) Improved the auto-scaling and added a simple key. 

2009-05-27  James Bonfield  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* VERSION 1.1.3.1 *

2009-05-15  James Bonfield  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* VERSION 1.1.3 *

2009-04-24  James Bonfield  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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 <ctype.h> 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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  <jkb@sanger.ac.uk>

	* 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 <<select>> binding so that clicking
	will position the editor cursor on the nearest sequence in X (and
	more importantly allows setting the editor cursor one past the end
	of a sequence). 

2009-04-09  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_register.c,
	* tgap/tg_register.h:
	(13:18:49) Fixed send_event when asking for a events to be sent to
	an entire contig. Maybe! 

	* gap5/tk-io-reg.c:
	(13:20:10) Fixed handling of REG_GENERIC events when acting via the
	tcl interface. 

	* gap5/tkEditor.c:
	(13:20:47) Added a contig_rec subcommand. 

	* gap5/contig_editor.tcl:
	(13:22:01) Overhaul of the undo/redo mechanism. There are still
	issues to tackle here when dealing with the join editor, but the
	basic editor(s) work.
	
	Improved handling of multiple editors on the same contig. The
	contig editor now registers and responds to basic events via the
	contig registration system, meaning it's moved closer to the
	original view,model,controller design. 

2009-04-08  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_contig.c:
	(15:46:43) Improved the compute_ypos function to always find the
	minimum Y rather than sometimes just the minimum recently used Y. 

	* gap5/contig_editor.tcl:
	(15:48:20) Updated the way the settings work in the join editor.
	I've removed the notion of the "current contig" (which was never
	updated anyway) and now options like cutoffs, quality and highlight
	disagreements automatically apply to both editors in the join
	editor. 

	* gap5/editor_view.c,
	* gap5/editor_view.h,
	* gap5/tkEdNames.c,
	* gap5/tkEditor.c:
	(15:52:48) The "pack sequences" display mode now behaves better. -
	The editing cursor, copy selection, scrollbars, etc now operate  
	correctly rather than counting in Y as if we had one line per  
	sequence. - The names panel switches to a small scaled
	representation of the	data visible in the editor panel. This
	still allows viewing of   mapping quality and the possibility of a
	right-click menu. Obviously   the names panel is optional too still
	in as far as it can be	 minimised.
	
	Minor (unfinished) support for the editor edit_annotation method.
	Currently this does nothing. 

2009-04-06  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/template_display.c,
	* tgap/tg_contig.c,
	* tgap/tg_contig.h:
	(14:05:17) Updated the tg_contig compute_ypos function to us the
	same tree based algorithm as used in the template display.
	
	There's still quite a bit of code duplication here, but where
	possible the data structures are shared. The duplication comes
	about because the data structures being sorted (range_t vs tline)
	differ. 

2009-04-03  James Bonfield  <jkb@sanger.ac.uk>

	* VERSION 1.1.2 *

2009-04-03  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/template_display.c:
	(11:26:38) Added a filter dialogue to allow the template display to
	be filtered by spanning, pair/single or mapping quality.
	
	Adjusted the Y-spread function to also take into account an index
	rather than purely X location. This means lines at the same X,Y
	coordinate can now be spread too, making duplicated templates
	easier to see.
	
	Fixed Y x-hair so that the reported position in the information bar
	is now the correct Y position. 

	* gap5/depth.tcl,
	* gap5/template_display.h:
	(11:26:39) Added a filter dialogue to allow the template display to
	be filtered by spanning, pair/single or mapping quality.
	
	Adjusted the Y-spread function to also take into account an index
	rather than purely X location. This means lines at the same X,Y
	coordinate can now be spread too, making duplicated templates
	easier to see.
	
	Fixed Y x-hair so that the reported position in the information bar
	is now the correct Y position. 

	* gap5/gap.tcl:
	(11:33:01) Bumped version to 1.1.2 

	* gap5/template_display.c:
	(13:53:44) Fixed the Y crosshair value when using
	separate-by-strands mode. 

	* gap5/template_display.c:
	(14:05:24) Minor tweaks of out by one errors in Y xhair value. 

2009-04-02  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/consen.tcl,
	* gap5/newgap5_cmds.c:
	(14:59:34) Sped up the consensus saving code substantially when
	many contigs are output due to an over-zelous addition to the map
	passed into string map; this ultimately made the code O(N^2) in
	speed.
	
	Added a new tcl_reformat_sequence command in C to convert binary
	quality to fastq and to perform line-wrapping. This works around
	locale issues and is faster to boot.
	
	Fixed a bug in calc_quality that wrote out one more base than
	desired. 

	* gap5/consensus.c:
	(15:09:09) Fixed the consensus generation functions when passed a
	sequence exactly 1 more than a multiple of 1024 long. Due to a < vs
	<= the last base was uninitialised. 

	* gap5/contig_editor.tcl:
	(15:11:10) Added clipboard copy for reading names, although at
	present without any highlighting. 

	* gap5/tkEdNames.c:
	(15:11:11) Added clipboard copy for reading names, although at
	present without any highlighting. 

	* gap5/editor_view.c:
	(15:12:35) Bug fixed copy(clipboard) of the consensus; it was out
	by one sometimes. 

	* gap5/list_proc.tcl:
	(15:12:52) Removal of debugging output. 

2009-03-31  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/maq.c:
	(16:28:19) minor grammar change 

	* gap5/contig_editor.tcl,
	* gap5/editor_view.c,
	* gap5/editor_view.h,
	* gap5/tkEditor.c:
	(16:29:54) Added selection (copy) handling for sequences and
	consensus. 

2009-03-27  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/hache_table.c:
	(12:46:05) Added a HacheTableLeakCheck() function for debugging.
	
	/*  * For debugging purposes only. This function severs all links
	to items  * with a reference count > 0. Obviously this breaks the
	HacheTable in  * various ways, but the purpose is that it should be
	immediately followed  * up by an exit() call and an analysis of
	memory leaks.  *  * In theory all items with a reference count > 0
	will have pointers to them  * in other pieces of code. If they do
	not then we know we leaked memory  * somewhere by virtue of
	incrementing the reference count and not  * decrementing it again
	before losing our pointer to the object.  */ 

	* tgap/maq.c:
	(12:47:12) Fixed a bug with the recent code to skip over unmapped
	sequences. This caused a memory. Also it was erroneously skipping
	over SW matches sequences too rather than only non-matched data,
	causing other memory wastage in the pair hash. 

	* tgap/tg_sequence.c:
	(12:47:40) Fixed an uninitialised memory access in
	sequence_index_update(). 

	* gap5/editor_view.c:
	(14:11:02) Fixed a bug with the display in the editor vanishing
	whenever the names panel is scrolled. 

2009-03-26  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/contig_selector.tcl:
	(11:16:16) Fixed searching of contig names via reading names. 

	* gap5/contig_id.tcl,
	* gap5/gap4_compat.tcl:
	(11:16:19) Fixed searching of contig names via reading names. 

	* tgap/tg_iface_g.c:
	(12:23:05) Reenabled the INDEX_NAMES code for using B+Trees on
	sequence names. Fixed a bug with the btree_del_cache code too. 

	* tgap/tg_index.c:
	(12:24:16) Changed the defaults for pair-linking (now on) and btree
	indexing (now off). Added -P and -t options too (already have -p
	and -T). The -p/-P is on/off for pairing and -t/-T is on/off for
	btree indexing.
	
	Program version now 0.14. 

	* tgap/g-struct.c,
	* tgap/tg_cache.c,
	* tgap/tg_iface_g.c,
	* tgap/tg_index.c:
	(17:12:21) Increased the size of the HacheTables by 4. This allows
	us to efficiently flush less often, which has a considerable impact
	on the performance of tg_index when using -t mode for building the
	name b+tree. 

	* tgap/maq.c,
	* tgap/maq.h:
	(17:17:51) Check the maq flags for NOMATCH and SW bits. When both
	set this implies that this sequence is not aligned, so we reject
	it.
	
	When NOMATCH only is set it implies only one end matched, which
	means we do not need to add this sequence name to the pair hash
	table.
	
	Also decreased the frequency of flushes. 

2009-03-25  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/contig_selector.tcl,
	* gap5/list_contigs.tcl:
	(10:25:23) Now list the number of sequences in a contig. 

	* tgap/tg_bin.c,
	* tgap/tg_iface_g.c,
	* tgap/tg_struct.h,
	* tgap/tg_tcl.c:
	(10:27:18) Added nseqs field to the bin structure and added an
	nseqs method to contig objects to return the number of sequences in
	the root bin. This is automatically kept up to date in
	bin_add_range() and bin_remove_item(), but I am unsure currently on
	the performance hit of this. 

	* tgap/tg_index.c:
	(12:40:52) Fixed the frequency of flushing (for .aln format) to be
	less frequent. I think I had accidentally pushed out a debugging
	version. 

	* tgap/hache_table.c,
	* tgap/hache_table.h,
	* tgap/tg_cache.c:
	(12:42:48) The hache table now maintains a linked list of objects
	with at least one reference count. This is useful when iterating
	through all referenced objects, such as in cache_flush().
	
	If we use a very large hache table (eg 3276800 instead of the
	current 32768) then the benchmarks showed that about 40% of cpu
	time was spent simply iterating through the hache table finding
	which items we need to flush. The impact is far less significant
	with smaller hache tables though. 

2009-03-23  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/editor_view.c:
	(16:05:46) Temporarily disabled the range caching code in
	edview_visible_items as it cannot detect when data is changed (eg
	inserting a base to the consensus => identical query range, but
	sequences maybe shifted within that range). 

	* gap5/depth.tcl:
	(16:09:19) The window title bar is now named after the contig being
	displayed. 

2009-03-20  James Bonfield  <jkb@sanger.ac.uk>

	* VERSION 1.1.1 *

2009-03-20  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/sam.c:
	(16:30:42) Removal of memory leaks. 

	* tgap/tg_index.c:
	(16:31:12) Update version to 0.13 

	* gap5/depth.tcl:
	(16:32:35) Small tweaks to make the depth plot work again (as I've
	been mainly focusing on the template display).
	
	Adjusted the default parameters for template display (scales,
	separate strands now off). 

	* gap5/gap_canvas_box.tcl:
	(16:33:35) Copied from gap4 and tweaked. Needed to support zooming
	in the contig selector. 

	* gap5/tclIndex:
	(16:33:57) *** empty log message *** 

	* gap5/template_display.c:
	(16:36:26) Total rewrite of the compute_ypos packing algorithm.
	This needs migrating back into tg_contig.c sometime. The new one
	uses a pair of splay trees and is massively faster than before.
	
	Adjusted the line width of reads when zoomed >= 150 in Y.
	
	Restructured the plotting function to be more distinct between
	querying, allocating Y and plotting. This is a precursor to caching
	of data (so we can scroll in Y faster) and better scrolling. 

	* gap5/template_display.h:
	(16:36:56) New "colours" (actually just GC line width change) for
	fwd/rev. 

2009-03-16  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/Makefile,
	* tgap/sam.c,
	* tgap/tg_index.c:
	(16:35:40) Added support for indexing bam format files (see
	samtools). 

2009-03-11  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_contig.c:
	(11:10:37) Experimented with different compute_ypos() functions.
	The new one I tried I ended up rejecting, but I doubled the speed
	of the existing implementation with a bit more optimisation. 

	* gap5/depth.tcl,
	* gap5/template_display.c,
	* gap5/template_display.h:
	(17:06:33) Added cross-hairs 

	* gap5/gap.tcl:
	(17:35:30) Version number update.
	
	Instead of Gap v5.x.x the program is now called gap5 and has
	version 1.x.x. Although a bit of a departure, it's more sane in
	that we regain control of the major version number again. 

	* gap5/ng_fb_cmds.tcl:
	(17:46:10) Removed the assumption of having a version code in
	database names. 

2009-03-10  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/depth.tcl,
	* gap5/template_display.c,
	* gap5/template_display.h:
	(12:35:18) Added a sequence depth and template depth line
	(optional). These need moving to their own raster or canvas, but
	for now they're functional rather than elegant.
	
	Fixed a bug with the xview coordinates. The raster plot was offset
	by the contig start coordinate, so if it didn't start at zero
	(clipped) it was shifted in X. 

2009-03-09  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/depth.tcl,
	* gap5/template_display.c,
	* gap5/template_display.h:
	(17:34:01) Ripped out the old canvas based template display code.
	
	Added an init method of plots (implemented for template display)
	and adjusted the layout slightly.
	
	Improved (but still not completely fixed) X and Y zooming of plots.
	
	Fixed template_display object "range" method call. It's now the
	same coordinates worked out during plotting.
	
	Added a (currently unused) xzoom mode to the template display
	window to mirror the (currently used) yzoom control. 

2009-03-05  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_contig.c:
	(16:59:09) Rewrote compute_ypos() to be faster. It's still not
	ideal though. I think it needs the combination of a linked list for
	fast resorting and an array for y scanning. 

	* gap5/depth.tcl,
	* gap5/template_display.c,
	* gap5/template_display.h:
	(17:01:21) Improvements to the template display:
	
	- background is now black so the reads are more vibrant and show up
	easier with low depth data.
	
	- Can separate out by template strand.
	
	- Additional yoffset control used as an offset to the computed Y.
	This allows bringing the two halves (when separated) closer or
	further apart. 

	* gap5/depth.tcl,
	* gap5/template_display.c,
	* gap5/template_display.h:
	(17:45:41) Added a control to filter out single ended data. 

2009-02-27  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/maq.c:
	(14:01:49) Added code to read the newer maq-long format. This can
	be forced using tg_index -M, or is automatically attempted if maq
	-m fails. 

	* tgap/maq.h,
	* tgap/maqmap.c,
	* tgap/maqmap.h,
	* tgap/tg_index.c:
	(14:01:51) Added code to read the newer maq-long format. This can
	be forced using tg_index -M, or is automatically attempted if maq
	-m fails. 

2009-02-26  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/template_display.c,
	* gap5/template_display.h:
	(12:13:29) Added a red colour for templates that have read-pairs in
	inconsistent orientations. 

2009-02-25  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_iface_g.c:
	(12:41:17) Check for errors in opening DB 

	* tgap/tg_bin.c,
	* tgap/tg_register.c,
	* tgap/tg_sequence.c,
	* tgap/tg_sequence.h,
	* tgap/tg_tcl.c,
	* tgap/tg_view.c:
	(12:43:05) Added an end return value to sequence_get_position(), in
	addition to the start. This means we can query the extents of a
	read rather than just one end. Most calls to this just have an
	extra NULL inserted to adhere to the new API. 

	* tgap/tg_contig.c,
	* tgap/tg_struct.h:
	(12:44:11) The rangec_t struct now has a pair_ind element. This is
	normally -1, but is set to the index in the array index of the data
	returned by contig_seqs_in_range() if the pair is also in this
	array.
	
	This can be used to avoid iterating through templates twice. 

	* gap5/Makefile:
	(13:59:35) Added template_display.o 

	* gap5/editor_view.c:
	(14:00:46) Changes to sequence_get_position API. 

	* gap5/gap.tcl:
	(14:01:09) Better error checking when given invalid DB to open. 

	* gap5/gap4_compat.c:
	(14:01:29) Changes due to sequence_get_position API change. 

	* gap5/newgap5_cmds.c:
	(14:02:27) Added call to TDisp_Init to register template display
	additions. 

	* gap5/qualIO.c:
	(14:02:46) Changes due to sequence_get_position API change. 

	* gap5/tman_interface.c:
	(14:03:10) Changes due to sequence_get_position API change. 

	* gap5/contig_editor.tcl:
	(14:04:01) Missing bracket? How did it work before. 

	* gap5/depth.tcl:
	(14:04:53) Major overhaul to use raster widget instead and the new
	template_display.c C code. The old canvas widget code is still
	there intact, albeit not reachable right now.
	
	This still needs a big tidyup. 

	* gap5/depth.tcl:
	(15:30:13) Allow for the old canvas based template display to still
	be viewed, so we can do mouse-overs etc. This is a temporary hack
	to get a usable interface, but ultimately I'll probably end up
	rewriting the raster method to be a canvas object so it can be
	combined with canvas overlays and fits in with the rest of the
	window. 

2009-02-19  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/depth.tcl:
	(14:57:13) Improved ways to colour and allocate Y positions to
	sequences 

2009-02-16  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/editor_view.c:
	(16:59:13) The contig editor information line now shows data on
	read-pairs if the read is paired. 

	* gap5/depth.tcl:
	(16:59:56) Added an option to colour the template by mapping
	quality. In this mode it doesn't draw the reads for paired data so
	the template is more visible. 

	* tgap/baf.c,
	* tgap/maq.c,
	* tgap/tg_contig.c,
	* tgap/tg_index.c,
	* tgap/tg_struct.h,
	* tgap/tg_tcl.c:
	(17:01:24) Added mapping quality and paired mapping quality values
	to the bin GRange structure.
	
	These are still in the seq_t struct too, but they've been
	duplicated here in order to allow graphical plots fast access to
	the summary data for viewing by quality. 

	* tgap/tg_index.c,
	* tgap/tg_view.c:
	(17:02:44) Bumped versions to 0.12 

	* gap5/gap.tcl:
	(17:02:51) Bumped version to 5.0.2 

2009-02-13  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_bin.c:
	(16:21:07) Initialise bin.anno to NULL on bin creation 

	* tgap/tg_contig.c:
	(16:24:23) Fixed bug in contig_insert_base (introduced when the
	break statement was commented out). It now shifts all bins
	appropriately again.
	
	Added a job command to contig_seqs_in_range. This allows for
	allocation of Y position (1 per line or several per line) and
	sorting by X or X&Y. 

	* tgap/tg_contig.h:
	(16:24:29) Added a job command to contig_seqs_in_range. This allows
	for allocation of Y position (1 per line or several per line) and
	sorting by X or X&Y. 

	* tgap/tg_struct.h:
	(16:24:56) Added y value to rangec_t, to facilitate Y ordering. 

	* tgap/tg_tcl.c:
	(16:25:22) Added a get_mapping_qual subcommand for sequence
	objects. 

	* tgap/tg_tracks.c,
	* tgap/tg_view.c:
	(16:26:16) Modified to support new option to
	contig_seqs_in_range(). 

	* gap5/consensus.c:
	(16:31:47) Updated calls to contig_seqs_in_range due to argument
	changes. 

	* gap5/read_depth.c,
	* gap5/tkEdNames.c:
	(16:31:48) Updated calls to contig_seqs_in_range due to argument
	changes. 

	* gap5/contig_editor.tcl:
	(16:32:59) Added GUI options for packing multiple sequences per
	line. 

	* gap5/depth.tcl:
	(16:34:08) Implemented a template Y allocation system similar to
	Magnus Manske's plots, where the Y position is based on the size of
	insert.
	
	Added some rudimentary GUI controls for this too. 

	* gap5/editor_view.c,
	* gap5/editor_view.h:
	(16:36:06) We now cache the last read rangec_t structs from
	contig_seqs_in_range rather than requerying every time the cursor
	moves.
	
	Implemented a rough draft of stacking multiple sequences per line.
	For now this only works for display and the cursor coordinates do
	not function correctly. It also needs the names display removing
	too to be sensible. 

	* gap5/tkEditor.c:
	(16:36:50) Added -stripe_mode and -stack_mode options. (For use in
	the experimental multiple sequences per line mode.) 

	* gap5/tkEditor.h:
	(16:36:51) Added -stripe_mode and -stack_mode options. (For use in
	the experimental multiple sequences per line mode.) 

2009-02-12  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_iface_g.c:
	(12:14:56) Fixed memory corruption in io_contig_read 

2009-02-10  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/maq.c:
	(15:19:51) Minor speed ups 

	* tgap/tg_sequence.c:
	(15:20:47) Sped up sequence_index_update() 

	* tgap/tg_iface_g.c,
	* tgap/tg_struct.h:
	(15:21:46) Minor tweaks for adding annotations - not yet
	implemented though. 

2009-02-09  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/Makefile:
	(14:16:16) Removed -DVALGRIND, which massively slows down
	heap_allocate 

	* tgap/g-alloc.c,
	* tgap/g-alloc.h:
	(16:26:03) Added tracking of the maximum size of object in a pool
	and also when all pools between X and Y are empty we jump straight
	to pool Y if we previously tried to allocate from X and ended up in
	Y. This caching is governed by next_free_pool, next_free_time and
	timer, with the latter two jointly implementing a means to
	invalidate the cache. 

	* tgap/g-alloc.c:
	(16:35:43) I had accidentally left heap_alloc in debug mode where
	it scanned from the first pool instead of the predicted pool in
	order to verify predictions. 

2009-02-06  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/depth.tcl:
	(16:05:25) Improved display of inconsistent templates, so reads and
	templates show up differently (may need to fix colours!).
	
	Fixed a bug with ordering of elements in lines sometimes giving tcl
	errors. 

	* tgap/maq.c:
	(16:06:03) Fixed parsing of read names when they have /1 and /2. We
	now also treat these as read pairs, and furthermore we set the
	actual end. 

	* tgap/tg_contig.c,
	* tgap/tg_tcl.c:
	(16:07:23) Added extra flags to handle knowing the template end. 

	* tgap/tg_cache.c,
	* tgap/tg_iface_g.c,
	* tgap/tg_sequence.c,
	* tgap/tg_struct.h:
	(16:08:28) Added room for sequence annotations. The structs exist,
	but no I/O to create, read or write is present yet. However this
	means the sequence format shouldn't need to change when they do get
	added. 

2009-02-05  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_view.c:
	(10:03:35) Minor prototype fixes 

	* tgap/g-request.c:
	(10:04:42) removed unused variable 

	* tgap/hache_table.c,
	* tgap/hache_table.h:
	(10:06:22) Added protection against HacheItems being passed into
	the wrong HacheTable (as this happened in practice due to a bug).
	
	Added a new debug function: HacheTableRefInfo. This lists the
	number of cached items separated by reference count. 

	* tgap/maqmap.c:
	(10:07:14) Support for maq files with no reference sequence; minor
	allocation change 

	* tgap/tg_bin.c,
	* tgap/tg_bin.h:
	(10:08:44) Enabled the bin-prediction code in bin_for_range. Also
	some small tidy-ups regarding reference counts.
	
	Moved RD_ELEMENTS macro to tg_bin.h so it can be used elsewhere. 

	* tgap/tg_cache.c:
	(10:10:13) Fixed a bug when working with derived GapIOs. We were
	often returning a HacheItem from the base GapIO, but then
	incrementing the reference count in the derived GapIO. We always
	use the same one now (plus HacheTable checks for consistency of
	such things too to spot similar bugs). 

	* tgap/tg_contig.c,
	* tgap/tg_iface_g.c,
	* tgap/tg_sequence.c,
	* tgap/tg_sequence.h,
	* tgap/tg_struct.h:
	(10:17:21) Changed the format of the on-disc GT_Seq, GT_Bin and
	GT_Range structures. NB: *INCOMPATIBLE* file format with previous
	release.
	
	Sequences no longer hold their paired sequence record directly in
	the sequence struct. Instead it's in the bin range array. To
	facilitate fast lookup the sequence holds the index in the bin
	range array referring back to that sequence.
	
	This allowed a change to how the pairing is computed too. In
	contigs_seqs_in_range we hash on record number and so link each
	sequence directly to its pair. This means that we don't need to
	load any sequence structs at all when plotting graphical displays
	like the template display, except for the rair cases at the edge of
	the window being plotted. (The I/O improvement in number of seeks
	and reads is somtimes a 10 fold drop.)
	
	New function sequence_get_pair() hides away the logic to compute
	the other end of a sequence pair. 

	* tgap/tg_tcl.c:
	(10:18:49) Updates for the contig interface: new dump_ps command;
	the sequences in range command now returns more data, related to
	the pairing. 

	* tgap/Makefile,
	* tgap/baf.c,
	* tgap/maq.c,
	* tgap/tg_index.c:
	(10:19:38) Updated maq, baf and plain .aln format parsers to cope
	with the new sequence and bin/range structures.
	
	NOTE: for now the ace format code has been disabled until it is
	rewritten to support the new structs. 

	* gap5/depth.tcl:
	(10:21:44) Changes to the template display following the sequence
	and bin/range structure changes.
	
	We now have an accurate and approximate mode. Both need MUCH less
	I/O than before, but approximate mode saves further I/O by not
	bothering to work out whether the other end of a template, which is
	not observed on screen, is in this contig and if so whether it is
	to the right or left of the sequence we did observe. 

	* gap5/editor_view.c:
	(10:22:13) Changed edGetTemplateReads to use the new
	sequence_get_pair function. 

	* gap5/break_contig.c,
	* gap5/break_contig.h,
	* gap5/editor_join.c:
	(10:29:57) Split break_contig into its own, more appropriately
	named, file. 

	* gap5/Makefile:
	(10:30:32) Added break_contig.o 

	* gap5/newgap5_cmds.c,
	* gap5/read_depth.h:
	(10:31:03) Minor warning fixes for undefined vars, prototypes, etc. 

	* tgap/tg_contig.c:
	(17:21:27) Removal of excessive debugging output 

	* gap5/break_contig.c,
	* tgap/tg_bin.c,
	* tgap/tg_bin.h,
	* tgap/tg_iface_g.c,
	* tgap/tg_struct.h:
	(17:22:38) Added a bin_invalidate_track() function.
	
	In the course of this discovered and fixed a bug where the track
	valid flag was not being set or checked for correctly. 

2009-01-28  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/contig_id.tcl,
	* gap5/contig_selector.tcl,
	* gap5/gap4_compat.tcl:
	(11:19:08) Improvements to contig_id handling. We now accept contig
	name, #seq_num and =contig_num. TODO: support reading name too for
	when contig name fails. 

	* tgap/tg_gio.c:
	(11:28:49) Protect against no contig_order array in
	gio_read_contig. 

	* tgap/tg_bin.c:
	(12:41:44) Added (currently commented out) bin-estimation code in
	bin_for_range. It's disabled as I'm not 100% sure it's infalible
	and it didn't gain as much speed as I hoped. Possibly room for
	future work though. 

	* gap5/gap.tcl:
	(12:42:12) Bumped version to 5.0.2 

2009-01-27  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/editor_join.c:
	(17:12:22) An incomplete update to join contigs (#if-ed out for
	now) to determine the optimal bin to reparent, rather than always
	duplicating the root node. This will reduce average depth when
	making small containment joins. 

2009-01-26  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/editor_join.c:
	(10:29:52) Improved break contig: It no longer creates new blank
	bins for the right hand contig when they are unnecessary. 

	* gap5/editor_join.c:
	(16:05:59) More break contig tweaks. We now remove redundant bins
	from both left and right contig after breaking. 

2009-01-23  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_contig.c,
	* tgap/tg_contig.h,
	* tgap/tg_tcl.c:
	(12:04:29) Added a postscript contig output function. It doesn't
	auto-scale yet, but that's relatively straight forward to manually
	edit in the ps file afterwards. 

	* gap5/editor_join.c:
	(12:05:08) Bug fixes for break contig. 

2009-01-08  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/editor_join.c:
	(14:05:48) Bug fix in break_contig_reparent_seqs: we no longer die
	when finding a bin with no Range data. 

	* gap5/gap_hash.c:
	(14:06:29) Protect against a match in find repeats extending 1 past
	the end of the sequence. I'm not sure why this occurs, but at least
	we handle the problem gracefully now. 

	* gap5/tk-io-reg.c:
	(14:07:18) Removed a heinous programming crime of returning the
	address of a local variable.
	
	This fixed the crosshairs in the contig selector/comparator window. 

	* tgap/tg_register.c,
	* tgap/tg_register.h:
	(14:09:02) Added reference counts and an inactive flag to the
	contig registration scheme. This allows us to protect against
	sending a notification which may cause the list of registered items
	to change, making it complex to iterate through all items to
	notify.
	
	Also implemented broadcasting (sending to all contigs) correctly. 

	* gap5/contig_editor.tcl:
	(14:22:05) Added temporary fix to shut down the contig selector
	when making a join. It's not what I want to do, but it works around
	the bug (and crash) that I'm not yet sending the appropriate
	notifications to force the plots to update upon a join.
	
	Will revert this when that code is in place. 

	* gap5/contig_editor.tcl:
	(14:32:11) Fixed the window title to display the contig name(s). 

	* gap5/editor_join.c:
	(14:32:44) When splitting contigs we now name the newly produce
	right-hand side contig with a derived name (#1, #2, etc). 

	* gap5/contig_id.tcl,
	* gap5/contig_selector.tcl:
	(14:50:26) Improvements to the contig selector / id UI components.
	We still need more work here to support #read_num and =contig_num,
	but for that to work we need a way of validating them first. 

2009-01-07  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/Makefile:
	(11:25:32) Added an install target 

	* tgap/gap_cli_arg.c:
	(11:26:23) Better error handling and added code to cope for when
	Tcl conversion from string fails for some reason (unknown why). 

	* gap5/Makefile:
	(11:26:57) Huge tidyup - more Gap5 now than a hacked gap4 

	* gap5/consen.c,
	* gap5/consen.h,
	* gap5/fij.c,
	* gap5/find_repeats.c:
	(11:30:54) make_consensus() now allocates memory for the consensus
	itself, rather than relying on something passed in. This removes
	the need to use a max_consensus parameter. 

	* gap5/contig_editor.tcl:
	(11:31:23) Now shutdowns the editor windows after a join. 

	* gap5/contig_selector.tcl:
	(11:31:56) Bug fixes to zooming and scrolling. 

	* gap5/editor_join.c,
	* gap5/newgap5_cmds.c,
	* gap5/newgap_structs.h:
	(11:32:58) Added first draft of the Break Contig function. 

	* gap5/tk-io-reg.c:
	(11:33:42) Fixed parsing in the reg_init_args function. This fix is
	part of the contig selector zooming/scrolling bug fixes. 

	* gap5/list_contigs.tcl:
	(11:34:05) *** empty log message *** 

	* gap5/list_proc.tcl:
	(11:34:24) gap_defs vs gap5_defs changes 

	* gap5/tclIndex:
	(11:34:43) Added result_manager.tcl 

	* gap5/editor_view.c:
	(12:27:24) Make sure we always set xx->link->lockOffset in
	set_displayPos for a join editor, even if lock is turned off.
	
	This fixes a bug in the join editor where turning off lock,
	scrolling, not hitting "align" and then hitting "join" will result
	in the incorrect join as it uses the starting lock offset instead
	of the current visible one. 

	* gap5/editor_view.c:
	(15:15:31) Better error checking in the status line updates. 

	* gap5/editor_join.c:
	(15:16:19) Fixed break contig: when sequences were moved from one
	bin to another bin I forgot to edit the sequence itself to relink
	the bin pointer to the new parent. 

2008-12-09  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/contig_selector.tcl,
	* gap5/tclIndex:
	(12:48:23) Moved GetItemInfo from template_display.tcl (not used)
	to here. 

	* gap5/depth.tcl:
	(12:49:13) Split the GUI dialogue into separate template displays
	and reading depth plots. 

	* gap5/gap_utils.tcl:
	(12:49:42) New utility function "counter". Used for generating
	unique window names. 

2008-12-03  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/consensus.c,
	* gap5/contig_editor.tcl,
	* gap5/editor_view.c,
	* tgap/tg_contig.c,
	* tgap/tg_sequence.c,
	* tgap/tg_sequence.h,
	* tgap/tg_tcl.c:
	(12:08:05) Modified the sequence_*_base() functions to take an
	extra argument named contig_orient. This controls whether we wish
	to make this change in the orientation that the sequence resides
	within the contig (requiring a bin traversal) or whether we already
	know and have taken that into account (such as from a former
	contig_seqs_in_range query).
	
	This allowed for multiple bug fixes relating to insertion/deletion
	of bases in the contig editor both within sequences and the
	consensus. 

	* gap5/editor_view.c:
	(12:22:03) Fixed '%b' brief format (base call). 

2008-12-02  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/g-request.c:
	(10:27:41) Initialise new index records to G_INDEX_NEW instead of
	zero. I don't think this affects anything though.
	
	Removed dead code from g_unlock_views. The heap_free call is
	already performed in update_record and so never actually got called
	in unlock_views.
	
	Tidied up some of the reading and writing argument checking steps
	to permit len==0 now. The logic of this is that it's easier to
	allocate and write a zero length block (for say X*Ncontigs when
	initialising the contig order array) than to check for the special
	case of zero length. 

	* tgap/tg_bin.h:
	(10:29:04) Increased the minimum bin size to 1024. 

	* tgap/tg_iface_g.c:
	(10:33:25) Improved error handling. "g" functions typically return
	positive error codes, so we now check these and turn into -1 rather
	than passing through verbatim and being missed.
	
	Fixed minor memory leak in io_database_create_files().
	
	Added io_database_lock and io_database_unlock functions. We use
	these to queue up writes in the g-* code and hence reduce the
	amount of aux file updating.
	
	Support for decoding zero-byte blocks in seq_decode() - ie it
	doesn't crash any more and instead initialises a blank seq_t struct
	for us. 

	* tgap/tg_sequence.c:
	(12:23:44) sequence_new_from() now performs the initialise steps
	itself as these have been removed from the low-level
	iface->seq.create call. This is to avoid initialising and flushing
	data until the proper cache_flush time, and in doing so removes
	unnecessary disk seeks.
	
	sequence_get_position has been updated to support complemented
	bins. It also has an extra argument to return whether the bin is
	effectively reverse-complemented in the contig as a whole.
	
	sequence_get_base and sequence_get_base4 now return data in the
	orientation of the seq_t struct rather than complementing
	themselves.
	
	sequence_replace_base now works with sequences in complemented
	contigs. 

	* tgap/tg_sequence.h:
	(12:24:00) sequence_get_position has been updated to support
	complemented bins. It also has an extra argument to return whether
	the bin is effectively reverse-complemented in the contig as a
	whole. 

	* tgap/tg_struct.h:
	(12:24:16) Added 'rec' to seq_t struct. 

	* tgap/tg_tcl.c:
	(12:25:06) "io num_contigs" command now returns the correct number
	of contigs rather than the maximum previous size of the
	contig_order array. 

	* tgap/tg_view.c:
	(12:25:51) Due to changes in seq_t left/right (always having left
	<= right) we no longer need to complement positions. 

	* tgap/Attic/tg_edit.c:
	(12:26:22) Redundant - no longer being maintained and likely
	doesn't work now. 

	* tgap/tg_bin.c,
	* tgap/tg_register.c:
	(12:27:04) Updated for extra argument to sequence_get_position(). 

	* tgap/tg_cache.c:
	(12:28:09) Better error checking in cache_load().
	
	Flipped sort order of cached items as the DB lock/unlock method
	reverses the order within the g-* code. 

	* tgap/tg_contig.c:
	(12:30:00) Create new contigs with MIN_BIN_SIZE instead of
	hard-coded 16.
	
	contig_seqs_in_range2() now always returns range start and end in
	sorted position (start <= end) rather than flipped for complemented
	sequence. This removes complementing code elsewhere too.
	
	Added debugging tool contig_bin_dump() - to be called from gdb or
	similar for listing out a contig bin struct. 

	* tgap/tg_index.c:
	(12:30:23) Flush less often. 

	* gap5/consen.tcl:
	(12:32:30) Removal of debugging output.
	
	Added close of fd in get_consensus. 

	* gap5/consensus.c:
	(12:33:45) Removal of now unnecessary complementing code (see
	tg_contig.c changes).
	
	Bug fix to consensus_valid_range (param cons). 

	* gap5/contig_selector.c:
	(12:34:19) Added header files. 

	* gap5/Attic/dependencies:
	(12:34:33) *** empty log message *** 

	* gap5/editor_join.c:
	(12:35:33) Update 'offset' based on reach contig_offset value too.
	
	Now also destroys the contig properly. 

	* gap5/editor_view.c:
	(12:36:14) Changed arguments to sequence_get_position. Removed
	complementing code (see tg_contigs.c change). 

	* gap5/fij.c:
	(12:36:57) Now corrects for start positions of the editor; does not
	assume starts as bp 1. 

	* gap5/find_repeats.c:
	(12:37:12) Added include file. 

	* gap5/gap4_compat.c:
	(12:37:44) sequence_get_position() arg changes.
	
	Implemented complement_contig function. 

	* gap5/gap4_compat.h:
	(12:37:56) Implemented complement_contig function. 

	* gap5/newgap5_cmds.c:
	(12:38:16) Implemented complement_contig function. 

	* gap5/qualIO.c:
	(12:38:36) sequence_get_position arg changes. 

	* gap5/read_depth.h:
	(12:38:54) Added avg_sequence_depth prototype. 

	* gap5/tman_interface.c:
	(12:39:12) sequence_get_position arg changes. 

	* gap5/Attic/dependencies:
	(12:41:58) *** empty log message *** 

	* tgap/tg_contig.c:
	(17:29:05) Adjusted the positioning of contig offsets so that the
	offset is applied verbatim regardless of orientation of the root
	bin. The root bin's position element itself can be used to move
	contigs around (ie change the numbering start) instead of the
	contig start/end records. 

	* gap5/editor_join.c,
	* gap5/gap4_compat.c,
	* tgap/tg_sequence.c:
	(17:29:06) Adjusted the positioning of contig offsets so that the
	offset is applied verbatim regardless of orientation of the root
	bin. The root bin's position element itself can be used to move
	contigs around (ie change the numbering start) instead of the
	contig start/end records. 

2008-11-25  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/contig_editor.tcl:
	(10:01:36) Added a Join button.
	
	The save/cutoffs/quality buttons now apply to both editors when in
	join editor mode.
	
	The curr_editor variable is now updated when clicking on another
	editor (also in join editor mode).
	
	Fixed the mouse-over text display for the names window. 

	* gap5/editor_join.c,
	* gap5/editor_view.h,
	* gap5/tkEditor.c:
	(10:02:34) Implemented the edJoin() function and the tkEditor
	"join" sub command.  Tested and we successfully made our first
	join. Yay! Next up, complemented joins. 

2008-11-24  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_cache.c:
	(10:08:14) Add missing break statment, which caused cache_dup to
	fail. 

	* tgap/tg_sequence.c:
	(10:08:29) Commented out the richard_munge_conf() call. 

	* gap5/consensus.c,
	* gap5/consensus.h:
	(10:09:58) New function: consensus_valid_range()
	
	This looks at the cutoff data to work out where the "used" extents
	of the contig are rather than the absolute sizes of the contig bins
	including cutoffs. 

	* gap5/fij.c,
	* gap5/find_repeats.c:
	(10:18:18) Fixed calls to edit_contig and join_contig. These now
	also specify the position in contig to display. 

	* gap5/gap4_compat.c:
	(10:19:35) lget_contig_num now returns the default contig range as
	the true start and end coordinates rather than 1 to 'length'. 

	* gap5/tclIndex:
	(10:19:46) Added join_contig 

	* gap5/tkEditor.c:
	(10:20:24) New sub-commands: link_to, lock and join_align. For the
	join editor. 

	* gap5/tkEditor.h:
	(10:20:39) *** empty log message *** 

	* gap5/Makefile,
	* gap5/editor_join.c:
	(10:24:05) New file: editor_join.c. This is derived from Gap4's
	join.c and consists of functions for the Join Editor to implement
	the align and join buttons. 

	* gap5/contig_editor.tcl,
	* gap5/editor_view.c,
	* gap5/editor_view.h:
	(10:24:47) Major works to support the Join Editor.
	
	Removed defunct and commented out calc_cons() call.
	
	Fixed bug in status line display of quality values.
	
	Fixed bug in X scrollbar position - if now compensates for contig
	start being negative (cutoff data) so user scrolled position and
	displayed position match.
	
	Allowed for editor to be started up with the cursor at a specified
	read and position. 

2008-11-17  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/baf.c,
	* tgap/baf.h:
	(11:09:55) Added minimal support for reading and storing the trace
	alignment string. 

	* tgap/maqmap.c,
	* tgap/maqmap.h:
	(11:11:30) Minor change to prototypes - added void instead of
	implicit "()" args. 

	* tgap/maq.c,
	* tgap/tg_cache.c,
	* tgap/tg_iface_g.c,
	* tgap/tg_index.c,
	* tgap/tg_sequence.c,
	* tgap/tg_struct.h:
	(11:13:07) Added trace name and alignment strings to the seq_t
	struct. Also improved the storage mechanism for CNF1 format data
	with some basic compression for sequence and quality values. This
	saves about 40% of storage on a mixed 454/Sanger assembly - less so
	for solexa/solid. 

	* gap5/tk-io-reg.c:
	(11:59:58) Fixed a bug in argument parsing within tcl_quit_displays 

	* gap5/fij.c:
	(16:40:29) *** empty log message *** 

	* gap5/depth.tcl:
	(16:40:48) Fixed Y scrolling (produced Tk error) 

	* gap5/consensus.c:
	(16:41:11) Fixed uninitialised data for zero-depth regions. 

	* tgap/tg_register.c:
	(16:42:32) Rewrote type_notify to accept the fact that calling the
	callback function may change the list of registered items (eg if
	the notification is a quit displays request). To address this if a
	callback function is called we then recompute the list of
	registered functions. 

	* tgap/maq.c:
	(16:43:01) Ensure we zero the alignment string. This was causing
	bugs whereby sequence and quality were corrupted. 

	* tgap/baf.c:
	(16:43:33) Added support for template names (TN lines) rather than
	assuming shared read-names indicate the template. 

2008-11-14  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/Attic/array.c,
	* tgap/Attic/array.h:
	(10:16:17) Duplicate copies removed - we use the version in the
	../Misc directory again now. 

2008-11-13  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/read_depth.c,
	* gap5/read_depth.h:
	(17:08:08) *** empty log message *** 

2008-11-11  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/BAF,
	* tgap/Makefile,
	* tgap/baf.c,
	* tgap/baf.h,
	* tgap/tg_index.c:
	(15:09:12) Added (some) support for BAF - the basic assembly
	format. This isn't intended to be a long-term file format but it
	will serve as a working format until a strong contender emerges.
	For now it's a replacement CAF to work around our current woes. 

	* tgap/hache_table.c,
	* tgap/hache_table.h:
	(15:09:30) Added iterators to the HacheTable code. 

	* tgap/tg_iface_g.c,
	* tgap/tg_sequence.c,
	* tgap/tg_sequence.h,
	* tgap/tg_struct.h:
	(15:11:12) Added trace_name to the sequence_t struct and a flag to
	indicate if the field is present on disk. This allows us to add
	explicit trace names only for cases where it differs to the
	sequence name. 

	* tgap/tg_view.c:
	(15:11:29) Fixed a bug with long read names where they could
	overlap the sequence. 

	* gap5/Makefile:
	(15:12:13) Fixed Makefile to not use ~jkb/work/tgap for the tgap
	source - it now correctly uses the Staden local copy. Oops 

	* gap5/trace_display.tcl:
	(15:12:55) Protect against trace titles containing dots, which
	previously broke the tk pathnames being generated. 

2008-10-24  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/consensus.c:
	(09:05:18) Added depth to the consensus struct per base.
	
	Improved support for utilising all 4 confidence values when
	available.
	
	Bug fixed some edge cases, such as zero depth regions. 

	* gap5/consensus.h:
	(09:05:31) Added depth to the consensus struct per base. 

	* gap5/contig_editor.tcl:
	(09:06:24) The status line updates quality information on keyboard
	cursor movements now as well as mouse over events. 

	* gap5/editor_view.c:
	(09:07:48) The editor "brief" status line format has been updated
	to support reporting all 4 confidence values for a sequence base
	call. 

	* gap5/gap4_compat.c:
	(09:08:23) contig_name_to_number now uses contig_index_query for
	btree scanning rather than a brute force search. 

	* gap5/newgap5_cmds.c:
	(09:10:06) New function: tcl_sequence_depth, doing pretty much what
	you expect.
	
	Start of tcl_find_internal_joins interface. Incomplete right now.
	
	tcl_calc_consensus_full now reports sequence depth too, incase
	you're already calculating the consensus anyway. 

2008-10-23  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/b+tree2.c:
	(14:09:23) Additional error checking in btree_find_recurse(). 

	* tgap/tg_contig.c,
	* tgap/tg_contig.h:
	(14:09:50) Added a contig_index_query function, analogous to
	sequence_index_query. 

	* tgap/tg_iface_g.c,
	* tgap/tg_index.c,
	* tgap/tg_sequence.c,
	* tgap/tg_sequence.h,
	* tgap/tg_tcl.c,
	* tgap/tg_view.c:
	(14:29:43) Fixed bug in btree_load_cache. If it had an error
	locking or reading data then it freed an uninitialised pointer.
	
	Fixed a view locking bug in btree_write().
	
	Added support for SEQ_FORMAT_CNF4 encoded sequences. These have 4
	log-odds confidence values instead of the 1 phred value. 

2008-10-03  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/Makefile,
	* tgap/ace.c,
	* tgap/ace.h,
	* tgap/maq.c,
	* tgap/tg_index.c:
	(16:12:13) Added support for loading (new format) ACE files in
	tg_index.
	
	For all formats we no longer flush the cache after every contig as
	this was a major speed hit when dealing with lots of small contigs.
	
	Added read-pairing support for the simple .aln format. If the name
	matches it's assumed to be part of a pair. 

	* tgap/hache_table.c:
	(16:13:07) Minor changes to the HacheTableStats function. The
	reporting number of cache hits/misses is now a delta from the last
	time the stats function was called. 

	* tgap/tg_tcl.c:
	(16:13:49) Added comments regarding usage. No code change. 

	* gap5/gap4_compat.c:
	(16:23:56) Fixes in get_contig_num. (Done so long ago I forget what
	the reasoning was - sorry!) 

	* gap5/fij.c,
	* gap5/fij.h,
	* gap5/fij.tcl,
	* gap5/newgap_structs.h:
	(16:25:46) Added Find Internal Joins function. 

	* gap5/depth.tcl,
	* gap5/tclIndex:
	(16:26:50) Added the first draft of a read-depth and template
	display. Also tidied up the menus to remove most of the unused
	functions somewhat. 

	* tgap/ace_reorder.pl:
	(17:00:02) This attempts to reorder an ACE file so that the reads
	within it are sorted in left to right order.
	
	The purpose for this is to improve efficiency when converting to a
	Gap5 database. While it'll work regardless of the read order
	(provided the reads are presented in the same order as listed int
	he AF lines), it is inefficient if the reads for a small region are
	spread throughout a large area of disk. 

	* gap5/depth.tcl:
	(17:56:15) Removed broken bits from the entry dialogue. The window
	doesn't yet support multiple contigs anyway. 

2008-08-29  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_cache.c:
	(09:01:56) Bug fixed the new flush code. Using ARR instead of arr
	macro auto-extends the array for us. 

	* tgap/tg_contig.c:
	(09:03:15) Added cache_incr/decr calls around contig_seqs_in_range2
	so that the recursive nature of the function cannot push the bin
	out of the cache. 

	* tgap/tg_tcl.c:
	(13:46:28) Overhauled the tcl objects somewhat. Contigs and
	sequence (more to follow) sport an "io" and a "delete" method. This
	comes about from the realisation that my object system doesn't
	really fit in with Tcl.
	
	Consider:
	
	if {$condition} {    set r [$io get_sequence $seq_num]	  puts
	length=[$r get_length] }
	
	This this we query the tg_cache to get a sequence object, we create
	a Tcl_Obj associated with that too (stored in $r) and register a
	*global* function named after the string form of $r. This allows us
	to call it with "$r get_length" as technically objects are not
	classes and cannot have methods invoked on them in their own right.
	The names are globally unique though so there are no clashes.
	
	Hence when $r goes out of scope it destroys the reference to the
	object but does not remove the function. We now have to explicitly
	call "$r delete" to tidy up otherwise we end up with memory leaks
	and global namespace pollution. ie:
	
	if {$condition} {    set r [$io get_sequence $seq_num]	  puts
	length=[$r get_length]	  $r delete }
	
	It's not enough to track reference counts on $r either as the act
	of calling it as a function ($r get_length) changes the type from
	sequence to cmdName, decrementing the reference. We cannot remove
	the memory yet though, so it's not possible to keep track it seems.
	
		   - -	- -  - -  - -  - -  - -  - -  - -  - -	- -
	
	Perhaps with hindsight we should use a procedural model instead:
	
	if {$condition} {    set r [g5::io::get_sequence $io $seq_num]	 
	puts length=[g5::seq::get_length $r] }
	
	This way we do not create and remove procedures plus our data
	automatically goes out of scope and is tidied up for us. The above
	is essentially what happens in perl when io is blessed to be in
	class g5::io or $r is blessed to be in class g5::seq. I guess
	incrTcl has an equivalent mechanism. 

	* gap5/gap.tcl:
	(14:58:13) Removed requirement of database name being
	"dbname.version". 

2008-08-26  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_cache.c,
	* tgap/tg_gio.h:
	(13:28:23) Fixed the cache_flush code to hand over cache_items from
	a "derived" io to the base io struct before running cache_flush on
	the base.
	
	This ensures that the base io obtains copies of data from (for
	example) the contig editor. 

	* gap5/contig_editor.tcl,
	* gap5/tkEditor.c:
	(13:30:43) Added an "edits_made" sub-command of the editor. This is
	used to implement a warning on editor exit to ask if changes should
	be saved.
	
	Also fixed an error with a callback when highlighting non-sequence
	objects in the names panel. 

2008-08-20  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/tg_iface_g.c:
	(15:48:12) Added more automatic commiting of writes. I'm still not
	sure if this is correct behaviour, but given our caching is now
	held in the tg_cache layer instead of G library it serves the
	purpose. 

	* tgap/tg_tcl.c:
	(15:49:01) Added a "child" subcommand of the io type. 

	* gap5/Makefile:
	(15:49:22) Tidyup to support tgap library being part of the staden
	build system now. 

	* gap5/contig_editor.tcl:
	(15:50:59) Made the contig editor using a child io for editing in.
	The save button now works.
	
	(Previously save/exit did the same thing as we edited the live io
	instead of child io.) 

	* gap5/gap.tcl:
	(15:51:49) Minor tweaks to replace gap4 with gap5 in strings,
	functions and version (gap v5.00 now) 

	* gap5/tkEditor.c:
	(15:52:29) Added Editor class save sub-command. 

2008-08-19  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/g-files.c:
	(15:10:36) Fix issues with .aux files being > 2Gb in size. 

2008-08-13  James Bonfield  <jkb@sanger.ac.uk>

	* tgap/Makefile,
	* tgap/Attic/array.c,
	* tgap/Attic/array.h,
	* tgap/b+tree2.c,
	* tgap/b+tree2.h,
	* tgap/g-alloc.c,
	* tgap/g-alloc.h,
	* tgap/g-connect.c,
	* tgap/g-connect.h,
	* tgap/g-db.c,
	* tgap/g-db.h,
	* tgap/g-defs.h,
	* tgap/g-error.c,
	* tgap/g-error.h,
	* tgap/g-filedefs.h,
	* tgap/g-files.c,
	* tgap/g-files.h,
	* tgap/g-io.c,
	* tgap/g-io.h,
	* tgap/g-misc.h,
	* tgap/g-os.h,
	* tgap/g-request.c,
	* tgap/g-request.h,
	* tgap/g-struct.c,
	* tgap/g-struct.h,
	* tgap/g.h,
	* tgap/gap_cli_arg.c,
	* tgap/gap_cli_arg.h,
	* tgap/hache_table.c,
	* tgap/hache_table.h,
	* tgap/libtgap.so,
	* tgap/maq.c,
	* tgap/maq.h,
	* tgap/maqmap.c,
	* tgap/maqmap.h,
	* tgap/misc.h,
	* tgap/mkdefs.c,
	* 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_depth,
	* tgap/tg_depth.c,
	* tgap/Attic/tg_edit.c,
	* tgap/tg_gio.c,
	* tgap/tg_gio.h,
	* tgap/tg_iface.h,
	* tgap/tg_iface_g.c:
	(14:18:07) Initial import of tgap. This is for use in Gap5 source
	(which uses libtgap.so), but development on the test programs
	tg_index and tg_view will now take place in this CVS tree instead
	of Sanger's private SubVersion repository. 

	* tgap/tg_iface_g.h,
	* tgap/tg_index.c,
	* 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_tcl.h,
	* tgap/tg_track.c,
	* tgap/tg_track.h,
	* tgap/tg_tracks.c,
	* tgap/tg_tracks.h,
	* tgap/tg_utils.c,
	* tgap/tg_utils.h,
	* tgap/tg_view.c,
	* tgap/xalloc.h,
	* tgap/xerror.c,
	* tgap/xerror.h:
	(14:18:08) Initial import of tgap. This is for use in Gap5 source
	(which uses libtgap.so), but development on the test programs
	tg_index and tg_view will now take place in this CVS tree instead
	of Sanger's private SubVersion repository. 

2008-07-14  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/consensus.c:
	(15:38:06) Fixes to the consensus algorithm for solexa reads -
	specifically calling gaps. 

	* gap5/contig_editor.tcl:
	(15:39:22) Added more use of tg_tcl's interfaces - we can now move
	reads around and insert/delete bases within readings (not just the
	consensus). 

2008-06-27  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/consensus.c:
	(16:23:43) Improved the consensus algorithm to handle pads. For now
	all pads score a fixed amount and we compare them against bases
	(any type) also at a fixed score. Having done that we then compute
	the base-score from non-pad bases as before, factoring in the
	probability of the base even existing right at the end.
	
	These fixed costs of overcall/undercall are reasonable for solexa
	where such errors are due to PCR and not related to the data
	quality.
	
	For capillary data we need more work to pick appropriate costs. 

	* gap5/contig_editor.tcl:
	(16:29:06) Added keybinding to use the new contig insert and delete
	base method. (Used for inserting columns of pads.) 

2008-05-30  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/contig_editor.tcl,
	* gap5/editor_view.c,
	* gap5/editor_view.h,
	* gap5/tkEditor.c:
	(14:22:00) Added code to support read-pair data. For now this is
	just the right mouse click in the editor's read name as a proof of
	concept.
	
	Fixed the "is the cursor visible?" code too so set X first, fixing
	an error in working out the Y display point. 

2008-05-27  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/consen.tcl:
	(16:25:11) Added code for Gap4's main output consensus function.
	Right now it's in simple mode only with no marking or masking.
	Formats supported are fastq and fasta, with experiment file to
	follow maybe. 

	* gap5/contig_editor.tcl,
	* gap5/editor_view.c,
	* gap5/tkEditor.c,
	* gap5/tkEditor.h:
	(16:28:21) Added display of mapping quality to the read-name
	section. 

2008-05-22  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/consen.tcl,
	* gap5/consensus.c,
	* gap5/qual.tcl:
	(10:25:34) Implemented a new consensus algorithm using log-odds
	scores. 

	* gap5/consensus.h:
	(10:25:35) Implemented a new consensus algorithm using log-odds
	scores. 

	* gap5/Makefile:
	(10:26:40) *** empty log message *** 

	* gap5/contig_editor.tcl:
	(10:27:55) Changed the mouse highlight on bases to use
	BASE_BRIEF_FORMAT[12] instead of the READ_BRIEF_FORMAT format
	string. 

	* gap5/editor_view.c,
	* gap5/editor_view.h:
	(10:30:26) Make use of the new consensus algorithm, which gives
	quality values so we can now grey-scale the consensus too.
	
	Improved the "brief" status line support, adding a new
	edGetBriefCon for consensus status info too. 

	* gap5/qual.c,
	* gap5/tkEditor.c:
	(10:30:30) Make use of the new consensus algorithm, which gives
	quality values so we can now grey-scale the consensus too.
	
	Improved the "brief" status line support, adding a new
	edGetBriefCon for consensus status info too. 

	* gap5/newgap5_cmds.c:
	(10:32:08) Added in List Consensus Confidence and List Base
	Confidence functions (the latter still needs major bug fixes
	though). 

	* gap5/qualIO.c:
	(10:32:09) Added in List Consensus Confidence and List Base
	Confidence functions (the latter still needs major bug fixes
	though). 

	* gap5/gap.tcl:
	(10:32:44) Temporary hack to change maxseq until I update the code
	to automatically derive it. 

2008-05-12  James Bonfield  <jkb@sanger.ac.uk>

	* gap5/IO.h,
	* gap5/IO2.h,
	* gap5/Makefile,
	* gap5/actf.c,
	* gap5/actf.h,
	* gap5/active_tags.c,
	* gap5/active_tags.h,
	* gap5/Attic/complement.h,
	* gap5/consen.c,
	* gap5/consen.h,
	* gap5/contig_editor.tcl,
	* gap5/contig_id.tcl,
	* gap5/contig_selector.c,
	* gap5/contig_selector.h,
	* gap5/contig_selector.tcl,
	* gap5/cs-object.c,
	* gap5/cs-object.h,
	* gap5/Attic/dependencies,
	* gap5/editor_view.c,
	* gap5/editor_view.h,
	* gap5/extract.h,
	* gap5/find_repeats.c,
	* gap5/find_repeats.h,
	* gap5/find_repeats.tcl,
	* gap5/fort.h,
	* gap5/gap-dbstruct.h,
	* gap5/gap-error.c,
	* gap5/gap-error.h,
	* gap5/gap-if.h,
	* gap5/gap-tcl.h,
	* gap5/gap.tcl,
	* gap5/gap4_compat.c,
	* gap5/gap4_compat.h,
	* gap5/gap4_compat.tcl,
	* gap5/gap_cli_arg.h,
	* gap5/gap_globals.c,
	* gap5/gap_globals.h,
	* gap5/gap_hash.c,
	* gap5/gap_hash.h,
	* gap5/gap_utils.tcl,
	* gap5/hash_lib.c,
	* gap5/hash_lib.h,
	* gap5/init.c,
	* gap5/io-reg.h,
	* gap5/io_handle.h,
	* gap5/io_utils.h,
	* gap5/jog.tcl,
	* gap5/list.h,
	* gap5/list_contigs.tcl,
	* gap5/list_proc.c,
	* gap5/list_proc.h,
	* gap5/list_proc.tcl,
	* gap5/newgap5_cmds.c,
	* gap5/newgap_cmds.h,
	* gap5/newgap_structs.h,
	* gap5/ng_fb_cmds.tcl,
	* gap5/notedb.c,
	* gap5/notedb.h,
	* gap5/qual.c,
	* gap5/qual.h,
	* gap5/qualIO.c,
	* gap5/qualIO.h,
	* gap5/qualP.h,
	* gap5/search.tcl,
	* gap5/sendto.tcl,
	* gap5/stack_dump.c,
	* gap5/stack_dump.h,
	* gap5/tag_checklist.tcl,
	* gap5/tagdb.c,
	* gap5/tagdb.h,
	* gap5/tclIndex,
	* gap5/template_display.tcl,
	* gap5/tk-io-reg.c,
	* gap5/tk-io-reg.h,
	* gap5/tkAppInit.c:
	(11:26:37) Try v2. Initial checkin of gap5 source. Note this
	requires the tgap source too, which will be added soon. (It
	currently exists in Sanger's own SVN repository.) 

	* gap5/tkEdNames.c,
	* gap5/tkEdNames.h,
	* gap5/tkEditor.c,
	* gap5/tkEditor.h,
	* gap5/tman_display.c,
	* gap5/tman_display.h,
	* gap5/tman_interface.c,
	* gap5/tman_interface.h,
	* gap5/trace_display.tcl:
	(11:26:38) Try v2. Initial checkin of gap5 source. Note this
	requires the tgap source too, which will be added soon. (It
	currently exists in Sanger's own SVN repository.) 

	* gap5/contig_editor.tcl,
	* gap5/contig_id.tcl,
	* gap5/gap.tcl,
	* gap5/gap4_compat.tcl,
	* gap5/ng_fb_cmds.tcl,
	* gap5/select_contig.tcl:
	(16:11:41) Minor tweaks to tidy up gap5 distrib. 

	* gap5/tk-io-reg.c:
	(16:11:42) Minor tweaks to tidy up gap5 distrib. 


