Moved the cram index creation out of cram_index program and into the
cram_index.c part of io_lib library.

Bug fixed both the index creation and decode range checking to handle
containers/slices with ref_seq_id of -2, indicating that multiple
references share the same container.


git-svn-id: svn://svn.code.sf.net/p/staden/code/io_lib@3625 ba6f2710-ca9f-427c-89d3-5bf716dbc8e1
Due to the change of only uncompressing blocks we explicitly need,
decoding crams with embedded references was failing.

Now uncompress that block too.


git-svn-id: svn://svn.code.sf.net/p/staden/code/io_lib@3626 ba6f2710-ca9f-427c-89d3-5bf716dbc8e1
Merged in the cram_refactor branch.

This consists of a major overhaul of the way cram data series are
managed.

- The C structs are now more array based, preferring ->block[DS_XX]
  instead of ->XX_blk and similar. 

- Many more block types wil be external by default now. It
  auto-selects CORE vs external based on size.

- Selection of compression algorithm for external blocks is more
  advanced.  Every external block has a metrics array element. This
  now tracks more than 2 types of compression and it culls candidate
  methods if they repeatedly are unpromising.

  The upshot is the hard-coded selection of which method to use for
  which block is (mostly) removed in favour of auto detection.

- CRAM now has the option to ignore certain types of fields when
  decoding.  Combined with more external blocks this permits faster
  decoding for tools like scram_flagstat, potentially 2-3x faster.

- Auxiliary tags now get split up into multiple external blocks based
  on data type. We still aggregate many together, but tag strings,
  integers, sequences and quality strings now get their own blocks.



git-svn-id: svn://svn.code.sf.net/p/staden/code/io_lib@3627 ba6f2710-ca9f-427c-89d3-5bf716dbc8e1
Also added CRAM_OPT_REQUIRED_FIELDS option to cram_index.

Indexing sometimes requires decoding of Ref ID and start/end when a
slice contains multiple refs, so specifying this speeds up indexing
several fold in that scenario.


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