Skip to content

Commit

Permalink
Merge pull request #1055 from jiajic/suite_dev
Browse files Browse the repository at this point in the history
Suite dev
  • Loading branch information
jiajic authored Oct 28, 2024
2 parents 0c025d1 + daabd70 commit 611eff1
Show file tree
Hide file tree
Showing 15 changed files with 246 additions and 192 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
^renv\.lock$
^Giotto\.Rproj$
^\.Rproj\.user$
^.lintr

^LICENSE\.md$
^README\.Rmd$
Expand Down
2 changes: 0 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ URL: https://drieslab.github.io/Giotto/, https://github.com/drieslab/Giotto
BugReports: https://github.com/drieslab/Giotto/issues
RoxygenNote: 7.3.2
Depends:
base (>= 4.4.1),
utils (>= 4.4.1),
R (>= 4.4.1),
methods,
GiottoClass (>= 0.3.3)
Expand Down
11 changes: 10 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Giotto 4.1.3
# Giotto 4.1.3 (2024/10/27)

## New
* Add `giottoToAnndataZarr()` to create a local anndata zarr folder and interact with the vitessceR package.
* `reduceDims()` API function for dimension reductions
* `runNMF()` implementation that works via RcppML

## Changes
* `screePlot()` `name` param changed to `dim_reduction_name`
* `runWNN()` and `runIntegratedUMAP()` arguments were updated to make the function flexible to handle any number of modalities.
* update `jackstrawPlot()` to make more flexible and efficient. Changed default params for `scaling`, `centering`, and `feats_to_use` to match `runPCA()`
* change warning when reduction "feats" is selected in `runtSNE()` to error to avoid accidentally wiping the `giotto` object.


# Giotto 4.1.2

Expand All @@ -26,7 +31,11 @@
* move `progressr` and `jsonlite` dependencies to GiottoUtils v0.1.12
* remove `reshape2` dependency.

## Bug fixes
* `processGiotto()` can now skip adjust step by default

## New
* `identifyTMAcores()` for assigning IDs to tissue microarray spatial data.
* `labelTransfer()` for transferring labels between giotto objects or subsets thereof. Supercedes `doClusterProjection()`

# Giotto 4.1.1
Expand Down
4 changes: 2 additions & 2 deletions R/clustering.R
Original file line number Diff line number Diff line change
Expand Up @@ -3228,11 +3228,11 @@ getDendrogramSplits <- function(gobject,

if (show_dend == TRUE) {
# plot dendrogram
graphics::plot(cordend)
plot(cordend)

# add horizontal lines
if (!is.null(h)) {
graphics::abline(h = h, col = h_color)
abline(h = h, col = h_color)
}
}

Expand Down
8 changes: 4 additions & 4 deletions R/dimension_reduction.R
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ reduceDims <- function(
)

if (set_seed) {
withSeed(
gwith_seed(
seed = seed_number,
{
pca_res <- do.call(BiocSingular::runPCA, pca_param)
},
seed = seed_number
)
} else {
pca_res <- do.call(BiocSingular::runPCA, pca_param)
Expand Down Expand Up @@ -1757,7 +1757,7 @@ jackstrawPlot <- function(gobject,
# create a random subset if random_subset is not NULL
if (!is.null(random_subset)) {
if (set_seed) {
withSeed(seed = seed_number, {
gwith_seed(seed = seed_number, {
random_selection <- sort(sample(
seq_len(ncol(expr_values)), random_subset
))
Expand Down Expand Up @@ -1795,7 +1795,7 @@ jackstrawPlot <- function(gobject,
}

if (set_seed) {
withSeed(seed = seed_number, {
gwith_seed(seed = seed_number, {
jtest <- .perm_pa(
dat = expr_values,
iter = iter,
Expand Down
2 changes: 1 addition & 1 deletion R/globals.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
utils::globalVariables(names = c(
globalVariables(names = c(
":=", ".N", ".SD", ".", "cast",
"%--%", ".inc", # igraph
"python_leiden", "python_louvain", "python_spatial_genes",
Expand Down
4 changes: 2 additions & 2 deletions R/image_registration.R
Original file line number Diff line number Diff line change
Expand Up @@ -705,10 +705,10 @@ registerGiottoObjectListRvision <- function(gobject_list = gobject_list,

## 4. Compute transformations
# Choose reference image
refImage <- unreg_images[[base::floor(length(unreg_images) / 2)]]
refImage <- unreg_images[[floor(length(unreg_images) / 2)]]

# Compute ECC transforms
transfs <- base::vector(mode = "list", length = length(unreg_images))
transfs <- vector(mode = "list", length = length(unreg_images))
for (i in seq_along(unreg_images)) {
transfs[[i]] <- Rvision::findTransformECC(
refImage, unreg_images[[i]],
Expand Down
2 changes: 1 addition & 1 deletion R/normalize.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ normalizeGiotto <- function(
.lib_norm_giotto <- function(mymatrix, scalefactor) {
libsizes <- colSums_flex(mymatrix)

if (any(libsizes == 0)) {
if (0 %in% libsizes) {
warning(wrap_txt("Total library size or counts for individual spat
units are 0.
This will likely result in normalization problems.
Expand Down
Loading

0 comments on commit 611eff1

Please sign in to comment.