Last updated: 2021-01-06

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 0c32e6a. 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/diff_count_Buenrostro2018_chomVAR_scPeaks.Rmd
    Untracked:  analysis/process_data_Buenrostro2018_Chen2019.Rmd
    Untracked:  analysis/single_cell_rnaseq_demo.Rmd
    Untracked:  output/clustering-Cusanovich2018.rds
    Untracked:  scripts/fit_all_models_Buenrostro_2018_chromVar_scPeaks_filtered.sbatch

Unstaged changes:
    Modified:   analysis/cisTopic_Buenrostro2018_chomVAR_scPeaks.Rmd
    Modified:   analysis/plots_Lareau2019_bonemarrow.Rmd
    Modified:   scripts/fit_all_models_Buenrostro_2018.sbatch
    Modified:   scripts/fit_cisTopic_Buenrostro_2018_chromVAR_scPeaks.sh
    Modified:   scripts/postfit_Buenrostro2018.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_Buenrostro2018.Rmd) and HTML (docs/process_data_Buenrostro2018.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 0c32e6a kevinlkx 2021-01-06 wflow_publish("analysis/process_data_Buenrostro2018.Rmd")
html 04cb767 kevinlkx 2021-01-06 Build site.
Rmd 97c421d kevinlkx 2021-01-06 put all four data processing options together
html 694fd3b kevinlkx 2020-11-19 Build site.
Rmd 4b7d5fa kevinlkx 2020-11-19 process data with peaks in less than 1% samples filtered out
html d5b411d kevinlkx 2020-11-18 Build site.
Rmd ee608fd kevinlkx 2020-11-18 process counts for aggregated single-cell peaks using chromVAR
html 594fd86 kevinlkx 2020-11-10 Build site.
Rmd 614814b kevinlkx 2020-11-10 process Buenrostro2018 data using Downloaded scATAC-seq processed data from GEO
Rmd c113844 kevinlkx 2020-11-10 wflow_rename("analysis/process_data_Buenrostro2018.Rmd", "analysis/process_data_Buenrostro2018_Chen2019pipeline.Rmd")
html c113844 kevinlkx 2020-11-10 wflow_rename("analysis/process_data_Buenrostro2018.Rmd", "analysis/process_data_Buenrostro2018_Chen2019pipeline.Rmd")
html 1905c58 kevinlkx 2020-11-05 Build site.
Rmd 1da32f8 kevinlkx 2020-11-05 set binarized counts as sparse matrix
html 89b45be kevinlkx 2020-11-04 Build site.
Rmd 857e1e8 kevinlkx 2020-11-04 process data from Buenrostro 2018 paper
html 907fa65 kevinlkx 2020-11-04 Build site.
Rmd 12bf4b3 kevinlkx 2020-11-04 process data from Buenrostro 2018 paper

About Buenrostro 2018 dataset

Reference: Buenrostro, J. D. et al. Integrated Single-Cell Analysis Maps the Continuous Regulatory Landscape of Human Hematopoietic Differentiation. Cell 173, 1535–1548.e16 (2018).

Data were downloaded from GEO: GSE96772 More details about the samples: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM2540299 RCC directory: /project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/

Prepare data for topic modeling

Here we tried four different options to process the scATAC-seq data.

In option 1, we used the processed counts and peaks from Buenrostro et al (2018) paper. However, the ATAC-seq peaks were defined using the bulk ATAC-seq samples. This may not be ideal as this approach may miss cell-type specific peaks that do not pass the peak calling threshold using all the bulk ATAC-seq samples. Thus, we did not use this option in our topic modeling of the dataset.

In option 2-4, we obtained the processed counts using the BAM reads and peaks from aggregated single cell ATAC-seq data. The processed peaks and BAM files were downloaded from scATAC-benchmarking website from Chen et al

Reference: Chen, H. et al. Assessment of computational methods for the analysis of single-cell ATAC-seq data. Genome Biol. 20, 241 (2019).

In option 2, we used the read count processing pipeline from Chen et al (2019), which uses bedtools to count reads in peaks. But it seems they did not consider the paired-end reads from the ATAC-seq data, i.e. they treated the paired-end reads as independent reads. This would bias the actual read counts, but should not affect the binarized counts (which we used in our topic modeling). The count processing pipeline from Chen et al (2019) also filtered peaks by requring peaks to be accessbile in at least 1% samples.

In option 3 and 4, we used chromVAR to count the reads in peaks, which considers the paired-end reads. In option 4, we further filtered the peaks by requring peaks to be accessbile in at least 1% samples. This filtering was also done using chormVAR.

Option 1. Using peaks called from bulk ATAC-seq samples

The Buenrostro et al (2018) paper called ATAC-seq peaks from the bulk ATAC-seq samples.

Using the previously described approach (Corces et al., 2016), we defined a peak list using all bulk hematopoietic data analyzed here, resulting in 491,437 500bp non-overlapping peaks which we use for the remainder of this study.

Downloaded scATAC-seq processed data from GEO: GSE96769

  • Peaks called from bulk ATAC-seq samples GSE96769_PeakFile_20160207.bed.gz
  • scATAC-seq sparse count matrix GSE96769_scATACseq_counts.txt.gz
library(Matrix)
library(tools)
library(readr)
library(data.table)

Load the fragment counts as a 2,953 x 491,437 sparse matrix.

# The first row has the sample names
file_counts <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/GEO_data/GSE96769_scATACseq_counts.txt.gz"
sample_names <- readLines(file_counts,n = 1)
sample_names <- unlist(strsplit(sample_names,"\t",fixed = TRUE))
sample_names <- unlist(strsplit(sample_names,";",fixed = TRUE))
sample_names <- sample_names[-1]

# Load the fragment counts as sparse matrix.
dat <- fread(file_counts,sep = "\t",skip = 1)
class(dat) <- "data.frame"
names(dat) <- c("i","j","x")
counts <- sparseMatrix(i = dat$i,j = dat$j,x = dat$x)
counts <- t(counts)
rownames(counts) <- sample_names
dim(counts)

peaks (from bulk ATAC-seq)

peaks <- fread("/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/GEO_data/GSE96769_PeakFile_20160207.bed.gz")
peak_names <- paste(peaks$V1,peaks$V2,peaks$V3,sep = "_")
rownames(peaks) <- peak_names
cat(sprintf("Number of peaks: %d\n",nrow(peaks)))

colnames(counts) <- peak_names

The supplementary Table S1 provides more details about these samples. https://ars.els-cdn.com/content/image/1-s2.0-S009286741830446X-mmc1.xlsx

Select the 2,034 samples (cells) passing quality filtering

Single-cell profiles were of consistent high-quality with 2,034 cells passing stringent quality filtering, yielding a median of 8,268 fragments per cell with 76% of those fragments mapping to peaks, resulting in a median of 6,442 fragments in peaks per cell (figure 1E).

Single-cells were filtered for quality requiring at least 60% of fragments in peaks and requiring greater than 1,000 fragments passing quality filters, quality filters are previously described (Corces et al., 2016) which includes removal of mitochondrial reads and low alignment quality (Q30).

The 2,034 samples (pass filter) were included in the metadata.tsv file on the scATAC-benchmarking website from Chen et al.

samples_filtered <- read.table('/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/data/input_Chen_2019/metadata.tsv', header = TRUE, stringsAsFactors=FALSE, quote="",row.names=1)
samples_filtered$name <- rownames(samples_filtered)

idx_samples_filtered <- match(samples_filtered$name, sample_names)
sample_names_filtered <- sample_names[idx_samples_filtered]
counts <- counts[idx_samples_filtered,]
samples <- samples_filtered[,c("name", "label")]
dim(counts)

Remove peaks not exist in any of the cells

j <- which(colSums(counts > 0) >= 1)
peaks <- peaks[j,]
counts <- counts[,j]
cat(length(j), "peaks after filtering.  \n")

Binarize counts

binarized_counts <- as.matrix((counts > 0) + 0)
binarized_counts <- Matrix(binarized_counts, sparse = TRUE) 

dim(binarized_counts)

Save processed data

data.dir <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/processed_data/"
dir.create(data.dir, showWarnings = FALSE, recursive = TRUE)

saveRDS(counts, file.path(data.dir, "counts_Buenrostro_2018.rds"))
saveRDS(binarized_counts, file.path(data.dir, "binarized_counts_Buenrostro_2018.rds"))

save(list = c("samples", "peaks", "counts"), 
     file = file.path(data.dir, "Buenrostro_2018.RData"))

counts <- binarized_counts
save(list = c("samples", "peaks", "counts"), 
     file = file.path(data.dir, "Buenrostro_2018_binarized.RData"))
data.dir <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/processed_data/"
load(file.path(data.dir, "Buenrostro_2018.RData"))
cat(sprintf("Loaded %d x %d counts matrix.\n",nrow(counts),ncol(counts)))

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)))

Option 2. Using the single-cell ATAC-seq data processing pipeline adapted from Chen et al (2019)

library(Matrix)
library(tools)
library(readr)
library(data.table)

count scATAC-seq reads in peaks

sbatch ~/projects/scATACseq-topics/scripts/count_reads_peaks_Buenrostro_2018.sbatch

combine counts from all samples

dir_readcount_output <- '/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/data/count_reads_peaks_output/'
files <- list.files(dir_readcount_output, pattern = "\\.txt$")
sample_names <- sapply(strsplit(files,'\\.'),'[', 1)
cat(length(sample_names), "samples. \n")
datalist <- lapply(files, function(x)fread(file.path(dir_readcount_output,x))$V4)
counts <- do.call("cbind", datalist)
data.dir <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/processed_data/"
dir.create(data.dir, showWarnings = FALSE, recursive = TRUE)

# saveRDS(counts, file.path(data.dir, "raw_counts_Buenrostro_2018.rds"))
counts <- readRDS(file.path(data.dir, "raw_counts_Buenrostro_2018.rds"))

Peaks

peaks <- read.csv("/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/data/input_Chen_2019/combined.sorted.merged.bed",
                      sep = '\t',header=FALSE,stringsAsFactors=FALSE)
peaknames <- paste(peaks$V1,peaks$V2,peaks$V3,sep = "_")
rownames(peaks) <- peaknames
cat(sprintf("Number of peaks: %d\n",nrow(peaks)))

head(peaknames)

colnames(counts) <- sample_names
rownames(counts) <- peaknames

dim(counts)

Samples metadata

samples <- read.table('/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/data/input_Chen_2019/metadata.tsv', header = TRUE, stringsAsFactors=FALSE, quote="",row.names=1)

head(samples)

Filter peaks (filter out peaks with counts in < 1% samples)

# adapted from Chen et al. Genome Biology 2019 paper https://github.com/pinellolab/scATAC-benchmarking/blob/master/Real_Data/Buenrostro_2018/run_methods/Control/Control_buenrostro2018.ipynb
# filter peaks with counts in at least 1% samples
filter_peaks <- function (datafr,cutoff = 0.01){
    binary_mat = as.matrix((datafr > 0) + 0)
    binary_mat = Matrix(binary_mat, sparse = TRUE) 
    num_cells_ncounted = Matrix::rowSums(binary_mat)
    ncounts = binary_mat[num_cells_ncounted >= dim(binary_mat)[2]*cutoff,]
    ncounts = ncounts[rowSums(ncounts) > 0,] 
    
    options(repr.plot.width=4, repr.plot.height=4)
    hist(log10(num_cells_ncounted),main="No. of Cells Each Site is Observed In",breaks=50)
    abline(v=log10(min(num_cells_ncounted[num_cells_ncounted >= dim(binary_mat)[2]*cutoff])),lwd=2,col="indianred")
#     hist(log10(new_counts),main="Number of Sites Each Cell Uses",breaks=50)
    peaks_selected = rownames(ncounts)
    return(peaks_selected)
}
peaks_selected <- filter_peaks(counts)
counts <- counts[peaks_selected,]
peaks <- peaks[peaks_selected, ]

counts <- t(counts)
counts <- Matrix(counts, sparse = TRUE) 
dim(counts)

Binarize counts

binarized_counts <- as.matrix((counts > 0) + 0)
binarized_counts <- Matrix(binarized_counts, sparse = TRUE) 

dim(binarized_counts)

Save processed data

saveRDS(counts, file.path(data.dir, "counts_Buenrostro_2018.rds"))
saveRDS(binarized_counts, file.path(data.dir, "binarized_counts_Buenrostro_2018.rds"))

save(list = c("samples", "peaks", "counts"), 
     file = file.path(data.dir, "Buenrostro_2018_counts.RData"))

counts <- binarized_counts
save(list = c("samples", "peaks", "counts"), 
     file = file.path(data.dir, "Buenrostro_2018_binarized_counts.RData"))
data.dir <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/processed_data/"
load(file.path(data.dir, "Buenrostro_2018_counts.RData"))
cat(sprintf("Loaded %d x %d counts matrix.\n",nrow(counts),ncol(counts)))

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)))

Option 3. Using BAM reads and peaks called from aggregated single-cell ATAC-seq data processed by Chen et al (2019)

Load chromVAR and related packages

# if (!requireNamespace("BiocManager", quietly = TRUE))
#     install.packages("BiocManager")
# BiocManager::install("chromVAR")
# BiocManager::install("motifmatchr")
# BiocManager::install("BSgenome.Hsapiens.UCSC.hg19")
# BiocManager::install("JASPAR2016")
library(chromVAR)
library(motifmatchr)
library(Matrix)
library(SummarizedExperiment)
library(BiocParallel)
library('JASPAR2016')
library(BSgenome.Hsapiens.UCSC.hg19)

register(MulticoreParam(10))

data.dir <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/processed_data_Chen2019pipeline/chromVAR/"
dir.create(data.dir, showWarnings = FALSE, recursive = TRUE)

samples metadata

samples <- read.table('/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/data/input_Chen_2019/metadata.tsv', header = TRUE, stringsAsFactors=FALSE, quote="",row.names=1)

peaks (from aggregated scATAC-seq)

peakfile <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/data/input_Chen_2019/combined.sorted.merged.bed"
peaks <- getPeaks(peakfile, sort_peaks = TRUE)
peaks <- resize(peaks, width = 500, fix = "center")

cat(length(peaks), "peaks \n")

BAM files of scATAC-seq reads

dir_bamfiles <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/data/input_Chen_2019/sc-bams_nodup/"
bamfiles <- list.files(path = dir_bamfiles, pattern = "\\.bam$")
cellnames <- sapply(strsplit(bamfiles,'.',fixed = TRUE), "[[", 1)
sum(cellnames == rownames(samples))

count scATAC-seq paired-end fragments in the peaks using chromVAR

fragment_counts <- getCounts(file.path(dir_bamfiles,bamfile), 
                             peaks, 
                             paired = TRUE, 
                             by_rg = TRUE, 
                             format = "bam", 
                             colData = data.frame(celltype = cellnames))

saveRDS(fragment_counts, file.path(data.dir, "fragment_counts_scPeaks_chromVAR_Buenrostro_2018.rds"))
fragment_counts <- readRDS(file.path(data.dir, "fragment_counts_scPeaks_chromVAR_Buenrostro_2018.rds"))
fragment_counts
counts <- assay(fragment_counts)
counts <- t(counts)

peaks <- as.data.frame(peaks)[,1:3]
colnames(peaks) <- c("chr", "start", "end")
peak_names <- paste(peaks$chr, peaks$start, peaks$end, sep = "_")
colnames(counts) <- peak_names

Filter peaks (accessible in at least 1 sample) using filterPeaks in chromVAR

idx_peaks_filtered <- filterPeaks(fragment_counts, min_fragments_per_peak = 1, non_overlapping = TRUE, ix_return = TRUE)
peaks <- peaks[idx_peaks_filtered,]
counts <- counts[,idx_peaks_filtered]
cat(length(idx_peaks_filtered), "peaks after filtering.  \n")

Binarize counts

binarized_counts <- as.matrix((counts > 0) + 0)
binarized_counts <- Matrix(binarized_counts, sparse = TRUE) 
dim(binarized_counts)

Save processed data

saveRDS(counts, file.path(data.dir, "counts_scPeaks_Buenrostro_2018.rds"))
saveRDS(binarized_counts, file.path(data.dir, "binarized_counts_scPeaks_Buenrostro_2018.rds"))

save(list = c("samples", "peaks", "counts"), 
     file = file.path(data.dir, "Buenrostro_2018_scPeaks.RData"))

counts <- binarized_counts
save(list = c("samples", "peaks", "counts"), 
     file = file.path(data.dir, "Buenrostro_2018_binarized_scPeaks.RData"))
data.dir <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/processed_data_Chen2019pipeline/chromVAR/"

load(file.path(data.dir, "Buenrostro_2018_binarized_scPeaks.RData"))
cat(sprintf("Loaded %d x %d counts matrix.\n",nrow(counts),ncol(counts)))

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)))

Option 4. Using BAM reads and peaks called from aggregated single-cell ATAC-seq data processed by Chen et al (2019) and filter peaks that are accessible in less than 1% samples

Load chromVAR and related packages

library(chromVAR)
library(motifmatchr)
library(Matrix)
library(SummarizedExperiment)
library(BiocParallel)
library('JASPAR2016')
library(BSgenome.Hsapiens.UCSC.hg19)

register(MulticoreParam(10))

data.dir <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/processed_data_Chen2019pipeline/chromVAR/"
dir.create(data.dir, showWarnings = FALSE, recursive = TRUE)

samples metadata

samples <- read.table('/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/data/input_Chen_2019/metadata.tsv', header = TRUE, stringsAsFactors=FALSE, quote="",row.names=1)

peaks (from aggregated scATAC-seq)

peakfile <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/data/input_Chen_2019/combined.sorted.merged.bed"
peaks <- getPeaks(peakfile, sort_peaks = TRUE)
peaks <- resize(peaks, width = 500, fix = "center")

cat(length(peaks), "peaks \n")

BAM reads

dir_bamfiles <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/data/input_Chen_2019/sc-bams_nodup/"
bamfiles <- list.files(path = dir_bamfiles, pattern = "\\.bam$")
cellnames <- sapply(strsplit(bamfiles,'.',fixed = TRUE), "[[", 1)
sum(cellnames == rownames(samples))

count scATAC-seq paired-end fragments in the peaks

fragment_counts <- getCounts(file.path(dir_bamfiles,bamfile), 
                             peaks, 
                             paired = TRUE, 
                             by_rg = TRUE, 
                             format = "bam", 
                             colData = data.frame(celltype = cellnames))

saveRDS(fragment_counts, file.path(data.dir, "fragment_counts_scPeaks_chromVAR_Buenrostro_2018.rds"))
fragment_counts <- readRDS(file.path(data.dir, "fragment_counts_scPeaks_chromVAR_Buenrostro_2018.rds"))
fragment_counts
counts <- assay(fragment_counts)
counts <- t(counts)

peaks <- as.data.frame(peaks)[,1:3]
colnames(peaks) <- c("chr", "start", "end")
peak_names <- paste(peaks$chr, peaks$start, peaks$end, sep = "_")
colnames(counts) <- peak_names

Filter peaks (filter out peaks with fragments in < 1% samples)

fragment_binarized_counts <- fragment_counts
assay(fragment_binarized_counts) <- Matrix(as.matrix((assay(fragment_binarized_counts) > 0) + 0), sparse = TRUE)
idx_peaks_filtered <- filterPeaks(fragment_binarized_counts, min_fragments_per_peak = floor(nrow(samples)*0.01), non_overlapping = TRUE, ix_return = TRUE)
cat(length(idx_peaks_filtered), "peaks selected after filtering.  \n")

peaks <- peaks[idx_peaks_filtered,]
counts <- counts[,idx_peaks_filtered]

Binarize counts

binarized_counts <- as.matrix((counts > 0) + 0)
binarized_counts <- Matrix(binarized_counts, sparse = TRUE) 
dim(binarized_counts)

Save processed data

save(list = c("samples", "peaks", "counts"), 
     file = file.path(data.dir, "Buenrostro_2018_scPeaks_filtered.RData"))

counts <- binarized_counts
save(list = c("samples", "peaks", "counts"), 
     file = file.path(data.dir, "Buenrostro_2018_binarized_scPeaks_filtered.RData"))
data.dir <- "/project2/mstephens/kevinluo/scATACseq-topics/data/Buenrostro_2018/processed_data_Chen2019pipeline/chromVAR/"

load(file.path(data.dir, "Buenrostro_2018_binarized_scPeaks_filtered.RData"))
cat(sprintf("Loaded %d x %d counts matrix.\n",nrow(counts),ncol(counts)))

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)))

sessionInfo()