first previous next last contents

Joining two contigs

The order of events within the joining is crucial. In the past several bugs have arisen due to this order being incorrect. We need to notify both the left and right contigs of the change, to join the two registration lists, and to delete the contig. Deleting the contig must be the last operation as this may renumber one of our contigs.

The order used is as follows, assuming we are joining two contigs together. We join 'left' to 'right', giving a new contig 'left'.

  1. Perform the actual join of the data. This involves updating everything except without notifications and without modifying the registration lists.
  2. Send a REG_JOIN_TO request to 'right' informing the new contig number is 'left'. This also includes the offset of 'right' within 'left'.
  3. Merge the registration lists using contig_register_join. We copy 'right' to 'left', leaving 'right' unchanged. It is required to leave 'right' unchanged so that the delete request is acknowledged.
  4. Notify 'left' of a change of length using REG_LENGTH. Note that this now also includes notifying items previously register with 'right'.
  5. Delete contig 'right'. As shown above, this will generate REG_DELETE and possibly REG_NUMBER_CHANGE requests.

first previous next last contents
This page is maintained by staden-package. Last generated on 1 March 2001.