deps/kb_meme/meme-5.0.1/src/order.c
/***********************************************************************
 * Add one spacer and the following motif to an order object.
 *
 * Does nothing if the order parameter is NULL.
 ***********************************************************************/
Add one spacer and the following motif to an order object.
Does nothing if the order parameter is NULL.
Add one spacer and the following motif to an order object . Does nothing if the order parameter is NULL .
void add_occurrence
  (int motif_i,
   int spacer_length,
   ORDER_T* order)
{
  if (order == NULL) {
    return;
  }
  assert(order->num_alloc >= order->num_occurs);
  if (!order_contains(motif_i, order)) {
    rbtree_make(order->distinct, &motif_i, NULL);
  }
  order->motif_spacers[order->num_occurs] = spacer_length;
  if (motif_i != END_TRANSITION) {
    assert(order->num_alloc > order->num_occurs);
    order->motif_occurs[order->num_occurs] = motif_i;
    (order->num_occurs)++;
  }
}
void add_occurrence ( int motif_i , int spacer_length , ORDER_T * order ) { if ( order == NULL ) { return ; } assert ( order -> num_alloc >= order -> num_occurs ) ; if ( ! order_contains ( motif_i , order ) ) { rbtree_make ( order -> distinct , & motif_i , NULL ) ; } order -> motif_spacers [ order -> num_occurs ] = spacer_length ; if ( motif_i != END_TRANSITION ) { assert ( order -> num_alloc > order -> num_occurs ) ; order -> motif_occurs [ order -> num_occurs ] = motif_i ; ( order -> num_occurs ) ++ ; } }
Add one spacer and the following motif to an order object.
Add one spacer and the following motif to an order object .
// Count distinct motifs. // Record the spacer before this occurrence. // Don't include the end transition as a motif occurence