Skip to content

Commit

Permalink
Prepare for CRAN submission
Browse files Browse the repository at this point in the history
  • Loading branch information
pfh committed Mar 19, 2022
1 parent 38e7ecb commit 00b9805
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 27 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: langevitour
Title: Langevin Tour
Version: 0.0.1
Version: 0.1
Authors@R:
person("Paul", "Harrison", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-3980-268X"))
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# langevitour 0.1

* Ready for CRAN submission.
8 changes: 8 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
url: https://logarithmic.net/langevitour/
template:
bootstrap: 5
articles:
- title: Examples
navbar: ~
contents:
- usage
- examples
- rnaseq

30 changes: 4 additions & 26 deletions vignettes/examples.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "langevitour examples"
title: "Further examples"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{langevitour examples}
%\VignetteIndexEntry{Further examples}
%\VignetteEncoding{UTF-8}
%\VignetteEngine{knitr::rmarkdown}
editor_options:
Expand All @@ -20,34 +20,10 @@ knitr::opts_chunk$set(
)
```

```{r install, eval=FALSE}
remotes::install_github("pfh/langevitour")
```

```{r setup}
library(langevitour)
```

Things to try:

* Drag labels onto the plot.
* Set point repulsion to "local".
* Experiment with "damping" and "heat".

## Palmer Station Penguins

Measurements of penguins. Since the measurements are in different units, we supply an appropriate scaling.

```{r}
library(palmerpenguins)
completePenguins <- na.omit(penguins[,c(1,3,4,5,6)])
scale <- apply(completePenguins[,-1], 2, sd)*4
langevitour(completePenguins[,-1], completePenguins$species, scale=scale, pointSize=2)
```


## Mouse brain cells

Single-cell RNA-Seq gene expression of 2,816 mouse brain cells ([Zeisel, 2015](https://pubmed.ncbi.nlm.nih.gov/25700174/)). The top 10 principal components were produced using the steps in the [Bioconductor OSCA workflow](http://bioconductor.org/books/3.13/OSCA.workflows/zeisel-mouse-brain-strt-seq.html). This is unscaled PCA of log$_2$(normalized_count+1) expression levels, mean UMI count 15,550 per cell. So $x$ units of distance can be explained for example by $n$ genes with $x/\sqrt{n}$ log$_2$ fold change each.
Expand Down Expand Up @@ -130,6 +106,8 @@ langevitour(geozoo::torus.flat(p=4)$points)

A dataset in the [liminal](https://sa-lee.github.io/liminal/) package. Each row has been scaled to a unit vector.

* Try setting point repulsion to "outliers".

```{r}
X <- as.matrix(liminal::pdfsense[,-(1:6)])
X <- X / sqrt(rowSums(X*X))
Expand Down
43 changes: 43 additions & 0 deletions vignettes/usage.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "Usage example"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Usage example}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

As an example we will use measurements of penguins made at Palmer Station, Antarctica.

Since the measurements are in different units, we supply an appropriate scaling.

```{r}
library(langevitour)
library(palmerpenguins)
completePenguins <- na.omit(penguins[,c(1,3,4,5,6)])
completePenguins
scale <- apply(completePenguins[,-1], 2, sd)*4
langevitour(completePenguins[,-1], completePenguins$species, scale=scale, pointSize=2)
```

<br>

Things to try:

* Drag labels onto the plot.
* Set point repulsion to "PCA".
* Experiment with "damping" and "heat".
* Hide measurements by unchecking the checkbox on their label.



0 comments on commit 00b9805

Please sign in to comment.