Skip to content

Commit 444e9e7

Browse files
committed
Update RTG User Manual.
1 parent 2cd69ea commit 444e9e7

File tree

13 files changed

+615
-242
lines changed

13 files changed

+615
-242
lines changed
11.6 KB
Binary file not shown.

installer/resources/core/RTGOperationsManual/_sources/appendix.rst.txt

Lines changed: 89 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ column of the same name.
351351
352352
CHROM; // "1"
353353
POS; // "11259340"
354+
ID; // "."
354355
REF; // "G"
356+
QUAL; // "."
355357
356358
ALT, FILTER
357359
```````````
@@ -378,32 +380,86 @@ declared in the header.
378380
INFO.DP; // "795"
379381
INFO.ABC; // "4,5"
380382
381-
INFO.DPR = "0.01"; // Will change the value of the DPR info field
382-
383383
384384
{SAMPLE\_NAME}.{FORMAT\_FIELD}
385385
``````````````````````````````
386386

387387
The JavaScript String prototype has been extended to allow access to the
388388
format fields for each sample. The string representation of values in
389389
the sample column are accessible as properties on the string matching
390-
the sample name named after the ``FORMAT`` field ``ID`` These properties can
391-
be assigned in order to make modifications. This will be undefined for fields
392-
not declared in the header.
390+
the sample name named after the ``FORMAT`` field ``ID``.
393391

394392
.. code-block:: text
395393
396394
'NA12877'.GT; // "1/2"
397395
'NA12878'.GT; // "1/0"
396+
397+
Note that these properties are only defined for fields that are declared
398+
in the VCF header (any that are not declared in the header will be
399+
undefined). See below for how to add new ``INFO`` or ``FORMAT`` field
400+
declarations.
401+
402+
403+
VCF record modification
404+
~~~~~~~~~~~~~~~~~~~~~~~
405+
406+
Most components of VCF records can be written or updated in a fairly
407+
natural manner by direct assignment in order to make modifications. For
408+
example:
409+
410+
.. code-block:: text
411+
412+
ID = "rs23987382"; // Will change the ID value
413+
QUAL = "50"; // Will change the QUAL value
414+
FILTER = "FAIL"; // Will set the FILTER value
415+
INFO.DPR = "0.01"; // Will change the value of the DPR info field
398416
'NA12877'.DP = "10"; // Will change the DP field of the NA12877 sample
399417
418+
Other components of the VCF record (such as ``CHROM``, ``POS``, ``REF``,
419+
and ``ALT``) are considered immutable and can not currently be altered.
420+
421+
Direct assignment to ``ID`` and ``FILTER`` fields accept either a string
422+
containing semicolon separated values, or a list of values. For example:
423+
424+
.. code-block:: text
425+
426+
ID = 'rs23987382;COSM3805';
427+
ID = ['rs23987382', 'COSM3805'];
428+
FILTER = 'BAZ;BANG';
429+
FILTER = ['BAZ', 'BANG'];
430+
431+
432+
Note that although the ``FILTER`` field returns an array when read, any
433+
changes made to this array directly are not reflected back into the VCF
434+
record.
435+
436+
Adding a filter to existing filters is a common operation and can be
437+
accomplished by the above assignment methods, for example by adding a
438+
value to the existing list and then setting the result:
439+
440+
.. code-block:: text
441+
442+
var f = FILTER;
443+
f.push('BOING');
444+
FILTER = f;
445+
446+
However, since this is a little unwieldy, a convenience function called
447+
`add()` can be used (and may be chained):
448+
449+
.. code-block:: text
450+
451+
FILTER.add('BOING');
452+
FILTER.add(['BOING', 'DOING');
453+
FILTER.add('BOING').add('DOING');
454+
455+
400456
VCF header modification
401457
~~~~~~~~~~~~~~~~~~~~~~~
402458

403-
Functions are provided that allow the addition of new ``INFO`` or ``FORMAT``
404-
fields to the header and records. It is recommended that the following
405-
functions only be used within the run-once portion of ``--javascript``.
406-
They may be called on every record, but this will be slow.
459+
Functions are provided that allow the addition of new ``FILTER``,
460+
``INFO`` and ``FORMAT`` fields to the header and records. It is
461+
recommended that the following functions only be used within the
462+
run-once portion of ``--javascript``.
407463

408464
ensureFormatHeader(FORMAT\_HEADER\_STRING)
409465
``````````````````````````````````````````
@@ -429,6 +485,17 @@ corresponding accessor methods for use in record processing.
429485
ensureInfoHeader('##INFO=<ID=CT,Number=1,Type=Integer,' +
430486
'Description="Coverage threshold that was applied">');
431487
488+
ensureFilterHeader(FILTER\_HEADER\_STRING)
489+
``````````````````````````````````````````
490+
491+
Add a new ``FILTER`` field to the VCF header if it is not already
492+
present. This will add an ``FILTER`` declaration line to the header.
493+
494+
.. code-block:: text
495+
496+
ensureFilterHeader('##INFO=<ID=FAIL_VAL,' +
497+
'Description="Failed validation">');
498+
432499
Additional information and functions
433500
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
434501

@@ -450,6 +517,19 @@ Writes the provided string to standard output.
450517
451518
print('The samples are: ' + SAMPLES);
452519
520+
checkMinVersion(RTG_MINIMUM_VERSION)
521+
````````````````````````````````````
522+
523+
Checks the version of RTG that the script is running under, and exits
524+
with an error message if the version of RTG does not meet the minimum
525+
required version. This is useful when distributing scripts that make use
526+
of features that are not present in earlier versions of RTG.
527+
528+
.. code-block:: text
529+
530+
checkMinVersion('3.9.2');
531+
532+
453533
.. seealso::
454534
For javascript filtering usage and examples see :ref:`vcffilter`
455535

installer/resources/core/RTGOperationsManual/_static/bizstyle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ $(window).resize(function(){
3636
$("li.nav-item-0 a").text("Top");
3737
}
3838
else {
39-
$("li.nav-item-0 a").text("RTG Core Operations Manual v3.9");
39+
$("li.nav-item-0 a").text("RTG Core Operations Manual v3.10");
4040
}
4141
});

installer/resources/core/RTGOperationsManual/administration.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
<head>
88
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99

10-
<title>Administration &amp; Capacity Planning &#8212; RTG Core Operations Manual v3.9</title>
10+
<title>Administration &amp; Capacity Planning &#8212; RTG Core Operations Manual v3.10</title>
1111

1212
<link rel="stylesheet" href="_static/bizstyle.css" type="text/css" />
1313
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1414

1515
<script type="text/javascript">
1616
var DOCUMENTATION_OPTIONS = {
1717
URL_ROOT: './',
18-
VERSION: '3.9',
18+
VERSION: '3.10',
1919
COLLAPSE_INDEX: false,
2020
FILE_SUFFIX: '.html',
2121
HAS_SOURCE: true,
@@ -48,7 +48,7 @@ <h3>Navigation</h3>
4848
<li class="right" >
4949
<a href="product_usage.html" title="RTG product usage - baseline progressions"
5050
accesskey="P">previous</a> |</li>
51-
<li class="nav-item nav-item-0"><a href="index.html">RTG Core Operations Manual v3.9</a> &#187;</li>
51+
<li class="nav-item nav-item-0"><a href="index.html">RTG Core Operations Manual v3.10</a> &#187;</li>
5252
</ul>
5353
</div>
5454
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
@@ -377,7 +377,7 @@ <h3>Navigation</h3>
377377
<li class="right" >
378378
<a href="product_usage.html" title="RTG product usage - baseline progressions"
379379
>previous</a> |</li>
380-
<li class="nav-item nav-item-0"><a href="index.html">RTG Core Operations Manual v3.9</a> &#187;</li>
380+
<li class="nav-item nav-item-0"><a href="index.html">RTG Core Operations Manual v3.10</a> &#187;</li>
381381
</ul>
382382
</div>
383383
<div class="footer" role="contentinfo">

0 commit comments

Comments
 (0)