deps/kb_meme/meme-5.0.1/src/dreme-sax.c
/*****************************************************************************
 * dreme > motifs > motif
 * contains: pos+, match*
 *
 *  id                the identifier used by DREME
 *  seq               the DNA iupac sequence representing the motif.
 *  length            the length of the motif
 *  nsites            the number of sites used to create the motif
 *  p                 the number of sequences in the positive set with the motif
 *  n                 the number of sequences in the negative set with the motif
 *  pvalue            the pvalue of the motif after erasing (returned as log10)
 *  evalue            the evalue of the motif after erasing (returned as log10)
 *  unerased_evalue   the evalue of the motif without erasing (returned as log10)
 ****************************************************************************/
dreme > motifs > motif
contains: pos+, match

id                the identifier used by DREME
seq               the DNA iupac sequence representing the motif.
length            the length of the motif
nsites            the number of sites used to create the motif
p                 the number of sequences in the positive set with the motif
n                 the number of sequences in the negative set with the motif
pvalue            the pvalue of the motif after erasing (returned as log10)
evalue            the evalue of the motif after erasing (returned as log10)
unerased_evalue   the evalue of the motif without erasing (returned as log10)
dreme > motifs > motif contains : pos + match id the identifier used by DREME seq the DNA iupac sequence representing the motif . length the length of the motif nsites the number of sites used to create the motif p the number of sequences in the positive set with the motif n the number of sequences in the negative set with the motif pvalue the pvalue of the motif after erasing ( returned as log10 ) evalue the evalue of the motif after erasing ( returned as log10 ) unerased_evalue the evalue of the motif without erasing ( returned as log10 )
static void start_ele_motif(PS_T *ps, const xmlChar **attrs) {
  char *id, *seq, *alt;
  int length;
  long nsites, p_hits, n_hits;
  double log10pvalue, log10evalue, log10uevalue;
  char* names[10] = {"alt", "evalue", "id", "length", "n", "nsites", "p", "pvalue", 
    "seq", "unerased_evalue"};
  int (*parsers[10])(char*, void*) = {ld_str, ld_log10_ev, ld_str, ld_int, ld_long, 
    ld_long, ld_long, ld_log10_pv, ld_str, ld_log10_ev};
  void *data[10] = {&alt, &log10evalue, &id, &length, &n_hits, &nsites, &p_hits, 
    &log10pvalue, &seq, &log10uevalue};
  bool required[10] = {false, true, true, true, true, true, true, true, 
    true, true};
  bool done[10];
  alt = "";
  parse_attributes(dreme_attr_parse_error, ps, "motif", attrs, 10, names, 
      parsers, data, required, done);
  if (ps->state != PS_ERROR) {
    int len = strlen(id);
    ps->motif_id = mm_malloc(sizeof(char) * (len + 1));
    strcpy(ps->motif_id, id);
    ps->last_pos = 0;
    ps->motif_len = length;
  }
  if (ps->callbacks->start_motif && ps->state != PS_ERROR) {
    ps->callbacks->start_motif(ps->user_data, id, alt, seq, length, nsites, p_hits, 
        n_hits, log10pvalue, log10evalue, log10uevalue);
  }
  dreme_push_es(ps, PS_IN_MATCH, ES_ANY);
  dreme_push_es(ps, PS_IN_POS, ES_ONE_OR_MORE);
}
static void start_ele_motif ( PS_T * ps , const xmlChar * * attrs ) { char * id , * seq , * alt ; int length ; long nsites , p_hits , n_hits ; double log10pvalue , log10evalue , log10uevalue ; char * names [ 10 ] = { " " , " " , " " , " " , " " , " " , " " , " " , " " , " " } ; int ( * parsers [ 10 ] ) ( char * , void * ) = { ld_str , ld_log10_ev , ld_str , ld_int , ld_long , ld_long , ld_long , ld_log10_pv , ld_str , ld_log10_ev } ; void * data [ 10 ] = { & alt , & log10evalue , & id , & length , & n_hits , & nsites , & p_hits , & log10pvalue , & seq , & log10uevalue } ; bool required [ 10 ] = { false , true , true , true , true , true , true , true , true , true } ; bool done [ 10 ] ; alt = " " ; parse_attributes ( dreme_attr_parse_error , ps , " " , attrs , 10 , names , parsers , data , required , done ) ; if ( ps -> state != PS_ERROR ) { int len = strlen ( id ) ; ps -> motif_id = mm_malloc ( sizeof ( char ) * ( len + 1 ) ) ; strcpy ( ps -> motif_id , id ) ; ps -> last_pos = 0 ; ps -> motif_len = length ; } if ( ps -> callbacks -> start_motif && ps -> state != PS_ERROR ) { ps -> callbacks -> start_motif ( ps -> user_data , id , alt , seq , length , nsites , p_hits , n_hits , log10pvalue , log10evalue , log10uevalue ) ; } dreme_push_es ( ps , PS_IN_MATCH , ES_ANY ) ; dreme_push_es ( ps , PS_IN_POS , ES_ONE_OR_MORE ) ; }
dreme > motifs > motif
 contains: pos+, match
dreme > motifs > motif contains : pos + match
// copy the motif id so we can use it in any error messages