Skip to content

Commit 8c37bfa

Browse files
committed
updated manual
1 parent b3d9c3d commit 8c37bfa

File tree

16 files changed

+171
-307
lines changed

16 files changed

+171
-307
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData
4+
.Ruserdata

R/.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
^.*\.Rproj$
2+
^\.Rproj\.user$

R/DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: SCRABBLE
22
Type: Package
33
Title: Impute scRNAseq data method
4-
Version: 0.2.0
4+
Version: 0.0.1
55
Author: Tao Peng
66
Maintainer: The package maintainer Tao Peng <tpengmath@gmail.com>
77
Description: SCRABBLE imputes drop-out data by optimizing an objective function
@@ -25,6 +25,6 @@ Imports: Rcpp (>= 0.12.13),
2525
reshape2,
2626
gridExtra
2727
LinkingTo: Rcpp, RcppEigen, gridExtra
28-
RoxygenNote: 6.0.1
28+
RoxygenNote: 6.1.1
2929
Suggests: knitr,rmarkdown,BiocStyle
3030
VignetteBuilder: knitr

R/R/.Rd2pdf14510/Rd2.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
\documentclass[a4paper]{book}
2+
\usepackage[times,inconsolata,hyper]{Rd}
3+
\usepackage{makeidx}
4+
\usepackage[latin1]{inputenc} % @SET ENCODING@
5+
% \usepackage{graphicx} % @USE GRAPHICX@
6+
\makeindex{}
7+
\begin{document}
8+
\chapter*{}
9+
\begin{center}
10+
{\textbf{\huge Package}}
11+
\par\bigskip{\large \today}
12+
\end{center}
13+
\Rdcontents{\R{} topics documented:}

R/R/.Rd2pdf15102/Rd2.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
\documentclass[a4paper]{book}
2+
\usepackage[times,inconsolata,hyper]{Rd}
3+
\usepackage{makeidx}
4+
\usepackage[latin1]{inputenc} % @SET ENCODING@
5+
% \usepackage{graphicx} % @USE GRAPHICX@
6+
\makeindex{}
7+
\begin{document}
8+
\chapter*{}
9+
\begin{center}
10+
{\textbf{\huge Package}}
11+
\par\bigskip{\large \today}
12+
\end{center}
13+
\Rdcontents{\R{} topics documented:}

R/R/.Rd2pdf15116/Rd2.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
\documentclass[a4paper]{book}
2+
\usepackage[times,inconsolata,hyper]{Rd}
3+
\usepackage{makeidx}
4+
\usepackage[latin1]{inputenc} % @SET ENCODING@
5+
% \usepackage{graphicx} % @USE GRAPHICX@
6+
\makeindex{}
7+
\begin{document}
8+
\chapter*{}
9+
\begin{center}
10+
{\textbf{\huge Package}}
11+
\par\bigskip{\large \today}
12+
\end{center}
13+
\Rdcontents{\R{} topics documented:}

R/data/data_example.RData

1.06 MB
Binary file not shown.

R/inst/doc/my-vignette.R

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## ----setup, include = FALSE----------------------------------------------
2+
knitr::opts_chunk$set(
3+
collapse = TRUE,
4+
comment = "#>"
5+
)
6+
7+
## ------------------------------------------------------------------------
8+
library(SCRABBLE)
9+
10+
## ------------------------------------------------------------------------
11+
data_sc <- data[[1]]
12+
data_bulk <- data[[2]]
13+
data_true <- data[[3]]
14+
15+
## ---- fig.height= 3, fig.width= 5----------------------------------------
16+
pl <- list()
17+
pl[[1]] <- plot_data(log10(data_true + 1),"True Data")
18+
pl[[2]] <- plot_data(log10(data_sc + 1),"Drop-out Data")
19+
main <- gridExtra::grid.arrange(grobs = pl,ncol = 2, top = "")
20+
21+
## ------------------------------------------------------------------------
22+
parameter <- c(1,1e-6,1e-4)
23+
24+
## ------------------------------------------------------------------------
25+
result <- scrabble(data, parameter = parameter)
26+
27+
## ---- fig.height = 3, fig.width= 7, fig.wide = TRUE----------------------
28+
pl <- list()
29+
pl[[1]] <- plot_data(log10(data[[3]] + 1),"True Data")
30+
pl[[2]] <- plot_data(log10(data[[1]] + 1),"Drop-out Data")
31+
pl[[3]] <- plot_data(log10(result + 1),"Imputed by SCRABBLE")
32+
main <- gridExtra::grid.arrange(grobs = pl, ncol = 3, top = "")
33+
34+
## ------------------------------------------------------------------------
35+
sessionInfo()
36+

R/inst/doc/my-vignette.Rmd

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: "Introduction to SCRABBLE"
3+
author:
4+
- name: Tao Peng
5+
date: "Updated on `r Sys.Date()`"
6+
package: "SCRABBLE"
7+
output: BiocStyle::pdf_document
8+
mainfont: Arial
9+
vignette: >
10+
%\VignetteIndexEntry{SCRABBLE}
11+
%\VignetteEngine{knitr::rmarkdown}
12+
%\VignetteEncoding{UTF-8}
13+
---
14+
15+
16+
```{r setup, include = FALSE}
17+
knitr::opts_chunk$set(
18+
collapse = TRUE,
19+
comment = "#>"
20+
)
21+
```
22+
23+
24+
```{r}
25+
library(SCRABBLE)
26+
```
27+
28+
# Simulation Data Study
29+
## Data Generation
30+
31+
We simulated scRNA-Seq data consisting of three cell types using the Splat method in the Bioconductor package Splatter 8. Dataset consists of 800 genes and 1000 cells. The details of the parameters used in the simulation data generation are seen in Supplementary Table 2. Dropout midpoints (parameter dropout_mid in Splatter) are used to control the dropout rate in the simulated data. Splatter generates the data matrices for the true data and its corresponding dropout data using a given dropout midpoint. The corresponding bulk RNA-Seq data are the mean values of genes in the true scRNA-Seq data. The dropout RNA-Seq and bulk RNA-Seq data matrices are the inputs of the imputation methods. To determine the performance stability of the methods, we generated 100 datasets for each dropout midpoints.
32+
33+
### Load the data
34+
35+
```{r}
36+
data_sc <- data[[1]]
37+
data_bulk <- data[[2]]
38+
data_true <- data[[3]]
39+
```
40+
41+
### Plot the data
42+
```{r, fig.height= 3, fig.width= 5}
43+
pl <- list()
44+
pl[[1]] <- plot_data(log10(data_true + 1),"True Data")
45+
pl[[2]] <- plot_data(log10(data_sc + 1),"Drop-out Data")
46+
main <- gridExtra::grid.arrange(grobs = pl,ncol = 2, top = "")
47+
```
48+
49+
## Run SCRABBLE
50+
51+
SCRABBLE imputes drop-out data by optimizing an objective function that consists of three terms. The first term ensures that imputed values for genes with nonzero expression remain as close to their original values as possible, thus minimizing unwanted bias towards expressed genes. The second term ensures the rank of the imputed data matrix to be as small as possible. The rationale is that we only expect a limited number of distinct cell types in the samples. The third term operates on the bulk RNA-Seq data. It ensures consistency between the average gene expression of the aggregated imputed data and the average gene expression of the bulk RNA-Seq data. We developed 58 a convex optimization algorithm to minimize the objective function.
52+
53+
### Set up the parameter used in SCRABBLE
54+
```{r}
55+
parameter <- c(1,1e-6,1e-4)
56+
```
57+
58+
### Run SCRABLE
59+
```{r}
60+
result <- scrabble(data, parameter = parameter)
61+
```
62+
63+
### Plot the data
64+
```{r, fig.height = 3, fig.width= 7, fig.wide = TRUE}
65+
pl <- list()
66+
pl[[1]] <- plot_data(log10(data[[3]] + 1),"True Data")
67+
pl[[2]] <- plot_data(log10(data[[1]] + 1),"Drop-out Data")
68+
pl[[3]] <- plot_data(log10(result + 1),"Imputed by SCRABBLE")
69+
main <- gridExtra::grid.arrange(grobs = pl, ncol = 3, top = "")
70+
```
71+
72+
# SessionInfo
73+
```{r}
74+
sessionInfo()
75+
```

R/inst/doc/my-vignette.pdf

4.28 MB
Binary file not shown.

0 commit comments

Comments
 (0)