<!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>Compute a Relative Expression Matrix — REMatrix • 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="Compute a Relative Expression Matrix — REMatrix"><meta name="description" content="This function computes the relative expression profiles of
all given phylostrata or divergence-strata within a given PhyloExpressionSet or DivergenceExpressionSet."><meta property="og:description" content="This function computes the relative expression profiles of
all given phylostrata or divergence-strata within a given PhyloExpressionSet or DivergenceExpressionSet."><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>Compute a Relative Expression Matrix</h1>
      <small class="dont-index">Source: <a href="https://github.com/drostlab/myTAI/blob/HEAD/R/rel_exp.R" class="external-link"><code>R/rel_exp.R</code></a></small>
      <div class="d-none name"><code>REMatrix.Rd</code></div>
    </div>

    <div class="ref-description section level2">
    <p>This function computes the relative expression profiles of
all given phylostrata or divergence-strata within a given PhyloExpressionSet or DivergenceExpressionSet.</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">REMatrix</span><span class="op">(</span><span class="va">ExpressionSet</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 or DivergenceExpressionSet object.</p></dd>

</dl></div>
    <div class="section level2">
    <h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
    <p>For each phylostratum or divergence-stratum the corresponding relative expression profile is being computed as follows:</p>
<p>$$f_js = ( e_js - e_j min ) / ( e_j max - e_j min )$$</p>
<p>where \(e_j min\) and \(e_j max\) denote the minimum/maximum mean expression level of
phylostratum j over the  developmental stages s. This linear transformation corresponds
to a shift by \(e_j min\) and a subsequent shrinkage by \(e_j max - e_j min\).
As a result, the relative expression level \(f_js\) of developmental stage s with minimum \(e_js\) is 0,
the relative expression level \(f_js\) of the developmental stage s with maximum \(e_js\) is 1,
and the relative expression levels \(f_js\) of all other stages s range between 0 and 1, accordingly.</p>
    </div>
    <div class="section level2">
    <h2 id="references">References<a class="anchor" aria-label="anchor" href="#references"></a></h2>
    <p>Domazet-Loso T and Tautz D. (2010). <em>A phylogenetically based transcriptome age index mirrors ontogenetic divergence patterns</em>. Nature (468): 815-818.</p>
<p>Quint M et al. (2012). <em>A transcriptomic hourglass in plant embryogenesis</em>. Nature (490): 98-101.</p>
    </div>
    <div class="section level2">
    <h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"></a></h2>
    <div class="dont-index"><p><code><a href="RE.html">RE</a></code>, <code><a href="PlotRE.html">PlotRE</a></code>, <code><a href="PlotBarRE.html">PlotBarRE</a></code></p></div>
    </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></span>
<span class="r-in"><span><span class="co"># read standard phylotranscriptomics data</span></span></span>
<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 class="fu"><a href="https://rdrr.io/r/utils/data.html" class="external-link">data</a></span><span class="op">(</span><span class="va">DivergenceExpressionSetExample</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># example PhyloExpressionSet</span></span></span>
<span class="r-in"><span><span class="fu">REMatrix</span><span class="op">(</span><span class="va">PhyloExpressionSetExample</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span>       Zygote  Quadrant   Globular      Heart    Torpedo       Bent    Mature</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1  0.4816246 0.3145330 0.46389184 0.00000000 0.17067495 0.56880234 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2  1.0000000 0.9363209 0.63348381 0.40823711 0.14904726 0.00000000 0.2206063</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3  0.6083424 0.4109402 0.00000000 0.09521758 0.16284114 0.21213845 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4  0.2985050 0.2366309 0.04946941 0.07499453 0.00000000 0.20573325 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5  0.2893657 0.2799777 0.00000000 0.01401191 0.01365328 0.45908792 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6  0.2323316 0.2786335 0.02706119 0.00000000 0.03592044 0.20084761 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7  0.5666979 0.2620602 0.00000000 0.12099252 0.07133814 0.13232551 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8  0.4203039 0.3092784 0.09237036 0.05442042 0.00000000 0.45520558 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9  0.4586261 0.4668613 0.39738003 0.23205534 0.00000000 0.37067096 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 0.8811321 1.0000000 0.53841500 0.22974016 0.00000000 0.30490542 0.4881046</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 11 0.4015809 0.4877111 0.04846721 0.05741594 0.00000000 0.07716367 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 12 0.5052572 0.3359211 0.07100055 0.09489782 0.00000000 0.25811214 1.0000000</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># example DivergenceExpressionSet</span></span></span>
<span class="r-in"><span><span class="fu">REMatrix</span><span class="op">(</span><span class="va">DivergenceExpressionSetExample</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span>       Zygote  Quadrant   Globular      Heart    Torpedo      Bent    Mature</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1  0.9669643 0.9755188 1.00000000 0.64894653 0.54294759 0.3860827 0.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2  0.7888009 0.4949178 0.10397567 0.00000000 0.08758660 0.4549387 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3  0.1733953 0.0000000 0.02704324 0.04893726 0.18054185 0.4309208 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4  0.3772372 0.2955661 0.08201140 0.07895260 0.00000000 0.2074848 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5  0.4543752 0.3987496 0.09292474 0.00000000 0.02050713 0.1912595 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6  0.4403615 0.2605017 0.07713944 0.13021586 0.00000000 0.2307754 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7  0.3264585 0.3200581 0.13864386 0.11077270 0.00000000 0.1420009 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8  0.4934416 0.4366671 0.11457069 0.08697865 0.00000000 0.3076689 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9  0.6236387 0.6561674 0.21851855 0.10163374 0.00000000 0.4161087 1.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 0.7794318 1.0000000 0.61482564 0.22487531 0.00000000 0.1192539 0.4259882</span>
<span class="r-in"><span></span></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>

