Code Monkey home page Code Monkey logo

monocle3's Introduction

MONOCLE 3

Monocle 3 is an analysis toolkit for single-cell RNA-Seq experiments. To use this package, you will need the R statistical computing environment (version 3.0 or later) and several packages available through Bioconductor and CRAN.

Details on how to install and use Monocle 3 are available on our website:

http://cole-trapnell-lab.github.io/monocle3/

monocle3's People

Contributors

brgew avatar ctrapnell avatar hpliner avatar jenniferfranks avatar mjsteinbaugh avatar zhangguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

monocle3's Issues

preprocess_cds() returns error

expression_matrix = readRDS(url("http://jpacker-data.s3.amazonaws.com/for-cole/for-cole.ciliated.amphid.neurons.exprs.rds"))
cell_metadata = readRDS(url("http://jpacker-data.s3.amazonaws.com/for-cole/for-cole.ciliated.amphid.neurons.pData.rds"))
gene_annotation = readRDS(url("http://jpacker-data.s3.amazonaws.com/for-cole/for-cole.ciliated.amphid.neurons.fData.rds"))
cds <- new_cell_data_set(expression_matrix,
                         cell_metadata = cell_metadata,
                         gene_metadata = gene_annotation)


cds <- estimate_size_factors(cds)
cds <- preprocess_cds(cds, num_dim = 20)

preprocess_cds raises

Error in assays<-(*tmp*, value = new("SimpleList", listData = list( :
current and replacement dimnames() differ

at

assays(cds)$normalized_exprs <- FM

add plot_volcano()

We should add a volcano plot function that takes tables from fit_models(), or maybe takes output from coefficient_table()

reassess automatic selection of ncenter

UMAP seems to make much more complex trajectories which need larger values of ncenter than DDRTree. We should re-tune the function that automatically selects the value of this parameter in learn_graph

plot_cell_clusters() doesn't work until you call cluster_cells()

It would be good to be able to plot cells after reduce_dimensions() but before cluster_cells(), partition_cells(), learn_graph(), order_cells(), etc. Right now if you try to plot after reduce_dimension but before cluster_cells(), you get an error. Maybe this should just be a message, and only then if you are trying to color_by="Cluster"?

Re-running reduce dimension does not clear old principal graph

If you have a cell_data_set object, calling pre_process_cds or reduce_dimension again after calling learn_graph should clear out old data (clusters, louvain components, etc) that is dependent on reduced dimensional coordinates.

cds <- reduce_dimension(cds)
plot_cells(cds, color_by = "Cluster")

cds <- cluster_cells(cds)
plot_cells(cds, color_by = "Cluster")

cds <- learn_graph(cds)
plot_cells(cds, color_by = "cell.type")

cds <- reduce_dimension(cds)
plot_cells(cds, color_by = "Cluster") # Shows old graph. Bad!

Model formula validation is too strict

fit_models has checks to validate formula, but they are are too stringent, because they don't catch formula that include functions of columns in colData.

  if (length(model_form[[2]]) == 1) {
    if (!as.character(model_form[[2]]) %in% c(names(colData(cds)), "~", "1", "|", "+", "-", ":", "*", "^", "I")) {
      stop(paste(as.character(model_form[[2]][[i]]), "formula element is missing"))
    }
  } else {
    for(i in 1:length(model_form[[2]])) {
      if (!as.character(model_form[[2]][[i]]) %in% c(names(colData(cds)), "~", "1", "|", "+", "-", ":", "*", "^", "I")) {
        stop(paste(as.character(model_form[[2]][[i]]), "formula element is missing"))
      }
    }
  }

Multicore fit_models hangs on R 3.5.2 cluster install

Adding here as note requested by Cole -- on R 3.5.2 (the version of R that is linked against OpenBlas on the cluster), I am not able to run fit_models with anything other than cores = 1, regardless of the dataset. Even just for a small number of genes seems to hang at least in my hands. Here is a toy example that illustrates the problem on my end:

# Make random test matrix
library(Matrix)
library(monocle3)

# Make a fake cds object
genes = 100
cells = 500
mat = matrix(sample(0:1, genes * cells, replace = TRUE), genes, cells)
rownames(mat) = paste0('cell', 1:genes)
colnames(mat) = paste0('gene', 1:cells)

pdata = data.frame('cell'=colnames(mat))
rownames(pdata) = pdata$cell
pdata$category = FALSE
pdata$category[0:floor(cells/2)] = TRUE

fdata = data.frame('gene_short_name'=rownames(mat))
rownames(fdata) = fdata$gene_short_name

cds = monocle3::new_cell_data_set(expression_data = mat, cell_metadata=pdata, gene_metadata=fdata)

# Now try fit models
## Works fine
models = monocle3::fit_models(cds, model_formula_str='~category', cores=1, expression_family='binomial')

## Hangs indefinitely
models = monocle3::fit_models(cds, model_formula_str='~category', cores=2, expression_family='binomial')

principal_graph_test returns lots of false positives when neighbor_graph="principal_graph"

cds <- load_a549()

set.seed(42)
cds <- preprocess_cds(cds)
cds <- reduce_dimension(cds, umap.fast_sgd=FALSE, cores=1)
cds <- partition_cells(cds)
cds <- learn_graph(cds)

#Negative control: randomize UMAP coordinates:
reducedDims(cds)$UMAP[,1] = reducedDims(cds)$UMAP[sample.int(nr),1]
reducedDims(cds)$UMAP[,2] = reducedDims(cds)$UMAP[sample.int(nr),2]

Calling principal_graph_test with neighbor_graph="principal_graph" returns lots of significant genes. Calling it with neighbor_graph="knn" returns none or a tiny number.

Import from Seurat

We need to add/review functions needed to import data from Seurat (v3.0) objects.

Improve resolution scanning in cluster_cells

By default, cluster_cells should automatically select a resolution parameter that finds the resolution that maximizes modularity while simultaneously minimizing the number of clusters

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.