deps/kb_meme/meme-5.0.1/src/seq.c
/***************************************************************************
 * Remove the first N bases of a given sequence.
 ***************************************************************************/
Remove the first N bases of a given sequence.
Remove the first N bases of a given sequence .
void shift_sequence
  (int    offset,
   SEQ_T* sequence)
{
  char *new_sequence = NULL;
  double *new_priors = NULL;
  assert(offset > 0);
  assert(offset <= sequence->length);
  memmove(
    sequence->sequence,
    sequence->sequence + offset,
    sequence->length - offset + 1
  );
  if (sequence->priors) {
    memmove(
      sequence->priors,
      sequence->priors + offset,
      (sequence->length - offset) * sizeof(double)
    );
  }
  sequence->offset += offset;
  myfree(sequence->intseq);
  sequence->intseq = NULL;
  myfree(sequence->gc);
  sequence->gc = NULL;
}
void shift_sequence ( int offset , SEQ_T * sequence ) { char * new_sequence = NULL ; double * new_priors = NULL ; assert ( offset > 0 ) ; assert ( offset <= sequence -> length ) ; memmove ( sequence -> sequence , sequence -> sequence + offset , sequence -> length - offset + 1 ) ; if ( sequence -> priors ) { memmove ( sequence -> priors , sequence -> priors + offset , ( sequence -> length - offset ) * sizeof ( double ) ) ; } sequence -> offset += offset ; myfree ( sequence -> intseq ) ; sequence -> intseq = NULL ; myfree ( sequence -> gc ) ; sequence -> gc = NULL ; }
Remove the first N bases of a given sequence.
Remove the first N bases of a given sequence .
// Make a copy of the raw sequence for the overlap. // Shift priors if needed. // Free the integer version. // Free the GC counts.