Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sjcshin authored Aug 30, 2024
2 parents e8858a3 + 1e5d90e commit 93bfde8
Show file tree
Hide file tree
Showing 101 changed files with 4,789 additions and 2,101 deletions.
51 changes: 49 additions & 2 deletions .github/workflows/covr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: code coverage

on:
push:
branches: [ "dev2 " ]
branches: [ "dev2" ]
schedule:
- cron: '16 20 * * 2'

Expand Down Expand Up @@ -37,19 +37,66 @@ jobs:
install-pandoc: false
extra-packages: |
github::drieslab/GiottoData
any::covr
any::rcmdcheck
any::testthat
any::rlang
any::R.utils
any::knitr
any::rmarkdown
any::qs
any::sp
any::stars
any::raster
any::sf
any::scattermore
any::exactextractr
any::RTriangle
any::geometry
any::covr
any::qs
any::future.apply
any::Biobase
any::chihaya
any::DelayedArray
any::DelayedMatrixStats
any::HDF5Array
any::plotly
any::rgl
any::rhdf5
any::S4Vectors
any::ScaledMatrix
any::XML
any::Seurat
any::SeuratObject
any::SingleCellExperiment
any::SpatialExperiment
any::STexampleData
any::SummarizedExperiment
needs: coverage

- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: setup giotto_env
shell: Rscript {0}
run: |
if (!GiottoClass::checkGiottoEnvironment()) {
GiottoClass::installGiottoEnvironment()
}
reticulate::conda_install(
envname = 'giotto_env',
packages = 'scanpy',
pip = TRUE
)
path_to_python <- GiottoClass::set_giotto_python_path()
writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python),
Sys.getenv("GITHUB_ENV"))
- name: Generate coverage report
run: |
covr::codecov(
Expand Down
31 changes: 14 additions & 17 deletions .github/workflows/dev_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,21 @@ jobs:
- name: setup giotto_env
shell: Rscript {0}
run: |
path_to_python <- reticulate::virtualenv_create(
envname = "giotto_env",
python = Sys.which("python"), # placed on PATH by the setup-python action
packages = c(
"pandas==1.5.1",
"networkx==2.8.8",
"python-igraph==0.10.2",
"leidenalg==0.9.0",
"python-louvain==0.16",
"scikit-learn==1.1.3",
"scipy==1.13.0",
"scanpy"
)
)
writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python),
Sys.getenv("GITHUB_ENV"))
if (!GiottoClass::checkGiottoEnvironment()) {
GiottoClass::installGiottoEnvironment()
}
reticulate::conda_install(
envname = 'giotto_env',
packages = 'scanpy',
pip = TRUE
)
path_to_python <- GiottoClass::set_giotto_python_path()
writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python),
Sys.getenv("GITHUB_ENV"))
- name: Run R CMD check
uses: r-lib/actions/check-r-package@v2
with:
Expand Down
40 changes: 36 additions & 4 deletions .github/workflows/main_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: R-CMD-check

on:
pull_request:
types: closed
types: opened
branches: [ "main" ]

permissions:
Expand Down Expand Up @@ -64,9 +64,9 @@ jobs:
any::testthat
any::rlang
any::R.utils
any::remotes
any::knitr
any::rmarkdown
any::qs
any::sp
any::stars
any::raster
Expand All @@ -77,14 +77,46 @@ jobs:
any::geometry
any::qs
any::future.apply
any::Biobase
any::chihaya
any::DelayedArray
any::DelayedMatrixStats
any::HDF5Array
any::plotly
any::rgl
any::rhdf5
any::S4Vectors
any::ScaledMatrix
any::XML
any::Seurat
any::SeuratObject
any::SingleCellExperiment
any::SpatialExperiment
any::STexampleData
any::SummarizedExperiment
github::drieslab/GiottoData
- name: Test python env build
- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: setup giotto_env
shell: Rscript {0}
run: |
if (!GiottoClass::checkGiottoEnvironment()) {
GiottoClass::installGiottoEnvironment()
}
shell: Rscript {0}
reticulate::conda_install(
envname = 'giotto_env',
packages = 'scanpy',
pip = TRUE
)
path_to_python <- GiottoClass::set_giotto_python_path()
writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python),
Sys.getenv("GITHUB_ENV"))
- name: Run R CMD check
uses: r-lib/actions/check-r-package@v2
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ inst/doc
.Rprofile
docs
codecov.yml

pkgdown
cell_rna*
17 changes: 9 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: GiottoClass
Title: Giotto Suite object definitions and framework
Version: 0.3.2
Version: 0.3.5
Authors@R: c(
person("Ruben", "Dries", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0001-7650-7754")),
Expand All @@ -24,17 +24,17 @@ Description: This package contains the Giotto object and subobject class
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Depends:
base (>= 4.0.1),
utils (>= 4.0.1),
R (>= 4.0.1),
base (>= 4.4.0),
utils (>= 4.4.0),
R (>= 4.4.0),
Imports:
checkmate,
data.table (>= 1.12.2),
dbscan (>= 1.1-3),
deldir (>= 1.0.6),
GiottoUtils (>= 0.1.7),
GiottoUtils (>= 0.1.10),
graphics,
grDevices,
igraph (>= 1.2.4.1),
Expand Down Expand Up @@ -79,8 +79,7 @@ Suggests:
SummarizedExperiment,
testthat (>= 3.0.0),
qs,
XML
Remotes: drieslab/GiottoUtils
xml2
Config/testthat/edition: 3
Collate:
'package_imports.R'
Expand All @@ -107,6 +106,7 @@ Collate:
'interoperability.R'
'join.R'
'methods-IDs.R'
'methods-affine.R'
'methods-centroids.R'
'methods-coerce.R'
'methods-copy.R'
Expand All @@ -125,6 +125,7 @@ Collate:
'methods-reconnect.R'
'methods-rescale.R'
'methods-setGiotto.R'
'methods-shear.R'
'methods-show.R'
'methods-spatShift.R'
'methods-spin.R'
Expand Down
7 changes: 7 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(.DollarNames,affine2d)
S3method(.DollarNames,dimObj)
S3method(.DollarNames,metaData)
S3method(.DollarNames,spatEnrObj)
Expand All @@ -8,6 +9,7 @@ S3method(.DollarNames,terraVectData)
S3method(as.data.table,SpatVector)
S3method(as.data.table,giottoPoints)
S3method(as.data.table,giottoPolygon)
S3method(print,giottoInstructions)
S3method(t,spatLocsObj)
S3method(t,spatialNetworkObj)
export(addCellMetadata)
Expand Down Expand Up @@ -322,6 +324,8 @@ exportMethods("prov<-")
exportMethods("spatUnit<-")
exportMethods(activeFeatType)
exportMethods(activeSpatUnit)
exportMethods(affine)
exportMethods(as.character)
exportMethods(as.matrix)
exportMethods(as.points)
exportMethods(as.polygons)
Expand Down Expand Up @@ -357,6 +361,7 @@ exportMethods(reconnect)
exportMethods(rescale)
exportMethods(rownames)
exportMethods(setGiotto)
exportMethods(shear)
exportMethods(spatIDs)
exportMethods(spatShift)
exportMethods(spatUnit)
Expand Down Expand Up @@ -405,8 +410,10 @@ importMethodsFrom(terra,as.points)
importMethodsFrom(terra,as.polygons)
importMethodsFrom(terra,centroids)
importMethodsFrom(terra,crop)
importMethodsFrom(terra,density)
importMethodsFrom(terra,ext)
importMethodsFrom(terra,flip)
importMethodsFrom(terra,hist)
importMethodsFrom(terra,ncol)
importMethodsFrom(terra,nrow)
importMethodsFrom(terra,plot)
Expand Down
74 changes: 73 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,80 @@

# GiottoClass 0.3.2
# GiottoClass 0.3.6 (2024/08/30)

## bug fixes
- fix `dimnames()` for some subobjects

## enhancements
- python packages to install through pip is now settable in `installGiottoEnvironment()`

# GiottoClass 0.3.5 (2024/08/28)

## breaking changes
- `set_giotto_python_path()` will now also initialize python env to set by default and print which python env is active, but otherwise do nothing if any python env has already been initialized.
- deprecated `readGiottoInstructions()`, `showGiottoInstructions()`, `changeGiottoInstructions()`, `replaceGiottoInstructions()` in favor of `instructions()` generic

## bug fixes
- intensity images now automatically scale to estimated highest value
- `giottoPolygon` `plot()` default `max_poly` raised to `1e6`
- `giottoInstructions` no longer lose class when specific params are replaced
- `ometif_to_tif()` now checks for _imagecodecs_ package as well
- `anndataToGiotto()` and `giottoToAnndata` now check for _anndata_ package as well.
- fix `joinGiottoObjects()` `"z_stack"` join method
- fix error in documentation [#214](https://github.com/drieslab/GiottoClass/issues/214) by shaojunyu
- fix error in `installGiottoEnvironment()` [#1006](https://github.com/drieslab/Giotto/issues/1006) by 13954380607

## enhancements
- `print()` method for `giottoInstructions`
- `rbind()` for `spatLocsObj`


# GiottoClass 0.3.4 (2024/08/04)

## bug fixes
- hotfix anndata matrix support [#216](https://github.com/drieslab/GiottoClass/issues/216) by wwang-chcn

# GiottoClass 0.3.3 (2024/07/29)

## bug fixes
- fix flipping issue with `giottoAffineImage` for certain affine transforms

## enhancements
- `missing` method for `affine()` instantiates an `affine2d` object

# GiottoClass 0.3.2 (2024/07/26)

## breaking changes
- python environment installation and how it relates to default settings such as .condarc may have changed.
- `giottoImage` `name` slot now requires `character` and will not accept `NULL`

## bug fixes
- `loadGiotto()` no longer errors with similarly named spat_units or feat_types (e.g. "cell" and "new_cell" would previously throw an error)
- fix in `giottoToSpatialExperiment()`
- fix for `giottoToSeuratV5` for cosmx mini dataset [#989](https://github.com/drieslab/Giotto/issues/989) by guillermoturiel
- fix issue with prints in `createGiottoCosMxObject()` [#960](https://github.com/drieslab/Giotto/issues/960) by GBeattie

## enhancements
- `verbose` param for `createNearestNetwork()`
- `checkGiottoEnvironment()` in addition to full filepaths, also now supports name of environment or installation directory
- `installGiottoEnvironment()`, `removeGiottoEnvironment()` now have `conda` param for setting path to conda executable and `envname` param for specifying environment by name
- `installGiottoEnvironment()` now has `confirm` param for skipping path input checks
- `t()` for `giotto` now affects images as well.

## new
- `affine()` for `giottoPolygon`, `giottoPoints`, `spatLocsObj`, `giotto`
- `shear()` for `giottoPoints`, `giottoPolygon`, `spatLocsObj`, `affine2d`
- `affine2d` class for accumulating linear transforms to be used with `affine()`
- `initialize()`, `[`, `$`, `show()`, `plot()`, methods for `affine2d`
- `spin()`, `rescale`, `spatShift()`, `affine()`, `flip()`, `shear()` `t()` methods for `affine2d`
- `giottoAffineImage` class for just-in-time affine transformed images
- `initialize()`, method for `giottoLargeImage`
- `initialize()`, `ext()`, `crop()`, `rescale()`, `spatShift()`, `plot()`, methods for `giottoAffineImage`
- `rescale()` method for `giottoImage`
- `spin()`, `shear()`, `affine()`, `flip()`, `t()` methods for `giottoAffineImage` and `giottoLargeImage` (which converts to `giottoAffineImage`)
- `as()` conversion from `giottoLargeImage` to `giottoAffineImage`
- `.get_centroid_xy()` internal for getting numeric centroid xy values of any object that responds to `ext()`
- `.bound_poly()` internal for generating a dummy polygon from the extent of any object that responds to `ext()`
- `.aff_shift_2d()`, `.aff_shift_2d<-()`, `.aff_linear_2d`, `.aff_linear_2d()<-` internals for accessing and manipulating affine matrices


# GiottoClass 0.3.1 (2024/05/21)
Expand Down
2 changes: 1 addition & 1 deletion R/NN_network.R
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ createNearestNetwork <- function(
expression_values
))
)
expr_obj <- get_expression_values(
expr_obj <- getExpression(
gobject = gobject,
feat_type = feat_type,
spat_unit = spat_unit,
Expand Down
2 changes: 1 addition & 1 deletion R/aggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -1900,7 +1900,7 @@ aggregateStacksExpression <- function(gobject,
# aggregate matrices
matrix_list <- list()
for (spat_unit in spat_units) {
mat <- get_expression_values(gobject,
mat <- getExpression(gobject,
spat_unit = spat_unit,
feat_type = feat_type,
values = values,
Expand Down
Loading

0 comments on commit 93bfde8

Please sign in to comment.