<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Plot evolutionary signatures across transcriptomes — PlotSignature • myTAI</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.4.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.4.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Plot evolutionary signatures across transcriptomes — PlotSignature"><meta name="description" content="Main function to visualize transcriptome indices."><meta property="og:description" content="Main function to visualize transcriptome indices."><meta property="og:image" content="https://drostlab.github.io/myTAI/logo.png"></head><body>
    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>


    <nav class="navbar navbar-expand-lg fixed-top bg-light" data-bs-theme="light" aria-label="Site navigation"><div class="container">

    <a class="navbar-brand me-2" href="../index.html">myTAI</a>

    <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">2.0.0</small>


    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div id="navbar" class="collapse navbar-collapse ms-3">
      <ul class="navbar-nav me-auto"><li class="active nav-item"><a class="nav-link" href="../reference/index.html">Reference</a></li>
<li class="nav-item dropdown">
  <button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button>
  <ul class="dropdown-menu" aria-labelledby="dropdown-articles"><li><a class="dropdown-item" href="../articles/Advanced.html">Advanced Phylotranscriptomics Analyses</a></li>
    <li><a class="dropdown-item" href="../articles/Enrichment.html">Enrichment Analyses</a></li>
    <li><a class="dropdown-item" href="../articles/Expression.html">Gene Expression Analysis with `myTAI`</a></li>
    <li><a class="dropdown-item" href="../articles/Intermediate.html">Intermediate Phylotranscriptomics Analyses</a></li>
    <li><a class="dropdown-item" href="../articles/Introduction.html">Introduction to the myTAI package</a></li>
    <li><a class="dropdown-item" href="../articles/Phylostratigraphy.html">Discussing Genomic Phylostratigraphy</a></li>
  </ul></li>
<li class="nav-item"><a class="nav-link" href="../news/index.html">Changelog</a></li>
      </ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search">
 <input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li>
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/drostlab/myTAI/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li>
      </ul></div>


  </div>
</nav><div class="container template-reference-topic">
<div class="row">
  <main id="main" class="col-md-9"><div class="page-header">
      <img src="../logo.png" class="logo" alt=""><h1>Plot evolutionary signatures across transcriptomes</h1>
      <small class="dont-index">Source: <a href="https://github.com/drostlab/myTAI/blob/HEAD/R/PlotSignature.R" class="external-link"><code>R/PlotSignature.R</code></a></small>
      <div class="d-none name"><code>PlotSignature.Rd</code></div>
    </div>

    <div class="ref-description section level2">
    <p>Main function to visualize transcriptome indices.</p>
    </div>

    <div class="section level2">
    <h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">PlotSignature</span><span class="op">(</span></span>
<span>  <span class="va">ExpressionSet</span>,</span>
<span>  measure <span class="op">=</span> <span class="st">"TAI"</span>,</span>
<span>  TestStatistic <span class="op">=</span> <span class="st">"FlatLineTest"</span>,</span>
<span>  modules <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  permutations <span class="op">=</span> <span class="fl">1000</span>,</span>
<span>  lillie.test <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  p.value <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  shaded.area <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  custom.perm.matrix <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  xlab <span class="op">=</span> <span class="st">"Ontogeny"</span>,</span>
<span>  ylab <span class="op">=</span> <span class="st">"Transcriptome Index"</span>,</span>
<span>  main <span class="op">=</span> <span class="st">""</span>,</span>
<span>  lwd <span class="op">=</span> <span class="fl">4</span>,</span>
<span>  alpha <span class="op">=</span> <span class="fl">0.1</span>,</span>
<span>  y.ticks <span class="op">=</span> <span class="fl">10</span></span>
<span><span class="op">)</span></span></code></pre></div>
    </div>

    <div class="section level2">
    <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>


<dl><dt id="arg-expressionset">ExpressionSet<a class="anchor" aria-label="anchor" href="#arg-expressionset"></a></dt>
<dd><p>a standard PhyloExpressionSet, DivergenceExpressionSet or PolymorphismsExpressionSet object.</p></dd>


<dt id="arg-measure">measure<a class="anchor" aria-label="anchor" href="#arg-measure"></a></dt>
<dd><p>type of transcriptome index that shall be computed. E.g.</p><ul><li><p><code>measure = "TAI"</code> (Transcriptome Age Index)</p></li>
<li><p><code>measure = "TDI"</code> (Transcriptome Divergence Index)</p></li>
<li><p><code>measure = "TPI"</code> (Transcriptome Polymorphism Index)</p></li>
</ul></dd>


<dt id="arg-teststatistic">TestStatistic<a class="anchor" aria-label="anchor" href="#arg-teststatistic"></a></dt>
<dd><p>a string defining the type of test statistics to be used to quantify the statistical significance the present phylotranscriptomics pattern.
Possible values can be:</p><ul><li><p><code>TestStatistic</code> = <code>"FlatLineTest"</code> : Statistical test for the deviation from a flat line</p></li>
<li><p><code>TestStatistic</code> = <code>"ReductiveHourglassTest"</code> : Statistical test for the existence of a hourglass shape (high-low-high pattern)</p></li>
<li><p><code>TestStatistic</code> = <code>"EarlyConservationTest"</code> : Statistical test for the existence of a early conservation pattern (low-high-high pattern)</p></li>
<li><p><code>TestStatistic</code> = <code>"LateConservationTest"</code> : Statistical test for the existence of a late conservation pattern (high-high-low pattern)</p></li>
<li><p><code>TestStatistic</code> = <code>"ReverseHourglassTest"</code> : Statistical test for the existence of a reverse hourglass pattern (low-high-low pattern)</p></li>
</ul></dd>


<dt id="arg-modules">modules<a class="anchor" aria-label="anchor" href="#arg-modules"></a></dt>
<dd><p>a list storing three elements for the <code><a href="ReductiveHourglassTest.html">ReductiveHourglassTest</a></code>, <code><a href="EarlyConservationTest.html">EarlyConservationTest</a></code>, <code><a href="LateConservationTest.html">LateConservationTest</a></code>,
or <code><a href="ReverseHourglassTest.html">ReverseHourglassTest</a></code>: early, mid, and late.
Each element expects a numeric vector specifying the developmental stages
or experiments that correspond to each module. For example:</p><ul><li><p><code>module</code> = <code>list(early = 1:2, mid = 3:5, late = 6:7)</code> divides a dataset storing seven developmental stages into 3 modules.</p></li>
</ul></dd>


<dt id="arg-permutations">permutations<a class="anchor" aria-label="anchor" href="#arg-permutations"></a></dt>
<dd><p>a numeric value specifying the number of permutations to be performed for the <code><a href="FlatLineTest.html">FlatLineTest</a></code>, <code><a href="EarlyConservationTest.html">EarlyConservationTest</a></code>, <code><a href="LateConservationTest.html">LateConservationTest</a></code>, <code><a href="ReductiveHourglassTest.html">ReductiveHourglassTest</a></code> or <code><a href="ReverseHourglassTest.html">ReverseHourglassTest</a></code>.</p></dd>


<dt id="arg-lillie-test">lillie.test<a class="anchor" aria-label="anchor" href="#arg-lillie-test"></a></dt>
<dd><p>a boolean value specifying whether the Lilliefors Kolmogorov-Smirnov Test shall be performed.</p></dd>


<dt id="arg-p-value">p.value<a class="anchor" aria-label="anchor" href="#arg-p-value"></a></dt>
<dd><p>a boolean value specifying whether the p-value of the test statistic shall be printed as a subtitle.</p></dd>


<dt id="arg-shaded-area">shaded.area<a class="anchor" aria-label="anchor" href="#arg-shaded-area"></a></dt>
<dd><p>a boolean value specifying whether a shaded area shall
be drawn for the developmental stages defined to be the presumptive phylotypic period.</p></dd>


<dt id="arg-custom-perm-matrix">custom.perm.matrix<a class="anchor" aria-label="anchor" href="#arg-custom-perm-matrix"></a></dt>
<dd><p>a custom <code><a href="bootMatrix.html">bootMatrix</a></code> (permutation matrix) to perform the underlying test statistic visualized by <code>PlotSignature</code>. Default is <code>custom.perm.matrix = NULL</code>.</p></dd>


<dt id="arg-xlab">xlab<a class="anchor" aria-label="anchor" href="#arg-xlab"></a></dt>
<dd><p>label of x-axis.</p></dd>


<dt id="arg-ylab">ylab<a class="anchor" aria-label="anchor" href="#arg-ylab"></a></dt>
<dd><p>label of y-axis.</p></dd>


<dt id="arg-main">main<a class="anchor" aria-label="anchor" href="#arg-main"></a></dt>
<dd><p>figure title.</p></dd>


<dt id="arg-lwd">lwd<a class="anchor" aria-label="anchor" href="#arg-lwd"></a></dt>
<dd><p>line width.</p></dd>


<dt id="arg-alpha">alpha<a class="anchor" aria-label="anchor" href="#arg-alpha"></a></dt>
<dd><p>transparency of the shaded area (between [0,1]). Default is <code>alpha = 0.1</code>.</p></dd>


<dt id="arg-y-ticks">y.ticks<a class="anchor" aria-label="anchor" href="#arg-y-ticks"></a></dt>
<dd><p>number of ticks on the y-axis. Default is <code>ticks = 10</code>.</p></dd>

</dl></div>
    <div class="section level2">
    <h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
    <p>This function substitutes the functionality of the <code><a href="PlotPattern.html">PlotPattern</a></code> function
and is based on ggplot2 insead of base R graphics.</p>
<p>The following transcriptome indices can be computed and visualized with this function:</p><ul><li><p>Transcriptome Age Index (<code><a href="TAI.html">TAI</a></code>)</p></li>
<li><p>Transcriptome Divergence Index (<code><a href="TDI.html">TDI</a></code>)</p></li>
<li><p>Transcriptome Polymorphism Index (<code><a href="TPI.html">TPI</a></code>)</p></li>
</ul></div>
    <div class="section level2">
    <h2 id="author">Author<a class="anchor" aria-label="anchor" href="#author"></a></h2>
    <p>Hajk-Georg Drost</p>
    </div>

    <div class="section level2">
    <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/utils/data.html" class="external-link">data</a></span><span class="op">(</span><span class="va">PhyloExpressionSetExample</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># plot TAI pattern and perform flat line test</span></span></span>
<span class="r-in"><span><span class="fu">PlotSignature</span><span class="op">(</span><span class="va">PhyloExpressionSetExample</span>, </span></span>
<span class="r-in"><span>              measure       <span class="op">=</span> <span class="st">"TAI"</span>, </span></span>
<span class="r-in"><span>              permutations  <span class="op">=</span> <span class="fl">100</span>,</span></span>
<span class="r-in"><span>              TestStatistic <span class="op">=</span> <span class="st">"FlatLineTest"</span>,</span></span>
<span class="r-in"><span>              ylab <span class="op">=</span> <span class="st">"Transcriptome Age Index"</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Plot signature: ' TAI ' and test statistic: ' FlatLineTest ' running  100  permutations.</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [ Number of Eigen threads that are employed on your machine: 12 ]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [ Computing age assignment permutations for test statistic ... ]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 
[=========================================] 100%   </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [ Computing variances of permuted transcriptome signatures ... ]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [ Number of Eigen threads that are employed on your machine: 12 ]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [ Computing age assignment permutations for test statistic ... ]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 
[=========================================] 100%   </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [ Computing variances of permuted transcriptome signatures ... ]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Total runtime of your permutation test: 0.015  seconds.</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> </span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> -&gt; We recommended using at least 20000 permutations to achieve a sufficient permutation test.</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Significance status of signature:  significant.</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> </span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> -&gt; Now run 'FlatLineTest(..., permutations  = 100, plotHistogram = TRUE)' to analyse the permutation test performance.</span>
<span class="r-plt img"><img src="PlotSignature-1.png" alt="" width="700" height="433"></span>
<span class="r-in"><span>              </span></span>
</code></pre></div>
    </div>
  </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
    </nav></aside></div>


    <footer><div class="pkgdown-footer-left">
  <p>Developed by Hajk-Georg Drost, Jaruwatana Sodai Lotharukpong, Nikola Kalábová, Kristian K Ullrich.</p>
</div>

<div class="pkgdown-footer-right">
  <p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.1.0.</p>
</div>

    </footer></div>





  </body></html>

