├── .DS_Store ├── .Rbuildignore ├── .Rhistory ├── .github ├── .gitignore └── workflows │ └── pkgdown.yaml ├── .gitignore ├── .travis.yml ├── CDSeq.Rproj ├── CRAN-RELEASE ├── DESCRIPTION ├── NAMESPACE ├── NEWS.md ├── R ├── .DS_Store ├── CDSeq-package.R ├── CDSeq.R ├── Cell2RNA.R ├── RNA2Cell.R ├── RcppExports.R ├── cdseq_result1-data.R ├── cdseq_result2-data.R ├── cdseq_result3-data.R ├── cdseq_result_pbmcmix-data.R ├── cellTypeAssignSCRNA.R ├── cellTypeProp-data.R ├── cellTypeRNAProp-data.R ├── data.R ├── gene2rpkm.R ├── geneLength-data.R ├── intersection.R ├── logpost.R ├── max_rep.R ├── mixtureGEP-data.R ├── pbmc_CDSeq_estprop-data.R ├── pbmc_ggplot-data.R ├── pbmc_mix-data.R ├── pbmc_true_prop-data.R ├── read2gene.R ├── refGEP-data.R ├── sc_annotation-data.R ├── sc_gep-data.R ├── trueGEPgene-data.R ├── trueGEPread-data.R └── trueGEPrpkm-data.R ├── README.Rmd ├── README.md ├── _pkgdown.yml ├── cran-comments.md ├── data ├── .DS_Store └── SyntheticMixtureData.RData ├── docs ├── 404.html ├── articles │ ├── CDSeq-vignette.html │ ├── CDSeq-vignette_files │ │ ├── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ │ ├── clipboard-1.7.1 │ │ │ └── clipboard.min.js │ │ ├── figure-html │ │ │ ├── fig1-1.png │ │ │ ├── fig2-1.png │ │ │ ├── fig3-1.png │ │ │ ├── fig4-1.png │ │ │ ├── fig5-1.png │ │ │ ├── fig6-1.png │ │ │ ├── fig7-1.png │ │ │ ├── show GEP vs scRNAseq-1.png │ │ │ └── show plots-1.png │ │ ├── header-attrs-2.6 │ │ │ └── header-attrs.js │ │ ├── klippy-0.0.0.9500 │ │ │ ├── css │ │ │ │ └── klippy.min.css │ │ │ └── js │ │ │ │ └── klippy.min.js │ │ └── primer-tooltips-1.4.0 │ │ │ └── build.css │ └── index.html ├── authors.html ├── bootstrap-toc.css ├── bootstrap-toc.js ├── docsearch.css ├── docsearch.js ├── index.html ├── link.svg ├── news │ └── index.html ├── pkgdown.css ├── pkgdown.js ├── pkgdown.yml └── reference │ ├── CDSeq-R-package.html │ ├── CDSeq.html │ ├── Cell2RNA.html │ ├── RNA2Cell.html │ ├── Rplot001.png │ ├── SyntheticMixtureData.html │ ├── cdseq.result.html │ ├── cellTypeAssign.html │ ├── cellTypeAssignMarkerGenes.html │ ├── cellTypeAssignSCRNA.html │ ├── figures │ ├── README-fig1-1.png │ ├── README-fig2-1.png │ ├── README-fig3-1.png │ ├── README-fig4-1.png │ ├── README-fig5-1.png │ └── README-pressure-1.png │ ├── gene2rpkm.html │ ├── gene_length.html │ ├── gibbsSampler.html │ ├── hungarian_Rcpp.html │ ├── index.html │ ├── intersection.html │ ├── logpost.html │ ├── max_rep.html │ ├── merge_df.html │ ├── mixtureGEP.html │ ├── pbmc_ggplot.html │ ├── pbmc_mix.html │ ├── read2gene.html │ ├── refGEP.html │ ├── result1.html │ ├── result2.html │ ├── result3.html │ ├── sc_annotation.html │ ├── sc_gep.html │ ├── seedMT.html │ ├── true_GEP_gene.html │ ├── true_GEP_read.html │ ├── true_GEP_rpkm.html │ ├── true_prop.html │ ├── true_prop_RNA.html │ └── true_prop_cell.html ├── inst └── CITATION ├── man ├── CDSeq-R-package.Rd ├── CDSeq.Rd ├── Cell2RNA.Rd ├── RNA2Cell.Rd ├── SyntheticMixtureData.Rd ├── cdseq.result.Rd ├── cellTypeAssignSCRNA.Rd ├── figures │ ├── README-fig1-1.png │ ├── README-fig2-1.png │ ├── README-fig3-1.png │ ├── README-fig4-1.png │ └── README-fig5-1.png ├── gene2rpkm.Rd ├── gene_length.Rd ├── gibbsSampler.Rd ├── hungarian_Rcpp.Rd ├── intersection.Rd ├── logpost.Rd ├── max_rep.Rd ├── merge_df.Rd ├── mixtureGEP.Rd ├── pbmc_ggplot.Rd ├── pbmc_mix.Rd ├── read2gene.Rd ├── refGEP.Rd ├── result1.Rd ├── result2.Rd ├── result3.Rd ├── sc_annotation.Rd ├── sc_gep.Rd ├── seedMT.Rd ├── true_GEP_gene.Rd ├── true_GEP_read.Rd ├── true_GEP_rpkm.Rd ├── true_prop.Rd ├── true_prop_RNA.Rd └── true_prop_cell.Rd ├── src ├── CDSeq.so ├── CDSeq_types.h ├── GibbsSampler.cpp ├── GibbsSampler.o ├── Hungarian.cpp ├── Hungarian.h ├── Hungarian.o ├── Makevars ├── Makevars.win ├── RcppExports.cpp ├── RcppExports.o ├── cokus.cpp ├── cokus.h ├── cokus.o ├── hungarian_Rcpp.cpp └── hungarian_Rcpp.o ├── tests ├── testthat.R └── testthat │ ├── test-CDSeq.R │ └── test-cellTypeAssignSCRNA.R └── vignettes ├── .gitignore └── CDSeq-vignette.Rmd /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/.DS_Store -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^_pkgdown\.yml$ 4 | ^docs$ 5 | ^pkgdown$ 6 | ^README\.Rmd$ 7 | ^cran-comments\.md$ 8 | ^\.travis\.yml$ 9 | ^CRAN-RELEASE$ 10 | ^\.github$ 11 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | - master 6 | 7 | name: pkgdown 8 | 9 | jobs: 10 | pkgdown: 11 | runs-on: macOS-latest 12 | env: 13 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - uses: r-lib/actions/setup-r@v1 18 | 19 | - uses: r-lib/actions/setup-pandoc@v1 20 | 21 | - name: Query dependencies 22 | run: | 23 | install.packages('remotes') 24 | saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) 25 | writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") 26 | shell: Rscript {0} 27 | 28 | - name: Cache R packages 29 | uses: actions/cache@v2 30 | with: 31 | path: ${{ env.R_LIBS_USER }} 32 | key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} 33 | restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- 34 | 35 | - name: Install dependencies 36 | run: | 37 | remotes::install_deps(dependencies = TRUE) 38 | install.packages("pkgdown", type = "binary") 39 | shell: Rscript {0} 40 | 41 | - name: Install package 42 | run: R CMD INSTALL . 43 | 44 | - name: Deploy package 45 | run: | 46 | git config --local user.email "actions@github.com" 47 | git config --local user.name "GitHub Actions" 48 | Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | src/*.o 6 | src/*.so 7 | src/*.dll 8 | inst/doc 9 | # RStudio files 10 | .Rproj.user/ 11 | # knitr and R markdown default cache directories 12 | *_cache/ 13 | /cache/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # R for travis: see documentation at https://docs.travis-ci.com/user/languages/r 2 | 3 | warnings_are_errors: false 4 | 5 | language: R 6 | cache: packages 7 | -------------------------------------------------------------------------------- /CDSeq.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | PackageRoxygenize: rd,collate,namespace 19 | -------------------------------------------------------------------------------- /CRAN-RELEASE: -------------------------------------------------------------------------------- 1 | This package was submitted to CRAN on 2021-02-05. 2 | Once it is accepted, delete this file and tag the release (commit 40b040a). 3 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: CDSeq 2 | Type: Package 3 | Title: A Complete Deconvolution Method using Sequencing Data 4 | Depends: R (>= 3.6.0) 5 | biocViews: 6 | Version: 1.0.9 7 | Date: 2021-03-12 8 | Authors@R: c(person("Kai", "Kang", email = "kangkai0714@gmail.com", role = c("aut", "cre","cph")), 9 | person("Caizhi", "Huang", email = "chuang19@ncsu.edu", role = "aut"), 10 | person("Qian","Meng", role="ctb"), 11 | person("Igor","Shats", role="ctb"), 12 | person("Melissa","Li", role="ctb"), 13 | person("David","Umbach",role="ctb"), 14 | person("Leping","Li", role=c("aut","cph")), 15 | person("Yuanyuan","Li", role="ctb"), 16 | person("Xiaoling","Li", role="ctb")) 17 | Maintainer: Kai Kang 18 | Description: Estimate cell-type-specific gene expression profiles and sample-specific cell-type proportions simultaneously using bulk sequencing data. Kang et al. (2019) . 19 | License: GPL-3 20 | Imports: 21 | Rcpp (>= 1.0.3), 22 | MASS, 23 | foreach, 24 | doParallel, 25 | dirmult, 26 | RcppThread, 27 | iterators, 28 | parallel, 29 | grDevices, 30 | Seurat, 31 | ggplot2, 32 | magrittr, 33 | dplyr, 34 | rlang, 35 | Matrix, 36 | matrixStats, 37 | ggpubr, 38 | pheatmap, 39 | harmony 40 | Remotes: github::immunogenomics/harmony 41 | LinkingTo: Rcpp, 42 | RcppArmadillo, 43 | Encoding: UTF-8 44 | LazyData: true 45 | RoxygenNote: 7.1.1 46 | Suggests: 47 | gplots, 48 | clue, 49 | Biobase, 50 | qlcMatrix, 51 | knitr, 52 | rmarkdown, 53 | testthat (>= 3.0.0) 54 | VignetteBuilder: knitr 55 | URL: https://github.com/kkang7/CDSeq_R_Package, https://doi.org/10.1371/journal.pcbi.1007510 56 | BugReports: https://github.com/kkang7/CDSeq_R_Package/issues 57 | Config/testthat/edition: 3 58 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(CDSeq) 4 | export(cellTypeAssignSCRNA) 5 | import(MASS) 6 | import(Rcpp) 7 | import(RcppThread) 8 | import(dirmult) 9 | import(doParallel) 10 | import(foreach) 11 | import(iterators) 12 | import(parallel) 13 | importFrom(Matrix,colSums) 14 | importFrom(Rcpp,evalCpp) 15 | importFrom(Seurat,CreateSeuratObject) 16 | importFrom(Seurat,FindAllMarkers) 17 | importFrom(Seurat,FindClusters) 18 | importFrom(Seurat,FindNeighbors) 19 | importFrom(Seurat,FindVariableFeatures) 20 | importFrom(Seurat,NormalizeData) 21 | importFrom(Seurat,RunPCA) 22 | importFrom(Seurat,RunTSNE) 23 | importFrom(Seurat,RunUMAP) 24 | importFrom(Seurat,ScaleData) 25 | importFrom(dplyr,"%>%") 26 | importFrom(dplyr,group_by) 27 | importFrom(dplyr,slice_max) 28 | importFrom(ggplot2,aes) 29 | importFrom(ggplot2,element_text) 30 | importFrom(ggplot2,geom_point) 31 | importFrom(ggplot2,ggplot) 32 | importFrom(ggplot2,ggsave) 33 | importFrom(ggplot2,ggtitle) 34 | importFrom(ggplot2,guide_legend) 35 | importFrom(ggplot2,guides) 36 | importFrom(ggplot2,scale_colour_manual) 37 | importFrom(ggplot2,scale_fill_manual) 38 | importFrom(ggplot2,scale_shape_manual) 39 | importFrom(ggplot2,scale_size_manual) 40 | importFrom(ggplot2,theme) 41 | importFrom(ggplot2,xlab) 42 | importFrom(ggplot2,ylab) 43 | importFrom(grDevices,rainbow) 44 | importFrom(harmony,RunHarmony) 45 | importFrom(pheatmap,pheatmap) 46 | importFrom(rlang,.data) 47 | importFrom(stats,cor) 48 | importFrom(stats,rmultinom) 49 | importFrom(stats,rnbinom) 50 | importFrom(stats,var) 51 | useDynLib(CDSeq) 52 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # CDSeq 1.0.9 2 | Added more features in cellTypeAssignSCRNA function. 3 | 4 | # CDSeq 1.0.8 5 | Bug fix. Add vignette. 6 | 7 | # CDSeq 1.0.7 8 | Bug fix. Add more features to cellTypeAssignSCRNA function. 9 | 10 | # CDSeq 1.0.6 11 | Add cellTypeAssignSCRNA function. This function can be used for cell type assignment using user provided single cell RNAseq data (with annotations). 12 | 13 | 14 | # CDSeq 1.0.5 15 | Add cellTypeAssignMarkerGenes function. This function can be used for cell type assignment using user provided marker gene list. 16 | -------------------------------------------------------------------------------- /R/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/R/.DS_Store -------------------------------------------------------------------------------- /R/CDSeq-package.R: -------------------------------------------------------------------------------- 1 | #' CDSeq: A package for complete deconvolution using sequencing data 2 | #' 3 | #' \code{CDSeq-R-package} takes bulk RNA-seq data as input and simultaneously returns estimates of both cell-type-specific gene expression profiles and sample-specific cell-type proportions. 4 | #' @author Kai Kang, David Huang, \email{kangkai0714@@gmail.com} 5 | #' @references \url{https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1007510} 6 | #' @section Reduce-Recover: 7 | #' CDSeq uses reduce-recovery strategy and CPU parallel computing to speed up the deconvolution. 8 | #' @section Hyperparameter estimation: 9 | #' Estimate hyperparameter for cell-type-specific GEPs (i.e. beta) using reference profile when cell_type_number is scalar. 10 | #' @section Estimating number of cell type: 11 | #' Estimate number of cell types when cell_type_number is a vector of integers. 12 | #' @section Partition on input bulk RNA-seq data: 13 | #' When block_number (number of partition on the bulk RNASeq data) is 1, whole bulk_data will be used. GEP is not from reduce-recovery. 14 | #' @docType package 15 | #' @import Rcpp MASS foreach doParallel dirmult RcppThread iterators parallel 16 | #' @importFrom Rcpp evalCpp 17 | #' @useDynLib CDSeq 18 | #' @name CDSeq-R-package 19 | NULL 20 | 21 | -------------------------------------------------------------------------------- /R/Cell2RNA.R: -------------------------------------------------------------------------------- 1 | #' Cell proportion to RNA proportion 2 | #' \code{Cell2RNA} converts Cell proportion to RNA proportion 3 | #' @param eta numeric vector represents the different amounts of RNA produced by different cell types 4 | #' @param cellprop sample-specific cell-type proportion 5 | #' @return Cell2RNA returns sample-specific cell-type RNA proportion 6 | 7 | # this function converts RNA proportion to cell proportion 8 | # coder: Kai Kang 9 | 10 | Cell2RNA<-function(eta,cellprop){ 11 | if(nargs()!=2){stop("in Cell2RNA: function takes 2 inputs")} 12 | 13 | if(!is.null(dim(eta))){stop("in Cell2RNA: eta should be a vector, NOT a matrix")} 14 | nc<-length(eta) 15 | nc2<-nrow(cellprop) 16 | if(is.null(nc2)){stop("in Cell2RNA: cellprop should be a matrix")} 17 | if(nc!=nc2){stop("in Cell2RNA: length(eta) should be equal to nrow(cellprop)")} 18 | 19 | tmp<-cellprop*eta 20 | rnaprop<-t(t(tmp)/colSums(tmp)) 21 | return(rnaprop) 22 | } -------------------------------------------------------------------------------- /R/RNA2Cell.R: -------------------------------------------------------------------------------- 1 | #' RNA proportion to cell proportion 2 | #' \code{RNA2Cell} converts RNA proportion to cell proportion 3 | #' @param eta numeric vector represents the different amounts of RNA produced by different cell types 4 | #' @param rnaprop sample-specific cell-type RNA proportion 5 | #' @return RNA2Cell returns sample-specific cell-type proportion 6 | # this function converts RNA proportion to cell proportion 7 | # coder: Kai Kang 8 | 9 | RNA2Cell<-function(eta,rnaprop){ 10 | if(nargs()!=2){stop("in RNA2Cell: function takes 2 inputs")} 11 | 12 | if(!is.null(dim(eta))){stop("in RNA2Cell: eta should be a vector, NOT a matrix")} 13 | nc<-length(eta) 14 | nc2<-nrow(rnaprop) 15 | if(is.null(nc2)){stop("in RNA2Cell: rnaprop should be a matrix")} 16 | if(nc!=nc2){stop("in RNA2Cell: length(eta) should be equal to nrow(rnaprop)")} 17 | 18 | tmp<-rnaprop/eta 19 | cellprop<-t(t(tmp)/colSums(tmp)) 20 | return(cellprop) 21 | } -------------------------------------------------------------------------------- /R/RcppExports.R: -------------------------------------------------------------------------------- 1 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand 2 | # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 3 | 4 | #' This is the Gibbs sampler for CDSeq. 5 | #' \code{GibbsSampler} returns estimated GEPs and cell type proportions. 6 | #' @param ALPHA hyperparameter for cell type proportion. 7 | #' @param BETA hyperparameter for cell-type-specific GEPs. 8 | #' @param mixtureSamples bulk RNA-seq data in form of read counts. 9 | #' @param T number of cell types. 10 | #' @param NN number of MCMC iteration. 11 | #' @param OUTPUT MCMC progress output control. 12 | #' @param processID worker process ID when using parallel computing. 13 | #' @param data_block_idx index for data blocks from bulk RNA-seq input. 14 | #' @param CDSeq_tmp_log temporary log file recording the workers' jobs. 15 | #' @param write_2_file print to progress msg to CDSeq_tmp_log if it is 1, not printing otherwise. 16 | #' @param verbose if greater than or euqal to 1, then print working progress in console, otherwise do not print in console. 17 | #' @return random integers uniformly distributed in 0..(2^32 - 1). 18 | gibbsSampler <- function(ALPHA, BETA, mixtureSamples, T, NN, OUTPUT, processID, data_block_idx, CDSeq_tmp_log, write_2_file, verbose) { 19 | .Call('_CDSeq_gibbsSampler', PACKAGE = 'CDSeq', ALPHA, BETA, mixtureSamples, T, NN, OUTPUT, processID, data_block_idx, CDSeq_tmp_log, write_2_file, verbose) 20 | } 21 | 22 | #' This is the Mersenne Twister random number generator. 23 | #' \code{cokus} generates pseudorandom integers uniformly distributed in 0..(2^32 - 1). 24 | #' @param seed odd number for seeding 25 | #' @return random integers uniformly distributed in 0..(2^32 - 1). 26 | #' @author Shawn Cokus (Cokus@@math.washington.edu) 27 | seedMT <- function(seed) { 28 | invisible(.Call('_CDSeq_seedMT', PACKAGE = 'CDSeq', seed)) 29 | } 30 | 31 | randomMT <- function() { 32 | .Call('_CDSeq_randomMT', PACKAGE = 'CDSeq') 33 | } 34 | 35 | #' This is the Hungarian algorithm wrapper for cell type assignment 36 | #' \code{hungarian_Rcpp} returns cell type assignment given reference GEPs 37 | #' @param costMat correlation matrix 38 | #' @return cost for the assignment and cell type assignment 39 | hungarian_Rcpp <- function(costMat) { 40 | .Call('_CDSeq_hungarian_Rcpp', PACKAGE = 'CDSeq', costMat) 41 | } 42 | 43 | -------------------------------------------------------------------------------- /R/cdseq_result1-data.R: -------------------------------------------------------------------------------- 1 | #' CDSeq result of synthetic bulk RNA-seq read counts data of six cell types 2 | #' @name result1 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source CDSeq-estimates of mixtureGEP 8 | NULL -------------------------------------------------------------------------------- /R/cdseq_result2-data.R: -------------------------------------------------------------------------------- 1 | #' CDSeq result of synthetic bulk RNA-seq read counts data of six cell types 2 | #' @name result2 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source CDSeq estimates of mixtureGEP 8 | NULL -------------------------------------------------------------------------------- /R/cdseq_result3-data.R: -------------------------------------------------------------------------------- 1 | #' CDSeq result of synthetic bulk RNA-seq read counts data of six cell types 2 | #' @name result3 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source CDSeq estimates of mixtureGEP 8 | NULL -------------------------------------------------------------------------------- /R/cdseq_result_pbmcmix-data.R: -------------------------------------------------------------------------------- 1 | #' Output of synthetic mixtures of PBMC scRNAseq data 2 | #' @name cdseq.result 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source This is the CDSeq output of synthetic PBMC mixtures 8 | NULL -------------------------------------------------------------------------------- /R/cellTypeProp-data.R: -------------------------------------------------------------------------------- 1 | #' True cell proportions of the mixtures 2 | #' @name true_prop_cell 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source cell type proportions are randomly generated 8 | NULL -------------------------------------------------------------------------------- /R/cellTypeRNAProp-data.R: -------------------------------------------------------------------------------- 1 | #' True cell type RNA proportions 2 | #' @name true_prop_RNA 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source randomly generated 8 | NULL -------------------------------------------------------------------------------- /R/data.R: -------------------------------------------------------------------------------- 1 | #' Synthetic bulk RNA-seq read counts data of six cell types, PBMC mixtures using scRNASeq and some preliminary results 2 | #' @name SyntheticMixtureData 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format A matrix of read counts data containing 40 synthetic mixtures with 500 genes 6 | #' @author Kai Kang 7 | #' @source we downloaded the pure cell line RNA-seq data and generated the mixing proportions randomly and produced the mixtures 8 | #' @examples 9 | #' data(SyntheticMixtureData) 10 | NULL -------------------------------------------------------------------------------- /R/gene2rpkm.R: -------------------------------------------------------------------------------- 1 | #' gene2rpkm outputs the rpkm normalizations of the CDSeq-estimated GEPs. 2 | #' \code{gene2rpkm} outputs the rpkm normalizations of the CDSeq-estimated GEPs. 3 | #' @param gene_rate CDSeq-estimated GEP normalized by gene length. 4 | #' @param gene_effective_length gene effective length which is the gene length minus the read length plus one. 5 | #' @param cell_line_counts RNA-Seq read counts data of cell lines 6 | #' @return gene2rpkm returns rpkm normalization of the CDSeq-estimated GEPs. 7 | 8 | # this function converts the gene rate to rpkm normalization 9 | # coder: Kai Kang 10 | 11 | gene2rpkm<-function(gene_rate, gene_effective_length, cell_line_counts){ 12 | if(nargs()!=3){stop("in function gene2rpkm: 3 inputs required")} 13 | 14 | #if(!is.matrix(gene_rate)){stop("in function gene2rpkm: input gene_rate has to be a matrix")} 15 | #if(!is.matrix(cell_line_counts)){stop("in function gene2rpkm: input cell_line_counts has to be a matrix")} 16 | 17 | gc<-dim(gene_rate) 18 | gc2<-dim(cell_line_counts) 19 | g3<-length(gene_effective_length) 20 | 21 | if(gc[1]!=gc2[1] || gc[1]!=g3 || gc2[1]!=g3){stop("in function gene2rpkm: the 3 inputs should have the same number of rows")} 22 | if(gc[2]!=gc2[2]){stop("in function gene2rpkm: gene_rate and cell_line_counts should have the same number of columns")} 23 | 24 | tmp<-cell_line_counts/gene_effective_length 25 | tmp2<-t(t(tmp)/colSums(cell_line_counts)) 26 | tmp3<-colSums(tmp2) 27 | rpkm<-t(t(gene_rate)*tmp3)*10^9; 28 | 29 | return(rpkm) 30 | } -------------------------------------------------------------------------------- /R/geneLength-data.R: -------------------------------------------------------------------------------- 1 | #' Gene length 2 | #' @name gene_length 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric vector 6 | #' @author Kai Kang 7 | NULL -------------------------------------------------------------------------------- /R/intersection.R: -------------------------------------------------------------------------------- 1 | #' \code{intersection} take intersection of multiple lists and return the common set and index 2 | #' @param list.vector this is a list of list contain all the data. 3 | #' @param order this is either sort or stable. If choose sort, the output common value will be sorted. If choose stable, the output common value will be in the same order as appear in the first element in list.vector. 4 | #' @return The common values among lists and their indices. 5 | 6 | 7 | 8 | 9 | 10 | #' intersection function: 11 | #' input: list.vector is a list of list contain all the data 12 | #' for example, if we need to find the common elements of a, b, c, then input should be list(a,b,c) 13 | 14 | intersection <- function(list.vector, 15 | order='sort' 16 | ){ 17 | if(order!='sort' && order!='stable'){stop('order has to be either \'sort\' or \'stable\'.')} 18 | list.length <- length(list.vector) 19 | if(list.length==1){stop('list.vector has to be a list of list, for example, list(a,b,c)')} 20 | 21 | idx <- vector("list",list.length) 22 | list.comm <- Reduce(intersect,list.vector) 23 | 24 | 25 | 26 | if(order=='sort'){ 27 | list.comm <- sort(list.comm) 28 | for (i in 1:list.length) { 29 | idx[[i]] <- match(list.comm,list.vector[[i]]) 30 | } 31 | } 32 | 33 | if(order=='stable'){ 34 | for (i in 1:list.length) { 35 | idx[[i]] <- match(list.comm,list.vector[[i]]) 36 | } 37 | } 38 | 39 | interaction.return <- list(comm.value=list.comm, index=idx) 40 | return(interaction.return) 41 | } -------------------------------------------------------------------------------- /R/logpost.R: -------------------------------------------------------------------------------- 1 | #' logpost computes the log posterior of the CDSeq model. 2 | #' \code{logpost} outputs the value of log posterior. 3 | #' @param estProp CDSeq-estimated cell type proportions. 4 | #' @param estGEP CDSeq-estimated cell-type-specific GEPs. 5 | #' @param mydata input bulk RNA-seq data. 6 | #' @param alpha hyperparameter for cell type proportion estimation. 7 | #' @param beta hyperparameter for cell-type-specific GEP estimation. 8 | #' @return logpost returns log posterior values. 9 | 10 | ## simplified log posterior function with estProp and estGEP matrices as input 11 | # coder: Kai Kang 12 | 13 | logpost <- function(estProp, estGEP, mydata, alpha, beta){ 14 | #if(class(alpha)!="numeric" || length(alpha)>1){stop("CDSeq: in function logpost, alpha is a positive scalar")} 15 | #if(class(beta)!="numeric" || length(beta)>1){stop("beta is a positive scalar")} 16 | if(class(alpha)!="numeric"){stop("CDSeq: in function logpost, alpha should be a numeric value")} 17 | if(class(beta)!="numeric"){stop("CDSeq: in function logpost, beta should be a numeric value")} 18 | mu<-1e8 19 | value <- sum(log(mu*estGEP)*(beta - 1)) + sum(log(estProp)*(alpha - 1)) + sum((log(mu*estGEP %*% estProp )) * mydata) 20 | return(value) 21 | } -------------------------------------------------------------------------------- /R/max_rep.R: -------------------------------------------------------------------------------- 1 | #' \code{max_rep} Find the element that repeats the most in a given vector and calculate its proportion. 2 | #' @param v a vector 3 | #' @return max_rep_value contains two elements: max_element and max_element_proportion. max_element is the element that repeats the most in v, and max_element_proportion 4 | #' is its proportion. 5 | 6 | # find the number of maximum repititions 7 | 8 | max_rep <- function(v){ 9 | unique_v <- unique(v) 10 | n_reps <- rep(0,length(unique_v)) 11 | max_rep_value <- list() 12 | for (i in 1:length(unique_v)) { 13 | idx <- which(v == unique_v[i]) 14 | n_reps[i] <- length(idx) 15 | } 16 | max_element_idx <- which(n_reps==max(n_reps)) 17 | max_element <- unique_v[max_element_idx] 18 | max_rep_value$max_element <- max_element 19 | max_rep_value$max_element_proportion <- max(n_reps)/sum(n_reps) 20 | return(max_rep_value) 21 | } -------------------------------------------------------------------------------- /R/mixtureGEP-data.R: -------------------------------------------------------------------------------- 1 | #' Synthetic bulk RNA-seq read counts data of six cell types 2 | #' @name mixtureGEP 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source we downloaded the pure cell line RNA-seq data and generated the mixing proportions randomly and produced the mixtures 8 | NULL -------------------------------------------------------------------------------- /R/pbmc_CDSeq_estprop-data.R: -------------------------------------------------------------------------------- 1 | #' Data frame for keeping the CDSeq-estimated cell type proportions for PBMC mixtures 2 | #' @name merge_df 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format data frame 6 | #' @author Kai Kang 7 | #' @source CDSeq estimated cell type proportions for cell type number 3, 6, 9 and 12 8 | NULL -------------------------------------------------------------------------------- /R/pbmc_ggplot-data.R: -------------------------------------------------------------------------------- 1 | #' ggplot figures of comparison between CDSeq-estimated cell type proportion and ground truth 2 | #' @name pbmc_ggplot 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format ggplot object 6 | #' @author Kai Kang 7 | #' @source CDseq-estimated cell type proportion and ground truth 8 | NULL -------------------------------------------------------------------------------- /R/pbmc_mix-data.R: -------------------------------------------------------------------------------- 1 | #' Synthetic bulk RNA-seq read counts data of PBMC single cell data 2 | #' @name pbmc_mix 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source we downloaded the PBMC scRNAseq and generated the mixing proportions randomly and produced the mixtures 8 | NULL -------------------------------------------------------------------------------- /R/pbmc_true_prop-data.R: -------------------------------------------------------------------------------- 1 | #' True cell type proportion in the PBMC synthetic mixtures 2 | #' @name true_prop 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source randomly generated 8 | NULL -------------------------------------------------------------------------------- /R/read2gene.R: -------------------------------------------------------------------------------- 1 | #' read2gene outputs the GEP normalized by gene length of the CDSeq-estimated GEPs. 2 | #' \code{read2gene} outputs the gene length normalized CDSeq-estimated GEP. 3 | #' @param read_rate CDSeq-estimated GEP before normalized by gene length. 4 | #' @param gene_effective_length gene effective length which is the gene length minus the read length plus one. 5 | #' @return read2gene returns gene length normalized CDSeq-estimated GEPs. 6 | 7 | # this function convert read rate to gene rate 8 | # coder: Kai Kang 9 | read2gene <- function(read_rate, gene_effective_length){ 10 | if(nargs()!=2){stop("read2gene function takes 2 inputs")} 11 | 12 | g<-nrow(read_rate) 13 | g1<-length(gene_effective_length) 14 | if(g!=g1){stop("in function read2gene: two inputs must have the same number of rows")} 15 | tmp<-read_rate/gene_effective_length 16 | gene_rate<-t(t(tmp)/colSums(tmp)) 17 | return(gene_rate) 18 | } -------------------------------------------------------------------------------- /R/refGEP-data.R: -------------------------------------------------------------------------------- 1 | #' GEPs of six component pure cell lines 2 | #' @name refGEP 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | NULL -------------------------------------------------------------------------------- /R/sc_annotation-data.R: -------------------------------------------------------------------------------- 1 | #' Cell type annotation of the PBMC single cell data 2 | #' @name sc_annotation 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source We used the annotation provided by the single cell data 8 | NULL -------------------------------------------------------------------------------- /R/sc_gep-data.R: -------------------------------------------------------------------------------- 1 | #' PBMC single cell RNAseq read counts that used for creating synthetic PBMC mixtures 2 | #' @name sc_gep 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | #' @source we downloaded the PBMC RNA-seq data and generated the mixing proportions randomly and produced the mixtures 8 | NULL -------------------------------------------------------------------------------- /R/trueGEPgene-data.R: -------------------------------------------------------------------------------- 1 | #' True GEPs of the six component cell types normalized by gene length 2 | #' @name true_GEP_gene 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | NULL -------------------------------------------------------------------------------- /R/trueGEPread-data.R: -------------------------------------------------------------------------------- 1 | #' True GEPs of the six component cell types unnormalized by gene length 2 | #' @name true_GEP_read 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | NULL -------------------------------------------------------------------------------- /R/trueGEPrpkm-data.R: -------------------------------------------------------------------------------- 1 | #' True GEPs of the six component cell types RPKM normalization 2 | #' @name true_GEP_rpkm 3 | #' @docType data 4 | #' @usage data(SyntheticMixtureData) 5 | #' @format numeric matrix 6 | #' @author Kai Kang 7 | NULL -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | 7 | ```{r, include = FALSE} 8 | knitr::opts_chunk$set( 9 | collapse = TRUE, 10 | comment = "#>", 11 | fig.path = "man/figures/README-", 12 | out.width = "100%" 13 | ) 14 | ``` 15 | 16 | # CDSeq 17 | 18 | 19 | [![Travis build status](https://travis-ci.com/kkang7/CDSeq_R_Package.svg?branch=master)](https://travis-ci.com/kkang7/CDSeq_R_Package) 20 | 21 | 22 | CDSeq is a complete deconvolution method for dissecting bulk RNA-Seq data. The input of CDSeq is, ideally, bulk RNA-Seq read counts (similar to the input format required by DESeq2), and CDSeq will estimate, simultaneously, the cell-type-specific gene expression profiles and the sample-specific cell-type proportions, no reference of pure cell line GEPs or scRNAseq reference is needed for running CDSeq. 23 | 24 | For example, if you have a bulk RNA-Seq data, a G by M matrix **A**, which is a G by M matrix. G denotes the number of genes and M is the sample size, then CDSeq will output **B** (a G by T matrix) and **C** (a T by M matrix), where T is the number of cell types, **B** is the estimate of cell-type-specific GEPs and **C** is the estimate of sample-specific cell-type proportions. 25 | 26 | Importantly, you can ask CDSeq to estimate the number of cell types, i.e. T, by providing a vector of possible integer values for T. For example, if the user input for T is a vector, i.e. $T=\{2,3,4,5,6\}$, then CDSeq will estimate the most likely number for T. 27 | 28 | ## Installation 29 | 30 | You can install the released version of CDSeq from [CRAN](https://CRAN.R-project.org) with: 31 | 32 | ``` r 33 | install.packages("CDSeq") 34 | ``` 35 | 36 | And the development version from [GitHub](https://github.com/) with: 37 | 38 | ``` r 39 | # install.packages("devtools") 40 | devtools::install_github("kkang7/CDSeq_R_Package") 41 | ``` 42 | 43 | build the vignette with 44 | 45 | ``` r 46 | # install.packages("devtools") 47 | devtools::install_github("kkang7/CDSeq_R_Package", build_vignettes = TRUE) 48 | ``` 49 | ## Known issue about MacOS installation 50 | It is possible for Mac users to run into some errors when install from source due to problems of Rcpp compiler tools. Follow the instruction here may help: https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/ 51 | 52 | 53 | ## Example 54 | Load package 55 | ```{r, echo=TRUE, eval=TRUE} 56 | library(CDSeq) 57 | ``` 58 | 59 | ### When the number of cell types is a scalar 60 | ```{r example 1, echo=TRUE ,eval=FALSE, cache=FALSE, results='hide'} 61 | ## basic example code 62 | result1<-CDSeq(bulk_data = mixtureGEP, 63 | cell_type_number = 6, 64 | mcmc_iterations = 5, # increase the mcmc_iterations to 700 or above 65 | gene_length = as.vector(gene_length), 66 | reference_gep = refGEP, # gene expression profile of pure cell lines 67 | cpu_number = 1) 68 | ``` 69 | 70 | 71 | ### When the number of cell types is a vector 72 | The *cell_type_number* can also be a vector which contains different integer values. CDSeq will perform estimation for each integer in the vector and estimate the number of cell types in the mixtures. For example, one can set *cell_type_number = 2:10* as follows, and CDSeq will estimate the most likely number of cell types from 2 to 10. 73 | 74 | ```{r example 2, echo=TRUE ,eval=FALSE, cache=FALSE, results='hide'} 75 | result2<-CDSeq(bulk_data = mixtureGEP, 76 | cell_type_number = 2:10, 77 | mcmc_iterations = 5, 78 | dilution_factor = 1, 79 | block_number = 1, 80 | gene_length = as.vector(gene_length), 81 | reference_gep = refGEP, # gene expression profile of pure cell lines 82 | cpu_number = 1, # use multiple cores to save time. Set the cpu_number = length(cell_type_number) if there is enough cores. 83 | print_progress_msg_to_file = 0) 84 | 85 | ``` 86 | 87 | 88 | ### Use single cell to annotate CDSeq-estimated cell types 89 | ```{r example 4, echo=TRUE, eval=FALSE, cache=FALSE, results='hide'} 90 | cdseq.result <- CDSeq::CDSeq(bulk_data = pbmc_mix, 91 | cell_type_number = seq(3,12,3), 92 | beta = 0.5, 93 | alpha = 5, 94 | mcmc_iterations = 700, 95 | cpu_number = 4, 96 | dilution_factor = 10) 97 | 98 | cdseq.result.celltypeassign <- cellTypeAssignSCRNA(cdseq_gep = cdseq.result$estGEP, # CDSeq-estimated cell-type-specific GEPs 99 | cdseq_prop = cdseq.result$estProp, # CDSeq-estimated cell type proportions 100 | sc_gep = sc_gep, # PBMC single cell data 101 | sc_annotation = sc_annotation,# PBMC single data annotations 102 | sc_pt_size = 3, 103 | cdseq_pt_size = 6, 104 | seurat_nfeatures = 100, 105 | seurat_npcs = 50, 106 | seurat_dims=1:5, 107 | plot_umap = 1, 108 | plot_tsne = 0) 109 | ``` 110 | 111 | ## Setting recommendations 112 | We provide recommendations for parameter settings. Note that these recommendations are merely emperical and there is no theoretical justifications yet. User can tune the parameters based on specific applications and domain knowledges. 113 | 114 | Parameters Recommended setting 115 | --------------- ---------------------- 116 | beta 0.5 117 | alpha 5 118 | mcmc_iteration 700-2000 119 | dilution_factor 2-10 120 | gene_subset_size 200-500 121 | block_number >5 122 | 123 | Check vignette for more details and examples: *browseVignettes("CDSeq")*. 124 | 125 | ## Contact 126 | email: kangkai0714@gmail.com 127 | 128 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # CDSeq 5 | 6 | 7 | 8 | [![Travis build 9 | status](https://travis-ci.com/kkang7/CDSeq_R_Package.svg?branch=master)](https://travis-ci.com/kkang7/CDSeq_R_Package) 10 | 11 | 12 | CDSeq is a complete deconvolution method for dissecting bulk RNA-Seq 13 | data. The input of CDSeq is, ideally, bulk RNA-Seq read counts (similar 14 | to the input format required by DESeq2), and CDSeq will estimate, 15 | simultaneously, the cell-type-specific gene expression profiles and the 16 | sample-specific cell-type proportions, no reference of pure cell line 17 | GEPs or scRNAseq reference is needed for running CDSeq. 18 | 19 | For example, if you have a bulk RNA-Seq data, a G by M matrix **A**, 20 | which is a G by M matrix. G denotes the number of genes and M is the 21 | sample size, then CDSeq will output **B** (a G by T matrix) and **C** (a 22 | T by M matrix), where T is the number of cell types, **B** is the 23 | estimate of cell-type-specific GEPs and **C** is the estimate of 24 | sample-specific cell-type proportions. 25 | 26 | Importantly, you can ask CDSeq to estimate the number of cell types, 27 | i.e. T, by providing a vector of possible integer values for T. For 28 | example, if the user input for T is a vector, i.e. \(T=\{2,3,4,5,6\}\), 29 | then CDSeq will estimate the most likely number for T. 30 | 31 | ## Installation 32 | 33 | You can install the released version of CDSeq from 34 | [CRAN](https://CRAN.R-project.org) with: 35 | 36 | ``` r 37 | install.packages("CDSeq") 38 | ``` 39 | 40 | And the development version from [GitHub](https://github.com/) with: 41 | 42 | ``` r 43 | # install.packages("devtools") 44 | devtools::install_github("kkang7/CDSeq_R_Package") 45 | ``` 46 | 47 | build the vignette with 48 | 49 | ``` r 50 | # install.packages("devtools") 51 | devtools::install_github("kkang7/CDSeq_R_Package", build_vignettes = TRUE) 52 | ``` 53 | 54 | ## Known issue about MacOS installation 55 | 56 | It is possible for Mac users to run into some errors when install from 57 | source due to problems of Rcpp compiler tools. Follow the instruction 58 | here may help: 59 | 60 | 61 | ## Example 62 | 63 | Load package 64 | 65 | ``` r 66 | library(CDSeq) 67 | ``` 68 | 69 | ### When the number of cell types is a scalar 70 | 71 | ``` r 72 | ## basic example code 73 | result1<-CDSeq(bulk_data = mixtureGEP, 74 | cell_type_number = 6, 75 | mcmc_iterations = 5, # increase the mcmc_iterations to 700 or above 76 | gene_length = as.vector(gene_length), 77 | reference_gep = refGEP, # gene expression profile of pure cell lines 78 | cpu_number = 1) 79 | ``` 80 | 81 | ### When the number of cell types is a vector 82 | 83 | The *cell\_type\_number* can also be a vector which contains different 84 | integer values. CDSeq will perform estimation for each integer in the 85 | vector and estimate the number of cell types in the mixtures. For 86 | example, one can set *cell\_type\_number = 2:10* as follows, and CDSeq 87 | will estimate the most likely number of cell types from 2 to 10. 88 | 89 | ``` r 90 | result2<-CDSeq(bulk_data = mixtureGEP, 91 | cell_type_number = 2:10, 92 | mcmc_iterations = 5, 93 | dilution_factor = 1, 94 | block_number = 1, 95 | gene_length = as.vector(gene_length), 96 | reference_gep = refGEP, # gene expression profile of pure cell lines 97 | cpu_number = 1, # use multiple cores to save time. Set the cpu_number = length(cell_type_number) if there is enough cores. 98 | print_progress_msg_to_file = 0) 99 | ``` 100 | 101 | ### Use single cell to annotate CDSeq-estimated cell types 102 | 103 | ``` r 104 | cdseq.result <- CDSeq::CDSeq(bulk_data = pbmc_mix, 105 | cell_type_number = seq(3,12,3), 106 | beta = 0.5, 107 | alpha = 5, 108 | mcmc_iterations = 700, 109 | cpu_number = 4, 110 | dilution_factor = 10) 111 | 112 | cdseq.result.celltypeassign <- cellTypeAssignSCRNA(cdseq_gep = cdseq.result$estGEP, # CDSeq-estimated cell-type-specific GEPs 113 | cdseq_prop = cdseq.result$estProp, # CDSeq-estimated cell type proportions 114 | sc_gep = sc_gep, # PBMC single cell data 115 | sc_annotation = sc_annotation,# PBMC single data annotations 116 | sc_pt_size = 3, 117 | cdseq_pt_size = 6, 118 | seurat_nfeatures = 100, 119 | seurat_npcs = 50, 120 | seurat_dims=1:5, 121 | plot_umap = 1, 122 | plot_tsne = 0) 123 | ``` 124 | 125 | ## Setting recommendations 126 | 127 | We provide recommendations for parameter settings. Note that these 128 | recommendations are merely emperical and there is no theoretical 129 | justifications yet. User can tune the parameters based on specific 130 | applications and domain knowledges. 131 | 132 | | Parameters | Recommended setting | 133 | | :----------------- | :------------------ | 134 | | beta | 0.5 | 135 | | alpha | 5 | 136 | | mcmc\_iteration | 700-2000 | 137 | | dilution\_factor | 2-10 | 138 | | gene\_subset\_size | 200-500 | 139 | | block\_number | \>5 | 140 | 141 | Check vignette for more details and examples: 142 | *browseVignettes(“CDSeq”)*. 143 | 144 | ## Contact 145 | 146 | email: 147 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | destination: docs 2 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## Test environments 2 | * local OS X install, R 3.6.0 3 | * Ubuntu 16.04.6 LTS (on travis-ci), R 4.0.2 4 | * win-builder (devel and release) 5 | 6 | ## R CMD check results 7 | There were no ERRORs or WARNINGs. 8 | 9 | There was 1 NOTE for win-builder: 10 | 11 | * checking CRAN incoming feasibility ... NOTE 12 | Possibly mis-spelled words in DESCRIPTION: 13 | Deconvolution (3:19) 14 | Kang (12:152) 15 | al (12:160) 16 | et (12:157) 17 | 18 | Deconvolution is NOT a mis-spelled word. Kang et al. is the paper that describes the method. 19 | 20 | ## Downstream dependencies 21 | There are currently no downstream dependencies for this package 22 | 23 | ## Resubmission 24 | This is a resubmission. In this version I have: 25 | 26 | * Added citation information for the package. 27 | 28 | * Added a few more examples in the Rd-files and enabled automatic tesing using usethis::use_testthat(). 29 | 30 | * Added option to suppress printing message to console, i.e. setting verbose = FALSE. 31 | 32 | * Added Authors@R field. 33 | 34 | * Reset par() option to default after plotting. 35 | 36 | * Ensured examples do not use more than 2 cores. 37 | 38 | ## Resubmission 39 | * Added all authors, contributors and copyright holders in the Authors@R field with the appropriate roles. 40 | 41 | ## Resubmission 2020-02-05 42 | * Added verbose parameter to prevent from writing to console. 43 | 44 | * Makoto Matsumoto and Takuji Nishimura are NOT part of the R package or method development. I used the Mersenne Twister random number generator developed by Makoto Matsumoto and Takuji Nishimura. The Mersenne Twister random number generator code is in cokus.cpp and I quote the writer of the cokus.cpp file: "This version is a recode by Shawn Cokus (Cokus@math.washington.edu) on March 8, 1998 of a version by Takuji Nishimura (who had suggestions from Topher Cooper and Marc Rieffel in July-August 1997)." 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /data/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/data/.DS_Store -------------------------------------------------------------------------------- /data/SyntheticMixtureData.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/data/SyntheticMixtureData.RData -------------------------------------------------------------------------------- /docs/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Page not found (404) • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
62 |
63 | 117 | 118 | 119 | 120 |
121 | 122 |
123 |
124 | 127 | 128 | Content not found. Please use links in the navbar. 129 | 130 |
131 | 132 | 137 | 138 |
139 | 140 | 141 | 142 |
143 | 146 | 147 |
148 |

Site built with pkgdown 1.6.1.

149 |
150 | 151 |
152 |
153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/figure-html/fig1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/articles/CDSeq-vignette_files/figure-html/fig1-1.png -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/figure-html/fig2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/articles/CDSeq-vignette_files/figure-html/fig2-1.png -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/figure-html/fig3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/articles/CDSeq-vignette_files/figure-html/fig3-1.png -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/figure-html/fig4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/articles/CDSeq-vignette_files/figure-html/fig4-1.png -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/figure-html/fig5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/articles/CDSeq-vignette_files/figure-html/fig5-1.png -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/figure-html/fig6-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/articles/CDSeq-vignette_files/figure-html/fig6-1.png -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/figure-html/fig7-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/articles/CDSeq-vignette_files/figure-html/fig7-1.png -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/figure-html/show GEP vs scRNAseq-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/articles/CDSeq-vignette_files/figure-html/show GEP vs scRNAseq-1.png -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/figure-html/show plots-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/articles/CDSeq-vignette_files/figure-html/show plots-1.png -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/header-attrs-2.6/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/klippy-0.0.0.9500/css/klippy.min.css: -------------------------------------------------------------------------------- 1 | .klippy{overflow:visible;position:relative}.btn-klippy{position:absolute;border:0;padding:1px 0 0 1px;background-color:transparent}.btn-klippy>div{margin:0;padding:0}.btn-klippy .octicon{display:inline-block;margin:0;padding:0}.btn-klippy:focus{outline:0}.btn-klippy:focus .octicon{border-width:thin;border-style:dotted;border-color:gray;border-radius:3px} 2 | -------------------------------------------------------------------------------- /docs/articles/CDSeq-vignette_files/klippy-0.0.0.9500/js/klippy.min.js: -------------------------------------------------------------------------------- 1 | function addClassKlippyToPreCode(){document.addEventListener("DOMContentLoaded",function(){for(var e=document.querySelectorAll("pre > code"),t=0;t';return"data:image/svg+xml;base64,"+window.btoa(l)}function initKlippy(t,o,n,l,i,a){document.addEventListener("DOMContentLoaded",function(){for(var r=getUriOcticonClippy(n,l),c="",d=document.querySelectorAll(".klippy > code"),p=0;p 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Articles • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
62 |
63 | 117 | 118 | 119 | 120 |
121 | 122 |
123 |
124 | 127 | 128 |
129 |

All vignettes

130 |

131 | 132 |
133 |
CDSeq: a complete deconvolution method using sequencing data
134 |
135 |
136 |
137 |
138 |
139 | 140 | 141 |
142 | 145 | 146 |
147 |

Site built with pkgdown 1.6.1.

148 |
149 | 150 |
151 |
152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /docs/authors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Citation and Authors • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
62 |
63 | 117 | 118 | 119 | 120 |
121 | 122 |
123 |
124 | 128 | 129 |

Kang, Kai, Qian Meng, Igor Shats, David M. Umbach, Melissa Li, Yuanyuan Li, Xiaoling Li, and Leping Li (2019) CDSeq: A novel complete deconvolution method for dissecting heterogeneous samples using gene expression data PLoS computational biology https://doi.org/10.1371/journal.pcbi.1007510

130 |
@Article{,
131 |   title = {CDSeq: A novel complete deconvolution method for dissecting heterogeneous samples using gene expression data},
132 |   author = {{Kang} and {Kai} and Qian Meng and Igor Shats and David M. Umbach and Melissa Li and Yuanyuan Li and Xiaoling Li and Leping Li},
133 |   journal = {PLoS computational biology},
134 |   year = {2019},
135 |   volume = {15},
136 |   number = {12},
137 |   pages = {e1007510},
138 |   url = {https://doi.org/10.1371/journal.pcbi.1007510},
139 | }
140 | 141 | 144 | 145 |
    146 |
  • 147 |

    Kai Kang. Author, maintainer, copyright holder. 148 |

    149 |
  • 150 |
  • 151 |

    Caizhi Huang. Author. 152 |

    153 |
  • 154 |
155 | 156 |
157 | 158 |
159 | 160 | 161 | 162 |
163 | 166 | 167 |
168 |

Site built with pkgdown 1.6.1.

169 |
170 | 171 |
172 |
173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /docs/bootstrap-toc.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | 6 | /* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ 7 | 8 | /* All levels of nav */ 9 | nav[data-toggle='toc'] .nav > li > a { 10 | display: block; 11 | padding: 4px 20px; 12 | font-size: 13px; 13 | font-weight: 500; 14 | color: #767676; 15 | } 16 | nav[data-toggle='toc'] .nav > li > a:hover, 17 | nav[data-toggle='toc'] .nav > li > a:focus { 18 | padding-left: 19px; 19 | color: #563d7c; 20 | text-decoration: none; 21 | background-color: transparent; 22 | border-left: 1px solid #563d7c; 23 | } 24 | nav[data-toggle='toc'] .nav > .active > a, 25 | nav[data-toggle='toc'] .nav > .active:hover > a, 26 | nav[data-toggle='toc'] .nav > .active:focus > a { 27 | padding-left: 18px; 28 | font-weight: bold; 29 | color: #563d7c; 30 | background-color: transparent; 31 | border-left: 2px solid #563d7c; 32 | } 33 | 34 | /* Nav: second level (shown on .active) */ 35 | nav[data-toggle='toc'] .nav .nav { 36 | display: none; /* Hide by default, but at >768px, show it */ 37 | padding-bottom: 10px; 38 | } 39 | nav[data-toggle='toc'] .nav .nav > li > a { 40 | padding-top: 1px; 41 | padding-bottom: 1px; 42 | padding-left: 30px; 43 | font-size: 12px; 44 | font-weight: normal; 45 | } 46 | nav[data-toggle='toc'] .nav .nav > li > a:hover, 47 | nav[data-toggle='toc'] .nav .nav > li > a:focus { 48 | padding-left: 29px; 49 | } 50 | nav[data-toggle='toc'] .nav .nav > .active > a, 51 | nav[data-toggle='toc'] .nav .nav > .active:hover > a, 52 | nav[data-toggle='toc'] .nav .nav > .active:focus > a { 53 | padding-left: 28px; 54 | font-weight: 500; 55 | } 56 | 57 | /* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ 58 | nav[data-toggle='toc'] .nav > .active > ul { 59 | display: block; 60 | } 61 | -------------------------------------------------------------------------------- /docs/bootstrap-toc.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | (function() { 6 | 'use strict'; 7 | 8 | window.Toc = { 9 | helpers: { 10 | // return all matching elements in the set, or their descendants 11 | findOrFilter: function($el, selector) { 12 | // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ 13 | // http://stackoverflow.com/a/12731439/358804 14 | var $descendants = $el.find(selector); 15 | return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); 16 | }, 17 | 18 | generateUniqueIdBase: function(el) { 19 | var text = $(el).text(); 20 | var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); 21 | return anchor || el.tagName.toLowerCase(); 22 | }, 23 | 24 | generateUniqueId: function(el) { 25 | var anchorBase = this.generateUniqueIdBase(el); 26 | for (var i = 0; ; i++) { 27 | var anchor = anchorBase; 28 | if (i > 0) { 29 | // add suffix 30 | anchor += '-' + i; 31 | } 32 | // check if ID already exists 33 | if (!document.getElementById(anchor)) { 34 | return anchor; 35 | } 36 | } 37 | }, 38 | 39 | generateAnchor: function(el) { 40 | if (el.id) { 41 | return el.id; 42 | } else { 43 | var anchor = this.generateUniqueId(el); 44 | el.id = anchor; 45 | return anchor; 46 | } 47 | }, 48 | 49 | createNavList: function() { 50 | return $(''); 51 | }, 52 | 53 | createChildNavList: function($parent) { 54 | var $childList = this.createNavList(); 55 | $parent.append($childList); 56 | return $childList; 57 | }, 58 | 59 | generateNavEl: function(anchor, text) { 60 | var $a = $(''); 61 | $a.attr('href', '#' + anchor); 62 | $a.text(text); 63 | var $li = $('
  • '); 64 | $li.append($a); 65 | return $li; 66 | }, 67 | 68 | generateNavItem: function(headingEl) { 69 | var anchor = this.generateAnchor(headingEl); 70 | var $heading = $(headingEl); 71 | var text = $heading.data('toc-text') || $heading.text(); 72 | return this.generateNavEl(anchor, text); 73 | }, 74 | 75 | // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). 76 | getTopLevel: function($scope) { 77 | for (var i = 1; i <= 6; i++) { 78 | var $headings = this.findOrFilter($scope, 'h' + i); 79 | if ($headings.length > 1) { 80 | return i; 81 | } 82 | } 83 | 84 | return 1; 85 | }, 86 | 87 | // returns the elements for the top level, and the next below it 88 | getHeadings: function($scope, topLevel) { 89 | var topSelector = 'h' + topLevel; 90 | 91 | var secondaryLevel = topLevel + 1; 92 | var secondarySelector = 'h' + secondaryLevel; 93 | 94 | return this.findOrFilter($scope, topSelector + ',' + secondarySelector); 95 | }, 96 | 97 | getNavLevel: function(el) { 98 | return parseInt(el.tagName.charAt(1), 10); 99 | }, 100 | 101 | populateNav: function($topContext, topLevel, $headings) { 102 | var $context = $topContext; 103 | var $prevNav; 104 | 105 | var helpers = this; 106 | $headings.each(function(i, el) { 107 | var $newNav = helpers.generateNavItem(el); 108 | var navLevel = helpers.getNavLevel(el); 109 | 110 | // determine the proper $context 111 | if (navLevel === topLevel) { 112 | // use top level 113 | $context = $topContext; 114 | } else if ($prevNav && $context === $topContext) { 115 | // create a new level of the tree and switch to it 116 | $context = helpers.createChildNavList($prevNav); 117 | } // else use the current $context 118 | 119 | $context.append($newNav); 120 | 121 | $prevNav = $newNav; 122 | }); 123 | }, 124 | 125 | parseOps: function(arg) { 126 | var opts; 127 | if (arg.jquery) { 128 | opts = { 129 | $nav: arg 130 | }; 131 | } else { 132 | opts = arg; 133 | } 134 | opts.$scope = opts.$scope || $(document.body); 135 | return opts; 136 | } 137 | }, 138 | 139 | // accepts a jQuery object, or an options object 140 | init: function(opts) { 141 | opts = this.helpers.parseOps(opts); 142 | 143 | // ensure that the data attribute is in place for styling 144 | opts.$nav.attr('data-toggle', 'toc'); 145 | 146 | var $topContext = this.helpers.createChildNavList(opts.$nav); 147 | var topLevel = this.helpers.getTopLevel(opts.$scope); 148 | var $headings = this.helpers.getHeadings(opts.$scope, topLevel); 149 | this.helpers.populateNav($topContext, topLevel, $headings); 150 | } 151 | }; 152 | 153 | $(function() { 154 | $('nav[data-toggle="toc"]').each(function(i, el) { 155 | var $nav = $(el); 156 | Toc.init($nav); 157 | }); 158 | }); 159 | })(); 160 | -------------------------------------------------------------------------------- /docs/docsearch.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | // register a handler to move the focus to the search bar 4 | // upon pressing shift + "/" (i.e. "?") 5 | $(document).on('keydown', function(e) { 6 | if (e.shiftKey && e.keyCode == 191) { 7 | e.preventDefault(); 8 | $("#search-input").focus(); 9 | } 10 | }); 11 | 12 | $(document).ready(function() { 13 | // do keyword highlighting 14 | /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ 15 | var mark = function() { 16 | 17 | var referrer = document.URL ; 18 | var paramKey = "q" ; 19 | 20 | if (referrer.indexOf("?") !== -1) { 21 | var qs = referrer.substr(referrer.indexOf('?') + 1); 22 | var qs_noanchor = qs.split('#')[0]; 23 | var qsa = qs_noanchor.split('&'); 24 | var keyword = ""; 25 | 26 | for (var i = 0; i < qsa.length; i++) { 27 | var currentParam = qsa[i].split('='); 28 | 29 | if (currentParam.length !== 2) { 30 | continue; 31 | } 32 | 33 | if (currentParam[0] == paramKey) { 34 | keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); 35 | } 36 | } 37 | 38 | if (keyword !== "") { 39 | $(".contents").unmark({ 40 | done: function() { 41 | $(".contents").mark(keyword); 42 | } 43 | }); 44 | } 45 | } 46 | }; 47 | 48 | mark(); 49 | }); 50 | }); 51 | 52 | /* Search term highlighting ------------------------------*/ 53 | 54 | function matchedWords(hit) { 55 | var words = []; 56 | 57 | var hierarchy = hit._highlightResult.hierarchy; 58 | // loop to fetch from lvl0, lvl1, etc. 59 | for (var idx in hierarchy) { 60 | words = words.concat(hierarchy[idx].matchedWords); 61 | } 62 | 63 | var content = hit._highlightResult.content; 64 | if (content) { 65 | words = words.concat(content.matchedWords); 66 | } 67 | 68 | // return unique words 69 | var words_uniq = [...new Set(words)]; 70 | return words_uniq; 71 | } 72 | 73 | function updateHitURL(hit) { 74 | 75 | var words = matchedWords(hit); 76 | var url = ""; 77 | 78 | if (hit.anchor) { 79 | url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; 80 | } else { 81 | url = hit.url + '?q=' + escape(words.join(" ")); 82 | } 83 | 84 | return url; 85 | } 86 | -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /docs/news/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Changelog • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
    62 |
    63 | 117 | 118 | 119 | 120 |
    121 | 122 |
    123 |
    124 | 128 | 129 |
    130 |

    131 | CDSeq 1.0.8

    132 |

    Bug fix. Add vignette.

    133 |
    134 |
    135 |

    136 | CDSeq 1.0.7

    137 |

    Bug fix. Add more features to cellTypeAssignSCRNA function.

    138 |
    139 |
    140 |

    141 | CDSeq 1.0.6

    142 |

    Add cellTypeAssignSCRNA function. This function can be used for cell type assignment using user provided single cell RNAseq data (with annotations).

    143 |
    144 |
    145 |

    146 | CDSeq 1.0.5

    147 |

    Add cellTypeAssignMarkerGenes function. This function can be used for cell type assignment using user provided marker gene list.

    148 |
    149 |
    150 | 151 | 156 | 157 |
    158 | 159 | 160 |
    161 | 164 | 165 |
    166 |

    Site built with pkgdown 1.6.1.

    167 |
    168 | 169 |
    170 |
    171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /docs/pkgdown.js: -------------------------------------------------------------------------------- 1 | /* http://gregfranko.com/blog/jquery-best-practices/ */ 2 | (function($) { 3 | $(function() { 4 | 5 | $('.navbar-fixed-top').headroom(); 6 | 7 | $('body').css('padding-top', $('.navbar').height() + 10); 8 | $(window).resize(function(){ 9 | $('body').css('padding-top', $('.navbar').height() + 10); 10 | }); 11 | 12 | $('[data-toggle="tooltip"]').tooltip(); 13 | 14 | var cur_path = paths(location.pathname); 15 | var links = $("#navbar ul li a"); 16 | var max_length = -1; 17 | var pos = -1; 18 | for (var i = 0; i < links.length; i++) { 19 | if (links[i].getAttribute("href") === "#") 20 | continue; 21 | // Ignore external links 22 | if (links[i].host !== location.host) 23 | continue; 24 | 25 | var nav_path = paths(links[i].pathname); 26 | 27 | var length = prefix_length(nav_path, cur_path); 28 | if (length > max_length) { 29 | max_length = length; 30 | pos = i; 31 | } 32 | } 33 | 34 | // Add class to parent
  • , and enclosing
  • if in dropdown 35 | if (pos >= 0) { 36 | var menu_anchor = $(links[pos]); 37 | menu_anchor.parent().addClass("active"); 38 | menu_anchor.closest("li.dropdown").addClass("active"); 39 | } 40 | }); 41 | 42 | function paths(pathname) { 43 | var pieces = pathname.split("/"); 44 | pieces.shift(); // always starts with / 45 | 46 | var end = pieces[pieces.length - 1]; 47 | if (end === "index.html" || end === "") 48 | pieces.pop(); 49 | return(pieces); 50 | } 51 | 52 | // Returns -1 if not found 53 | function prefix_length(needle, haystack) { 54 | if (needle.length > haystack.length) 55 | return(-1); 56 | 57 | // Special case for length-0 haystack, since for loop won't run 58 | if (haystack.length === 0) { 59 | return(needle.length === 0 ? 0 : -1); 60 | } 61 | 62 | for (var i = 0; i < haystack.length; i++) { 63 | if (needle[i] != haystack[i]) 64 | return(i); 65 | } 66 | 67 | return(haystack.length); 68 | } 69 | 70 | /* Clipboard --------------------------*/ 71 | 72 | function changeTooltipMessage(element, msg) { 73 | var tooltipOriginalTitle=element.getAttribute('data-original-title'); 74 | element.setAttribute('data-original-title', msg); 75 | $(element).tooltip('show'); 76 | element.setAttribute('data-original-title', tooltipOriginalTitle); 77 | } 78 | 79 | if(ClipboardJS.isSupported()) { 80 | $(document).ready(function() { 81 | var copyButton = ""; 82 | 83 | $(".examples, div.sourceCode").addClass("hasCopyButton"); 84 | 85 | // Insert copy buttons: 86 | $(copyButton).prependTo(".hasCopyButton"); 87 | 88 | // Initialize tooltips: 89 | $('.btn-copy-ex').tooltip({container: 'body'}); 90 | 91 | // Initialize clipboard: 92 | var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { 93 | text: function(trigger) { 94 | return trigger.parentNode.textContent; 95 | } 96 | }); 97 | 98 | clipboardBtnCopies.on('success', function(e) { 99 | changeTooltipMessage(e.trigger, 'Copied!'); 100 | e.clearSelection(); 101 | }); 102 | 103 | clipboardBtnCopies.on('error', function() { 104 | changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); 105 | }); 106 | }); 107 | } 108 | })(window.jQuery || window.$) 109 | -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 2.9.2.1 2 | pkgdown: 1.6.1 3 | pkgdown_sha: ~ 4 | articles: 5 | CDSeq-vignette: CDSeq-vignette.html 6 | last_built: 2021-01-25T15:31Z 7 | 8 | -------------------------------------------------------------------------------- /docs/reference/Rplot001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/reference/Rplot001.png -------------------------------------------------------------------------------- /docs/reference/cdseq.result.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Output of synthetic mixtures of PBMC scRNAseq data — cdseq.result • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    Output of synthetic mixtures of PBMC scRNAseq data

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Source

    142 | 143 |

    This is the CDSeq output of synthetic PBMC mixtures

    144 |

    Author

    145 | 146 |

    Kai Kang

    147 | 148 |
    149 | 154 |
    155 | 156 | 157 |
    158 | 161 | 162 |
    163 |

    Site built with pkgdown 1.6.1.

    164 |
    165 | 166 |
    167 |
    168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /docs/reference/figures/README-fig1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/reference/figures/README-fig1-1.png -------------------------------------------------------------------------------- /docs/reference/figures/README-fig2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/reference/figures/README-fig2-1.png -------------------------------------------------------------------------------- /docs/reference/figures/README-fig3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/reference/figures/README-fig3-1.png -------------------------------------------------------------------------------- /docs/reference/figures/README-fig4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/reference/figures/README-fig4-1.png -------------------------------------------------------------------------------- /docs/reference/figures/README-fig5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/reference/figures/README-fig5-1.png -------------------------------------------------------------------------------- /docs/reference/figures/README-pressure-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/docs/reference/figures/README-pressure-1.png -------------------------------------------------------------------------------- /docs/reference/gene_length.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Gene length — gene_length • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    Gene length

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric vector

    141 |

    Author

    142 | 143 |

    Kai Kang

    144 | 145 |
    146 | 151 |
    152 | 153 | 154 |
    155 | 158 | 159 |
    160 |

    Site built with pkgdown 1.6.1.

    161 |
    162 | 163 |
    164 |
    165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /docs/reference/refGEP.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | GEPs of six component pure cell lines — refGEP • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    GEPs of six component pure cell lines

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Author

    142 | 143 |

    Kai Kang

    144 | 145 |
    146 | 151 |
    152 | 153 | 154 |
    155 | 158 | 159 |
    160 |

    Site built with pkgdown 1.6.1.

    161 |
    162 | 163 |
    164 |
    165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /docs/reference/result1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | CDSeq result of synthetic bulk RNA-seq read counts data of six cell types — result1 • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    CDSeq result of synthetic bulk RNA-seq read counts data of six cell types

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Source

    142 | 143 |

    CDSeq-estimates of mixtureGEP

    144 |

    Author

    145 | 146 |

    Kai Kang

    147 | 148 |
    149 | 154 |
    155 | 156 | 157 |
    158 | 161 | 162 |
    163 |

    Site built with pkgdown 1.6.1.

    164 |
    165 | 166 |
    167 |
    168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /docs/reference/result2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | CDSeq result of synthetic bulk RNA-seq read counts data of six cell types — result2 • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    CDSeq result of synthetic bulk RNA-seq read counts data of six cell types

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Source

    142 | 143 |

    CDSeq estimates of mixtureGEP

    144 |

    Author

    145 | 146 |

    Kai Kang

    147 | 148 |
    149 | 154 |
    155 | 156 | 157 |
    158 | 161 | 162 |
    163 |

    Site built with pkgdown 1.6.1.

    164 |
    165 | 166 |
    167 |
    168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /docs/reference/sc_annotation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Cell type annotation of the PBMC single cell data — sc_annotation • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    Cell type annotation of the PBMC single cell data

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Source

    142 | 143 |

    We used the annotation provided by the single cell data

    144 |

    Author

    145 | 146 |

    Kai Kang

    147 | 148 |
    149 | 154 |
    155 | 156 | 157 |
    158 | 161 | 162 |
    163 |

    Site built with pkgdown 1.6.1.

    164 |
    165 | 166 |
    167 |
    168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /docs/reference/true_GEP_gene.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | True GEPs of the six component cell types normalized by gene length — true_GEP_gene • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    True GEPs of the six component cell types normalized by gene length

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Author

    142 | 143 |

    Kai Kang

    144 | 145 |
    146 | 151 |
    152 | 153 | 154 |
    155 | 158 | 159 |
    160 |

    Site built with pkgdown 1.6.1.

    161 |
    162 | 163 |
    164 |
    165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /docs/reference/true_GEP_read.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | True GEPs of the six component cell types unnormalized by gene length — true_GEP_read • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    True GEPs of the six component cell types unnormalized by gene length

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Author

    142 | 143 |

    Kai Kang

    144 | 145 |
    146 | 151 |
    152 | 153 | 154 |
    155 | 158 | 159 |
    160 |

    Site built with pkgdown 1.6.1.

    161 |
    162 | 163 |
    164 |
    165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /docs/reference/true_GEP_rpkm.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | True GEPs of the six component cell types RPKM normalization — true_GEP_rpkm • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    True GEPs of the six component cell types RPKM normalization

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Author

    142 | 143 |

    Kai Kang

    144 | 145 |
    146 | 151 |
    152 | 153 | 154 |
    155 | 158 | 159 |
    160 |

    Site built with pkgdown 1.6.1.

    161 |
    162 | 163 |
    164 |
    165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /docs/reference/true_prop.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | True cell type proportion in the PBMC synthetic mixtures — true_prop • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    True cell type proportion in the PBMC synthetic mixtures

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Source

    142 | 143 |

    randomly generated

    144 |

    Author

    145 | 146 |

    Kai Kang

    147 | 148 |
    149 | 154 |
    155 | 156 | 157 |
    158 | 161 | 162 |
    163 |

    Site built with pkgdown 1.6.1.

    164 |
    165 | 166 |
    167 |
    168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /docs/reference/true_prop_RNA.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | True cell type RNA proportions — true_prop_RNA • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    True cell type RNA proportions

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Source

    142 | 143 |

    randomly generated

    144 |

    Author

    145 | 146 |

    Kai Kang

    147 | 148 |
    149 | 154 |
    155 | 156 | 157 |
    158 | 161 | 162 |
    163 |

    Site built with pkgdown 1.6.1.

    164 |
    165 | 166 |
    167 |
    168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /docs/reference/true_prop_cell.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | True cell proportions of the mixtures — true_prop_cell • CDSeq 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 118 | 119 | 120 | 121 |
    122 | 123 |
    124 |
    125 | 130 | 131 |
    132 |

    True cell proportions of the mixtures

    133 |
    134 | 135 |
    data(SyntheticMixtureData)
    136 | 137 | 138 |

    Format

    139 | 140 |

    numeric matrix

    141 |

    Source

    142 | 143 |

    cell type proportions are randomly generated

    144 |

    Author

    145 | 146 |

    Kai Kang

    147 | 148 |
    149 | 154 |
    155 | 156 | 157 |
    158 | 161 | 162 |
    163 |

    Site built with pkgdown 1.6.1.

    164 |
    165 | 166 |
    167 |
    168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | citHeader("To cite CDSeq in publications, please use:") 2 | 3 | citEntry( 4 | entry = "Article", 5 | title = "CDSeq: A novel complete deconvolution method for dissecting heterogeneous samples using gene expression data", 6 | author = "Kang, Kai, Qian Meng, Igor Shats, David M. Umbach, Melissa Li, Yuanyuan Li, Xiaoling Li, and Leping Li", 7 | journal = "PLoS computational biology", 8 | year = "2019", 9 | volume = "15", 10 | number = "12", 11 | pages = "e1007510", 12 | url = "https://doi.org/10.1371/journal.pcbi.1007510", 13 | textVersion = paste("Kang, Kai, Qian Meng, Igor Shats, David M. Umbach, Melissa Li, Yuanyuan Li, Xiaoling Li, and Leping Li (2019)", 14 | "CDSeq: A novel complete deconvolution method for dissecting heterogeneous samples using gene expression data", 15 | "PLoS computational biology", 16 | "https://doi.org/10.1371/journal.pcbi.1007510" 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /man/CDSeq-R-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CDSeq-package.R 3 | \docType{package} 4 | \name{CDSeq-R-package} 5 | \alias{CDSeq-R-package} 6 | \title{CDSeq: A package for complete deconvolution using sequencing data} 7 | \description{ 8 | \code{CDSeq-R-package} takes bulk RNA-seq data as input and simultaneously returns estimates of both cell-type-specific gene expression profiles and sample-specific cell-type proportions. 9 | } 10 | \section{Reduce-Recover}{ 11 | 12 | CDSeq uses reduce-recovery strategy and CPU parallel computing to speed up the deconvolution. 13 | } 14 | 15 | \section{Hyperparameter estimation}{ 16 | 17 | Estimate hyperparameter for cell-type-specific GEPs (i.e. beta) using reference profile when cell_type_number is scalar. 18 | } 19 | 20 | \section{Estimating number of cell type}{ 21 | 22 | Estimate number of cell types when cell_type_number is a vector of integers. 23 | } 24 | 25 | \section{Partition on input bulk RNA-seq data}{ 26 | 27 | When block_number (number of partition on the bulk RNASeq data) is 1, whole bulk_data will be used. GEP is not from reduce-recovery. 28 | } 29 | 30 | \references{ 31 | \url{https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1007510} 32 | } 33 | \author{ 34 | Kai Kang, David Huang, \email{kangkai0714@gmail.com} 35 | } 36 | -------------------------------------------------------------------------------- /man/CDSeq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CDSeq.R 3 | \name{CDSeq} 4 | \alias{CDSeq} 5 | \title{Complete deconvolution using sequencing data.} 6 | \usage{ 7 | CDSeq( 8 | bulk_data, 9 | beta = 0.5, 10 | alpha = 5, 11 | cell_type_number = NULL, 12 | mcmc_iterations = 700, 13 | dilution_factor = 1, 14 | gene_subset_size = NULL, 15 | block_number = 1, 16 | cpu_number = NULL, 17 | gene_length = NULL, 18 | reference_gep = NULL, 19 | verbose = FALSE, 20 | print_progress_msg_to_file = 0 21 | ) 22 | } 23 | \arguments{ 24 | \item{bulk_data}{RNA-Seq read counts matrix. Columns represent samples and rows represent genes.} 25 | 26 | \item{beta}{beta is a scalar or a vector of length G where G is the number of genes; default value for beta is 0.5; When beta=Null, CDSeq uses reference_gep to estimate beta.} 27 | 28 | \item{alpha}{alpha is a scalar or a vector of length cell_type_number where cell_type_number is the number of cell type; default value for alpha is 5.} 29 | 30 | \item{cell_type_number}{number of cell types. cell_type_number can be an integer or a vector of different integers. To estimate the number of cell types, please provide a vector for cell_type_number, 31 | e.g. cell_type_number <- 2:30, then CDSeq will estimate the number of cell types.} 32 | 33 | \item{mcmc_iterations}{number of iterations for the Gibbs sampler; default value is 700.} 34 | 35 | \item{dilution_factor}{a scalar to dilute the read counts for speeding up; default value is 1. CDSeq will use bulk_data/dilution_factor.} 36 | 37 | \item{gene_subset_size}{number of genes randomly sampled for each block. Default is NULL.} 38 | 39 | \item{block_number}{number of blocks. Each block contains gene_subset_size genes. Default is 1.} 40 | 41 | \item{cpu_number}{number of cpu cores that can be used for parallel computing; 42 | Default is NULL and CDSeq will detect the available number of cores on the device and use number of all cores - 1 for parallel computing.} 43 | 44 | \item{gene_length}{a vector of the effective length (gene length - read length + 1) of each gene; Default is NULL.} 45 | 46 | \item{reference_gep}{a reference gene expression profile can be used to determine the cell type and/or estimate beta; Default is NULL.} 47 | 48 | \item{verbose}{if TRUE, then print progress message to the console. Default is FALSE.} 49 | 50 | \item{print_progress_msg_to_file}{print progress message to a text file. Set 1 if need to print progress msg to a file and set 0 if no printing. Default is 0;} 51 | } 52 | \value{ 53 | CDSeq returns estimates of both cell-type-specific gene expression profiles and sample-specific cell-type proportions. CDSeq will also return estimated number of cell types. 54 | and the log posterior values for different number of cell types. 55 | } 56 | \description{ 57 | \code{CDSeq} takes bulk RNA-seq data as input and simultaneously returns estimates of both cell-type-specific gene expression profiles and sample-specific cell-type proportions. 58 | } 59 | \examples{ 60 | result1<-CDSeq(bulk_data = mixtureGEP, cell_type_number = 6, mcmc_iterations = 5, 61 | dilution_factor = 50, block_number = 1, gene_length = as.vector(gene_length), 62 | reference_gep = refGEP, cpu_number=1, print_progress_msg_to_file=0) 63 | } 64 | -------------------------------------------------------------------------------- /man/Cell2RNA.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Cell2RNA.R 3 | \name{Cell2RNA} 4 | \alias{Cell2RNA} 5 | \title{Cell proportion to RNA proportion 6 | \code{Cell2RNA} converts Cell proportion to RNA proportion} 7 | \usage{ 8 | Cell2RNA(eta, cellprop) 9 | } 10 | \arguments{ 11 | \item{eta}{numeric vector represents the different amounts of RNA produced by different cell types} 12 | 13 | \item{cellprop}{sample-specific cell-type proportion} 14 | } 15 | \value{ 16 | Cell2RNA returns sample-specific cell-type RNA proportion 17 | } 18 | \description{ 19 | Cell proportion to RNA proportion 20 | \code{Cell2RNA} converts Cell proportion to RNA proportion 21 | } 22 | -------------------------------------------------------------------------------- /man/RNA2Cell.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RNA2Cell.R 3 | \name{RNA2Cell} 4 | \alias{RNA2Cell} 5 | \title{RNA proportion to cell proportion 6 | \code{RNA2Cell} converts RNA proportion to cell proportion} 7 | \usage{ 8 | RNA2Cell(eta, rnaprop) 9 | } 10 | \arguments{ 11 | \item{eta}{numeric vector represents the different amounts of RNA produced by different cell types} 12 | 13 | \item{rnaprop}{sample-specific cell-type RNA proportion} 14 | } 15 | \value{ 16 | RNA2Cell returns sample-specific cell-type proportion 17 | } 18 | \description{ 19 | RNA proportion to cell proportion 20 | \code{RNA2Cell} converts RNA proportion to cell proportion 21 | } 22 | -------------------------------------------------------------------------------- /man/SyntheticMixtureData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{SyntheticMixtureData} 5 | \alias{SyntheticMixtureData} 6 | \title{Synthetic bulk RNA-seq read counts data of six cell types, PBMC mixtures using scRNASeq and some preliminary results} 7 | \format{ 8 | A matrix of read counts data containing 40 synthetic mixtures with 500 genes 9 | } 10 | \source{ 11 | we downloaded the pure cell line RNA-seq data and generated the mixing proportions randomly and produced the mixtures 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | Synthetic bulk RNA-seq read counts data of six cell types, PBMC mixtures using scRNASeq and some preliminary results 18 | } 19 | \examples{ 20 | data(SyntheticMixtureData) 21 | } 22 | \author{ 23 | Kai Kang 24 | } 25 | -------------------------------------------------------------------------------- /man/cdseq.result.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cdseq_result_pbmcmix-data.R 3 | \docType{data} 4 | \name{cdseq.result} 5 | \alias{cdseq.result} 6 | \title{Output of synthetic mixtures of PBMC scRNAseq data} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | This is the CDSeq output of synthetic PBMC mixtures 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | Output of synthetic mixtures of PBMC scRNAseq data 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/figures/README-fig1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/man/figures/README-fig1-1.png -------------------------------------------------------------------------------- /man/figures/README-fig2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/man/figures/README-fig2-1.png -------------------------------------------------------------------------------- /man/figures/README-fig3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/man/figures/README-fig3-1.png -------------------------------------------------------------------------------- /man/figures/README-fig4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/man/figures/README-fig4-1.png -------------------------------------------------------------------------------- /man/figures/README-fig5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/man/figures/README-fig5-1.png -------------------------------------------------------------------------------- /man/gene2rpkm.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gene2rpkm.R 3 | \name{gene2rpkm} 4 | \alias{gene2rpkm} 5 | \title{gene2rpkm outputs the rpkm normalizations of the CDSeq-estimated GEPs. 6 | \code{gene2rpkm} outputs the rpkm normalizations of the CDSeq-estimated GEPs.} 7 | \usage{ 8 | gene2rpkm(gene_rate, gene_effective_length, cell_line_counts) 9 | } 10 | \arguments{ 11 | \item{gene_rate}{CDSeq-estimated GEP normalized by gene length.} 12 | 13 | \item{gene_effective_length}{gene effective length which is the gene length minus the read length plus one.} 14 | 15 | \item{cell_line_counts}{RNA-Seq read counts data of cell lines} 16 | } 17 | \value{ 18 | gene2rpkm returns rpkm normalization of the CDSeq-estimated GEPs. 19 | } 20 | \description{ 21 | gene2rpkm outputs the rpkm normalizations of the CDSeq-estimated GEPs. 22 | \code{gene2rpkm} outputs the rpkm normalizations of the CDSeq-estimated GEPs. 23 | } 24 | -------------------------------------------------------------------------------- /man/gene_length.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/geneLength-data.R 3 | \docType{data} 4 | \name{gene_length} 5 | \alias{gene_length} 6 | \title{Gene length} 7 | \format{ 8 | numeric vector 9 | } 10 | \usage{ 11 | data(SyntheticMixtureData) 12 | } 13 | \description{ 14 | Gene length 15 | } 16 | \author{ 17 | Kai Kang 18 | } 19 | -------------------------------------------------------------------------------- /man/gibbsSampler.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RcppExports.R 3 | \name{gibbsSampler} 4 | \alias{gibbsSampler} 5 | \title{This is the Gibbs sampler for CDSeq. 6 | \code{GibbsSampler} returns estimated GEPs and cell type proportions.} 7 | \usage{ 8 | gibbsSampler( 9 | ALPHA, 10 | BETA, 11 | mixtureSamples, 12 | T, 13 | NN, 14 | OUTPUT, 15 | processID, 16 | data_block_idx, 17 | CDSeq_tmp_log, 18 | write_2_file, 19 | verbose 20 | ) 21 | } 22 | \arguments{ 23 | \item{ALPHA}{hyperparameter for cell type proportion.} 24 | 25 | \item{BETA}{hyperparameter for cell-type-specific GEPs.} 26 | 27 | \item{mixtureSamples}{bulk RNA-seq data in form of read counts.} 28 | 29 | \item{T}{number of cell types.} 30 | 31 | \item{NN}{number of MCMC iteration.} 32 | 33 | \item{OUTPUT}{MCMC progress output control.} 34 | 35 | \item{processID}{worker process ID when using parallel computing.} 36 | 37 | \item{data_block_idx}{index for data blocks from bulk RNA-seq input.} 38 | 39 | \item{CDSeq_tmp_log}{temporary log file recording the workers' jobs.} 40 | 41 | \item{write_2_file}{print to progress msg to CDSeq_tmp_log if it is 1, not printing otherwise.} 42 | 43 | \item{verbose}{if greater than or euqal to 1, then print working progress in console, otherwise do not print in console.} 44 | } 45 | \value{ 46 | random integers uniformly distributed in 0..(2^32 - 1). 47 | } 48 | \description{ 49 | This is the Gibbs sampler for CDSeq. 50 | \code{GibbsSampler} returns estimated GEPs and cell type proportions. 51 | } 52 | -------------------------------------------------------------------------------- /man/hungarian_Rcpp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RcppExports.R 3 | \name{hungarian_Rcpp} 4 | \alias{hungarian_Rcpp} 5 | \title{This is the Hungarian algorithm wrapper for cell type assignment 6 | \code{hungarian_Rcpp} returns cell type assignment given reference GEPs} 7 | \usage{ 8 | hungarian_Rcpp(costMat) 9 | } 10 | \arguments{ 11 | \item{costMat}{correlation matrix} 12 | } 13 | \value{ 14 | cost for the assignment and cell type assignment 15 | } 16 | \description{ 17 | This is the Hungarian algorithm wrapper for cell type assignment 18 | \code{hungarian_Rcpp} returns cell type assignment given reference GEPs 19 | } 20 | -------------------------------------------------------------------------------- /man/intersection.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/intersection.R 3 | \name{intersection} 4 | \alias{intersection} 5 | \title{\code{intersection} take intersection of multiple lists and return the common set and index} 6 | \usage{ 7 | intersection(list.vector, order = "sort") 8 | } 9 | \arguments{ 10 | \item{list.vector}{this is a list of list contain all the data.} 11 | 12 | \item{order}{this is either sort or stable. If choose sort, the output common value will be sorted. If choose stable, the output common value will be in the same order as appear in the first element in list.vector.} 13 | } 14 | \value{ 15 | The common values among lists and their indices. 16 | intersection function: 17 | input: list.vector is a list of list contain all the data 18 | for example, if we need to find the common elements of a, b, c, then input should be list(a,b,c) 19 | } 20 | \description{ 21 | \code{intersection} take intersection of multiple lists and return the common set and index 22 | } 23 | -------------------------------------------------------------------------------- /man/logpost.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/logpost.R 3 | \name{logpost} 4 | \alias{logpost} 5 | \title{logpost computes the log posterior of the CDSeq model. 6 | \code{logpost} outputs the value of log posterior.} 7 | \usage{ 8 | logpost(estProp, estGEP, mydata, alpha, beta) 9 | } 10 | \arguments{ 11 | \item{estProp}{CDSeq-estimated cell type proportions.} 12 | 13 | \item{estGEP}{CDSeq-estimated cell-type-specific GEPs.} 14 | 15 | \item{mydata}{input bulk RNA-seq data.} 16 | 17 | \item{alpha}{hyperparameter for cell type proportion estimation.} 18 | 19 | \item{beta}{hyperparameter for cell-type-specific GEP estimation.} 20 | } 21 | \value{ 22 | logpost returns log posterior values. 23 | } 24 | \description{ 25 | logpost computes the log posterior of the CDSeq model. 26 | \code{logpost} outputs the value of log posterior. 27 | } 28 | -------------------------------------------------------------------------------- /man/max_rep.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/max_rep.R 3 | \name{max_rep} 4 | \alias{max_rep} 5 | \title{\code{max_rep} Find the element that repeats the most in a given vector and calculate its proportion.} 6 | \usage{ 7 | max_rep(v) 8 | } 9 | \arguments{ 10 | \item{v}{a vector} 11 | } 12 | \value{ 13 | max_rep_value contains two elements: max_element and max_element_proportion. max_element is the element that repeats the most in v, and max_element_proportion 14 | is its proportion. 15 | } 16 | \description{ 17 | \code{max_rep} Find the element that repeats the most in a given vector and calculate its proportion. 18 | } 19 | -------------------------------------------------------------------------------- /man/merge_df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pbmc_CDSeq_estprop-data.R 3 | \docType{data} 4 | \name{merge_df} 5 | \alias{merge_df} 6 | \title{Data frame for keeping the CDSeq-estimated cell type proportions for PBMC mixtures} 7 | \format{ 8 | data frame 9 | } 10 | \source{ 11 | CDSeq estimated cell type proportions for cell type number 3, 6, 9 and 12 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | Data frame for keeping the CDSeq-estimated cell type proportions for PBMC mixtures 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/mixtureGEP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mixtureGEP-data.R 3 | \docType{data} 4 | \name{mixtureGEP} 5 | \alias{mixtureGEP} 6 | \title{Synthetic bulk RNA-seq read counts data of six cell types} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | we downloaded the pure cell line RNA-seq data and generated the mixing proportions randomly and produced the mixtures 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | Synthetic bulk RNA-seq read counts data of six cell types 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/pbmc_ggplot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pbmc_ggplot-data.R 3 | \docType{data} 4 | \name{pbmc_ggplot} 5 | \alias{pbmc_ggplot} 6 | \title{ggplot figures of comparison between CDSeq-estimated cell type proportion and ground truth} 7 | \format{ 8 | ggplot object 9 | } 10 | \source{ 11 | CDseq-estimated cell type proportion and ground truth 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | ggplot figures of comparison between CDSeq-estimated cell type proportion and ground truth 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/pbmc_mix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pbmc_mix-data.R 3 | \docType{data} 4 | \name{pbmc_mix} 5 | \alias{pbmc_mix} 6 | \title{Synthetic bulk RNA-seq read counts data of PBMC single cell data} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | we downloaded the PBMC scRNAseq and generated the mixing proportions randomly and produced the mixtures 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | Synthetic bulk RNA-seq read counts data of PBMC single cell data 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/read2gene.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/read2gene.R 3 | \name{read2gene} 4 | \alias{read2gene} 5 | \title{read2gene outputs the GEP normalized by gene length of the CDSeq-estimated GEPs. 6 | \code{read2gene} outputs the gene length normalized CDSeq-estimated GEP.} 7 | \usage{ 8 | read2gene(read_rate, gene_effective_length) 9 | } 10 | \arguments{ 11 | \item{read_rate}{CDSeq-estimated GEP before normalized by gene length.} 12 | 13 | \item{gene_effective_length}{gene effective length which is the gene length minus the read length plus one.} 14 | } 15 | \value{ 16 | read2gene returns gene length normalized CDSeq-estimated GEPs. 17 | } 18 | \description{ 19 | read2gene outputs the GEP normalized by gene length of the CDSeq-estimated GEPs. 20 | \code{read2gene} outputs the gene length normalized CDSeq-estimated GEP. 21 | } 22 | -------------------------------------------------------------------------------- /man/refGEP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/refGEP-data.R 3 | \docType{data} 4 | \name{refGEP} 5 | \alias{refGEP} 6 | \title{GEPs of six component pure cell lines} 7 | \format{ 8 | numeric matrix 9 | } 10 | \usage{ 11 | data(SyntheticMixtureData) 12 | } 13 | \description{ 14 | GEPs of six component pure cell lines 15 | } 16 | \author{ 17 | Kai Kang 18 | } 19 | -------------------------------------------------------------------------------- /man/result1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cdseq_result1-data.R 3 | \docType{data} 4 | \name{result1} 5 | \alias{result1} 6 | \title{CDSeq result of synthetic bulk RNA-seq read counts data of six cell types} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | CDSeq-estimates of mixtureGEP 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | CDSeq result of synthetic bulk RNA-seq read counts data of six cell types 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/result2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cdseq_result2-data.R 3 | \docType{data} 4 | \name{result2} 5 | \alias{result2} 6 | \title{CDSeq result of synthetic bulk RNA-seq read counts data of six cell types} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | CDSeq estimates of mixtureGEP 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | CDSeq result of synthetic bulk RNA-seq read counts data of six cell types 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/result3.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cdseq_result3-data.R 3 | \docType{data} 4 | \name{result3} 5 | \alias{result3} 6 | \title{CDSeq result of synthetic bulk RNA-seq read counts data of six cell types} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | CDSeq estimates of mixtureGEP 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | CDSeq result of synthetic bulk RNA-seq read counts data of six cell types 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/sc_annotation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sc_annotation-data.R 3 | \docType{data} 4 | \name{sc_annotation} 5 | \alias{sc_annotation} 6 | \title{Cell type annotation of the PBMC single cell data} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | We used the annotation provided by the single cell data 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | Cell type annotation of the PBMC single cell data 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/sc_gep.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sc_gep-data.R 3 | \docType{data} 4 | \name{sc_gep} 5 | \alias{sc_gep} 6 | \title{PBMC single cell RNAseq read counts that used for creating synthetic PBMC mixtures} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | we downloaded the PBMC RNA-seq data and generated the mixing proportions randomly and produced the mixtures 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | PBMC single cell RNAseq read counts that used for creating synthetic PBMC mixtures 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/seedMT.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RcppExports.R 3 | \name{seedMT} 4 | \alias{seedMT} 5 | \title{This is the Mersenne Twister random number generator. 6 | \code{cokus} generates pseudorandom integers uniformly distributed in 0..(2^32 - 1).} 7 | \usage{ 8 | seedMT(seed) 9 | } 10 | \arguments{ 11 | \item{seed}{odd number for seeding} 12 | } 13 | \value{ 14 | random integers uniformly distributed in 0..(2^32 - 1). 15 | } 16 | \description{ 17 | This is the Mersenne Twister random number generator. 18 | \code{cokus} generates pseudorandom integers uniformly distributed in 0..(2^32 - 1). 19 | } 20 | \author{ 21 | Shawn Cokus (Cokus@math.washington.edu) 22 | } 23 | -------------------------------------------------------------------------------- /man/true_GEP_gene.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/trueGEPgene-data.R 3 | \docType{data} 4 | \name{true_GEP_gene} 5 | \alias{true_GEP_gene} 6 | \title{True GEPs of the six component cell types normalized by gene length} 7 | \format{ 8 | numeric matrix 9 | } 10 | \usage{ 11 | data(SyntheticMixtureData) 12 | } 13 | \description{ 14 | True GEPs of the six component cell types normalized by gene length 15 | } 16 | \author{ 17 | Kai Kang 18 | } 19 | -------------------------------------------------------------------------------- /man/true_GEP_read.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/trueGEPread-data.R 3 | \docType{data} 4 | \name{true_GEP_read} 5 | \alias{true_GEP_read} 6 | \title{True GEPs of the six component cell types unnormalized by gene length} 7 | \format{ 8 | numeric matrix 9 | } 10 | \usage{ 11 | data(SyntheticMixtureData) 12 | } 13 | \description{ 14 | True GEPs of the six component cell types unnormalized by gene length 15 | } 16 | \author{ 17 | Kai Kang 18 | } 19 | -------------------------------------------------------------------------------- /man/true_GEP_rpkm.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/trueGEPrpkm-data.R 3 | \docType{data} 4 | \name{true_GEP_rpkm} 5 | \alias{true_GEP_rpkm} 6 | \title{True GEPs of the six component cell types RPKM normalization} 7 | \format{ 8 | numeric matrix 9 | } 10 | \usage{ 11 | data(SyntheticMixtureData) 12 | } 13 | \description{ 14 | True GEPs of the six component cell types RPKM normalization 15 | } 16 | \author{ 17 | Kai Kang 18 | } 19 | -------------------------------------------------------------------------------- /man/true_prop.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pbmc_true_prop-data.R 3 | \docType{data} 4 | \name{true_prop} 5 | \alias{true_prop} 6 | \title{True cell type proportion in the PBMC synthetic mixtures} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | randomly generated 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | True cell type proportion in the PBMC synthetic mixtures 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/true_prop_RNA.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cellTypeRNAProp-data.R 3 | \docType{data} 4 | \name{true_prop_RNA} 5 | \alias{true_prop_RNA} 6 | \title{True cell type RNA proportions} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | randomly generated 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | True cell type RNA proportions 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /man/true_prop_cell.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cellTypeProp-data.R 3 | \docType{data} 4 | \name{true_prop_cell} 5 | \alias{true_prop_cell} 6 | \title{True cell proportions of the mixtures} 7 | \format{ 8 | numeric matrix 9 | } 10 | \source{ 11 | cell type proportions are randomly generated 12 | } 13 | \usage{ 14 | data(SyntheticMixtureData) 15 | } 16 | \description{ 17 | True cell proportions of the mixtures 18 | } 19 | \author{ 20 | Kai Kang 21 | } 22 | -------------------------------------------------------------------------------- /src/CDSeq.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/src/CDSeq.so -------------------------------------------------------------------------------- /src/CDSeq_types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long uint32; 2 | #if (__cplusplus - 0) >= 201703L 3 | #define __REGISTER 4 | #else 5 | #define __REGISTER register 6 | #endif 7 | -------------------------------------------------------------------------------- /src/GibbsSampler.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/src/GibbsSampler.o -------------------------------------------------------------------------------- /src/Hungarian.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Hungarian.h: Header file for Class HungarianAlgorithm. 3 | // 4 | // This is a C++ wrapper with slight modification of a hungarian algorithm implementation by Markus Buehren. 5 | // The original implementation is a few mex-functions for use in MATLAB, found here: 6 | // http://www.mathworks.com/matlabcentral/fileexchange/6543-functions-for-the-rectangular-assignment-problem 7 | // 8 | // Both this code and the orignal code are published under the BSD license. 9 | // by Cong Ma, 2016 10 | // 11 | 12 | #ifndef HUNGARIAN_H 13 | #define HUNGARIAN_H 14 | 15 | #include 16 | #include 17 | 18 | using namespace std; 19 | 20 | 21 | class HungarianAlgorithm 22 | { 23 | public: 24 | HungarianAlgorithm(); 25 | ~HungarianAlgorithm(); 26 | double Solve(vector >& DistMatrix, vector& Assignment); 27 | 28 | private: 29 | void assignmentoptimal(int *assignment, double *cost, double *distMatrix, int nOfRows, int nOfColumns); 30 | void buildassignmentvector(int *assignment, bool *starMatrix, int nOfRows, int nOfColumns); 31 | void computeassignmentcost(int *assignment, double *cost, double *distMatrix, int nOfRows); 32 | void step2a(int *assignment, double *distMatrix, bool *starMatrix, bool *newStarMatrix, bool *primeMatrix, bool *coveredColumns, bool *coveredRows, int nOfRows, int nOfColumns, int minDim); 33 | void step2b(int *assignment, double *distMatrix, bool *starMatrix, bool *newStarMatrix, bool *primeMatrix, bool *coveredColumns, bool *coveredRows, int nOfRows, int nOfColumns, int minDim); 34 | void step3(int *assignment, double *distMatrix, bool *starMatrix, bool *newStarMatrix, bool *primeMatrix, bool *coveredColumns, bool *coveredRows, int nOfRows, int nOfColumns, int minDim); 35 | void step4(int *assignment, double *distMatrix, bool *starMatrix, bool *newStarMatrix, bool *primeMatrix, bool *coveredColumns, bool *coveredRows, int nOfRows, int nOfColumns, int minDim, int row, int col); 36 | void step5(int *assignment, double *distMatrix, bool *starMatrix, bool *newStarMatrix, bool *primeMatrix, bool *coveredColumns, bool *coveredRows, int nOfRows, int nOfColumns, int minDim); 37 | }; 38 | 39 | 40 | #endif -------------------------------------------------------------------------------- /src/Hungarian.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/src/Hungarian.o -------------------------------------------------------------------------------- /src/Makevars: -------------------------------------------------------------------------------- 1 | 2 | ## With R 3.1.0 or later, you can uncomment the following line to tell R to 3 | ## enable compilation with C++11 (where available) 4 | ## 5 | ## Also, OpenMP support in Armadillo prefers C++11 support. However, for wider 6 | ## availability of the package we do not yet enforce this here. It is however 7 | ## recommended for client packages to set it. 8 | ## 9 | ## And with R 3.4.0, and RcppArmadillo 0.7.960.*, we turn C++11 on as OpenMP 10 | ## support within Armadillo prefers / requires it 11 | CXX_STD = CXX11 12 | 13 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) 14 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 15 | -------------------------------------------------------------------------------- /src/Makevars.win: -------------------------------------------------------------------------------- 1 | 2 | ## With R 3.1.0 or later, you can uncomment the following line to tell R to 3 | ## enable compilation with C++11 (where available) 4 | ## 5 | ## Also, OpenMP support in Armadillo prefers C++11 support. However, for wider 6 | ## availability of the package we do not yet enforce this here. It is however 7 | ## recommended for client packages to set it. 8 | ## 9 | ## And with R 3.4.0, and RcppArmadillo 0.7.960.*, we turn C++11 on as OpenMP 10 | ## support within Armadillo prefers / requires it 11 | CXX_STD = CXX11 12 | 13 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) 14 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 15 | -------------------------------------------------------------------------------- /src/RcppExports.cpp: -------------------------------------------------------------------------------- 1 | // Generated by using Rcpp::compileAttributes() -> do not edit by hand 2 | // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 3 | 4 | #include "CDSeq_types.h" 5 | #include 6 | #include 7 | 8 | using namespace Rcpp; 9 | 10 | // gibbsSampler 11 | List gibbsSampler(double ALPHA, std::vector BETA, NumericMatrix mixtureSamples, int T, int NN, int OUTPUT, int processID, int data_block_idx, std::string CDSeq_tmp_log, int write_2_file, int verbose); 12 | RcppExport SEXP _CDSeq_gibbsSampler(SEXP ALPHASEXP, SEXP BETASEXP, SEXP mixtureSamplesSEXP, SEXP TSEXP, SEXP NNSEXP, SEXP OUTPUTSEXP, SEXP processIDSEXP, SEXP data_block_idxSEXP, SEXP CDSeq_tmp_logSEXP, SEXP write_2_fileSEXP, SEXP verboseSEXP) { 13 | BEGIN_RCPP 14 | Rcpp::RObject rcpp_result_gen; 15 | Rcpp::RNGScope rcpp_rngScope_gen; 16 | Rcpp::traits::input_parameter< double >::type ALPHA(ALPHASEXP); 17 | Rcpp::traits::input_parameter< std::vector >::type BETA(BETASEXP); 18 | Rcpp::traits::input_parameter< NumericMatrix >::type mixtureSamples(mixtureSamplesSEXP); 19 | Rcpp::traits::input_parameter< int >::type T(TSEXP); 20 | Rcpp::traits::input_parameter< int >::type NN(NNSEXP); 21 | Rcpp::traits::input_parameter< int >::type OUTPUT(OUTPUTSEXP); 22 | Rcpp::traits::input_parameter< int >::type processID(processIDSEXP); 23 | Rcpp::traits::input_parameter< int >::type data_block_idx(data_block_idxSEXP); 24 | Rcpp::traits::input_parameter< std::string >::type CDSeq_tmp_log(CDSeq_tmp_logSEXP); 25 | Rcpp::traits::input_parameter< int >::type write_2_file(write_2_fileSEXP); 26 | Rcpp::traits::input_parameter< int >::type verbose(verboseSEXP); 27 | rcpp_result_gen = Rcpp::wrap(gibbsSampler(ALPHA, BETA, mixtureSamples, T, NN, OUTPUT, processID, data_block_idx, CDSeq_tmp_log, write_2_file, verbose)); 28 | return rcpp_result_gen; 29 | END_RCPP 30 | } 31 | // seedMT 32 | void seedMT(uint32 seed); 33 | RcppExport SEXP _CDSeq_seedMT(SEXP seedSEXP) { 34 | BEGIN_RCPP 35 | Rcpp::RNGScope rcpp_rngScope_gen; 36 | Rcpp::traits::input_parameter< uint32 >::type seed(seedSEXP); 37 | seedMT(seed); 38 | return R_NilValue; 39 | END_RCPP 40 | } 41 | // randomMT 42 | uint32 randomMT(); 43 | RcppExport SEXP _CDSeq_randomMT() { 44 | BEGIN_RCPP 45 | Rcpp::RObject rcpp_result_gen; 46 | Rcpp::RNGScope rcpp_rngScope_gen; 47 | rcpp_result_gen = Rcpp::wrap(randomMT()); 48 | return rcpp_result_gen; 49 | END_RCPP 50 | } 51 | // hungarian_Rcpp 52 | List hungarian_Rcpp(NumericMatrix costMat); 53 | RcppExport SEXP _CDSeq_hungarian_Rcpp(SEXP costMatSEXP) { 54 | BEGIN_RCPP 55 | Rcpp::RObject rcpp_result_gen; 56 | Rcpp::RNGScope rcpp_rngScope_gen; 57 | Rcpp::traits::input_parameter< NumericMatrix >::type costMat(costMatSEXP); 58 | rcpp_result_gen = Rcpp::wrap(hungarian_Rcpp(costMat)); 59 | return rcpp_result_gen; 60 | END_RCPP 61 | } 62 | 63 | static const R_CallMethodDef CallEntries[] = { 64 | {"_CDSeq_gibbsSampler", (DL_FUNC) &_CDSeq_gibbsSampler, 11}, 65 | {"_CDSeq_seedMT", (DL_FUNC) &_CDSeq_seedMT, 1}, 66 | {"_CDSeq_randomMT", (DL_FUNC) &_CDSeq_randomMT, 0}, 67 | {"_CDSeq_hungarian_Rcpp", (DL_FUNC) &_CDSeq_hungarian_Rcpp, 1}, 68 | {NULL, NULL, 0} 69 | }; 70 | 71 | RcppExport void R_init_CDSeq(DllInfo *dll) { 72 | R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); 73 | R_useDynamicSymbols(dll, FALSE); 74 | } 75 | -------------------------------------------------------------------------------- /src/RcppExports.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/src/RcppExports.o -------------------------------------------------------------------------------- /src/cokus.h: -------------------------------------------------------------------------------- 1 | #ifndef COKUS_H 2 | #define COKUS_H 3 | 4 | typedef unsigned long uint32; 5 | 6 | #if (__cplusplus - 0) >= 201703L 7 | #define __REGISTER 8 | #else 9 | #define __REGISTER register 10 | #endif 11 | 12 | void seedMT(uint32 seed); 13 | uint32 randomMT(); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/cokus.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/src/cokus.o -------------------------------------------------------------------------------- /src/hungarian_Rcpp.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Hungarian.h" 3 | 4 | using namespace std; 5 | using namespace Rcpp; 6 | //' This is the Hungarian algorithm wrapper for cell type assignment 7 | //' \code{hungarian_Rcpp} returns cell type assignment given reference GEPs 8 | //' @param costMat correlation matrix 9 | //' @return cost for the assignment and cell type assignment 10 | // [[Rcpp::export]] 11 | List hungarian_Rcpp(NumericMatrix costMat) { 12 | int nrows=costMat.rows(), ncols=costMat.cols(); 13 | int i,j; 14 | 15 | vector< vector > costMatrix; 16 | // the following step is critical to make it work 17 | costMatrix.resize(nrows, vector(ncols, 0)); 18 | 19 | for(i=0;i assignment; 30 | 31 | double cost = HungAlgo.Solve(costMatrix, assignment); 32 | 33 | //for (int x = 0; x < costMatrix.size(); x++) 34 | // Rprintf("%d,%f\t",x,assignment[x]); 35 | //std::cout << x << "," << assignment[x] << "\t"; 36 | 37 | //std::cout << "\ncost: " << cost << std::endl; 38 | //Rprintf("\ncost:%f\n",cost); 39 | 40 | List result; 41 | result["cost"] = cost; 42 | result["cost_assignment"] = assignment; 43 | return result; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/hungarian_Rcpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkang7/CDSeq_R_Package/8232fdc5d028b5eaf293364ca8db60c63bfd002f/src/hungarian_Rcpp.o -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(CDSeq) 3 | 4 | test_check("CDSeq") 5 | -------------------------------------------------------------------------------- /tests/testthat/test-CDSeq.R: -------------------------------------------------------------------------------- 1 | 2 | result1<-CDSeq(bulk_data = mixtureGEP, cell_type_number = 6, mcmc_iterations = 5, 3 | dilution_factor = 50, block_number = 1, gene_length = as.vector(gene_length), 4 | reference_gep = refGEP, cpu_number=1, print_progress_msg_to_file=0) 5 | 6 | test_that("GEP and proportion estimates are returned", { 7 | expect_true("estGEP" %in% names(result1)) 8 | expect_true("estProp" %in% names(result1)) 9 | }) 10 | #> Test passed 11 | 12 | test_that("GEP and proportion are in the right dimension", { 13 | expect_equal(nrow(result1[["estGEP"]]), nrow(mixtureGEP)) 14 | expect_equal(ncol(result1[["estGEP"]]),6) 15 | expect_equal(nrow(result1[["estProp"]]),6) 16 | expect_equal(ncol(result1[["estProp"]]), ncol(mixtureGEP)) 17 | }) 18 | #> Test passed 19 | 20 | result2<-CDSeq(bulk_data = mixtureGEP, cell_type_number = 2:3, mcmc_iterations = 5, 21 | dilution_factor = 50, block_number = 1, gene_length = as.vector(gene_length), 22 | reference_gep = refGEP, cpu_number=1, print_progress_msg_to_file=0) 23 | 24 | test_that("Check est_all are returned when cell_type_number is a vector", { 25 | expect_true("est_all" %in% names(result2)) 26 | }) 27 | #> Test passed -------------------------------------------------------------------------------- /tests/testthat/test-cellTypeAssignSCRNA.R: -------------------------------------------------------------------------------- 1 | cdseq.result <- CDSeq::CDSeq(bulk_data = pbmc_mix, 2 | cell_type_number = 3, 3 | mcmc_iterations = 5, 4 | cpu_number = 1, 5 | gene_length = rep(1,100), 6 | dilution_factor = 50, 7 | reference_gep = sc_gep) 8 | 9 | cdseq.result.celltypeassign <- cellTypeAssignSCRNA(cdseq_gep = cdseq.result$estGEP, # CDSeq-estimated cell-type-specific GEPs 10 | cdseq_prop = cdseq.result$estProp, # CDSeq-estimated cell type proportions 11 | sc_gep = sc_gep, # PBMC single cell data 12 | sc_annotation = sc_annotation,# PBMC single data annotations 13 | sc_pt_size = 3, 14 | cdseq_pt_size = 6, 15 | seurat_nfeatures = 10, 16 | seurat_npcs = 3, 17 | seurat_dims=1:3, 18 | plot_umap = 0, 19 | plot_tsne = 0) 20 | 21 | test_that("GEP and proportion assignments are returned", { 22 | expect_true("CDSeq_cell_type_assignment_df" %in% names(cdseq.result.celltypeassign)) 23 | expect_true("cdseq_prop_merged" %in% names(cdseq.result.celltypeassign)) 24 | }) 25 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | --------------------------------------------------------------------------------