Skip to content

Commit

Permalink
Release 1.0.0 (GreenleafLab#376)
Browse files Browse the repository at this point in the history
* updates

* Update DESCRIPTION

* documentation

* document

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* trajectory

* add trajectory and clustering params

* New additions for multi modal analysis

* documentation updates

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* bugfix

* Update README.md

* Update README.md

* threads are integer for umap

* Update README.md

* add stream trajectory export

* add empirical p-value and dims to use in integration

* typo

* add seed arguments to LSI

* fix buffer ratio

* update param addmotifannot

update param

* add getFragmentsFromProject

* update documentation

* remove default size aes in rasterized point

* added .safeSaveRDS

* add check for subsetArchRProject

* added na.rm = TRUE to validating a numeric integer

* update documentation

* add getAvailableMatrices check for getMatrixFromProject

* Update ArrowRead.R

* bugfix of rowRanges for peakmatrix not staying

* bugfix

* add a check for 0 cells

* addmodule score and imputation of cellColData

* add normMethod = "None" to browser

* update documentation

* add back size to ggplot

* bugfix multimodal cbind

* update getBlacklist

* force removeFilteredCells=TRUE

* bugfix reducedDims not passed to imputation in RNA integration

* add more logging to markerFeatures

* bugfix

* force sparse matrix for scRNA

* catch 0 overlap

* added checkSparseMatrix for getPartialMatrix

* add .checkSparseMatrix to MarkerFeatures

* update create arrow

* bugfix

* adding test genome

* testgenome

* Added PBMC Small Project

* add test fragments

* document

* update test stuff

* add logging to plotP2GHeatmap

* browser plotting order

* bugfix case in correlate matrices

* bugfix deviationsmatrix in copyarrows

* bug fix 1d bias

* update subsetting

* clarify subset message

* bugfix ncol markerSE = 1

* add message for number of overlapping gene names

* add ArchR method for background peaks

* add more logging to tile matrix

* convert to vector

* Add Raw output Peak2GeneLinks

* add cellsToUse to peak2gene links

* Update addPeak2GeneLinks.Rd

* make nLabel functional

* force archr with non-fixed width peaks

* clean groupBW and self KNN

* document

* update plotBrowserTrack to now have single cell tracks!

* Update ArchRBrowser.R

* Update ArchRBrowser.R

* Update ArchRBrowser.R

* bugfix

* cleanup

* add gene plots to browser with patchwork!

* document

* bugfix

* useMatrix = NULL

* bugfix normmetho -> normmethod

* add null to getTrajectory

* update plotFragSizes and plotTSS to have groupBy option

* file locking

* statistics to coA and P2G stable

* update coaccessibility

* test

* Update auto-comment.yml

* Update auto-comment.yml
  • Loading branch information
jgranja24 authored Oct 29, 2020
1 parent ddcaae4 commit 2f022a4
Show file tree
Hide file tree
Showing 68 changed files with 2,774 additions and 283 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions .github/auto-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Comment to a new issue.
issueOpened: >
Thank your for raising a issue. We will try and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: ArchR
Type: Package
Date: 2019-05-11
Date: 2020-10-01
Title: Analyzing single-cell regulatory chromatin in R.
Version: 0.9.5
Version: 1.0.0
Authors@R: c(
person("Jeffrey", "Granja", email = "[email protected]", role = c("aut","cre")),
person("Ryan", "Corces", role = "aut"))
Expand Down Expand Up @@ -73,8 +73,11 @@ Collate:
'MarkerFeatures.R'
'MatrixDeviations.R'
'MatrixFeatures.R'
'MatrixGeneExpression.R'
'MatrixGeneScores.R'
'MatrixTiles.R'
'ModuleScore.R'
'MultiModal.R'
'ProjectMethods.R'
'QualityControl.R'
'RNAIntegration.R'
Expand Down
11 changes: 11 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@ export(addBgdPeaks)
export(addCellColData)
export(addClusters)
export(addCoAccessibility)
export(addCombinedDims)
export(addDemuxletResults)
export(addDeviationsMatrix)
export(addDoubletScores)
export(addFeatureCounts)
export(addFeatureMatrix)
export(addGeneExpressionMatrix)
export(addGeneIntegrationMatrix)
export(addGeneScoreMatrix)
export(addGroupCoverages)
export(addHarmony)
export(addImputeWeights)
export(addIterativeLSI)
export(addModuleScore)
export(addMonocleTrajectory)
export(addMotifAnnotations)
export(addPeak2GeneLinks)
export(addPeakAnnotations)
Expand All @@ -40,6 +44,7 @@ export(addPeakSet)
export(addProjectSummary)
export(addReproduciblePeakSet)
export(addSampleColData)
export(addSlingShotTrajectories)
export(addTSNE)
export(addTileMatrix)
export(addTrajectory)
Expand All @@ -53,6 +58,7 @@ export(createGenomeAnnotation)
export(createLogFile)
export(enrichHeatmap)
export(exportGroupSE)
export(exportPeakMatrixForSTREAM)
export(extendGR)
export(filterChrGR)
export(filterDoublets)
Expand All @@ -76,6 +82,7 @@ export(getExons)
export(getFeatures)
export(getFootprints)
export(getFragmentsFromArrow)
export(getFragmentsFromProject)
export(getGeneAnnotation)
export(getGenes)
export(getGenome)
Expand All @@ -90,6 +97,7 @@ export(getMarkers)
export(getMatches)
export(getMatrixFromArrow)
export(getMatrixFromProject)
export(getMonocleTrajectories)
export(getOutputDirectory)
export(getPeak2GeneLinks)
export(getPeakAnnotation)
Expand All @@ -101,6 +109,8 @@ export(getSampleColData)
export(getSampleNames)
export(getSeqnames)
export(getTSS)
export(getTestFragments)
export(getTestProject)
export(getTrajectory)
export(getTutorialData)
export(getValidBarcodes)
Expand All @@ -110,6 +120,7 @@ export(ggGroup)
export(ggHex)
export(ggOneToOne)
export(ggPoint)
export(import10xFeatureMatrix)
export(imputeMatrix)
export(installExtraPackages)
export(loadArchRProject)
Expand Down
49 changes: 47 additions & 2 deletions R/AllClasses.R
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ saveArchRProject <- function(
}

message("Saving ArchRProject...")
saveRDS(newProj, file.path(outputDirectory, "Save-ArchR-Project.rds"))
.safeSaveRDS(newProj, file.path(outputDirectory, "Save-ArchR-Project.rds"))

if(load){
message("Loading ArchRProject...")
Expand All @@ -636,14 +636,16 @@ saveArchRProject <- function(
#' @param dropCells A boolean indicating whether to drop cells that are not in `ArchRProject` from corresponding Arrow Files.
#' @param logFile The path to a file to be used for logging ArchR output.
#' @param threads The number of threads to use for parallel execution.
#' @param force If output directory exists overwrite.
#' @export
subsetArchRProject <- function(
ArchRProj = NULL,
cells = getCellNames(ArchRProj),
outputDirectory = "ArchRSubset",
dropCells = TRUE,
logFile = NULL,
threads = getArchRThreads()
threads = getArchRThreads(),
force = FALSE
){

.validInput(input = ArchRProj, name = "ArchRProj", valid = "ArchRProj")
Expand All @@ -652,6 +654,12 @@ subsetArchRProject <- function(

outDirOld <- getOutputDirectory(ArchRProj)

if(dir.exists(outputDirectory)){
if(!force){
stop("outputDirectory exists! Please set force = TRUE to overwrite existing directory!")
}
}

if(outputDirectory == outDirOld){
stop("outputDirectory must be different than ArchRProj outputDirectory to properly subset!")
}
Expand Down Expand Up @@ -754,12 +762,49 @@ subsetArchRProject <- function(
i <- rownames(cD)[i]
}

if(length(i) == 1){
stop("Length of subsetting cells must be greater than 1!")
}

i <- unique(i)

#First Subset CellColData
x@cellColData <- cD[i, , drop=FALSE]
cellsKeep <- rownames(x@cellColData)

#Second Remove Impute Weights
if(length(i) != nrow(cD)){
if(length(x@imputeWeights) != 0){
message("Dropping ImputeWeights Since You Are Subsetting Cells! ImputeWeights is a cell-x-cell Matrix!")
}
x@imputeWeights <- SimpleList()
}

#Third Subset ReducedDims
rD <- x@reducedDims
rD2 <- lapply(seq_along(rD), function(x){
rD[[x]][[1]] <- rD[[x]][[1]][cellsKeep, , drop = FALSE]
rD[[x]]
}) %>% SimpleList()
names(rD2) <- names(rD)
rD <- x@reducedDims
rm(rD, rD2)

#Fourth Subset Embeddings
eD <- x@embeddings
eD2 <- lapply(seq_along(eD), function(x){
eD[[x]][[1]] <- eD[[x]][[1]][cellsKeep, , drop = FALSE]
eD[[x]]
}) %>% SimpleList()
names(eD2) <- names(eD)
x@embeddings <- eD2
rm(eD, eD2)

return(x)

}


setMethod(
f = "colnames",
signature = c("x" = "ArchRProject"),
Expand Down
17 changes: 9 additions & 8 deletions R/AnnotationPeaks.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ addPeakAnnotations <- function(
ArchRProj@peakAnnotation[[name]]$Positions <- savePositions
ArchRProj@peakAnnotation[[name]]$Matches <- saveMatches

saveRDS(out, file.path(getOutputDirectory(ArchRProj), "Annotations", paste0(name,"-In-Peaks-Summary.rds")), compress = FALSE)
saveRDS(out$regionPositions, savePositions, compress = FALSE)
saveRDS(out$regionMatches, saveMatches, compress = FALSE)
.safeSaveRDS(out, file.path(getOutputDirectory(ArchRProj), "Annotations", paste0(name,"-In-Peaks-Summary.rds")), compress = FALSE)
.safeSaveRDS(out$regionPositions, savePositions, compress = FALSE)
.safeSaveRDS(out$regionMatches, saveMatches, compress = FALSE)

return(ArchRProj)

Expand All @@ -239,6 +239,7 @@ addPeakAnnotations <- function(
#' used from CisBP/JASPAR. By default, this function will attempt to guess the species based on the value from `getGenome()`.
#' @param collection If one of the JASPAR motif sets is used via `motifSet`, this parameter allows you to indicate the JASPAR
#' collection to be used. See `getMatrixSet()` from `TFBSTools` for all options to supply for collection.
#' @param motifPWMs A custom set of motif PWMs as a PWMList for adding motif annotations.
#' @param cutOff The p-value cutoff to be used for motif search. The p-value is determined vs a background set of sequences
#' (see `MOODS` for more details on this determination).
#' @param width The width in basepairs to consider for motif matches. See the `motimatchr` package for more information.
Expand Down Expand Up @@ -473,9 +474,9 @@ addMotifAnnotations <- function(
ArchRProj@peakAnnotation[[name]]$Positions <- savePositions
ArchRProj@peakAnnotation[[name]]$Matches <- saveMatches

saveRDS(out, file.path(getOutputDirectory(ArchRProj), "Annotations", paste0(name,"-In-Peaks-Summary.rds")), compress = FALSE)
saveRDS(out$motifPositions, savePositions, compress = FALSE)
saveRDS(out$motifMatches, saveMatches, compress = FALSE)
.safeSaveRDS(out, file.path(getOutputDirectory(ArchRProj), "Annotations", paste0(name,"-In-Peaks-Summary.rds")), compress = FALSE)
.safeSaveRDS(out$motifPositions, savePositions, compress = FALSE)
.safeSaveRDS(out$motifMatches, saveMatches, compress = FALSE)

.endLogging(logFile = logFile)

Expand Down Expand Up @@ -741,8 +742,8 @@ addArchRAnnotations <- function(
ArchRProj@peakAnnotation[[name]]$Positions <- "None"
ArchRProj@peakAnnotation[[name]]$Matches <- saveMatches

saveRDS(out, file.path(getOutputDirectory(ArchRProj), "Annotations", paste0(name,"-In-Peaks-Summary.rds")), compress = FALSE)
saveRDS(out$regionMatches, saveMatches, compress = FALSE)
.safeSaveRDS(out, file.path(getOutputDirectory(ArchRProj), "Annotations", paste0(name,"-In-Peaks-Summary.rds")), compress = FALSE)
.safeSaveRDS(out$regionMatches, saveMatches, compress = FALSE)

.endLogging(logFile = logFile)

Expand Down
Loading

0 comments on commit 2f022a4

Please sign in to comment.