Function tskit::bindings::tsk_table_collection_check_integrity[][src]

pub unsafe extern "C" fn tsk_table_collection_check_integrity(
    self_: *const tsk_table_collection_t,
    options: tsk_flags_t
) -> tsk_id_t

@brief Runs integrity checks on this table collection.

@rst

Checks the integrity of this table collection. The default checks (i.e., with options = 0) guarantee the integrity of memory and entity references within the table collection. All spatial values (along the genome) are checked to see if they are finite values and within the required bounds. Time values are checked to see if they are finite or marked as unknown.

To check if a set of tables fulfills the :ref:requirements <sec_valid_tree_sequence_requirements> needed for a valid tree sequence, use the TSK_CHECK_TREES option. When this method is called with TSK_CHECK_TREES, the number of trees in the tree sequence is returned. Thus, to check for errors client code should verify that the return value is less than zero. All other options will return zero on success and a negative value on failure.

More fine-grained checks can be achieved using bitwise combinations of the other options.

Options**:

Options can be specified by providing one or more of the following bitwise flags:

TSK_CHECK_EDGE_ORDERING Check edge ordering constraints for a tree sequence. TSK_CHECK_SITE_ORDERING Check that sites are in nondecreasing position order. TSK_CHECK_SITE_DUPLICATES Check for any duplicate site positions. TSK_CHECK_MUTATION_ORDERING Check contraints on the ordering of mutations. Any non-null mutation parents and known times are checked for ordering constraints. TSK_CHECK_INDIVIDUAL_ORDERING Check individual parents are before children, where specified. TSK_CHECK_INDEXES Check that the table indexes exist, and contain valid edge references. TSK_CHECK_TREES All checks needed to define a valid tree sequence. Note that this implies all of the above checks.

It is sometimes useful to disregard some parts of the data model when performing checks:

TSK_NO_CHECK_POPULATION_REFS Do not check integrity of references to populations. This can be safely combined with the other checks. @endrst

@param self A pointer to a tsk_table_collection_t object. @param options Bitwise options. @return Return a negative error value on if any problems are detected in the tree sequence. If the TSK_CHECK_TREES option is provided, the number of trees in the tree sequence will be returned, on success.