<!-- Document definition -->
<!DOCTYPE MEME[
<!ELEMENT MEME (
  training_set,
  model, 
  motifs, 
  scanned_sites_summary?
)>
<!ATTLIST MEME 
  version CDATA #REQUIRED
  release CDATA #REQUIRED
>
<!-- Training-set elements -->
<!ELEMENT training_set (alphabet, ambigs, sequence+, letter_frequencies)>
<!ATTLIST training_set datafile CDATA #REQUIRED length CDATA #REQUIRED>
<!ELEMENT alphabet (letter+)>
<!ATTLIST alphabet id (amino-acid|nucleotide) #REQUIRED
                   length CDATA #REQUIRED>
<!ELEMENT ambigs (letter+)>
<!ELEMENT letter EMPTY>
<!ATTLIST letter id ID #REQUIRED>
<!ATTLIST letter symbol CDATA #REQUIRED>
<!ELEMENT sequence EMPTY>
<!ATTLIST sequence id ID #REQUIRED
                   name CDATA #REQUIRED
                   length CDATA #REQUIRED
                   weight CDATA #REQUIRED
>
<!ELEMENT letter_frequencies (alphabet_array)>

<!-- Model elements -->
<!ELEMENT model (
  command_line,
  host,
  type,
  nmotifs,
  evalue_threshold,
  object_function,
  min_width,
  max_width,
  minic,
  wg,
  ws,
  endgaps,
  minsites,
  maxsites,
  wnsites,
  prob,
  spmap,
  spfuzz,
  prior,
  beta,
  maxiter,
  distance,
  num_sequences,
  num_positions,
  seed,
  seqfrac,
  strands,
  priors_file,
  reason_for_stopping,
  background_frequencies
)>
<!ELEMENT command_line (#PCDATA)*>
<!ELEMENT host (#PCDATA)*>
<!ELEMENT type (#PCDATA)*>
<!ELEMENT nmotifs (#PCDATA)*>
<!ELEMENT evalue_threshold (#PCDATA)*>
<!ELEMENT object_function (#PCDATA)*>
<!ELEMENT min_width (#PCDATA)*>
<!ELEMENT max_width (#PCDATA)*>
<!ELEMENT minic (#PCDATA)*>
<!ELEMENT wg (#PCDATA)*>
<!ELEMENT ws (#PCDATA)*>
<!ELEMENT endgaps (#PCDATA)*>
<!ELEMENT minsites (#PCDATA)*>
<!ELEMENT maxsites (#PCDATA)*>
<!ELEMENT wnsites (#PCDATA)*>
<!ELEMENT prob (#PCDATA)*>
<!ELEMENT spmap (#PCDATA)*>
<!ELEMENT spfuzz (#PCDATA)*>
<!ELEMENT prior (#PCDATA)*>
<!ELEMENT beta (#PCDATA)*>
<!ELEMENT maxiter (#PCDATA)*>
<!ELEMENT distance (#PCDATA)*>
<!ELEMENT num_sequences (#PCDATA)*>
<!ELEMENT num_positions (#PCDATA)*>
<!ELEMENT seed (#PCDATA)*>
<!ELEMENT seqfrac (#PCDATA)*>
<!ELEMENT strands (#PCDATA)*>
<!ELEMENT priors_file (#PCDATA)*>
<!ELEMENT reason_for_stopping (#PCDATA)*>
<!ELEMENT background_frequencies (alphabet_array)>
<!ATTLIST background_frequencies source CDATA #REQUIRED>

<!-- Motif elements -->
<!ELEMENT motifs (motif+)>
<!ELEMENT motif (scores, probabilities, regular_expression?, contributing_sites)>
<!ATTLIST motif id ID #REQUIRED
                name CDATA #REQUIRED
                width CDATA #REQUIRED
                sites CDATA #REQUIRED
                llr CDATA #REQUIRED
                ic CDATA #REQUIRED
                re CDATA #REQUIRED
                bayes_threshold CDATA #REQUIRED
                e_value CDATA #REQUIRED
                elapsed_time CDATA #REQUIRED
                url CDATA ""
>
<!ELEMENT scores (alphabet_matrix)>
<!ELEMENT probabilities (alphabet_matrix)>
<!ELEMENT regular_expression (#PCDATA)*>

<!-- Contributing site elements -->
<!-- Contributing sites are motif occurences found during the motif discovery phase -->
<!ELEMENT contributing_sites (contributing_site+)>
<!ELEMENT contributing_site (left_flank, site, right_flank)>
<!ATTLIST contributing_site sequence_id IDREF #REQUIRED
                          position CDATA #REQUIRED
                          strand (plus|minus|none) 'none'
                          pvalue CDATA #REQUIRED
>
<!-- The left_flank contains the sequence for 10 bases to the left of the motif start -->
<!ELEMENT left_flank (#PCDATA)>
<!-- The site contains the sequence for the motif instance -->
<!ELEMENT site (letter_ref+)>
<!-- The right_flank contains the sequence for 10 bases to the right of the motif end -->
<!ELEMENT right_flank (#PCDATA)>

<!-- Scanned site elements -->
<!-- Scanned sites are motif occurences found during the sequence scan phase -->
<!ELEMENT scanned_sites_summary (scanned_sites+)>
<!ATTLIST scanned_sites_summary p_thresh CDATA #REQUIRED>
<!ELEMENT scanned_sites (scanned_site*)>
<!ATTLIST scanned_sites sequence_id IDREF #REQUIRED
                        pvalue CDATA #REQUIRED
                        num_sites CDATA #REQUIRED>
<!ELEMENT scanned_site EMPTY>
<!ATTLIST scanned_site  motif_id IDREF #REQUIRED
                        strand (plus|minus|none) 'none'
                        position CDATA #REQUIRED
                        pvalue CDATA #REQUIRED>

<!-- Utility elements -->
<!-- A reference to a letter in the alphabet -->
<!ELEMENT letter_ref EMPTY>
<!ATTLIST letter_ref letter_id IDREF #REQUIRED>
<!-- A alphabet-array contains one floating point value for each letter in an alphabet -->
<!ELEMENT alphabet_array (value+)>
<!ELEMENT value (#PCDATA)>
<!ATTLIST value letter_id IDREF #REQUIRED>

<!-- A alphabet_matrix contains one alphabet_array for each position in a motif -->
<!ELEMENT alphabet_matrix (alphabet_array+)>

]>
