JAL-2843 tweaks to help text for filters
[jalview.git] / help / html / features / featuresFormat.html
index 8e6ee13..4d13dcd 100755 (executable)
-<html>\r
-\r
-<head><title>Features File Format</title></head>\r
-\r
-<body>\r
-<p><strong>Sequence Features File Format</strong></p>\r
-<p>(Prior to version 2.08 known as the &quot;Groups file&quot;)<br>\r
-  A precalculated Features file can read onto an alignment from the command line \r
-  (&quot;-features&quot;), by drag and dropping the features file onto an alignment \r
-  or by selecting from the File menu &quot;Load Features / Annotations&quot;.</p>\r
-<p>Specify the feature types first, then refer to the feature type for each sequence.</p>\r
-<p>featureType&lt;tab&gt;colour<br>\r
-  description&lt;tab&gt;sequenceId&lt;tab&gt;sequenceIndex&lt;tab&gt;start&lt;tab&gt;end&lt;tab&gt;featureType</p>\r
-<p>eg<br>\r
-  <font size="2" face="Courier New, Courier, mono">domain red<br>\r
-  metal ion-binding site 00ff00<br>\r
-  transit peptide 0,105,215<br>\r
-  chain 225,105,0<br>\r
-  modified residue 105,225,35<br>\r
-  signal peptide 0,155,165<br>\r
-  Your Own description here FER_CAPAA -1 3 93 domain<br>\r
-  Your Own description here FER_CAPAN -1 48 144 chain<br>\r
-  Your Own description here FER_CAPAN -1 50 140 domain<br>\r
-  Your Own description here FER_CAPAN -1 136 136 modified residue<br>\r
-  Your Own description here FER1_LYCES -1 1 47 transit peptide<br>\r
-  Your Own description here Q93XJ9_SOLTU -1 1 48 signal peptide<br>\r
-  Your Own description here Q93XJ9_SOLTU -1 49 144 chain</font></p>\r
-<p>An additional option in Jalview 2.08 is to group features in the following \r
-  way: </p>\r
-<p><font size="2" face="Georgia, Times New Roman, Times, serif">STARTGROUP&lt;tab&gt;My feature groupA<br>\r
-  ....Many Feature descriptions here<br>\r
-  ENDGROUP&lt;tab&gt;My feature groupA</font><br>\r
-</p>\r
-</body>\r
-</html>\r
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ -->
+<head>
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Sequence Features File</title>
+</head>
+<body>
+  <p>
+    <strong>Sequence Features File</strong>
+  <p>
+  <p>The Sequence features file (which used to be known as the
+    "Groups file" prior to version 2.08) is a simple way of getting your
+    own sequence annotations into Jalview. It was introduced to allow
+    sequence features to be rendered in the Jalview applet, and so is
+    intentionally lightweight and minimal because the applet is often
+    used in situations where data file size must be kept to a minimum,
+    and no XML parser is available.</p>
+
+  <p>
+    Features files are imported into Jalview in the following ways:<br>
+  <ul>
+    <li>from the command line <pre>
+<strong> -features &lt;<em>Features filename</em>&gt;</strong>
+</pre>
+    </li>
+
+    <li>Dragging a features file onto an alignment window</li>
+
+    <li>Via the &quot;Load Features / Annotations&quot; entry in
+      the <strong>File</strong> menu of an alignment window.
+    </li>
+  </ul>
+
+  </p>
+
+  <p>
+    <strong>Sequence Features File Format</strong>
+  </p>
+  <p>
+    A features file is a simple ASCII text file, where each line
+    contains tab separated text fields. <strong>No comments are
+      allowed</strong>.
+  </p>
+  <p>
+    <strong>Feature Colours</strong>
+  </p>
+  <p>The first set of lines contain feature type definitions and their colours:
+  <pre>
+<strong><em>Feature label</em>&#9;<em>Feature Colour</em>
+<!-- &#9;<em>Feature links</em>  --></strong>
+</pre>
+
+  A feature type has a text label, and a colour specification. This can
+  be either:
+
+  <ul>
+    <li>A single colour specified as either a red,green,blue 24 bit
+      triplet in hexadecimal (eg. 00ff00) or as comma separated numbers
+      (ranging from 0 to 255))<br>
+      (For help with colour values, see <a href="https://www.w3schools.com/colors/colors_converter.asp">https://www.w3schools.com/colors/colors_converter.asp</a>.)</li>
+
+    <li>A <a href="featureschemes.html">graduated colourscheme</a>
+      specified as a "|" separated list of fields: <pre>
+[label <em>or</em> score<em> or</em> attribute|attName|]&lt;mincolor&gt;|&lt;maxcolor&gt;|[absolute|]&lt;minvalue&gt;|&lt;maxvalue&gt;[|&lt;novalue&gt;][|&lt;thresholdtype&gt;|[&lt;threshold value&gt;]]
+</pre> The fields are as follows:
+
+      <ul>
+        <li><em>label</em><br> Indicates that the feature
+          description should be used to create a colour for features of
+          this type.<br> <em>Note: if no threshold value is
+            needed then only 'label' is required.<br> This
+            keyword was added in Jalview 2.6
+        </em></li>
+
+        <li><em>score</em><br> Indicates that the feature
+          score should be used to create a graduated colour for features of
+          this type, in conjunction with mincolor, maxcolor.<br><em>This keyword was added in Jalview 2.11.
+          It may be omitted (score is the default) if mincolor and maxcolor are specified.
+        </em></li>
+
+        <li><em>attribute|attName</em><br> Indicates that the value of feature
+          attribute 'attName' should be used to create a colour for features of
+          this type.
+          <br>For example, <em>attribute|clinical_significance</em> to colour by clinical_significance.
+          <br>To colour by range of a numeric attribute, include <em>mincolor</em> and <em>maxcolor</em>, or omit to colour by text (category).
+          <br>(Note: the value of the attribute used for colouring will also be shown in the tooltip as you mouse over features.)
+          <br>A sub-attribute should be written as, for example, CSQ:IMPACT.
+          <br><em>This keyword was added in Jalview 2.11</em></li>
+
+        <li><em>mincolor</em> and <em>maxcolor</em><br> Colour
+          triplets specified as hexadecimal or comma separated values
+          (may be left blank for a <em>label</em> style colourscheme,
+          but remember to specify the remaining fields)</li>
+
+        <li><em>absolute</em><br> An optional switch
+          indicating that the <em>minvalue</em> and <em>maxvalue</em>
+          parameters should be left as is, rather than rescaled
+          according to the range of scores for this feature type.</li>
+
+        <li><em>minvalue</em> and <em>maxvalue</em><br>
+          Minimum and maximum values defining the range of scores for
+          which the colour range will be defined over.<br>If minvalue is
+          greater than maxvalue then the linear mapping will have
+          negative gradient.</li>
+
+        <li><em>novalue</em> <br>
+          Specifies the colour to use if colouring by attribute, when the attribute is absent.
+          Valid options are <em>novaluemin, novaluemax, novaluenone</em>, to use mincolor, maxcolor, or no colour.
+          <br>If not specified this will default to novaluemin.</li>
+
+        <li><em>thresholdtype</em><br> Either
+          &quot;none&quot;, &quot;below&quot;, or &quot;above&quot;. <em>below</em>
+          and <em>above</em> require an additional <em>threshold
+            value</em> which is used to control the display of features with
+          a score either below or above the value.</li>
+      </ul>
+    </li>
+  </ul>
+  </p>
+
+  <p>
+    <strong>Feature Filters</strong>
+  </p>
+  <p>This section is optional, and allows one or more filters to be defined for each feature type.
+     <br>Only features that satisfy the filter conditions will be displayed.
+     <br>Begin with a line which is just STARTFILTERS, and end with a line which is just ENDFILTERS.
+     <br>Each line has the format:
+     <pre>featureType <em>&lt;tab&gt;</em> (filtercondition1) [and|or] (filtercondition2) [and|or]...<br></pre>
+     The parentheses are not needed if there is only one condition. 
+     Combine multiple conditions with either <em>and</em> or <em>or</em> (but not a mixture).
+     <br>Each condition is written as:
+     <pre>Label <em>or</em> Score <em>or</em> AttributeName condition [value]</pre>
+     where either the label (description), (numeric) score, or (text or numeric) attribute is tested against the condition.
+     <br><em>condition</em> is not case sensitive, and should be one of
+     <ul>
+     <li><em>Contains</em> - description (or attribute) should contain the given value (not case sensitive); example <em>clinical_significance contains Pathogenic</em></li> 
+     <li><em>NotContains</em> - description (or attribute) should not contain the given value</li> 
+     <li><em>Matches</em> - description (or attribute)  should match the given value (not case sensitive)</li> 
+     <li><em>NotMatches</em> - description (or attribute) should not match the given value (not case sensitive)</li> 
+     <li><em>Present</em> - attribute is present on the feature (no value required); example <em>CSQ:SIFT present</em></li> 
+     <li><em>NotPresent</em> - attribute is not present on the feature (no value required)</li> 
+     <li><em>EQ</em> - feature score, or specified attribute, is equal to the (numeric) value</li> 
+     <li><em>NE, LT, LE, GT, GE</em> - tests for not equal to / less than / less than or equal to / greater than / greater than or equal to the value</li> 
+     </ul>
+     A non-numeric value always fails a numeric test.<br>If either attribute name, or value to compare, contains spaces, then enclose in single quotes:
+     <em>'mutagenesis site' contains 'decreased affinity'</em>
+     <br>Tip: some examples of filter syntax are given below; or to see more, first configure colours and filters in Jalview, then <em>File | Export Features</em> to Textbox in Jalview Format.
+     <br><em>Feature filters were added in Jalview 2.11</em>
+  </p>
+
+  <p>
+    <strong>Feature Instances</strong>
+  </p>
+
+  <p>The remaining lines in the file are the sequence annotation
+    definitions, where the now defined features are attached to regions
+    on particular sequences. Each feature can optionally include some
+    descriptive text which is displayed in a tooltip when the mouse is
+    near the feature on that sequence (and may also be used to generate
+    a colour for the feature).</p>
+
+  <p>
+    If your sequence annotation is already available in <a href="http://gmod.org/wiki/GFF2">GFF2</a> (http://gmod.org/wiki/GFF2) or
+    <a href="https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md">GFF3</a> 
+    (http://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md) format, 
+    then you can leave it as is, after first adding a line containing only
+    'GFF' after any Jalview feature colour definitions (<em>this
+    mixed format capability was added in Jalview 2.6</em>). Alternately,
+    you can use Jalview's own sequence feature annotation format, which
+    additionally allows HTML and URLs to be directly attached to each
+    piece of annotation.
+  </p>
+
+  <p>
+    <strong>Jalview's sequence feature annotation format</strong>
+  </p>
+  <p>Each feature is specified as a tab-separated series of columns
+    as defined below:
+  <pre>
+<em>description</em>&#9;<em>sequenceId</em>&#9;<em>sequenceIndex</em>&#9;<em>start</em>&#9;<em>end</em>&#9;<em>featureType</em>&#9;<em>score (optional)</em>
+</pre>
+
+  This format allows two alternate ways of referring to a sequence,
+  either by its text ID, or its index (base 0) in an associated
+  alignment. Normally, sequence features are associated with sequences
+  rather than alignments, and the sequenceIndex field is given as
+  &quot;-1&quot;. In order to specify a sequence by its index in a
+  particular alignment, the sequenceId should be given as
+  &quot;ID_NOT_SPECIFIED&quot;, otherwise the sequenceId field will be
+  used in preference to the sequenceIndex field.
+  </p>
+
+
+  <p>
+    The description may contain simple HTML document body tags if
+    enclosed by &quot;&lt;html&gt;&lt;/html&gt;&quot; and these will be
+    rendered as formatted tooltips in the Jalview Application (the
+    Jalview applet is not capable of rendering HTML tooltips, so all
+    formatting tags will be removed).<br> <em>Attaching Links
+      to Sequence Features</em><br> Any anchor tags in an html formatted
+    description line will be translated into URL links. A link symbol
+    will be displayed adjacent to any feature which includes links, and
+    these are made available from the <a
+      href="../menus/popupMenu.html#sqid.popup">links submenu</a>
+    of the popup menu which is obtained by right-clicking when a link
+    symbol is displayed in the tooltip.<br> <em>Non-positional
+      features</em><br> Specify the <em>start</em> and <em>end</em> for
+    a feature to be <strong>0</strong> in order to attach it to the
+    whole sequence. Non-positional features are shown in a tooltip when
+    the mouse hovers over the sequence ID panel, and any embedded links
+    can be accessed from the popup menu.<br /> <em>Scores</em><br>
+    Scores can be associated with sequence features, and used to sort
+    sequences or shade the alignment (this was added in Jalview 2.5).
+    The score field is optional, and malformed scores will be ignored.
+  </p>
+
+  <p>Feature annotations can be collected into named groups by
+    prefixing definitions with lines of the form:
+  <pre>
+<strong>startgroup     groupname</strong>
+</pre>
+
+  .. and subsequently post-fixing the group with:
+
+  <pre>
+<strong>endgroup       groupname</strong>
+</pre>
+
+  Feature grouping was introduced in version 2.08, and used to control
+  whether a set of features are either hidden or shown together in the
+  <a href="seqfeatures.html">sequence Feature settings dialog box</a>.
+  </p>
+
+
+  <p>A complete example is shown below :
+  <pre>
+domain&#9;red
+metal ion-binding site&#9;00ff00
+transit peptide&#9;0,105,215
+chain&#9;225,105,0
+modified residue&#9;105,225,35
+signal peptide&#9;0,155,165
+helix&#9;ff0000
+strand&#9;00ff00
+coil&#9;cccccc
+kdHydrophobicity&#9;ccffcc|333300|-3.9|4.5|above|-2.0
+
+STARTFILTERS
+metal ion-binding site&#9;Label Contains sulfur
+kdHydrophobicity&#9;(Score LT 1.5) OR (Score GE 2.8)
+ENDFILTERS
+
+Your Own description here&#9;FER_CAPAA&#9;-1&#9;3&#9;93&#9;domain
+Your Own description here&#9;FER_CAPAN&#9;-1&#9;48&#9;144&#9;chain
+Your Own description here&#9;FER_CAPAN&#9;-1&#9;50&#9;140&#9;domain
+Your Own description here&#9;FER_CAPAN&#9;-1&#9;136&#9;136&#9;modified residue
+Your Own description here&#9;FER1_LYCES&#9;-1&#9;1&#9;47&#9;transit peptide
+Your Own description here&#9;Q93XJ9_SOLTU&#9;-1&#9;1&#9;48&#9;signal peptide
+Your Own description here&#9;Q93XJ9_SOLTU&#9;-1&#9;49&#9;144&#9;chain
+
+STARTGROUP&#9;secondarystucture
+PDB secondary structure annotation&#9;FER1_SPIOL&#9;-1&#9;52&#9;59&#9;strand
+PDB secondary structure annotation&#9;FER1_SPIOL&#9;-1&#9;74&#9;80&#9;helix
+ENDGROUP&#9;secondarystructure
+
+STARTGROUP&#9;kd
+Hydrophobicity score by kD     Q93XJ9_SOLTU    -1      48      48      kdHydrophobicity        1.8
+ENDGROUP&#9;kd
+
+GFF
+FER_CAPAA&#9;GffGroup&#9;domain&#9;3&#9;93&#9;.&#9;.
+</pre>
+</body>
+</html>
+