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

  Print XML elements for the log-odds matrix. See DTD embeded in
  print_meme_header_xml for the description of model XML syntax.
**********************************************************************/
print_meme_pssm_xml
Print XML elements for the log-odds matrix. See DTD embeded in
print_meme_header_xml for the description of model XML syntax.
print_meme_pssm_xml Print XML elements for the log - odds matrix . See DTD embeded in print_meme_header_xml for the description of model XML syntax .
static void print_meme_pssm_xml(
  double **logodds,
  ALPH_T *alph,    
  int width,       
  FILE* outfile    
) {
  int i = 0;
  int j = 0;
  STR_T *b = str_create(3);
  fprintf(outfile, "<scores>\n<alphabet_matrix>\n");
  for (i = 0; i < width; i++) {   
    fprintf(outfile, "<alphabet_array>\n");
    for (j = 0; j < alph_size_core(alph); j++) { 
      fprintf(outfile,
        "<value letter_id=\"%s\">%d</value>\n",
        alph_xml_id(alph, j, b),
        NINT(100*logodds(i,j))
      );
    }
    fprintf(outfile, "</alphabet_array>\n");
  }
  fprintf(outfile, "</alphabet_matrix>\n</scores>\n");
  str_destroy(b, false);
}
static void print_meme_pssm_xml ( double * * logodds , ALPH_T * alph , int width , FILE * outfile ) { int i = 0 ; int j = 0 ; STR_T * b = str_create ( 3 ) ; fprintf ( outfile , " \n \n " ) ; for ( i = 0 ; i < width ; i ++ ) { fprintf ( outfile , " \n " ) ; for ( j = 0 ; j < alph_size_core ( alph ) ; j ++ ) { fprintf ( outfile , " \" \" \n " , alph_xml_id ( alph , j , b ) , NINT ( 100 * logodds ( i , j ) ) ) ; } fprintf ( outfile , " \n " ) ; } fprintf ( outfile , " \n \n " ) ; str_destroy ( b , false ) ; }
print_meme_pssm_xml
Print XML elements for the log-odds matrix.
print_meme_pssm_xml Print XML elements for the log - odds matrix .
// pointer to matrix of log-odds scores IN  // alphabet IN // width of the motif IN  // pointer to output file IN  // site position  // letter 