JAL-629 JAL-4265 JAL-4269 Updated help Documentation
authorBen Soares <b.soares@dundee.ac.uk>
Tue, 19 Sep 2023 23:32:46 +0000 (00:32 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Tue, 19 Sep 2023 23:32:46 +0000 (00:32 +0100)
help/help/html/features/clarguments-basic.html
help/help/html/features/clarguments-reference.html

index 7eb2294..0307494 100644 (file)
@@ -50,7 +50,7 @@
   <h2><a name="openingalignments"></a>Opening alignments (<code>--open</code>, <code>--append</code>, <code>--new</code>)</h2>
 
   <p>
-  To simply open one or more alignment files in different windows just put the filenames as the first arguments:
+  To simply open one or more alignment files in different alignment windows just put the filenames as the first arguments:
   <pre>
   jalview filename1 filename2 ...
   </pre>
 
   <h2><a name="alignmentoptions"></a>Alignment options (<code>--colour</code>, <code>--wrap</code>, <code>--showannotations</code>, <code>--title</code>)</h2>
 
+  <p>
+  An opened alignment window (or set of opened alignment windows) can be modified in its appearance using the following arguments before the next <code>--open</code> argument.  These modifying arguments apply to the one or more files that were opened with the preceding <code>--open</code> argument.  E.g. <code>--open file.fa --colour gecos-flower</code> will colour the one alignment window with <code>file.fa</code>.  However, <code>--open *.fa --colour gecos-flower</code> will colour every alignment window matching <code>file*.fa</code>, and <code> --open file1.fa file2.fa --colour gecos-flower</code>
+  will colour both opened alignment windows.
+  </p>
+
   <h3><a name="colour"></a><code>--colour</code></h3>
 
   <p>
   </p>
 
   <h3><a name="image"></a><code>--image</code></h3>
-  To export the open alignment window as an image, use the <code>--image</code> argument, which will give an image of the alignment and annotations as it appears (or would appear if not in <code>--headless</code> mode) in the alignment window if it was large enough for the whole alignment, including colour choice and features.
+  <p>
+  To export the open alignment window as an image, use the <code>--image</code> argument, which will give an image of the alignment and annotations as it appears (or would appear if not in <code>--headless</code> mode) in the alignment window if it was large enough for the whole alignment, including colour scheme and features.
+  </p>
+  <p>
+  <pre>
+  jalview --open examples/plantfdx.fa --colour gecos-blossom --features examples/plantfdx.features --annotations examples/plantfdx.annotations --image plantfdx.png --headless
+  </pre>
+  </p>
+
+  <h3><a name="image"></a><code>--structureimage</code></h3>
+  <p>
+  To export an open structure as an image, use the <code>--structureimage</code> argument, which will give an image of the structure as it appears (or would appear if not in <code>--headless</code> mode) in a Jmol window including colour scheme. <code>--structureimage</code> can currently only be used with structures opened with the <code>jmol</code> structureviewer (the default viewer).
+  </p>
   <p>
   <pre>
   jalview --open examples/plantfdx.fa --colour gecos-blossom --features examples/plantfdx.features --annotations examples/plantfdx.annotations --image plantfdx.png --headless
   </p>
 
   <p>
-  This by default produces a PNG image of screen or webpage resolution, which you may want to improve upon.  There are two ways of doing this with Jalview: increasing the scale of the PNG image, or using a vector based image format (EPS, SVG, HTML).
+  These by default produce a PNG image of screen or webpage resolution, which you will probably want to improve upon.  There are two ways of doing this with Jalview: increasing the scale of the PNG image, or using a vector based image format (EPS, SVG, HTML).
   <p>
 
   <h3><a name="bitmap"></a>Bitmap image types (<code>png</code>)</h3>
   </pre>
   </p>
 
+  <h3><a name="height"></a><code>--imagecolour</code></h3>
+
+  <p>
+  Specify a colour scheme to use just for this image using the <code>--imagecolour</code> argument:
+  <pre>
+  jalview --open examples/uniref50.fa --colour gecos-flower --image uniref50-residues.png --height 2160 --image uniref50-helix.png --imagecolour helix-propensity --width 800 --image uniref50-turn.png --imagecolour turn-propensity --width 800
+  </pre>
+  </p>
+
+  <h3><a name="height"></a><code>--bgcolour</code></h3>
+
+  <p>
+  <strong>Only applies to <code>--structureimage</code>.</strong> Specify a background colour for a structure image.  The colour can be specified as a named colour recognised by Java (e.g. <code>"white"</code>, <code>"cyan"</code>) or as a #RRGGBB hash-6-digit-hex-string as used in web pages (e.g. <code>"#ffffff"</code>, <code>"#00ffff"</code>).  Note that if you're using a hash in a bash-like shell then you should quote the string to avoid problems with it being interpreted as a comment character.
+  </p>
+  <p>
+  E.g.
+  <pre>
+  jalview --open examples/uniref50.fa --colour gecos-sunset --structure examples/AF-P00221-F1-model_v4.pdb --seqid FER1_SPIOL --structureimage temp.png  --bgcolour magenta
+  </pre>
+  </p>
+
   <p>
   Next we look at vector image formats, which maintain detail at all resolutions.
   </p>
   </p>
 
   <p>
+  Specifically for <code>--structureimage</code> output, you can also use substitutions using parts of the structure filename:
+  <ul>
+  <li><code>{structuredirname}</code> -- is replaced by the directory path to the opened structure file.</li>
+  <li><code>{structurebasename}</code> -- is replaced by the base of the filename of the opened structure file. This is without the path or file extension (if there is one).</li>
+  <li><code>{structureextension}</code> -- is replaced by the extension of the filename of the opened structure file.</li>
+  </ul>
+  </p>
+
+  <p>
   These filename substitutions are on by default, but if for whatever reason you wish to disable the substitutions, they can be turned off (or back on again) through the list of arguments with:
   </p>
 
   <h2><a name="alloutputwildcard"></a>The all output wildcard: <code>--output "*.ext"</code>,  <code>--image "*.ext"</code></h2>
 
   <p>
-  Purely as an intuitive syntactic sweetener, you can use the <code>--output</code> wildcard <code>*</code> <em>at the beginning of the output filename</em> as shorthand for <code>--all --output {dirname}/{basename}</code> followed by whatever you put after the '<code>*</code>'.  For example, to achieve the same as the thumbnails example above, you could use
+  Purely as an intuitive syntactic sweetener, you can use the <code>--output</code> wildcard <code>*</code> in two places as part of an output path and filename.
+  </p>
+
+  <p>
+  Using an asterisk (<code>*</code>) as a filename before an extension, e.g. <code>--image "tmp/*.png"</code> will result in that asterisk being treated as a <code>{basename}</code> substitution.
+  </p>
+
+  <p>
+  Using an asterisk (<code>*</code>) before a file separator (usually </code>/</code>), e.g. <code>--image "tmp/*/file1.png"</code> will result in that asterisk being treated as a <code>{dirname}</code> substitution.
+  </p>
+
+  <p>
+  You can combine these, using an asterisk (<code>*</code>) before and after the last file separator, e.g. <code>--image "tmp/*/*.png"</code> will result in being substituted like <code>tmp/{dirname}/{basename}.png</code>.
+  </p>
+
+  <p>
+  For example, to achieve the same as the thumbnails example above, you could use
   <pre>
-  jalview --open */*.fa --image "*.png" --colour gecos-flower --width 256 --height 256 --close --headless
+  jalview --open */*.fa --image "*/*.png" --colour gecos-flower --width 256 --height 256 --close --headless
   </pre>
   Here we move the <code>--colour</code> argument after the <code>--output</code> argument (it will still be applied before the image export or file output) so that it is included after the implied <code>--all</code> argument.  The thumbnails will be placed in the same directory as the alignment file with the same filename except for a different extension of <code>.png</code>.
   </p>
index 60951d8..484d62a 100644 (file)
@@ -35,7 +35,6 @@
   <li><a href="#processingalignments">Processing alignments</a></li>
   <li><a href="#outputtingalignmentfiles">Outputting alignment files</a></li>
   <li><a href="#exportingimagefiles">Exporting image files</a></li>
-  <li><a href="#exporting3dstructureimagefiles">Exporting 3D structure image files</a></li>
   <li><a href="#controllingflowofarguments">Controlling flow of arguments</a></li>
   </ul>
 
     <td align="center">&#x2713;</td>
     </tr>
 
+    <tr valign="top">
+    <td><code>&#8209;&#8209;mkdirs</code></td>
+    <td>Enable automatic creation of new directories and parent directories for filenames given, or created through substitutions, in <code>--output</code>, <code>--image</code> or <code>--structureimage</code> arguments.
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+
+
+Automatically create directories when outputting a file to a new directory
   </table>
 
 
     <code>biojs</code>.
     </td>
     <td>
-      <code>type=<em>name</em>,
-      <code>textrenderer=<em>name</em>,
-      <code>scale=<em>number</em>,
-      <code>width=<em>number</em>,
-      <code>height=<em>number</em>
+      <code>
+      type=<em>name</em>,
+      <br/>
+      textrenderer=<em>name</em>,
+      <br/>
+      scale=<em>number</em>,
+      <br/>
+      width=<em>number</em>,
+      <br/>
+      height=<em>number</em>,
+      <br/>
+      imagecolour=<em>name</em>
+      </code>
+    </td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;structureimage&nbsp;<em>filename</em></code></td>
+    <td>Export an image of a 3D structure opened in JMOL (currently jmol only).  Each <code>&#8209;&#8209;structureimage</code> filename will output a file for each <code>&#8209;&#8209;structureimage</code> that has been applied to the open alignment window.  In this situation, to avoid overwriting the same file with each structure, additional substitutions <code>{structuredirname}</code>, <code>{structurebasename}</code> and <code>{structureextname}</code> are available being substituted with the directory path, file basename and file extension of each structure file.    Image formats can be:
+    <br/>
+    <code>svg</code>,
+    <br/>
+    <code>png</code>,
+    <br/>
+    <code>eps</code>.
+    </td>
+    <td>
+      <code>
+      type=<em>name</em>,
+      <br/>
+      textrenderer=<em>name</em>,
+      <br/>
+      scale=<em>number</em>,
+      <br/>
+      width=<em>number</em>,
+      <br/>
+      height=<em>number</em>,
+      <br/>
+      imagecolour=<em>name</em>
+      <br/>
+      bgcolour=<em>name</em>
+      </code>
     </td>
     <td align="center">&#x2713;</td>
     </tr>
 
     <tr valign="top">
     <td><code>&#8209;&#8209;type&nbsp;<em>name</em></code></td>
-    <td>Set the image format for the preceding <code>&#8209;&#8209;image</code> to <em>name</em>.  Valid values for <em>name</em> are:
+    <td>Set the image format for the preceding <code>&#8209;&#8209;image</code> or <code>&#8209;&#8209;structureimage</code> to <em>name</em>.  Valid values for <em>name</em> are:
     <br/>
     <code>svg</code>,
     <br/>
 
     <tr valign="top">
     <td><code>&#8209;&#8209;textrenderer&nbsp;<em>name</em></code></td>
-    <td>Sets whether text in a vector image format (SVG, HTML, EPS) should be rendered as text or vector line-art.  Valid values for <em>name</em> are:
+    <td>Sets whether text in a vector image format (SVG, HTML, EPS) should be rendered as text or vector line-art.  Applies to the preceding <code>&#8209;&#8209;image</code> or <code>&#8209;&#8209;structureimage</code>.  Valid values for <em>name</em> are:
     <br/>
     <code>text</code>,
     <br/>
 
     <tr valign="top">
     <td><code>&#8209;&#8209;scale&nbsp;<em>number</em></code></td>
-    <td>Sets a scaling for bitmap image format (PNG).  Should be given as a floating point number.  This can also be set as a sub-value modifier to the <code>--image</code> value.  If used in conjunction with <code>--width</code> and <code>--height</code> then the smallest scaling will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).
+    <td>Sets a scaling for bitmap image format (PNG).  Should be given as a floating point number.  Applies to the preceding <code>&#8209;&#8209;image</code> or <code>&#8209;&#8209;structureimage</code>.  This can also be set as a sub-value modifier to the <code>--image</code> or <code>&#8209;&#8209;structureimage</code> value.  If used in conjunction with <code>--width</code> and <code>--height</code> then the smallest size will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).
     </td>
     <td></td>
     <td align="center">&#x2713;</td>
 
     <tr valign="top">
     <td><code>&#8209;&#8209;width&nbsp;<em>number</em></code></td>
-    <td>Sets a width for bitmap image format (PNG) with the height maintaining the aspect ratio.  Should be given as a positive integer.  This can also be set as a sub-value modifier to the <code>--image</code> value.  If used in conjunction with <code>--scale</code> and <code>--height</code> then the smallest scaling will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).
+    <td>Sets a width for bitmap image format (PNG) with the height maintaining the aspect ratio.  Applies to the preceding <code>&#8209;&#8209;image</code> or <code>&#8209;&#8209;structureimage</code>.  Should be given as a positive integer.  This can also be set as a sub-value modifier to the <code>--image</code> or <code>&#8209;&#8209;structureimage</code> value.  If used in conjunction with <code>--scale</code> and <code>--height</code> then the smallest size will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).
     </td>
     <td></td>
     <td align="center">&#x2713;</td>
 
     <tr valign="top">
     <td><code>&#8209;&#8209;height&nbsp;<em>number</em></code></td>
-    <td>Sets a height for bitmap image format (PNG) with the width maintaining the aspect ratio.  Should be given as a positive integer.  This can also be set as a sub-value modifier to the <code>--image</code> value.  If used in conjunction with <code>--scale</code> and <code>--width</code> then the smallest scaling will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).</td>
+    <td>Sets a height for bitmap image format (PNG) with the width maintaining the aspect ratio.  Applies to the preceding <code>&#8209;&#8209;image</code> or <code>&#8209;&#8209;structureimage</code>.  Should be given as a positive integer.  This can also be set as a sub-value modifier to the <code>--image</code> or <code>&#8209;&#8209;structureimage</code> value.  If used in conjunction with <code>--scale</code> and <code>--width</code> then the smallest size will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).</td>
     <td></td>
     <td align="center">&#x2713;</td>
     </tr>
 
     <tr valign="top">
-    <td><code>&#8209;&#8209;groovy&nbsp;<em>filename</em></code></td>
-    <td>Process a groovy script in the file for the open alignment.</td>
+    <td><code>&#8209;&#8209;bgcolour&nbsp;<em>name</em></code></td>
+    <td>Only applies to structure images (opened with <code>jmol</code> structure viewer).  Sets the background colour of the preceding <code>&#8209;&#8209;structureimage</code>.  <em>name</em> should be either a named colour (e.g. <code>white</code>, <code>cyan</code>) known to Jmol, or can be given as a six digit RGB hex string preceded by a hash (#) character (e.g. <code>#ffffff</code>, <code>00ffff</code>).  Note that you made need to quote a hashed RGB hex string.  This can also be set as a sub-value modifier to the <code>--structureimage</code> value.</td>
     <td></td>
     <td align="center">&#x2713;</td>
     </tr>
 
-  </table>
-
-
-  <h2><a name="exporting3dstructureimagefiles"></a>Exporting 3D structure image files (<code>jmol</code> only)</h2>
-
-  <table border="1" cellpadding="3">
     <tr valign="top">
-    <td><strong>argument</strong></td>
-    <td><strong>action</strong></td>
-    <td><strong>sub-value modifiers</strong> (optional)</td>
-    <td><strong>linked</strong> (optional)</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;structureimage&nbsp;<em>filename</em></code></td>
-    <td>Export an image of a 3D structure opened in JMOL.  Image formats can be:
-    <br/>
-    <code>svg</code>,
-    <br/>
-    <code>png</code>,
-    <br/>
-    <code>eps</code>.
-    </td>
-    <td>
-      <code>structureimagetype=<em>name</em>,
-      <code>structureimagetextrenderer=<em>name</em>,
-      <code>structureimagescale=<em>number</em>,
-      <code>structureimagewidth=<em>number</em>,
-      <code>structureimageheight=<em>number</em>
-    </td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;structureimagetype&nbsp;<em>name</em></code></td>
-    <td>Set the structure image format for the preceding --structureimage. Valid values are:
-    <br/>
-    <code>svg</code>,
-    <br/>
-    <code>png</code>,
-    <br/>
-    <code>eps</code>.
-    </td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;structureimagetextrenderer&nbsp;<em>name</em></code></td>
-    <td>Sets whether text in a vector structure image format (SVG, EPS) should be rendered as text or vector line-art. Possible values are:
-    <br/>
-    <code>text</code>,
-    <br/>
-    <code>lineart</code>.
-    </td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;structureimagescale&nbsp;<em>number</em></code></td>
-    <td>Sets a scaling for bitmap structure image format (PNG). Should be given as a floating point number. If used in conjunction with --structureimagewidth and --structureimageheight then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).
-    </td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;structureimagewidth&nbsp;<em>number</em></code></td>
-    <td>Sets a width for bitmap structure image format (PNG) with the height maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --structureimagescale and --structureimageheight then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).
-    </td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;structureimageheight&nbsp;<em>number</em></code></td>
-    <td>Sets a height for bitmap structure image format (PNG) with the width maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --structureimagescale and --structureimagewidth then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).
-    </td>
+    <td><code>&#8209;&#8209;groovy&nbsp;<em>filename</em></code></td>
+    <td>Process a groovy script in the file for the open alignment.</td>
     <td></td>
     <td align="center">&#x2713;</td>
     </tr>
     <tr valign="top">
     <td><code>&#8209;&#8209;substitutions / &#8209;&#8209;nosubstitutions</code></td>
     <td>The following argument values allow (or don't allow) subsituting filename parts.  This is initially true.  Valid substitutions are
+    <br/>
     <code>{basename}</code> - the filename-without-extension of the currently <code>&#8209;&#8209;open</code>ed file (or first <code>&#8209;&#8209;append</code>ed file),
     <br/>
     <code>{dirname}</code>, - the directory (folder) name of the currently <code>&#8209;&#8209;open</code>ed file (or first <code>&#8209;&#8209;append</code>ed file),
+    <code>{extension}</code>, - the extension of the filename of the currently <code>&#8209;&#8209;open</code>ed file (or first <code>&#8209;&#8209;append</code>ed file),
     <br/>
     <code>{argfilebasename}</code> - the filename-without-extension of the current <code>&#8209;&#8209;argfile</code>,
     <br/>
     <code>{argfiledirname}</code> - the directory (folder) name of the current <code>&#8209;&#8209;argfile</code>,
     <br/>
+    <code>{structurebasename}</code> - the filename-without-extension of the <code>&#8209;&#8209;structure</code> file.  Only available to <code>&#8209;&#8209;structureimage</code> .
+    <br/>
+    <code>{structuredirname}</code>, - the directory (folder) name of the <code>&#8209;&#8209;structure</code> file.  Only available to <code>&#8209;&#8209;structureimage</code> .
+    <br/>
+    <code>{structureextension}</code>, - the extension of the filename of the <code>&#8209;&#8209;structure</code> file.  Only available to <code>&#8209;&#8209;structureimage</code> .
+    <br/>
     <code>{n}</code> - the value of the index counter (starting at 0).
     <br/>
-    <code>{++n}</code> - increase and substitute the value of the index counter,
+    <code>{++n}</code> - increase and substitute the value of the index counter.
+    <br/>
+    <code>{m}</code> - the value of the on-the-fly counter (starting at 0).  Only available to <code>&#8209;&#8209;structureimage</code> .
+    <br/>
+    <code>{++m}</code> - increase and substitute the (incremented) value of the on-the-fly counter.  Only available to <code>&#8209;&#8209;structureimage</code> .
     <br/>
     <code>{}</code> - the value of the current alignment window <em>default</em> index.
     </td>