Skip to content

Commit

Permalink
Merge branch 'develop' into fix/heatmap
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwbutler committed Jul 30, 2021
2 parents 1baa39e + 421f472 commit 6b3e1af
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: Seurat
Version: 4.0.3.9010
Version: 4.0.3.9011
Date: 2021-07-16
Title: Tools for Single Cell Genomics
Description: A toolkit for quality control, analysis, and exploration of single cell RNA sequencing data. 'Seurat' aims to enable users to identify and interpret sources of heterogeneity from single cell transcriptomic measurements, and to integrate diverse types of single cell data. See Satija R, Farrell J, Gennert D, et al (2015) <doi:10.1038/nbt.3192>, Macosko E, Basu A, Satija R, et al (2015) <doi:10.1016/j.cell.2015.05.002>, Stuart T, Butler A, et al (2019) <doi:10.1016/j.cell.2019.05.031>, and Hao, Hao, et al (2020) <doi:10.1101/2020.10.12.335331> for more details.
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export(Read10X)
export(Read10X_Image)
export(Read10X_h5)
export(ReadMtx)
export(ReadParseBio)
export(ReadSTARsolo)
export(ReadSlideSeq)
export(Reductions)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Add `image` parameter to `Load10X_Spatial()` and `image.name` parameter to `Read10X_Image()` ([#4641](https://github.com/satijalab/seurat/pull/4641))
- Add `ReadSTARsolo()` function to read output from STARsolo
- Add `densify` parameter to `FindMarkers()`
- Add `ReadParsebio()` function to read output from Parse Biosciences

## Changes
- Warn and continue rather than erroring if not all features are available in `FindSpatiallyVariableFeatures()` ([#4611](https://github.com/satijalab/seurat/issues/4611))
Expand Down
29 changes: 27 additions & 2 deletions R/convenience.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,41 @@ SpecificDimPlot <- function(object, ...) {
)
}

#' Read output from Parse Biosciences
#'
#' @param data.dir Directory containing the data files
#' @param ... Extra parameters passed to \code{\link{ReadMtx}}
#' @concept convenience
#' @export
#'
ReadParseBio <- function(data.dir, ...) {
mtx <- file.path(data.dir, "DGE.mtx")
cells <- file.path(data.dir, "cell_metadata.csv")
features <- file.path(data.dir, "genes.csv")
return(ReadMtx(
mtx = mtx,
cells = cells,
features = features,
cell.column = 1,
feature.column = 2,
cell.sep = ",",
feature.sep = ",",
skip.cell = 1,
skip.feature = 1,
mtx.transpose = TRUE
))
}

#' Read output from STARsolo
#'
#' @param data.dir Directory containing the data files
#' @param ... Extra parameters passed to \code{ReadMtx}
#' @param ... Extra parameters passed to \code{\link{ReadMtx}}
#'
#' @rdname ReadSTARsolo
#' @concept convenience
#' @export
#'
ReadSTARsolo <- function(data.dir, ... ){
ReadSTARsolo <- function(data.dir, ... ) {
mtx <- file.path(data.dir, "matrix.mtx")
cells <- file.path(data.dir, "barcodes.tsv")
features <- file.path(data.dir, "features.tsv")
Expand Down
13 changes: 11 additions & 2 deletions R/preprocessing.R
Original file line number Diff line number Diff line change
Expand Up @@ -1045,8 +1045,11 @@ Read10X_Image <- function(image.dir, image.name = "tissue_lowres_image.png", fil
#' @param features Name or remote URL of the features/genes file
#' @param cell.column Specify which column of cells file to use for cell names; default is 1
#' @param feature.column Specify which column of features files to use for feature/gene names; default is 2
#' @param cell.sep Specify the delimiter in the cell name file
#' @param feature.sep Specify the delimiter in the feature name file
#' @param skip.cell Number of lines to skip in the cells file before beginning to read cell names
#' @param skip.feature Number of lines to skip in the features file before beginning to gene names
#' @param mtx.transpose Transpose the matrix after reading in
#' @param unique.features Make feature names unique (default TRUE)
#' @param strip.suffix Remove trailing "-1" if present in all cell barcodes.
#'
Expand Down Expand Up @@ -1085,8 +1088,11 @@ ReadMtx <- function(
features,
cell.column = 1,
feature.column = 2,
cell.sep = "\t",
feature.sep = "\t",
skip.cell = 0,
skip.feature = 0,
mtx.transpose = FALSE,
unique.features = TRUE,
strip.suffix = FALSE
) {
Expand Down Expand Up @@ -1118,14 +1124,14 @@ ReadMtx <- function(
cell.barcodes <- read.table(
file = all.files[['barcode list']],
header = FALSE,
sep = '\t',
sep = cell.sep,
row.names = NULL,
skip = skip.cell
)
feature.names <- read.table(
file = all.files[['feature list']],
header = FALSE,
sep = '\t',
sep = feature.sep,
row.names = NULL,
skip = skip.feature
)
Expand Down Expand Up @@ -1196,6 +1202,9 @@ ReadMtx <- function(
feature.names <- make.unique(names = feature.names)
}
data <- readMM(file = all.files[['expression matrix']])
if (mtx.transpose) {
data <- t(x = data)
}
if (length(x = cell.names) != ncol(x = data)) {
stop(
"Matrix has ",
Expand Down
9 changes: 9 additions & 0 deletions man/ReadMtx.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions man/ReadParseBio.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/ReadSTARsolo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6b3e1af

Please sign in to comment.