The example analysis is implemented by ArchR.
The example data, spanning the hematopoieitic hierarchy from stem cells to differentiated cells, consist in ~35000 cells from bone marrow mononuclear cells (BMMC), peripheral blood mononuclear cells (PBMC), and CD34+ hematopoietic stem and progenitor cells from bone marrow (CD34 BMMC). The data was produces by Granja et al. 2019.
First import ArchR we will be using for analyzing input data.
options(warn=-1)
library(ArchR)
set.seed(1)
Next, we set the default number of threads to 8 for parallelized operations in ArchR functions.
addArchRThreads(threads = 8)
## Setting default number of Parallel threads to 8.
The first step of analysis is to load the fragment file as an ArchR object.
The fragment file represents a full list of all unique fragments across all single cells. It is a substantially larger file, is slower to work with, and is stored on-disk (instead of in memory). However, the advantage of retaining this file is that it contains all fragments associated with each single cell, as opposed to only fragments that map to peaks.
Internal parameters:
task_id - The only identifier of each task.
task_id <- 'Example'
inputpath <- paste0("./", task_id, "/")
outputpath <- paste0("./", task_id, "/results/")
We start by creating an Arrow file. ArchR uses a matrix and a fragment file as input.
User-defined parameters:
Fragment_file - The name of the fragment file you want to load. Default: 'scATAC_BMMC_R1.fragments.tsv.gz'.
Reference_genome - 'hg19', 'hg38', 'mm9' or 'mm10' are the 4 currently recognised genomic version in this pipeline. Default: 'hg19'.
In this pipeline, we downloaded the Hematopoeisis data using the getTutorialData() function as the tutorial data.
inputFiles <- getTutorialData("Hematopoiesis")
## Downloading files to HemeFragments...
inputFiles
## scATAC_BMMC_R1
## "HemeFragments/scATAC_BMMC_R1.fragments.tsv.gz"
## scATAC_CD34_BMMC_R1
## "HemeFragments/scATAC_CD34_BMMC_R1.fragments.tsv.gz"
## scATAC_PBMC_R1
## "HemeFragments/scATAC_PBMC_R1.fragments.tsv.gz"
We add a reference genome annotation for ArchR to have access to chromosome and gene information.
Reference_genome <- "hg19"
addArchRGenome(Reference_genome)
## Setting default genome to Hg19.
We start by creating an Arrow file using the fragment file as input. For each sample, this step will:
1. Read accessible fragments from the provided input files.
2. Calculate quality control information for each cell (i.e. TSS enrichment scores and nucleosome info).
3. Filter cells based on quality control parameters and create a folder in the current working directory called “QualityControl” which will contain 2 plots associated with each of your samples. The first plot shows the log10(unique nuclear fragments) vs TSS enrichment score and indicates the thresholds used with dotted lines. The second shows the fragment size distribution.
4. Create a genome-wide TileMatrix using 500-bp bins.
5. Create a GeneScoreMatrix using the custom geneAnnotation that was defined when we called addArchRGenome().
User-defined parameters:
Minimum_TSS_enrichment - Minimum TSS enrichment scores required for a cell to pass filtering. Default: 4.
Minimum_fragments_in_peaks - Minimum number of fragments in peaks required for a cell to pass filtering. Default: 1000.
Minimum_TSS_enrichment <- 4
Minimum_fragments_in_peaks <- 1000
ArrowFiles <- createArrowFiles(
inputFiles = inputFiles,
sampleNames = names(inputFiles),
filterTSS = Minimum_TSS_enrichment, #Dont set this too high because you can always increase later
filterFrags = Minimum_fragments_in_peaks,
QCDir = paste0(outputpath, "QualityControl"),
addTileMat = TRUE,
addGeneScoreMat = TRUE,
force=TRUE
)
## filterFrags is no longer a valid input. Please use minFrags! Setting filterFrags value to minFrags!
## filterTSS is no longer a valid input. Please use minTSS! Setting filterTSS value to minTSS!
## Using GeneAnnotation set by addArchRGenome(Hg19)!
## Using GeneAnnotation set by addArchRGenome(Hg19)!
## ArchR logging to : ArchRLogs/ArchR-createArrows-78d24cdc1776-Date-2023-08-30_Time-15-41-26.log
## If there is an issue, please report to github with logFile!
## Cleaning Temporary Files
## 2023-08-30 15:41:26 : Batch Execution w/ safelapply!, 0 mins elapsed.
## ArchR logging successful to : ArchRLogs/ArchR-createArrows-78d24cdc1776-Date-2023-08-30_Time-15-41-26.log
ArrowFiles
## [1] "scATAC_BMMC_R1.arrow" "scATAC_CD34_BMMC_R1.arrow"
## [3] "scATAC_PBMC_R1.arrow"
After Arrow file creation, we can infer potential doublets (a single droplet containing multiple cells) that can confound downstream results. This is done using the addDoubletScores() function.
Adding doublet scores will create plots in the “QualityControl” directory. There are 3 plots associated with each of your samples in this folder:
1. Doublet Enrichments - These represent the enrichment of simulated doublets nearby each single cell compared to the expected if we assume a uniform distribution.
2. Doublet Scores - These represent the significance (-log10(binomial adjusted p-value)) of simulated doublets nearby each single cell compared to the expected if we assume a uniform distribution. We have found this value to be less consistent than the doublet enrichments and therefore use doublet enrichments for doublet identification.
3. Doublet Density - This represents the density of the simulated doublet projections. This allows you to visualize where the synthetic doublets were located after projection into your 2-dimensional embedding.
doubScores <- addDoubletScores(
input = ArrowFiles,
k = 10, #Refers to how many cells near a "pseudo-doublet" to count.
knnMethod = "UMAP", #Refers to the embedding to use for nearest neighbor search.
LSIMethod = 1,
outDir = outputpath
)
## ArchR logging to : ArchRLogs/ArchR-addDoubletScores-78d2224045a5-Date-2023-08-30_Time-15-48-39.log
## If there is an issue, please report to github with logFile!
## 2023-08-30 15:48:39 : Batch Execution w/ safelapply!, 0 mins elapsed.
## 2023-08-30 15:48:39 : scATAC_BMMC_R1 (1 of 3) : Computing Doublet Statistics, 0 mins elapsed.
## scATAC_BMMC_R1 (1 of 3) : UMAP Projection R^2 = 0.9878
## scATAC_BMMC_R1 (1 of 3) : UMAP Projection R^2 = 0.9878
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## 2023-08-30 15:49:38 : scATAC_CD34_BMMC_R1 (2 of 3) : Computing Doublet Statistics, 0.982 mins elapsed.
## scATAC_CD34_BMMC_R1 (2 of 3) : UMAP Projection R^2 = 0.99213
## scATAC_CD34_BMMC_R1 (2 of 3) : UMAP Projection R^2 = 0.99213
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## 2023-08-30 15:50:24 : scATAC_PBMC_R1 (3 of 3) : Computing Doublet Statistics, 1.748 mins elapsed.
## scATAC_PBMC_R1 (3 of 3) : UMAP Projection R^2 = 0.9753
## scATAC_PBMC_R1 (3 of 3) : UMAP Projection R^2 = 0.9753
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## ArchR logging successful to : ArchRLogs/ArchR-addDoubletScores-78d2224045a5-Date-2023-08-30_Time-15-48-39.log
We create ArchRProject by providing a list of Arrow files and a few other parameters. The outputDirectory here describes where all downstream analyses and plots will be saved.
proj <- ArchRProject(
ArrowFiles = ArrowFiles,
outputDirectory = outputpath,
copyArrows = TRUE #This is recommened so that you maintain an unaltered copy for later usage.
)
## Using GeneAnnotation set by addArchRGenome(Hg19)!
## Using GeneAnnotation set by addArchRGenome(Hg19)!
## Validating Arrows...
## Getting SampleNames...
##
## Copying ArrowFiles to Ouptut Directory! If you want to save disk space set copyArrows = FALSE
## 1 2 3
## Getting Cell Metadata...
##
## Merging Cell Metadata...
## Initializing ArchRProject...
##
## / |
## / \
## . / |.
## \\\ / |.
## \\\ / `|.
## \\\ / |.
## \ / |\
## \\#####\ / ||
## ==###########> / ||
## \\##==......\ / ||
## ______ = =|__ /__ || \\\
## ,--' ,----`-,__ ___/' --,-`-===================##========>
## \ ' ##_______ _____ ,--,__,=##,__ ///
## , __== ___,-,__,--'#' ===' `-' | ##,-/
## -,____,---' \\####\\________________,--\\_##,/
## ___ .______ ______ __ __ .______
## / \ | _ \ / || | | | | _ \
## / ^ \ | |_) | | ,----'| |__| | | |_) |
## / /_\ \ | / | | | __ | | /
## / _____ \ | |\ \\___ | `----.| | | | | |\ \\___.
## /__/ \__\ | _| `._____| \______||__| |__| | _| `._____|
##
We can also ask which data matrices are available within the ArchRProject which will be useful downstream once we start adding to this project:
getAvailableMatrices(proj)
## [1] "GeneScoreMatrix" "TileMatrix"
Now we can filter putative doublets based on the previously determined doublet scores using the filterDoublets() function. This doesn’t physically remove data from the Arrow files but rather tells the ArchRProject to ignore these cells for downstream analysis.
proj <- filterDoublets(ArchRProj = proj)
## Filtering 410 cells from ArchRProject!
## scATAC_BMMC_R1 : 243 of 4932 (4.9%)
## scATAC_CD34_BMMC_R1 : 107 of 3275 (3.3%)
## scATAC_PBMC_R1 : 60 of 2453 (2.4%)
proj
##
## ___ .______ ______ __ __ .______
## / \ | _ \ / || | | | | _ \
## / ^ \ | |_) | | ,----'| |__| | | |_) |
## / /_\ \ | / | | | __ | | /
## / _____ \ | |\ \\___ | `----.| | | | | |\ \\___.
## /__/ \__\ | _| `._____| \______||__| |__| | _| `._____|
##
## class: ArchRProject
## outputDirectory: /home/scepitools/archr_cxj/Example/results
## samples(3): scATAC_BMMC_R1 scATAC_CD34_BMMC_R1 scATAC_PBMC_R1
## sampleColData names(1): ArrowFiles
## cellColData names(15): Sample TSSEnrichment ... DoubletEnrichment
## BlacklistRatio
## numberOfCells(1): 10250
## medianTSS(1): 16.815
## medianFrags(1): 2992
ArchR implements an iterative LSI dimensionality reduction via the addIterativeLSI() function.
proj <- addIterativeLSI(ArchRProj = proj, useMatrix = "TileMatrix", name = "IterativeLSI", outDir = outputpath)
## Checking Inputs...
## ArchR logging to : ArchRLogs/ArchR-addIterativeLSI-78d2920d1c9-Date-2023-08-30_Time-15-51-09.log
## If there is an issue, please report to github with logFile!
## 2023-08-30 15:51:10 : Computing Total Across All Features, 0.002 mins elapsed.
## 2023-08-30 15:51:10 : Computing Top Features, 0.018 mins elapsed.
## ###########
## 2023-08-30 15:51:12 : Running LSI (1 of 2) on Top Features, 0.036 mins elapsed.
## ###########
## 2023-08-30 15:51:12 : Sampling Cells (N = 10001) for Estimated LSI, 0.037 mins elapsed.
## 2023-08-30 15:51:12 : Creating Sampled Partial Matrix, 0.037 mins elapsed.
## 2023-08-30 15:51:15 : Computing Estimated LSI (projectAll = FALSE), 0.089 mins elapsed.
## 2023-08-30 15:51:34 : Identifying Clusters, 0.407 mins elapsed.
## 2023-08-30 15:51:44 : Identified 6 Clusters, 0.568 mins elapsed.
## 2023-08-30 15:51:44 : Saving LSI Iteration, 0.568 mins elapsed.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## WARNING: Error found with Cairo installation. Continuing without rasterization.
## 2023-08-30 15:51:54 : Creating Cluster Matrix on the total Group Features, 0.75 mins elapsed.
## 2023-08-30 15:52:04 : Computing Variable Features, 0.903 mins elapsed.
## ###########
## 2023-08-30 15:52:04 : Running LSI (2 of 2) on Variable Features, 0.905 mins elapsed.
## ###########
## 2023-08-30 15:52:04 : Creating Partial Matrix, 0.906 mins elapsed.
## 2023-08-30 15:52:07 : Computing LSI, 0.955 mins elapsed.
## 2023-08-30 15:52:23 : Finished Running IterativeLSI, 1.233 mins elapsed.
To call clusters in this reduced dimension sub-space, we use the addClusters() function.
User-defined parameters:
Clustering_algorithm - The algorithm for clustering. scEpiTools provides two choices, "Seurat" and "Scran". Default: "Seurat".
Clustering_algorithm <- c("Seurat")
for (Clustering_algorithm_ in Clustering_algorithm) {
print(Clustering_algorithm_)
proj <- addClusters(input = proj, reducedDims = "IterativeLSI", method = Clustering_algorithm_, name = paste0("Clusters_",Clustering_algorithm_), force=TRUE)
}
## [1] "Seurat"
## ArchR logging to : ArchRLogs/ArchR-addClusters-78d26081d3a6-Date-2023-08-30_Time-15-52-23.log
## If there is an issue, please report to github with logFile!
## 2023-08-30 15:52:24 : Running Seurats FindClusters (Stuart et al. Cell 2019), 0.001 mins elapsed.
## Computing nearest neighbor graph
## Computing SNN
## Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
##
## Number of nodes: 10250
## Number of edges: 455876
##
## Running Louvain algorithm...
## Maximum modularity in 10 random starts: 0.8696
## Number of communities: 12
## Elapsed time: 0 seconds
## 2023-08-30 15:52:33 : Testing Outlier Clusters, 0.157 mins elapsed.
## 2023-08-30 15:52:33 : Assigning Cluster Names to 12 Clusters, 0.157 mins elapsed.
## 2023-08-30 15:52:33 : Finished addClusters, 0.158 mins elapsed.
We can visualize our data using a 2-dimensional representation such as Uniform Manifold Approximation and Projection (UMAP) and t-Stocastic Neighbor Embedding (t-SNE).
User-defined parameters:
Visualization_method - The visualization method for displaying clustering results, scEpiTools provides two choices, "umap" and "tsne". Default: "umap".
Visualization_method <- toupper(c('umap'))
for (Visualization_method_ in Visualization_method) {
if (Visualization_method_ == 'TSNE') {
proj <- addTSNE(ArchRProj = proj, reducedDims = "IterativeLSI", force = TRUE)
} else {
proj <- addUMAP(ArchRProj = proj, reducedDims = "IterativeLSI", force = TRUE)
}
}
## 15:52:33 UMAP embedding parameters a = 0.7669 b = 1.223
## 15:52:33 Read 10250 rows and found 30 numeric columns
## 15:52:33 Using Annoy for neighbor search, n_neighbors = 40
## 15:52:33 Building Annoy index with metric = cosine, n_trees = 50
## 0% 10 20 30 40 50 60 70 80 90 100%
## [----|----|----|----|----|----|----|----|----|----|
## **************************************************|
## 15:52:34 Writing NN index file to temp file /tmp/Rtmpv01T2p/file78d21b20f3f3
## 15:52:34 Searching Annoy index using 8 threads, search_k = 4000
## 15:52:34 Annoy recall = 100%
## 15:52:35 Commencing smooth kNN distance calibration using 8 threads with target n_neighbors = 40
## 15:52:35 Initializing from normalized Laplacian + noise (using irlba)
## 15:52:36 Commencing optimization for 200 epochs, with 618908 positive edges
## 15:52:40 Optimization finished
## 15:52:40 Creating temp model dir /tmp/Rtmpv01T2p/dir78d2291341c8
## 15:52:40 Creating dir /tmp/Rtmpv01T2p/dir78d2291341c8
## 15:52:41 Changing to /tmp/Rtmpv01T2p/dir78d2291341c8
## 15:52:41 Creating /home/scepitools/archr_cxj/Example/results/Embeddings/Save-Uwot-UMAP-Params-IterativeLSI-78d24d1c3fb4-Date-2023-08-30_Time-15-52-40.tar
p <- c()
for (Visualization_method_ in Visualization_method) {
p[[paste0(Visualization_method_, "_Sample")]] <- plotEmbedding(ArchRProj = proj, colorBy = "cellColData", name = "Sample", embedding = Visualization_method_)
for (Clustering_algorithm_ in Clustering_algorithm) {
p[[paste0(Visualization_method_, "_Clusters_", Clustering_algorithm_)]] <- plotEmbedding(ArchRProj = proj, colorBy = "cellColData",
name = paste0("Clusters_",Clustering_algorithm_),
embedding = Visualization_method_)
}
}
## ArchR logging to : ArchRLogs/ArchR-plotEmbedding-78d233cf9947-Date-2023-08-30_Time-15-52-41.log
## If there is an issue, please report to github with logFile!
## Getting UMAP Embedding
## ColorBy = cellColData
## Plotting Embedding
## 1 WARNING: Error found with Cairo installation. Continuing without rasterization.
##
## ArchR logging successful to : ArchRLogs/ArchR-plotEmbedding-78d233cf9947-Date-2023-08-30_Time-15-52-41.log
## ArchR logging to : ArchRLogs/ArchR-plotEmbedding-78d260fa51ea-Date-2023-08-30_Time-15-52-42.log
## If there is an issue, please report to github with logFile!
## Getting UMAP Embedding
## ColorBy = cellColData
## Plotting Embedding
## 1 WARNING: Error found with Cairo installation. Continuing without rasterization.
##
## ArchR logging successful to : ArchRLogs/ArchR-plotEmbedding-78d260fa51ea-Date-2023-08-30_Time-15-52-42.log
options(repr.plot.width = 6, repr.plot.height = 6)
p
## $UMAP_Sample
##
## $UMAP_Clusters_Seurat
plotPDF(p, name = "Visualization-Sample-Clusters.pdf", ArchRProj = proj, addDOC = FALSE, width = 6, height = 6)
## Plotting Ggplot!
## Plotting Ggplot!
To do cell type annotation manually, we use prior knowledge of cell type-specific marker genes and we use gene score for the prediction of how highly expressed a gene will be based on the accessibility of regulatory elements in the vicinity of the gene.
User-defined parameters:
Marker_genes - Marker genes to help interpret our ATAC-seq clusters. It is a string separated by ','. Default: NULL.
Marker_genes <- 'CD34,GATA1,PAX5,MS4A1,MME,CD14,MPO,CD3D,CD8A'
We can try to assign biological labels to these clusters using marker genes.
if (Marker_genes != "NULL") {
Marker_genes_ <- strsplit(Marker_genes, ",")[[1]]
p <- c()
for (Visualization_method_ in Visualization_method) {
p[[paste0(Visualization_method_, "_Marker_genes")]] <- plotEmbedding(ArchRProj = proj, colorBy = "GeneScoreMatrix", name = Marker_genes_,
embedding = Visualization_method_, imputeWeights = getImputeWeights(proj))
}
} else {print("There is no marker genes for this step!")}
## Getting ImputeWeights
## No imputeWeights found, returning NULL
## ArchR logging to : ArchRLogs/ArchR-plotEmbedding-78d26cdf5abf-Date-2023-08-30_Time-15-52-45.log
## If there is an issue, please report to github with logFile!
## Getting UMAP Embedding
## ColorBy = GeneScoreMatrix
## Getting Matrix Values...
## 2023-08-30 15:52:46 :
##
## Plotting Embedding
## 1 2 3 4 5 6 7 8 9
## ArchR logging successful to : ArchRLogs/ArchR-plotEmbedding-78d26cdf5abf-Date-2023-08-30_Time-15-52-45.log
Cowplot of marker genes that lights up the corresponding cell clusters.
if (Marker_genes != "NULL") {
print(p[[1]][[1]])
} else {print("There is no marker genes for this step!")}
if (Marker_genes != "NULL") {
plotPDF(plotList = p,
name = "Visualization-Marker-Genes-W-Imputation.pdf",
ArchRProj = proj,
addDOC = FALSE, width = 5, height = 5)
} else {print("There is no marker genes for this step!")}
## Plotting Ggplot!
## Plotting Ggplot!
## Plotting Ggplot!
## Plotting Ggplot!
## Plotting Ggplot!
## Plotting Ggplot!
## Plotting Ggplot!
## Plotting Ggplot!
## Plotting Ggplot!
We can browse the local chromatin accessibility at marker genes on a per cluster basis with genome browser tracks.
if (Marker_genes != "NULL") {
p <- c()
for (Clustering_algorithm_ in Clustering_algorithm) {
p[[paste0("Clusters_", Clustering_algorithm_)]] <- plotBrowserTrack(ArchRProj = proj, groupBy = paste0("Clusters_", Clustering_algorithm_),
geneSymbol = Marker_genes_, upstream = 50000, downstream = 50000)
}
} else {print("There is no marker genes for this step!")}
## ArchR logging to : ArchRLogs/ArchR-plotBrowserTrack-78d265e6409f-Date-2023-08-30_Time-15-52-54.log
## If there is an issue, please report to github with logFile!
## 2023-08-30 15:52:55 : Validating Region, 0.002 mins elapsed.
## GRanges object with 9 ranges and 2 metadata columns:
## seqnames ranges strand | gene_id symbol
## <Rle> <IRanges> <Rle> | <character> <character>
## [1] chr1 208059883-208084683 - | 947 CD34
## [2] chrX 48644982-48652717 + | 2623 GATA1
## [3] chr9 36838531-37034476 - | 5079 PAX5
## [4] chr11 60223282-60238225 + | 931 MS4A1
## [5] chr3 154741913-154901518 + | 4311 MME
## [6] chr5 140011313-140013286 - | 929 CD14
## [7] chr17 56347217-56358296 - | 4353 MPO
## [8] chr11 118209789-118213459 - | 915 CD3D
## [9] chr2 87011728-87035519 - | 925 CD8A
## -------
## seqinfo: 24 sequences from hg19 genome
## 2023-08-30 15:52:55 : Adding Bulk Tracks (1 of 9), 0.003 mins elapsed.
## 2023-08-30 15:52:55 : Adding Gene Tracks (1 of 9), 0.01 mins elapsed.
## 2023-08-30 15:52:55 : Plotting, 0.013 mins elapsed.
## 2023-08-30 15:52:56 : Adding Bulk Tracks (2 of 9), 0.025 mins elapsed.
## 2023-08-30 15:52:56 : Adding Gene Tracks (2 of 9), 0.031 mins elapsed.
## 2023-08-30 15:52:56 : Plotting, 0.033 mins elapsed.
## 2023-08-30 15:52:57 : Adding Bulk Tracks (3 of 9), 0.044 mins elapsed.
## 2023-08-30 15:52:57 : Adding Gene Tracks (3 of 9), 0.051 mins elapsed.
## 2023-08-30 15:52:58 : Plotting, 0.054 mins elapsed.
## 2023-08-30 15:52:58 : Adding Bulk Tracks (4 of 9), 0.066 mins elapsed.
## 2023-08-30 15:52:59 : Adding Gene Tracks (4 of 9), 0.073 mins elapsed.
## 2023-08-30 15:52:59 : Plotting, 0.075 mins elapsed.
## 2023-08-30 15:53:00 : Adding Bulk Tracks (5 of 9), 0.085 mins elapsed.
## 2023-08-30 15:53:00 : Adding Gene Tracks (5 of 9), 0.091 mins elapsed.
## 2023-08-30 15:53:00 : Plotting, 0.094 mins elapsed.
## 2023-08-30 15:53:01 : Adding Bulk Tracks (6 of 9), 0.103 mins elapsed.
## 2023-08-30 15:53:01 : Adding Gene Tracks (6 of 9), 0.11 mins elapsed.
## 2023-08-30 15:53:01 : Plotting, 0.112 mins elapsed.
## 2023-08-30 15:53:02 : Adding Bulk Tracks (7 of 9), 0.125 mins elapsed.
## 2023-08-30 15:53:02 : Adding Gene Tracks (7 of 9), 0.132 mins elapsed.
## 2023-08-30 15:53:03 : Plotting, 0.134 mins elapsed.
## 2023-08-30 15:53:03 : Adding Bulk Tracks (8 of 9), 0.148 mins elapsed.
## 2023-08-30 15:53:04 : Adding Gene Tracks (8 of 9), 0.155 mins elapsed.
## 2023-08-30 15:53:04 : Plotting, 0.157 mins elapsed.
## 2023-08-30 15:53:05 : Adding Bulk Tracks (9 of 9), 0.169 mins elapsed.
## 2023-08-30 15:53:05 : Adding Gene Tracks (9 of 9), 0.176 mins elapsed.
## 2023-08-30 15:53:05 : Plotting, 0.178 mins elapsed.
## ArchR logging successful to : ArchRLogs/ArchR-plotBrowserTrack-78d265e6409f-Date-2023-08-30_Time-15-52-54.log
To plot a track of a specific gene, we can simply select one from the list.
if (Marker_genes != "NULL") {
options(repr.plot.width = 12, repr.plot.height = 12)
grid::grid.newpage()
grid::grid.draw(p[[1]][[1]])
} else {print("There is no marker genes for this step!")}
if (Marker_genes != "NULL") {
plotPDF(plotList = p,
name = "Tracks-Marker-Genes.pdf",
ArchRProj = proj,
addDOC = FALSE, width = 5, height = 5)
} else {print("There is no marker genes for this step!")}
## Plotting Gtable!
## NULL
## Plotting Gtable!
## NULL
## Plotting Gtable!
## NULL
## Plotting Gtable!
## NULL
## Plotting Gtable!
## NULL
## Plotting Gtable!
## NULL
## Plotting Gtable!
## NULL
## Plotting Gtable!
## NULL
## Plotting Gtable!
## NULL
Write .rds-formatted file. You can get the results (a html file, a rds file and figure files) via your taskID.
proj <- saveArchRProject(ArchRProj = proj, outputDirectory = outputpath)
## Saving ArchRProject...
## Loading ArchRProject...
## Successfully loaded ArchRProject!
##
## / |
## / \
## . / |.
## \\\ / |.
## \\\ / `|.
## \\\ / |.
## \ / |\
## \\#####\ / ||
## ==###########> / ||
## \\##==......\ / ||
## ______ = =|__ /__ || \\\
## ,--' ,----`-,__ ___/' --,-`-===================##========>
## \ ' ##_______ _____ ,--,__,=##,__ ///
## , __== ___,-,__,--'#' ===' `-' | ##,-/
## -,____,---' \\####\\________________,--\\_##,/
## ___ .______ ______ __ __ .______
## / \ | _ \ / || | | | | _ \
## / ^ \ | |_) | | ,----'| |__| | | |_) |
## / /_\ \ | / | | | __ | | /
## / _____ \ | |\ \\___ | `----.| | | | | |\ \\___.
## /__/ \__\ | _| `._____| \______||__| |__| | _| `._____|
##