More reworking of contig insertion / deletion code.

The tcl code to undo consensus base deletion has been simplified by creating a
contig insert_column interface, which takes the list of reads and base calls in
the undo stack and applies it to the column being inserted.  This allows the C
code to do a much more complete job than the old insert_base code, so the tcl
part does not need to do as much cleaning up.  This also means there is less
need to iterate around the bin tree.

Consensus base deletion now also stores undo information for reference position
markers.  As deleting a base may cause markers to be merged, the only way to
get them back when undoing is to know what markers were present in the first
place.

Various edge cases and problems with complemented bins have been fixed.

tg_tcl.c
  Added contig insert_column, find_refpos_marker, set_refpos_marker and
delete_refpos_marker interfaces.

tg_contig.c
tg_contig.h
  Made it easier to turn debugging code on and off.

  Added new contig_insert_column() function.  This is like contig_insert_base,
but can be passed an array listing the base and confidence value to be inserted
into each read in the column.  This is used to make a hash table which is
passed to contig_insert_base_common and then contig_insert_base2 so the updates
can be made reasonably efficiently without having to do too many traverses of
the bin tree.

  Update contig_insert_base2 to take the pileup hash, and to fix more edge
case and complemented bin issues.

  Ensure bin_incr_nseq() is only called for sequences in contig_delete_base2.

  Improved calculation of moved_left, moved_right and fixed_right in
contig_delete_base2.

  Allow deletion of the first base of the contig in contig_delete_base_common.

  Reworked refpos marker code to simplify it and to fix a bug where some
deletion markers were not removed in contig_delete_base_common causing them
to pile up.

  Added set_refpos_marker() and delete_refpos_marker() functions.  These are
called from the tcl interfaces in tg_tcl.c

tg_sequence.c
tg_sequence.h

  Pass in comp to sequence_insert_bases, which should be 1 if the current bin
is complemented.  This means it's possible to work out if the base call should
be complemented or not when inserting in bin orientation.  The value passed in
is ignored if in contig_orientation.

tg_check.c

  In bin_walk, when an incorrect nseqs or nanno count is found, print out what
the stored and actual values were.

contig_editor.tcl

  C_INS undo code now uses $contig insert_column instead of insert_base.  This
allowed a lot of code that was fixing eveything $contig insert_base had not
done correctly to be removed.

  Added RP_SET and RP_DEL undo commands.

  Made editor_delete_cons_base store undo for any reference position markers
that could be affected.  This is the only way to guarantee that the undo
operation can get them back as they were before.

gap5_del_test.tcl

  Made the basic test run on a complemented bin as well as an uncomplemented
one.

  Make do_test compare sam files for the before and after complemented case.

Makefile

  Recalculated dependencies.



git-svn-id: svn://svn.code.sf.net/p/staden/code/staden/trunk@3655 ba6f2710-ca9f-427c-89d3-5bf716dbc8e1