Skip to content

Commit 6ea0462

Browse files
committed
Merge branch 'devel'
2 parents 14c064e + ae6bfeb commit 6ea0462

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

inst/doc/intro.html

+22-12
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<meta name="author" content="Harold Pimentel, Nicolas Bray, Pall Melsted and Lior Pachter" />
1212

13-
<meta name="date" content="2015-10-27" />
13+
<meta name="date" content="2015-11-02" />
1414

1515
<title>Introduction to sleuth</title>
1616

@@ -72,7 +72,7 @@
7272
<div id="header">
7373
<h1 class="title">Introduction to sleuth</h1>
7474
<h4 class="author"><em>Harold Pimentel, Nicolas Bray, Pall Melsted and Lior Pachter</em></h4>
75-
<h4 class="date"><em>2015-10-27</em></h4>
75+
<h4 class="date"><em>2015-11-02</em></h4>
7676
</div>
7777

7878

@@ -169,7 +169,7 @@ <h2>Example</h2>
169169
## 4 ~/Downloads/cuffdiff2_data_kallisto_results/results/SRR493369/kallisto
170170
## 5 ~/Downloads/cuffdiff2_data_kallisto_results/results/SRR493370/kallisto
171171
## 6 ~/Downloads/cuffdiff2_data_kallisto_results/results/SRR493371/kallisto</code></pre>
172-
<p>Now the “sleuth object” can be constructed. This requires three commands that (1) load the kallisto processed data into the object (2) estimate parameters for the <strong>sleuth</strong> response error measurement model and (3) perform differential analyis (testing). On a laptop the three steps should take about 2 minutes altogether.</p>
172+
<p>Now the “sleuth object” can be constructed. This requires three commands that (1) load the kallisto processed data into the object (2) estimate parameters for the <strong>sleuth</strong> response error measurement model and (3) perform differential analysis (testing). On a laptop the three steps should take about 2 minutes altogether.</p>
173173
<p>First type</p>
174174
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">so &lt;-<span class="st"> </span><span class="kw">sleuth_prep</span>(s2c, ~<span class="st"> </span>condition)</code></pre></div>
175175
<pre><code>## reading in kallisto results
@@ -186,7 +186,7 @@ <h2>Example</h2>
186186
## computing variance of betas</code></pre>
187187
<p>and finally</p>
188188
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">so &lt;-<span class="st"> </span><span class="kw">sleuth_wt</span>(so, <span class="st">'conditionscramble'</span>)</code></pre></div>
189-
<p>In general, one can see the possible tests that could be performed using the <code>which_beta</code> parameter in <code>sleuth_test</code> and examining the coefficients:</p>
189+
<p>In general, one can see the possible tests that could be performed using the <code>which_beta</code> parameter in <code>sleuth_wt</code> and examining the coefficients:</p>
190190
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">models</span>(so)</code></pre></div>
191191
<pre><code>## [ full ]
192192
## formula: ~condition
@@ -202,16 +202,26 @@ <h2>Example</h2>
202202
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">mart &lt;-<span class="st"> </span>biomaRt::<span class="kw">useMart</span>(<span class="dt">biomart =</span> <span class="st">&quot;ensembl&quot;</span>, <span class="dt">dataset =</span> <span class="st">&quot;hsapiens_gene_ensembl&quot;</span>)</code></pre></div>
203203
<pre><code>## Creating a generic function for 'nchar' from package 'base' in package 'S4Vectors'</code></pre>
204204
<p>and add them into the <strong>sleuth</strong> table with</p>
205-
<pre><code>t2g &lt;- biomaRt::getBM(attributes = c(&quot;ensembl_transcript_id&quot;, &quot;ensembl_gene_id&quot;,
206-
&quot;external_gene_name&quot;), mart = mart)
207-
t2g &lt;- dplyr::rename(t2g, target_id = ensembl_transcript_id,
208-
ens_gene = ensembl_gene_id, ext_gene = external_gene_name)
209-
so &lt;- sleuth_prep(kal_dirs, s2c, ~ condition, target_mapping = t2g)
210-
so &lt;- sleuth_fit(so)
211-
so &lt;- sleuth_test(so, which_beta = 'conditionscramble')</code></pre>
205+
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">t2g &lt;-<span class="st"> </span>biomaRt::<span class="kw">getBM</span>(<span class="dt">attributes =</span> <span class="kw">c</span>(<span class="st">&quot;ensembl_transcript_id&quot;</span>, <span class="st">&quot;ensembl_gene_id&quot;</span>,
206+
<span class="st">&quot;external_gene_name&quot;</span>), <span class="dt">mart =</span> mart)
207+
t2g &lt;-<span class="st"> </span>dplyr::<span class="kw">rename</span>(t2g, <span class="dt">target_id =</span> ensembl_transcript_id,
208+
<span class="dt">ens_gene =</span> ensembl_gene_id, <span class="dt">ext_gene =</span> external_gene_name)
209+
so &lt;-<span class="st"> </span><span class="kw">sleuth_prep</span>(s2c, ~<span class="st"> </span>condition, <span class="dt">target_mapping =</span> t2g)</code></pre></div>
210+
<pre><code>## reading in kallisto results
211+
## ......
212+
## normalizing est_counts
213+
## 50844 targets passed the filter
214+
## normalizing tpm
215+
## merging in metadata
216+
## normalizing bootstrap samples
217+
## summarizing bootstraps</code></pre>
218+
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">so &lt;-<span class="st"> </span><span class="kw">sleuth_fit</span>(so)</code></pre></div>
219+
<pre><code>## shrinkage estimation
220+
## computing variance of betas</code></pre>
221+
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">so &lt;-<span class="st"> </span><span class="kw">sleuth_wt</span>(so, <span class="dt">which_beta =</span> <span class="st">'conditionscramble'</span>)</code></pre></div>
212222
<p>This addition of metadata to transcript IDs is very general, and can be used to add in other information.</p>
213223
<p>The best way to view the results is to generate the Shiny webpage that allows for exploratory data analysis:</p>
214-
<pre><code>sleuth_live(so)</code></pre>
224+
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">sleuth_live</span>(so)</code></pre></div>
215225
<p>To generate a table of results for analysis within R type</p>
216226
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">results_table &lt;-<span class="st"> </span><span class="kw">sleuth_results</span>(so, <span class="st">'conditionscramble'</span>)</code></pre></div>
217227
</div>

vignettes/intro.Rmd

+6-6
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ In this case, the kallisto output is correctly matched with the sample identifie
119119
print(s2c)
120120
```
121121

122-
Now the "sleuth object" can be constructed. This requires three commands that (1) load the kallisto processed data into the object (2) estimate parameters for the __sleuth__ response error measurement model and (3) perform differential analyis (testing). On a laptop the three steps should take about 2 minutes altogether.
122+
Now the "sleuth object" can be constructed. This requires three commands that (1) load the kallisto processed data into the object (2) estimate parameters for the __sleuth__ response error measurement model and (3) perform differential analysis (testing). On a laptop the three steps should take about 2 minutes altogether.
123123

124124
First type
125125

@@ -139,7 +139,7 @@ and finally
139139
so <- sleuth_wt(so, 'conditionscramble')
140140
```
141141

142-
In general, one can see the possible tests that could be performed using the `which_beta` parameter in `sleuth_test` and examining the coefficients:
142+
In general, one can see the possible tests that could be performed using the `which_beta` parameter in `sleuth_wt` and examining the coefficients:
143143

144144
```{r eval=TRUE}
145145
models(so)
@@ -164,21 +164,21 @@ mart <- biomaRt::useMart(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")
164164

165165
and add them into the __sleuth__ table with
166166

167-
```
167+
```{r, eval=TRUE}
168168
t2g <- biomaRt::getBM(attributes = c("ensembl_transcript_id", "ensembl_gene_id",
169169
"external_gene_name"), mart = mart)
170170
t2g <- dplyr::rename(t2g, target_id = ensembl_transcript_id,
171171
ens_gene = ensembl_gene_id, ext_gene = external_gene_name)
172-
so <- sleuth_prep(kal_dirs, s2c, ~ condition, target_mapping = t2g)
172+
so <- sleuth_prep(s2c, ~ condition, target_mapping = t2g)
173173
so <- sleuth_fit(so)
174-
so <- sleuth_test(so, which_beta = 'conditionscramble')
174+
so <- sleuth_wt(so, which_beta = 'conditionscramble')
175175
```
176176

177177
This addition of metadata to transcript IDs is very general, and can be used to add in other information.
178178

179179
The best way to view the results is to generate the Shiny webpage that allows for exploratory data analysis:
180180

181-
```
181+
```{r, eval=FALSE}
182182
sleuth_live(so)
183183
```
184184

0 commit comments

Comments
 (0)