Skip to content

Commit

Permalink
Merge pull request #131 from KrishnaswamyLab/dev
Browse files Browse the repository at this point in the history
MAGIC v1.3.0
  • Loading branch information
scottgigante authored Sep 21, 2018
2 parents c18669a + e7eb1dc commit 544ec7e
Show file tree
Hide file tree
Showing 19 changed files with 213 additions and 527 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ python/*.egg-info
python/magic/__pycache__
python/magic/*.pyc
python/tutorial_notebooks/.ipynb_checkpoints
__pycache__
.eggs


matlab/EMT.csv

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The following code runs MAGIC on test data located in the MAGIC repository.

#### Tutorials

We have included two tutorial notebooks on MAGIC usage and results visualization for single cell RNA-seq data.
You can read the MAGIC documentation at https://magic.readthedocs.io/. We have included two tutorial notebooks on MAGIC usage and results visualization for single cell RNA-seq data.

EMT data notebook: http://nbviewer.jupyter.org/github/KrishnaswamyLab/MAGIC/blob/master/python/tutorial_notebooks/emt_tutorial.ipynb

Expand Down Expand Up @@ -134,7 +134,7 @@ After installing the package, MAGIC can be run by loading the library and callin

#### Tutorials

For a working example, see the Rmarkdown tutorials at <http://htmlpreview.github.io/?https://github.com/KrishnaswamyLab/MAGIC/blob/master/Rmagic/inst/examples/bonemarrow_tutorial.html> and <http://htmlpreview.github.io/?https://github.com/KrishnaswamyLab/MAGIC/blob/master/Rmagic/inst/examples/emt_tutorial.html> or in `Rmagic/inst/examples`.
You can read the MAGIC tutorial by running `help(Rmagic::magic)`. For a working example, see the Rmarkdown tutorials at <http://htmlpreview.github.io/?https://github.com/KrishnaswamyLab/MAGIC/blob/master/Rmagic/inst/examples/bonemarrow_tutorial.html> and <http://htmlpreview.github.io/?https://github.com/KrishnaswamyLab/MAGIC/blob/master/Rmagic/inst/examples/emt_tutorial.html> or in `Rmagic/inst/examples`.

## Help

Expand Down
12 changes: 7 additions & 5 deletions Rmagic/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Package: Rmagic
Type: Package
Title: MAGIC - Markov Affinity-Based Graph Imputation of Cells
Version: 1.0.0
Version: 1.3.0
Authors@R: c(person(given = "David", family = "van Dijk", email = "davidvandijk@gmail.com", role = c("aut")),
person(given = 'Scott', family = 'Gigante', email = 'scott.gigante@yale.edu', role = 'cre', comment = c(ORCID = '0000-0002-4544-2764')))
person(given = 'Scott', family = 'Gigante', email = 'scott.gigante@yale.edu', role = 'cre',
comment = c(ORCID = '0000-0002-4544-2764')))
Maintainer: Scott Gigante <scott.gigante@yale.edu>
Description: MAGIC (Markov affinity-based graph imputation of cells) is a method for addressing technical noise in single-cell data, including under-sampling of mRNA molecules, often termed "dropout" which can severely obscure important gene-gene relationships. MAGIC shares information across similar cells, via data diffusion, to denoise the cell count matrix and fill in missing transcripts. Read more: van Dijk et al. (2018) <DOI:10.1016/j.cell.2018.05.061>.
Depends:
Expand All @@ -15,9 +16,10 @@ Imports:
reticulate (>= 1.4),
ggplot2
Suggests:
readr,
readr,
viridis,
phateR
phateR
License: GPL-2 | file LICENSE
LazyData: true
RoxygenNote: 6.0.1
RoxygenNote: 6.1.0
Encoding: UTF-8
2 changes: 1 addition & 1 deletion Rmagic/R/magic.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#' @param seed int or `NULL`, random state (default: `NULL`)
#'
#' @examples
#' if (reticulate::py_module_available("phate")) {
#' if (reticulate::py_module_available("magic")) {
#'
#' data(magic_testdata)
#'
Expand Down
22 changes: 20 additions & 2 deletions Rmagic/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,25 @@ null_equal <- function(x, y) {
}

load_pymagic <- function(delay_load = FALSE) {
result <- try(pymagic <<- reticulate::import("magic", delay_load = delay_load))
if (is.null(pymagic)) {
result <- try(pymagic <<- reticulate::import("magic", delay_load = delay_load))
} else {
result <- try(reticulate::import("magic", delay_load = delay_load))
}
if (methods::is(result, "try-error")) {
install.magic()
if ((!delay_load) && length(grep("ModuleNotFoundError: No module named 'magic'", result)) > 0 ||
length(grep("ImportError: No module named magic", result)) > 0) {
if (utils::menu(c("Yes", "No"), title="Install MAGIC Python package with reticulate?") == 1) {
install.magic()
}
} else if (length(grep("r\\-reticulate", reticulate::py_config()$python)) > 0) {
message("Consider removing the 'r-reticulate' environment by running:")
if (grep("virtualenvs", reticulate::py_config()$python)) {
message("reticulate::virtualenv_remove('r-reticulate')")
} else {
message("reticulate::conda_remove('r-reticulate')")
}
}
}
}

Expand Down Expand Up @@ -44,6 +60,7 @@ install.magic <- function(envname = "r-reticulate", method = "auto",
envname = envname, method = method,
conda = conda, pip=pip, ...
)
message("Install complete. Please restart R and try again.")
},
error = function(e) {
stop(paste0(
Expand All @@ -57,5 +74,6 @@ install.magic <- function(envname = "r-reticulate", method = "auto",
pymagic <- NULL

.onLoad <- function(libname, pkgname) {
py_config <- reticulate::py_discover_config(required_module = "magic")
load_pymagic(delay_load = TRUE)
}
4 changes: 2 additions & 2 deletions Rmagic/README.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title : Rmagic v1.0.0
title : Rmagic v1.3.0
output: github_document
toc: true
---
Expand Down Expand Up @@ -181,4 +181,4 @@ ggplot(data_PHATE) +

## Help

If you have any questions or require assistance using MAGIC, please contact us at <https://krishnaswamylab.org/get-help>.
Please let us know of any issues at the [GitHub repo](https://github.com/KrishnaswamyLab/MAGIC/issues). If you have any questions or require assistance using MAGIC, please read the documentation by running `help(Rmagic::magic)` or contact us at <https://krishnaswamylab.org/get-help>.
7 changes: 5 additions & 2 deletions Rmagic/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Rmagic v1.0.0
Rmagic v1.3.0
================

<!-- README.md is generated from README.Rmd. Please edit that file -->
Expand Down Expand Up @@ -236,4 +236,7 @@ ggplot(data_PHATE) +

## Help

If you have any questions or require assistance using MAGIC, please contact us at <https://krishnaswamylab.org/get-help>.
Please let us know of any issues at the [GitHub
repo](https://github.com/KrishnaswamyLab/MAGIC/issues). If you have any
questions or require assistance using MAGIC, please read the documentation
by running `help(Rmagic::magic)` or contact us at <https://krishnaswamylab.org/get-help>.
4 changes: 2 additions & 2 deletions Rmagic/man/install.magic.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Rmagic/man/magic.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions python/doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,6 @@ MAGIC
:inherited-members:
:show-inheritance:

File Input/Output
-----------------

.. automodule:: magic.io
:members:
:inherited-members:
:show-inheritance:

Data Preprocessing
------------------

.. automodule:: magic.preprocessing
:members:
:inherited-members:
:show-inheritance:

Plotting
--------

Expand Down
Loading

0 comments on commit 544ec7e

Please sign in to comment.