Skip to content

Commit

Permalink
Merge pull request #12 from alikhuseynov/seurat_v4
Browse files Browse the repository at this point in the history
`readVizgen()` and `readXenium()`
  • Loading branch information
lambdamoses authored Jan 31, 2024
2 parents 6e76c28 + d20fc79 commit 2574409
Show file tree
Hide file tree
Showing 83 changed files with 35,263 additions and 1,504 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup R and Bioconductor
uses: grimbough/bioc-actions/setup-bioc@v1
with:
bioc-version: 3.17
bioc-version: release
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
Expand Down
8 changes: 6 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Authors@R:
c(person("Lambda", "Moses", email = "[email protected]",
role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-7092-9427")),
person("Alik", "Huseynov",
comment = c(ORCID = "0000-0002-1438-4389"),
role = "aut"),
person("Lior", "Pachter", email = "[email protected]",
role = c("aut", "ths"),
comment = c(ORCID = "0000-0002-9164-6231")))
Expand All @@ -19,8 +22,10 @@ Imports:
BiocGenerics,
BiocNeighbors,
BiocParallel,
data.table,
DropletUtils,
grDevices,
lifecycle,
Matrix,
methods,
rjson,
Expand Down Expand Up @@ -61,14 +66,13 @@ Collate:
'updateObject.R'
'validity.R'
Suggests:
arrow,
BiocStyle,
dplyr,
knitr,
rhdf5,
rmarkdown,
sfarrow,
SFEData,
vroom,
testthat (>= 3.0.0)
Config/testthat/edition: 3
Depends:
Expand Down
16 changes: 16 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export(.value2df)
export(.warn_symbol_duplicate)
export(ROIPoly)
export(SFEVersion)
export(SpatRasterImage)
export(SpatialFeatureExperiment)
export(addTxSpots)
export(addVisiumSpotPoly)
export(annotGeometries)
export(annotGeometry)
Expand All @@ -57,6 +59,7 @@ export(annotOp)
export(annotPred)
export(annotSummary)
export(bbox)
export(callMeta)
export(cellSeg)
export(centroids)
export(changeSampleIDs)
Expand All @@ -74,6 +77,7 @@ export(dimGeometry)
export(dimGeometryNames)
export(findSpatialNeighbors)
export(findVisiumGraph)
export(formatTxSpots)
export(getImg)
export(imgData)
export(localResult)
Expand All @@ -84,7 +88,9 @@ export(localResults)
export(mirror)
export(nucSeg)
export(read10xVisiumSFE)
export(readCosMX)
export(readVizgen)
export(readXenium)
export(removeEmptySpace)
export(rowData)
export(rowGeometries)
Expand Down Expand Up @@ -175,6 +181,7 @@ importFrom(S4Vectors,setValidity2)
importFrom(SingleCellExperiment,"int_colData<-")
importFrom(SingleCellExperiment,"int_elementMetadata<-")
importFrom(SingleCellExperiment,"int_metadata<-")
importFrom(SingleCellExperiment,counts)
importFrom(SingleCellExperiment,int_colData)
importFrom(SingleCellExperiment,int_elementMetadata)
importFrom(SingleCellExperiment,int_metadata)
Expand All @@ -195,6 +202,10 @@ importFrom(SummarizedExperiment,"colData<-")
importFrom(SummarizedExperiment,"rowData<-")
importFrom(SummarizedExperiment,colData)
importFrom(SummarizedExperiment,rowData)
importFrom(data.table,fread)
importFrom(data.table,is.data.table)
importFrom(data.table,merge.data.table)
importFrom(data.table,rbindlist)
importFrom(grDevices,col2rgb)
importFrom(lifecycle,deprecate_warn)
importFrom(lifecycle,deprecated)
Expand All @@ -217,6 +228,7 @@ importFrom(sf,"st_agr<-")
importFrom(sf,"st_geometry<-")
importFrom(sf,st_agr)
importFrom(sf,st_area)
importFrom(sf,st_as_sf)
importFrom(sf,st_as_sfc)
importFrom(sf,st_bbox)
importFrom(sf,st_buffer)
Expand Down Expand Up @@ -261,11 +273,15 @@ importFrom(stats,median)
importFrom(stats,setNames)
importFrom(terra,"ext<-")
importFrom(terra,ext)
importFrom(terra,nlyr)
importFrom(terra,rast)
importFrom(terra,sources)
importFrom(terra,unwrap)
importFrom(terra,vect)
importFrom(terra,wrap)
importFrom(tools,file_ext)
importFrom(tools,file_path_sans_ext)
importFrom(utils,getFromNamespace)
importFrom(utils,head)
importFrom(utils,packageVersion)
importFrom(utils,read.csv)
3 changes: 1 addition & 2 deletions R/SFE-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ SpatialFeatureExperiment <- function(assays,
spotDiameter, unit, BPPARAM) {
if (is.null(colGeometries)) {
cg_name <- if (is.na(spotDiameter)) "centroids" else "spotPoly"
colGeometries <- list(foo = .sc2cg(spatialCoords(spe), spotDiameter,
BPPARAM))
colGeometries <- list(foo = .sc2cg(spatialCoords(spe), spotDiameter, BPPARAM))
names(colGeometries) <- cg_name
}
if (!is.null(rowGeometries)) {
Expand Down
6 changes: 4 additions & 2 deletions R/coerce.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
NULL

.sc2cg <- function(coords_use, spotDiameter = NA, BPPARAM = SerialParam()) {
colnames(coords_use) <- c("x", "y")
cg_sfc <- df2sf(coords_use, spotDiameter = spotDiameter, BPPARAM = BPPARAM,
if (is.null(colnames(coords_use)))
colnames(coords_use) <- paste0("V", seq_len(ncol(coords_use)))
cg_sfc <- df2sf(coords_use, spatialCoordsNames = colnames(coords_use),
spotDiameter = spotDiameter, BPPARAM = BPPARAM,
geometryType = "POINT")
rownames(cg_sfc) <- rownames(coords_use)
cg_sfc
Expand Down
Loading

0 comments on commit 2574409

Please sign in to comment.