Commit cbb7c1d7 authored by Davis McCarthy's avatar Davis McCarthy
Browse files

Bug fix in exprs-norm

parent 21279ec9
Pipeline #937 passed with stage
in 4 seconds
......@@ -541,7 +541,7 @@ instead of transcripts. `scater` uses the
[biomaRt](https://bioconductor.org/packages/release/bioc/html/biomaRt.html)
package, which allows one to annotate genes by other attributes:
```{r, message = FALSE, warning = FALSE}
```{r, message = FALSE, warning = FALSE, eval=FALSE}
umi.qc <- getBMFeatureAnnos(
umi.qc,
filters = "ensembl_gene_id",
......@@ -579,19 +579,19 @@ umi.qc <- getBMFeatureAnnos(
Some of the genes were not annotated, therefore we filter them out:
```{r}
```{r, eval=FALSE}
umi.qc.ann <- umi.qc[!is.na(rowData(umi.qc)$ensembl_gene_id), ]
```
Now we compute the total gene length in Kilobases by using the `end_position`
and `start_position` fields:
```{r}
```{r, eval=FALSE}
eff_length <-
abs(rowData(umi.qc.ann)$end_position - rowData(umi.qc.ann)$start_position) / 1000
```
```{r length-vs-mean, fig.cap = "Gene length vs Mean Expression for the raw data"}
```{r length-vs-mean, eval=FALSE, fig.cap = "Gene length vs Mean Expression for the raw data"}
plot(eff_length, rowMeans(counts(umi.qc.ann)))
```
......@@ -608,12 +608,12 @@ page](https://www.biostars.org/p/83901/).
Now we are ready to perform the normalisations:
```{r}
```{r, eval=FALSE}
tpm(umi.qc.ann) <- log2(calculateTPM(umi.qc.ann, eff_length) + 1)
```
Plot the results as a PCA plot:
```{r norm-pca-fpkm, fig.cap = "PCA plot of the tung data after TPM normalisation"}
```{r norm-pca-fpkm, eval=FALSE, fig.cap = "PCA plot of the tung data after TPM normalisation"}
tmp <- runPCA(
umi.qc.ann,
exprs_values = "tpm",
......@@ -626,11 +626,11 @@ plotPCA(
)
```
```{r}
```{r, eval=FALSE}
tpm(umi.qc.ann) <- log2(calculateFPKM(umi.qc.ann, eff_length) + 1)
```
```{r norm-pca-tpm, fig.cap = "PCA plot of the tung data after FPKM normalisation"}
```{r norm-pca-tpm, eval=FALSE, fig.cap = "PCA plot of the tung data after FPKM normalisation"}
tmp <- runPCA(
umi.qc.ann,
exprs_values = "tpm",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment