deps/kb_meme/meme-5.0.1/src/motif-in.c
/*
 * Set the background source to be used for pseudocounts.
 * The background is resolved by the following rules:
 *   If source is:
 *     null or "--nrdb--"			use nrdb frequencies
 *     "--uniform--"				use uniform frequencies
 *     "motif-file", "--motif--" or "--query"	use frequencies in motif file
 *     file name                		read frequencies from bg file
 *
 *   This cancels a conversion alphabet.
 */
Set the background source to be used for pseudocounts.

This cancels a conversion alphabet.
Set the background source to be used for pseudocounts . This cancels a conversion alphabet .
void mread_set_bg_source(
  MREAD_T *mread, 
  const char *source,
  ALPH_T *alph
) {
  if (mread->other_bg != NULL) free_array(mread->other_bg);
  mread->other_bg = NULL;
  if (mread->other_bg_src != NULL) free(mread->other_bg_src);
  mread->other_bg_src = NULL;
  if (mread->conv_alph != NULL) alph_release(mread->conv_alph);
  mread->conv_alph = NULL;
  if (source != NULL) {
    mread->other_bg_src = strdup(source);
  }
  if (mread->success) set_pseudo_bg(mread, alph);
}
void mread_set_bg_source ( MREAD_T * mread , const char * source , ALPH_T * alph ) { if ( mread -> other_bg != NULL ) free_array ( mread -> other_bg ) ; mread -> other_bg = NULL ; if ( mread -> other_bg_src != NULL ) free ( mread -> other_bg_src ) ; mread -> other_bg_src = NULL ; if ( mread -> conv_alph != NULL ) alph_release ( mread -> conv_alph ) ; mread -> conv_alph = NULL ; if ( source != NULL ) { mread -> other_bg_src = strdup ( source ) ; } if ( mread -> success ) set_pseudo_bg ( mread , alph ) ; }
Set the background source to be used for pseudocounts.
Set the background source to be used for pseudocounts .
// clean up old bg // clean up conversion alphabet // copy the passed source // Set the background for pseudocounts.