deps/kb_meme/meme-5.0.1/src/display.c
/**********************************************************************
  print_meme_motifs_xml

  Print XML elements for the motifs. See DTD embeded in
  print_meme_header_xml for the description of model XML syntax.

***********************************************************************/
print_meme_motifs_xml
Print XML elements for the motifs. See DTD embeded in
print_meme_header_xml for the description of model XML syntax.
print_meme_motifs_xml Print XML elements for the motifs . See DTD embeded in print_meme_header_xml for the description of model XML syntax .
static void print_meme_motifs_xml(
  MODEL *model,                   
  DATASET *dataset,               
  int nmotifs,                    
  MOTIF_SUMMARY *motif_summaries, 
  FILE* outfile                   
) {
  fprintf(outfile, "<motifs>\n");
  int i = 0;
  for (i = 0; i < nmotifs; i++) {
    fprintf(
      outfile,
      "<motif id=\"motif_%d\" name=\"%s\" alt=\"MEME-%d\" width=\"%d\" sites=\"%d\""
      " ic=\"%.1f\" re=\"%.1f\""
      " llr=\"%.0f\" p_value=\"%3.1fe%+04.0f\" e_value=\"%3.1fe%+04.0f\" bayes_threshold=\"%g\""
      " elapsed_time=\"%f\">\n",
      i + 1,
      motif_summaries[i].consensus,	
      i + 1,				
      motif_summaries[i].width,
      motif_summaries[i].num_sites,
      motif_summaries[i].ic,
      motif_summaries[i].re,
      motif_summaries[i].llr,
      motif_summaries[i].p_value_mant,
      motif_summaries[i].p_value_exp,
      motif_summaries[i].e_value_mant,
      motif_summaries[i].e_value_exp,
      motif_summaries[i].bayes,
      motif_summaries[i].elapsed_time
    );
    print_meme_pssm_xml(
      motif_summaries[i].pssm,
      dataset->alph,
      motif_summaries[i].width,
      outfile
    );
    print_meme_psfm_xml(
      motif_summaries[i].psfm,
      dataset->alph,
      motif_summaries[i].width,
      outfile
    );
    print_meme_regular_expression_xml(
      motif_summaries[i].regexp,
      outfile
    );
    print_meme_contributing_sites_xml(
      model,
      &(motif_summaries[i]),
      dataset,
      outfile
    );
    fprintf(outfile, "</motif>\n");
  }
  fprintf(outfile, "</motifs>\n");
}
static void print_meme_motifs_xml ( MODEL * model , DATASET * dataset , int nmotifs , MOTIF_SUMMARY * motif_summaries , FILE * outfile ) { fprintf ( outfile , " \n " ) ; int i = 0 ; for ( i = 0 ; i < nmotifs ; i ++ ) { fprintf ( outfile , " \" \" \" \" \" \" \" \" \" \" " " \" \" \" \" " " \" \" \" \" \" \" \" \" " " \" \" \n " , i + 1 , motif_summaries [ i ] . consensus , i + 1 , motif_summaries [ i ] . width , motif_summaries [ i ] . num_sites , motif_summaries [ i ] . ic , motif_summaries [ i ] . re , motif_summaries [ i ] . llr , motif_summaries [ i ] . p_value_mant , motif_summaries [ i ] . p_value_exp , motif_summaries [ i ] . e_value_mant , motif_summaries [ i ] . e_value_exp , motif_summaries [ i ] . bayes , motif_summaries [ i ] . elapsed_time ) ; print_meme_pssm_xml ( motif_summaries [ i ] . pssm , dataset -> alph , motif_summaries [ i ] . width , outfile ) ; print_meme_psfm_xml ( motif_summaries [ i ] . psfm , dataset -> alph , motif_summaries [ i ] . width , outfile ) ; print_meme_regular_expression_xml ( motif_summaries [ i ] . regexp , outfile ) ; print_meme_contributing_sites_xml ( model , & ( motif_summaries [ i ] ) , dataset , outfile ) ; fprintf ( outfile , " \n " ) ; } fprintf ( outfile , " \n " ) ; }
print_meme_motifs_xml
Print XML elements for the motifs.
print_meme_motifs_xml Print XML elements for the motifs .
// the model IN  // the dataset IN  // number of motifs IN  // List of final motif properties IN  // output file IN  //"<motif id=\"motif_%d\" name=\"%d\" width=\"%d\" sites=\"%d\"" // TLB: new name for motifs // TLB: include alternate name 'MEME-i'