Last updated: 2020-09-10
Checks: 7 0
Knit directory: scATACseq-topics/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
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.
The command set.seed(20200729)
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.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 7b8b36f. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use 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: .Rhistory
Ignored: .Rproj.user/
Untracked files:
Untracked: analysis/plots_Cusanovich2018.Rmd
Untracked: analysis/plots_Lareau2019_bonemarrow.Rmd
Untracked: code/plots.R
Unstaged changes:
Modified: analysis/process_data_Lareau2019.Rmd
Modified: code/functions_for_assessing_fits.R
Modified: scripts/fit_all_models_Cusanovich2018.sh
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.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/process_data_Cusanovich2018.Rmd
) and HTML (docs/process_data_Cusanovich2018.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | 7b8b36f | kevinlkx | 2020-09-10 | wflow_publish(“analysis/process_data_Cusanovich2018.Rmd”) |
html | edbd049 | kevinlkx | 2020-08-24 | Build site. |
Rmd | b836761 | kevinlkx | 2020-08-24 | wflow_publish(“analysis/process_data_Cusanovich2018.Rmd”) |
html | ceef630 | kevinlkx | 2020-08-21 | Build site. |
Rmd | d0bc60c | kevinlkx | 2020-08-21 | wflow_publish(“analysis/process_data_Cusanovich2018.Rmd”) |
Rmd | 0289508 | kevinlkx | 2020-08-21 | wflow_rename(“analysis/scATACseq_analysis_Cusanovich2018.Rmd”, |
html | 0289508 | kevinlkx | 2020-08-21 | wflow_rename(“analysis/scATACseq_analysis_Cusanovich2018.Rmd”, |
Reference: Cusanovich, D., Hill, A., Aghamirzaie, D., Daza, R., Pliner, H., Berletch, J., Filippova, G., Huang, X., Christiansen, L., DeWitt, W., Lee, C., Regalado, S., Read, D., Steemers, F., Disteche, C., Trapnell, C., Shendure, J. (2018). A Single-Cell Atlas of In Vivo Mammalian Chromatin Accessibility Cell 174(5), 1 35. https://dx.doi.org/10.1016/j.cell.2018.06.052
Data were downloaded from the website: https://atlas.gs.washington.edu/mouse-atac/data/. They also provided detail descriptions about these datasets.
RCC directory: /project2/mstephens/kevinluo/scATACseq-topics/data/Cusanovich_2018/
The authors included nice tutorials on how to get started with analysis of sci-ATAC-seq data: http://atlas.gs.washington.edu/mouse-atac/docs/
R/python scripts referenced in this tutorial are available on: https://github.com/shendurelab/mouse-atac and downloaded to /project2/mstephens/kevinluo/scATACseq-topics/data/Cusanovich_2018/code_from_authors/mouse-atac
on RCC.
Many of the initial steps of processing raw sci-ATAC-seq libraries used for this study are similar to their previous work of sci-ATAC-seq on Drosophila melanogaster embryos at 3 different stages of development. “Cusanovich, D., Reddington, J., Garfield, D. et al. The cis-regulatory dynamics of embryonic development at single-cell resolution. Nature 555, 538–542 (2018). https://doi.org/10.1038/nature25981”. Code and documentation on processing sequencing data can be found on the Fly ATAC Github. Documentation on various downstream steps can be found in the Fly ATAC documentation.
Binarized peak by cell matrix: atac_matrix.binary.qc_filtered.rds
(only QC filtered cells are included).
The subset of peaks used as input to TFIDF: atac_matrix.tfidf.qc_filtered.peaks.txt
.
TFIDF normalized peak by cell matrix: atac_matrix.tfidf.qc_filtered.rds
. This dataset has rare peaks filtered out and is then normalized with TFIDF to allow for input to PCA/TSNE (only QC filtered cells are included).
cell_metadata.txt
: Metadata for cells in TSV format, including several features such as TSNE coordinates, cluster assignments, and cell type assignments. Columns in this data:
cell_metadata <- read.table("/project2/mstephens/kevinluo/scATACseq-topics/data/Cusanovich_2018/metadata/cell_metadata.txt", header = TRUE, stringsAsFactors = TRUE, sep = "\t")
dim(cell_metadata)
[1] 81173 11
cell_metadata[1:3,]
cell tissue tissue.replicate cluster
1 AGCGATAGAACGAATTCGCCTCCGACGGCAGGACGT Lung Lung2_62216 10
2 AGCGATAGAACGAATTCGTTGGTAGTCGATAGAGGC Spleen Spleen_62016 10
3 AGCGATAGAACGCGCAGAAAGCTAGGTTAGGCGAAG BoneMarrow BoneMarrow_62016 10
subset_cluster tsne_1 tsne_2 subset_tsne1 subset_tsne2
1 1 16.25804 17.05674 -14.44873 -3.100071
2 1 15.28149 16.10859 -15.23808 1.123518
3 1 17.03914 14.69750 -16.88165 5.244815
id cell_label
1 clusters_10.cluster_1 Hematopoietic progenitors
2 clusters_10.cluster_1 Hematopoietic progenitors
3 clusters_10.cluster_1 Hematopoietic progenitors
cell_metadata.tissue_freq_filtered.txt
: Same as cell_metadata.txt
, but removes cells in each tissue belonging to a cell_label that accounts for less than 0.5% of the cells in that tissue. These very low frequency labels are often not cell types expected their respective tissues and could be due to slight imperfections in clustering, for example. Provided matrices would need to be subsetted to match this set of cells if using this metadata.cell_metadata <- read.table("/project2/mstephens/kevinluo/scATACseq-topics/data/Cusanovich_2018/metadata/cell_metadata.tissue_freq_filtered.txt", header = TRUE, stringsAsFactors = TRUE, sep = "\t")
dim(cell_metadata)
[1] 80254 11
cell_metadata[1:3,]
cell tissue tissue.replicate cluster
1 AGCGATAGAACGAATTCGCCTCCGACGGCAGGACGT Lung Lung2_62216 10
2 AGCGATAGAACGAATTCGTTGGTAGTCGATAGAGGC Spleen Spleen_62016 10
3 AGCGATAGAACGCGCAGAAAGCTAGGTTAGGCGAAG BoneMarrow BoneMarrow_62016 10
subset_cluster tsne_1 tsne_2 subset_tsne1 subset_tsne2
1 1 16.25804 17.05674 -14.44873 -3.100071
2 1 15.28149 16.10859 -15.23808 1.123518
3 1 17.03914 14.69750 -16.88165 5.244815
id cell_label
1 clusters_10.cluster_1 Hematopoietic progenitors
2 clusters_10.cluster_1 Hematopoietic progenitors
3 clusters_10.cluster_1 Hematopoietic progenitors
cell_type_assignments.xlsx
: Excel document with three tabs expected cell types, cell type markers, and Cell type assignments that contain a pairs of tissues and expected cell types, a list of positive markers for each cell type, and the table of cell type assignments with extra details about assignment criteria when applicable, respectively. This is meant to document justification for cell type assignments provided in cell_metadata.txt
above.
peak_promoter_intersections.txt
: Metadata for peaks-intersected TSS pairs in TSV format.
peak_promoter_intersections <- read.table("/project2/mstephens/kevinluo/scATACseq-topics/data/Cusanovich_2018/metadata/peak_promoter_intersections.txt", header = TRUE, stringsAsFactors = TRUE, sep = "\t")
dim(peak_promoter_intersections)
[1] 62545 9
peak_promoter_intersections[1:3,]
peak_id peak_chr peak_start peak_end ensembl_id
1 chr1_3206330_3206546 chr1 3206330 3206546 ENSMUSG00000051951.5
2 chr1_3456171_3457239 chr1 3456171 3457239 ENSMUSG00000089699.1
3 chr1_3660494_3662750 chr1 3660494 3662750 ENSMUSG00000051951.5
gene_short_name ensembl_transcript_id biotype strand
1 Xkr4 ENSMUST00000162897.1 processed_transcript -
2 Gm1992 ENSMUST00000161581.1 antisense +
3 Xkr4 ENSMUST00000070533.4 protein_coding -
library(Matrix)
library(tools)
atac_matrix.binary.qc_filtered.rds
(only QC filtered cells are included).## atac_matrix.binary.qc_filtered.rds: binarized peak by cell matrix in RDS format.
binarized_matrix <- readRDS("/project2/mstephens/kevinluo/scATACseq-topics/data/Cusanovich_2018/ATAC_matrices/atac_matrix.binary.qc_filtered.rds")
dim(binarized_matrix)
counts <- t(binarized_matrix)
## all peaks exist in all of the cells
length(which(colSums(counts > 0) == 0))
length(which(rowSums(counts > 0) == 0))
cat(sprintf("Number of samples (cells): %d\n",nrow(counts)))
cat(sprintf("Number of peaks: %d\n",ncol(counts)))
cat(sprintf("Proportion of counts that are non-zero: %0.1f%%.\n",
100*mean(counts > 0)))
cell_metadata.txt
: Metadata for cells in TSV format, including several features such as TSNE coordinates, cluster assignments, and cell type assignments.samples <- read.table("/project2/mstephens/kevinluo/scATACseq-topics/data/Cusanovich_2018/metadata/cell_metadata.txt", header = TRUE, stringsAsFactors = FALSE, sep = "\t")
dim(samples)
[1] 81173 11
cat(sprintf("Number of samples: %d\n",nrow(samples)))
Number of samples: 81173
print(samples[1:3,])
cell tissue tissue.replicate cluster
1 AGCGATAGAACGAATTCGCCTCCGACGGCAGGACGT Lung Lung2_62216 10
2 AGCGATAGAACGAATTCGTTGGTAGTCGATAGAGGC Spleen Spleen_62016 10
3 AGCGATAGAACGCGCAGAAAGCTAGGTTAGGCGAAG BoneMarrow BoneMarrow_62016 10
subset_cluster tsne_1 tsne_2 subset_tsne1 subset_tsne2
1 1 16.25804 17.05674 -14.44873 -3.100071
2 1 15.28149 16.10859 -15.23808 1.123518
3 1 17.03914 14.69750 -16.88165 5.244815
id cell_label
1 clusters_10.cluster_1 Hematopoietic progenitors
2 clusters_10.cluster_1 Hematopoietic progenitors
3 clusters_10.cluster_1 Hematopoietic progenitors
This study measured single cell chromatin accessibility in 13 different tissues in mice:
table(samples$tissue)
BoneMarrow Cerebellum Heart Kidney
8403 2278 7650 6431
LargeIntestine Liver Lung PreFrontalCortex
7086 6167 9996 5959
SmallIntestine Spleen Testes Thymus
4077 4020 2723 7617
WholeBrain
8766
Cells were labeled into the cell types:
table(samples$cell_label)
Activated B cells Alveolar macrophages
500 559
Astrocytes B cells
1666 5772
Cardiomyocytes Cerebellar granule cells
4076 4099
Collecting duct Collisions
164 1218
DCT/CD Dendritic cells
506 958
Distal convoluted tubule Endothelial I (glomerular)
319 552
Endothelial I cells Endothelial II cells
952 3019
Enterocytes Erythroblasts
4783 2811
Ex. neurons CPN Ex. neurons CThPN
1832 1540
Ex. neurons SCPN Hematopoietic progenitors
1466 3425
Hepatocytes Immature B cells
5664 571
Inhibitory neurons Loop of henle
1828 815
Macrophages Microglia
711 422
Monocytes NK cells
1173 321
Oligodendrocytes Podocytes
1558 498
Proximal tubule Proximal tubule S3
2570 594
Purkinje cells Regulatory T cells
320 507
SOM+ Interneurons Sperm
553 2089
T cells Type I pneumocytes
8954 1622
Type II pneumocytes Unknown
157 10029
data.dir <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Cusanovich_2018/processed_data/"
dir.create(data.dir, showWarnings = FALSE, recursive = TRUE)
saveRDS(counts, file.path(data.dir, "counts_Cusanovich_2018.rds"))
save(list = c("samples","counts"), file = file.path(data.dir, "Cusanovich_2018.RData"))
data.dir <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Cusanovich_2018/processed_data/"
load(file.path(data.dir, "Cusanovich_2018.RData"))
cat(sprintf("Loaded %d x %d counts matrix.\n",nrow(counts),ncol(counts)))
Loaded 81173 x 436206 counts matrix.
cat(sprintf("Number of samples (cells): %d\n",nrow(counts)))
Number of samples (cells): 81173
cat(sprintf("Number of peaks: %d\n",ncol(counts)))
Number of peaks: 436206
cat(sprintf("Proportion of counts that are non-zero: %0.1f%%.\n",
100*mean(counts > 0)))
Proportion of counts that are non-zero: 1.2%.
sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Scientific Linux 7.4 (Nitrogen)
Matrix products: default
BLAS/LAPACK: /software/openblas-0.2.19-el7-x86_64/lib/libopenblas_haswellp-r0.2.19.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] tools stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] Matrix_1.2-15 workflowr_1.6.2
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 lattice_0.20-38 rprojroot_1.3-2 digest_0.6.25
[5] later_1.0.0 grid_3.5.1 R6_2.4.1 backports_1.1.7
[9] git2r_0.27.1 magrittr_1.5 evaluate_0.14 stringi_1.4.6
[13] rlang_0.4.6 fs_1.3.1 promises_1.1.0 whisker_0.4
[17] rmarkdown_2.1 stringr_1.4.0 glue_1.4.1 httpuv_1.5.3.1
[21] xfun_0.14 yaml_2.2.0 compiler_3.5.1 htmltools_0.4.0
[25] knitr_1.28