**What it does**

This tool trains the complete genefinding system mGene. Based on a
sequence file given in FASTA format and a set of annotated genes in
GFF3 format, mGene learns to predict gene structures on genomic
DNA sequences. The output is an internal data structure (TmGP) containing the trained
gene predictor that can be used with the mGenePredict tool to predict
genes.

For some organisms, we have already trained an mGene model, which can be
used to generate predictions. We recommend that the user check if the
organism of interest is on this list (see the mGenePredict tool). If
it is, training might not be necessary. Usually the
pre-trained model will be more accurate than a user-trained model, since
we have taken particular care in the choice of training data and also
perform a more extensive model selection than what is possible for the
user. **Also, we would like to ask users who are interested in a fair
comparison of mGene with other gene prediction systems on a particular
set of data to contact us directly.**

**Input**

* To run an example, use the provided example data sets (FASTA and GFF3
  file) in ./examples.

* To run the tool on your own data, make sure the DNA sequence is
  available in FASTA format and the genome annotation in GFF3 or GTF
  format.

**Common Mistakes**

* Coordinates given in the GFF3 file need to correspond to the
  sequence file (e.g., if you use the *C.elegans* genome annotation WS160
  with the sequence WS180, the program will obviously not work).

* The Seqids given in the first column of the GFF3 file should be 
  identical to the ones used in the description lines of the FASTA file
  (e.g., if you use 'chr1', 'chr2' as sequids and 'I','II' in the FASTA
  file, the program will not be able to assign the right
  sequence to the annotated genes).

* The complete annotation file will be parsed for lines of the
  following types (column 3): 'genes', 'mRNA', 'five_prime_UTR',
  'three_prime_UTR', 'CDS', 'coding_exon' and 'exon' . If you use it
  for training mGene, you might want to exclude annotations that are
  themselves derived from other gene finders, otherwise mGene might
  learn to imitate the mistakes made by the other system. Also, if the GFF3
  file contains pseudogenes, or non-coding RNAs, you might want to
  filter them out beforehand.

* If the annotation file contains too few genes, training might not
  work, or the performance could be extremely weak. In such a case,
  there will be a warning in the output file.


**Output**

* The output is an internal data structure (TmGP) containing the
  trained gene predictor, which can be used with the mGenePredict tool
  to predict genes. The reported text file contains some performance
  estimates for the individual signals and contents (e.g., splice sites or
  transcription start site predictor, etc). **If you wish to share
  your model for a new organism, we invite you to contact us and we will
  include it in our list of pre-trained models.**

------

**About formats**


**FASTA format** A sequence in FASTA format begins with a single-line
description, followed by lines of sequence data. The description line
is distinguished from the sequence data by a "greater than" (>) symbol
in the first column. The token until the first space or the end of the 
line is used as an identifier for the sequence. The remainder of the 
description line is ignored.

An example sequence in FASTA format is:

>CHR1

CCCTAAACCCTAAACCCTAAACCCTAAACCTCTGAATCCTTAATCCCTAAATCCCTAAAT
CTTTAAATCCTACATCCATGAATCCCTAAATACCTAATTCCCTAAACCCGAAACCGGTTT
CTCTGGTTGAAAATCATTGTGTATATAATGATAATTTTATCGTTTTTATGTAATTGCTTA
TTGTTGTGTGTAGATTTTTTAAAAATATCATTTGAGGTCAATACAAATCCTATTTCTTGT
GGTTTTCTTTCCTTCACTTAGCTATGGATGGTTTATCTTCATTTGTTATATTGGATACAA
GCTTTGCTACGATCTACATTTGGGAATGTGAGTCTCTTATTGTAACCTTAGGGTTGGTTT
ATCTCAAGAATCTTATTAATTGTTTGGACTGTTTATGTTTGGACATTTATTGTCATTCTT
ACTCCTTTGTGGAAATGTTTGTTCTATCAATTTATCTTTTGTGGGAAAATTATTTAGTTG
TAGGGATGAAGTCTTTCTTCGTTGTTGTTACGCTTGTCATCTCATCTCTCAATGATATGG
GATGGTCCTTTAGCATTTATTCTGAAGTTCTTCTGCTTGATGATTTTATCCTTAGCCAAA
AGGATTGGTGGTTTGAAGACACATCATATCAAAAAAGCTATCGCCTCGACGATGCTCTAT
TTCTATCCTTGTAGCACACATTTTGGCACTCAAAAAAGTATTTTTAGATGTTTGTTTTGC
...

**GFF3 format** General Feature Format is a format for describing genes
and other features associated with DNA, RNA, and protein sequences. GFF
lines have nine tab-separated fields:

    1. seqname - The name of the chromosome or scaffold (e.g., chr1, chrY_random).
    2. source - The program that generated this feature.
    3. feature - The name of this type of feature. Some examples of standard feature types are "CDS", "start_codon", "stop_codon", and "exon".
    4. start - The starting position of the feature in the sequence. (The first base on a chromosome is numbered 1.)
    5. end - The ending position of the feature (inclusive).
    6. score - A score between 0 and 1000. If there is no score value, enter ".".
    7. strand - Defines the strand - either '+' or '-'.
    8. frame - If the feature is a coding exon, *frame* should be a number between 0 and 2 that represents the reading frame of the first base. If the feature is not a coding exon, the value should be '.'.
    9. group - All lines with the same group are linked together into a single item.

For more information see http://www.sequenceontology.org/gff3.shtml


**TmGP format** Trained mGene Predictor is an internal structure that
contains the complete trained model including all signal and content
predictors as well as the gene predictor to predict genes from DNA
sequences.
