Skip to content

Commit

Permalink
fix vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Feb 23, 2021
1 parent b059c83 commit 51e080f
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 40 deletions.
21 changes: 13 additions & 8 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
Resubmission: moved some examples to `\donttest{}` to reduce checking time.

# dyngen 1.0.0

This version mostly upgrades dyngen's ease-of-use, such as better vignettes, conversion functions for working with dyngen datasets in other packages, and more useful ways of specifying platform-specific parameters (i.e. number of cores and cache location). Perhaps more excitingly, the dyngen documentation is more readable online at [https://dyngen.dynverse.org](https://dyngen.dynverse.org)!

## NEW FEATURES
## BREAKING CHANGES
* `wrap_dataset()`: Now returns a list instead of a dyno object. Use `as_dyno(model)` or `wrap_dataset(model, format = "dyno")` to replicate previous behaviour.

* `as_anndata()`: Added a function for converting the dyngen output to an anndata object.
## NEW FEATURES

* `as_sce()`: Added a function for converting the dyngen output to an SingleCellExperiment object.
* Added functions for converting the dyngen output to various data formats: `as_anndata()` for anndata, `as_sce()` for SingleCellExperiment, `as_seurat()` for Seurat, `as_dyno()` for dyno, `as_list()` for a simple list object.

* `as_seurat()`: Added a function for converting the dyngen output to a Seurat object.
* `wrap_dataset()`: Added 'format' argument which allows choosing the output format (#28).

* The default number of cores used can be set by adding `options(Ncpus = ...)` to your Rprofile.

Expand All @@ -20,15 +23,14 @@ This version mostly upgrades dyngen's ease-of-use, such as better vignettes, con

## MAJOR CHANGES

* `generate_experiment()`: Map count density of reference dataset to simulation expression before sampling molecules.
* `generate_experiment()`: Map count density of reference dataset to simulation expression before sampling molecules.
Parameters are available for toggling off or on the mapping of the reference library size & CPM distribution.

## MINOR CHANGES

* `initialise_model()`: Change defaults of `num_cores` and `download_cache_dir`
to `getOption("Ncpus")` and `getOption("dyngen_download_cache_dir")` respectively.

* `as_dyno()`: Rename `wrap_dataset()` to `as_dyno()`.

* `generate_experiment()`: Drastically speed up sampling of molecules.

## BUG FIX
Expand All @@ -39,14 +41,17 @@ This version mostly upgrades dyngen's ease-of-use, such as better vignettes, con

## DOCUMENTATION

* Extended vignettes:
* Added and extended vignettes:
- Advanced: Simulating batch effects
- Advanced: Simulating a knockout experiment
- Advanced: Running dyngen from a docker container
- Advanced: Constructing a custom backbone
- Advanced: Tweaking parameters
- Advanced: Comparison of characteristic features between dyngen and reference datasets

* Created a website at [https://dyngen.dynverse.org](https://dyngen.dynverse.org) using pkgdown.

* Shortened examples to reduce r cmd check time.

## Test environments
* local Fedora 32 install (R 4.0)
Expand Down
9 changes: 7 additions & 2 deletions vignettes/getting_started.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ write_rds(dataset, "dataset.rds", compress = "gz")
```

## Step 8 alternative: Convert to an anndata/SCE/Seurat object
dyngen (>= 0.4.1) allows converting the output to an `anndata`, `SCE` or `Seurat` object as well.
dyngen 1.0.0 allows converting the output to an `anndata`, `SCE` or `Seurat` object as well.
Check out the [anndata documentation](https://cran.r-project.org/package=anndata)
on how to install anndata for R.

Expand All @@ -182,9 +182,13 @@ library(anndata)
ad <- as_anndata(model)
ad$write_h5ad("dataset.h5ad")

library(SingleCellExperiment)
sce <- as_sce(model)
write_rds(sce, "dataset_sce.rds")

seurat <- as_seurat(model)
library(Seurat)
seurat <- as_seurat(model)
write_rds(seurat, "dataset_seurat.rds")
```

# One-shot function
Expand All @@ -194,6 +198,7 @@ all of the steps all at once and producing plots.
```{r oneshot_run, message=FALSE, fig.width=20, fig.height=20}
out <- generate_dataset(
config,
format = "dyno",
make_plots = TRUE
)
Expand Down
58 changes: 31 additions & 27 deletions vignettes/getting_started.html

Large diffs are not rendered by default.

21 changes: 18 additions & 3 deletions vignettes/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ write_rds(dataset, "dataset.rds", compress = "gz")

## Step 8 alternative: Convert to an anndata/SCE/Seurat object

dyngen (&gt;= 0.4.1) allows converting the output to an `anndata`, `SCE`
or `Seurat` object as well. Check out the [anndata
dyngen 1.0.0 allows converting the output to an `anndata`, `SCE` or
`Seurat` object as well. Check out the [anndata
documentation](https://cran.r-project.org/package=anndata) on how to
install anndata for R.

Expand All @@ -263,9 +263,13 @@ library(anndata)
ad <- as_anndata(model)
ad$write_h5ad("dataset.h5ad")

library(SingleCellExperiment)
sce <- as_sce(model)
write_rds(sce, "dataset_sce.rds")

seurat <- as_seurat(model)
library(Seurat)
seurat <- as_seurat(model)
write_rds(seurat, "dataset_seurat.rds")
```

# One-shot function
Expand All @@ -276,6 +280,7 @@ all at once and producing plots.
``` r
out <- generate_dataset(
config,
format = "dyno",
make_plots = TRUE
)
```
Expand All @@ -292,7 +297,17 @@ print(out$plot)

``` r
library(dyno)
```

## Loading required package: dynfeature

## Loading required package: dynguidelines

## Loading required package: dynmethods

## Loading required package: dynwrap

``` r
plot_dimred(dataset)
```

Expand Down
Binary file modified vignettes/getting_started_files/figure-gfm/oneshot_run-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/getting_started_files/figure-gfm/unnamed-chunk-1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/getting_started_files/figure-gfm/unnamed-chunk-1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 51e080f

Please sign in to comment.