AcePerl
view release on metacpan or search on metacpan
docs/GFF_Spec.html view on Meta::CPAN
Fields are:
<seqname> <source> <feature> <start> <end> <score> <strand> <frame> [group]>[comments] <P>
<dl>
<dt><seqname>
<dd>The name of the sequence. Having an explicit sequence name
allows a feature file to be prepared for a data set of multiple
sequences. Normally the seqname will be the identifier of the
sequence in an accompanying fasta format file. An alternative is that
'seqname' is the identifier for a sequence in a public database, such
as an EMBL/Genbank/DDBJ accession number. Which is the case, and
which file or database to use, should be explained in accompanying
information.<P>
<dt><source>
<dd> The source of this feature. This field will normally be used to
indicate the program making the prediction, or if it comes from public
database annotation, or is experimentally verified, etc.<P>
<dt><feature>
<dd> The feature type name. We hope to suggest a standard set of
features, to facilitate import/export, comparison etc.. Of course,
people are free to define new ones as needed. For example, Genie
splice detectors account for a region of DNA, and multiple detectors
may be available for the same site, as shown above.<P>
<A name="standard_feature_table">
(<b>Version 2 change</b>: <u>Standard Table of Features</u> -
we would like to enforce a standard nomenclature for
common GFF features. This does not forbid the use of other features,
rather, just that if the feature is obviously described in the standard
list, that the standard label should be used. For this standard table
we propose to fall back on the international public standards for genomic
database feature annotation, specifically, the
<a href="http://www.ebi.ac.uk/ebi_docs/embl_db/ft/feature_key_ref.html">
DDBJ/EMBL/GenBank feature table</a>).<P>
<dt><start>, <end>
<dd> Integers. <start> must be less than or equal to
<end>. Sequence numbering starts at 1, so these numbers
should be between 1 and the length of the relevant sequence,
inclusive. (<b>Version 2 change</b>: version 2 condones values of
<start> and <end> that extend outside the
reference sequence. This is often more natural when dumping from
acedb, rather than clipping. It means that some software using the
files may need to clip for itself.)<P>
<dt><score>
<dd> A floating point value. When there is no score (i.e. for a
sensor that just records the possible presence of a signal, as for the
EMBL features above) you should use '.'. (<b>Version 2 change</b>: in
version 1 of GFF you had to write 0 in such circumstances.)<P>
<dt><strand>
<dd> One of '+', '-' or '.'. '.' should be used when
strand is not relevant, e.g. for dinucleotide repeats.<P>
<dt><frame>
<dd> One of '0', '1', '2' or '.'. '0' indicates that the specified
region is in frame, i.e. that its first base corresponds to the first
base of a codon. '1' indicates that there is one extra base,
i.e. that the second base of the region corresponds to the first base
of a codon, and '2' means that the third base of the region is the
first base of a codon. If the strand is '-', then the first base of
the region is value of <end>, because the corresponding
coding region will run from <end> to <start> on
the reverse strand. As with <strand>, if the frame is not
relevant then set <frame> to '.'.
It has been pointed out that "phase" might be a better descriptor than
"frame" for this field.<P>
<dt><A NAME="group_field">[group] </A>
<dd> An optional string-valued field that can be used as a name to
group together a set of records. Typical uses might be to group the
introns and exons in one gene prediction (or experimentally verified
gene structure), or to group multiple regions of match to another
sequence, such as an EST or a protein. See below for examples.<br>
<b>Version 2 change</b>: In version 2, the optional [group] field on the line
must have an tag value structure following the syntax used within
objects in a .ace file, flattened onto one line by semicolon
separators. Tags must be standard identifiers
([A-Za-z][A-Za-z0-9_]*). Free text values must be quoted with double
quotes. <em>Note: all non-printing characters in such free text value strings
(e.g. newlines, tabs, control characters, etc)
must be explicitly represented by their C (UNIX) style backslash-escaped
representation (e.g. newlines as '\n', tabs as '\t').</em>
As in ACEDB, multiple values can follow a specific tag. The
aim is to establish consistent use of particular tags, corresponding
to an underlying implied ACEDB model if you want to think that way
(but acedb is not required). Examples of these would be:
<font size="3"><pre>
seq1 BLASTX similarity 101 235 87.1 + 0 Target "HBA_HUMAN" 11 55 ; E_value 0.0003
dJ102G20 GD_mRNA coding_exon 7105 7201 . - 2 Sequence "dJ102G20.C1.1"
</pre></font>
</dl>
All strings (i.e. values of the <seqname>,
<source> or <feature> fields) should be under 256
characters long, and should not include whitespace. The whole line
should be under 32k long. A character limit is not very desirable,
but helps write parsers in some languages. The slightly silly 32k
limit is to allow plenty of space for comments/extra data. <b>Version 2 change</b>:
field and line size limitations are removed; however, fields (except the optional
[group] field above) must still not include whitespace.
<P>
All of the above described fields should be separated by TAB characters ('\t').
<b>Version 2 note</b>: previous Version 2 permission to use arbitrary whitespace
as field delimiters is now <b>revoked</b>! (99/02/26)
<P>
<P>
Back to <A HREF="#TOC">Table of Contents</A>
<P>
<HR>
<A NAME="comments"><h3> Comments </h3>
Comments are allowed, starting with "#" as in Perl, awk etc.
Everything following # until the end of the line is ignored.
Effectively this can be used in two ways. Either it must be at the
beginning of the line (after any whitespace), to make the whole line a
comment, or the comment could come after all the required fields on
the line.
<P>
We also permit extra information to be given on the line following the
group field without a '#' character (<b>Version 2 change</b>: this extra
information <B>must</B> be delimited by the '#' comment delimiter <B>OR</B>
by another tab field delimiter character, following
any and all [group] field tag-value pairs).
<P>
This allows extra method-specific information to be transferred with the line. However,
we discourage overuse of this feature: better to find a way to do it
with more true feature lines, and perhaps groups. (<b>Version 2
change</b>: we gave in and defined a structured way of passing
additional information, as described above under [group]. But the
sentiment of this paragraph still applies - don't overuse the
tag-value syntax. The use of tag-value pairs (with whitespace) renders problematic the parsing of
Version 1 style comments (following the group field, without a '#' character), so in Version 2,
such [group] trailing comments <B>must</B> start with the "#", as noted above.
<A NAME="meta_info"><h4> ## comment lines for meta information </h4>
There is a set of standardised (i.e. parsable) ## line types that can
be used optionally at the top of a gff file. The philosophy is a
little like the special set of %% lines at the top of postscript
files, used for example to give the BoundingBox for EPS files.<P>
Current proposed ## lines are:
<dl>
<dt><pre> ##gff-version 1 </pre>
<dd> GFF version - in case it is a real success and we want to
change it. The current version is 2. (<b>Version 2 change</b>!)
<dt><pre> ##source-version {source} {version text} </pre>
<dd> So that people can record what version of a program or package was
used to make the data in this file. I suggest the version is text
without whitespace. That allows things like 1.3, 4a etc.
<dt> <pre> ##date {date} </pre>
<dd> The date the file was made, or perhaps that the prediction
programs were run. We suggest to use astronomical format: 1997-11-08
for 8th November 1997, first because these sort properly, and second
to avoid any US/European bias.
<dt> <pre>
##DNA {seqname}
##acggctcggattggcgctggatgatagatcagacgac
##...
##end-DNA
</pre>
<dd> To give a DNA sequence. Several people have pointed out that it may
be convenient to include the sequence in the file. It should not
become mandatory to do so. Often the seqname will be a well-known
identifier, and the sequence can easily be retrieved from a
database, or an accompanying file.
<dt> <pre> ##sequence-region {seqname} {start} {end} </pre>
<dd> To indicate that this file only contains entries for the
specified subregion of a sequence.
</dl>
Please feel free to propose new ## lines.
The ## line proposal came out of some discussions including Anders
Krogh, David Haussler, people at the Newton Institute on 1997-10-29
and some email from Suzanna Lewis. Of course, naive programs can
ignore all of these...
<A NAME="file_names"><h3> File Naming </h3>
We propose that the format is called "GFF", with conventional file
name ending ".gff".
<P>
Back to <A HREF="#TOC">Table of Contents</A>
<P>
<HR>
<A NAME="semantics"><h2> Semantics </h2>
We have intentionally avoided overspecifying the semantics of the
format. For example, we have not restricted the items expressible in
GFF to a specified set of feature types (splice sites, exons etc.)
with defined semantics. Therefore, in order for the information in a
gff file to be useful to somebody else, the person producing the
features must describe the meaning of the features. <P>
In the example given above the feature "splice5" indicates that there
is a candidate 5' splice site between positions 172 and 173. The
"sp5-20" feature is a prediction based on a window of 20 bp for the
same splice site. To use either of these, you must know the position
within the feature of the predicted splice site. This only needs to
be given once, possibly in comments at the head of the file, or in a
separate document. <P>
Another example is the scoring scheme; we ourselves would like the
score to be a log-odds likelihood score in bits to a defined null
model, but that is not required, because different methods take
different approaches.
Avoiding a prespecified feature set also leaves open the possibility
for GFF to be used for new feature types, such as CpG islands,
docs/GFF_Spec.html view on Meta::CPAN
site, and the sum of the scores of all the codons in between. In such
a case it can be much more efficient to use the GFF format to report
separate scores for the splice site sensors and for the individual
codons in all three (or six, including reverse strand) frames, and let
the program that interprets this file assemble the exon scores. The
exon scores can be calculated efficiently by first creating three
arrays, each of which contains in its [i]th position a value A[i] that
is the partial sum of the codon scores in a particular frame for the
entire sequence from position 1 up to position i. Then for any
positions i < j, the sum of the scores of all codons from i to j can
be obtained as A[j] - A[i]. Using these arrays, along with the
candidate splice site scores, a very large number of scores for
overlapping exons are implicitly defined in a data structure that
takes only linear space with respect to the number of positions in the
sequence, and such that the score for each exon can be retrieved in
constant time. <P>
When the GFF format is used to transmit scores that can be summed for
efficient retrieval as in the case of the codon scores above, we ask
that the provider of the scores indicate that these scores are
summable in this manner, and provide a recipe for calculating the
scores that are to be derived from these summable scores, such as the
exon scores described above. We place no limit on the complexity of
this recipe, nor do we provide a standard protocol for such assembly,
other than providing examples. It behooves the sensor score provider
to keep the recipe simple enough that others can easily implement it.
<P>
Back to <A HREF="#TOC">Table of Contents</A>
<P>
<HR>
<A NAME="mailing_list"><h2> Mailing list </h2>
<P>
There is a <A HREF="mailto:gff-list@sanger.ac.uk"> mailing list </a>
to which you can send comments, enquiries, complaints etc. about GFF.
If you want to be added to the mailing list, please send
mail to <A HREF="mailto:Majordomo@sanger.ac.uk">Majordomo@sanger.ac.uk</A> with the
following command in the body of your email message:
<P>
<code>
subscribe gff-list
</code>
<P>
<P>
Back to <A HREF="#TOC">Table of Contents</A>
<P>
<HR>
<A NAME="edit_history"><h2>Edit History</h2></A>
<P>
971028 rd: I changed the comment initiator to '#' from '//' because a
single symbol is easier for simple parsers.<P>
971028 rd: We also now allow extra text after <group>
without a comment character, because this immediately proved useful.<P>
971028 rd: I considered switching from start-end notation to
start-length notation, on the suggestion of Anders Krogh. This seems
nicer in many cases, but is a debatable point. I then switched back!<P>
971028 rd: I added the section about name space.<P>
971108 rd: added ## line proposals - moved them into main text 971113.<P>
971113 rd: added extra "source" field as discussed at Newton Institute
meeting 971029. There are two main reasons. First, to help prevent
name space clashes -- each program would have their own source
designation. Second, to help reuse feature names, so one could have
"exon" for exon predictions from each prediction program.<P>
971113 rd: added section on mailing list.<P>
980909 ihh: fixed some small things and put this page on the Sanger
GFF site.<P>
981216 rd: introduced version 2 changes.<P>
990226 rbsk: incorporated amendments to the version 2 specification as follows:<P>
<UL>
<LI>Non-printing characters (e.g. newlines, tabs) in Version 2 double quoted
"free text values" must be explicitly represented by their C (UNIX) style
backslash escaped character (i.e. '\t' for tabs, '\n' for newlines, etc.)<br>
<LI>Removed field (256) and line (32K) character size limitations for Version 2.
<LI>Removed arbitrary whitespace field delimiter permission from specification.
TAB ('\t') field delimiters now enforced again, as in Version 1.<br>
</UL>
990317 rbsk:
<UL>
<LI>End of line comments following Version 2 [group] field tag-value structures must be
tab '\t' or hash '#' delimited.
</UL>
<P>
<P>
Back to <A HREF="#TOC">Table of Contents</A>
<P>
<HR>
<A NAME="authors"><h2>Authors</h2></A>
<P>
GFF Protocol Specification initially proposed by:
<A HREF="mailto:rd@sanger.ac.uk">Richard Durbin</a> and
<A HREF="mailto:haussler@cse.ucsc.edu">David Haussler</a>
<P>with amendments proposed by:
<A HREF="mailto:lstein@cshl.org">Lincoln Stein</a>, Anders Krogh and others.
<P>The GFF specification now maintained at the Sanger Centre by
<A HREF="mailto:rbsk@sanger.ac.uk">Richard Bruskiewich</a>
<P>
Back to <A HREF="#TOC">Table of Contents</A>
<P>
<!-- page content ends here -->
</TD></TR></TABLE></CENTER> <!-- close table for page content -->
<HR ALIGN="CENTER" WIDTH="90%">
<!-- open table for page footer -->
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN=LEFT>
<I>
last modified : 25-Mar-1999, 01:59 PM
</I>
</TD>
<TD ALIGN=RIGHT>
<A HREF=/Users/rbsk/>Richard Bruskiewich</A>
<I>(<A HREF=mailto:rbsk@sanger.ac.uk>rbsk@sanger.ac.uk</A>)</I>
</TD>
</TR>
</TABLE> <!-- close table for page footer -->
( run in 0.783 second using v1.01-cache-2.11-cpan-39bf76dae61 )