├── DESCRIPTION ├── LICENSE ├── Makefile ├── NAMESPACE ├── R ├── analysis.r ├── class_gene_bc_matrix.r ├── constants.r ├── data.r ├── help.r ├── io.r ├── normalize.r ├── plot.r └── util.r ├── README.md ├── data ├── gbm1.rda └── gbm2.rda ├── inst └── extdata │ ├── test_pipestance │ ├── lone_matrix.mtx │ └── outs │ │ ├── analysis │ │ ├── kmeans │ │ │ ├── 10_clusters │ │ │ │ └── clusters.csv │ │ │ ├── 2_clusters │ │ │ │ └── clusters.csv │ │ │ ├── 3_clusters │ │ │ │ └── clusters.csv │ │ │ ├── 4_clusters │ │ │ │ └── clusters.csv │ │ │ ├── 5_clusters │ │ │ │ └── clusters.csv │ │ │ ├── 6_clusters │ │ │ │ └── clusters.csv │ │ │ ├── 7_clusters │ │ │ │ └── clusters.csv │ │ │ ├── 8_clusters │ │ │ │ └── clusters.csv │ │ │ └── 9_clusters │ │ │ │ └── clusters.csv │ │ ├── pca │ │ │ └── projection.csv │ │ └── tsne │ │ │ └── projection.csv │ │ ├── filtered_gene_bc_matrices │ │ └── hg19 │ │ │ ├── barcodes.tsv │ │ │ ├── genes.tsv │ │ │ └── matrix.mtx │ │ └── metrics_summary.csv │ ├── test_pipestance_cr130 │ └── outs │ │ ├── analysis │ │ ├── clustering │ │ │ ├── graphclust │ │ │ │ └── clusters.csv │ │ │ ├── kmeans_10_clusters │ │ │ │ └── clusters.csv │ │ │ ├── kmeans_2_clusters │ │ │ │ └── clusters.csv │ │ │ ├── kmeans_3_clusters │ │ │ │ └── clusters.csv │ │ │ ├── kmeans_4_clusters │ │ │ │ └── clusters.csv │ │ │ ├── kmeans_5_clusters │ │ │ │ └── clusters.csv │ │ │ ├── kmeans_6_clusters │ │ │ │ └── clusters.csv │ │ │ ├── kmeans_7_clusters │ │ │ │ └── clusters.csv │ │ │ ├── kmeans_8_clusters │ │ │ │ └── clusters.csv │ │ │ └── kmeans_9_clusters │ │ │ │ └── clusters.csv │ │ ├── diffexp │ │ │ ├── graphclust │ │ │ │ └── differential_expression.csv │ │ │ └── kmeans_2_clusters │ │ │ │ └── differential_expression.csv │ │ ├── pca │ │ │ └── 10_components │ │ │ │ ├── components.csv │ │ │ │ ├── dispersion.csv │ │ │ │ ├── genes_selected.csv │ │ │ │ ├── projection.csv │ │ │ │ └── variance.csv │ │ └── tsne │ │ │ └── 2_components │ │ │ └── projection.csv │ │ ├── filtered_gene_bc_matrices │ │ └── GRCh38 │ │ │ ├── barcodes.tsv │ │ │ ├── genes.tsv │ │ │ └── matrix.mtx │ │ ├── filtered_gene_bc_matrices_h5.h5 │ │ ├── metrics_summary.csv │ │ └── molecule_info.h5 │ ├── test_pipestance_h5 │ └── outs │ │ └── filtered_gene_bc_matrices_h5.h5 │ └── test_subsample │ └── outs │ ├── filtered_gene_bc_matrices │ └── hg19 │ │ ├── barcodes.tsv │ │ ├── genes.tsv │ │ └── matrix.mtx │ ├── metrics_summary.csv │ └── molecule_info.h5 ├── man ├── Arith-GeneBCMatrix-GeneBCMatrix-method.Rd ├── Arith-GeneBCMatrix-logical-method.Rd ├── Arith-GeneBCMatrix-numeric-method.Rd ├── Arith-logical-GeneBCMatrix-method.Rd ├── Arith-numeric-GeneBCMatrix-method.Rd ├── Compare-GeneBCMatrix-GeneBCMatrix-method.Rd ├── Compare-GeneBCMatrix-logical-method.Rd ├── Compare-GeneBCMatrix-numeric-method.Rd ├── Compare-logical-GeneBCMatrix-method.Rd ├── Compare-numeric-GeneBCMatrix-method.Rd ├── GeneBCMatrix-class.Rd ├── GeneBCMatrix-missing-method.Rd ├── Logic-GeneBCMatrix-GeneBCMatrix-method.Rd ├── Logic-GeneBCMatrix-logical-method.Rd ├── Logic-GeneBCMatrix-numeric-method.Rd ├── Logic-logical-GeneBCMatrix-method.Rd ├── Logic-numeric-GeneBCMatrix-method.Rd ├── Math-GeneBCMatrix-method.Rd ├── Math2-GeneBCMatrix-method.Rd ├── Summary-GeneBCMatrix-method.Rd ├── binary_op.Rd ├── binary_op_left.Rd ├── binary_op_right.Rd ├── bind-variables-to-fix-data.table-errors-when-packaging.Rd ├── cell_composition.Rd ├── cellrangerRkit.Rd ├── check_irlba.Rd ├── colMeans-GeneBCMatrix-method.Rd ├── colSums-GeneBCMatrix-method.Rd ├── compress_sequences.Rd ├── compute_sseq_params.Rd ├── concatenate_gene_bc_matrices.Rd ├── constants.Rd ├── csv_value_to_numeric.Rd ├── dim-GeneBCMatrix-method.Rd ├── dimnames-GeneBCMatrix-method.Rd ├── directory.exists.Rd ├── download_file_and_check.Rd ├── download_sample.Rd ├── equalize_gbms.Rd ├── format_barcode_string.Rd ├── gbm1.Rd ├── gbm2.Rd ├── gbm_pheatmap.Rd ├── get_barcode_sequence.Rd ├── get_clustering_path.Rd ├── get_correletion_scores.Rd ├── get_custom_col.Rd ├── get_gem_group.Rd ├── get_gene_dispersion.Rd ├── get_gene_index.Rd ├── get_genome_in_matrix_path.Rd ├── get_genomes_in_matrix_dir.Rd ├── get_matrix_dir_path.Rd ├── get_matrix_from_h5.Rd ├── get_matrix_path.Rd ├── get_mean_mapped_reads_per_cell.Rd ├── get_mean_raw_reads_per_cell.Rd ├── get_metric.Rd ├── get_nonzero_genes.Rd ├── get_ordered_gene_list_mean_diff.Rd ├── get_ordered_gene_list_sseq.Rd ├── get_ordered_gene_list_unique.Rd ├── get_pca_path.Rd ├── get_read_count_mtx.Rd ├── get_summary_csv_path.Rd ├── get_tsne_path.Rd ├── load_analysis_results_from_path.Rd ├── load_cellranger_analysis_results.Rd ├── load_cellranger_matrix.Rd ├── load_cellranger_matrix_from_files.Rd ├── load_cellranger_matrix_h5.Rd ├── load_cellranger_summary.Rd ├── load_molecule_info.Rd ├── load_molecule_info_from_path.Rd ├── log_gene_bc_matrix.Rd ├── merge_clusters.Rd ├── nb_exact_test.Rd ├── ncol-GeneBCMatrix-method.Rd ├── newGeneBCMatrix.Rd ├── normalize_barcode_sums_to_median.Rd ├── nrow-GeneBCMatrix-method.Rd ├── order_cell_by_clusters.Rd ├── plot_barcode_counts.Rd ├── plot_population_corr.Rd ├── plus-GeneBCMatrix-missing-method.Rd ├── prioritize_genes.Rd ├── prioritize_top_genes.Rd ├── rowMeans-GeneBCMatrix-method.Rd ├── rowSums-GeneBCMatrix-method.Rd ├── run_differential_expression.Rd ├── run_kmeans_clustering.Rd ├── run_pca.Rd ├── run_tsne.Rd ├── save_cellranger_matrix_h5.Rd ├── select_cells_by_clusterID.Rd ├── select_clusters_by_gene_markers.Rd ├── sparse_pca.Rd ├── sseq_differential_expression.Rd ├── subsample_gene_bc_matrix.Rd ├── train_multinomial.Rd ├── trunc_gbm_by_genes.Rd ├── unary_arith_op.Rd ├── unary_op.Rd ├── visualize_clusters.Rd ├── visualize_gene_markers.Rd ├── visualize_umi_counts.Rd ├── visualize_variable_genes.Rd └── write_cluster_specific_genes.Rd ├── scripts ├── download_samples.R ├── rkit-install-1.1.0.R ├── rkit-install-2.0.0.R ├── run_knitr.R └── saved_variables.R ├── tests ├── testthat.R └── testthat │ ├── Rplots.pdf │ ├── test_concat.r │ ├── test_de.r │ ├── test_kmeans.r │ ├── test_load.r │ ├── test_normalize.r │ ├── test_pca.r │ ├── test_plots.r │ ├── test_save.r │ ├── test_subsample.r │ ├── test_tsne.r │ └── test_util.r └── vignettes ├── Rplots.pdf ├── cellrangerrkit-PBMC-vignette-knitr.Rnw ├── cellrangerrkit-PBMC-vignette-knitr.aux ├── cellrangerrkit-PBMC-vignette-knitr.log ├── cellrangerrkit-PBMC-vignette-knitr.out ├── cellrangerrkit-PBMC-vignette-knitr.pdf ├── cellrangerrkit-PBMC-vignette-knitr.tex ├── cellrangerrkit-PBMC-vignette-knitr.toc ├── cellrangerrkit-PBMC-vignette.Rnw ├── cellrangerrkit-PBMC-vignette.tex ├── figure ├── heatmap-1.pdf ├── kmeans-1.pdf ├── kmeans5-1.pdf ├── markers-1.pdf ├── plot_tsne_batch-1.pdf └── umi-1.pdf ├── framed.sty └── whbiocvignette.sty /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: cellrangerRkit 2 | Title: Analysis Tools for 10x Genomics Chromium Single-Cell RNA-seq 3 | Version: 2.0.0 4 | Author: 10x Genomics 5 | Maintainer: 10x Genomics 6 | Description: Provides tools for exploring the data output of 10x Genomics' 7 | Single Cell RNA-seq product. 8 | License: AGPL 9 | URL: http://software.10xgenomics.com/docs/license, http://software. 10 | 10xgenomics.com/single-cell/pipelines/latest/rkit 11 | biocViews: DataImport, Clustering, GeneExpression, RNASeq, Sequencing, 12 | Software, Visualization 13 | LazyData: true 14 | Depends: R (>= 3.1), Matrix (>= 1.2), Biobase, RColorBrewer, ggplot2, 15 | bit64, Rmisc 16 | Imports: rhdf5 (>= 2.14.0), data.table, Rtsne, pheatmap, irlba 17 | Suggests: testthat, knitr 18 | Collate: 'analysis.r' 'class_gene_bc_matrix.r' 'constants.r' 'data.r' 19 | 'help.r' 'io.r' 'normalize.r' 'plot.r' 'util.r' 20 | VignetteBuilder: knitr 21 | RoxygenNote: 6.0.1 22 | NeedsCompilation: yes 23 | Packaged: 2017-07-24 16:30:34 UTC; paulr 24 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: rkit vignette 2 | 3 | rkit: 4 | mkdir -p build 5 | R CMD build --no-build-vignettes . 6 | 7 | # NOTE: You have to run this TWICE to update the table of contents. 8 | vignette: 9 | Rscript scripts/run_knitr.R 10 | 11 | clean: 12 | rm -rf build 13 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(cell_composition) 4 | export(concatenate_gene_bc_matrices) 5 | export(download_sample) 6 | export(equalize_gbms) 7 | export(gbm_pheatmap) 8 | export(get_correletion_scores) 9 | export(get_custom_col) 10 | export(get_gene_dispersion) 11 | export(get_matrix_from_h5) 12 | export(get_mean_mapped_reads_per_cell) 13 | export(get_mean_raw_reads_per_cell) 14 | export(get_nonzero_genes) 15 | export(get_read_count_mtx) 16 | export(load_analysis_results_from_path) 17 | export(load_cellranger_analysis_results) 18 | export(load_cellranger_matrix) 19 | export(load_cellranger_matrix_from_files) 20 | export(load_cellranger_matrix_h5) 21 | export(load_molecule_info) 22 | export(load_molecule_info_from_path) 23 | export(log_gene_bc_matrix) 24 | export(merge_clusters) 25 | export(newGeneBCMatrix) 26 | export(normalize_barcode_sums_to_median) 27 | export(order_cell_by_clusters) 28 | export(plot_barcode_counts) 29 | export(plot_population_corr) 30 | export(prioritize_top_genes) 31 | export(run_differential_expression) 32 | export(run_kmeans_clustering) 33 | export(run_pca) 34 | export(run_tsne) 35 | export(save_cellranger_matrix_h5) 36 | export(select_cells_by_clusterID) 37 | export(select_clusters_by_gene_markers) 38 | export(subsample_gene_bc_matrix) 39 | export(train_multinomial) 40 | export(trunc_gbm_by_genes) 41 | export(visualize_clusters) 42 | export(visualize_gene_markers) 43 | export(visualize_umi_counts) 44 | export(visualize_variable_genes) 45 | export(write_cluster_specific_genes) 46 | exportMethods("+") 47 | exportMethods("-") 48 | exportMethods(Arith) 49 | exportMethods(Compare) 50 | exportMethods(Logic) 51 | exportMethods(Math) 52 | exportMethods(Math2) 53 | exportMethods(Summary) 54 | exportMethods(colMeans) 55 | exportMethods(colSums) 56 | exportMethods(dim) 57 | exportMethods(dimnames) 58 | exportMethods(ncol) 59 | exportMethods(nrow) 60 | exportMethods(rowMeans) 61 | exportMethods(rowSums) 62 | import(Biobase) 63 | import(Matrix) 64 | import(data.table) 65 | import(ggplot2) 66 | import(pheatmap) 67 | import(rhdf5) 68 | importFrom(Rtsne,Rtsne) 69 | importFrom(irlba,irlba) 70 | -------------------------------------------------------------------------------- /R/class_gene_bc_matrix.r: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. 3 | # 4 | 5 | #' GeneBCMatrix class 6 | #' 7 | 8 | #' An S4 class to represent a matrix containing cell-barcoded gene counts 9 | #' @slot barcode_filtered Whether the matrix contains only cell-containing barcodes (vs all sequenced barcodes) 10 | #' @slot pipestance_path The path to the pipestance that this sample was loaded from 11 | #' @slot summary Metrics summary 12 | #' @slot subsampled The matrix was read-subsampled 13 | #' @slot molecule_info Molecule info; used for read-subsampling 14 | #' @import data.table 15 | #' @import Biobase 16 | GeneBCMatrix <- setClass("GeneBCMatrix", 17 | contains="ExpressionSet", 18 | slots=list( 19 | barcode_filtered="logical", 20 | pipestance_path="character", 21 | summary="list", 22 | subsampled="logical", 23 | molecule_info="data.table" 24 | ), 25 | prototype = prototype( new("VersionedBiobase", 26 | versions = c( classVersion("ExpressionSet"), GeneBCMatrix = "1.0.0" ) )) 27 | ) 28 | 29 | #' Create a new GeneBCMatrix 30 | #' @export 31 | #' @param mat A sparse matrix whose rows are genes and columns are cell-barcodes 32 | #' @param fd A dataframe with gene IDs as row names and additional metadata such as gene symbols as columns. 33 | #' @param pd A dataframe with cell barcodes as row names and any additional metadata columns. 34 | #' @param template A GeneBCMatrix to copy slots from 35 | #' @return A new GeneBCMatrix object 36 | #' @examples 37 | #' \dontrun{ 38 | #' matrix = exprs(gbm1) 39 | #' featureData = fData(gbm1) 40 | #' phenoData = pData(gbm1) 41 | #' 42 | #' # Note including a template copies all other slots of gbm to new object 43 | #' new_gbm = newGeneBCMatrix(matrix, fd=featureData, pd=phenoData, template=gbm1) 44 | #'} 45 | newGeneBCMatrix <- function(mat, fd, pd, template=NULL) { 46 | res <- new("GeneBCMatrix", assayData=assayDataNew( "environment", exprs=mat ), featureData=new("AnnotatedDataFrame", data=fd), phenoData=new("AnnotatedDataFrame", data=pd), molecule_info=data.table()) 47 | 48 | if (!is.null(template)) { 49 | for (slot_name in setdiff(slotNames(res), c('assayData', 'featureData', 'phenoData'))) { 50 | slot(res, slot_name) <- slot(template, slot_name) 51 | } 52 | } 53 | 54 | res 55 | } 56 | 57 | #' dim for GeneBCMatrix objects 58 | #' @export 59 | #' @param x a GeneBCMatrix object 60 | #' @return Result of dim function on exprs() on GeneBCMatrix 61 | #' @examples 62 | #' gene_count = dim(gbm1)[1] 63 | #' cell_barcode_count = dim(gbm1)[2] 64 | setMethod("dim", "GeneBCMatrix", function(x) dim(exprs(x))) 65 | 66 | #' nrow for GeneBCMatrix objects 67 | #' @export 68 | #' @param x a GeneBCMatrix object 69 | #' @return Result of nrow function on exprs() on GeneBCMatrix 70 | #' @examples 71 | #' gene_count = nrow(gbm1) 72 | setMethod("nrow", "GeneBCMatrix", function(x) nrow(exprs(x))) 73 | 74 | #' ncol for GeneBCMatrix objects 75 | #' @export 76 | #' @param x a GeneBCMatrix object 77 | #' @return Result of ncol function on exprs() on GeneBCMatrix 78 | #' @examples 79 | #' cell_barcode_count = ncol(gbm1) 80 | setMethod("ncol", "GeneBCMatrix", function(x) ncol(exprs(x))) 81 | 82 | #' dimnames for GeneBCMatrix objects 83 | #' @export 84 | #' @param x a GeneBCMatrix object 85 | #' @return Result of dimnames function on exprs() on GeneBCMatrix 86 | #' @examples 87 | #' gene_ids = dimnames(gbm1)[1] 88 | #' cell_barcodes = dimnames(gbm1)[2] 89 | setMethod("dimnames", "GeneBCMatrix", function(x) dimnames(exprs(x))) 90 | 91 | #' rowSums for GeneBCMatrix objects 92 | #' @export 93 | #' @param x a GeneBCMatrix object 94 | #' @param na.rm na.rm argument base function 95 | #' @param dims dims argument passed to base function 96 | #' @return Result of rowSums function on exprs() on GeneBCMatrix 97 | #' @examples 98 | #' umi_counts_per_gene = rowSums(gbm1) 99 | setMethod("rowSums", "GeneBCMatrix", function(x, na.rm, dims=1) rowSums(exprs(x), na.rm, dims)) 100 | 101 | #' colSums for GeneBCMatrix objects 102 | #' @export 103 | #' @param x a GeneBCMatrix object 104 | #' @param na.rm na.rm argument base function 105 | #' @param dims dims argument passed to base function 106 | #' @return Result of colSums function on exprs() on GeneBCMatrix 107 | #' @examples 108 | #' umi_counts_per_cell = colSums(gbm1) 109 | setMethod("colSums", "GeneBCMatrix", function(x, na.rm, dims=1) colSums(exprs(x), na.rm, dims)) 110 | 111 | #' rowMeans for GeneBCMatrix objects 112 | #' @export 113 | #' @param x a GeneBCMatrix object 114 | #' @param na.rm na.rm argument base function 115 | #' @param dims dims argument passed to base function 116 | #' @return Result of rowMeans function on exprs() on GeneBCMatrix 117 | #' @examples 118 | #' average_umis_per_gene = rowMeans(gbm1) 119 | setMethod("rowMeans", "GeneBCMatrix", function(x, na.rm, dims=1) rowMeans(exprs(x), na.rm, dims)) 120 | 121 | #' colMeans for GeneBCMatrix objects 122 | #' @export 123 | #' @param x a GeneBCMatrix object 124 | #' @param na.rm na.rm argument base function 125 | #' @param dims dims argument passed to base function 126 | #' @return Result of colMeans function on exprs() on GeneBCMatrix 127 | #' @examples 128 | #' average_umis_per_cell = colMeans(gbm1) 129 | setMethod("colMeans", "GeneBCMatrix", function(x, na.rm, dims=1) colMeans(exprs(x), na.rm, dims)) 130 | 131 | ###################################### 132 | # Non-exported functions for delegation 133 | ###################################### 134 | #' Delegate a binary operator to the matrix slot 135 | #' @param e1 LHS 136 | #' @param e2 RHS 137 | #' @return result from operator 138 | binary_op <- function(e1, e2) newGeneBCMatrix(mat=callGeneric(exprs(e1), exprs(e2)), fd=fData(e1), pd=pData(e1), e1) 139 | 140 | #' Delegate a binary operator to the matrix slot 141 | #' @param e1 LHS 142 | #' @param e2 RHS 143 | #' @return result from operator 144 | binary_op_left <- function(e1, e2) newGeneBCMatrix(mat=callGeneric(exprs(e1), exprs(e2)), fd=fData(e1), pd=pData(e1), e1) 145 | 146 | #' Delegate a binary operator to the matrix slot 147 | #' @param e1 LHS 148 | #' @param e2 RHS 149 | #' @return result from operator 150 | binary_op_right <- function(e1, e2) newGeneBCMatrix(mat=callGeneric(e1, exprs(e2)), fd=fData(e2), pd=pData(e2), e2) 151 | 152 | #' Delegate a unary operator to the matrix slot 153 | #' @param x GeneBCMatrix object 154 | #' @return result from operator 155 | unary_op <- function(x) newGeneBCMatrix(mat=callGeneric(exprs(x)), fd=fData(x), pData(x), x) 156 | 157 | #' Delegate a unary arithmetic operator to the matrix slot 158 | #' @param e1 GeneBCMatrix object 159 | #' @param e2 dummy 160 | #' @return result from operator 161 | unary_arith_op <- function(e1, e2) newGeneBCMatrix(mat=callGeneric(exprs(e1)), fd=fData(e1), pd=pData(e1), e1) 162 | 163 | ###################################### 164 | # Non-exported functions for delegation 165 | ###################################### 166 | 167 | #' Unary negation of GeneBCMatrix objects 168 | #' @export 169 | #' @param e1 GeneBCMatrix 170 | #' @param e2 dummy 171 | #' @return result from operator 172 | setMethod("-", signature(e1 = "GeneBCMatrix", e2 = "missing"), unary_arith_op) 173 | 174 | #' Unary identity of GeneBCMatrix objects 175 | #' @export 176 | #' @param e1 GeneBCMatrix 177 | #' @param e2 dummy 178 | #' @return result from operator 179 | setMethod("+", signature(e1 = "GeneBCMatrix", e2 = "missing"), unary_arith_op) 180 | 181 | #' Arithmetic operator for GeneBCMatrix 182 | #' @export 183 | #' @param e1 GeneBCMatrix 184 | #' @param e2 GeneBCMatrix 185 | #' @return result from operator 186 | setMethod("Arith", signature(e1 = "GeneBCMatrix", e2 = "GeneBCMatrix"), binary_op) 187 | 188 | #' Arithmetic operator for GeneBCMatrix 189 | #' @export 190 | #' @param e1 GeneBCMatrix 191 | #' @param e2 logical 192 | #' @return result from operator 193 | setMethod("Arith", signature(e1 = "GeneBCMatrix", e2 = "logical"), binary_op_left) 194 | 195 | #' Arithmetic operator for GeneBCMatrix 196 | #' @export 197 | #' @param e1 logical 198 | #' @param e2 GeneBCMatrix 199 | #' @return result from operator 200 | setMethod("Arith", signature(e1 = "logical", e2 = "GeneBCMatrix"), binary_op_right) 201 | 202 | #' Arithmetic operator for GeneBCMatrix 203 | #' @export 204 | #' @param e1 GeneBCMatrix 205 | #' @param e2 numeric 206 | #' @return result from operator 207 | setMethod("Arith", signature(e1 = "GeneBCMatrix", e2 = "numeric"), binary_op_left) 208 | 209 | #' Arithmetic operator for GeneBCMatrix 210 | #' @export 211 | #' @param e1 numeric 212 | #' @param e2 GeneBCMatrix 213 | #' @return result from operator 214 | setMethod("Arith", signature(e1 = "numeric", e2 = "GeneBCMatrix"), binary_op_right) 215 | 216 | 217 | #' Compare operator for GeneBCMatrix 218 | #' @export 219 | #' @param e1 GeneBCMatrix 220 | #' @param e2 GeneBCMatrix 221 | #' @return result from operator 222 | setMethod("Compare", signature(e1 = "GeneBCMatrix", e2 = "GeneBCMatrix"), binary_op) 223 | 224 | 225 | #' Compare operator for GeneBCMatrix 226 | #' @export 227 | #' @param e1 GeneBCMatrix 228 | #' @param e2 GeneBCMatrix 229 | #' @return result from operator 230 | setMethod("Compare", signature(e1 = "GeneBCMatrix", e2 = "numeric"), binary_op_left) 231 | 232 | #' Compare operator for GeneBCMatrix 233 | #' @export 234 | #' @param e1 GeneBCMatrix 235 | #' @param e2 GeneBCMatrix 236 | #' @return result from operator 237 | setMethod("Compare", signature(e1 = "numeric", e2 = "GeneBCMatrix"), binary_op_right) 238 | 239 | #' Compare operator for GeneBCMatrix 240 | #' @export 241 | #' @param e1 GeneBCMatrix 242 | #' @param e2 GeneBCMatrix 243 | #' @return result from operator 244 | setMethod("Compare", signature(e1 = "logical", e2 = "GeneBCMatrix"), binary_op_left) 245 | 246 | 247 | #' Compare operator for GeneBCMatrix 248 | #' @export 249 | #' @param e1 GeneBCMatrix 250 | #' @param e2 GeneBCMatrix 251 | #' @return result from operator 252 | setMethod("Compare", signature(e1 = "GeneBCMatrix", e2 = "logical"), binary_op_left) 253 | 254 | #' Logical operator for GeneBCMatrix 255 | #' @export 256 | #' @param e1 GeneBCMatrix 257 | #' @param e2 GeneBCMatrix 258 | #' @return result from operator 259 | setMethod("Logic", signature(e1 = "GeneBCMatrix", e2 = "GeneBCMatrix"), binary_op) 260 | 261 | #' Logical operator for GeneBCMatrix 262 | #' @export 263 | #' @param e1 GeneBCMatrix 264 | #' @param e2 GeneBCMatrix 265 | #' @return result from operator 266 | setMethod("Logic", signature(e1 = "GeneBCMatrix", e2 = "numeric"), binary_op_left) 267 | 268 | #' Logical operator for GeneBCMatrix 269 | #' @export 270 | #' @param e1 GeneBCMatrix 271 | #' @param e2 GeneBCMatrix 272 | #' @return result from operator 273 | setMethod("Logic", signature(e1 = "numeric", e2 = "GeneBCMatrix"), binary_op_right) 274 | 275 | #' Logical operator for GeneBCMatrix 276 | #' @export 277 | #' @param e1 GeneBCMatrix 278 | #' @param e2 GeneBCMatrix 279 | #' @return result from operator 280 | setMethod("Logic", signature(e1 = "GeneBCMatrix", e2 = "logical"), binary_op_left) 281 | 282 | #' Logical operator for GeneBCMatrix 283 | #' @export 284 | #' @param e1 GeneBCMatrix 285 | #' @param e2 GeneBCMatrix 286 | #' @return result from operator 287 | setMethod("Logic", signature(e1 = "logical", e2 = "GeneBCMatrix"), binary_op_right) 288 | 289 | #' Math operator for GeneBCMatrix 290 | #' @export 291 | #' @param x GeneBCMatrix 292 | #' @return result from operator 293 | setMethod("Math", signature(x = "GeneBCMatrix"), unary_op) 294 | 295 | #' Math2 operator for GeneBCMatrix 296 | #' @export 297 | #' @param x GeneBCMatrix 298 | #' @return result from operator 299 | setMethod("Math2", signature(x = "GeneBCMatrix"), unary_op) 300 | 301 | #' Summary operator for GeneBCMatrix 302 | #' @export 303 | #' @param x GeneBCMatrix 304 | #' @return result from operator 305 | setMethod("Summary", signature(x = "GeneBCMatrix"), function(x) callGeneric(exprs(x))) 306 | -------------------------------------------------------------------------------- /R/constants.r: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. 3 | # 4 | 5 | #' @name constants 6 | #' @title Constants 7 | #' @return none 8 | #' @description global constants 9 | 10 | # Note: R replaces spaces with periods in column names when loading from csv 11 | 12 | CELL_COUNT_METRIC <- "Number.of.Cells" 13 | TOTAL_READS_METRIC <- "Number.of.Reads" 14 | CONF_MAPPED_READS_METRIC <- "Reads.Mapped.Confidently.to.Transcriptome" 15 | VALID_BARCODES_METRIC <- "Valid.Barcodes" 16 | 17 | NULL 18 | -------------------------------------------------------------------------------- /R/data.r: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. 3 | # 4 | 5 | #' An example GeneBarcodeMatrix object containing 7827 cells and 35635 genes. 6 | #' 7 | #' Data contains peripheral blood mononuclear cells (PBMCs) from human individual 1. 8 | #' @return none. data documentation. 9 | "gbm1" 10 | 11 | #' An example GeneBarcodeMatrix object containing 9515 cells and 35635 genes. 12 | #' 13 | #' Data contains peripheral blood mononuclear cells (PBMCs) from human individual 2. 14 | #' @return none. data documentation. 15 | "gbm2" 16 | -------------------------------------------------------------------------------- /R/help.r: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. 3 | # 4 | 5 | #' Analyze data from 10x Genomics Single Cell pipeline 6 | #' 7 | #' Load, manipulate, analyze, and plot data from the 10x Genomics Single Cell pipeline, Cell Ranger 8 | #' 9 | #' For a full example, run \code{vignette('rkit-vignette')} 10 | #' 11 | #' The following functions are provided by this package to assist users of 10x Genomics Single Cell 12 | #' in secondary analysis of their data. 13 | #' 14 | #' @section Loading data from Cell Ranger's output: 15 | #' \itemize{ 16 | #' \item{\code{\link{load_cellranger_matrix}}} 17 | #' \item{\code{\link{load_cellranger_analysis_results}}} 18 | #' } 19 | #' 20 | #' @section Plotting data from Cell Ranger's output: 21 | #' \itemize{ 22 | #' \item{\code{\link{plot_barcode_counts}}} 23 | #' } 24 | #' 25 | #' @section Analyzing data from Cell Ranger's output: 26 | #' \itemize{ 27 | #' \item{\code{\link{run_pca}}} 28 | #' \item{\code{\link{run_tsne}}} 29 | #' \item{\code{\link{run_kmeans_clustering}}} 30 | #' } 31 | #' 32 | #' @section Getting info from Cell Ranger's output: 33 | #' \itemize{ 34 | #' \item{\code{\link{get_mean_mapped_reads_per_cell}}} 35 | #' \item{\code{\link{get_mean_raw_reads_per_cell}}} 36 | #' } 37 | #' 38 | #' @section Normalizing samples to make them comparable: 39 | #' \itemize{ 40 | #' \item{\code{\link{load_molecule_info}}} 41 | #' \item{\code{\link{subsample_gene_bc_matrix}}} 42 | #' } 43 | #' 44 | #' @section Combining data from multiple samples: 45 | #' \itemize{ 46 | #' \item{\code{\link{concatenate_gene_bc_matrices}}} 47 | #' } 48 | #' 49 | #' @author 10x Genomics 50 | #' @docType package 51 | #' @name cellrangerRkit 52 | #' 53 | NULL 54 | 55 | -------------------------------------------------------------------------------- /R/normalize.r: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. 3 | # 4 | 5 | #' Normalization functions 6 | #' 7 | 8 | #' Normalize barcodes by sum to the median barcode by sum 9 | #' 10 | #' @param gbm a GeneBCMatrix to normalize 11 | #' @return A GeneBCMatrix with barcode-normalized values 12 | #' @export 13 | #' @examples 14 | #' gbm_norm_by_bc <- normalize_barcode_sums_to_median(gbm1) 15 | #' 16 | normalize_barcode_sums_to_median <- function(gbm) { 17 | bc_sums <- colSums(gbm) 18 | median_sum <- median(bc_sums) 19 | new_matrix <- sweep(exprs(gbm), 2, median_sum/bc_sums, '*') 20 | 21 | return(newGeneBCMatrix(new_matrix, fData(gbm), pData(gbm), template=gbm)) 22 | } 23 | 24 | #' Take the element-wise logarithm of a gene-barcode matrix while maintaining sparsity 25 | #' 26 | #' @param gbm a GeneBCMatrix to log 27 | #' @param base base of logarithm to use 28 | #' @return A GeneBCMatrix with logged counts 29 | #' @export 30 | #' @examples 31 | #' gbm_log <- log_gene_bc_matrix(gbm1) 32 | #' 33 | log_gene_bc_matrix <- function(gbm, base=2) { 34 | x <- uniqTsparse(as(exprs(gbm), 'dgTMatrix')) 35 | slot(x, 'x') <- log(1 + slot(x, 'x'), base=base) 36 | return(newGeneBCMatrix(x, fData(gbm), pData(gbm), template=gbm)) 37 | } 38 | -------------------------------------------------------------------------------- /R/plot.r: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. 3 | # 4 | 5 | #' Plotting functions 6 | #' 7 | 8 | #' Plot barcode distribution 9 | #' 10 | #' Plot the barcode counts in descending order on a log-scale 11 | #' 12 | #' @param gene_bc_matrix A GeneBCMatrix object 13 | #' @return none. plot is generated. 14 | #' @export 15 | #' @examples 16 | #' \dontrun{ 17 | #' plot_barcode_counts(gbm1) 18 | #' } 19 | #' 20 | plot_barcode_counts <- function(gene_bc_matrix) { 21 | bc_counts <- sort(colSums(exprs(gene_bc_matrix)), decreasing=TRUE) 22 | nonzero_bc_counts <- bc_counts[bc_counts > 0] 23 | plot(nonzero_bc_counts ~ I(1:length(nonzero_bc_counts)), t='l', log='xy', 24 | xlab='Barcode rank', ylab='Barcode UMI counts') 25 | } 26 | 27 | #' Visualize total umi counts under a 2D projection 28 | #' 29 | #' Generate a ggplot object that highlights UMI counts 30 | #' 31 | #' @param gbm A GeneBCMatrix object (NOT log-transformed) 32 | #' @param projection A two column matrix projection of each cell 33 | #' @param limits (min,max) saturates values on the color bar 34 | #' @return A ggplot object with facets corresponding to each gene symbol 35 | #' @import ggplot2 36 | #' @export 37 | #' @examples 38 | #' \dontrun{ 39 | #' visualize_umi_counts(gbm,tsne_proj) 40 | #' } 41 | #' 42 | visualize_umi_counts<- function(gbm,projection,limits=c(0,10),marker_size=0.1) { 43 | gene_values <- log(colSums(exprs(gbm)),base=10) 44 | gene_values[gene_valueslimits[2]] <- limits[2] 46 | projection_names <- colnames(projection) 47 | colnames(projection) <- c('Component.1', 'Component.2') 48 | proj_gene <- data.frame(cbind(projection,gene_values)) 49 | p <- ggplot(proj_gene, aes(Component.1, Component.2)) + 50 | geom_point(aes(colour=gene_values),size=marker_size) + 51 | scale_colour_gradient(low="blue",high="red",name = "log10") + 52 | labs(x=projection_names[1],y=projection_names[2]) + ggtitle('Total number of UMIs') + theme_bw() + 53 | theme(plot.title = element_text(hjust = 0.5), 54 | panel.grid.major = element_blank(), panel.grid.minor = element_blank()) 55 | 56 | return(p) 57 | } 58 | 59 | #' Visualize gene markers under a 2D projection 60 | #' 61 | #' Generate a ggplot object that highlights gene markers 62 | #' 63 | #' @param gbm A GeneBCMatrix object (recommended to be normalized by UMI counts and log-transformed) 64 | #' @param gene_probes A vector of gene symbols to highlight 65 | #' @param projection A two column matrix projection of each cell 66 | #' @param limits (min,max) saturates values on the color bar 67 | #' @return A ggplot object with facets corresponding to each gene symbol 68 | #' @import ggplot2 69 | #' @export 70 | #' @examples 71 | #' \dontrun{ 72 | #' visualize_gene_markers(gbm,c('gene1','gene2'),tsne_proj) 73 | #' } 74 | #' 75 | visualize_gene_markers<- function(gbm,gene_probes,projection,limits=c(0,10),marker_size=0.1,title=NULL) { 76 | gbm_trunc <- trunc_gbm_by_genes(gbm,gene_probes) 77 | gene_values <- t(as.matrix(exprs(gbm_trunc))) 78 | gene_values[gene_valueslimits[2]] <- limits[2] 80 | colnames(gene_values) <- gene_probes 81 | projection_names <- colnames(projection) 82 | colnames(projection) <- c('Component.1', 'Component.2') 83 | proj_gene <- data.frame(cbind(projection,gene_values)) 84 | proj_gene_melt <- melt(proj_gene, id.vars=c("Component.1", "Component.2")) 85 | p<- ggplot(proj_gene_melt, aes(Component.1, Component.2)) + 86 | geom_point(aes(colour=value),size=marker_size) + facet_wrap(~variable) + 87 | scale_colour_gradient(low="grey",high="red",name = "val") + 88 | labs(x=projection_names[1],y=projection_names[2]) 89 | if (!is.null(title)) { p <- p + ggtitle(title) } 90 | p <- p + theme_bw() + theme(plot.title = element_text(hjust = 0.5), 91 | panel.grid.major = element_blank(), panel.grid.minor = element_blank()) 92 | 93 | return(p) 94 | } 95 | 96 | #' Visualize class labels under a 2D projection 97 | #' 98 | #' Generate a ggplot object that highlights specified class labels 99 | #' 100 | #' @param cluster_result A vector or matrix of class labels for each cell (row) 101 | #' @param projection A two column matrix projection of each cell 102 | #' @param colour (Optional) Customized colors for each class label 103 | #' @param alpha (Optional) Transparancy parameter for ggplot 104 | #' @param marker_size (Optional) Marker size for ggplot 105 | #' @param title (Optional) Title for ggplot 106 | #' @param legend_anno (Optional) Array of characters for legend annotation 107 | #' @return A ggplot object with facets corresponding to each gene symbol 108 | #' @import ggplot2 109 | #' @export 110 | #' @examples 111 | #' \dontrun{ 112 | #' visualize_clusters(cluster_result,tsne_proj) 113 | #' } 114 | #' 115 | visualize_clusters <-function(cluster_result,projection,colour=NULL,alpha=1,marker_size=0.1,title=NULL,legend_anno=NULL) { 116 | cluster_ids <- sort(unique(as.vector(cluster_result))) # unique labels 117 | if (is.vector(cluster_result)) { 118 | if (dim(projection)[1] != length(cluster_result)) 119 | stop('The number of labels and the number of projected points do not match!\n') 120 | } else { 121 | if (dim(projection)[1] != dim(cluster_result)[1]) { 122 | stop('The number of labels and the number of projected points do not match!\n') 123 | } 124 | } 125 | 126 | if (!is.null(legend_anno)) { 127 | if (length(legend_anno) != length(cluster_ids)) 128 | stop('The length of legend_anno is not the same as the number of unique labels!\n') 129 | } 130 | 131 | if (!is.null(colour)) { 132 | if (length(colour) != length(cluster_ids)) 133 | stop('The length of colour is not the same as the number of unique labels!\n') 134 | names(colour) <- cluster_ids 135 | if (!is.null(legend_anno)) { 136 | names(colour) <- legend_anno 137 | } 138 | } 139 | 140 | projection_names <- colnames(projection) 141 | colnames(projection) <- c('Component.1', 'Component.2') 142 | proj_clu <- data.frame(cbind(projection,cluster_result)) 143 | proj_clu_melt <- melt(proj_clu, id.vars=c('Component.1','Component.2')) 144 | 145 | if (!is.null(legend_anno)) { 146 | cid_idx <- unlist(lapply(cluster_result, function(x) which(cluster_ids %in% x) )) 147 | proj_clu_melt$value <- factor(legend_anno[cid_idx]) 148 | } else { 149 | proj_clu_melt$value <- factor(proj_clu_melt$value) 150 | } 151 | 152 | p <- ggplot(proj_clu_melt, aes(Component.1, Component.2))+ 153 | geom_point(aes(colour = value),size=marker_size,alpha=alpha) + facet_wrap(~variable)+ 154 | guides(col = guide_legend(title="ID",override.aes = list(size=3)))+ 155 | labs(x=projection_names[1],y=projection_names[2]) + theme_bw() # theme_classic() 156 | 157 | if (!is.null(title)) { p <- p + ggtitle(title) } 158 | 159 | if ((!is.null(colour))) { p <- p + scale_color_manual(values=colour) } 160 | 161 | if (is.vector(cluster_result)) { # only one set of clusters 162 | p <- p + theme(plot.title = element_text(hjust = 0.5), legend.key = element_blank(), strip.text.x = element_blank(), 163 | panel.grid.major = element_blank(), panel.grid.minor = element_blank()) 164 | } else { 165 | p <- p + theme(plot.title = element_text(hjust = 0.5), legend.key = element_blank(), 166 | panel.grid.major = element_blank(), panel.grid.minor = element_blank()) 167 | } 168 | 169 | return(p) 170 | } 171 | 172 | #' Plot heatmap with specified gene and cell ordering 173 | #' 174 | #' Generate a ggplot object that highlights specified class labels 175 | #' 176 | #' @param gbm A GeneBCMatrix object (recommended to be normalized by UMI counts and log-transformed) 177 | #' @param genes_to_plot A list of gene symbols (or output from function: prioritize_genes) 178 | #' @param cells_to_plot A dataframe with cell names and cell indices (or output from function: order_cell_by_clusters) 179 | #' @param n_genes Number of genes to include in the heatmap 180 | #' @param colour Customized colors for each class label on the colour axes 181 | #' @param limits (min,max) saturates values on the color bar 182 | #' @return none. a pheatmap is generated. 183 | #' @import pheatmap 184 | #' @export 185 | #' @examples 186 | #' \dontrun{ 187 | #' gbm_pheatmap(gbm,genes_to_plot,cells_to_plot) 188 | #' } 189 | #' 190 | gbm_pheatmap <- function(gbm,genes_to_plot,cells_to_plot,n_genes=5,colour=NULL,limits=c(-3,3)) { 191 | if (!is.list(genes_to_plot)) { # custmoized gene list 192 | cat('Plotting one gene set instead of multiple cluster-specific gene sets\n') 193 | gene_indices <- sapply(genes_to_plot, function(x) get_gene_index(gbm,x)) 194 | gene_annotation <- NULL 195 | } else { 196 | if ('significant' %in% names(genes_to_plot[[1]])) { 197 | gene_indices <- unlist(lapply(genes_to_plot,function(x) with(x, head(ix[significant], n_genes)))) 198 | gene_grouping <- unlist(lapply(names(genes_to_plot),function(nm) 199 | rep(nm, with(genes_to_plot[[nm]], length(head(ix[significant],n_genes)))))) 200 | } else { 201 | gene_indices <- unlist(lapply(genes_to_plot,function(x) x$ix[1:n_genes])) 202 | gene_grouping <- rep(names(genes_to_plot), each=n_genes) 203 | } 204 | gene_annotation <- data.frame(ClusterID = as.factor(gene_grouping)) 205 | } 206 | cell_indices <- unlist(lapply(cells_to_plot,function(x) x$ix)) 207 | # scaling by genes and saturating the gene expression values and saturate at limits 208 | value <- t(scale(t(as.matrix(exprs(gbm))[gene_indices,cell_indices]))) 209 | value[valuelimits[2]] <- limits[2] 211 | rownames(value) <- make.unique(fData(gbm)$symbol[gene_indices]) 212 | cell_grouping <- unlist(lapply(1:length(cells_to_plot), function(x) { 213 | rep(names(cells_to_plot)[x], length(cells_to_plot[[x]]$barcode))})) 214 | # create annotation of x and y axes 215 | cell_annotation <- data.frame(ClusterID = as.factor(cell_grouping)) 216 | rownames(cell_annotation) <- colnames(value) 217 | if (!is.null(gene_annotation)) { rownames(gene_annotation) <- rownames(value) } 218 | if (is.null(colour)) { 219 | anno_colors <- NULL 220 | } else { 221 | names(colour) <- names(cells_to_plot) 222 | anno_colors <- list(ClusterID = colour) 223 | } 224 | pheatmap(value, cluster_rows = FALSE,cluster_cols = FALSE, show_colnames = FALSE, 225 | annotation_row=gene_annotation,annotation_col=cell_annotation, 226 | annotation_names_row = FALSE, annotation_names_col = FALSE, 227 | annotation_colors = anno_colors) 228 | } 229 | 230 | #' Plot correlation heatmap 231 | #' 232 | #' Generate a pheatmap that shows the correlation between pairs of rows in an input matrix 233 | #' 234 | #' @param pop_avg An input matrix (rownames will be used) where rows are samples and columns are features 235 | #' @param method The correlation method for the cor() function to compute pairwise correlations 236 | #' @return none. a pheatmap is generated. 237 | #' @import pheatmap 238 | #' @export 239 | #' @examples 240 | #' plot_population_corr(gbm,genes_to_plot,cells_to_plot) 241 | #' 242 | plot_population_corr <- function(pop_avg,method='spearman') { 243 | pop_cor<-cor(t(pop_avg),method=method) 244 | rownames(pop_cor)<-rownames(pop_avg) 245 | colnames(pop_cor)<-rep("",length(rownames(pop_avg))) 246 | # pheatmap(pop_cor,color=colorRampPalette(c("gray100", 'gray30'))(20),cluster_rows=T,cluster_cols=T) 247 | pheatmap(pop_cor,cluster_rows=T,cluster_cols=T) 248 | } 249 | 250 | #' Get custmoized colours 251 | #' 252 | #' Generate an array of up to 13 colors from custmoized color palette 253 | #' 254 | #' @param n Number of colors needed 255 | #' @param style The color palette 256 | #' @return a character array of up to 13 colors 257 | #' @export 258 | #' @examples 259 | #' get_custom_col(13) 260 | #' 261 | get_custom_col <- function(n,style='default') { 262 | mycol <- c( "cornflowerblue", 263 | "green4", 264 | "#6A3D9A", # purple 265 | "grey", 266 | "tan4", 267 | "yellow", 268 | "#FF7F00", # orange 269 | "black", 270 | "#FB9A99", # pink 271 | "orchid", 272 | "red", 273 | "darkblue", 274 | "darkolivegreen1") 275 | if (n > length(mycol)) { 276 | stop('There are',n,'colors requested, but the maximum supported is now:',length(mycol)) 277 | } 278 | return(mycol[1:n]) 279 | } 280 | 281 | #' Visualize variable genes 282 | #' 283 | #' 284 | #' @param gene_dispersion Dispersion for each gene (output from function get_gene_dispersion()) 285 | #' @param used (Optional) if TRUE will plot the used genes 286 | #' @param marker_size (Optional) marker size (default: 0) 287 | #' @return none. A ggplot object that shows normalized dispersion v.s. mean expression 288 | #' @import ggplot2 289 | #' @export 290 | #' @examples 291 | #' plot_population_corr(gbm,genes_to_plot,cells_to_plot) 292 | #' 293 | visualize_variable_genes <- function(gene_dispersion, used=FALSE, marker_size=1) { 294 | if (used) { 295 | ggplot(gene_dispersion,aes(mean,dispersion,col=used))+geom_point(size=marker_size)+scale_x_log10()+ 296 | scale_y_log10()+scale_color_manual(values=c("grey","black")) + theme_classic() 297 | } else { 298 | ggplot(gene_dispersion,aes(mean,dispersion))+geom_point(size=marker_size)+scale_x_log10()+ 299 | scale_y_log10() + theme_classic() 300 | } 301 | } 302 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 10X Genomics Cell Ranger R kit 2 | 3 | ## Description 4 | R package that accompanies the 10X Genomics Cell Ranger pipeline. It supports manipulation and visualization of output from the pipeline as well as re-running of secondary analyses. 5 | 6 | ## Development 7 | Make sure you have R packages devtools and roxygen2 installed and loaded: 8 | 9 | ```R 10 | install.packages( c('devtools', 'roxygen2') ) 11 | library(devtools) 12 | library(roxygen2) 13 | ``` 14 | 15 | To install the current version from master: 16 | 17 | ```R 18 | install_github( '10XDev/cellrangerRkit', user = 'github_user', 19 | auth_token = 'some_auth_token' ) 20 | ``` 21 | 22 | The auth token can be generated using the default settings in 23 | https://github.com/settings/applications under 'Personal access tokens'. Make 24 | sure to save the token, otherwise you need to generate another one. 25 | 26 | ## Workflow 27 | Since you've already installed devtools, you should consider using it to help 28 | develop the package. Note that all `'path/to/working/copy'` strings can be 29 | replaced by the empty string if you're inside the root of the package directory 30 | (which I strongly recommend). There is a developer mode you can enter by 31 | typing: 32 | 33 | ```R 34 | dev_mode() 35 | ``` 36 | and exit similarly. What this does is create a sandboxed development 37 | environment for your packages. 38 | 39 | Throughout development, you probably will need to load updates regularly: 40 | 41 | ```R 42 | install('path/to/working/copy') 43 | ``` 44 | 45 | If you're trying to access a new function outside of the package (in 46 | userspace land) make sure to add the `@export` decorator and generate 47 | documentation for it using roxygen2: 48 | 49 | ```R 50 | document('path/to/working/copy') 51 | ``` 52 | 53 | Once you dig the changes and you think it's stable, drop out of developer mode 54 | and install it into your main package set. 55 | 56 | ### Testing 57 | 58 | We are using the testthat package for unit testing. All tests live in 59 | `inst/tests/`. The directory `tests/` simply contains a stub to test all things 60 | that live in `inst/tests/`. 61 | 62 | To run all tests, in Rstudio go to: Build.. Test Package 63 | 64 | Using devtools you can call all tests by running: 65 | ```R 66 | test('path/to/working/copy') 67 | ``` 68 | 69 | 70 | ### Building for distribution 71 | 72 | make rkit && R CMD INSTALL . && make vignette 73 | 74 | ## Uninstalling 75 | ```R 76 | remove.packages('cellrangerRkit') 77 | ``` 78 | -------------------------------------------------------------------------------- /data/gbm1.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/data/gbm1.rda -------------------------------------------------------------------------------- /data/gbm2.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/data/gbm2.rda -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/analysis/kmeans/10_clusters/clusters.csv: -------------------------------------------------------------------------------- 1 | Barcode,Cluster 2 | AAAGAGACCGTTGA-1,4 3 | AAATCTGATTTGTC-1,1 4 | AACCGATGGTTTCT-1,4 5 | AACGCATGACCCAA-1,4 6 | AACGTGTGCGAGTT-1,10 7 | AACTCACTGTGTAC-1,4 8 | AAGAAGACCCCTAC-1,1 9 | AAGCACTGTGAAGA-1,4 10 | AAGGCTTGTCTATC-1,9 11 | AAGTGGCTCTCCAC-1,4 12 | AATACTGACCCTAC-1,6 13 | AATAGGGATGGTTG-1,3 14 | AATCGGTGTGGTAC-1,4 15 | ACAACCGACCGCTT-1,4 16 | ACCCAGCTGTTTCT-1,9 17 | ACGTTACTAGCCTA-1,4 18 | ACTCCTCTACCTGA-1,2 19 | AGCATTCTTTCTAC-1,2 20 | AGCCGGTGTCCTCG-1,3 21 | AGGTGGGATGCTAG-1,4 22 | AGTCAGACGGGATG-1,1 23 | AGTTCTACACGTTG-1,9 24 | AGTTTAGATTTACC-1,3 25 | ATGCGATGAGGAGC-1,4 26 | ATGGACACTGATGC-1,4 27 | ATTGCGGAGACGGA-1,4 28 | ATTGCTTGTGGTAC-1,2 29 | CAAAGCACCATACG-1,3 30 | CAAGGACTGAGACG-1,4 31 | CAATTCACACCTGA-1,4 32 | CACTAACTCTAGTG-1,9 33 | CACTGCACGGAAAT-1,8 34 | CAGAAGCTCCTTTA-1,6 35 | CAGCCTACCTCTAT-1,4 36 | CAGCTCACAACGTC-1,3 37 | CATTTCGAATCTCT-1,4 38 | CATTTCGATCCAGA-1,4 39 | CCAAAGTGGTGTAC-1,9 40 | CCACCATGTTCCCG-1,3 41 | CCACTGTGAGGAGC-1,6 42 | CCAGCGGACCAGTA-1,9 43 | CCCAAAGAAGTAGA-1,4 44 | CCGACTACTTCTTG-1,4 45 | CCTTCACTGGACAG-1,4 46 | CGAAGGGAGGACTT-1,6 47 | CGACTGCTTCCTAT-1,4 48 | CGAGGCTGGGTCTA-1,9 49 | CGGCACGATGACCA-1,4 50 | CTAGGATGGACGGA-1,5 51 | CTCAGCACGTAGGG-1,4 52 | CTCATTGACGAATC-1,6 53 | CTGATTTGAAAGCA-1,4 54 | CTTACAACTGGGAG-1,3 55 | CTTACAACTTAGGC-1,4 56 | CTTCACCTAGAGTA-1,4 57 | CTTCTAGATTCTAC-1,4 58 | CTTGATTGAGTCTG-1,3 59 | CTTGTATGTGACTG-1,6 60 | CTTTAGTGGGAACG-1,9 61 | GACGATTGCAGTTG-1,4 62 | GAGGGTGACTAGTG-1,4 63 | GAGGTTACGTCTGA-1,6 64 | GAGTTGTGGCTAAC-1,4 65 | GATAGAGAACTACG-1,4 66 | GATAGCACCCTTCG-1,3 67 | GATATAACGACAGG-1,9 68 | GATCTTTGGTGTTG-1,2 69 | GCACAAACACACAC-1,4 70 | GCACAAACTCTGGA-1,4 71 | GCCACTACTGGCAT-1,3 72 | GCGCGATGACGCTA-1,6 73 | GGAATGCTCCCTAC-1,4 74 | GGACAGGACAACTG-1,4 75 | GGACGCACTCGTTT-1,6 76 | GGAGGCCTTATGCG-1,4 77 | GGCAAGGAGAGGTG-1,4 78 | GGCACGTGGCTCCT-1,4 79 | GGCTCACTACCACA-1,1 80 | GGGATTACTCCGAA-1,4 81 | GGGCCATGCCATAG-1,6 82 | GTACTACTAGTCGT-1,4 83 | GTATTCACGAAACA-1,4 84 | GTTATGCTGTCTGA-1,4 85 | TAAGCTCTACCTGA-1,6 86 | TAATGAACCATGGT-1,3 87 | TAGAAACTCTGTGA-1,9 88 | TAGAATACTAGAGA-1,4 89 | TAGACGTGTATGGC-1,9 90 | TAGGCAACACCTGA-1,4 91 | TATACGCTTGACCA-1,4 92 | TCATCATGGCCCTT-1,3 93 | TCATGTACACGTGT-1,4 94 | TCATTGACCAGATC-1,6 95 | TCCACTCTAAAGTG-1,6 96 | TCCCACGAGTCATG-1,4 97 | TCCGGACTTAGAGA-1,3 98 | TCTCAAACGTACCA-1,7 99 | TGACTGGACCTCCA-1,4 100 | TGCTTAACCGAATC-1,6 101 | TGGAACACCAGAAA-1,4 102 | TGGACCCTTAACGC-1,4 103 | TGGATGACCCAGTA-1,4 104 | TGGATGACTTCCCG-1,4 105 | TGTAAAACCAACCA-1,4 106 | TGTGAGTGACCTTT-1,4 107 | TTAACCACTTGACG-1,3 108 | TTACCATGTGCTTT-1,4 109 | TTAGACCTTGCACA-1,6 110 | TTATGCACGGTGGA-1,6 111 | TTCAGACTTTCAGG-1,3 112 | TTGGAGTGACCATG-1,1 113 | TTGTACACGTTACG-1,1 114 | TTGTAGCTGAAAGT-1,4 115 | TTTAGCTGTATCTC-1,6 116 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/analysis/kmeans/2_clusters/clusters.csv: -------------------------------------------------------------------------------- 1 | Barcode,Cluster 2 | AAAGAGACCGTTGA-1,2 3 | AAATCTGATTTGTC-1,1 4 | AACCGATGGTTTCT-1,2 5 | AACGCATGACCCAA-1,2 6 | AACGTGTGCGAGTT-1,2 7 | AACTCACTGTGTAC-1,2 8 | AAGAAGACCCCTAC-1,1 9 | AAGCACTGTGAAGA-1,2 10 | AAGGCTTGTCTATC-1,2 11 | AAGTGGCTCTCCAC-1,2 12 | AATACTGACCCTAC-1,1 13 | AATAGGGATGGTTG-1,2 14 | AATCGGTGTGGTAC-1,2 15 | ACAACCGACCGCTT-1,2 16 | ACCCAGCTGTTTCT-1,2 17 | ACGTTACTAGCCTA-1,2 18 | ACTCCTCTACCTGA-1,2 19 | AGCATTCTTTCTAC-1,2 20 | AGCCGGTGTCCTCG-1,2 21 | AGGTGGGATGCTAG-1,2 22 | AGTCAGACGGGATG-1,1 23 | AGTTCTACACGTTG-1,2 24 | AGTTTAGATTTACC-1,2 25 | ATGCGATGAGGAGC-1,2 26 | ATGGACACTGATGC-1,2 27 | ATTGCGGAGACGGA-1,2 28 | ATTGCTTGTGGTAC-1,2 29 | CAAAGCACCATACG-1,2 30 | CAAGGACTGAGACG-1,2 31 | CAATTCACACCTGA-1,2 32 | CACTAACTCTAGTG-1,2 33 | CACTGCACGGAAAT-1,1 34 | CAGAAGCTCCTTTA-1,1 35 | CAGCCTACCTCTAT-1,2 36 | CAGCTCACAACGTC-1,2 37 | CATTTCGAATCTCT-1,2 38 | CATTTCGATCCAGA-1,2 39 | CCAAAGTGGTGTAC-1,2 40 | CCACCATGTTCCCG-1,2 41 | CCACTGTGAGGAGC-1,1 42 | CCAGCGGACCAGTA-1,2 43 | CCCAAAGAAGTAGA-1,2 44 | CCGACTACTTCTTG-1,2 45 | CCTTCACTGGACAG-1,2 46 | CGAAGGGAGGACTT-1,1 47 | CGACTGCTTCCTAT-1,2 48 | CGAGGCTGGGTCTA-1,2 49 | CGGCACGATGACCA-1,2 50 | CTAGGATGGACGGA-1,2 51 | CTCAGCACGTAGGG-1,2 52 | CTCATTGACGAATC-1,1 53 | CTGATTTGAAAGCA-1,2 54 | CTTACAACTGGGAG-1,2 55 | CTTACAACTTAGGC-1,2 56 | CTTCACCTAGAGTA-1,2 57 | CTTCTAGATTCTAC-1,2 58 | CTTGATTGAGTCTG-1,1 59 | CTTGTATGTGACTG-1,1 60 | CTTTAGTGGGAACG-1,2 61 | GACGATTGCAGTTG-1,2 62 | GAGGGTGACTAGTG-1,2 63 | GAGGTTACGTCTGA-1,1 64 | GAGTTGTGGCTAAC-1,2 65 | GATAGAGAACTACG-1,2 66 | GATAGCACCCTTCG-1,2 67 | GATATAACGACAGG-1,2 68 | GATCTTTGGTGTTG-1,2 69 | GCACAAACACACAC-1,2 70 | GCACAAACTCTGGA-1,2 71 | GCCACTACTGGCAT-1,2 72 | GCGCGATGACGCTA-1,1 73 | GGAATGCTCCCTAC-1,2 74 | GGACAGGACAACTG-1,2 75 | GGACGCACTCGTTT-1,1 76 | GGAGGCCTTATGCG-1,2 77 | GGCAAGGAGAGGTG-1,2 78 | GGCACGTGGCTCCT-1,2 79 | GGCTCACTACCACA-1,1 80 | GGGATTACTCCGAA-1,2 81 | GGGCCATGCCATAG-1,1 82 | GTACTACTAGTCGT-1,2 83 | GTATTCACGAAACA-1,2 84 | GTTATGCTGTCTGA-1,2 85 | TAAGCTCTACCTGA-1,1 86 | TAATGAACCATGGT-1,2 87 | TAGAAACTCTGTGA-1,2 88 | TAGAATACTAGAGA-1,2 89 | TAGACGTGTATGGC-1,2 90 | TAGGCAACACCTGA-1,2 91 | TATACGCTTGACCA-1,2 92 | TCATCATGGCCCTT-1,2 93 | TCATGTACACGTGT-1,2 94 | TCATTGACCAGATC-1,1 95 | TCCACTCTAAAGTG-1,1 96 | TCCCACGAGTCATG-1,2 97 | TCCGGACTTAGAGA-1,2 98 | TCTCAAACGTACCA-1,2 99 | TGACTGGACCTCCA-1,2 100 | TGCTTAACCGAATC-1,1 101 | TGGAACACCAGAAA-1,2 102 | TGGACCCTTAACGC-1,2 103 | TGGATGACCCAGTA-1,2 104 | TGGATGACTTCCCG-1,2 105 | TGTAAAACCAACCA-1,2 106 | TGTGAGTGACCTTT-1,2 107 | TTAACCACTTGACG-1,2 108 | TTACCATGTGCTTT-1,2 109 | TTAGACCTTGCACA-1,1 110 | TTATGCACGGTGGA-1,1 111 | TTCAGACTTTCAGG-1,2 112 | TTGGAGTGACCATG-1,1 113 | TTGTACACGTTACG-1,1 114 | TTGTAGCTGAAAGT-1,2 115 | TTTAGCTGTATCTC-1,1 116 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/analysis/kmeans/3_clusters/clusters.csv: -------------------------------------------------------------------------------- 1 | Barcode,Cluster 2 | AAAGAGACCGTTGA-1,1 3 | AAATCTGATTTGTC-1,2 4 | AACCGATGGTTTCT-1,1 5 | AACGCATGACCCAA-1,1 6 | AACGTGTGCGAGTT-1,1 7 | AACTCACTGTGTAC-1,1 8 | AAGAAGACCCCTAC-1,2 9 | AAGCACTGTGAAGA-1,1 10 | AAGGCTTGTCTATC-1,1 11 | AAGTGGCTCTCCAC-1,1 12 | AATACTGACCCTAC-1,2 13 | AATAGGGATGGTTG-1,1 14 | AATCGGTGTGGTAC-1,1 15 | ACAACCGACCGCTT-1,1 16 | ACCCAGCTGTTTCT-1,1 17 | ACGTTACTAGCCTA-1,1 18 | ACTCCTCTACCTGA-1,1 19 | AGCATTCTTTCTAC-1,1 20 | AGCCGGTGTCCTCG-1,1 21 | AGGTGGGATGCTAG-1,1 22 | AGTCAGACGGGATG-1,2 23 | AGTTCTACACGTTG-1,1 24 | AGTTTAGATTTACC-1,1 25 | ATGCGATGAGGAGC-1,1 26 | ATGGACACTGATGC-1,1 27 | ATTGCGGAGACGGA-1,1 28 | ATTGCTTGTGGTAC-1,1 29 | CAAAGCACCATACG-1,1 30 | CAAGGACTGAGACG-1,1 31 | CAATTCACACCTGA-1,1 32 | CACTAACTCTAGTG-1,1 33 | CACTGCACGGAAAT-1,2 34 | CAGAAGCTCCTTTA-1,2 35 | CAGCCTACCTCTAT-1,1 36 | CAGCTCACAACGTC-1,1 37 | CATTTCGAATCTCT-1,1 38 | CATTTCGATCCAGA-1,1 39 | CCAAAGTGGTGTAC-1,1 40 | CCACCATGTTCCCG-1,1 41 | CCACTGTGAGGAGC-1,2 42 | CCAGCGGACCAGTA-1,1 43 | CCCAAAGAAGTAGA-1,1 44 | CCGACTACTTCTTG-1,1 45 | CCTTCACTGGACAG-1,1 46 | CGAAGGGAGGACTT-1,2 47 | CGACTGCTTCCTAT-1,1 48 | CGAGGCTGGGTCTA-1,1 49 | CGGCACGATGACCA-1,1 50 | CTAGGATGGACGGA-1,3 51 | CTCAGCACGTAGGG-1,1 52 | CTCATTGACGAATC-1,2 53 | CTGATTTGAAAGCA-1,1 54 | CTTACAACTGGGAG-1,1 55 | CTTACAACTTAGGC-1,1 56 | CTTCACCTAGAGTA-1,1 57 | CTTCTAGATTCTAC-1,1 58 | CTTGATTGAGTCTG-1,2 59 | CTTGTATGTGACTG-1,2 60 | CTTTAGTGGGAACG-1,1 61 | GACGATTGCAGTTG-1,1 62 | GAGGGTGACTAGTG-1,1 63 | GAGGTTACGTCTGA-1,2 64 | GAGTTGTGGCTAAC-1,1 65 | GATAGAGAACTACG-1,1 66 | GATAGCACCCTTCG-1,1 67 | GATATAACGACAGG-1,1 68 | GATCTTTGGTGTTG-1,1 69 | GCACAAACACACAC-1,1 70 | GCACAAACTCTGGA-1,1 71 | GCCACTACTGGCAT-1,1 72 | GCGCGATGACGCTA-1,2 73 | GGAATGCTCCCTAC-1,1 74 | GGACAGGACAACTG-1,1 75 | GGACGCACTCGTTT-1,2 76 | GGAGGCCTTATGCG-1,1 77 | GGCAAGGAGAGGTG-1,1 78 | GGCACGTGGCTCCT-1,1 79 | GGCTCACTACCACA-1,2 80 | GGGATTACTCCGAA-1,1 81 | GGGCCATGCCATAG-1,2 82 | GTACTACTAGTCGT-1,1 83 | GTATTCACGAAACA-1,1 84 | GTTATGCTGTCTGA-1,1 85 | TAAGCTCTACCTGA-1,2 86 | TAATGAACCATGGT-1,1 87 | TAGAAACTCTGTGA-1,1 88 | TAGAATACTAGAGA-1,1 89 | TAGACGTGTATGGC-1,1 90 | TAGGCAACACCTGA-1,1 91 | TATACGCTTGACCA-1,1 92 | TCATCATGGCCCTT-1,1 93 | TCATGTACACGTGT-1,1 94 | TCATTGACCAGATC-1,2 95 | TCCACTCTAAAGTG-1,2 96 | TCCCACGAGTCATG-1,1 97 | TCCGGACTTAGAGA-1,1 98 | TCTCAAACGTACCA-1,1 99 | TGACTGGACCTCCA-1,1 100 | TGCTTAACCGAATC-1,2 101 | TGGAACACCAGAAA-1,1 102 | TGGACCCTTAACGC-1,1 103 | TGGATGACCCAGTA-1,1 104 | TGGATGACTTCCCG-1,1 105 | TGTAAAACCAACCA-1,1 106 | TGTGAGTGACCTTT-1,1 107 | TTAACCACTTGACG-1,1 108 | TTACCATGTGCTTT-1,1 109 | TTAGACCTTGCACA-1,2 110 | TTATGCACGGTGGA-1,2 111 | TTCAGACTTTCAGG-1,1 112 | TTGGAGTGACCATG-1,2 113 | TTGTACACGTTACG-1,2 114 | TTGTAGCTGAAAGT-1,1 115 | TTTAGCTGTATCTC-1,2 116 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/analysis/kmeans/4_clusters/clusters.csv: -------------------------------------------------------------------------------- 1 | Barcode,Cluster 2 | AAAGAGACCGTTGA-1,1 3 | AAATCTGATTTGTC-1,2 4 | AACCGATGGTTTCT-1,1 5 | AACGCATGACCCAA-1,1 6 | AACGTGTGCGAGTT-1,4 7 | AACTCACTGTGTAC-1,4 8 | AAGAAGACCCCTAC-1,2 9 | AAGCACTGTGAAGA-1,1 10 | AAGGCTTGTCTATC-1,4 11 | AAGTGGCTCTCCAC-1,1 12 | AATACTGACCCTAC-1,2 13 | AATAGGGATGGTTG-1,1 14 | AATCGGTGTGGTAC-1,1 15 | ACAACCGACCGCTT-1,1 16 | ACCCAGCTGTTTCT-1,4 17 | ACGTTACTAGCCTA-1,1 18 | ACTCCTCTACCTGA-1,4 19 | AGCATTCTTTCTAC-1,4 20 | AGCCGGTGTCCTCG-1,1 21 | AGGTGGGATGCTAG-1,1 22 | AGTCAGACGGGATG-1,2 23 | AGTTCTACACGTTG-1,4 24 | AGTTTAGATTTACC-1,1 25 | ATGCGATGAGGAGC-1,1 26 | ATGGACACTGATGC-1,1 27 | ATTGCGGAGACGGA-1,1 28 | ATTGCTTGTGGTAC-1,1 29 | CAAAGCACCATACG-1,1 30 | CAAGGACTGAGACG-1,1 31 | CAATTCACACCTGA-1,1 32 | CACTAACTCTAGTG-1,1 33 | CACTGCACGGAAAT-1,2 34 | CAGAAGCTCCTTTA-1,2 35 | CAGCCTACCTCTAT-1,1 36 | CAGCTCACAACGTC-1,1 37 | CATTTCGAATCTCT-1,1 38 | CATTTCGATCCAGA-1,1 39 | CCAAAGTGGTGTAC-1,1 40 | CCACCATGTTCCCG-1,1 41 | CCACTGTGAGGAGC-1,2 42 | CCAGCGGACCAGTA-1,4 43 | CCCAAAGAAGTAGA-1,1 44 | CCGACTACTTCTTG-1,1 45 | CCTTCACTGGACAG-1,1 46 | CGAAGGGAGGACTT-1,2 47 | CGACTGCTTCCTAT-1,1 48 | CGAGGCTGGGTCTA-1,1 49 | CGGCACGATGACCA-1,1 50 | CTAGGATGGACGGA-1,3 51 | CTCAGCACGTAGGG-1,1 52 | CTCATTGACGAATC-1,2 53 | CTGATTTGAAAGCA-1,1 54 | CTTACAACTGGGAG-1,1 55 | CTTACAACTTAGGC-1,1 56 | CTTCACCTAGAGTA-1,1 57 | CTTCTAGATTCTAC-1,1 58 | CTTGATTGAGTCTG-1,2 59 | CTTGTATGTGACTG-1,2 60 | CTTTAGTGGGAACG-1,4 61 | GACGATTGCAGTTG-1,1 62 | GAGGGTGACTAGTG-1,1 63 | GAGGTTACGTCTGA-1,2 64 | GAGTTGTGGCTAAC-1,1 65 | GATAGAGAACTACG-1,1 66 | GATAGCACCCTTCG-1,1 67 | GATATAACGACAGG-1,1 68 | GATCTTTGGTGTTG-1,4 69 | GCACAAACACACAC-1,1 70 | GCACAAACTCTGGA-1,1 71 | GCCACTACTGGCAT-1,1 72 | GCGCGATGACGCTA-1,2 73 | GGAATGCTCCCTAC-1,1 74 | GGACAGGACAACTG-1,1 75 | GGACGCACTCGTTT-1,2 76 | GGAGGCCTTATGCG-1,1 77 | GGCAAGGAGAGGTG-1,1 78 | GGCACGTGGCTCCT-1,1 79 | GGCTCACTACCACA-1,2 80 | GGGATTACTCCGAA-1,1 81 | GGGCCATGCCATAG-1,2 82 | GTACTACTAGTCGT-1,1 83 | GTATTCACGAAACA-1,1 84 | GTTATGCTGTCTGA-1,1 85 | TAAGCTCTACCTGA-1,2 86 | TAATGAACCATGGT-1,1 87 | TAGAAACTCTGTGA-1,4 88 | TAGAATACTAGAGA-1,1 89 | TAGACGTGTATGGC-1,4 90 | TAGGCAACACCTGA-1,1 91 | TATACGCTTGACCA-1,1 92 | TCATCATGGCCCTT-1,1 93 | TCATGTACACGTGT-1,1 94 | TCATTGACCAGATC-1,2 95 | TCCACTCTAAAGTG-1,2 96 | TCCCACGAGTCATG-1,1 97 | TCCGGACTTAGAGA-1,1 98 | TCTCAAACGTACCA-1,4 99 | TGACTGGACCTCCA-1,1 100 | TGCTTAACCGAATC-1,2 101 | TGGAACACCAGAAA-1,1 102 | TGGACCCTTAACGC-1,1 103 | TGGATGACCCAGTA-1,1 104 | TGGATGACTTCCCG-1,1 105 | TGTAAAACCAACCA-1,1 106 | TGTGAGTGACCTTT-1,1 107 | TTAACCACTTGACG-1,1 108 | TTACCATGTGCTTT-1,1 109 | TTAGACCTTGCACA-1,2 110 | TTATGCACGGTGGA-1,2 111 | TTCAGACTTTCAGG-1,1 112 | TTGGAGTGACCATG-1,2 113 | TTGTACACGTTACG-1,2 114 | TTGTAGCTGAAAGT-1,1 115 | TTTAGCTGTATCTC-1,2 116 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/analysis/kmeans/5_clusters/clusters.csv: -------------------------------------------------------------------------------- 1 | Barcode,Cluster 2 | AAAGAGACCGTTGA-1,2 3 | AAATCTGATTTGTC-1,3 4 | AACCGATGGTTTCT-1,2 5 | AACGCATGACCCAA-1,1 6 | AACGTGTGCGAGTT-1,5 7 | AACTCACTGTGTAC-1,5 8 | AAGAAGACCCCTAC-1,3 9 | AAGCACTGTGAAGA-1,2 10 | AAGGCTTGTCTATC-1,1 11 | AAGTGGCTCTCCAC-1,2 12 | AATACTGACCCTAC-1,3 13 | AATAGGGATGGTTG-1,1 14 | AATCGGTGTGGTAC-1,2 15 | ACAACCGACCGCTT-1,2 16 | ACCCAGCTGTTTCT-1,5 17 | ACGTTACTAGCCTA-1,2 18 | ACTCCTCTACCTGA-1,5 19 | AGCATTCTTTCTAC-1,5 20 | AGCCGGTGTCCTCG-1,1 21 | AGGTGGGATGCTAG-1,2 22 | AGTCAGACGGGATG-1,3 23 | AGTTCTACACGTTG-1,5 24 | AGTTTAGATTTACC-1,1 25 | ATGCGATGAGGAGC-1,2 26 | ATGGACACTGATGC-1,2 27 | ATTGCGGAGACGGA-1,2 28 | ATTGCTTGTGGTAC-1,1 29 | CAAAGCACCATACG-1,1 30 | CAAGGACTGAGACG-1,2 31 | CAATTCACACCTGA-1,2 32 | CACTAACTCTAGTG-1,2 33 | CACTGCACGGAAAT-1,3 34 | CAGAAGCTCCTTTA-1,3 35 | CAGCCTACCTCTAT-1,2 36 | CAGCTCACAACGTC-1,1 37 | CATTTCGAATCTCT-1,2 38 | CATTTCGATCCAGA-1,2 39 | CCAAAGTGGTGTAC-1,2 40 | CCACCATGTTCCCG-1,1 41 | CCACTGTGAGGAGC-1,3 42 | CCAGCGGACCAGTA-1,2 43 | CCCAAAGAAGTAGA-1,2 44 | CCGACTACTTCTTG-1,2 45 | CCTTCACTGGACAG-1,2 46 | CGAAGGGAGGACTT-1,3 47 | CGACTGCTTCCTAT-1,2 48 | CGAGGCTGGGTCTA-1,2 49 | CGGCACGATGACCA-1,2 50 | CTAGGATGGACGGA-1,4 51 | CTCAGCACGTAGGG-1,2 52 | CTCATTGACGAATC-1,3 53 | CTGATTTGAAAGCA-1,2 54 | CTTACAACTGGGAG-1,2 55 | CTTACAACTTAGGC-1,2 56 | CTTCACCTAGAGTA-1,2 57 | CTTCTAGATTCTAC-1,2 58 | CTTGATTGAGTCTG-1,1 59 | CTTGTATGTGACTG-1,3 60 | CTTTAGTGGGAACG-1,5 61 | GACGATTGCAGTTG-1,2 62 | GAGGGTGACTAGTG-1,2 63 | GAGGTTACGTCTGA-1,3 64 | GAGTTGTGGCTAAC-1,2 65 | GATAGAGAACTACG-1,2 66 | GATAGCACCCTTCG-1,1 67 | GATATAACGACAGG-1,2 68 | GATCTTTGGTGTTG-1,5 69 | GCACAAACACACAC-1,2 70 | GCACAAACTCTGGA-1,2 71 | GCCACTACTGGCAT-1,1 72 | GCGCGATGACGCTA-1,3 73 | GGAATGCTCCCTAC-1,2 74 | GGACAGGACAACTG-1,2 75 | GGACGCACTCGTTT-1,3 76 | GGAGGCCTTATGCG-1,2 77 | GGCAAGGAGAGGTG-1,2 78 | GGCACGTGGCTCCT-1,2 79 | GGCTCACTACCACA-1,3 80 | GGGATTACTCCGAA-1,2 81 | GGGCCATGCCATAG-1,3 82 | GTACTACTAGTCGT-1,2 83 | GTATTCACGAAACA-1,2 84 | GTTATGCTGTCTGA-1,2 85 | TAAGCTCTACCTGA-1,3 86 | TAATGAACCATGGT-1,1 87 | TAGAAACTCTGTGA-1,5 88 | TAGAATACTAGAGA-1,2 89 | TAGACGTGTATGGC-1,5 90 | TAGGCAACACCTGA-1,2 91 | TATACGCTTGACCA-1,2 92 | TCATCATGGCCCTT-1,1 93 | TCATGTACACGTGT-1,2 94 | TCATTGACCAGATC-1,3 95 | TCCACTCTAAAGTG-1,3 96 | TCCCACGAGTCATG-1,2 97 | TCCGGACTTAGAGA-1,1 98 | TCTCAAACGTACCA-1,5 99 | TGACTGGACCTCCA-1,2 100 | TGCTTAACCGAATC-1,3 101 | TGGAACACCAGAAA-1,2 102 | TGGACCCTTAACGC-1,2 103 | TGGATGACCCAGTA-1,2 104 | TGGATGACTTCCCG-1,2 105 | TGTAAAACCAACCA-1,2 106 | TGTGAGTGACCTTT-1,2 107 | TTAACCACTTGACG-1,1 108 | TTACCATGTGCTTT-1,2 109 | TTAGACCTTGCACA-1,3 110 | TTATGCACGGTGGA-1,3 111 | TTCAGACTTTCAGG-1,1 112 | TTGGAGTGACCATG-1,3 113 | TTGTACACGTTACG-1,3 114 | TTGTAGCTGAAAGT-1,2 115 | TTTAGCTGTATCTC-1,3 116 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/analysis/kmeans/6_clusters/clusters.csv: -------------------------------------------------------------------------------- 1 | Barcode,Cluster 2 | AAAGAGACCGTTGA-1,2 3 | AAATCTGATTTGTC-1,1 4 | AACCGATGGTTTCT-1,2 5 | AACGCATGACCCAA-1,2 6 | AACGTGTGCGAGTT-1,6 7 | AACTCACTGTGTAC-1,2 8 | AAGAAGACCCCTAC-1,1 9 | AAGCACTGTGAAGA-1,2 10 | AAGGCTTGTCTATC-1,2 11 | AAGTGGCTCTCCAC-1,2 12 | AATACTGACCCTAC-1,5 13 | AATAGGGATGGTTG-1,2 14 | AATCGGTGTGGTAC-1,2 15 | ACAACCGACCGCTT-1,2 16 | ACCCAGCTGTTTCT-1,6 17 | ACGTTACTAGCCTA-1,2 18 | ACTCCTCTACCTGA-1,6 19 | AGCATTCTTTCTAC-1,2 20 | AGCCGGTGTCCTCG-1,2 21 | AGGTGGGATGCTAG-1,2 22 | AGTCAGACGGGATG-1,1 23 | AGTTCTACACGTTG-1,6 24 | AGTTTAGATTTACC-1,2 25 | ATGCGATGAGGAGC-1,2 26 | ATGGACACTGATGC-1,2 27 | ATTGCGGAGACGGA-1,2 28 | ATTGCTTGTGGTAC-1,2 29 | CAAAGCACCATACG-1,2 30 | CAAGGACTGAGACG-1,2 31 | CAATTCACACCTGA-1,2 32 | CACTAACTCTAGTG-1,2 33 | CACTGCACGGAAAT-1,5 34 | CAGAAGCTCCTTTA-1,5 35 | CAGCCTACCTCTAT-1,2 36 | CAGCTCACAACGTC-1,2 37 | CATTTCGAATCTCT-1,2 38 | CATTTCGATCCAGA-1,2 39 | CCAAAGTGGTGTAC-1,2 40 | CCACCATGTTCCCG-1,2 41 | CCACTGTGAGGAGC-1,5 42 | CCAGCGGACCAGTA-1,2 43 | CCCAAAGAAGTAGA-1,2 44 | CCGACTACTTCTTG-1,2 45 | CCTTCACTGGACAG-1,2 46 | CGAAGGGAGGACTT-1,5 47 | CGACTGCTTCCTAT-1,2 48 | CGAGGCTGGGTCTA-1,2 49 | CGGCACGATGACCA-1,2 50 | CTAGGATGGACGGA-1,4 51 | CTCAGCACGTAGGG-1,2 52 | CTCATTGACGAATC-1,5 53 | CTGATTTGAAAGCA-1,2 54 | CTTACAACTGGGAG-1,2 55 | CTTACAACTTAGGC-1,2 56 | CTTCACCTAGAGTA-1,2 57 | CTTCTAGATTCTAC-1,2 58 | CTTGATTGAGTCTG-1,5 59 | CTTGTATGTGACTG-1,5 60 | CTTTAGTGGGAACG-1,6 61 | GACGATTGCAGTTG-1,2 62 | GAGGGTGACTAGTG-1,2 63 | GAGGTTACGTCTGA-1,5 64 | GAGTTGTGGCTAAC-1,2 65 | GATAGAGAACTACG-1,2 66 | GATAGCACCCTTCG-1,2 67 | GATATAACGACAGG-1,2 68 | GATCTTTGGTGTTG-1,6 69 | GCACAAACACACAC-1,2 70 | GCACAAACTCTGGA-1,2 71 | GCCACTACTGGCAT-1,2 72 | GCGCGATGACGCTA-1,5 73 | GGAATGCTCCCTAC-1,2 74 | GGACAGGACAACTG-1,2 75 | GGACGCACTCGTTT-1,5 76 | GGAGGCCTTATGCG-1,2 77 | GGCAAGGAGAGGTG-1,2 78 | GGCACGTGGCTCCT-1,2 79 | GGCTCACTACCACA-1,1 80 | GGGATTACTCCGAA-1,2 81 | GGGCCATGCCATAG-1,1 82 | GTACTACTAGTCGT-1,2 83 | GTATTCACGAAACA-1,2 84 | GTTATGCTGTCTGA-1,2 85 | TAAGCTCTACCTGA-1,5 86 | TAATGAACCATGGT-1,2 87 | TAGAAACTCTGTGA-1,2 88 | TAGAATACTAGAGA-1,2 89 | TAGACGTGTATGGC-1,2 90 | TAGGCAACACCTGA-1,2 91 | TATACGCTTGACCA-1,2 92 | TCATCATGGCCCTT-1,2 93 | TCATGTACACGTGT-1,2 94 | TCATTGACCAGATC-1,5 95 | TCCACTCTAAAGTG-1,5 96 | TCCCACGAGTCATG-1,2 97 | TCCGGACTTAGAGA-1,2 98 | TCTCAAACGTACCA-1,3 99 | TGACTGGACCTCCA-1,2 100 | TGCTTAACCGAATC-1,5 101 | TGGAACACCAGAAA-1,2 102 | TGGACCCTTAACGC-1,2 103 | TGGATGACCCAGTA-1,2 104 | TGGATGACTTCCCG-1,2 105 | TGTAAAACCAACCA-1,2 106 | TGTGAGTGACCTTT-1,2 107 | TTAACCACTTGACG-1,2 108 | TTACCATGTGCTTT-1,2 109 | TTAGACCTTGCACA-1,5 110 | TTATGCACGGTGGA-1,5 111 | TTCAGACTTTCAGG-1,2 112 | TTGGAGTGACCATG-1,1 113 | TTGTACACGTTACG-1,1 114 | TTGTAGCTGAAAGT-1,2 115 | TTTAGCTGTATCTC-1,5 116 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/analysis/kmeans/7_clusters/clusters.csv: -------------------------------------------------------------------------------- 1 | Barcode,Cluster 2 | AAAGAGACCGTTGA-1,7 3 | AAATCTGATTTGTC-1,4 4 | AACCGATGGTTTCT-1,7 5 | AACGCATGACCCAA-1,2 6 | AACGTGTGCGAGTT-1,1 7 | AACTCACTGTGTAC-1,7 8 | AAGAAGACCCCTAC-1,4 9 | AAGCACTGTGAAGA-1,7 10 | AAGGCTTGTCTATC-1,7 11 | AAGTGGCTCTCCAC-1,7 12 | AATACTGACCCTAC-1,6 13 | AATAGGGATGGTTG-1,2 14 | AATCGGTGTGGTAC-1,7 15 | ACAACCGACCGCTT-1,7 16 | ACCCAGCTGTTTCT-1,1 17 | ACGTTACTAGCCTA-1,7 18 | ACTCCTCTACCTGA-1,1 19 | AGCATTCTTTCTAC-1,1 20 | AGCCGGTGTCCTCG-1,2 21 | AGGTGGGATGCTAG-1,7 22 | AGTCAGACGGGATG-1,4 23 | AGTTCTACACGTTG-1,1 24 | AGTTTAGATTTACC-1,2 25 | ATGCGATGAGGAGC-1,7 26 | ATGGACACTGATGC-1,7 27 | ATTGCGGAGACGGA-1,7 28 | ATTGCTTGTGGTAC-1,2 29 | CAAAGCACCATACG-1,2 30 | CAAGGACTGAGACG-1,7 31 | CAATTCACACCTGA-1,7 32 | CACTAACTCTAGTG-1,7 33 | CACTGCACGGAAAT-1,5 34 | CAGAAGCTCCTTTA-1,6 35 | CAGCCTACCTCTAT-1,7 36 | CAGCTCACAACGTC-1,2 37 | CATTTCGAATCTCT-1,7 38 | CATTTCGATCCAGA-1,7 39 | CCAAAGTGGTGTAC-1,7 40 | CCACCATGTTCCCG-1,2 41 | CCACTGTGAGGAGC-1,6 42 | CCAGCGGACCAGTA-1,7 43 | CCCAAAGAAGTAGA-1,7 44 | CCGACTACTTCTTG-1,7 45 | CCTTCACTGGACAG-1,7 46 | CGAAGGGAGGACTT-1,6 47 | CGACTGCTTCCTAT-1,7 48 | CGAGGCTGGGTCTA-1,7 49 | CGGCACGATGACCA-1,7 50 | CTAGGATGGACGGA-1,3 51 | CTCAGCACGTAGGG-1,7 52 | CTCATTGACGAATC-1,4 53 | CTGATTTGAAAGCA-1,7 54 | CTTACAACTGGGAG-1,7 55 | CTTACAACTTAGGC-1,7 56 | CTTCACCTAGAGTA-1,7 57 | CTTCTAGATTCTAC-1,7 58 | CTTGATTGAGTCTG-1,6 59 | CTTGTATGTGACTG-1,6 60 | CTTTAGTGGGAACG-1,1 61 | GACGATTGCAGTTG-1,7 62 | GAGGGTGACTAGTG-1,7 63 | GAGGTTACGTCTGA-1,4 64 | GAGTTGTGGCTAAC-1,7 65 | GATAGAGAACTACG-1,7 66 | GATAGCACCCTTCG-1,2 67 | GATATAACGACAGG-1,7 68 | GATCTTTGGTGTTG-1,1 69 | GCACAAACACACAC-1,7 70 | GCACAAACTCTGGA-1,7 71 | GCCACTACTGGCAT-1,2 72 | GCGCGATGACGCTA-1,6 73 | GGAATGCTCCCTAC-1,7 74 | GGACAGGACAACTG-1,7 75 | GGACGCACTCGTTT-1,6 76 | GGAGGCCTTATGCG-1,7 77 | GGCAAGGAGAGGTG-1,7 78 | GGCACGTGGCTCCT-1,7 79 | GGCTCACTACCACA-1,4 80 | GGGATTACTCCGAA-1,7 81 | GGGCCATGCCATAG-1,4 82 | GTACTACTAGTCGT-1,7 83 | GTATTCACGAAACA-1,7 84 | GTTATGCTGTCTGA-1,7 85 | TAAGCTCTACCTGA-1,6 86 | TAATGAACCATGGT-1,2 87 | TAGAAACTCTGTGA-1,7 88 | TAGAATACTAGAGA-1,7 89 | TAGACGTGTATGGC-1,1 90 | TAGGCAACACCTGA-1,7 91 | TATACGCTTGACCA-1,7 92 | TCATCATGGCCCTT-1,2 93 | TCATGTACACGTGT-1,7 94 | TCATTGACCAGATC-1,6 95 | TCCACTCTAAAGTG-1,6 96 | TCCCACGAGTCATG-1,7 97 | TCCGGACTTAGAGA-1,2 98 | TCTCAAACGTACCA-1,1 99 | TGACTGGACCTCCA-1,7 100 | TGCTTAACCGAATC-1,6 101 | TGGAACACCAGAAA-1,7 102 | TGGACCCTTAACGC-1,7 103 | TGGATGACCCAGTA-1,7 104 | TGGATGACTTCCCG-1,7 105 | TGTAAAACCAACCA-1,7 106 | TGTGAGTGACCTTT-1,7 107 | TTAACCACTTGACG-1,2 108 | TTACCATGTGCTTT-1,7 109 | TTAGACCTTGCACA-1,6 110 | TTATGCACGGTGGA-1,6 111 | TTCAGACTTTCAGG-1,2 112 | TTGGAGTGACCATG-1,4 113 | TTGTACACGTTACG-1,4 114 | TTGTAGCTGAAAGT-1,7 115 | TTTAGCTGTATCTC-1,6 116 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/analysis/kmeans/8_clusters/clusters.csv: -------------------------------------------------------------------------------- 1 | Barcode,Cluster 2 | AAAGAGACCGTTGA-1,1 3 | AAATCTGATTTGTC-1,2 4 | AACCGATGGTTTCT-1,1 5 | AACGCATGACCCAA-1,1 6 | AACGTGTGCGAGTT-1,7 7 | AACTCACTGTGTAC-1,4 8 | AAGAAGACCCCTAC-1,2 9 | AAGCACTGTGAAGA-1,1 10 | AAGGCTTGTCTATC-1,1 11 | AAGTGGCTCTCCAC-1,1 12 | AATACTGACCCTAC-1,3 13 | AATAGGGATGGTTG-1,6 14 | AATCGGTGTGGTAC-1,1 15 | ACAACCGACCGCTT-1,1 16 | ACCCAGCTGTTTCT-1,4 17 | ACGTTACTAGCCTA-1,1 18 | ACTCCTCTACCTGA-1,7 19 | AGCATTCTTTCTAC-1,4 20 | AGCCGGTGTCCTCG-1,6 21 | AGGTGGGATGCTAG-1,1 22 | AGTCAGACGGGATG-1,2 23 | AGTTCTACACGTTG-1,4 24 | AGTTTAGATTTACC-1,6 25 | ATGCGATGAGGAGC-1,1 26 | ATGGACACTGATGC-1,1 27 | ATTGCGGAGACGGA-1,1 28 | ATTGCTTGTGGTAC-1,6 29 | CAAAGCACCATACG-1,6 30 | CAAGGACTGAGACG-1,1 31 | CAATTCACACCTGA-1,1 32 | CACTAACTCTAGTG-1,1 33 | CACTGCACGGAAAT-1,8 34 | CAGAAGCTCCTTTA-1,3 35 | CAGCCTACCTCTAT-1,1 36 | CAGCTCACAACGTC-1,6 37 | CATTTCGAATCTCT-1,1 38 | CATTTCGATCCAGA-1,1 39 | CCAAAGTGGTGTAC-1,1 40 | CCACCATGTTCCCG-1,6 41 | CCACTGTGAGGAGC-1,3 42 | CCAGCGGACCAGTA-1,1 43 | CCCAAAGAAGTAGA-1,1 44 | CCGACTACTTCTTG-1,1 45 | CCTTCACTGGACAG-1,1 46 | CGAAGGGAGGACTT-1,3 47 | CGACTGCTTCCTAT-1,1 48 | CGAGGCTGGGTCTA-1,1 49 | CGGCACGATGACCA-1,1 50 | CTAGGATGGACGGA-1,5 51 | CTCAGCACGTAGGG-1,1 52 | CTCATTGACGAATC-1,2 53 | CTGATTTGAAAGCA-1,1 54 | CTTACAACTGGGAG-1,1 55 | CTTACAACTTAGGC-1,1 56 | CTTCACCTAGAGTA-1,1 57 | CTTCTAGATTCTAC-1,1 58 | CTTGATTGAGTCTG-1,6 59 | CTTGTATGTGACTG-1,3 60 | CTTTAGTGGGAACG-1,6 61 | GACGATTGCAGTTG-1,1 62 | GAGGGTGACTAGTG-1,1 63 | GAGGTTACGTCTGA-1,2 64 | GAGTTGTGGCTAAC-1,1 65 | GATAGAGAACTACG-1,1 66 | GATAGCACCCTTCG-1,6 67 | GATATAACGACAGG-1,1 68 | GATCTTTGGTGTTG-1,7 69 | GCACAAACACACAC-1,1 70 | GCACAAACTCTGGA-1,1 71 | GCCACTACTGGCAT-1,6 72 | GCGCGATGACGCTA-1,3 73 | GGAATGCTCCCTAC-1,1 74 | GGACAGGACAACTG-1,1 75 | GGACGCACTCGTTT-1,3 76 | GGAGGCCTTATGCG-1,1 77 | GGCAAGGAGAGGTG-1,1 78 | GGCACGTGGCTCCT-1,1 79 | GGCTCACTACCACA-1,2 80 | GGGATTACTCCGAA-1,1 81 | GGGCCATGCCATAG-1,2 82 | GTACTACTAGTCGT-1,1 83 | GTATTCACGAAACA-1,1 84 | GTTATGCTGTCTGA-1,1 85 | TAAGCTCTACCTGA-1,3 86 | TAATGAACCATGGT-1,6 87 | TAGAAACTCTGTGA-1,1 88 | TAGAATACTAGAGA-1,1 89 | TAGACGTGTATGGC-1,4 90 | TAGGCAACACCTGA-1,1 91 | TATACGCTTGACCA-1,1 92 | TCATCATGGCCCTT-1,6 93 | TCATGTACACGTGT-1,1 94 | TCATTGACCAGATC-1,3 95 | TCCACTCTAAAGTG-1,3 96 | TCCCACGAGTCATG-1,1 97 | TCCGGACTTAGAGA-1,6 98 | TCTCAAACGTACCA-1,4 99 | TGACTGGACCTCCA-1,1 100 | TGCTTAACCGAATC-1,3 101 | TGGAACACCAGAAA-1,1 102 | TGGACCCTTAACGC-1,1 103 | TGGATGACCCAGTA-1,1 104 | TGGATGACTTCCCG-1,1 105 | TGTAAAACCAACCA-1,1 106 | TGTGAGTGACCTTT-1,1 107 | TTAACCACTTGACG-1,6 108 | TTACCATGTGCTTT-1,1 109 | TTAGACCTTGCACA-1,3 110 | TTATGCACGGTGGA-1,3 111 | TTCAGACTTTCAGG-1,6 112 | TTGGAGTGACCATG-1,2 113 | TTGTACACGTTACG-1,2 114 | TTGTAGCTGAAAGT-1,1 115 | TTTAGCTGTATCTC-1,3 116 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/analysis/kmeans/9_clusters/clusters.csv: -------------------------------------------------------------------------------- 1 | Barcode,Cluster 2 | AAAGAGACCGTTGA-1,4 3 | AAATCTGATTTGTC-1,2 4 | AACCGATGGTTTCT-1,4 5 | AACGCATGACCCAA-1,1 6 | AACGTGTGCGAGTT-1,3 7 | AACTCACTGTGTAC-1,4 8 | AAGAAGACCCCTAC-1,7 9 | AAGCACTGTGAAGA-1,4 10 | AAGGCTTGTCTATC-1,4 11 | AAGTGGCTCTCCAC-1,4 12 | AATACTGACCCTAC-1,2 13 | AATAGGGATGGTTG-1,1 14 | AATCGGTGTGGTAC-1,4 15 | ACAACCGACCGCTT-1,4 16 | ACCCAGCTGTTTCT-1,3 17 | ACGTTACTAGCCTA-1,4 18 | ACTCCTCTACCTGA-1,8 19 | AGCATTCTTTCTAC-1,4 20 | AGCCGGTGTCCTCG-1,1 21 | AGGTGGGATGCTAG-1,4 22 | AGTCAGACGGGATG-1,7 23 | AGTTCTACACGTTG-1,4 24 | AGTTTAGATTTACC-1,1 25 | ATGCGATGAGGAGC-1,4 26 | ATGGACACTGATGC-1,4 27 | ATTGCGGAGACGGA-1,4 28 | ATTGCTTGTGGTAC-1,1 29 | CAAAGCACCATACG-1,1 30 | CAAGGACTGAGACG-1,4 31 | CAATTCACACCTGA-1,4 32 | CACTAACTCTAGTG-1,4 33 | CACTGCACGGAAAT-1,8 34 | CAGAAGCTCCTTTA-1,2 35 | CAGCCTACCTCTAT-1,4 36 | CAGCTCACAACGTC-1,1 37 | CATTTCGAATCTCT-1,4 38 | CATTTCGATCCAGA-1,4 39 | CCAAAGTGGTGTAC-1,4 40 | CCACCATGTTCCCG-1,1 41 | CCACTGTGAGGAGC-1,2 42 | CCAGCGGACCAGTA-1,4 43 | CCCAAAGAAGTAGA-1,4 44 | CCGACTACTTCTTG-1,4 45 | CCTTCACTGGACAG-1,4 46 | CGAAGGGAGGACTT-1,2 47 | CGACTGCTTCCTAT-1,4 48 | CGAGGCTGGGTCTA-1,4 49 | CGGCACGATGACCA-1,4 50 | CTAGGATGGACGGA-1,5 51 | CTCAGCACGTAGGG-1,4 52 | CTCATTGACGAATC-1,7 53 | CTGATTTGAAAGCA-1,4 54 | CTTACAACTGGGAG-1,4 55 | CTTACAACTTAGGC-1,4 56 | CTTCACCTAGAGTA-1,4 57 | CTTCTAGATTCTAC-1,4 58 | CTTGATTGAGTCTG-1,3 59 | CTTGTATGTGACTG-1,2 60 | CTTTAGTGGGAACG-1,3 61 | GACGATTGCAGTTG-1,4 62 | GAGGGTGACTAGTG-1,4 63 | GAGGTTACGTCTGA-1,7 64 | GAGTTGTGGCTAAC-1,4 65 | GATAGAGAACTACG-1,4 66 | GATAGCACCCTTCG-1,1 67 | GATATAACGACAGG-1,4 68 | GATCTTTGGTGTTG-1,8 69 | GCACAAACACACAC-1,4 70 | GCACAAACTCTGGA-1,4 71 | GCCACTACTGGCAT-1,1 72 | GCGCGATGACGCTA-1,2 73 | GGAATGCTCCCTAC-1,4 74 | GGACAGGACAACTG-1,4 75 | GGACGCACTCGTTT-1,9 76 | GGAGGCCTTATGCG-1,4 77 | GGCAAGGAGAGGTG-1,4 78 | GGCACGTGGCTCCT-1,4 79 | GGCTCACTACCACA-1,7 80 | GGGATTACTCCGAA-1,4 81 | GGGCCATGCCATAG-1,7 82 | GTACTACTAGTCGT-1,4 83 | GTATTCACGAAACA-1,4 84 | GTTATGCTGTCTGA-1,4 85 | TAAGCTCTACCTGA-1,2 86 | TAATGAACCATGGT-1,1 87 | TAGAAACTCTGTGA-1,4 88 | TAGAATACTAGAGA-1,1 89 | TAGACGTGTATGGC-1,4 90 | TAGGCAACACCTGA-1,4 91 | TATACGCTTGACCA-1,4 92 | TCATCATGGCCCTT-1,1 93 | TCATGTACACGTGT-1,4 94 | TCATTGACCAGATC-1,2 95 | TCCACTCTAAAGTG-1,2 96 | TCCCACGAGTCATG-1,4 97 | TCCGGACTTAGAGA-1,1 98 | TCTCAAACGTACCA-1,6 99 | TGACTGGACCTCCA-1,4 100 | TGCTTAACCGAATC-1,2 101 | TGGAACACCAGAAA-1,4 102 | TGGACCCTTAACGC-1,4 103 | TGGATGACCCAGTA-1,4 104 | TGGATGACTTCCCG-1,4 105 | TGTAAAACCAACCA-1,4 106 | TGTGAGTGACCTTT-1,4 107 | TTAACCACTTGACG-1,1 108 | TTACCATGTGCTTT-1,4 109 | TTAGACCTTGCACA-1,2 110 | TTATGCACGGTGGA-1,2 111 | TTCAGACTTTCAGG-1,1 112 | TTGGAGTGACCATG-1,7 113 | TTGTACACGTTACG-1,7 114 | TTGTAGCTGAAAGT-1,4 115 | TTTAGCTGTATCTC-1,2 116 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/analysis/tsne/projection.csv: -------------------------------------------------------------------------------- 1 | Barcode,TSNE-1,TSNE-2 2 | AAAGAGACCGTTGA-1,33.409870327681269,-33.427707335098304 3 | AAATCTGATTTGTC-1,22.548691692077163,93.971792857351858 4 | AACCGATGGTTTCT-1,-4.3104888809186619,86.285541110778126 5 | AACGCATGACCCAA-1,20.402924329573246,18.538280857110053 6 | AACGTGTGCGAGTT-1,11.275537700347273,41.491261453698172 7 | AACTCACTGTGTAC-1,-17.970824404248166,42.272466599513656 8 | AAGAAGACCCCTAC-1,-40.064218716836187,59.349454744770014 9 | AAGCACTGTGAAGA-1,54.867744441966273,-6.8040179964733953 10 | AAGGCTTGTCTATC-1,31.45675273227031,-116.74921220774188 11 | AAGTGGCTCTCCAC-1,36.533595043353046,-22.36720548644363 12 | AATACTGACCCTAC-1,49.700730823922775,-64.45366229299718 13 | AATAGGGATGGTTG-1,6.6260988673788459,103.61482881246177 14 | AATCGGTGTGGTAC-1,48.87648072390315,24.771419971207255 15 | ACAACCGACCGCTT-1,54.384561290882999,26.482250609593674 16 | ACCCAGCTGTTTCT-1,70.919250277442472,26.078108715241001 17 | ACGTTACTAGCCTA-1,-6.7695722649072811,0.92340506909549691 18 | ACTCCTCTACCTGA-1,-97.197043447099404,-35.740790814127223 19 | AGCATTCTTTCTAC-1,80.136345585097615,57.181742809206931 20 | AGCCGGTGTCCTCG-1,22.940356972838146,29.992690986388691 21 | AGGTGGGATGCTAG-1,83.664270454140379,7.2071156480829632 22 | AGTCAGACGGGATG-1,-83.371076672813231,-9.5765206599817816 23 | AGTTCTACACGTTG-1,30.112985218554776,44.892065821338122 24 | AGTTTAGATTTACC-1,-17.39028702310965,-46.2711604199486 25 | ATGCGATGAGGAGC-1,11.519291899562077,12.090884700129219 26 | ATGGACACTGATGC-1,1.3668083431155869,10.795813825044306 27 | ATTGCGGAGACGGA-1,0.45621202230439861,-28.03901471826256 28 | ATTGCTTGTGGTAC-1,25.815464389059908,-16.116833539781169 29 | CAAAGCACCATACG-1,-11.869216191236436,-38.478276016013531 30 | CAAGGACTGAGACG-1,-2.7351754467973213,65.750298637085052 31 | CAATTCACACCTGA-1,12.105280973758131,-49.045810581429727 32 | CACTAACTCTAGTG-1,-29.128783306339248,-30.765270615040691 33 | CACTGCACGGAAAT-1,-48.599202304133385,-50.644153725020622 34 | CAGAAGCTCCTTTA-1,61.917208504769533,71.427756191724825 35 | CAGCCTACCTCTAT-1,1.4491042681087829,-68.940977925708225 36 | CAGCTCACAACGTC-1,-10.609069662937063,-57.012671049506871 37 | CATTTCGAATCTCT-1,45.464250786805891,1.3938804803705103 38 | CATTTCGATCCAGA-1,4.8267644564503369,0.57941803946489168 39 | CCAAAGTGGTGTAC-1,-27.472937466399625,31.088420875026255 40 | CCACCATGTTCCCG-1,-33.44112887727244,-62.241435940781592 41 | CCACTGTGAGGAGC-1,-58.507971576146922,-10.367235268185993 42 | CCAGCGGACCAGTA-1,9.3761789565191549,59.482157033290861 43 | CCCAAAGAAGTAGA-1,-1.6325830422359018,46.355232915992019 44 | CCGACTACTTCTTG-1,22.831141125601743,-28.635222630091604 45 | CCTTCACTGGACAG-1,-12.951565035802597,53.096375388953447 46 | CGAAGGGAGGACTT-1,-44.861797870785402,-6.4462553807713521 47 | CGACTGCTTCCTAT-1,21.439397634773862,-42.217259967602551 48 | CGAGGCTGGGTCTA-1,33.095867964507967,24.007047543695226 49 | CGGCACGATGACCA-1,-14.933815013723459,-22.673254887970614 50 | CTAGGATGGACGGA-1,22.62094992220042,76.019450852755142 51 | CTCAGCACGTAGGG-1,8.3261621848599248,26.103360839608342 52 | CTCATTGACGAATC-1,-72.711822316393366,-21.990183400300022 53 | CTGATTTGAAAGCA-1,43.200862341802171,83.01454643127795 54 | CTTACAACTGGGAG-1,63.669563953655747,-49.205535973176879 55 | CTTACAACTTAGGC-1,13.217825673293188,-32.46386211277791 56 | CTTCACCTAGAGTA-1,16.683836983745511,-65.498448932367694 57 | CTTCTAGATTCTAC-1,-11.194379522927496,11.956284071037723 58 | CTTGATTGAGTCTG-1,-45.049996667853449,43.545366077509534 59 | CTTGTATGTGACTG-1,-48.05304872528567,-28.253988368158545 60 | CTTTAGTGGGAACG-1,19.065073257918414,48.957380684803262 61 | GACGATTGCAGTTG-1,14.256192011127713,-7.8765326105669393 62 | GAGGGTGACTAGTG-1,-27.032797807015772,-75.512137761876076 63 | GAGGTTACGTCTGA-1,-27.969998058638456,69.076776182416523 64 | GAGTTGTGGCTAAC-1,-10.348356549883045,25.343914119040118 65 | GATAGAGAACTACG-1,48.655027867146245,-23.608128222309979 66 | GATAGCACCCTTCG-1,31.43257054619011,-75.013924855763094 67 | GATATAACGACAGG-1,46.321155290896336,62.403211406597386 68 | GATCTTTGGTGTTG-1,-95.162252000533471,-43.381497424341418 69 | GCACAAACACACAC-1,68.110819910876913,-9.6993751574453899 70 | GCACAAACTCTGGA-1,24.462506113596319,-53.107415393215732 71 | GCCACTACTGGCAT-1,-1.3202991120866878,-46.995600026063606 72 | GCGCGATGACGCTA-1,-42.992816163201333,-19.364785582688686 73 | GGAATGCTCCCTAC-1,52.372460279122016,43.905238260862923 74 | GGACAGGACAACTG-1,-23.682988062421881,9.0209346459054984 75 | GGACGCACTCGTTT-1,91.118806797482819,-12.141204365535291 76 | GGAGGCCTTATGCG-1,-32.395964452396235,20.03779003009554 77 | GGCAAGGAGAGGTG-1,-13.389095532783781,-8.8205006282129421 78 | GGCACGTGGCTCCT-1,62.829930561418792,-24.691973627275914 79 | GGCTCACTACCACA-1,-69.534226849930832,-42.341060841656926 80 | GGGATTACTCCGAA-1,-58.435370757896415,32.885304525188289 81 | GGGCCATGCCATAG-1,-34.79333623750118,-46.183296601410824 82 | GTACTACTAGTCGT-1,92.807897385043645,25.67488543348696 83 | GTATTCACGAAACA-1,40.473541369925606,-9.1807418417740667 84 | GTTATGCTGTCTGA-1,-4.1481108910510862,-15.606714645235121 85 | TAAGCTCTACCTGA-1,-58.475108730837164,4.7022310375973788 86 | TAATGAACCATGGT-1,29.070700701750326,9.8203624949117252 87 | TAGAAACTCTGTGA-1,65.708632795358341,10.327938711592763 88 | TAGAATACTAGAGA-1,40.654895287417332,37.832264821623077 89 | TAGACGTGTATGGC-1,-71.582463671146741,50.414822454102186 90 | TAGGCAACACCTGA-1,55.261410821723693,2.9737910389100328 91 | TATACGCTTGACCA-1,-26.619199964133308,-6.5476889291864957 92 | TCATCATGGCCCTT-1,-16.336070307084551,-68.258263702379139 93 | TCATGTACACGTGT-1,17.709342983040621,1.5371186268471162 94 | TCATTGACCAGATC-1,39.08758363449104,-54.055924161816868 95 | TCCACTCTAAAGTG-1,-92.161731481230447,-89.877685730840028 96 | TCCCACGAGTCATG-1,47.21002149582111,-37.423394974071414 97 | TCCGGACTTAGAGA-1,-56.530052764059398,-64.888304355436915 98 | TCTCAAACGTACCA-1,-80.96015912975291,30.141660072986316 99 | TGACTGGACCTCCA-1,-94.461828663874755,6.1892987141573546 100 | TGCTTAACCGAATC-1,-49.873129288840794,75.826965047086262 101 | TGGAACACCAGAAA-1,42.475424083362093,13.238720721914802 102 | TGGACCCTTAACGC-1,30.694800160107917,-4.2837264606299295 103 | TGGATGACCCAGTA-1,8.8871717080274077,-78.939047756981296 104 | TGGATGACTTCCCG-1,-0.26915262148895724,20.40303678714259 105 | TGTAAAACCAACCA-1,76.03665366109675,39.742202081478389 106 | TGTGAGTGACCTTT-1,-12.614292783884189,-89.986234742840097 107 | TTAACCACTTGACG-1,29.277762622209838,60.841695603291193 108 | TTACCATGTGCTTT-1,3.0651448548647893,-8.421686897231309 109 | TTAGACCTTGCACA-1,-47.390660537208525,10.849531539530908 110 | TTATGCACGGTGGA-1,-68.307004992420559,-7.4482499380014398 111 | TTCAGACTTTCAGG-1,79.779452138235641,-27.820246849605624 112 | TTGGAGTGACCATG-1,108.82237899069121,-6.4531913941470656 113 | TTGTACACGTTACG-1,-65.66682851760271,-34.471281751390038 114 | TTGTAGCTGAAAGT-1,11.048111576330909,-18.455509630976906 115 | TTTAGCTGTATCTC-1,-68.533965027098276,10.156713117292398 116 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/filtered_gene_bc_matrices/hg19/barcodes.tsv: -------------------------------------------------------------------------------- 1 | AAAGAGACCGTTGA-1 2 | AAATCTGATTTGTC-1 3 | AACCGATGGTTTCT-1 4 | AACGCATGACCCAA-1 5 | AACGTGTGCGAGTT-1 6 | AACTCACTGTGTAC-1 7 | AAGAAGACCCCTAC-1 8 | AAGCACTGTGAAGA-1 9 | AAGGCTTGTCTATC-1 10 | AAGTGGCTCTCCAC-1 11 | AATACTGACCCTAC-1 12 | AATAGGGATGGTTG-1 13 | AATCGGTGTGGTAC-1 14 | ACAACCGACCGCTT-1 15 | ACCCAGCTGTTTCT-1 16 | ACGTTACTAGCCTA-1 17 | ACTCCTCTACCTGA-1 18 | AGCATTCTTTCTAC-1 19 | AGCCGGTGTCCTCG-1 20 | AGGTGGGATGCTAG-1 21 | AGTCAGACGGGATG-1 22 | AGTTCTACACGTTG-1 23 | AGTTTAGATTTACC-1 24 | ATGCGATGAGGAGC-1 25 | ATGGACACTGATGC-1 26 | ATTGCGGAGACGGA-1 27 | ATTGCTTGTGGTAC-1 28 | CAAAGCACCATACG-1 29 | CAAGGACTGAGACG-1 30 | CAATTCACACCTGA-1 31 | CACTAACTCTAGTG-1 32 | CACTGCACGGAAAT-1 33 | CAGAAGCTCCTTTA-1 34 | CAGCCTACCTCTAT-1 35 | CAGCTCACAACGTC-1 36 | CATTTCGAATCTCT-1 37 | CATTTCGATCCAGA-1 38 | CCAAAGTGGTGTAC-1 39 | CCACCATGTTCCCG-1 40 | CCACTGTGAGGAGC-1 41 | CCAGCGGACCAGTA-1 42 | CCCAAAGAAGTAGA-1 43 | CCGACTACTTCTTG-1 44 | CCTTCACTGGACAG-1 45 | CGAAGGGAGGACTT-1 46 | CGACTGCTTCCTAT-1 47 | CGAGGCTGGGTCTA-1 48 | CGGCACGATGACCA-1 49 | CTAGGATGGACGGA-1 50 | CTCAGCACGTAGGG-1 51 | CTCATTGACGAATC-1 52 | CTGATTTGAAAGCA-1 53 | CTTACAACTGGGAG-1 54 | CTTACAACTTAGGC-1 55 | CTTCACCTAGAGTA-1 56 | CTTCTAGATTCTAC-1 57 | CTTGATTGAGTCTG-1 58 | CTTGTATGTGACTG-1 59 | CTTTAGTGGGAACG-1 60 | GACGATTGCAGTTG-1 61 | GAGGGTGACTAGTG-1 62 | GAGGTTACGTCTGA-1 63 | GAGTTGTGGCTAAC-1 64 | GATAGAGAACTACG-1 65 | GATAGCACCCTTCG-1 66 | GATATAACGACAGG-1 67 | GATCTTTGGTGTTG-1 68 | GCACAAACACACAC-1 69 | GCACAAACTCTGGA-1 70 | GCCACTACTGGCAT-1 71 | GCGCGATGACGCTA-1 72 | GGAATGCTCCCTAC-1 73 | GGACAGGACAACTG-1 74 | GGACGCACTCGTTT-1 75 | GGAGGCCTTATGCG-1 76 | GGCAAGGAGAGGTG-1 77 | GGCACGTGGCTCCT-1 78 | GGCTCACTACCACA-1 79 | GGGATTACTCCGAA-1 80 | GGGCCATGCCATAG-1 81 | GTACTACTAGTCGT-1 82 | GTATTCACGAAACA-1 83 | GTTATGCTGTCTGA-1 84 | TAAGCTCTACCTGA-1 85 | TAATGAACCATGGT-1 86 | TAGAAACTCTGTGA-1 87 | TAGAATACTAGAGA-1 88 | TAGACGTGTATGGC-1 89 | TAGGCAACACCTGA-1 90 | TATACGCTTGACCA-1 91 | TCATCATGGCCCTT-1 92 | TCATGTACACGTGT-1 93 | TCATTGACCAGATC-1 94 | TCCACTCTAAAGTG-1 95 | TCCCACGAGTCATG-1 96 | TCCGGACTTAGAGA-1 97 | TCTCAAACGTACCA-1 98 | TGACTGGACCTCCA-1 99 | TGCTTAACCGAATC-1 100 | TGGAACACCAGAAA-1 101 | TGGACCCTTAACGC-1 102 | TGGATGACCCAGTA-1 103 | TGGATGACTTCCCG-1 104 | TGTAAAACCAACCA-1 105 | TGTGAGTGACCTTT-1 106 | TTAACCACTTGACG-1 107 | TTACCATGTGCTTT-1 108 | TTAGACCTTGCACA-1 109 | TTATGCACGGTGGA-1 110 | TTCAGACTTTCAGG-1 111 | TTGGAGTGACCATG-1 112 | TTGTACACGTTACG-1 113 | TTGTAGCTGAAAGT-1 114 | TTTAGCTGTATCTC-1 115 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance/outs/metrics_summary.csv: -------------------------------------------------------------------------------- 1 | Number of Cells,Mean Reads per Cell,Median Genes per Cell,Number of Reads,Valid Barcodes,Reads Mapped Confidently to Transcriptome,Reads Mapped Confidently to Intergenic Regions,Reads Mapped Confidently to Intronic Regions,cDNA PCR Duplication,Q30 Bases in Barcode,Q30 Bases in Read 1,Q30 Bases in Sample Index,Q30 Bases in UMI,Fraction Reads in Cells,Median UMI Counts per Cell 2 | 114,"62,966",731,"7,178,216",94.7%,63.3%,5.3%,16.2%,93.9%,70.9%,93.4%,96.9%,96.4%,94.1%,"1,858" 3 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance_cr130/outs/analysis/pca/10_components/variance.csv: -------------------------------------------------------------------------------- 1 | PC,Proportion.Variance.Explained 2 | 1,0.0015185889702783704 3 | 2,0.0013574486716096958 4 | 3,0.0011924067007797381 5 | 4,0.0011838882483212753 6 | 5,0.0010985339270300062 7 | 6,0.0010901204378422928 8 | 7,0.0010692894462711378 9 | 8,0.0010606031361909112 10 | 9,0.0010562178615653364 11 | 10,0.0010519538531158943 12 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance_cr130/outs/filtered_gene_bc_matrices_h5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/inst/extdata/test_pipestance_cr130/outs/filtered_gene_bc_matrices_h5.h5 -------------------------------------------------------------------------------- /inst/extdata/test_pipestance_cr130/outs/metrics_summary.csv: -------------------------------------------------------------------------------- 1 | Estimated Number of Cells,Mean Reads per Cell,Median Genes per Cell,Valid Barcodes,Reads Mapped Confidently to Transcriptome,Reads Mapped Confidently to Exonic Regions,Reads Mapped Confidently to Intronic Regions,Reads Mapped Confidently to Intergenic Regions,Sequencing Saturation,Q30 Bases in Barcode,Q30 Bases in RNA Read,Q30 Bases in Sample Index,Q30 Bases in UMI,Fraction Reads in Cells,Total Genes Detected,Median UMI Counts per Cell 2 | "4,122",24,11,98.0%,62.2%,66.2%,24.6%,3.3%,0.2%,98.5%,91.5%,98.2%,98.6%,91.9%,"6,307",12 3 | -------------------------------------------------------------------------------- /inst/extdata/test_pipestance_cr130/outs/molecule_info.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/inst/extdata/test_pipestance_cr130/outs/molecule_info.h5 -------------------------------------------------------------------------------- /inst/extdata/test_pipestance_h5/outs/filtered_gene_bc_matrices_h5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/inst/extdata/test_pipestance_h5/outs/filtered_gene_bc_matrices_h5.h5 -------------------------------------------------------------------------------- /inst/extdata/test_subsample/outs/filtered_gene_bc_matrices/hg19/matrix.mtx: -------------------------------------------------------------------------------- 1 | %%MatrixMarket matrix coordinate real general 2 | % 3 | 509 779 770 4 | 1 1 1 5 | 2 2 1 6 | 3 3 1 7 | 4 4 1 8 | 5 5 1 9 | 6 6 1 10 | 7 7 1 11 | 8 9 1 12 | 9 10 1 13 | 10 11 1 14 | 11 13 1 15 | 12 14 1 16 | 13 15 1 17 | 14 16 1 18 | 15 17 1 19 | 16 19 1 20 | 17 19 1 21 | 18 21 1 22 | 19 21 1 23 | 20 21 1 24 | 21 22 1 25 | 22 22 1 26 | 23 24 1 27 | 24 25 1 28 | 25 27 1 29 | 26 27 1 30 | 27 27 1 31 | 28 27 1 32 | 29 28 1 33 | 30 29 1 34 | 29 30 1 35 | 31 30 1 36 | 32 33 1 37 | 33 34 1 38 | 34 34 1 39 | 35 34 1 40 | 36 37 1 41 | 37 38 1 42 | 38 39 1 43 | 39 40 1 44 | 40 41 1 45 | 41 42 1 46 | 26 44 1 47 | 42 44 1 48 | 43 45 1 49 | 44 46 1 50 | 45 47 1 51 | 46 48 1 52 | 47 51 1 53 | 48 51 1 54 | 49 52 1 55 | 50 54 1 56 | 40 55 1 57 | 51 56 1 58 | 52 57 1 59 | 53 58 1 60 | 54 59 1 61 | 55 61 1 62 | 56 62 1 63 | 57 63 1 64 | 58 63 1 65 | 14 64 1 66 | 59 65 1 67 | 60 66 1 68 | 61 66 1 69 | 62 67 1 70 | 63 68 1 71 | 38 69 1 72 | 45 69 1 73 | 64 69 1 74 | 65 70 1 75 | 66 71 1 76 | 67 71 1 77 | 68 71 1 78 | 69 72 1 79 | 70 72 1 80 | 71 73 1 81 | 72 78 1 82 | 73 79 1 83 | 74 80 1 84 | 8 81 1 85 | 75 83 1 86 | 76 85 1 87 | 77 86 1 88 | 78 87 1 89 | 79 88 1 90 | 80 89 1 91 | 81 90 1 92 | 82 91 1 93 | 43 93 1 94 | 83 94 1 95 | 84 95 1 96 | 58 96 1 97 | 85 97 1 98 | 32 98 1 99 | 86 98 1 100 | 87 99 1 101 | 88 100 1 102 | 89 101 1 103 | 67 102 1 104 | 54 103 1 105 | 90 103 1 106 | 91 104 1 107 | 75 105 1 108 | 92 107 1 109 | 93 108 1 110 | 94 110 1 111 | 95 113 1 112 | 96 114 1 113 | 97 115 1 114 | 98 116 1 115 | 76 117 1 116 | 99 118 1 117 | 100 119 1 118 | 101 121 1 119 | 102 122 1 120 | 103 124 1 121 | 75 125 1 122 | 76 126 1 123 | 104 126 1 124 | 105 128 1 125 | 106 129 1 126 | 88 131 1 127 | 107 132 1 128 | 108 133 1 129 | 109 134 1 130 | 110 135 1 131 | 2 136 1 132 | 111 137 1 133 | 112 139 1 134 | 113 140 1 135 | 114 141 1 136 | 115 142 1 137 | 52 144 1 138 | 116 144 1 139 | 117 145 1 140 | 100 146 1 141 | 118 149 1 142 | 119 149 1 143 | 120 149 1 144 | 121 149 1 145 | 122 150 1 146 | 76 153 1 147 | 123 155 1 148 | 124 157 1 149 | 125 159 1 150 | 126 160 1 151 | 127 163 1 152 | 128 164 1 153 | 41 165 1 154 | 129 165 1 155 | 130 166 1 156 | 131 167 1 157 | 76 168 1 158 | 132 169 1 159 | 119 170 1 160 | 103 171 1 161 | 133 172 1 162 | 134 174 1 163 | 135 175 1 164 | 136 176 1 165 | 137 177 1 166 | 138 178 1 167 | 11 179 1 168 | 139 180 1 169 | 140 181 1 170 | 141 182 1 171 | 142 182 1 172 | 26 183 1 173 | 143 184 1 174 | 96 186 1 175 | 144 186 1 176 | 145 186 1 177 | 76 187 1 178 | 146 188 1 179 | 147 189 1 180 | 148 190 1 181 | 71 191 1 182 | 149 192 1 183 | 150 192 1 184 | 151 193 1 185 | 152 196 1 186 | 153 198 1 187 | 154 199 1 188 | 155 200 1 189 | 156 201 1 190 | 157 201 1 191 | 158 202 1 192 | 159 204 1 193 | 160 205 1 194 | 42 206 1 195 | 161 206 1 196 | 162 206 1 197 | 163 207 1 198 | 164 208 1 199 | 165 209 1 200 | 166 210 1 201 | 167 210 1 202 | 168 211 1 203 | 103 213 1 204 | 169 214 1 205 | 170 215 1 206 | 157 216 1 207 | 126 217 1 208 | 58 219 1 209 | 171 219 1 210 | 172 219 1 211 | 173 219 1 212 | 69 221 1 213 | 11 223 1 214 | 174 224 1 215 | 23 225 1 216 | 175 226 1 217 | 176 227 1 218 | 67 228 1 219 | 136 228 1 220 | 177 228 1 221 | 136 229 1 222 | 178 230 1 223 | 179 231 1 224 | 180 233 1 225 | 15 234 1 226 | 181 235 1 227 | 52 236 1 228 | 182 236 1 229 | 183 237 1 230 | 36 238 1 231 | 26 239 1 232 | 32 240 1 233 | 184 240 1 234 | 20 241 1 235 | 185 242 1 236 | 186 243 1 237 | 187 244 1 238 | 188 245 1 239 | 189 246 1 240 | 190 247 1 241 | 191 248 1 242 | 192 248 1 243 | 172 249 1 244 | 193 251 1 245 | 194 253 1 246 | 195 254 1 247 | 196 255 1 248 | 197 256 1 249 | 198 257 1 250 | 199 259 1 251 | 185 260 1 252 | 200 261 1 253 | 47 262 1 254 | 104 263 1 255 | 201 263 1 256 | 58 265 1 257 | 202 266 1 258 | 203 268 1 259 | 204 269 1 260 | 42 271 1 261 | 2 272 1 262 | 53 272 1 263 | 156 272 1 264 | 205 272 1 265 | 206 272 1 266 | 207 272 1 267 | 208 273 1 268 | 209 273 1 269 | 210 273 1 270 | 211 274 1 271 | 212 276 1 272 | 205 277 1 273 | 213 278 1 274 | 214 280 1 275 | 215 281 1 276 | 216 283 1 277 | 217 284 1 278 | 218 284 1 279 | 219 285 1 280 | 220 286 1 281 | 221 287 1 282 | 222 288 1 283 | 223 289 1 284 | 224 291 1 285 | 103 292 1 286 | 43 293 1 287 | 225 294 1 288 | 226 295 1 289 | 73 296 1 290 | 54 297 1 291 | 227 297 1 292 | 228 299 1 293 | 229 300 1 294 | 230 300 1 295 | 231 301 1 296 | 232 302 1 297 | 3 303 1 298 | 233 303 1 299 | 234 304 1 300 | 235 305 1 301 | 236 305 1 302 | 213 307 1 303 | 237 309 1 304 | 238 310 1 305 | 111 312 1 306 | 239 313 1 307 | 220 315 1 308 | 240 316 1 309 | 241 316 1 310 | 242 317 1 311 | 243 319 1 312 | 244 319 1 313 | 156 320 1 314 | 52 322 1 315 | 245 323 1 316 | 246 323 1 317 | 247 326 1 318 | 119 328 1 319 | 248 329 1 320 | 2 331 1 321 | 35 331 1 322 | 249 331 1 323 | 250 332 1 324 | 251 333 1 325 | 252 334 1 326 | 253 335 1 327 | 137 336 1 328 | 237 337 1 329 | 185 338 1 330 | 254 339 1 331 | 98 340 1 332 | 255 340 1 333 | 256 340 1 334 | 257 341 1 335 | 258 342 1 336 | 52 344 1 337 | 259 345 1 338 | 38 346 2 339 | 208 346 1 340 | 3 348 1 341 | 260 348 1 342 | 43 349 1 343 | 261 350 1 344 | 136 351 1 345 | 125 353 1 346 | 262 353 1 347 | 263 354 1 348 | 136 355 1 349 | 133 356 1 350 | 255 357 1 351 | 264 357 1 352 | 265 358 1 353 | 266 359 1 354 | 267 360 1 355 | 2 362 1 356 | 268 362 1 357 | 269 363 1 358 | 270 364 1 359 | 271 365 1 360 | 236 366 1 361 | 43 367 1 362 | 272 368 1 363 | 46 369 1 364 | 100 369 1 365 | 273 370 1 366 | 274 371 1 367 | 275 372 1 368 | 276 373 1 369 | 277 374 1 370 | 278 376 1 371 | 279 377 1 372 | 2 378 1 373 | 43 379 1 374 | 280 380 1 375 | 75 383 1 376 | 281 383 1 377 | 282 384 1 378 | 20 385 1 379 | 279 385 1 380 | 269 386 1 381 | 104 387 1 382 | 283 390 1 383 | 284 390 1 384 | 285 391 1 385 | 286 392 1 386 | 104 393 1 387 | 287 396 1 388 | 255 397 1 389 | 288 398 1 390 | 289 399 1 391 | 290 400 1 392 | 54 401 1 393 | 291 402 1 394 | 124 403 1 395 | 292 405 1 396 | 293 406 1 397 | 294 408 1 398 | 107 409 1 399 | 223 409 1 400 | 100 411 1 401 | 295 411 1 402 | 296 411 1 403 | 297 412 1 404 | 298 413 1 405 | 255 414 1 406 | 299 414 1 407 | 300 415 1 408 | 301 416 1 409 | 302 416 1 410 | 303 416 1 411 | 224 417 1 412 | 6 418 1 413 | 304 418 1 414 | 305 419 1 415 | 306 419 1 416 | 307 420 1 417 | 308 420 1 418 | 309 422 1 419 | 192 423 1 420 | 310 423 1 421 | 12 424 1 422 | 311 427 1 423 | 26 428 1 424 | 67 429 1 425 | 306 430 1 426 | 312 430 1 427 | 313 431 1 428 | 314 432 1 429 | 46 433 1 430 | 103 433 1 431 | 203 433 1 432 | 315 433 1 433 | 316 434 1 434 | 18 437 1 435 | 317 437 1 436 | 43 438 1 437 | 318 439 1 438 | 319 440 1 439 | 320 441 1 440 | 321 442 1 441 | 47 443 1 442 | 322 444 1 443 | 323 445 1 444 | 165 446 1 445 | 245 446 1 446 | 324 446 1 447 | 325 446 1 448 | 326 447 1 449 | 129 448 1 450 | 46 450 1 451 | 327 451 1 452 | 328 452 1 453 | 172 453 1 454 | 329 454 1 455 | 330 457 1 456 | 331 458 1 457 | 332 459 1 458 | 333 460 1 459 | 334 461 1 460 | 335 462 1 461 | 192 463 1 462 | 336 463 1 463 | 337 464 1 464 | 133 465 1 465 | 338 466 1 466 | 339 467 1 467 | 284 468 1 468 | 340 469 1 469 | 26 470 2 470 | 50 470 1 471 | 341 471 1 472 | 342 472 1 473 | 83 473 1 474 | 343 474 1 475 | 344 475 1 476 | 21 476 1 477 | 103 478 1 478 | 345 478 1 479 | 250 479 1 480 | 346 480 1 481 | 347 481 1 482 | 348 483 1 483 | 269 484 1 484 | 54 486 1 485 | 349 487 1 486 | 111 488 1 487 | 341 489 1 488 | 350 489 1 489 | 351 490 1 490 | 235 491 1 491 | 352 491 1 492 | 3 493 1 493 | 26 493 1 494 | 76 493 1 495 | 353 493 1 496 | 133 494 1 497 | 354 495 1 498 | 76 496 1 499 | 355 496 1 500 | 249 497 1 501 | 356 498 1 502 | 357 499 1 503 | 358 500 1 504 | 359 501 1 505 | 178 502 1 506 | 80 503 1 507 | 360 503 1 508 | 361 504 1 509 | 173 505 1 510 | 362 506 1 511 | 363 506 1 512 | 364 507 1 513 | 217 508 1 514 | 80 509 1 515 | 365 511 1 516 | 54 512 1 517 | 288 514 1 518 | 366 514 1 519 | 45 515 1 520 | 367 517 1 521 | 368 518 1 522 | 369 519 1 523 | 370 519 1 524 | 371 521 1 525 | 183 522 1 526 | 372 523 1 527 | 129 524 1 528 | 373 525 1 529 | 235 526 1 530 | 374 527 1 531 | 46 529 1 532 | 375 530 1 533 | 240 531 1 534 | 376 532 1 535 | 377 533 1 536 | 112 534 1 537 | 235 535 1 538 | 378 536 1 539 | 46 537 1 540 | 26 538 1 541 | 379 543 1 542 | 50 544 1 543 | 380 545 1 544 | 381 547 1 545 | 382 548 1 546 | 383 550 1 547 | 333 551 1 548 | 384 551 1 549 | 103 553 1 550 | 385 553 1 551 | 386 553 1 552 | 76 554 1 553 | 387 555 1 554 | 388 557 1 555 | 389 559 1 556 | 390 560 1 557 | 74 561 1 558 | 136 562 1 559 | 391 562 1 560 | 392 562 1 561 | 64 563 1 562 | 393 564 1 563 | 394 565 1 564 | 395 566 1 565 | 192 567 1 566 | 396 568 1 567 | 54 569 1 568 | 397 570 1 569 | 398 571 1 570 | 399 572 1 571 | 293 573 1 572 | 400 574 1 573 | 401 575 1 574 | 402 576 1 575 | 403 578 1 576 | 404 580 1 577 | 405 582 1 578 | 58 583 1 579 | 133 584 1 580 | 13 585 1 581 | 406 586 1 582 | 407 587 1 583 | 408 588 1 584 | 409 589 1 585 | 410 590 1 586 | 223 593 1 587 | 411 593 1 588 | 134 594 1 589 | 208 595 1 590 | 43 596 1 591 | 3 597 1 592 | 412 598 1 593 | 413 600 1 594 | 414 601 1 595 | 415 602 1 596 | 44 603 1 597 | 416 604 1 598 | 417 604 1 599 | 418 605 1 600 | 419 606 1 601 | 420 607 1 602 | 421 610 1 603 | 219 611 1 604 | 422 611 1 605 | 423 611 1 606 | 101 612 1 607 | 261 612 1 608 | 179 615 1 609 | 424 615 1 610 | 425 616 1 611 | 103 617 1 612 | 250 618 1 613 | 426 618 1 614 | 47 619 1 615 | 427 619 1 616 | 281 621 1 617 | 336 622 1 618 | 428 623 1 619 | 429 624 1 620 | 430 625 1 621 | 431 626 1 622 | 172 627 1 623 | 432 627 1 624 | 433 628 1 625 | 434 628 1 626 | 435 629 1 627 | 436 630 1 628 | 437 631 1 629 | 438 632 1 630 | 41 635 1 631 | 439 635 1 632 | 440 636 1 633 | 441 637 1 634 | 442 638 1 635 | 443 638 1 636 | 419 639 1 637 | 38 640 1 638 | 141 641 1 639 | 444 642 1 640 | 108 643 1 641 | 103 644 1 642 | 2 645 1 643 | 80 645 1 644 | 445 645 1 645 | 446 645 1 646 | 197 646 1 647 | 26 647 1 648 | 162 648 1 649 | 54 650 1 650 | 447 650 1 651 | 448 651 1 652 | 449 652 1 653 | 450 653 1 654 | 451 653 1 655 | 452 654 1 656 | 15 655 1 657 | 88 656 1 658 | 453 657 1 659 | 74 658 1 660 | 410 660 1 661 | 454 660 1 662 | 455 662 1 663 | 456 663 1 664 | 2 664 1 665 | 203 664 1 666 | 457 665 1 667 | 458 666 1 668 | 133 667 1 669 | 459 668 1 670 | 103 669 1 671 | 250 669 1 672 | 460 670 1 673 | 91 671 1 674 | 461 671 1 675 | 133 672 1 676 | 462 673 1 677 | 463 674 1 678 | 286 675 1 679 | 464 676 1 680 | 465 677 1 681 | 466 677 1 682 | 401 679 1 683 | 467 681 1 684 | 286 682 1 685 | 468 683 1 686 | 469 685 1 687 | 195 686 1 688 | 463 686 1 689 | 47 687 1 690 | 235 688 1 691 | 470 691 1 692 | 58 692 1 693 | 75 693 1 694 | 50 695 1 695 | 471 697 1 696 | 409 698 1 697 | 472 699 1 698 | 195 700 1 699 | 103 701 1 700 | 473 705 1 701 | 474 706 1 702 | 475 706 1 703 | 92 707 1 704 | 251 708 1 705 | 476 709 1 706 | 477 710 1 707 | 478 711 1 708 | 38 713 1 709 | 80 713 1 710 | 181 714 1 711 | 463 714 1 712 | 479 717 1 713 | 480 718 1 714 | 384 719 1 715 | 103 720 1 716 | 481 720 1 717 | 185 721 1 718 | 482 722 1 719 | 306 723 1 720 | 483 724 1 721 | 484 725 1 722 | 203 728 1 723 | 485 729 1 724 | 3 730 1 725 | 69 730 1 726 | 486 730 1 727 | 104 731 1 728 | 487 733 1 729 | 488 736 1 730 | 489 737 1 731 | 195 738 1 732 | 50 739 1 733 | 490 739 1 734 | 20 740 1 735 | 29 741 1 736 | 20 742 1 737 | 213 743 1 738 | 491 743 1 739 | 492 744 1 740 | 269 745 1 741 | 110 746 1 742 | 183 747 1 743 | 42 748 1 744 | 103 750 1 745 | 348 751 1 746 | 493 752 1 747 | 140 753 1 748 | 494 754 1 749 | 495 755 1 750 | 496 756 1 751 | 185 757 1 752 | 497 757 1 753 | 498 759 1 754 | 499 759 1 755 | 500 760 1 756 | 501 761 1 757 | 43 762 1 758 | 64 763 1 759 | 502 764 1 760 | 503 765 1 761 | 98 766 1 762 | 504 767 1 763 | 505 768 1 764 | 203 770 1 765 | 506 770 1 766 | 261 771 1 767 | 35 772 1 768 | 140 774 1 769 | 67 775 1 770 | 507 776 1 771 | 508 776 1 772 | 509 777 1 773 | 3 779 1 774 | -------------------------------------------------------------------------------- /inst/extdata/test_subsample/outs/metrics_summary.csv: -------------------------------------------------------------------------------- 1 | Number of Reads,Number of Cells,Mean Reads per Cell,Median Genes per Cell,Valid Barcodes,Reads Mapped Confidently to Transcriptome,Reads Mapped Confidently to Intergenic Regions,Reads Mapped Confidently to Intronic Regions,cDNA PCR Duplication,Q30 Bases in Barcode,Q30 Bases in Read 1,Q30 Bases in Sample Index,Q30 Bases in UMI,Fraction Reads in Cells,Median UMI Counts per Cell 2 | "1,000,000",703,"1,422",411,95.8%,77.1%,2.4%,2.4%,3.4%,80.2%,90.1%,94.5%,94.5%,65.7%,614 3 | -------------------------------------------------------------------------------- /inst/extdata/test_subsample/outs/molecule_info.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/inst/extdata/test_subsample/outs/molecule_info.h5 -------------------------------------------------------------------------------- /man/Arith-GeneBCMatrix-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Arith,GeneBCMatrix,GeneBCMatrix-method} 5 | \alias{Arith,GeneBCMatrix,GeneBCMatrix-method} 6 | \title{Arithmetic operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Arith}{GeneBCMatrix,GeneBCMatrix}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Arithmetic operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Arith-GeneBCMatrix-logical-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Arith,GeneBCMatrix,logical-method} 5 | \alias{Arith,GeneBCMatrix,logical-method} 6 | \title{Arithmetic operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Arith}{GeneBCMatrix,logical}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{logical} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Arithmetic operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Arith-GeneBCMatrix-numeric-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Arith,GeneBCMatrix,numeric-method} 5 | \alias{Arith,GeneBCMatrix,numeric-method} 6 | \title{Arithmetic operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Arith}{GeneBCMatrix,numeric}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{numeric} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Arithmetic operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Arith-logical-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Arith,logical,GeneBCMatrix-method} 5 | \alias{Arith,logical,GeneBCMatrix-method} 6 | \title{Arithmetic operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Arith}{logical,GeneBCMatrix}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{logical} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Arithmetic operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Arith-numeric-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Arith,numeric,GeneBCMatrix-method} 5 | \alias{Arith,numeric,GeneBCMatrix-method} 6 | \title{Arithmetic operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Arith}{numeric,GeneBCMatrix}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{numeric} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Arithmetic operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Compare-GeneBCMatrix-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Compare,GeneBCMatrix,GeneBCMatrix-method} 5 | \alias{Compare,GeneBCMatrix,GeneBCMatrix-method} 6 | \title{Compare operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Compare}{GeneBCMatrix,GeneBCMatrix}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Compare operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Compare-GeneBCMatrix-logical-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Compare,GeneBCMatrix,logical-method} 5 | \alias{Compare,GeneBCMatrix,logical-method} 6 | \title{Compare operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Compare}{GeneBCMatrix,logical}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Compare operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Compare-GeneBCMatrix-numeric-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Compare,GeneBCMatrix,numeric-method} 5 | \alias{Compare,GeneBCMatrix,numeric-method} 6 | \title{Compare operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Compare}{GeneBCMatrix,numeric}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Compare operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Compare-logical-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Compare,logical,GeneBCMatrix-method} 5 | \alias{Compare,logical,GeneBCMatrix-method} 6 | \title{Compare operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Compare}{logical,GeneBCMatrix}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Compare operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Compare-numeric-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Compare,numeric,GeneBCMatrix-method} 5 | \alias{Compare,numeric,GeneBCMatrix-method} 6 | \title{Compare operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Compare}{numeric,GeneBCMatrix}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Compare operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/GeneBCMatrix-class.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{class} 4 | \name{GeneBCMatrix-class} 5 | \alias{GeneBCMatrix-class} 6 | \alias{GeneBCMatrix} 7 | \title{GeneBCMatrix class} 8 | \description{ 9 | An S4 class to represent a matrix containing cell-barcoded gene counts 10 | } 11 | \section{Slots}{ 12 | 13 | \describe{ 14 | \item{\code{barcode_filtered}}{Whether the matrix contains only cell-containing barcodes (vs all sequenced barcodes)} 15 | 16 | \item{\code{pipestance_path}}{The path to the pipestance that this sample was loaded from} 17 | 18 | \item{\code{summary}}{Metrics summary} 19 | 20 | \item{\code{subsampled}}{The matrix was read-subsampled} 21 | 22 | \item{\code{molecule_info}}{Molecule info; used for read-subsampling} 23 | }} 24 | 25 | -------------------------------------------------------------------------------- /man/GeneBCMatrix-missing-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{-,GeneBCMatrix,missing-method} 5 | \alias{-,GeneBCMatrix,missing-method} 6 | \title{Unary negation of GeneBCMatrix objects} 7 | \usage{ 8 | \S4method{-}{GeneBCMatrix,missing}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{dummy} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Unary negation of GeneBCMatrix objects 20 | } 21 | -------------------------------------------------------------------------------- /man/Logic-GeneBCMatrix-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Logic,GeneBCMatrix,GeneBCMatrix-method} 5 | \alias{Logic,GeneBCMatrix,GeneBCMatrix-method} 6 | \title{Logical operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Logic}{GeneBCMatrix,GeneBCMatrix}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Logical operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Logic-GeneBCMatrix-logical-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Logic,GeneBCMatrix,logical-method} 5 | \alias{Logic,GeneBCMatrix,logical-method} 6 | \title{Logical operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Logic}{GeneBCMatrix,logical}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Logical operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Logic-GeneBCMatrix-numeric-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Logic,GeneBCMatrix,numeric-method} 5 | \alias{Logic,GeneBCMatrix,numeric-method} 6 | \title{Logical operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Logic}{GeneBCMatrix,numeric}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Logical operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Logic-logical-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Logic,logical,GeneBCMatrix-method} 5 | \alias{Logic,logical,GeneBCMatrix-method} 6 | \title{Logical operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Logic}{logical,GeneBCMatrix}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Logical operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Logic-numeric-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Logic,numeric,GeneBCMatrix-method} 5 | \alias{Logic,numeric,GeneBCMatrix-method} 6 | \title{Logical operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Logic}{numeric,GeneBCMatrix}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{GeneBCMatrix} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Logical operator for GeneBCMatrix 20 | } 21 | -------------------------------------------------------------------------------- /man/Math-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Math,GeneBCMatrix-method} 5 | \alias{Math,GeneBCMatrix-method} 6 | \title{Math operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Math}{GeneBCMatrix}(x) 9 | } 10 | \arguments{ 11 | \item{x}{GeneBCMatrix} 12 | } 13 | \value{ 14 | result from operator 15 | } 16 | \description{ 17 | Math operator for GeneBCMatrix 18 | } 19 | -------------------------------------------------------------------------------- /man/Math2-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Math2,GeneBCMatrix-method} 5 | \alias{Math2,GeneBCMatrix-method} 6 | \title{Math2 operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Math2}{GeneBCMatrix}(x) 9 | } 10 | \arguments{ 11 | \item{x}{GeneBCMatrix} 12 | } 13 | \value{ 14 | result from operator 15 | } 16 | \description{ 17 | Math2 operator for GeneBCMatrix 18 | } 19 | -------------------------------------------------------------------------------- /man/Summary-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{Summary,GeneBCMatrix-method} 5 | \alias{Summary,GeneBCMatrix-method} 6 | \title{Summary operator for GeneBCMatrix} 7 | \usage{ 8 | \S4method{Summary}{GeneBCMatrix}(x) 9 | } 10 | \arguments{ 11 | \item{x}{GeneBCMatrix} 12 | } 13 | \value{ 14 | result from operator 15 | } 16 | \description{ 17 | Summary operator for GeneBCMatrix 18 | } 19 | -------------------------------------------------------------------------------- /man/binary_op.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \name{binary_op} 4 | \alias{binary_op} 5 | \title{Delegate a binary operator to the matrix slot} 6 | \usage{ 7 | binary_op(e1, e2) 8 | } 9 | \arguments{ 10 | \item{e1}{LHS} 11 | 12 | \item{e2}{RHS} 13 | } 14 | \value{ 15 | result from operator 16 | } 17 | \description{ 18 | Delegate a binary operator to the matrix slot 19 | } 20 | -------------------------------------------------------------------------------- /man/binary_op_left.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \name{binary_op_left} 4 | \alias{binary_op_left} 5 | \title{Delegate a binary operator to the matrix slot} 6 | \usage{ 7 | binary_op_left(e1, e2) 8 | } 9 | \arguments{ 10 | \item{e1}{LHS} 11 | 12 | \item{e2}{RHS} 13 | } 14 | \value{ 15 | result from operator 16 | } 17 | \description{ 18 | Delegate a binary operator to the matrix slot 19 | } 20 | -------------------------------------------------------------------------------- /man/binary_op_right.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \name{binary_op_right} 4 | \alias{binary_op_right} 5 | \title{Delegate a binary operator to the matrix slot} 6 | \usage{ 7 | binary_op_right(e1, e2) 8 | } 9 | \arguments{ 10 | \item{e1}{LHS} 11 | 12 | \item{e2}{RHS} 13 | } 14 | \value{ 15 | result from operator 16 | } 17 | \description{ 18 | Delegate a binary operator to the matrix slot 19 | } 20 | -------------------------------------------------------------------------------- /man/bind-variables-to-fix-data.table-errors-when-packaging.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r, R/util.r 3 | \name{bind variables to fix data.table errors when packaging} 4 | \alias{bind variables to fix data.table errors when packaging} 5 | \alias{bind variables to fix data.table errors when packaging} 6 | \title{Input/Output functions} 7 | \description{ 8 | Input/Output functions 9 | 10 | Utility functions 11 | } 12 | -------------------------------------------------------------------------------- /man/cell_composition.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{cell_composition} 4 | \alias{cell_composition} 5 | \title{Tabulate the proportion of each cell type in respective classes} 6 | \usage{ 7 | cell_composition(clu, anno = NULL, n_digits = 5) 8 | } 9 | \arguments{ 10 | \item{clu}{An array of integer labels from 1 to k (length = number of cells)} 11 | 12 | \item{anno}{Annotation for the k classes (can be an array of strings)} 13 | 14 | \item{n_digits}{Number of digits for to display} 15 | } 16 | \value{ 17 | A table of the break down of the numbers of each label (with optional annotation) 18 | } 19 | \description{ 20 | Tabulate the proportion of each cell type in respective classes 21 | } 22 | \examples{ 23 | \dontrun{ 24 | cell_composition(clu) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /man/cellrangerRkit.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/help.r 3 | \docType{package} 4 | \name{cellrangerRkit} 5 | \alias{cellrangerRkit} 6 | \alias{cellrangerRkit-package} 7 | \title{Analyze data from 10x Genomics Single Cell pipeline} 8 | \description{ 9 | Load, manipulate, analyze, and plot data from the 10x Genomics Single Cell pipeline, Cell Ranger 10 | } 11 | \details{ 12 | For a full example, run \code{vignette('rkit-vignette')} 13 | 14 | The following functions are provided by this package to assist users of 10x Genomics Single Cell 15 | in secondary analysis of their data. 16 | } 17 | \section{Loading data from Cell Ranger's output}{ 18 | 19 | \itemize{ 20 | \item{\code{\link{load_cellranger_matrix}}} 21 | \item{\code{\link{load_cellranger_analysis_results}}} 22 | } 23 | } 24 | 25 | \section{Plotting data from Cell Ranger's output}{ 26 | 27 | \itemize{ 28 | \item{\code{\link{plot_barcode_counts}}} 29 | } 30 | } 31 | 32 | \section{Analyzing data from Cell Ranger's output}{ 33 | 34 | \itemize{ 35 | \item{\code{\link{run_pca}}} 36 | \item{\code{\link{run_tsne}}} 37 | \item{\code{\link{run_kmeans_clustering}}} 38 | } 39 | } 40 | 41 | \section{Getting info from Cell Ranger's output}{ 42 | 43 | \itemize{ 44 | \item{\code{\link{get_mean_mapped_reads_per_cell}}} 45 | \item{\code{\link{get_mean_raw_reads_per_cell}}} 46 | } 47 | } 48 | 49 | \section{Normalizing samples to make them comparable}{ 50 | 51 | \itemize{ 52 | \item{\code{\link{load_molecule_info}}} 53 | \item{\code{\link{subsample_gene_bc_matrix}}} 54 | } 55 | } 56 | 57 | \section{Combining data from multiple samples}{ 58 | 59 | \itemize{ 60 | \item{\code{\link{concatenate_gene_bc_matrices}}} 61 | } 62 | } 63 | 64 | \author{ 65 | 10x Genomics 66 | } 67 | -------------------------------------------------------------------------------- /man/check_irlba.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{check_irlba} 4 | \alias{check_irlba} 5 | \title{Check for a broken version of irlba} 6 | \usage{ 7 | check_irlba() 8 | } 9 | \description{ 10 | Check for a broken version of irlba 11 | } 12 | -------------------------------------------------------------------------------- /man/colMeans-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{colMeans,GeneBCMatrix-method} 5 | \alias{colMeans,GeneBCMatrix-method} 6 | \title{colMeans for GeneBCMatrix objects} 7 | \usage{ 8 | \S4method{colMeans}{GeneBCMatrix}(x, na.rm, dims = 1) 9 | } 10 | \arguments{ 11 | \item{x}{a GeneBCMatrix object} 12 | 13 | \item{na.rm}{na.rm argument base function} 14 | 15 | \item{dims}{dims argument passed to base function} 16 | } 17 | \value{ 18 | Result of colMeans function on exprs() on GeneBCMatrix 19 | } 20 | \description{ 21 | colMeans for GeneBCMatrix objects 22 | } 23 | \examples{ 24 | average_umis_per_cell = colMeans(gbm1) 25 | } 26 | -------------------------------------------------------------------------------- /man/colSums-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{colSums,GeneBCMatrix-method} 5 | \alias{colSums,GeneBCMatrix-method} 6 | \title{colSums for GeneBCMatrix objects} 7 | \usage{ 8 | \S4method{colSums}{GeneBCMatrix}(x, na.rm, dims = 1) 9 | } 10 | \arguments{ 11 | \item{x}{a GeneBCMatrix object} 12 | 13 | \item{na.rm}{na.rm argument base function} 14 | 15 | \item{dims}{dims argument passed to base function} 16 | } 17 | \value{ 18 | Result of colSums function on exprs() on GeneBCMatrix 19 | } 20 | \description{ 21 | colSums for GeneBCMatrix objects 22 | } 23 | \examples{ 24 | umi_counts_per_cell = colSums(gbm1) 25 | } 26 | -------------------------------------------------------------------------------- /man/compress_sequences.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{compress_sequences} 4 | \alias{compress_sequences} 5 | \title{Compress a vector of sequences into 2-bit representation} 6 | \usage{ 7 | compress_sequences(seqs) 8 | } 9 | \arguments{ 10 | \item{seqs}{Vector of nucleotide sequences to compress} 11 | } 12 | \value{ 13 | A vector of integer64 objects 14 | } 15 | \description{ 16 | Compress a vector of sequences into integer64 objects containing 17 | a 2-bit representation. Ns are not allowed 18 | } 19 | -------------------------------------------------------------------------------- /man/compute_sseq_params.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{compute_sseq_params} 4 | \alias{compute_sseq_params} 5 | \title{Compute sSeq parameters} 6 | \usage{ 7 | compute_sseq_params(x, zeta_quantile = 0.995) 8 | } 9 | \arguments{ 10 | \item{x}{(cell x gene) count matrix} 11 | 12 | \item{zeta_quantile}{Take this quantile of the method-of-moments dispersion estimates as the shrinkage target} 13 | } 14 | \description{ 15 | Compute sSeq parameters 16 | } 17 | -------------------------------------------------------------------------------- /man/concatenate_gene_bc_matrices.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{concatenate_gene_bc_matrices} 4 | \alias{concatenate_gene_bc_matrices} 5 | \title{Concatenate gene-barcode matrices} 6 | \usage{ 7 | concatenate_gene_bc_matrices(gbms) 8 | } 9 | \arguments{ 10 | \item{gbms}{a list of GeneBCMatrix objects to concatenate} 11 | } 12 | \value{ 13 | A new GeneBCMatrix containing all the barcodes in the given matrices 14 | } 15 | \description{ 16 | Concatenate gene-barcode matrices 17 | } 18 | \examples{ 19 | big_gbm <- concatenate_gene_bc_matrices(list(gbm1, gbm2)) 20 | 21 | } 22 | -------------------------------------------------------------------------------- /man/constants.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/constants.r 3 | \docType{data} 4 | \name{constants} 5 | \alias{constants} 6 | \alias{CELL_COUNT_METRIC} 7 | \title{Constants} 8 | \format{An object of class \code{character} of length 1.} 9 | \usage{ 10 | CELL_COUNT_METRIC 11 | } 12 | \value{ 13 | none 14 | } 15 | \description{ 16 | global constants 17 | } 18 | \keyword{datasets} 19 | -------------------------------------------------------------------------------- /man/csv_value_to_numeric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{csv_value_to_numeric} 4 | \alias{csv_value_to_numeric} 5 | \title{Read value from metrics CSV} 6 | \usage{ 7 | csv_value_to_numeric(x) 8 | } 9 | \arguments{ 10 | \item{x}{String to convert} 11 | } 12 | \value{ 13 | Numeric version of string 14 | } 15 | \description{ 16 | Read value from metrics CSV 17 | } 18 | -------------------------------------------------------------------------------- /man/dim-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{dim,GeneBCMatrix-method} 5 | \alias{dim,GeneBCMatrix-method} 6 | \title{dim for GeneBCMatrix objects} 7 | \usage{ 8 | \S4method{dim}{GeneBCMatrix}(x) 9 | } 10 | \arguments{ 11 | \item{x}{a GeneBCMatrix object} 12 | } 13 | \value{ 14 | Result of dim function on exprs() on GeneBCMatrix 15 | } 16 | \description{ 17 | dim for GeneBCMatrix objects 18 | } 19 | \examples{ 20 | gene_count = dim(gbm1)[1] 21 | cell_barcode_count = dim(gbm1)[2] 22 | } 23 | -------------------------------------------------------------------------------- /man/dimnames-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{dimnames,GeneBCMatrix-method} 5 | \alias{dimnames,GeneBCMatrix-method} 6 | \title{dimnames for GeneBCMatrix objects} 7 | \usage{ 8 | \S4method{dimnames}{GeneBCMatrix}(x) 9 | } 10 | \arguments{ 11 | \item{x}{a GeneBCMatrix object} 12 | } 13 | \value{ 14 | Result of dimnames function on exprs() on GeneBCMatrix 15 | } 16 | \description{ 17 | dimnames for GeneBCMatrix objects 18 | } 19 | \examples{ 20 | gene_ids = dimnames(gbm1)[1] 21 | cell_barcodes = dimnames(gbm1)[2] 22 | } 23 | -------------------------------------------------------------------------------- /man/directory.exists.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{directory.exists} 4 | \alias{directory.exists} 5 | \title{Check if a directory exists} 6 | \usage{ 7 | directory.exists(dir_name, stop_message = NULL) 8 | } 9 | \arguments{ 10 | \item{path_name}{Directory name} 11 | 12 | \item{stop}{(Optional) stop if the file does not exist} 13 | } 14 | \value{ 15 | Logical TRUE if exists and FALSE otherwise 16 | } 17 | \description{ 18 | Check if a directory exists 19 | } 20 | -------------------------------------------------------------------------------- /man/download_file_and_check.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{download_file_and_check} 4 | \alias{download_file_and_check} 5 | \title{Download file to local and check if it exists} 6 | \usage{ 7 | download_file_and_check(url_name, loc_name) 8 | } 9 | \arguments{ 10 | \item{url_name}{File URL} 11 | } 12 | \value{ 13 | loc_name Local file path where the file is stored 14 | } 15 | \description{ 16 | Download file to local and check if it exists 17 | } 18 | -------------------------------------------------------------------------------- /man/download_sample.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{download_sample} 4 | \alias{download_sample} 5 | \title{Download a sample and relevant information from software.10xgenomics.com} 6 | \usage{ 7 | download_sample(sample_name, sample_dir, host, lite = TRUE, 8 | barcode_unfiltered = FALSE) 9 | } 10 | \arguments{ 11 | \item{sample_name}{A name of the sample to be downloaded} 12 | 13 | \item{sample_dir}{Directory where the data is saved} 14 | 15 | \item{host}{The prefix of the url where the data is downloaded from} 16 | 17 | \item{lite}{(Optional, default = TRUE) If TRUE, then molecule_info will not be downloaded} 18 | 19 | \item{barcode_unfiltered}{(Optional, default = FALSE) If TRUE, then raw_gene_bc_matrix will be downloaded} 20 | } 21 | \value{ 22 | None The sample_dir can be used to create a gbm object 23 | } 24 | \description{ 25 | NOTE: This pipestance format is for v1.1 and earlier 26 | } 27 | \examples{ 28 | \dontrun{ 29 | download_sample('pbmc3k','/home/Downloads','https://s3-us-west-2.amazonaws.com/10x.files/samples/cell/') 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /man/equalize_gbms.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{equalize_gbms} 4 | \alias{equalize_gbms} 5 | \title{Equalize a list of gbms by subsampling} 6 | \usage{ 7 | equalize_gbms(gbm_list) 8 | } 9 | \arguments{ 10 | \item{gbm_list}{A list of GeneBCMatrix objects to merge} 11 | } 12 | \value{ 13 | A list of GeneBCMatrix objects after subsampling 14 | } 15 | \description{ 16 | Equalize a list of gbms by subsampling 17 | } 18 | \examples{ 19 | \dontrun{ 20 | equalize_gbms(list(gbm1,gbm2)) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /man/format_barcode_string.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{format_barcode_string} 4 | \alias{format_barcode_string} 5 | \title{Format a barcode string} 6 | \usage{ 7 | format_barcode_string(barcode_seq, gem_group) 8 | } 9 | \arguments{ 10 | \item{barcode_seq}{Cell barcode sequence} 11 | 12 | \item{gem_group}{Gem group number} 13 | } 14 | \value{ 15 | A formatted barcode string 16 | } 17 | \description{ 18 | Format a barcode string 19 | } 20 | -------------------------------------------------------------------------------- /man/gbm1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.r 3 | \docType{data} 4 | \name{gbm1} 5 | \alias{gbm1} 6 | \title{An example GeneBarcodeMatrix object containing 7827 cells and 35635 genes.} 7 | \format{An object of class \code{GeneBCMatrix} with 35635 rows and 50 columns.} 8 | \usage{ 9 | gbm1 10 | } 11 | \value{ 12 | none. data documentation. 13 | } 14 | \description{ 15 | Data contains peripheral blood mononuclear cells (PBMCs) from human individual 1. 16 | } 17 | \keyword{datasets} 18 | -------------------------------------------------------------------------------- /man/gbm2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.r 3 | \docType{data} 4 | \name{gbm2} 5 | \alias{gbm2} 6 | \title{An example GeneBarcodeMatrix object containing 9515 cells and 35635 genes.} 7 | \format{An object of class \code{GeneBCMatrix} with 35635 rows and 65 columns.} 8 | \usage{ 9 | gbm2 10 | } 11 | \value{ 12 | none. data documentation. 13 | } 14 | \description{ 15 | Data contains peripheral blood mononuclear cells (PBMCs) from human individual 2. 16 | } 17 | \keyword{datasets} 18 | -------------------------------------------------------------------------------- /man/gbm_pheatmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.r 3 | \name{gbm_pheatmap} 4 | \alias{gbm_pheatmap} 5 | \title{Plot heatmap with specified gene and cell ordering} 6 | \usage{ 7 | gbm_pheatmap(gbm, genes_to_plot, cells_to_plot, n_genes = 5, colour = NULL, 8 | limits = c(-3, 3)) 9 | } 10 | \arguments{ 11 | \item{gbm}{A GeneBCMatrix object (recommended to be normalized by UMI counts and log-transformed)} 12 | 13 | \item{genes_to_plot}{A list of gene symbols (or output from function: prioritize_genes)} 14 | 15 | \item{cells_to_plot}{A dataframe with cell names and cell indices (or output from function: order_cell_by_clusters)} 16 | 17 | \item{n_genes}{Number of genes to include in the heatmap} 18 | 19 | \item{colour}{Customized colors for each class label on the colour axes} 20 | 21 | \item{limits}{(min,max) saturates values on the color bar} 22 | } 23 | \value{ 24 | none. a pheatmap is generated. 25 | } 26 | \description{ 27 | Generate a ggplot object that highlights specified class labels 28 | } 29 | \examples{ 30 | \dontrun{ 31 | gbm_pheatmap(gbm,genes_to_plot,cells_to_plot) 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /man/get_barcode_sequence.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{get_barcode_sequence} 4 | \alias{get_barcode_sequence} 5 | \title{Extract the cell barcode sequence from one or more barcode strings} 6 | \usage{ 7 | get_barcode_sequence(barcode_str) 8 | } 9 | \arguments{ 10 | \item{barcode_str}{Formatted cell barcode sequence} 11 | } 12 | \value{ 13 | A cell barcode sequence string 14 | } 15 | \description{ 16 | Extract the cell barcode sequence from one or more barcode strings 17 | } 18 | -------------------------------------------------------------------------------- /man/get_clustering_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{get_clustering_path} 4 | \alias{get_clustering_path} 5 | \title{Load Cell Ranger clustering results from a specified analysis folder} 6 | \usage{ 7 | get_clustering_path(analysis_path) 8 | } 9 | \arguments{ 10 | \item{analysis_path}{Path to the analysis output directory produced by Cell Ranger} 11 | } 12 | \value{ 13 | Path to clustering results 14 | } 15 | \description{ 16 | Load Cell Ranger clustering results from a specified analysis folder 17 | } 18 | \examples{ 19 | \dontrun{ 20 | pca_path <- get_pca_path(analysis_path) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /man/get_correletion_scores.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{get_correletion_scores} 4 | \alias{get_correletion_scores} 5 | \title{Compute the correlation score with a bulk population profile} 6 | \usage{ 7 | get_correletion_scores(gbm_in, compare_exprs, compare_gene_ids, 8 | method = "spearman") 9 | } 10 | \arguments{ 11 | \item{gbm_in}{A GeneBCMatrix (recommended to be normalized by UMI counts)} 12 | 13 | \item{compare_exprs}{A matrix that includes expressions with one typical expression per row} 14 | 15 | \item{compare_gene_ids}{The gene ids corresponding to the gene expression} 16 | } 17 | \value{ 18 | A matrix of correlation scores (each row is a cell in gbm_in) based on the intersection of genes between gbm_in and compare_exprs 19 | } 20 | \description{ 21 | Compute the correlation score with a bulk population profile 22 | } 23 | \examples{ 24 | \dontrun{ 25 | get_correletion_scores(gbm, bulk_profile$avg_expr, bulk_profile$genes$id) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /man/get_custom_col.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.r 3 | \name{get_custom_col} 4 | \alias{get_custom_col} 5 | \title{Get custmoized colours} 6 | \usage{ 7 | get_custom_col(n, style = "default") 8 | } 9 | \arguments{ 10 | \item{n}{Number of colors needed} 11 | 12 | \item{style}{The color palette} 13 | } 14 | \value{ 15 | a character array of up to 13 colors 16 | } 17 | \description{ 18 | Generate an array of up to 13 colors from custmoized color palette 19 | } 20 | \examples{ 21 | get_custom_col(13) 22 | 23 | } 24 | -------------------------------------------------------------------------------- /man/get_gem_group.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{get_gem_group} 4 | \alias{get_gem_group} 5 | \title{Extract the gem group from one or more barcode strings} 6 | \usage{ 7 | get_gem_group(barcode_str) 8 | } 9 | \arguments{ 10 | \item{barcode_str}{Formatted cell barcode sequence} 11 | } 12 | \value{ 13 | A gem group integer 14 | } 15 | \description{ 16 | Extract the gem group from one or more barcode strings 17 | } 18 | -------------------------------------------------------------------------------- /man/get_gene_dispersion.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{get_gene_dispersion} 4 | \alias{get_gene_dispersion} 5 | \title{Compute the normalized dispersion for each gene} 6 | \usage{ 7 | get_gene_dispersion(gbm_in, num_bins = 20) 8 | } 9 | \arguments{ 10 | \item{num_bins}{The number of bins to calculate the dispersion norm} 11 | 12 | \item{gbm_norm}{A GeneBCMatrix normalized by UMI counts (or output from normalize_barcode_sums_to_median())} 13 | } 14 | \value{ 15 | A data frame containing \itemize{ 16 | \item "mean" - The mean expression each gene 17 | \item "var" - The variance of each gene 18 | \item "dispersion" - The computed dispersion (var/mean) of each gene 19 | \item "dispersion_norm" - The dispersion noramlized by binning 20 | \item "id" - gene ids 21 | \item "symbol" - gene symbols 22 | } 23 | } 24 | \description{ 25 | Compute the normalized dispersion for each gene 26 | } 27 | \examples{ 28 | \dontrun{ 29 | get_gene_dispersion(gbm1) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /man/get_gene_index.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{get_gene_index} 4 | \alias{get_gene_index} 5 | \title{Get a gene index from a valid gene symbol} 6 | \usage{ 7 | get_gene_index(gbm, gene_symbol) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix to get the non-zero genes from} 11 | 12 | \item{gene_symbol}{A gene symbol string} 13 | } 14 | \value{ 15 | The indices from a gene index 16 | } 17 | \description{ 18 | Get a gene index from a valid gene symbol 19 | } 20 | -------------------------------------------------------------------------------- /man/get_genome_in_matrix_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{get_genome_in_matrix_path} 4 | \alias{get_genome_in_matrix_path} 5 | \title{Get list of genomes in Cell Ranger output} 6 | \usage{ 7 | get_genome_in_matrix_path(matrix_path, genome = NULL) 8 | } 9 | \arguments{ 10 | \item{matrix_path}{Path to the output directory produced by the Cell Ranger pipeline} 11 | 12 | \item{barcode_filtered}{Path to filtered matrix if true, otherwise raw matrix} 13 | } 14 | \value{ 15 | A character vector of the genomes found 16 | } 17 | \description{ 18 | Get list of genomes in Cell Ranger output 19 | } 20 | -------------------------------------------------------------------------------- /man/get_genomes_in_matrix_dir.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{get_genomes_in_matrix_dir} 4 | \alias{get_genomes_in_matrix_dir} 5 | \title{Get list of genomes in Cell Ranger output} 6 | \usage{ 7 | get_genomes_in_matrix_dir(pipestance_path, barcode_filtered) 8 | } 9 | \arguments{ 10 | \item{pipestance_path}{Path to the output directory produced by the Cell Ranger pipeline} 11 | 12 | \item{barcode_filtered}{Path to filtered matrix if true, otherwise raw matrix} 13 | } 14 | \value{ 15 | A character vector of the genomes found 16 | } 17 | \description{ 18 | Get list of genomes in Cell Ranger output 19 | } 20 | 21 | -------------------------------------------------------------------------------- /man/get_matrix_dir_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{get_matrix_dir_path} 4 | \alias{get_matrix_dir_path} 5 | \title{Get path to matrices in Cell Ranger output} 6 | \usage{ 7 | get_matrix_dir_path(pipestance_path, barcode_filtered) 8 | } 9 | \arguments{ 10 | \item{pipestance_path}{Path to the output directory produced by the Cell Ranger pipeline} 11 | 12 | \item{barcode_filtered}{If true, get the path to the barcode filtered matrices; else to the raw filtered matrices} 13 | } 14 | \value{ 15 | The path to the matrices directory 16 | } 17 | \description{ 18 | Get path to matrices in Cell Ranger output 19 | } 20 | -------------------------------------------------------------------------------- /man/get_matrix_from_h5.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{get_matrix_from_h5} 4 | \alias{get_matrix_from_h5} 5 | \title{Load gene-barcode matrix from a specific H5 file} 6 | \usage{ 7 | get_matrix_from_h5(filename, genome = NULL) 8 | } 9 | \arguments{ 10 | \item{genome}{The desired genome (e.g., 'hg19' or 'mm10')} 11 | 12 | \item{Path}{to the gene-barcode matrix H5 file (NOT the pipestance path)} 13 | } 14 | \value{ 15 | A GeneBCMatrix sparse matrix where rows are genes and columns are cell-barcodes 16 | } 17 | \description{ 18 | Load gene-barcode matrix from a specific H5 file 19 | } 20 | \examples{ 21 | \dontrun{ 22 | # Load hg19 from a filtered matrix h5 23 | gene_bc_matrix <- get_matrix_from_h5("/home/user/cellranger_output/outs/filtered_gene_bc_matrices_h5.h5", "hg19") 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /man/get_matrix_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{get_matrix_path} 4 | \alias{get_matrix_path} 5 | \title{Get path to a genome matrix in Cell Ranger output} 6 | \usage{ 7 | get_matrix_path(pipestance_path, barcode_filtered, genome) 8 | } 9 | \arguments{ 10 | \item{pipestance_path}{Path to the output directory produced by the Cell Ranger pipeline} 11 | 12 | \item{barcode_filtered}{If true, get the path to the barcode filtered matrix; else to the raw filtered matrix} 13 | 14 | \item{genome}{The desired genome (e.g., 'hg19' or 'mm10')} 15 | } 16 | \value{ 17 | The path to a matrix directory 18 | } 19 | \description{ 20 | Get path to a genome matrix in Cell Ranger output 21 | } 22 | 23 | -------------------------------------------------------------------------------- /man/get_mean_mapped_reads_per_cell.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{get_mean_mapped_reads_per_cell} 4 | \alias{get_mean_mapped_reads_per_cell} 5 | \title{Get mean mapped reads per cell} 6 | \usage{ 7 | get_mean_mapped_reads_per_cell(gbm) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix object} 11 | } 12 | \value{ 13 | Mean confidently mapped, barcoded reads per cell 14 | } 15 | \description{ 16 | Get mean mapped reads per cell 17 | } 18 | \examples{ 19 | \dontrun{ 20 | mapped_rpc <- get_mean_mapped_reads_per_cell(gbm) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /man/get_mean_raw_reads_per_cell.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{get_mean_raw_reads_per_cell} 4 | \alias{get_mean_raw_reads_per_cell} 5 | \title{Get mean raw reads per cell} 6 | \usage{ 7 | get_mean_raw_reads_per_cell(gbm) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix object} 11 | } 12 | \value{ 13 | Mean raw reads per cell 14 | } 15 | \description{ 16 | Get mean raw reads per cell 17 | } 18 | \examples{ 19 | \dontrun{ 20 | raw_rpc <- get_mean_raw_reads_per_cell(gbm1) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /man/get_metric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{get_metric} 4 | \alias{get_metric} 5 | \title{Get a metric from the metric summary} 6 | \usage{ 7 | get_metric(gbm, metric_name) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix object} 11 | 12 | \item{metric_name}{Metric name} 13 | } 14 | \value{ 15 | numeric metric value 16 | } 17 | \description{ 18 | Get a metric from the metric summary 19 | } 20 | -------------------------------------------------------------------------------- /man/get_nonzero_genes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{get_nonzero_genes} 4 | \alias{get_nonzero_genes} 5 | \title{Get the non-zero gene indices from a GeneBCMatrix} 6 | \usage{ 7 | get_nonzero_genes(gbm) 8 | } 9 | \arguments{ 10 | \item{gbm}{a GeneBCMatrix to get the non-zero genes from} 11 | } 12 | \value{ 13 | The gene (row) indices for genes with at least 1 count in the matrix 14 | } 15 | \description{ 16 | Get the non-zero gene indices from a GeneBCMatrix 17 | } 18 | \examples{ 19 | non_zero_gene_ids <- get_nonzero_genes(gbm1) 20 | 21 | } 22 | -------------------------------------------------------------------------------- /man/get_ordered_gene_list_mean_diff.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{get_ordered_gene_list_mean_diff} 4 | \alias{get_ordered_gene_list_mean_diff} 5 | \title{Get ordered gene list by mean difference between clusters} 6 | \usage{ 7 | get_ordered_gene_list_mean_diff(gbm, cluster_labels, test_ID) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix} 11 | 12 | \item{cluster_labels}{An array of integer labels from 1 to k (length = number of cells)} 13 | 14 | \item{test_ID}{A label between 1 to k to be tested} 15 | } 16 | \value{ 17 | an array of genes sorted by the mean differential expression between testID and the rest 18 | } 19 | \description{ 20 | Get ordered gene list by mean difference between clusters 21 | } 22 | -------------------------------------------------------------------------------- /man/get_ordered_gene_list_sseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{get_ordered_gene_list_sseq} 4 | \alias{get_ordered_gene_list_sseq} 5 | \title{Get ordered gene list by the sSeq differential expression method} 6 | \usage{ 7 | get_ordered_gene_list_sseq(gbm, cluster_labels, test_ID, sseq_params, t_mat) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix} 11 | 12 | \item{cluster_labels}{An array of integer labels from 1 to k (length = number of cells)} 13 | 14 | \item{test_ID}{A label between 1 to k to be tested} 15 | 16 | \item{sseq_params}{List returned by compute_sseq_params} 17 | 18 | \item{t_mat}{BC x gene matrix} 19 | } 20 | \value{ 21 | an array of genes sorted by the mean differential expression between testID and the rest 22 | } 23 | \description{ 24 | Get ordered gene list by the sSeq differential expression method 25 | } 26 | -------------------------------------------------------------------------------- /man/get_ordered_gene_list_unique.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{get_ordered_gene_list_unique} 4 | \alias{get_ordered_gene_list_unique} 5 | \title{Get ordered gene list by gene uniqueness} 6 | \usage{ 7 | get_ordered_gene_list_unique(gbm, cluster_labels, test_ID) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix} 11 | 12 | \item{cluster_labels}{An array of integer labels from 1 to k (length = number of cells)} 13 | 14 | \item{test_ID}{A label between 1 to k to be tested} 15 | } 16 | \value{ 17 | an array of genes sorted by the mean differential expression between testID and the rest 18 | } 19 | \description{ 20 | Get ordered gene list by gene uniqueness 21 | } 22 | -------------------------------------------------------------------------------- /man/get_pca_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{get_pca_path} 4 | \alias{get_pca_path} 5 | \title{Load Cell Ranger PCA results from a specified analysis folder} 6 | \usage{ 7 | get_pca_path(analysis_path) 8 | } 9 | \arguments{ 10 | \item{analysis_path}{Path to the analysis output directory produced by Cell Ranger} 11 | } 12 | \value{ 13 | Path to PCA results 14 | } 15 | \description{ 16 | Load Cell Ranger PCA results from a specified analysis folder 17 | } 18 | \examples{ 19 | \dontrun{ 20 | pca_path <- get_pca_path(analysis_path) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /man/get_read_count_mtx.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{get_read_count_mtx} 4 | \alias{get_read_count_mtx} 5 | \title{Get the read count matrix} 6 | \usage{ 7 | get_read_count_mtx(gbm) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix object} 11 | } 12 | \value{ 13 | A dgTMatrix with the same dimension as exprs(gbm) 14 | } 15 | \description{ 16 | Get the read count matrix 17 | } 18 | \examples{ 19 | \dontrun{ 20 | get_read_count_mtx(gbm1) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /man/get_summary_csv_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{get_summary_csv_path} 4 | \alias{get_summary_csv_path} 5 | \title{Get summary csv in Cell Ranger output} 6 | \usage{ 7 | get_summary_csv_path(pipestance_path) 8 | } 9 | \arguments{ 10 | \item{pipestance_path}{Path to the output directory produced by the Cell Ranger pipeline} 11 | } 12 | \value{ 13 | Path to the summary CSV 14 | } 15 | \description{ 16 | Get summary csv in Cell Ranger output 17 | } 18 | -------------------------------------------------------------------------------- /man/get_tsne_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{get_tsne_path} 4 | \alias{get_tsne_path} 5 | \title{Load Cell Ranger t-SNE results from a specified analysis folder} 6 | \usage{ 7 | get_tsne_path(analysis_path) 8 | } 9 | \arguments{ 10 | \item{analysis_path}{Path to the analysis output directory produced by Cell Ranger} 11 | } 12 | \value{ 13 | Path to t-SNE results 14 | } 15 | \description{ 16 | Load Cell Ranger t-SNE results from a specified analysis folder 17 | } 18 | \examples{ 19 | \dontrun{ 20 | tsne_path <- get_tsne_path(analysis_path) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /man/load_analysis_results_from_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{load_analysis_results_from_path} 4 | \alias{load_analysis_results_from_path} 5 | \title{Load Cell Ranger secondary analysis results from a specified analysis folder} 6 | \usage{ 7 | load_analysis_results_from_path(analysis_path) 8 | } 9 | \arguments{ 10 | \item{analysis_path}{Path to the analysis output directory produced by Cell Ranger} 11 | } 12 | \value{ 13 | A list containing: \itemize{ 14 | \item pca - pca projection 15 | \item tsne - tsne projection 16 | \item clustering - clustering results for various clustering methods 17 | } 18 | } 19 | \description{ 20 | Load Cell Ranger secondary analysis results from a specified analysis folder 21 | } 22 | \examples{ 23 | \dontrun{ 24 | analysis <- load_analysis_results_from_path("/home/user/cellranger_output/outs/analysis") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /man/load_cellranger_analysis_results.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{load_cellranger_analysis_results} 4 | \alias{load_cellranger_analysis_results} 5 | \title{Load Cell Ranger secondary analysis results} 6 | \usage{ 7 | load_cellranger_analysis_results(pipestance_path) 8 | } 9 | \arguments{ 10 | \item{pipestance_path}{Path to the output directory produced by Cell Ranger} 11 | } 12 | \value{ 13 | A list containing: \itemize{ 14 | \item pca - pca projection 15 | \item tsne - tsne projection 16 | \item kmeans - kmeans results for various values of K 17 | } 18 | } 19 | \description{ 20 | Load Cell Ranger secondary analysis results 21 | } 22 | \examples{ 23 | \dontrun{ 24 | analysis <- load_cellranger_analysis_results("/home/user/cellranger_output") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /man/load_cellranger_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{load_cellranger_matrix} 4 | \alias{load_cellranger_matrix} 5 | \title{Load data from the 10x Genomics Cell Ranger pipeline} 6 | \usage{ 7 | load_cellranger_matrix(pipestance_path = NULL, genome = NULL, 8 | barcode_filtered = TRUE) 9 | } 10 | \arguments{ 11 | \item{pipestance_path}{Path to the output directory produced by Cell Ranger} 12 | 13 | \item{genome}{The desired genome (e.g., 'hg19' or 'mm10')} 14 | 15 | \item{barcode_filtered}{Load only the cell-containing barcodes} 16 | } 17 | \value{ 18 | A GeneBCMatrix sparse matrix where rows are genes and columns are cell-barcodes 19 | } 20 | \description{ 21 | Load data from the 10x Genomics Cell Ranger pipeline 22 | } 23 | \examples{ 24 | \dontrun{ 25 | # Load from a Cell Ranger output directory 26 | gene_bc_matrix <- load_cellranger_matrix("/home/user/cellranger_output") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /man/load_cellranger_matrix_from_files.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{load_cellranger_matrix_from_files} 4 | \alias{load_cellranger_matrix_from_files} 5 | \title{Load data from the 10x Genomics Cell Ranger pipeline by specifying individual file paths} 6 | \usage{ 7 | load_cellranger_matrix_from_files(mat_fn, gene_fn, barcode_fn, 8 | summary_fn = NULL) 9 | } 10 | \arguments{ 11 | \item{mat_fn}{Path to a .mtx file including matirx entries} 12 | 13 | \item{gene_fn}{Path to a .tsv file including gene information} 14 | 15 | \item{barcode_fn}{Path to a .tsv file including cell barcode information} 16 | 17 | \item{summary_fn}{(Optional) Path to a .csv file including cell barcode information} 18 | } 19 | \value{ 20 | A GeneBCMatrix sparse matrix where rows are genes and columns are cell-barcodes 21 | } 22 | \description{ 23 | Load data from the 10x Genomics Cell Ranger pipeline by specifying individual file paths 24 | } 25 | \examples{ 26 | \dontrun{ 27 | gbm <- load_cellranger_matrix_from_files("matrix.mtx","genes.tsv","barcodes.tsv") 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /man/load_cellranger_matrix_h5.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{load_cellranger_matrix_h5} 4 | \alias{load_cellranger_matrix_h5} 5 | \title{Load HDF5 data from the 10x Genomics Cell Ranger pipeline} 6 | \usage{ 7 | load_cellranger_matrix_h5(pipestance_path = NULL, genome = NULL, 8 | barcode_filtered = TRUE) 9 | } 10 | \arguments{ 11 | \item{pipestance_path}{Path to the output directory produced by Cell Ranger} 12 | 13 | \item{genome}{The desired genome (e.g., 'hg19' or 'mm10')} 14 | 15 | \item{barcode_filtered}{Load only the cell-containing barcodes} 16 | } 17 | \value{ 18 | A GeneBCMatrix sparse matrix where rows are genes and columns are cell-barcodes 19 | } 20 | \description{ 21 | Load HDF5 data from the 10x Genomics Cell Ranger pipeline 22 | } 23 | \examples{ 24 | \dontrun{ 25 | # Load from a Cell Ranger output directory 26 | gene_bc_matrix <- load_cellranger_matrix_h5("/home/user/cellranger_output") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /man/load_cellranger_summary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{load_cellranger_summary} 4 | \alias{load_cellranger_summary} 5 | \title{Load metrics summary from the Cell Ranger pipeline} 6 | \usage{ 7 | load_cellranger_summary(pipestance_path) 8 | } 9 | \arguments{ 10 | \item{pipestance_path}{Path to the output directory produced by the Cell Ranger pipeline} 11 | } 12 | \value{ 13 | The summary csv in a data frame 14 | } 15 | \description{ 16 | Load metrics summary from the Cell Ranger pipeline 17 | } 18 | \examples{ 19 | \dontrun{ 20 | single_cell_metrics <- load_cellranger_summary("/home/user/cellranger_output") 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /man/load_molecule_info.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{load_molecule_info} 4 | \alias{load_molecule_info} 5 | \title{Load molecule info h5 file from the Cell Ranger pipeline} 6 | \usage{ 7 | load_molecule_info(gbm) 8 | } 9 | \arguments{ 10 | \item{gbm}{GeneBCMatrix object to load into} 11 | } 12 | \value{ 13 | A GeneBCMatrix object containing the loaded molecule info 14 | } 15 | \description{ 16 | Load molecule info h5 file from the Cell Ranger pipeline 17 | } 18 | \examples{ 19 | \dontrun{ 20 | gbm1 = load_molecule_info(gbm1) 21 | # Note molecule info stored as gbm1@molecule_info 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /man/load_molecule_info_from_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{load_molecule_info_from_path} 4 | \alias{load_molecule_info_from_path} 5 | \title{Load molecule info h5 file from a specified .h5 file} 6 | \usage{ 7 | load_molecule_info_from_path(gbm, f_path) 8 | } 9 | \arguments{ 10 | \item{gbm}{GeneBCMatrix object to load into} 11 | 12 | \item{f_path}{Path to the molecule_info.h5} 13 | } 14 | \value{ 15 | A GeneBCMatrix object containing the loaded molecule info 16 | } 17 | \description{ 18 | Load molecule info h5 file from a specified .h5 file 19 | } 20 | \examples{ 21 | \dontrun{ 22 | gbm1 = load_molecule_info(gbm1, f_path) 23 | # Note molecule info stored as gbm1@molecule_info 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /man/log_gene_bc_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/normalize.r 3 | \name{log_gene_bc_matrix} 4 | \alias{log_gene_bc_matrix} 5 | \title{Take the element-wise logarithm of a gene-barcode matrix while maintaining sparsity} 6 | \usage{ 7 | log_gene_bc_matrix(gbm, base = 2) 8 | } 9 | \arguments{ 10 | \item{gbm}{a GeneBCMatrix to log} 11 | 12 | \item{base}{base of logarithm to use} 13 | } 14 | \value{ 15 | A GeneBCMatrix with logged counts 16 | } 17 | \description{ 18 | Take the element-wise logarithm of a gene-barcode matrix while maintaining sparsity 19 | } 20 | \examples{ 21 | gbm_log <- log_gene_bc_matrix(gbm1) 22 | 23 | } 24 | -------------------------------------------------------------------------------- /man/merge_clusters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{merge_clusters} 4 | \alias{merge_clusters} 5 | \title{Merge clusters among cluster assignments} 6 | \usage{ 7 | merge_clusters(cluster_result, cluster_select, colour = NULL) 8 | } 9 | \arguments{ 10 | \item{cluster_result}{A vector of integer class labels for each cell} 11 | 12 | \item{cluster_select}{A vector of cluster (integer) ids to select} 13 | 14 | \item{colour}{(Optional) colours assignments for original clusters} 15 | } 16 | \value{ 17 | A list containing: \itemize{ 18 | \item ids - new (consecutive) id labels for each cell after merging integer labels 19 | \item col - new colours (mapping to the ids) corresponding to the integer labels if colour is specified, otherwise equals NULL 20 | } 21 | } 22 | \description{ 23 | Merge clusters among cluster assignments 24 | } 25 | \examples{ 26 | merge_clusters_test(rep(1:5,4),c(1,3,4)) 27 | } 28 | -------------------------------------------------------------------------------- /man/nb_exact_test.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{nb_exact_test} 4 | \alias{nb_exact_test} 5 | \title{Negative binomial exact test as in sSeq} 6 | \usage{ 7 | nb_exact_test(x_a, x_b, s_a, s_b, mu, phi) 8 | } 9 | \arguments{ 10 | \item{x_a}{Total count for a single gene in group A} 11 | 12 | \item{x_b}{Total count for the same gene in group B} 13 | 14 | \item{s_a}{Size factor for group A} 15 | 16 | \item{s_b}{Size factor for group B} 17 | 18 | \item{mu}{Common mean for gene} 19 | 20 | \item{phi}{Common dispersion for gene} 21 | } 22 | \description{ 23 | Negative binomial exact test as in sSeq 24 | } 25 | -------------------------------------------------------------------------------- /man/ncol-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{ncol,GeneBCMatrix-method} 5 | \alias{ncol,GeneBCMatrix-method} 6 | \title{ncol for GeneBCMatrix objects} 7 | \usage{ 8 | \S4method{ncol}{GeneBCMatrix}(x) 9 | } 10 | \arguments{ 11 | \item{x}{a GeneBCMatrix object} 12 | } 13 | \value{ 14 | Result of ncol function on exprs() on GeneBCMatrix 15 | } 16 | \description{ 17 | ncol for GeneBCMatrix objects 18 | } 19 | \examples{ 20 | cell_barcode_count = ncol(gbm1) 21 | } 22 | -------------------------------------------------------------------------------- /man/newGeneBCMatrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \name{newGeneBCMatrix} 4 | \alias{newGeneBCMatrix} 5 | \title{Create a new GeneBCMatrix} 6 | \usage{ 7 | newGeneBCMatrix(mat, fd, pd, template = NULL) 8 | } 9 | \arguments{ 10 | \item{mat}{A sparse matrix whose rows are genes and columns are cell-barcodes} 11 | 12 | \item{fd}{A dataframe with gene IDs as row names and additional metadata such as gene symbols as columns.} 13 | 14 | \item{pd}{A dataframe with cell barcodes as row names and any additional metadata columns.} 15 | 16 | \item{template}{A GeneBCMatrix to copy slots from} 17 | } 18 | \value{ 19 | A new GeneBCMatrix object 20 | } 21 | \description{ 22 | Create a new GeneBCMatrix 23 | } 24 | \examples{ 25 | \dontrun{ 26 | matrix = exprs(gbm1) 27 | featureData = fData(gbm1) 28 | phenoData = pData(gbm1) 29 | 30 | # Note including a template copies all other slots of gbm to new object 31 | new_gbm = newGeneBCMatrix(matrix, fd=featureData, pd=phenoData, template=gbm1) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /man/normalize_barcode_sums_to_median.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/normalize.r 3 | \name{normalize_barcode_sums_to_median} 4 | \alias{normalize_barcode_sums_to_median} 5 | \title{Normalization functions} 6 | \usage{ 7 | normalize_barcode_sums_to_median(gbm) 8 | } 9 | \arguments{ 10 | \item{gbm}{a GeneBCMatrix to normalize} 11 | } 12 | \value{ 13 | A GeneBCMatrix with barcode-normalized values 14 | } 15 | \description{ 16 | Normalize barcodes by sum to the median barcode by sum 17 | } 18 | \examples{ 19 | gbm_norm_by_bc <- normalize_barcode_sums_to_median(gbm1) 20 | 21 | } 22 | -------------------------------------------------------------------------------- /man/nrow-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{nrow,GeneBCMatrix-method} 5 | \alias{nrow,GeneBCMatrix-method} 6 | \title{nrow for GeneBCMatrix objects} 7 | \usage{ 8 | \S4method{nrow}{GeneBCMatrix}(x) 9 | } 10 | \arguments{ 11 | \item{x}{a GeneBCMatrix object} 12 | } 13 | \value{ 14 | Result of nrow function on exprs() on GeneBCMatrix 15 | } 16 | \description{ 17 | nrow for GeneBCMatrix objects 18 | } 19 | \examples{ 20 | gene_count = nrow(gbm1) 21 | } 22 | -------------------------------------------------------------------------------- /man/order_cell_by_clusters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{order_cell_by_clusters} 4 | \alias{order_cell_by_clusters} 5 | \title{Order cells based on clusters} 6 | \usage{ 7 | order_cell_by_clusters(gbm, clu) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix} 11 | 12 | \item{clu}{An array of integer labels from 1 to k (length = number of cells)} 13 | } 14 | \value{ 15 | A list of (n_top_genes * number of clusters) genes (may include duplicates) 16 | } 17 | \description{ 18 | Order cells based on clusters 19 | } 20 | \examples{ 21 | \dontrun{ 22 | order_cell_by_clusters(gbm_log,clu) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /man/plot_barcode_counts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.r 3 | \name{plot_barcode_counts} 4 | \alias{plot_barcode_counts} 5 | \title{Plotting functions} 6 | \usage{ 7 | plot_barcode_counts(gene_bc_matrix) 8 | } 9 | \arguments{ 10 | \item{gene_bc_matrix}{A GeneBCMatrix object} 11 | } 12 | \value{ 13 | none. plot is generated. 14 | } 15 | \description{ 16 | Plot barcode distribution 17 | } 18 | \details{ 19 | Plot the barcode counts in descending order on a log-scale 20 | } 21 | \examples{ 22 | \dontrun{ 23 | plot_barcode_counts(gbm1) 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/plot_population_corr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.r 3 | \name{plot_population_corr} 4 | \alias{plot_population_corr} 5 | \title{Plot correlation heatmap} 6 | \usage{ 7 | plot_population_corr(pop_avg, method = "spearman") 8 | } 9 | \arguments{ 10 | \item{pop_avg}{An input matrix (rownames will be used) where rows are samples and columns are features} 11 | 12 | \item{method}{The correlation method for the cor() function to compute pairwise correlations} 13 | } 14 | \value{ 15 | none. a pheatmap is generated. 16 | } 17 | \description{ 18 | Generate a pheatmap that shows the correlation between pairs of rows in an input matrix 19 | } 20 | \examples{ 21 | plot_population_corr(gbm,genes_to_plot,cells_to_plot) 22 | 23 | } 24 | -------------------------------------------------------------------------------- /man/plus-GeneBCMatrix-missing-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{+,GeneBCMatrix,missing-method} 5 | \alias{+,GeneBCMatrix,missing-method} 6 | \title{Unary identity of GeneBCMatrix objects} 7 | \usage{ 8 | \S4method{+}{GeneBCMatrix,missing}(e1, e2) 9 | } 10 | \arguments{ 11 | \item{e1}{GeneBCMatrix} 12 | 13 | \item{e2}{dummy} 14 | } 15 | \value{ 16 | result from operator 17 | } 18 | \description{ 19 | Unary identity of GeneBCMatrix objects 20 | } 21 | -------------------------------------------------------------------------------- /man/prioritize_genes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{prioritize_genes} 4 | \alias{prioritize_genes} 5 | \title{Prioritize genes that are most significant markers for each cluster} 6 | \usage{ 7 | prioritize_genes(gbm, clu, method) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix (recommended to be normalized by UMI counts and log-transformed)} 11 | 12 | \item{clu}{An array of integer labels from 1 to k (length = number of cells)} 13 | 14 | \item{method}{Method to priortize genes: currently only supports mean difference} 15 | 16 | \item{n_top_genes}{Number of top genes for each cluster group to consider} 17 | } 18 | \description{ 19 | Prioritize genes that are most significant markers for each cluster 20 | } 21 | \examples{ 22 | \dontrun{ 23 | prioritize_top_genes(gbm_log,clu,3,'mean_diff') 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /man/prioritize_top_genes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{prioritize_top_genes} 4 | \alias{prioritize_top_genes} 5 | \title{Prioritize genes that are most significant markers for each cluster} 6 | \usage{ 7 | prioritize_top_genes(gbm, clu, method, logscale = TRUE, p_cutoff = 0.05, 8 | min_mean = 1, min_log2fc = 0, order_by = "pvalue") 9 | } 10 | \arguments{ 11 | \item{gbm}{A GeneBCMatrix (recommended to be normalized by UMI counts and log-transformed for the "mean_diff" method). For the "sseq" method, this should be a raw (unnormalized) GeneBCMatrix.} 12 | 13 | \item{clu}{An array of integer labels from 1 to k (length = number of cells)} 14 | 15 | \item{method}{Method to prioritize genes: currently only supports mean difference ('mean_diff', 'unique', or 'sseq')} 16 | 17 | \item{logscale}{Logical if the input is log-scale or not (default: TRUE)} 18 | 19 | \item{p_cutoff}{If method is "sseq," only consider genes w/ adjusted p-value below this value} 20 | 21 | \item{min_mean}{If method is "sseq," only consider genes w/ mean normalized UMI counts/cell exceeding this value} 22 | 23 | \item{min_log2fc}{If method is "sseq," only consider genes with at least this log2 fold-change} 24 | 25 | \item{order_by}{If method is "sseq," sort genes by 'pvalue' or by 'log2fc'} 26 | 27 | \item{n_top_genes}{Number of top genes for each cluster group to consider} 28 | } 29 | \description{ 30 | Prioritize genes that are most significant markers for each cluster 31 | } 32 | \examples{ 33 | \dontrun{ 34 | prioritize_top_genes(gbm, cluster_labels, 'sseq') 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /man/rowMeans-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{rowMeans,GeneBCMatrix-method} 5 | \alias{rowMeans,GeneBCMatrix-method} 6 | \title{rowMeans for GeneBCMatrix objects} 7 | \usage{ 8 | \S4method{rowMeans}{GeneBCMatrix}(x, na.rm, dims = 1) 9 | } 10 | \arguments{ 11 | \item{x}{a GeneBCMatrix object} 12 | 13 | \item{na.rm}{na.rm argument base function} 14 | 15 | \item{dims}{dims argument passed to base function} 16 | } 17 | \value{ 18 | Result of rowMeans function on exprs() on GeneBCMatrix 19 | } 20 | \description{ 21 | rowMeans for GeneBCMatrix objects 22 | } 23 | \examples{ 24 | average_umis_per_gene = rowMeans(gbm1) 25 | } 26 | -------------------------------------------------------------------------------- /man/rowSums-GeneBCMatrix-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \docType{methods} 4 | \name{rowSums,GeneBCMatrix-method} 5 | \alias{rowSums,GeneBCMatrix-method} 6 | \title{rowSums for GeneBCMatrix objects} 7 | \usage{ 8 | \S4method{rowSums}{GeneBCMatrix}(x, na.rm, dims = 1) 9 | } 10 | \arguments{ 11 | \item{x}{a GeneBCMatrix object} 12 | 13 | \item{na.rm}{na.rm argument base function} 14 | 15 | \item{dims}{dims argument passed to base function} 16 | } 17 | \value{ 18 | Result of rowSums function on exprs() on GeneBCMatrix 19 | } 20 | \description{ 21 | rowSums for GeneBCMatrix objects 22 | } 23 | \examples{ 24 | umi_counts_per_gene = rowSums(gbm1) 25 | } 26 | -------------------------------------------------------------------------------- /man/run_differential_expression.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{run_differential_expression} 4 | \alias{run_differential_expression} 5 | \title{Run differential expression analysis between two sets of cells} 6 | \usage{ 7 | run_differential_expression(gbm, cell_indices0, cell_indices1) 8 | } 9 | \arguments{ 10 | \item{gbm}{GeneBCMatrix} 11 | 12 | \item{cell_indices0}{(integer) Indices of cells in group A} 13 | 14 | \item{cell_indices1}{(integer) Indices of cells in group B} 15 | } 16 | \value{ 17 | A data frame containing differential expression results for each gene. 18 | } 19 | \description{ 20 | Run differential expression analysis between two sets of cells 21 | } 22 | \examples{ 23 | \dontrun{ 24 | de_result <- run_differential_expression(gbm, 1:500, 501:1000) 25 | top_results <- de_result \%>\% filter(p_adj < 0.05) \%>\% arrange(desc(log2fc)) 26 | head(top_results) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /man/run_kmeans_clustering.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{run_kmeans_clustering} 4 | \alias{run_kmeans_clustering} 5 | \title{Run k-means clustering} 6 | \usage{ 7 | run_kmeans_clustering(pca, k, n_pcs = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{pca}{A PCA result from run_pca()} 11 | 12 | \item{k}{number of clusters} 13 | 14 | \item{n_pcs}{The number of top pca components to use (default is to use all pcs)} 15 | 16 | \item{...}{parameters to pass to kmeans} 17 | } 18 | \value{ 19 | See ?kmeans. The item of interest is the 'cluster' element 20 | } 21 | \description{ 22 | Run k-means clustering 23 | } 24 | \examples{ 25 | pca <- run_pca(gbm1, n_pcs=10) 26 | km_res <- run_kmeans_clustering(pca, k=5) 27 | 28 | } 29 | \seealso{ 30 | kmeans 31 | } 32 | -------------------------------------------------------------------------------- /man/run_pca.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{run_pca} 4 | \alias{run_pca} 5 | \title{Analysis functions} 6 | \usage{ 7 | run_pca(gbm, n_pcs = 10, logscale = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{gbm}{a GeneBCMatrix to run PCA on (must set logscale=TRUE if it is already log-transformed)} 11 | 12 | \item{n_pcs}{The number of principal components to compute (default: 10)} 13 | 14 | \item{logscale}{Logical if the input is log-scale or not (default: FALSE)} 15 | } 16 | \value{ 17 | A list containing \itemize{ 18 | \item "x" - The rotated data matrix where rows are barcodes and columns are PCs 19 | \item "sdev" - the standard deviations of the principal components (i.e., sqrt of eigvals of the covariance matrix) 20 | \item "rotation" - The loadings (eigenvectors) where each column is a PC 21 | \item "tot_var" - The total variation in the scaled and centered matrix (this is also the effective rank of the matrix) 22 | \item "var_pcs" - The proportion of variance explained by each principle comoponent 23 | \item "use_genes" - The list of gene indices that were used 24 | \item "normalized_mat" - The matrix that was used as input to the PCA 25 | } 26 | } 27 | \description{ 28 | Run principal components analysis to reduce the dimensionality of a gene-barcode matrix 29 | } 30 | \examples{ 31 | pca <- run_pca(gbm1, n_pcs=2) 32 | plot(PC2 ~ PC1, pca$x) 33 | 34 | } 35 | -------------------------------------------------------------------------------- /man/run_tsne.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{run_tsne} 4 | \alias{run_tsne} 5 | \title{Project dimensionally reduced gene-barcode matrix into a visualizable space via t-SNE} 6 | \usage{ 7 | run_tsne(pca_res, n_pcs = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{pca_res}{A PCA result from run_pca()} 11 | 12 | \item{n_pcs}{The number of top pca components to use (default is to use all pcs)} 13 | 14 | \item{...}{parameters to pass to Rtsne} 15 | } 16 | \value{ 17 | See ?Rtsne in the Rtsne package. The item of interest is the 'Y' element which contains the coordinates. 18 | } 19 | \description{ 20 | Project dimensionally reduced gene-barcode matrix into a visualizable space via t-SNE 21 | } 22 | \examples{ 23 | \dontrun{ 24 | pca <- run_pca(gbm1, n_pcs=10) 25 | tsne_res <- run_tsne(pca) 26 | plot(tsne_res$Y[,1], tsne_res$Y[,2]) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /man/save_cellranger_matrix_h5.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/io.r 3 | \name{save_cellranger_matrix_h5} 4 | \alias{save_cellranger_matrix_h5} 5 | \title{Save a single-genome GeneBCMatrix as an h5 file for input into `cellranger reanalyze`} 6 | \usage{ 7 | save_cellranger_matrix_h5(gbm, out_filename, genome_name, template = NULL, 8 | overwrite = FALSE) 9 | } 10 | \arguments{ 11 | \item{gbm}{GeneBCMatrix to write} 12 | 13 | \item{out_filename}{The HDF5 filename to write to} 14 | 15 | \item{genome_name}{The original genome name (e.g., GRCh38)} 16 | 17 | \item{template}{Path to the original matrix.h5 file.} 18 | 19 | \item{overwrite}{Overwrite the HDF5 file if it exists} 20 | } 21 | \description{ 22 | Save a single-genome GeneBCMatrix as an h5 file for input into `cellranger reanalyze` 23 | } 24 | \examples{ 25 | \dontrun{ 26 | # Save a gbm as a matrix HDF5 file 27 | save_cellranger_matrix_h5(gbm, "new_matrix.h5", "GRCh38") 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /man/select_cells_by_clusterID.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{select_cells_by_clusterID} 4 | \alias{select_cells_by_clusterID} 5 | \title{Select cells according to cluster IDs} 6 | \usage{ 7 | select_cells_by_clusterID(cluster_result, cluster_select) 8 | } 9 | \arguments{ 10 | \item{cluster_result}{A vector of class labels for each cell} 11 | 12 | \item{cluster_select}{A vector (or scalar) of cluster ids to select} 13 | } 14 | \value{ 15 | Logical whether or not a cell is selected 16 | } 17 | \description{ 18 | Select cells according to cluster IDs 19 | } 20 | \examples{ 21 | select_cells_by_clusterID(rep(1:5,4),c(1,3,4)) 22 | } 23 | -------------------------------------------------------------------------------- /man/select_clusters_by_gene_markers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{select_clusters_by_gene_markers} 4 | \alias{select_clusters_by_gene_markers} 5 | \title{Select cells by clusters according to the fraction of cells that express at least one of the input gene markers} 6 | \usage{ 7 | select_clusters_by_gene_markers(gbm, gene_symbols, cluster, frac) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix (recommended to be normalized by UMI counts and log-transformed)} 11 | 12 | \item{gene_symbols}{A list of gene symbols} 13 | 14 | \item{cluster}{A vector of class labels for each cell} 15 | 16 | \item{frac}{Minimum fraction of cells in a cluster required for the cluster to be selected} 17 | } 18 | \value{ 19 | Logical whether or not a cell is selected 20 | } 21 | \description{ 22 | Select cells by clusters according to the fraction of cells that express at least one of the input gene markers 23 | } 24 | \examples{ 25 | select_cells_by_clusterID(rep(1:5,4),c(1,3,4)) 26 | } 27 | -------------------------------------------------------------------------------- /man/sparse_pca.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{sparse_pca} 4 | \alias{sparse_pca} 5 | \title{Run a fast PCA algorithm while maintaining sparsity} 6 | \usage{ 7 | sparse_pca(x, n_pcs, mu = NULL, s = NULL, center_scale = TRUE) 8 | } 9 | \arguments{ 10 | \item{x}{a sparse matrix to run PCA on} 11 | 12 | \item{n_pcs}{number of principal components to compute} 13 | 14 | \item{mu}{column means} 15 | 16 | \item{s}{column standard deviations} 17 | 18 | \item{center_scale}{perform centering and scaling} 19 | } 20 | \value{ 21 | A list containing \itemize{ 22 | \item "x" - The rotated data matrix where rows are barcodes and columns are PCs 23 | \item "sdev" - the standard deviations of the principal components (i.e., sqrt of eigvals of the covariance matrix) 24 | \item "rotation" - The loadings (eigenvectors) where each column is a PC 25 | \item "tot_var" - The total variation in the scaled and centered matrix (this is also the effective rank of the matrix) 26 | \item "var_pcs" - The proportion of variance explained by each principle comoponent 27 | } 28 | } 29 | \description{ 30 | Run a fast PCA algorithm while maintaining sparsity 31 | } 32 | \examples{ 33 | \dontrun{ 34 | pca <- sparse_pca(x, n_pcs=10) 35 | plot(pca$x[,1], pca$x[,2], xlab='PC1', ylab='PC2') 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /man/sseq_differential_expression.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{sseq_differential_expression} 4 | \alias{sseq_differential_expression} 5 | \title{Compute differential expression using the sSeq method} 6 | \usage{ 7 | sseq_differential_expression(x, cond0, cond1, sseq_params, gene_ids, 8 | gene_symbols) 9 | } 10 | \arguments{ 11 | \item{x}{(cell x gene) Count matrix} 12 | 13 | \item{cond0}{(integer) Indices of cells in group A} 14 | 15 | \item{cond1}{(integer) Indices of cells in group B} 16 | 17 | \item{sseq_params}{Params precomputed from whole sample} 18 | } 19 | \description{ 20 | Compute differential expression using the sSeq method 21 | } 22 | -------------------------------------------------------------------------------- /man/subsample_gene_bc_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{subsample_gene_bc_matrix} 4 | \alias{subsample_gene_bc_matrix} 5 | \title{Subsample a matrix to a given sequencing depth} 6 | \usage{ 7 | subsample_gene_bc_matrix(gbm, target_reads_per_cell, 8 | target_type = "raw_reads", verbose = TRUE) 9 | } 10 | \arguments{ 11 | \item{gbm}{GeneBCMatrix object to subsample} 12 | 13 | \item{target_reads_per_cell}{Target depth specified as reads per cell} 14 | 15 | \item{target_type}{Type of reads specified in target_reads_per_cell; one of: \itemize{ 16 | \item \code{"raw_reads"} - Raw reads per cell. 17 | \item \code{"mapped_reads"} Confidently mapped, barcoded reads per cell. Raw reads are sufficient in most cases, but if the valid barcode fraction or confidently mapped read fraction vary greatly between samples, this option should be used. 18 | }} 19 | 20 | \item{verbose}{Print status messages along the way} 21 | } 22 | \value{ 23 | A new GeneBCMatrix object that has been subsampled to the specified read depth 24 | } 25 | \description{ 26 | Subsample a matrix to a given sequencing depth so it is comparable to matrices from other samples 27 | } 28 | \examples{ 29 | \dontrun{ 30 | new_reads_per_cell = 10000 # downsampling read depth per cell to 10000 31 | gbm1 = load_molecule_info(gbm1) 32 | gbm1_subsampled = subsample_gene_bc_matrix(gbm1, 10000) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /man/train_multinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/analysis.r 3 | \name{train_multinomial} 4 | \alias{train_multinomial} 5 | \title{Train a multinomial distribution from a vector} 6 | \usage{ 7 | train_multinomial(x) 8 | } 9 | \arguments{ 10 | \item{x}{An input vector of values} 11 | } 12 | \value{ 13 | A scaled vector of frequencies 14 | } 15 | \description{ 16 | Train a multinomial distribution from a vector 17 | } 18 | \examples{ 19 | train_multinomial(1:10) 20 | } 21 | -------------------------------------------------------------------------------- /man/trunc_gbm_by_genes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{trunc_gbm_by_genes} 4 | \alias{trunc_gbm_by_genes} 5 | \title{Truncate a GeneBCMatrix according to an array of gene symbols} 6 | \usage{ 7 | trunc_gbm_by_genes(gbm, gene_symbols) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix} 11 | 12 | \item{gene_symbols}{A list of gene symbols} 13 | } 14 | \value{ 15 | A GeneBCMatrix truncated to genes with specific gene symbols 16 | } 17 | \description{ 18 | Truncate a GeneBCMatrix according to an array of gene symbols 19 | } 20 | \examples{ 21 | gbm_trunc <- trunc_gbm_by_genes(gbm1,c('CD79A','NKG7')) 22 | 23 | } 24 | -------------------------------------------------------------------------------- /man/unary_arith_op.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \name{unary_arith_op} 4 | \alias{unary_arith_op} 5 | \title{Delegate a unary arithmetic operator to the matrix slot} 6 | \usage{ 7 | unary_arith_op(e1, e2) 8 | } 9 | \arguments{ 10 | \item{e1}{GeneBCMatrix object} 11 | 12 | \item{e2}{dummy} 13 | } 14 | \value{ 15 | result from operator 16 | } 17 | \description{ 18 | Delegate a unary arithmetic operator to the matrix slot 19 | } 20 | -------------------------------------------------------------------------------- /man/unary_op.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/class_gene_bc_matrix.r 3 | \name{unary_op} 4 | \alias{unary_op} 5 | \title{Delegate a unary operator to the matrix slot} 6 | \usage{ 7 | unary_op(x) 8 | } 9 | \arguments{ 10 | \item{x}{GeneBCMatrix object} 11 | } 12 | \value{ 13 | result from operator 14 | } 15 | \description{ 16 | Delegate a unary operator to the matrix slot 17 | } 18 | -------------------------------------------------------------------------------- /man/visualize_clusters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.r 3 | \name{visualize_clusters} 4 | \alias{visualize_clusters} 5 | \title{Visualize class labels under a 2D projection} 6 | \usage{ 7 | visualize_clusters(cluster_result, projection, colour = NULL, alpha = 1, 8 | marker_size = 0.1, title = NULL, legend_anno = NULL) 9 | } 10 | \arguments{ 11 | \item{cluster_result}{A vector or matrix of class labels for each cell (row)} 12 | 13 | \item{projection}{A two column matrix projection of each cell} 14 | 15 | \item{colour}{(Optional) Customized colors for each class label} 16 | 17 | \item{alpha}{(Optional) Transparancy parameter for ggplot} 18 | 19 | \item{marker_size}{(Optional) Marker size for ggplot} 20 | 21 | \item{title}{(Optional) Title for ggplot} 22 | 23 | \item{legend_anno}{(Optional) Array of characters for legend annotation} 24 | } 25 | \value{ 26 | A ggplot object with facets corresponding to each gene symbol 27 | } 28 | \description{ 29 | Generate a ggplot object that highlights specified class labels 30 | } 31 | \examples{ 32 | \dontrun{ 33 | visualize_clusters(cluster_result,tsne_proj) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /man/visualize_gene_markers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.r 3 | \name{visualize_gene_markers} 4 | \alias{visualize_gene_markers} 5 | \title{Visualize gene markers under a 2D projection} 6 | \usage{ 7 | visualize_gene_markers(gbm, gene_probes, projection, limits = c(0, 10), 8 | marker_size = 0.1, title = NULL) 9 | } 10 | \arguments{ 11 | \item{gbm}{A GeneBCMatrix object (recommended to be normalized by UMI counts and log-transformed)} 12 | 13 | \item{gene_probes}{A vector of gene symbols to highlight} 14 | 15 | \item{projection}{A two column matrix projection of each cell} 16 | 17 | \item{limits}{(min,max) saturates values on the color bar} 18 | } 19 | \value{ 20 | A ggplot object with facets corresponding to each gene symbol 21 | } 22 | \description{ 23 | Generate a ggplot object that highlights gene markers 24 | } 25 | \examples{ 26 | \dontrun{ 27 | visualize_gene_markers(gbm,c('gene1','gene2'),tsne_proj) 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /man/visualize_umi_counts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.r 3 | \name{visualize_umi_counts} 4 | \alias{visualize_umi_counts} 5 | \title{Visualize total umi counts under a 2D projection} 6 | \usage{ 7 | visualize_umi_counts(gbm, projection, limits = c(0, 10), marker_size = 0.1) 8 | } 9 | \arguments{ 10 | \item{gbm}{A GeneBCMatrix object (NOT log-transformed)} 11 | 12 | \item{projection}{A two column matrix projection of each cell} 13 | 14 | \item{limits}{(min,max) saturates values on the color bar} 15 | } 16 | \value{ 17 | A ggplot object with facets corresponding to each gene symbol 18 | } 19 | \description{ 20 | Generate a ggplot object that highlights UMI counts 21 | } 22 | \examples{ 23 | \dontrun{ 24 | visualize_umi_counts(gbm,tsne_proj) 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /man/visualize_variable_genes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.r 3 | \name{visualize_variable_genes} 4 | \alias{visualize_variable_genes} 5 | \title{Visualize variable genes} 6 | \usage{ 7 | visualize_variable_genes(gene_dispersion, used = FALSE, marker_size = 1) 8 | } 9 | \arguments{ 10 | \item{gene_dispersion}{Dispersion for each gene (output from function get_gene_dispersion())} 11 | 12 | \item{used}{(Optional) if TRUE will plot the used genes} 13 | 14 | \item{marker_size}{(Optional) marker size (default: 0)} 15 | } 16 | \value{ 17 | none. A ggplot object that shows normalized dispersion v.s. mean expression 18 | } 19 | \description{ 20 | Visualize variable genes 21 | } 22 | \examples{ 23 | plot_population_corr(gbm,genes_to_plot,cells_to_plot) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /man/write_cluster_specific_genes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/util.r 3 | \name{write_cluster_specific_genes} 4 | \alias{write_cluster_specific_genes} 5 | \title{Write cluster-specific genes to file} 6 | \usage{ 7 | write_cluster_specific_genes(gene_clusters, gene_folder_path, n_genes = 10, 8 | output_type = "symbol") 9 | } 10 | \arguments{ 11 | \item{gene_clusters}{A list of genes that are prioritized (output from function: prioritize_genes)} 12 | 13 | \item{gene_folder_path}{Path to folder to store the cluster-specific genes} 14 | 15 | \item{n_genes}{Number of genes to include for each cluster} 16 | 17 | \item{output_type}{The format of the output gene list "ensembl" or "symbol} 18 | } 19 | \value{ 20 | matrix that includes all the genes written to a folder 21 | } 22 | \description{ 23 | Write cluster-specific genes to file 24 | } 25 | \examples{ 26 | \dontrun{ 27 | write_cluster_specific_genes(genes_to_plot,GENE_RES_FOLDER, n_genes=10,output_type='ensembl') 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /scripts/download_samples.R: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | 3 | # Download data used in the vignette 4 | 5 | #Sys.setenv(RKIT_VIGNETTE_PIPESTANCE_BASE_PATH='/path/to/cellranger/pipestances') 6 | 7 | PIPESTANCE_BASE_PATH <- Sys.getenv('RKIT_VIGNETTE_PIPESTANCE_BASE_PATH') 8 | 9 | if (PIPESTANCE_BASE_PATH == '') { 10 | stop('Please set the RKIT_VIGNETTE_PIPESTANCE_BASE_PATH environment variable. (to, e.g., /path/to/cellranger/pipestances)') 11 | } 12 | if (!file.exists(PIPESTANCE_BASE_PATH)) { 13 | dir.create(PIPESTANCE_BASE_PATH, recursive=T) 14 | } 15 | 16 | download_sample(sample_name="pbmc3k", sample_dir=file.path(PIPESTANCE_BASE_PATH, 'pbmc3k'), host="http://s3-us-west-2.amazonaws.com/10x.files/samples/cell/", lite=F) 17 | download_sample(sample_name="pbmc6k", sample_dir=file.path(PIPESTANCE_BASE_PATH, 'pbmc6k'), host="http://s3-us-west-2.amazonaws.com/10x.files/samples/cell/", lite=F) 18 | -------------------------------------------------------------------------------- /scripts/rkit-install-1.1.0.R: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. 3 | # 4 | check_package_version = function(pkg_name, min_version) { 5 | package_version = packageVersion(pkg_name) 6 | if(package_version < min_version) stop(sprintf("Version %s of %s found, need at least %s", package_version, pkg_name, min_version)) 7 | } 8 | 9 | message('\nCell Ranger R Kit Installer') 10 | message('Copyright (c) 2016 10x Genomics, Inc. All rights reserved.') 11 | message('----------------------------------------------------------') 12 | eula <- readline("By continuing, you are agreeing to the EULA at: http://support.10xgenomics.com/license\n[ hit enter to continue ]\n") 13 | 14 | # Try to install rhdf5 correctly for all versions of R 15 | source("http://bioconductor.org/biocLite.R") 16 | biocLite(suppressUpdates=TRUE) 17 | 18 | biocLite("rhdf5", siteRepos="http://bioconductor.org/packages/3.3/bioc", suppressUpdates=TRUE) 19 | check_package_version("rhdf5", 2.14) 20 | 21 | packages = c( 22 | "Matrix", 23 | "ggplot2", 24 | "bit64", 25 | "data.table", 26 | "Rtsne", 27 | "pheatmap", 28 | "irlba", 29 | "Rmisc" 30 | ) 31 | 32 | for(package in packages) { 33 | install.packages(package) 34 | } 35 | 36 | install.packages("http://s3-us-west-2.amazonaws.com/10x.files/code/cellrangerRkit-1.1.0.tar.gz", repos=NULL) 37 | -------------------------------------------------------------------------------- /scripts/rkit-install-2.0.0.R: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. 3 | # 4 | check_package_version = function(pkg_name, min_version) { 5 | package_version = packageVersion(pkg_name) 6 | if(package_version < min_version) stop(sprintf("Version %s of %s found, need at least %s", package_version, pkg_name, min_version)) 7 | } 8 | 9 | message('\nCell Ranger R Kit Installer') 10 | message('Copyright (c) 2016 10x Genomics, Inc. All rights reserved.') 11 | message('----------------------------------------------------------') 12 | eula <- readline("By continuing, you are agreeing to the EULA at: http://support.10xgenomics.com/license\n[ hit enter to continue ]\n") 13 | 14 | # Try to install rhdf5 correctly for all versions of R 15 | source("http://bioconductor.org/biocLite.R") 16 | biocLite(suppressUpdates=TRUE) 17 | 18 | biocLite("rhdf5", siteRepos="http://bioconductor.org/packages/3.3/bioc", suppressUpdates=TRUE) 19 | check_package_version("rhdf5", 2.14) 20 | 21 | packages = c( 22 | "Matrix", 23 | "ggplot2", 24 | "bit64", 25 | "data.table", 26 | "Rtsne", 27 | "pheatmap", 28 | "irlba", 29 | "Rmisc" 30 | ) 31 | 32 | for(package in packages) { 33 | install.packages(package) 34 | } 35 | 36 | install.packages("http://s3-us-west-2.amazonaws.com/10x.files/code/cellrangerRkit-2.0.0.tar.gz", repos=NULL) 37 | -------------------------------------------------------------------------------- /scripts/run_knitr.R: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. 3 | # 4 | 5 | # compile document with knitr 6 | library('knitr') 7 | setwd(dir='vignettes') 8 | 9 | cat('Running Sweave2knitr...\n') 10 | Sweave2knitr("cellrangerrkit-PBMC-vignette.Rnw") 11 | 12 | cat('Running knit...\n') 13 | knit(file.path(getwd(), 'cellrangerrkit-PBMC-vignette-knitr.Rnw')) 14 | 15 | cat ('Running pdflatex...\n') 16 | system("pdflatex cellrangerrkit-PBMC-vignette-knitr.tex") 17 | -------------------------------------------------------------------------------- /scripts/saved_variables.R: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | 3 | cat(sprintf("Loaded cellrangerRkit version %s\n", packageVersion('cellrangerRkit'))) 4 | cat("Building cellrangerRkit vignette...\n") 5 | 6 | # Set RKIT_VIGNETTE_PIPESTANCE_BASE_PATH 7 | # Set RKIT_VIGNETTE_CACHE_PATH 8 | # 1) Run download_samples.R 9 | # 2) Run saved_variables.R (the vignette also calls this) 10 | 11 | ## Preload data for the vignette. 12 | # Take as input a cellranger pipestance and load variables used by the rkit vignette. 13 | # Caches these data in an RDS file at a specified location. 14 | 15 | #Sys.setenv(RKIT_VIGNETTE_PIPESTANCE_BASE_PATH='/path/to/rkit_vignette_data/pipestances') 16 | #Sys.setenv(RKIT_VIGNETTE_CACHE_PATH='/path/to/rkit_vignette_data') 17 | 18 | PIPESTANCE_BASE_PATH <- Sys.getenv('RKIT_VIGNETTE_PIPESTANCE_BASE_PATH') 19 | CACHE_PATH <- Sys.getenv('RKIT_VIGNETTE_CACHE_PATH') 20 | 21 | if (PIPESTANCE_BASE_PATH == '') { 22 | stop('Please set the RKIT_VIGNETTE_PIPESTANCE_BASE_PATH environment variable. (to, e.g., /path/to/rkit_vignette_data/pipestances)') 23 | } 24 | if (CACHE_PATH == '') { 25 | stop('Please set the RKIT_VIGNETTE_CACHE_PATH environment variable. (to, e.g., /path/to/rkit_vignette_data). The output of this script goes there.') 26 | } 27 | 28 | if (!file.exists(CACHE_PATH)) { 29 | dir.create(CACHE_PATH, recursive=T) 30 | } 31 | 32 | get_pipestance_data <- function(name, pipestance_base_path=PIPESTANCE_BASE_PATH, cache_path=CACHE_PATH, force=FALSE) { 33 | # See if we need to generate a new rds 34 | rds_filename <- file.path(cache_path, sprintf('%s.rds', name)) 35 | if (!force && file.exists(rds_filename)) { 36 | cat(sprintf('Using cached data for %s at %s\n', name, rds_filename)) 37 | return(readRDS(rds_filename)) 38 | } 39 | 40 | # Regenerate the RDS 41 | cat(sprintf('Did not find cached data for %s at %s\n', name, rds_filename)) 42 | cat('Regenerating cached data...\n') 43 | pipestance_path <- file.path(pipestance_base_path, name) 44 | gbm <- load_cellranger_matrix(pipestance_path) 45 | print(gbm@pipestance_path) 46 | analysis_results <- load_cellranger_analysis_results(pipestance_path) 47 | saveRDS(list(gbm=gbm, analysis_results=analysis_results), file=rds_filename) 48 | cat('done.\n') 49 | return(readRDS(rds_filename)) 50 | } 51 | 52 | # Test CR1.2.0 data 53 | #pbmc4k_data <- get_pipestance_data('pbmc4k') 54 | 55 | # Load CR1.1.0 vignette data (pbmc3k,pbmc6k) 56 | pbmc3k_data <- get_pipestance_data('pbmc3k') 57 | pbmc6k_data <- get_pipestance_data('pbmc6k') 58 | 59 | 60 | # The vignette requires: 61 | # gbm 62 | # analysis_results 63 | # merged_tsne_clust 64 | 65 | gbm <- pbmc3k_data$gbm 66 | analysis_results <- pbmc3k_data$analysis_results 67 | 68 | # Generate merged_tsne_clust 69 | 70 | get_merged_analysis <- function(gbm1, gbm2, cache_filename=merged_rds_filename) { 71 | if (!file.exists(cache_filename)) { 72 | cat(sprintf('Did not find cached data for pbmc3k_pbmc6k_merged.rds at %s\n', merged_rds_filename)) 73 | cat('Regenerating cached data...\n') 74 | set.seed(0) 75 | gbm_list <- list(gbm1, gbm2) 76 | gbm_list <- lapply(gbm_list,load_molecule_info) # load sample molecule information 77 | gbm_list_equalized <- equalize_gbms(gbm_list) # equalize the gene-barcode matrices 78 | merged_gbm <- concatenate_gene_bc_matrices(gbm_list_equalized) 79 | merged_ID <- unlist(lapply(1:length(gbm_list), function(x) rep(x,dim(gbm_list[[x]])[2]))) 80 | 81 | set.seed(0) 82 | n_clust <- 5 83 | pca_result <- run_pca(merged_gbm) 84 | tsne_result <- run_tsne(pca_result) 85 | kmeans_result <- run_kmeans_clustering(pca_result, k=n_clust) 86 | # included re-named cell IDs, t-SNE and k-means result in a merged data frame 87 | merged_tsne_clust <- data.frame(Barcode=as.factor(1:tsne_result$N), 88 | TSNE.1=tsne_result$Y[,1],TSNE.2=tsne_result$Y[,2], 89 | Cluster=kmeans_result$cluster,Batch=merged_ID) 90 | saveRDS(merged_tsne_clust, file=cache_filename) 91 | } 92 | return(readRDS(merged_rds_filename)) 93 | } 94 | gbm1 <- gbm 95 | gbm2 <- pbmc6k_data$gbm 96 | merged_rds_filename <- file.path(CACHE_PATH, 'pbmc3k_pbmc6k_merged.rds') 97 | merged_tsne_clust <- get_merged_analysis(gbm1,gbm2, merged_rds_filename) 98 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(cellrangerRkit) 3 | 4 | test_check("cellrangerRkit") 5 | -------------------------------------------------------------------------------- /tests/testthat/Rplots.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/tests/testthat/Rplots.pdf -------------------------------------------------------------------------------- /tests/testthat/test_concat.r: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | context('Concatenation') 3 | 4 | pipestance_path <- system.file("extdata", "test_pipestance", package="cellrangerRkit") 5 | 6 | filt_gbm <- load_cellranger_matrix(pipestance_path, barcode_filtered=T) 7 | 8 | print("loaded") 9 | gbm1 <- filt_gbm[,1:30] 10 | gbm2 <- filt_gbm[,31:60] 11 | gbm3 <- filt_gbm[,61:114] 12 | 13 | big_gbm <- concatenate_gene_bc_matrices(list(gbm1, gbm2, gbm3)) 14 | 15 | test_that("concatenated gbm has correct content", { 16 | expect_true(nrow(big_gbm) == nrow(filt_gbm)) 17 | expect_true(all(fData(big_gbm) == fData(filt_gbm))) 18 | expect_true(ncol(big_gbm) == ncol(gbm1) + ncol(gbm2) + ncol(gbm3)) 19 | expect_true(sum(big_gbm) == sum(gbm1) + sum(gbm2) + sum(gbm3)) 20 | }) 21 | 22 | test_that("can't concat different gene sets", { 23 | expect_error(concatenate_gene_bc_matrices(list(gbm1, gbm1[1:100,]))) 24 | }) 25 | 26 | gbm4 <- filt_gbm[,1:50] 27 | test_that("can concatenate intersecting barcode sets", { 28 | expect_error(big_gbm <- concatenate_gene_bc_matrices(list(gbm1, gbm4), NA)) 29 | 30 | # TODO For whatever reason, these subsetted matrices have diff sample names now 31 | # Not sure why, but the sample names are same length, but differ between exprs 32 | # and phenoData during this call between gbm1 and gbm4 33 | # I think the reason may have to do with fact that barcodes should actually be 34 | # the columns in an expression dataset typically, but are rep as rows here 35 | expect_true(ncol(concatenate_gene_bc_matrices(list(gbm1, gbm4))) == ncol(gbm1) + ncol(gbm4)) 36 | }) 37 | -------------------------------------------------------------------------------- /tests/testthat/test_de.r: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | context('differential expression') 3 | 4 | set.seed(0) 5 | 6 | # Simulate a gene expression matrix 7 | n_cells <- 1e3 8 | n_transcripts <- 10000 9 | n_genes <- 10000 10 | plaw_alpha <- 0.7 11 | n_de_genes <- 50 12 | l2fc <- 2 13 | 14 | txome0 <- (1:n_genes)^-plaw_alpha 15 | txome0 <- txome0/sum(txome0) 16 | de_idx <- sample(length(txome0), n_de_genes) 17 | txome1 <- txome0 18 | txome1[de_idx] <- l2fc * txome1[de_idx] 19 | txome1 <- txome1/sum(txome1) 20 | 21 | size_factors <- exp(rnorm(n_cells, 0, 0.1)) 22 | 23 | test_matrix <- do.call(rbind, lapply(1:(n_cells/2), function(i) rpois(n_genes, size_factors[i]*n_transcripts*txome0))) 24 | test_matrix <- rbind(test_matrix, do.call(rbind, lapply((n_cells/2+1):n_cells, function(i) rpois(n_genes, size_factors[i]*n_transcripts*txome1)))) 25 | test_matrix <- t(test_matrix) 26 | 27 | row.names(test_matrix) = sprintf("gene%d", 1:n_genes) 28 | colnames(test_matrix) = sprintf("cell%d", 1:n_cells) 29 | 30 | genes = data.frame(id=sprintf("gene%d", 1:n_genes), symbol=sprintf("symbol%d", 1:n_genes)) 31 | row.names(genes) = genes$id 32 | 33 | cells = data.frame(barcode=sprintf("cell%d", 1:n_cells)) 34 | row.names(cells) = cells$barcode 35 | 36 | gbm <- newGeneBCMatrix(test_matrix, fd=genes, pd=cells) 37 | 38 | de_result <- run_differential_expression(gbm, 1:(n_cells/2), (1+n_cells/2):n_cells) 39 | 40 | act_pos <- 1:n_genes %in% de_idx 41 | called_pos <- de_result$p_adj < 0.05 42 | tp <- act_pos & called_pos 43 | 44 | sens <- sum(tp) / sum(act_pos) 45 | ppv <- sum(tp) / sum(called_pos) 46 | 47 | test_that("DE results make sense", { 48 | expect_equal(sens, 1) 49 | expect_equal(ppv, 1) 50 | } ) 51 | 52 | 53 | -------------------------------------------------------------------------------- /tests/testthat/test_kmeans.r: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | context('kmeans') 3 | 4 | set.seed(0) 5 | test_matrix = Matrix(matrix(rbinom(200*100, 10, 0.1), 200, 100)) 6 | 7 | grp1 <- 1:40 8 | grp2 <- 41:100 9 | test_matrix[1:5,grp1] <- 5 10 | test_matrix[6:10,grp2] <- 6 11 | 12 | row.names(test_matrix) = sprintf("gene%d", 1:200) 13 | colnames(test_matrix) = sprintf("cell%d", 1:100) 14 | 15 | genes = data.frame(id=sprintf("gene%d", 1:200), symbol=sprintf("symbol%d", 1:200)) 16 | row.names(genes) = genes$id 17 | 18 | cells = data.frame(barcode=sprintf("cell%d", 1:100)) 19 | row.names(cells) = cells$barcode 20 | 21 | gbm <- newGeneBCMatrix(test_matrix, fd=genes, pd=cells) 22 | 23 | pca <- run_pca(gbm, 2) 24 | set.seed(0) 25 | km <- run_kmeans_clustering(pca, 2, nstart=10) 26 | 27 | test_that("kmeans works", { 28 | expect_true(all(km$cluster[grp1] == 1) && all(km$cluster[grp2] == 2) || 29 | all(km$cluster[grp1] == 2) && all(km$cluster[grp2] == 1)) 30 | } ) 31 | -------------------------------------------------------------------------------- /tests/testthat/test_load.r: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | context('GeneBCMatrix') 3 | 4 | pipestance_path <- system.file("extdata", "test_pipestance", package="cellrangerRkit") 5 | 6 | filt_gbm <- load_cellranger_matrix(pipestance_path, barcode_filtered=T) 7 | test_that("filtered matrix has correct dimensions", { 8 | expect_equal(nrow(filt_gbm), 35635) 9 | expect_equal(ncol(filt_gbm), 114) 10 | }) 11 | 12 | test_that("bc filter flag is set correctly", { 13 | expect_equal(filt_gbm@barcode_filtered, TRUE) 14 | }) 15 | 16 | # Try subselecting barcodes 17 | filt_gbm <- filt_gbm[,1:50] 18 | test_that("bc-subselected matrix has correct dimensions", { 19 | expect_equal(nrow(filt_gbm), 35635) 20 | expect_equal(ncol(filt_gbm), 50) 21 | }) 22 | 23 | # Try subselecting genes 24 | filt_gbm <- filt_gbm[1:500,] 25 | test_that("gene-subselected matrix has correct dimensions", { 26 | expect_equal(nrow(filt_gbm), 500) 27 | expect_equal(ncol(filt_gbm), 50) 28 | expect_equal(length(row.names(fData(filt_gbm))), 500) 29 | }) 30 | 31 | test_that("can load secondary analysis results", { 32 | load_cellranger_analysis_results(pipestance_path) 33 | }) 34 | 35 | # Try loading H5 36 | pipestance_path_h5 <- system.file("extdata", "test_pipestance_h5", package="cellrangerRkit") 37 | 38 | filt_gbm_h5 <- load_cellranger_matrix_h5(pipestance_path_h5, barcode_filtered=T) 39 | test_that("filtered matrix has correct dimensions", { 40 | expect_equal(nrow(filt_gbm_h5), 343) 41 | expect_equal(ncol(filt_gbm_h5), 34) 42 | }) 43 | 44 | # Test on a Cell Ranger 1.3.0 pipestance 45 | pipestance_path_cr130 <- system.file("extdata", "test_pipestance_cr130", package="cellrangerRkit") 46 | filt_gbm_cr130 <- load_cellranger_matrix(pipestance_path_cr130, barcode_filtered=T) 47 | test_that("filtered matrix has correct dimensions", { 48 | expect_equal(nrow(filt_gbm_cr130), 33694) 49 | expect_equal(ncol(filt_gbm_cr130), 4122) 50 | }) 51 | 52 | an <- load_cellranger_analysis_results(pipestance_path_cr130) 53 | test_that("can load secondary analysis results (cr 1.3.0)", { 54 | expect_true(!is.null(an$clustering$graphclust)) 55 | expect_true(!is.null(an$clustering$kmeans_2_clusters)) 56 | }) 57 | 58 | # Test matrix H5 loading 59 | filt_gbm_h5_cr130 <- load_cellranger_matrix_h5(pipestance_path_cr130, barcode_filtered=T) 60 | test_that("filtered matrix H5 has correct dimensions", { 61 | expect_equal(nrow(filt_gbm_h5_cr130), 33694) 62 | expect_equal(ncol(filt_gbm_h5_cr130), 4122) 63 | }) 64 | -------------------------------------------------------------------------------- /tests/testthat/test_normalize.r: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | context('Normalization') 3 | 4 | gene_names = c('a', 'b') 5 | sample_names = c('sample1', 'sample2', 'sample3') 6 | 7 | # Generate a test dataset 8 | test_matrix = Matrix(matrix(c(1,2,10,20,100,200), ncol=3)) 9 | row.names(test_matrix) = gene_names 10 | colnames(test_matrix) = sample_names 11 | 12 | test_genes = data.frame(id=gene_names, symbol=gene_names) 13 | row.names(test_genes) = gene_names 14 | 15 | test_sample_data = data.frame(barcode=sample_names) 16 | row.names(test_sample_data) = sample_names 17 | 18 | # Create GBM from it 19 | test_gbm <- newGeneBCMatrix(test_matrix, test_genes, test_sample_data) 20 | 21 | # Test median normalization 22 | test_gbm_bcnorm <- normalize_barcode_sums_to_median(test_gbm) 23 | 24 | test_that("bc normalization gives correct result", { 25 | expect_true(all(colSums(test_gbm_bcnorm) == 30)) 26 | }) 27 | 28 | # Test log normalization 29 | test_gbm <- newGeneBCMatrix(test_matrix, test_genes, test_sample_data) 30 | test_gbm_log2 <- log_gene_bc_matrix(test_gbm, base=2) 31 | test_that("bc normalization gives correct result", { 32 | expect_true(all(test_gbm_log2 == log2(1+test_gbm))) 33 | }) 34 | -------------------------------------------------------------------------------- /tests/testthat/test_pca.r: -------------------------------------------------------------------------------- 1 | #library(cellrangerRkit) 2 | library(devtools) 3 | context('PCA') 4 | 5 | for (irlba_version in c('2.0.0', 'latest')) { 6 | dev_mode(on=T) 7 | detach("package:cellrangerRkit", unload=TRUE) 8 | unloadNamespace('irlba') 9 | if (irlba_version == 'latest') { 10 | install_cran('irlba', quietly=T, repos="http://cran.rstudio.com/") 11 | test_that('got latest irlba', { expect_true(as.character(packageVersion('irlba')) != '2.0.0') }) 12 | } else { 13 | install_url(sprintf('https://cran.r-project.org/src/contrib/Archive/irlba/irlba_%s.tar.gz', irlba_version), quietly=T) 14 | test_that(sprintf('got irlba %s', irlba_version), { expect_equal(as.character(packageVersion('irlba')), irlba_version) }) 15 | } 16 | library(cellrangerRkit) 17 | 18 | test_matrix = Matrix(matrix(rbinom(200*100, 10, 0.1), 200, 100)) 19 | 20 | grp1 <- 1:40 21 | grp2 <- 41:100 22 | test_matrix[1:5,grp1] <- 5 23 | test_matrix[6:10,grp2] <- 6 24 | 25 | row.names(test_matrix) = sprintf("gene%d", 1:200) 26 | colnames(test_matrix) = sprintf("sample%d", 1:100) 27 | 28 | test_genes = data.frame(id=sprintf("gene%d", 1:200)) 29 | row.names(test_genes) = test_genes$id 30 | 31 | test_samples = data.frame(barcode=sprintf("sample%d", 1:100)) 32 | row.names(test_samples) = test_samples$barcode 33 | 34 | gbm <- newGeneBCMatrix(test_matrix, test_genes, test_samples) 35 | 36 | pca <- run_pca(gbm, 2) 37 | 38 | test_that("pca results make sense", { 39 | expect_true(nrow(pca$x) == ncol(gbm)) 40 | expect_equal(ncol(pca$x), 2) 41 | expect_true(nrow(pca$rotation) == length(pca$use_genes)) 42 | expect_equal(ncol(pca$rotation), 2) 43 | expect_true(all(pca$x[grp1,1] < 0) && all(pca$x[grp2,1] > 0) || 44 | all(pca$x[grp1,1] > 0) && all(pca$x[grp2,1] < 0)) 45 | } ) 46 | dev_mode(on=F) 47 | } 48 | 49 | -------------------------------------------------------------------------------- /tests/testthat/test_plots.r: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | context('Plotting') 3 | 4 | pipestance_path <- system.file("extdata", "test_pipestance", package="cellrangerRkit") 5 | 6 | gbm <- load_cellranger_matrix(pipestance_path) 7 | 8 | test_that("can plot bc counts", { 9 | plot_barcode_counts(gbm) 10 | }) 11 | -------------------------------------------------------------------------------- /tests/testthat/test_save.r: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | context('Save matrix H5') 3 | 4 | pipestance_path <- system.file("extdata", "test_pipestance_cr130", package="cellrangerRkit") 5 | filt_gbm <- load_cellranger_matrix(pipestance_path, barcode_filtered=T) 6 | 7 | test_that("filtered matrix has correct dimensions", { 8 | expect_equal(nrow(filt_gbm), 33694) 9 | expect_equal(ncol(filt_gbm), 4122) 10 | }) 11 | 12 | filt_gbm <- filt_gbm[,1:(ncol(filt_gbm)-100)] 13 | if (file.exists('test_save.h5')) { 14 | unlink('test_save.h5') 15 | } 16 | save_cellranger_matrix_h5(filt_gbm, 'test_save.h5', 'GRCh38') 17 | reloaded_gbm <- get_matrix_from_h5('test_save.h5') 18 | test_that("saved matrix has correct dimensions", { 19 | expect_equal(nrow(reloaded_gbm), 33694) 20 | expect_equal(ncol(reloaded_gbm), 4122-100) 21 | }) 22 | 23 | test_that("sums are equal", { 24 | expect_equal(sum(filt_gbm), sum(reloaded_gbm)) 25 | }) 26 | 27 | 28 | -------------------------------------------------------------------------------- /tests/testthat/test_subsample.r: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | context('Subsampling') 3 | 4 | pipestance_path <- system.file("extdata", "test_subsample", 5 | package="cellrangerRkit") 6 | 7 | set.seed(0) 8 | 9 | gbm <- load_cellranger_matrix(pipestance_path) 10 | gbm <- load_molecule_info(gbm) 11 | 12 | gbm_ss <- subsample_gene_bc_matrix(gbm, 1000000) 13 | test_that("subsampling returns orig matrix if target depth higher", { 14 | expect_equal(sum(gbm_ss), sum(gbm)) 15 | }) 16 | 17 | rpc <- get_mean_raw_reads_per_cell(gbm) 18 | 19 | gbm_ss <- subsample_gene_bc_matrix(gbm, floor(rpc)) 20 | test_that("subsampling returns orig matrix at same depth", { 21 | expect_equal(sum(gbm_ss), sum(gbm)) 22 | }) 23 | 24 | gbm_ss <- subsample_gene_bc_matrix(gbm, floor(rpc/2)) 25 | test_that("subsampling to 1/2", { 26 | expect_true(abs(round(sum(gbm_ss)/sum(gbm),2) - 0.5) < 0.01) 27 | }) 28 | 29 | gbm_ss <- subsample_gene_bc_matrix(gbm, floor(rpc/10)) 30 | test_that("subsampling to 1/10", { 31 | expect_true(abs(round(sum(gbm_ss)/sum(gbm),2) - 0.1) < 0.01) 32 | }) 33 | 34 | 35 | -------------------------------------------------------------------------------- /tests/testthat/test_tsne.r: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | context('tsne') 3 | 4 | pipestance_path <- system.file("extdata", "test_pipestance", package="cellrangerRkit") 5 | 6 | gbm <- load_cellranger_matrix(pipestance_path) 7 | pca <- run_pca(gbm, 2) 8 | tsne_res <- run_tsne(pca, theta=0.75) 9 | -------------------------------------------------------------------------------- /tests/testthat/test_util.r: -------------------------------------------------------------------------------- 1 | library(cellrangerRkit) 2 | context('Util') 3 | 4 | 5 | gene_names = c('gene_a', 'gene_b', 'gene_c') 6 | sample_names = c('sample_a', 'sample_b', 'sample_c') 7 | 8 | test_matrix = Matrix(matrix(c(1,0,3,10,0,30,100,0,300), ncol=3)) 9 | row.names(test_matrix) = gene_names 10 | colnames(test_matrix) = sample_names 11 | 12 | test_gene_matrix = data.frame(id=gene_names, symbol=gene_names) 13 | row.names(test_gene_matrix) = test_gene_matrix$id 14 | 15 | test_samples = data.frame(barcode=sample_names) 16 | row.names(test_samples) = test_samples$barcode 17 | 18 | test_gbm <- newGeneBCMatrix(test_matrix, test_gene_matrix, test_samples) 19 | test_genes <- get_nonzero_genes(test_gbm) 20 | 21 | 22 | test_that("get_nonzero_genes gives correct result", { 23 | expect_equal(length(test_genes), 2) 24 | expect_equal(test_genes[1], 1) 25 | expect_equal(test_genes[2], 3) 26 | }) 27 | 28 | pipestance_path <- system.file("extdata", "test_pipestance", package="cellrangerRkit") 29 | filt_gbm <- load_cellranger_matrix(pipestance_path, barcode_filtered=T) 30 | 31 | test_that("can get mean reads per cell", { 32 | get_mean_mapped_reads_per_cell(filt_gbm) 33 | }) 34 | -------------------------------------------------------------------------------- /vignettes/Rplots.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/vignettes/Rplots.pdf -------------------------------------------------------------------------------- /vignettes/cellrangerrkit-PBMC-vignette-knitr.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand\HyField@AuxAddToFields[1]{} 18 | \providecommand\HyField@AuxAddToCoFields[2]{} 19 | \@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}{section.1}} 20 | \@writefile{toc}{\contentsline {subsection}{\numberline {1.1}Overview of this tutorial}{1}{subsection.1.1}} 21 | \@writefile{toc}{\contentsline {subsection}{\numberline {1.2}Additional resources}{2}{subsection.1.2}} 22 | \@writefile{toc}{\contentsline {section}{\numberline {2}Getting Started}{2}{section.2}} 23 | \@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Installing Cell Ranger R Kit}{2}{subsection.2.1}} 24 | \@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Loading gene expression data for secondary analysis}{2}{subsection.2.2}} 25 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces t-SNE projection where each cell is colored by log10 of UMI counts. Color scale represents log10 of UMI counts.}}{3}{figure.1}} 26 | \newlabel{fig:umi}{{1}{3}{t-SNE projection where each cell is colored by log10 of UMI counts. Color scale represents log10 of UMI counts}{figure.1}{}} 27 | \@writefile{toc}{\contentsline {section}{\numberline {3}Visualizing signatures of known gene markers}{3}{section.3}} 28 | \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces t-SNE projection where each cell is colored by normalized expression of the marker in the cell. Color scale represents the normalized expression of the marker. }}{4}{figure.2}} 29 | \newlabel{fig:markers}{{2}{4}{t-SNE projection where each cell is colored by normalized expression of the marker in the cell. Color scale represents the normalized expression of the marker}{figure.2}{}} 30 | \@writefile{toc}{\contentsline {section}{\numberline {4}Unbiased analysis using clustering results}{4}{section.4}} 31 | \@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Visualizing clustering results}{4}{subsection.4.1}} 32 | \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces t-SNE projection where each cell is colored by cluster assigned by kmeans clustering. ID on the right represents the cluster ID.}}{5}{figure.3}} 33 | \newlabel{fig:kmeans}{{3}{5}{t-SNE projection where each cell is colored by cluster assigned by kmeans clustering. ID on the right represents the cluster ID}{figure.3}{}} 34 | \@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Analyzing cluster specific genes}{5}{subsection.4.2}} 35 | \@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces t-SNE projection where each cell is colored by cluster assigned by kmeans clustering. ID on the right represents the cluster ID.}}{6}{figure.4}} 36 | \newlabel{fig:kmeans5}{{4}{6}{t-SNE projection where each cell is colored by cluster assigned by kmeans clustering. ID on the right represents the cluster ID}{figure.4}{}} 37 | \@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Heatmap of scaled expression of top 3 genes (row) in each cell (column). The horizontal and vertical bars around the heat map represents cluster ID assigned by kmeans clustering. Color scale represents scaled expression of the gene.}}{7}{figure.5}} 38 | \newlabel{fig:heatmap}{{5}{7}{Heatmap of scaled expression of top 3 genes (row) in each cell (column). The horizontal and vertical bars around the heat map represents cluster ID assigned by kmeans clustering. Color scale represents scaled expression of the gene}{figure.5}{}} 39 | \@writefile{toc}{\contentsline {section}{\numberline {5}Analyzing multiple data sets}{7}{section.5}} 40 | \@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Merging multiple pbmc data sets}{7}{subsection.5.1}} 41 | \@writefile{toc}{\contentsline {subsection}{\numberline {5.2}Re-running PCA, t-SNE and k-means clustering using R}{8}{subsection.5.2}} 42 | \@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces t-SNE projection where (Left) each cell is colored by cluster assigned in kmeans clustering, (Right) each cell is colored by sample ID, where 1 represents pbmc3k, and 2 represents pbmc6k.}}{9}{figure.6}} 43 | \newlabel{fig:tsne_batch}{{6}{9}{t-SNE projection where (Left) each cell is colored by cluster assigned in kmeans clustering, (Right) each cell is colored by sample ID, where 1 represents pbmc3k, and 2 represents pbmc6k}{figure.6}{}} 44 | \@writefile{toc}{\contentsline {section}{\numberline {6}Subsetting the matrix and reanalyzing}{9}{section.6}} 45 | \@writefile{toc}{\contentsline {subsection}{\numberline {6.1}Re-running PCA, t-SNE and clustering using "cellranger reanalyze"}{9}{subsection.6.1}} 46 | \bibstyle{unsrt} 47 | \bibdata{cellrangerrkit-bib} 48 | \@writefile{toc}{\contentsline {section}{\numberline {7}Session Info}{10}{section.7}} 49 | -------------------------------------------------------------------------------- /vignettes/cellrangerrkit-PBMC-vignette-knitr.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][]{section.1}{1 Introduction}{}% 1 2 | \BOOKMARK [2][]{subsection.1.1}{1.1 Overview of this tutorial}{section.1}% 2 3 | \BOOKMARK [2][]{subsection.1.2}{1.2 Additional resources}{section.1}% 3 4 | \BOOKMARK [1][]{section.2}{2 Getting Started}{}% 4 5 | \BOOKMARK [2][]{subsection.2.1}{2.1 Installing Cell Ranger R Kit}{section.2}% 5 6 | \BOOKMARK [2][]{subsection.2.2}{2.2 Loading gene expression data for secondary analysis}{section.2}% 6 7 | \BOOKMARK [1][]{section.3}{3 Visualizing signatures of known gene markers}{}% 7 8 | \BOOKMARK [1][]{section.4}{4 Unbiased analysis using clustering results}{}% 8 9 | \BOOKMARK [2][]{subsection.4.1}{4.1 Visualizing clustering results}{section.4}% 9 10 | \BOOKMARK [2][]{subsection.4.2}{4.2 Analyzing cluster specific genes}{section.4}% 10 11 | \BOOKMARK [1][]{section.5}{5 Analyzing multiple data sets}{}% 11 12 | \BOOKMARK [2][]{subsection.5.1}{5.1 Merging multiple pbmc data sets}{section.5}% 12 13 | \BOOKMARK [2][]{subsection.5.2}{5.2 Re-running PCA, t-SNE and k-means clustering using R}{section.5}% 13 14 | \BOOKMARK [1][]{section.6}{6 Subsetting the matrix and reanalyzing}{}% 14 15 | \BOOKMARK [2][]{subsection.6.1}{6.1 Re-running PCA, t-SNE and clustering using "cellranger reanalyze"}{section.6}% 15 16 | \BOOKMARK [1][]{section.7}{7 Session Info}{}% 16 17 | -------------------------------------------------------------------------------- /vignettes/cellrangerrkit-PBMC-vignette-knitr.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/vignettes/cellrangerrkit-PBMC-vignette-knitr.pdf -------------------------------------------------------------------------------- /vignettes/cellrangerrkit-PBMC-vignette-knitr.toc: -------------------------------------------------------------------------------- 1 | \contentsline {section}{\numberline {1}Introduction}{1}{section.1} 2 | \contentsline {subsection}{\numberline {1.1}Overview of this tutorial}{1}{subsection.1.1} 3 | \contentsline {subsection}{\numberline {1.2}Additional resources}{2}{subsection.1.2} 4 | \contentsline {section}{\numberline {2}Getting Started}{2}{section.2} 5 | \contentsline {subsection}{\numberline {2.1}Installing Cell Ranger R Kit}{2}{subsection.2.1} 6 | \contentsline {subsection}{\numberline {2.2}Loading gene expression data for secondary analysis}{2}{subsection.2.2} 7 | \contentsline {section}{\numberline {3}Visualizing signatures of known gene markers}{3}{section.3} 8 | \contentsline {section}{\numberline {4}Unbiased analysis using clustering results}{4}{section.4} 9 | \contentsline {subsection}{\numberline {4.1}Visualizing clustering results}{4}{subsection.4.1} 10 | \contentsline {subsection}{\numberline {4.2}Analyzing cluster specific genes}{5}{subsection.4.2} 11 | \contentsline {section}{\numberline {5}Analyzing multiple data sets}{7}{section.5} 12 | \contentsline {subsection}{\numberline {5.1}Merging multiple pbmc data sets}{7}{subsection.5.1} 13 | \contentsline {subsection}{\numberline {5.2}Re-running PCA, t-SNE and k-means clustering using R}{8}{subsection.5.2} 14 | \contentsline {section}{\numberline {6}Subsetting the matrix and reanalyzing}{9}{section.6} 15 | \contentsline {subsection}{\numberline {6.1}Re-running PCA, t-SNE and clustering using "cellranger reanalyze"}{9}{subsection.6.1} 16 | \contentsline {section}{\numberline {7}Session Info}{10}{section.7} 17 | -------------------------------------------------------------------------------- /vignettes/cellrangerrkit-PBMC-vignette.tex: -------------------------------------------------------------------------------- 1 | % \VignetteIndexEntry{Cell Ranger R Kit Tutorial: Secondary Analysis on 10x Single Cell 3' RNA-seq PBMC Data} 2 | % \VignetteEngine{knitr::knitr} 3 | % \VignetteDepends{} 4 | % \VignettePackage{cellrangerrkit} 5 | 6 | % 7 | % Copyright (c) 2016 10x Genomics, Inc. All rights reserved. 8 | % 9 | 10 | \documentclass[10pt,oneside]{article} 11 | 12 | \newcommand{\tm}{\textsuperscript{\tiny {TM}}~} 13 | \newcommand{\weblink}[1]{\newline \newline {\color{Violet}{\texttt{~ #1}}} \newline \newline} 14 | 15 | % \newcommand{\weblink}[1]{ {\color{Violet}\verb!#1! }} 16 | % \newcommand{\weblink}[1]{\begin{verbatim}#1\end{verbatim}} 17 | % \newcommand{\weblink}[1]{{\color{Violet}\begin{verbatim}#1\end{verbatim}}} 18 | 19 | \newcommand{\thetitle}{Cell Ranger\textsuperscript{\footnotesize {TM}} R Kit Tutorial: Secondary Analysis on \\ 10x Genomics\textsuperscript{\footnotesize {TM}} Single Cell 3' RNA-seq PBMC Data} 20 | 21 | 22 | \usepackage{whbiocvignette} 23 | \usepackage{listings} 24 | \usepackage{hyperref} 25 | \usepackage[usenames,dvipsnames]{xcolor} 26 | \usepackage{fancyhdr} 27 | 28 | % Turn on the style 29 | \pagestyle{fancy} 30 | \fancyhead{} 31 | \fancyfoot{} 32 | \fancyfoot[C]{\thepage} 33 | 34 | 35 | \title{\textsf{\textbf{\thetitle}}} 36 | \author{10x Genomics\tm} 37 | 38 | \usepackage{Sweave} 39 | \begin{document} 40 | \input{cellrangerrkit-PBMC-vignette-concordance} 41 | 42 | \maketitle 43 | 44 | % \begin{abstract} 45 | % \end{abstract} 46 | 47 | \tableofcontents 48 | 49 | \begin{Schunk} 50 | \begin{Soutput} 51 | Loaded cellrangerRkit version 1.1.0 52 | Building cellrangerRkit vignette... 53 | Searching for genomes in: /mnt/home/jason/yard/example_data/pbmc_data_public/pbmc3k/outs/filtered_gene_bc_matrices 54 | Using hg19 in folder: /mnt/home/jason/yard/example_data/pbmc_data_public/pbmc3k/outs/filtered_gene_bc_matrices/hg19 55 | Loaded matrix information 56 | Loaded gene information 57 | Loaded barcode information 58 | Loaded summary information 59 | \end{Soutput} 60 | \end{Schunk} 61 | \vspace{0.5in} 62 | \section{Introduction} 63 | \subsection{Overview of this tutorial} 64 | This tutorial provides instructions on how to perform exploratory secondary analysis on single cell 3' RNA-seq data produced by the 10x Genomics\tm Chromium\tm Platform, and processed by the Cell Ranger\tm pipeline. We illustrate an example workflow using peripheral blood mononuclear cells (PBMCs) from a healthy donor, using two data sets: \verb!pbmc3k! and \verb!pbmc6k! (from the same donor) released by 10x Genomics\tm: 65 | {\color{Violet} 66 | \begin{verbatim} 67 | http://support.10xgenomics.com/single-cell/datasets/pbmc3k 68 | http://support.10xgenomics.com/single-cell/datasets/pbmc6k 69 | \end{verbatim}} 70 | \noindent 71 | In this tutorial, you will learn how to: 72 | \begin{itemize} 73 | \item 74 | Load processed data from the Cell Ranger\tm pipeline or public data provided by 10x Genomics\tm 75 | \item 76 | Perform unsupervised clustering for {\it de novo} cell-type discovery 77 | \item 78 | Visualize clustering of single cells and cluster-specific gene expression signatures 79 | \item 80 | Combine data from multiple experiments 81 | \end{itemize} 82 | \subsection{Additional resources} 83 | You can learn more about the Cell Ranger\tm pipeline here: 84 | \weblink{http://support.10xgenomics.com/single-cell/software/pipelines/latest/what-is-cell-ranger} 85 | A larger number of other publicly available single cell data sets released by 10x Genomics\tm are available here: 86 | \weblink{http://support.10xgenomics.com/single-cell/datasets} 87 | If you have any questions about the data and the analysis, please contact {\bf \verb!support@10xgenomics.com!}. 88 | 89 | \vspace{0.5in} 90 | 91 | \section{Getting Started} 92 | \subsection{Installing Cell Ranger R Kit} 93 | You can follow the instructions at the link below to install R Kit and its dependencies: 94 | \weblink{http://support.10xgenomics.com/single-cell/software/pipelines/latest/rkit} 95 | \subsection{Loading gene expression data for secondary analysis} 96 | The Chromium\tm Cell Ranger\tm pipeline produces processed gene-barcode matrices and primary results. By specifiying the pipeline output directory (or {\it pipestance path}), you can use the R kit to load these pipeline results into your local R environment. You can load the pipeline data by specifying a pipestance path in R as follows. 97 | \begin{Schunk} 98 | \begin{Sinput} 99 | > cellranger_pipestance_path <- "/path/to/your/pipeline/output/directory" 100 | > gbm <- load_cellranger_matrix(cellranger_pipestance_path) 101 | > analysis_results <- load_cellranger_analysis_results(cellranger_pipestance_path) 102 | \end{Sinput} 103 | \end{Schunk} 104 | \noindent 105 | Alternatively, you can download the publicly available data to a local path using the \verb!download_sample! function and treat this local path as your pipestance path. 106 | \begin{Schunk} 107 | \begin{Sinput} 108 | > pipestance_path <- "/path/to/your/local/directory/for/pbmc3k" 109 | > download_sample(sample_name="pbmc3k",sample_dir=pipestance_path, 110 | + host="https://s3-us-west-2.amazonaws.com/10x.files/samples/cell/") 111 | > gbm <- load_cellranger_matrix(pipestance_path) 112 | > analysis_results <- load_cellranger_analysis_results(pipestance_path) 113 | \end{Sinput} 114 | \end{Schunk} 115 | 116 | The variable \verb!gbm! is an object based on the Bioconductor ExpressionSet class that stores the barcode filtered gene expression matrix and metadata, such as gene symbols and barcode IDs corresponding to cells in the data set. The gene expression values, gene information and cell barcodes can be accessed using: 117 | \begin{Schunk} 118 | \begin{Sinput} 119 | > exprs(gbm) # expression matrix 120 | > fData(gbm) # data frame of genes 121 | > pData(gbm) # data frame of cell barcodes 122 | \end{Sinput} 123 | \end{Schunk} 124 | The variable \verb!analysis_results! contains pre-computed results for principle component analysis (PCA) dimensional reduction, t-SNE (t-Distributed Stochastic Neighbor Embedding) projection, and k-means clustering. Because each cell is represented by a high-dimensional gene expression profile, one way to visualize cell-to-cell similarity is by reducing the data set to a two dimensional representation. There are many dimension reduction methods available for 2-D visualization. Here we include implementations of two popular approaches, PCA and t-SNE, with pre-computed results stored in \verb!analysis_results!. 125 | 126 | For instance, you can access the t-SNE projection and plot the cells colored by UMI counts as follows. 127 | 128 | \begin{figure}[htbp] 129 | \begin{center} 130 | \begin{Schunk} 131 | \begin{Sinput} 132 | > tsne_proj <- analysis_results$tsne 133 | > visualize_umi_counts(gbm,tsne_proj[c("TSNE.1","TSNE.2")],limits=c(3,4),marker_size=0.05) 134 | \end{Sinput} 135 | \end{Schunk} 136 | \caption{t-SNE projection where each cell is colored by log10 of UMI counts. Color scale represents log10 of UMI counts.} 137 | \label{fig:umi} 138 | \end{center} 139 | \end{figure} 140 | 141 | \vspace{0.3in} 142 | 143 | Each point in the scatter plot represents a cell in the coordinates specified by the two t-SNE components. The color of each point plotted by \verb!visualize_umi_counts! (Figure \ref{fig:umi}) indicates the total number of UMIs for each cell, and these count values are displayed in log10 scale. 144 | 145 | Cells with similar expression profile tend to appear closer in the 2-D space, so you may already see some structures in the data. However, to identify what the structures represent, you will need to rely on the gene signatures that each cell expresses to draw meaningful insights from the data. Instead of using raw UMI counts for downstream differential gene analysis, we recommend that you filter unexpressed genes, normalize the UMI counts for each barcode, and use the log-transformed gene-barcode matrix. After transformation, the gene-barcode matrix contains 16634 genes for 2700 cells. 146 | \begin{Schunk} 147 | \begin{Sinput} 148 | > use_genes <- get_nonzero_genes(gbm) 149 | > gbm_bcnorm <- normalize_barcode_sums_to_median(gbm[use_genes,]) 150 | > gbm_log <- log_gene_bc_matrix(gbm_bcnorm,base=10) 151 | > print(dim(gbm_log)) 152 | \end{Sinput} 153 | \begin{Soutput} 154 | [1] 16634 2700 155 | \end{Soutput} 156 | \end{Schunk} 157 | 158 | \vspace{0.5in} 159 | \section{Visualizing signatures of known gene markers} 160 | One way to identify different cell types is by expression of specific genes in cells. You can visualize expression values of a set of genes to identify cells where particular genes are up-regulated. Here, we show how to simultaneously plot the expression of 6 gene markers, one for each subplot using the \verb!visualize_gene_markers! function. 161 | 162 | \begin{figure}[htbp] 163 | \begin{center} 164 | \begin{Schunk} 165 | \begin{Sinput} 166 | > genes <- c("CD79A","NKG7","CD3D","CST3","CD8A","PF4") 167 | > tsne_proj <- analysis_results$tsne 168 | > visualize_gene_markers(gbm_log,genes,tsne_proj[c("TSNE.1","TSNE.2")],limits=c(0,1.5)) 169 | \end{Sinput} 170 | \end{Schunk} 171 | \caption{t-SNE projection where each cell is colored by normalized expression of the marker in the cell. Color scale represents the normalized expression of the marker. } 172 | \label{fig:markers} 173 | \end{center} 174 | \end{figure} 175 | 176 | \newpage 177 | Because the input matrix \verb!gbm_log! is already normalized and log10-transformed, the color indicates the UMI counts for each gene under log10 scale (Figure \ref{fig:markers}). The specific gene markers already reveal cell types such as B cells, T cells, and natural killer (NK) cells. As expected, the cell-type-specific markers we have chosen are mostly unique to cells that are close together in the 2-D t-SNE projection. 178 | 179 | \vspace{0.5in} 180 | \section{Unbiased analysis using clustering results} 181 | \subsection{Visualizing clustering results} 182 | For some data sets, {\it de novo} cell-type discovery may be desired as prior knowledge of relevant marker genes can be limited or one may not want to introduce biases. In these cases it is useful to use unsupervised analysis to first algorithmically specify groupings of cells using the full data set. This can be achieved by applying any clustering methods on the loaded gene expression matrix \verb!exprs(gbm)! or the matrix in a reduced dimension space. In our implementation, for instance, we apply k-means clustering on the top 10 principle components of the gene expression matrix (after log-transformation, centering and scaling). 183 | 184 | Because k-means clustering requires a specified number of clusters in the data set but the number of clusters in a data set may not be known {\it a priori}, it is helpful to consider multiple values of $k$. The output data from Cell Ranger\tm includes the pre-computed cluster labels sweeping $k$ from 2 to 10. So you can quickly visualize results for different values of $k$ and pick the one that agrees with your intuition (Figure \ref{fig:kmeans}). Here each cell is colored by its cluster ID. 185 | \newpage 186 | \begin{figure}[htbp] 187 | \begin{center} 188 | \begin{Schunk} 189 | \begin{Sinput} 190 | > n_clu <- 2:10 191 | > km_res <- analysis_results$kmeans # load pre-computed kmeans results 192 | > clu_res <- sapply(n_clu, function(x) km_res[[paste(x,"clusters",sep="_")]]$Cluster) 193 | > colnames(clu_res) <- sapply(n_clu, function(x) paste("kmeans",x,sep=".")) 194 | > visualize_clusters(clu_res,tsne_proj[c("TSNE.1","TSNE.2")]) 195 | \end{Sinput} 196 | \end{Schunk} 197 | \caption{t-SNE projection where each cell is colored by cluster assigned by kmeans clustering. ID on the right represents the cluster ID.} 198 | \label{fig:kmeans} 199 | \end{center} 200 | \end{figure} 201 | 202 | \subsection{Analyzing cluster specific genes} 203 | Using these integer cluster labels (or integer labels generated by any clustering algorithm), you can now perform differential gene analysis to identify gene markers that are specific to a particular cell population. For this example, we focus on the k-means clustering result above with 5 clusters (Figure \ref{fig:kmeans5}). Standard statistical tests can be applied to identify which genes are most differentially expressed across different cell types. 204 | \newpage 205 | \vspace{0.5in} 206 | \begin{figure}[htbp] 207 | \begin{center} 208 | \begin{Schunk} 209 | \begin{Sinput} 210 | > example_K <- 5 # number of clusters (use "Set3" for brewer.pal below if example_K > 8) 211 | > example_col <- rev(brewer.pal(example_K,"Set2")) # customize plotting colors 212 | > cluster_result <- analysis_results$kmeans[[paste(example_K,"clusters",sep="_")]] 213 | > visualize_clusters(cluster_result$Cluster,tsne_proj[c("TSNE.1","TSNE.2")],colour=example_col) 214 | \end{Sinput} 215 | \end{Schunk} 216 | \caption{t-SNE projection where each cell is colored by cluster assigned by kmeans clustering. ID on the right represents the cluster ID.} 217 | \label{fig:kmeans5} 218 | \end{center} 219 | \end{figure} 220 | You can compare the mean expression between a class of cells and the remaining ones, and then prioritize genes by how highly expressed they are in the class of interest. The function \verb!prioritize_top_genes! identifies markers that are up-regulated in particular clusters of cells. Note that there are many other ways to identify cluster-specific genes. The approach used here is quick when looking for cluster-specific genes among $\sim 20$k candidate genes. 221 | \begin{Schunk} 222 | \begin{Sinput} 223 | > # sort the cells by the cluster labels 224 | > cells_to_plot <- order_cell_by_clusters(gbm_log,cluster_result$Cluster) 225 | > # order the genes from most up-regulated to most down-regulated in each cluster 226 | > prioritized_genes <- prioritize_top_genes(gbm_log,cluster_result$Cluster,"mean_diff") -------------------------------------------------------------------------------- /vignettes/figure/heatmap-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/vignettes/figure/heatmap-1.pdf -------------------------------------------------------------------------------- /vignettes/figure/kmeans-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/vignettes/figure/kmeans-1.pdf -------------------------------------------------------------------------------- /vignettes/figure/kmeans5-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/vignettes/figure/kmeans5-1.pdf -------------------------------------------------------------------------------- /vignettes/figure/markers-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/vignettes/figure/markers-1.pdf -------------------------------------------------------------------------------- /vignettes/figure/plot_tsne_batch-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/vignettes/figure/plot_tsne_batch-1.pdf -------------------------------------------------------------------------------- /vignettes/figure/umi-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hb-gitified/cellrangerRkit/1da09d171b937ca37570e79ac6268ee9c872fead/vignettes/figure/umi-1.pdf -------------------------------------------------------------------------------- /vignettes/whbiocvignette.sty: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e} 2 | \ProvidesPackage{whbiocvignette}[2013/02/24 Wolfgang Huber's class for Bioconductor vignettes] 3 | % 4 | % -I would wish to know how to make this work- 5 | %\DeclareOption{pdftitle}{\PassOptionsToPackage{pdftitle}{hyperref}} 6 | %\DeclareOption{pdfauthor}{\PassOptionsToPackage{pdfauthor}{hyperref}} 7 | %\ExecuteOptions{pdftitle,pdfauthor} 8 | %\ProcessOptions 9 | % 10 | \RequirePackage[% 11 | pdfpagelabels,% 12 | plainpages=false,% 13 | pdfborder={0 0 0},% 14 | pdfstartview=FitH,% 15 | bookmarks=true,% 16 | bookmarksnumbered=true,% 17 | bookmarksopen=true,% 18 | linktoc=section,% 19 | linkcolor=BlueViolet,% 20 | citecolor=BlueViolet,% 21 | urlcolor=BlueViolet,% 22 | linkbordercolor={.7 .7 .7}, 23 | citebordercolor={.7 .7 .7}, 24 | urlbordercolor={.7 .7 .7} , 25 | raiselinks]{hyperref} 26 | 27 | \RequirePackage[usenames,dvipsnames]{xcolor} 28 | \RequirePackage[a4paper,left=1.9cm,top=1.9cm,bottom=2.5cm,right=1.9cm,ignoreheadfoot]{geometry} 29 | %\RequirePackage{graphicx} 30 | \RequirePackage{helvet} 31 | \renewcommand{\familydefault}{\sfdefault} 32 | \RequirePackage{cite} 33 | \pagestyle{empty} 34 | % 35 | \RequirePackage{sectsty} 36 | \sectionfont{\sffamily\bfseries\color{RoyalBlue}\sectionrule{0pt}{0pt}{-1ex}{1pt}} 37 | \subsectionfont{\sffamily\bfseries\color{RoyalBlue}} 38 | \subsubsectionfont{\sffamily\bfseries\color{RoyalBlue}} 39 | % 40 | \RequirePackage{fancyhdr} 41 | \pagestyle{fancy} 42 | \fancyhead{} 43 | \fancyfoot{} 44 | \lfoot{}\cfoot{\thetitle}\rfoot{} 45 | \renewcommand{\headrule}{} 46 | % 47 | \RequirePackage{xstring} 48 | % 49 | \RequirePackage{Sweave} 50 | % 51 | \renewcommand{\floatpagefraction}{0.9} 52 | % 53 | \newcommand{\Robject}[1]{\texttt{#1}} 54 | \newcommand{\Rpackage}[1]{\textit{#1}} 55 | \newcommand{\Rclass}[1]{\textit{#1}} 56 | \newcommand{\Rfunction}[1]{{\texttt{#1}}} 57 | % 58 | \newcommand{\comment}[1]{\textsl{\textcolor{Gray}{#1}}} 59 | \newcommand{\fixme}[1]{\textsl{\textcolor{Bittersweet}{Fixme: #1}}} 60 | % 61 | \newcommand{\myincfig}[4]{% 62 | \begin{figure}[htbp] 63 | \begin{center} 64 | \includegraphics[width=#2]{#1} 65 | \caption[#3]{\label{#1}\textbf{#3} #4} 66 | \end{center} 67 | \end{figure} 68 | } 69 | % 70 | \newenvironment{packeditemize}{ 71 | \begin{itemize} 72 | \setlength{\itemsep}{1pt} 73 | \setlength{\parskip}{0pt} 74 | \setlength{\parsep}{0pt} 75 | }{\end{itemize}} 76 | % 77 | \newenvironment{packedenumerate}{ 78 | \begin{enumerate} 79 | \setlength{\itemsep}{1pt} 80 | \setlength{\parskip}{0pt} 81 | \setlength{\parsep}{0pt} 82 | }{\end{enumerate}} 83 | % 84 | \endinput 85 | --------------------------------------------------------------------------------