Giter VIP home page Giter VIP logo

celltrails's Introduction

Version License: Artistic-2.0 Platforms Travis CI build status Coverage

   ____     _ _ _____          _ _
  / ___|___| | |_   _| __ __ _(_) |___
 | |   / _ \ | | | || '__/ _` | | / __|
 | |__|  __/ | | | || | | (_| | | \__ \
  \____\___|_|_| |_||_|  \__,_|_|_|___/
  
  (c) Daniel C. Ellwanger, 2018.

CellTrails: Inference of Temporal Gene Expression Dynamics of Branching Biological Processes from Single-cell Expression Data

High-throughput single-cell technologies facilitate the generation of -omic readouts from thousands of cells captured at different cellular maturation stages during development, or other normal or pathological processes with unprecedented resolution. A single snapshot of an asynchronously developing specimen, for example, constitutes a time series in which individual cells represent distinct time points along a continuum. However, recoding of valuable cell-specific information, such as a cell's developmental age, its location in a tissue, or its functional phenotype is limited during sample preparation, and remains hidden in high dimensional cellular expression profiles. This formulates the computational challenge to infer the latent internal time axis of the biological process from the obtained expression matrix alone, while considering common parameters of single-cell measurements, such as noise, dropouts and redundancy. In other words, biological samples need to be placed by means of hidden information onto a non-linear trajectory, which might constitute of branching processes towards distinct functional cell types.

CellTrails is an unsupervised algorithm for the de novo chronological ordering, visualization and analysis of single-cell expression data. CellTrails makes use of a geometrically motivated concept of lower-dimensional manifold learning, which exhibits a multitude of virtues that counteract intrinsic noise of single cell data caused by drop-outs, technical variance, and redundancy of predictive variables. CellTrails enables the reconstruction of branching trajectories and provides an intuitive graphical representation of expression patterns along all branches simultaneously. It allows the user to define and infer the expression dynamics of individual and multiple pathways towards distinct phenotypes.

CellTrails was developed with a 183-dimensional RT-qPCR gene expression panel of 1,008 cells collected from the developing chicken utricle, a balance organ. Key players in the utricle's function are cohorts of sensory hair cells that display mechanosensing organelles, called hair bundles, protruding from their apical surfaces. Bundle growth and maturation is dictated by an orchestration of distinct sequential and overlapping cellular processes. Our goal was to elucidate the temporal expression program of key hair bundle genes in subtypes of hair cells that occur with distinct spatial distribution. We showed that CellTrails faithfully predicted expression patterns of hair cell maturation with unprecedented resolution.

We confirmed that CellTrails can be applied to analysis of single-cell RNA-Seq datasets. We are pleased that you consider using CellTrails in your research. A detailed theoretical description of the algorithm and its application to biological uses has been published in:

Ellwanger DC, Scheibinger M, Dumont RA, Barr-Gillespie PG, and Heller S. "Transcriptional dynamics of hair-bundle morphogenesis revealed with CellTrails". Cell Reports, June 5 2018;23(10)

Installation

CellTrails is an extension for R (https://www.r-project.org), which is a free software environment for statistical computing and graphics. A simple yet efficient way to work with R consists in writing source code with your favorite text editor and sending it to the R console. It is suggested to use a development environment, such as Rstudio (https://www.rstudio.com/), or a rich text editor with R functionalities, such as Emacs (https://www.gnu.org/software/emacs/), which greatly eases the work.

The CellTrails package can be installed from this repository directly using the devtools package within an active R session.

if(!require("devtools")) {
  install.packages("devtools")
} 
if(require("devtools")) {
  install_github("dcellwanger/CellTrails")
} else {
  stop("Could not load package 'devtools'.")
}

We also recommend to download and install the graph visualization software yEd (http://www.yworks.com/products/yed). It provides great capabilities to visualize and analyze a trajectory graph produced by CellTrails.

Before ready to use, the CellTrails library must be loaded into the R environment:

library(CellTrails)

Additional information can be found at http://hellerlab.stanford.edu/celltrails/

Please, refer to the vignette for a detailed explanation and instruction on how to use CellTrails.

celltrails's People

Contributors

dcellwanger avatar kayla-morrell avatar mtmorgan avatar nturaga avatar vobencha avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rcannood

celltrails's Issues

Error when executing findStates() - Error in t.default(.exprs(sce[.useFeature(sce), ])) :

Hello,

I'm trying to execute the follow code:

states(sce_obj) <- findStates(sce_obj, min_size=0.01, min_feat=5, max_pval=1e-4, min_fc=2)

however I'm running into this error message:

Error in t.default(.exprs(sce[.useFeature(sce), ])) :
argument is not a matrix

I'm not quite sure which assay it's accessing however this is what my counts matrices look like:

> str(counts(sce_obj))

Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
...@ i : int [1:3306205] 0 22 70 102 131 186 281 352 384 401 ...
..@ p : int [1:3759] 0 764 1702 1942 3475 4253 4796 5948 6948 7998 ...
..@ Dim : int [1:2] 32524 3758
..@ Dimnames:List of 2
.. ..$ : chr [1:32524] "rpl24" "cep97" "nfkbiz" "CU651657.1" ...
.. ..$ : chr [1:3758] "AAACCTGCAAGAGTCG_3" "AAACCTGCATTAACCG_3" >"AAACCTGGTGTGGTTT_3" "AAACCTGTCAGATAAG_3" ...
..@ x : num [1:3306205] 5 1 1 1 1 1 1 1 5 6 ...
..@ factors : list()

> str(logcounts(sce_obj))

Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
..@ i : int [1:3306205] 0 22 70 102 131 186 281 352 384 401 ...
..@ p : int [1:3759] 0 764 1702 1942 3475 4253 4796 5948 6948 7998 ...
..@ Dim : int [1:2] 32524 3758
..@ Dimnames:List of 2
.. ..$ : chr [1:32524] "rpl24" "cep97" "nfkbiz" "CU651657.1" ...
.. ..$ : chr [1:3758] "AAACCTGCAAGAGTCG_3" "AAACCTGCATTAACCG_3" >"AAACCTGGTGTGGTTT_3" "AAACCTGTCAGATAAG_3" ...
..@ x : num [1:3306205] 3.19 1.73 1.73 1.73 1.73 ...
..@ factors : list()

Here's what my SingleCellExperiment object looks like:
> show(sce_obj)

class: SingleCellExperiment
dim: 32524 3758
metadata(0):
assays(2): counts logcounts
rownames(32524): rpl24 cep97 ... *3 *4
rowData names(0):
colnames(3758): AAACCTGCAAGAGTCG_3 AAACCTGCATTAACCG_3 ... >TTTGTCAGTGTGCGTC_3 TTTGTCATCACCGGGT_3
colData names(12): orig.ident nCount_RNA ... seq.method ident
reducedDimNames(4): PCA UMAP CellTrails CellTrails.tSNE
spikeNames(0):

I had the same issue happen when running embedSample() however I was able to convert my dgCMatrix into a regular matrix however I'm unsure as to convert it within the SingleCellExperiment object

Here's my sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server 7.6 (Maipo)

Matrix products: default
BLAS: /gpfs/packages/R/3.5.1/lib64/R/lib/libRblas.so
LAPACK: /gpfs/packages/R/3.5.1/lib64/R/lib/libRlapack.so

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets methods base

other attached packages:
[1] devtools_2.3.0 usethis_1.6.1 wesanderson_0.3.6 RColorBrewer_1.1-2
[5] ggplot2_3.2.1 scran_1.10.2 CellTrails_1.7.1 SingleCellExperiment_1.4.1
[9] SummarizedExperiment_1.12.0 DelayedArray_0.8.0 BiocParallel_1.14.2 matrixStats_0.54.0
[13] Biobase_2.40.0 GenomicRanges_1.34.0 GenomeInfoDb_1.18.2 IRanges_2.16.0
[17] S4Vectors_0.20.1 BiocGenerics_0.28.0 Seurat_3.1.5

loaded via a namespace (and not attached):
[1] backports_1.1.2 plyr_1.8.4 igraph_1.2.2 lazyeval_0.2.1
[5] splines_3.5.1 listenv_0.8.0 scater_1.10.1 digest_0.6.25
[9] htmltools_0.4.0 viridis_0.5.1 gdata_2.18.0 fansi_0.4.0
[13] magrittr_1.5 memoise_1.1.0 cluster_2.0.7-1 ROCR_1.0-7
[17] remotes_2.1.1 limma_3.36.3 globals_0.12.5 prettyunits_1.0.2
[21] colorspace_1.3-2 ggrepel_0.8.0 dplyr_0.8.3 callr_3.4.3
[25] crayon_1.3.4 RCurl_1.95-4.11 jsonlite_1.6.1 EnvStats_2.3.1
[29] survival_2.42-6 zoo_1.8-7 ape_5.4 glue_1.4.1
[33] gtable_0.2.0 zlibbioc_1.26.0 XVector_0.22.0 leiden_0.3.1
[37] cba_0.2-21 pkgbuild_1.0.6 Rhdf5lib_1.4.3 future.apply_1.3.0
[41] HDF5Array_1.10.1 scales_1.0.0 edgeR_3.24.3 Rcpp_1.0.3
[45] dtw_1.20-1 viridisLite_0.3.0 reticulate_1.10 rsvd_1.0.2
[49] proxy_0.4-22 tsne_0.1-3 htmlwidgets_1.5.1 httr_1.4.1
[53] gplots_3.0.3 ellipsis_0.3.0 ica_1.0-2 pkgconfig_2.0.2
[57] uwot_0.1.8 locfit_1.5-9.1 dynamicTreeCut_1.63-1 tidyselect_1.1.0
[61] labeling_0.3 rlang_0.4.6 reshape2_1.4.3 munsell_0.5.0
[65] tools_3.5.1 cli_2.0.2 ggridges_0.5.0 stringr_1.4.0
[69] maptree_1.4-7 npsurv_0.4-0 processx_3.4.2 fs_1.3.1
[73] fitdistrplus_1.0-11 caTools_1.17.1.1 purrr_0.3.3 RANN_2.6
[77] dendextend_1.13.4 pbapply_1.3-4 future_1.17.0 nlme_3.1-137
[81] compiler_3.5.1 rstudioapi_0.11 curl_3.2 beeswarm_0.2.3
[85] plotly_4.9.2 png_0.1-7 testthat_2.3.2 lsei_1.2-0
[89] tibble_2.1.3 statmod_1.4.30 stringi_1.4.6 ps_1.3.2
[93] desc_1.2.0 lattice_0.20-35 Matrix_1.2-14 vctrs_0.3.1
[97] pillar_1.4.3 lifecycle_0.1.0 lmtest_0.9-36 RcppAnnoy_0.0.12
[101] BiocNeighbors_1.0.0 data.table_1.12.8 cowplot_0.9.3 bitops_1.0-6
[105] irlba_2.3.2 patchwork_1.0.0 R6_2.2.2 KernSmooth_2.23-15
[109] gridExtra_2.3 vipor_0.4.5 sessioninfo_1.1.1 codetools_0.2-15
[113] pkgload_1.1.0 MASS_7.3-51.6 gtools_3.8.1 assertthat_0.2.0
[117] rhdf5_2.26.2 rprojroot_1.3-2 withr_2.1.2 sctransform_0.2.0
[121] GenomeInfoDbData_1.1.0 mgcv_1.8-24 grid_3.5.1 rpart_4.1-13
[125] tidyr_1.0.0 DelayedMatrixStats_1.4.0 Rtsne_0.13 ggbeeswarm_0.6.0

Any insight is greatly appreciated, thank you!!

Unable to store layout in trajLayout() and stateTrajLayout()

Hello CellTrails developers,

I'm running into the following error messages whenever I'm attempting to store my graph layouts to the SingleCellExperiment object:

p <- plotStateTrajectory(sce_obj, color_by="phenoName", name="state", component=1, point_size=1.5, label_offset=4)
stateTrajLayout(sce_obj) <- p

Error in stateTrajLayout<-(*tmp*, value = list(data = list(), layers = list( :
No proper layout information detected.

Here's the following error message when attempting to store my graphml plot:

tl <- read.ygraphml("../data/updated_yed_celltrails.graphml")

plot(tl[,1:2], axes=FALSE, xlab="", ylab="", pch=20, cex=.25)

trajLayout(sce_obj, adjust=TRUE) <- tl

Error in ext[[class2]] : no such index at level 1

To my understanding, storing the layout in the SingleCellExperiment is necessary to perform the plotMap function.
Any suggestions on how to proceed is greatly appreciated! Thank you!

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.