Skip to content

Commit

Permalink
Dev jg (GreenleafLab#40)
Browse files Browse the repository at this point in the history
* update browser,anno,peakcalling

* bugfix

* Update GroupCoverages.R

* parallel createArrow

* update

* update

* update

* updates

* update documentation

* update hidden functions

make sure no parameters are missing a default. make sure hidden functions are not exported

* addScaleDims + Bugs

* updated documentation

* bugfixes

* bugfix

* doubletUpdate

* doublet

* fix

* finish scaleTo update

* remove ... additional args unless needed

* embed

* update tutorial

* Dev jg lsi (GreenleafLab#39)

* update

* update docs

* update

* update

* CleanUp functions

* update

* addUMAP and addTSNE

* paletteUpdate

* reducedDimsOut to name

* colorBy protection

* updated ... to only be in function usage messages wtih ... now are ..

* added installs to ArchRGenome

* finalized doublet calling

* finalize LSI params

* bug fix ...

* bugfix

* bugfix

* addDevMode

* default prints in createArrow

* bug

* print update

* bugfix

* bug fix

* bugfix dependency on h5ls

* remove dependency on h5ls

* update gg

* update

* updates

* bugFixes

* Update MarkerFeatures.R

* bugfixes

* Update HelperUtils.R

* bug fix ggplot2

* update to ggGroups

* bugfix

* Update AllClasses.R

* fix

* Update GroupCoverages.R

* update

* update

* Update CreateArrow.R

* Update CreateArrow.R

* update

* bug

* bugTest

* subthreading 2

* a

* order by size

* bugfix

* tss fix for normal values

* asdas

* Update CreateArrow.R

* bugfix

* updates

* asd

* Update ReproduciblePeakSet.R

* Update QualityControl.R

* bug

* larger tss plot

* plot params

* Update CreateArrow.R

Co-authored-by: Ryan Corces <[email protected]>
  • Loading branch information
jgranja24 and rcorces authored Feb 6, 2020
1 parent 9737ea7 commit ca48916
Show file tree
Hide file tree
Showing 151 changed files with 5,999 additions and 3,145 deletions.
Binary file modified .DS_Store
Binary file not shown.
357 changes: 331 additions & 26 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,30 +1,335 @@
```{r, out.width="0.3\\linewidth", include=TRUE, fig.align="center", echo=FALSE}
knitr::include_graphics("../../images/tutorial_1_UMAP-Clusters.pdf")
knitr::include_graphics(c("../../images/ArchRProject_Schematic.png", "../../images/ArchR_FunctionSchematic.png", "../../images/tutorial_1_UMAP-Clusters.png", "../../images/tutorial_2_tracks.pdf", "../../images/tutorial_3_MarkerGeneScores.pdf", "../../images/tutorial_4_MarkerGeneHeatmap.pdf"))
knitr::include_graphics("../../images/tutorial_1_UMAP-Clusters.pdf")
getwd()
../../images/tutorial_1_UMAP-Clusters.pdf
library(png)
library(grid)
library(gridExtra)
---
title: "ArchR Hematopoiesis Tutorial"
author: "Jeffrey Granja"
date: "11/22/2019"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(echo = TRUE)
summary(cars)
plot(pressure)
knitr::opts_chunk$set(echo = TRUE)
setwd("~/Documents/Heme_Tutorial/")
data("geneAnnoHg19")
data("genomeAnnoHg19")
threads <- 8
pathFragments <- "Heme_Fragments"
inputFiles <- list.files(pathFragments, pattern = ".gz", full.names = TRUE)
names(inputFiles) <- gsub(".fragments.tsv.gz", "", list.files(pathFragments, pattern = ".gz"))
inputFiles <- inputFiles[!grepl(".tbi", inputFiles)]
inputFiles
knitr::opts_chunk$set(echo = TRUE)
#Input Libraries
library(ArchR)
setArchRThreads
setArchRThreads()
getwd()
knitr::include_graphics(
c(
"../../images/ArchRProject_Schematic.png",
"../../images/ArchR_FunctionSchematic.png",
"../../images/tutorial_1_UMAP-Clusters.pdf",
"../../images/tutorial_2_tracks.pdf",
"../../images/tutorial_3_MarkerGeneScores.pdf",
"../../images/tutorial_4_MarkerGeneHeatmap.pdf"
#Set/Create Working Directory to Folder
setwd("~/Documents/Heme_Tutorial/")
#Load Genome Annotations
data("geneAnnoHg19")
data("genomeAnnoHg19")
#Set Threads to be used
threads <- 8
pathFragments <- "Heme_Fragments"
inputFiles <- list.files(pathFragments, pattern = ".gz", full.names = TRUE)
names(inputFiles) <- gsub(".fragments.tsv.gz", "", list.files(pathFragments, pattern = ".gz"))
inputFiles <- inputFiles[!grepl(".tbi", inputFiles)]
inputFiles
#Input Libraries
library(ArchR)
#Set/Create Working Directory to Folder
setwd("~/Documents/Heme_Tutorial/")
#Load Genome Annotations
data("geneAnnoHg19")
data("genomeAnnoHg19")
#Set Threads to be used
threads <- 8
knitr::opts_chunk$set(echo = TRUE)
opts_knit$set(root.dir = "~/Documents/Heme_Tutorial/")
library(knitr)
knitr::opts_chunk$set(echo = TRUE)
opts_knit$set(root.dir = "~/Documents/Heme_Tutorial/")
#Input Libraries
library(ArchR)
#Load Genome Annotations
data("geneAnnoHg19")
data("genomeAnnoHg19")
#Set Threads to be used
threads <- 8
pathFragments <- "Heme_Fragments"
inputFiles <- list.files(pathFragments, pattern = ".gz", full.names = TRUE)
names(inputFiles) <- gsub(".fragments.tsv.gz", "", list.files(pathFragments, pattern = ".gz"))
inputFiles <- inputFiles[!grepl(".tbi", inputFiles)]
inputFiles
#Input Libraries
library(ArchR)
#Load Genome Annotations
data("geneAnnoHg19")
data("genomeAnnoHg19")
#Set Threads to be used
threads <- 8
library(knitr)
knitr::opts_chunk$set(echo = TRUE)
opts_knit$set(root.dir = "~/Documents/Heme_Tutorial/")
#Input Libraries
library(ArchR)
#Load Genome Annotations
data("geneAnnoHg19")
data("genomeAnnoHg19")
#Set Threads to be used
threads <- 8
pathFragments <- "Heme_Fragments"
inputFiles <- list.files(pathFragments, pattern = ".gz", full.names = TRUE)
names(inputFiles) <- gsub(".fragments.tsv.gz", "", list.files(pathFragments, pattern = ".gz"))
inputFiles <- inputFiles[!grepl(".tbi", inputFiles)]
inputFiles
#Input Libraries
library(ArchR)
#Load Genome Annotations
data("geneAnnoHg19")
data("genomeAnnoHg19")
#Set Threads to be used
threads <- 8
library(knitr)
knitr::opts_chunk$set(echo = TRUE)
opts_knit$set(root.dir = "~/Documents/Heme_Tutorial/")
library(ArchR)
#Input Libraries
library(ArchR)
#Load Genome Annotations
data("geneAnnoHg19")
data("genomeAnnoHg19")
#Set Threads to be used
threads <- 8
pathFragments <- "Heme_Fragments"
inputFiles <- list.files(pathFragments, pattern = ".gz", full.names = TRUE)
names(inputFiles) <- gsub(".fragments.tsv.gz", "", list.files(pathFragments, pattern = ".gz"))
inputFiles <- inputFiles[!grepl(".tbi", inputFiles)]
inputFiles
library(knitr)
knitr::opts_chunk$set(echo = TRUE)
opts_knit$set(root.dir = "~/Documents/Heme_Tutorial/")
library(ArchR)
#Load Genome Annotations
data("geneAnnoHg19")
data("genomeAnnoHg19")
#Set Threads to be used
threads <- 8
pathFragments <- "Heme_Fragments"
inputFiles <- list.files(pathFragments, pattern = ".gz", full.names = TRUE)
names(inputFiles) <- gsub(".fragments.tsv.gz", "", list.files(pathFragments, pattern = ".gz"))
inputFiles <- inputFiles[!grepl(".tbi", inputFiles)]
inputFiles
ArrowFiles <- createArrowFiles(
inputFiles = inputFiles[3],
sampleNames = names(inputFiles),
geneAnno = geneAnnoHg19,
genomeAnno = genomeAnnoHg19,
threads = threads,
force = TRUE
)
ArrowFiles <- createArrowFiles(
inputFiles = inputFiles[3],
sampleNames = names(inputFiles)[3],
geneAnno = geneAnnoHg19,
genomeAnno = genomeAnnoHg19,
threads = threads,
force = TRUE
)
ls
```{r eval=TRUE, cache=TRUE}
ArrowFiles <- createArrowFiles(
inputFiles = inputFiles[3],
sampleNames = names(inputFiles)[3],
geneAnno = geneAnnoHg19,
genomeAnno = genomeAnnoHg19,
threads = threads,
addGeneScoreMat = FALSE,
addTileMat = FALSE,
force = TRUE
)
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(eval = FALSE)
# Small fig.width
knitr::include_graphics("~/Documents/Heme_Tutorial/Heme_Tutorial/Plots/Plot-UMAP-TileLSI_Date-2019-11-22_Time-01-35-25.pdf")
# Small fig.width
knitr::include_graphics("~/Documents/Heme_Tutorial/Heme_Tutorial/Plots/Plot-UMAP-TileLSI_Date-2019-11-22_Time-01-35-25.pdf")
# Small fig.width
knitr::include_graphics("~/Documents/Heme_Tutorial/Heme_Tutorial/Plots/Plot-UMAP-TileLSI_Date-2019-11-22_Time-01-35-25.pdf")
getwd()
"/Users/jeffreygranja/Documents/Heme_Tutorial/Heme_Tutorial/Plots/Plot-UMAP-TileLSI_Date-2019-11-22_Time-01-35-25.pdf
# Small fig.width
knitr::include_graphics("/Users/jeffreygranja/Documents/Heme_Tutorial/Heme_Tutorial/Plots/Plot-UMAP-TileLSI_Date-2019-11-22_Time-01-35-25.pdf")
# Small fig.width
knitr::include_graphics("/Users/jeffreygranja/Documents/Heme_Tutorial/Heme_Tutorial/Plots/Plot-UMAP-TileLSI_Date-2019-11-22_Time-01-35-25.pdf")
"~/Documents/HemeAll/heme/Plots/Plot-Tracks_Date-2019-11-17_Time-17-52-02.pdf"
knitr::include_graphics(path.expand("~/Documents/HemeAll/heme/Plots/Plot-Tracks_Date-2019-11-17_Time-17-52-02.pdf"))
file.copy
list.files()
list.files()
system("cp ~/Documents/HemeAll/heme/Plots/Plot-Tracks_Date-2019-11-17_Time-17-52-02.pdf mychart.pdf")
knitr::include_graphics(path = "mychart.pdf")
"mychart.pdf"
knitr::include_graphics(path = "mychart.pdf")#path.expand("~/Documents/HemeAll/heme/Plots/Plot-Tracks_Date-2019-11-17_Time-17-52-02.pdf"))
knitr::include_graphics(path = "mychart.pdf")
knitr::opts_chunk$set(echo = TRUE)
```{r pressure, echo=FALSE, eval = FALSE}
sessionInfo()
head(sessionInfo())
suppressPackageStartupMessages()
Sys.info()
.Platform
parallel::detectCores()
try(system("grep MemTotal /proc/meminfo", intern = TRUE), silent = TRUE)
ram = substring(system("sysctl hw.memsize", intern = TRUE), 13) #nocov
ram
ram / 10^9
as.numeric(ram) / 10^9
get_windows_ram = function() {
ram = try(system("grep MemTotal /proc/meminfo", intern = TRUE), silent = TRUE)
if (class(ram) != "try-error" && length(ram) != 0) {
ram = strsplit(ram, " ")[[1]]
ram = as.numeric(ram[length(ram) - 1])
ram_size = ram
} else {
# Fallback: This was the old method I used
# It worked for Windows 7 and below.
ram_size = system("wmic MemoryChip get Capacity", intern = TRUE)[-1]
}
return(ram_size)
}
system_ram = function(os) {
if (length(grep("^linux", os))) {
cmd = "awk '/MemTotal/ {print $2}' /proc/meminfo"
ram = system(cmd, intern = TRUE)
} else if (length(grep("^darwin", os))) {
ram = substring(system("sysctl hw.memsize", intern = TRUE), 13) #nocov
} else if (length(grep("^solaris", os))) {
cmd = "prtconf | grep Memory" # nocov
ram = system(cmd, intern = TRUE) ## Memory size: XXX Megabytes # nocov
} else {
ram = get_windows_ram() # nocov
}
ram
}
#' Get the amount of RAM
#'
#' Attempt to extract the amount of RAM on the current machine. This is OS
#' specific:
#' \itemize{
#' \item Linux: \code{proc/meminfo}
#' \item Apple: \code{system_profiler -detailLevel mini}
#' \item Windows: \code{memory.size()}
#' \item Solaris: \code{prtconf}
#' }
#' A value of \code{NA} is return if it isn't possible to determine the amount of RAM.
#' @export
#' @references The \code{print.bytes} function was taken from the \pkg{pryr} package.
#' @examples
#' ## Return (and pretty print) the amount of RAM
#' get_ram()
get_ram = function() {
os = R.version$os
ram = suppressWarnings(try(system_ram(os), silent = TRUE))
if (class(ram) == "try-error" || length(ram) == 0) {
message("\t Unable to detect your RAM. # nocov
Please raise an issue at https://github.com/csgillespie/benchmarkme") # nocov
ram = structure(NA, class = "ram") # nocov
} else {
cleaned_ram = suppressWarnings(try(clean_ram(ram, os), silent = TRUE))
if (class(cleaned_ram) == "try-error" || length(ram) == 0) {
message("\t Unable to detect your RAM. # nocov
Please raise an issue at https://github.com/csgillespie/benchmarkme") # nocov
ram = structure(NA, class = "ram") #nocov
} else {
ram = structure(cleaned_ram, class = "ram")
}
}
return(ram)
}
#' @rawNamespace S3method(print,ram)
print.ram = function(x, digits = 3, unit_system = c("metric", "iec"), ...) {
#unit_system = match.arg(unit_system)
unit_system = "metric"
base = switch(unit_system, metric = 1000, iec = 1024)
power = min(floor(log(abs(x), base)), 8)
if (is.na(x) || power < 1) {
unit = "B"
} else {
unit_labels = switch(
unit_system,
metric = c("kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"),
iec = c("KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB")
)
setwd("~/Documents/GitHub/ArchR/")
library(pkdgdown)
library(pkgdown)
build_articles()
unit = unit_labels[[power]]
x = x / (base^power)
}
formatted = format(signif(x, digits = digits), big.mark = ",",
scientific = FALSE, ...)
cat(unclass(formatted), " ", unit, "\n", sep = "")
invisible(paste(unclass(formatted), unit))
}
get_ram()
plot(cars)
```{r eval = TRUE}
```{r}
suppressPackageStartupMessages(library(SnapATAC))
suppressPackageStartupMessages(library(SnapATAC))
suppressPackageStartupMessages(library(magrittr))
setwd("/Volumes/JG_SSD_2/Data/Analysis/Tutorial/test-snap")
parallel::detectCores()
Sys.Date()
sessionInfo()
setwd("~/Documents/Github/ArchR")
build_site()
#5k
if(!file.exists("atac_pbmc_5k_nextgem_fragments.tsv.gz")){
system("wget http://cf.10xgenomics.com/samples/cell-atac/1.2.0/atac_pbmc_5k_nextgem/atac_pbmc_5k_nextgem_fragments.tsv.gz")
system("wget http://cf.10xgenomics.com/samples/cell-atac/1.2.0/atac_pbmc_5k_nextgem/atac_pbmc_5k_nextgem_fragments.tsv.gz.tbi")
}
#10k
if(!file.exists("atac_pbmc_10k_nextgem_fragments.tsv.gz")){
system("wget http://cf.10xgenomics.com/samples/cell-atac/1.2.0/atac_pbmc_10k_nextgem/atac_pbmc_10k_nextgem_fragments.tsv.gz")
system("wget http://cf.10xgenomics.com/samples/cell-atac/1.2.0/atac_pbmc_10k_nextgem/atac_pbmc_10k_nextgem_fragments.tsv.gz.tbi")
}
#Analysis of 10x Fragment Files
#Install pip install -user snaptools
snapTools <- "/Users/jeffreygranja/Library/Python/2.7/bin/snaptools"
#Fragment Files
fragFiles <- c(
"atac_pbmc_5k_nextgem_fragments.tsv.gz",
"atac_pbmc_10k_nextgem_fragments.tsv.gz"
)
#Input Genome
genome <- "hg19"
if(!file.exists(paste0(genome,".chrom.sizes"))){
system(paste0("wget http://hgdownload.cse.ucsc.edu/goldenpath/",genome,"/bigZips/",genome,".chrom.sizes"))
}
#Download/Set Up 10x Fragment Files
#5k
if(!file.exists("atac_pbmc_5k_nextgem_fragments.tsv.gz")){
system("wget http://cf.10xgenomics.com/samples/cell-atac/1.2.0/atac_pbmc_5k_nextgem/atac_pbmc_5k_nextgem_fragments.tsv.gz")
system("wget http://cf.10xgenomics.com/samples/cell-atac/1.2.0/atac_pbmc_5k_nextgem/atac_pbmc_5k_nextgem_fragments.tsv.gz.tbi")
}
#10k
if(!file.exists("atac_pbmc_10k_nextgem_fragments.tsv.gz")){
system("wget http://cf.10xgenomics.com/samples/cell-atac/1.2.0/atac_pbmc_10k_nextgem/atac_pbmc_10k_nextgem_fragments.tsv.gz")
system("wget http://cf.10xgenomics.com/samples/cell-atac/1.2.0/atac_pbmc_10k_nextgem/atac_pbmc_10k_nextgem_fragments.tsv.gz.tbi")
}
#Analysis of 10x Fragment Files
#Install pip install -user snaptools
snapTools <- "/Users/jeffreygranja/Library/Python/2.7/bin/snaptools"
#Fragment Files
fragFiles <- c(
"atac_pbmc_5k_nextgem_fragments.tsv.gz",
"atac_pbmc_10k_nextgem_fragments.tsv.gz"
)
#Input Genome
genome <- "hg19"
if(!file.exists(paste0(genome,".chrom.sizes"))){
system(paste0("wget http://hgdownload.cse.ucsc.edu/goldenpath/",genome,"/bigZips/",genome,".chrom.sizes"))
}
setwd("~/Documents/GitHub/ArchR")
pkgdown::build_site()
warnings()
pkgdown::build_site()
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: ArchR
Type: Package
Date: 2019-10-17
Title: Analyzing regulatory chromatin in R
Version: 0.1.5
Date: 2019-02-01
Title: Analyzing single-cell regulatory chromatin in R.
Version: 0.1.6
Authors@R: c(
person("Jeffrey", "Granja", email = "[email protected]", role = c("aut","cre")),
person("Ryan", "Corces", role = "aut"))
Expand All @@ -11,7 +11,7 @@ Roxygen: list(markdown = TRUE)
License: GPL (>= 2)
LinkingTo: Rcpp
LazyData: TRUE
RoxygenNote: 6.1.1
RoxygenNote: 7.0.2
Encoding: UTF-8
Imports:
Rcpp (>= 0.12.16),
Expand All @@ -24,6 +24,7 @@ Imports:
ggrepel,
Rsamtools,
gtable,
gtools,
grid,
gridExtra,
Biostrings,
Expand All @@ -38,4 +39,3 @@ Depends:
S4Vectors (>= 0.9.25),
BiocGenerics,
GenomicRanges,

Loading

0 comments on commit ca48916

Please sign in to comment.