diff --git a/.Rbuildignore b/.Rbuildignore old mode 100644 new mode 100755 index 892071b..af5f251 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,3 @@ ^GeneTrajectory\.Rproj$ ^\.Rproj\.user$ +^README\.Rmd$ diff --git a/.Rhistory b/.Rhistory old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index cd67eac..e67f93b --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .Rproj.user +inst/doc diff --git a/DESCRIPTION b/DESCRIPTION index be4faf8..2729611 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,3 +30,7 @@ Imports: biclust, stats, Matrix (>= 1.5) +Suggests: + knitr, + rmarkdown +VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 974bbe0..b00070a 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,13 +8,11 @@ export(GetGenePseudoorder) export(GetGraphDistance) export(LoadGeneDistMat) export(RunDM) -export(checkIgtPythonEnvironment) export(coarse.grain) export(diffusion.map) export(get.RW.matrix) -export(setupIgtPythonEnvironment) -export(simulate.bifurcation) -export(simulate.coral) -export(simulate.cyclic) -export(simulate.cylinder) -export(simulate.linear) +export(simulate_bifurcation) +export(simulate_coral) +export(simulate_cyclic) +export(simulate_cylinder) +export(simulate_linear) diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..a4fe838 --- /dev/null +++ b/NEWS.md @@ -0,0 +1,3 @@ +# GeneTrajectory 1.0.0 + +* Initial CRAN submission. diff --git a/R/checkIgtPythonEnvironment.R b/R/checkIgtPythonEnvironment.R deleted file mode 100755 index a4fbbbf..0000000 --- a/R/checkIgtPythonEnvironment.R +++ /dev/null @@ -1,22 +0,0 @@ -#' Check the Python environment for running IGT (Inference of Gene Trajectories) using reticulate package in R -#' -#' @export -#' - -checkIgtPythonEnvironment <- function(python.packages = c('ot', 'tqdm', 'scipy.io'), check.numpy=TRUE){ - if(!reticulate::py_available()){ - setupIgtPythonEnvironment() - reticulate::py_available(initialize=TRUE) - } - if(!reticulate::py_available()){ - stop('Python not available. Please install Python, e.g. by using using reticulate::install_python()') - } - if(check.numpy & ! reticulate::py_numpy_available()){ - stop(sprintf('Package "numpy" not available.')) - } - for (p in python.packages) { - if(! reticulate::py_module_available(p)){ - stop(sprintf('Package "%s" not available.', p)) - } - } -} \ No newline at end of file diff --git a/R/setupIgtPythonEnvironment.R b/R/setupIgtPythonEnvironment.R deleted file mode 100755 index 8135347..0000000 --- a/R/setupIgtPythonEnvironment.R +++ /dev/null @@ -1,43 +0,0 @@ -#' Set up Python environment for running IGT (Inference of Gene Trajectories) using reticulate package in R -#' -#' @export -#' - -setupIgtPythonEnvironment <- function(condaenv='igt', - virtualenv='igt', - packages=c('numpy', 'scipy', 'pot', 'tqdm'), - create=FALSE){ - if(reticulate::py_available()){ - message(paste('Already set up to ', reticulate::py_exe())) - return(TRUE) - } - - if(reticulate::condaenv_exists(condaenv)){ - message(paste('Using conda environment', condaenv)) - reticulate::use_condaenv(condaenv = condaenv) - return(TRUE) - } - - if(reticulate::virtualenv_exists(virtualenv)){ - message(paste('Using virtualenv environment', condaenv)) - reticulate::use_virtualenv(virtualenv=virtualenv) - return(TRUE) - } - - - if(create & ! reticulate::condaenv_exists(condaenv)){ - reticulate::conda_create(condaenv, packages = packages) - reticulate::use_condaenv(condaenv = condaenv) - return(TRUE) - } - - if(create & ! reticulate::virtualenv_exists(virtualenv)){ - virtualenv_create(virtualenv, packages=packages) - reticulate::use_virtualenv(virtualenv=virtualenv) - return(TRUE) - } - - return(FALSE) -} - - diff --git a/R/simulate.bifurcation.R b/R/simulate_bifurcation.R similarity index 97% rename from R/simulate.bifurcation.R rename to R/simulate_bifurcation.R index 01e101c..a24485e 100755 --- a/R/simulate.bifurcation.R +++ b/R/simulate_bifurcation.R @@ -15,12 +15,12 @@ #' @return #' Returns a gene-by-cell count matrix #' -#' @export simulate.bifurcation +#' @export simulate_bifurcation #' #' @examples #' -simulate.bifurcation <- function(N_cells = 5*c(100, 50, 50), +simulate_bifurcation <- function(N_cells = 5*c(100, 50, 50), N_genes = 5*c(100, 50, 50), model = "poisson", meanlog = 0, diff --git a/R/simulate.coral.R b/R/simulate_coral.R similarity index 97% rename from R/simulate.coral.R rename to R/simulate_coral.R index 1d9cd11..3ec4b4a 100755 --- a/R/simulate.coral.R +++ b/R/simulate_coral.R @@ -16,13 +16,13 @@ #' @return #' Returns a gene-by-cell count matrix #' -#' @export simulate.coral +#' @export simulate_coral #' #' @examples #' -simulate.coral <- function(N_cells = 15*rep(100, 7), +simulate_coral <- function(N_cells = 15*rep(100, 7), N_genes = 2*rep(100, 7), N_genes_CC = 400, model = "poisson", @@ -124,7 +124,7 @@ simulate.coral <- function(N_cells = 15*rep(100, 7), gc_mat_tree <- gc_mat - gc_mat_cyclic <- simulate.cyclic(N_cells = sum(N_cells), + gc_mat_cyclic <- simulate_cyclic(N_cells = sum(N_cells), N_genes = N_genes_CC, model = model, meanlog = meanlog, diff --git a/R/simulate.cyclic.R b/R/simulate_cyclic.R similarity index 97% rename from R/simulate.cyclic.R rename to R/simulate_cyclic.R index bdd43f0..e03fffd 100755 --- a/R/simulate.cyclic.R +++ b/R/simulate_cyclic.R @@ -14,12 +14,12 @@ #' @return #' Returns a gene-by-cell count matrix #' -#' @export simulate.cyclic +#' @export simulate_cyclic #' #' @examples #' -simulate.cyclic <- function(N_cells = 1000, +simulate_cyclic <- function(N_cells = 1000, N_genes = 500, model = "poisson", meanlog = 0, diff --git a/R/simulate.cylinder.R b/R/simulate_cylinder.R similarity index 93% rename from R/simulate.cylinder.R rename to R/simulate_cylinder.R index 7556dec..49911c2 100755 --- a/R/simulate.cylinder.R +++ b/R/simulate_cylinder.R @@ -15,12 +15,12 @@ #' @return #' Returns a gene-by-cell count matrix #' -#' @export simulate.cylinder +#' @export simulate_cylinder #' #' @examples #' -simulate.cylinder <- function(N_cells = 5000, +simulate_cylinder <- function(N_cells = 5000, N_genes = rep(500,2), model = "poisson", meanlog = 0, @@ -31,7 +31,7 @@ simulate.cylinder <- function(N_cells = 5000, sort = TRUE, sparsity = 0.1, theta = 10){ - gc_mat_linear <- simulate.linear(N_cells = N_cells, + gc_mat_linear <- simulate_linear(N_cells = N_cells, N_genes = N_genes[1], model = model, meanlog = meanlog, @@ -42,7 +42,7 @@ simulate.cylinder <- function(N_cells = 5000, sort = sort, sparsity = sparsity, theta = theta) - gc_mat_cyclic <- simulate.cyclic(N_cells = N_cells, + gc_mat_cyclic <- simulate_cyclic(N_cells = N_cells, N_genes = N_genes[2], model = model, meanlog = meanlog, diff --git a/R/simulate.linear.R b/R/simulate_linear.R similarity index 97% rename from R/simulate.linear.R rename to R/simulate_linear.R index ddab476..7af83ee 100755 --- a/R/simulate.linear.R +++ b/R/simulate_linear.R @@ -15,13 +15,13 @@ #' @return #' Returns a gene-by-cell count matrix #' -#' @export simulate.linear +#' @export simulate_linear #' #' @examples #' #' -simulate.linear <- function(N_cells = 1000, +simulate_linear <- function(N_cells = 1000, N_genes = 200, model = "poisson", meanlog = 0, diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..1851123 --- /dev/null +++ b/README.Rmd @@ -0,0 +1,54 @@ +--- +output: github_document +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "man/figures/README-", + out.width = "100%" +) +``` + +# GeneTrajectory + + + + +The goal of GeneTrajectory is to ... + +## Installation + +You can install the development version of GeneTrajectory like so: + +``` r +# FILL THIS IN! HOW CAN PEOPLE INSTALL YOUR DEV PACKAGE? +``` + +## Example + +This is a basic example which shows you how to solve a common problem: + +```{r example} +library(GeneTrajectory) +## basic example code +``` + +What is special about using `README.Rmd` instead of just `README.md`? You can include R chunks like so: + +```{r cars} +summary(cars) +``` + +You'll still need to render `README.Rmd` regularly, to keep `README.md` up-to-date. `devtools::build_readme()` is handy for this. + +You can also embed plots, for example: + +```{r pressure, echo = FALSE} +plot(pressure) +``` + +In that case, don't forget to commit and push the resulting figure files, so they display on GitHub and CRAN. diff --git a/docs/404.html b/docs/404.html index a32b703..5b0e0cb 100644 --- a/docs/404.html +++ b/docs/404.html @@ -43,6 +43,9 @@
RunDM()
Run Diffusion Map on a Seurat object
Check the Python environment for running IGT (Inference of Gene Trajectories) using reticulate package in R
Convert a distance matrix into a random-walk matrix based on adaptive Gaussian kernel
Set up Python environment for running IGT (Inference of Gene Trajectories) using reticulate package in R
Simulate bifurcating gene process
Simulate a multi-level lineage differentiation process coupled with cell cycle
Simulate cyclic gene process
Simulate concurrent independent linear and cyclic gene processes
Simulate linear gene process
setupIgtPythonEnvironment.Rd
Set up Python environment for running IGT (Inference of Gene Trajectories) using reticulate package in R
-setupIgtPythonEnvironment(
- condaenv = "igt",
- virtualenv = "igt",
- packages = c("numpy", "scipy", "pot", "tqdm"),
- create = FALSE
-)
simulate.bifurcation.Rd
simulate_bifurcation.Rd
# S3 method for bifurcation
-simulate(
+ simulate_bifurcation(
N_cells = 5 * c(100, 50, 50),
N_genes = 5 * c(100, 50, 50),
model = "poisson",
diff --git a/docs/reference/simulate.coral.html b/docs/reference/simulate_coral.html
similarity index 95%
rename from docs/reference/simulate.coral.html
rename to docs/reference/simulate_coral.html
index f171f82..81e9233 100644
--- a/docs/reference/simulate.coral.html
+++ b/docs/reference/simulate_coral.html
@@ -1,5 +1,5 @@
-Simulate a multi-level lineage differentiation process coupled with cell cycle — simulate.coral • GeneTrajectory Simulate a multi-level lineage differentiation process coupled with cell cycle — simulate_coral • GeneTrajectory
@@ -27,6 +27,9 @@
Reference
+
+
+ Changelog
simulate.coral.Rd
simulate_coral.Rd
# S3 method for coral
-simulate(
+ simulate_coral(
N_cells = 15 * rep(100, 7),
N_genes = 2 * rep(100, 7),
N_genes_CC = 400,
diff --git a/docs/reference/simulate.cyclic.html b/docs/reference/simulate_cyclic.html
similarity index 94%
rename from docs/reference/simulate.cyclic.html
rename to docs/reference/simulate_cyclic.html
index 0abdfbb..4376614 100644
--- a/docs/reference/simulate.cyclic.html
+++ b/docs/reference/simulate_cyclic.html
@@ -1,5 +1,5 @@
-Simulate cyclic gene process — simulate.cyclic • GeneTrajectory Simulate cyclic gene process — simulate_cyclic • GeneTrajectory
@@ -27,6 +27,9 @@
Reference
+
+
+ Changelog
simulate.cyclic.Rd
simulate_cyclic.Rd
# S3 method for cyclic
-simulate(
+ simulate_cyclic(
N_cells = 1000,
N_genes = 500,
model = "poisson",
diff --git a/docs/reference/simulate.cylinder.html b/docs/reference/simulate_cylinder.html
similarity index 94%
rename from docs/reference/simulate.cylinder.html
rename to docs/reference/simulate_cylinder.html
index c9d8cd9..78ad922 100644
--- a/docs/reference/simulate.cylinder.html
+++ b/docs/reference/simulate_cylinder.html
@@ -1,5 +1,5 @@
-Simulate concurrent independent linear and cyclic gene processes — simulate.cylinder • GeneTrajectory Simulate concurrent independent linear and cyclic gene processes — simulate_cylinder • GeneTrajectory
@@ -27,6 +27,9 @@
Reference
+
+
+ Changelog
simulate.cylinder.Rd
simulate_cylinder.Rd
# S3 method for cylinder
-simulate(
+ simulate_cylinder(
N_cells = 5000,
N_genes = rep(500, 2),
model = "poisson",
diff --git a/docs/reference/simulate.linear.html b/docs/reference/simulate_linear.html
similarity index 94%
rename from docs/reference/simulate.linear.html
rename to docs/reference/simulate_linear.html
index 97cf25a..a81b7ea 100644
--- a/docs/reference/simulate.linear.html
+++ b/docs/reference/simulate_linear.html
@@ -1,5 +1,5 @@
-Simulate linear gene process — simulate.linear • GeneTrajectory Simulate linear gene process — simulate_linear • GeneTrajectory
@@ -27,6 +27,9 @@
Reference
+
+
+ Changelog
simulate.linear.Rd
simulate_linear.Rd
# S3 method for linear
-simulate(
+ simulate_linear(
N_cells = 1000,
N_genes = 200,
model = "poisson",
diff --git a/docs/sitemap.xml b/docs/sitemap.xml
index a34d411..2752e1e 100644
--- a/docs/sitemap.xml
+++ b/docs/sitemap.xml
@@ -15,6 +15,9 @@
/index.html
+
+ /news/index.html
+
/reference/AddGeneBinScore.html
@@ -39,9 +42,6 @@
/reference/RunDM.html
-
- /reference/checkIgtPythonEnvironment.html
-
/reference/coarse.grain.html
@@ -55,21 +55,18 @@
/reference/index.html
- /reference/setupIgtPythonEnvironment.html
-
-
- /reference/simulate.bifurcation.html
+ /reference/simulate_bifurcation.html
- /reference/simulate.coral.html
+ /reference/simulate_coral.html
- /reference/simulate.cyclic.html
+ /reference/simulate_cyclic.html
- /reference/simulate.cylinder.html
+ /reference/simulate_cylinder.html
- /reference/simulate.linear.html
+ /reference/simulate_linear.html
diff --git a/man/checkIgtPythonEnvironment.Rd b/man/checkIgtPythonEnvironment.Rd
deleted file mode 100644
index f491359..0000000
--- a/man/checkIgtPythonEnvironment.Rd
+++ /dev/null
@@ -1,14 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/checkIgtPythonEnvironment.R
-\name{checkIgtPythonEnvironment}
-\alias{checkIgtPythonEnvironment}
-\title{Check the Python environment for running IGT (Inference of Gene Trajectories) using reticulate package in R}
-\usage{
-checkIgtPythonEnvironment(
- python.packages = c("ot", "tqdm", "scipy.io"),
- check.numpy = TRUE
-)
-}
-\description{
-Check the Python environment for running IGT (Inference of Gene Trajectories) using reticulate package in R
-}
diff --git a/man/setupIgtPythonEnvironment.Rd b/man/setupIgtPythonEnvironment.Rd
deleted file mode 100644
index ae5e481..0000000
--- a/man/setupIgtPythonEnvironment.Rd
+++ /dev/null
@@ -1,16 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/setupIgtPythonEnvironment.R
-\name{setupIgtPythonEnvironment}
-\alias{setupIgtPythonEnvironment}
-\title{Set up Python environment for running IGT (Inference of Gene Trajectories) using reticulate package in R}
-\usage{
-setupIgtPythonEnvironment(
- condaenv = "igt",
- virtualenv = "igt",
- packages = c("numpy", "scipy", "pot", "tqdm"),
- create = FALSE
-)
-}
-\description{
-Set up Python environment for running IGT (Inference of Gene Trajectories) using reticulate package in R
-}
diff --git a/man/simulate.bifurcation.Rd b/man/simulate_bifurcation.Rd
similarity index 88%
rename from man/simulate.bifurcation.Rd
rename to man/simulate_bifurcation.Rd
index 2d98d73..5e8e26a 100644
--- a/man/simulate.bifurcation.Rd
+++ b/man/simulate_bifurcation.Rd
@@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/simulate.bifurcation.R
-\name{simulate.bifurcation}
-\alias{simulate.bifurcation}
+% Please edit documentation in R/simulate_bifurcation.R
+\name{simulate_bifurcation}
+\alias{simulate_bifurcation}
\title{Simulate bifurcating gene process}
\usage{
-\method{simulate}{bifurcation}(
+simulate_bifurcation(
N_cells = 5 * c(100, 50, 50),
N_genes = 5 * c(100, 50, 50),
model = "poisson",
diff --git a/man/simulate.coral.Rd b/man/simulate_coral.Rd
similarity index 91%
rename from man/simulate.coral.Rd
rename to man/simulate_coral.Rd
index f28ee2d..e3d03d1 100644
--- a/man/simulate.coral.Rd
+++ b/man/simulate_coral.Rd
@@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/simulate.coral.R
-\name{simulate.coral}
-\alias{simulate.coral}
+% Please edit documentation in R/simulate_coral.R
+\name{simulate_coral}
+\alias{simulate_coral}
\title{Simulate a multi-level lineage differentiation process coupled with cell cycle}
\usage{
-\method{simulate}{coral}(
+simulate_coral(
N_cells = 15 * rep(100, 7),
N_genes = 2 * rep(100, 7),
N_genes_CC = 400,
diff --git a/man/simulate.cyclic.Rd b/man/simulate_cyclic.Rd
similarity index 87%
rename from man/simulate.cyclic.Rd
rename to man/simulate_cyclic.Rd
index 6cb2d0b..477cce1 100644
--- a/man/simulate.cyclic.Rd
+++ b/man/simulate_cyclic.Rd
@@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/simulate.cyclic.R
-\name{simulate.cyclic}
-\alias{simulate.cyclic}
+% Please edit documentation in R/simulate_cyclic.R
+\name{simulate_cyclic}
+\alias{simulate_cyclic}
\title{Simulate cyclic gene process}
\usage{
-\method{simulate}{cyclic}(
+simulate_cyclic(
N_cells = 1000,
N_genes = 500,
model = "poisson",
diff --git a/man/simulate.cylinder.Rd b/man/simulate_cylinder.Rd
similarity index 89%
rename from man/simulate.cylinder.Rd
rename to man/simulate_cylinder.Rd
index d01d644..2a53bb8 100644
--- a/man/simulate.cylinder.Rd
+++ b/man/simulate_cylinder.Rd
@@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/simulate.cylinder.R
-\name{simulate.cylinder}
-\alias{simulate.cylinder}
+% Please edit documentation in R/simulate_cylinder.R
+\name{simulate_cylinder}
+\alias{simulate_cylinder}
\title{Simulate concurrent independent linear and cyclic gene processes}
\usage{
-\method{simulate}{cylinder}(
+simulate_cylinder(
N_cells = 5000,
N_genes = rep(500, 2),
model = "poisson",
diff --git a/man/simulate.linear.Rd b/man/simulate_linear.Rd
similarity index 88%
rename from man/simulate.linear.Rd
rename to man/simulate_linear.Rd
index 5a218d3..a00aebb 100644
--- a/man/simulate.linear.Rd
+++ b/man/simulate_linear.Rd
@@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/simulate.linear.R
-\name{simulate.linear}
-\alias{simulate.linear}
+% Please edit documentation in R/simulate_linear.R
+\name{simulate_linear}
+\alias{simulate_linear}
\title{Simulate linear gene process}
\usage{
-\method{simulate}{linear}(
+simulate_linear(
N_cells = 1000,
N_genes = 200,
model = "poisson",