deps/kb_meme/meme-5.0.1/src/beadstring.c
/**********************************************************************
 * This function saves the sequences containing a hit to a motif
 * which is greater than the output p/q-value threshold. If the sequence
 * is less then 10k in length, a copy of the complete sequence will be
 * saved.
 *********************************************************************/
This function saves the sequences containing a hit to a motif
which is greater than the output p/q-value threshold. If the sequence
is less then 10k in length, a copy of the complete sequence will be
saved.
This function saves the sequences containing a hit to a motif which is greater than the output p / q - value threshold . If the sequence is less then 10k in length a copy of the complete sequence will be saved .
void print_sequences(FILE *out, OPTIONS_T *options, CISML_T *cisml) {
  SEQ_T* sequence = NULL;
  const int max_size_recorded = 10000;
  fputs("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n", out);
  fputs("<matched-sequences>\n", out);
  FILE* fasta_file = NULL;
  if (open_file(options->seq_filename, "r", true, "FASTA", "sequences", &fasta_file) == 0) {
    die("Couldn't open the file %s.\n", options->seq_filename);
  }
  while (read_one_fasta(options->alphabet, fasta_file, MAX_SEQ, &sequence)) {
    char *seq_name = get_seq_name(sequence);
    int seq_length = get_seq_length(sequence);
    if (seq_length <= max_size_recorded) {
      char *raw_sequence = get_raw_sequence(sequence);
      fprintf(
        out,
        "<sequence name=\"%s\" length=\"%d\">\n%s\n",
        seq_name,
        seq_length,
        raw_sequence
      );
      fprintf(out, "</sequence>\n");
    }
    else {
      fprintf(
        out,
        "<sequence name=\"%s\" length=\"%d\"\\>\n",
        seq_name,
        seq_length
      );
    }
  }
  fputs("</matched-sequences>\n", out);
  fclose(fasta_file);
}
void print_sequences ( FILE * out , OPTIONS_T * options , CISML_T * cisml ) { SEQ_T * sequence = NULL ; const int max_size_recorded = 10000 ; fputs ( " \" \" \" \" \" \" \n " , out ) ; fputs ( " \n " , out ) ; FILE * fasta_file = NULL ; if ( open_file ( options -> seq_filename , " " , true , " " , " " , & fasta_file ) == 0 ) { die ( " \n " , options -> seq_filename ) ; } while ( read_one_fasta ( options -> alphabet , fasta_file , MAX_SEQ , & sequence ) ) { char * seq_name = get_seq_name ( sequence ) ; int seq_length = get_seq_length ( sequence ) ; if ( seq_length <= max_size_recorded ) { char * raw_sequence = get_raw_sequence ( sequence ) ; fprintf ( out , " \" \" \" \" \n \n " , seq_name , seq_length , raw_sequence ) ; fprintf ( out , " \n " ) ; } else { fprintf ( out , " \" \" \" \" \\ \n " , seq_name , seq_length ) ; } } fputs ( " \n " , out ) ; fclose ( fasta_file ) ; }
This function saves the sequences containing a hit to a motif
 which is greater than the output p/q-value threshold.
This function saves the sequences containing a hit to a motif which is greater than the output p / q - value threshold .
// Open the FASTA file for reading. // Read the FASTA file one sequence at a time. // FIXME Only print those sequences that contain a matched element // If sequence is less then limit record raw sequence // Just record name and length