Skip to content

Commit

Permalink
update R tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgigante committed Nov 18, 2019
1 parent bb7b206 commit ded38aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Rmagic/inst/examples/bonemarrow_tutorial.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ As you can see, the gene-gene relationships are much clearer after MAGIC. These

### Rerunning MAGIC with new parameters

The data is a little too smooth - we can decrease `t` from the automatic value to reduce the amount of diffusion. We pass the original result to the argument `init` to avoid recomputing intermediate steps.
The data is a little too smooth - we can increase `t` from the default value of 3 to increase the amount of diffusion. We pass the original result to the argument `init` to avoid recomputing intermediate steps.

```{r decrease_t}
bmmsc_MAGIC <- magic(bmmsc, genes=c("Mpo", "Klf1", "Ifitm1"),
Expand All @@ -141,7 +141,7 @@ We can visualize the results of MAGIC on PCA with `genes="pca_only"`.
```{r run_pca}
bmmsc_MAGIC_PCA <- magic(bmmsc, genes="pca_only",
t=4, init=bmmsc_MAGIC)
ggplot(bmmsc_MAGIC_PCA) +
# ggplot(bmmsc_MAGIC_PCA) +
geom_point(aes(x=PC1, y=PC2, color=bmmsc_MAGIC$result$Klf1)) +
scale_color_viridis(option="B") +
labs(color="Klf1")
Expand All @@ -154,7 +154,7 @@ ggsave('BMMSC_data_R_pca_colored_by_magic.png', width=5, height=5)
We can visualize the results of MAGIC on PHATE as follows.

```{r run_phate}
bmmsc_PHATE <- phate(bmmsc, knn=4, decay=100, t=20)
bmmsc_PHATE <- phate(bmmsc)
ggplot(bmmsc_PHATE) +
geom_point(aes(x=PHATE1, y=PHATE2, color=bmmsc_MAGIC$result$Klf1)) +
scale_color_viridis(option="B") +
Expand Down
4 changes: 2 additions & 2 deletions Rmagic/inst/examples/emt_tutorial.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ if (FALSE) {

### Running MAGIC

Running MAGIC is as simple as running the `magic` function. Because this dataset is rather large, we can increase `knn` from the default of 10 up to 15.
Running MAGIC is as simple as running the `magic` function. Because this dataset is rather small, we can decrease `knn` from the default of 5 down to 3.

```{r run_magic}
# run MAGIC
data_MAGIC <- magic(data, knn=15, genes=c("VIM", "CDH1", "ZEB1"))
data_MAGIC <- magic(data, knn=3, genes=c("VIM", "CDH1", "ZEB1"))
```

We can plot the data before and after MAGIC to visualize the results.
Expand Down

0 comments on commit ded38aa

Please sign in to comment.