Skip to content

Commit

Permalink
Merge pull request #730 from jiajic/suite
Browse files Browse the repository at this point in the history
3.3.1 update
  • Loading branch information
jiajic authored Aug 2, 2023
2 parents 5208666 + 9ca44d7 commit d2d746a
Show file tree
Hide file tree
Showing 128 changed files with 6,618 additions and 1,763 deletions.
10 changes: 7 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Giotto
Title: Spatial Single-Cell Transcriptomics Toolbox
Version: 3.3.0
Version: 3.3.1
Authors@R: c(
person("Ruben", "Dries", email = "[email protected]",
role = c("aut", "cre")),
Expand Down Expand Up @@ -30,6 +30,7 @@ Depends:
methods
Imports:
BiocSingular,
checkmate,
cowplot (>= 0.9.4),
data.table (>= 1.12.2),
dbscan (>= 1.1-3),
Expand Down Expand Up @@ -81,7 +82,6 @@ Suggests:
ggdendro,
ggforce,
ggraph,
ggrepel,
HDF5Array (>= 1.18.1),
hdf5r,
htmlwidgets,
Expand Down Expand Up @@ -117,10 +117,11 @@ Suggests:
Collate:
'NN_network.R'
'accessors.R'
'classes.R'
'assert.R'
'auxiliary_giotto.R'
'auxiliary_visuals.R'
'cell_segmentation.R'
'classes.R'
'clustering.R'
'convenience.R'
'cross_section.R'
Expand All @@ -129,16 +130,19 @@ Collate:
'dd.R'
'differential_expression.R'
'dimension_reduction.R'
'feature_set_enrichment.R'
'general_help.R'
'giotto_structures.R'
'generics.R'
'giotto.R'
'giotto_viewer.R'
'globals.R'
'spatial_manipulation.R'
'image_registration.R'
'images.R'
'interactivity.R'
'interoperability.R'
'poly_influence.R'
'python_environment.R'
'python_hmrf.R'
'python_scrublet.R'
Expand Down
26 changes: 26 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export(addGiottoPoints)
export(addGiottoPoints3D)
export(addGiottoPolygons)
export(addHMRF)
export(addHMRF_V2)
export(addNetworkLayout)
export(addPolygonCells)
export(addSpatialCentroidLocations)
Expand Down Expand Up @@ -83,9 +84,11 @@ export(compareCellAbundance)
export(comparePolygonExpression)
export(convertEnsemblToGeneSymbol)
export(convertGiottoLargeImageToMG)
export(createArchRProj)
export(createCellMetaObj)
export(createCrossSection)
export(createDimObj)
export(createExprObj)
export(createFeatMetaObj)
export(createGiottoCosMxObject)
export(createGiottoImage)
Expand All @@ -96,6 +99,7 @@ export(createGiottoLargeImageList)
export(createGiottoMerscopeObject)
export(createGiottoObject)
export(createGiottoObjectSubcellular)
export(createGiottoObjectfromArchR)
export(createGiottoPoints)
export(createGiottoPolygonsFromDfr)
export(createGiottoPolygonsFromMask)
Expand All @@ -112,6 +116,7 @@ export(createSpatialDefaultGrid)
export(createSpatialDelaunayNetwork)
export(createSpatialEnrich)
export(createSpatialFeaturesKNNnetwork)
export(createSpatialGenomicsObject)
export(createSpatialGrid)
export(createSpatialKNNnetwork)
export(createSpatialNetwork)
Expand All @@ -136,7 +141,10 @@ export(dimPlot2D)
export(dimPlot3D)
export(distGiottoImage)
export(doCellSegmentation)
export(doFeatureSetEnrichment)
export(doGiottoClustree)
export(doHMRF)
export(doHMRF_V2)
export(doHclust)
export(doKmeans)
export(doLeidenCluster)
Expand Down Expand Up @@ -164,6 +172,7 @@ export(filterICFSpot)
export(filterICG)
export(filterInteractionChangedFeats)
export(filterInteractionChangedGenes)
export(filterSpatialGenes)
export(findCPG)
export(findCellProximityGenes)
export(findGiniMarkers)
Expand Down Expand Up @@ -216,6 +225,7 @@ export(get_spatial_locations)
export(giotto)
export(giottoImage)
export(giottoLargeImage)
export(giottoMasterToSuite)
export(giottoPoints)
export(giottoPolygon)
export(giottoToAnnData)
Expand All @@ -225,13 +235,15 @@ export(heatmSpatialCorFeats)
export(heatmSpatialCorGenes)
export(hexVertices)
export(hyperGeometricEnrich)
export(initHMRF_V2)
export(insertCrossSectionGenePlot3D)
export(insertCrossSectionSpatPlot3D)
export(installGiottoEnvironment)
export(jackstrawPlot)
export(joinGiottoObjects)
export(loadGiotto)
export(loadHMRF)
export(makePseudoVisium)
export(makeSignMatrixDWLS)
export(makeSignMatrixDWLSfromMatrix)
export(makeSignMatrixPAGE)
Expand Down Expand Up @@ -298,6 +310,7 @@ export(readPolygonData)
export(readPolygonFilesVizgen)
export(readPolygonFilesVizgenHDF5)
export(readPolygonFilesVizgenHDF5_old)
export(readPolygonVizgenParquet)
export(readSpatEnrichData)
export(readSpatLocsData)
export(readSpatNetData)
Expand Down Expand Up @@ -353,6 +366,8 @@ export(set_spatial_enrichment)
export(set_spatial_locations)
export(seuratToGiotto)
export(seuratToGiotto_OLD)
export(showCellProportionSwitchedPie)
export(showCellProportionSwitchedSanKey)
export(showClusterDendrogram)
export(showClusterHeatmap)
export(showGiottoCellMetadata)
Expand All @@ -374,6 +389,7 @@ export(showPattern)
export(showPattern2D)
export(showPattern3D)
export(showPatternGenes)
export(showPolygonSizeInfluence)
export(showProcessingSteps)
export(showSaveParameters)
export(showSpatialCorFeats)
Expand Down Expand Up @@ -413,6 +429,7 @@ export(spatNetwDistributionsKneighbors)
export(spatPlot)
export(spatPlot2D)
export(spatPlot3D)
export(spatQueryGiottoPolygons)
export(spatShift)
export(spatUnit)
export(spatialAEH)
Expand All @@ -429,6 +446,7 @@ export(subsetGiotto)
export(subsetGiottoLocs)
export(subsetGiottoLocsMulti)
export(subsetGiottoLocsSubcellular)
export(tessellate)
export(trendSceek)
export(updateGiottoImage)
export(updateGiottoImageMG)
Expand All @@ -440,6 +458,7 @@ export(validObject)
export(viewHMRFresults)
export(viewHMRFresults2D)
export(viewHMRFresults3D)
export(viewHMRFresults_V2)
export(violinPlot)
export(writeGiottoLargeImage)
export(writeHMRFresults)
Expand All @@ -465,6 +484,7 @@ exportMethods("[")
exportMethods("[<-")
exportMethods("activeFeatType<-")
exportMethods("activeSpatUnit<-")
exportMethods("ext<-")
exportMethods("featType<-")
exportMethods("instructions<-")
exportMethods("objName<-")
Expand All @@ -476,8 +496,10 @@ exportMethods(centroids)
exportMethods(colnames)
exportMethods(copy)
exportMethods(dim)
exportMethods(ext)
exportMethods(featIDs)
exportMethods(featType)
exportMethods(flip)
exportMethods(instructions)
exportMethods(ncol)
exportMethods(nrow)
Expand All @@ -498,6 +520,7 @@ import(data.table)
import(ggplot2)
import(magrittr)
import(utils)
importClassesFrom(terra,SpatExtent)
importFrom(graphics,segments)
importFrom(magrittr,"%>%")
importFrom(methods,"slot<-")
Expand All @@ -508,7 +531,10 @@ importFrom(methods,slot)
importFrom(methods,slotNames)
importFrom(methods,validObject)
importMethodsFrom(Matrix,t)
importMethodsFrom(terra,"ext<-")
importMethodsFrom(terra,centroids)
importMethodsFrom(terra,ext)
importMethodsFrom(terra,flip)
importMethodsFrom(terra,ncol)
importMethodsFrom(terra,nrow)
importMethodsFrom(terra,plot)
Expand Down
51 changes: 51 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@


# Giotto Suite 3.3.1 (2023-08-02)

## Breaking Changes
- Change `checkGiottoEnvironment()`. Downgrade from error to message and return FALSE when a provided directory does not exist

## Added
- New file `poly_influence.R`
- New function `showPolygonSizeInfluence()` within `poly_influence.R` to show if cells switch clusters when across resized polygon annotations
- New function `showCellProportionSwitchedPie()` within `poly_influence.R` to visualize results from `showPolygonSizeInfluence()` in a pie chart
- New function `showCellProportionSwitchedSankey()` within `poly_influence.R` to visualize results from `showPolygonSizeInfluence()` in a Sankey diagram
- New function `makePseudoVisium()` within `giotto_structure.R` to generate a pseudo visium grid of circular spots
- New function `tessellate()` within `giotto_structure.R` to generate a grid of hexagons or squares for spatial binning
- New file `feature_set_enrichment.R`
- New function `doFeatureSetEnrichment()` within `feature_set_enrichment.R` for GSEA analysis
- New function `doGiottoClustree()` within `clustering.R` for visualizations of leiden clusters at varying resolutions
- New `createArchRProj()` and `CreateGiottoObjectFromArchR()` functions to create a `giotto` object with ATAC or epigenetic features using the *ArchR* pipeline.
- New `giottoMasterToSuite()` function to convert a `giotto` object created with the master version to a Giotto suite object.
- New `readPolygonVizgenParquet()` for updated parquet outputs
- Add *checkmate* to Imports for assertions checking
- Add exported `create` function for `exprObj` creation
- New file `spatial_manipulation.R`
- Add `ext()` methods for `giottoPolygon`, `giottoPoints`, `spatialNetworkObj`, `spatLocsObj`, `giottoLargeImage`
- Add `flip()` methods for `giottoPolygon`, `giottoPoints`, `spatialNetworkObj`, `spatLocsObj`, `SpatExtent`, `giottoLargeImage`
- Add access to terra plotting params for `giottoLargeImage` `plot()` method.

## Changes
- Fix bug in `combine_matrices()`
- Fix bug in `createGiottoObject()` that will not allow object creation without supplied expression information
- Updated `polyStamp()` to replace an apply function with a crossjoin for better performance.
- Updated `spatInSituPlotPoints()` with `plot_last` parameter. Default output now plots polygons above points for better visibility.
- Add check for spatLocsObj for spatlocs in polyStamp()
- Removed various print() and cat() statements throughout.
- Changed default verbose argument to FALSE for createGiottoObject
- Changed default verbose argument to FALSE for joinGiottoObjects
- Changed default verbose argument to FALSE for createGiottoObjectSubcellular
- Default verbose = FALSE argument added to cellProximityEnrichmentSpots
- Default verbose = FALSE argument added to specific_CCCScores_spots
- Default verbose = FALSE argument added to runWNN
- Default verbose = FALSE argument added to subset_giotto_points_object
- Default verbose = FALSE argument added to subset_feature_info_data
- Default verbose = FALSE argument added to subsetGiotto
- Default verbose = FALSE argument added to subsetGiottoLocsSubcellular
- Default verbose = FALSE argument added to createGiottoXeniumObject_subcellular
- Update `readPolygonFilesVizgenHDF5()` add option to return as `data.table` and skip `giottoPolygon` creation. Downstream `giottoPolygon` creation refactored as new internal function
- Update cell segmentation workflow to check for *deepcell* and *PIL* python packages
- Update cell segmentation workflow to return grayscale mask images instead of RGB
- Update `createGiottoVisiumObject()` image h5 scalefactors reading to use partial matching for whether hi or lowres image is supplied
- Update `giottoLargeImage` `plot()` method to use `terra::plot()` instead of `terra::plotRGB()` for grayscale images
- Remove unnecessary prints from `subsetGiotto()`
- Fix bug in `readCellMetadata()` and `readFeatMetadata()`


# Giotto Suite 3.3.0 (2023-04-18)

Expand Down
23 changes: 19 additions & 4 deletions R/NN_network.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,24 @@ createNearestNetwork <- function(gobject,
spat_unit = spat_unit,
values = values,
output = 'exprObj')

provenance = prov(expr_obj)
expr_values = expr_obj[] # extract matrix

if(!is.null(slot(gobject, 'h5_file'))) {
expr_path = slot(expr_values, 'exprMat')

expr_values = HDF5Array::h5mread(filepath = slot(gobject, 'h5_file'),
name = expr_path)

expr_dimnames = HDF5Array::h5readDimnames(filepath = slot(gobject, 'h5_file'),
name = expr_path)

rownames(expr_values) = expr_dimnames[[1]]
colnames(expr_values) = expr_dimnames[[2]]
} else {

provenance = prov(expr_obj)
expr_values = expr_obj[] # extract matrix

}

# subset expression matrix
if(!is.null(feats_to_use)) {
Expand Down Expand Up @@ -209,7 +224,7 @@ createNearestNetwork <- function(gobject,
}


print(nn_network_igraph) # debug


# set default name
if(is.null(name)) name = paste0(type, '.', dim_reduction_to_use)
Expand Down
Loading

0 comments on commit d2d746a

Please sign in to comment.