diff --git a/DESCRIPTION b/DESCRIPTION index 86a0dd7e1cba9baf94bc471dbc44f7f5f9d80366..3ce8b798f5a9dc86daa590eb00dbceb1cadecc50 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: splatter Type: Package Title: Simple Simulation of Single-cell RNA Sequencing Data -Version: 1.3.3.9010 -Date: 2018-04-12 +Version: 1.3.4 +Date: 2018-04-19 Author: Luke Zappia Authors@R: c(person("Luke", "Zappia", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 46aabfac94d1c2f655298b216ca66ab53ef80568..5f3a2df3d0ba39405235d89dda7f0352abcf0503 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,14 @@ +## Version 1.3.4 (2018-04-19) + +* Add option to use a normal distribution for library sizes in Splat simulations +* Add SparseDC simulation +* Rename params in metadata slot of simulation to Params for consistency +* Add checks to SplatParams to reset path.from if nGroups changes +* Improve printing of parameters stored as data.frames +* Colourise Params print output and listSims output +* Improve warning message when fitting means in splatEstimate fails +* Simplify problematic documentation links + ### Version 1.3.3.9010 (2018-04-12) * Add option to use a normal distribution for library sizes in Splat simulations diff --git a/R/SparseDCParams-methods.R b/R/SparseDCParams-methods.R index 0701d8962d22dd314c32239535f653ee0fc6b40e..361705674fd9aea2cbcbd684266c60d386048c39 100644 --- a/R/SparseDCParams-methods.R +++ b/R/SparseDCParams-methods.R @@ -53,7 +53,7 @@ setValidity("SparseDCParams", function(object) { clusts.combined <- c(v$clusts.c1, v$clusts.c2) if (!all(seq_len(max(clusts.combined)) %in% clusts.combined)) { - checks <- c(checks, clusts = "Cluster labels must be seqential") + checks <- c(checks, clusts = "Cluster labels must be sequential") } if (all(checks == TRUE)) { diff --git a/_pkgdown.yml b/_pkgdown.yml index 968dea9e3a82260613789c68a3cadfcfd2ca8353..a51d299468259182c553cc4f304d493705ee00b0 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -22,6 +22,7 @@ reference: - '`SCDDParams`' - '`SimpleParams`' - '`SplatParams`' + - '`SparseDCParams`' - '`ZINBParams`' - title: Estimation desc: Functions for estimating parameters @@ -39,6 +40,7 @@ reference: - '`splatEstLib`' - '`splatEstMean`' - '`splatEstOutlier`' + - '`sparseDCEstimate`' - '`zinbEstimate`' - title: Simulation desc: Functions for simulating datasets @@ -60,6 +62,7 @@ reference: - '`splatSimLibSizes`' - '`splatSimTrueCounts`' - '`splatSimulate`' + - '`sparseDCSimulate`' - '`zinbSimulate`' - title: Comparison functions desc: Functions for comparing datasets @@ -87,5 +90,7 @@ reference: - '`rbindMatched`' - '`setParamsUnchecked`' - '`setParamUnchecked`' + - '`showDFs`' - '`showPP`' + - '`showValues`' - '`winsorize`' diff --git a/docs/articles/index.html b/docs/articles/index.html index 619a82f56e4331c1ace1b5c7429df30bef73a91a..578c4208edba5d314f24cf6b33ebeadfadd089e9 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -96,7 +96,7 @@ </header> <div class="page-header"> - <h1>Articles <small>version 1.3.3</small></h1> + <h1>Articles <small>version 1.3.4</small></h1> </div> <div class="row"> diff --git a/docs/articles/splatter.html b/docs/articles/splatter.html index 1d4b4568d7f2bd3249466593c84f818aaa7c2f83..9d304865aa487624ff8167d50b3938da7d24b020 100644 --- a/docs/articles/splatter.html +++ b/docs/articles/splatter.html @@ -76,7 +76,7 @@ <h1>Introduction to Splatter</h1> <h4 class="author">Luke Zappia</h4> - <h4 class="date">2018-03-27</h4> + <h4 class="date">2018-04-19</h4> </div> @@ -171,9 +171,10 @@ ## filter</code></pre> <div class="sourceCode" id="cb34"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb34-1" data-line-number="1"><span class="kw">data</span>(<span class="st">"sc_example_counts"</span>)</a> <a class="sourceLine" id="cb34-2" data-line-number="2"><span class="co"># Estimate parameters from example data</span></a> -<a class="sourceLine" id="cb34-3" data-line-number="3">params <-<span class="st"> </span><span class="kw"><a href="../reference/splatEstimate.html">splatEstimate</a></span>(sc_example_counts)</a> -<a class="sourceLine" id="cb34-4" data-line-number="4"><span class="co"># Simulate data using estimated parameters</span></a> -<a class="sourceLine" id="cb34-5" data-line-number="5">sim <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(params, <span class="dt">dropout.present =</span> <span class="ot">FALSE</span>)</a></code></pre></div> +<a class="sourceLine" id="cb34-3" data-line-number="3">params <-<span class="st"> </span><span class="kw"><a href="../reference/splatEstimate.html">splatEstimate</a></span>(sc_example_counts)</a></code></pre></div> +<pre><code>## NOTE: Library sizes have been found to be normally distributed instead of log-normal. You may want to check this is correct.</code></pre> +<div class="sourceCode" id="cb36"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb36-1" data-line-number="1"><span class="co"># Simulate data using estimated parameters</span></a> +<a class="sourceLine" id="cb36-2" data-line-number="2">sim <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(params, <span class="dt">dropout.present =</span> <span class="ot">FALSE</span>)</a></code></pre></div> <pre><code>## Getting parameters...</code></pre> <pre><code>## Creating simulation object...</code></pre> <pre><code>## Simulating library sizes...</code></pre> @@ -231,9 +232,11 @@ <strong>Library size parameters</strong> <ul> <li> -<code>lib.loc</code> - Location (meanlog) parameter for the library size log-normal distribution.</li> +<code>lib.loc</code> - Location (meanlog) parameter for the library size log-normal distribution, or mean for the normal distribution.</li> <li> -<code>lib.scale</code> - Scale (sdlog) parameter for the library size log-normal distribution.</li> +<code>lib.scale</code> - Scale (sdlog) parameter for the library size log-normal distribution, or sd for the normal distribution.</li> +<li> +<code>lib.norm</code> - Whether to use a normal distribution instead of the usual log-normal distribution.</li> </ul> </li> <li> @@ -312,70 +315,70 @@ <h1 class="hasAnchor"> <a href="#the-splatparams-object" class="anchor"></a>The <code>SplatParams</code> object</h1> <p>All the parameters for the Splat simulation are stored in a <code>SplatParams</code> object. Let’s create a new one and see what it looks like.</p> -<div class="sourceCode" id="cb43"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb43-1" data-line-number="1">params <-<span class="st"> </span><span class="kw"><a href="../reference/newParams.html">newSplatParams</a></span>()</a> -<a class="sourceLine" id="cb43-2" data-line-number="2">params</a></code></pre></div> +<div class="sourceCode" id="cb45"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb45-1" data-line-number="1">params <-<span class="st"> </span><span class="kw"><a href="../reference/newParams.html">newSplatParams</a></span>()</a> +<a class="sourceLine" id="cb45-2" data-line-number="2">params</a></code></pre></div> <pre><code>## A Params object of class SplatParams -## Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +## Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' ## ## Global: -## (Genes) (Cells) [Seed] -## 10000 100 970999 +## (Genes) (Cells) [Seed] +## 10000 100 778289 ## -## 27 additional parameters +## 28 additional parameters ## ## Batches: -## [Batches] [Batch Cells] [Location] [Scale] -## 1 100 0.1 0.1 +## [Batches] [Batch Cells] [Location] [Scale] +## 1 100 0.1 0.1 ## ## Mean: -## (Rate) (Shape) -## 0.3 0.6 +## (Rate) (Shape) +## 0.3 0.6 ## ## Library size: -## (Location) (Scale) -## 11 0.2 +## (Location) (Scale) (Norm) +## 11 0.2 FALSE ## ## Exprs outliers: -## (Probability) (Location) (Scale) -## 0.05 4 0.5 +## (Probability) (Location) (Scale) +## 0.05 4 0.5 ## ## Groups: -## [Groups] [Group Probs] -## 1 1 +## [Groups] [Group Probs] +## 1 1 ## ## Diff expr: -## [Probability] [Down Prob] [Location] [Scale] -## 0.1 0.5 0.1 0.4 +## [Probability] [Down Prob] [Location] [Scale] +## 0.1 0.5 0.1 0.4 ## ## BCV: -## (Common Disp) (DoF) -## 0.1 60 +## (Common Disp) (DoF) +## 0.1 60 ## ## Dropout: -## [Present] (Midpoint) (Shape) -## FALSE 0 -1 +## [Present] (Midpoint) (Shape) +## FALSE 0 -1 ## ## Paths: -## [From] [Length] [Skew] [Non-linear] -## 0 100 0.5 0.1 -## [Sigma Factor] +## [From] [Length] [Skew] [Non-linear] +## 0 100 0.5 0.1 +## [Sigma Factor] ## 0.8</code></pre> <p>As well as telling us what type of object we have (“A <code>Params</code> object of class <code>SplatParams</code>â€) and showing us the values of the parameter this output gives us some extra information. We can see which parameters can be estimated by the <code>splatEstimate</code> function (those in parentheses), which can’t be estimated (those in brackets) and which have been changed from their default values (those in ALL CAPS).</p> <div id="getting-and-setting" class="section level2"> <h2 class="hasAnchor"> <a href="#getting-and-setting" class="anchor"></a>Getting and setting</h2> <p>If we want to look at a particular parameter, for example the number of genes to simulate, we can extract it using the <code>getParam</code> function:</p> -<div class="sourceCode" id="cb45"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb45-1" data-line-number="1"><span class="kw"><a href="../reference/getParam.html">getParam</a></span>(params, <span class="st">"nGenes"</span>)</a></code></pre></div> +<div class="sourceCode" id="cb47"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb47-1" data-line-number="1"><span class="kw"><a href="../reference/getParam.html">getParam</a></span>(params, <span class="st">"nGenes"</span>)</a></code></pre></div> <pre><code>## [1] 10000</code></pre> <p>Alternatively, to give a parameter a new value we can use the <code>setParam</code> function:</p> -<div class="sourceCode" id="cb47"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb47-1" data-line-number="1">params <-<span class="st"> </span><span class="kw"><a href="../reference/setParam.html">setParam</a></span>(params, <span class="st">"nGenes"</span>, <span class="dv">5000</span>)</a> -<a class="sourceLine" id="cb47-2" data-line-number="2"><span class="kw"><a href="../reference/getParam.html">getParam</a></span>(params, <span class="st">"nGenes"</span>)</a></code></pre></div> +<div class="sourceCode" id="cb49"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb49-1" data-line-number="1">params <-<span class="st"> </span><span class="kw"><a href="../reference/setParam.html">setParam</a></span>(params, <span class="st">"nGenes"</span>, <span class="dv">5000</span>)</a> +<a class="sourceLine" id="cb49-2" data-line-number="2"><span class="kw"><a href="../reference/getParam.html">getParam</a></span>(params, <span class="st">"nGenes"</span>)</a></code></pre></div> <pre><code>## [1] 5000</code></pre> <p>If we want to extract multiple parameters (as a list) or set multiple parameters we can use the <code>getParams</code> or <code>setParams</code> functions:</p> -<div class="sourceCode" id="cb49"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb49-1" data-line-number="1"><span class="co"># Set multiple parameters at once (using a list)</span></a> -<a class="sourceLine" id="cb49-2" data-line-number="2">params <-<span class="st"> </span><span class="kw"><a href="../reference/setParams.html">setParams</a></span>(params, <span class="dt">update =</span> <span class="kw">list</span>(<span class="dt">nGenes =</span> <span class="dv">8000</span>, <span class="dt">mean.rate =</span> <span class="fl">0.5</span>))</a> -<a class="sourceLine" id="cb49-3" data-line-number="3"><span class="co"># Extract multiple parameters as a list</span></a> -<a class="sourceLine" id="cb49-4" data-line-number="4"><span class="kw"><a href="../reference/getParams.html">getParams</a></span>(params, <span class="kw">c</span>(<span class="st">"nGenes"</span>, <span class="st">"mean.rate"</span>, <span class="st">"mean.shape"</span>))</a></code></pre></div> +<div class="sourceCode" id="cb51"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb51-1" data-line-number="1"><span class="co"># Set multiple parameters at once (using a list)</span></a> +<a class="sourceLine" id="cb51-2" data-line-number="2">params <-<span class="st"> </span><span class="kw"><a href="../reference/setParams.html">setParams</a></span>(params, <span class="dt">update =</span> <span class="kw">list</span>(<span class="dt">nGenes =</span> <span class="dv">8000</span>, <span class="dt">mean.rate =</span> <span class="fl">0.5</span>))</a> +<a class="sourceLine" id="cb51-3" data-line-number="3"><span class="co"># Extract multiple parameters as a list</span></a> +<a class="sourceLine" id="cb51-4" data-line-number="4"><span class="kw"><a href="../reference/getParams.html">getParams</a></span>(params, <span class="kw">c</span>(<span class="st">"nGenes"</span>, <span class="st">"mean.rate"</span>, <span class="st">"mean.shape"</span>))</a></code></pre></div> <pre><code>## $nGenes ## [1] 8000 ## @@ -384,59 +387,59 @@ ## ## $mean.shape ## [1] 0.6</code></pre> -<div class="sourceCode" id="cb51"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb51-1" data-line-number="1"><span class="co"># Set multiple parameters at once (using additional arguments)</span></a> -<a class="sourceLine" id="cb51-2" data-line-number="2">params <-<span class="st"> </span><span class="kw"><a href="../reference/setParams.html">setParams</a></span>(params, <span class="dt">mean.shape =</span> <span class="fl">0.5</span>, <span class="dt">de.prob =</span> <span class="fl">0.2</span>)</a> -<a class="sourceLine" id="cb51-3" data-line-number="3">params</a></code></pre></div> +<div class="sourceCode" id="cb53"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb53-1" data-line-number="1"><span class="co"># Set multiple parameters at once (using additional arguments)</span></a> +<a class="sourceLine" id="cb53-2" data-line-number="2">params <-<span class="st"> </span><span class="kw"><a href="../reference/setParams.html">setParams</a></span>(params, <span class="dt">mean.shape =</span> <span class="fl">0.5</span>, <span class="dt">de.prob =</span> <span class="fl">0.2</span>)</a> +<a class="sourceLine" id="cb53-3" data-line-number="3">params</a></code></pre></div> <pre><code>## A Params object of class SplatParams -## Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +## Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' ## ## Global: -## (GENES) (Cells) [Seed] -## 8000 100 970999 +## (GENES) (Cells) [Seed] +## 8000 100 778289 ## -## 27 additional parameters +## 28 additional parameters ## ## Batches: -## [Batches] [Batch Cells] [Location] [Scale] -## 1 100 0.1 0.1 +## [Batches] [Batch Cells] [Location] [Scale] +## 1 100 0.1 0.1 ## ## Mean: -## (RATE) (SHAPE) -## 0.5 0.5 +## (RATE) (SHAPE) +## 0.5 0.5 ## ## Library size: -## (Location) (Scale) -## 11 0.2 +## (Location) (Scale) (Norm) +## 11 0.2 FALSE ## ## Exprs outliers: -## (Probability) (Location) (Scale) -## 0.05 4 0.5 +## (Probability) (Location) (Scale) +## 0.05 4 0.5 ## ## Groups: -## [Groups] [Group Probs] -## 1 1 +## [Groups] [Group Probs] +## 1 1 ## ## Diff expr: -## [PROBABILITY] [Down Prob] [Location] [Scale] -## 0.2 0.5 0.1 0.4 +## [PROBABILITY] [Down Prob] [Location] [Scale] +## 0.2 0.5 0.1 0.4 ## ## BCV: -## (Common Disp) (DoF) -## 0.1 60 +## (Common Disp) (DoF) +## 0.1 60 ## ## Dropout: -## [Present] (Midpoint) (Shape) -## FALSE 0 -1 +## [Present] (Midpoint) (Shape) +## FALSE 0 -1 ## ## Paths: -## [From] [Length] [Skew] [Non-linear] -## 0 100 0.5 0.1 -## [Sigma Factor] +## [From] [Length] [Skew] [Non-linear] +## 0 100 0.5 0.1 +## [Sigma Factor] ## 0.8</code></pre> <p>The parameters with have changed are now shown in ALL CAPS to indicate that they been changed form the default.</p> <p>We can also set parameters directly when we call <code>newSplatParams</code>:</p> -<div class="sourceCode" id="cb53"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb53-1" data-line-number="1">params <-<span class="st"> </span><span class="kw"><a href="../reference/newParams.html">newSplatParams</a></span>(<span class="dt">lib.loc =</span> <span class="dv">12</span>, <span class="dt">lib.scale =</span> <span class="fl">0.6</span>)</a> -<a class="sourceLine" id="cb53-2" data-line-number="2"><span class="kw"><a href="../reference/getParams.html">getParams</a></span>(params, <span class="kw">c</span>(<span class="st">"lib.loc"</span>, <span class="st">"lib.scale"</span>))</a></code></pre></div> +<div class="sourceCode" id="cb55"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb55-1" data-line-number="1">params <-<span class="st"> </span><span class="kw"><a href="../reference/newParams.html">newSplatParams</a></span>(<span class="dt">lib.loc =</span> <span class="dv">12</span>, <span class="dt">lib.scale =</span> <span class="fl">0.6</span>)</a> +<a class="sourceLine" id="cb55-2" data-line-number="2"><span class="kw"><a href="../reference/getParams.html">getParams</a></span>(params, <span class="kw">c</span>(<span class="st">"lib.loc"</span>, <span class="st">"lib.scale"</span>))</a></code></pre></div> <pre><code>## $lib.loc ## [1] 12 ## @@ -448,23 +451,24 @@ <h1 class="hasAnchor"> <a href="#estimating-parameters" class="anchor"></a>Estimating parameters</h1> <p>Splat allows you to estimate many of it’s parameters from a data set containing counts using the <code>splatEstimate</code> function.</p> -<div class="sourceCode" id="cb55"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb55-1" data-line-number="1"><span class="co"># Check that sc_example counts is an integer matrix</span></a> -<a class="sourceLine" id="cb55-2" data-line-number="2"><span class="kw">class</span>(sc_example_counts)</a></code></pre></div> +<div class="sourceCode" id="cb57"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb57-1" data-line-number="1"><span class="co"># Check that sc_example counts is an integer matrix</span></a> +<a class="sourceLine" id="cb57-2" data-line-number="2"><span class="kw">class</span>(sc_example_counts)</a></code></pre></div> <pre><code>## [1] "matrix"</code></pre> -<div class="sourceCode" id="cb57"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb57-1" data-line-number="1"><span class="kw">typeof</span>(sc_example_counts)</a></code></pre></div> +<div class="sourceCode" id="cb59"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb59-1" data-line-number="1"><span class="kw">typeof</span>(sc_example_counts)</a></code></pre></div> <pre><code>## [1] "integer"</code></pre> -<div class="sourceCode" id="cb59"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb59-1" data-line-number="1"><span class="co"># Check the dimensions, each row is a gene, each column is a cell</span></a> -<a class="sourceLine" id="cb59-2" data-line-number="2"><span class="kw">dim</span>(sc_example_counts)</a></code></pre></div> +<div class="sourceCode" id="cb61"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb61-1" data-line-number="1"><span class="co"># Check the dimensions, each row is a gene, each column is a cell</span></a> +<a class="sourceLine" id="cb61-2" data-line-number="2"><span class="kw">dim</span>(sc_example_counts)</a></code></pre></div> <pre><code>## [1] 2000 40</code></pre> -<div class="sourceCode" id="cb61"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb61-1" data-line-number="1"><span class="co"># Show the first few entries</span></a> -<a class="sourceLine" id="cb61-2" data-line-number="2">sc_example_counts[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>, <span class="dv">1</span><span class="op">:</span><span class="dv">5</span>]</a></code></pre></div> +<div class="sourceCode" id="cb63"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb63-1" data-line-number="1"><span class="co"># Show the first few entries</span></a> +<a class="sourceLine" id="cb63-2" data-line-number="2">sc_example_counts[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>, <span class="dv">1</span><span class="op">:</span><span class="dv">5</span>]</a></code></pre></div> <pre><code>## Cell_001 Cell_002 Cell_003 Cell_004 Cell_005 ## Gene_0001 0 123 2 0 0 ## Gene_0002 575 65 3 1561 2311 ## Gene_0003 0 0 0 0 1213 ## Gene_0004 0 1 0 0 0 ## Gene_0005 0 0 11 0 0</code></pre> -<div class="sourceCode" id="cb63"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb63-1" data-line-number="1">params <-<span class="st"> </span><span class="kw"><a href="../reference/splatEstimate.html">splatEstimate</a></span>(sc_example_counts)</a></code></pre></div> +<div class="sourceCode" id="cb65"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb65-1" data-line-number="1">params <-<span class="st"> </span><span class="kw"><a href="../reference/splatEstimate.html">splatEstimate</a></span>(sc_example_counts)</a></code></pre></div> +<pre><code>## NOTE: Library sizes have been found to be normally distributed instead of log-normal. You may want to check this is correct.</code></pre> <p>Here we estimated parameters from a counts matrix but <code>splatEstimate</code> can also take a <code>SingleCellExperiment</code> object. The estimation process has the following steps:</p> <ol style="list-style-type: decimal"> <li>Mean parameters are estimated by fitting a gamma distribution to the mean expression levels.</li> @@ -479,7 +483,7 @@ <h1 class="hasAnchor"> <a href="#simulating-counts" class="anchor"></a>Simulating counts</h1> <p>Once we have a set of parameters we are happy with we can use <code>splatSimulate</code> to simulate counts. If we want to make small adjustments to the parameters we can provide them as additional arguments, alternatively if we don’t supply any parameters the defaults will be used:</p> -<div class="sourceCode" id="cb64"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb64-1" data-line-number="1">sim <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(params, <span class="dt">nGenes =</span> <span class="dv">1000</span>, <span class="dt">dropout.present =</span> <span class="ot">FALSE</span>)</a></code></pre></div> +<div class="sourceCode" id="cb67"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb67-1" data-line-number="1">sim <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(params, <span class="dt">nGenes =</span> <span class="dv">1000</span>, <span class="dt">dropout.present =</span> <span class="ot">FALSE</span>, <span class="dt">seed =</span> <span class="dv">0</span>)</a></code></pre></div> <pre><code>## Getting parameters...</code></pre> <pre><code>## Creating simulation object...</code></pre> <pre><code>## Simulating library sizes...</code></pre> @@ -488,7 +492,7 @@ <pre><code>## Simulating counts..</code></pre> <pre><code>## Simulating dropout (if needed)...</code></pre> <pre><code>## Done!</code></pre> -<div class="sourceCode" id="cb73"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb73-1" data-line-number="1">sim</a></code></pre></div> +<div class="sourceCode" id="cb76"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb76-1" data-line-number="1">sim</a></code></pre></div> <pre><code>## class: SingleCellExperiment ## dim: 1000 40 ## metadata(1): params @@ -500,54 +504,54 @@ ## reducedDimNames(0): ## spikeNames(0):</code></pre> <p>Looking at the output of <code>splatSimulate</code> we can see that <code>sim</code> is <code>SingleCellExperiment</code> object with 1000 features (genes) and 40 samples (cells). The main part of this object is a features by samples matrix containing the simulated counts (accessed using <code>counts</code>), although it can also hold other expression measures such as FPKM or TPM. Additionaly a <code>SingleCellExperiment</code> contains phenotype information about each cell (accessed using <code>colData</code>) and feature information about each gene (accessed using <code>rowData</code>). Splatter uses these slots, as well as <code>assays</code>, to store information about the intermediate values of the simulation.</p> -<div class="sourceCode" id="cb75"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb75-1" data-line-number="1"><span class="co"># Access the counts</span></a> -<a class="sourceLine" id="cb75-2" data-line-number="2"><span class="kw">counts</span>(sim)[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>, <span class="dv">1</span><span class="op">:</span><span class="dv">5</span>]</a></code></pre></div> +<div class="sourceCode" id="cb78"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb78-1" data-line-number="1"><span class="co"># Access the counts</span></a> +<a class="sourceLine" id="cb78-2" data-line-number="2"><span class="kw">counts</span>(sim)[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>, <span class="dv">1</span><span class="op">:</span><span class="dv">5</span>]</a></code></pre></div> <pre><code>## Cell1 Cell2 Cell3 Cell4 Cell5 -## Gene1 0 0 0 2 0 -## Gene2 220 13206 16225 27 7 -## Gene3 3 0 0 0 0 -## Gene4 0 0 13 0 0 -## Gene5 0 17 0 1 7052</code></pre> -<div class="sourceCode" id="cb77"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb77-1" data-line-number="1"><span class="co"># Information about genes</span></a> -<a class="sourceLine" id="cb77-2" data-line-number="2"><span class="kw">head</span>(<span class="kw">rowData</span>(sim))</a></code></pre></div> +## Gene1 16 0 0 1232 0 +## Gene2 77 0 293 7 0 +## Gene3 323 52 5 0 1 +## Gene4 0 0 7 3 0 +## Gene5 278 0 14 55 1</code></pre> +<div class="sourceCode" id="cb80"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb80-1" data-line-number="1"><span class="co"># Information about genes</span></a> +<a class="sourceLine" id="cb80-2" data-line-number="2"><span class="kw">head</span>(<span class="kw">rowData</span>(sim))</a></code></pre></div> <pre><code>## DataFrame with 6 rows and 4 columns -## Gene BaseGeneMean OutlierFactor GeneMean -## <factor> <numeric> <numeric> <numeric> -## 1 Gene1 158.719527020559 1 158.719527020559 -## 2 Gene2 970.318963415582 1 970.318963415582 -## 3 Gene3 377.696503133266 1 377.696503133266 -## 4 Gene4 0.710912644993431 1 0.710912644993431 -## 5 Gene5 245.794372332926 1 245.794372332926 -## 6 Gene6 17.7586005302078 1 17.7586005302078</code></pre> -<div class="sourceCode" id="cb79"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb79-1" data-line-number="1"><span class="co"># Information about cells</span></a> -<a class="sourceLine" id="cb79-2" data-line-number="2"><span class="kw">head</span>(<span class="kw">colData</span>(sim))</a></code></pre></div> +## Gene BaseGeneMean OutlierFactor GeneMean +## <factor> <numeric> <numeric> <numeric> +## 1 Gene1 680.726908939431 1 680.726908939431 +## 2 Gene2 29.6384151850527 1 29.6384151850527 +## 3 Gene3 9.58778523489509 1 9.58778523489509 +## 4 Gene4 2.83976742238589 1 2.83976742238589 +## 5 Gene5 150.071547242578 1 150.071547242578 +## 6 Gene6 66.0478747990155 1 66.0478747990155</code></pre> +<div class="sourceCode" id="cb82"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb82-1" data-line-number="1"><span class="co"># Information about cells</span></a> +<a class="sourceLine" id="cb82-2" data-line-number="2"><span class="kw">head</span>(<span class="kw">colData</span>(sim))</a></code></pre></div> <pre><code>## DataFrame with 6 rows and 3 columns ## Cell Batch ExpLibSize ## <factor> <character> <numeric> -## Cell1 Cell1 Batch1 819839.521777331 -## Cell2 Cell2 Batch1 658885.101984588 -## Cell3 Cell3 Batch1 440805.063929258 -## Cell4 Cell4 Batch1 458256.442717672 -## Cell5 Cell5 Batch1 419008.637502263 -## Cell6 Cell6 Batch1 341560.612672682</code></pre> -<div class="sourceCode" id="cb81"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb81-1" data-line-number="1"><span class="co"># Gene by cell matrices</span></a> -<a class="sourceLine" id="cb81-2" data-line-number="2"><span class="kw">names</span>(<span class="kw">assays</span>(sim))</a></code></pre></div> +## Cell1 Cell1 Batch1 681471.700471143 +## Cell2 Cell2 Batch1 313386.003338354 +## Cell3 Cell3 Batch1 696954.252459665 +## Cell4 Cell4 Batch1 683666.296838061 +## Cell5 Cell5 Batch1 484986.516482731 +## Cell6 Cell6 Batch1 32266.4313600409</code></pre> +<div class="sourceCode" id="cb84"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb84-1" data-line-number="1"><span class="co"># Gene by cell matrices</span></a> +<a class="sourceLine" id="cb84-2" data-line-number="2"><span class="kw">names</span>(<span class="kw">assays</span>(sim))</a></code></pre></div> <pre><code>## [1] "BatchCellMeans" "BaseCellMeans" "BCV" "CellMeans" ## [5] "TrueCounts" "counts"</code></pre> -<div class="sourceCode" id="cb83"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb83-1" data-line-number="1"><span class="co"># Example of cell means matrix</span></a> -<a class="sourceLine" id="cb83-2" data-line-number="2"><span class="kw">assays</span>(sim)<span class="op">$</span>CellMeans[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>, <span class="dv">1</span><span class="op">:</span><span class="dv">5</span>]</a></code></pre></div> -<pre><code>## Cell1 Cell2 Cell3 Cell4 Cell5 -## Gene1 4.375231e-01 2.019127e-03 4.695107e-04 1.814947532 1.585570e-01 -## Gene2 2.185596e+02 1.311812e+04 1.629748e+04 30.992615936 5.170301e+00 -## Gene3 3.693554e+00 3.243744e-09 8.358921e-09 0.005179575 6.305009e-06 -## Gene4 3.921184e-08 2.002084e-05 1.213953e+01 0.061775849 1.712920e-05 -## Gene5 1.037909e-04 2.047324e+01 3.391620e-02 0.256579054 7.059271e+03</code></pre> +<div class="sourceCode" id="cb86"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb86-1" data-line-number="1"><span class="co"># Example of cell means matrix</span></a> +<a class="sourceLine" id="cb86-2" data-line-number="2"><span class="kw">assays</span>(sim)<span class="op">$</span>CellMeans[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>, <span class="dv">1</span><span class="op">:</span><span class="dv">5</span>]</a></code></pre></div> +<pre><code>## Cell1 Cell2 Cell3 Cell4 Cell5 +## Gene1 1.996549e+01 5.070084e-03 0.2151287 1.246817e+03 2.348151e-03 +## Gene2 6.824467e+01 6.878904e-04 270.2654016 5.265928e+00 1.081630e+00 +## Gene3 3.299146e+02 5.260857e+01 2.6861953 1.121680e-03 2.510321e+00 +## Gene4 2.971991e-04 5.295532e-11 5.6812428 1.776702e+00 1.525443e-07 +## Gene5 3.066060e+02 2.441931e-11 18.0058655 4.726581e+01 6.353592e-01</code></pre> <p>An additional (big) advantage of outputting a <code>SingleCellExperiment</code> is that we get immediate access to other analysis packages, such as the plotting functions in <code>scater</code>. For example we can make a PCA plot:</p> -<div class="sourceCode" id="cb85"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb85-1" data-line-number="1"><span class="co"># Use scater to calculate logcounts</span></a> -<a class="sourceLine" id="cb85-2" data-line-number="2">sim <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/normalize">normalise</a></span>(sim)</a></code></pre></div> +<div class="sourceCode" id="cb88"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb88-1" data-line-number="1"><span class="co"># Use scater to calculate logcounts</span></a> +<a class="sourceLine" id="cb88-2" data-line-number="2">sim <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/normalize">normalise</a></span>(sim)</a></code></pre></div> <pre><code>## Warning in .local(object, ...): using library sizes as size factors</code></pre> -<div class="sourceCode" id="cb87"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb87-1" data-line-number="1"><span class="co"># Plot PCA</span></a> -<a class="sourceLine" id="cb87-2" data-line-number="2"><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/plot_reddim">plotPCA</a></span>(sim)</a></code></pre></div> +<div class="sourceCode" id="cb90"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb90-1" data-line-number="1"><span class="co"># Plot PCA</span></a> +<a class="sourceLine" id="cb90-2" data-line-number="2"><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/plot_reddim">plotPCA</a></span>(sim)</a></code></pre></div> <p><img src="splatter_files/figure-html/pca-1.png" width="576" style="display: block; margin: auto;"></p> <p>(<strong>NOTE:</strong> Your values and plots may look different as the simulation is random and produces different results each time it is run.)</p> <p>For more details about the <code>SingleCellExperiment</code> object refer to the [vignette] <a href="https://bioconductor.org/packages/devel/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html">SCE-vignette</a>. For information about what you can do with <code>scater</code> refer to the <code>scater</code> documentation and <a href="https://bioconductor.org/packages/release/bioc/vignettes/scater/inst/doc/vignette.html">vignette</a>.</p> @@ -605,11 +609,11 @@ <a href="#simulating-groups" class="anchor"></a>Simulating groups</h2> <p>So far we have only simulated a single population of cells but often we are interested in investigating a mixed population of cells and looking to see what cell types are present or what differences there are between them. Splatter is able to simulate these situations by changing the <code>method</code> argument Here we are going to simulate two groups, by specifying the <code>group.prob</code> parameter and setting the <code>method</code> parameter to <code>"groups"</code>:</p> <p>(<strong>NOTE:</strong> We have also set the <code>verbose</code> argument to <code>FALSE</code> to stop Splatter printing progress messages.)</p> -<div class="sourceCode" id="cb88"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb88-1" data-line-number="1">sim.groups <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(<span class="dt">group.prob =</span> <span class="kw">c</span>(<span class="fl">0.5</span>, <span class="fl">0.5</span>), <span class="dt">method =</span> <span class="st">"groups"</span>,</a> -<a class="sourceLine" id="cb88-2" data-line-number="2"> <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> -<a class="sourceLine" id="cb88-3" data-line-number="3">sim.groups <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/normalize">normalise</a></span>(sim.groups)</a></code></pre></div> +<div class="sourceCode" id="cb91"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb91-1" data-line-number="1">sim.groups <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(<span class="dt">group.prob =</span> <span class="kw">c</span>(<span class="fl">0.5</span>, <span class="fl">0.5</span>), <span class="dt">method =</span> <span class="st">"groups"</span>,</a> +<a class="sourceLine" id="cb91-2" data-line-number="2"> <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> +<a class="sourceLine" id="cb91-3" data-line-number="3">sim.groups <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/normalize">normalise</a></span>(sim.groups)</a></code></pre></div> <pre><code>## Warning in .local(object, ...): using library sizes as size factors</code></pre> -<div class="sourceCode" id="cb90"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb90-1" data-line-number="1"><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/plot_reddim">plotPCA</a></span>(sim.groups, <span class="dt">colour_by =</span> <span class="st">"Group"</span>)</a></code></pre></div> +<div class="sourceCode" id="cb93"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb93-1" data-line-number="1"><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/plot_reddim">plotPCA</a></span>(sim.groups, <span class="dt">colour_by =</span> <span class="st">"Group"</span>)</a></code></pre></div> <p><img src="splatter_files/figure-html/groups-1.png" width="576" style="display: block; margin: auto;"></p> <p>As we have set both the group probabilites to 0.5 we should get approximately equal numbers of cells in each group (around 50 in this case). If we wanted uneven groups we could set <code>group.prob</code> to any set of probabilites that sum to 1.</p> </div> @@ -617,10 +621,10 @@ <h2 class="hasAnchor"> <a href="#simulating-paths" class="anchor"></a>Simulating paths</h2> <p>The other situation that is often of interest is a differentiation process where one cell type is changing into another. Splatter approximates this process by simulating a series of steps between two groups and randomly assigning each cell to a step. We can create this kind of simulation using the <code>"paths"</code> method.</p> -<div class="sourceCode" id="cb91"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb91-1" data-line-number="1">sim.paths <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(<span class="dt">method =</span> <span class="st">"paths"</span>, <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> -<a class="sourceLine" id="cb91-2" data-line-number="2">sim.paths <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/normalize">normalise</a></span>(sim.paths)</a></code></pre></div> +<div class="sourceCode" id="cb94"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb94-1" data-line-number="1">sim.paths <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(<span class="dt">method =</span> <span class="st">"paths"</span>, <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> +<a class="sourceLine" id="cb94-2" data-line-number="2">sim.paths <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/normalize">normalise</a></span>(sim.paths)</a></code></pre></div> <pre><code>## Warning in .local(object, ...): using library sizes as size factors</code></pre> -<div class="sourceCode" id="cb93"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb93-1" data-line-number="1"><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/plot_reddim">plotPCA</a></span>(sim.paths, <span class="dt">colour_by =</span> <span class="st">"Step"</span>)</a></code></pre></div> +<div class="sourceCode" id="cb96"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb96-1" data-line-number="1"><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/plot_reddim">plotPCA</a></span>(sim.paths, <span class="dt">colour_by =</span> <span class="st">"Step"</span>)</a></code></pre></div> <p><img src="splatter_files/figure-html/paths-1.png" width="576" style="display: block; margin: auto;"></p> <p>Here the colours represent the “step†of each cell or how far along the differentiation path it is. We can see that the cells with dark colours are more similar to the originating cell type and the light coloured cells are closer to the final, differentiated, cell type. By setting additional parameters it is possible to simulate more complex process (for example multiple mature cell types from a single progenitor).</p> </div> @@ -628,20 +632,17 @@ <h2 class="hasAnchor"> <a href="#batch-effects" class="anchor"></a>Batch effects</h2> <p>Another factor that is important in the analysis of any sequencing experiment are batch effects, technical variation that is common to a set of samples processed at the same time. We apply batch effects by telling Splatter how many cells are in each batch:</p> -<div class="sourceCode" id="cb94"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb94-1" data-line-number="1">sim.batches <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(<span class="dt">batchCells =</span> <span class="kw">c</span>(<span class="dv">50</span>, <span class="dv">50</span>), <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> -<a class="sourceLine" id="cb94-2" data-line-number="2">sim.batches <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/normalize">normalise</a></span>(sim.batches)</a></code></pre></div> +<div class="sourceCode" id="cb97"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb97-1" data-line-number="1">sim.batches <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(<span class="dt">batchCells =</span> <span class="kw">c</span>(<span class="dv">50</span>, <span class="dv">50</span>), <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> +<a class="sourceLine" id="cb97-2" data-line-number="2">sim.batches <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/normalize">normalise</a></span>(sim.batches)</a></code></pre></div> <pre><code>## Warning in .local(object, ...): using library sizes as size factors</code></pre> -<div class="sourceCode" id="cb96"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb96-1" data-line-number="1"><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/plot_reddim">plotPCA</a></span>(sim.batches, <span class="dt">colour_by =</span> <span class="st">"Batch"</span>)</a></code></pre></div> +<div class="sourceCode" id="cb99"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb99-1" data-line-number="1"><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/plot_reddim">plotPCA</a></span>(sim.batches, <span class="dt">colour_by =</span> <span class="st">"Batch"</span>)</a></code></pre></div> <p><img src="splatter_files/figure-html/batches-1.png" width="576" style="display: block; margin: auto;"></p> <p>This looks at lot like when we simulated groups and that is because the process is very similar. The difference is that batch effects are applied to all genes, not just those that are differentially expressed, and the effects are usually smaller. By combining groups and batches we can simulate both unwanted variation that we aren’t interested in (batch) and the wanted variation we are looking for (group):</p> -<div class="sourceCode" id="cb97"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb97-1" data-line-number="1">sim.groups <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(<span class="dt">batchCells =</span> <span class="kw">c</span>(<span class="dv">50</span>, <span class="dv">50</span>), <span class="dt">group.prob =</span> <span class="kw">c</span>(<span class="fl">0.5</span>, <span class="fl">0.5</span>),</a> -<a class="sourceLine" id="cb97-2" data-line-number="2"> <span class="dt">method =</span> <span class="st">"groups"</span>, <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> -<a class="sourceLine" id="cb97-3" data-line-number="3">sim.groups <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/normalize">normalise</a></span>(sim.groups)</a></code></pre></div> +<div class="sourceCode" id="cb100"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb100-1" data-line-number="1">sim.groups <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(<span class="dt">batchCells =</span> <span class="kw">c</span>(<span class="dv">50</span>, <span class="dv">50</span>), <span class="dt">group.prob =</span> <span class="kw">c</span>(<span class="fl">0.5</span>, <span class="fl">0.5</span>),</a> +<a class="sourceLine" id="cb100-2" data-line-number="2"> <span class="dt">method =</span> <span class="st">"groups"</span>, <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> +<a class="sourceLine" id="cb100-3" data-line-number="3">sim.groups <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/normalize">normalise</a></span>(sim.groups)</a></code></pre></div> <pre><code>## Warning in .local(object, ...): using library sizes as size factors</code></pre> -<div class="sourceCode" id="cb99"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb99-1" data-line-number="1"><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/plot_reddim">plotPCA</a></span>(sim.groups, <span class="dt">shape_by =</span> <span class="st">"Batch"</span>, <span class="dt">colour_by =</span> <span class="st">"Group"</span>,</a> -<a class="sourceLine" id="cb99-2" data-line-number="2"> <span class="dt">exprs_values =</span> <span class="st">"counts"</span>)</a></code></pre></div> -<pre><code>## Warning in .disambiguate_args(...): non-plotting arguments like -## 'exprs_values' should go in 'run_args'</code></pre> +<div class="sourceCode" id="cb102"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb102-1" data-line-number="1"><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/plot_reddim">plotPCA</a></span>(sim.groups, <span class="dt">shape_by =</span> <span class="st">"Batch"</span>, <span class="dt">colour_by =</span> <span class="st">"Group"</span>)</a></code></pre></div> <p><img src="splatter_files/figure-html/batch-groups-1.png" width="576" style="display: block; margin: auto;"></p> <p>Here we see that the effects of the group (first component) are stronger than the batch effects (second component) but by adjusting the parameters we could made the batch effects dominate.</p> </div> @@ -655,7 +656,7 @@ <h1 class="hasAnchor"> <a href="#other-simulations" class="anchor"></a>Other simulations</h1> <p>As well as it’s own Splat simulation method the Splatter package contains implementations of other single-cell RNA-seq simulations that have been published or wrappers around simulations included in other packages. To see all the available simulations run the <code><a href="../reference/listSims.html">listSims()</a></code> function:</p> -<div class="sourceCode" id="cb101"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb101-1" data-line-number="1"><span class="kw"><a href="../reference/listSims.html">listSims</a></span>()</a></code></pre></div> +<div class="sourceCode" id="cb103"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb103-1" data-line-number="1"><span class="kw"><a href="../reference/listSims.html">listSims</a></span>()</a></code></pre></div> <pre><code>## Splatter currently contains 12 simulations ## ## Splat (splat) @@ -706,7 +707,7 @@ ## DOI: 10.1101/125112 GitHub: drisso/zinbwave ## The ZINB-WaVE simulation simulates counts from a sophisticated zero-inflated negative-binomial distribution including cell and gene-level covariates.</code></pre> <p>(or more conveniently for the vignette as a table)</p> -<div class="sourceCode" id="cb103"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb103-1" data-line-number="1">knitr<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/knitr/topics/kable">kable</a></span>(<span class="kw"><a href="../reference/listSims.html">listSims</a></span>(<span class="dt">print =</span> <span class="ot">FALSE</span>))</a></code></pre></div> +<div class="sourceCode" id="cb105"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb105-1" data-line-number="1">knitr<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/knitr/topics/kable">kable</a></span>(<span class="kw"><a href="../reference/listSims.html">listSims</a></span>(<span class="dt">print =</span> <span class="ot">FALSE</span>))</a></code></pre></div> <table class="table"> <thead><tr class="header"> <th align="left">Name</th> @@ -808,67 +809,67 @@ <h1 class="hasAnchor"> <a href="#other-expression-values" class="anchor"></a>Other expression values</h1> <p>Splatter is designed to simulate count data but some analysis methods expect other expression values, particularly length-normalised values such as TPM or FPKM. The <code>scater</code> package has functions for adding these values to a <code>SingleCellExperiment</code> object but they require a length for each gene. The <code>addGeneLengths</code> function can be used to simulate these lengths:</p> -<div class="sourceCode" id="cb104"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb104-1" data-line-number="1">sim <-<span class="st"> </span><span class="kw"><a href="../reference/simpleSimulate.html">simpleSimulate</a></span>(<span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> -<a class="sourceLine" id="cb104-2" data-line-number="2">sim <-<span class="st"> </span><span class="kw"><a href="../reference/addGeneLengths.html">addGeneLengths</a></span>(sim)</a> -<a class="sourceLine" id="cb104-3" data-line-number="3"><span class="kw">head</span>(<span class="kw">rowData</span>(sim))</a></code></pre></div> +<div class="sourceCode" id="cb106"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb106-1" data-line-number="1">sim <-<span class="st"> </span><span class="kw"><a href="../reference/simpleSimulate.html">simpleSimulate</a></span>(<span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> +<a class="sourceLine" id="cb106-2" data-line-number="2">sim <-<span class="st"> </span><span class="kw"><a href="../reference/addGeneLengths.html">addGeneLengths</a></span>(sim)</a> +<a class="sourceLine" id="cb106-3" data-line-number="3"><span class="kw">head</span>(<span class="kw">rowData</span>(sim))</a></code></pre></div> <pre><code>## DataFrame with 6 rows and 3 columns ## Gene GeneMean Length ## <factor> <numeric> <numeric> -## 1 Gene1 3.56323287578331 3147 -## 2 Gene2 2.01145135360206 1818 -## 3 Gene3 1.86585373979197 1706 -## 4 Gene4 0.604002851544031 2095 -## 5 Gene5 0.208358805273164 12058 -## 6 Gene6 0.00251242171935063 3166</code></pre> +## 1 Gene1 0.952295922769918 1496 +## 2 Gene2 2.87873968030232 716 +## 3 Gene3 0.0135557245970668 4430 +## 4 Gene4 0.00368760310168385 2284 +## 5 Gene5 0.56378066886752 3537 +## 6 Gene6 3.19737947404623 2187</code></pre> <p>We can then use <code>scater</code> to calculate TPM:</p> -<div class="sourceCode" id="cb106"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb106-1" data-line-number="1"><span class="kw">tpm</span>(sim) <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/calculateTPM">calculateTPM</a></span>(sim, <span class="kw">rowData</span>(sim)<span class="op">$</span>Length)</a> -<a class="sourceLine" id="cb106-2" data-line-number="2"><span class="kw">tpm</span>(sim)[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>, <span class="dv">1</span><span class="op">:</span><span class="dv">5</span>]</a></code></pre></div> -<pre><code>## Cell1 Cell2 Cell3 Cell4 Cell5 -## Gene1 0.04756574 0.04729671 0.11788209 0.145152470 0.04817510 -## Gene2 0.12350610 0.12280755 0.12243397 0.167508186 0.12508831 -## Gene3 0.04387145 0.13086994 0.08698122 0.133878905 0.04443348 -## Gene4 0.00000000 0.00000000 0.00000000 0.000000000 0.03618306 -## Gene5 0.00000000 0.00000000 0.00000000 0.006313856 0.00000000</code></pre> +<div class="sourceCode" id="cb108"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb108-1" data-line-number="1"><span class="kw">tpm</span>(sim) <-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/scater/topics/calculateTPM">calculateTPM</a></span>(sim, <span class="kw">rowData</span>(sim)<span class="op">$</span>Length)</a> +<a class="sourceLine" id="cb108-2" data-line-number="2"><span class="kw">tpm</span>(sim)[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>, <span class="dv">1</span><span class="op">:</span><span class="dv">5</span>]</a></code></pre></div> +<pre><code>## Cell1 Cell2 Cell3 Cell4 Cell5 +## Gene1 0.05053290 0.000000 0.00000000 0.05102276 0.05145083 +## Gene2 0.21116541 0.418942 0.52430665 0.00000000 0.53750310 +## Gene3 0.00000000 0.000000 0.00000000 0.00000000 0.00000000 +## Gene4 0.03309861 0.000000 0.00000000 0.00000000 0.00000000 +## Gene5 0.00000000 0.000000 0.02122723 0.02158045 0.00000000</code></pre> <p>The default method used by <code>addGeneLengths</code> to simulate lengths is to generate values from a log-normal distribution which are then rounded to give an integer length. The parameters for this distribution are based on human protein coding genes but can be adjusted if needed (for example for other species). Alternatively lengths can be sampled from a provided vector (see <code><a href="../reference/addGeneLengths.html">?addGeneLengths</a></code> for details and an example).</p> </div> <div id="comparing-simulations-and-real-data" class="section level1"> <h1 class="hasAnchor"> <a href="#comparing-simulations-and-real-data" class="anchor"></a>Comparing simulations and real data</h1> <p>One thing you might like to do after simulating data is to compare it to a real dataset, or compare simulations with different parameters or models. Splatter provides a function <code>compareSCEs</code> that aims to make these comparisons easier. As the name suggests this function takes a list of <code>SingleCellExperiment</code> objects, combines the datasets and produces some plots comparing them. Let’s make two small simulations and see how they compare.</p> -<div class="sourceCode" id="cb108"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb108-1" data-line-number="1">sim1 <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(<span class="dt">nGenes =</span> <span class="dv">1000</span>, <span class="dt">batchCells =</span> <span class="dv">20</span>, <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> -<a class="sourceLine" id="cb108-2" data-line-number="2">sim2 <-<span class="st"> </span><span class="kw"><a href="../reference/simpleSimulate.html">simpleSimulate</a></span>(<span class="dt">nGenes =</span> <span class="dv">1000</span>, <span class="dt">nCells =</span> <span class="dv">20</span>, <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> -<a class="sourceLine" id="cb108-3" data-line-number="3">comparison <-<span class="st"> </span><span class="kw"><a href="../reference/compareSCEs.html">compareSCEs</a></span>(<span class="kw">list</span>(<span class="dt">Splat =</span> sim1, <span class="dt">Simple =</span> sim2))</a></code></pre></div> +<div class="sourceCode" id="cb110"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb110-1" data-line-number="1">sim1 <-<span class="st"> </span><span class="kw"><a href="../reference/splatSimulate.html">splatSimulate</a></span>(<span class="dt">nGenes =</span> <span class="dv">1000</span>, <span class="dt">batchCells =</span> <span class="dv">20</span>, <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> +<a class="sourceLine" id="cb110-2" data-line-number="2">sim2 <-<span class="st"> </span><span class="kw"><a href="../reference/simpleSimulate.html">simpleSimulate</a></span>(<span class="dt">nGenes =</span> <span class="dv">1000</span>, <span class="dt">nCells =</span> <span class="dv">20</span>, <span class="dt">verbose =</span> <span class="ot">FALSE</span>)</a> +<a class="sourceLine" id="cb110-3" data-line-number="3">comparison <-<span class="st"> </span><span class="kw"><a href="../reference/compareSCEs.html">compareSCEs</a></span>(<span class="kw">list</span>(<span class="dt">Splat =</span> sim1, <span class="dt">Simple =</span> sim2))</a></code></pre></div> <pre><code>## Note that the names of some metrics have changed, see 'Renamed metrics' in ?calculateQCMetrics. ## Old names are currently maintained for back-compatibility, but may be removed in future releases. ## Note that the names of some metrics have changed, see 'Renamed metrics' in ?calculateQCMetrics. ## Old names are currently maintained for back-compatibility, but may be removed in future releases.</code></pre> -<div class="sourceCode" id="cb110"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb110-1" data-line-number="1"><span class="kw">names</span>(comparison)</a></code></pre></div> +<div class="sourceCode" id="cb112"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb112-1" data-line-number="1"><span class="kw">names</span>(comparison)</a></code></pre></div> <pre><code>## [1] "FeatureData" "PhenoData" "Plots"</code></pre> -<div class="sourceCode" id="cb112"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb112-1" data-line-number="1"><span class="kw">names</span>(comparison<span class="op">$</span>Plots)</a></code></pre></div> +<div class="sourceCode" id="cb114"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb114-1" data-line-number="1"><span class="kw">names</span>(comparison<span class="op">$</span>Plots)</a></code></pre></div> <pre><code>## [1] "Means" "Variances" "MeanVar" "LibrarySizes" ## [5] "ZerosGene" "ZerosCell" "MeanZeros"</code></pre> <p>The returned list has three items. The first two are the combined datasets by gene (<code>FeatureData</code>) and by cell (<code>PhenoData</code>) and the third contains some comparison plots (produced using <code>ggplot2</code>), for example a plot of the distribution of means:</p> -<div class="sourceCode" id="cb114"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb114-1" data-line-number="1">comparison<span class="op">$</span>Plots<span class="op">$</span>Means</a></code></pre></div> +<div class="sourceCode" id="cb116"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb116-1" data-line-number="1">comparison<span class="op">$</span>Plots<span class="op">$</span>Means</a></code></pre></div> <p><img src="splatter_files/figure-html/comparison-means-1.png" width="576" style="display: block; margin: auto;"></p> <p>These are only a few of the plots you might want to consider but it should be easy to make more using the returned data. For example, we could plot the number of expressed genes against the library size:</p> -<div class="sourceCode" id="cb115"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb115-1" data-line-number="1"><span class="kw">library</span>(<span class="st">"ggplot2"</span>)</a> -<a class="sourceLine" id="cb115-2" data-line-number="2"><span class="kw"><a href="http://www.rdocumentation.org/packages/ggplot2/topics/ggplot">ggplot</a></span>(comparison<span class="op">$</span>PhenoData,</a> -<a class="sourceLine" id="cb115-3" data-line-number="3"> <span class="kw"><a href="http://www.rdocumentation.org/packages/ggplot2/topics/aes">aes</a></span>(<span class="dt">x =</span> total_counts, <span class="dt">y =</span> total_features, <span class="dt">colour =</span> Dataset)) <span class="op">+</span></a> -<a class="sourceLine" id="cb115-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/ggplot2/topics/geom_point">geom_point</a></span>()</a></code></pre></div> +<div class="sourceCode" id="cb117"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb117-1" data-line-number="1"><span class="kw">library</span>(<span class="st">"ggplot2"</span>)</a> +<a class="sourceLine" id="cb117-2" data-line-number="2"><span class="kw"><a href="http://www.rdocumentation.org/packages/ggplot2/topics/ggplot">ggplot</a></span>(comparison<span class="op">$</span>PhenoData,</a> +<a class="sourceLine" id="cb117-3" data-line-number="3"> <span class="kw"><a href="http://www.rdocumentation.org/packages/ggplot2/topics/aes">aes</a></span>(<span class="dt">x =</span> total_counts, <span class="dt">y =</span> total_features, <span class="dt">colour =</span> Dataset)) <span class="op">+</span></a> +<a class="sourceLine" id="cb117-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/ggplot2/topics/geom_point">geom_point</a></span>()</a></code></pre></div> <p><img src="splatter_files/figure-html/comparison-libsize-features-1.png" width="576" style="display: block; margin: auto;"></p> <div id="comparing-differences" class="section level2"> <h2 class="hasAnchor"> <a href="#comparing-differences" class="anchor"></a>Comparing differences</h2> <p>Sometimes instead of visually comparing datasets it may be more interesting to look at the differences between them. We can do this using the <code>diffSCEs</code> function. Similar to <code>compareSCEs</code> this function takes a list of <code>SingleCellExperiment</code> objects but now we also specify one to be a reference. A series of similar plots are returned but instead of showing the overall distributions they demonstrate differences from the reference.</p> -<div class="sourceCode" id="cb116"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb116-1" data-line-number="1">difference <-<span class="st"> </span><span class="kw"><a href="../reference/diffSCEs.html">diffSCEs</a></span>(<span class="kw">list</span>(<span class="dt">Splat =</span> sim1, <span class="dt">Simple =</span> sim2), <span class="dt">ref =</span> <span class="st">"Simple"</span>)</a></code></pre></div> +<div class="sourceCode" id="cb118"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb118-1" data-line-number="1">difference <-<span class="st"> </span><span class="kw"><a href="../reference/diffSCEs.html">diffSCEs</a></span>(<span class="kw">list</span>(<span class="dt">Splat =</span> sim1, <span class="dt">Simple =</span> sim2), <span class="dt">ref =</span> <span class="st">"Simple"</span>)</a></code></pre></div> <pre><code>## Note that the names of some metrics have changed, see 'Renamed metrics' in ?calculateQCMetrics. ## Old names are currently maintained for back-compatibility, but may be removed in future releases. ## Note that the names of some metrics have changed, see 'Renamed metrics' in ?calculateQCMetrics. ## Old names are currently maintained for back-compatibility, but may be removed in future releases.</code></pre> -<div class="sourceCode" id="cb118"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb118-1" data-line-number="1">difference<span class="op">$</span>Plots<span class="op">$</span>Means</a></code></pre></div> +<div class="sourceCode" id="cb120"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb120-1" data-line-number="1">difference<span class="op">$</span>Plots<span class="op">$</span>Means</a></code></pre></div> <p><img src="splatter_files/figure-html/difference-1.png" width="576" style="display: block; margin: auto;"></p> <p>We also get a series of Quantile-Quantile plot that can be used to compare distributions.</p> -<div class="sourceCode" id="cb119"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb119-1" data-line-number="1">difference<span class="op">$</span>QQPlots<span class="op">$</span>Means</a></code></pre></div> +<div class="sourceCode" id="cb121"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb121-1" data-line-number="1">difference<span class="op">$</span>QQPlots<span class="op">$</span>Means</a></code></pre></div> <p><img src="splatter_files/figure-html/difference-qq-1.png" width="576" style="display: block; margin: auto;"></p> </div> <div id="making-panels" class="section level2"> @@ -876,22 +877,22 @@ <a href="#making-panels" class="anchor"></a>Making panels</h2> <p>Each of these comparisons makes several plots which can be a lot to look at. To make this easier, or to produce figures for publications, you can make use of the functions <code>makeCompPanel</code>, <code>makeDiffPanel</code> and <code>makeOverallPanel</code>.</p> <p>These functions combine the plots into a single panel using the <code>cowplot</code> package. The panels can be quite large and hard to view (for example in RStudio’s plot viewer) so it can be better to output the panels and view them separately. Luckily <code>cowplot</code> provides a convenient function for saving the images. Here are some suggested parameters for outputting each of the panels:</p> -<div class="sourceCode" id="cb120"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb120-1" data-line-number="1"><span class="co"># This code is just an example and is not run</span></a> -<a class="sourceLine" id="cb120-2" data-line-number="2">panel <-<span class="st"> </span><span class="kw"><a href="../reference/makeCompPanel.html">makeCompPanel</a></span>(comparison)</a> -<a class="sourceLine" id="cb120-3" data-line-number="3">cowplot<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/cowplot/topics/save_plot">save_plot</a></span>(<span class="st">"comp_panel.png"</span>, panel, <span class="dt">nrow =</span> <span class="dv">4</span>, <span class="dt">ncol =</span> <span class="dv">3</span>)</a> -<a class="sourceLine" id="cb120-4" data-line-number="4"></a> -<a class="sourceLine" id="cb120-5" data-line-number="5">panel <-<span class="st"> </span><span class="kw"><a href="../reference/makeDiffPanel.html">makeDiffPanel</a></span>(difference)</a> -<a class="sourceLine" id="cb120-6" data-line-number="6">cowplot<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/cowplot/topics/save_plot">save_plot</a></span>(<span class="st">"diff_panel.png"</span>, panel, <span class="dt">nrow =</span> <span class="dv">3</span>, <span class="dt">ncol =</span> <span class="dv">5</span>)</a> -<a class="sourceLine" id="cb120-7" data-line-number="7"></a> -<a class="sourceLine" id="cb120-8" data-line-number="8">panel <-<span class="st"> </span><span class="kw"><a href="../reference/makeOverallPanel.html">makeOverallPanel</a></span>(comparison, difference)</a> -<a class="sourceLine" id="cb120-9" data-line-number="9">cowplot<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/cowplot/topics/save_plot">save_plot</a></span>(<span class="st">"overall_panel.png"</span>, panel, <span class="dt">ncol =</span> <span class="dv">4</span>, <span class="dt">nrow =</span> <span class="dv">7</span>)</a></code></pre></div> +<div class="sourceCode" id="cb122"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb122-1" data-line-number="1"><span class="co"># This code is just an example and is not run</span></a> +<a class="sourceLine" id="cb122-2" data-line-number="2">panel <-<span class="st"> </span><span class="kw"><a href="../reference/makeCompPanel.html">makeCompPanel</a></span>(comparison)</a> +<a class="sourceLine" id="cb122-3" data-line-number="3">cowplot<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/cowplot/topics/save_plot">save_plot</a></span>(<span class="st">"comp_panel.png"</span>, panel, <span class="dt">nrow =</span> <span class="dv">4</span>, <span class="dt">ncol =</span> <span class="dv">3</span>)</a> +<a class="sourceLine" id="cb122-4" data-line-number="4"></a> +<a class="sourceLine" id="cb122-5" data-line-number="5">panel <-<span class="st"> </span><span class="kw"><a href="../reference/makeDiffPanel.html">makeDiffPanel</a></span>(difference)</a> +<a class="sourceLine" id="cb122-6" data-line-number="6">cowplot<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/cowplot/topics/save_plot">save_plot</a></span>(<span class="st">"diff_panel.png"</span>, panel, <span class="dt">nrow =</span> <span class="dv">3</span>, <span class="dt">ncol =</span> <span class="dv">5</span>)</a> +<a class="sourceLine" id="cb122-7" data-line-number="7"></a> +<a class="sourceLine" id="cb122-8" data-line-number="8">panel <-<span class="st"> </span><span class="kw"><a href="../reference/makeOverallPanel.html">makeOverallPanel</a></span>(comparison, difference)</a> +<a class="sourceLine" id="cb122-9" data-line-number="9">cowplot<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/cowplot/topics/save_plot">save_plot</a></span>(<span class="st">"overall_panel.png"</span>, panel, <span class="dt">ncol =</span> <span class="dv">4</span>, <span class="dt">nrow =</span> <span class="dv">7</span>)</a></code></pre></div> </div> </div> <div id="citing-splatter" class="section level1"> <h1 class="hasAnchor"> <a href="#citing-splatter" class="anchor"></a>Citing Splatter</h1> <p>If you use Splatter in your work please cite our paper:</p> -<div class="sourceCode" id="cb121"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb121-1" data-line-number="1"><span class="kw">citation</span>(<span class="st">"splatter"</span>)</a></code></pre></div> +<div class="sourceCode" id="cb123"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb123-1" data-line-number="1"><span class="kw">citation</span>(<span class="st">"splatter"</span>)</a></code></pre></div> <pre><code>## ## Zappia L, Phipson B, Oshlack A. Splatter: Simulation of ## single-cell RNA sequencing data. Genome Biology. 2017; @@ -911,8 +912,8 @@ <div id="session-information" class="section level1 unnumbered"> <h1 class="hasAnchor"> <a href="#session-information" class="anchor"></a>Session information</h1> -<div class="sourceCode" id="cb123"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb123-1" data-line-number="1"><span class="kw">sessionInfo</span>()</a></code></pre></div> -<pre><code>## R Under development (unstable) (2018-01-28 r74177) +<div class="sourceCode" id="cb125"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb125-1" data-line-number="1"><span class="kw">sessionInfo</span>()</a></code></pre></div> +<pre><code>## R version 3.5.0 beta (2018-04-10 r74581) ## Platform: x86_64-apple-darwin16.7.0 (64-bit) ## Running under: macOS Sierra 10.12.6 ## @@ -928,56 +929,50 @@ ## [8] methods base ## ## other attached packages: -## [1] scater_1.7.13 ggplot2_2.2.1 -## [3] splatter_1.3.2 SingleCellExperiment_1.1.2 -## [5] SummarizedExperiment_1.9.15 DelayedArray_0.5.22 +## [1] scater_1.7.15 ggplot2_2.2.1 +## [3] splatter_1.3.3.9010 SingleCellExperiment_1.1.3 +## [5] SummarizedExperiment_1.9.16 DelayedArray_0.5.30 ## [7] BiocParallel_1.13.3 matrixStats_0.53.1 -## [9] Biobase_2.39.2 GenomicRanges_1.31.22 +## [9] Biobase_2.39.2 GenomicRanges_1.31.23 ## [11] GenomeInfoDb_1.15.5 IRanges_2.13.28 -## [13] S4Vectors_0.17.37 BiocGenerics_0.25.3 +## [13] S4Vectors_0.17.41 BiocGenerics_0.25.3 ## ## loaded via a namespace (and not attached): -## [1] bitops_1.0-6 bit64_0.9-7 -## [3] progress_1.1.2 httr_1.3.1 -## [5] rprojroot_1.3-2 tools_3.5.0 -## [7] backports_1.1.2 R6_2.2.2 -## [9] vipor_0.4.5 DBI_0.8 -## [11] lazyeval_0.2.1 colorspace_1.3-2 -## [13] sp_1.2-7 gridExtra_2.3 -## [15] prettyunits_1.0.2 bit_1.1-12 -## [17] compiler_3.5.0 labeling_0.3 -## [19] scales_0.5.0 checkmate_1.8.5 -## [21] stringr_1.3.0 digest_0.6.15 -## [23] rmarkdown_1.9 XVector_0.19.9 -## [25] pkgconfig_2.0.1 htmltools_0.3.6 -## [27] akima_0.6-2 highr_0.6 -## [29] limma_3.35.14 rlang_0.2.0 -## [31] RSQLite_2.0 shiny_1.0.5 -## [33] DelayedMatrixStats_1.1.10 bindr_0.1.1 -## [35] dplyr_0.7.4 RCurl_1.95-4.10 -## [37] magrittr_1.5 GenomeInfoDbData_1.1.0 -## [39] Matrix_1.2-12 Rcpp_0.12.16 -## [41] ggbeeswarm_0.6.0 munsell_0.4.3 -## [43] Rhdf5lib_1.1.5 viridis_0.5.0 -## [45] stringi_1.1.7 yaml_2.1.18 -## [47] edgeR_3.21.9 MASS_7.3-48 -## [49] zlibbioc_1.25.0 rhdf5_2.23.5 -## [51] plyr_1.8.4 grid_3.5.0 -## [53] blob_1.1.1 shinydashboard_0.7.0 -## [55] lattice_0.20-35 cowplot_0.9.2 -## [57] splines_3.5.0 locfit_1.5-9.1 -## [59] knitr_1.20 pillar_1.2.1 -## [61] rjson_0.2.15 reshape2_1.4.3 -## [63] biomaRt_2.35.12 XML_3.98-1.10 -## [65] glue_1.2.0 evaluate_0.10.1 -## [67] data.table_1.10.4-3 httpuv_1.3.6.2 -## [69] gtable_0.2.0 assertthat_0.2.0 -## [71] mime_0.5 xtable_1.8-2 -## [73] survival_2.41-3 viridisLite_0.3.0 -## [75] tibble_1.4.2 AnnotationDbi_1.41.4 -## [77] beeswarm_0.2.3 memoise_1.1.0 -## [79] tximport_1.7.13 bindrcpp_0.2 -## [81] fitdistrplus_1.0-9</code></pre> +## [1] viridis_0.5.1 edgeR_3.21.9 +## [3] viridisLite_0.3.0 splines_3.5.0 +## [5] DelayedMatrixStats_1.1.12 shiny_1.0.5 +## [7] assertthat_0.2.0 highr_0.6 +## [9] sp_1.2-7 GenomeInfoDbData_1.1.0 +## [11] vipor_0.4.5 yaml_2.1.18 +## [13] pillar_1.2.1 backports_1.1.2 +## [15] lattice_0.20-35 glue_1.2.0 +## [17] limma_3.35.14 digest_0.6.15 +## [19] XVector_0.19.9 checkmate_1.8.6 +## [21] colorspace_1.3-2 cowplot_0.9.2 +## [23] htmltools_0.3.6 httpuv_1.3.6.2 +## [25] Matrix_1.2-14 plyr_1.8.4 +## [27] pkgconfig_2.0.1 zlibbioc_1.25.0 +## [29] xtable_1.8-2 scales_0.5.0 +## [31] tibble_1.4.2 lazyeval_0.2.1 +## [33] crayon_1.3.4 survival_2.41-3 +## [35] magrittr_1.5 mime_0.5 +## [37] evaluate_0.10.1 MASS_7.3-49 +## [39] beeswarm_0.2.3 shinydashboard_0.7.0 +## [41] tools_3.5.0 fitdistrplus_1.0-9 +## [43] data.table_1.10.4-3 stringr_1.3.0 +## [45] Rhdf5lib_1.1.5 munsell_0.4.3 +## [47] locfit_1.5-9.1 bindrcpp_0.2.2 +## [49] akima_0.6-2 compiler_3.5.0 +## [51] rlang_0.2.0 rhdf5_2.23.7 +## [53] grid_3.5.0 RCurl_1.95-4.10 +## [55] tximport_1.7.14 rjson_0.2.15 +## [57] labeling_0.3 bitops_1.0-6 +## [59] rmarkdown_1.9 gtable_0.2.0 +## [61] reshape2_1.4.3 R6_2.2.2 +## [63] gridExtra_2.3 knitr_1.20 +## [65] dplyr_0.7.4 bindr_0.1.1 +## [67] rprojroot_1.3-2 stringi_1.1.7 +## [69] ggbeeswarm_0.6.0 Rcpp_0.12.16</code></pre> </div> </div> </div> diff --git a/docs/articles/splatter_files/figure-html/batch-groups-1.png b/docs/articles/splatter_files/figure-html/batch-groups-1.png index baadc002cbb46a612b2d55cc2553ba07a85748b6..21129513a61deab0d61e0daac8800f2faa0534b2 100644 Binary files a/docs/articles/splatter_files/figure-html/batch-groups-1.png and b/docs/articles/splatter_files/figure-html/batch-groups-1.png differ diff --git a/docs/articles/splatter_files/figure-html/batches-1.png b/docs/articles/splatter_files/figure-html/batches-1.png index ff71471ae93b8c66c59ddb21eb31bf1ba74a7c3d..0d4703d1a675867c7142c27a3d4169a53a5dc4ff 100644 Binary files a/docs/articles/splatter_files/figure-html/batches-1.png and b/docs/articles/splatter_files/figure-html/batches-1.png differ diff --git a/docs/articles/splatter_files/figure-html/comparison-libsize-features-1.png b/docs/articles/splatter_files/figure-html/comparison-libsize-features-1.png index 744adc0e2ee1a74b21b13827f07ad8999c695d47..ba3a976f177a82e4fc8a65af2b430aa1ad830f9f 100644 Binary files a/docs/articles/splatter_files/figure-html/comparison-libsize-features-1.png and b/docs/articles/splatter_files/figure-html/comparison-libsize-features-1.png differ diff --git a/docs/articles/splatter_files/figure-html/comparison-means-1.png b/docs/articles/splatter_files/figure-html/comparison-means-1.png index bbe6b0213d36f5c20c10a47b556b18448173783e..4f71d89c67dfd837249072aae06f47f2b2f68b51 100644 Binary files a/docs/articles/splatter_files/figure-html/comparison-means-1.png and b/docs/articles/splatter_files/figure-html/comparison-means-1.png differ diff --git a/docs/articles/splatter_files/figure-html/difference-1.png b/docs/articles/splatter_files/figure-html/difference-1.png index 937bffc92a016a115dc6435844b6017d5629bb3d..b7e28f110935b6d4688813246828848d68ee532a 100644 Binary files a/docs/articles/splatter_files/figure-html/difference-1.png and b/docs/articles/splatter_files/figure-html/difference-1.png differ diff --git a/docs/articles/splatter_files/figure-html/difference-qq-1.png b/docs/articles/splatter_files/figure-html/difference-qq-1.png index 39d95a5b6811e169edba43dc7f7dc571b25c3f57..e15899e9a4946dcfbe6ebf19434b5a5df1ea7158 100644 Binary files a/docs/articles/splatter_files/figure-html/difference-qq-1.png and b/docs/articles/splatter_files/figure-html/difference-qq-1.png differ diff --git a/docs/articles/splatter_files/figure-html/groups-1.png b/docs/articles/splatter_files/figure-html/groups-1.png index e9fc24effa5d25f1ab4eb35f2ea5ae31f4bdc83f..2e10c59a0cb138bd94ff68e8f2bdd8325fbe27cc 100644 Binary files a/docs/articles/splatter_files/figure-html/groups-1.png and b/docs/articles/splatter_files/figure-html/groups-1.png differ diff --git a/docs/articles/splatter_files/figure-html/paths-1.png b/docs/articles/splatter_files/figure-html/paths-1.png index 6a7006c1b758445a6d519921ee1c14cbe4a5bb48..92417785f5d67bb3439a97e4239966e0965fced7 100644 Binary files a/docs/articles/splatter_files/figure-html/paths-1.png and b/docs/articles/splatter_files/figure-html/paths-1.png differ diff --git a/docs/articles/splatter_files/figure-html/pca-1.png b/docs/articles/splatter_files/figure-html/pca-1.png index c3944128d4bd96f609df48800032bb51febef38a..fdd505da9563045b2f73faa71f18e54887026dfb 100644 Binary files a/docs/articles/splatter_files/figure-html/pca-1.png and b/docs/articles/splatter_files/figure-html/pca-1.png differ diff --git a/docs/authors.html b/docs/authors.html index 28822b274997cbdfbbd523d66f299a930fd7cdec..cb75a40a7d6f1b0ab3c352a5484d749064678728 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -102,7 +102,7 @@ <h1>Citation</h1> </div> - <p>Zappia L, Phipson B and Oshlack A (2017). + <p>Zappia L, Phipson B, Oshlack A (2017). “Splatter: simulation of single-cell RNA sequencing data.” <em>Genome Biology</em>. doi: <a href="http://doi.org/10.1186/s13059-017-1305-0">10.1186/s13059-017-1305-0</a>, <a href="http://dx.doi.org/10.1186/s13059-017-1305-0">http://dx.doi.org/10.1186/s13059-017-1305-0</a>. @@ -122,15 +122,15 @@ doi: <a href="http://doi.org/10.1186/s13059-017-1305-0">10.1186/s13059-017-1305- <ul class="list-unstyled"> <li> <p><strong>Luke Zappia</strong>. Author, maintainer. - </p> + <br /><small>0000-0001-7744-8565</small></p> </li> <li> <p><strong>Belinda Phipson</strong>. Author. - </p> + <br /><small>0000-0002-1711-7454</small></p> </li> <li> <p><strong>Alicia Oshlack</strong>. Author. - </p> + <br /><small>0000-0001-9788-5690</small></p> </li> </ul> diff --git a/docs/index.html b/docs/index.html index e81b7e443dda4b88ed1dde5e6ad4bbea1b8642f1..b6a03e64a033969e786de401159d245230cf272a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -130,9 +130,12 @@ biocLite("splatter")</code></pre> </ul> <h2>Developers</h2> <ul class="list-unstyled"> -<li>Luke Zappia <br><small class="roles"> Author, maintainer </small> </li> -<li>Belinda Phipson <br><small class="roles"> Author </small> </li> -<li>Alicia Oshlack <br><small class="roles"> Author </small> </li> +<li>Luke Zappia <br><small class="roles"> Author, maintainer </small> <br><small>(0000-0001-7744-8565)</small> +</li> +<li>Belinda Phipson <br><small class="roles"> Author </small> <br><small>(0000-0002-1711-7454)</small> +</li> +<li>Alicia Oshlack <br><small class="roles"> Author </small> <br><small>(0000-0001-9788-5690)</small> +</li> </ul> <h2>Dev status</h2> <ul class="list-unstyled"> diff --git a/docs/news/index.html b/docs/news/index.html index cf4257d1ef40d0939299f0dd55a6f7dcc2ca05cc..4715b61bced570550a1ba48300f23528343bc898 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -104,6 +104,25 @@ <div class="contents"> <div class="section level2"> +<h2>Version 1.3.4 (2018-04-19)</h2> +<ul> +<li>Add option to use a normal distribution for library sizes in Splat simulations</li> +<li>Add SparseDC simulation</li> +<li>Rename params in metadata slot of simulation to Params for consistency</li> +<li>Add checks to SplatParams to reset path.from if nGroups changes</li> +<li>Improve printing of parameters stored as data.frames</li> +<li>Colourise Params print output and listSims output</li> +<li>Improve warning message when fitting means in splatEstimate fails</li> +<li>Simplify problematic documentation links</li> +</ul> +<div class="section level3"> +<h3>Version 1.3.3.9010 (2018-04-12)</h3> +<ul> +<li>Add option to use a normal distribution for library sizes in Splat simulations</li> +</ul> +</div> +</div> + <div class="section level2"> <h2>Version 1.3.3 (2018-03-27)</h2> <ul> <li>Fix parameter passing bug in scDDEstimate</li> @@ -459,6 +478,7 @@ <div id="tocnav"> <h2>Contents</h2> <ul class="nav nav-pills nav-stacked"> + <li><a href="#NA">1.3.4</a></li> <li><a href="#NA">1.3.3</a></li> <li><a href="#NA">1.3.2</a></li> <li><a href="#NA">1.3.1</a></li> diff --git a/docs/reference/SparseDCParams.html b/docs/reference/SparseDCParams.html new file mode 100644 index 0000000000000000000000000000000000000000..b106fa1fda38ead9d176e12e0109dcbb47543042 --- /dev/null +++ b/docs/reference/SparseDCParams.html @@ -0,0 +1,161 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>The SparseDCParams class — SparseDCParams • Splatter</title> + +<!-- jquery --> +<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> +<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cosmo/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> + +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + <link href="../extra.css" rel="stylesheet"> + +<!-- mathjax --> +<script src='https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + +<!-- Google analytics --> +<script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-52309538-4', 'auto'); + ga('send', 'pageview'); + +</script> + + </head> + + <body> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">splatter</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../index.html"> + <span class="fa fa-home fa-lg"></span> + + </a> +</li> +<li> + <a href="../articles/splatter.html">Get Started</a> +</li> +<li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/Oshlack/splatter"> + <span class="fa fa-github fa-lg"></span> + + </a> +</li> + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>The SparseDCParams class</h1> + </div> + + + <p>S4 class that holds parameters for the SparseDC simulation.</p> + + + + <h2 class="hasAnchor" id="parameters"><a class="anchor" href="#parameters"></a>Parameters</h2> + + + <p>The SparseDC simulation uses the following parameters:</p><dl class='dl-horizontal'> + <dt><code>nGenes</code></dt><dd><p>The number of genes to simulate in each condition.</p></dd> + <dt><code>nCells</code></dt><dd><p>The number of cells to simulate.</p></dd> + <dt><code>[seed]</code></dt><dd><p>Seed to use for generating random numbers.</p></dd> + <dt><code>markers.n</code></dt><dd><p>Number of marker genes to simulate for each + cluster.</p></dd> + <dt><code>markers.shared</code></dt><dd><p>Number of marker genes for each cluster + shared between conditions. Must be less than or equal to + <code>markers.n</code></p></dd>. + <dt><code>[markers.same]</code></dt><dd><p>Logical. Whether each cluster should have + the same set of marker genes.</p></dd> + <dt><code>clusts.c1</code></dt><dd><p>Numeric vector of clusters present in + condition 1. The number of times a cluster is repeated controls the + proportion of cells from that cluster.</p></dd> + <dt><code>clusts.c2</code></dt><dd><p>Numeric vector of clusters present in + condition 2. The number of times a cluster is repeated controls the + proportion of cells from that cluster.</p></dd> + <dt><code>[mean.lower]</code></dt><dd><p>Lower bound for cluster gene means.</p></dd> + <dt><code>[mean.upper]</code></dt><dd><p>Upper bound for cluster gene means.</p></dd> +</dl> + <p>The parameters not shown in brackets can be estimated from real data using +<code><a href='sparseDCEstimate.html'>sparseDCEstimate</a></code>. For details of the SparseDC simulation +see <code><a href='sparseDCSimulate.html'>sparseDCSimulate</a></code>.</p> + + + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + + <li><a href="#parameters">Parameters</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Luke Zappia, Belinda Phipson, Alicia Oshlack.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/SplatParams.html b/docs/reference/SplatParams.html index 160134d922e283fb662ad648da8574b0cba0e346..26480caee4e0e0771240770bf88d7b390a241e14 100644 --- a/docs/reference/SplatParams.html +++ b/docs/reference/SplatParams.html @@ -130,9 +130,13 @@ </dl></p></dd> <dt><em>Library size parameters</em></dt><dd><p><dl class='dl-horizontal'> <dt><code>lib.loc</code></dt><dd><p>Location (meanlog) parameter for the - library size log-normal distribution.</p></dd> + library size log-normal distribution, or mean parameter if a + normal distribution is used.</p></dd> <dt><code>lib.scale</code></dt><dd><p>Scale (sdlog) parameter for the library - size log-normal distribution.</p></dd> + size log-normal distribution, or sd parameter if a normal + distribution is used.</p></dd> + <dt><code>lib.norm</code></dt><dd><p>Logical. Whether to use a normal + distribution for library sizes instead of a log-normal.</p></dd> </dl></p></dd> <dt><em>Expression outlier parameters</em></dt><dd><p><dl class='dl-horizontal'> <dt><code>out.prob</code></dt><dd><p>Probability that a gene is an expression diff --git a/docs/reference/addFeatureStats.html b/docs/reference/addFeatureStats.html index 84890932c7d71d949e8b51e1371ccddad2912999..5455a8cd0d5206b9c13e9223a5805478350f1877 100644 --- a/docs/reference/addFeatureStats.html +++ b/docs/reference/addFeatureStats.html @@ -144,10 +144,10 @@ calculating statistics.</p></td> <p>Currently adds the following statistics: mean, variance, coefficient of variation, median and median absolute deviation. Statistics are added to -the <code><a href='http://www.rdocumentation.org/packages/SummarizedExperiment/topics/SummarizedExperiment-class'>rowData</a></code> slot and are named -<code>Stat[Log]Value[No0]</code> where <code>Log</code> and <code>No0</code> are added if those -arguments are true. UpperCamelCase is used to differentiate these columns -from those added by analysis packages.</p> +the <code>rowData</code> slot and are named <code>Stat[Log]Value[No0]</code> where +<code>Log</code> and <code>No0</code> are added if those arguments are true. +UpperCamelCase is used to differentiate these columns from those added by +analysis packages.</p> </div> diff --git a/docs/reference/addGeneLengths.html b/docs/reference/addGeneLengths.html index bba78ccbc52236f5400dbf43cf9db726d9c316a0..56f4c47975253f2d313d6755e1785bbedd01e335 100644 --- a/docs/reference/addGeneLengths.html +++ b/docs/reference/addGeneLengths.html @@ -140,7 +140,7 @@ <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <p>This function adds simulated gene lengths to the -<code><a href='http://www.rdocumentation.org/packages/SummarizedExperiment/topics/SummarizedExperiment-class'>rowData</a></code> slot of a +<code>rowData</code> slot of a <code><a href='http://www.rdocumentation.org/packages/SingleCellExperiment/topics/SingleCellExperiment'>SingleCellExperiment</a></code> object that can be used for calculating length normalised expression values such as TPM or FPKM. The <code>generate</code> method simulates lengths using a (rounded) log-normal @@ -156,12 +156,12 @@ vector.</p> <span class='fu'>head</span>(<span class='fu'>rowData</span>(<span class='no'>sce</span>))</div><div class='output co'>#> DataFrame with 6 rows and 3 columns #> Gene GeneMean Length #> <factor> <numeric> <numeric> -#> 1 Gene1 0.276285870265276 2787 -#> 2 Gene2 5.590079589556 3891 -#> 3 Gene3 0.0434982745624651 7065 -#> 4 Gene4 0.0157237897854258 774 -#> 5 Gene5 0.734831944235454 3313 -#> 6 Gene6 0.117382388691264 2806</div><div class='input'># Sample method (human coding genes) +#> 1 Gene1 0.26662904681126 1135 +#> 2 Gene2 3.22843622430885 6836 +#> 3 Gene3 0.747825116595176 3205 +#> 4 Gene4 0.0237206245029356 1427 +#> 5 Gene5 0.0901336217761832 4777 +#> 6 Gene6 2.1010781020721 1065</div><div class='input'># Sample method (human coding genes) </div><span class='co'># NOT RUN {</span> <span class='fu'>library</span>(<span class='no'>TxDb.Hsapiens.UCSC.hg19.knownGene</span>) <span class='fu'>library</span>(<span class='no'>GenomicFeatures</span>) diff --git a/docs/reference/index.html b/docs/reference/index.html index d15069ebe980af8736752fc652793d11bf73be25..3f5b17a89377cd5b5e8d556d740ad881e7c8cdd1 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -100,7 +100,7 @@ <div class="page-header"> <h1> Reference - <small>version 1.3.3</small> + <small>version 1.3.4</small> </h1> </div> @@ -122,7 +122,7 @@ <tr> <!-- --> <td> - <p><code><a href="newParams.html">newBASiCSParams</a></code> <code><a href="newParams.html">newLun2Params</a></code> <code><a href="newParams.html">newLunParams</a></code> <code><a href="newParams.html">newMFAParams</a></code> <code><a href="newParams.html">newPhenoParams</a></code> <code><a href="newParams.html">newSCDDParams</a></code> <code><a href="newParams.html">newSimpleParams</a></code> <code><a href="newParams.html">newSplatParams</a></code> <code><a href="newParams.html">newZINBParams</a></code> </p> + <p><code><a href="newParams.html">newBASiCSParams</a></code> <code><a href="newParams.html">newLun2Params</a></code> <code><a href="newParams.html">newLunParams</a></code> <code><a href="newParams.html">newMFAParams</a></code> <code><a href="newParams.html">newPhenoParams</a></code> <code><a href="newParams.html">newSCDDParams</a></code> <code><a href="newParams.html">newSimpleParams</a></code> <code><a href="newParams.html">newSparseDCParams</a></code> <code><a href="newParams.html">newSplatParams</a></code> <code><a href="newParams.html">newZINBParams</a></code> </p> </td> <td><p>New Params</p></td> </tr><tr> @@ -203,6 +203,12 @@ <p><code><a href="SplatParams.html">SplatParams</a></code> </p> </td> <td><p>The SplatParams class</p></td> + </tr><tr> + <!-- --> + <td> + <p><code><a href="SparseDCParams.html">SparseDCParams</a></code> </p> + </td> + <td><p>The SparseDCParams class</p></td> </tr><tr> <!-- --> <td> @@ -295,6 +301,12 @@ <p><code><a href="splatEstOutlier.html">splatEstOutlier</a></code> </p> </td> <td><p>Estimate Splat expression outlier parameters</p></td> + </tr><tr> + <!-- --> + <td> + <p><code><a href="sparseDCEstimate.html">sparseDCEstimate</a></code> </p> + </td> + <td><p>Estimate SparseDC simulation parameters</p></td> </tr><tr> <!-- --> <td> @@ -411,6 +423,12 @@ <p><code><a href="splatSimulate.html">splatSimulate</a></code> <code><a href="splatSimulate.html">splatSimulateSingle</a></code> <code><a href="splatSimulate.html">splatSimulateGroups</a></code> <code><a href="splatSimulate.html">splatSimulatePaths</a></code> </p> </td> <td><p>Splat simulation</p></td> + </tr><tr> + <!-- --> + <td> + <p><code><a href="sparseDCSimulate.html">sparseDCSimulate</a></code> </p> + </td> + <td><p>SparseDC simulation</p></td> </tr><tr> <!-- --> <td> @@ -543,12 +561,24 @@ <p><code><a href="setParamUnchecked.html">setParamUnchecked</a></code> </p> </td> <td><p>Set a parameter UNCHECKED</p></td> + </tr><tr> + <!-- --> + <td> + <p><code><a href="showDFs.html">showDFs</a></code> </p> + </td> + <td><p>Show data.frame</p></td> </tr><tr> <!-- --> <td> <p><code><a href="showPP.html">showPP</a></code> </p> </td> <td><p>Show pretty print</p></td> + </tr><tr> + <!-- --> + <td> + <p><code><a href="showValues.html">showValues</a></code> </p> + </td> + <td><p>Show vales</p></td> </tr><tr> <!-- --> <td> diff --git a/docs/reference/listSims.html b/docs/reference/listSims.html index 3c0793ef444a716e681fdf59dab389677b125f61..df9e49eb61506eef825880d258b5ef5db44f9d2e 100644 --- a/docs/reference/listSims.html +++ b/docs/reference/listSims.html @@ -124,7 +124,7 @@ displayed.</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'><span class='fu'>listSims</span>()</div><div class='output co'>#> Splatter currently contains 12 simulations + <pre class="examples"><div class='input'><span class='fu'>listSims</span>()</div><div class='output co'>#> Splatter currently contains 13 simulations #> #> Splat (splat) #> DOI: 10.1186/s13059-017-1305-0 GitHub: Oshlack/splatter @@ -173,6 +173,10 @@ displayed.</p> #> ZINB-WaVE (zinb) #> DOI: 10.1101/125112 GitHub: drisso/zinbwave #> The ZINB-WaVE simulation simulates counts from a sophisticated zero-inflated negative-binomial distribution including cell and gene-level covariates. +#> +#> SparseDC (sparseDC) +#> DOI: 10.1093/nar/gkx1113 GitHub: cran/SparseDC +#> The SparseDC simulation simulates a set of clusters across two conditions, where some clusters may be present in only one condition. #> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> diff --git a/docs/reference/lun2Estimate.html b/docs/reference/lun2Estimate.html index 2199344bc5362dccd6c786aff88cdf29beb1571d..0e3a98599e128068c870487799cc385d9b9d1a71 100644 --- a/docs/reference/lun2Estimate.html +++ b/docs/reference/lun2Estimate.html @@ -144,9 +144,9 @@ the data.</p></td> </tr> <tr> <th>BPPARAM</th> - <td><p>A <code><a href='http://www.rdocumentation.org/packages/BiocParallel/topics/BiocParallelParam-class'>BiocParallelParam</a></code> instance -giving the parallel back-end to be used. Default is -<code><a href='http://www.rdocumentation.org/packages/BiocParallel/topics/SerialParam-class'>SerialParam</a></code> which uses a single core.</p></td> + <td><p>A <code>BiocParallelParam</code> instance giving the parallel +back-end to be used. Default is <code>SerialParam</code> which uses a +single core.</p></td> </tr> </table> diff --git a/docs/reference/lunEstimate.html b/docs/reference/lunEstimate.html index d32f6aacf0f9104469d80674561d08d32b99cfc9..09b6b464402fa329cf65f6b880f5fd6106068f87 100644 --- a/docs/reference/lunEstimate.html +++ b/docs/reference/lunEstimate.html @@ -140,34 +140,38 @@ for more details on the parameters.</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'><span class='co'># Load example data</span> -<span class='fu'>library</span>(<span class='no'>scater</span>) -<span class='fu'>data</span>(<span class='st'>"sc_example_counts"</span>) +<span class='fu'>library</span>(<span class='no'>scater</span>)</div><div class='output co'>#> <span class='message'>Loading required package: ggplot2</span></div><div class='output co'>#> <span class='message'></span> +#> <span class='message'>Attaching package: ‘scater’</span></div><div class='output co'>#> <span class='message'>The following object is masked from ‘package:S4Vectors’:</span> +#> <span class='message'></span> +#> <span class='message'> rename</span></div><div class='output co'>#> <span class='message'>The following object is masked from ‘package:stats’:</span> +#> <span class='message'></span> +#> <span class='message'> filter</span></div><div class='input'><span class='fu'>data</span>(<span class='st'>"sc_example_counts"</span>) <span class='no'>params</span> <span class='kw'><-</span> <span class='fu'>lunEstimate</span>(<span class='no'>sc_example_counts</span>) <span class='no'>params</span></div><div class='output co'>#> A Params object of class LunParams -#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> #> Global: -#> (GENES) (CELLS) [Seed] -#> 2000 40 578513 +#> (GENES) (CELLS) [Seed] +#> 2000 40 457996 #> #> 9 additional parameters #> #> Mean: -#> [Rate] [Shape] -#> 2 2 +#> [Rate] [Shape] +#> 2 2 #> #> Counts: -#> [Dispersion] -#> 0.1 +#> [Dispersion] +#> 0.1 #> #> Groups: -#> [Groups] [GROUP CELLS] -#> 1 40 +#> [GROUPS] [GROUP CELLS] +#> 1 40 #> #> Diff expr: -#> [Genes] [Up Prop] [Up FC] [Down FC] -#> 1000 0.5 5 0 +#> [Genes] [Up Prop] [Up FC] [Down FC] +#> 1000 0.5 5 0 #> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> diff --git a/docs/reference/mfaEstimate.html b/docs/reference/mfaEstimate.html index 20be7eeae8bd42af0f756896403723e5349a3294..7d344b65944267e3c811102c9e132206025a2530 100644 --- a/docs/reference/mfaEstimate.html +++ b/docs/reference/mfaEstimate.html @@ -146,25 +146,25 @@ details on the parameters.</p> <span class='no'>params</span> <span class='kw'><-</span> <span class='fu'>mfaEstimate</span>(<span class='no'>sc_example_counts</span>) <span class='no'>params</span></div><div class='output co'>#> A Params object of class MFAParams -#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> #> Global: -#> (GENES) (CELLS) [Seed] -#> 2000 40 578513 +#> (GENES) (CELLS) [Seed] +#> 2000 40 457996 #> #> 4 additional parameters #> #> Transient: -#> [Proportion] -#> 0 +#> [Proportion] +#> 0 #> #> Negative: -#> [Zero] -#> TRUE +#> [Zero] +#> TRUE #> #> Dropout: -#> [Present] (LAMBDA) -#> FALSE 0.00352186231063193 +#> [Present] (LAMBDA) +#> FALSE 0.00352186231063193 #> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> diff --git a/docs/reference/newParams.html b/docs/reference/newParams.html index 496c5dab384bd4c1954e9f5f227c7c90d29f1d6e..8ca19cd443bb4c4b896bb06cc2006544aafc1325 100644 --- a/docs/reference/newParams.html +++ b/docs/reference/newParams.html @@ -120,6 +120,8 @@ Params subtypes.</p> <span class='fu'>newSimpleParams</span>(<span class='no'>...</span>) +<span class='fu'>newSparseDCParams</span>(<span class='no'>...</span>) + <span class='fu'>newSplatParams</span>(<span class='no'>...</span>) <span class='fu'>newZINBParams</span>(<span class='no'>...</span>)</pre> diff --git a/docs/reference/phenoEstimate.html b/docs/reference/phenoEstimate.html index ef5af23fbadc8145125526e906d0883a1b94a09e..1a75c9adf0f619e52727207dcfb56ceedd110131 100644 --- a/docs/reference/phenoEstimate.html +++ b/docs/reference/phenoEstimate.html @@ -147,17 +147,17 @@ See <code><a href='PhenoParams.html'>PhenoParams</a></code> for more details on <span class='no'>params</span> <span class='kw'><-</span> <span class='fu'>phenoEstimate</span>(<span class='no'>sc_example_counts</span>) <span class='no'>params</span></div><div class='output co'>#> A Params object of class PhenoParams -#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> #> Global: -#> (GENES) (CELLS) [Seed] -#> 2000 40 578513 +#> (GENES) (CELLS) [Seed] +#> 2000 40 457996 #> #> 4 additional parameters #> #> Genes: -#> [DE] [PST] [PST + BETA] [DE + PST + BETA] -#> 500 500 500 500 +#> [DE] [PST] [PST + BETA] [DE + PST + BETA] +#> 500 500 500 500 #> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> diff --git a/docs/reference/phenoSimulate.html b/docs/reference/phenoSimulate.html index e6b0404f7a205645e57d94b8c40a265194f0aff7..1ed90a231f3802cce94d90af937b9e92176d34de 100644 --- a/docs/reference/phenoSimulate.html +++ b/docs/reference/phenoSimulate.html @@ -136,7 +136,7 @@ <code><a href='PhenoParams.html'>PhenoParams</a></code>, runs the simulation then converts the output from log-expression to counts and returns a <code><a href='http://www.rdocumentation.org/packages/SingleCellExperiment/topics/SingleCellExperiment'>SingleCellExperiment</a></code> object. The original -simulated log-expression values are returned in the <code>LogExprs</code> asssay. +simulated log-expression values are returned in the <code>LogExprs</code> assay. See <code><a href='http://www.rdocumentation.org/packages/phenopath/topics/simulate_phenopath'>simulate_phenopath</a></code> and the PhenoPath paper for more details about how the simulation works.</p> diff --git a/docs/reference/scDDEstimate.html b/docs/reference/scDDEstimate.html index 4007dc4c03471ba215318a0c58298da5f0a7773b..a5b2409a2653605f36dd3a39865a8ae467f49782 100644 --- a/docs/reference/scDDEstimate.html +++ b/docs/reference/scDDEstimate.html @@ -138,9 +138,9 @@ containing count data to estimate parameters from.</p></td> </tr> <tr> <th>BPPARAM</th> - <td><p>A <code><a href='http://www.rdocumentation.org/packages/BiocParallel/topics/BiocParallelParam-class'>BiocParallelParam</a></code> instance -giving the parallel back-end to be used. Default is -<code><a href='http://www.rdocumentation.org/packages/BiocParallel/topics/SerialParam-class'>SerialParam</a></code> which uses a single core.</p></td> + <td><p>A <code>BiocParallelParam</code> instance giving the parallel +back-end to be used. Default is <code>SerialParam</code> which uses a +single core.</p></td> </tr> <tr> <th>...</th> diff --git a/docs/reference/scDDSimulate.html b/docs/reference/scDDSimulate.html index 02caf606417a0e6f2e8a94ecb0289507391cfe24..c188de988e69e6344630afec446c4e85e4a06bb6 100644 --- a/docs/reference/scDDSimulate.html +++ b/docs/reference/scDDSimulate.html @@ -130,9 +130,9 @@ plots.</p></td> </tr> <tr> <th>BPPARAM</th> - <td><p>A <code><a href='http://www.rdocumentation.org/packages/BiocParallel/topics/BiocParallelParam-class'>BiocParallelParam</a></code> instance -giving the parallel back-end to be used. Default is -<code><a href='http://www.rdocumentation.org/packages/BiocParallel/topics/SerialParam-class'>SerialParam</a></code> which uses a single core.</p></td> + <td><p>A <code>BiocParallelParam</code> instance giving the parallel +back-end to be used. Default is <code>SerialParam</code> which uses a +single core.</p></td> </tr> <tr> <th>...</th> diff --git a/docs/reference/setParam.html b/docs/reference/setParam.html index bf50bcffccbf322475636060cde7a0e7915d5557..5824593598294e89dc832c5c5b3ae49b851d8289 100644 --- a/docs/reference/setParam.html +++ b/docs/reference/setParam.html @@ -156,21 +156,21 @@ <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'><span class='no'>params</span> <span class='kw'><-</span> <span class='fu'><a href='newParams.html'>newSimpleParams</a></span>() <span class='fu'>setParam</span>(<span class='no'>params</span>, <span class='st'>"nGenes"</span>, <span class='fl'>100</span>)</div><div class='output co'>#> A Params object of class SimpleParams -#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> #> Global: -#> (GENES) (Cells) [Seed] -#> 100 100 578513 +#> (GENES) (Cells) [Seed] +#> 100 100 457996 #> #> 3 additional parameters #> #> Mean: -#> (Rate) (Shape) -#> 0.3 0.4 +#> (Rate) (Shape) +#> 0.3 0.4 #> #> Counts: -#> [Dispersion] -#> 0.1 +#> [Dispersion] +#> 0.1 #> </div><div class='input'> </div></pre> </div> diff --git a/docs/reference/setParams.html b/docs/reference/setParams.html index 1255ffb631c9495c0a22be1ca518e1bbc778ab79..7f2abf8eefd86b24f935a59fcd37295b627653c9 100644 --- a/docs/reference/setParams.html +++ b/docs/reference/setParams.html @@ -142,57 +142,57 @@ them manually), see examples.</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'><span class='no'>params</span> <span class='kw'><-</span> <span class='fu'><a href='newParams.html'>newSimpleParams</a></span>() <span class='no'>params</span></div><div class='output co'>#> A Params object of class SimpleParams -#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> #> Global: -#> (Genes) (Cells) [Seed] -#> 10000 100 578513 +#> (Genes) (Cells) [Seed] +#> 10000 100 457996 #> #> 3 additional parameters #> #> Mean: -#> (Rate) (Shape) -#> 0.3 0.4 +#> (Rate) (Shape) +#> 0.3 0.4 #> #> Counts: -#> [Dispersion] -#> 0.1 +#> [Dispersion] +#> 0.1 #> </div><div class='input'><span class='co'># Set individually</span> <span class='no'>params</span> <span class='kw'><-</span> <span class='fu'>setParams</span>(<span class='no'>params</span>, <span class='kw'>nGenes</span> <span class='kw'>=</span> <span class='fl'>1000</span>, <span class='kw'>nCells</span> <span class='kw'>=</span> <span class='fl'>50</span>) <span class='no'>params</span></div><div class='output co'>#> A Params object of class SimpleParams -#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> #> Global: -#> (GENES) (CELLS) [Seed] -#> 1000 50 578513 +#> (GENES) (CELLS) [Seed] +#> 1000 50 457996 #> #> 3 additional parameters #> #> Mean: -#> (Rate) (Shape) -#> 0.3 0.4 +#> (Rate) (Shape) +#> 0.3 0.4 #> #> Counts: -#> [Dispersion] -#> 0.1 +#> [Dispersion] +#> 0.1 #> </div><div class='input'><span class='co'># Set via update list</span> <span class='no'>params</span> <span class='kw'><-</span> <span class='fu'>setParams</span>(<span class='no'>params</span>, <span class='fu'>list</span>(<span class='kw'>mean.rate</span> <span class='kw'>=</span> <span class='fl'>0.2</span>, <span class='kw'>mean.shape</span> <span class='kw'>=</span> <span class='fl'>0.8</span>)) <span class='no'>params</span></div><div class='output co'>#> A Params object of class SimpleParams -#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> #> Global: -#> (GENES) (CELLS) [Seed] -#> 1000 50 578513 +#> (GENES) (CELLS) [Seed] +#> 1000 50 457996 #> #> 3 additional parameters #> #> Mean: -#> (RATE) (SHAPE) -#> 0.2 0.8 +#> (RATE) (SHAPE) +#> 0.2 0.8 #> #> Counts: -#> [Dispersion] -#> 0.1 +#> [Dispersion] +#> 0.1 #> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> diff --git a/docs/reference/showDFs.html b/docs/reference/showDFs.html new file mode 100644 index 0000000000000000000000000000000000000000..f913211b171ef1ad74511347e01fc54c35ae1879 --- /dev/null +++ b/docs/reference/showDFs.html @@ -0,0 +1,147 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Show data.frame — showDFs • Splatter</title> + +<!-- jquery --> +<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> +<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cosmo/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> + +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + <link href="../extra.css" rel="stylesheet"> + +<!-- mathjax --> +<script src='https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + +<!-- Google analytics --> +<script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-52309538-4', 'auto'); + ga('send', 'pageview'); + +</script> + + </head> + + <body> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">splatter</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../index.html"> + <span class="fa fa-home fa-lg"></span> + + </a> +</li> +<li> + <a href="../articles/splatter.html">Get Started</a> +</li> +<li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/Oshlack/splatter"> + <span class="fa fa-github fa-lg"></span> + + </a> +</li> + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Show data.frame</h1> + </div> + + + <p>Function used for pretty printing data.frame parameters.</p> + + + <pre class="usage"><span class='fu'>showDFs</span>(<span class='no'>dfs</span>, <span class='no'>not.default</span>)</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>dfs</th> + <td><p>list of data.frames to show.</p></td> + </tr> + <tr> + <th>not.default</th> + <td><p>logical vector giving which have changed from the default.</p></td> + </tr> + </table> + + + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Luke Zappia, Belinda Phipson, Alicia Oshlack.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/showValues.html b/docs/reference/showValues.html new file mode 100644 index 0000000000000000000000000000000000000000..86c0a1e9f4dfa8073c717290534dd99148d06cfa --- /dev/null +++ b/docs/reference/showValues.html @@ -0,0 +1,147 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Show vales — showValues • Splatter</title> + +<!-- jquery --> +<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> +<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cosmo/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> + +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + <link href="../extra.css" rel="stylesheet"> + +<!-- mathjax --> +<script src='https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + +<!-- Google analytics --> +<script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-52309538-4', 'auto'); + ga('send', 'pageview'); + +</script> + + </head> + + <body> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">splatter</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../index.html"> + <span class="fa fa-home fa-lg"></span> + + </a> +</li> +<li> + <a href="../articles/splatter.html">Get Started</a> +</li> +<li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/Oshlack/splatter"> + <span class="fa fa-github fa-lg"></span> + + </a> +</li> + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Show vales</h1> + </div> + + + <p>Function used for pretty printing scale or vector parameters.</p> + + + <pre class="usage"><span class='fu'>showValues</span>(<span class='no'>values</span>, <span class='no'>not.default</span>)</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>values</th> + <td><p>list of values to show.</p></td> + </tr> + <tr> + <th>not.default</th> + <td><p>logical vector giving which have changed from the default.</p></td> + </tr> + </table> + + + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Luke Zappia, Belinda Phipson, Alicia Oshlack.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/simpleEstimate.html b/docs/reference/simpleEstimate.html index edacd6f9a575767ae319c0e83f4c18e424710dd8..07b9e52f5852b059a81d034b2d32b9ade6f6a269 100644 --- a/docs/reference/simpleEstimate.html +++ b/docs/reference/simpleEstimate.html @@ -148,21 +148,21 @@ details on the parameters.</p> <span class='no'>params</span> <span class='kw'><-</span> <span class='fu'>simpleEstimate</span>(<span class='no'>sc_example_counts</span>) <span class='no'>params</span></div><div class='output co'>#> A Params object of class SimpleParams -#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> #> Global: -#> (GENES) (CELLS) [Seed] -#> 2000 40 578513 +#> (GENES) (CELLS) [Seed] +#> 2000 40 457996 #> #> 3 additional parameters #> #> Mean: -#> (RATE) (SHAPE) -#> 0.0008052293183292 0.131835949613878 +#> (RATE) (SHAPE) +#> 0.0008052293183292 0.131835949613878 #> #> Counts: -#> [Dispersion] -#> 0.1 +#> [Dispersion] +#> 0.1 #> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> diff --git a/docs/reference/sparseDCEstimate.html b/docs/reference/sparseDCEstimate.html new file mode 100644 index 0000000000000000000000000000000000000000..675f8df47a5b2550183927d97274e67c309bb5a5 --- /dev/null +++ b/docs/reference/sparseDCEstimate.html @@ -0,0 +1,221 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Estimate SparseDC simulation parameters — sparseDCEstimate • Splatter</title> + +<!-- jquery --> +<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> +<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cosmo/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> + +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + <link href="../extra.css" rel="stylesheet"> + +<!-- mathjax --> +<script src='https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + +<!-- Google analytics --> +<script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-52309538-4', 'auto'); + ga('send', 'pageview'); + +</script> + + </head> + + <body> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">splatter</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../index.html"> + <span class="fa fa-home fa-lg"></span> + + </a> +</li> +<li> + <a href="../articles/splatter.html">Get Started</a> +</li> +<li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/Oshlack/splatter"> + <span class="fa fa-github fa-lg"></span> + + </a> +</li> + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Estimate SparseDC simulation parameters</h1> + </div> + + + <p>Estimate simulation parameters for the SparseDC simulation from a real +dataset.</p> + + + <pre class="usage"><span class='fu'>sparseDCEstimate</span>(<span class='no'>counts</span>, <span class='no'>conditions</span>, <span class='no'>nclusters</span>, <span class='kw'>norm</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, + <span class='kw'>params</span> <span class='kw'>=</span> <span class='fu'><a href='newParams.html'>newSparseDCParams</a></span>()) + +<span class='co'># S3 method for SingleCellExperiment</span> +<span class='fu'>sparseDCEstimate</span>(<span class='no'>counts</span>, <span class='no'>conditions</span>, <span class='no'>nclusters</span>, + <span class='kw'>norm</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>params</span> <span class='kw'>=</span> <span class='fu'><a href='newParams.html'>newSparseDCParams</a></span>()) + +<span class='co'># S3 method for matrix</span> +<span class='fu'>sparseDCEstimate</span>(<span class='no'>counts</span>, <span class='no'>conditions</span>, <span class='no'>nclusters</span>, <span class='kw'>norm</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, + <span class='kw'>params</span> <span class='kw'>=</span> <span class='fu'><a href='newParams.html'>newSparseDCParams</a></span>())</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>counts</th> + <td><p>either a counts matrix or an SingleCellExperiment object +containing count data to estimate parameters from.</p></td> + </tr> + <tr> + <th>conditions</th> + <td><p>numeric vector giving the condition each cell belongs to.</p></td> + </tr> + <tr> + <th>nclusters</th> + <td><p>number of cluster present in the dataset.</p></td> + </tr> + <tr> + <th>norm</th> + <td><p>logical, whether to libray size normalise counts before +estimation. Set this to FALSE if counts is already normalised.</p></td> + </tr> + <tr> + <th>params</th> + <td><p>PhenoParams object to store estimated values in.</p></td> + </tr> + </table> + + <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> + + <p>SparseParams object containing the estimated parameters.</p> + + <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> + + <p>The <code>nGenes</code> and <code>nCells</code> parameters are taken from the size of the +input data. The counts are preprocessed using +<code><a href='http://www.rdocumentation.org/packages/SparseDC/topics/pre_proc_data'>pre_proc_data</a></code> and then parameters are estimated using +<code><a href='http://www.rdocumentation.org/packages/SparseDC/topics/sparsedc_cluster'>sparsedc_cluster</a></code> using lambda values calculated using +<code><a href='http://www.rdocumentation.org/packages/SparseDC/topics/lambda1_calculator'>lambda1_calculator</a></code> and +<code><a href='http://www.rdocumentation.org/packages/SparseDC/topics/lambda2_calculator'>lambda2_calculator</a></code>.</p> +<p>See <code><a href='SparseDCParams.html'>SparseDCParams</a></code> for more details on the parameters.</p> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='co'># Load example data</span> +<span class='fu'>library</span>(<span class='no'>scater</span>) +<span class='fu'>data</span>(<span class='st'>"sc_example_counts"</span>) + +<span class='no'>conditions</span> <span class='kw'><-</span> <span class='fu'>sample</span>(<span class='fl'>1</span>:<span class='fl'>2</span>, <span class='fu'>ncol</span>(<span class='no'>sc_example_counts</span>), <span class='kw'>replace</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) + +<span class='no'>params</span> <span class='kw'><-</span> <span class='fu'>sparseDCEstimate</span>(<span class='no'>sc_example_counts</span>[<span class='fl'>1</span>:<span class='fl'>500</span>, ], <span class='no'>conditions</span>, + <span class='kw'>nclusters</span> <span class='kw'>=</span> <span class='fl'>3</span>) +<span class='no'>params</span></div><div class='output co'>#> A Params object of class SparseDCParams +#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' +#> +#> Global: +#> (GENES) (CELLS) [Seed] +#> 500 20 457996 +#> +#> 7 additional parameters +#> +#> Markers: +#> (NUMBER) (SHARED) [Same] +#> 1 1 FALSE +#> +#> Clusters: +#> (CONDITION 1) (CONDITION 2) +#> 1, 2, 3 1, 2, 3 +#> +#> Means: +#> [Lower] [Upper] +#> 1 2 +#> </div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + + <li><a href="#value">Value</a></li> + + <li><a href="#details">Details</a></li> + + <li><a href="#examples">Examples</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Luke Zappia, Belinda Phipson, Alicia Oshlack.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/sparseDCSimulate.html b/docs/reference/sparseDCSimulate.html new file mode 100644 index 0000000000000000000000000000000000000000..f7ac26d99dd7119300b7dfa3c67fde7323fe5cd7 --- /dev/null +++ b/docs/reference/sparseDCSimulate.html @@ -0,0 +1,188 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>SparseDC simulation — sparseDCSimulate • Splatter</title> + +<!-- jquery --> +<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> +<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cosmo/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> + +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + <link href="../extra.css" rel="stylesheet"> + +<!-- mathjax --> +<script src='https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + +<!-- Google analytics --> +<script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-52309538-4', 'auto'); + ga('send', 'pageview'); + +</script> + + </head> + + <body> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">splatter</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../index.html"> + <span class="fa fa-home fa-lg"></span> + + </a> +</li> +<li> + <a href="../articles/splatter.html">Get Started</a> +</li> +<li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/Oshlack/splatter"> + <span class="fa fa-github fa-lg"></span> + + </a> +</li> + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>SparseDC simulation</h1> + </div> + + + <p>Simulate counts from cluster in two conditions using the SparseDC method.</p> + + + <pre class="usage"><span class='fu'>sparseDCSimulate</span>(<span class='kw'>params</span> <span class='kw'>=</span> <span class='fu'><a href='newParams.html'>newSparseDCParams</a></span>(), <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>)</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>params</th> + <td><p>SparseDCParams object containing simulation parameters.</p></td> + </tr> + <tr> + <th>verbose</th> + <td><p>logical. Whether to print progress messages</p></td> + </tr> + <tr> + <th>...</th> + <td><p>any additional parameter settings to override what is provided in +<code>params</code>.</p></td> + </tr> + </table> + + <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> + + <p>SingleCellExperiment containing simulated counts</p> + + <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> + + <p>This function is just a wrapper around +<code><a href='http://www.rdocumentation.org/packages/SparseDC/topics/sim_data'>sim_data</a></code> that takes a +<code><a href='SparseDCParams.html'>SparseDCParams</a></code>, runs the simulation then converts the +output from log-expression to counts and returns a +<code><a href='http://www.rdocumentation.org/packages/SingleCellExperiment/topics/SingleCellExperiment'>SingleCellExperiment</a></code> object. The original +simulated log-expression values are returned in the <code>LogExprs</code> assay. +See <code><a href='http://www.rdocumentation.org/packages/SparseDC/topics/sim_data'>sim_data</a></code> and the SparseDC paper for +more details about how the simulation works.</p> + + <h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2> + + <p>Campbell K, Yau C. Uncovering genomic trajectories with heterogeneous genetic +and environmental backgrounds across single-cells and populations. bioRxiv +(2017).</p> +<p>Barron M, Zhang S, Li J. A sparse differential clustering algorithm for +tracing cell type changes via single-cell RNA-sequencing data. +Nucleic Acids Research (2017).</p> +<p>Paper: <a href='10.1093/nar/gkx1113'>10.1093/nar/gkx1113</a></p> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='no'>sim</span> <span class='kw'><-</span> <span class='fu'>sparseDCSimulate</span>()</div><div class='output co'>#> <span class='message'>Simulating counts...</span></div><div class='output co'>#> <span class='message'>Creating final dataset...</span></div><div class='input'> +</div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + + <li><a href="#value">Value</a></li> + + <li><a href="#details">Details</a></li> + + <li><a href="#references">References</a></li> + + <li><a href="#examples">Examples</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Luke Zappia, Belinda Phipson, Alicia Oshlack.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/splatEstLib.html b/docs/reference/splatEstLib.html index 33e42989f5e1af131871d7ae0035d244a09562d6..3fbc04a936f2d18f6c696050468b097930290068 100644 --- a/docs/reference/splatEstLib.html +++ b/docs/reference/splatEstLib.html @@ -102,8 +102,10 @@ </div> - <p>A log-normal distribution is fitted to the library sizes and the estimated -parameters are added to the params object. See + <p>The Shapiro-Wilk test is used to determine if the library sizes are +normally distributed. If so a normal distribution is fitted to the library +sizes, if not (most cases) a log-normal distribution is fitted and the +estimated parameters are added to the params object. See <code><a href='http://www.rdocumentation.org/packages/fitdistrplus/topics/fitdist'>fitdist</a></code> for details on the fitting.</p> diff --git a/docs/reference/splatEstimate.html b/docs/reference/splatEstimate.html index 9fa546e4bb95f1131c0bd08a15a417df51e77ec8..94f00767aa76aee47c1b07c439688fe2b0784f7f 100644 --- a/docs/reference/splatEstimate.html +++ b/docs/reference/splatEstimate.html @@ -146,51 +146,50 @@ containing count data to estimate parameters from.</p></td> <span class='fu'>library</span>(<span class='no'>scater</span>) <span class='fu'>data</span>(<span class='st'>"sc_example_counts"</span>) -<span class='no'>params</span> <span class='kw'><-</span> <span class='fu'>splatEstimate</span>(<span class='no'>sc_example_counts</span>) -<span class='no'>params</span></div><div class='output co'>#> A Params object of class SplatParams -#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. +<span class='no'>params</span> <span class='kw'><-</span> <span class='fu'>splatEstimate</span>(<span class='no'>sc_example_counts</span>)</div><div class='output co'>#> <span class='message'>NOTE: Library sizes have been found to be normally distributed instead of log-normal. You may want to check this is correct.</span></div><div class='input'><span class='no'>params</span></div><div class='output co'>#> A Params object of class SplatParams +#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> #> Global: -#> (GENES) (CELLS) [Seed] -#> 2000 40 578513 +#> (GENES) (CELLS) [Seed] +#> 2000 40 457996 #> -#> 27 additional parameters +#> 28 additional parameters #> #> Batches: -#> [Batches] [BATCH CELLS] [Location] [Scale] -#> 1 40 0.1 0.1 +#> [BATCHES] [BATCH CELLS] [Location] [Scale] +#> 1 40 0.1 0.1 #> #> Mean: -#> (RATE) (SHAPE) -#> 0.0032639148887191 0.419304527025529 +#> (RATE) (SHAPE) +#> 0.0032639148887191 0.419304527025529 #> #> Library size: -#> (LOCATION) (SCALE) -#> 12.7053037408488 0.58910919018286 +#> (LOCATION) (SCALE) (NORM) +#> 388947.775 231618.775891602 TRUE #> #> Exprs outliers: -#> (PROBABILITY) (LOCATION) (SCALE) -#> 0.00623376623376623 4.22280669039478 0.422108697251885 +#> (PROBABILITY) (LOCATION) (SCALE) +#> 0.00623376623376623 4.22280669039478 0.422108697251885 #> #> Groups: -#> [Groups] [Group Probs] -#> 1 1 +#> [Groups] [Group Probs] +#> 1 1 #> #> Diff expr: -#> [Probability] [Down Prob] [Location] [Scale] -#> 0.1 0.5 0.1 0.4 +#> [Probability] [Down Prob] [Location] [Scale] +#> 0.1 0.5 0.1 0.4 #> #> BCV: -#> (COMMON DISP) (DOF) -#> 3.21969047393022 14.7262017878812 +#> (COMMON DISP) (DOF) +#> 3.21969047393022 14.7262017878812 #> #> Dropout: -#> [Present] (MIDPOINT) (SHAPE) -#> FALSE 5.00420976858168 -0.652889139821156 +#> [Present] (MIDPOINT) (SHAPE) +#> FALSE 5.00420976858168 -0.652889139821156 #> #> Paths: -#> [From] [Length] [Skew] [Non-linear] [Sigma Factor] -#> 0 100 0.5 0.1 0.8 +#> [From] [Length] [Skew] [Non-linear] [Sigma Factor] +#> 0 100 0.5 0.1 0.8 #> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> diff --git a/docs/reference/splatSimLibSizes.html b/docs/reference/splatSimLibSizes.html index 69ee1cbaa6f334823573b6e3b82341bbb7ea6f89..99a7cb8759960150b6a02a3587168ee16ce799c0 100644 --- a/docs/reference/splatSimLibSizes.html +++ b/docs/reference/splatSimLibSizes.html @@ -102,7 +102,9 @@ </div> - <p>Simulate expected library sizes from a log-normal distribution</p> + <p>Simulate expected library sizes. Typically a log-normal distribution is used +but there is also the option to use a normal distribution. In this case any +negative values are set to half the minimum non-zero value.</p> <pre class="usage"><span class='fu'>splatSimLibSizes</span>(<span class='no'>sim</span>, <span class='no'>params</span>)</pre> diff --git a/docs/reference/splatSimulate.html b/docs/reference/splatSimulate.html index 5ec04af36a1b29182a1ce6d3019cd55cd908fed5..6cb201b10396df49895e5c52a6408606d34daa87 100644 --- a/docs/reference/splatSimulate.html +++ b/docs/reference/splatSimulate.html @@ -168,10 +168,10 @@ can be used.</p> <p>The final output is a <code><a href='http://www.rdocumentation.org/packages/SingleCellExperiment/topics/SingleCellExperiment'>SingleCellExperiment</a></code> object that contains the simulated counts but also the values for various intermediate -steps. These are stored in the <code><a href='http://www.rdocumentation.org/packages/SummarizedExperiment/topics/SummarizedExperiment-class'>colData</a></code> -(for cell specific information), <code><a href='http://www.rdocumentation.org/packages/SummarizedExperiment/topics/SummarizedExperiment-class'>rowData</a></code> -(for gene specific information) or <code><a href='http://www.rdocumentation.org/packages/SummarizedExperiment/topics/SummarizedExperiment-class'>assays</a></code> -(for gene by cell matrices) slots. This additional information includes:</p><dl class='dl-horizontal'> +steps. These are stored in the <code>colData</code> (for cell specific +information), <code>rowData</code> (for gene specific information) or +<code>assays</code> (for gene by cell matrices) slots. This additional +information includes:</p><dl class='dl-horizontal'> <dt><code>phenoData</code></dt><dd><p><dl class='dl-horizontal'> <dt>Cell</dt><dd><p>Unique cell identifier.</p></dd> <dt>Group</dt><dd><p>The group or path the cell belongs to.</p></dd> diff --git a/docs/reference/summariseDiff.html b/docs/reference/summariseDiff.html index bd37d71e3c72ed36d7a5c23307614610bb1396bb..490a07ad7eaed7f54ad88bb195987e71f646fd0b 100644 --- a/docs/reference/summariseDiff.html +++ b/docs/reference/summariseDiff.html @@ -127,20 +127,20 @@ Error (RMSE) for the various properties and ranks them.</p> <pre class="examples"><div class='input'><span class='no'>sim1</span> <span class='kw'><-</span> <span class='fu'><a href='splatSimulate.html'>splatSimulate</a></span>(<span class='kw'>nGenes</span> <span class='kw'>=</span> <span class='fl'>1000</span>, <span class='kw'>batchCells</span> <span class='kw'>=</span> <span class='fl'>20</span>)</div><div class='output co'>#> <span class='message'>Getting parameters...</span></div><div class='output co'>#> <span class='message'>Creating simulation object...</span></div><div class='output co'>#> <span class='message'>Simulating library sizes...</span></div><div class='output co'>#> <span class='message'>Simulating gene means...</span></div><div class='output co'>#> <span class='message'>Simulating BCV...</span></div><div class='output co'>#> <span class='message'>Simulating counts..</span></div><div class='output co'>#> <span class='message'>Simulating dropout (if needed)...</span></div><div class='output co'>#> <span class='message'>Done!</span></div><div class='input'><span class='no'>sim2</span> <span class='kw'><-</span> <span class='fu'><a href='simpleSimulate.html'>simpleSimulate</a></span>(<span class='kw'>nGenes</span> <span class='kw'>=</span> <span class='fl'>1000</span>, <span class='kw'>nCells</span> <span class='kw'>=</span> <span class='fl'>20</span>)</div><div class='output co'>#> <span class='message'>Simulating means...</span></div><div class='output co'>#> <span class='message'>Simulating counts...</span></div><div class='output co'>#> <span class='message'>Creating final dataset...</span></div><div class='input'><span class='no'>difference</span> <span class='kw'><-</span> <span class='fu'><a href='diffSCEs.html'>diffSCEs</a></span>(<span class='fu'>list</span>(<span class='kw'>Splat</span> <span class='kw'>=</span> <span class='no'>sim1</span>, <span class='kw'>Simple</span> <span class='kw'>=</span> <span class='no'>sim2</span>), <span class='kw'>ref</span> <span class='kw'>=</span> <span class='st'>"Simple"</span>)</div><div class='output co'>#> <span class='message'>Note that the names of some metrics have changed, see 'Renamed metrics' in ?calculateQCMetrics.</span> #> <span class='message'>Old names are currently maintained for back-compatibility, but may be removed in future releases.</span></div><div class='output co'>#> <span class='message'>Note that the names of some metrics have changed, see 'Renamed metrics' in ?calculateQCMetrics.</span> #> <span class='message'>Old names are currently maintained for back-compatibility, but may be removed in future releases.</span></div><div class='input'><span class='no'>summary</span> <span class='kw'><-</span> <span class='fu'>summariseDiff</span>(<span class='no'>difference</span>) -<span class='fu'>head</span>(<span class='no'>summary</span>)</div><div class='output co'>#> Dataset Statistic MAD MADScaled MADRank MAE MAEScaled -#> 1 Splat Mean 2.189448 NaN 1 2.413328 NaN -#> 2 Splat Variance 11.093339 NaN 1 9.715559 NaN -#> 3 Splat ZerosGene 30.000000 NaN 1 36.935000 NaN -#> 4 Splat MeanVar 10.378331 NaN 1 11.562988 NaN -#> 5 Splat MeanZeros 40.000000 NaN 1 41.485000 NaN -#> 6 Splat LibSize 63648.000000 NaN 1 64685.100000 NaN +<span class='fu'>head</span>(<span class='no'>summary</span>)</div><div class='output co'>#> Dataset Statistic MAD MADScaled MADRank MAE MAEScaled +#> 1 Splat Mean 2.67384 NaN 1 2.710879 NaN +#> 2 Splat Variance 11.83125 NaN 1 10.836162 NaN +#> 3 Splat ZerosGene 35.00000 NaN 1 40.860000 NaN +#> 4 Splat MeanVar 11.35193 NaN 1 12.464230 NaN +#> 5 Splat MeanZeros 45.00000 NaN 1 43.990000 NaN +#> 6 Splat LibSize 54007.50000 NaN 1 57638.350000 NaN #> MAERank RMSE RMSEScaled RMSERank -#> 1 1 2.985198 NaN 1 -#> 2 1 12.342547 NaN 1 -#> 3 1 41.914496 NaN 1 -#> 4 1 14.488452 NaN 1 -#> 5 1 51.422028 NaN 1 -#> 6 1 65468.891494 NaN 1</div></pre> +#> 1 1 3.287816 NaN 1 +#> 2 1 13.638593 NaN 1 +#> 3 1 45.098780 NaN 1 +#> 4 1 15.539611 NaN 1 +#> 5 1 53.837719 NaN 1 +#> 6 1 58755.898060 NaN 1</div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> <h2>Contents</h2> diff --git a/docs/reference/zinbEstimate.html b/docs/reference/zinbEstimate.html index f838ec1e21aa8a08650f43ffa05cab8052d029cd..11899967327bb0e7c5a1320a63a31e36b3f067d9 100644 --- a/docs/reference/zinbEstimate.html +++ b/docs/reference/zinbEstimate.html @@ -165,9 +165,9 @@ features is estimated.</p></td> </tr> <tr> <th>BPPARAM</th> - <td><p>A <code><a href='http://www.rdocumentation.org/packages/BiocParallel/topics/BiocParallelParam-class'>BiocParallelParam</a></code> instance -giving the parallel back-end to be used. Default is -<code><a href='http://www.rdocumentation.org/packages/BiocParallel/topics/SerialParam-class'>SerialParam</a></code> which uses a single core.</p></td> + <td><p>A <code>BiocParallelParam</code> instance giving the parallel +back-end to be used. Default is <code>SerialParam</code> which uses a +single core.</p></td> </tr> <tr> <th>...</th> diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 6b287066109545df632ae56d85815133994a2152..4dad2117cdde8ed95c6b972db5a671b9af3788c6 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -1,6 +1,21 @@ \name{NEWS} \title{News for Package \pkg{splatter}} +\section{Version 1.3.4, Bioconductor 3.7 Release (2017-04-19)}{ + \itemize{ + \item{Move scater to Imports and add scater version} + \item{Remove lingering references to SCESets} + \item{Add option to use a normal distribution for library sizes in Splat + simulations} + \item{Add SparseDC simulation} + \item{Rename params in metadata slot of simulation to Params for + consistency} + \item{Improve and colourise Params print output} + \item{Improve test coverage} + \item{Various other minor updates and bug fixes} + } +} + \section{Version 1.1.8, Bioconductor 3.6 Release (2017-10-13)}{ \itemize{ \item{Now published in Genome Biology!} diff --git a/tests/testthat/test-SparseDCParams.R b/tests/testthat/test-SparseDCParams.R index 7d9bb1e7f89bb38ffc41a5fe0fa91d21715e776f..642ec927687d26fb6f47428733b2ac5701e308a7 100644 --- a/tests/testthat/test-SparseDCParams.R +++ b/tests/testthat/test-SparseDCParams.R @@ -16,7 +16,7 @@ test_that("clusts checks work", { expect_error(setParam(params, "clusts.c2", 2), "is length 1 it must equal 1") expect_error(setParam(params, "clusts.c1", c(1, 3)), - "Cluster labels must be seqential") + "Cluster labels must be sequential") expect_error(setParam(params, "clusts.c2", c(1, 3)), - "Cluster labels must be seqential") + "Cluster labels must be sequential") })