10.4 Add Peak Matrix

We can now save our original projHeme4 using the saveArchRProject() function. This ArchRProject contains the MACS2-derived merged peak set.

saveArchRProject(ArchRProj = projHeme4, outputDirectory = "Save-ProjHeme4", load = FALSE)

## Copying ArchRProject to new outputDirectory : /oak/stanford/groups/howchang/users/jgranja/ArchRTutorial/ArchRBook/BookOutput4/Save-ProjHeme4
## Copying Arrow Files…
## Copying Arrow Files (1 of 3)
## Copying Arrow Files (2 of 3)
## Copying Arrow Files (3 of 3)
## Getting ImputeWeights
## Dropping ImputeWeights…
## Copying Other Files…
## Copying Other Files (1 of 6): Embeddings
## Copying Other Files (2 of 6): GroupCoverages
## Copying Other Files (3 of 6): IterativeLSI
## Copying Other Files (4 of 6): IterativeLSI2
## Copying Other Files (5 of 6): PeakCalls
## Copying Other Files (6 of 6): Plots
## Saving ArchRProject…

To prepare for downstream analyses, we can create a new ArchRProject called projHeme5 and add a new matrix to it containing insertion counts within our new merged peak set.

projHeme5 <- addPeakMatrix(projHeme4)

## ArchR logging to : ArchRLogs/ArchR-addPeakMatrix-faba377aa2f2-Date-2020-04-15_Time-10-29-40.log
## If there is an issue, please report to github with logFile!
## 2020-04-15 10:29:41 : Batch Execution w/ safelapply!, 0 mins elapsed.
## ArchR logging successful to : ArchRLogs/ArchR-addPeakMatrix-faba377aa2f2-Date-2020-04-15_Time-10-29-40.log

We can now see that a new matrix has been added to projHeme5 called “PeakMatrix”. This is another reserved-name matrix similar to GeneScoreMatrix and TileMatrix. As mentioned previously, each ArchRProject object can only have one peak set and one PeakMatrix. You can, of course, create an unlimited number of custom feature matrices of different names but PeakMatrix is reserved for the matrix of insertion counts derived from the peak set stored in the ArchRProject.

getAvailableMatrices(projHeme5)

## [1] “GeneIntegrationMatrix” “GeneScoreMatrix” “PeakMatrix”
## [4] “TileMatrix”