Last updated: 2018-11-30
workflowr checks: (Click a bullet for more information) ✖ R Markdown file: uncommitted changes
The R Markdown is untracked by Git. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish
to commit the R Markdown file and build the HTML.
✔ Environment: empty
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
✔ Seed:
set.seed(20181119)
The command set.seed(20181119)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
✔ Session information: recorded
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
✔ Repository version: b5d096d
wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rproj.user/
Ignored: analysis/Quality_metrics_cache/
Ignored: analysis/figure/
Untracked files:
Untracked: analysis/Quality_metrics.Rmd
Untracked: docs/figure/Quality_metrics.Rmd/
Unstaged changes:
Modified: analysis/_site.yml
Modified: analysis/crop_workflow_Alan.Rmd
Modified: analysis/crop_workflow_Siwei.Rmd
Modified: analysis/index.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
From Siwei’s cellranger run:
library(Matrix)
matrix_dir = "/Volumes/CROP-seq/data_from_Siwei/Xin_scRNA_seq_05Nov2018/filtered_gene_bc_matrices/CellRanger_index/"
matrix.path <- paste0(matrix_dir, "matrix.mtx")
dm <- readMM(file = matrix.path)
dm1 <- tail(dm,n=76)
length(colSums(dm1)[colSums(dm1)==1])
[1] 440
From Alan’s cellranger run:
matrix_dir1 = "/Volumes/CROP-seq/NSC0507_cellranger/outs/filtered_gene_bc_matrices/cellranger_ref/"
matrix.path1 <- paste0(matrix_dir1, "matrix.mtx")
mattemp1 <- readMM(file = matrix.path1)
mattemp11 <- tail(mattemp1,n=76)
length(colSums(mattemp11)[colSums(mattemp11)==1])
[1] 266
matrix_dir2 = "/Volumes/CROP-seq/NSC08_cellranger/outs/filtered_gene_bc_matrices/cellranger_ref/"
matrix.path2 <- paste0(matrix_dir2, "matrix.mtx")
mattemp2 <- readMM(file = matrix.path2)
mattemp21 <- tail(mattemp2,n=76)
length(colSums(mattemp21)[colSums(mattemp21)==1])
[1] 190
Note: in Alan’s original analysis conversion from h5 to csv step didn’t seem to work properly. if starting from matrix.mtx files. Siwei and Alan’s analyses gave the same results. So from now on, we will always start from Siwei’s matrix.mtx file.
barcode.path <- paste0(matrix_dir, "barcodes.tsv")
features.path <- paste0(matrix_dir, "genes.tsv")
feature.names = read.delim(features.path, header = FALSE,
stringsAsFactors = FALSE)
barcode.names = read.delim(barcode.path, header = FALSE,
stringsAsFactors = FALSE)
colnames(dm) = barcode.names$V1
rownames(dm) = feature.names$V1
dm1 <- tail(dm,n=76)
hist(colSums(dm1),breaks=3000,xlim=c(0,30),ylim=c(0,450), main="Distribution of gRNA number per cell", xlab= "#gRNA per cell")
ncell <- apply(dm1dfagg,1, function (x) length(x[x>0]))
barplot(ncell,las=2,cex.lab=1)
#Singletons (cells with only 1 gRNA)
singles = colnames(comb)[which(colSums(gRNA.dge.col>0)==1)]
grna.det.rate = rowSums(gRNA.dge.col[,singles]>0)
order.grna = gRNAs.col[order(grna.det.rate,decreasing = T)]
grna.det.df = data.frame(det=grna.det.rate, gRNAs=factor(gRNAs.col, levels = order.grna))
library(ggplot2)
ggplot(grna.det.df, aes(x=gRNAs, y=det)) + geom_bar(stat="identity") + theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
xlab('guide RNAs') + ylab('Number of Cells')
sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin11.4.2 (64-bit)
Running under: OS X El Capitan 10.11.6
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.7.5 Matrix_1.2-10
loaded via a namespace (and not attached):
[1] Rcpp_0.12.17 knitr_1.20 bindr_0.1.1
[4] whisker_0.3-2 magrittr_1.5 workflowr_1.1.1
[7] tidyselect_0.2.4 lattice_0.20-35 R6_2.2.2
[10] rlang_0.2.1 stringr_1.2.0 tools_3.3.2
[13] grid_3.3.2 R.oo_1.22.0 git2r_0.18.0
[16] htmltools_0.3.6 yaml_2.1.16 rprojroot_1.2
[19] digest_0.6.12 assertthat_0.2.0 tibble_1.4.2
[22] bindrcpp_0.2.2 purrr_0.2.5 R.utils_2.7.0
[25] glue_1.2.0 evaluate_0.10 rmarkdown_1.10
[28] stringi_1.1.5 pillar_1.2.3 backports_1.0.5
[31] R.methodsS3_1.7.1 pkgconfig_2.0.1
This reproducible R Markdown analysis was created with workflowr 1.1.1