diff --git a/INDEX.md b/INDEX.md
deleted file mode 100644
index 48370bc78..000000000
--- a/INDEX.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-# Giotto Suite
-
-
-
-[![License: GPL
-v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
-![Last
-Commit](https://badgen.net/github/last-commit/drieslab/Giotto/suite)
-![Commits Since
-Latest](https://img.shields.io/github/commits-since/drieslab/Giotto/latest/suite)
-[![R-CMD-check](https://github.com/drieslab/Giotto/actions/workflows/main_check.yaml/badge.svg?branch=suite_modular)](https://github.com/drieslab/Giotto/actions/workflows/main_check.yaml)
-
-
-Giotto Suite is a major upgrade to the Giotto package that provides tools to process, analyze and visualize **spatial multi-omics data at all scales and multiple resolutions**. The underlying framework is generalizable to virtually all current and emerging spatial technologies. Our Giotto Suite prototype pipeline is generally applicable on various different datasets, such as those created by state-of-the-art spatial technologies, including *in situ* hybridization (seqFISH+, merFISH, osmFISH, CosMx), sequencing (Slide-seq, Visium, STARmap, Seq-Scope, Stereo-Seq) and imaging-based multiplexing/proteomics (CyCIF, MIBI, CODEX). These technologies differ in terms of resolution (subcellular, single cell or multiple cells), spatial dimension (2D vs 3D), molecular modality (protein, RNA, DNA, …), and throughput (number of cells and analytes).
-
-
-## Installation
-
-To install Giotto suite use
-`pak::pkg_install("drieslab/Giotto")`.
-
-Visit the Giotto [Discussions](https://github.com/drieslab/Giotto/discussions) page for more information.
-
-## Website Update!
-
-With Giotto version 4.0, we updated the website at http://giottosuite.com, you can still find the previous website at https://giottosuite.readthedocs.io/en/latest/
-
-## Website description
-
-- **Get started:** Here you can find more advanced information about the Giotto object, Giotto ecosystem, Giotto configuration, and installation FAQs.
-- **Documentation:** Here you will find all Giotto functions grouped by their purpose (Helpers, Getters & Setters, Visualization, ...)
-- **Examples:** Here you can find end-to-end examples for different technologies and datasets.
-- **Tutorials:** Here you can find various tutorials on working with Giotto (analysis, visualizations, working on the cloud, ...)
-- **News:** Here you can find the changelog for every Giotto release and video recordings from previous presentations.
-
-
-## References
-
-- [Jiaji George Chen, Joselyn Cristina Chávez-Fuentes, et al. Giotto Suite: a multi-scale and technology-agnostic spatial multi-omics analysis ecosystem. bioRxiv (2023)](https://www.biorxiv.org/content/10.1101/2023.11.26.568752v1)
-- [Dries, R., Zhu, Q. et al. Giotto: a toolbox for integrative analysis and visualization of spatial expression data. Genome Biology (2021).](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-021-02286-2)
-- [Dries, R., Chen, J. et al. Advances in spatial transcriptomic data analysis. Genome Research (2021).](https://genome.cshlp.org/content/31/10/1706.long)
-- [Del Rossi, N., Chen, J. et al. Analyzing Spatial Transcriptomics Data Using Giotto. Current Protocols (2022).](https://currentprotocols.onlinelibrary.wiley.com/doi/abs/10.1002/cpz1.405)
diff --git a/_pkgdown.yml b/_pkgdown.yml
deleted file mode 100644
index 72eaeedbf..000000000
--- a/_pkgdown.yml
+++ /dev/null
@@ -1,821 +0,0 @@
-url: https://drieslab.github.io/Giotto/
-
-authors:
- Ruben Dries:
- href: https://www.drieslab.com
- Guo-Cheng Yuan:
- href: https://labs.icahn.mssm.edu/yuanlab/
- Joselyn C. Chávez-Fuentes:
- href: https://josschavezf.github.io
-
-
-template:
- bootstrap: 3
- bslib:
- bg: "#FFFFFF"
- fg: "#000000"
- primary: "#7E69AE"
- code_font: {google: "JetBrains Mono"}
-
-development:
- mode: auto
-
-navbar:
- bg: light
- structure:
- left:
- - intro
- - get_started
- - reference
- - articles
- - tools
- - news
- - team
- right:
- - search
- - github
- components:
- get_started:
- text: Get started
- menu:
- - text: Giotto Installation
- href: articles/installation.html
- - text: Giotto Ecosystem
- href: articles/ecosystem.html
- - text: Giotto Class Structure
- href: articles/structure.html
- - text: FAQs
- href: articles/faqs.html
- - text: How to report a bug
- href: articles/github_issues.html
- - text: Contributing guide
- href: articles/contributing.html
- reference:
- text: Documentation
- href: reference/index.html
- tools:
- text: Tutorials
- menu:
- - text: Giotto Object Creation
- href: articles/object_creation.html
- - text: -------
- - text: Giotto Configuration
- href: articles/configuration.html
- - text: -------
- - text: Spatial manipulation
- - text: Spatial transformations
- href: articles/spatial_transformations.html
- - text: -------
- - text: Spatial geometries
- href: https://drieslab.github.io/GiottoClass/articles/spatial_geometries.html
- - text: -------
- - text: Image alignment
- - text: Image alignment
- href: articles/image_alignment.html
- - text: -------
- - text: Interactive selection
- - text: Interactive selection
- href: articles/interactive_selection.html
- - text: -------
- - text: Visualizations
- - text: Visualizations
- href: articles/visualizations.html
- - text: -------
- - text: Saving and Loading
- - text: Saving a Giotto object
- href: articles/saving_object.html
- - text: Saving plots
- href: articles/saving_plots.html
- - text: -------
- - text: Interoperability
- - text: AnnData
- href: articles/interoperability_anndata.html
- - text: SpatialExperiment
- href: articles/interoperability_spatialexperiment.html
- - text: -------
- - text: Try Giotto in the Cloud
- - text: Terra.bio
- href: articles/terra.html
- - text: Docker
- href: articles/docker.html
- - text: Singularity
- href: articles/singularity.html
- articles:
- text: Examples
- menu:
- - text: Seq-Scope
- menu:
- - text: Mouse liver
- href: articles/seqscope_mouse_liver.html
- - text: -------
- - text: Visium
- menu:
- - text: Visium Mouse Kidney
- href: articles/visium_mouse_kidney.html
- - text: Visium Mouse Brain
- href: articles/visium_mouse_brain.html
- - text: Visium Prostate Integration
- href: articles/visium_prostate_integration.html
- - text: CytAssist Human Lung Cancer
- href: articles/visium_cytassist_lungcancer.html
- - text: CytAssist Multi-omics Human Glioblastoma
- href: articles/visium_cytassist_human_glioblastoma.html
- - text: -------
- - text: Spatial Genomics
- menu:
- - text: Mouse Kidney
- href: articles/spatial_genomics_mouse_kidney.html
- - text: -------
- - text: DBiT-Seq
- menu:
- - text: Multi-omics Mouse Embryo DBiT-Seq
- href: articles/mouse_embryo_dbitseq.html
- - text: -------
- - text: Spatial CITE-Seq
- menu:
- - text: Multi-omics Spatial CITE-Seq Human skin
- href: articles/spatial_citeseq_human_skin.html
- - text: -------
- - text: Xenium
- menu:
- - text: Xenium Human breast cancer
- href: articles/xenium_breast_cancer.html
- - text: -------
- - text: Nanostring CosMx
- menu:
- - text: Nanostring CosMx Subcellular Lung Cancer
- href: articles/nanostring_cosmx_lung_cancer.html
- - text: -------
- - text: MERFISH
- menu:
- - text: MERFISH Mouse Hypothalamic Preoptic Region
- href: articles/merfish_mouse_hypothalamic.html
- - text: -------
- - text: Vizgen
- menu:
- - text: Vizgen Mouse Brain Receptor Map
- href: articles/vizgen_mouse_brain.html
- - text: -------
- - text: seqFISH
- menu:
- - text: mini seqFISH
- href: articles/mini_seqfish.html
- - text: SeqFish+ Mouse Cortex Example
- href: articles/seqfish_cortex.html
- - text: -------
- - text: osmFISH
- menu:
- - text: osmFISH Mouse SS Cortex
- href: articles/osmfish_mouse_ss_cortex.html
- - text: -------
- - text: Resolve Bioscience
- menu:
- - text: Resolve Bioscience Breast Cancer Subcellular
- href: articles/resolve_biosciences.html
- - text: -------
- - text: CODEX
- menu:
- - text: Codex Mouse Spleen
- href: articles/codex_mouse_spleen.html
- - text: -------
- - text: Single Cell RNA Sequencing
- menu:
- - text: Prostate
- href: articles/singlecell_prostate_standard.html
- - text: Prostate Integration
- href: articles/singlecell_prostate_integration.html
- - text: Human Lung Adenocarcinoma
- href: articles/singlecell_lung_adenocarcinoma.html
- news:
- text: News
- menu:
- - text: Changes
- href: news/index.html
- - text: Presentations
- href: articles/presentations.html
- - text: Branches
- href: articles/branches.html
- team:
- - text: Team
- href: articles/team.html
- github:
- icon: fab fa-github fa-lg
- href: https://github.com/drieslab/Giotto/
- aria-label: github
-
-articles:
-- title: Team
- navbar: ~
- contents:
- - team
-- title: News
- navbar: ~
- contents:
- - presentations
- - branches
-- title: Get started
- navbar: ~
- contents:
- - installation
- - ecosystem
- - structure
- - faqs
- - github_issues
- - contributing
-- title: Giotto Object Creation
- navbar: ~
- contents:
- - object_creation
-- title: Giotto Configuration
- navbar: ~
- contents:
- - configuration
-- title: Try Giotto in the Cloud
- navbar: ~
- contents:
- - terra
- - docker
- - singularity
-- title: Spatial Manipulation
- navbar: ~
- contents:
- - spatial_transformations
-- title: Image alignment
- navbar: ~
- contents:
- - image_alignment
-- title: Interactive selection
- navbar: ~
- contents:
- - interactive_selection
-- title: Visualizations
- navbar: ~
- contents:
- - visualizations
-- title: Saving and Loading
- navbar: ~
- contents:
- - saving_object
- - saving_plots
-- title: Interoperability
- navbar: ~
- contents:
- - interoperability_anndata
- - interoperability_spatialexperiment
-- title: Seq-Scope
- navbar: ~
- contents:
- - seqscope_mouse_liver
-- title: Visium
- navbar: ~
- contents:
- - visium_mouse_kidney
- - visium_mouse_brain
- - visium_prostate_integration
- - visium_cytassist_lungcancer
- - visium_cytassist_human_glioblastoma
-- title: Spatial Genomics
- navbar: ~
- contents:
- - spatial_genomics_mouse_kidney
-- title: DBiT-Seq
- navbar: ~
- contents:
- - mouse_embryo_dbitseq
-- title: Spatial CITE-Seq
- navbar: ~
- contents:
- - spatial_citeseq_human_skin
-- title: Xenium
- navbar: ~
- contents:
- - xenium_breast_cancer
-- title: Nanostring CosMx
- navbar: ~
- contents:
- - nanostring_cosmx_lung_cancer
-- title: MERFISH
- navbar: ~
- contents:
- - merfish_mouse_hypothalamic
-- title: Vizgen
- navbar: ~
- contents:
- - vizgen_mouse_brain
-- title: seqFISH
- navbar: ~
- contents:
- - mini_seqfish
- - seqfish_cortex
-- title: osmFISH
- navbar: ~
- contents:
- - osmfish_mouse_ss_cortex
-- title: Resolve Bioscience
- navbar: ~
- contents:
- - resolve_biosciences
-- title: CODEX
- navbar: ~
- contents:
- - codex_mouse_spleen
-- title: Single Cell RNA Sequencing
- navbar: ~
- contents:
- - singlecell_prostate_standard
- - singlecell_prostate_integration
- - singlecell_lung_adenocarcinoma
-
-news:
- cran_dates: false
-
-
-home:
- sidebar:
- structure: [links, license, community, citation, authors, dev]
-
-reference:
-- title: Giotto Environment
- desc: Install and work with Giotto Python Environment.
-- contents:
- - GiottoClass::installGiottoEnvironment
- - GiottoClass::removeGiottoEnvironment
- - GiottoClass::checkGiottoEnvironment
-- title: Giotto Instructions
- desc: Create or change Giotto instructions.
-- contents:
- - GiottoClass::createGiottoInstructions
- - GiottoClass::readGiottoInstructions
- - GiottoClass::changeGiottoInstructions
- - GiottoClass::replaceGiottoInstructions
-- title: Import Raw Data
- desc: Functions to help to import raw spatial data.
-- contents:
- - GiottoData::getSpatialDataset
- - GiottoClass::readExprMatrix
- - get10Xmatrix
- - get10XmatrixOLD
- - get10Xmatrix_h5
- - GiottoClass::stitchFieldCoordinates
- - GiottoClass::stitchTileCoordinates
- - readPolygonFilesVizgen
- - readPolygonFilesVizgenHDF5
- - getGEFtxCoords
-- title: Images
- desc: Functions to work with images for a Giotto object.
-- contents:
- - GiottoClass::estimateImageBg
- - GiottoClass::changeImageBg
- - GiottoClass::createGiottoImage
- - GiottoClass::addGiottoImage
- - GiottoVisuals::addGiottoImageToSpatPlot
- - GiottoClass::showGiottoImageNames
- - GiottoClass::updateGiottoImage
- - GiottoClass::getGiottoImage
- - GiottoClass::plotGiottoImage
- - GiottoClass::setGiottoImage
- - GiottoClass::addGiottoLargeImage
- - GiottoClass::createGiottoLargeImage
- - GiottoClass::createGiottoLargeImageList
- - createMerscopeLargeImage
- - GiottoClass::cropGiottoLargeImage
- - GiottoClass::updateGiottoLargeImage
- - GiottoClass::writeGiottoLargeImage
- - GiottoClass::stitchGiottoLargeImage
- - GiottoClass::convertGiottoLargeImageToMG
- - GiottoClass::addGiottoImageMG
- - GiottoClass::updateGiottoImageMG
- - GiottoClass::distGiottoImage
- - GiottoClass::reconnectGiottoImage
- - registerImagesFIJI
- - registerGiottoObjectList
- - registerGiottoObjectListFiji
- - registerGiottoObjectListRvision
-- title: Giotto Object
- desc: Functions to help to import raw spatial data.
-- contents:
- - GiottoClass::createGiottoObject
- - createGiottoVisiumObject
- - GiottoClass::createGiottoObjectSubcellular
- - createGiottoCosMxObject
- - createGiottoMerscopeObject
- - createGiottoObjectfromArchR
- - createArchRProj
- - createGiottoXeniumObject
- - readPolygonFilesVizgenHDF5_old
-- title: Giotto Helper Functions
- desc: Common functions to help working with Giotto objects.
-- contents:
- - GiottoClass::pDataDT
- - GiottoClass::fDataDT
- - GiottoClass::showProcessingSteps
- - GiottoClass::calculateMetaTable
- - GiottoClass::calculateMetaTableCells
- - GiottoClass::combineMetadata
- - GiottoClass::createMetafeats
- - findNetworkNeighbors
- - GiottoClass::objHistory
- - fiji
-- title: Giotto Getters & Setters
- desc: Low level functions to get, set and show Giotto slots.
-- contents:
- - GiottoClass::getExpression
- - GiottoClass::setExpression
- - GiottoClass::getSpatialLocations
- - GiottoClass::setSpatialLocations
- - GiottoClass::getDimReduction
- - GiottoClass::setDimReduction
- - GiottoClass::getNearestNetwork
- - GiottoClass::setNearestNetwork
- - GiottoClass::getSpatialNetwork
- - GiottoClass::setSpatialNetwork
- - GiottoClass::getSpatialGrid
- - GiottoClass::setSpatialGrid
- - GiottoClass::getPolygonInfo
- - GiottoClass::setPolygonInfo
- - GiottoClass::getFeatureInfo
- - GiottoClass::setFeatureInfo
- - GiottoClass::getFeatureMetadata
- - GiottoClass::setFeatureMetadata
- - GiottoClass::getSpatialEnrichment
- - GiottoClass::setSpatialEnrichment
- - GiottoClass::getCellMetadata
- - GiottoClass::setCellMetadata
- - GiottoClass::getMultiomics
- - GiottoClass::setMultiomics
-- title: Giotto Show Slots
- desc: Show what is available in different information slots.
-- contents:
- - GiottoClass::showGiottoExpression
- - GiottoClass::showGiottoCellMetadata
- - GiottoClass::showGiottoDimRed
- - GiottoClass::showGiottoFeatInfo
- - GiottoClass::showGiottoFeatMetadata
- - GiottoClass::showGiottoImageNames
- - GiottoClass::showGiottoInstructions
- - GiottoClass::showGiottoNearestNetworks
- - GiottoClass::showGiottoSpatEnrichments
- - GiottoClass::showGiottoSpatGrids
- - GiottoClass::showGiottoSpatialInfo
- - GiottoClass::showGiottoSpatLocs
- - GiottoClass::showGiottoSpatNetworks
- - GiottoClass::showGrids
- - GiottoClass::showNetworks
- - showPattern
- - showPattern2D
- - showPattern3D
- - showPatternGenes
-- title: Modify Giotto Object
- desc: Modifications to the Giotto objects.
-- contents:
- - filterGiotto
- - filterCombinations
- - filterDistributions
- - GiottoClass::subsetGiotto
- - GiottoClass::subsetGiottoLocs
- - GiottoClass::subsetGiottoLocsMulti
- - GiottoClass::joinGiottoObjects
- - normalizeGiotto
- - adjustGiottoMatrix
- - GiottoClass::annotateGiotto
- - GiottoClass::removeCellAnnotation
- - GiottoClass::removeFeatAnnotation
- - GiottoClass::addCellMetadata
- - GiottoClass::addFeatMetadata
- - addFeatStatistics
- - addCellStatistics
- - addStatistics
- - addFeatsPerc
- - addCellIntMetadata
- - processGiotto
- - filterCPG
-- title: Dimension Reduction
- desc: Functions to reduce dimensions.
-- contents:
- - calculateHVF
- - signPCA
- - screePlot
- - create_screeplot
- - jackstrawPlot
- - runPCA
- - runUMAP
- - runtSNE
- - runGiottoHarmony
- - runWNN
- - runIntegratedUMAP
- - runPCAprojection
- - runPCAprojectionBatch
- - runUMAPprojection
-- title: Clustering
- desc: Functions to cluster cells.
-- contents:
- - calculateHVF
- - GiottoClass::createNearestNetwork
- - GiottoClass::addNetworkLayout
- - clusterCells
- - doLeidenCluster
- - doLeidenClusterIgraph
- - doLouvainCluster
- - doKmeans
- - doHclust
- - doRandomWalkCluster
- - doSNNCluster
- - subClusterCells
- - doLeidenSubCluster
- - doLouvainSubCluster
- - getClusterSimilarity
- - mergeClusters
- - getDendrogramSplits
- - doClusterProjection
- - doGiottoClustree
-- title: Marker Genes
- desc: Functions to detect cell type / cluster specific marker genes.
-- contents:
- - findMarkers
- - findMarkers_one_vs_all
- - findGiniMarkers
- - findGiniMarkers_one_vs_all
- - findScranMarkers
- - findScranMarkers_one_vs_all
- - findMastMarkers
- - findMastMarkers_one_vs_all
-- title: Auxiliary Visualizations
- desc: Functions for different visualization options to explore gene, cell or cluster characteristics.
-- contents:
- - GiottoVisuals::showClusterHeatmap()
- - GiottoVisuals::showClusterDendrogram
- - GiottoVisuals::plotHeatmap
- - GiottoVisuals::plotMetaDataHeatmap
- - GiottoVisuals::plotMetaDataCellsHeatmap
- - GiottoVisuals::violinPlot
- - callSpdep
-- title: Spatial Enrichment
- desc: Algorithms to compute spatial enrichment of gene signatures or scRNA-seq matrix.
-- contents:
- - makeSignMatrixPAGE
- - makeSignMatrixRank
- - runSpatialEnrich
- - runPAGEEnrich
- - runPAGEEnrich_OLD
- - runRankEnrich
- - rankEnrich
- - runHyperGeometricEnrich
- - hyperGeometricEnrich
- - PAGEEnrich
- - createSpatialEnrich
- - createSpatialGenomicsObject
- - doFeatureSetEnrichment
- - selectPatternGenes
- - silhouetteRank
- - silhouetteRankTest
-- title: Spatial Deconvolution
- desc: Algorithms to perform spatial deconvolution based on gene signatures or single-cell RNAseq information.
-- contents:
- - makeSignMatrixDWLSfromMatrix
- - makeSignMatrixDWLS
- - runSpatialDeconv
- - runDWLSDeconv
- - GiottoVisuals::spatDeconvPlot
- - featExpDWLS
-- title: Spatial Network or Grid
- desc: Function to (help) create a spatial network or grid.
-- contents:
- - GiottoVisuals::spatNetwDistributionsDistance
- - GiottoVisuals::spatNetwDistributionsKneighbors
- - GiottoVisuals::spatNetwDistributions
- - GiottoClass::createSpatialDelaunayNetwork
- - GiottoVisuals::plotStatDelaunayNetwork
- - GiottoClass::createSpatialKNNnetwork
- - GiottoClass::annotateSpatialNetwork
- - GiottoClass::annotateSpatialGrid
- - GiottoClass::createSpatialGrid
- - GiottoClass::createSpatialDefaultGrid
-- title: Spatial Expression Patterns
- desc: Methods to detect spatially coherent expression patterns.
-- contents:
- - binSpectSingleMatrix
- - binSpectSingle
- - binSpectMultiMatrix
- - binSpectMulti
- - binSpect
- - spatialDE
- - spatialAEH
- - trendSceek
- - spark
- - filterSpatialGenes
-- title: Simulate Spatial Expression Patterns
- desc: Function to simulate a user-defined pattern using the full complexity of the different gene distributions.
-- contents:
- - simulateOneGenePatternGiottoObject
- - runPatternSimulation
-- title: Spatial Co-Expression Modules
- desc: Method to detect spatially co-expressed feature modules.
-- contents:
- - clusterSpatialCorFeats
- - detectSpatialCorFeats
- - detectSpatialCorGenes
- - clusterSpatialCorGenes
- - detectSpatialCorFeatsMatrix
- - detectSpatialPatterns
- - heatmSpatialCorFeats
- - heatmSpatialCorGenes
- - showSpatialCorFeats
- - showSpatialCorGenes
- - rankSpatialCorGroups
- - getBalancedSpatCoexpressionFeats
-- title: Spatial Data Handling
- desc: Functions to condense spatial data.
-- contents:
- - GiottoClass::combineSpatialCellFeatureInfo
- - GiottoClass::combineSpatialCellMetadataInfo
-- title: Hidden Markov Random Field (HMRF)
- desc: Functions to identify spatial domains with HMRF.
-- contents:
- - doHMRF
- - doHMRF_V2
- - initHMRF_V2
- - loadHMRF
- - viewHMRFresults
- - viewHMRFresults_V2
- - writeHMRFresults
- - addHMRF
- - addHMRF_V2
- - viewHMRFresults
- - viewHMRFresults2D
- - viewHMRFresults3D
-- title: General Plotting
- desc: Functions to assist in plotting.
-- contents:
- - GiottoVisuals::getDistinctColors
- - GiottoVisuals::showSaveParameters
-- title: 2D Visualization In Expression Space
- desc: Visualization of expression space (e.g. UMAP) in 2D.
-- contents:
- - GiottoVisuals::dimPlot
- - GiottoVisuals::dimPlot2D
- - GiottoVisuals::plotUMAP
- - GiottoVisuals::plotUMAP_2D
- - GiottoVisuals::plotTSNE
- - GiottoVisuals::plotTSNE_2D
- - GiottoVisuals::plotPCA
- - GiottoVisuals::plotPCA_2D
- - GiottoVisuals::dimFeatPlot2D
- - GiottoVisuals::dimCellPlot2D
-- title: 2D Visualization in Spatial Space
- desc: Visualization of expression space (e.g. UMAP) in 2D.
-- contents:
- - GiottoVisuals::spatPlot2D
- - GiottoVisuals::spatCellPlot2D
- - GiottoVisuals::spatFeatPlot2D
-- title: 2D Visualization In Both Spatial And Expression Space
- desc: Visualization in both 2D spatial and expression space.
-- contents:
- - GiottoVisuals::spatDimPlot2D
- - GiottoVisuals::spatDimCellPlot2D
- - GiottoVisuals::spatDimFeatPlot2D
-- title: 3D Visualization Dimension Reduction
- desc: Visualization of expression space (e.g. UMAP) in 3D.
-- contents:
- - GiottoVisuals::dimPlot3D
- - GiottoVisuals::plotTSNE_3D
- - GiottoVisuals::plotPCA_3D
-- title: 3D Visualization In Spatial Space
- desc: Visualization in 3D spatial space.
-- contents:
- - GiottoVisuals::spatPlot3D
-- title: 3D visualization in Spatial and Expression Space
- desc: Visualization in 3D spatial space.
-- contents:
- - GiottoVisuals::spatDimPlot3D
-- title: In Silico Cross Sections
- desc: Functions to create an in silico 2D cross sections from 3D data.
-- contents:
- - createCrossSection
- - crossSectionGenePlot
- - crossSectionPlot
- - crossSectionGenePlot3D
- - crossSectionPlot3D
- - insertCrossSectionGenePlot3D
- - insertCrossSectionSpatPlot3D
- - create_crossSection_object
-- title: Cell Neighborhood, Cell-Type/Cell-Type Enrichment
- desc: Functions to calculate and visualize cell-type/cell-type spatial enrichment or depletion.
-- contents:
- - cellProximityEnrichment
- - cellProximityEnrichmentEachSpot
- - cellProximityEnrichmentSpots
- - cellProximityBarplot
- - cellProximityHeatmap
- - cellProximityNetwork
- - cellProximitySpatPlot
- - cellProximitySpatPlot3D
- - specificCellCellcommunicationScores
- - filterCellProximityGenes
- - findCellProximityGenes
- - findCellTypesFromEnrichment
- - pieCellTypesFromEnrichment
- - plotCellTypesFromEnrichment
- - plotCellProximityFeatSpot
- - showCellProportionSwitchedPie
- - showCellProportionSwitchedSanKey
- - spatCellCellcomSpots
-- title: Cell Neighborhood, Spatial Interaction Changed Features (ICF)
- desc: Identify and visualize features (genes) that change in a source cell type due to interaction with another neighboring cell type.
-- contents:
- - findInteractionChangedFeats
- - findICF
- - findICFSpot
- - findICG
- - findCPG
- - filterInteractionChangedFeats
- - filterInteractionChangedGenes
- - filterICF
- - filterICFSpot
- - filterICG
- - plotICF
- - plotICFSpot
- - plotCellProximityFeats
- - plotCPF
- - combineInteractionChangedFeats
- - combineICF
- - plotCombineInteractionChangedFeats
- - plotInteractionChangedFeats
- - plotCombineICF
- - combineCPG
- - combineCellProximityGenes
- - combineICG
- - combineInteractionChangedGenes
- - findInteractionChangedGenes
- - spatialAutoCor
- - spdepAutoCorr
- - spatialSplitCluster
-- title: Cell Neighborhood, Ligand-Receptor Cell Communication
- desc: Functions to calculate and visualize cell-type/cell-type spatial enrichment or depletion.
-- contents:
- - combCCcom
- - exprCellCellcom
- - spatCellCellcom
- - plotCCcomDotplot
- - plotRankSpatvsExpr
- - plotRecovery
- - plotCCcomHeatmap
- - plotCombineCellCellCommunication
- - plotCombineCCcom
-- title: Subcellular
- desc: Functions to manipulate and visualize subcellular data.
-- contents:
- - addPolygonCells
- - GiottoClass::addGiottoPoints
- - GiottoClass::addGiottoPoints3D
- - GiottoClass::addGiottoPolygons
- - addVisiumPolygons
- - GiottoClass::addSpatialCentroidLocations
- - GiottoClass::addSpatialCentroidLocationsLayer
- - GiottoClass::calculateOverlapParallel
- - GiottoClass::calculateOverlapPolygonImages
- - GiottoClass::calculateOverlapRaster
- - GiottoClass::calculateOverlapSerial
- - GiottoClass::combineCellData
- - GiottoClass::combineFeatureData
- - GiottoClass::combineFeatureOverlapData
- - GiottoClass::createGiottoPoints
- - GiottoClass::createGiottoPolygonsFromDfr
- - GiottoClass::createGiottoPolygonsFromMask
- - GiottoClass::overlapToMatrix
- - GiottoClass::overlapImagesToMatrix
- - GiottoClass::overlapToMatrixMultiPoly
- - GiottoClass::smoothGiottoPolygons
- - GiottoVisuals::spatInSituPlotDensity
- - GiottoVisuals::spatInSituPlotHex
- - GiottoVisuals::spatInSituPlotPoints
- - showPolygonSizeInfluence
-- title: Segmentation
- desc: Function to segment cells in-tissue.
-- contents:
- - doCellSegmentation
-- title: Doublet Detection
- desc: Function to detect doublets in raw expression data.
-- contents:
- - doScrubletDetect
-- title: Interactive Visualizations
- desc:
-- contents:
- - cellProximitySpatPlot2D
- - cellProximityVisPlot
- - comparePolygonExpression
- - getCellsFromPolygon
- - plotInteractivePolygons
- - plotPolygons
- - plotInteractive3D
- - compareCellAbundance
- - exportGiottoViewer
-- title: Interoperability
- desc: Convert other type of objects into a Giotto object and vice versa.
-- contents:
- - GiottoClass::seuratToGiotto
- - GiottoClass::giottoToSeurat
- - GiottoClass::giottoToSpatialExperiment
- - GiottoClass::giottoToAnnData
- - GiottoClass::anndataToGiotto
- - GiottoClass::giottoMasterToSuite
- - convertEnsemblToGeneSymbol
diff --git a/codecov.yml b/codecov.yml
deleted file mode 100644
index 04c558599..000000000
--- a/codecov.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-comment: false
-
-coverage:
- status:
- project:
- default:
- target: auto
- threshold: 1%
- informational: true
- patch:
- default:
- target: auto
- threshold: 1%
- informational: true
diff --git a/vignettes/branches.Rmd b/vignettes/branches.Rmd
deleted file mode 100644
index 5f8ddae89..000000000
--- a/vignettes/branches.Rmd
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: "Branches"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Branches}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Giotto Suite
-
-The Suite branch of Giotto is the latest and extended version of Giotto and is under active development. Giotto Suite is focused on building a modular platform for analyzing spatial-omics technologies and strives to be interoperable with other popular spatial analysis tools and classes.
-
-Using established packages optimized for large(r) data, Giotto Suite adopts fast and memory efficient methods to create an interactive analysis. Click the logo below to learn more about the Giotto Suite branch.
-
-[![](images/branches/GiottoLogo.png){width="200px"}](https://drieslab.github.io/Giotto/articles/ecosystem.html)
-
-# Giotto Master
-
-The Master branch of Giotto is the original Giotto R package published in 2021 by Dries et al. in [Genome Biology](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-021-02286-2).
-
-Click the logo below to learn more about the Giotto Master branch.
-
-[![](images/branches/GiottoLogoMaster.png){width="200px"}](https://giottosuite.readthedocs.io/en/master/)
diff --git a/vignettes/codex_mouse_spleen.Rmd b/vignettes/codex_mouse_spleen.Rmd
deleted file mode 100644
index 0cbb5632f..000000000
--- a/vignettes/codex_mouse_spleen.Rmd
+++ /dev/null
@@ -1,569 +0,0 @@
----
-title: "Codex Mouse Spleen"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Codex Mouse Spleen}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Dataset explanation
-
-The CODEX data to run this tutorial can be found [here](https://github.com/drieslab/spatial-datasets/tree/master/data/2018_codex_spleen). Alternatively you can use the **getSpatialDataset** to automatically download this dataset like we do in this example.
-
-[Goltsev et al.](https://www.cell.com/cell/pdf/S0092-8674(18)30904-8.pdf) created a multiplexed datasets of normal and lupus (MRL/lpr) murine spleens using CODEX technique. The dataset consists of 30 protein markers from 734,101 single cells. In this tutorial, 83,787 cells from sample "BALBc-3" were
-selected for the analysis.
-
-
-# Set up Giotto environment
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure GiottoData, a small, helper module for tutorials, is installed.
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-
-# 1. Giotto global instructions and preparations
-
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-# 1. set working directory
-results_folder = 'path/to/result'
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-```
-
-
-
-```{r, eval=FALSE}
-# download data to working directory
-# use method = 'wget' if wget is available. This should be much faster.
-# if you run into authentication issues with wget, then add " extra = '--no-check-certificate' "
-getSpatialDataset(dataset = 'codex_spleen',
- directory = results_folder,
- method = 'wget')
-```
-
-
-```{r, eval=FALSE}
-# 1. (optional) set Giotto instructions
-instrs = createGiottoInstructions(show_plot = FALSE,
- save_plot = TRUE,
- save_dir = results_folder,
- python_path = my_python_path)
-
-# 2. create giotto object from provided paths ####
-expr_path = paste0(results_folder, "codex_BALBc_3_expression.txt.gz")
-loc_path = paste0(results_folder, "codex_BALBc_3_coord.txt")
-meta_path = paste0(results_folder, "codex_BALBc_3_annotation.txt")
-```
-
-
-# 2. Create Giotto object & process data
-
-
-```{r, eval=FALSE}
-# read in data information
-
-# expression info
-codex_expression = readExprMatrix(expr_path, transpose = F)
-# cell coordinate info
-codex_locations = data.table::fread(loc_path)
-# metadata
-codex_metadata = data.table::fread(meta_path)
-
-## stitch x.y tile coordinates to global coordinates
-xtilespan = 1344;
-ytilespan = 1008;
-# TODO: expand the documentation and input format of stitchTileCoordinates. Probably not enough information for new users.
-stitch_file = stitchTileCoordinates(location_file = codex_metadata,
- Xtilespan = xtilespan,
- Ytilespan = ytilespan)
-codex_locations = stitch_file[,.(Xcoord, Ycoord)]
-
-# create Giotto object
-codex_test <- createGiottoObject(expression = codex_expression,
- spatial_locs = codex_locations,
- instructions = instrs)
-
-codex_metadata$cell_ID <- as.character(codex_metadata$cellID)
-codex_test <- addCellMetadata(codex_test, new_metadata = codex_metadata,
- by_column = T,
- column_cell_ID = "cell_ID")
-
-# subset Giotto object
-cell_meta = pDataDT(codex_test)
-cell_IDs_to_keep = cell_meta[Imaging_phenotype_cell_type != "dirt" & Imaging_phenotype_cell_type != "noid" & Imaging_phenotype_cell_type != "capsule",]$cell_ID
-
-codex_test = subsetGiotto(codex_test,
- cell_ids = cell_IDs_to_keep)
-
-## filter
-codex_test <- filterGiotto(gobject = codex_test,
- expression_threshold = 1,
- feat_det_in_min_cells = 10,
- min_det_feats_per_cell = 2,
- expression_values = c('raw'),
- verbose = T)
-
-codex_test <- normalizeGiotto(gobject = codex_test,
- scalefactor = 6000,
- verbose = T,
- log_norm = FALSE,
- library_size_norm = FALSE,
- scale_feats = FALSE,
- scale_cells = TRUE)
-
-## add gene & cell statistics
-codex_test <- addStatistics(gobject = codex_test,expression_values = "normalized")
-
-## adjust expression matrix for technical or known variables
-codex_test <- adjustGiottoMatrix(gobject = codex_test,
- expression_values = c('normalized'),
- batch_columns = 'sample_Xtile_Ytile',
- covariate_columns = NULL,
- return_gobject = TRUE,
- update_slot = c('custom'))
-
-## visualize
-spatPlot(gobject = codex_test,point_size = 0.1,
- coord_fix_ratio = NULL,point_shape = 'no_border',
- save_param = list(save_name = '2_a_spatPlot'))
-```
-
-
-![](images/codex_mouse_spleen/2_a_spatPlot.png)
-
-Show different regions of the dataset
-
-
-```{r, eval=FALSE}
-spatPlot(gobject = codex_test,
- point_size = 0.2,
- coord_fix_ratio = 1,
- cell_color = 'sample_Xtile_Ytile',
- legend_symbol_size = 3,
- legend_text = 5,
- save_param = list(save_name = '2_b_spatPlot'))
-```
-
-![](images/codex_mouse_spleen/2_b_spatPlot.png)
-
-# 3. Dimension reduction
-
-```{r, eval=FALSE}
-# use all Abs
-
-# PCA
-codex_test <- runPCA(gobject = codex_test,
- expression_values = 'normalized',
- scale_unit = T,
- method = "factominer")
-signPCA(codex_test,
- scale_unit = T,
- scree_ylim = c(0, 3),
- save_param = list(save_name = '3_a_spatPlot'))
-```
-
-![](images/codex_mouse_spleen/3_a_spatPlot.png)
-
-```{r, eval=FALSE}
-plotPCA(gobject = codex_test,
- point_shape = 'no_border',
- point_size = 0.2,
- save_param = list(save_name = '3_b_PCA'))
-```
-
-![](images/codex_mouse_spleen/3_b_PCA.png)
-
-```{r, eval=FALSE}
-# UMAP
-codex_test <- runUMAP(codex_test,
- dimensions_to_use = 1:14,
- n_components = 2,
- n_threads = 12)
-
-plotUMAP(gobject = codex_test,
- point_shape = 'no_border',
- point_size = 0.2,
- save_param = list(save_name = '3_c_UMAP'))
-```
-
-![](images/codex_mouse_spleen/3_c_UMAP.png)
-
-# 4. Cluster
-
-```{r, eval=FALSE}
-## sNN network (default)
-codex_test <- createNearestNetwork(gobject = codex_test,
- dimensions_to_use = 1:14,
- k = 20)
-
-## 0.1 resolution
-codex_test <- doLeidenCluster(gobject = codex_test,
- resolution = 0.5,
- n_iterations = 100,
- name = 'leiden')
-
-codex_metadata = pDataDT(codex_test)
-leiden_colors = getDistinctColors(length(unique(codex_metadata$leiden)))
-names(leiden_colors) = unique(codex_metadata$leiden)
-
-plotUMAP(gobject = codex_test,
- cell_color = 'leiden',
- point_shape = 'no_border',
- point_size = 0.2,
- cell_color_code = leiden_colors,
- save_param = list(save_name = '4_a_UMAP'))
-```
-
-![](images/codex_mouse_spleen/4_a_UMAP.png)
-
-```{r, eval=FALSE}
-spatPlot(gobject = codex_test,
- cell_color = 'leiden',
- point_shape = 'no_border',
- point_size = 0.2,
- cell_color_code = leiden_colors,
- coord_fix_ratio = 1,
- label_size =2,
- legend_text = 5,
- legend_symbol_size = 2,
- save_param = list(save_name = '4_b_spatplot'))
-```
-
-![](images/codex_mouse_spleen/4_b_spatplot.png)
-
-# 5. Co-visualize
-
-```{r, eval=FALSE}
-spatDimPlot2D(gobject = codex_test,
- cell_color = 'leiden',
- spat_point_shape = 'no_border',
- spat_point_size = 0.2,
- dim_point_shape = 'no_border',
- dim_point_size = 0.2,
- cell_color_code = leiden_colors,
- plot_alignment = c("horizontal"),
- save_param = list(save_name = '5_a_spatdimplot'))
-```
-
-![](images/codex_mouse_spleen/5_a_spatdimplot.png)
-
-# 6. Differential expression
-
-```{r, eval=FALSE}
-cluster_column = 'leiden'
-
-markers_scran = findMarkers_one_vs_all(gobject=codex_test,
- method="scran",
- expression_values="normalized",
- cluster_column=cluster_column,
- min_feats=3)
-
-markergenes_scran = unique(markers_scran[, head(.SD, 5), by="cluster"][["feats"]])
-
-plotMetaDataHeatmap(codex_test,
- expression_values = "normalized",
- metadata_cols = c(cluster_column),
- selected_feats = markergenes_scran,
- y_text_size = 8,
- show_values = 'zscores_rescaled',
- save_param = list(save_name = '6_a_metaheatmap'))
-```
-
-![](images/codex_mouse_spleen/6_a_metaheatmap.png)
-
-```{r, eval=FALSE}
-topgenes_scran = markers_scran[, head(.SD, 1), by = 'cluster']$feats
-
-violinPlot(codex_test,
- feats = unique(topgenes_scran)[1:8],
- cluster_column = cluster_column,
- strip_text = 8,
- strip_position = 'right',
- save_param = list(save_name = '6_b_violinplot'))
-```
-
-![](images/codex_mouse_spleen/6_b_violinplot.png)
-
-```{r, eval=FALSE}
-# gini
-markers_gini = findMarkers_one_vs_all(gobject = codex_test,
- method = "gini",
- expression_values = "normalized",
- cluster_column = cluster_column,
- min_feats=5)
-
-markergenes_gini = unique(markers_gini[, head(.SD, 5), by = "cluster"][["feats"]])
-
-plotMetaDataHeatmap(codex_test,
- expression_values = "normalized",
- metadata_cols = c(cluster_column),
- selected_feats = markergenes_gini,
- show_values = 'zscores_rescaled',
- save_param = list(save_name = '6_c_metaheatmap'))
-```
-
-![](images/codex_mouse_spleen/6_c_metaheatmap.png)
-
-```{r, eval=FALSE}
-topgenes_gini = markers_gini[, head(.SD, 1), by = 'cluster']$feats
-
-violinPlot(codex_test,
- feats = unique(topgenes_gini),
- cluster_column = cluster_column,
- strip_text = 8,
- strip_position = 'right',
- save_param = list(save_name = '6_d_violinplot'))
-```
-
-![](images/codex_mouse_spleen/6_d_violinplot.png)
-
-# 7. Cell type annotation
-
-```{r, eval=FALSE}
-clusters_cell_types <- c("naive B cells","B cells","B cells","naive B cells","B cells",
- "macrophages","erythroblasts","erythroblasts","erythroblasts","CD8 + T cells",
- "Naive T cells","CD4+ T cells","Naive T cells", "CD4+ T cells","Dendritic cells",
- "NK cells","Dendritic cells","Plasma cells","endothelial cells","monocytes")
-
-names(clusters_cell_types) = c(2,15,13,5,8,9,19,1,10,3,12,14,4,6,7,16,17,18,11,20)
-
-codex_test = annotateGiotto(gobject = codex_test,
- annotation_vector = clusters_cell_types,
- cluster_column = 'leiden',
- name = 'cell_types')
-
-plotUMAP(gobject = codex_test,
- cell_color = 'cell_types',
- point_shape = 'no_border',
- point_size = 0.2,
- show_center_label = F,
- label_size = 2,
- legend_text = 5,
- legend_symbol_size = 2,
- save_param = list(save_name = '7_a_umap_celltypes'))
-```
-
-![](images/codex_mouse_spleen/7_a_umap_celltypes.png)
-
-Or, this dataset comes with the imaging phenotype annotation
-
-```{r, eval=FALSE}
-plotUMAP(gobject = codex_test,
- cell_color = 'Imaging_phenotype_cell_type',
- point_shape = 'no_border',
- point_size = 0.2,
- show_center_label = F,
- label_size = 2,
- legend_text = 5,
- legend_symbol_size = 2,
- save_param = list(save_name = '7_b_umap'))
-```
-
-![](images/codex_mouse_spleen/7_b_umap.png)
-
-```{r, eval=FALSE}
-spatPlot(gobject = codex_test,
- cell_color = 'Imaging_phenotype_cell_type',
- point_shape = 'no_border',
- point_size = 0.2,
- coord_fix_ratio = 1,
- label_size = 2,
- legend_text = 5,
- legend_symbol_size = 2,
- save_param = list(save_name = '7_c_spatplot'))
-```
-
-![](images/codex_mouse_spleen/7_c_spatplot.png)
-
-# 8. Visualize cell types and gene expression in selected zones
-
-```{r, eval=FALSE}
-cell_metadata = pDataDT(codex_test)
-subset_cell_ids = cell_metadata[sample_Xtile_Ytile=="BALBc-3_X04_Y08"]$cell_ID
-
-codex_test_zone1 = subsetGiotto(codex_test,
- cell_ids = subset_cell_ids)
-
-plotUMAP(gobject = codex_test_zone1,
- cell_color = 'Imaging_phenotype_cell_type',
- point_shape = 'no_border',
- point_size = 1,
- show_center_label = F,
- label_size = 2,
- legend_text = 5,
- legend_symbol_size = 2,
- save_param = list(save_name = '8_a_umap'))
-```
-
-![](images/codex_mouse_spleen/8_a_umap.png)
-
-```{r, eval=FALSE}
-spatPlot(gobject = codex_test_zone1,
- cell_color = 'Imaging_phenotype_cell_type',
- point_shape = 'no_border',
- point_size = 1,
- coord_fix_ratio = 1,
- label_size = 2,
- legend_text = 5,
- legend_symbol_size = 2,
- save_param = list(save_name = '8_b_spatplot'))
-```
-
-![](images/codex_mouse_spleen/8_b_spatplot.png)
-
-```{r, eval=FALSE}
-spatDimFeatPlot2D(codex_test_zone1,
- expression_values = 'scaled',
- feats = c("CD8a","CD19"),
- spat_point_shape = 'no_border',
- dim_point_shape = 'no_border',
- cell_color_gradient = c("darkblue", "white", "red"),
- save_param = list(save_name = '8_c_spatdimplot'))
-```
-
-![](images/codex_mouse_spleen/8_c_spatdimplot.png)
-
-Test on another region:
-
-```{r, eval=FALSE}
-cell_metadata = pDataDT(codex_test)
-
-subset_cell_ids = cell_metadata[sample_Xtile_Ytile=="BALBc-3_X04_Y03"]$cell_ID
-
-codex_test_zone2 = subsetGiotto(codex_test,
- cell_ids = subset_cell_ids)
-
-plotUMAP(gobject = codex_test_zone2,
- cell_color = 'Imaging_phenotype_cell_type',
- point_shape = 'no_border',
- point_size = 1,
- show_center_label = F,
- label_size = 2,
- legend_text = 5,
- legend_symbol_size = 2,
- save_param = list(save_name = '8_d_umap'))
-```
-
-![](images/codex_mouse_spleen/8_d_umap.png)
-
-```{r, eval=FALSE}
-spatPlot(gobject = codex_test_zone2,
- cell_color = 'Imaging_phenotype_cell_type',
- point_shape = 'no_border',
- point_size = 1,
- coord_fix_ratio = 1,
- label_size = 2,
- legend_text = 5,
- legend_symbol_size = 2,
- save_param = list(save_name = '8_e_spatPlot'))
-```
-
-![](images/codex_mouse_spleen/8_e_spatPlot.png)
-
-```{r, eval=FALSE}
-spatDimFeatPlot2D(codex_test_zone2,
- expression_values = 'scaled',
- feats = c("CD4", "CD106"),
- spat_point_shape = 'no_border',
- dim_point_shape = 'no_border',
- cell_color_gradient = c("darkblue", "white", "red"),
- save_param = list(save_name = '8_f_spatdimgeneplot'))
-```
-
-![](images/codex_mouse_spleen/8_f_spatdimgeneplot.png)
-
-# 9. Session info
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.3.1
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] GiottoData_0.2.6.2 GiottoUtils_0.1.5 Giotto_4.0.2 GiottoClass_0.1.3
-
-loaded via a namespace (and not attached):
- [1] colorRamp2_0.1.0 bitops_1.0-7 rlang_1.1.3
- [4] magrittr_2.0.3 RcppAnnoy_0.0.22 matrixStats_1.2.0
- [7] compiler_4.3.2 DelayedMatrixStats_1.24.0 png_0.1-8
- [10] systemfonts_1.0.5 vctrs_0.6.5 pkgconfig_2.0.3
- [13] SpatialExperiment_1.12.0 crayon_1.5.2 fastmap_1.1.1
- [16] backports_1.4.1 magick_2.8.2 XVector_0.42.0
- [19] scuttle_1.12.0 labeling_0.4.3 utf8_1.2.4
- [22] rmarkdown_2.25 ragg_1.2.7 bluster_1.12.0
- [25] xfun_0.42 beachmat_2.18.0 zlibbioc_1.48.0
- [28] GenomeInfoDb_1.38.6 jsonlite_1.8.8 flashClust_1.01-2
- [31] pak_0.7.1 DelayedArray_0.28.0 BiocParallel_1.36.0
- [34] terra_1.7-71 irlba_2.3.5.1 parallel_4.3.2
- [37] cluster_2.1.6 R6_2.5.1 RColorBrewer_1.1-3
- [40] limma_3.58.1 reticulate_1.35.0 GenomicRanges_1.54.1
- [43] estimability_1.4.1 Rcpp_1.0.12 SummarizedExperiment_1.32.0
- [46] knitr_1.45 R.utils_2.12.3 IRanges_2.36.0
- [49] igraph_2.0.1.1 Matrix_1.6-5 tidyselect_1.2.0
- [52] rstudioapi_0.15.0 abind_1.4-5 yaml_2.3.8
- [55] codetools_0.2-19 lattice_0.22-5 tibble_3.2.1
- [58] Biobase_2.62.0 withr_3.0.0 evaluate_0.23
- [61] pillar_1.9.0 MatrixGenerics_1.14.0 checkmate_2.3.1
- [64] DT_0.31 stats4_4.3.2 dbscan_1.1-12
- [67] generics_0.1.3 RCurl_1.98-1.14 S4Vectors_0.40.2
- [70] ggplot2_3.4.4 sparseMatrixStats_1.14.0 munsell_0.5.0
- [73] scales_1.3.0 gtools_3.9.5 xtable_1.8-4
- [76] leaps_3.1 glue_1.7.0 metapod_1.10.1
- [79] emmeans_1.10.0 scatterplot3d_0.3-44 tools_4.3.2
- [82] GiottoVisuals_0.1.4 BiocNeighbors_1.20.2 data.table_1.15.0
- [85] ScaledMatrix_1.10.0 locfit_1.5-9.8 scran_1.30.2
- [88] mvtnorm_1.2-4 cowplot_1.1.3 grid_4.3.2
- [91] edgeR_4.0.14 colorspace_2.1-0 SingleCellExperiment_1.24.0
- [94] GenomeInfoDbData_1.2.11 BiocSingular_1.18.0 rsvd_1.0.5
- [97] cli_3.6.2 textshaping_0.3.7 fansi_1.0.6
-[100] S4Arrays_1.2.0 dplyr_1.1.4 uwot_0.1.16
-[103] gtable_0.3.4 R.methodsS3_1.8.2 digest_0.6.34
-[106] progressr_0.14.0 BiocGenerics_0.48.1 dqrng_0.3.2
-[109] SparseArray_1.2.3 ggrepel_0.9.5 FactoMineR_2.9
-[112] rjson_0.2.21 htmlwidgets_1.6.4 farver_2.1.1
-[115] htmltools_0.5.7 R.oo_1.26.0 lifecycle_1.0.4
-[118] multcompView_0.1-9 statmod_1.5.0 MASS_7.3-60.0.1
-```
-
-
diff --git a/vignettes/configuration.Rmd b/vignettes/configuration.Rmd
deleted file mode 100644
index c98623cc2..000000000
--- a/vignettes/configuration.Rmd
+++ /dev/null
@@ -1,325 +0,0 @@
----
-title: "Giotto Configuration"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Giotto Configuration}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-# 1. Configuring the Giotto Environment
-
-Giotto contains several functions that contain wrappers to Python code and thus requires an environment containing Python. Utilizing the functionality of the [reticulate](https://rstudio.github.io/reticulate/) package, Giotto contains a function which sets up a miniconda environment and installs the required Python packages within that environment. Once this function, [installGiottoEnvironment](../md_rst/installGiottoEnvironment.html), has been run, Giotto will automatically default to utilizing this environment.
-
-# 2. Start Giotto
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-library(Giotto)
-
-# Ensure Giotto Data is installed
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-library(GiottoData)
-```
-
-
-```{r, eval=FALSE}
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- installGiottoEnvironment()
-}
-```
-
-
-The function [installGiottoEnvironment](../md_rst/installGiottoEnvironment.html) two particular arguments that are most useful for reinstallation, if necessary:
-
-- **force_miniconda**: force reinstallation of miniconda, default is FALSE
-- **force_environment**: force reinstallation of the Giotto environment, default is FALSE
-
-**Note that, by default,** [installGiottoEnvironment](../md_rst/installGiottoEnvironment.html) **installs a specific version of Python and each required package. At the time of this tutorial's creation, the following versions are utilized:**
-
-- [Python](https://www.python.org/) 3.10.2
-- [pandas](https://pandas.pydata.org/) 1.5.1
-- [networkx](https://networkx.org/) 2.8.8
-- [python-igraph](https://igraph.org/python/) 0.10.2
-- [leidenalg](https://leidenalg.readthedocs.io/en/latest/) 0.9.0
-- [python-louvain](https://python-louvain.readthedocs.io/en/latest/) 0.16
-- [python.app](https://github.com/conda-forge/python.app-feedstock) (Mac only) 1.4
-- [scikit-learn](https://scikit-learn.org/stable/) 1.1.3
-- [smfishHmrf](https://pypi.org/project/smfishHmrf/) 1.3.3
-
-# 3. Customizing the Giotto Installation
-
-If different versions of Python or packages are necessary for a workflow, Giotto may be installed accordingly. Ensure that all required packages, which have been listed above, are accounted for when installing. Simply specify the desired version numbers for each package within a vector, and provide that vector to the *packages_to_install* argument within **installGiottoEnvironment**.
-
-Note that machine type is not relevant when providing *packages_to_install* to **installGiottoEnvironment**; this function will identify the OS in use and install/not install packages (i.e. python.app) accordingly.
-
-
-```{r, eval=FALSE}
-### Note that the following code has been provided to indicate how to install
-### Giotto with customized Python and Python package versions. It has been
-### intentionally commented out so that it will not run and overwrite the
-### default versions unless deliberately edited.
-
-### new_pkg_versions <- c('pandas==1.4.4',
-### 'networkx==2.6.3',
-### 'python-igraph==0.9.6',
-### 'leidenalg==0.8.7',
-### 'python-louvain==0.15',
-### 'scikit-learn==0.24.2',
-### 'python.app==2')
-###
-### ############################
-### # If altering the original Giotto Installation is not desired, DO NOT
-### # run the following command as written.
-### ############################
-### installGiottoEnvironment(packages_to_install = new_pkg_versions,
-### python_version = '3.8') # Default is 3.10.2
-```
-
-
-# 4. Advanced: Using a non-default Conda Environment with Giotto
-
-If using [reticulate\'s](https://rstudio.github.io/reticulate/) default miniconda path to create an environment is undesirable, the Giotto environment may be created within an existing anaconda/miniconda environment by specifying the `mini_install_path` argument:
-
-
-```{r, eval=FALSE}
-installGiottoEnvironment(mini_install_path = "C:/my/conda/lives/here")
-```
-
-
-If not provided, it is chosen by [reticulate::install_miniconda()](https://rstudio.github.io/reticulate/reference/conda-tools.html#finding-conda-1). Please note the required input format: - **Correct format:** mini_install_path = "C:/my/conda/lives/here" OR
-"C:\\my\\conda\\lives\\here" - **INCORRECT formats:** mini_install_path = "C:/my/conda/lives/here/" AND "C:\\my\\conda\\lives\\here\\"
-
-Unexpected behavior could arise if `force_miniconda` is set to `TRUE` when `mini_install_path` is specified and encompasses a non-reticulate environment, as this prompts a reticulate miniconda installation.
-
-**Note that the installation of all aforementioned packages is necessary for the full functionality of Giotto**. A .yml file is provided in the repository for convenience of alternative installation methods. If the desired environment is not named "giotto_env", Giotto will be unable to automatically detect the conda environment, so it must be specified within a workflow. To use a specific, non-default named Conda environment, the path to a system-specific python executable within that environment must be provided to [createGiottoInstructions](../md_rst/createGiottoInstructions.html). This will direct reticulate to activate and utilize that environment within that R session. See [How to Create a Giotto
-Object](./getting_started_gobject.html) for more details.
-
-# 5. Package Accessibility
-
-Giotto makes use of the following Python packages (and their respective dependencies) for full functionality:
-
-- [pandas](https://pandas.pydata.org/)
-- [networkx](https://networkx.org/)
-- [python-igraph](https://igraph.org/python/)
-- [leidenalg](https://leidenalg.readthedocs.io/en/latest/)
-- [python-louvain](https://python-louvain.readthedocs.io/en/latest/)
-- [python.app](https://github.com/conda-forge/python.app-feedstock) (Mac only)
-- [scikit-learn](https://scikit-learn.org/stable/)
-- [smfishHmrf](https://pypi.org/project/smfishHmrf/)
-
-Here is a brief troubleshooting workflow to investigate if [reticulate](https://rstudio.github.io/reticulate/) can access them.
-
-*Note that "community" and "sklearn" are aliases of "python-louvain" and "scikit-learn", respectively.*
-
-
-```{r, eval=FALSE}
-# Creating Giotto Instructions without specifying a Python path will make
-# reticulate activate the default Giotto environment.
-default_instrs <- createGiottoInstructions()
-
-# Extract python path information
-default_python_path <- default_instrs$python_path
-
-# Make reticulate iteratively check for the packages
-pkg_check <- function(){
- py_pkgs = c('pandas','networkx', 'igraph', 'leidenalg','community','sklearn','python.app')
- py_pkg_error = character()
- test_availability = TRUE
-
- for (i in py_pkgs){
- if(i == 'python.app' & Sys.info()[['sysname']] != "Darwin"){
- # If the machine OS is not OSX (Mac), break out of the loop
- # Otherwise, also check for python.app
- break
- }
- test_availability <- reticulate::py_module_available(i)
- if(!test_availability) {py_pkg_error <- c(py_pkg_error,i)}
- }
-
- if(test_availability){
- cat('All Python packages for Giotto are accessible at environment:\n', default_python_path)
- }else{
- for (x in py_pkg_error) cat(x,'was not found within environment:\n',default_python_path,'\n\n')
- }
-
- return(py_pkg_error)
-}
-
-pkg_check()
-```
-
-
-# 6. Troubleshooting Packages not Found
-
-
-```{r, eval=FALSE}
-# Restart the R session, while maintaining workspace variables.
-# If using RStudio, the following command will do exactly that:
-.rs.restartR()
-
-# Direct reticulate to use Python within the Giotto Environment
-reticulate::use_python(default_python_path)
-
-# Check if packages exist again. Ensure function from above code block is defined.
-missing_packages <- pkg_check()
-
-retry_install <- length(missing_packages) > 0
-
-if(retry_install){
-
- # Attempt to reinstall all packages.
- pkgs_w_versions <- c('pandas==1.5.1',
- 'networkx==2.8.8',
- 'python-igraph==0.10.2',
- 'leidenalg==0.9.0',
- 'python-louvain==0.16',
- 'python.app==1.4',
- 'scikit-learn==1.1.3')
-
- python_version = "3.10.2"
-
- py_pkgs = c('pandas','networkx',
- 'igraph', 'leidenalg',
- 'python-louvain','scikit-learn','python.app')
-
- if(Sys.info()[['sysname']] != "Darwin"){
- pkgs_w_versions = pkgs_w_versions[!grepl(pattern = 'python.app', x = pkgs_w_versions)]
- py_pkgs = py_pkgs[!grepl(pattern = 'python.app', x = py_pkgs)]
- }
-
- env_location <- reticulate::py_discover_config()$pythonhome
- partial_path_to_conda <- paste0(reticulate::miniconda_path(),'/envs/giotto_env')
-
- py_lou = pkgs_w_versions[grepl(pattern = 'python-louvain',x = pkgs_w_versions)]
- pip_packages = c("smfishhmrf", py_lou)
- pkgs_w_versions = pkgs_w_versions[!grepl(pattern = 'python-louvain',x = pkgs_w_versions)]
-
- if(.Platform[['OS.type']] == 'unix') {
-
- conda_full_path = paste0(partial_path_to_conda,'/','bin/conda')
-
- # Remove all previous installations
- reticulate::conda_remove(envname = env_location,
- packages = py_pkgs,
- conda = conda_full_path)
-
- # Reinstall
- reticulate::conda_install(packages = pkgs_w_versions,
- envname = env_location,
- method = 'conda',
- conda = conda_full_path,
- python_version = python_version)
-
- # Reinstall with pip
- reticulate::conda_install(packages = pip_packages,
- envname = env_location,
- method = 'conda',
- conda = conda_full_path,
- pip = TRUE,
- python_version = python_version)
- }
- else if(.Platform[['OS.type']] == 'windows'){
- conda_full_path = paste0(partial_path_to_conda,'/','condabin/conda.bat')
-
- # Remove all previous installations
- reticulate::conda_remove(envname = env_location,
- packages = py_pkgs,
- conda = conda_full_path)
-
- # Reinstall
- reticulate::conda_install(packages = pkgs_w_versions,
- envname = env_location,
- method = 'conda',
- conda = conda_full_path,
- python_version = python_version,
- channel = c('conda-forge', 'vtraag'))
-
- # Reinstall with pip
- reticulate::conda_install(packages = pip_packages,
- envname = env_location,
- method = 'conda',
- conda = conda_full_path,
- pip = TRUE,
- python_version = python_version)
- }
-}
-```
-
-
-If this does not fix the issue at hand, here are some potential action items:
-
-- Remove and attempt to reinstall the Giotto environment.
-- Run [removeGiottoEnvironment](../md_rst/removeGiottoEnvironment.html), then terminate R.
-- Open a completely new R session, and run [installGiottoEnvironment](../md_rst/installGiottoEnvironment.html)
-- Post to an issue to the Giotto GitHub page [here](https://github.com/drieslab/Giotto).
-- Please include the version numbers of R, Giotto, and the OS in use at the time of the issue.
-
-# 7. Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.3.1
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] Giotto_4.0.2 GiottoClass_0.1.3
-
-loaded via a namespace (and not attached):
- [1] SummarizedExperiment_1.32.0 gtable_0.3.4 rjson_0.2.21
- [4] xfun_0.42 ggplot2_3.4.4 Biobase_2.62.0
- [7] lattice_0.22-5 vctrs_0.6.5 tools_4.3.2
-[10] bitops_1.0-7 generics_0.1.3 parallel_4.3.2
-[13] stats4_4.3.2 tibble_3.2.1 fansi_1.0.6
-[16] colorRamp2_0.1.0 pkgconfig_2.0.3 Matrix_1.6-5
-[19] checkmate_2.3.1 data.table_1.15.0 S4Vectors_0.40.2
-[22] lifecycle_1.0.4 GenomeInfoDbData_1.2.11 compiler_4.3.2
-[25] GiottoUtils_0.1.5 munsell_0.5.0 terra_1.7-71
-[28] codetools_0.2-19 GenomeInfoDb_1.38.6 htmltools_0.5.7
-[31] RCurl_1.98-1.14 yaml_2.3.8 pillar_1.9.0
-[34] crayon_1.5.2 SingleCellExperiment_1.24.0 DelayedArray_0.28.0
-[37] magick_2.8.2 abind_1.4-5 gtools_3.9.5
-[40] tidyselect_1.2.0 digest_0.6.34 dplyr_1.1.4
-[43] rprojroot_2.0.4 fastmap_1.1.1 grid_4.3.2
-[46] here_1.0.1 colorspace_2.1-0 cli_3.6.2
-[49] SparseArray_1.2.3 magrittr_2.0.3 S4Arrays_1.2.0
-[52] utf8_1.2.4 withr_3.0.0 backports_1.4.1
-[55] scales_1.3.0 rmarkdown_2.25 XVector_0.42.0
-[58] matrixStats_1.2.0 reticulate_1.35.0 GiottoVisuals_0.1.4
-[61] png_0.1-8 SpatialExperiment_1.12.0 evaluate_0.23
-[64] knitr_1.45 GenomicRanges_1.54.1 IRanges_2.36.0
-[67] rlang_1.1.3 Rcpp_1.0.12 glue_1.7.0
-[70] BiocGenerics_0.48.1 rstudioapi_0.15.0 jsonlite_1.8.8
-[73] R6_2.5.1 MatrixGenerics_1.14.0 zlibbioc_1.48.0
-```
diff --git a/vignettes/contributing.Rmd b/vignettes/contributing.Rmd
deleted file mode 100644
index 20fd3ef92..000000000
--- a/vignettes/contributing.Rmd
+++ /dev/null
@@ -1,155 +0,0 @@
----
-title: "How to Contribute?"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{How to Contribute?}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-We welcome contributions or suggestions from other developers. Please contact us if you have questions or would like to discuss an addition or major modifications to the Giotto main code.
-The source code for Giotto Suite may be found on our [GitHub repository](https://github.com/drieslab/Giotto/).
-
-
-# Coding Style
-
-Following a particular programming style will help programmers read and understand source code conforming to the style, and help to avoid introducing errors. Here we present a small list of guidelines on what is considered a good practice when writing R codes in Giotto package. Most of them are adapted from [Bioconductor - coding style](https://bioconductor.org/developers/how-to/coding-style/) or [Google's R Style Guide](https://google.github.io/styleguide/Rguide.xml). These guidelines are preferences and strongly encouraged!
-
-- **Naming**
- - Use camelCase for Giotto user-facing exported function names. (`functionName()`)
- - Use snake_case for non-user-facing exported functions, which are essentially any functions not directly related to commonly used data processing, analysis, and visualization. (`function_name()`)
- - Use "." prefix and snake_case for internal non-exported functions. (`.function_name()`)
- - Use snake_case for parameter names.
- - Do not use "." as a separator in function naming. (in the S3 class system, some(x) where x is class A will dispatch to some.A)
-
-- **Use of space**
- - Do not place a space before a comma, but always place one after a comma. This: `a, b, c`.
- - Always use space around “=” when using named arguments to functions. This: `somefunc(a = 1, b = 2)`.
-
-- **Use of symbols**
- - Do not use any non-UTF-8 characters unless provided as the escape code. For example: `'\u00F6'` for `ö`
-
-Beyond these guidelines, [*styler*](https://github.com/r-lib/styler) should be used in order to maintain code uniformity.
-
-
-# Stat functions
-
-Most Giotto commands can accept several matrix classes (DelayedMatrix, SparseM, Matrix or base matrix). To
-facilitate this we provide **flexible** wrappers that work on any type of matrix class.
-
-- **mean_flex**: analogous to mean()
-- **rowSums_flex**: analogous to rowSums()
-- **rowMeans_flex**: analogous to rowMeans()
-- **colSums_flex**: analogous to colSums()
-- **colMeans_flex**: analogous to colMeans()
-- **t_flex**: analogous to t()
-- **cor_flex**: analogous to cor()
-
-
-
-# Auxiliary functions
-
-Giotto has a number of auxiliary or convenience functions that might help you to adapt your code or write new code for Giotto. We encourage you to use these small functions to maintain uniformity throughout the code.
-
-- **lapply_flex**: analogous to lapply() and works for both windows and unix systems
-- **all_plots_save_function**: compatible with Giotto instructions and helps to automatically save generated plots
-- **plot_output_handler**: further wraps `all_plots_save_function` and includes handling for return_plot and show_plot and Giotto instructions checking
-- **determine_cores**: to determine the number of cores to use if a user does not set this explicitly
-- **get_os**: to identify the operating system
-- **update_giotto_params**: will catch and store the parameters for each used command on a giotto object
-- **wrap_txt** and **wrap_msg**: text and message formatting functions
-- **vmsg**: framework for Giotto's verbosity-flagged messages
-- **package_check**: to check if a package exists, works for packages on CRAN, Bioconductor and Github
-
-The last function should be used within your contribution code. It has the additional benefit that it will suggest the user how to download the package if it is not available. To keep the size of Giotto within limits we prefer not to add too many new dependencies.
-
-
-# Package Imports
-
-Giotto tracks packages and functions to import in a centralized manner. When adding code that requires functions from another package, add the roxygen tags to the `package_imports.R` file for that Giotto module.
-
-
-# Getters and Setters
-
-Giotto stores information in different [slots](articles/structure.html#giotto-object-structure), which can be accessed through these getters and setters functions. They can be found in the [accessors.R](https://github.com/drieslab/Giotto/blob/suite/R/accessors.R) file.
-
-- **getCellMetadata()**: Gets cell metadata
-- **setCellMetadata()**: Sets cell metadata
-
-- **getFeatureMetadata()**: Gets feature metadata
-- **getFeatureMetadata()**: Sets feature metadata
-
-- **getExpression()**: To select the expression matrix to use
-- **setExpression()**: Sets a new expression matrix to the expression slot
-
-- **getSpatialLocations()**: Get spatial locations to use
-- **setSpatialLocations()**: Sets new spatial locations
-
-- **getDimReduction()**: To select the dimension reduction values to use
-- **setDimReduction()**: Sets new dimension reduction object
-
-- **getNearestNetwork()**: To select the nearest neighbor network (kNN or sNN) to use
-- **setNearestNetwork()**: Sets a new nearest neighbor network (kNN or sNN)
-
-- **getSpatialNetwork()**: To select the spatial network to use
-- **setSpatialNetwork()**: Sets a new spatial network
-
-- **getPolygonInfo()**: Gets spatial polygon information
-- **setPolygonInfo()**: Set new spatial polygon information
-
-- **getFeatureInfo()**: Gets spatial feature information
-- **setFeatureInfo()**: Sets new spatial feature information
-
-- **getSpatialEnrichment()**: Gets spatial enrichment information
-- **setSpatialEnrichment()**: Sets new spatial enrichment information
-
-- **getMultiomics()**: Gets multiomics information
-- **setMultiomics()**: Sets multiomics information
-
-
-# Python code
-
-To use Python code we prefer to create a python wrapper/functions around the python code, which can then be sourced by reticulate. As an example we show the basic principles of how we implemented the Leiden clustering algorithm.
-
-1. write python wrapper and store as python_leiden.py in */inst/python*:
-
-```
-import igraph as ig
-import leidenalg as la
-import pandas as pd
-import networkx as nx
-
-def python_leiden(df, partition_type, initial_membership=None, weights=None, n_iterations=2, seed=None, resolution_parameter = 1):
-
- # create networkx object
- Gx = nx.from_pandas_edgelist(df = df, source = 'from', target = 'to', edge_attr = 'weight')
-
- # get weight attribute
- myweights = nx.get_edge_attributes(Gx, 'weight')
-
- ....
-
- return(leiden_dfr)
-```
-
-
-2. source python code with reticulate:
-
-```
-python_leiden_function = system.file("python", "python_leiden.py", package = 'Giotto')
-reticulate::source_python(file = python_leiden_function)
-```
-
-3. use python code as if R code:
-See **doLeidenCLuster** for more detailed information.
-
-```
- pyth_leid_result = python_leiden(df = network_edge_dt,
- partition_type = partition_type,
- initial_membership = init_membership,
- weights = 'weight',
- n_iterations = n_iterations,
- seed = seed_number,
- resolution_parameter = resolution)
-```
-
diff --git a/vignettes/docker.Rmd b/vignettes/docker.Rmd
deleted file mode 100644
index 550d3654e..000000000
--- a/vignettes/docker.Rmd
+++ /dev/null
@@ -1,51 +0,0 @@
----
-title: "Docker images"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Docker images}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# 1. Docker Image with RStudio
-
-We have set up a [Docker Image](https://hub.docker.com/r/giottopackage/rstudio_suite) linked to RStudio with Giotto pre-installed.
-
-## Instructions
-
-Follow these instructions to create your own Docker container and run
-Giotto:
-
-1. docker pull `giottopackage/rstudio_suite:latest`
-2. docker run
- `--rm -p 8787:8787 -e PASSWORD=mypassword giottopackage/rstudio_suite:latest`
- 1. You may use *any* port as long as it is not in use.
- 2. You can set the password to *whatever* you like.
-3. Open the browser of your choice and enter
- [localhost:yourport]{.title-ref}.
- 1. Where yourport is either 8787 or the port you assigned it in
- step 2.
-4. You will be directed to an RStudio login.
- 1. Username: rstudio
- 2. Password: mypassword
- - **Note**: The password you enter will be whatever you
- declared in step 2.
-5. Run the following **in RStudio**:
- 1. library(Giotto)
-6. Now you can run any analysis with Giotto!
-
-# 2. Docker Image with bash terminal
-
-If you prefer to run your analysis directly on the terminal, we have set up a [Docker Image](https://hub.docker.com/r/giottopackage/suite) able to run in a bash environment.
-
-## Instructions
-
-Follow these instructions to create your own Docker container and run
-Giotto:
-
-1. docker pull `giottopackage/suite:latest`
-2. docker run `-ti giottopackage/suite:latest /bin/bash`
-3. R
-4. Run the following **in R**:
- 1. library(Giotto)
-5. Now you can run any analysis with Giotto!
diff --git a/vignettes/ecosystem.Rmd b/vignettes/ecosystem.Rmd
deleted file mode 100644
index 4ef1a3253..000000000
--- a/vignettes/ecosystem.Rmd
+++ /dev/null
@@ -1,200 +0,0 @@
----
-title: "Giotto Ecosystem"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Giotto Ecosystem}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-# 1. Explanation
-
-We plan to curate an ecosystem of different, related packages to modularize Giotto Suite as we extend its functionalities. Here, we detail some different helper module(s) within the Giotto Ecosystem.
-
-
-```{r, echo=FALSE, fig.align='center', out.width='60%'}
-knitr::include_graphics("images/ecosystem/modules.png")
-```
-
-
-# 2. GiottoClass
-
-This package contains the Giotto object and subobject class definitions and frameworks. Functionalities relating to data ingestion, basic object creation, data access within the Giotto object, and generics defined for the Giotto classes are all found here.
-
-Applications of this framework and convenience functions for loading specific technologies are found in the base Giotto package.
-
-Find more information [here](https://drieslab.github.io/GiottoClass/)
-
-To install GiottoClass run:
-
-```{r, eval=FALSE}
-pak::pkg_install('drieslab/GiottoClass')
-```
-
-# 3. GiottoUtils
-
-GiottoUtils exports functionalities that are called internally by many of the other packages in the Giotto ecosystem. These range from things such as commonly used imports to pretty prints. Users should not need to directly interact with this package.
-
-Find more information [here](https://drieslab.github.io/GiottoUtils/)
-
-To install GiottoUtils run:
-
-```{r, eval=FALSE}
-pak::pkg_install('drieslab/GiottoUtils')
-```
-
-# 4. GiottoVisuals
-
-GiottoVisuals contains the main plotting functions of Giotto Suite
-
-Find more information [here](https://drieslab.github.io/GiottoVisuals/)
-
-To install GiottoVisuals run:
-
-```{r, eval=FALSE}
-pak::pkg_install('drieslab/GiottoVisuals')
-```
-
-# 5. GiottoData
-
-This package depends on Giotto Suite and leverages various functions within it for saving and loading Giotto objects. It contains dataset helper functions `loadGiottoMini()` and `getSpatialDataset()`. **Note that** `getSpatialDataset()` **was moved from Giotto Suite to GiottoData!**
-
-In addition to dataset helpers, we have created mini Giotto Objects for testing Giotto Suite's capabilities rapidly and streamlining the tutorial experience. GiottoData currently includes two mini Giotto Objects which are derived from Vizgen and Visium data; more mini Giotto Objects will be published in the future. Further, we include mini objects, S4 subobjects of a Giotto Object (i.e. exprObj), in an effort to make the Giotto Object structure as transparent as possible.
-
-Find more information [here](https://drieslab.github.io/GiottoData/)
-
-To install GiottoData run:
-
-```{r, eval=FALSE}
-pak::pkg_install('drieslab/GiottoData')
-```
-
-
-The scripts used to create both the mini giotto objects and mini objects are available in the repository so that we may extend and/or improve them and that you may utilize them for your own purposes!
-
-## 5.1 Start Giotto
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-library(Giotto)
-
-# Ensure Giotto Data is installed
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-library(GiottoData)
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- installGiottoEnvironment()
-}
-```
-
-
-## 5.2 Create a Giotto object
-
-
-```{r, eval=FALSE}
-visium_mini = loadGiottoMini(dataset = 'visium')
-```
-
-
-# 6. Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
-
-R version 4.3.2 (2023-10-31)
-Platform: aarch64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.2.1
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/Mexico_City
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods
-[7] base
-
-other attached packages:
-[1] GiottoData_0.2.6.1 GiottoUtils_0.1.2 Giotto_4.0.2
-[4] GiottoClass_0.1.2
-
-loaded via a namespace (and not attached):
- [1] colorRamp2_0.1.0 DBI_1.2.0
- [3] bitops_1.0-7 biomaRt_2.58.0
- [5] rlang_1.1.2 magrittr_2.0.3
- [7] matrixStats_1.2.0 e1071_1.7-14
- [9] compiler_4.3.2 RSQLite_2.3.4
- [11] png_0.1-8 vctrs_0.6.5
- [13] stringr_1.5.1 pkgconfig_2.0.3
- [15] SpatialExperiment_1.12.0 crayon_1.5.2
- [17] fastmap_1.1.1 backports_1.4.1
- [19] dbplyr_2.4.0 magick_2.8.2
- [21] XVector_0.42.0 utf8_1.2.4
- [23] rmarkdown_2.25 purrr_1.0.2
- [25] bit_4.0.5 xfun_0.41
- [27] zlibbioc_1.48.0 cachem_1.0.8
- [29] jsonlite_1.8.8 GenomeInfoDb_1.38.5
- [31] progress_1.2.3 blob_1.2.4
- [33] rhdf5filters_1.14.1 gmp_0.7-3
- [35] DelayedArray_0.28.0 Rhdf5lib_1.24.1
- [37] terra_1.7-65 parallel_4.3.2
- [39] prettyunits_1.2.0 R6_2.5.1
- [41] stringi_1.8.3 reticulate_1.34.0
- [43] ClusterR_1.3.2 GenomicRanges_1.54.1
- [45] Rcpp_1.0.11 assertthat_0.2.1
- [47] SummarizedExperiment_1.32.0 knitr_1.45
- [49] IRanges_2.36.0 igraph_1.6.0
- [51] Matrix_1.6-4 tidyselect_1.2.0
- [53] yaml_2.3.8 rstudioapi_0.15.0
- [55] abind_1.4-5 codetools_0.2-19
- [57] curl_5.2.0 lattice_0.21-9
- [59] tibble_3.2.1 withr_2.5.2
- [61] Biobase_2.62.0 KEGGREST_1.42.0
- [63] evaluate_0.23 sf_1.0-15
- [65] units_0.8-5 proxy_0.4-27
- [67] BiocFileCache_2.10.1 xml2_1.3.6
- [69] Biostrings_2.70.1 pillar_1.9.0
- [71] filelock_1.0.3 MatrixGenerics_1.14.0
- [73] KernSmooth_2.23-22 checkmate_2.3.1
- [75] stats4_4.3.2 generics_0.1.3
- [77] RCurl_1.98-1.13 S4Vectors_0.40.2
- [79] hms_1.1.3 ggplot2_3.4.4
- [81] munsell_0.5.0 scales_1.3.0
- [83] class_7.3-22 glue_1.6.2
- [85] tools_4.3.2 GiottoVisuals_0.1.1
- [87] data.table_1.14.10 XML_3.99-0.16
- [89] cowplot_1.1.2 rhdf5_2.46.1
- [91] grid_4.3.2 AnnotationDbi_1.64.1
- [93] colorspace_2.1-0 SingleCellExperiment_1.24.0
- [95] GenomeInfoDbData_1.2.11 cli_3.6.2
- [97] rappdirs_0.3.3 fansi_1.0.6
- [99] S4Arrays_1.2.0 arrow_14.0.0.2
-[101] dplyr_1.1.4 gtable_0.3.4
-[103] digest_0.6.33 progressr_0.14.0
-[105] BiocGenerics_0.48.1 classInt_0.4-10
-[107] SparseArray_1.2.3 rjson_0.2.21
-[109] memoise_2.0.1 htmltools_0.5.7
-[111] lifecycle_1.0.4 httr_1.4.7
-[113] bit64_4.0.5
-```
diff --git a/vignettes/faqs.Rmd b/vignettes/faqs.Rmd
deleted file mode 100644
index fbd62af18..000000000
--- a/vignettes/faqs.Rmd
+++ /dev/null
@@ -1,70 +0,0 @@
----
-title: "Frequently Asked Questions"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Frequently Asked Questions}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Installation
-
-- [How do I install an R package for the first time?](https://drieslab.github.io/Giotto/articles/installation.html)
-
-- [Can I install Python components manually?](https://drieslab.github.io/Giotto/articles/configuration.html)
-
-# Data Availability
-
-- Where can I find seqFISH+ and other ready-to-use datasets?
-
-Checkout our [GiottoData](https://github.com/drieslab/GiottoData) extension package to find already preprocessed datasets and Giotto mini Objects.
-
-- Where else can I find more spatial datasets?
-
-Checkout the following for more spatial-omics data:
-
- - [Aquila](https://aquila.cheunglab.org/view)
- - Tencent\'s [SODB](https://gene.ai.tencent.com/SpatialOmics/)
- - [PySODB](https://pysodb.readthedocs.io/en/latest/), a python interface for the SODB
-
-- How can I automatically download tutorial datasets?
-
-Use `getSpatialDataset()` from GiottoData:
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-library(Giotto)
-
-# Ensure Giotto Data is installed
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-library(GiottoData)
-
-
-# choose your directory
-my_working_dir = getwd()
-
-# merFISH example:
-
-# standard download data to working directory
-getSpatialDataset(dataset = 'merfish_preoptic',
- directory = my_working_dir)
-
-# use wget to download data to working directory (much faster)
-getSpatialDataset(dataset = 'merfish_preoptic',
- directory = my_working_dir,
- method = 'wget')
-
-# avoid certification issues with wget
-getSpatialDataset(dataset = 'merfish_preoptic',
- directory = my_working_dir,
- method = 'wget',
- extra = '--no-check-certificate')
-```
-
diff --git a/vignettes/github_issues.Rmd b/vignettes/github_issues.Rmd
deleted file mode 100644
index e1336a07d..000000000
--- a/vignettes/github_issues.Rmd
+++ /dev/null
@@ -1,300 +0,0 @@
----
-title: "How to Submit a GitHub Issue"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{How to Submit a GitHub Issue}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-Please read through the information below before submitting your issue to our GitHub page. The link to report an issue can be found at the bottom of the page.
-
-## GitHub Issues Guidelines
-
-### Some Useful Commands
-
-It is helpful if you provide any relevant information about the software and Giotto object you are using. See below for some tips to get this information.
-
-- What version of R are you using?
-
-```{r, eval=FALSE}
-R.version.string
-```
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-```
-
-- What version of Giotto are you using?
-
-```{r, eval=FALSE}
-packageVersion("Giotto")
-```
-
-```{r, eval=FALSE}
-4.0.2
-```
-
-- Are you using the Giotto environment or your own python path?
-
-```{r, eval=FALSE}
-# Check Giotto environment
-Giotto::checkGiottoEnvironment()
-```
-
-```{r, eval=FALSE}
-giotto environment found at
-/Users/yuanlab/Library/r-miniconda/envs/giotto_env/bin/pythonw
-```
-
-- Show sequential processing steps/commands in the Giotto object
-
-```{r, eval=FALSE}
-Giotto::showProcessingSteps(my_giotto_object)
-```
-
-```{r, eval=FALSE}
-Processing steps:
-0_normalize
-
- 1_subset
-
- 2_filter
- name info: tag tag
-
- 3_feat_stats
-
- 4_cell_stats
-
- 5_hvf
- name info: hvf HVFplot
-
- 6_pca
-
- 7_umap
-
- 8_tsne
-
- 9_nn_network
-
- 10_cluster
- name info: leiden_clus sNN.pca
-
- 11_delaunay_spatial_network
- name info: Delaunay_network
-
- 12_spatial_network
- name info: spatial_network
-
- 13_create_metafeat
- name info: cluster_metagene
-
- 14_pca
- name info: custom_pca
-
- 15_umap
- name info: custom_pca custom_umap
-
- 16_nn_network
- name info: custom_pca custom_NN
-
- 17_cluster
- name info: custom_leiden custom_NN
-```
-
-- Show the structure of the Giotto object
-
-```{r, eval=FALSE}
-str(my_giotto_object, max.level = 3)
-```
-
-```{r, eval=FALSE}
-Formal class 'giotto' [package "Giotto"] with 23 slots
- ..@ expression :List of 1
- .. ..$ cell:List of 1
- ..@ expression_feat : chr "rna"
- ..@ spatial_locs :List of 1
- .. ..$ cell:List of 1
- ..@ spatial_info : NULL
- ..@ cell_metadata :List of 1
- .. ..$ cell:List of 1
- ..@ feat_metadata :List of 1
- .. ..$ cell:List of 1
- ..@ feat_info : NULL
- ..@ cell_ID :List of 1
- .. ..$ cell: chr [1:624] "AAAGGGATGTAGCAAG-1" "AAATGGCATGTCTTGT-1" "AAATGGTCAATGTGCC-1" "AAATTAACGGGTAGCT-1" ...
- ..@ feat_ID :List of 1
- .. ..$ rna: chr [1:634] "Gna12" "Ccnd2" "Btbd17" "Sox9" ...
- ..@ spatial_network :List of 1
- .. ..$ cell:List of 2
- ..@ spatial_grid : NULL
- ..@ spatial_enrichment :List of 1
- .. ..$ cell:List of 1
- ..@ dimension_reduction:List of 1
- .. ..$ cells:List of 1
- ..@ nn_network :List of 1
- .. ..$ cell:List of 1
- ..@ images : NULL
- ..@ largeImages :List of 1
- .. ..$ image:Formal class 'giottoLargeImage' [package "Giotto"] with 13 slots
- ..@ parameters :List of 18
- .. ..$ 0_normalize : Named chr [1:14] "mini_visium" "raw" "standard" "TRUE" ...
- .. .. ..- attr(*, "names")= chr [1:14] "gobject" "expression_values" "norm_methods" "library_size_norm" ...
- .. ..$ 1_subset : Named chr [1:12] "gobject" "spat_unit" "feat_type" "selected_cell_ids" ...
- .. .. ..- attr(*, "names")= chr [1:12] "gobject" "spat_unit" "feat_type" "cell_ids" ...
- .. ..$ 2_filter : Named chr [1:13] "mini_visium" "raw" "1" "5" ...
- .. .. ..- attr(*, "names")= chr [1:13] "gobject" "expression_values" "expression_threshold" "feat_det_in_min_cells" ...
- .. ..$ 3_feat_stats : Named chr [1:4] "mini_visium" "normalized" "0" "TRUE"
- .. .. ..- attr(*, "names")= chr [1:4] "gobject" "expression_values" "detection_threshold" "return_gobject"
- .. ..$ 4_cell_stats : Named chr [1:4] "mini_visium" "normalized" "0" "TRUE"
- .. .. ..- attr(*, "names")= chr [1:4] "gobject" "expression_values" "detection_threshold" "return_gobject"
- .. ..$ 5_hvf : Named chr [1:17] "mini_visium" "normalized" "cov_groups" "FALSE" ...
- .. .. ..- attr(*, "names")= chr [1:17] "gobject" "expression_values" "method" "reverse_log_scale" ...
- .. ..$ 6_pca : Named chr [1:15] "mini_visium" "normalized" "cells" "hvf" ...
- .. .. ..- attr(*, "names")= chr [1:15] "gobject" "expression_values" "reduction" "feats_to_use" ...
- .. ..$ 7_umap : Named chr [1:17] "mini_visium" "normalized" "cells" "pca" ...
- .. .. ..- attr(*, "names")= chr [1:17] "gobject" "expression_values" "reduction" "dim_reduction_to_use" ...
- .. ..$ 8_tsne : Named chr [1:14] "mini_visium" "normalized" "cells" "pca" ...
- .. .. ..- attr(*, "names")= chr [1:14] "gobject" "expression_values" "reduction" "dim_reduction_to_use" ...
- .. ..$ 9_nn_network : Named chr [1:11] "mini_visium" "sNN" "pca" "1:5" ...
- .. .. ..- attr(*, "names")= chr [1:11] "gobject" "type" "dim_reduction_to_use" "dimensions_to_use" ...
- .. ..$ 10_cluster : Named chr [1:11] "mini_visium" "leiden_clus" "sNN" "sNN.pca" ...
- .. .. ..- attr(*, "names")= chr [1:11] "gobject" "name" "nn_network_to_use" "network_name" ...
- .. ..$ 11_delaunay_spatial_network: Named chr [1:4] "dimensions: sdimx and sdimy" "deldir" "auto" "Delaunay_network"
- .. .. ..- attr(*, "names")= chr [1:4] "dimensions used" "method" "maximum distance threshold" "name of spatial network"
- .. ..$ 12_spatial_network : Named chr [1:4] "10" "all" "400" "spatial_network"
- .. .. ..- attr(*, "names")= chr [1:4] "k neighbours" "dimensions used" "maximum distance threshold" "name of spatial network"
- .. ..$ 13_create_metafeat : Named chr [1:5] "mini_visium" "normalized" "cluster_genes" "cluster_metagene" ...
- .. .. ..- attr(*, "names")= chr [1:5] "gobject" "expression_values" "feat_clusters" "name" ...
- .. ..$ 14_pca : Named chr [1:16] "mini_visium" "normalized" "cells" "custom_pca" ...
- .. .. ..- attr(*, "names")= chr [1:16] "gobject" "expression_values" "reduction" "name" ...
- .. ..$ 15_umap : Named chr [1:19] "mini_visium" "normalized" "cells" "pca" ...
- .. .. ..- attr(*, "names")= chr [1:19] "gobject" "expression_values" "reduction" "dim_reduction_to_use" ...
- .. ..$ 16_nn_network : Named chr [1:13] "mini_visium" "sNN" "pca" "custom_pca" ...
- .. .. ..- attr(*, "names")= chr [1:13] "gobject" "type" "dim_reduction_to_use" "dim_reduction_name" ...
- .. ..$ 17_cluster : Named chr [1:11] "mini_visium" "custom_leiden" "sNN" "custom_NN" ...
- .. .. ..- attr(*, "names")= chr [1:11] "gobject" "name" "nn_network_to_use" "network_name" ...
- ..@ instructions :List of 13
- .. ..$ python_path : chr "/Users/yuanlab/Library/r-miniconda/envs/giotto_env/bin/pythonw"
- .. ..$ show_plot : logi TRUE
- .. ..$ return_plot : logi FALSE
- .. ..$ save_plot : logi FALSE
- .. ..$ save_dir : logi NA
- .. ..$ plot_format : chr "png"
- .. ..$ dpi : num 300
- .. ..$ units : chr "in"
- .. ..$ height : num 9
- .. ..$ width : num 9
- .. ..$ is_docker : logi FALSE
- .. ..$ active_spat_unit: chr "cell"
- .. ..$ active_feat_type: chr "rna"
- ..@ offset_file : NULL
- ..@ OS_platform : chr "unix"
- ..@ join_info : NULL
- ..@ multiomics : NULL
- ..@ h5_file : NULL
-```
-
-### Warning Messages
-
-- Deprecation warning
-
-```{r, eval=FALSE}
-my_giotto_object <- createGiottoObject(raw_exprs = "path/to/expression/data",
- spatial_locs = "path/to/spatial/data")
-```
-
-```{r, eval=FALSE}
-Warning message:
-In createGiottoObject(raw_exprs = "/Users/username/path/to/data", :
- raw_exprs argument is deprecated, use expression argument in the future
-```
-
-**Solution** The code has still run and your object has been created, but in the future use the following command:
-
-```{r, eval=FALSE}
-my_giotto_object <- createGiottoObject(expression = "path/to/expression/data",
- spatial_locs = "path/to/spatial/data")
-```
-
-### Errors
-
-- Is this an error from Giotto?
-
-```{r, eval=FALSE}
-Error in adjustGiottoMatrix(gobject = my_giotto_object, expression_values = c("normalized"): covariate column name(s) were not found in the cell metadata
-```
-
-**Solution** In this case, you would need to check your cell metadata (`my_giotto_object@cell_metadata`) and make appropriate adjustments.
-
-- Is this an error from an external package?
-
-```{r, eval=FALSE}
-Error in methods::as(as.matrix(x[, -1]), "Matrix") :
-no method or default for coercing "matrix" to "Matrix"
-```
-
-**Solution** Ensure that the Matrix library is loaded:
-
-```{r, eval=FALSE}
-library(Matrix)
-```
-
-## Some steps before posting an issue
-
-- Google (or whichever search engine you prefer) the error
-- Look up the documentation for the package the error came from
-
-### Required information to provide
-
-- What code/data did you use? (copy-pasted or an example is helpful)
-- What did you expect your result to be?
-- What was your result?
-- If your result was an error message, please see the category on error messages to determine whether the source was Giotto or an external package.
-
-### How to create a reproducible example
-
-For us to be able to help you at the best of our ability, it\'s helpful if you can provide a reproducible example. This just means that anyone who reads your GitHub issue should be able to accurately reproduce your error.
-
-For more information on minimal reproducible examples check out [this link](https://stackoverflow.com/help/minimal-reproducible-example).
-
-And to see what other people recommend, please check out [this forum](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example).
-
-### Example of a Good GitHub issue
-
-- Provide a code example
-- Please use the GitHub "insert code" function or wrap your code like so:
-
-```{r, eval=FALSE}
-`x <- "hello world"
-
-print(x)`
-```
-
-*If applicable, provide a screenshot of the issue*
-
-I am having trouble adjusting my Giotto matix. I have inputted the
-following code:
-
-```{r, eval=FALSE}
-my_giotto_object <- GiottoData::loadGiottoMini("visium")
-
-my_giotto_object <- adjustGiottoMatrix(gobject = my_giotto_object,
- expression_values = c('normalized'),
- covariate_columns = c('nr_genes',
- 'total_expr'))
-```
-
-I expected that my matrix would be appropriately adjusted, but I got the following error:
-
-```{r, eval=FALSE}
-Error in adjustGiottoMatrix(gobject = my_giotto_object, expression_values = c("normalized"): covariate column name(s) were not found in the cell metadata
-```
-
-For more context, I am running R version 4.3.2 and Giotto version 4.0.2. I can send you the data I used if necessary.
-
-### Example of a Bad GitHub issue
-
-I am having trouble adjusting my Giotto matrix. My error says that the covariate column name(s) were not found in the cell meta data. What do I do?
-
-Report An Issue
diff --git a/vignettes/image_alignment.Rmd b/vignettes/image_alignment.Rmd
deleted file mode 100644
index 86b03707a..000000000
--- a/vignettes/image_alignment.Rmd
+++ /dev/null
@@ -1,573 +0,0 @@
----
-title: "Image Alignment"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Image Alignment}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# 1. Giotto and Image Data
-
-Multiple images may be attached to the Giotto object. Spatial data can be overlaid upon these images which may then be used for downstream analyses. While Giotto attempts to automate the addition and alignment of images as much as possible, manual adjustments may sometimes be necessary. This tutorial will be covering both automatic and manual adjustment.
-
-The examples in this tutorial will be worked using Visium's normal human prostate FFPE [dataset](https://www.10xgenomics.com/resources/datasets/normal-human-prostate-ffpe-1-standard-1-3-0) for both the Visium (automatic) and manual adjustment workflows. A manual download of this data is required; please see **Visium Directory Structure Details** below.
-
-For an example of working with high definition images that may require ROI alignment and or stitching, please see the Nanostring CosMx lung data [analysis](./Nanostring_Lung12_jan26_21.html).
-
-# 2. Start Giotto
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-library(Giotto)
-
-# Ensure Giotto Data is installed
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install"drieslab/GiottoData")
-}
-library(GiottoData)
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- installGiottoEnvironment()
-}
-```
-
-
-# 3. Conceptual Overview
-
-Giotto currently supports two types of image objects. For most purposes, images are loaded in using [terra](https://rdrr.io/cran/terra/) and are then placed into **giottoLargeImage** objects. **giottoLargeImage** objects only load in sampled subsets of the original image that are needed to represent the image, increasing efficiency for analysis of very high-resolution images.
-
-Alternatively, smaller images are loaded in using the [magick](https://rdrr.io/cran/magick/) package and are then placed into **giottoImage** objects. This offers direct access to the powerful image processing functionality in the *magick* package among other Giotto functions for analysis and viewing. **giottoLargeImage** objects can be downsampled into **giottoImage** objects when necessary through use of
-the **convertGiottoLargeImageToMG()** function.
-
-
-**More about the giottoImage container**
-
-**giottoImages** are S4 class objects with slots containing the image itself and the metadata necessary to plot it properly. The **magick** package allows easy access to image processing functions as well as the ability to access images through pointers, so the images are only loaded into memory when needed.
-
-Please note that as a result of using pointers to access the image, **giottoImages** will not be saved between sessions, since the pointer will die after a given R session is closed. However, the information used to create the image will be retained within the **giottoObject** in the **images** slot, as described below.
-
-When incorporated into a **giottoObject**, **giottoImages** are added into the **images** slot of the **giottoObject**. The **images** slot is organized as a **list()** so multiple **giottoImages** may be added and then referred to individually using the **name** which they have been given.
-
-**giottoImage Structure**
-
-- name - *name of the giottoImage, does not need to match the name of the variable which stores the giotto image. Default is 'image'.*
-- mg_object - *image loaded in as magick object (pointer)*
-- minmax - *x and y minimum and maximum values found from spatial locations*
-- boundaries - *adjustment values for stretching the image based on minmax values*
-- scale_factor - *scale factor of spatial locations to image*
-- resolution - *spatial location units covered per pixel*
-- OS_platform - *computer environment*
-
-*Note that **minmax** refers to the relevant values of the associated spatial locations rather than those of the image. These values are given either by providing spatial locations directly when calling **createGiottoImage()** or in later steps that involve a **giottoObjects** with associated spatial locations.
-
-
-For maximum flexibility, Giotto plots images and spatial data on different layers that are largely independent of each other. The spatial data is plotted first, essentially serving as an anchor **(xmin, xmax, ymin, ymax)**. The image, no matter its actual dimensions or resolution, is then **stretched** to fit on the plot according to accompanying metadata **(xmin_adj, xmax_adj, ymin_adj, ymax_adj)** which can be edited by the user.
-
-![](images/image_alignment/images_adjust.png)
-
-Calling the **giottoImage** by itself will display its class and name, followed the values that occupy its minmax, boundary adjustment, scale_factor, and resolution slots. The actual image boundaries are displayed as spatial values, which detail the points to which the image's edges will be stretched.
-
-Most spatial datasets currently generate spatial locations based on how they map onto an original image. Although this brief explanation is somewhat simplified, Giotto's automatic alignment works as follows:
-
-- Scale image dimensions to original dimensions by dividing by the **scaling_factor**
-- **xmin_adj** = (spatial location xmin) - 0
-- **xmax_adj** = (xmax image bound in original dimensions) - (spatial location xmax)
-- **ymin_adj** = (spatial location ymin) - (ymin image bound in original dimensions)
-- **ymax_adj** = 0 - (spatial location ymax)
-
-For instance, assume a **giottoImage** object named GImage has already been created:
-
-
-```{r, eval=FALSE}
-GImage
-
-## R TERMINAL OUTPUT:
-#
-# An object of class ' giottoImage ' with name image
-#
-# Min and max values are:
-# Max on x-axis: 23520
-# Min on x-axis: 5066
-# Max on y-axis: -3682
-# Min on y-axis: -23148
-#
-# Boundary adjustment are:
-# Max adjustment on x-axis: 3949.001
-# Min adjustment on x-axis: 5066
-# Max adjustment on y-axis: 3682
-# Min adjustment on y-axis: 2082.277
-#
-# Boundaries are:
-# Image x-axis max boundary: 27469
-# Image x-axis min boundary: 0
-# Image y-axis max boundary: 0
-# Image y-axis min boundary: -25230.28
-#
-# Scale factor:
-# x y
-# 0.07280935 0.07280935
-#
-# Resolution:
-# x y
-# 13.7345 13.7345
-#
-# File Path:
-# [1] "/path/to/directory/tissue_image.png"
-```
-
-
-Further intuition for defining these parameters in this way is detailed within the **Why this inversion is necessary** dropdown text beneath Standard workflow.
-
-# 4. Visium Workflow (Automated):
-
-Assembly of Giotto object as well as the reading in and alignment of the tissue staining image from the Visium spatial subdirectory is done automatically using **createGiottoVisiumObject()**.
-
-Note that in order to run the following code, the Output Files "Feature barcode matrix (raw)" and "Spatial imaging data" from the [dataset](https://www.10xgenomics.com/resources/datasets/normal-human-prostate-ffpe-1-standard-1-3-0) must be downloaded and extracted into a structured Visium directory.
-
-
-**Visium Directory Structure Details**
-
-Here, details on how to structure the Visium Directory for creating a Giotto object using **createGiottoVisiumObject()** for the purposes of this tutorial will be shown. Nonetheless, this procedure is standard practice for using Giotto with Visium Data.
-
-First create a new directory. This will be the Visium Directory. Then, open a terminal within that directory, and enter the following commands:
-
-
-``` bash
-wget https://cf.10xgenomics.com/samples/spatial-exp/1.3.0/Visium_FFPE_Human_Normal_Prostate/Visium_FFPE_Human_Normal_Prostate_raw_feature_bc_matrix.tar.gz
-tar -xzvf Visium_FFPE_Human_Normal_Prostate_raw_feature_bc_matrix.tar.gz
-wget https://cf.10xgenomics.com/samples/spatial-exp/1.3.0/Visium_FFPE_Human_Normal_Prostate/Visium_FFPE_Human_Normal_Prostate_spatial.tar.gz
-tar -xzvf Visium_FFPE_Human_Normal_Prostate_spatial.tar.gz
-```
-
-
-This will create two subdirectories within the Visium Directory, titled "raw_feature_bc_matrix" and "spatial". These subdirectories will contain barcode and expression information, or images and scaling information, respectively. Now, the Visium Directory may be inputted to **createGiottoVisiumObject()**!
-
-
-A giotto object using either the hires or lowres image will be loaded depending on whether "**tissue_hires_image.png"** or **"tissue_lowres_image.png"** is provided to the **png_name** argument. In this example, the hires image will be plotted.
-
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-VisiumDir = '/path/to/visium/directory/'
-results_directory = paste0(getwd(),'/gobject_imaging_results/')
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-
-# Optional: Set Giotto instructions
-instrs = createGiottoInstructions(save_plot = TRUE,
- show_plot = TRUE,
- save_dir = results_directory,
- python_path = my_python_path)
-```
-
-
-
-```{r, eval=FALSE}
-# Create a Giotto Object using Visium Data
-FFPE_prostate <- createGiottoVisiumObject(expr_data = 'raw',
- visium_dir = VisiumDir,
- png_name = "tissue_hires_image.png",
- instructions = instrs)
-```
-
-```{r, eval=FALSE}
-# visualize spots that are in tissue
-spatPlot2D(FFPE_prostate,
- show_image = TRUE,
- cell_color = 'in_tissue',
- save_param = list(save_name = 'high_res_IT'))
-```
-
-
-![](images/image_alignment/high_res_IT.png)
-
-# 5. Standard Workflow
-
-## 5.1 Invert Y-Values
-
-Before beginning, it is important to acknowledge that differences may exist in the conventions for defining coordinates within images and plots. As a result, it is often required to make the spatial location y values negative. This inversion is necessary for the spatial locations to appear in the same orientation as the image. This transformation of the spatial locations is automatically done for Visium datasets during **createGiottoVisiumObject()**. In the standard workflow, it is important to determine if this is necessary for the data at hand.
-
-
-**Why this inversion is necessary**
-
-
-**Image Coordinates vs Plotting Coordinates**
-By convention, the origin of image coordinates is defined in the upper left, and coordinates increase rightward (x coordinate) and downward (y coordinate). Many spatial methods inherit this convention when generating spatial location data. However, Giotto plots with the coordinates originating from the lower left. Thus, without inversion of the y coordinates, the **spatial locations are displayed as vertically flipped compared to how they are intended to be seen**.
-
-![](images/image_alignment/images_coord_diffs.png)
-
-**The fix for this is to multiply all the Y-values in spatial locations by -1, inverting them.** This may be done prior to creation of the giotto object by multiplying the y values within the spatial location matrix by -1. If the giotto object has already been created, yet the spatial data still needs inversion, running the following commands will invert the y coordinates.
-
-Here, my_gobject refers to the **giottoObject** and my_spatlocs refers to the name of the **spatial locations** to which the image will be aligned.
-
-
-```{r, eval=FALSE}
-# Retrieve original spatial location data as a spatLocObj
-spatlocs <- getSpatialLocations(gobject = FFPE_prostate,
- output = 'spatLocsObj')
-
-spatlocs[]$sdimy <- -spatlocs[]$sdimy # Note the negative sign operator for inversion
-
-# Overwrite the original spatial locations with the inverted ones
-my_gobject <- setSpatialLocations(gobject = FFPE_prostate,
- x = spatlocs)
-```
-
-
-![](images/image_alignment/images_inverty.png)
-
-
-## 5.2 Create giottoImage
-
-giottoImages are created using the **createGiottoImage()** function. This function requires a **magick**-compatible image (eg. jpg, tiff, png) to be provided to the **mg_object** argument as either a filepath or a **magick** object.
-
-If automatic image alignment is desired, the **scale_factor** parameter is required, which scales the spatial locations to the image. *This parameter is required since spatial locations do not contain information about the size of the image is past the spatial xmax and ymin values. Those two image bounds are instead inferred by scaling up the current image dimensions to those of the spatial locations.*
-
-For Visium datasets, scaling information is available in the **scalefactors_json.json** file found within the **spatial** subdirectory.
-
-**scalefactors_json.json** for this [dataset](https://www.10xgenomics.com/resources/datasets/normal-human-prostate-ffpe-1-standard-1-3-0):
-
-
-```{r, eval=FALSE}
-{"tissue_hires_scalef": 0.072809346, "tissue_lowres_scalef": 0.021842804, "fiducial_diameter_fullres": 304.63145798068047, "spot_diameter_fullres": 188.58137874994503}
-```
-
-Providing the appropriate factor to the **scale_factor** parameter will result in automatic alignment.
-
-```{r, eval=FALSE}
-lowResPath <- paste0(VisiumDir,"spatial/tissue_lowres_image.png")
-lowResG_img <- createGiottoImage(gobject = FFPE_prostate,
- mg_object = lowResPath,
- name = "low_res",
- scale_factor = 0.021842804)
-```
-
-Alignment values:
-
-```{r, eval=FALSE}
-lowResG_img
-```
-
-```{r, eval=FALSE}
- An object of class ' giottoImage ' with name low_res
-
- Min and max values are:
- Max on x-axis: 23520
- Min on x-axis: 5066
- Max on y-axis: -3682
- Min on y-axis: -23148
-
- Boundary adjustment are:
- Max adjustment on x-axis: 3949.001
- Min adjustment on x-axis: 5066
- Max adjustment on y-axis: 3682
- Min adjustment on y-axis: 2077.699
-
- Boundaries are:
- Image x-axis max boundary: 27469
- Image x-axis min boundary: 0
- Image y-axis max boundary: 4.547474e-13
- Image y-axis min boundary: -25225.7
-
- Scale factor:
- x y
- 0.0218428 0.0218428
-
- Resolution:
- x y
- 45.78167 45.78167
-
- File Path:
- [1] "~/Visium_FFPE_Human_Normal_Prostate/spatial/tissue_lowres_image.png"
-```
-
-
-**Without spatial locations**
-
-```{r, eval=FALSE}
-lowResG_img_no_locs <- createGiottoImage(mg_object = lowResPath,
- name = "low_res_no_locs",
- scale_factor = 0.021842804)
-```
-
-
-Alignment values:
-
-
-```{r, eval=FALSE}
-lowResG_img_no_locs
-```
-
-```{r, eval=FALSE}
- An object of class ' giottoImage ' with name low_res_no_locs
-
- Min and max values are:
- Max on x-axis: 10
- Min on x-axis: 0
- Max on y-axis: 10
- Min on y-axis: 0
-
- Boundary adjustment are:
- Max adjustment on x-axis: 0
- Min adjustment on x-axis: 0
- Max adjustment on y-axis: 0
- Min adjustment on y-axis: 0
-
- Boundaries are:
- Image x-axis max boundary: 10
- Image x-axis min boundary: 0
- Image y-axis max boundary: 10
- Image y-axis min boundary: 0
-
- Scale factor:
- x y
- 0.0218428 0.0218428
-
- Resolution:
- x y
- 45.78167 45.78167
-
- File Path:
- [1] "~/Visium_FFPE_Human_Normal_Prostate/spatial/tissue_lowres_image.png"
-
-```
-
-*Note that only default values are given to minmax and boundaries in this case.*
-
-
-(**Optional**) Providing spatial location information through either of the **gobject** parameters **spat_loc_name** or **spatial_locs** will populate the minmax and boundary slots in an attempt to auto-align the image with the spatial locations. The auto-alignment can be bypassed by using **do_manual_adj = TRUE** and only the minmax slot will be populated.
-
-
-
-**With spatial locations, but also with do_manual_adj = TRUE**
-
-
-
-```{r, eval=FALSE}
-lowResG_img_manual <- createGiottoImage(gobject = FFPE_prostate,
- mg_object = lowResPath,
- name = "low_res_manual",
- do_manual_adj = TRUE,
- xmin_adj = 0,
- xmax_adj = 0,
- ymin_adj = 0,
- ymax_adj = 0,
- scale_factor = 0.021842804)
-```
-
-
-Alignment values:
-
-
-```{r, eval=FALSE}
-lowResG_img_manual
-```
-
-```{r, eval=FALSE}
- An object of class ' giottoImage ' with name low_res_manual
-
- Min and max values are:
- Max on x-axis: 23520
- Min on x-axis: 5066
- Max on y-axis: -3682
- Min on y-axis: -23148
-
- Boundary adjustment are:
- Max adjustment on x-axis: 0
- Min adjustment on x-axis: 0
- Max adjustment on y-axis: 0
- Min adjustment on y-axis: 0
-
- Boundaries are:
- Image x-axis max boundary: 23520
- Image x-axis min boundary: 5066
- Image y-axis max boundary: -3682
- Image y-axis min boundary: -23148
-
- Scale factor:
- x y
- 0.0218428 0.0218428
-
- Resolution:
- x y
- 45.78167 45.78167
-
- File Path:
- [1] "~/Visium_FFPE_Human_Normal_Prostate/spatial/tissue_lowres_image.png"
-```
-
-
-
-*When* **do_manual_adj = TRUE***, automatic alignment is bypassed in favor of the four manual adjustment values.* *These values (Boundary adjustment) default to 0.*
-
-
-## 5.3 Add giottoImage to giottoObject and Visualize
-
-
-```{r, eval=FALSE}
-# Since lowResG_img_no_locs is not associated with the gobject FFPE_prostate, it
-# may not be added to the gobject.
-FFPE_prostate = addGiottoImage(gobject = FFPE_prostate,
- images = list(lowResG_img))
-
-spatPlot2D(gobject = FFPE_prostate,
- show_image = TRUE,
- image_name = "low_res",
- cell_color = "in_tissue",
- save_param = list(save_name = 'low_res_IT'))
-```
-
-![](images/image_alignment/low_res_IT.png)
-
-# 6. Manual Adjustment
-
-Manually adjusting the plotting of images comes either during **createGiottoImage()** using **do_manual_adj = TRUE** and the four adjustment values **(xmin_adj, xmax_adj, ymin_adj, ymax_adj)** or after **giottoImage** creation using **updateGiottoImage()**.
-
-This method is performed by eye and may be necessary depending on preference or if despite accounting for scaling, the image coordinates do not match up with the spatial coordinates for some reason.
-
-## 6.1 During giottoImage creation
-
-```{r, eval=FALSE}
-# createGiottoImage with manually defined adjustment values
-lowResG_img_update_manual <- createGiottoImage(gobject = FFPE_prostate,
- mg_object = lowResPath,
- name = "low_res_update_manual",
- do_manual_adj = TRUE,
- xmin_adj = 5066,
- xmax_adj = 3949,
- ymin_adj = 2078,
- ymax_adj = 3682,
- scale_factor = 0.021842804)
-```
-
-```{r, eval=FALSE}
-FFPE_prostate = addGiottoImage(gobject = FFPE_prostate,
- images = list(lowResG_img_update_manual))
-
-spatPlot2D(gobject = FFPE_prostate,
- show_image = TRUE,
- image_name = "low_res_update_manual",
- cell_color = "in_tissue",
- save_param = list(save_name = 'low_res_update_manual_IT'))
-```
-
-![](images/image_alignment/low_res_update_manual_IT.png)
-
-## 6.2 After giottoImage creation, within the giottoObject
-
-```{r, eval=FALSE}
-# createGiottoImage with manually defined adjustment values
-lowResG_img_to_update <- createGiottoImage(gobject = FFPE_prostate,
- mg_object = lowResPath,
- name = "low_res_to_update",
- do_manual_adj = TRUE,
- xmin_adj = 0,
- xmax_adj = 0,
- ymin_adj = 0,
- ymax_adj = 0,
- scale_factor = 0.021842804)
-```
-
-```{r, eval=FALSE}
-FFPE_prostate = addGiottoImage(gobject = FFPE_prostate,
- images = list(lowResG_img_to_update))
-
-spatPlot2D(gobject = FFPE_prostate,
- show_image = TRUE,
- image_name = "low_res_to_update",
- cell_color = "in_tissue",
- save_param = list(save_name = 'low_res_before_update_IT'))
-```
-
-![](images/image_alignment/low_res_before_update_IT.png)
-
-```{r, eval=FALSE}
-# Use updateGiottoImage() to update the image adjustment values
-FFPE_prostate = updateGiottoImage(gobject = FFPE_prostate,
- image_name = "low_res_to_update",
- xmin_adj = 5066,
- xmax_adj = 3949,
- ymin_adj = 2078,
- ymax_adj = 3682)
-
-spatPlot2D(gobject = FFPE_prostate,
- show_image = TRUE,
- image_name = "low_res_to_update",
- cell_color = "in_tissue",
- save_param = list(save_name = 'low_res_after_update_IT'))
-```
-
-![](images/image_alignment/low_res_after_update_IT.png)
-
-# 7. Session Info
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.3.1
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] Giotto_4.0.2 GiottoClass_0.1.3
-
-loaded via a namespace (and not attached):
- [1] tidyselect_1.2.0 dplyr_1.1.4 farver_2.1.1
- [4] GiottoVisuals_0.1.4 R.utils_2.12.3 bitops_1.0-7
- [7] fastmap_1.1.1 SingleCellExperiment_1.24.0 RCurl_1.98-1.14
-[10] digest_0.6.34 lifecycle_1.0.4 terra_1.7-71
-[13] magrittr_2.0.3 compiler_4.3.2 rlang_1.1.3
-[16] tools_4.3.2 igraph_2.0.1.1 utf8_1.2.4
-[19] yaml_2.3.8 data.table_1.15.0 knitr_1.45
-[22] S4Arrays_1.2.0 labeling_0.4.3 reticulate_1.35.0
-[25] here_1.0.1 DelayedArray_0.28.0 RColorBrewer_1.1-3
-[28] abind_1.4-5 withr_3.0.0 BiocGenerics_0.48.1
-[31] R.oo_1.26.0 grid_4.3.2 stats4_4.3.2
-[34] fansi_1.0.6 colorspace_2.1-0 ggplot2_3.4.4
-[37] scales_1.3.0 gtools_3.9.5 SummarizedExperiment_1.32.0
-[40] cli_3.6.2 rmarkdown_2.25 crayon_1.5.2
-[43] ragg_1.2.7 generics_0.1.3 rstudioapi_0.15.0
-[46] rjson_0.2.21 zlibbioc_1.48.0 parallel_4.3.2
-[49] XVector_0.42.0 matrixStats_1.2.0 vctrs_0.6.5
-[52] Matrix_1.6-5 jsonlite_1.8.8 GiottoData_0.2.7.0
-[55] IRanges_2.36.0 S4Vectors_0.40.2 systemfonts_1.0.5
-[58] magick_2.8.2 GiottoUtils_0.1.5 glue_1.7.0
-[61] codetools_0.2-19 cowplot_1.1.3 gtable_0.3.4
-[64] GenomeInfoDb_1.38.6 GenomicRanges_1.54.1 munsell_0.5.0
-[67] tibble_3.2.1 pillar_1.9.0 htmltools_0.5.7
-[70] GenomeInfoDbData_1.2.11 R6_2.5.1 textshaping_0.3.7
-[73] rprojroot_2.0.4 evaluate_0.23 lattice_0.22-5
-[76] Biobase_2.62.0 png_0.1-8 R.methodsS3_1.8.2
-[79] backports_1.4.1 SpatialExperiment_1.12.0 Rcpp_1.0.12
-[82] SparseArray_1.2.3 checkmate_2.3.1 colorRamp2_0.1.0
-[85] xfun_0.42 MatrixGenerics_1.14.0 pkgconfig_2.0.3
-```
diff --git a/vignettes/images/branches/GiottoLogo.png b/vignettes/images/branches/GiottoLogo.png
deleted file mode 100644
index ae312c82a..000000000
Binary files a/vignettes/images/branches/GiottoLogo.png and /dev/null differ
diff --git a/vignettes/images/branches/GiottoLogoMaster.png b/vignettes/images/branches/GiottoLogoMaster.png
deleted file mode 100644
index 1eec4612d..000000000
Binary files a/vignettes/images/branches/GiottoLogoMaster.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/2_a_spatPlot.png b/vignettes/images/codex_mouse_spleen/2_a_spatPlot.png
deleted file mode 100644
index cbee4f9b6..000000000
Binary files a/vignettes/images/codex_mouse_spleen/2_a_spatPlot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/2_b_spatPlot.png b/vignettes/images/codex_mouse_spleen/2_b_spatPlot.png
deleted file mode 100644
index 3bc2f3d43..000000000
Binary files a/vignettes/images/codex_mouse_spleen/2_b_spatPlot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/3_a_spatPlot.png b/vignettes/images/codex_mouse_spleen/3_a_spatPlot.png
deleted file mode 100644
index 37e5ffceb..000000000
Binary files a/vignettes/images/codex_mouse_spleen/3_a_spatPlot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/3_b_PCA.png b/vignettes/images/codex_mouse_spleen/3_b_PCA.png
deleted file mode 100644
index 8c866f3e0..000000000
Binary files a/vignettes/images/codex_mouse_spleen/3_b_PCA.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/3_c_UMAP.png b/vignettes/images/codex_mouse_spleen/3_c_UMAP.png
deleted file mode 100644
index fd0c2f954..000000000
Binary files a/vignettes/images/codex_mouse_spleen/3_c_UMAP.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/4_a_UMAP.png b/vignettes/images/codex_mouse_spleen/4_a_UMAP.png
deleted file mode 100644
index 7858a89d2..000000000
Binary files a/vignettes/images/codex_mouse_spleen/4_a_UMAP.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/4_b_spatplot.png b/vignettes/images/codex_mouse_spleen/4_b_spatplot.png
deleted file mode 100644
index 2ef9d7c40..000000000
Binary files a/vignettes/images/codex_mouse_spleen/4_b_spatplot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/5_a_spatdimplot.png b/vignettes/images/codex_mouse_spleen/5_a_spatdimplot.png
deleted file mode 100644
index 0622b54d3..000000000
Binary files a/vignettes/images/codex_mouse_spleen/5_a_spatdimplot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/6_a_metaheatmap.png b/vignettes/images/codex_mouse_spleen/6_a_metaheatmap.png
deleted file mode 100644
index 3c0a40bc6..000000000
Binary files a/vignettes/images/codex_mouse_spleen/6_a_metaheatmap.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/6_b_violinplot.png b/vignettes/images/codex_mouse_spleen/6_b_violinplot.png
deleted file mode 100644
index fd21056e4..000000000
Binary files a/vignettes/images/codex_mouse_spleen/6_b_violinplot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/6_c_metaheatmap.png b/vignettes/images/codex_mouse_spleen/6_c_metaheatmap.png
deleted file mode 100644
index 45d4b07c6..000000000
Binary files a/vignettes/images/codex_mouse_spleen/6_c_metaheatmap.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/6_d_violinplot.png b/vignettes/images/codex_mouse_spleen/6_d_violinplot.png
deleted file mode 100644
index d848d371a..000000000
Binary files a/vignettes/images/codex_mouse_spleen/6_d_violinplot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/7_a_umap_celltypes.png b/vignettes/images/codex_mouse_spleen/7_a_umap_celltypes.png
deleted file mode 100644
index 3e4034115..000000000
Binary files a/vignettes/images/codex_mouse_spleen/7_a_umap_celltypes.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/7_b_umap.png b/vignettes/images/codex_mouse_spleen/7_b_umap.png
deleted file mode 100644
index 647556f45..000000000
Binary files a/vignettes/images/codex_mouse_spleen/7_b_umap.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/7_c_spatplot.png b/vignettes/images/codex_mouse_spleen/7_c_spatplot.png
deleted file mode 100644
index 531f1cef7..000000000
Binary files a/vignettes/images/codex_mouse_spleen/7_c_spatplot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/8_a_umap.png b/vignettes/images/codex_mouse_spleen/8_a_umap.png
deleted file mode 100644
index e031500dc..000000000
Binary files a/vignettes/images/codex_mouse_spleen/8_a_umap.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/8_b_spatplot.png b/vignettes/images/codex_mouse_spleen/8_b_spatplot.png
deleted file mode 100644
index 03782c132..000000000
Binary files a/vignettes/images/codex_mouse_spleen/8_b_spatplot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/8_c_spatdimplot.png b/vignettes/images/codex_mouse_spleen/8_c_spatdimplot.png
deleted file mode 100644
index 5c964c5c5..000000000
Binary files a/vignettes/images/codex_mouse_spleen/8_c_spatdimplot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/8_d_umap.png b/vignettes/images/codex_mouse_spleen/8_d_umap.png
deleted file mode 100644
index 8aaffb98e..000000000
Binary files a/vignettes/images/codex_mouse_spleen/8_d_umap.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/8_e_spatPlot.png b/vignettes/images/codex_mouse_spleen/8_e_spatPlot.png
deleted file mode 100644
index b8bf52c80..000000000
Binary files a/vignettes/images/codex_mouse_spleen/8_e_spatPlot.png and /dev/null differ
diff --git a/vignettes/images/codex_mouse_spleen/8_f_spatdimgeneplot.png b/vignettes/images/codex_mouse_spleen/8_f_spatdimgeneplot.png
deleted file mode 100644
index e6ad73441..000000000
Binary files a/vignettes/images/codex_mouse_spleen/8_f_spatdimgeneplot.png and /dev/null differ
diff --git a/vignettes/images/ecosystem/modules.png b/vignettes/images/ecosystem/modules.png
deleted file mode 100644
index ff8d4baa8..000000000
Binary files a/vignettes/images/ecosystem/modules.png and /dev/null differ
diff --git a/vignettes/images/general_figs/CODEX_spleen_image_summary.png b/vignettes/images/general_figs/CODEX_spleen_image_summary.png
deleted file mode 100644
index 4a06b59ef..000000000
Binary files a/vignettes/images/general_figs/CODEX_spleen_image_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/Giotto_to_suite.png b/vignettes/images/general_figs/Giotto_to_suite.png
deleted file mode 100644
index 3cc5802bc..000000000
Binary files a/vignettes/images/general_figs/Giotto_to_suite.png and /dev/null differ
diff --git a/vignettes/images/general_figs/Visium_FFPE_Human_Normal_Prostate_image.png b/vignettes/images/general_figs/Visium_FFPE_Human_Normal_Prostate_image.png
deleted file mode 100644
index ac3a91528..000000000
Binary files a/vignettes/images/general_figs/Visium_FFPE_Human_Normal_Prostate_image.png and /dev/null differ
diff --git a/vignettes/images/general_figs/Visium_FFPE_Human_Prostate_Cancer_image.png b/vignettes/images/general_figs/Visium_FFPE_Human_Prostate_Cancer_image.png
deleted file mode 100644
index b95142309..000000000
Binary files a/vignettes/images/general_figs/Visium_FFPE_Human_Prostate_Cancer_image.png and /dev/null differ
diff --git a/vignettes/images/general_figs/coming_soon_summary.png b/vignettes/images/general_figs/coming_soon_summary.png
deleted file mode 100644
index 369b477d1..000000000
Binary files a/vignettes/images/general_figs/coming_soon_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/construction-boy.png b/vignettes/images/general_figs/construction-boy.png
deleted file mode 100644
index bfb0a5205..000000000
Binary files a/vignettes/images/general_figs/construction-boy.png and /dev/null differ
diff --git a/vignettes/images/general_figs/cortex_image_summary.png b/vignettes/images/general_figs/cortex_image_summary.png
deleted file mode 100644
index d000aada3..000000000
Binary files a/vignettes/images/general_figs/cortex_image_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/cortex_svz_location_fields.png b/vignettes/images/general_figs/cortex_svz_location_fields.png
deleted file mode 100644
index 69b6c5306..000000000
Binary files a/vignettes/images/general_figs/cortex_svz_location_fields.png and /dev/null differ
diff --git a/vignettes/images/general_figs/cyCIF_PDAC_image_summary.png b/vignettes/images/general_figs/cyCIF_PDAC_image_summary.png
deleted file mode 100644
index 7966e53c4..000000000
Binary files a/vignettes/images/general_figs/cyCIF_PDAC_image_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/cycif_paper_figure.png b/vignettes/images/general_figs/cycif_paper_figure.png
deleted file mode 100644
index c6d0ce2b9..000000000
Binary files a/vignettes/images/general_figs/cycif_paper_figure.png and /dev/null differ
diff --git a/vignettes/images/general_figs/diagram_giotto_workflow.png b/vignettes/images/general_figs/diagram_giotto_workflow.png
deleted file mode 100644
index 10722560f..000000000
Binary files a/vignettes/images/general_figs/diagram_giotto_workflow.png and /dev/null differ
diff --git a/vignettes/images/general_figs/merFISH_hypoth_image_summary.png b/vignettes/images/general_figs/merFISH_hypoth_image_summary.png
deleted file mode 100644
index 3da5fa6d3..000000000
Binary files a/vignettes/images/general_figs/merFISH_hypoth_image_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/mouse_brain_highres.png b/vignettes/images/general_figs/mouse_brain_highres.png
deleted file mode 100644
index b1debc72d..000000000
Binary files a/vignettes/images/general_figs/mouse_brain_highres.png and /dev/null differ
diff --git a/vignettes/images/general_figs/mouse_kidney_highres.png b/vignettes/images/general_figs/mouse_kidney_highres.png
deleted file mode 100644
index 1ac2cb22c..000000000
Binary files a/vignettes/images/general_figs/mouse_kidney_highres.png and /dev/null differ
diff --git a/vignettes/images/general_figs/osmFISH_SS_cortex_image_summary.png b/vignettes/images/general_figs/osmFISH_SS_cortex_image_summary.png
deleted file mode 100644
index 695f237fd..000000000
Binary files a/vignettes/images/general_figs/osmFISH_SS_cortex_image_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/osmfish_image_demo.png b/vignettes/images/general_figs/osmfish_image_demo.png
deleted file mode 100644
index 163ed0e91..000000000
Binary files a/vignettes/images/general_figs/osmfish_image_demo.png and /dev/null differ
diff --git a/vignettes/images/general_figs/overview_datasets.png b/vignettes/images/general_figs/overview_datasets.png
deleted file mode 100644
index 6730727a8..000000000
Binary files a/vignettes/images/general_figs/overview_datasets.png and /dev/null differ
diff --git a/vignettes/images/general_figs/overview_datasets2.png b/vignettes/images/general_figs/overview_datasets2.png
deleted file mode 100644
index 1bd31f598..000000000
Binary files a/vignettes/images/general_figs/overview_datasets2.png and /dev/null differ
diff --git a/vignettes/images/general_figs/resolve_bioscience_cancer_summary.png b/vignettes/images/general_figs/resolve_bioscience_cancer_summary.png
deleted file mode 100644
index 7e653283a..000000000
Binary files a/vignettes/images/general_figs/resolve_bioscience_cancer_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/starmap_cortex_image_summary.png b/vignettes/images/general_figs/starmap_cortex_image_summary.png
deleted file mode 100644
index feb7b9b93..000000000
Binary files a/vignettes/images/general_figs/starmap_cortex_image_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/temp_workflow.png b/vignettes/images/general_figs/temp_workflow.png
deleted file mode 100644
index 1266db7ea..000000000
Binary files a/vignettes/images/general_figs/temp_workflow.png and /dev/null differ
diff --git a/vignettes/images/general_figs/visium_brain_image_summary.png b/vignettes/images/general_figs/visium_brain_image_summary.png
deleted file mode 100644
index ff5a93011..000000000
Binary files a/vignettes/images/general_figs/visium_brain_image_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/visium_kidney_image_summary.png b/vignettes/images/general_figs/visium_kidney_image_summary.png
deleted file mode 100644
index 487a2e2f4..000000000
Binary files a/vignettes/images/general_figs/visium_kidney_image_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/visium_prostate_summary.png b/vignettes/images/general_figs/visium_prostate_summary.png
deleted file mode 100644
index 946b4c4c5..000000000
Binary files a/vignettes/images/general_figs/visium_prostate_summary.png and /dev/null differ
diff --git a/vignettes/images/general_figs/visium_technology.png b/vignettes/images/general_figs/visium_technology.png
deleted file mode 100644
index cc3bb159f..000000000
Binary files a/vignettes/images/general_figs/visium_technology.png and /dev/null differ
diff --git a/vignettes/images/general_figs/vizgen_brain_summary.png b/vignettes/images/general_figs/vizgen_brain_summary.png
deleted file mode 100644
index 6cdc55ba0..000000000
Binary files a/vignettes/images/general_figs/vizgen_brain_summary.png and /dev/null differ
diff --git a/vignettes/images/image_alignment/high_res_IT.png b/vignettes/images/image_alignment/high_res_IT.png
deleted file mode 100644
index b9ea26705..000000000
Binary files a/vignettes/images/image_alignment/high_res_IT.png and /dev/null differ
diff --git a/vignettes/images/image_alignment/images_adjust.png b/vignettes/images/image_alignment/images_adjust.png
deleted file mode 100644
index 887e3255f..000000000
Binary files a/vignettes/images/image_alignment/images_adjust.png and /dev/null differ
diff --git a/vignettes/images/image_alignment/images_coord_diffs.png b/vignettes/images/image_alignment/images_coord_diffs.png
deleted file mode 100644
index f8b553937..000000000
Binary files a/vignettes/images/image_alignment/images_coord_diffs.png and /dev/null differ
diff --git a/vignettes/images/image_alignment/images_inverty.png b/vignettes/images/image_alignment/images_inverty.png
deleted file mode 100644
index 4246004f2..000000000
Binary files a/vignettes/images/image_alignment/images_inverty.png and /dev/null differ
diff --git a/vignettes/images/image_alignment/low_res_IT.png b/vignettes/images/image_alignment/low_res_IT.png
deleted file mode 100644
index 5f7daf4da..000000000
Binary files a/vignettes/images/image_alignment/low_res_IT.png and /dev/null differ
diff --git a/vignettes/images/image_alignment/low_res_after_update_IT.png b/vignettes/images/image_alignment/low_res_after_update_IT.png
deleted file mode 100644
index aeb8087a9..000000000
Binary files a/vignettes/images/image_alignment/low_res_after_update_IT.png and /dev/null differ
diff --git a/vignettes/images/image_alignment/low_res_before_update_IT.png b/vignettes/images/image_alignment/low_res_before_update_IT.png
deleted file mode 100644
index 92848794e..000000000
Binary files a/vignettes/images/image_alignment/low_res_before_update_IT.png and /dev/null differ
diff --git a/vignettes/images/image_alignment/low_res_update_manual_IT.png b/vignettes/images/image_alignment/low_res_update_manual_IT.png
deleted file mode 100644
index aeb8087a9..000000000
Binary files a/vignettes/images/image_alignment/low_res_update_manual_IT.png and /dev/null differ
diff --git a/vignettes/images/installation/timeout.png b/vignettes/images/installation/timeout.png
deleted file mode 100644
index 24899beaf..000000000
Binary files a/vignettes/images/installation/timeout.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/1-interactive_brain_spots.png b/vignettes/images/interactive_selection/1-interactive_brain_spots.png
deleted file mode 100644
index dd17e84b9..000000000
Binary files a/vignettes/images/interactive_selection/1-interactive_brain_spots.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/10-get_cells.png b/vignettes/images/interactive_selection/10-get_cells.png
deleted file mode 100644
index 118699cc5..000000000
Binary files a/vignettes/images/interactive_selection/10-get_cells.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/11-compare_genes.png b/vignettes/images/interactive_selection/11-compare_genes.png
deleted file mode 100644
index 01a1616b0..000000000
Binary files a/vignettes/images/interactive_selection/11-compare_genes.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/12-compare_topgenes.png b/vignettes/images/interactive_selection/12-compare_topgenes.png
deleted file mode 100644
index c7fcf071c..000000000
Binary files a/vignettes/images/interactive_selection/12-compare_topgenes.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/13-compare_cell_abundance.png b/vignettes/images/interactive_selection/13-compare_cell_abundance.png
deleted file mode 100644
index 1fb333e2d..000000000
Binary files a/vignettes/images/interactive_selection/13-compare_cell_abundance.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/14-compare_spatplots.png b/vignettes/images/interactive_selection/14-compare_spatplots.png
deleted file mode 100644
index 6e4dc6759..000000000
Binary files a/vignettes/images/interactive_selection/14-compare_spatplots.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/15-compare_spatfeatplot.png b/vignettes/images/interactive_selection/15-compare_spatfeatplot.png
deleted file mode 100644
index 2954cca42..000000000
Binary files a/vignettes/images/interactive_selection/15-compare_spatfeatplot.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/16-plotPolygons.png b/vignettes/images/interactive_selection/16-plotPolygons.png
deleted file mode 100644
index 74cac16b9..000000000
Binary files a/vignettes/images/interactive_selection/16-plotPolygons.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/17-plotPolygon2.png b/vignettes/images/interactive_selection/17-plotPolygon2.png
deleted file mode 100644
index acec4eba8..000000000
Binary files a/vignettes/images/interactive_selection/17-plotPolygon2.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/2-interactive_brain_tissue.png b/vignettes/images/interactive_selection/2-interactive_brain_tissue.png
deleted file mode 100644
index c928d3336..000000000
Binary files a/vignettes/images/interactive_selection/2-interactive_brain_tissue.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/3-interactive_brain_black.png b/vignettes/images/interactive_selection/3-interactive_brain_black.png
deleted file mode 100644
index 6ec5e9cc6..000000000
Binary files a/vignettes/images/interactive_selection/3-interactive_brain_black.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/4-interactive_brain_height.png b/vignettes/images/interactive_selection/4-interactive_brain_height.png
deleted file mode 100644
index 84bbc4333..000000000
Binary files a/vignettes/images/interactive_selection/4-interactive_brain_height.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/5-interactive_brain_zoom.png b/vignettes/images/interactive_selection/5-interactive_brain_zoom.png
deleted file mode 100644
index 5ce8201a9..000000000
Binary files a/vignettes/images/interactive_selection/5-interactive_brain_zoom.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/6-my_polygon_coordinates.png b/vignettes/images/interactive_selection/6-my_polygon_coordinates.png
deleted file mode 100644
index 2075b53af..000000000
Binary files a/vignettes/images/interactive_selection/6-my_polygon_coordinates.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/7-new_metadata.png b/vignettes/images/interactive_selection/7-new_metadata.png
deleted file mode 100644
index a38859357..000000000
Binary files a/vignettes/images/interactive_selection/7-new_metadata.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/7-new_metadata_prev.png b/vignettes/images/interactive_selection/7-new_metadata_prev.png
deleted file mode 100644
index b8bf10092..000000000
Binary files a/vignettes/images/interactive_selection/7-new_metadata_prev.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/8-new_metadata_customized.png b/vignettes/images/interactive_selection/8-new_metadata_customized.png
deleted file mode 100644
index 2989e6a06..000000000
Binary files a/vignettes/images/interactive_selection/8-new_metadata_customized.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/8-new_metadata_customized_prev.png b/vignettes/images/interactive_selection/8-new_metadata_customized_prev.png
deleted file mode 100644
index db6598e89..000000000
Binary files a/vignettes/images/interactive_selection/8-new_metadata_customized_prev.png and /dev/null differ
diff --git a/vignettes/images/interactive_selection/9-get_cells_polygon_1.png b/vignettes/images/interactive_selection/9-get_cells_polygon_1.png
deleted file mode 100644
index 1026c0b23..000000000
Binary files a/vignettes/images/interactive_selection/9-get_cells_polygon_1.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/0-filterDistributions.png b/vignettes/images/merfish_mouse_hypothalamic/0-filterDistributions.png
deleted file mode 100644
index eba7c1ee6..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/0-filterDistributions.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/1-filterDistributions.png b/vignettes/images/merfish_mouse_hypothalamic/1-filterDistributions.png
deleted file mode 100644
index a3e9cb776..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/1-filterDistributions.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/10-plotMetaDataHeatmap.png b/vignettes/images/merfish_mouse_hypothalamic/10-plotMetaDataHeatmap.png
deleted file mode 100644
index 669b990b2..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/10-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/11-plotMetaDataHeatmap.png b/vignettes/images/merfish_mouse_hypothalamic/11-plotMetaDataHeatmap.png
deleted file mode 100644
index 377919c69..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/11-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/12-plotMetaDataHeatmap.png b/vignettes/images/merfish_mouse_hypothalamic/12-plotMetaDataHeatmap.png
deleted file mode 100644
index 92bb96fd8..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/12-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/13-UMAP_3D.png b/vignettes/images/merfish_mouse_hypothalamic/13-UMAP_3D.png
deleted file mode 100644
index 240262778..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/13-UMAP_3D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/14-spat3D.png b/vignettes/images/merfish_mouse_hypothalamic/14-spat3D.png
deleted file mode 100644
index e530ee6e7..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/14-spat3D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/15-spatPlot2D.png b/vignettes/images/merfish_mouse_hypothalamic/15-spatPlot2D.png
deleted file mode 100644
index a10c1dd0c..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/15-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/16-spat3D.png b/vignettes/images/merfish_mouse_hypothalamic/16-spat3D.png
deleted file mode 100644
index b8d03ceec..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/16-spat3D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/17-spatPlot2D.png b/vignettes/images/merfish_mouse_hypothalamic/17-spatPlot2D.png
deleted file mode 100644
index 588fa1452..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/17-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/18-spat3D.png b/vignettes/images/merfish_mouse_hypothalamic/18-spat3D.png
deleted file mode 100644
index 2e62ed179..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/18-spat3D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/19-spatPlot2D.png b/vignettes/images/merfish_mouse_hypothalamic/19-spatPlot2D.png
deleted file mode 100644
index 6ca52576c..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/19-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/2-filterCombinations.png b/vignettes/images/merfish_mouse_hypothalamic/2-filterCombinations.png
deleted file mode 100644
index da6da98c5..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/2-filterCombinations.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/20-spat3D.png b/vignettes/images/merfish_mouse_hypothalamic/20-spat3D.png
deleted file mode 100644
index 26ebbf351..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/20-spat3D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/21-spatPlot2D.png b/vignettes/images/merfish_mouse_hypothalamic/21-spatPlot2D.png
deleted file mode 100644
index a60e4f60b..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/21-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/22-spat3D.png b/vignettes/images/merfish_mouse_hypothalamic/22-spat3D.png
deleted file mode 100644
index 375d31082..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/22-spat3D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/23-spatPlot2D.png b/vignettes/images/merfish_mouse_hypothalamic/23-spatPlot2D.png
deleted file mode 100644
index cbb35c20a..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/23-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/3-spatPlot2D.png b/vignettes/images/merfish_mouse_hypothalamic/3-spatPlot2D.png
deleted file mode 100644
index f6f60218a..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/3-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/4-spat3D.png b/vignettes/images/merfish_mouse_hypothalamic/4-spat3D.png
deleted file mode 100644
index 358196cbb..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/4-spat3D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/5-screePlot.png b/vignettes/images/merfish_mouse_hypothalamic/5-screePlot.png
deleted file mode 100644
index 968857c33..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/5-screePlot.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/6-UMAP_3D.png b/vignettes/images/merfish_mouse_hypothalamic/6-UMAP_3D.png
deleted file mode 100644
index 102e00b8b..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/6-UMAP_3D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/7-UMAP_3D.png b/vignettes/images/merfish_mouse_hypothalamic/7-UMAP_3D.png
deleted file mode 100644
index 111bab771..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/7-UMAP_3D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/8-spatPlot2D.png b/vignettes/images/merfish_mouse_hypothalamic/8-spatPlot2D.png
deleted file mode 100644
index 5d73661e2..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/8-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/merfish_mouse_hypothalamic/9-violinPlot.png b/vignettes/images/merfish_mouse_hypothalamic/9-violinPlot.png
deleted file mode 100644
index 755adf60a..000000000
Binary files a/vignettes/images/merfish_mouse_hypothalamic/9-violinPlot.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/0-HVFplot.png b/vignettes/images/mini_seqfish/0-HVFplot.png
deleted file mode 100644
index 18ddea8f3..000000000
Binary files a/vignettes/images/mini_seqfish/0-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/1-screePlot.png b/vignettes/images/mini_seqfish/1-screePlot.png
deleted file mode 100644
index 2402070ef..000000000
Binary files a/vignettes/images/mini_seqfish/1-screePlot.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/10-plotMetaDataHeatmap.png b/vignettes/images/mini_seqfish/10-plotMetaDataHeatmap.png
deleted file mode 100644
index 8fae7a2e7..000000000
Binary files a/vignettes/images/mini_seqfish/10-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/11-spatDimPlot2D.png b/vignettes/images/mini_seqfish/11-spatDimPlot2D.png
deleted file mode 100644
index c365f4e70..000000000
Binary files a/vignettes/images/mini_seqfish/11-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/12-plotHeatmap.png b/vignettes/images/mini_seqfish/12-plotHeatmap.png
deleted file mode 100644
index 13ab9cc59..000000000
Binary files a/vignettes/images/mini_seqfish/12-plotHeatmap.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/13-spatPlot2D.png b/vignettes/images/mini_seqfish/13-spatPlot2D.png
deleted file mode 100644
index 1cefb1b62..000000000
Binary files a/vignettes/images/mini_seqfish/13-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/14-plotStatDelaunayNetwork.png b/vignettes/images/mini_seqfish/14-plotStatDelaunayNetwork.png
deleted file mode 100644
index eeb57557b..000000000
Binary files a/vignettes/images/mini_seqfish/14-plotStatDelaunayNetwork.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/15-spatPlot2D.png b/vignettes/images/mini_seqfish/15-spatPlot2D.png
deleted file mode 100644
index f356a01bf..000000000
Binary files a/vignettes/images/mini_seqfish/15-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/16-spatPlot2D.png b/vignettes/images/mini_seqfish/16-spatPlot2D.png
deleted file mode 100644
index ab67aee5f..000000000
Binary files a/vignettes/images/mini_seqfish/16-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/17-spatFeatPlot2D.png b/vignettes/images/mini_seqfish/17-spatFeatPlot2D.png
deleted file mode 100644
index a59aa46c3..000000000
Binary files a/vignettes/images/mini_seqfish/17-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/18-spatFeatPlot2D.png b/vignettes/images/mini_seqfish/18-spatFeatPlot2D.png
deleted file mode 100644
index 281d6068b..000000000
Binary files a/vignettes/images/mini_seqfish/18-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/19-spatFeatPlot2D.png b/vignettes/images/mini_seqfish/19-spatFeatPlot2D.png
deleted file mode 100644
index 52a6fe0e7..000000000
Binary files a/vignettes/images/mini_seqfish/19-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/2-PCA.png b/vignettes/images/mini_seqfish/2-PCA.png
deleted file mode 100644
index 3d9c011f4..000000000
Binary files a/vignettes/images/mini_seqfish/2-PCA.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/20-heatmSpatialCorFeats.png b/vignettes/images/mini_seqfish/20-heatmSpatialCorFeats.png
deleted file mode 100644
index 33dd24ca6..000000000
Binary files a/vignettes/images/mini_seqfish/20-heatmSpatialCorFeats.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/21-rankSpatialCorGroups.png b/vignettes/images/mini_seqfish/21-rankSpatialCorGroups.png
deleted file mode 100644
index 279107052..000000000
Binary files a/vignettes/images/mini_seqfish/21-rankSpatialCorGroups.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/22-spatCellPlot2D.png b/vignettes/images/mini_seqfish/22-spatCellPlot2D.png
deleted file mode 100644
index 4d5813eb4..000000000
Binary files a/vignettes/images/mini_seqfish/22-spatCellPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/23-spatPlot2D.png b/vignettes/images/mini_seqfish/23-spatPlot2D.png
deleted file mode 100644
index b268811f7..000000000
Binary files a/vignettes/images/mini_seqfish/23-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/24-cellProximityBarplot.png b/vignettes/images/mini_seqfish/24-cellProximityBarplot.png
deleted file mode 100644
index 94bb4cb60..000000000
Binary files a/vignettes/images/mini_seqfish/24-cellProximityBarplot.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/25-cellProximityHeatmap.png b/vignettes/images/mini_seqfish/25-cellProximityHeatmap.png
deleted file mode 100644
index bc8e9439b..000000000
Binary files a/vignettes/images/mini_seqfish/25-cellProximityHeatmap.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/26-cellProximityNetwork.png b/vignettes/images/mini_seqfish/26-cellProximityNetwork.png
deleted file mode 100644
index d113dec33..000000000
Binary files a/vignettes/images/mini_seqfish/26-cellProximityNetwork.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/27-cellProximityNetwork.png b/vignettes/images/mini_seqfish/27-cellProximityNetwork.png
deleted file mode 100644
index 7bc7bfdfe..000000000
Binary files a/vignettes/images/mini_seqfish/27-cellProximityNetwork.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/28-cellProximitySpatPlot2D.png b/vignettes/images/mini_seqfish/28-cellProximitySpatPlot2D.png
deleted file mode 100644
index bce079044..000000000
Binary files a/vignettes/images/mini_seqfish/28-cellProximitySpatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/29-spatPlot2D.png b/vignettes/images/mini_seqfish/29-spatPlot2D.png
deleted file mode 100644
index 51176a002..000000000
Binary files a/vignettes/images/mini_seqfish/29-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/3-UMAP.png b/vignettes/images/mini_seqfish/3-UMAP.png
deleted file mode 100644
index 0f9c03543..000000000
Binary files a/vignettes/images/mini_seqfish/3-UMAP.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/30-plotCellProximityFeats.png b/vignettes/images/mini_seqfish/30-plotCellProximityFeats.png
deleted file mode 100644
index 6c5b63929..000000000
Binary files a/vignettes/images/mini_seqfish/30-plotCellProximityFeats.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/31-plotICF.png b/vignettes/images/mini_seqfish/31-plotICF.png
deleted file mode 100644
index ae6d4f496..000000000
Binary files a/vignettes/images/mini_seqfish/31-plotICF.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/32-plotCCcomHeatmap.png b/vignettes/images/mini_seqfish/32-plotCCcomHeatmap.png
deleted file mode 100644
index b16a06169..000000000
Binary files a/vignettes/images/mini_seqfish/32-plotCCcomHeatmap.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/33-plotCCcomDotplot.png b/vignettes/images/mini_seqfish/33-plotCCcomDotplot.png
deleted file mode 100644
index a1f609129..000000000
Binary files a/vignettes/images/mini_seqfish/33-plotCCcomDotplot.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/34-plotRankSpatvsExpr.png b/vignettes/images/mini_seqfish/34-plotRankSpatvsExpr.png
deleted file mode 100644
index 9fdfd9115..000000000
Binary files a/vignettes/images/mini_seqfish/34-plotRankSpatvsExpr.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/35-plotRecovery.png b/vignettes/images/mini_seqfish/35-plotRecovery.png
deleted file mode 100644
index 78729b3b4..000000000
Binary files a/vignettes/images/mini_seqfish/35-plotRecovery.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/4-tSNE.png b/vignettes/images/mini_seqfish/4-tSNE.png
deleted file mode 100644
index d38ae3d97..000000000
Binary files a/vignettes/images/mini_seqfish/4-tSNE.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/5-UMAP.png b/vignettes/images/mini_seqfish/5-UMAP.png
deleted file mode 100644
index e508785bd..000000000
Binary files a/vignettes/images/mini_seqfish/5-UMAP.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/6-spatDimPlot2D.png b/vignettes/images/mini_seqfish/6-spatDimPlot2D.png
deleted file mode 100644
index 249ba6a3c..000000000
Binary files a/vignettes/images/mini_seqfish/6-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/7-showClusterHeatmap.png b/vignettes/images/mini_seqfish/7-showClusterHeatmap.png
deleted file mode 100644
index e81ba437c..000000000
Binary files a/vignettes/images/mini_seqfish/7-showClusterHeatmap.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/8-showClusterDendrogram.png b/vignettes/images/mini_seqfish/8-showClusterDendrogram.png
deleted file mode 100644
index 8c6b80c72..000000000
Binary files a/vignettes/images/mini_seqfish/8-showClusterDendrogram.png and /dev/null differ
diff --git a/vignettes/images/mini_seqfish/9-violinPlot.png b/vignettes/images/mini_seqfish/9-violinPlot.png
deleted file mode 100644
index 4193c7b99..000000000
Binary files a/vignettes/images/mini_seqfish/9-violinPlot.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/0-spatPlot2D.png b/vignettes/images/mouse_embryo_dbitseq/0-spatPlot2D.png
deleted file mode 100644
index a1622c04c..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/0-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/1-spatPlot2D.png b/vignettes/images/mouse_embryo_dbitseq/1-spatPlot2D.png
deleted file mode 100644
index 04e6f4e01..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/1-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/10-UMAP.png b/vignettes/images/mouse_embryo_dbitseq/10-UMAP.png
deleted file mode 100644
index 3d9ed2dfa..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/10-UMAP.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/11-UMAP.png b/vignettes/images/mouse_embryo_dbitseq/11-UMAP.png
deleted file mode 100644
index b3166df46..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/11-UMAP.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/12-spatPlot2D.png b/vignettes/images/mouse_embryo_dbitseq/12-spatPlot2D.png
deleted file mode 100644
index ab7173279..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/12-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/13-spatPlot2D.png b/vignettes/images/mouse_embryo_dbitseq/13-spatPlot2D.png
deleted file mode 100644
index bdde23c22..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/13-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/14-UMAP.png b/vignettes/images/mouse_embryo_dbitseq/14-UMAP.png
deleted file mode 100644
index 1c7d5f3f9..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/14-UMAP.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/15-spatPlot2D.png b/vignettes/images/mouse_embryo_dbitseq/15-spatPlot2D.png
deleted file mode 100644
index 83328c21b..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/15-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/2-spatPlot2D.png b/vignettes/images/mouse_embryo_dbitseq/2-spatPlot2D.png
deleted file mode 100644
index b5d356cd3..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/2-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/3-HVFplot.png b/vignettes/images/mouse_embryo_dbitseq/3-HVFplot.png
deleted file mode 100644
index 6d25b2a81..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/3-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/4-screePlot.png b/vignettes/images/mouse_embryo_dbitseq/4-screePlot.png
deleted file mode 100644
index 442f3fa1b..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/4-screePlot.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/5-PCA.png b/vignettes/images/mouse_embryo_dbitseq/5-PCA.png
deleted file mode 100644
index 041278676..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/5-PCA.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/6-screePlot.png b/vignettes/images/mouse_embryo_dbitseq/6-screePlot.png
deleted file mode 100644
index 69a97d7a8..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/6-screePlot.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/7-PCA.png b/vignettes/images/mouse_embryo_dbitseq/7-PCA.png
deleted file mode 100644
index ebb8e9b84..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/7-PCA.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/8-UMAP.png b/vignettes/images/mouse_embryo_dbitseq/8-UMAP.png
deleted file mode 100644
index 9f8f23936..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/8-UMAP.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/9-UMAP.png b/vignettes/images/mouse_embryo_dbitseq/9-UMAP.png
deleted file mode 100644
index 742555c35..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/9-UMAP.png and /dev/null differ
diff --git a/vignettes/images/mouse_embryo_dbitseq/integrated_deconvolution.png b/vignettes/images/mouse_embryo_dbitseq/integrated_deconvolution.png
deleted file mode 100644
index b79cf6d66..000000000
Binary files a/vignettes/images/mouse_embryo_dbitseq/integrated_deconvolution.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/10.1_gini_violin.png b/vignettes/images/nanostring_cosmx_lung_cancer/10.1_gini_violin.png
deleted file mode 100644
index 32f06a26b..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/10.1_gini_violin.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/10.2_heatmap.png b/vignettes/images/nanostring_cosmx_lung_cancer/10.2_heatmap.png
deleted file mode 100644
index 1a3a4e992..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/10.2_heatmap.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/10.3_gini_genes.png b/vignettes/images/nanostring_cosmx_lung_cancer/10.3_gini_genes.png
deleted file mode 100644
index 1d3f627d5..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/10.3_gini_genes.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/11_anno_umap.png b/vignettes/images/nanostring_cosmx_lung_cancer/11_anno_umap.png
deleted file mode 100644
index 4e401130e..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/11_anno_umap.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/12_spatdim_type.png b/vignettes/images/nanostring_cosmx_lung_cancer/12_spatdim_type.png
deleted file mode 100644
index 7e6299ce4..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/12_spatdim_type.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/13_insitu_type.png b/vignettes/images/nanostring_cosmx_lung_cancer/13_insitu_type.png
deleted file mode 100644
index b85be6c39..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/13_insitu_type.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/14_ICF.png b/vignettes/images/nanostring_cosmx_lung_cancer/14_ICF.png
deleted file mode 100644
index db1d13f18..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/14_ICF.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/1_inSituFeats.png b/vignettes/images/nanostring_cosmx_lung_cancer/1_inSituFeats.png
deleted file mode 100644
index 1596968d2..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/1_inSituFeats.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/2_spatCentroids.png b/vignettes/images/nanostring_cosmx_lung_cancer/2_spatCentroids.png
deleted file mode 100644
index ac8c7efe3..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/2_spatCentroids.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/3.1_totalexpr.png b/vignettes/images/nanostring_cosmx_lung_cancer/3.1_totalexpr.png
deleted file mode 100644
index 5ae2bce5f..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/3.1_totalexpr.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/3.2_totalnegprbe.png b/vignettes/images/nanostring_cosmx_lung_cancer/3.2_totalnegprbe.png
deleted file mode 100644
index f00a32730..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/3.2_totalnegprbe.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/4_inSituDens.png b/vignettes/images/nanostring_cosmx_lung_cancer/4_inSituDens.png
deleted file mode 100644
index 104044fb0..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/4_inSituDens.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/5.1_rna_norm_total_hist.png b/vignettes/images/nanostring_cosmx_lung_cancer/5.1_rna_norm_total_hist.png
deleted file mode 100644
index 9f2800ee8..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/5.1_rna_norm_total_hist.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/5.2_neg_norm_total_hist.png b/vignettes/images/nanostring_cosmx_lung_cancer/5.2_neg_norm_total_hist.png
deleted file mode 100644
index 466cd969c..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/5.2_neg_norm_total_hist.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/5.3_color_centroids.png b/vignettes/images/nanostring_cosmx_lung_cancer/5.3_color_centroids.png
deleted file mode 100644
index 57eb5d363..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/5.3_color_centroids.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/5.4_rna_color_polys.png b/vignettes/images/nanostring_cosmx_lung_cancer/5.4_rna_color_polys.png
deleted file mode 100644
index 3ebd98b93..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/5.4_rna_color_polys.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/5.5_neg_color_polys.png b/vignettes/images/nanostring_cosmx_lung_cancer/5.5_neg_color_polys.png
deleted file mode 100644
index 1b2cf4f59..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/5.5_neg_color_polys.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/6.1_pearson_HVF.png b/vignettes/images/nanostring_cosmx_lung_cancer/6.1_pearson_HVF.png
deleted file mode 100644
index 9a10e0735..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/6.1_pearson_HVF.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/6.2_screeplot.png b/vignettes/images/nanostring_cosmx_lung_cancer/6.2_screeplot.png
deleted file mode 100644
index 4a8c1775c..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/6.2_screeplot.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/6.3_PCA.png b/vignettes/images/nanostring_cosmx_lung_cancer/6.3_PCA.png
deleted file mode 100644
index 36b89acc0..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/6.3_PCA.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/6.4_UMAP.png b/vignettes/images/nanostring_cosmx_lung_cancer/6.4_UMAP.png
deleted file mode 100644
index 647be4115..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/6.4_UMAP.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/6.5_UMAP_feats.png b/vignettes/images/nanostring_cosmx_lung_cancer/6.5_UMAP_feats.png
deleted file mode 100644
index 814ad53b1..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/6.5_UMAP_feats.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/7.1_UMAP_leiden.png b/vignettes/images/nanostring_cosmx_lung_cancer/7.1_UMAP_leiden.png
deleted file mode 100644
index e4382b43f..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/7.1_UMAP_leiden.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/7.2_spatdim_leiden.png b/vignettes/images/nanostring_cosmx_lung_cancer/7.2_spatdim_leiden.png
deleted file mode 100644
index c933bebc1..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/7.2_spatdim_leiden.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/7.3_spatinsitu_leiden.png b/vignettes/images/nanostring_cosmx_lung_cancer/7.3_spatinsitu_leiden.png
deleted file mode 100644
index e797d4b8c..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/7.3_spatinsitu_leiden.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/8.1_smallfov_points.png b/vignettes/images/nanostring_cosmx_lung_cancer/8.1_smallfov_points.png
deleted file mode 100644
index 0b0f95bc9..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/8.1_smallfov_points.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/8.2_smallfov_poly.png b/vignettes/images/nanostring_cosmx_lung_cancer/8.2_smallfov_poly.png
deleted file mode 100644
index 3f091e877..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/8.2_smallfov_poly.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/8.3_smallfov_leiden.png b/vignettes/images/nanostring_cosmx_lung_cancer/8.3_smallfov_leiden.png
deleted file mode 100644
index 09bae069c..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/8.3_smallfov_leiden.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/9_binspect_genes.png b/vignettes/images/nanostring_cosmx_lung_cancer/9_binspect_genes.png
deleted file mode 100644
index 2a53edf99..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/9_binspect_genes.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/mat_comparison.png b/vignettes/images/nanostring_cosmx_lung_cancer/mat_comparison.png
deleted file mode 100644
index 855196eaa..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/mat_comparison.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/preview_negprb.png b/vignettes/images/nanostring_cosmx_lung_cancer/preview_negprb.png
deleted file mode 100644
index ca277dd5f..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/preview_negprb.png and /dev/null differ
diff --git a/vignettes/images/nanostring_cosmx_lung_cancer/values_diff.png b/vignettes/images/nanostring_cosmx_lung_cancer/values_diff.png
deleted file mode 100644
index 2db2d4ceb..000000000
Binary files a/vignettes/images/nanostring_cosmx_lung_cancer/values_diff.png and /dev/null differ
diff --git a/vignettes/images/object_creation/Giotto_suite_object-01.svg b/vignettes/images/object_creation/Giotto_suite_object-01.svg
deleted file mode 100644
index 74f543158..000000000
--- a/vignettes/images/object_creation/Giotto_suite_object-01.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/vignettes/images/object_creation/Giotto_suite_object-02.svg b/vignettes/images/object_creation/Giotto_suite_object-02.svg
deleted file mode 100644
index dd976717d..000000000
--- a/vignettes/images/object_creation/Giotto_suite_object-02.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/vignettes/images/object_creation/Giotto_suite_object-03.svg b/vignettes/images/object_creation/Giotto_suite_object-03.svg
deleted file mode 100644
index de97e0faa..000000000
--- a/vignettes/images/object_creation/Giotto_suite_object-03.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/vignettes/images/object_creation/cell_clusters.png b/vignettes/images/object_creation/cell_clusters.png
deleted file mode 100644
index c9007086d..000000000
Binary files a/vignettes/images/object_creation/cell_clusters.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/0-HVGplot.png b/vignettes/images/osmfish_mouse_ss_cortex/0-HVGplot.png
deleted file mode 100644
index e4669e289..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/0-HVGplot.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/1-screePlot.png b/vignettes/images/osmfish_mouse_ss_cortex/1-screePlot.png
deleted file mode 100644
index 6a04fad00..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/1-screePlot.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/10_a_spatial_genes_km.png b/vignettes/images/osmfish_mouse_ss_cortex/10_a_spatial_genes_km.png
deleted file mode 100644
index 758f41123..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/10_a_spatial_genes_km.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/12_a_barplot_cell_cell_enrichment.png b/vignettes/images/osmfish_mouse_ss_cortex/12_a_barplot_cell_cell_enrichment.png
deleted file mode 100644
index 0113f703b..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/12_a_barplot_cell_cell_enrichment.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/12_b_heatmap_cell_cell_enrichment.png b/vignettes/images/osmfish_mouse_ss_cortex/12_b_heatmap_cell_cell_enrichment.png
deleted file mode 100644
index d9f6d9db1..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/12_b_heatmap_cell_cell_enrichment.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/12_c_network_cell_cell_enrichment.png b/vignettes/images/osmfish_mouse_ss_cortex/12_c_network_cell_cell_enrichment.png
deleted file mode 100644
index ebb8746d3..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/12_c_network_cell_cell_enrichment.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/12_d_cell_cell_enrichment_selected.png b/vignettes/images/osmfish_mouse_ss_cortex/12_d_cell_cell_enrichment_selected.png
deleted file mode 100644
index bd365e297..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/12_d_cell_cell_enrichment_selected.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/2_a_original_clusters.png b/vignettes/images/osmfish_mouse_ss_cortex/2_a_original_clusters.png
deleted file mode 100644
index 21f4f87c6..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/2_a_original_clusters.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/2_b_original_regions.png b/vignettes/images/osmfish_mouse_ss_cortex/2_b_original_regions.png
deleted file mode 100644
index f9f5aac10..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/2_b_original_regions.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/2_c_clusterID.png b/vignettes/images/osmfish_mouse_ss_cortex/2_c_clusterID.png
deleted file mode 100644
index 472addc8f..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/2_c_clusterID.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/2_d_total_expr_limits.png b/vignettes/images/osmfish_mouse_ss_cortex/2_d_total_expr_limits.png
deleted file mode 100644
index d40522e86..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/2_d_total_expr_limits.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/3_a_screeplot.png b/vignettes/images/osmfish_mouse_ss_cortex/3_a_screeplot.png
deleted file mode 100644
index 5db628995..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/3_a_screeplot.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/3_b_PCA_reduction.png b/vignettes/images/osmfish_mouse_ss_cortex/3_b_PCA_reduction.png
deleted file mode 100644
index 38f0b69aa..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/3_b_PCA_reduction.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/3_c_UMAP_reduction.png b/vignettes/images/osmfish_mouse_ss_cortex/3_c_UMAP_reduction.png
deleted file mode 100644
index 9281c689a..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/3_c_UMAP_reduction.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/3_d_UMAP_reduction_expression.png b/vignettes/images/osmfish_mouse_ss_cortex/3_d_UMAP_reduction_expression.png
deleted file mode 100644
index fa54fae8b..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/3_d_UMAP_reduction_expression.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/3_e_tSNE_reduction.png b/vignettes/images/osmfish_mouse_ss_cortex/3_e_tSNE_reduction.png
deleted file mode 100644
index f313db11f..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/3_e_tSNE_reduction.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/4_a_UMAP_hclust.png b/vignettes/images/osmfish_mouse_ss_cortex/4_a_UMAP_hclust.png
deleted file mode 100644
index e459b8940..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/4_a_UMAP_hclust.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/4_b_UMAP_kmeans.png b/vignettes/images/osmfish_mouse_ss_cortex/4_b_UMAP_kmeans.png
deleted file mode 100644
index 1a0839a55..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/4_b_UMAP_kmeans.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/4_c_UMAP_leiden.png b/vignettes/images/osmfish_mouse_ss_cortex/4_c_UMAP_leiden.png
deleted file mode 100644
index c1aac8bff..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/4_c_UMAP_leiden.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/4_d_UMAP_leiden_merged.png b/vignettes/images/osmfish_mouse_ss_cortex/4_d_UMAP_leiden_merged.png
deleted file mode 100644
index 7a2014e7b..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/4_d_UMAP_leiden_merged.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/4_e_heatmap.png b/vignettes/images/osmfish_mouse_ss_cortex/4_e_heatmap.png
deleted file mode 100644
index 26986aeca..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/4_e_heatmap.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/4_f_dendro.png b/vignettes/images/osmfish_mouse_ss_cortex/4_f_dendro.png
deleted file mode 100644
index 221585444..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/4_f_dendro.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/5_a_covis_leiden.png b/vignettes/images/osmfish_mouse_ss_cortex/5_a_covis_leiden.png
deleted file mode 100644
index 73b431a2a..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/5_a_covis_leiden.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/5_b_covis_leiden_m.png b/vignettes/images/osmfish_mouse_ss_cortex/5_b_covis_leiden_m.png
deleted file mode 100644
index 54a1a4b6e..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/5_b_covis_leiden_m.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/5_c_covis_leiden_merged_selected.png b/vignettes/images/osmfish_mouse_ss_cortex/5_c_covis_leiden_merged_selected.png
deleted file mode 100644
index 5826dac34..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/5_c_covis_leiden_merged_selected.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/5_d_total_expr.png b/vignettes/images/osmfish_mouse_ss_cortex/5_d_total_expr.png
deleted file mode 100644
index c04612164..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/5_d_total_expr.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/6_a_dendrogram.png b/vignettes/images/osmfish_mouse_ss_cortex/6_a_dendrogram.png
deleted file mode 100644
index dad80fd38..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/6_a_dendrogram.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/6_a_violinplot.png b/vignettes/images/osmfish_mouse_ss_cortex/6_a_violinplot.png
deleted file mode 100644
index 3bb83c9c5..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/6_a_violinplot.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/6_b_metaheatmap.png b/vignettes/images/osmfish_mouse_ss_cortex/6_b_metaheatmap.png
deleted file mode 100644
index 4711e28c5..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/6_b_metaheatmap.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/6_e_metaheatmap_all_genes.png b/vignettes/images/osmfish_mouse_ss_cortex/6_e_metaheatmap_all_genes.png
deleted file mode 100644
index 4711e28c5..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/6_e_metaheatmap_all_genes.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/6_f_metaheatmap_all_genes_names.png b/vignettes/images/osmfish_mouse_ss_cortex/6_f_metaheatmap_all_genes_names.png
deleted file mode 100644
index 7760c61e9..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/6_f_metaheatmap_all_genes_names.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/7_c_clusterHeatmap_det_cell_types.png b/vignettes/images/osmfish_mouse_ss_cortex/7_c_clusterHeatmap_det_cell_types.png
deleted file mode 100644
index b7f9e80f5..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/7_c_clusterHeatmap_det_cell_types.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/7_e_metaheatmap.png b/vignettes/images/osmfish_mouse_ss_cortex/7_e_metaheatmap.png
deleted file mode 100644
index 14907956e..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/7_e_metaheatmap.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/8_grid_det_cell_types.png b/vignettes/images/osmfish_mouse_ss_cortex/8_grid_det_cell_types.png
deleted file mode 100644
index d7e8d8d01..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/8_grid_det_cell_types.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/9_spatial_network_k10.png b/vignettes/images/osmfish_mouse_ss_cortex/9_spatial_network_k10.png
deleted file mode 100644
index e48a506cf..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/9_spatial_network_k10.png and /dev/null differ
diff --git a/vignettes/images/osmfish_mouse_ss_cortex/osmfish_image_demo.png b/vignettes/images/osmfish_mouse_ss_cortex/osmfish_image_demo.png
deleted file mode 100644
index 163ed0e91..000000000
Binary files a/vignettes/images/osmfish_mouse_ss_cortex/osmfish_image_demo.png and /dev/null differ
diff --git a/vignettes/images/presentations/bioc-giotto-pres.png b/vignettes/images/presentations/bioc-giotto-pres.png
deleted file mode 100644
index 9cc8efb9a..000000000
Binary files a/vignettes/images/presentations/bioc-giotto-pres.png and /dev/null differ
diff --git a/vignettes/images/presentations/vues2023.png b/vignettes/images/presentations/vues2023.png
deleted file mode 100644
index fbf777e43..000000000
Binary files a/vignettes/images/presentations/vues2023.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/0-spatPlot2D.png b/vignettes/images/resolve_biosciences/0-spatPlot2D.png
deleted file mode 100644
index a80f2b0a5..000000000
Binary files a/vignettes/images/resolve_biosciences/0-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/1-spatPlot2D.png b/vignettes/images/resolve_biosciences/1-spatPlot2D.png
deleted file mode 100644
index 8bbea3f3d..000000000
Binary files a/vignettes/images/resolve_biosciences/1-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/12-showClusterDendrogram.png b/vignettes/images/resolve_biosciences/12-showClusterDendrogram.png
deleted file mode 100644
index 95816b15a..000000000
Binary files a/vignettes/images/resolve_biosciences/12-showClusterDendrogram.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/13-spatPlot2D.png b/vignettes/images/resolve_biosciences/13-spatPlot2D.png
deleted file mode 100644
index 083ee482a..000000000
Binary files a/vignettes/images/resolve_biosciences/13-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/16-spatInSituPlotPoints.png b/vignettes/images/resolve_biosciences/16-spatInSituPlotPoints.png
deleted file mode 100644
index 9b385d71f..000000000
Binary files a/vignettes/images/resolve_biosciences/16-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/17-spatInSituPlotPoints.png b/vignettes/images/resolve_biosciences/17-spatInSituPlotPoints.png
deleted file mode 100644
index a6f7771dd..000000000
Binary files a/vignettes/images/resolve_biosciences/17-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/18-spatInSituPlotPoints.png b/vignettes/images/resolve_biosciences/18-spatInSituPlotPoints.png
deleted file mode 100644
index 29877b9f7..000000000
Binary files a/vignettes/images/resolve_biosciences/18-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/19-spatInSituPlotPoints.png b/vignettes/images/resolve_biosciences/19-spatInSituPlotPoints.png
deleted file mode 100644
index acb470cb0..000000000
Binary files a/vignettes/images/resolve_biosciences/19-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/21-spatInSituPlotPoints.png b/vignettes/images/resolve_biosciences/21-spatInSituPlotPoints.png
deleted file mode 100644
index ca2ad57c0..000000000
Binary files a/vignettes/images/resolve_biosciences/21-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/22-spatInSituPlotPoints.png b/vignettes/images/resolve_biosciences/22-spatInSituPlotPoints.png
deleted file mode 100644
index e8f78bda7..000000000
Binary files a/vignettes/images/resolve_biosciences/22-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/39-UMAP.png b/vignettes/images/resolve_biosciences/39-UMAP.png
deleted file mode 100644
index b215962ea..000000000
Binary files a/vignettes/images/resolve_biosciences/39-UMAP.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/4-HVFplot.png b/vignettes/images/resolve_biosciences/4-HVFplot.png
deleted file mode 100644
index c8854d7e1..000000000
Binary files a/vignettes/images/resolve_biosciences/4-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/43-spatInSituPlotPoints.png b/vignettes/images/resolve_biosciences/43-spatInSituPlotPoints.png
deleted file mode 100644
index 843fa9de8..000000000
Binary files a/vignettes/images/resolve_biosciences/43-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/5-HVFplot.png b/vignettes/images/resolve_biosciences/5-HVFplot.png
deleted file mode 100644
index 0466887fb..000000000
Binary files a/vignettes/images/resolve_biosciences/5-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/51-spatDimPlot2D.png b/vignettes/images/resolve_biosciences/51-spatDimPlot2D.png
deleted file mode 100644
index ee0443ef7..000000000
Binary files a/vignettes/images/resolve_biosciences/51-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/54-spatInSituPlotPoints.png b/vignettes/images/resolve_biosciences/54-spatInSituPlotPoints.png
deleted file mode 100644
index 91a7806d7..000000000
Binary files a/vignettes/images/resolve_biosciences/54-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/6-screePlot.png b/vignettes/images/resolve_biosciences/6-screePlot.png
deleted file mode 100644
index 86c3cd553..000000000
Binary files a/vignettes/images/resolve_biosciences/6-screePlot.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/61-spatInSituPlotPoints.png b/vignettes/images/resolve_biosciences/61-spatInSituPlotPoints.png
deleted file mode 100644
index 9720deabf..000000000
Binary files a/vignettes/images/resolve_biosciences/61-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/66-spatInSituPlotPoints.png b/vignettes/images/resolve_biosciences/66-spatInSituPlotPoints.png
deleted file mode 100644
index e154a219b..000000000
Binary files a/vignettes/images/resolve_biosciences/66-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/69-spatPlot2D.png b/vignettes/images/resolve_biosciences/69-spatPlot2D.png
deleted file mode 100644
index ca1307af8..000000000
Binary files a/vignettes/images/resolve_biosciences/69-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/7-PCA.png b/vignettes/images/resolve_biosciences/7-PCA.png
deleted file mode 100644
index b366e2248..000000000
Binary files a/vignettes/images/resolve_biosciences/7-PCA.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/72-Heatmap.png b/vignettes/images/resolve_biosciences/72-Heatmap.png
deleted file mode 100644
index c1c76ff01..000000000
Binary files a/vignettes/images/resolve_biosciences/72-Heatmap.png and /dev/null differ
diff --git a/vignettes/images/resolve_biosciences/8-UMAP.png b/vignettes/images/resolve_biosciences/8-UMAP.png
deleted file mode 100644
index a5568a7b0..000000000
Binary files a/vignettes/images/resolve_biosciences/8-UMAP.png and /dev/null differ
diff --git a/vignettes/images/saving_object/unnamed-chunk-4-1.png b/vignettes/images/saving_object/unnamed-chunk-4-1.png
deleted file mode 100644
index 524d8341c..000000000
Binary files a/vignettes/images/saving_object/unnamed-chunk-4-1.png and /dev/null differ
diff --git a/vignettes/images/saving_object/unnamed-chunk-7-1.png b/vignettes/images/saving_object/unnamed-chunk-7-1.png
deleted file mode 100644
index 524d8341c..000000000
Binary files a/vignettes/images/saving_object/unnamed-chunk-7-1.png and /dev/null differ
diff --git a/vignettes/images/saving_object/unnamed-chunk-8-1.png b/vignettes/images/saving_object/unnamed-chunk-8-1.png
deleted file mode 100644
index 524d8341c..000000000
Binary files a/vignettes/images/saving_object/unnamed-chunk-8-1.png and /dev/null differ
diff --git a/vignettes/images/saving_plots/clusters_black.png b/vignettes/images/saving_plots/clusters_black.png
deleted file mode 100644
index 4249d0baf..000000000
Binary files a/vignettes/images/saving_plots/clusters_black.png and /dev/null differ
diff --git a/vignettes/images/saving_plots/unnamed-chunk-3-1.png b/vignettes/images/saving_plots/unnamed-chunk-3-1.png
deleted file mode 100644
index 6126ee52c..000000000
Binary files a/vignettes/images/saving_plots/unnamed-chunk-3-1.png and /dev/null differ
diff --git a/vignettes/images/saving_plots/unnamed-chunk-4-1.png b/vignettes/images/saving_plots/unnamed-chunk-4-1.png
deleted file mode 100644
index 6126ee52c..000000000
Binary files a/vignettes/images/saving_plots/unnamed-chunk-4-1.png and /dev/null differ
diff --git a/vignettes/images/saving_plots/unnamed-chunk-4-2.png b/vignettes/images/saving_plots/unnamed-chunk-4-2.png
deleted file mode 100644
index 6126ee52c..000000000
Binary files a/vignettes/images/saving_plots/unnamed-chunk-4-2.png and /dev/null differ
diff --git a/vignettes/images/saving_plots/unnamed-chunk-5-1.png b/vignettes/images/saving_plots/unnamed-chunk-5-1.png
deleted file mode 100644
index 6126ee52c..000000000
Binary files a/vignettes/images/saving_plots/unnamed-chunk-5-1.png and /dev/null differ
diff --git a/vignettes/images/saving_plots/unnamed-chunk-6-1.png b/vignettes/images/saving_plots/unnamed-chunk-6-1.png
deleted file mode 100644
index 6126ee52c..000000000
Binary files a/vignettes/images/saving_plots/unnamed-chunk-6-1.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/0-HVFplot.png b/vignettes/images/seqfish_cortex/0-HVFplot.png
deleted file mode 100644
index 7ffecad8c..000000000
Binary files a/vignettes/images/seqfish_cortex/0-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/0-filterDistributions.png b/vignettes/images/seqfish_cortex/0-filterDistributions.png
deleted file mode 100644
index 57196669f..000000000
Binary files a/vignettes/images/seqfish_cortex/0-filterDistributions.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/0-spatPlot2D.png b/vignettes/images/seqfish_cortex/0-spatPlot2D.png
deleted file mode 100644
index b0f395904..000000000
Binary files a/vignettes/images/seqfish_cortex/0-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/1-HVFplot.png b/vignettes/images/seqfish_cortex/1-HVFplot.png
deleted file mode 100644
index fa3eb6117..000000000
Binary files a/vignettes/images/seqfish_cortex/1-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/1-filterDistributions.png b/vignettes/images/seqfish_cortex/1-filterDistributions.png
deleted file mode 100644
index 9931e06f2..000000000
Binary files a/vignettes/images/seqfish_cortex/1-filterDistributions.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/10-UMAP.png b/vignettes/images/seqfish_cortex/10-UMAP.png
deleted file mode 100644
index 0dc096beb..000000000
Binary files a/vignettes/images/seqfish_cortex/10-UMAP.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/10-filterDistributions.png b/vignettes/images/seqfish_cortex/10-filterDistributions.png
deleted file mode 100644
index 49c524e6f..000000000
Binary files a/vignettes/images/seqfish_cortex/10-filterDistributions.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/11-filterCombinations.png b/vignettes/images/seqfish_cortex/11-filterCombinations.png
deleted file mode 100644
index 8aa82c0a0..000000000
Binary files a/vignettes/images/seqfish_cortex/11-filterCombinations.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/11-showClusterHeatmap.pdf b/vignettes/images/seqfish_cortex/11-showClusterHeatmap.pdf
deleted file mode 100644
index 08f5a6ffa..000000000
Binary files a/vignettes/images/seqfish_cortex/11-showClusterHeatmap.pdf and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/11-showClusterHeatmap.png b/vignettes/images/seqfish_cortex/11-showClusterHeatmap.png
deleted file mode 100644
index bc6dcef9e..000000000
Binary files a/vignettes/images/seqfish_cortex/11-showClusterHeatmap.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/12-filterCombinations.png b/vignettes/images/seqfish_cortex/12-filterCombinations.png
deleted file mode 100644
index 422162320..000000000
Binary files a/vignettes/images/seqfish_cortex/12-filterCombinations.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/12-showClusterDendrogram.png b/vignettes/images/seqfish_cortex/12-showClusterDendrogram.png
deleted file mode 100644
index 616690f3e..000000000
Binary files a/vignettes/images/seqfish_cortex/12-showClusterDendrogram.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/12_d_network_cell_cell_enrichment_self.png b/vignettes/images/seqfish_cortex/12_d_network_cell_cell_enrichment_self.png
deleted file mode 100644
index 07d3c0c66..000000000
Binary files a/vignettes/images/seqfish_cortex/12_d_network_cell_cell_enrichment_self.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/13-spatDimPlot2D.png b/vignettes/images/seqfish_cortex/13-spatDimPlot2D.png
deleted file mode 100644
index 445db3409..000000000
Binary files a/vignettes/images/seqfish_cortex/13-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/14-spatDimPlot2D.png b/vignettes/images/seqfish_cortex/14-spatDimPlot2D.png
deleted file mode 100644
index 4e935fd65..000000000
Binary files a/vignettes/images/seqfish_cortex/14-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/15-violinPlot.png b/vignettes/images/seqfish_cortex/15-violinPlot.png
deleted file mode 100644
index 449f37547..000000000
Binary files a/vignettes/images/seqfish_cortex/15-violinPlot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/16-plotMetaDataHeatmap.png b/vignettes/images/seqfish_cortex/16-plotMetaDataHeatmap.png
deleted file mode 100644
index 4143f58f2..000000000
Binary files a/vignettes/images/seqfish_cortex/16-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/17-violinPlot.png b/vignettes/images/seqfish_cortex/17-violinPlot.png
deleted file mode 100644
index eef918a47..000000000
Binary files a/vignettes/images/seqfish_cortex/17-violinPlot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/18-spatDimPlot2D.png b/vignettes/images/seqfish_cortex/18-spatDimPlot2D.png
deleted file mode 100644
index c48a886fb..000000000
Binary files a/vignettes/images/seqfish_cortex/18-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/19-plotHeatmap.png b/vignettes/images/seqfish_cortex/19-plotHeatmap.png
deleted file mode 100644
index 867970e10..000000000
Binary files a/vignettes/images/seqfish_cortex/19-plotHeatmap.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/2-HVFplot.png b/vignettes/images/seqfish_cortex/2-HVFplot.png
deleted file mode 100644
index 7abb11316..000000000
Binary files a/vignettes/images/seqfish_cortex/2-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/2-filterCombinations.png b/vignettes/images/seqfish_cortex/2-filterCombinations.png
deleted file mode 100644
index 0eee4f6f7..000000000
Binary files a/vignettes/images/seqfish_cortex/2-filterCombinations.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/2-screePlot.png b/vignettes/images/seqfish_cortex/2-screePlot.png
deleted file mode 100644
index 01eaf19ab..000000000
Binary files a/vignettes/images/seqfish_cortex/2-screePlot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/20-plotHeatmap.png b/vignettes/images/seqfish_cortex/20-plotHeatmap.png
deleted file mode 100644
index f34be7d45..000000000
Binary files a/vignettes/images/seqfish_cortex/20-plotHeatmap.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/21-spatPlot2D.png b/vignettes/images/seqfish_cortex/21-spatPlot2D.png
deleted file mode 100644
index 372f2b918..000000000
Binary files a/vignettes/images/seqfish_cortex/21-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/22-spatPlot2D.png b/vignettes/images/seqfish_cortex/22-spatPlot2D.png
deleted file mode 100644
index c77cc6ba0..000000000
Binary files a/vignettes/images/seqfish_cortex/22-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/23-spatPlot2D.png b/vignettes/images/seqfish_cortex/23-spatPlot2D.png
deleted file mode 100644
index 9ffb30462..000000000
Binary files a/vignettes/images/seqfish_cortex/23-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/24-spatPlot2D.png b/vignettes/images/seqfish_cortex/24-spatPlot2D.png
deleted file mode 100644
index 6b58b5e7c..000000000
Binary files a/vignettes/images/seqfish_cortex/24-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/25-spatPlot2D.png b/vignettes/images/seqfish_cortex/25-spatPlot2D.png
deleted file mode 100644
index 8c271472d..000000000
Binary files a/vignettes/images/seqfish_cortex/25-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/26-spatGenePlot2D.png b/vignettes/images/seqfish_cortex/26-spatGenePlot2D.png
deleted file mode 100644
index c5a39fa86..000000000
Binary files a/vignettes/images/seqfish_cortex/26-spatGenePlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/27-heatmSpatialCorFeats.pdf b/vignettes/images/seqfish_cortex/27-heatmSpatialCorFeats.pdf
deleted file mode 100644
index 72052fce8..000000000
Binary files a/vignettes/images/seqfish_cortex/27-heatmSpatialCorFeats.pdf and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/27-heatmSpatialCorFeats.png b/vignettes/images/seqfish_cortex/27-heatmSpatialCorFeats.png
deleted file mode 100644
index 25d1048be..000000000
Binary files a/vignettes/images/seqfish_cortex/27-heatmSpatialCorFeats.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/28-rankSpatialCorGroups.png b/vignettes/images/seqfish_cortex/28-rankSpatialCorGroups.png
deleted file mode 100644
index db425e9a5..000000000
Binary files a/vignettes/images/seqfish_cortex/28-rankSpatialCorGroups.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/29-spatCellPlot2D.png b/vignettes/images/seqfish_cortex/29-spatCellPlot2D.png
deleted file mode 100644
index ec281ce50..000000000
Binary files a/vignettes/images/seqfish_cortex/29-spatCellPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/3-PCA.png b/vignettes/images/seqfish_cortex/3-PCA.png
deleted file mode 100644
index dddf0b725..000000000
Binary files a/vignettes/images/seqfish_cortex/3-PCA.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/3-filterCombinations.png b/vignettes/images/seqfish_cortex/3-filterCombinations.png
deleted file mode 100644
index b2c9da679..000000000
Binary files a/vignettes/images/seqfish_cortex/3-filterCombinations.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/30-spatPlot2D.png b/vignettes/images/seqfish_cortex/30-spatPlot2D.png
deleted file mode 100644
index ea9142ec5..000000000
Binary files a/vignettes/images/seqfish_cortex/30-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/31-cellProximityBarplot.png b/vignettes/images/seqfish_cortex/31-cellProximityBarplot.png
deleted file mode 100644
index 1f0fc781a..000000000
Binary files a/vignettes/images/seqfish_cortex/31-cellProximityBarplot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/32-cellProximityHeatmap.pdf b/vignettes/images/seqfish_cortex/32-cellProximityHeatmap.pdf
deleted file mode 100644
index 43a9ebf5b..000000000
Binary files a/vignettes/images/seqfish_cortex/32-cellProximityHeatmap.pdf and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/32-cellProximityHeatmap.png b/vignettes/images/seqfish_cortex/32-cellProximityHeatmap.png
deleted file mode 100644
index 4433c9d2f..000000000
Binary files a/vignettes/images/seqfish_cortex/32-cellProximityHeatmap.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/33-cellProximityNetwork.png b/vignettes/images/seqfish_cortex/33-cellProximityNetwork.png
deleted file mode 100644
index d33cb4db2..000000000
Binary files a/vignettes/images/seqfish_cortex/33-cellProximityNetwork.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/34-cellProximitySpatPlot2D.png b/vignettes/images/seqfish_cortex/34-cellProximitySpatPlot2D.png
deleted file mode 100644
index 7119b8fe0..000000000
Binary files a/vignettes/images/seqfish_cortex/34-cellProximitySpatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/35-spatPlot2D.png b/vignettes/images/seqfish_cortex/35-spatPlot2D.png
deleted file mode 100644
index dd092ba0b..000000000
Binary files a/vignettes/images/seqfish_cortex/35-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/36-plotCellProximityGenes.png b/vignettes/images/seqfish_cortex/36-plotCellProximityGenes.png
deleted file mode 100644
index 102428f6d..000000000
Binary files a/vignettes/images/seqfish_cortex/36-plotCellProximityGenes.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/37-plotICF.png b/vignettes/images/seqfish_cortex/37-plotICF.png
deleted file mode 100644
index 337eddada..000000000
Binary files a/vignettes/images/seqfish_cortex/37-plotICF.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/38-plotCCcomDotplot.png b/vignettes/images/seqfish_cortex/38-plotCCcomDotplot.png
deleted file mode 100644
index b6c6d5aa9..000000000
Binary files a/vignettes/images/seqfish_cortex/38-plotCCcomDotplot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/39-plotRankSpatvsExpr.png b/vignettes/images/seqfish_cortex/39-plotRankSpatvsExpr.png
deleted file mode 100644
index d973156d6..000000000
Binary files a/vignettes/images/seqfish_cortex/39-plotRankSpatvsExpr.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/4-UMAP.png b/vignettes/images/seqfish_cortex/4-UMAP.png
deleted file mode 100644
index d409ffcbd..000000000
Binary files a/vignettes/images/seqfish_cortex/4-UMAP.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/4-filterCombinations.png b/vignettes/images/seqfish_cortex/4-filterCombinations.png
deleted file mode 100644
index 2f66149d3..000000000
Binary files a/vignettes/images/seqfish_cortex/4-filterCombinations.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/40-plotRecovery.png b/vignettes/images/seqfish_cortex/40-plotRecovery.png
deleted file mode 100644
index 8946596a7..000000000
Binary files a/vignettes/images/seqfish_cortex/40-plotRecovery.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/5-filterCombinations.png b/vignettes/images/seqfish_cortex/5-filterCombinations.png
deleted file mode 100644
index d0ba6080d..000000000
Binary files a/vignettes/images/seqfish_cortex/5-filterCombinations.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/5-tSNE.png b/vignettes/images/seqfish_cortex/5-tSNE.png
deleted file mode 100644
index 1795d4459..000000000
Binary files a/vignettes/images/seqfish_cortex/5-tSNE.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/6-UMAP.png b/vignettes/images/seqfish_cortex/6-UMAP.png
deleted file mode 100644
index 4e2604f34..000000000
Binary files a/vignettes/images/seqfish_cortex/6-UMAP.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/6-filterCombinations.png b/vignettes/images/seqfish_cortex/6-filterCombinations.png
deleted file mode 100644
index 53efa089e..000000000
Binary files a/vignettes/images/seqfish_cortex/6-filterCombinations.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/7-HVFplot.png b/vignettes/images/seqfish_cortex/7-HVFplot.png
deleted file mode 100644
index 97fcf72e0..000000000
Binary files a/vignettes/images/seqfish_cortex/7-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/7-filterCombinations.png b/vignettes/images/seqfish_cortex/7-filterCombinations.png
deleted file mode 100644
index 91376e552..000000000
Binary files a/vignettes/images/seqfish_cortex/7-filterCombinations.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/8-HVFplot.png b/vignettes/images/seqfish_cortex/8-HVFplot.png
deleted file mode 100644
index 04637dbf6..000000000
Binary files a/vignettes/images/seqfish_cortex/8-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/8-filterDistributions.png b/vignettes/images/seqfish_cortex/8-filterDistributions.png
deleted file mode 100644
index 563e74f88..000000000
Binary files a/vignettes/images/seqfish_cortex/8-filterDistributions.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/9-HVFplot.png b/vignettes/images/seqfish_cortex/9-HVFplot.png
deleted file mode 100644
index f4148f95c..000000000
Binary files a/vignettes/images/seqfish_cortex/9-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/9-filterDistributions.png b/vignettes/images/seqfish_cortex/9-filterDistributions.png
deleted file mode 100644
index 563e74f88..000000000
Binary files a/vignettes/images/seqfish_cortex/9-filterDistributions.png and /dev/null differ
diff --git a/vignettes/images/seqfish_cortex/cortex_svz_location_fields.png b/vignettes/images/seqfish_cortex/cortex_svz_location_fields.png
deleted file mode 100644
index 69b6c5306..000000000
Binary files a/vignettes/images/seqfish_cortex/cortex_svz_location_fields.png and /dev/null differ
diff --git a/vignettes/images/seqscope_mouse_liver/HDMI_scatter.png b/vignettes/images/seqscope_mouse_liver/HDMI_scatter.png
deleted file mode 100644
index a105b8910..000000000
Binary files a/vignettes/images/seqscope_mouse_liver/HDMI_scatter.png and /dev/null differ
diff --git a/vignettes/images/seqscope_mouse_liver/feature_distribution.png b/vignettes/images/seqscope_mouse_liver/feature_distribution.png
deleted file mode 100644
index 1c206e808..000000000
Binary files a/vignettes/images/seqscope_mouse_liver/feature_distribution.png and /dev/null differ
diff --git a/vignettes/images/seqscope_mouse_liver/leiden_spat.png b/vignettes/images/seqscope_mouse_liver/leiden_spat.png
deleted file mode 100644
index 4f532741b..000000000
Binary files a/vignettes/images/seqscope_mouse_liver/leiden_spat.png and /dev/null differ
diff --git a/vignettes/images/seqscope_mouse_liver/leiden_umap.png b/vignettes/images/seqscope_mouse_liver/leiden_umap.png
deleted file mode 100644
index e837a3315..000000000
Binary files a/vignettes/images/seqscope_mouse_liver/leiden_umap.png and /dev/null differ
diff --git a/vignettes/images/seqscope_mouse_liver/polygon.png b/vignettes/images/seqscope_mouse_liver/polygon.png
deleted file mode 100644
index 0a4744f43..000000000
Binary files a/vignettes/images/seqscope_mouse_liver/polygon.png and /dev/null differ
diff --git a/vignettes/images/seqscope_mouse_liver/spatgenes.png b/vignettes/images/seqscope_mouse_liver/spatgenes.png
deleted file mode 100644
index 7ee3ef882..000000000
Binary files a/vignettes/images/seqscope_mouse_liver/spatgenes.png and /dev/null differ
diff --git a/vignettes/images/seqscope_mouse_liver/top200.png b/vignettes/images/seqscope_mouse_liver/top200.png
deleted file mode 100644
index 901eae72b..000000000
Binary files a/vignettes/images/seqscope_mouse_liver/top200.png and /dev/null differ
diff --git a/vignettes/images/seqscope_mouse_liver/total_expr.png b/vignettes/images/seqscope_mouse_liver/total_expr.png
deleted file mode 100644
index 02abd4d4a..000000000
Binary files a/vignettes/images/seqscope_mouse_liver/total_expr.png and /dev/null differ
diff --git a/vignettes/images/singlecell_lung_adenocarcinoma/0-HVFplot.png b/vignettes/images/singlecell_lung_adenocarcinoma/0-HVFplot.png
deleted file mode 100644
index e035abb56..000000000
Binary files a/vignettes/images/singlecell_lung_adenocarcinoma/0-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/singlecell_lung_adenocarcinoma/3_scree_plot.png b/vignettes/images/singlecell_lung_adenocarcinoma/3_scree_plot.png
deleted file mode 100644
index f367d54af..000000000
Binary files a/vignettes/images/singlecell_lung_adenocarcinoma/3_scree_plot.png and /dev/null differ
diff --git a/vignettes/images/singlecell_lung_adenocarcinoma/4_Cluster.png b/vignettes/images/singlecell_lung_adenocarcinoma/4_Cluster.png
deleted file mode 100644
index cbfb39624..000000000
Binary files a/vignettes/images/singlecell_lung_adenocarcinoma/4_Cluster.png and /dev/null differ
diff --git a/vignettes/images/singlecell_lung_adenocarcinoma/5_metaheatmap.png b/vignettes/images/singlecell_lung_adenocarcinoma/5_metaheatmap.png
deleted file mode 100644
index 55631312d..000000000
Binary files a/vignettes/images/singlecell_lung_adenocarcinoma/5_metaheatmap.png and /dev/null differ
diff --git a/vignettes/images/singlecell_lung_adenocarcinoma/6_featureplot.png b/vignettes/images/singlecell_lung_adenocarcinoma/6_featureplot.png
deleted file mode 100644
index a0f1572cc..000000000
Binary files a/vignettes/images/singlecell_lung_adenocarcinoma/6_featureplot.png and /dev/null differ
diff --git a/vignettes/images/singlecell_lung_adenocarcinoma/6_heatmap_all_clusters_cell_types.png b/vignettes/images/singlecell_lung_adenocarcinoma/6_heatmap_all_clusters_cell_types.png
deleted file mode 100644
index b932abdf3..000000000
Binary files a/vignettes/images/singlecell_lung_adenocarcinoma/6_heatmap_all_clusters_cell_types.png and /dev/null differ
diff --git a/vignettes/images/singlecell_lung_adenocarcinoma/7_Annotation.png b/vignettes/images/singlecell_lung_adenocarcinoma/7_Annotation.png
deleted file mode 100644
index 81180b4aa..000000000
Binary files a/vignettes/images/singlecell_lung_adenocarcinoma/7_Annotation.png and /dev/null differ
diff --git a/vignettes/images/singlecell_prostate_integration/4_cluster_with_integration.png b/vignettes/images/singlecell_prostate_integration/4_cluster_with_integration.png
deleted file mode 100644
index 126da6056..000000000
Binary files a/vignettes/images/singlecell_prostate_integration/4_cluster_with_integration.png and /dev/null differ
diff --git a/vignettes/images/singlecell_prostate_integration/4_cluster_without_integration.png b/vignettes/images/singlecell_prostate_integration/4_cluster_without_integration.png
deleted file mode 100644
index f751a3802..000000000
Binary files a/vignettes/images/singlecell_prostate_integration/4_cluster_without_integration.png and /dev/null differ
diff --git a/vignettes/images/singlecell_prostate_integration/4_list_with_integration.png b/vignettes/images/singlecell_prostate_integration/4_list_with_integration.png
deleted file mode 100644
index 8465f8dc7..000000000
Binary files a/vignettes/images/singlecell_prostate_integration/4_list_with_integration.png and /dev/null differ
diff --git a/vignettes/images/singlecell_prostate_integration/4_list_without_integration.png b/vignettes/images/singlecell_prostate_integration/4_list_without_integration.png
deleted file mode 100644
index ae5ea022e..000000000
Binary files a/vignettes/images/singlecell_prostate_integration/4_list_without_integration.png and /dev/null differ
diff --git a/vignettes/images/singlecell_rna_seq/3_scree_plot.png b/vignettes/images/singlecell_rna_seq/3_scree_plot.png
deleted file mode 100644
index ba099380e..000000000
Binary files a/vignettes/images/singlecell_rna_seq/3_scree_plot.png and /dev/null differ
diff --git a/vignettes/images/singlecell_rna_seq/4_Cluster.png b/vignettes/images/singlecell_rna_seq/4_Cluster.png
deleted file mode 100644
index b3624ffdd..000000000
Binary files a/vignettes/images/singlecell_rna_seq/4_Cluster.png and /dev/null differ
diff --git a/vignettes/images/singlecell_rna_seq/5_a_metaheatmap.png b/vignettes/images/singlecell_rna_seq/5_a_metaheatmap.png
deleted file mode 100644
index f0edb8207..000000000
Binary files a/vignettes/images/singlecell_rna_seq/5_a_metaheatmap.png and /dev/null differ
diff --git a/vignettes/images/singlecell_rna_seq/5_b_violinplot_scran.png b/vignettes/images/singlecell_rna_seq/5_b_violinplot_scran.png
deleted file mode 100644
index e563ff0f8..000000000
Binary files a/vignettes/images/singlecell_rna_seq/5_b_violinplot_scran.png and /dev/null differ
diff --git a/vignettes/images/singlecell_rna_seq/6_featureplot.png b/vignettes/images/singlecell_rna_seq/6_featureplot.png
deleted file mode 100644
index 28820bc6f..000000000
Binary files a/vignettes/images/singlecell_rna_seq/6_featureplot.png and /dev/null differ
diff --git a/vignettes/images/singlecell_rna_seq/7_Annotation.png b/vignettes/images/singlecell_rna_seq/7_Annotation.png
deleted file mode 100644
index 6157bf520..000000000
Binary files a/vignettes/images/singlecell_rna_seq/7_Annotation.png and /dev/null differ
diff --git a/vignettes/images/singlecell_rna_seq/8_c_metaheatmap.png b/vignettes/images/singlecell_rna_seq/8_c_metaheatmap.png
deleted file mode 100644
index a1f23243f..000000000
Binary files a/vignettes/images/singlecell_rna_seq/8_c_metaheatmap.png and /dev/null differ
diff --git a/vignettes/images/singlecell_rna_seq/8a_scree_plot.png b/vignettes/images/singlecell_rna_seq/8a_scree_plot.png
deleted file mode 100644
index 57993be71..000000000
Binary files a/vignettes/images/singlecell_rna_seq/8a_scree_plot.png and /dev/null differ
diff --git a/vignettes/images/singlecell_rna_seq/8b_Cluster.png b/vignettes/images/singlecell_rna_seq/8b_Cluster.png
deleted file mode 100644
index bcb0c4de2..000000000
Binary files a/vignettes/images/singlecell_rna_seq/8b_Cluster.png and /dev/null differ
diff --git a/vignettes/images/singlecell_rna_seq/8d_Annotation.png b/vignettes/images/singlecell_rna_seq/8d_Annotation.png
deleted file mode 100644
index ebda7bc09..000000000
Binary files a/vignettes/images/singlecell_rna_seq/8d_Annotation.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/0-spatPlot2D.png b/vignettes/images/spatial_citeseq_human_skin/0-spatPlot2D.png
deleted file mode 100644
index 5b6545306..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/0-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/1-PCA.png b/vignettes/images/spatial_citeseq_human_skin/1-PCA.png
deleted file mode 100644
index 16d4e4e00..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/1-PCA.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/10-heatmSpatialCorFeats.png b/vignettes/images/spatial_citeseq_human_skin/10-heatmSpatialCorFeats.png
deleted file mode 100644
index 98b47e389..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/10-heatmSpatialCorFeats.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/11-spatCellPlot2D.png b/vignettes/images/spatial_citeseq_human_skin/11-spatCellPlot2D.png
deleted file mode 100644
index 69d9b6edf..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/11-spatCellPlot2D.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/12-spatPlot2D.png b/vignettes/images/spatial_citeseq_human_skin/12-spatPlot2D.png
deleted file mode 100644
index 1cdfe4434..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/12-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/2-PCA.png b/vignettes/images/spatial_citeseq_human_skin/2-PCA.png
deleted file mode 100644
index 4c0ed7cfe..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/2-PCA.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/3-UMAP.png b/vignettes/images/spatial_citeseq_human_skin/3-UMAP.png
deleted file mode 100644
index aa9abde8d..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/3-UMAP.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/4-UMAP.png b/vignettes/images/spatial_citeseq_human_skin/4-UMAP.png
deleted file mode 100644
index 30cf69ca4..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/4-UMAP.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/5-spatPlot2D.png b/vignettes/images/spatial_citeseq_human_skin/5-spatPlot2D.png
deleted file mode 100644
index 83a7c014d..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/5-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/6-spatPlot2D.png b/vignettes/images/spatial_citeseq_human_skin/6-spatPlot2D.png
deleted file mode 100644
index 267fbf6a3..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/6-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/7-UMAP.png b/vignettes/images/spatial_citeseq_human_skin/7-UMAP.png
deleted file mode 100644
index 73686cfea..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/7-UMAP.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/8-spatPlot2D.png b/vignettes/images/spatial_citeseq_human_skin/8-spatPlot2D.png
deleted file mode 100644
index 1d0770faa..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/8-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/spatial_citeseq_human_skin/9-spatFeatPlot2D.png b/vignettes/images/spatial_citeseq_human_skin/9-spatFeatPlot2D.png
deleted file mode 100644
index aae752e4d..000000000
Binary files a/vignettes/images/spatial_citeseq_human_skin/9-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/Acsm2_SpatialCor.png b/vignettes/images/spatial_genomics_mouse_kidney/Acsm2_SpatialCor.png
deleted file mode 100644
index b2f1c4ba5..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/Acsm2_SpatialCor.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/ClusterHeatMap.png b/vignettes/images/spatial_genomics_mouse_kidney/ClusterHeatMap.png
deleted file mode 100644
index acf9bdd12..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/ClusterHeatMap.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/DelaunayGraphs.png b/vignettes/images/spatial_genomics_mouse_kidney/DelaunayGraphs.png
deleted file mode 100644
index 226f43959..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/DelaunayGraphs.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/GeneExpressionViolin.png b/vignettes/images/spatial_genomics_mouse_kidney/GeneExpressionViolin.png
deleted file mode 100644
index ce0d57e3e..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/GeneExpressionViolin.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/HVF.png b/vignettes/images/spatial_genomics_mouse_kidney/HVF.png
deleted file mode 100644
index 6f09e8232..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/HVF.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/KMeansBinSpect.png b/vignettes/images/spatial_genomics_mouse_kidney/KMeansBinSpect.png
deleted file mode 100644
index 723e635a3..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/KMeansBinSpect.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/LeidenSpatPlot4.png b/vignettes/images/spatial_genomics_mouse_kidney/LeidenSpatPlot4.png
deleted file mode 100644
index deab7a7e8..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/LeidenSpatPlot4.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/LeidenSpatPlot6.png b/vignettes/images/spatial_genomics_mouse_kidney/LeidenSpatPlot6.png
deleted file mode 100644
index 2f800c1db..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/LeidenSpatPlot6.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/LeidenUMAP.png b/vignettes/images/spatial_genomics_mouse_kidney/LeidenUMAP.png
deleted file mode 100644
index 30b29bf96..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/LeidenUMAP.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/PCA.png b/vignettes/images/spatial_genomics_mouse_kidney/PCA.png
deleted file mode 100644
index a2116fd30..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/PCA.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/Points.png b/vignettes/images/spatial_genomics_mouse_kidney/Points.png
deleted file mode 100644
index afb89d5c0..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/Points.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/Polygons.png b/vignettes/images/spatial_genomics_mouse_kidney/Polygons.png
deleted file mode 100644
index 6e9b32da4..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/Polygons.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/RankBinSpect.png b/vignettes/images/spatial_genomics_mouse_kidney/RankBinSpect.png
deleted file mode 100644
index 2cc1ebb19..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/RankBinSpect.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/RankSpatialCorGroups.png b/vignettes/images/spatial_genomics_mouse_kidney/RankSpatialCorGroups.png
deleted file mode 100644
index b69583807..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/RankSpatialCorGroups.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/SpatialCorClusters2.png b/vignettes/images/spatial_genomics_mouse_kidney/SpatialCorClusters2.png
deleted file mode 100644
index 9b9821552..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/SpatialCorClusters2.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/SpatialCorHeatMap.png b/vignettes/images/spatial_genomics_mouse_kidney/SpatialCorHeatMap.png
deleted file mode 100644
index b51974dcc..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/SpatialCorHeatMap.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/TSNE.png b/vignettes/images/spatial_genomics_mouse_kidney/TSNE.png
deleted file mode 100644
index c1a619f19..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/TSNE.png and /dev/null differ
diff --git a/vignettes/images/spatial_genomics_mouse_kidney/UMAP.png b/vignettes/images/spatial_genomics_mouse_kidney/UMAP.png
deleted file mode 100644
index 5d1c643f2..000000000
Binary files a/vignettes/images/spatial_genomics_mouse_kidney/UMAP.png and /dev/null differ
diff --git a/vignettes/images/spatial_transformations/unnamed-chunk-5-1.png b/vignettes/images/spatial_transformations/unnamed-chunk-5-1.png
deleted file mode 100644
index 61b2c50d0..000000000
Binary files a/vignettes/images/spatial_transformations/unnamed-chunk-5-1.png and /dev/null differ
diff --git a/vignettes/images/spatial_transformations/unnamed-chunk-5-2.png b/vignettes/images/spatial_transformations/unnamed-chunk-5-2.png
deleted file mode 100644
index 6ce5e2133..000000000
Binary files a/vignettes/images/spatial_transformations/unnamed-chunk-5-2.png and /dev/null differ
diff --git a/vignettes/images/spatial_transformations/unnamed-chunk-6-1.png b/vignettes/images/spatial_transformations/unnamed-chunk-6-1.png
deleted file mode 100644
index 194c8023b..000000000
Binary files a/vignettes/images/spatial_transformations/unnamed-chunk-6-1.png and /dev/null differ
diff --git a/vignettes/images/spatial_transformations/unnamed-chunk-6-2.png b/vignettes/images/spatial_transformations/unnamed-chunk-6-2.png
deleted file mode 100644
index 7258bf9ae..000000000
Binary files a/vignettes/images/spatial_transformations/unnamed-chunk-6-2.png and /dev/null differ
diff --git a/vignettes/images/spatial_transformations/unnamed-chunk-7-1.png b/vignettes/images/spatial_transformations/unnamed-chunk-7-1.png
deleted file mode 100644
index 18c91d4b0..000000000
Binary files a/vignettes/images/spatial_transformations/unnamed-chunk-7-1.png and /dev/null differ
diff --git a/vignettes/images/spatial_transformations/unnamed-chunk-7-2.png b/vignettes/images/spatial_transformations/unnamed-chunk-7-2.png
deleted file mode 100644
index e2bb092c4..000000000
Binary files a/vignettes/images/spatial_transformations/unnamed-chunk-7-2.png and /dev/null differ
diff --git a/vignettes/images/spatial_transformations/unnamed-chunk-7-3.png b/vignettes/images/spatial_transformations/unnamed-chunk-7-3.png
deleted file mode 100644
index 4d03d038e..000000000
Binary files a/vignettes/images/spatial_transformations/unnamed-chunk-7-3.png and /dev/null differ
diff --git a/vignettes/images/spatial_transformations/unnamed-chunk-8-1.png b/vignettes/images/spatial_transformations/unnamed-chunk-8-1.png
deleted file mode 100644
index 697ead639..000000000
Binary files a/vignettes/images/spatial_transformations/unnamed-chunk-8-1.png and /dev/null differ
diff --git a/vignettes/images/spatial_transformations/unnamed-chunk-8-2.png b/vignettes/images/spatial_transformations/unnamed-chunk-8-2.png
deleted file mode 100644
index 3d78d8139..000000000
Binary files a/vignettes/images/spatial_transformations/unnamed-chunk-8-2.png and /dev/null differ
diff --git a/vignettes/images/spatial_transformations/unnamed-chunk-8-3.png b/vignettes/images/spatial_transformations/unnamed-chunk-8-3.png
deleted file mode 100644
index 46778e16a..000000000
Binary files a/vignettes/images/spatial_transformations/unnamed-chunk-8-3.png and /dev/null differ
diff --git a/vignettes/images/stereoseq_mosta/1.png b/vignettes/images/stereoseq_mosta/1.png
deleted file mode 100644
index ff8ebddf2..000000000
Binary files a/vignettes/images/stereoseq_mosta/1.png and /dev/null differ
diff --git a/vignettes/images/stereoseq_mosta/2.png b/vignettes/images/stereoseq_mosta/2.png
deleted file mode 100644
index ec7f88020..000000000
Binary files a/vignettes/images/stereoseq_mosta/2.png and /dev/null differ
diff --git a/vignettes/images/stereoseq_mosta/3.png b/vignettes/images/stereoseq_mosta/3.png
deleted file mode 100644
index 321e9288f..000000000
Binary files a/vignettes/images/stereoseq_mosta/3.png and /dev/null differ
diff --git a/vignettes/images/stereoseq_mosta/4.png b/vignettes/images/stereoseq_mosta/4.png
deleted file mode 100644
index ab3d0a265..000000000
Binary files a/vignettes/images/stereoseq_mosta/4.png and /dev/null differ
diff --git a/vignettes/images/stereoseq_mosta/5.png b/vignettes/images/stereoseq_mosta/5.png
deleted file mode 100644
index 9fb9c7e39..000000000
Binary files a/vignettes/images/stereoseq_mosta/5.png and /dev/null differ
diff --git a/vignettes/images/stereoseq_mosta/6.png b/vignettes/images/stereoseq_mosta/6.png
deleted file mode 100644
index be130ebc4..000000000
Binary files a/vignettes/images/stereoseq_mosta/6.png and /dev/null differ
diff --git a/vignettes/images/stereoseq_mosta/7.png b/vignettes/images/stereoseq_mosta/7.png
deleted file mode 100644
index ad43bcd46..000000000
Binary files a/vignettes/images/stereoseq_mosta/7.png and /dev/null differ
diff --git a/vignettes/images/stereoseq_mosta/8.png b/vignettes/images/stereoseq_mosta/8.png
deleted file mode 100644
index 7b53514e7..000000000
Binary files a/vignettes/images/stereoseq_mosta/8.png and /dev/null differ
diff --git a/vignettes/images/stereoseq_mosta/9.png b/vignettes/images/stereoseq_mosta/9.png
deleted file mode 100644
index be241c1bd..000000000
Binary files a/vignettes/images/stereoseq_mosta/9.png and /dev/null differ
diff --git a/vignettes/images/structure/Giotto_suite_object-01.svg b/vignettes/images/structure/Giotto_suite_object-01.svg
deleted file mode 100644
index 74f543158..000000000
--- a/vignettes/images/structure/Giotto_suite_object-01.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/vignettes/images/structure/Giotto_suite_object-02.svg b/vignettes/images/structure/Giotto_suite_object-02.svg
deleted file mode 100644
index dd976717d..000000000
--- a/vignettes/images/structure/Giotto_suite_object-02.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/vignettes/images/structure/Giotto_suite_object-03.svg b/vignettes/images/structure/Giotto_suite_object-03.svg
deleted file mode 100644
index de97e0faa..000000000
--- a/vignettes/images/structure/Giotto_suite_object-03.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/vignettes/images/structure/cell_clusters.png b/vignettes/images/structure/cell_clusters.png
deleted file mode 100644
index c9007086d..000000000
Binary files a/vignettes/images/structure/cell_clusters.png and /dev/null differ
diff --git a/vignettes/images/terra/01_Giotto_on_Terra.png b/vignettes/images/terra/01_Giotto_on_Terra.png
deleted file mode 100644
index fcde8138f..000000000
Binary files a/vignettes/images/terra/01_Giotto_on_Terra.png and /dev/null differ
diff --git a/vignettes/images/terra/01_environments.png b/vignettes/images/terra/01_environments.png
deleted file mode 100644
index c41734db9..000000000
Binary files a/vignettes/images/terra/01_environments.png and /dev/null differ
diff --git a/vignettes/images/terra/01_terra.png b/vignettes/images/terra/01_terra.png
deleted file mode 100644
index b165b281a..000000000
Binary files a/vignettes/images/terra/01_terra.png and /dev/null differ
diff --git a/vignettes/images/terra/01_vm.png b/vignettes/images/terra/01_vm.png
deleted file mode 100644
index 259b6a2cc..000000000
Binary files a/vignettes/images/terra/01_vm.png and /dev/null differ
diff --git a/vignettes/images/terra/02_docker.png b/vignettes/images/terra/02_docker.png
deleted file mode 100644
index 9e22f9e61..000000000
Binary files a/vignettes/images/terra/02_docker.png and /dev/null differ
diff --git a/vignettes/images/terra/03_startup_script.png b/vignettes/images/terra/03_startup_script.png
deleted file mode 100644
index 6fc3f8416..000000000
Binary files a/vignettes/images/terra/03_startup_script.png and /dev/null differ
diff --git a/vignettes/images/terra/04_share.png b/vignettes/images/terra/04_share.png
deleted file mode 100644
index 893b2ade3..000000000
Binary files a/vignettes/images/terra/04_share.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/0-spatPlot2D.png b/vignettes/images/visium_cytassist_human_glioblastoma/0-spatPlot2D.png
deleted file mode 100644
index 4b0050795..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/0-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/1-spatPlot2D.png b/vignettes/images/visium_cytassist_human_glioblastoma/1-spatPlot2D.png
deleted file mode 100644
index 7c9aa422c..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/1-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/10-spatPlot2D.png b/vignettes/images/visium_cytassist_human_glioblastoma/10-spatPlot2D.png
deleted file mode 100644
index 4c78e0d4c..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/10-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/11-spatPlot2D.png b/vignettes/images/visium_cytassist_human_glioblastoma/11-spatPlot2D.png
deleted file mode 100644
index 7aa2836f5..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/11-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/12-UMAP.png b/vignettes/images/visium_cytassist_human_glioblastoma/12-UMAP.png
deleted file mode 100644
index ceec533d3..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/12-UMAP.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/13-spatPlot2D.png b/vignettes/images/visium_cytassist_human_glioblastoma/13-spatPlot2D.png
deleted file mode 100644
index cc245e003..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/13-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/2-spatPlot2D.png b/vignettes/images/visium_cytassist_human_glioblastoma/2-spatPlot2D.png
deleted file mode 100644
index f7847700c..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/2-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/3-HVFplot.png b/vignettes/images/visium_cytassist_human_glioblastoma/3-HVFplot.png
deleted file mode 100644
index c82c1ee36..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/3-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/4-screePlot.png b/vignettes/images/visium_cytassist_human_glioblastoma/4-screePlot.png
deleted file mode 100644
index 38a160c64..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/4-screePlot.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/5-PCA.png b/vignettes/images/visium_cytassist_human_glioblastoma/5-PCA.png
deleted file mode 100644
index 6ba10136d..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/5-PCA.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/6-screePlot.png b/vignettes/images/visium_cytassist_human_glioblastoma/6-screePlot.png
deleted file mode 100644
index 21a30d2b4..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/6-screePlot.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/7-PCA.png b/vignettes/images/visium_cytassist_human_glioblastoma/7-PCA.png
deleted file mode 100644
index 81155d69c..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/7-PCA.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/8-UMAP.png b/vignettes/images/visium_cytassist_human_glioblastoma/8-UMAP.png
deleted file mode 100644
index 23938765f..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/8-UMAP.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_human_glioblastoma/9-UMAP.png b/vignettes/images/visium_cytassist_human_glioblastoma/9-UMAP.png
deleted file mode 100644
index 775b63e72..000000000
Binary files a/vignettes/images/visium_cytassist_human_glioblastoma/9-UMAP.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/0-spatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/0-spatPlot2D.png
deleted file mode 100644
index 192392b3b..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/0-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/1-spatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/1-spatPlot2D.png
deleted file mode 100644
index 1f31b8113..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/1-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/10-spatDimPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/10-spatDimPlot2D.png
deleted file mode 100644
index 363c523cd..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/10-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/11-spatDimPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/11-spatDimPlot2D.png
deleted file mode 100644
index 761f7af88..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/11-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/12-violinPlot.png b/vignettes/images/visium_cytassist_lungcancer/12-violinPlot.png
deleted file mode 100644
index d164e5ddc..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/12-violinPlot.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/13-plotMetaDataHeatmap.png b/vignettes/images/visium_cytassist_lungcancer/13-plotMetaDataHeatmap.png
deleted file mode 100644
index 67f1109d5..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/13-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/14-dimFeatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/14-dimFeatPlot2D.png
deleted file mode 100644
index 99a913977..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/14-dimFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/15-violinPlot.png b/vignettes/images/visium_cytassist_lungcancer/15-violinPlot.png
deleted file mode 100644
index d543461f7..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/15-violinPlot.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/16-plotMetaDataHeatmap.png b/vignettes/images/visium_cytassist_lungcancer/16-plotMetaDataHeatmap.png
deleted file mode 100644
index effb15b81..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/16-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/18-spatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/18-spatPlot2D.png
deleted file mode 100644
index 02a0b5da9..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/18-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/19-plotStatDelaunayNetwork.png b/vignettes/images/visium_cytassist_lungcancer/19-plotStatDelaunayNetwork.png
deleted file mode 100644
index b1f815a14..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/19-plotStatDelaunayNetwork.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/2-spatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/2-spatPlot2D.png
deleted file mode 100644
index a9478e872..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/2-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/20-spatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/20-spatPlot2D.png
deleted file mode 100644
index a759943c3..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/20-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/21-spatFeatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/21-spatFeatPlot2D.png
deleted file mode 100644
index 43110504a..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/21-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/22-spatFeatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/22-spatFeatPlot2D.png
deleted file mode 100644
index 2d8c274c2..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/22-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/22-z1-heatmap_correlated_genes.png b/vignettes/images/visium_cytassist_lungcancer/22-z1-heatmap_correlated_genes.png
deleted file mode 100644
index 014d12d48..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/22-z1-heatmap_correlated_genes.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/22-z2-rank_correlated_groups.png b/vignettes/images/visium_cytassist_lungcancer/22-z2-rank_correlated_groups.png
deleted file mode 100644
index 6fe030091..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/22-z2-rank_correlated_groups.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/23-spatFeatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/23-spatFeatPlot2D.png
deleted file mode 100644
index ee52762f8..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/23-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/24-spatFeatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/24-spatFeatPlot2D.png
deleted file mode 100644
index 276af72a6..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/24-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/25-spatCellPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/25-spatCellPlot2D.png
deleted file mode 100644
index 4d791df25..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/25-spatCellPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/26-spatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/26-spatPlot2D.png
deleted file mode 100644
index 970278d40..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/26-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/27-spatPlot2D.png b/vignettes/images/visium_cytassist_lungcancer/27-spatPlot2D.png
deleted file mode 100644
index 717cfd307..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/27-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/3-HVFplot.png b/vignettes/images/visium_cytassist_lungcancer/3-HVFplot.png
deleted file mode 100644
index 46422e3b7..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/3-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/4-screePlot.png b/vignettes/images/visium_cytassist_lungcancer/4-screePlot.png
deleted file mode 100644
index 0d866fa07..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/4-screePlot.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/5-PCA.png b/vignettes/images/visium_cytassist_lungcancer/5-PCA.png
deleted file mode 100644
index 417e4f1ce..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/5-PCA.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/6-UMAP.png b/vignettes/images/visium_cytassist_lungcancer/6-UMAP.png
deleted file mode 100644
index 6e33e62f8..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/6-UMAP.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/7-tSNE.png b/vignettes/images/visium_cytassist_lungcancer/7-tSNE.png
deleted file mode 100644
index 5995d0888..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/7-tSNE.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/7_a_metaheatmap.png b/vignettes/images/visium_cytassist_lungcancer/7_a_metaheatmap.png
deleted file mode 100644
index eb20a49c7..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/7_a_metaheatmap.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/7_b_spatcellplot_1.png b/vignettes/images/visium_cytassist_lungcancer/7_b_spatcellplot_1.png
deleted file mode 100644
index b884d7716..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/7_b_spatcellplot_1.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/7_d_spatDimCellPlot.png b/vignettes/images/visium_cytassist_lungcancer/7_d_spatDimCellPlot.png
deleted file mode 100644
index f10c21122..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/7_d_spatDimCellPlot.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/8-UMAP.png b/vignettes/images/visium_cytassist_lungcancer/8-UMAP.png
deleted file mode 100644
index ec3522cb9..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/8-UMAP.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/9-tSNE.png b/vignettes/images/visium_cytassist_lungcancer/9-tSNE.png
deleted file mode 100644
index 2c7534300..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/9-tSNE.png and /dev/null differ
diff --git a/vignettes/images/visium_cytassist_lungcancer/CytAssist_Visium_workflow.png b/vignettes/images/visium_cytassist_lungcancer/CytAssist_Visium_workflow.png
deleted file mode 100644
index 15272314d..000000000
Binary files a/vignettes/images/visium_cytassist_lungcancer/CytAssist_Visium_workflow.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/0-spatPlot2D.png b/vignettes/images/visium_mouse_brain/0-spatPlot2D.png
deleted file mode 100644
index 69cdd4521..000000000
Binary files a/vignettes/images/visium_mouse_brain/0-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/1-spatPlot2D.png b/vignettes/images/visium_mouse_brain/1-spatPlot2D.png
deleted file mode 100644
index 240bd6bbf..000000000
Binary files a/vignettes/images/visium_mouse_brain/1-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/10-spatPlot2D.png b/vignettes/images/visium_mouse_brain/10-spatPlot2D.png
deleted file mode 100644
index 62bf63f25..000000000
Binary files a/vignettes/images/visium_mouse_brain/10-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/11-spatPlot2D.png b/vignettes/images/visium_mouse_brain/11-spatPlot2D.png
deleted file mode 100644
index 89d6bee17..000000000
Binary files a/vignettes/images/visium_mouse_brain/11-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/12-spatPlot2D.png b/vignettes/images/visium_mouse_brain/12-spatPlot2D.png
deleted file mode 100644
index 89e203840..000000000
Binary files a/vignettes/images/visium_mouse_brain/12-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/13-spatDimPlot2D.png b/vignettes/images/visium_mouse_brain/13-spatDimPlot2D.png
deleted file mode 100644
index 2c9bea585..000000000
Binary files a/vignettes/images/visium_mouse_brain/13-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/14-violinPlot.png b/vignettes/images/visium_mouse_brain/14-violinPlot.png
deleted file mode 100644
index 6863329ab..000000000
Binary files a/vignettes/images/visium_mouse_brain/14-violinPlot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/15-plotMetaDataHeatmap.png b/vignettes/images/visium_mouse_brain/15-plotMetaDataHeatmap.png
deleted file mode 100644
index 510fbfe73..000000000
Binary files a/vignettes/images/visium_mouse_brain/15-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/16-dimFeatPlot2D.png b/vignettes/images/visium_mouse_brain/16-dimFeatPlot2D.png
deleted file mode 100644
index d40528e45..000000000
Binary files a/vignettes/images/visium_mouse_brain/16-dimFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/17-violinPlot.png b/vignettes/images/visium_mouse_brain/17-violinPlot.png
deleted file mode 100644
index e4e98fe03..000000000
Binary files a/vignettes/images/visium_mouse_brain/17-violinPlot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/18-plotMetaDataHeatmap.png b/vignettes/images/visium_mouse_brain/18-plotMetaDataHeatmap.png
deleted file mode 100644
index 67e767b7c..000000000
Binary files a/vignettes/images/visium_mouse_brain/18-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/19-dimFeatPlot2D.png b/vignettes/images/visium_mouse_brain/19-dimFeatPlot2D.png
deleted file mode 100644
index 942f7c06d..000000000
Binary files a/vignettes/images/visium_mouse_brain/19-dimFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/2-HVFplot.png b/vignettes/images/visium_mouse_brain/2-HVFplot.png
deleted file mode 100644
index 2668e4855..000000000
Binary files a/vignettes/images/visium_mouse_brain/2-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/20-plotMetaDataCellsHeatmap.png b/vignettes/images/visium_mouse_brain/20-plotMetaDataCellsHeatmap.png
deleted file mode 100644
index 6f8522e24..000000000
Binary files a/vignettes/images/visium_mouse_brain/20-plotMetaDataCellsHeatmap.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/21-spatCellPlot2D.png b/vignettes/images/visium_mouse_brain/21-spatCellPlot2D.png
deleted file mode 100644
index 3c30f8d82..000000000
Binary files a/vignettes/images/visium_mouse_brain/21-spatCellPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/22-spatDimCellPlot2D.png b/vignettes/images/visium_mouse_brain/22-spatDimCellPlot2D.png
deleted file mode 100644
index 8fcae5bb2..000000000
Binary files a/vignettes/images/visium_mouse_brain/22-spatDimCellPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/23-spatCellPlot2D.png b/vignettes/images/visium_mouse_brain/23-spatCellPlot2D.png
deleted file mode 100644
index fe16fa2ee..000000000
Binary files a/vignettes/images/visium_mouse_brain/23-spatCellPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/24-spatPlot2D.png b/vignettes/images/visium_mouse_brain/24-spatPlot2D.png
deleted file mode 100644
index 05d3df191..000000000
Binary files a/vignettes/images/visium_mouse_brain/24-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/25-spatPlot2D.png b/vignettes/images/visium_mouse_brain/25-spatPlot2D.png
deleted file mode 100644
index 6eea0e9ba..000000000
Binary files a/vignettes/images/visium_mouse_brain/25-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/26-spatFeatPlot2D.png b/vignettes/images/visium_mouse_brain/26-spatFeatPlot2D.png
deleted file mode 100644
index 0efb6620d..000000000
Binary files a/vignettes/images/visium_mouse_brain/26-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/27-spatFeatPlot2D.png b/vignettes/images/visium_mouse_brain/27-spatFeatPlot2D.png
deleted file mode 100644
index 97088bdeb..000000000
Binary files a/vignettes/images/visium_mouse_brain/27-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/28-heatmSpatialCorFeats.png b/vignettes/images/visium_mouse_brain/28-heatmSpatialCorFeats.png
deleted file mode 100644
index a9fe28856..000000000
Binary files a/vignettes/images/visium_mouse_brain/28-heatmSpatialCorFeats.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/29-rankSpatialCorGroups.png b/vignettes/images/visium_mouse_brain/29-rankSpatialCorGroups.png
deleted file mode 100644
index 4f83914d7..000000000
Binary files a/vignettes/images/visium_mouse_brain/29-rankSpatialCorGroups.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/3-screePlot.png b/vignettes/images/visium_mouse_brain/3-screePlot.png
deleted file mode 100644
index b79198313..000000000
Binary files a/vignettes/images/visium_mouse_brain/3-screePlot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/30-spatCellPlot2D.png b/vignettes/images/visium_mouse_brain/30-spatCellPlot2D.png
deleted file mode 100644
index b8f39cd03..000000000
Binary files a/vignettes/images/visium_mouse_brain/30-spatCellPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/31-spatPlot2D.png b/vignettes/images/visium_mouse_brain/31-spatPlot2D.png
deleted file mode 100644
index 2e7525f4c..000000000
Binary files a/vignettes/images/visium_mouse_brain/31-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/32-UMAP.png b/vignettes/images/visium_mouse_brain/32-UMAP.png
deleted file mode 100644
index c21169e12..000000000
Binary files a/vignettes/images/visium_mouse_brain/32-UMAP.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/33-spatPlot2D.png b/vignettes/images/visium_mouse_brain/33-spatPlot2D.png
deleted file mode 100644
index 0805063d0..000000000
Binary files a/vignettes/images/visium_mouse_brain/33-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/4-dimPlot2D.png b/vignettes/images/visium_mouse_brain/4-dimPlot2D.png
deleted file mode 100644
index db49036fb..000000000
Binary files a/vignettes/images/visium_mouse_brain/4-dimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/5-UMAP.png b/vignettes/images/visium_mouse_brain/5-UMAP.png
deleted file mode 100644
index 7264940e0..000000000
Binary files a/vignettes/images/visium_mouse_brain/5-UMAP.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/6-tSNE.png b/vignettes/images/visium_mouse_brain/6-tSNE.png
deleted file mode 100644
index 3e6513051..000000000
Binary files a/vignettes/images/visium_mouse_brain/6-tSNE.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/7-UMAP.png b/vignettes/images/visium_mouse_brain/7-UMAP.png
deleted file mode 100644
index 350df0c73..000000000
Binary files a/vignettes/images/visium_mouse_brain/7-UMAP.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/8-spatDimPlot2D.png b/vignettes/images/visium_mouse_brain/8-spatDimPlot2D.png
deleted file mode 100644
index c6d718595..000000000
Binary files a/vignettes/images/visium_mouse_brain/8-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/9-spatDimPlot2D.png b/vignettes/images/visium_mouse_brain/9-spatDimPlot2D.png
deleted file mode 100644
index 341b78d3e..000000000
Binary files a/vignettes/images/visium_mouse_brain/9-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/DWLS_plot.png b/vignettes/images/visium_mouse_brain/DWLS_plot.png
deleted file mode 100644
index b85250c56..000000000
Binary files a/vignettes/images/visium_mouse_brain/DWLS_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/spat_DWLS_pie_plot.png b/vignettes/images/visium_mouse_brain/spat_DWLS_pie_plot.png
deleted file mode 100644
index b41f06534..000000000
Binary files a/vignettes/images/visium_mouse_brain/spat_DWLS_pie_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_brain/spat_enr_Rank_plot.png b/vignettes/images/visium_mouse_brain/spat_enr_Rank_plot.png
deleted file mode 100644
index dc89117d3..000000000
Binary files a/vignettes/images/visium_mouse_brain/spat_enr_Rank_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/0-spatPlot2D.png b/vignettes/images/visium_mouse_kidney/0-spatPlot2D.png
deleted file mode 100644
index 0368b5dcc..000000000
Binary files a/vignettes/images/visium_mouse_kidney/0-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/1-spatPlot2D.png b/vignettes/images/visium_mouse_kidney/1-spatPlot2D.png
deleted file mode 100644
index ba43e036f..000000000
Binary files a/vignettes/images/visium_mouse_kidney/1-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/10-spatDimPlot2D.png b/vignettes/images/visium_mouse_kidney/10-spatDimPlot2D.png
deleted file mode 100644
index 8d0d24290..000000000
Binary files a/vignettes/images/visium_mouse_kidney/10-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/11-violinPlot.png b/vignettes/images/visium_mouse_kidney/11-violinPlot.png
deleted file mode 100644
index 0f7f24da6..000000000
Binary files a/vignettes/images/visium_mouse_kidney/11-violinPlot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/11-z1-violinplot_gini.png b/vignettes/images/visium_mouse_kidney/11-z1-violinplot_gini.png
deleted file mode 100644
index 1042be726..000000000
Binary files a/vignettes/images/visium_mouse_kidney/11-z1-violinplot_gini.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/12-plotMetaDataHeatmap.png b/vignettes/images/visium_mouse_kidney/12-plotMetaDataHeatmap.png
deleted file mode 100644
index 5b545af1b..000000000
Binary files a/vignettes/images/visium_mouse_kidney/12-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/13-dimFeatPlot2D.png b/vignettes/images/visium_mouse_kidney/13-dimFeatPlot2D.png
deleted file mode 100644
index 4e01435b9..000000000
Binary files a/vignettes/images/visium_mouse_kidney/13-dimFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/14-violinPlot.png b/vignettes/images/visium_mouse_kidney/14-violinPlot.png
deleted file mode 100644
index b9691a4b4..000000000
Binary files a/vignettes/images/visium_mouse_kidney/14-violinPlot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/15-plotMetaDataHeatmap.png b/vignettes/images/visium_mouse_kidney/15-plotMetaDataHeatmap.png
deleted file mode 100644
index aa15a4039..000000000
Binary files a/vignettes/images/visium_mouse_kidney/15-plotMetaDataHeatmap.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/16-dimFeatPlot2D.png b/vignettes/images/visium_mouse_kidney/16-dimFeatPlot2D.png
deleted file mode 100644
index 01f448fac..000000000
Binary files a/vignettes/images/visium_mouse_kidney/16-dimFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/17-spatPlot2D.png b/vignettes/images/visium_mouse_kidney/17-spatPlot2D.png
deleted file mode 100644
index 19f0328c7..000000000
Binary files a/vignettes/images/visium_mouse_kidney/17-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/18-plotStatDelaunayNetwork.png b/vignettes/images/visium_mouse_kidney/18-plotStatDelaunayNetwork.png
deleted file mode 100644
index c9fce8233..000000000
Binary files a/vignettes/images/visium_mouse_kidney/18-plotStatDelaunayNetwork.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/19-spatPlot2D.png b/vignettes/images/visium_mouse_kidney/19-spatPlot2D.png
deleted file mode 100644
index 9a3dca527..000000000
Binary files a/vignettes/images/visium_mouse_kidney/19-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/2-spatPlot2D.png b/vignettes/images/visium_mouse_kidney/2-spatPlot2D.png
deleted file mode 100644
index 35bfee3e8..000000000
Binary files a/vignettes/images/visium_mouse_kidney/2-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/20-spatFeatPlot2D.png b/vignettes/images/visium_mouse_kidney/20-spatFeatPlot2D.png
deleted file mode 100644
index ac9971063..000000000
Binary files a/vignettes/images/visium_mouse_kidney/20-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/21-spatFeatPlot2D.png b/vignettes/images/visium_mouse_kidney/21-spatFeatPlot2D.png
deleted file mode 100644
index 45cf2f6f3..000000000
Binary files a/vignettes/images/visium_mouse_kidney/21-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/22-spatFeatPlot2D.png b/vignettes/images/visium_mouse_kidney/22-spatFeatPlot2D.png
deleted file mode 100644
index 91c8d70c6..000000000
Binary files a/vignettes/images/visium_mouse_kidney/22-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/22-z1-heatmap_correlated_genes.pdf b/vignettes/images/visium_mouse_kidney/22-z1-heatmap_correlated_genes.pdf
deleted file mode 100644
index 65b6ffb32..000000000
Binary files a/vignettes/images/visium_mouse_kidney/22-z1-heatmap_correlated_genes.pdf and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/22-z2-rank_correlated_groups.png b/vignettes/images/visium_mouse_kidney/22-z2-rank_correlated_groups.png
deleted file mode 100644
index c9545d1f3..000000000
Binary files a/vignettes/images/visium_mouse_kidney/22-z2-rank_correlated_groups.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/23-spatCellPlot2D.png b/vignettes/images/visium_mouse_kidney/23-spatCellPlot2D.png
deleted file mode 100644
index ba06f4f3c..000000000
Binary files a/vignettes/images/visium_mouse_kidney/23-spatCellPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/24-spatPlot2D.png b/vignettes/images/visium_mouse_kidney/24-spatPlot2D.png
deleted file mode 100644
index 698ed2971..000000000
Binary files a/vignettes/images/visium_mouse_kidney/24-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/25-spatPlot2D.png b/vignettes/images/visium_mouse_kidney/25-spatPlot2D.png
deleted file mode 100644
index 9178d7b0c..000000000
Binary files a/vignettes/images/visium_mouse_kidney/25-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/3-HVFplot.png b/vignettes/images/visium_mouse_kidney/3-HVFplot.png
deleted file mode 100644
index cfff54b9b..000000000
Binary files a/vignettes/images/visium_mouse_kidney/3-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/4-screePlot.png b/vignettes/images/visium_mouse_kidney/4-screePlot.png
deleted file mode 100644
index f964198da..000000000
Binary files a/vignettes/images/visium_mouse_kidney/4-screePlot.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/5-PCA.png b/vignettes/images/visium_mouse_kidney/5-PCA.png
deleted file mode 100644
index 37aacb7f5..000000000
Binary files a/vignettes/images/visium_mouse_kidney/5-PCA.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/6-UMAP.png b/vignettes/images/visium_mouse_kidney/6-UMAP.png
deleted file mode 100644
index 121abd1b5..000000000
Binary files a/vignettes/images/visium_mouse_kidney/6-UMAP.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/7-tSNE.png b/vignettes/images/visium_mouse_kidney/7-tSNE.png
deleted file mode 100644
index a7e804c70..000000000
Binary files a/vignettes/images/visium_mouse_kidney/7-tSNE.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/8-UMAP.png b/vignettes/images/visium_mouse_kidney/8-UMAP.png
deleted file mode 100644
index 3446e38da..000000000
Binary files a/vignettes/images/visium_mouse_kidney/8-UMAP.png and /dev/null differ
diff --git a/vignettes/images/visium_mouse_kidney/9-spatDimPlot2D.png b/vignettes/images/visium_mouse_kidney/9-spatDimPlot2D.png
deleted file mode 100644
index 0a2767239..000000000
Binary files a/vignettes/images/visium_mouse_kidney/9-spatDimPlot2D.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/0-HVFplot.png b/vignettes/images/visium_prostate_integration/0-HVFplot.png
deleted file mode 100644
index eac66b69c..000000000
Binary files a/vignettes/images/visium_prostate_integration/0-HVFplot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/1a_plot.png b/vignettes/images/visium_prostate_integration/1a_plot.png
deleted file mode 100644
index 71822ff62..000000000
Binary files a/vignettes/images/visium_prostate_integration/1a_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/1b_plot.png b/vignettes/images/visium_prostate_integration/1b_plot.png
deleted file mode 100644
index d8216b2bb..000000000
Binary files a/vignettes/images/visium_prostate_integration/1b_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/1c_plot.png b/vignettes/images/visium_prostate_integration/1c_plot.png
deleted file mode 100644
index ee6ccbe7c..000000000
Binary files a/vignettes/images/visium_prostate_integration/1c_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/2a_plot.png b/vignettes/images/visium_prostate_integration/2a_plot.png
deleted file mode 100644
index fcfb3fbc5..000000000
Binary files a/vignettes/images/visium_prostate_integration/2a_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/2b_plot.png b/vignettes/images/visium_prostate_integration/2b_plot.png
deleted file mode 100644
index 24c9de4a1..000000000
Binary files a/vignettes/images/visium_prostate_integration/2b_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/2c_plot.png b/vignettes/images/visium_prostate_integration/2c_plot.png
deleted file mode 100644
index e8cbc0375..000000000
Binary files a/vignettes/images/visium_prostate_integration/2c_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/3a_screeplot.png b/vignettes/images/visium_prostate_integration/3a_screeplot.png
deleted file mode 100644
index d8eeed788..000000000
Binary files a/vignettes/images/visium_prostate_integration/3a_screeplot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/4.1a_plot.png b/vignettes/images/visium_prostate_integration/4.1a_plot.png
deleted file mode 100644
index 050a00d14..000000000
Binary files a/vignettes/images/visium_prostate_integration/4.1a_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/4.1b_plot.png b/vignettes/images/visium_prostate_integration/4.1b_plot.png
deleted file mode 100644
index d2609ae85..000000000
Binary files a/vignettes/images/visium_prostate_integration/4.1b_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/4.1c_plot.png b/vignettes/images/visium_prostate_integration/4.1c_plot.png
deleted file mode 100644
index 62824bf64..000000000
Binary files a/vignettes/images/visium_prostate_integration/4.1c_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/4.2a_plot.png b/vignettes/images/visium_prostate_integration/4.2a_plot.png
deleted file mode 100644
index 5c2e64e27..000000000
Binary files a/vignettes/images/visium_prostate_integration/4.2a_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/4.2b_plot.png b/vignettes/images/visium_prostate_integration/4.2b_plot.png
deleted file mode 100644
index a52531e7e..000000000
Binary files a/vignettes/images/visium_prostate_integration/4.2b_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/4.2c_plot.png b/vignettes/images/visium_prostate_integration/4.2c_plot.png
deleted file mode 100644
index 400b762f7..000000000
Binary files a/vignettes/images/visium_prostate_integration/4.2c_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/4_w_integration_plot.png b/vignettes/images/visium_prostate_integration/4_w_integration_plot.png
deleted file mode 100644
index 678af529d..000000000
Binary files a/vignettes/images/visium_prostate_integration/4_w_integration_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/4_w_o_integration_plot.png b/vignettes/images/visium_prostate_integration/4_w_o_integration_plot.png
deleted file mode 100644
index f8fee002a..000000000
Binary files a/vignettes/images/visium_prostate_integration/4_w_o_integration_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/5a_PAGE_plot.png b/vignettes/images/visium_prostate_integration/5a_PAGE_plot.png
deleted file mode 100644
index e4ff434ef..000000000
Binary files a/vignettes/images/visium_prostate_integration/5a_PAGE_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/5b_HyperGeometric_plot.png b/vignettes/images/visium_prostate_integration/5b_HyperGeometric_plot.png
deleted file mode 100644
index f8e9095fd..000000000
Binary files a/vignettes/images/visium_prostate_integration/5b_HyperGeometric_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/5c_Rank_plot.png b/vignettes/images/visium_prostate_integration/5c_Rank_plot.png
deleted file mode 100644
index 4d93a4757..000000000
Binary files a/vignettes/images/visium_prostate_integration/5c_Rank_plot.png and /dev/null differ
diff --git a/vignettes/images/visium_prostate_integration/5d_DWLS_plot.png b/vignettes/images/visium_prostate_integration/5d_DWLS_plot.png
deleted file mode 100644
index 2c5c92eb0..000000000
Binary files a/vignettes/images/visium_prostate_integration/5d_DWLS_plot.png and /dev/null differ
diff --git a/vignettes/images/visualizations/newplot.png b/vignettes/images/visualizations/newplot.png
deleted file mode 100644
index d1e58dc90..000000000
Binary files a/vignettes/images/visualizations/newplot.png and /dev/null differ
diff --git a/vignettes/images/visualizations/newplot1.png b/vignettes/images/visualizations/newplot1.png
deleted file mode 100644
index 11dfc5014..000000000
Binary files a/vignettes/images/visualizations/newplot1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/newplot2.png b/vignettes/images/visualizations/newplot2.png
deleted file mode 100644
index 681c8449a..000000000
Binary files a/vignettes/images/visualizations/newplot2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/newplot3.png b/vignettes/images/visualizations/newplot3.png
deleted file mode 100644
index 1972ceee1..000000000
Binary files a/vignettes/images/visualizations/newplot3.png and /dev/null differ
diff --git a/vignettes/images/visualizations/newplot4.png b/vignettes/images/visualizations/newplot4.png
deleted file mode 100644
index ebe8f29bd..000000000
Binary files a/vignettes/images/visualizations/newplot4.png and /dev/null differ
diff --git a/vignettes/images/visualizations/newplot5.png b/vignettes/images/visualizations/newplot5.png
deleted file mode 100644
index 9405d8d13..000000000
Binary files a/vignettes/images/visualizations/newplot5.png and /dev/null differ
diff --git a/vignettes/images/visualizations/newplot6.png b/vignettes/images/visualizations/newplot6.png
deleted file mode 100644
index e13b9b4a6..000000000
Binary files a/vignettes/images/visualizations/newplot6.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-10-1.png b/vignettes/images/visualizations/unnamed-chunk-10-1.png
deleted file mode 100644
index 6d6ca2623..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-10-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-10-2.png b/vignettes/images/visualizations/unnamed-chunk-10-2.png
deleted file mode 100644
index 6d6ca2623..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-10-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-11-1.png b/vignettes/images/visualizations/unnamed-chunk-11-1.png
deleted file mode 100644
index 83a6ddfa0..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-11-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-11-2.png b/vignettes/images/visualizations/unnamed-chunk-11-2.png
deleted file mode 100644
index 83a6ddfa0..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-11-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-13-1.png b/vignettes/images/visualizations/unnamed-chunk-13-1.png
deleted file mode 100644
index 0ff5236a7..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-13-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-13-2.png b/vignettes/images/visualizations/unnamed-chunk-13-2.png
deleted file mode 100644
index 0ff5236a7..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-13-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-14-1.png b/vignettes/images/visualizations/unnamed-chunk-14-1.png
deleted file mode 100644
index 9a124b2ad..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-14-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-14-2.png b/vignettes/images/visualizations/unnamed-chunk-14-2.png
deleted file mode 100644
index 9a124b2ad..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-14-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-17-1.png b/vignettes/images/visualizations/unnamed-chunk-17-1.png
deleted file mode 100644
index 5ce5a005e..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-17-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-17-2.png b/vignettes/images/visualizations/unnamed-chunk-17-2.png
deleted file mode 100644
index 5ce5a005e..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-17-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-19-1.png b/vignettes/images/visualizations/unnamed-chunk-19-1.png
deleted file mode 100644
index aae77769e..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-19-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-19-2.png b/vignettes/images/visualizations/unnamed-chunk-19-2.png
deleted file mode 100644
index aae77769e..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-19-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-21-1.png b/vignettes/images/visualizations/unnamed-chunk-21-1.png
deleted file mode 100644
index 8a453e702..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-21-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-21-2.png b/vignettes/images/visualizations/unnamed-chunk-21-2.png
deleted file mode 100644
index 8a453e702..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-21-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-21-3.png b/vignettes/images/visualizations/unnamed-chunk-21-3.png
deleted file mode 100644
index 922b88eba..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-21-3.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-21-4.png b/vignettes/images/visualizations/unnamed-chunk-21-4.png
deleted file mode 100644
index 922b88eba..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-21-4.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-22-1.png b/vignettes/images/visualizations/unnamed-chunk-22-1.png
deleted file mode 100644
index 2909c4413..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-22-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-22-2.png b/vignettes/images/visualizations/unnamed-chunk-22-2.png
deleted file mode 100644
index 2909c4413..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-22-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-23-1.png b/vignettes/images/visualizations/unnamed-chunk-23-1.png
deleted file mode 100644
index f4fb59bf5..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-23-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-23-2.png b/vignettes/images/visualizations/unnamed-chunk-23-2.png
deleted file mode 100644
index f4fb59bf5..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-23-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-24-1.png b/vignettes/images/visualizations/unnamed-chunk-24-1.png
deleted file mode 100644
index d045a85ab..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-24-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-24-2.png b/vignettes/images/visualizations/unnamed-chunk-24-2.png
deleted file mode 100644
index d045a85ab..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-24-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-3-1.png b/vignettes/images/visualizations/unnamed-chunk-3-1.png
deleted file mode 100644
index 1ae9c6bc4..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-3-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-3-2.png b/vignettes/images/visualizations/unnamed-chunk-3-2.png
deleted file mode 100644
index 1ae9c6bc4..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-3-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-5-1.png b/vignettes/images/visualizations/unnamed-chunk-5-1.png
deleted file mode 100644
index c622c53e7..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-5-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-5-2.png b/vignettes/images/visualizations/unnamed-chunk-5-2.png
deleted file mode 100644
index c622c53e7..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-5-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-8-1.png b/vignettes/images/visualizations/unnamed-chunk-8-1.png
deleted file mode 100644
index 0667d1f1b..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-8-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-8-2.png b/vignettes/images/visualizations/unnamed-chunk-8-2.png
deleted file mode 100644
index 0667d1f1b..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-8-2.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-9-1.png b/vignettes/images/visualizations/unnamed-chunk-9-1.png
deleted file mode 100644
index b5a6f303c..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-9-1.png and /dev/null differ
diff --git a/vignettes/images/visualizations/unnamed-chunk-9-2.png b/vignettes/images/visualizations/unnamed-chunk-9-2.png
deleted file mode 100644
index b5a6f303c..000000000
Binary files a/vignettes/images/visualizations/unnamed-chunk-9-2.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/0-overview_spatplot.png b/vignettes/images/vizgen_mouse_brain/0-overview_spatplot.png
deleted file mode 100644
index 40a5508ce..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/0-overview_spatplot.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/1-FOVs.png b/vignettes/images/vizgen_mouse_brain/1-FOVs.png
deleted file mode 100644
index d726309e9..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/1-FOVs.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/10-spatPlot2D.png b/vignettes/images/vizgen_mouse_brain/10-spatPlot2D.png
deleted file mode 100644
index f9e7bbaad..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/10-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/11-spatFeatPlot2D.png b/vignettes/images/vizgen_mouse_brain/11-spatFeatPlot2D.png
deleted file mode 100644
index f1a062b21..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/11-spatFeatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/12-spatPlot2D.png b/vignettes/images/vizgen_mouse_brain/12-spatPlot2D.png
deleted file mode 100644
index b604c9d4c..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/12-spatPlot2D.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/12b-spatInSituPlotPoints.png b/vignettes/images/vizgen_mouse_brain/12b-spatInSituPlotPoints.png
deleted file mode 100644
index b32c9c8a4..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/12b-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/13-poly.png b/vignettes/images/vizgen_mouse_brain/13-poly.png
deleted file mode 100644
index 4aeff1c96..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/13-poly.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/14-point.png b/vignettes/images/vizgen_mouse_brain/14-point.png
deleted file mode 100644
index 16a144ce9..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/14-point.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/15-spatInSituPlotPoints.png b/vignettes/images/vizgen_mouse_brain/15-spatInSituPlotPoints.png
deleted file mode 100644
index a1194ad50..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/15-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/16-spatInSituPlotPoints.png b/vignettes/images/vizgen_mouse_brain/16-spatInSituPlotPoints.png
deleted file mode 100644
index 0483ec2c6..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/16-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/17-spatInSituPlotPoints.png b/vignettes/images/vizgen_mouse_brain/17-spatInSituPlotPoints.png
deleted file mode 100644
index 759940bb5..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/17-spatInSituPlotPoints.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/1b-FOVs.png b/vignettes/images/vizgen_mouse_brain/1b-FOVs.png
deleted file mode 100644
index 972e55f0b..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/1b-FOVs.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/2-dapi0_preview.png b/vignettes/images/vizgen_mouse_brain/2-dapi0_preview.png
deleted file mode 100644
index dbf4aa093..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/2-dapi0_preview.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/3-img_overlay.png b/vignettes/images/vizgen_mouse_brain/3-img_overlay.png
deleted file mode 100644
index 372be0695..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/3-img_overlay.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/4-img_overlay_zoom.png b/vignettes/images/vizgen_mouse_brain/4-img_overlay_zoom.png
deleted file mode 100644
index cdd8a5038..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/4-img_overlay_zoom.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/5-nr_feats.png b/vignettes/images/vizgen_mouse_brain/5-nr_feats.png
deleted file mode 100644
index f00d96457..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/5-nr_feats.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/6-screePlot.png b/vignettes/images/vizgen_mouse_brain/6-screePlot.png
deleted file mode 100644
index c3e4cfa36..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/6-screePlot.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/7-PCA.png b/vignettes/images/vizgen_mouse_brain/7-PCA.png
deleted file mode 100644
index b79f97d69..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/7-PCA.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/8-UMAP.png b/vignettes/images/vizgen_mouse_brain/8-UMAP.png
deleted file mode 100644
index 6034eb270..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/8-UMAP.png and /dev/null differ
diff --git a/vignettes/images/vizgen_mouse_brain/9-UMAP.png b/vignettes/images/vizgen_mouse_brain/9-UMAP.png
deleted file mode 100644
index 04f721b53..000000000
Binary files a/vignettes/images/vizgen_mouse_brain/9-UMAP.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/1_spatplot.png b/vignettes/images/xenium_breast_cancer/1_spatplot.png
deleted file mode 100644
index 21d670514..000000000
Binary files a/vignettes/images/xenium_breast_cancer/1_spatplot.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/2_HVF.png b/vignettes/images/xenium_breast_cancer/2_HVF.png
deleted file mode 100644
index ab867158e..000000000
Binary files a/vignettes/images/xenium_breast_cancer/2_HVF.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/3a_screePlot.png b/vignettes/images/xenium_breast_cancer/3a_screePlot.png
deleted file mode 100644
index 773e017c9..000000000
Binary files a/vignettes/images/xenium_breast_cancer/3a_screePlot.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/3b_PCA.png b/vignettes/images/xenium_breast_cancer/3b_PCA.png
deleted file mode 100644
index 4a33d699d..000000000
Binary files a/vignettes/images/xenium_breast_cancer/3b_PCA.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/4a_tSNE.png b/vignettes/images/xenium_breast_cancer/4a_tSNE.png
deleted file mode 100644
index 5b8bd52e7..000000000
Binary files a/vignettes/images/xenium_breast_cancer/4a_tSNE.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/4b_UMAP.png b/vignettes/images/xenium_breast_cancer/4b_UMAP.png
deleted file mode 100644
index 6b5bf0fe1..000000000
Binary files a/vignettes/images/xenium_breast_cancer/4b_UMAP.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/5_umap_leiden.png b/vignettes/images/xenium_breast_cancer/5_umap_leiden.png
deleted file mode 100644
index 2fc18df1b..000000000
Binary files a/vignettes/images/xenium_breast_cancer/5_umap_leiden.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/6_spat_leiden.png b/vignettes/images/xenium_breast_cancer/6_spat_leiden.png
deleted file mode 100644
index 917093567..000000000
Binary files a/vignettes/images/xenium_breast_cancer/6_spat_leiden.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/7_polys.png b/vignettes/images/xenium_breast_cancer/7_polys.png
deleted file mode 100644
index b410dc587..000000000
Binary files a/vignettes/images/xenium_breast_cancer/7_polys.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/8_subset_in_situ.png b/vignettes/images/xenium_breast_cancer/8_subset_in_situ.png
deleted file mode 100644
index c78ae672d..000000000
Binary files a/vignettes/images/xenium_breast_cancer/8_subset_in_situ.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/gpoints_blnk.png b/vignettes/images/xenium_breast_cancer/gpoints_blnk.png
deleted file mode 100644
index b7d3d0cfd..000000000
Binary files a/vignettes/images/xenium_breast_cancer/gpoints_blnk.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/gpoints_expr.png b/vignettes/images/xenium_breast_cancer/gpoints_expr.png
deleted file mode 100644
index f9145d307..000000000
Binary files a/vignettes/images/xenium_breast_cancer/gpoints_expr.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/gpoints_ngcode.png b/vignettes/images/xenium_breast_cancer/gpoints_ngcode.png
deleted file mode 100644
index 57ac0192f..000000000
Binary files a/vignettes/images/xenium_breast_cancer/gpoints_ngcode.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/gpoints_ngprbe.png b/vignettes/images/xenium_breast_cancer/gpoints_ngprbe.png
deleted file mode 100644
index 29f0f131d..000000000
Binary files a/vignettes/images/xenium_breast_cancer/gpoints_ngprbe.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/gpolys.png b/vignettes/images/xenium_breast_cancer/gpolys.png
deleted file mode 100644
index ce1838b42..000000000
Binary files a/vignettes/images/xenium_breast_cancer/gpolys.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/gpolys_centroids.png b/vignettes/images/xenium_breast_cancer/gpolys_centroids.png
deleted file mode 100644
index de02bdb4c..000000000
Binary files a/vignettes/images/xenium_breast_cancer/gpolys_centroids.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/he_prev.png b/vignettes/images/xenium_breast_cancer/he_prev.png
deleted file mode 100644
index de5d8f045..000000000
Binary files a/vignettes/images/xenium_breast_cancer/he_prev.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/if_prev.png b/vignettes/images/xenium_breast_cancer/if_prev.png
deleted file mode 100644
index fb74e5cd6..000000000
Binary files a/vignettes/images/xenium_breast_cancer/if_prev.png and /dev/null differ
diff --git a/vignettes/images/xenium_breast_cancer/large_preview.png b/vignettes/images/xenium_breast_cancer/large_preview.png
deleted file mode 100644
index c3d7ce049..000000000
Binary files a/vignettes/images/xenium_breast_cancer/large_preview.png and /dev/null differ
diff --git a/vignettes/installation.Rmd b/vignettes/installation.Rmd
deleted file mode 100644
index d7c5504ab..000000000
--- a/vignettes/installation.Rmd
+++ /dev/null
@@ -1,503 +0,0 @@
----
-title: "Installation"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Installation}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-# 1. Installing Giotto Suite
-
-Giotto Suite is installed via R **but there are required Python modules** which **must** be installed in order for Giotto Suite to function properly. Below are the instructions for both the installation of the Giotto Suite package and required Python environment.
-
-## 1.1 Requirements
-
-- R (\>= 4.0.1)
-- Python (\>= 3.6)
-- Windows, MacOS or Linux specific installation tools for [Posit](https://support.posit.co/hc/en-us/articles/200486498-Package-Development-Prerequisites) (previously RStudio)
-
-# 2. Installation
-
-## 2.1 Install Giotto Suite
-
-
-```{r, eval=FALSE}
-# Necessary for installation from R
-if(!"pak" %in% installed.packages()) {
- install.packages("pak")
-}
-
-pak::pkg_install("drieslab/Giotto")
-```
-
-
-## 2.2 Install the Giotto Python Environment
-
-
-```{r, eval=FALSE}
-library(Giotto)
-installGiottoEnvironment()
-```
-
-
-## 2.3 Solutions to Installation Errors
-
-### Errors on MacOS
-
-#### Packages not Found
-
-
-In the event that packages are inaccessible in the default installation of the Giotto miniconda environment, one troubleshooting method is provided here.
-
-
-```{r, eval=FALSE}
-# Restart the R session, while maintaining workspace variables.
-# If using RStudio, the following command will do exactly that:
-.rs.restartR()
-
-# Creating Giotto Instructions without specifying a Python path will make
-# reticulate activate the default Giotto environment.
-default_instrs <- createGiottoInstructions()
-
-# Extract python path information
-default_python_path <- default_instrs$python_path
-
-# Direct reticulate to use Python within the Giotto Environment
-reticulate::use_python(default_python_path)
-
-# Make reticulate iteratively check for the packages
-pkg_check <- function(){
- py_pkgs = c('pandas','networkx', 'igraph', 'leidenalg','community','sklearn','python.app')
- py_pkg_error = character()
- test_availability = TRUE
-
- for (i in py_pkgs){
- if(i == 'python.app' & Sys.info()[['sysname']] != "Darwin"){
- # If the machine OS is not OSX (Mac), break out of the loop
- # Otherwise, also check for python.app
- break
- }
- test_availability <- reticulate::py_module_available(i)
- if(!test_availability) {py_pkg_error <- c(py_pkg_error,i)}
- }
-
- if(test_availability){
- cat('All Python packages for Giotto are accessible at environment:\n', default_python_path)
- }else{
- for (x in py_pkg_error) cat(x,'was not found within environment:\n',default_python_path,'\n\n')
- }
-
- return(py_pkg_error)
-}
-
-# Check if packages exist again. Ensure function from above code block is defined.
-missing_packages <- pkg_check()
-
-retry_install <- length(missing_packages) > 0
-
-if(retry_install){
-
- # Attempt to reinstall all packages.
- pkgs_w_versions <- c('pandas==1.5.1',
- 'networkx==2.8.8',
- 'python-igraph==0.10.2',
- 'leidenalg==0.9.0',
- 'python-louvain==0.16',
- 'python.app==1.4',
- 'scikit-learn==1.1.3')
-
- python_version = "3.10.2"
-
- py_pkgs = c('pandas','networkx',
- 'igraph', 'leidenalg',
- 'python-louvain','scikit-learn','python.app')
-
- if(Sys.info()[['sysname']] != "Darwin"){
- pkgs_w_versions = pkgs_w_versions[!grepl(pattern = 'python.app', x = pkgs_w_versions)]
- py_pkgs = py_pkgs[!grepl(pattern = 'python.app', x = py_pkgs)]
- }
-
- env_location <- reticulate::py_discover_config()$pythonhome
- partial_path_to_conda <- paste0(reticulate::miniconda_path(),'/envs/giotto_env')
-
- py_lou = pkgs_w_versions[grepl(pattern = 'python-louvain',x = pkgs_w_versions)]
- pip_packages = c("smfishhmrf", py_lou)
- pkgs_w_versions = pkgs_w_versions[!grepl(pattern = 'python-louvain',x = pkgs_w_versions)]
-
- if(.Platform[['OS.type']] == 'unix') {
-
- conda_full_path = paste0(partial_conda_path,'/','bin/conda')
-
- # Remove all previous installations
- reticulate::conda_remove(envname = env_location,
- packages = py_pkgs,
- conda = conda_full_path)
-
- # Reinstall
- reticulate::conda_install(packages = pkgs_w_versions,
- envname = env_location,
- method = 'conda',
- conda = conda_full_path,
- python_version = python_version)
-
- # Reinstall with pip
- reticulate::conda_install(packages = pip_packages,
- envname = env_location,
- method = 'conda',
- conda = conda_full_path,
- pip = TRUE,
- python_version = python_version)
- }
- else if(.Platform[['OS.type']] == 'windows'){
- conda_full_path = paste0(partial_conda_path,'/','condabin/conda.bat')
-
- # Remove all previous installations
- reticulate::conda_remove(envname = env_location,
- packages = py_pkgs,
- conda = conda_full_path)
-
- # Reinstall
- reticulate::conda_install(packages = pkgs_w_versions,
- envname = env_location,
- method = 'conda',
- conda = conda_full_path,
- python_version = python_version,
- channel = c('conda-forge', 'vtraag'))
-
- # Reinstall with pip
- reticulate::conda_install(packages = pip_packages,
- envname = env_location,
- method = 'conda',
- conda = conda_full_path,
- pip = TRUE,
- python_version = python_version)
-
- }
-}
-```
-
-### Errors on Windows
-
-#### Windows 11 OpenSSL Error
-
-
-*Please note that this troubleshooting workflow is for a Windows 11 64-bit machine.*
-
-Unfortunately, it is known that installing miniconda on Windows 11 can sometimes result in an [OpenSSL error](https://github.com/drieslab/Giotto/issues/425#issuecomment-1320499840).
-
-It should be noted that Conda developers are aware of this, and that this particular issue does not have to do with the configuration of the Giotto package. One workaround for this error is described below and on the conda repository, [here](https://github.com/conda/conda/issues/8273#issue-409800067).
-
-First, open a terminal and navigate to the folder in which miniconda lives on the machine. To find this, press the Windows Key and search for "Anaconda Prompt". If anaconda3 is installed on the machine, there may be multiple options for this terminal; choose the Anaconda Prompt with "R-MINI~1" in parenthesis.
-
-Output from the following commands will be provided as a comparative guide. Once the terminal is open, identify the Conda environments on the machine by running the following:
-
-
-```{r, eval=FALSE}
-(base) PS > conda info --envs
-
-# conda environments:
-#
-# base * C:\Users\matto\AppData\Local\R-MINI~1
-# giotto_env C:\Users\matto\AppData\Local\R-MINI~1\envs\giotto_env
-# C:\Users\matto\AppData\Local\r-miniconda\envs\giotto_env
-# C:\Users\matto\anaconda3
-```
-
-
-Change your current directory to the R-MINI\~1 subdirectory. Then, navigate to the Library/bin/ subdirectory within. Use the dir command to search bin for two groups of files. These files will be moved to a different directory, and should fix the issue. There may be more than two files per group here, and that is okay. All of the files with these names will be moved, regardless of the extension.
-
-
-```{r, eval=FALSE}
-(base) PS > cd C:\Users\matto\AppData\Local\R-MINI~1
-(base) PS > cd .\Library\bin
-(base) PS > dir libssl-1_1-x64.*
-
-# Directory: C:\Users\matto\AppData\Local\r-miniconda\Library\bin
-
-
-# Mode LastWriteTime Length Name
-# ---- ------------- ------ ----
-# -a---- 11/4/2022 11:06 AM 686080 libssl-1_1-x64.dll
-# -a---- 11/4/2022 11:06 AM 2338816 libssl-1_1-x64.pdbo
-
-(base) PS > dir libcrypto-1_1-x64.*
-
-# Directory: C:\Users\matto\AppData\Local\r-miniconda\Library\bin
-
-
-# Mode LastWriteTime Length Name
-# ---- ------------- ------ ----
-# -a---- 11/4/2022 11:06 AM 3416064 libcrypto-1_1-x64.dll
-# -a---- 11/4/2022 11:06 AM 10219520 libcrypto-1_1-x64.pdb
-```
-
-
-Once these files are located, they may be moved to R-MINI\~1/DLLs/, the proper directory for the search path.
-
-
-```{r, eval=FALSE}
-(base) PS > pwd
-
-# Path
-# ----
-# C:\Users\matth\AppData\Local\r-miniconda\Library\bin
-
-(base) PS > mv libssl-1_1-x64.* ..\..\DLLs\
-(base) PS > mv libcrypto-1_1-x64.* ..\..\DLLs\
-```
-
-
-Finally, change to the DLLs directory within R-MINI\~1 and verify that the files now exist there.
-
-
-```{r, eval=FALSE}
-(base) PS > cd C:\Users\matth\AppData\Local\r-miniconda\DLLs\
-(base) PS > dir libssl-1_1-x64.*
-
-# Directory: C:\Users\matth\AppData\Local\r-miniconda\DLLs
-
-
-# Mode LastWriteTime Length Name
-# ---- ------------- ------ ----
-# -a---- 11/4/2022 11:07 AM 686080 libssl-1_1-x64.dll
-# -a---- 11/4/2022 11:07 AM 2338816 libssl-1_1-x64.pdb
-
-(base) PS > dir libcrypto-1_1-x64.*
-
-# Directory: C:\Users\matto\AppData\Local\r-miniconda\DLLs
-
-
-# Mode LastWriteTime Length Name
-# ---- ------------- ------ ----
-# -a---- 11/4/2022 11:07 AM 3416064 libcrypto-1_1-x64.dll
-# -a---- 11/4/2022 11:07 AM 10219520 libcrypto-1_1-x64.pdb
-```
-
-
-Now that these files have moved, this error should disappear. Activate the Giotto environment, and run python within it to test a package import. The OpenSSL error should no longer occur.
-
-
-```{r, eval=FALSE}
-(base) PS > conda info --envs
-
-# conda environments:
-#
-# base * C:\Users\matto\AppData\Local\R-MINI~1
-# giotto_env C:\Users\matto\AppData\Local\R-MINI~1\envs\giotto_env
-# C:\Users\matto\AppData\Local\r-miniconda\envs\giotto_env
-# C:\Users\matto\anaconda3
-
-(base) PS > conda activate giotto_env
-(giotto_env) PS > cd C:\Users\matto\AppData\Local\R-MINI~1\envs\giotto_env
-(giotto_env) PS > python
-Python 3.10.2 | packaged by conda-forge | (main, Mar 8 2022, 15:47:33) [MSC v.1929 64 bit (AMD64)] on win32
-Type "help", "copyright", "credits" or "license" for more information.
->>> import pandas, networkx, igraph, leidenalg, community, sklearn
->>>
-```
-
-### UnsatisfiableError
-
-
-This error results from conflicts within the anaconda and miniconda environment. This error presents itself when conflicting versions of conda live on the same machine; conda environments can only be so isolated from each other. To begin the troubleshooting workflow, open a terminal (macOS, Linux) or an Anaconda Prompt (Windows), and identify the environments on the machine. If anaconda3 is installed on the Windows machine, there may be multiple options for this terminal; choose the Anaconda Prompt with "anaconda3" in parenthesis.
-
-**NOTE:** The following commands will be shown as if within an Anaconda Prompt to emphasize the difference for Windows users; for these purposes, the only difference between terminals is the appearance of the message (i.e., (active_env) PS \>) preceding the textual entry. No output will be shown here as differences in OS, environments, and versions will vary.
-
-First, identify the environments on the machine:
-
-
-```{r, eval=FALSE}
-(base) PS > conda info --envs
-```
-
-
-To proceed, any r-miniconda associated environments will be deleted, and the base environment will be updated. If **any** environment is frequently used for other analyses and a python version update is undesirable, it may be preserved by cloning the environment. The original environment, however, will be removed or updated, so ensure that files and workflows associated with this environment are redirected to the new, cloned environment. Ensure the path of the cloned environment is not associated with r-miniconda.
-
-**It is recommended that conda is updated within any cloned environment (see below).**
-
-
-```{r, eval=FALSE}
-(base) PS > conda create --name my_base_clone --clone base
-```
-
-
-Verify that the clone exists to the proper specifications before proceeding by comparing packages and python versions:
-
-
-```{r, eval=FALSE}
-(base) PS > conda info --envs
-(base) PS > conda activate my_base_clone
-(my_base_clone) PS > conda update conda
-(my_base_clone) PS > python -V
-(my_base_clone) PS > conda list
-(my_base_clone) PS > conda activate base
-(base) PS > python -V
-(base) PS > conda list
-```
-
-
-Ensure the base environment is activated. If the r-miniconda environments are still on the machine, remove them. Specify the r-miniconda environments other than giotto_env, as these will be unique to the machine. This may be done at the command line:
-
-
-```{r, eval=FALSE}
-(base) PS > conda env remove --name giotto_env
-(base) PS > conda env remove /path/to/r-miniconda/
-```
-
-
-Alternatively, in R, reticulate can uninstall miniconda and remove the associated environments:
-
-
-```{r, eval=FALSE}
-reticulate::miniconda_uninstall()
-```
-
-
-It is advisable to remove any and all environments which are outdated and/or no longer used.
-
-Recall that by default, Giotto installs a miniconda environment with python v3.10.2 for interfacing with R. Older versions of conda in the base environment cannot handle a python version that high in a different environment. Therefore, the recommended troubleshooting method is to update conda and python within the base environment at a minimum. Updating to python v3.8.5 at a minimum is recommended. It is advisable to update conda and python within *each* environment on the machine if feasible.
-
-
-```{r, eval=FALSE}
-(base) PS > conda update conda
-(base) PS > conda update python==3.8.5
-```
-
-
-Finally, close the terminal and open the RStudio, VSCode, or an alternative IDE. Running the following should ensure successful installation:
-
-
-```{r, eval=FALSE}
-library(Giotto)
-installGiottoEnvironment(force_environment = TRUE, force_miniconda = TRUE)
-```
-
-
-If the issue persists, please post an issue on the [GitHub](https://github.com/drieslab/Giotto/issues).
-
-### Installation Time out
-
-
-If you're installing Giotto using the devtools or remote packages, with the most recent version of Giotto, the following error has been observed:
-
-![](images/installation/timeout.png)
-
-
-This error is related to the time required for downloading the package. To solve the error, increase the limit of downloading time by running this code in your R console:
-
-```{r, eval=FALSE}
-options(timeout = max(1000, getOption("timeout")))
-```
-
-If you are doing the installation through a linux terminal, you can run instead this command to directly modify your R environment variable:
-
-```
-echo "R_DEFAULT_INTERNET_TIMEOUT = 1000" >> .Renviron
-```
-
-Alternatively, you can use the package pak to install Giotto
-
-```{r, eval=FALSE}
-if(!"pak" %in% installed.packages()) {
- install.packages("pak")
-}
-
-pak::pkg_install("drieslab/Giotto")
-```
-
-
-# 3. Try Giotto in the cloud
-
-You can also run analyses in Giotto on Terra.bio. Take a look on the [Terra tutorial](https://drieslab.github.io/Giotto/articles/terra.html).
-
-Encountering errors? Post to an issue to the Giotto GitHub page [here](https://github.com/drieslab/Giotto). Please include the version numbers of R, Giotto, and the OS in use at the time of the issue.
-
-# 4. Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: aarch64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.2.1
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/Mexico_City
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods
-[7] base
-
-other attached packages:
-[1] Giotto_4.0.2 GiottoClass_0.1.2
-
-loaded via a namespace (and not attached):
- [1] colorRamp2_0.1.0 DBI_1.2.0
- [3] bitops_1.0-7 biomaRt_2.58.0
- [5] rlang_1.1.2 magrittr_2.0.3
- [7] GiottoUtils_0.1.2 matrixStats_1.2.0
- [9] e1071_1.7-14 compiler_4.3.2
- [11] RSQLite_2.3.4 png_0.1-8
- [13] vctrs_0.6.5 stringr_1.5.1
- [15] pkgconfig_2.0.3 SpatialExperiment_1.12.0
- [17] crayon_1.5.2 fastmap_1.1.1
- [19] backports_1.4.1 dbplyr_2.4.0
- [21] magick_2.8.2 XVector_0.42.0
- [23] utf8_1.2.4 rmarkdown_2.25
- [25] purrr_1.0.2 bit_4.0.5
- [27] xfun_0.41 zlibbioc_1.48.0
- [29] cachem_1.0.8 GenomeInfoDb_1.38.5
- [31] progress_1.2.3 blob_1.2.4
- [33] rhdf5filters_1.14.1 gmp_0.7-3
- [35] DelayedArray_0.28.0 Rhdf5lib_1.24.1
- [37] terra_1.7-65 parallel_4.3.2
- [39] prettyunits_1.2.0 R6_2.5.1
- [41] stringi_1.8.3 ClusterR_1.3.2
- [43] GenomicRanges_1.54.1 Rcpp_1.0.11
- [45] assertthat_0.2.1 SummarizedExperiment_1.32.0
- [47] knitr_1.45 IRanges_2.36.0
- [49] Matrix_1.6-4 tidyselect_1.2.0
- [51] yaml_2.3.8 rstudioapi_0.15.0
- [53] abind_1.4-5 codetools_0.2-19
- [55] curl_5.2.0 lattice_0.21-9
- [57] tibble_3.2.1 Biobase_2.62.0
- [59] KEGGREST_1.42.0 evaluate_0.23
- [61] sf_1.0-15 units_0.8-5
- [63] proxy_0.4-27 BiocFileCache_2.10.1
- [65] xml2_1.3.6 Biostrings_2.70.1
- [67] pillar_1.9.0 filelock_1.0.3
- [69] MatrixGenerics_1.14.0 KernSmooth_2.23-22
- [71] checkmate_2.3.1 stats4_4.3.2
- [73] generics_0.1.3 RCurl_1.98-1.13
- [75] S4Vectors_0.40.2 hms_1.1.3
- [77] ggplot2_3.4.4 munsell_0.5.0
- [79] scales_1.3.0 class_7.3-22
- [81] glue_1.6.2 tools_4.3.2
- [83] GiottoVisuals_0.1.1 data.table_1.14.10
- [85] XML_3.99-0.16 cowplot_1.1.2
- [87] rhdf5_2.46.1 grid_4.3.2
- [89] AnnotationDbi_1.64.1 colorspace_2.1-0
- [91] SingleCellExperiment_1.24.0 GenomeInfoDbData_1.2.11
- [93] cli_3.6.2 rappdirs_0.3.3
- [95] fansi_1.0.6 S4Arrays_1.2.0
- [97] arrow_14.0.0.2 dplyr_1.1.4
- [99] gtable_0.3.4 digest_0.6.33
-[101] progressr_0.14.0 BiocGenerics_0.48.1
-[103] classInt_0.4-10 SparseArray_1.2.3
-[105] rjson_0.2.21 memoise_2.0.1
-[107] htmltools_0.5.7 lifecycle_1.0.4
-[109] httr_1.4.7 bit64_4.0.5
-```
diff --git a/vignettes/interactive_selection.Rmd b/vignettes/interactive_selection.Rmd
deleted file mode 100644
index 66d38d1f2..000000000
--- a/vignettes/interactive_selection.Rmd
+++ /dev/null
@@ -1,386 +0,0 @@
----
-title: "Interactive selection"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Interactive selection}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Set up Giotto object
-
-NOTE: To follow this tutorial, you must pre-run the Parts 1-4 from the [Mouse Visium Brain tutorial](https://giottosuite.readthedocs.io/en/latest/subsections/datasets/mouse_visium_brain.html)
-
-You can use as input either a ggplot2 object, a terra::rast image, or the output of running the spatPlot2D( ) function.
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!'Giotto' %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure GiottoData, a small, helper module for tutorials, is installed.
-if(!'GiottoData' %in% installed.packages()) {
- pak::pkg_install('drieslab/GiottoData')
-}
-
-library(Giotto)
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- installGiottoEnvironment()
-}
-```
-
-
-# 1. Create a Giotto spatPlot object
-
-When creating the spatPlot2D object, you can only plot the spatial cells/spots or show the tissue image in the background.
-
-If you plan to select individual clusters or cell types, we recommend coloring the cells/spots using the cell_color argument.
-
-
-```{r, eval=FALSE}
-## Plot spatial cells/spots
-my_spatPlot <- spatPlot2D(gobject = visium_brain,
- cell_color = 'leiden_clus',
- point_size = 1.5,
- point_alpha = 0.5,
- show_image = FALSE)
-
-## Plot spatial cells/spots with tissue on the background
-my_spatPlot <- spatPlot2D(gobject = visium_brain,
- point_size = 1.5,
- point_alpha = 0.1,
- show_image = TRUE)
-```
-
-
-# 2. Run the interactive selection tool
-
-plotInteractivePolygons( ) will run a ShinyApp gadget within your RStudio session. Use your cursor to draw the area of interest and add a name. You can draw as many regions as you wish.
-
-
-```{r, eval=FALSE}
-## Run the Shiny app with default parameters
-plotInteractivePolygons(my_spatPlot)
-```
-
-
-![](images/interactive_selection/1-interactive_brain_spots.png)
-
-
-```{r, eval=FALSE}
-## Run the Shiny app using the tissue image
-plotInteractivePolygons(my_spatPlot)
-```
-
-
-![](images/interactive_selection/2-interactive_brain_tissue.png)
-
-You can use additional parameters passed to the polygon( ) function, such as the line thickness and color of the polygons.
-
-
-```{r, eval=FALSE}
-## Modify the width and/or color of the line
-plotInteractivePolygons(my_spatPlot,
- color = 'black',
- lwd = 2)
-```
-
-
-![](images/interactive_selection/3-interactive_brain_black.png)
-
-
-```{r, eval=FALSE}
-## Modify the width or heigh of the plotted image
-plotInteractivePolygons(my_spatPlot,
- height = 500)
-```
-
-
-![](images/interactive_selection/4-interactive_brain_height.png)
-
-Use the slider bars to zoom in or out your plot and draw tiny polygons.
-
-
-```{r, eval=FALSE}
-## Use the zoom in and out slide-bars to select small areas
-plotInteractivePolygons(my_spatPlot,
- height = 320)
-```
-
-
-![](images/interactive_selection/5-interactive_brain_zoom.png)
-
-# 3. Save the coordinates
-
-Click on the button *Done* once you have finished selecting the areas of interest.
-
-By default, plotInteractivePolygons() will print the polygon x and y coordinates as a 'data.table' object on the Console panel, but you can store the output using the assignment operator.
-
-
-```{r, eval=FALSE}
-## The polygon coordinates will be saved on my_polygon_coordinates as a data.table object
-my_polygon_coordinates <- plotInteractivePolygons(my_spatPlot,
- height = 320)
-```
-
-
-![](images/interactive_selection/6-my_polygon_coordinates.png)
-
-Now, let's add the polygon coordinates to the Giotto object:
-
-Create a polygon object
-
-```{r, eval=FALSE}
-## We must transform the data.table or data.frame with coordinates into a Giotto polygon object
-my_giotto_polygons <- createGiottoPolygonsFromDfr(my_polygon_coordinates,
- name = 'selections')
-```
-
-If you plan to save and load your Giotto object after adding the selected polygons, include the centroids of the polygon by using the following argument:
-
-```{r, eval=FALSE}
-## We must transform the data.table or data.frame with coordinates into a Giotto polygon object
-my_giotto_polygons <- createGiottoPolygonsFromDfr(my_polygon_coordinates,
- name = 'selections',
- calc_centroids = TRUE)
-```
-
-Then, add the polygons to the Giotto object
-
-```{r, eval=FALSE}
-visium_brain <- addGiottoPolygons(gobject = visium_brain,
- gpolygons = list(my_giotto_polygons))
-```
-
-
-Finally, add the corresponding polygon ID to the cell Metadata. By default, the function will add a 'no_polygon' label to cells outside polygons, but you can customize it using the na.label argument.
-
-
-```{r, eval=FALSE}
-## Using the default parameters
-visium_brain <- addPolygonCells(visium_brain,
- polygon_name = 'selections')
-
-## Let's see how it looks like now the cell_metadata
-pDataDT(visium_brain)
-```
-
-
-![](images/interactive_selection/7-new_metadata.png)
-
-
-```{r, eval=FALSE}
-## Customize the NA label
-visium_brain <- addPolygonCells(visium_brain,
- polygon_name = 'selections',
- na.label = 'No Polygon')
-```
-
-
-![](images/interactive_selection/8-new_metadata_customized.png)
-
-# 4. Get the cells located within each polygon
-
-
-You can extract the coordinates and IDs from cells located within one or multiple regions of interest.
-
-
-```{r, eval=FALSE}
-## Provide the name of the polygon to extract cells from
-getCellsFromPolygon(visium_brain,
- polygon_name = 'selections',
- polygons = 'polygon 1')
-```
-
-
-![](images/interactive_selection/9-get_cells_polygon_1.png)
-
-
-```{r, eval=FALSE}
-## If no polygon name is provided, the function will retrieve cells located within all polygons
-getCellsFromPolygon(visium_brain,
- polygon_name = 'selections')
-```
-
-
-![](images/interactive_selection/10-get_cells.png)
-
-# 5. Compare gene expression
-
-Let's compare the expression levels of some genes of interest between the selected regions.
-
-
-```{r, eval=FALSE}
-## You can provide a list of genes
-comparePolygonExpression(visium_brain,
- selected_feats = c('Stmn1', 'Psd', 'Ly6h'))
-```
-
-
-![](images/interactive_selection/11-compare_genes.png)
-
-
-```{r, eval=FALSE}
-## Or calculate the top genes expressed within each region, then provide the result to compare polygons.
-scran_results <- findMarkers_one_vs_all(visium_brain,
- spat_unit = 'cell',
- feat_type = 'rna',
- method = 'scran',
- expression_values = 'normalized',
- cluster_column = 'selections',
- min_feats = 10)
-
-top_genes <- scran_results[, head(.SD, 2), by = 'cluster']$feats
-
-comparePolygonExpression(visium_brain,
- selected_feats = top_genes)
-```
-
-
-![](images/interactive_selection/12-compare_topgenes.png)
-
-# 6. Compare cell type abundance
-
-If you have run an analysis for finding clusters or have annotated cell types within the cell metadata slot, you can use the column name to compare the abundance of cell types between the selected regions.
-
-
-```{r, eval=FALSE}
-## By default, the function will look for the leiden_cluster
-compareCellAbundance(visium_brain)
-
-## You can use other columns within the cell metadata table to compare the cell type abundances
-compareCellAbundance(visium_brain, cell_type_column = 'cell_type')
-```
-
-
-![](images/interactive_selection/13-compare_cell_abundance.png)
-
-# 7. Create a spatPlot per region
-
-You can use the spatPlot( ) arguments to isolate and plot each region. Also, you can color each cell by cluster, cell type or expression level.
-
-
-```{r, eval=FALSE}
-## Compare clusters within each region
-spatPlot2D(visium_brain,
- cell_color = 'leiden_clus',
- group_by = 'selections',
- point_size = 1,
- coord_fix_ratio = 1,
- cow_n_col = 3,
- show_legend = FALSE)
-```
-
-![](images/interactive_selection/14-compare_spatplots.png)
-
-```{r, eval=FALSE}
-## Compare expression levels between regions
-spatFeatPlot2D(visium_brain,
- expression_values = 'scaled',
- group_by = 'selections',
- feats = 'Psd',
- point_size = 1)
-```
-
-![](images/interactive_selection/15-compare_spatfeatplot.png)
-
-# 8. Plot again the polygons
-
-You can plot again all or some drawn polygons. The minimal input is the Giotto object containing polygon coordinates within the spatial_info slot, as well as the spatial plot.
-
-
-```{r, eval=FALSE}
-## Plot all polygons
-plotPolygons(visium_brain,
- polygon_name = 'selections',
- x = my_spatPlot)
-```
-
-![](images/interactive_selection/16-plotPolygons.png)
-
-Additionaly, you can plot a few polygons by providing a vector with the polygon IDs.
-
-```{r, eval=FALSE}
-## Plot a subset of polygons
-plotPolygons(visium_brain,
- polygon_name = 'selections',
- x = my_spatPlot,
- polygons = 'polygon 2')
-```
-
-![](images/interactive_selection/17-plotPolygon2.png)
-
-# 9. Session info
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.3.1
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] shiny_1.8.0 Giotto_4.0.2 GiottoClass_0.1.3
-
-loaded via a namespace (and not attached):
- [1] colorRamp2_0.1.0 bitops_1.0-7 rlang_1.1.3
- [4] magrittr_2.0.3 GiottoUtils_0.1.5 matrixStats_1.2.0
- [7] compiler_4.3.2 png_0.1-8 systemfonts_1.0.5
- [10] vctrs_0.6.5 pkgconfig_2.0.3 SpatialExperiment_1.12.0
- [13] crayon_1.5.2 fastmap_1.1.1 ellipsis_0.3.2
- [16] backports_1.4.1 magick_2.8.2 XVector_0.42.0
- [19] labeling_0.4.3 utf8_1.2.4 promises_1.2.1
- [22] rmarkdown_2.25 ragg_1.2.7 xfun_0.42
- [25] cachem_1.0.8 zlibbioc_1.48.0 beachmat_2.18.0
- [28] GenomeInfoDb_1.38.6 jsonlite_1.8.8 later_1.3.2
- [31] DelayedArray_0.28.0 BiocParallel_1.36.0 terra_1.7-71
- [34] irlba_2.3.5.1 parallel_4.3.2 R6_2.5.1
- [37] bslib_0.6.1 RColorBrewer_1.1-3 reticulate_1.35.0
- [40] parallelly_1.36.0 jquerylib_0.1.4 GenomicRanges_1.54.1
- [43] Rcpp_1.0.12 SummarizedExperiment_1.32.0 knitr_1.45
- [46] future.apply_1.11.1 R.utils_2.12.3 IRanges_2.36.0
- [49] FNN_1.1.4 httpuv_1.6.14 Matrix_1.6-5
- [52] igraph_2.0.1.1 tidyselect_1.2.0 rstudioapi_0.15.0
- [55] abind_1.4-5 yaml_2.3.8 codetools_0.2-19
- [58] miniUI_0.1.1.1 listenv_0.9.1 lattice_0.22-5
- [61] tibble_3.2.1 Biobase_2.62.0 withr_3.0.0
- [64] evaluate_0.23 Rtsne_0.17 future_1.33.1
- [67] pillar_1.9.0 MatrixGenerics_1.14.0 checkmate_2.3.1
- [70] stats4_4.3.2 generics_0.1.3 dbscan_1.1-12
- [73] RCurl_1.98-1.14 S4Vectors_0.40.2 ggplot2_3.4.4
- [76] munsell_0.5.0 scales_1.3.0 xtable_1.8-4
- [79] gtools_3.9.5 globals_0.16.2 glue_1.7.0
- [82] tools_4.3.2 GiottoVisuals_0.1.4 data.table_1.15.0
- [85] ScaledMatrix_1.10.0 cowplot_1.1.3 grid_4.3.2
- [88] colorspace_2.1-0 SingleCellExperiment_1.24.0 GenomeInfoDbData_1.2.11
- [91] BiocSingular_1.18.0 cli_3.6.2 rsvd_1.0.5
- [94] textshaping_0.3.7 fansi_1.0.6 S4Arrays_1.2.0
- [97] dplyr_1.1.4 uwot_0.1.16 gtable_0.3.4
-[100] R.methodsS3_1.8.2 sass_0.4.8 digest_0.6.34
-[103] BiocGenerics_0.48.1 SparseArray_1.2.3 ggrepel_0.9.5
-[106] rjson_0.2.21 farver_2.1.1 memoise_2.0.1
-[109] htmltools_0.5.7 R.oo_1.26.0 lifecycle_1.0.4
-[112] mime_0.12
-```
-
diff --git a/vignettes/interoperability_anndata.Rmd b/vignettes/interoperability_anndata.Rmd
deleted file mode 100644
index 0359a5daa..000000000
--- a/vignettes/interoperability_anndata.Rmd
+++ /dev/null
@@ -1,170 +0,0 @@
----
-title: "Interoperability: AnnData"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Interoperability: AnnData}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# 1. Converting to and from AnnData (squidpy-flavor)
-
-This tutorial details how to use the conversion functions `anndataToGiotto()` and `giottoToAnnData()`. A mini Giotto object will be used for minimal computational requirements. Please note that these functions are inherently in active development, since changes to either squidpy or anndata are possible.
-
-# 2. Start Giotto
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-library(Giotto)
-
-# Ensure Giotto Data is installed
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-library(GiottoData)
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- installGiottoEnvironment()
-}
-```
-
-
-# 3. Create a Giotto object
-
-
-```{r, eval=FALSE}
-# Specify path to which results may be saved
-results_directory = paste0(getwd(),'/giotto_anndata_conversion/')
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-
-mini_gobject = loadGiottoMini(dataset = 'vizgen',
- python_path = my_python_path)
-
-instrs = showGiottoInstructions(mini_gobject)
-instrs$save_dir = results_directory
-
-mini_gobject = replaceGiottoInstructions(gobject = mini_gobject,
- instructions = instrs)
-```
-
-
-# 4. Convert Giotto to AnnData
-
-Since Giotto is structured hierarchally, converting Giotto to AnnData will result in multiple `.h5ad` files. Each file will correspond to a Giotto `spat_unit` `feat_type` pair. Furthermore, each expression slot will be treated as a `layer` in the resulting AnnData slot.
-
-Squidpy anndata objects take different defaults for various operations compared to Giotto. For instance, the default nearest neighbor network is a kNN for squidpy, while the default for Giotto is a sNN. We'll create a kNN in addition to the sNN within this object already to show how it they are handled.
-
-
-```{r, eval=FALSE}
-mini_gobject = createNearestNetwork(gobject = mini_gobject,
- spat_unit = "aggregate",
- feat_type = "rna",
- type = "kNN",
- dim_reduction_to_use = "umap",
- dim_reduction_name = "umap",
- k = 15,
- name = "kNN.umap")
-```
-
-
-The above cell creates a nearest network with almost all default parameters. We'll change some and make a new network to show how the converter handles this.
-
-
-```{r, eval=FALSE}
-mini_gobject = createNearestNetwork(gobject = mini_gobject,
- spat_unit = "aggregate",
- feat_type = "rna",
- type = "kNN",
- dim_reduction_to_use = "umap",
- dim_reduction_name = "umap",
- k = 6,
- name = "new_network")
-```
-
-
-Since we have multiple `spat_unit` `feat_type` pairs, there will be multiple files created by this function. The names of the `.h5ad` files will be returned. In the case of a non-anndata-default nearest network or spatial network name, the key_added terms will be recorded and saved in `.txt` files named accordingly. Please see the documentation for further details.
-
-
-```{r, eval=FALSE}
-anndata_conversions = giottoToAnnData(gobject = mini_gobject,
- save_directory = results_directory,
- python_path = my_python_path)
-```
-
-
-# 5. AnnData to Giotto
-
-To convert an AnnData Object back into a Giotto object, it must first be saved as a `.h5ad` file. The name of said file may then be provided to `anndataToGiotto()` for conversion.
-
-If a nearest neighbor network or spatial netowkr was created using the `key_added` argument, they may be provided to arguments n_key_added and/or spatial_n\_key_added, respectively. If converting an anndata object that was originally a giotto object, the `.txt` files generated by `giottoToAnnData()` may be provided to these arguments as well.
-
-
-```{r, eval=FALSE}
-z0_rna_gobject <- anndataToGiotto(anndata_path = "./giotto_anndata_conversion/z0_rna_converted_gobject.h5ad",
- python_path = my_python_path)
-
-z1_rna_gobject <- anndataToGiotto(anndata_path = "./giotto_anndata_conversion/z1_rna_converted_gobject.h5ad",
- python_path = my_python_path)
-
-aggregate_rna_gobject <- anndataToGiotto(anndata_path = "./giotto_anndata_conversion/aggregate_rna_converted_gobject.h5ad",
- python_path = my_python_path,
- n_key_added = list("sNN.pca","new_network"),
- spatial_n_key_added = "aggregate_rna_spatial_network_keys_added.txt")
-```
-
-
-# 6. Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
- R version 4.2.2 (2022-10-31 ucrt)
- Platform: x86_64-w64-mingw32/x64 (64-bit)
- Running under: Windows 10 x64 (build 22621)
-
- Matrix products: default
-
- locale:
- [1] LC_COLLATE=English_United States.utf8
- [2] LC_CTYPE=English_United States.utf8
- [3] LC_MONETARY=English_United States.utf8
- [4] LC_NUMERIC=C
- [5] LC_TIME=English_United States.utf8
-
- attached base packages:
- [1] stats graphics grDevices utils datasets methods base
-
- other attached packages:
- [1] GiottoData_0.2.1 Giotto_3.2.1
-
- loaded via a namespace (and not attached):
- [1] Rcpp_1.0.10 pillar_1.9.0 compiler_4.2.2 tools_4.2.2
- [5] digest_0.6.30 jsonlite_1.8.3 evaluate_0.20 lifecycle_1.0.3
- [9] tibble_3.2.1 gtable_0.3.3 lattice_0.20-45 png_0.1-7
- [13] pkgconfig_2.0.3 rlang_1.1.0 igraph_1.4.1 Matrix_1.5-1
- [17] cli_3.4.1 rstudioapi_0.14 parallel_4.2.2 yaml_2.3.7
- [21] xfun_0.38 fastmap_1.1.0 terra_1.7-18 dplyr_1.1.1
- [25] knitr_1.42 rappdirs_0.3.3 generics_0.1.3 vctrs_0.6.1
- [29] rprojroot_2.0.3 grid_4.2.2 tidyselect_1.2.0 here_1.0.1
- [33] reticulate_1.26 glue_1.6.2 data.table_1.14.6 R6_2.5.1
- [37] fansi_1.0.4 rmarkdown_2.21 ggplot2_3.4.1 magrittr_2.0.3
- [41] scales_1.2.1 codetools_0.2-18 htmltools_0.5.4 colorspace_2.1-0
- [45] utf8_1.2.3 munsell_0.5.0 dbscan_1.1-11
-
-```
diff --git a/vignettes/interoperability_spatialexperiment.Rmd b/vignettes/interoperability_spatialexperiment.Rmd
deleted file mode 100644
index 7a07d0821..000000000
--- a/vignettes/interoperability_spatialexperiment.Rmd
+++ /dev/null
@@ -1,374 +0,0 @@
----
-title: "Interoperability: SpatialExperiment"
-output: rmarkdown::html_vignette
-author: Iqra Amin, Irzam Sarfraz
-vignette: >
- %\VignetteIndexEntry{Interoperability: SpatialExperiment}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-## Introduction
-
-Giotto allows seamless analysis of spatial transcriptomics data provided through a range of functions and algorithms. At the same time, it also allows effortless conversion to other object types, so the data can be analyzed with other tools including packages from Bioconductor that mostly use *Experiment objects and their derivatives. In this tutorial, we show how cross-conversion between Giotto and SpatialExperiment objects can complement spatial transcriptomic analyses.
-
-In the first part of the tutorial, we load an example Giotto object, convert it to SpatialExperiment object and use a multitude of packages from Bioconductor to analyze it. In the second part, we use an example SpatialExperiment object, convert it to Giotto and drive the analysis with the toolkit.
-
-## 1.0 Giottoobj to SpatialExperiment
-
-In this part of the tutorial, we show the conversion of a an example Giotto object to SpatialExperiment object and use several packages to process it. Initially, we load the required packages:
-```{r main-libraries, message=FALSE}
-library(Giotto)
-library(GiottoData)
-library(SpatialExperiment)
-```
-
-## 1.2 Load a Giotto Object
-
-First, we load a example dataset from the GiottoData package. For this tutorial, we import a mini mouse brain dataset generated using the visium protocol.
-```{r load-giotto-mini, message=FALSE}
-g <- loadGiottoMini(dataset = "visium")
-```
-
-## 1.3 Convert to a SpatialExperiment obj
-
-We now convert this imported giotto object into a SpatialExperiment object using the “giottoToSpatialExperiment” function.
-```{r convert-to-spe, message=FALSE}
-gspe <- giottoToSpatialExperiment(g)
-```
-For each spatial unit the converter function returns a separate SpatialExperiment object. The output is a list of objects (one object for each unit) therefore we select the first object and use it downstream.
-
-```{r select-first-spe}
-spe <- gspe[[1]]
-```
-
-
-## 1.4 Downstream Analysis using SpatialExperiment object
-
-Now, we do some processing on the object including quality control, normalization, feature selection and dimensionality reduction.
-```{r downstream-packages, message=FALSE}
-library(ggspavis)
-library(pheatmap)
-```
-
-
-### 1.4.1 Quality Control Metrics
-
-Using the *scater* package from Bioconductor, we perform some initial quality control analysis. We particularly look for mitochondrial genes and compute some quality control metrics including total counts and features per cell. We then visualize these metrics and select thresholds to remove low quality cells.
-
-```{r scater, message=FALSE}
-library(scater)
-
-# identify mitochondrial genes
-is_mito <- grepl("(^MT-)|(^mt-)", rownames(spe))
-table(is_mito)
-
-# calculate per-spot QC metrics and store in colData
-spe <- addPerCellQC(spe, subsets = list(mito = is_mito),assay.type = "raw_rna_cell")
-head(colData(spe))
-```
-
-
-We plot a histogram of library size and select a threshold of 50 to remove low quality cells.
-```{r lib-size}
-# histogram of library sizes
-hist(colData(spe)$sum, breaks = 20)
-
-# select QC threshold
-qc_lib_size <- colData(spe)$sum < 50
-```
-
-We select a threshold of 18 for number of features detected per cell and remove the low quality cells.
-```{r filtering}
-# histogram of numbers of expressed genes
-hist(colData(spe)$detected, breaks = 20)
-
-# select QC threshold for number of expressed genes
-qc_detected <- colData(spe)$detected < 18
-# combined set of discarded spots
-discard <- qc_lib_size | qc_detected
-table(discard)
-
-colData(spe)$discard <- discard
-spe <- spe[, !colData(spe)$discard]
-spe
-```
-
-### 1.4.2 Normalization
-
-Now we calculate log-transformed normalized counts(logcounts) using library size factors using the scran package from Bioconductor.
-```{r normalization, message=FALSE}
-library(scran)
-
-# calculate library size factors
-spe <- computeLibraryFactors(spe, assay.type="raw_rna_cell")
-summary(sizeFactors(spe))
-
-hist(sizeFactors(spe), breaks = 20)
-
-# calculate logcounts and store in object
-spe <- logNormCounts(spe, assay.type="raw_rna_cell")
-
-# check
-assayNames(spe)
-```
-
-
-### 1.4.3 Feature selection
-
-To identify HVGs (highly variable genes), we use a mean-variance method “modelGeneVar” from the scran package.
-```{r hvg-detection}
-# fit mean-variance relationship
-dec <- modelGeneVar(spe)
-# visualize mean-variance relationship
-fit <- metadata(dec)
-plot(fit$mean, fit$var,
- xlab = "mean of log-expression", ylab = "variance of log-expression")
-curve(fit$trend(x), col = "dodgerblue", add = TRUE, lwd = 2)
-```
-
-
-### 1.4.4 Dimentionality Reduction (PCA)
-
-Now we apply dimensionality reduction methods to visualize the data and to generate inputs for further downstream analyses. For this purpose, we use the runPCA method to compute the top principal components and then finally plot the top two components.
-```{r pca}
-# compute PCA
-set.seed(123)
-spe <- runPCA(spe)
-reducedDimNames(spe)
-
-# plot top 2 PCA dimensions
-plotDimRed(spe , type = "PCA")
-```
-
-
-To visualize the clusters, we use a non-linear method “UMAP”, perform clustering and plot the cluster labels over on the UMAP.
-```{r umap}
-spe <- scater::runUMAP(spe)
-colnames(reducedDim(spe,"UMAP")) <- c("UMAP1","UMAP2")
-
-plotDimRed(spe, type = "UMAP")
-
-# graph-based clustering
-set.seed(123)
-k <- 5
-gGraphsnn <- buildSNNGraph(spe, k = k, use.dimred = "PCA")
-g_walk <- igraph::cluster_walktrap(gGraphsnn)
-clus <- g_walk$membership
-table(clus)
-
-
-# plot clusters in UMAP reduced dimensions
-colData(spe)$label <- clus
-plotDimRed(spe, type = "UMAP",annotate = "label", palette = "libd_layer_colors")
-```
-
-We identify the marker genes in each cluster and visualize the top genes in each cluster using a pheatmap
-
-```{r marker-detection}
-# test for marker genes
-markers <- findMarkers(spe, test = "binom", direction = "up")
-# plot log-fold changes for one cluster over all other clusters
-# selecting cluster 1
-interesting <- markers[[1]]
-best_set <- interesting[interesting$Top <= 5, ]
-logFCs <- getMarkerEffects(best_set)
-pheatmap(logFCs, breaks = seq(-5, 5, length.out = 101))
-
-# plot log-transformed normalized expression of top genes for one cluster
-top_genes <- head(rownames(interesting))
-plotExpression(spe, x = "label", features = top_genes)
-```
-
-
-
-## 2.0 SpatialExperiment to Giottoobj
-
-In this section, we load a sample dataset in the form of a SpatialExperiment object, convert it to Giotto and drive the downstream analysis with the Giotto toolkit.
-
-```{r spe-to-giotto, message=FALSE}
-library(SpatialExperiment)
-library(STexampleData)
-```
-
-## 2.1 Load a sample SpatialExperiment obj
-
-Loading sample SpatialExperiment Object as spe
-
-```{r load-visium-dlpfc, message=FALSE}
-spe <- Visium_humanDLPFC()
-spe
-```
-
-## 2.2 Convert to a giotto obj
-
-Converting SpatialExperiment Object to giottoobj. The new giottoobject is n_g.
-
-```{r convert-to-giotto, message=FALSE}
-#create giottoObject from spe
-n_g <- spatialExperimentToGiotto(spe, python_path = instructions(g)$python_path)
-```
-
-
-## 2.3 Downstream analysis with the giotto toolkit
-
-We filter the giottoobj and then run normalization on it.
-
-### 2.3.1 High Efficiency Data Processing
-
-```{r processgiotto, message=FALSE}
-n_g <- processGiotto(
- n_g,
- filter_params = list(expression_threshold = 1,
- feat_det_in_min_cells = 100,
- min_det_feats_per_cell = 10),
- norm_params = list(norm_methods = 'standard',
- scale_feats = TRUE,
- scalefactor = 6000),
- stat_params = list(expression_values = 'normalized'),
- adjust_params = list(expression_values = c('normalized'),
- covariate_columns = 'nr_feats')
-)
-```
-
-
-### 2.3.2 Dimension Reduction and PCA
-
-We first find the highly variable features (HVF) and then use these to compute the reduced dimensions using PCA.
-
-Calculate HVF using the loess regression prediction model:
-
-```{r giotto-hvf, message=FALSE}
-n_g <- calculateHVF(gobject = n_g, method = 'cov_loess')
-```
-
-
-PCA can be run based on the highly variable genes. After PCA, a tSNE, a UMAP, or both may be run. For this example, highly variable genes have been identified using Loess Regression predictions.
-
-```{r giotto-pca, message=FALSE}
-## Select genes highly variable genes that fit specified statistics
-# These are both found within feature metadata
-feature_metadata = getFeatureMetadata(n_g)[]
-featgenes = feature_metadata[hvf == 'yes' & perc_cells > 4 & mean_expr_det > 0.5]$feat_ID
-
-## run PCA on expression values (default)
-n_g <- Giotto::runPCA(gobject = n_g, feats_to_use = featgenes, scale_unit = F, center = F)
-```
-
-
-Run a UMAP based on PCA dimension reduction and view pre-clustering UMAP.
-
-```{r giotto-umap}
-n_g <- Giotto::runUMAP(n_g, dimensions_to_use = 1:15)
-graph1 <- Giotto::plotUMAP(gobject = n_g)
-```
-
-
-### 2.3.3 Clustering
-
-Cells may be clustered into distinct groups based on feature expression. To cluster, the Giotto Object must contain data that has undergone PCA dimension reduction, either tSNE or UMAP dimension reduction, and have a neighbor network.
-
-Create a shared nearest neighbor network (sNN), where k is the number of k neighbors to use:
-
-```{r giotto-nn}
-n_g <- createNearestNetwork(gobject = n_g, type = "sNN", dimensions_to_use = 1:15, k = 15)
-```
-
-Cells can be clustered in Giotto using k-means, Leiden, or Louvain clustering. These clustering algorithms return cluster information within cell_metadata, which is named accordingly by default. The name may be changed by providing the name argument, as shown in the code chunk below.
-
-```{r giotto-kmeans}
-## k-means clustering
-n_g <- doKmeans(gobject = n_g, dim_reduction_to_use = 'pca')
-
-#Plot UMAP post-clustering to visualize kmeans
-graph2 <- Giotto::plotUMAP(
- gobject = n_g,
- cell_color = 'kmeans',
- show_NN_network = T,
- point_size = 2.5
-)
-```
-
-
-### 2.3.4 Spatial co-expression
-
-Using previously created spatial network to calculate spatially variable genes using binSpect method.
-
-```{r giotto-binspect, message=FALSE}
-n_g <- Giotto::createSpatialDelaunayNetwork(gobject = n_g)
-showGiottoSpatNetworks(n_g)
-
-ranktest = binSpect(
- n_g, bin_method = 'rank',
- calc_hub = T, hub_min_int = 5,
- spatial_network_name = 'Delaunay_network'
-)
-```
-
-Here we will subset on the top 300 spatial genes identified with binSpect. We will also show how to identify the top spatially correlated genes.
-
-```{r spatial-cor-genes}
-# 3.1 cluster the top 500 spatial genes into 20 clusters
-ext_spatial_genes = ranktest[1:300,]$feats
-
-# here we use existing detectSpatialCorGenes function to calculate pairwise distances between genes (but set network_smoothing=0 to use default clustering)
-spat_cor_netw_DT = detectSpatialCorFeats(
- n_g,
- method = 'network',
- spatial_network_name = 'Delaunay_network',
- subset_feats = ext_spatial_genes
-)
-# 3.2 identify most similar spatially correlated genes for one gene
-top10_genes = showSpatialCorFeats(spat_cor_netw_DT, feats = 'Dsp', show_top_feats = 10)
-```
-
-
-Use the pheatmap to identify spatial co-expression modules and adjust the number of clusters (k) accordingly.
-
-```{r coexpression-modules}
-# 3.3 identify potenial spatial co-expression
-spat_cor_netw_DT = clusterSpatialCorFeats(spat_cor_netw_DT, name = 'spat_netw_clus', k = 7)
-
-# visualize clusters
-graph3 <- heatmSpatialCorFeats(
- n_g,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- heatmap_legend_param = list(title = NULL),
- save_param = list(base_height = 6, base_width = 8, units = 'cm')
-)
-```
-
-
-genes from each co-expression module and then aggregate genes into meta genes.
-
-```{r balanced-spat-coexpression-feats, message=FALSE}
-# 3.4 create metagenes / co-expression modules
-cluster_genes = getBalancedSpatCoexpressionFeats(spat_cor_netw_DT, maximum = 30)
-```
-
-
-```{r create-meta-feats}
-n_g = createMetafeats(n_g, feat_clusters = cluster_genes, name = 'cluster_metagene')
-
-
-graph4 <- spatCellPlot(
- n_g,
- spat_enr_names = 'cluster_metagene',
- cell_annotation_values = as.character(c(1:7)),
- point_size = 1, cow_n_col = 3
-)
-```
-
-
-## 3.0 Session Info
-
-```{r session-info}
-sessionInfo()
-```
-
-
-
-
-
-
diff --git a/vignettes/merfish_mouse_hypothalamic.Rmd b/vignettes/merfish_mouse_hypothalamic.Rmd
deleted file mode 100644
index 2bf63155d..000000000
--- a/vignettes/merfish_mouse_hypothalamic.Rmd
+++ /dev/null
@@ -1,459 +0,0 @@
----
-title: "MERFISH Mouse Hypothalamic Preoptic Region"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{MERFISH Mouse Hypothalamic Preoptic Region}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-Giotto version 2.0.0.998. Please check the version you are using to get the same results.
-
-Clustering, 3D visualization, and cell type identification of clusters using marker genes will be explored in this tutorial.
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure GiottoData, a small, helper module for tutorials, is installed.
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-library(Giotto)
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- installGiottoEnvironment()
-}
-```
-
-
-# 1. Start Giotto
-
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-# Specify path from which data may be retrieved/stored
-data_directory = paste0(getwd(),'/gobject_visual_data/')
-# alternatively, "/path/to/where/the/data/lives/"
-
-# Specify path to which results may be saved
-results_directory = paste0(getwd(),'/gobject_visual_results/')
-# alternatively, "/path/to/store/the/results/"
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-```
-
-
-# Dataset Explanation
-
-[Moffitt et al.](https://doi.org/10.1126/science.aau5324) created a 3D spatial expression dataset consisting of 155 genes from ~1 million single cells acquired from mouse hypothalamic preoptic regions. Please ensure that [wget](https://www.gnu.org/software/wget/?) is installed locally to streamline the download.
-
-# Dataset Download
-
-
-```{r, eval=FALSE}
-# In the event of authentication issues with wget,
-# add ", extra = '--no-check-certificate' " after the method argument.
-# Get the dataset:
-getSpatialDataset(dataset = 'merfish_preoptic',
- directory = data_directory,
- method = 'wget')
-```
-
-
-# 1. Create Giotto Instructions & Prepare Data
-
-
-```{r, eval=FALSE}
-# Optional, but encouraged: Set Giotto instructions
-instrs = createGiottoInstructions(save_plot = TRUE,
- show_plot = TRUE,
- save_dir = results_directory,
- python_path = my_python_path)
-
-# Create file paths to feed data into Giotto Object
-expr_path = paste0(data_directory, "merFISH_3D_data_expression.txt.gz")
-loc_path = paste0(data_directory, "merFISH_3D_data_cell_locations.txt")
-meta_path = paste0(data_directory, "merFISH_3D_metadata.txt")
-```
-
-
-# 2. Create Giotto Object & Process Data
-
-
-```{r, eval=FALSE}
-# Create Giotto object
-merFISH_gobject <- createGiottoObject(expression = expr_path,
- spatial_locs = loc_path,
- instructions = instrs)
-
-
-# Add additional metadata
-metadata = data.table::fread(meta_path)
-merFISH_gobject = addCellMetadata(merFISH_gobject,
- new_metadata = metadata$layer_ID,
- vector_name = 'layer_ID')
-merFISH_gobject = addCellMetadata(merFISH_gobject,
- new_metadata = metadata$orig_cell_types,
- vector_name = 'orig_cell_types')
-```
-
-
-First pre-test filter parameters for both features and cells.
-
-
-```{r, eval=FALSE}
-filterDistributions(merFISH_gobject, detection = 'feats')
-```
-
-
-![](images/merfish_mouse_hypothalamic/0-filterDistributions.png)
-
-
-```{r, eval=FALSE}
-filterDistributions(merFISH_gobject, detection = 'cells')
-```
-
-
-![](images/merfish_mouse_hypothalamic/1-filterDistributions.png)
-
-
-```{r, eval=FALSE}
-filterCombinations(merFISH_gobject,
- expression_thresholds = c(0,1e-6,1e-5),
- feat_det_in_min_cells = c(500, 1000, 1500),
- min_det_feats_per_cell = c(1, 5, 10))
-```
-
-
-![](images/merfish_mouse_hypothalamic/2-filterCombinations.png)
-
-Use the previously generated plots to inform filter decisions.
-
-
-```{r, eval=FALSE}
-## Data Processing
-
-# Filter data
-merFISH_gobject <- filterGiotto(gobject = merFISH_gobject,
- feat_det_in_min_cells = 0,
- min_det_feats_per_cell = 0)
-# Normalize data
-merFISH_gobject <- normalizeGiotto(gobject = merFISH_gobject,
- scalefactor = 10000,
- verbose = T)
-
-# Add statistics to Giotto Object
-merFISH_gobject <- addStatistics(gobject = merFISH_gobject,
- expression_values = 'normalized')
-
-# Adjust for covariates
-merFISH_gobject <- adjustGiottoMatrix(gobject = merFISH_gobject, expression_values = c('normalized'),
- batch_columns = NULL, covariate_columns = c('layer_ID'),
- return_gobject = TRUE,
- update_slot = c('custom'))
-```
-
-
-Now, take a glance at the data in both 2D and 3D.
-
-
-```{r, eval=FALSE}
-# 2D
-spatPlot(gobject = merFISH_gobject, point_size = 1.5)
-```
-
-
-![](images/merfish_mouse_hypothalamic/3-spatPlot2D.png)
-
-
-```{r, eval=FALSE}
-# 3D
-spatPlot3D(gobject = merFISH_gobject, point_size = 1.25, axis_scale = 'real')
-```
-
-
-![](images/merfish_mouse_hypothalamic/4-spat3D.png)
-
-# Part 3: Dimension Reduction
-
-There are only 155 genes within this dataset. Use them all (default) within the dimension reduction.
-
-
-```{r, eval=FALSE}
-merFISH_gobject <- runPCA(gobject = merFISH_gobject,
- feats_to_use = NULL,
- scale_unit = FALSE,
- center = TRUE)
-
-# View details about the principal components
-screePlot(merFISH_gobject)
-```
-
-
-![](images/merfish_mouse_hypothalamic/5-screePlot.png)
-
-After the PCA, a UMAP may be run. Run the UMAP so clusters may be visualized upon it.
-
-
-```{r, eval=FALSE}
-merFISH_gobject <- runUMAP(merFISH_gobject,
- dimensions_to_use = 1:8,
- n_components = 3,
- n_threads = 4)
-
-plotUMAP_3D(gobject = merFISH_gobject, point_size = 1.5)
-```
-
-
-![](images/merfish_mouse_hypothalamic/6-UMAP_3D.png)
-
-# Part 4: Cluster
-
-Create a nearest network, then perform Leiden clustering. The clusters may be visualized on a UMAP.
-
-
-```{r, eval=FALSE}
-# Create a sNN network (default)
-merFISH_gobject <- createNearestNetwork(gobject = merFISH_gobject,
- dimensions_to_use = 1:8,
- k = 15)
-# Leiden cluster
-merFISH_gobject <- doLeidenCluster(gobject = merFISH_gobject,
- resolution = 0.2,
- n_iterations = 200,
- name = 'leiden_0.2_200')
-# Plot the clusters upon the UMAP
-plotUMAP_3D(gobject = merFISH_gobject,
- cell_color = 'leiden_0.2_200',
- point_size = 1.5,
- show_center_label = F)
-```
-
-
-![](images/merfish_mouse_hypothalamic/7-UMAP_3D.png)
-
-# Part 5: Co-Visualize
-
-View the clusters in-tissue on each layer.
-
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = merFISH_gobject,
- point_size = 1.5,
- cell_color = 'leiden_0.2_200',
- group_by = 'layer_ID',
- cow_n_col = 2,
- group_by_subset = c(260, 160, 60, -40, -140, -240))
-```
-
-
-![](images/merfish_mouse_hypothalamic/8-spatPlot2D.png)
-
-# Part 6: Cell Type Marker Gene Detection
-
-Call **findMarkers_one_vs_all** to identify marker features. Click the function to see alternate methods, or look findGiniMarkers section for details on the gini method. Once marker features have been determined, observe the differential expression across clusters within the violin plot.
-
-
-```{r, eval=FALSE}
-markers = findMarkers_one_vs_all(gobject = merFISH_gobject,
- method = 'gini',
- expression_values = 'normalized',
- cluster_column = 'leiden_0.2_200',
- min_feats = 1, rank_score = 2)
-# Display details about the marker genes in-console
-markers[, head(.SD, 2), by = 'cluster']
-
-# violinplot
-topgini_genes = unique(markers[, head(.SD, 2), by = 'cluster']$feats)
-violinPlot(merFISH_gobject, feats = topgini_genes, cluster_column = 'leiden_0.2_200', strip_position = 'right')
-```
-
-![](images/merfish_mouse_hypothalamic/9-violinPlot.png)
-
-```{r, eval=FALSE}
-topgini_genes = unique(markers[, head(.SD, 6), by = 'cluster']$feats)
-plotMetaDataHeatmap(merFISH_gobject, expression_values = 'scaled',
- metadata_cols = c('leiden_0.2_200'),
- selected_feats = topgini_genes)
-```
-
-![](images/merfish_mouse_hypothalamic/10-plotMetaDataHeatmap.png)
-
-# Part 7: Cell-Type Annotation
-
-Use known marker and differentially expressed genes (DEGs) to identify cell type for each cluster.
-
-
-```{r, eval=FALSE}
-# Known markers and DEGs
-selected_genes = c('Myh11', 'Klf4', 'Fn1', 'Cd24a', 'Cyr61', 'Nnat', 'Trh',
- 'Selplg', 'Pou3f2', 'Aqp4', 'Traf4', 'Pdgfra', 'Opalin',
- 'Mbp', 'Ttyh2', 'Fezf1', 'Cbln1', 'Slc17a6', 'Scg2', 'Isl1', 'Gad1')
-
-gobject_cell_metadata = pDataDT(merFISH_gobject)
-cluster_order = unique(gobject_cell_metadata$leiden_0.2_200)
-
-plotMetaDataHeatmap(merFISH_gobject, expression_values = 'scaled',
- metadata_cols = c('leiden_0.2_200'),
- selected_feats = selected_genes,
- custom_feat_order = rev(selected_genes),
- custom_cluster_order = cluster_order)
-```
-
-
-![](images/merfish_mouse_hypothalamic/11-plotMetaDataHeatmap.png)
-
-Since there are more Leiden clusters than there are types of cells in this dataset, the same cell type may be assigned to different cluster numbers. This may be done only after verifying that particular clusters highly express marker genes corresponding to the same cell type. The above heatmap is used to streamline this process. Call **annotateGiotto** to map cell types to Leiden clusters; these will appear in *cell_metadata* within the **giottoObject**.
-
-
-```{r, eval=FALSE}
-# Name clusters
-clusters_cell_types_hypo = c('Inhibitory', 'Inhibitory', 'Excitatory', 'Astrocyte','OD Mature', 'Endothelial',
- 'OD Mature', 'OD Immature', 'Ambiguous','Ependymal', 'Endothelial', 'Microglia', 'OD Mature')
-names(clusters_cell_types_hypo) = as.character(sort(cluster_order))
-
-merFISH_gobject = annotateGiotto(gobject = merFISH_gobject,
- annotation_vector = clusters_cell_types_hypo,
- cluster_column = 'leiden_0.2_200',
- name = 'cell_types')
-
-## show heatmap
-plotMetaDataHeatmap(merFISH_gobject,
- expression_values = 'scaled',
- metadata_cols = c('cell_types'),
- selected_feats = selected_genes,
- custom_feat_order = rev(selected_genes),
- custom_cluster_order = clusters_cell_types_hypo)
-```
-
-![](images/merfish_mouse_hypothalamic/12-plotMetaDataHeatmap.png)
-
-# Part 8: Visualize
-
-
-```{r, eval=FALSE}
-# Assign colors to each cell type
-mycolorcode = c('red', 'lightblue', 'yellowgreen','purple', 'darkred',
- 'magenta', 'mediumblue', 'yellow', 'gray')
-names(mycolorcode) = c('Inhibitory', 'Excitatory','OD Mature', 'OD Immature',
- 'Astrocyte', 'Microglia', 'Ependymal','Endothelial', 'Ambiguous')
-
-plotUMAP_3D(merFISH_gobject,
- cell_color = 'cell_types',
- point_size = 1.5,
- cell_color_code = mycolorcode)
-```
-
-![](images/merfish_mouse_hypothalamic/13-UMAP_3D.png)
-
-```{r, eval=FALSE}
-spatPlot3D(merFISH_gobject,
- cell_color = 'cell_types', axis_scale = 'real',
- sdimx = 'sdimx', sdimy = 'sdimy', sdimz = 'sdimz',
- show_grid = F, cell_color_code = mycolorcode)
-```
-
-![](images/merfish_mouse_hypothalamic/14-spat3D.png)
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = merFISH_gobject, point_size = 1.0,
- cell_color = 'cell_types', cell_color_code = mycolorcode,
- group_by = 'layer_ID', cow_n_col = 2, group_by_subset = c(seq(260, -290, -100)))
-```
-
-![](images/merfish_mouse_hypothalamic/15-spatPlot2D.png)
-
-## Excitatory Cells Only
-
-```{r, eval=FALSE}
-spatPlot3D(merFISH_gobject,
- cell_color = 'cell_types', axis_scale = 'real',
- sdimx = 'sdimx', sdimy = 'sdimy', sdimz = 'sdimz',
- show_grid = F, cell_color_code = mycolorcode,
- select_cell_groups = 'Excitatory', show_other_cells = F)
-```
-
-![](images/merfish_mouse_hypothalamic/16-spat3D.png)
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = merFISH_gobject, point_size = 1.0,
- cell_color = 'cell_types', cell_color_code = mycolorcode,
- select_cell_groups = 'Excitatory', show_other_cells = F,
- group_by = 'layer_ID', cow_n_col = 2, group_by_subset = c(seq(260, -290, -100)))
-```
-
-![](images/merfish_mouse_hypothalamic/17-spatPlot2D.png)
-
-## Inhibitory Cells Only
-
-```{r, eval=FALSE}
-spatPlot3D(merFISH_gobject,
- cell_color = 'cell_types', axis_scale = 'real',
- sdimx = 'sdimx', sdimy = 'sdimy', sdimz = 'sdimz',
- show_grid = F, cell_color_code = mycolorcode,
- select_cell_groups = 'Inhibitory', show_other_cells = F)
-```
-
-![](images/merfish_mouse_hypothalamic/18-spat3D.png)
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = merFISH_gobject, point_size = 1.0,
- cell_color = 'cell_types', cell_color_code = mycolorcode,
- select_cell_groups = 'Inhibitory', show_other_cells = F,
- group_by = 'layer_ID', cow_n_col = 2, group_by_subset = c(seq(260, -290, -100)))
-```
-
-![](images/merfish_mouse_hypothalamic/19-spatPlot2D.png)
-
-## OD and Astrocytes Only
-
-```{r, eval=FALSE}
-spatPlot3D(merFISH_gobject,
- cell_color = 'cell_types', axis_scale = 'real',
- sdimx = 'sdimx', sdimy = 'sdimy', sdimz = 'sdimz',
- show_grid = F, cell_color_code = mycolorcode,
- select_cell_groups = c('Astrocyte', 'OD Mature', 'OD Immature'), show_other_cells = F)
-```
-
-![](images/merfish_mouse_hypothalamic/20-spat3D.png)
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = merFISH_gobject, point_size = 1.0,
- cell_color = 'cell_types', cell_color_code = mycolorcode,
- select_cell_groups = c('Astrocyte', 'OD Mature', 'OD Immature'), show_other_cells = F,
- group_by = 'layer_ID', cow_n_col = 2, group_by_subset = c(seq(260, -290, -100)))
-```
-
-![](images/merfish_mouse_hypothalamic/21-spatPlot2D.png)
-
-## Other Cells Only
-
-```{r, eval=FALSE}
-spatPlot3D(merFISH_gobject,
- cell_color = 'cell_types', axis_scale = 'real',
- sdimx = 'sdimx', sdimy = 'sdimy', sdimz = 'sdimz',
- show_grid = F, cell_color_code = mycolorcode,
- select_cell_groups = c('Microglia', 'Ependymal', 'Endothelial'), show_other_cells = F)
-```
-
-![](images/merfish_mouse_hypothalamic/22-spat3D.png)
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = merFISH_gobject, point_size = 1.0,
- cell_color = 'cell_types', cell_color_code = mycolorcode,
- select_cell_groups = c('Microglia', 'Ependymal', 'Endothelial'), show_other_cells = F,
- group_by = 'layer_ID', cow_n_col = 2, group_by_subset = c(seq(260, -290, -100)))
-```
-
-![](images/merfish_mouse_hypothalamic/23-spatPlot2D.png)
diff --git a/vignettes/mini_seqfish.Rmd b/vignettes/mini_seqfish.Rmd
deleted file mode 100644
index a1f95b691..000000000
--- a/vignettes/mini_seqfish.Rmd
+++ /dev/null
@@ -1,818 +0,0 @@
----
-title: "mini seqFISH"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{mini seqFISH}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Start Giotto
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure GiottoData, a small, helper module for tutorials, is installed.
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-# 1. Load the Giotto object
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-```
-
-A small seqFISH data is available through the giottoData package.
-
-```{r, eval=FALSE}
-# download data
-seqfish_mini = loadGiottoMini("seqfish",
- python_path = NULL)
-```
-
-## Set Giotto instructions (optional)
-
-How to work with Giotto instructions that are part of your Giotto
-object:
-
-- Show the instructions associated with your Giotto object with **showGiottoInstructions()**
-- Change one or more instructions with **changeGiottoInstructions()**
-- Replace all instructions at once with **replaceGiottoInstructions()**
-- Read or get a specific Giotto instruction with **readGiottoInstructions()**
-
-
-```{r, eval=FALSE}
-# show instructions associated with giotto object (seqfish_mini)
-showGiottoInstructions(seqfish_mini)
-
-# Change one or more instructions
-# to automatically save figures in save_dir, set save_plot to TRUE
-temp_dir = getwd()
-seqfish_mini = changeGiottoInstructions(seqfish_mini,
- params = c("save_dir", "save_plot", "show_plot"),
- new_values = c(temp_dir,TRUE, TRUE))
-```
-
-# 2. Processing steps
-
-- Filter genes and cells based on detection frequencies.
-- Normalize expression matrix (log transformation, scaling factor and/or z-scores)
-- Add cell and gene statistics (optional)
-- Adjust expression matrix for technical covariates or batches (optional). These results will be stored in the *custom* slot.
-
-
-```{r, eval=FALSE}
-seqfish_mini = filterGiotto(gobject = seqfish_mini,
- expression_threshold = 0.5,
- feat_det_in_min_cells = 20,
- min_det_feats_per_cell = 0)
-
-seqfish_mini = normalizeGiotto(gobject = seqfish_mini,
- scalefactor = 6000,
- verbose = T)
-
-seqfish_mini = addStatistics(gobject = seqfish_mini)
-
-seqfish_mini = adjustGiottoMatrix(gobject = seqfish_mini,
- expression_values = c('normalized'),
- covariate_columns = c('nr_feats',
- 'total_expr'))
-```
-
-# 3. Dimension reduction
-
-- Identify highly variable features (HVF)
-
-```{r, eval=FALSE}
-seqfish_mini = calculateHVF(gobject = seqfish_mini)
-```
-
-![](images/mini_seqfish/0-HVFplot.png)
-
-- Perform PCA
-- Identify number of significant principal components (PCs)
-
-
-```{r, eval=FALSE}
-seqfish_mini = runPCA(gobject = seqfish_mini)
-
-screePlot(seqfish_mini, ncp = 20)
-```
-
-![](images/mini_seqfish/1-screePlot.png)
-
-```{r, eval=FALSE}
-plotPCA(seqfish_mini)
-```
-
-![](images/mini_seqfish/2-PCA.png)
-
-- Run UMAP and/or t-SNE on PCs (or directly on matrix)
-
-```{r, eval=FALSE}
-seqfish_mini = runUMAP(seqfish_mini,
- dimensions_to_use = 1:5,
- n_threads = 2)
-
-plotUMAP(gobject = seqfish_mini)
-```
-
-![](images/mini_seqfish/3-UMAP.png)
-
-```{r, eval=FALSE}
-seqfish_mini = runtSNE(seqfish_mini,
- dimensions_to_use = 1:5)
-
-plotTSNE(gobject = seqfish_mini)
-```
-
-![](images/mini_seqfish/4-tSNE.png)
-
-# 4. Clustering
-
-- Create a shared (default) nearest network in PCA space (or directly on matrix)
-- Cluster on nearest network with Leiden or Louvain (k-means and hclust are alternatives)
-
-```{r, eval=FALSE}
-seqfish_mini = createNearestNetwork(gobject = seqfish_mini,
- dimensions_to_use = 1:5,
- k = 5)
-
-seqfish_mini = doLeidenCluster(gobject = seqfish_mini,
- resolution = 0.4,
- n_iterations = 1000)
-
-# visualize UMAP cluster results
-plotUMAP(gobject = seqfish_mini,
- cell_color = 'leiden_clus',
- show_NN_network = T,
- point_size = 2.5)
-```
-
-![](images/mini_seqfish/5-UMAP.png)
-
-```{r, eval=FALSE}
-# visualize UMAP and spatial results
-spatDimPlot(gobject = seqfish_mini,
- cell_color = 'leiden_clus',
- spat_point_shape = 'voronoi')
-```
-
-![](images/mini_seqfish/6-spatDimPlot2D.png)
-
-```{r, eval=FALSE}
-# heatmap and dendrogram
-showClusterHeatmap(gobject = seqfish_mini,
- cluster_column = 'leiden_clus')
-```
-
-![](images/mini_seqfish/7-showClusterHeatmap.png)
-
-The following step requires the installation of {ggdendro}.
-
-```{r, eval=FALSE}
-# install.packages('ggdendro')
-library(ggdendro)
-
-showClusterDendrogram(seqfish_mini,
- h = 0.5,
- rotate = T,
- cluster_column = 'leiden_clus')
-```
-
-![](images/mini_seqfish/8-showClusterDendrogram.png)
-
-# 5. Differential expression
-
-```{r, eval=FALSE}
-gini_markers = findMarkers_one_vs_all(gobject = seqfish_mini,
- method = 'gini',
- expression_values = 'normalized',
- cluster_column = 'leiden_clus',
- min_feats = 20,
- min_expr_gini_score = 0.5,
- min_det_gini_score = 0.5)
-
-# get top 2 genes per cluster and visualize with violin plot
-topgenes_gini = gini_markers[, head(.SD, 2), by = 'cluster']
-
-violinPlot(seqfish_mini,
- feats = topgenes_gini$feats[1:4],
- cluster_column = 'leiden_clus')
-```
-
-![](images/mini_seqfish/9-violinPlot.png)
-
-```{r, eval=FALSE}
-# get top 6 genes per cluster and visualize with heatmap
-topgenes_gini2 = gini_markers[, head(.SD, 6), by = 'cluster']
-
-plotMetaDataHeatmap(seqfish_mini,
- selected_feats = topgenes_gini2$feats,
- metadata_cols = c('leiden_clus'))
-```
-
-![](images/mini_seqfish/10-plotMetaDataHeatmap.png)
-
-# 6. Cell type annotation
-
-```{r, eval=FALSE}
-clusters_cell_types = c('cell A', 'cell B', 'cell C', 'cell D',
- 'cell E', 'cell F', 'cell G', 'cell H')
-
-names(clusters_cell_types) = 1:8
-
-seqfish_mini = annotateGiotto(gobject = seqfish_mini,
- annotation_vector = clusters_cell_types,
- cluster_column = 'leiden_clus',
- name = 'cell_types')
-
-# check new cell metadata
-pDataDT(seqfish_mini)
-
-# visualize annotations
-spatDimPlot(gobject = seqfish_mini,
- cell_color = 'cell_types',
- spat_point_size = 3,
- dim_point_size = 3)
-```
-
-![](images/mini_seqfish/11-spatDimPlot2D.png)
-
-```{r, eval=FALSE}
-# heatmap
-topgenes_heatmap = gini_markers[, head(.SD, 4), by = 'cluster']
-
-plotHeatmap(gobject = seqfish_mini,
- feats = topgenes_heatmap$feats,
- feat_order = 'custom',
- feat_custom_order = unique(topgenes_heatmap$feats),
- cluster_column = 'cell_types',
- legend_nrows = 1)
-```
-
-![](images/mini_seqfish/12-plotHeatmap.png)
-
-# 7. Spatial grid
-
-- Create a grid based on defined step sizes in the x,y(,z) axes.
-
-```{r, eval=FALSE}
-seqfish_mini = createSpatialGrid(gobject = seqfish_mini,
- sdimx_stepsize = 300,
- sdimy_stepsize = 300,
- minimum_padding = 50)
-
-showGiottoSpatGrids(seqfish_mini)
-
-# visualize grid
-spatPlot(gobject = seqfish_mini,
- show_grid = T,
- point_size = 1.5)
-```
-
-![](images/mini_seqfish/13-spatPlot2D.png)
-
-# 8. Spatial network
-
-- Visualize information about the default Delaunay network
-- Create a spatial Delaunay network (default)
-- Create a spatial kNN network
-
-```{r, eval=FALSE}
-plotStatDelaunayNetwork(gobject = seqfish_mini,
- maximum_distance = 400)
-```
-
-![](images/mini_seqfish/14-plotStatDelaunayNetwork.png)
-
-```{r, eval=FALSE}
-seqfish_mini = createSpatialNetwork(gobject = seqfish_mini,
- minimum_k = 2,
- maximum_distance_delaunay = 400)
-
-seqfish_mini = createSpatialNetwork(gobject = seqfish_mini,
- minimum_k = 2,
- method = 'kNN', k = 10)
-
-showGiottoSpatNetworks(seqfish_mini)
-
-# visualize the two different spatial networks
-spatPlot(gobject = seqfish_mini,
- show_network = T,
- network_color = 'blue',
- spatial_network_name = 'Delaunay_network',
- point_size = 2.5,
- cell_color = 'leiden_clus')
-```
-
-![](images/mini_seqfish/15-spatPlot2D.png)
-
-```{r, eval=FALSE}
-spatPlot(gobject = seqfish_mini,
- show_network = T,
- network_color = 'blue',
- spatial_network_name = 'kNN_network',
- point_size = 2.5,
- cell_color = 'leiden_clus')
-```
-
-![](images/mini_seqfish/16-spatPlot2D.png)
-
-# 9. Spatial genes
-
-Identify spatial genes with 3 different methods:
-
-- binSpect with k-means binarization (default)
-- binSpect with rank binarization
-- silhouetteRank
-
-Visualize top 4 genes per method.
-
-```{r, eval=FALSE}
-km_spatialgenes = binSpect(seqfish_mini)
-
-spatFeatPlot2D(seqfish_mini,
- expression_values = 'scaled',
- feats = km_spatialgenes[1:4]$feats,
- point_shape = 'border',
- point_border_stroke = 0.1,
- show_network = F,
- network_color = 'lightgrey',
- point_size = 2.5,
- cow_n_col = 2)
-```
-
-![](images/mini_seqfish/17-spatFeatPlot2D.png)
-
-```{r, eval=FALSE}
-rank_spatialgenes = binSpect(seqfish_mini,
- bin_method = 'rank')
-
-spatFeatPlot2D(seqfish_mini,
- expression_values = 'scaled',
- feats = rank_spatialgenes[1:4]$feats,
- point_shape = 'border',
- point_border_stroke = 0.1,
- show_network = F,
- network_color = 'lightgrey',
- point_size = 2.5,
- cow_n_col = 2)
-```
-
-![](images/mini_seqfish/18-spatFeatPlot2D.png)
-
-```{r, eval=FALSE}
-silh_spatialgenes = silhouetteRank(gobject = seqfish_mini) # TODO: suppress print output
-
-spatFeatPlot2D(seqfish_mini,
- expression_values = 'scaled',
- feats = silh_spatialgenes[1:4]$genes,
- point_shape = 'border',
- point_border_stroke = 0.1,
- show_network = F,
- network_color = 'lightgrey',
- point_size = 2.5,
- cow_n_col = 2)
-```
-
-![](images/mini_seqfish/19-spatFeatPlot2D.png)
-
-# 10. Spatial co-expression patterns
-
-Identify robust spatial co-expression patterns using the spatial network or grid and a subset of individual spatial genes.
-
-1. Calculate spatial correlation scores
-2. Cluster correlation scores
-
-```{r, eval=FALSE}
-# 1. calculate spatial correlation scores
-ext_spatial_genes = km_spatialgenes[1:500]$feats
-
-spat_cor_netw_DT = detectSpatialCorFeats(seqfish_mini,
- method = 'network',
- spatial_network_name = 'Delaunay_network',
- subset_feats = ext_spatial_genes)
-# 2. cluster correlation scores
-spat_cor_netw_DT = clusterSpatialCorFeats(spat_cor_netw_DT,
- name = 'spat_netw_clus',
- k = 8)
-
-heatmSpatialCorFeats(seqfish_mini,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus')
-```
-
-![](images/mini_seqfish/20-heatmSpatialCorFeats.png)
-
-```{r, eval=FALSE}
-netw_ranks = rankSpatialCorGroups(seqfish_mini,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus')
-```
-
-![](images/mini_seqfish/21-rankSpatialCorGroups.png)
-
-```{r, eval=FALSE}
-top_netw_spat_cluster = showSpatialCorFeats(spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- selected_clusters = 6,
- show_top_feats = 1)
-
-cluster_genes_DT = showSpatialCorFeats(spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- show_top_feats = 1)
-
-cluster_genes = cluster_genes_DT$clus; names(cluster_genes) = cluster_genes_DT$feat_ID
-
-seqfish_mini = createMetafeats(seqfish_mini,
- feat_clusters = cluster_genes,
- name = 'cluster_metagene')
-
-spatCellPlot(seqfish_mini,
- spat_enr_names = 'cluster_metagene',
- cell_annotation_values = netw_ranks$clusters,
- point_size = 1.5, cow_n_col = 3)
-```
-
-![](images/mini_seqfish/22-spatCellPlot2D.png)
-
-# 11. Spatial HMRF domains
-
-The following HMRF function requires {smfishHmrf} .
-
-```{r, eval=FALSE}
-# remotes::install_bitbucket(repo = 'qzhudfci/smfishhmrf-r', ref='master')
-library(smfishHmrf)
-
-hmrf_folder = paste0(temp_dir,'/','11_HMRF/')
-
-if(!file.exists(hmrf_folder)) dir.create(hmrf_folder, recursive = T)
-
-# perform hmrf
-my_spatial_genes = km_spatialgenes[1:100]$feats
-
-HMRF_spatial_genes = doHMRF(gobject = seqfish_mini,
- expression_values = 'scaled',
- spatial_genes = my_spatial_genes,
- spatial_network_name = 'Delaunay_network',
- k = 9,
- betas = c(28,2,2),
- output_folder = paste0(hmrf_folder, '/', 'Spatial_genes/SG_top100_k9_scaled'))
-
-# check and select hmrf
-for(i in seq(28, 30, by = 2)) {
- viewHMRFresults2D(gobject = seqfish_mini,
- HMRFoutput = HMRF_spatial_genes,
- k = 9, betas_to_view = i,
- point_size = 2)
-}
-
-seqfish_mini = addHMRF(gobject = seqfish_mini,
- HMRFoutput = HMRF_spatial_genes,
- k = 9, betas_to_add = c(28),
- hmrf_name = 'HMRF')
-
-# visualize selected hmrf result
-giotto_colors = Giotto::getDistinctColors(9)
-names(giotto_colors) = 1:9
-
-spatPlot(gobject = seqfish_mini,
- cell_color = 'HMRF_k9_b.28',
- point_size = 3,
- coord_fix_ratio = 1,
- cell_color_code = giotto_colors)
-```
-
-![](images/mini_seqfish/23-spatPlot2D.png)
-
-# 12. Cell neighborhood: cell-type/cell-type interactions
-
-```{r, eval=FALSE}
-set.seed(seed = 2841)
-
-cell_proximities = cellProximityEnrichment(gobject = seqfish_mini,
- cluster_column = 'cell_types',
- spatial_network_name = 'Delaunay_network',
- adjust_method = 'fdr',
- number_of_simulations = 1000)
-
-# barplot
-cellProximityBarplot(gobject = seqfish_mini,
- CPscore = cell_proximities,
- min_orig_ints = 5,
- min_sim_ints = 5,
- p_val = 0.5)
-```
-
-![](images/mini_seqfish/24-cellProximityBarplot.png)
-
-```{r, eval=FALSE}
-## heatmap
-cellProximityHeatmap(gobject = seqfish_mini,
- CPscore = cell_proximities,
- order_cell_types = T,
- scale = T,
- color_breaks = c(-1.5, 0, 1.5),
- color_names = c('blue', 'white', 'red'))
-```
-
-![](images/mini_seqfish/25-cellProximityHeatmap.png)
-
-```{r, eval=FALSE}
-# network
-cellProximityNetwork(gobject = seqfish_mini,
- CPscore = cell_proximities,
- remove_self_edges = T,
- only_show_enrichment_edges = T)
-```
-
-![](images/mini_seqfish/26-cellProximityNetwork.png)
-
-```{r, eval=FALSE}
-# network with self-edges
-cellProximityNetwork(gobject = seqfish_mini,
- CPscore = cell_proximities,
- remove_self_edges = F,
- self_loop_strength = 0.3,
- only_show_enrichment_edges = F,
- rescale_edge_weights = T,
- node_size = 8,
- edge_weight_range_depletion = c(1, 2),
- edge_weight_range_enrichment = c(2,5))
-```
-
-![](images/mini_seqfish/27-cellProximityNetwork.png)
-
-## Visualization of specific cell types
-
-```{r, eval=FALSE}
-# Option 1
-spec_interaction = "cell D--cell F"
-
-cellProximitySpatPlot2D(gobject = seqfish_mini,
- interaction_name = spec_interaction,
- show_network = T,
- cluster_column = 'cell_types',
- cell_color = 'cell_types',
- cell_color_code = c('cell D' = 'lightblue', 'cell F' = 'red'),
- point_size_select = 4,
- point_size_other = 2)
-```
-
-![](images/mini_seqfish/28-cellProximitySpatPlot2D.png)
-
-```{r, eval=FALSE}
-# Option 2: create additional metadata
-seqfish_mini = addCellIntMetadata(seqfish_mini,
- spat_unit = "cell",
- spatial_network = 'Delaunay_network',
- cluster_column = 'cell_types',
- cell_interaction = spec_interaction,
- name = 'D_F_interactions')
-
-spatPlot(seqfish_mini,
- cell_color = 'D_F_interactions',
- legend_symbol_size = 3,
- select_cell_groups = c('other_cell D', 'other_cell F', 'select_cell D', 'select_cell F'))
-```
-
-![](images/mini_seqfish/29-spatPlot2D.png)
-
-# 13. Cell neighborhood: interaction changed features
-
-
-```{r, eval=FALSE}
-## select top 25 highest expressing genes
-gene_metadata = fDataDT(seqfish_mini)
-
-plot(gene_metadata$nr_cells, gene_metadata$mean_expr)
-
-plot(gene_metadata$nr_cells, gene_metadata$mean_expr_det)
-
-quantile(gene_metadata$mean_expr_det)
-
-high_expressed_genes = gene_metadata[mean_expr_det > 4]$feat_ID
-
-## identify features (genes) that are associated with proximity to other cell types
-ICFscoresHighGenes = findICF(gobject = seqfish_mini,
- selected_feats = high_expressed_genes,
- spatial_network_name = 'Delaunay_network',
- cluster_column = 'cell_types',
- diff_test = 'permutation',
- adjust_method = 'fdr',
- nr_permutations = 500,
- do_parallel = T)
-
-## visualize all genes
-plotCellProximityFeats(seqfish_mini,
- icfObject = ICFscoresHighGenes,
- method = 'dotplot')
-```
-
-![](images/mini_seqfish/30-plotCellProximityGenes.png)
-
-```{r, eval=FALSE}
-## filter genes
-ICFscoresFilt = filterICF(ICFscoresHighGenes,
- min_cells = 2,
- min_int_cells = 2,
- min_fdr = 0.1,
- min_spat_diff = 0.1,
- min_log2_fc = 0.1,
- min_zscore = 1)
-
-## visualize subset of interaction changed genes (ICGs)
-ICF_genes = c('Cpne2', 'Scg3', 'Cmtm3', 'Cplx1', 'Lingo1')
-ICF_genes_types = c('cell E', 'cell D', 'cell D', 'cell G', 'cell E')
-names(ICF_genes) = ICF_genes_types
-
-plotICF(gobject = seqfish_mini,
- icfObject = ICFscoresHighGenes,
- source_type = 'cell A',
- source_markers = c('Csf1r', 'Laptm5'),
- ICF_feats = ICF_genes)
-```
-
-![](images/mini_seqfish/31-plotICF.png)
-
-# 14. Cell neighborhood: ligand-receptor cell-cell communication
-
-```{r, eval=FALSE}
-LR_data = data.table::fread(system.file("Mini_datasets/seqfish/Raw/mouse_ligand_receptors.txt",
- package = "GiottoData"))
-
-LR_data[, ligand_det := ifelse(mouseLigand %in% seqfish_mini@feat_ID[['rna']], T, F)]
-
-LR_data[, receptor_det := ifelse(mouseReceptor %in% seqfish_mini@feat_ID[['rna']], T, F)]
-
-LR_data_det = LR_data[ligand_det == T & receptor_det == T]
-
-select_ligands = LR_data_det$mouseLigand
-
-select_receptors = LR_data_det$mouseReceptor
-
-## get statistical significance of gene pair expression changes based on expression ##
-expr_only_scores = exprCellCellcom(gobject = seqfish_mini,
- cluster_column = 'cell_types',
- random_iter = 50,
- feat_set_1 = select_ligands,
- feat_set_2 = select_receptors)
-
-## get statistical significance of gene pair expression changes upon cell-cell interaction
-spatial_all_scores = spatCellCellcom(seqfish_mini,
- spat_unit = 'cell',
- feat_type = 'rna',
- spatial_network_name = 'Delaunay_network',
- cluster_column = 'cell_types',
- random_iter = 50,
- feat_set_1 = select_ligands,
- feat_set_2 = select_receptors,
- adjust_method = 'fdr',
- do_parallel = T,
- cores = 4,
- verbose = 'none')
-
-## * plot communication scores ####
-## select top LR ##
-selected_spat = spatial_all_scores[p.adj <= 0.5 & abs(log2fc) > 0.1 & lig_nr >= 2 & rec_nr >= 2]
-
-data.table::setorder(selected_spat, -PI)
-
-top_LR_ints = unique(selected_spat[order(-abs(PI))]$LR_comb)[1:33]
-
-top_LR_cell_ints = unique(selected_spat[order(-abs(PI))]$LR_cell_comb)[1:33]
-
-plotCCcomHeatmap(gobject = seqfish_mini,
- comScores = spatial_all_scores,
- selected_LR = top_LR_ints,
- selected_cell_LR = top_LR_cell_ints,
- show = 'LR_expr')
-```
-
-![](images/mini_seqfish/32-plotCCcomHeatmap.png)
-
-```{r, eval=FALSE}
-plotCCcomDotplot(gobject = seqfish_mini,
- comScores = spatial_all_scores,
- selected_LR = top_LR_ints,
- selected_cell_LR = top_LR_cell_ints,
- cluster_on = 'PI')
-```
-
-![](images/mini_seqfish/33-plotCCcomDotplot.png)
-
-```{r, eval=FALSE}
-## * spatial vs rank ####
-comb_comm = combCCcom(spatialCC = spatial_all_scores,
- exprCC = expr_only_scores)
-
-# top differential activity levels for ligand receptor pairs
-plotRankSpatvsExpr(gobject = seqfish_mini,
- comb_comm,
- expr_rnk_column = 'exprPI_rnk',
- spat_rnk_column = 'spatPI_rnk',
- gradient_midpoint = 10)
-```
-
-![](images/mini_seqfish/34-plotRankSpatvsExpr.png)
-
-```{r, eval=FALSE}
-## * recovery ####
-## predict maximum differential activity
-plotRecovery(gobject = seqfish_mini,
- comb_comm,
- expr_rnk_column = 'exprPI_rnk',
- spat_rnk_column = 'spatPI_rnk',
- ground_truth = 'spatial')
-```
-
-![](images/mini_seqfish/35-plotRecovery.png)
-
-# 15. Session info
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.3
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] smfishHmrf_0.1 fs_1.6.3 pracma_2.4.4 ggdendro_0.1.23
-[5] GiottoData_0.2.6.2 GiottoUtils_0.1.3 Giotto_4.0.2 GiottoClass_0.1.3
-
-loaded via a namespace (and not attached):
- [1] RColorBrewer_1.1-3 rstudioapi_0.15.0 jsonlite_1.8.8
- [4] shape_1.4.6 magrittr_2.0.3 magick_2.8.2
- [7] farver_2.1.1 GlobalOptions_0.1.2 zlibbioc_1.48.0
- [10] ragg_1.2.7 vctrs_0.6.5 Cairo_1.6-2
- [13] RCurl_1.98-1.14 terra_1.7-71 S4Arrays_1.2.0
- [16] SparseArray_1.2.3 parallelly_1.36.0 plyr_1.8.9
- [19] igraph_2.0.1.1 lifecycle_1.0.4 iterators_1.0.14
- [22] pkgconfig_2.0.3 rsvd_1.0.5 Matrix_1.6-5
- [25] R6_2.5.1 GenomeInfoDbData_1.2.11 rbibutils_2.2.16
- [28] MatrixGenerics_1.14.0 future_1.33.1 clue_0.3-65
- [31] digest_0.6.34 colorspace_2.1-0 S4Vectors_0.40.2
- [34] irlba_2.3.5.1 textshaping_0.3.7 GenomicRanges_1.54.1
- [37] beachmat_2.18.0 labeling_0.4.3 progressr_0.14.0
- [40] fansi_1.0.6 polyclip_1.10-6 abind_1.4-5
- [43] compiler_4.3.2 withr_3.0.0 doParallel_1.0.17
- [46] backports_1.4.1 BiocParallel_1.36.0 viridis_0.6.5
- [49] ggforce_0.4.1 MASS_7.3-60.0.1 DelayedArray_0.28.0
- [52] rjson_0.2.21 gtools_3.9.5 GiottoVisuals_0.1.4
- [55] tools_4.3.2 future.apply_1.11.1 glue_1.7.0
- [58] dbscan_1.1-12 grid_4.3.2 checkmate_2.3.1
- [61] Rtsne_0.17 cluster_2.1.6 reshape2_1.4.4
- [64] generics_0.1.3 gtable_0.3.4 tidyr_1.3.1
- [67] data.table_1.15.0 BiocSingular_1.18.0 tidygraph_1.3.1
- [70] ScaledMatrix_1.10.0 utf8_1.2.4 XVector_0.42.0
- [73] BiocGenerics_0.48.1 ggrepel_0.9.5 foreach_1.5.2
- [76] pillar_1.9.0 stringr_1.5.1 limma_3.58.1
- [79] circlize_0.4.15 dplyr_1.1.4 tweenr_2.0.2
- [82] lattice_0.22-5 FNN_1.1.4 deldir_2.0-2
- [85] tidyselect_1.2.0 ComplexHeatmap_2.18.0 SingleCellExperiment_1.24.0
- [88] knitr_1.45 gridExtra_2.3 IRanges_2.36.0
- [91] SummarizedExperiment_1.32.0 stats4_4.3.2 xfun_0.41
- [94] graphlayouts_1.1.0 Biobase_2.62.0 statmod_1.5.0
- [97] matrixStats_1.2.0 stringi_1.8.3 codetools_0.2-19
-[100] ggraph_2.1.0 tibble_3.2.1 colorRamp2_0.1.0
-[103] cli_3.6.2 uwot_0.1.16 reticulate_1.35.0
-[106] systemfonts_1.0.5 Rdpack_2.6 munsell_0.5.0
-[109] Rcpp_1.0.12 GenomeInfoDb_1.38.5 globals_0.16.2
-[112] png_0.1-8 parallel_4.3.2 ggplot2_3.4.4
-[115] bitops_1.0-7 listenv_0.9.1 SpatialExperiment_1.12.0
-[118] viridisLite_0.4.2 scales_1.3.0 purrr_1.0.2
-[121] crayon_1.5.2 GetoptLong_1.0.5 rlang_1.1.3
-[124] cowplot_1.1.3
-
-```
-
diff --git a/vignettes/mouse_embryo_dbitseq.Rmd b/vignettes/mouse_embryo_dbitseq.Rmd
deleted file mode 100644
index 2013a553c..000000000
--- a/vignettes/mouse_embryo_dbitseq.Rmd
+++ /dev/null
@@ -1,582 +0,0 @@
----
-title: "Multi-omics Mouse Embryo DBiT-Seq"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Multi-omics Mouse Embryo DBiT-Seq}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# 1 Dataset explanation
-
-The dataset was created by [Liu, et al 2020](https://www.sciencedirect.com/science/article/pii/S0092867420313908?via%3Dihub) and downloaded from https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE137986. For running this tutorial, we will use the dataset E10 Whole (50 μm) 2.
-
-
-# 2 Start Giotto
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-library(Giotto)
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- installGiottoEnvironment()
-}
-```
-
-# 3 Create Giotto object
-
-Read expression matrix 22846 genes, 22 proteins, 901 cells
-
-```{r, eval = FALSE}
-## RNA
-rna_expression = read.table("data/GSE137986_RAW/GSM4189613_0702cL.tsv.gz",
- sep = "\t",
- header = TRUE)
-rownames(rna_expression) = rna_expression$X
-```
-
-```{r, eval = FALSE}
-## Protein
-protein_expression = read.table("data/GSE137986_RAW/GSM4202307_0702aL.tsv.gz",
- sep = "\t",
- header = TRUE)
-rownames(protein_expression) = protein_expression$X
-```
-
-Transpose matrix
-
-```{r, eval = FALSE}
-rna_expression = t(rna_expression[-1])
-protein_expression = t(protein_expression[-1])
-```
-
-Get the spatial coordinates
-
-```{r, eval = FALSE}
-spatial_coords = data.frame(cell_ID = colnames(rna_expression))
-spatial_coords = cbind(spatial_coords,
- tidyr::separate(spatial_coords, cell_ID, c("x","y"), sep = "x"))
-
-spatial_coords$x = as.numeric(spatial_coords$x)
-spatial_coords$y = as.numeric(spatial_coords$y)*-1
-```
-
-Create the Giotto object
-
-```{r, eval = FALSE}
-save_dir = 'results'
-instrs = createGiottoInstructions(save_dir = save_dir,
- save_plot = TRUE,
- show_plot = TRUE)
-
-giottoObject = createGiottoObject(expression = list(raw = rna_expression,
- raw = protein_expression),
- expression_feat = c('rna', 'protein'),
- spatial_locs = spatial_coords,
- instructions = instrs)
-```
-
-# 4 Processing
-
-## Filtering
-
-```{r, eval = FALSE}
-## RNA
-giottoObject = filterGiotto(gobject = giottoObject,
- expression_threshold = 1,
- feat_det_in_min_cells = 1,
- min_det_feats_per_cell = 1,
- expression_values = 'raw',
- verbose = TRUE)
-
-## Protein
-giottoObject = filterGiotto(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein',
- expression_threshold = 1,
- feat_det_in_min_cells = 1,
- min_det_feats_per_cell = 1,
- expression_values = 'raw',
- verbose = TRUE)
-```
-
-## Normalization
-
-```{r, eval = FALSE}
-## RNA
-giottoObject = normalizeGiotto(gobject = giottoObject,
- scalefactor = 6000,
- verbose = TRUE)
-
-## Protein
-giottoObject = normalizeGiotto(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein',
- scalefactor = 6000,
- verbose = TRUE)
-```
-
-## Statistics
-
-```{r, eval = FALSE}
-## RNA
-giottoObject = addStatistics(gobject = giottoObject)
-
-spatPlot2D(giottoObject,
- spat_unit = 'cell',
- feat_type = 'rna',
- cell_color = "nr_feats",
- color_as_factor = FALSE,
- point_size = 3.5)
-
-spatPlot2D(giottoObject,
- cell_color = "total_expr",
- color_as_factor = FALSE,
- point_size = 3.5)
-```
-
-![](images/mouse_embryo_dbitseq/0-spatPlot2D.png)
-![](images/mouse_embryo_dbitseq/1-spatPlot2D.png)
-
-
-```{r, eval = FALSE}
-## Protein
-giottoObject = addStatistics(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein')
-
-spatPlot2D(giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein',
- cell_color = "total_expr",
- color_as_factor = FALSE,
- point_size = 3.5)
-```
-
-![](images/mouse_embryo_dbitseq/2-spatPlot2D.png)
-
-# 5 Dimention Reduction
-
-## Identify highly variable features (HVF)
-
-```{r, eval = FALSE}
-giottoObject = calculateHVF(gobject = giottoObject)
-```
-
-![](images/mouse_embryo_dbitseq/3-HVFplot.png)
-
-
-## PCA
-
-```{r, eval = FALSE}
-# RNA
-giottoObject <- runPCA(gobject = giottoObject)
-```
-
-```{r, eval = FALSE}
-screePlot(giottoObject, ncp = 30)
-```
-
-![](images/mouse_embryo_dbitseq/4-screePlot.png)
-
-```{r, eval = FALSE}
-plotPCA(gobject = giottoObject)
-```
-
-![](images/mouse_embryo_dbitseq/5-PCA.png)
-
-```{r, eval = FALSE}
-# Protein
-giottoObject <- runPCA(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein')
-```
-
-```{r, eval = FALSE}
-screePlot(giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein',
- ncp = 30)
-```
-
-![](images/mouse_embryo_dbitseq/6-screePlot.png)
-
-```{r, eval = FALSE}
-plotPCA(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein')
-```
-
-![](images/mouse_embryo_dbitseq/7-PCA.png)
-
-# 6 Clustering
-
-## UMAP
-
-```{r, eval = FALSE}
-# RNA
-giottoObject <- runUMAP(giottoObject,
- dimensions_to_use = 1:10)
-```
-
-```{r, eval = FALSE}
-plotUMAP(gobject = giottoObject)
-```
-
-![](images/mouse_embryo_dbitseq/8-UMAP.png)
-
-```{r, eval = FALSE}
-# Protein
-giottoObject <- runUMAP(giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein',
- dimensions_to_use = 1:10)
-```
-
-```{r, eval = FALSE}
-plotUMAP(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein')
-```
-
-![](images/mouse_embryo_dbitseq/9-UMAP.png)
-
-## Create shared nearest network (sNN) and perform leiden clustering
-
-```{r, eval = FALSE}
-# RNA
-giottoObject <- createNearestNetwork(gobject = giottoObject,
- dimensions_to_use = 1:10,
- k = 30)
-
-giottoObject <- doLeidenCluster(gobject = giottoObject,
- resolution = 1,
- n_iterations = 1000)
-
-# Protein
-giottoObject <- createNearestNetwork(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein',
- dimensions_to_use = 1:10,
- k = 30)
-
-giottoObject <- doLeidenCluster(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein',
- resolution = 1,
- n_iterations = 1000)
-```
-
-## Visualize UMAP cluster results
-
-```{r, eval = FALSE}
-# RNA
-plotUMAP(gobject = giottoObject,
- cell_color = 'leiden_clus',
- show_NN_network = FALSE,
- point_size = 2,
- title = "",
- axis_text = 14,
- axis_title = 18,
- legend_text = 14)
-```
-
-![](images/mouse_embryo_dbitseq/10-UMAP.png)
-
-```{r, eval = FALSE}
-# Protein
-plotUMAP(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein',
- cell_color = 'leiden_clus',
- show_NN_network = FALSE,
- point_size = 2,
- title = "",
- axis_text = 14,
- axis_title = 18,
- legend_text = 14)
-```
-
-![](images/mouse_embryo_dbitseq/11-UMAP.png)
-
-## Visualize spatial results
-
-```{r, eval = FALSE}
-# RNA
-spatPlot2D(gobject = giottoObject,
- show_image = FALSE,
- cell_color = 'leiden_clus',
- point_size = 3.5,
- title = "",
- axis_text = 14,
- axis_title = 18,
- legend_text = 14)
-```
-
-![](images/mouse_embryo_dbitseq/12-spatPlot2D.png)
-
-```{r, eval = FALSE}
-# Protein
-spatPlot2D(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein',
- show_image = FALSE,
- cell_color = 'leiden_clus',
- point_size = 3.5,
- title = "",
- axis_text = 14,
- axis_title = 18,
- legend_text = 14)
-```
-
-![](images/mouse_embryo_dbitseq/13-spatPlot2D.png)
-
-# 7 Multi-omics integration
-
-```{r, eval = FALSE}
-# RNA
-giottoObject <- createNearestNetwork(gobject = giottoObject,
- type = 'kNN',
- dimensions_to_use = 1:10,
- k = 20)
-
-# Protein
-giottoObject <- createNearestNetwork(gobject = giottoObject,
- spat_unit = 'cell',
- feat_type = 'protein',
- type = 'kNN',
- dimensions_to_use = 1:10,
- k = 20)
-```
-
-```{r, eval = FALSE}
-giottoObject <- runWNN(giottoObject,
- spat_unit = "cell",
- modality_1 = "rna",
- modality_2 = "protein",
- pca_name_modality_1 = "pca",
- pca_name_modality_2 = "protein.pca",
- k = 20,
- verbose = TRUE)
-```
-
-```{r, eval = FALSE}
-giottoObject <- runIntegratedUMAP(giottoObject,
- modality1 = "rna",
- modality2 = "protein",
- spread = 7,
- min_dist = 1,
- force = FALSE)
-```
-
-```{r, eval = FALSE}
-giottoObject <- doLeidenCluster(gobject = giottoObject,
- spat_unit = "cell",
- feat_type = "rna",
- nn_network_to_use = "kNN",
- network_name = "integrated_kNN",
- name = "integrated_leiden_clus",
- resolution = 1)
-```
-
-```{r, eval = FALSE}
-plotUMAP(gobject = giottoObject,
- spat_unit = "cell",
- feat_type = "rna",
- cell_color = 'integrated_leiden_clus',
- dim_reduction_name = "integrated.umap",
- point_size = 2,
- title = "",
- axis_text = 14,
- axis_title = 18,
- legend_text = 14)
-```
-
-![](images/mouse_embryo_dbitseq/14-UMAP.png)
-
-```{r, eval = FALSE}
-spatPlot2D(giottoObject,
- spat_unit = "cell",
- feat_type = "rna",
- cell_color = "integrated_leiden_clus",
- point_size = 3.5,
- show_image = FALSE,
- title = "",
- axis_text = 14,
- axis_title = 18,
- legend_text = 14)
-```
-
-![](images/mouse_embryo_dbitseq/15-spatPlot2D.png)
-
-# 8 Deconvolution
-
-We used the scRNAseq from [Cao et al., 2019](https://www.nature.com/articles/s41586-019-0969-x) as reference. J. Cao, M. Spielmann, X. Qiu, X. Huang, D.M. Ibrahim, A.J. Hill, F. Zhang, S. Mundlos, L. Christiansen, F.J. Steemers, et al. The single-cell transcriptional landscape of mammalian organogenesis
-
-## Preparation of the scRNAseq
-
-```{r, eval = FALSE}
-gene_count_cleaned_sampled_100k <- readRDS("gene_count_cleaned_sampled_100k.RDS")
-
-cell_annotation = data.table::fread("data/scrnaseq/cell_annotate.csv")
-cell_annotation = cell_annotation[,c("sample", "Total_mRNAs", "num_genes_expressed", "Main_cell_type")]
-colnames(cell_annotation)[1] = "cell_ID"
-
-cell_annotation = cell_annotation[cell_annotation$cell_ID %in% colnames(gene_count_cleaned_sampled_100k),]
-```
-
-```{r, eval = FALSE}
-sc_giotto = createGiottoObject(expression = gene_count_cleaned_sampled_100k)
-sc_giotto = addCellMetadata(sc_giotto,
- new_metadata = cell_annotation)
-```
-
-```{r, eval = FALSE}
-sc_giotto = normalizeGiotto(sc_giotto,
- log_norm = FALSE,
- scale_feats = FALSE,
- scale_cells = FALSE)
-```
-
-Find markergenes
-
-```{r, eval = FALSE}
-markers_scran <- findMarkers_one_vs_all(gobject = sc_giotto,
- method = "scran",
- expression_values = "normalized",
- cluster_column = 'Main_cell_type',
- min_feats = 3)
-markergenes_scran <- unique(markers_scran[, head(.SD, 30), by = "cluster"][["feats"]])
-```
-
-Create DWLS matrix
-
-```{r, eval=FALSE}
-DWLS_matrix_direct <- makeSignMatrixDWLSfromMatrix(
- matrix = getExpression(sc_giotto,
- values = "normalized",
- output = "matrix"),
- cell_type = pDataDT(sc_giotto)$Main_cell_type,
- sign_gene = markergenes_scran)
-```
-
-Fix gene names
-
-```{r, eval = FALSE}
-sc_gene_names = read.csv("data/scrnaseq/GSE119945_gene_annotate.csv")
-
-ENSMUS_names = rownames(DWLS_matrix_direct)
-sc_gene_names = sc_gene_names[sc_gene_names$gene_id %in% ENSMUS_names,]
-
-rownames(DWLS_matrix_direct) = sc_gene_names$gene_short_name
-```
-
-## Run deconvolution
-
-```{r, eval=FALSE}
-# run DWLS using integrated leiden clusters
-giottoObject <- runDWLSDeconv(gobject = giottoObject,
- sign_matrix = DWLS_matrix_direct,
- cluster_column = "integrated_leiden_clus")
-```
-
-Plot DWLS deconvolution result
-
-```{r, eval = FALSE}
-# Plot DWLS deconvolution result with Pie plots dataset 1
-spatDeconvPlot(giottoObject,
- show_image = FALSE,
- radius = 0.5,
- return_plot = TRUE,
- save_plot = TRUE,
- save_param = list(save_name = "integrated_deconvolution"),
- title = "",
- axis_text = 14,
- axis_title = 18,
- legend_text = 0,
- background_color = "black")
-```
-
-![](images/mouse_embryo_dbitseq/integrated_deconvolution.png)
-
-# 9 Session Info
-
-```{r, eval = FALSE}
-sessionInfo()
-```
-
-```{r, eval = FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.3
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] Giotto_4.0.2 GiottoClass_0.1.3
-
-loaded via a namespace (and not attached):
- [1] RColorBrewer_1.1-3 rstudioapi_0.15.0 jsonlite_1.8.8
- [4] magrittr_2.0.3 magick_2.8.2 farver_2.1.1
- [7] rmarkdown_2.25 zlibbioc_1.48.0 ragg_1.2.7
- [10] vctrs_0.6.5 DelayedMatrixStats_1.24.0 GiottoUtils_0.1.4
- [13] RCurl_1.98-1.14 terra_1.7-71 htmltools_0.5.7
- [16] S4Arrays_1.2.0 curl_5.2.0 BiocNeighbors_1.20.0
- [19] SparseArray_1.2.3 parallelly_1.36.0 desc_1.4.3
- [22] igraph_2.0.1.1 lifecycle_1.0.4 pkgconfig_2.0.3
- [25] rsvd_1.0.5 Matrix_1.6-5 R6_2.5.1
- [28] fastmap_1.1.1 GenomeInfoDbData_1.2.11 MatrixGenerics_1.14.0
- [31] future_1.33.1 digest_0.6.34 colorspace_2.1-0
- [34] S4Vectors_0.40.2 ps_1.7.6 dqrng_0.3.2
- [37] irlba_2.3.5.1 textshaping_0.3.7 GenomicRanges_1.54.1
- [40] beachmat_2.18.0 labeling_0.4.3 progressr_0.14.0
- [43] RcppZiggurat_0.1.6 fansi_1.0.6 polyclip_1.10-6
- [46] abind_1.4-5 compiler_4.3.2 remotes_2.4.2.1
- [49] withr_3.0.0 backports_1.4.1 BiocParallel_1.36.0
- [52] pkgbuild_1.4.3 ggforce_0.4.1 MASS_7.3-60.0.1
- [55] DelayedArray_0.28.0 rjson_0.2.21 bluster_1.12.0
- [58] gtools_3.9.5 GiottoVisuals_0.1.4 tools_4.3.2
- [61] scatterpie_0.2.1 future.apply_1.11.1 glue_1.7.0
- [64] quadprog_1.5-8 dbscan_1.1-12 callr_3.7.3
- [67] grid_4.3.2 checkmate_2.3.1 cluster_2.1.6
- [70] generics_0.1.3 gtable_0.3.4 tidyr_1.3.1
- [73] data.table_1.15.0 BiocSingular_1.18.0 ScaledMatrix_1.10.0
- [76] metapod_1.10.0 utf8_1.2.4 XVector_0.42.0
- [79] BiocGenerics_0.48.1 ggrepel_0.9.5 pillar_1.9.0
- [82] limma_3.58.1 tweenr_2.0.2 dplyr_1.1.4
- [85] lattice_0.22-5 FNN_1.1.4 tidyselect_1.2.0
- [88] SingleCellExperiment_1.24.0 locfit_1.5-9.8 scuttle_1.12.0
- [91] knitr_1.45 IRanges_2.36.0 edgeR_4.0.0
- [94] SummarizedExperiment_1.32.0 stats4_4.3.2 xfun_0.42
- [97] Biobase_2.62.0 statmod_1.5.0 matrixStats_1.2.0
-[100] ggfun_0.1.4 yaml_2.3.8 evaluate_0.23
-[103] codetools_0.2-19 tibble_3.2.1 colorRamp2_0.1.0
-[106] cli_3.6.2 uwot_0.1.16 RcppParallel_5.1.7
-[109] reticulate_1.35.0 systemfonts_1.0.5 munsell_0.5.0
-[112] processx_3.8.3 Rcpp_1.0.12 GenomeInfoDb_1.38.5
-[115] globals_0.16.2 png_0.1-8 parallel_4.3.2
-[118] Rfast_2.1.0 ggplot2_3.4.4 scran_1.30.0
-[121] sparseMatrixStats_1.14.0 bitops_1.0-7 listenv_0.9.1
-[124] SpatialExperiment_1.12.0 scales_1.3.0 purrr_1.0.2
-[127] crayon_1.5.2 rlang_1.1.3 cowplot_1.1.3
-```
-
-
-
diff --git a/vignettes/nanostring_cosmx_lung_cancer.Rmd b/vignettes/nanostring_cosmx_lung_cancer.Rmd
deleted file mode 100644
index 64d31e446..000000000
--- a/vignettes/nanostring_cosmx_lung_cancer.Rmd
+++ /dev/null
@@ -1,1153 +0,0 @@
----
-title: "Nanostring CosMx Subcellular Lung Cancer"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Nanostring CosMx Subcellular Lung Cancer}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-This example uses subcellular data from Nanostring's CosMx Spatial Molecular Imager. This publicly available [dataset](https://nanostring.com/resources/smi-ffpe-dataset-lung12-data/) is from an FFPE sample of non-small-cell lung cancer (NSCLC). This example works with Lung12.
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-# 1. Setup
-
-
-```{r, eval=FALSE}
-library(Giotto)
-
-# Custom color palettes from rcartocolor
-# pal10 = rcartocolor::carto_pal(n = 10, name = 'Pastel')
-pal10 = c("#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F",
- "#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B3B3B3")
-# viv10 = rcartocolor::carto_pal(n = 10, name = 'Vivid')
-viv10 = c("#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0",
- "#24796C","#DAA51B","#2F8AC4","#764E9F","#A5AA99")
-
-# set working directory
-results_folder = '/path/to/directory'
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-
-## Set object behavior
-# by directly saving plots, but not rendering them you will save a lot of time
-instrs = createGiottoInstructions(save_dir = results_folder,
- save_plot = TRUE,
- show_plot = FALSE,
- return_plot = FALSE,
- python_path = my_python_path)
-```
-
-
-## 1.1 CosMx Project loading function
-
-Convenience function for loading in the CosMx data. It loads subcellular transcript information and polygons and generates a `giotto` object with `giottoPoints` objects for both 'rna' and 'neg_probe' nested in the gobject `feat_info` slot, and a `giottoPolygon` object for the 'cell' spatial unit in the `spatial_info` slot.
-
-This function performs the manual object creation steps described below. To skip those steps and preliminary data exploration, go to Section 5.
-
-Additionally, a comparison of the count matrix produced through the convenience function 'subcellular' workflow and Nanostring's provided matrix can be found at Section 6.4.
-
-
-```{r, eval=FALSE}
-## provide path to nanostring folder
-data_path = '/path/to/data/Lung12-Flat_files_and_images/'
-
-## create giotto cosmx object
-fov_join = createGiottoCosMxObject(cosmx_dir = data_path,
- data_to_use = 'subcellular', # only subcellular
- FOVs = c(2,3,4),
- instructions = instrs)
-
-showGiottoFeatInfo(fov_join)
-showGiottoSpatialInfo(fov_join)
-```
-
-
-# 2. Data exploration and loading
-
-## 2.1 Subcellular detections (points info)
-
-`tx_file.csv` contains the subcellular detections information. It contains information on each of the individual feature detections within the sample.
-
-- **fov** which FOV the detection happened in
-- **cell_ID** the ID of the cell the detection happened in
-- **x_global_px** the global spatial x location in pixels
-- **y_global_px** the global spatial y location in pixels
-- **x_local_px** the spatial x location in pixels within the FOV
-- **y_local_px** the spatial y location in pixels within the FOV
-- **z** the z plane the detection was called in (-1 to 16)
-- **target** the feature the probe is targeted against
-- **CellComp** Cellular compartment the detection happened in (0, Cytoplasm, Membrane, Nuclear)
-
-
-```{r, eval=FALSE}
-# load transcript coordinates
-tx_coord_all = data.table::fread(paste0(data_path, 'Lung12_tx_file.csv'))
-
-colnames(tx_coord_all)
-
-# z planes
-tx_coord_all[, table(z)]
-
-# Cell compartment
-tx_coord_all[, table(CellComp)]
-```
-
-
-
-```{r, eval=FALSE}
-# [1] "fov" "cell_ID" "x_global_px" "y_global_px"
-# [5] "x_local_px" "y_local_px" "z" "target"
-# [9] "CellComp"
-#
-# z
-# -1 0 1 2 3 4 5 6
-# 23723 3466178 2522315 2694973 2686531 2648926 2660346 2711105
-# 7 8 9 10 11 12 13 14
-# 2855259 3700831 36840 6594 6466 6787 6944 6959
-# 15 16
-# 17603 2
-#
-# CellComp
-# 0 Cytoplasm Membrane Nuclear
-# 6619744 5770549 3368411 10299678
-```
-
-
-## 2.2 Split detections by features vs negative probes
-
-`tx_file.csv` contains information on both actual features (960 targeted gene probes in this dataset) and negative probes (20) that are targeted to alien sequences defined by the External RNA Controls Consortium (ERCC) that do not exist in human tissue. These two types of detections will be treated as separate feature types (`feat_type`) and placed in separate expression matrices.
-
-
-```{r, eval=FALSE}
-all_IDs = tx_coord_all[, unique(target)]
-
-# negative probe IDs
-neg_IDs = all_IDs[grepl(pattern = 'NegPrb', all_IDs)]
-neg_IDs
-
-# Feature IDs
-feat_IDs = all_IDs[!all_IDs %in% neg_IDs]
-length(feat_IDs)
-
-# split detections
-feat_coords_all = tx_coord_all[target %in% feat_IDs]
-neg_coords_all = tx_coord_all[target %in% neg_IDs]
-
-cat('\nFeatures: ', feat_coords_all[, .N], '\n',
- 'NegProbes: ', neg_coords_all[, .N])
-```
-
-```{r, eval=FALSE}
-# Negative Probe IDs
-# [1] "NegPrb15" "NegPrb18" "NegPrb7" "NegPrb21" "NegPrb13"
-# [6] "NegPrb10" "NegPrb11" "NegPrb9" "NegPrb3" "NegPrb16"
-# [11] "NegPrb23" "NegPrb14" "NegPrb20" "NegPrb8" "NegPrb19"
-# [16] "NegPrb6" "NegPrb5" "NegPrb12" "NegPrb17" "NegPrb22"
-#
-# Number of feature IDs
-# [1] 960
-#
-# Features: 25875734
-# NegProbes: 182648
-```
-
-
-### 2.2.1 Preview negative probes (optional)
-
-Previewing the probe information can be done by converting to `giottoPoints` and then using `plot()`. Here we show a preview of the negative probes.
-
-**Note:** if previewing the rna expression information, it is highly recommended to set a subset of features using the `feats` param. The default is to plot all points, which can be very slow for large data.
-
-
-```{r, eval=FALSE}
-neg_points = createGiottoPoints(
- x = neg_coords_all[, .(target, x_global_px, y_global_px)]
-)
-plot(neg_points, point_size = 0.2, feats = neg_IDs)
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/preview_negprb.png)
-
-## 2.3 FOV shifts
-
-`fov_positions_file.csv` contains information on the x and y shifts needed in order to put the FOVs tiles together into a cohesive whole. This information is needed during the image attachment and alignment process.
-
-
-```{r, eval=FALSE}
-# load field of vision (fov) positions
-fov_offset_file = data.table::fread(paste0(data_path,
- 'Lung12_fov_positions_file.csv'))
-```
-
-
-## 2.4 Choose field of view for analysis
-
-CosMx data is large and Giotto loads in the subcellular information by FOV. This dataset includes 28 FOVs which can be difficult for most computers to handle at once.
-
-This tutorial will use FOVs '02', '03', and '04' which correspond to the 3 FOVs visible on the bottom right in the negative probe preview above.
-
-
-```{r, eval=FALSE}
-gobjects_list = list()
-
-id_set = c('02', '03', '04')
-```
-
-
-# 3. Create a Giotto Object for each FOV
-
-
-```{r, eval=FALSE}
-for(fov_i in 1:length(id_set)) {
-
- fov_id = id_set[fov_i]
-
-
- # 1. original composite image as png
- original_composite_image = paste0(data_path, 'CellComposite/CellComposite_F0', fov_id,'.jpg')
-
- # 2. input cell segmentation as mask file
- segmentation_mask = paste0(data_path, 'CellLabels/CellLabels_F0', fov_id, '.tif')
-
- # 3. input features coordinates + offset
- feat_coord = feat_coords_all[fov == as.numeric(fov_id)]
- neg_coord = neg_coords_all[fov == as.numeric(fov_id)]
- feat_coord = feat_coord[,.(x_local_px, y_local_px, z, target)]
- neg_coord = neg_coord[,.(x_local_px, y_local_px, z, target)]
- colnames(feat_coord) = c('x', 'y', 'z', 'gene_id')
- colnames(neg_coord) = c('x', 'y', 'z', 'gene_id')
- feat_coord = feat_coord[,.(x, y, gene_id)]
- neg_coord = neg_coord[,.(x, y, gene_id)]
-
-
- fovsubset = createGiottoObjectSubcellular(
- gpoints = list('rna' = feat_coord,
- 'neg_probe' = neg_coord),
- gpolygons = list('cell' = segmentation_mask),
- polygon_mask_list_params = list(
- mask_method = 'guess',
- flip_vertical = TRUE,
- flip_horizontal = FALSE,
- shift_horizontal_step = FALSE
- ),
- instructions = instrs
- )
-
-
- # cell centroids are now used to provide the spatial locations
- fovsubset = addSpatialCentroidLocations(fovsubset,
- poly_info = 'cell')
-
- # create and add Giotto images
- composite = createGiottoLargeImage(raster_object = original_composite_image,
- negative_y = FALSE,
- name = 'composite')
-
- fovsubset = addGiottoImage(gobject = fovsubset,
- largeImages = list(composite))
-
-
- fovsubset = convertGiottoLargeImageToMG(giottoLargeImage = composite,
- #mg_name = 'composite',
- gobject = fovsubset,
- return_gobject = TRUE)
-
- gobjects_list[[fov_i]] = fovsubset
-
-}
-```
-
-
-# 4. Join FOV Giotto Objects
-
-
-```{r, eval=FALSE}
-new_names = paste0("fov0", id_set)
-
-id_match = match(as.numeric(id_set), fov_offset_file$fov)
-x_shifts = fov_offset_file[id_match]$x_global_px
-y_shifts = fov_offset_file[id_match]$y_global_px
-
-# Create Giotto object that includes all selected FOVs
-fov_join = joinGiottoObjects(gobject_list = gobjects_list,
- gobject_names = new_names,
- join_method = 'shift',
- x_shift = x_shifts,
- y_shift = y_shifts)
-```
-
-
-# 5. Visualize Cells and Genes of Interest
-
-When plotting subcellular data, Giotto uses the `spatInSituPlot` functions. Spatial plots showing the feature points and polygons are plotted using `spatInSituPlotPoints()`.
-
-
-```{r, eval=FALSE}
-showGiottoImageNames(fov_join)
-
-# Set up vector of image names
-id_set = c('02', '03', '04')
-new_names = paste0("fov0", id_set)
-image_names = paste0(new_names, '-image')
-
-spatInSituPlotPoints(fov_join,
- show_image = TRUE,
- image_name = image_names,
- feats = list('rna' = c('MMP2', 'VEGFA', 'IGF1R',
- 'MKI67', 'EPCAM', 'KRT8')),
- feats_color_code = viv10,
- spat_unit = 'cell',
- point_size = 0.01,
- show_polygon = TRUE,
- use_overlap = FALSE,
- polygon_feat_type = 'cell',
- polygon_color = 'white',
- polygon_line_size = 0.03,
- save_param = list(base_height = 3,
- save_name = '1_inSituFeats'))
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/1_inSituFeats.png)
-
-## 5.1 Visualize Cell Centroids
-
-The standard `spatPlot2D()` function can also be used, but this works off only the aggregated information that is assembled based on the subcellular information. Plotting information based on cell centroids can be done through this function.
-
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = fov_join,
- image_name = image_names,
- show_image = TRUE,
- point_shape = 'no_border',
- point_size = 0.01,
- point_alpha = 0.5,
- coord_fix_ratio = 1,
- save_param = list(base_height = 2,
- save_name = '2_spatCentroids'))
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/2_spatCentroids.png)
-
-# 6. Aggregate subcellular features
-
-Giotto supports working directly with the subcellular features in order to generate cell by feature matrices. The data generated this way is then given the spatial unit `'cell'`. This workflow is recommended over loading the provided cell by feature (aggregated expression) matrix and then including the subcellular information as secondary data.
-
-When both the raw subcellular information and the pre-made expression matrix are loaded in at the same time, the subcellular data and all data generated from it should be given the spatial unit `'cell'` and the pre-generated aggregated information should be given a different spatial unit such as `'cell_agg'` to differentiate between the two sources of information.
-
-
-In this step, we will be aggregating the feature points of `'rna'` and `'neg_probe'` into the `'cell'` spatial unit.
-
-
-```{r, eval=FALSE}
-# Find the feature points overlapped by polygons. This overlap information is then
-# returned to the relevant giottoPolygon object's overlaps slot.
-fov_join = calculateOverlapRaster(fov_join, feat_info = 'rna')
-fov_join = calculateOverlapRaster(fov_join, feat_info = 'neg_probe')
-
-# Convert the overlap information into a cell by feature expression matrix which
-# is then stored in the Giotto object's expression slot
-fov_join = overlapToMatrix(fov_join, feat_info = 'rna')
-fov_join = overlapToMatrix(fov_join, feat_info = 'neg_probe')
-
-showGiottoExpression(fov_join)
-```
-
-
-## 6.1 Plot histograms of total counts per cell
-
-
-```{r, eval=FALSE}
-filterDistributions(fov_join,
- plot_type = 'hist',
- detection = 'cells',
- method = 'sum',
- feat_type = 'rna',
- nr_bins = 100,
- save_param = list(base_height = 3,
- save_name = '3.1_totalexpr'))
-
-filterDistributions(fov_join,
- plot_type = 'hist',
- detection = 'cells',
- method = 'sum',
- feat_type = 'neg_probe',
- nr_bins = 25,
- save_param = list(base_height = 3,
- save_name = '3.2_totalnegprbe'))
-```
-
-
-**RNA**
-![](images/nanostring_cosmx_lung_cancer/3.1_totalexpr.png)
-
-**Negative Probes**
-![](images/nanostring_cosmx_lung_cancer/3.2_totalnegprbe.png)
-
-## 6.2 2D Density Plots
-
-Density-based representations may sometimes be preferred instead of viewing the raw points information, especially when points are dense enough that there is overplotting. After overlaps information has been calculated, `spatInSituPlotDensity()` can be used in order to get a general idea of how much expression there is of a feature.
-
-
-```{r, eval=FALSE}
-spatInSituPlotDensity(gobject = fov_join,
- feats = c("MMP2", "VEGFA", "IGF1R",
- 'MKI67', 'EPCAM', 'KRT8'),
- cow_n_col = 2,
- save_param = list(base_height = 4,
- save_name = '4_inSituDens'))
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/4_inSituDens.png)
-
-## 6.3 Extract Data from Giotto Object
-
-
-```{r, eval=FALSE}
-# combine cell data
-morphometa = combineCellData(fov_join,
- feat_type = 'rna')
-
-# combine feature data
-featmeta = combineFeatureData(fov_join,
- feat_type = c('rna'))
-
-# combine overlapping feature data
-featoverlapmeta = combineFeatureOverlapData(fov_join,
- feat_type = c('rna'))
-```
-
-
-## 6.4 Comparison of Giotto aggregated and Nanostring provided matrices
-
-Comparison of Giotto's aggregated matrix results and those provided by Nanostring. Only FOV2 will be used in this comparison. Matrices are expected to be similar when the same sets of cell polygons/masks are used for both.
-
-
-```{r, eval=FALSE}
-# Load and prepare data
-
-nanoDT = data.table::fread(paste0(data_path, 'Lung12_exprMat_file.csv'))
-test1 = nanoDT[fov == 2]
-
-# Set up cell_IDs
-test1[, cell_ID := paste0('cell_', cell_ID)]
-test1[, cell_ID := paste0('f', fov, '-', cell_ID)]
-test1[, fov := NULL]
-
-test1mat = GiottoClass::t_flex(GiottoUtils::dt_to_matrix(test1))
-testnano_f2 = test1mat
-
-# Remove cell_0 (all tx counts that do not fall within a polygon)
-testnano_f2 = testnano_f2[, -1]
-
-# Remove negative probe counts
-testnano_f2 = testnano_f2[!grepl('NegPrb', rownames(testnano_f2)),]
-
-# giotto matrix
-testg = fov_join@expression$cell$rna$raw[]
-testg_f2 = testg[, grepl('fov002', colnames(testg))]
-sorted_rownames = sort(rownames(testg_f2))
-testg_f2 = testg_f2[sorted_rownames, ]
-
-# Prepare matrix comparison
-# Summarise sparse matrices (i and j are matrix indices, x is value)
-testg_f2_DT = data.table::as.data.table(Matrix::summary(testg_f2))
-testg_f2_DT[, method := 'giotto']
-testnano_f2_DT = data.table::as.data.table(Matrix::summary(testnano_f2))
-testnano_f2_DT[, method := 'nanostring']
-testDT = data.table::rbindlist(list(testg_f2_DT, testnano_f2_DT))
-
-# Combine sparse matrix indices
-testDT[, combo := paste0(i,'-',j)]
-```
-
-
-```{r, eval=FALSE}
-# Plot results
-library(ggplot2)
-
-# matrix index similarity
-pl_n = ggplot()
-pl_n = pl_n + geom_tile(data = testnano_f2_DT, aes(x = i, y = j, fill = log(x+1)))
-pl_n = pl_n + ggtitle('Nanostring Sparse Matrix')
-pl_n = pl_n + scale_fill_gradient(low = 'blue', high = 'red')
-pl_n = pl_n + theme(panel.grid.major = element_blank(),
- panel.grid.minor = element_blank(),
- panel.background = element_rect(fill = "black"))
-
-pl_g = ggplot()
-pl_g = pl_g + geom_tile(data = testg_f2_DT, aes(x = i, y = j, fill = log(x+1)))
-pl_g = pl_g + ggtitle('Giotto Sparse Matrix')
-pl_g = pl_g + scale_fill_gradient(low = 'blue', high = 'red')
-pl_g = pl_g + theme(panel.grid.major = element_blank(),
- panel.grid.minor = element_blank(),
- panel.background = element_rect(fill = "black"))
-
-
-combplot = cowplot::plot_grid(pl_n, pl_g,
- nrow = 2,
- labels = 'AUTO')
-combplot
-```
-
-![](images/nanostring_cosmx_lung_cancer/mat_comparison.png)
-
-```{r, eval=FALSE}
-# directly compare differences in matrix values (counts assigned)
-vartestDT = testDT[, list(var = var(x), diff = diff(x), mean = mean(x)), by = .(i,j)]
-data.table::setorder(vartestDT, var)
-
-# check arbitrary index values
-testDT[i == '812' & j == '2']
-testDT[i == '667' & j == '1072']
-testDT[i == '667' & j == '2880']
-
-# plot difference in values
-pl = ggplot()
-pl = pl + geom_bar(data = vartestDT, aes(x = diff))
-pl = pl + theme_bw()
-pl = pl + labs(x = 'difference nanostring - Giotto')
-pl
-
-testDT[order(x)]
-```
-
-![](images/nanostring_cosmx_lung_cancer/values_diff.png)
-
-```{r, eval=FALSE}
-testDT[, .N, by = 'method']
-
-testDT[, method, by = combo][, sum(duplicated(combo))]
-```
-
-```{r, eval=FALSE}
-# method N
-# 1: giotto 415952
-# 2: nanostring 416099
-#
-# 411050
-```
-
-
-Overall, the nanostring matrix has **416099 - 415952 = 147** more non-zero values than giotto's matrix for FOV2. Within the **411050** shared entries that were called by both methods (common i and j indices), there appears to be no major bias in terms of counts/values assigned. Moreover, the vast majority of these shared entries have the same values (difference of 0).
-
-
-# 7. Filtering and normalization
-
-After the expression matrix is generated from the subcellular information, analysis proceeds through data filtering and normalization.
-
-For the normalization step, we will employ two types.
-
-- **standard normalization method:** *library size normalization and log normalization.* This method will produce both normalized and scaled values that are be returned as the 'normalized' and 'scaled'expression matrices respectively. In this tutorial, the normalized values will be used for generating expression statistics and plotting expression values. The scaled values will be ignored. We will also generate normalized values for the negative probes for visualization purposes during which the library normalization step will be skipped.
-
-- **pearson residuals:** *A normalization that uses the method described in* [Lause/Kobak et al, 2021](https://doi.org/10.1186/s13059-021-02451-7). This produces a set of values that are most similar in utility to a scaled matrix and offer improvements to both HVF detection and PCA generation. These values should not be used for statistics, plotting of expression values, or differential expression analysis.
-
-
-```{r, eval=FALSE}
-# filter (feat_type = 'rna' by default)
-fov_join <- filterGiotto(gobject = fov_join,
- feat_type = 'rna',
- expression_threshold = 1,
- feat_det_in_min_cells = 5,
- min_det_feats_per_cell = 5)
-
-# normalize
-# standard method of normalization (log normalization based)
-fov_join <- normalizeGiotto(gobject = fov_join,
- feat_type = 'rna',
- norm_methods = 'standard',
- verbose = TRUE)
-
-fov_join <- normalizeGiotto(gobject = fov_join,
- feat_type = 'neg_probe',
- norm_methods = 'standard',
- library_size_norm = FALSE,
- verbose = TRUE)
-
-# new normalization method based on pearson correlations (Lause/Kobak et al. 2021)
-# this normalized matrix is given the name 'pearson' using the update_slot param
-fov_join <- normalizeGiotto(gobject = fov_join,
- feat_type = 'rna',
- scalefactor = 5000,
- verbose = TRUE,
- norm_methods = 'pearson_resid',
- update_slot = 'pearson')
-
-showGiottoExpression(fov_join)
-```
-
-```{r, eval=FALSE}
-# add statistics based on log normalized values for features rna and negative probes
-fov_join = addStatistics(gobject = fov_join,
- expression_values = 'normalized',
- feat_type = 'rna')
-
-fov_join = addStatistics(gobject = fov_join,
- expression_values = 'normalized',
- feat_type = 'neg_probe')
-
-# View cellular data (default is feat = 'rna')
-showGiottoCellMetadata(fov_join)
-
-# View feature data
-showGiottoFeatMetadata(fov_join)
-```
-
-**Note:** The show functions for metadata do not return the information. To retrieve the metadata information, instead use `pDataDT()` and `fDataDT()` along with the `feat_type` param for either 'rna' or 'neg_probe'.
-
-# 8. View Transcript Total Expression Distribution
-
-## 8.1 Histogram of log normalized data
-
-
-```{r, eval=FALSE}
-filterDistributions(fov_join,
- detection = 'cells',
- feat_type = 'rna',
- expression_values = 'normalized',
- method = 'sum',
- nr_bins = 100,
- save_param = list(base_height = 3,
- save_name = '5.1_rna_norm_total_hist'))
-
-filterDistributions(fov_join,
- detection = 'cell',
- feat_type = 'neg_probe',
- expression_values = 'normalized',
- method = 'sum',
- nr_bins = 20,
- save_param = list(base_height = 3,
- save_name = '5.2_neg_norm_total_hist'))
-```
-
-
-**RNA**
-
-![](images/nanostring_cosmx_lung_cancer/5.1_rna_norm_total_hist.png)
-
-**Negative Probe**
-
-![](images/nanostring_cosmx_lung_cancer/5.2_neg_norm_total_hist.png)
-
-## 8.2 Plot spatially as centroids
-
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = fov_join,
- cell_color = 'total_expr',
- color_as_factor = FALSE,
- show_image = TRUE,
- image_name = image_names,
- point_size = 0.9,
- point_alpha = 0.75,
- save_param = list(base_height = 2,
- save_name = '5.3_color_centroids'))
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/5.3_color_centroids.png)
-
-## 8.3 Plot spatially as color-scaled polygons
-
-
-```{r, eval=FALSE}
-spatInSituPlotPoints(fov_join,
- show_polygon = TRUE,
- polygon_color = 'gray',
- polygon_line_size = 0.05,
- polygon_fill = 'total_expr',
- polygon_fill_as_factor = FALSE,
- save_param = list(base_height = 2,
- save_name = '5.4_rna_color_polys'))
-
-spatInSituPlotPoints(fov_join,
- feat_type = 'neg_probe',
- show_polygon = TRUE,
- polygon_color = 'gray',
- polygon_line_size = 0.05,
- polygon_fill = 'total_expr',
- polygon_fill_as_factor = FALSE,
- save_param = list(base_height = 2,
- save_name = '5.5_neg_color_polys'))
-```
-
-
-**RNA**
-
-![](images/nanostring_cosmx_lung_cancer/5.4_rna_color_polys.png)
-
-**Negative Probe**
-
-![](images/nanostring_cosmx_lung_cancer/5.5_neg_color_polys.png)
-
-# 9. Dimension Reduction
-
-## 9.1 Detect highly variable genes and generate PCA
-
-Detect highly variable genes using the pearson residuals method based on the 'pearson' expression matrix. These results will be returned as a new 'hvf' column in the 'rna' feature metadata.
-
-PCA generation will also be based on the 'pearson' matrix. Scaling and centering of the PCA which is usually done by default will be skipped since the pearson matrix is already scaled.
-
-
-```{r, eval=FALSE}
-fov_join = calculateHVF(fov_join,
- method = 'var_p_resid',
- expression_values = 'pearson',
- save_param = list(base_height = 5,
- save_name = '6.1_pearson_HVF'))
-
-# print HVFs
-gene_meta = fDataDT(fov_join)
-gene_meta[hvf == 'yes', feat_ID]
-```
-
-![](images/nanostring_cosmx_lung_cancer/6.1_pearson_HVF.png)
-
-```{r, eval=FALSE}
-fov_join = runPCA(fov_join,
- scale_unit = FALSE,
- center = FALSE,
- expression_values = 'pearson')
-
-# screeplot uses the generated PCA. No need to specify expr values
-screePlot(fov_join,
- ncp = 20,
- save_param = list(save_name = '6.2_screeplot'))
-
-plotPCA(fov_join,
- cell_color = 'nr_feats', # (from log norm statistics)
- color_as_factor = FALSE,
- point_size = 0.1,
- point_shape = 'no_border',
- save_param = list(save_name = '6.3_PCA'))
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/6.2_screeplot.png)
-![](images/nanostring_cosmx_lung_cancer/6.3_PCA.png)
-
-## 9.2 Run UMAP
-
-
-```{r, eval=FALSE}
-# Generate UMAP from PCA
-fov_join <- runUMAP(fov_join,
- dimensions_to_use = 1:10,
- n_threads = 4)
-
-plotUMAP(gobject = fov_join,
- save_param = list(save_name = '6.4_UMAP'))
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/6.4_UMAP.png)
-
-## 9.3 Plot features on expression space
-
-
-```{r, eval=FALSE}
-dimFeatPlot2D(gobject = fov_join,
- feat_type = 'rna',
- feats = c('MKI67', 'CD8A', 'CD4',
- 'COL1A1', 'MS4A1', 'MZB1'),
- expression_values = 'normalized',
- point_shape = 'no_border',
- point_size = 0.01,
- cow_n_col = 3,
- save_param = list(base_height = 5,
- save_name = '6.5_UMAP_feats'))
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/6.5_UMAP_feats.png)
-
-# 10. Cluster
-
-## 10.1 Visualize clustering
-
-
-```{r, eval=FALSE}
-fov_join <- createNearestNetwork(gobject = fov_join,
- dimensions_to_use = 1:10,
- k = 10)
-
-fov_join <- doLeidenCluster(gobject = fov_join,
- resolution = 0.07,
- n_iterations = 1000)
-
-# visualize UMAP cluster results
-plotUMAP(gobject = fov_join,
- cell_color = 'leiden_clus',
- cell_color_code = pal10,
- show_NN_network = TRUE,
- point_size = 2,
- save_param = list(save_name = '7.1_UMAP_leiden'))
-```
-
-![](images/nanostring_cosmx_lung_cancer/7.1_UMAP_leiden.png)
-
-## 10.2 Visualize clustering on expression and spatial space
-
-```{r, eval=FALSE}
-# visualize UMAP and spatial results
-spatDimPlot2D(gobject = fov_join,
- show_image = TRUE,
- image_name = image_names,
- cell_color = 'leiden_clus',
- cell_color_code = pal10,
- spat_point_size = 1,
- save_param = list(save_name = '7.2_spatdim_leiden'))
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/7.2_spatdim_leiden.png)
-
-## 10.3 Map clustering spatially
-
-```{r, eval=FALSE}
-spatInSituPlotPoints(fov_join,
- feats = list('rna' = c('MMP2', 'VEGFA', 'IGF1R',
- 'MKI67', 'EPCAM', 'MZB1')),
- point_size = 0.15,
- feats_color_code = viv10,
- show_polygon = TRUE,
- polygon_color = 'white',
- polygon_line_size = 0.01,
- polygon_fill = 'leiden_clus',
- polygon_fill_as_factor = TRUE,
- polygon_fill_code = pal10,
- save_param = list(base_height = 5,
- save_name = '7.3_spatinsitu_leiden'))
-```
-
-![](images/nanostring_cosmx_lung_cancer/7.3_spatinsitu_leiden.png)
-
-# 11. Small Subset Visualization
-
-```{r, eval=FALSE}
-#subset a Giotto object based on spatial locations
-smallfov <- subsetGiottoLocs(fov_join,
- x_max = 3000,
- x_min = 1000,
- y_max = -157800,
- y_min = -159800)
-
-#extract all genes observed in new object
-smallfeats <- fDataDT(smallfov)[, feat_ID]
-
-#plot all genes
-spatInSituPlotPoints(smallfov,
- feats = list(smallfeats),
- point_size = 0.15,
- polygon_line_size = 0.1,
- show_polygon = TRUE,
- polygon_color = 'white',
- show_image = TRUE,
- largeImage_name = 'fov002-composite',
- show_legend = FALSE,
- save_param = list(save_name = '8.1_smallfov_points'))
-
-# plot only the polygon outlines
-spatInSituPlotPoints(smallfov,
- polygon_line_size = 0.1,
- polygon_alpha = 0,
- polygon_color = 'white',
- show_polygon = TRUE,
- show_image = TRUE,
- largeImage_name = 'fov002-composite',
- show_legend = FALSE,
- save_param = list(save_name = '8.2_smallfov_poly'))
-
-# plot polygons colorlabeled with leiden clusters
-spatInSituPlotPoints(smallfov,
- polygon_line_size = 0.1,
- show_polygon = TRUE,
- polygon_fill = 'leiden_clus',
- polygon_fill_as_factor = TRUE,
- polygon_fill_code = pal10,
- show_image = TRUE,
- largeImage_name = 'fov002-composite',
- show_legend = FALSE,
- save_param = list(save_name = '8.3_smallfov_leiden'))
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/8.1_smallfov_points.png)
-![](images/nanostring_cosmx_lung_cancer/8.2_smallfov_poly.png)
-![](images/nanostring_cosmx_lung_cancer/8.3_smallfov_leiden.png)
-
-# 12. Spatial Expression Patterns
-
-Find spatially organized gene expression by examining the binarized expression of cells and their spatial neighbors.
-
-
-```{r, eval=FALSE}
-# create spatial network based on physical distance of cell centroids
-fov_join = createSpatialNetwork(gobject = fov_join,
- minimum_k = 2,
- maximum_distance_delaunay = 50)
-
-
-# perform Binary Spatial Extraction of genes - NOTE: Depending on your system this could take time
-km_spatialgenes = binSpect(fov_join)
-
-# visualize spatial expression of selected genes obtained from binSpect
-spatFeatPlot2D(fov_join,
- expression_values = 'normalized',
- feats = km_spatialgenes$feats[1:10],
- point_shape = 'no_border',
- point_border_stroke = 0.01,
- point_size = 0.01,
- cow_n_col = 2,
- save_param = list(save_name = '9_binspect_genes'))
-```
-
-
-![](images/nanostring_cosmx_lung_cancer/9_binspect_genes.png)
-
-# 13. Identify cluster differential expression genes
-
-## 13.1 Violin plot
-
-
-```{r, eval=FALSE}
-# Gini
-markers = findMarkers_one_vs_all(gobject = fov_join,
- method = 'gini',
- expression_values = 'normalized',
- cluster_column = 'leiden_clus',
- min_feats = 1,
- rank_score = 2)
-# First 5 results by cluster
-markers[, head(.SD, 5), by = 'cluster']
-
-# violinplot
-topgini_genes = unique(markers[, head(.SD, 2), by = 'cluster']$feats)
-
-violinPlot(fov_join,
- feats = topgini_genes,
- cluster_column = 'leiden_clus',
- strip_position = 'right',
- save_param = list(save_name = '10.1_gini_violin'))
-```
-
-![](images/nanostring_cosmx_lung_cancer/10.1_gini_violin.png)
-
-## 13.2 Heatmap
-
-```{r, eval=FALSE}
-cluster_order = 1:10
-
-plotMetaDataHeatmap(fov_join,
- expression_values = 'normalized',
- metadata_cols = c('leiden_clus'),
- selected_feats = topgini_genes,
- custom_cluster_order = cluster_order,
- save_param = list(base_height = 5,
- save_name = '10.2_heatmap'))
-```
-
-![](images/nanostring_cosmx_lung_cancer/10.2_heatmap.png)
-
-## 13.3 Plot gini genes on UMAP
-
-```{r, eval=FALSE}
-# low, mid, high
-custom_scale = c('#440154', '#1F968B', '#FDE725')
-
-dimFeatPlot2D(fov_join,
- expression_values = 'normalized',
- cell_color_gradient = custom_scale,
- gradient_midpoint = 5,
- feats = topgini_genes,
- point_shape = 'no_border',
- point_size = 0.001,
- cow_n_col = 4,
- save_param = list(base_height = 8,
- save_name = '10.3_gini_genes'))
-```
-
-![](images/nanostring_cosmx_lung_cancer/10.3_gini_genes.png)
-
-## 13.4 Annotate Giotto Object
-
-```{r, eval=FALSE}
-## add cell types ###
-clusters_cell_types_lung = c('Normal Epithelial 1', 'Cancer', 'Stromal', 'B-lineage',
- 'Macrophage', 'B-lineage', 'Cancer',
- 'Normal Epithelial 2', 'Stromal', 'B-lineage')
-
-names(clusters_cell_types_lung) = 1:10
-
-fov_join = annotateGiotto(gobject = fov_join,
- annotation_vector = clusters_cell_types_lung,
- cluster_column = 'leiden_clus',
- name = 'cell_types')
-
-plotUMAP(fov_join,
- cell_color = 'cell_types',
- cell_color_code = viv10,
- point_size = 1.5,
- save_param = list(save_name = '11_anno_umap'))
-```
-
-![](images/nanostring_cosmx_lung_cancer/11_anno_umap.png)
-
-## 13.5 Visualize
-
-```{r, eval=FALSE}
-spatDimPlot2D(gobject = fov_join,
- show_image = TRUE,
- image_name = image_names,
- cell_color = 'cell_types',
- cell_color_code = viv10,
- spat_point_size = 1,
- save_param = list(save_name = '12_spatdim_type'))
-```
-
-![](images/nanostring_cosmx_lung_cancer/12_spatdim_type.png)
-
-```{r, eval=FALSE}
-spatInSituPlotPoints(fov_join,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'grey',
- polygon_line_size = 0.05,
- polygon_fill = 'cell_types',
- polygon_fill_as_factor = TRUE,
- polygon_fill_code = viv10,
- save_param = list(base_height = 2,
- save_name = '13_insitu_type'))
-```
-
-![](images/nanostring_cosmx_lung_cancer/13_insitu_type.png)
-
-# 14. Interaction Changed Genes
-
-```{r, eval=FALSE}
-future::plan('multisession', workers = 4) # NOTE: Depending on your system this could take time
-
-icf = findInteractionChangedFeats(gobject = fov_join,
- cluster_column = 'cell_types')
-
-# Identify top ten interaction changed features
-icf$ICFscores[type_int == 'hetero']$feats[1:10]
-
-# Skip first two genes since they are too highly expressed
-icf_plotfeats = icf$ICFscores[type_int == 'hetero']$feats[3:12]
-
-# Visualize ICF expression
-spatInSituPlotPoints(fov_join,
- feats = list(icf_plotfeats),
- point_size = 0.001,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'gray',
- polygon_line_size = 0.05,
- polygon_fill = 'cell_types',
- polygon_fill_as_factor = TRUE,
- polygon_fill_code = pal10,
- save_param = list(base_height = 6,
- save_name = '14_ICF'))
-```
-
-![](images/nanostring_cosmx_lung_cancer/14_ICF.png)
-
-# 15. Saving the giotto object
-
-Giotto uses many objects that include pointers to information that live on disk instead of loading everything into memory. This includes both giotto image objects (`giottoImage`, `giottoLargeImage`) and also subcellular information (`giottoPoints`, `giottoPolygon`). When saving the project as a `.RDS` or `.Rdata`, these pointers are broken and can produce errors when loaded again.
-
-`saveGiotto()` is a function that can save Giotto Suite projects into a contained structured directory that can then be properly loaded again later using `loadGiotto()`.
-
-
-```{r, eval=FALSE}
-saveGiotto(gobject = fov_join,
- foldername = 'new_folder_name',
- dir = '/directory/to/save/to/')
-```
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.3
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] ggplot2_3.4.4 Giotto_4.0.2 GiottoClass_0.1.3
-
-loaded via a namespace (and not attached):
- [1] tidyselect_1.2.0 viridisLite_0.4.2 dplyr_1.1.4
- [4] farver_2.1.1 GiottoVisuals_0.1.4 bitops_1.0-7
- [7] fastmap_1.1.1 SingleCellExperiment_1.24.0 RCurl_1.98-1.14
- [10] rsvd_1.0.5 digest_0.6.34 lifecycle_1.0.4
- [13] terra_1.7-71 dbscan_1.1-12 magrittr_2.0.3
- [16] compiler_4.3.2 rlang_1.1.3 tools_4.3.2
- [19] igraph_2.0.1.1 utf8_1.2.4 yaml_2.3.8
- [22] data.table_1.15.0 knitr_1.45 S4Arrays_1.2.0
- [25] labeling_0.4.3 reticulate_1.35.0 DelayedArray_0.28.0
- [28] RColorBrewer_1.1-3 BiocParallel_1.36.0 abind_1.4-5
- [31] withr_3.0.0 BiocGenerics_0.48.1 grid_4.3.2
- [34] stats4_4.3.2 fansi_1.0.6 beachmat_2.18.0
- [37] colorspace_2.1-0 future_1.33.1 progressr_0.14.0
- [40] globals_0.16.2 scales_1.3.0 gtools_3.9.5
- [43] MASS_7.3-60.0.1 SummarizedExperiment_1.32.0 cli_3.6.2
- [46] rmarkdown_2.25 crayon_1.5.2 ragg_1.2.7
- [49] generics_0.1.3 rstudioapi_0.15.0 future.apply_1.11.1
- [52] rjson_0.2.21 zlibbioc_1.48.0 parallel_4.3.2
- [55] XVector_0.42.0 matrixStats_1.2.0 vctrs_0.6.5
- [58] Matrix_1.6-5 jsonlite_1.8.8 BiocSingular_1.18.0
- [61] IRanges_2.36.0 S4Vectors_0.40.2 ggrepel_0.9.5
- [64] irlba_2.3.5.1 scattermore_1.2 listenv_0.9.1
- [67] systemfonts_1.0.5 magick_2.8.2 GiottoUtils_0.1.3
- [70] parallelly_1.36.0 glue_1.7.0 codetools_0.2-19
- [73] uwot_0.1.16 cowplot_1.1.3 RcppAnnoy_0.0.22
- [76] gtable_0.3.4 deldir_2.0-2 GenomeInfoDb_1.38.5
- [79] GenomicRanges_1.54.1 ScaledMatrix_1.10.0 munsell_0.5.0
- [82] tibble_3.2.1 pillar_1.9.0 htmltools_0.5.7
- [85] GenomeInfoDbData_1.2.11 R6_2.5.1 textshaping_0.3.7
- [88] evaluate_0.23 lattice_0.22-5 Biobase_2.62.0
- [91] png_0.1-8 backports_1.4.1 SpatialExperiment_1.12.0
- [94] Rcpp_1.0.12 SparseArray_1.2.3 checkmate_2.3.1
- [97] colorRamp2_0.1.0 xfun_0.41 MatrixGenerics_1.14.0
-[100] pkgconfig_2.0.3
-```
-
diff --git a/vignettes/object_creation.Rmd b/vignettes/object_creation.Rmd
deleted file mode 100644
index 388838cea..000000000
--- a/vignettes/object_creation.Rmd
+++ /dev/null
@@ -1,280 +0,0 @@
----
-title: "Giotto Object Creation"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Giotto Object Creation}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# 1. How to create a Giotto Object
-
-In this tutorial, the methodology and syntax to create a `giotto` object is shown and osmFISH data is used throughout the tutorial.
-
-## 1.1 Import Giotto and Download the Data
-
-To download this data, please ensure that [wget](https://www.gnu.org/software/wget/?) is installed locally.
-
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- installGiottoEnvironment()
-}
-
-# Specify path from which data may be retrieved/stored
-data_directory = paste0(getwd(),'/gobject_data/')
-# alternatively, "/path/to/where/the/data/lives/"
-
-# Specify path to which results may be saved
-results_directory = paste0(getwd(),'/gobject_results/')
-# alternatively, "/path/to/store/the/results/"
-
-# Download osmFISH dataset to data_directory
-getSpatialDataset(dataset = 'osmfish_SS_cortex', directory = data_directory, method = 'wget')
-```
-
-
-## 1.2 Minimum requirements for a Giotto Object
-
-- Expression matrix
-- Spatial locations (*unnecessary for scRNAseq analysis*)
-
-Here, creating a `giotto` object with the minimum requirements is shown in two examples. Data formatting guidelines are shown below this code block.
-
-
-```{r, eval=FALSE}
-# Example 1.
-# Create a Giotto object using data directly from file paths
-osm_exprs = paste0(data_directory, "osmFISH_prep_expression.txt")
-osm_locs = paste0(data_directory, "osmFISH_prep_cell_coordinates.txt")
-
-minimum_gobject1 = createGiottoObject(expression = osm_exprs,
- spatial_locs = osm_locs)
-
-# Example 2.
-# Create a Giotto object using objects already loaded into workspace
-expression_matrix = readExprMatrix(path = osm_exprs) # fast method to read expression matrix
-cell_locations = data.table::fread(file = osm_locs)
-
-minimum_gobject2 = createGiottoObject(expression = expression_matrix,
- spatial_locs = cell_locations)
-```
-
-
-
-Expression file formatting
-
-
-Expression count matrices accepted by *Giotto* should have columns correlating to individual cells (**cell IDs**) and rows to individual features (**feature IDs**).
-
-**data.table** objects and text-based files ie: (**.csv, .tsv, .txt**) to be read in should have column 1 be **feature IDs**.
-
-**matrix** and **DelayedMatrix** objects should have **feature IDs**
-already incorporated as the rownames.
-
-
-
-Locations file formatting
-
-
-Numerical columns will be interpreted in order of x, y, and (optionally) z coordinate. The first non-numerical column will be taken as **cell IDs**
-
-
-**\*Note:** multiple expression files during can be given at once during Giotto object creation by using a named list.
-
-
-```{r, eval=FALSE}
-# Arbitrary modifications
-scaled_matrix = expression_matrix * 1.2
-custom_matrix = expression_matrix * 0.5
-
-# Provide multiple expression matrices at once to the Giotto Object
-# If these matrices are stored in files rather than in the workspace,
-# file paths may be provided instead of variables
-multi_expr_gobject = createGiottoObject(expression = list(raw = expression_matrix,
- scaled = scaled_matrix,
- custom = custom_matrix),
- spatial_locs = cell_locations)
-```
-
-
-## 1.3 Customizing the Giotto Object
-
-By providing values to other `createGiottoObject()` parameters, it is possible to add:
-
-- **Cell** or **feature (gene) metadata**: see
- [addCellMetadata](../reference/addCellMetadata.html) and
- [addFeatMetadata](../reference/addFeatMetadata.html)
-- **Spatial networks** or **grids**: see
- [Visualizations](./Visualizations.html)
-- **Dimension reduction**: see
- [Clustering](./dimension_reduction.html)
-- **Images**: see [Imaging](./getting_started_images.html)
-- **giottoInstructions**: see
- [createGiottoInstructions](../docs/reference/createGiottoInstructions.html) and below
-
-Providing `giottoInstructions` allows the specification of:
-
-- An alternative python path if using the Giotto Environment (default) is not desired
-- A directory to which resulting plots will save
-- Plot formatting
-
-`createGiottoInstruction()` is used to create the instructions that are provided to `createGiottoObject()`. The `instructions()` function can then be used to view, set, or modify one or more of these instructions after they have been added to a `giotto` object.
-
-Here is an example of a more customized Giotto object.
-
-
-```{r, eval=FALSE}
-# Specify data with file paths
-osm_exprs = paste0(data_directory, "osmFISH_prep_expression.txt")
-osm_locs = paste0(data_directory, "osmFISH_prep_cell_coordinates.txt")
-meta_path = paste0(data_directory, "osmFISH_prep_cell_metadata.txt")
-
-# Create instructions
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-
-instrs = createGiottoInstructions(python_path = my_python_path,
- save_dir = results_directory,
- plot_format = 'png',
- dpi = 200,
- height = 9,
- width = 9)
-
-# Create Giotto object
-custom_gobject = createGiottoObject(expression = osm_exprs,
- spatial_locs = osm_locs,
- instructions = instrs)
-
-# Add field annotations as cell metadata
-metadata = data.table::fread(file = meta_path)
-custom_gobject = addCellMetadata(custom_gobject,
- new_metadata = metadata,
- by_column = T,
- column_cell_ID = 'CellID')
-
-# Show the Giotto instructions associated with the Giotto object
-instructions(custom_gobject)
-```
-
-
-Note that although parameters `show_plot`, `return_plot`, and `save_plot` were not specified within the call to `createGiottoInstructions()`, default values were provided to these instruction parameters. All instruction parameters have default values, such that `createGiottoInstructions()` may be called with some or no arguments yet all instruction parameters will have a value after its execution.
-
-Alternatively, a named list may also be provided to the `instructions` argument of `createGiottoObject()`. However, ensure that all arguments to ` `createGiottoInstructions() ` are defined when providing instructions as a named list, since default values are only applied to instructions when made with createGiottoInstructions() \*Note that `python_path` must be specified when providing instructions as a named list, and may not be provided as NULL.
-
-The `giottoInstructions` may be changed, or completely replaced:
-
-
-```{r, eval=FALSE}
-# Change a specific previously set parameter, e.g. change dpi = 200 to dpi = 300
-instructions(custom_gobject, 'dpi') = 300
-
-# Observe that the instructions have changed
-instructions(custom_gobject, 'dpi')
-
-# Create new instructions using a named list
-sub_results_directory = paste0(results_directory, 'specific_results/')
-my_python_path = instructions(custom_gobject, 'python_path')
-new_instrs = list(python_path = my_python_path,
- show_plot = TRUE,
- return_plot = FALSE,
- save_plot = TRUE,
- save_dir = sub_results_directory,
- plot_format = 'jpg',
- dpi = 250,
- units = 'in',
- height = 12,
- width = 12,
- is_docker = FALSE)
-
-# Change all instructions
-instructions(custom_gobject) = new_instrs
-
-# Observe that the instructions have changed
-instructions(custom_gobject)
-```
-
-
-### 1.3.1 Active spatial unit and feature type
-
-Many of *Giotto*'s functions have `spat_unit` and `feat_type` parameters that govern which set of data to use. The active spatial unit and feature type is visible when directly returning the `giotto` object and decides what defaults are used when those parameters are not supplied.
-
-This setting is also stored within `giottoInstructions` and there are convenient accessors specific for those two settings:
-
-- `activeSpatUnit()`
-- `activeFeatType()`
-
-## 1.4 Plotting Data from a Giotto Object
-
-Each plotting function in Giotto has three important binary parameters:
-
-- `show_plot`: print the plot to the console, default is TRUE
-- `return_plot`: return the plot as an object, default is TRUE
-- `save_plot`: automatically save the plot, default is FALSE
-
-These parameters are stored within a `giotto` object that was provided instructions from `createGiottoInstructions()` and are provided to plotting functions accordingly. To change these parameters from the default values, the instructions may be changed or replaced, or these parameters may be *manually overwritten* within plotting functions.
-
-See `showSaveParameters()` and the `Saving
-Options` tutorial for alternative methods to save plots.
-
-
-```{r, eval=FALSE}
-# Plot according to Giotto Instructions (default)
-spatPlot(custom_gobject)
-
-# Plot clusters, create, and save to a new subdirectory, all while overwriting formatting
-spatPlot(custom_gobject,
- cell_color = 'ClusterName',
- save_plot = TRUE,
- return_plot = TRUE,
- show_plot = TRUE,
- save_param = list(save_folder = 'plots/', # Create subdirectory
- save_name = 'cell_clusters',
- save_format = 'png',
- units = 'in',
- base_height = 9,
- base_width = 9))
-```
-
-
-![](images/object_creation/cell_clusters.png)
-
-For a more in-depth look at the `giotto` object structure, take a look at the [introduction to giotto classes](./classes_intro.html)
-
-## 2. Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
- R version 4.2.1 (2022-06-23)
- Platform: x86_64-apple-darwin17.0 (64-bit)
- Running under: macOS Big Sur ... 10.16
-
- Matrix products: default
- BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
- LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
-
- locale:
- [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
- attached base packages:
- [1] stats graphics grDevices utils datasets methods base
-
- loaded via a namespace (and not attached):
- [1] compiler_4.2.1 fastmap_1.1.1 cli_3.6.1 tools_4.2.1
- [5] htmltools_0.5.5 rstudioapi_0.14 yaml_2.3.7 rmarkdown_2.21
- [9] knitr_1.42 xfun_0.39 digest_0.6.31 jsonlite_1.8.4
- [13] rlang_1.1.1 evaluate_0.21
-
-```
diff --git a/vignettes/osmfish_mouse_ss_cortex.Rmd b/vignettes/osmfish_mouse_ss_cortex.Rmd
deleted file mode 100644
index 0633b0d12..000000000
--- a/vignettes/osmfish_mouse_ss_cortex.Rmd
+++ /dev/null
@@ -1,728 +0,0 @@
----
-title: "osmFISH Mouse SS Cortex"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{osmFISH Mouse SS Cortex}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Dataset explanation
-
-[Codeluppi et al.](https://www.nature.com/articles/s41592-018-0175-z) created a cyclic single-molecule fluorescence in situ hybridization (osmFISH) technology and define the cellular organization of the somatosensory cortex with the expression of 33 genes in 5,328 cells.
-
-![](images/osmfish_mouse_ss_cortex/osmfish_image_demo.png)
-
-# Set up Giotto environment
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite and GiottoData, a small, helper module for tutorials, are installed.
-pkgs <- c("Giotto", "GiottoData")
-need_install <- pkgs[sapply(pkgs, function(pkg) !requireNamespace(pkg, quietly = TRUE))]
-
-if (length(need_install) > 0L) {
- if (!requireNamespace("pak", quietly = TRUE)) install.packages("pak")
- pak::pak(sprintf("drieslab/%s", need_install))
-}
-
-library(Giotto)
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- installGiottoEnvironment()
-}
-```
-
-
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-# 1. set working directory
-results_folder = 'path/to/result'
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-```
-
-
-# Dataset download
-
-The osmFISH data to run this tutorial can be found [here](https://github.com/drieslab/spatial-datasets/tree/master/data/2018_osmFISH_SScortex). Alternatively you can use the **getSpatialDataset** to automatically download this dataset like we do in this example; to download the data used to create the Giotto Object below, please ensure that
-[wget](https://www.gnu.org/software/wget/?) is installed locally.
-
-
-```{r, eval=FALSE}
-# download data to working directory ####
-# if wget is installed, set method = 'wget'
-# if you run into authentication issues with wget, then add " extra = '--no-check-certificate' "
-getSpatialDataset(dataset = 'osmfish_SS_cortex', directory = results_folder, method = 'wget')
-```
-
-
-# 1. Giotto global instructions and preparations
-
-
-```{r, eval=FALSE}
-## instructions allow us to automatically save all plots into a chosen results folder
-instrs = createGiottoInstructions(save_plot = TRUE,
- show_plot = FALSE,
- save_dir = results_folder,
- python_path = python_path)
-
-expr_path = file.path(results_folder, "osmFISH_prep_expression.txt")
-loc_path = file.path(results_folder, "osmFISH_prep_cell_coordinates.txt")
-meta_path = file.path(results_folder, "osmFISH_prep_cell_metadata.txt")
-```
-
-
-# 2. Create Giotto object & process data
-
-
-```{r, eval=FALSE}
-## create
-osm_test <- createGiottoObject(expression = expr_path,
- spatial_locs = loc_path,
- instructions = instrs)
-
-## add field annotation
-metadata = data.table::fread(file = meta_path)
-osm_test = addCellMetadata(osm_test, new_metadata = metadata,
- by_column = T, column_cell_ID = 'CellID')
-## filter
-osm_test <- filterGiotto(
- gobject = osm_test,
- expression_threshold = 1,
- feat_det_in_min_cells = 10,
- min_det_feats_per_cell = 10,
- expression_values = c('raw'),
- verbose = TRUE
-)
-
-## normalize Giotto
-## there are two ways for osmFISH object
-
-# 1. standard z-score way
-osm_test <- normalizeGiotto(gobject = osm_test)
-
-# 2. osmFISH way
-raw_expr_matrix <- getExpression(osm_test, values = "raw", output = "matrix")
-norm_genes <- (raw_expr_matrix/Matrix::rowSums(raw_expr_matrix)) * nrow(raw_expr_matrix)
-
-norm_genes_cells <- Matrix::t((Matrix::t(norm_genes)/Matrix::colSums(norm_genes)) * ncol(raw_expr_matrix))
-norm_genes_cells <- Giotto::createExprObj(norm_genes_cells, name = "custom")
-osm_test <- setGiotto(osm_test, x = norm_genes_cells)
-
-## add gene & cell statistics
-osm_test <- addStatistics(gobject = osm_test)
-
-# save according to giotto instructions
-spatPlot2D(
- gobject = osm_test,
- cell_color = 'ClusterName',
- point_size = 1.3,
- save_param = list(save_name = '2_a_original_clusters')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/2_a_original_clusters.png)
-
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = osm_test,
- cell_color = 'Region',
- cell_color_code = c(
- "Excluded" = "lightsteelblue4",
- "Hippocampus" = "gold",
- "White matter" = "cyan",
- "Internal Capsule Caudoputamen" = "#9730F2",
- "Ventricle" = "green",
- "Layer 2-3 lateral" = "blue",
- "Layer 2-3 medial" = "yellowgreen",
- "Layer 3-4" = "brown",
- "Layer 4" = "orange",
- "Layer 5" = "red",
- "Layer 6" = "magenta",
- "Pia Layer 1" = "mediumturquoise"
- ),
- point_size = 1.5,
- save_param = list(save_name = '2_b_original_regions'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/2_b_original_regions.png)
-
-
-```{r, eval=FALSE}
-spatPlot2D(
- gobject = osm_test,
- cell_color = 'ClusterID',
- point_size = 1.5,
- save_param = list(save_name = '2_c_clusterID')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/2_c_clusterID.png)
-
-
-```{r, eval=FALSE}
-spatPlot2D(
- gobject = osm_test,
- cell_color = 'total_expr',
- color_as_factor = FALSE,
- point_size = 1.5,
- gradient_style = "sequential",
- gradient_midpoint = 160,
- gradient_limits = c(120,220),
- background_color = "black",
- save_param = list(save_name = '2_d_total_expr_limits')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/2_d_total_expr_limits.png)
-
-# 3. Dimension reduction
-
-
-```{r, eval=FALSE}
-## highly variable genes (HVG)
-# only 33 genes so use all genes
-
-## run PCA on expression values (default)
-osm_test <- runPCA(gobject = osm_test,
- expression_values = 'custom',
- scale_unit = F,
- center = F)
-screePlot(osm_test, ncp = 30,
- save_param = list(save_name = '3_a_screeplot'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/3_a_screeplot.png)
-
-
-```{r, eval=FALSE}
-plotPCA(osm_test,
- save_param = list(save_name = '3_b_PCA_reduction'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/3_b_PCA_reduction.png)
-
-
-```{r, eval=FALSE}
-## run UMAP and tSNE on PCA space (default)
-osm_test <- runUMAP(osm_test, dimensions_to_use = 1:31, n_threads = 4)
-plotUMAP(gobject = osm_test,
- save_param = list(save_name = '3_c_UMAP_reduction'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/3_c_UMAP_reduction.png)
-
-
-```{r, eval=FALSE}
-plotUMAP(
- gobject = osm_test,
- cell_color = 'total_expr',
- color_as_factor = FALSE,
- point_size = 2,
- gradient_style = "sequential",
- gradient_midpoint = 180,
- gradient_limits = c(120, 220),
- background_color = "black",
- save_param = list(save_name = '3_d_UMAP_reduction_expression')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/3_d_UMAP_reduction_expression.png)
-
-
-```{r, eval=FALSE}
-osm_test <- runtSNE(
- osm_test,
- dimensions_to_use = 1:31,
- perplexity = 70,
- check_duplicates = F
-)
-plotTSNE(gobject = osm_test, save_param = list(save_name = '3_e_tSNE_reduction'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/3_e_tSNE_reduction.png)
-
-# 4. Cluster
-
-
-```{r, eval=FALSE}
-## hierarchical clustering
-osm_test = doHclust(
- gobject = osm_test,
- expression_values = 'custom',
- k = 36
-)
-plotUMAP(gobject = osm_test, cell_color = 'hclust', point_size = 2.5,
- show_NN_network = F, edge_alpha = 0.05,
- save_param = list(save_name = '4_a_UMAP_hclust'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/4_a_UMAP_hclust.png)
-
-
-```{r, eval=FALSE}
-## kmeans clustering
-osm_test = doKmeans(
- gobject = osm_test,
- expression_values = 'normalized',
- dim_reduction_to_use = 'pca',
- dimensions_to_use = 1:20,
- centers = 36,
- nstart = 2000
-)
-plotUMAP(gobject = osm_test, cell_color = 'kmeans',
- point_size = 2.5, show_NN_network = F, edge_alpha = 0.05,
- save_param = list(save_name = '4_b_UMAP_kmeans'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/4_b_UMAP_kmeans.png)
-
-
-```{r, eval=FALSE}
-## Leiden clustering strategy:
-# 1. overcluster
-# 2. merge small clusters that are highly similar
-
-# sNN network (default)
-osm_test <- createNearestNetwork(gobject = osm_test, dimensions_to_use = 1:31, k = 12)
-
-osm_test <- doLeidenCluster(gobject = osm_test, resolution = 0.09, n_iterations = 1000)
-plotUMAP(gobject = osm_test, cell_color = 'leiden_clus', point_size = 2.5,
- show_NN_network = F, edge_alpha = 0.05,
- save_param = list(save_name = '4_c_UMAP_leiden'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/4_c_UMAP_leiden.png)
-
-
-```{r, eval=FALSE}
-# merge small groups based on similarity
-leiden_similarities = getClusterSimilarity(osm_test,
- expression_values = 'custom',
- cluster_column = 'leiden_clus')
-
-osm_test = mergeClusters(osm_test,
- expression_values = 'custom',
- cluster_column = 'leiden_clus',
- new_cluster_name = 'leiden_clus_m',
- max_group_size = 30,
- force_min_group_size = 25,
- max_sim_clusters = 10,
- min_cor_score = 0.7)
-
-plotUMAP(gobject = osm_test, cell_color = 'leiden_clus_m', point_size = 2.5,
- show_NN_network = F, edge_alpha = 0.05,
- save_param = list(save_name = '4_d_UMAP_leiden_merged'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/4_d_UMAP_leiden_merged.png)
-
-
-```{r, eval=FALSE}
-## show cluster relationships
-showClusterHeatmap(gobject = osm_test, expression_values = 'custom', cluster_column = 'leiden_clus_m',
- save_param = list(save_name = '4_e_heatmap', units = 'cm'),
- row_names_gp = grid::gpar(fontsize = 6), column_names_gp = grid::gpar(fontsize = 6))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/4_e_heatmap.png)
-
-
-```{r, eval=FALSE}
-showClusterDendrogram(osm_test, cluster_column = 'leiden_clus_m', h = 1, rotate = T,
- save_param = list(save_name = '4_f_dendro', units = 'cm'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/4_f_dendro.png)
-
-# 5. Co-visualize
-
-
-```{r, eval=FALSE}
-# expression and spatial
-spatDimPlot2D(
- gobject = osm_test,
- cell_color = 'leiden_clus',
- spat_point_size = 2,
- plot_alignment = 'horizontal',
- save_param = list(save_name = '5_a_covis_leiden')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/5_a_covis_leiden.png)
-
-
-```{r, eval=FALSE}
-spatDimPlot2D(
- gobject = osm_test,
- cell_color = 'leiden_clus_m',
- spat_point_size = 2,
- plot_alignment = 'horizontal',
- save_param = list(save_name = '5_b_covis_leiden_m')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/5_b_covis_leiden_m.png)
-
-
-```{r, eval=FALSE}
-spatDimPlot2D(
- gobject = osm_test,
- cell_color = 'leiden_clus_m',
- dim_point_size = 2,
- spat_point_size = 2,
- select_cell_groups = '29',
- plot_alignment = 'horizontal',
- save_param = list(save_name = '5_c_covis_leiden_merged_selected')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/5_c_covis_leiden_merged_selected.png)
-
-
-```{r, eval=FALSE}
-spatDimPlot2D(
- gobject = osm_test,
- cell_color = 'total_expr',
- color_as_factor = FALSE,
- dim_point_shape = "no_border",
- spat_point_shape = "no_border",
- dim_point_size = 0.4,
- spat_point_size = 0.4,
- dim_background_color = "black",
- spat_background_color = "black",
- gradient_style = "sequential",
- gradient_midpoint = 160,
- gradient_limits = c(120,220),
- plot_alignment = 'horizontal',
- save_param = list(save_name = '5_d_total_expr')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/5_d_total_expr.png)
-
-# 6. Differential expression
-
-
-```{r, eval=FALSE}
-## split dendrogram nodes ##
-dendsplits = getDendrogramSplits(gobject = osm_test,
- expression_values = 'custom',
- cluster_column = 'leiden_clus_m')
-split_3_markers = findMarkers(
- gobject = osm_test,
- method = 'gini',
- expression_values = 'custom',
- cluster_column = 'leiden_clus_m',
- group_1 = unlist(dendsplits[3]$tree_1),
- group_2 = unlist(dendsplits[3]$tree_2)
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/6_a_dendrogram.png)
-
-
-```{r, eval=FALSE}
-## Individual populations ##
-markers = findMarkers_one_vs_all(gobject = osm_test,
- method = 'scran',
- expression_values = 'custom',
- cluster_column = 'leiden_clus_m',
- min_feats = 2, rank_score = 2)
-## violinplot
-topgenes = markers[, head(.SD, 1), by = 'cluster']$feats
-violinPlot(osm_test, feats = unique(topgenes), cluster_column = 'leiden_clus_m', expression_values = 'custom',
- strip_text = 5, strip_position = 'right',
- save_param = list(save_name = '6_a_violinplot'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/6_a_violinplot.png)
-
-
-```{r, eval=FALSE}
-plotMetaDataHeatmap(osm_test, expression_values = 'custom',
- metadata_cols = c('leiden_clus_m'),
- save_param = list(save_name = '6_b_metaheatmap'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/6_b_metaheatmap.png)
-
-
-```{r, eval=FALSE}
-plotMetaDataHeatmap(osm_test, expression_values = 'custom',
- metadata_cols = c('leiden_clus_m'),
- save_param = list(save_name = '6_e_metaheatmap_all_genes'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/6_e_metaheatmap_all_genes.png)
-
-
-```{r, eval=FALSE}
-plotMetaDataHeatmap(osm_test, expression_values = 'custom',
- metadata_cols = c('ClusterName'),
- save_param = list(save_name = '6_f_metaheatmap_all_genes_names'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/6_f_metaheatmap_all_genes_names.png)
-
-# 7. Cell type annotation
-
-Use [annotateGiotto()](http://giottosuite.com/reference/annotateGiotto.html) to annotate the clusters. For this dataset, we have ClusterName in the metadata.
-
-# 8. Spatial grid
-
-
-```{r, eval=FALSE}
-osm_test <- createSpatialGrid(gobject = osm_test,
- sdimx_stepsize = 2000,
- sdimy_stepsize = 2000,
- minimum_padding = 0)
-spatPlot2D(
- osm_test,
- cell_color = 'ClusterName',
- show_grid = TRUE,
- grid_color = 'lightblue',
- spatial_grid_name = 'spatial_grid',
- point_size = 1.5,
- save_param = list(save_name = "8_grid_det_cell_types")
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/8_grid_det_cell_types.png)
-
-# 9. Spatial network
-
-
-```{r, eval=FALSE}
-osm_test <- createSpatialNetwork(gobject = osm_test)
-spatPlot2D(gobject = osm_test, show_network = T,
- network_color = 'blue',
- point_size = 1.5, cell_color = 'ClusterName', legend_symbol_size = 2,
- save_param = list(save_name = '9_spatial_network_k10'))
-```
-
-
-![](images/osmfish_mouse_ss_cortex/9_spatial_network_k10.png)
-
-# 10. Spatial genes
-
-
-```{r, eval=FALSE}
-# km binarization
-kmtest = binSpect(osm_test, calc_hub = T, hub_min_int = 5,
- bin_method = 'kmeans')
-
-spatDimFeatPlot2D(
- osm_test,
- expression_values = 'scaled',
- feats = kmtest$feats[1:3],
- plot_alignment = 'horizontal',
- spat_point_shape = "no_border",
- dim_point_shape = "no_border",
- spat_point_size = 0.1,
- dim_point_size = 0.1,
- cow_n_col = 1,
- save_param = list(save_name = '10_a_spatial_genes_km')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/10_a_spatial_genes_km.png)
-
-# 12. Cell-cell preferential proximity
-
-
-```{r, eval=FALSE}
-## calculate frequently seen proximities
-cell_proximities = cellProximityEnrichment(gobject = osm_test,
- cluster_column = 'ClusterName',
- number_of_simulations = 1000)
-## barplot
-cellProximityBarplot(
- gobject = osm_test,
- CPscore = cell_proximities,
- min_orig_ints = 25,
- min_sim_ints = 25,
- save_param = list(save_name = '12_a_barplot_cell_cell_enrichment')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/12_a_barplot_cell_cell_enrichment.png)
-
-
-```{r, eval=FALSE}
-## heatmap
-cellProximityHeatmap(
- gobject = osm_test,
- CPscore = cell_proximities,
- order_cell_types = T,
- scale = T,
- color_breaks = c(-1.5, 0, 1.5),
- color_names = c('blue', 'white', 'red'),
- save_param = list(save_name = '12_b_heatmap_cell_cell_enrichment',
- unit = 'in')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/12_b_heatmap_cell_cell_enrichment.png)
-
-
-```{r, eval=FALSE}
-## network
-cellProximityNetwork(
- gobject = osm_test,
- CPscore = cell_proximities,
- remove_self_edges = F,
- only_show_enrichment_edges = T,
- save_param = list(save_name = '12_c_network_cell_cell_enrichment')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/12_c_network_cell_cell_enrichment.png)
-
-
-```{r, eval=FALSE}
-## visualization
-spec_interaction = "Astrocyte_Mfge8--Oligodendrocyte_Precursor_cells"
-cellProximitySpatPlot(
- gobject = osm_test,
- interaction_name = spec_interaction,
- cluster_column = 'ClusterName',
- cell_color = 'ClusterName',
- cell_color_code = c('Astrocyte_Mfge8' = 'blue',
- 'Oligodendrocyte_Precursor_cells' = 'red'),
- coord_fix_ratio = 0.5,
- point_size_select = 3,
- point_size_other = 1.5,
- save_param = list(save_name = '12_d_cell_cell_enrichment_selected')
-)
-```
-
-
-![](images/osmfish_mouse_ss_cortex/12_d_cell_cell_enrichment_selected.png)
-
-## 13. Session Info
-```
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Ventura 13.4
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] Giotto_4.0.2 testthat_3.2.0 GiottoData_0.2.6.3 GiottoClass_0.1.3
-[5] GiottoUtils_0.1.3
-
-loaded via a namespace (and not attached):
- [1] fs_1.6.3 matrixStats_1.2.0 bitops_1.0-7
- [4] devtools_2.4.5 httr_1.4.7 RColorBrewer_1.1-3
- [7] doParallel_1.0.17 profvis_0.3.8 tools_4.3.2
- [10] backports_1.4.1 utf8_1.2.4 R6_2.5.1
- [13] DT_0.31 lazyeval_0.2.2 uwot_0.1.16
- [16] GetoptLong_1.0.5 urlchecker_1.0.1 withr_2.5.2
- [19] prettyunits_1.2.0 gridExtra_2.3 progressr_0.14.0
- [22] cli_3.6.2 Biobase_2.62.0 textshaping_0.3.7
- [25] factoextra_1.0.7 Cairo_1.6-2 flashClust_1.01-2
- [28] labeling_0.4.3 mvtnorm_1.2-4 arrow_13.0.0.1
- [31] systemfonts_1.0.5 dbscan_1.1-12 scater_1.30.1
- [34] sessioninfo_1.2.2 limma_3.58.1 rstudioapi_0.15.0
- [37] FNN_1.1.3.2 generics_0.1.3 shape_1.4.6
- [40] gtools_3.9.5 dplyr_1.1.4 dendextend_1.17.1
- [43] leaps_3.1 Matrix_1.6-3 ggbeeswarm_0.7.2
- [46] fansi_1.0.6 S4Vectors_0.40.2 abind_1.4-5
- [49] terra_1.7-55 lifecycle_1.0.4 scatterplot3d_0.3-44
- [52] yaml_2.3.8 edgeR_4.0.2 SummarizedExperiment_1.32.0
- [55] SparseArray_1.2.3 Rtsne_0.17 grid_4.3.2
- [58] promises_1.2.1 dqrng_0.3.2 crayon_1.5.2
- [61] miniUI_0.1.1.1 lattice_0.22-5 beachmat_2.18.0
- [64] cowplot_1.1.2 magick_2.8.2 pillar_1.9.0
- [67] knitr_1.45 ComplexHeatmap_2.18.0 metapod_1.10.0
- [70] GenomicRanges_1.54.1 rjson_0.2.21 estimability_1.4.1
- [73] pak_0.7.1 codetools_0.2-19 glue_1.7.0
- [76] data.table_1.14.10 remotes_2.4.2.1 vctrs_0.6.5
- [79] png_0.1-8 gtable_0.3.4 assertthat_0.2.1
- [82] cachem_1.0.8 xfun_0.41 S4Arrays_1.2.0
- [85] mime_0.12 tidygraph_1.2.3 SingleCellExperiment_1.24.0
- [88] iterators_1.0.14 statmod_1.5.0 bluster_1.12.0
- [91] ellipsis_0.3.2 ArchR_1.0.2 usethis_2.2.2
- [94] bit64_4.0.5 RcppAnnoy_0.0.21 GenomeInfoDb_1.38.1
- [97] rprojroot_2.0.4 irlba_2.3.5.1 vipor_0.4.7
-[100] colorspace_2.1-0 BiocGenerics_0.48.1 tidyselect_1.2.0
-[103] processx_3.8.2 emmeans_1.8.9 bit_4.0.5
-[106] compiler_4.3.2 BiocNeighbors_1.20.0 desc_1.4.2
-[109] ggdendro_0.1.23 DelayedArray_0.28.0 plotly_4.10.3
-[112] checkmate_2.3.1 scales_1.3.0 multinet_4.1.2
-[115] callr_3.7.3 multcompView_0.1-9 stringr_1.5.1
-[118] SpatialExperiment_1.12.0 digest_0.6.34 rmarkdown_2.25
-[121] XVector_0.42.0 htmltools_0.5.7 GiottoVisuals_0.1.5
-[124] pkgconfig_2.0.3 sparseMatrixStats_1.14.0 MatrixGenerics_1.14.0
-[127] FactoMineR_2.9 fastmap_1.1.1 rlang_1.1.3
-[130] GlobalOptions_0.1.2 htmlwidgets_1.6.4 shiny_1.8.0
-[133] DelayedMatrixStats_1.24.0 farver_2.1.1 jsonlite_1.8.8
-[136] BiocParallel_1.36.0 BiocSingular_1.18.0 RCurl_1.98-1.13
-[139] magrittr_2.0.3 scuttle_1.12.0 GenomeInfoDbData_1.2.11
-[142] munsell_0.5.0 Rcpp_1.0.12 viridis_0.6.4
-[145] reticulate_1.34.0 stringi_1.8.3 ggraph_2.1.0
-[148] brio_1.1.3 zlibbioc_1.48.0 MASS_7.3-60
-[151] plyr_1.8.9 pkgbuild_1.4.2 parallel_4.3.2
-[154] ggrepel_0.9.5 deldir_2.0-2 graphlayouts_1.0.2
-[157] circlize_0.4.15 locfit_1.5-9.8 colorRamp2_0.1.0
-[160] ps_1.7.5 clustree_0.5.1 igraph_1.6.0
-[163] reshape2_1.4.4 stats4_4.3.2 ScaledMatrix_1.10.0
-[166] pkgload_1.3.3 evaluate_0.23 scran_1.30.2
-[169] foreach_1.5.2 tweenr_2.0.2 httpuv_1.6.13
-[172] tidyr_1.3.0 purrr_1.0.2 polyclip_1.10-6
-[175] clue_0.3-65 ggplot2_3.4.4 ggforce_0.4.1
-[178] rsvd_1.0.5 xtable_1.8-4 later_1.3.2
-[181] viridisLite_0.4.2 ragg_1.2.6 tibble_3.2.1
-[184] memoise_2.0.1 beeswarm_0.4.0 IRanges_2.36.0
-[187] cluster_2.1.4
-```
diff --git a/vignettes/presentations.Rmd b/vignettes/presentations.Rmd
deleted file mode 100644
index de6231368..000000000
--- a/vignettes/presentations.Rmd
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: "Presentations"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Presentations}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# BioC 2023
-
-[![](images/presentations/bioc-giotto-pres.png){.align-center}](https://www.youtube.com/watch?v=vJhZtfTDK9I)
-
-# The Visualization and User Experience Seminars, November 21st 2023
-
-[![](images/presentations/vues2023.png)](https://www.dropbox.com/scl/fi/z97wixwv7eksnehazn6qu/20231121_VUES.mp4?rlkey=22f5hxje1eicktcexkm4vfozb&dl=1){.align-center}
-
-
diff --git a/vignettes/resolve_biosciences.Rmd b/vignettes/resolve_biosciences.Rmd
deleted file mode 100644
index d29826625..000000000
--- a/vignettes/resolve_biosciences.Rmd
+++ /dev/null
@@ -1,481 +0,0 @@
----
-title: "Resolve Bioscience Breast Cancer Subcellular"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Resolve Bioscience Breast Cancer Subcellular}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure GiottoData, a small, helper module for tutorials, is installed.
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-# Start Giotto
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-# 1. set working directory
-my_working_dir = '/path/to/directory'
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-```
-
-# Input Files
-
-```{r, eval=FALSE}
-## provide path to resolve bioscience folder
-data_path = '/path/to/Resolve_bioscience_cancer'
-
-
-# 1. original image as png
-original_DAPI_image = paste0(data_path, '/', 'sample2_DAPI.jpg')
-
-# 2. input cell segmentation as mask file
-# can also be provided as a 3-column polygon file
-# to be used as image background AND to store segmentations as polygons
-# can be obtained through Fiji / QuPath / Ilastik / Cellpose / ...
-segmentation_mask = paste0(data_path, '/', 'Mask3.png')
-
-# 3. input features coordinates
-tx_coord = fread(paste0(data_path, '/', 'data_sample2.txt'))
-colnames(tx_coord) = c('x', 'y', 'z', 'gene_id')
-tx_coord = tx_coord[,.(x, y, gene_id)]
-```
-
-# 1. Create Subcellular Giotto Object
-
-```{r, eval=FALSE}
-testobj = createGiottoObjectSubcellular(gpoints = list('rna' = tx_coord),
- gpolygons = list('cell' = segmentation_mask),
- instructions = instrs,
- verbose = FALSE,
- cores = 32)
-```
-
-# 2. Create Spatial Locations
-
-```{r, eval=FALSE}
-# centroids are now used to provide the spatial locations (centroid of each cell)
-# needed for certain downstream spatial analyses
-testobj = addSpatialCentroidLocations(testobj,
- poly_info = 'cell')
-```
-
-# 3. Add Image Information
-
-```{r, eval=FALSE}
-# create Giotto images
-DAPI_image = createGiottoImage(gobject = testobj,
- name = 'DAPI',
- do_manual_adj = T,
- xmax_adj = 0,ymax_adj = 0,
- xmin_adj = 0,ymin_adj = 0,
- image_transformations = 'flip_x_axis',
- mg_object = original_DAPI_image)
-
-segm_image = createGiottoImage(gobject = testobj,
- name = 'segmentation',
- do_manual_adj = T,
- xmax_adj = 0,ymax_adj = 0,
- xmin_adj = 0,ymin_adj = 0,
- image_transformations = 'flip_x_axis',
- mg_object = segmentation_mask)
-
-# add images to Giotto object
-testobj = addGiottoImage(testobj,
- images = list(DAPI_image, segm_image))
-
-# provides an overview of available images
-showGiottoImageNames(testobj)
-```
-
-# 4. Visualize Original Images
-
-```{r, eval=FALSE}
-# visualize overlay of calculated cell centroid with original image and segmentation mask file
-# by setting show_plot to FALSE and save_plot to TRUE you can save quite some time when creating plots
-# with big images it sometimes takes quite long for R/Rstudio to render them
-spatPlot2D(gobject = testobj,
- image_name = 'DAPI',
- point_size = 1.5)
-```
-
-![](images/resolve_biosciences/0-spatPlot2D.png)
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = testobj,
- image_name = 'segmentation',
- point_size = 1.5)
-```
-
-![](images/resolve_biosciences/1-spatPlot2D.png)
-
-# 5. Calculate Cell Shape Overlap
-
-```{r, eval=FALSE}
-tictoc::tic()
-testobj = calculateOverlap(testobj,
- method = 'parallel',
- x_step = 1000,
- y_step = 1000,
- poly_info = 'cell',
- feat_info = 'rna')
-tictoc::toc()
-#convert overlap to matrix
-testobj = overlapToMatrix(testobj,
- poly_info = 'cell',
- feat_info = 'rna',
- name = 'raw')
-```
-
-# 6. Filter Data
-
-```{r, eval=FALSE}
-# features can be filtered individually
-# cells will be filtered across features
-
-# first filter on rna
-subc_test <- filterGiotto(gobject = testobj,
- expression_threshold = 1,
- feat_det_in_min_cells = 20,
- min_det_feats_per_cell = 5)
-
-spatPlot2D(gobject = subc_test,
- image_name = 'segmentation', show_image = TRUE,
- point_size = 1.5)
-```
-
-![](images/resolve_biosciences/69-spatPlot2D.png)
-
-# 7. Process Giotto Object
-
-```{r, eval=FALSE}
-# rna data, default.
-# other feature modalities can be processed and filtered in an anologous manner
-subc_test <- normalizeGiotto(gobject = subc_test,
- scalefactor = 6000,
- verbose = T)
-subc_test <- addStatistics(gobject = subc_test)
-subc_test <- adjustGiottoMatrix(gobject = subc_test,
- expression_values = c('normalized'),
- covariate_columns = c('nr_feats', 'total_expr'))
-
-subc_test <- normalizeGiotto(gobject = subc_test, norm_methods = 'pearson_resid', update_slot = 'pearson')
-showGiottoExpression(subc_test)
-```
-
-# 8. Dimension Reduction
-
-```{r, eval=FALSE}
-# Find highly valuable Features
-
-# typical way of calculating HVF
-subc_test <- calculateHVF(gobject = subc_test, HVFname= 'hvg_orig')
-```
-
-![](images/resolve_biosciences/4-HVFplot.png)
-
-```{r, eval=FALSE}
-# new method based on variance of pearson residuals for each gene
-subc_test <- calculateHVF(gobject = subc_test,
- method = 'var_p_resid',
- expression_values = 'pearson',
- show_plot = T)
-```
-
-![](images/resolve_biosciences/5-HVFplot.png)
-
-```{r, eval=FALSE}
-#run PCA
-subc_test <- runPCA(gobject = subc_test,
- expression_values = 'pearson',
- scale_unit = F, center = F)
-
-screePlot(subc_test, ncp = 20)
-```
-
-![](images/resolve_biosciences/6-screePlot.png)
-
-```{r, eval=FALSE}
-plotPCA(subc_test,
- dim1_to_use = 1,
- dim2_to_use = 2)
-```
-
-![](images/resolve_biosciences/7-PCA.png)
-
-```{r, eval=FALSE}
-# run UMAP
-subc_test <- runUMAP(subc_test,
- dimensions_to_use = 1:5,
- n_threads = 2)
-plotUMAP(gobject = subc_test)
-```
-
-![](images/resolve_biosciences/8-UMAP.png)
-
-# 9. Cluster
-
-```{r, eval=FALSE}
-subc_test <- createNearestNetwork(gobject = subc_test,
- dimensions_to_use = 1:5,
- k = 5)
-subc_test <- doLeidenCluster(gobject = subc_test,
- resolution = 0.05,
- n_iterations = 1000,
- name = 'leiden_0.05')
-
-# Create color palettes, or proceed with Giotto defaults
-devtools::install_github("alyssafrazee/RSkittleBrewer")
-colorcode = lacroix_palette(type = "paired")
-featcolor = lacroix_palette("KeyLime", type = "discrete")
-
-# visualize UMAP cluster results
-plotUMAP(gobject = subc_test,
- cell_color = 'leiden_clus',
- show_NN_network = T,
- point_size = 2.5,
- cell_color_code = colorcode)
-```
-
-![](images/resolve_biosciences/39-UMAP.png)
-
-```{r, eval=FALSE}
-# visualize UMAP and spatial results
-spatDimPlot2D(gobject = subc_test,
- show_image = T,
- image_name = 'segmentation',
- cell_color = 'leiden_clus',
- spat_point_size = 2,
- cell_color_code = colorcode)
-```
-
-![](images/resolve_biosciences/51-spatDimPlot2D.png)
-
-```{r, eval=FALSE}
-# Plot a cluster heatmap
-showClusterHeatmap(gobject = subc_test,
- cluster_column = 'leiden_clus',
- save_param = list(save_format = 'pdf',base_height = 6, base_width = 8, units = 'cm'))
-```
-
-![](images/resolve_biosciences/72-Heatmap.png)
-
-```{r, eval=FALSE}
-# See cluster relationships in a dendogram
-showClusterDendrogram(subc_test,
- h = 0.5,
- rotate = T,
- cluster_column = 'leiden_clus')
-```
-
-![](images/resolve_biosciences/12-showClusterDendrogram.png)
-
-# 10. Create a Spatial Network
-
-```{r, eval=FALSE}
-subc_test = createSpatialNetwork(gobject = subc_test,
- spat_loc_name = 'cell',
- minimum_k = 3,
- maximum_distance_delaunay = 100)
-
-spatPlot2D(gobject = subc_test,
- image_name = 'segmentation',
- show_image = TRUE,
- point_size = 1.5,
- show_network = TRUE)
-```
-
-![](images/resolve_biosciences/13-spatPlot2D.png)
-
-# 11. Visualize SubCellular Data
-
-```{r, eval=FALSE}
-# Visualize clustered cells
-spatInSituPlotPoints(subc_test,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'white',
- polygon_line_size = 0.1,
- polygon_fill = 'leiden_clus',
- polygon_fill_as_factor = T ,
- polygon_fill_code = colorcode)
-```
-
-![](images/resolve_biosciences/54-spatInSituPlotPoints.png)
-
-```{r, eval=FALSE}
-# individual plotting of transcripts and polygon information
-
-# all cells
-spatInSituPlotPoints(testobj,
- feats = list('rna' = c("MMP2", "VEGFA", "IGF1R", 'CDH2', 'MKI67')),
- point_size = 0.2,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'white',
- polygon_line_size = 0.1)
-```
-
-![](images/resolve_biosciences/16-spatInSituPlotPoints.png)
-
-```{r, eval=FALSE}
-# filtered cells
-spatInSituPlotPoints(subc_test,
- feats = list('rna' = c("MMP2", "VEGFA", "IGF1R", 'CDH2', 'MKI67')),
- point_size = 0.2,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'white',
- polygon_line_size = 0.1)
-```
-
-![](images/resolve_biosciences/17-spatInSituPlotPoints.png)
-
-```{r, eval=FALSE}
-# faster plotting method if you have many points
-spatInSituPlotPoints(subc_test,
- plot_method = 'scattermore',
- feats = list('rna' = c("MMP2", "VEGFA", "IGF1R", 'CDH2', 'MKI67')),
- point_size = 0.2,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'white',
- polygon_line_size = 0.1)
-```
-
-![](images/resolve_biosciences/18-spatInSituPlotPoints.png)
-
-## 11.1 Subset by Location
-
-```{r, eval=FALSE}
-# can be used to focus on specific spatial structures
-# to zoom in on niche environments
-
-subloc = subsetGiottoLocs(subc_test,
- x_min = 0, x_max = 2000,
- y_min = 0, y_max = 2000,
- poly_info = 'cell')
-
-# show subset of genes
-spatInSituPlotPoints(subloc,
- feats = list('rna' = c("MMP2", "VEGFA", "IGF1R", 'CDH2', 'MKI67')),
- point_size = 0.6,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'white',
- polygon_line_size = 0.1)
-```
-
-![](images/resolve_biosciences/19-spatInSituPlotPoints.png)
-
-```{r, eval=FALSE}
-# show subset of genes and color cells according to clusters
-spatInSituPlotPoints(subloc,
- feats = list('rna' = c("MMP2", "VEGFA", "IGF1R", 'CDH2', 'MKI67')),
- point_size = 0.6,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'white',
- polygon_line_size = 0.1,
- polygon_fill = 'leiden_clus',
- polygon_fill_as_factor = T,
- polygon_fill_code = colorcode,
- feats_color_code = featcolor)
-```
-
-![](images/resolve_biosciences/21-spatInSituPlotPoints.png)
-
-```{r, eval=FALSE}
-# show subset of genes and color cells according to total expression
-# use a faster and more efficient point plotting method = scattermore
-spatInSituPlotPoints(subloc,
- plot_method = 'scattermore',
- feats = list('rna' = c("MMP2", "VEGFA", "IGF1R", 'CDH2', 'MKI67')),
- point_size = 0.6,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'white',
- polygon_line_size = 0.1,
- polygon_fill = 'total_expr',
- polygon_fill_as_factor = F)
-```
-
-![](images/resolve_biosciences/61-spatInSituPlotPoints.png)
-
-```{r, eval=FALSE}
-# show cells and color them according to total expression
-spatInSituPlotPoints(subloc,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'white',
- polygon_line_size = 0.1,
- polygon_fill = 'total_expr',
- polygon_fill_as_factor = F)
-```
-
-![](images/resolve_biosciences/22-spatInSituPlotPoints.png)
-
-```{r, eval=FALSE}
-# show cells and color them according to total cluster information
-spatInSituPlotPoints(subloc,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'white',
- polygon_line_size = 0.1,
- polygon_fill = 'leiden_clus',
- polygon_fill_as_factor = T,
- polygon_fill_code = colorcode)
-```
-
-![](images/resolve_biosciences/66-spatInSituPlotPoints.png)
-
-# 12. Find Interaction Changed Features
-
-```{r, eval=FALSE}
-# find interaction changed Features
-# In this case, features are genes whose expression difference is associated with a neighboring cell type
-future::plan('multisession', workers = 4) # sometimes unstable, restart R session
-
-test = findInteractionChangedFeats(gobject = subc_test,
- cluster_column = 'leiden_clus')
-
-test$ICFscores[type_int == 'hetero']
-
-spatInSituPlotPoints(subc_test,
- feats = list('rna' = c("CTSD", "BMP1")),
- point_size = 0.6,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'black',
- polygon_line_size = 0.1,
- polygon_fill = 'leiden_clus',
- polygon_fill_as_factor = T,
- polygon_fill_code = colorcode,
- feats_color_code = featcolor)
-```
-
-![](images/resolve_biosciences/43-spatInSituPlotPoints.png)
diff --git a/vignettes/saving_object.Rmd b/vignettes/saving_object.Rmd
deleted file mode 100644
index 0bce034b6..000000000
--- a/vignettes/saving_object.Rmd
+++ /dev/null
@@ -1,245 +0,0 @@
----
-title: "Saving your analysis"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Saving your analysis}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-# 1. Tutorial explanation
-
-Giotto objects contain certain objects that act as pointers to the data that they reference or pull from. While this can help with lowering the amount of memory needed and decrease load times, pointer objects do not save and reload properly when using `saveRDS()` and `readRDS()`.
-
-Giotto instead implements the `saveGiotto()` and `loadGiotto()` functions that collects all the data attached to the object and saves it in a standalone manner. These functions will be demonstrated using a small subset of the Vizgen mouse brain dataset that is easily available through the **GiottoData** package.
-
-# 2. Start Giotto
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-library(Giotto)
-
-# Ensure Giotto Data is installed
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-library(GiottoData)
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- installGiottoEnvironment()
-}
-```
-
-
-# 3. Create a Giotto object
-
-
-```{r, eval=FALSE}
-vizgen = loadGiottoMini(dataset = 'vizgen')
-```
-
-```{r, eval=FALSE}
- [1] "/Library/Frameworks/R.framework/Versions/4.2/Resources/library/GiottoData//Mini_datasets/Vizgen/VizgenObject//Features/rna_feature_spatVector.shp"
- [1] "rna"
- [1] "aggregate_spatInfo_spatVector.shp" "z0_spatInfo_spatVector.shp"
- [3] "z1_spatInfo_spatVector.shp"
- [1] "aggregate_spatInfo_spatVectorCentroids.shp"
- [2] "z0_spatInfo_spatVectorCentroids.shp"
- [3] "z1_spatInfo_spatVectorCentroids.shp"
- [1] "rna_aggregate_spatInfo_spatVectorOverlaps.shp"
- [2] "rna_z0_spatInfo_spatVectorOverlaps.shp"
- [3] "rna_z1_spatInfo_spatVectorOverlaps.shp"
- [1] "poly_ID" "feat_ID" "feat_ID_uniq" "stack"
- [1] "poly_ID" "feat_ID" "feat_ID_uniq"
- [1] "poly_ID" "feat_ID" "feat_ID_uniq"
-
-```
-
-# 4. Show Existing Info
-
-Many analyses were first performed on this mini object to fill it out before it was saved using `saveGiotto()`. Returning the object gives an overview of its contents.
-
-
-```{r, eval=FALSE}
-vizgen
-```
-
-```{r, eval=FALSE}
- An object of class giotto
- >Active spat_unit: z0
- >Active feat_type: rna
- [SUBCELLULAR INFO]
- polygons : z0 z1 aggregate
- features : rna
- [AGGREGATE INFO]
- expression -----------------------
- [z0][rna] raw
- [z1][rna] raw
- [aggregate][rna] raw normalized scaled pearson
- spatial locations ----------------
- [z0] raw
- [z1] raw
- [aggregate] raw
- spatial networks -----------------
- [aggregate] Delaunay_network kNN_network
- dim reduction --------------------
- [aggregate][rna] pca umap tsne
- nearest neighbor networks --------
- [aggregate][rna] sNN.pca
- attached images ------------------
- giottoLargeImage : 4 items...
-
-
- Use objHistory() to see steps and params used
-
-```
-
-The object also functions as expected. Here we first set the active spatial unit as 'aggregate' and then plot the saved leiden clustering results.
-
-
-```{r, eval=FALSE}
-activeSpatUnit(vizgen) = 'aggregate'
-spatPlot2D(vizgen,
- show_image = TRUE,
- cell_color = 'leiden_clus',
- largeImage_name = 'dapi_z0',
- point_alpha = 0.5)
-```
-
-![](images/saving_object/unnamed-chunk-4-1.png)
-
-
-
-# 5. Saving the Object
-
-To save the object, most important inputs are the object to be saved, a directory in which to place the saved object, and the actual folder within that directory to contain Giotto's files.
-
-The dir param defaults to the working directory, but here I am specifying for the object to be saved to a temporary directory.
-
-
-```{r, eval=FALSE}
-saveGiotto(gobject = vizgen,
- dir = tempdir(),
- foldername = 'vizgen')
-```
-
-
-# 6. Faster Saving with `qs`
-
-`saveGiotto()` defaults to using `saveRDS()` for its main files, but `qs` implements faster read and write functions for serialization. Saving using `qs` is done by passing the param `method = 'qs'`.
-
-Note that `qs` is an additional package that is not installed by default with Giotto but it can be installed with `install.packages(qs)`.
-
-# 7. Loading the Object
-
-To load the object, only the path to the folder is needed. Additional params of interest are:
-
-- `reconnect_giottoImage` -instead of reading from the saved images in the folder- attempts to reconnect the pointer objects based on filepaths that were recorded. This requires that the Giotto object is being loaded on the same system it was generated on and that those images have not been moved.
-- `python_path` allows a new python path to be set during loading.
-
-
-```{r, eval=FALSE}
-test_vizgen = loadGiotto(path_to_folder = file.path(tempdir(), 'vizgen'))
-```
-
-
-
-```{r, eval=FALSE}
-test_vizgen
-```
-
-```{r, eval=FALSE}
- An object of class giotto
- >Active spat_unit: aggregate
- >Active feat_type: rna
- [SUBCELLULAR INFO]
- polygons : z0 z1 aggregate
- features : rna
- [AGGREGATE INFO]
- expression -----------------------
- [z0][rna] raw
- [z1][rna] raw
- [aggregate][rna] raw normalized scaled pearson
- spatial locations ----------------
- [z0] raw
- [z1] raw
- [aggregate] raw
- spatial networks -----------------
- [aggregate] Delaunay_network kNN_network
- dim reduction --------------------
- [aggregate][rna] pca umap tsne
- nearest neighbor networks --------
- [aggregate][rna] sNN.pca
- attached images ------------------
- giottoLargeImage : 4 items...
-
-
- Use objHistory() to see steps and params used
-```
-
-
-
-```{r, eval=FALSE}
-activeSpatUnit(test_vizgen) = 'aggregate'
-spatPlot2D(test_vizgen,
- show_image = TRUE,
- cell_color = 'leiden_clus',
- largeImage_name = 'dapi_z0',
- point_alpha = 0.5)
-```
-
-![](images/saving_object/unnamed-chunk-8-1.png)
-
-
-
-# 8. Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
- R version 4.2.1 (2022-06-23)
- Platform: x86_64-apple-darwin17.0 (64-bit)
- Running under: macOS Big Sur ... 10.16
-
- Matrix products: default
- BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
- LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
-
- locale:
- [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
- attached base packages:
- [1] stats graphics grDevices utils datasets methods base
-
- other attached packages:
- [1] GiottoData_0.2.1 Giotto_3.2.1
-
- loaded via a namespace (and not attached):
- [1] Rcpp_1.0.10 RColorBrewer_1.1-3 pillar_1.9.0 compiler_4.2.1
- [5] tools_4.2.1 digest_0.6.31 jsonlite_1.8.4 evaluate_0.20
- [9] lifecycle_1.0.3 tibble_3.2.1 gtable_0.3.3 lattice_0.20-45
- [13] png_0.1-8 pkgconfig_2.0.3 rlang_1.1.0 igraph_1.4.1
- [17] Matrix_1.5-3 cli_3.6.1 rstudioapi_0.14 parallel_4.2.1
- [21] yaml_2.3.7 xfun_0.38 fastmap_1.1.1 terra_1.7-22
- [25] withr_2.5.0 dplyr_1.1.1 knitr_1.42 generics_0.1.3
- [29] vctrs_0.6.1 rprojroot_2.0.3 grid_4.2.1 tidyselect_1.2.0
- [33] here_1.0.1 reticulate_1.28 glue_1.6.2 data.table_1.14.8
- [37] R6_2.5.1 fansi_1.0.4 rmarkdown_2.21 farver_2.1.1
- [41] ggplot2_3.4.2 magrittr_2.0.3 scales_1.2.1 codetools_0.2-18
- [45] htmltools_0.5.5 colorspace_2.1-0 labeling_0.4.2 utf8_1.2.3
- [49] munsell_0.5.0
-
-```
diff --git a/vignettes/saving_plots.Rmd b/vignettes/saving_plots.Rmd
deleted file mode 100644
index 23e80355d..000000000
--- a/vignettes/saving_plots.Rmd
+++ /dev/null
@@ -1,247 +0,0 @@
----
-title: "Saving Plots"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Saving Plots}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-# 1. Explanation
-
-This tutorial walks through saving spatial data in plots. *Please see the* [Configuration](./configuration_04122023.html) *and* [Giotto Object](./getting_started_gobject.html) *vignettes before walking through this tutorial.*
-
-R/Posit and Giotto provide different ways to save spatial data. Here, a **giottoObject** will be created without using **giottoInstructions** so that the save parameters for plotting functions within Giotto as well as the default saving methods built into R/Posit may be emphasized here. Note that for plotting functions, all parameters available to the *save_param* argument may be found by running **showSaveParameters()**.
-
-# 2. Start Giotto
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-library(Giotto)
-
-# Ensure Giotto Data is installed
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-library(GiottoData)
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- installGiottoEnvironment()
-}
-```
-
-
-# 3. Create a Giotto object
-
-Since the focus of this vignette is saving methods, the **giottoObject** will not be created with **giottoInstructions**. See [Giotto Object](./getting_started_gobject.html) for further intuition on working with a **giottoObject** that has been provided instructions.
-
-
-```{r, eval=FALSE}
-data_directory = paste0(getwd(),'/')
-
-# Download dataset
-getSpatialDataset(dataset = 'osmfish_SS_cortex',
- directory = data_directory, method = 'wget')
-
-# Specify path to files
-osm_exprs = paste0(data_directory, "osmFISH_prep_expression.txt")
-osm_locs = paste0(data_directory, "osmFISH_prep_cell_coordinates.txt")
-meta_path = paste0(data_directory, "osmFISH_prep_cell_metadata.txt")
-
-## CREATE GIOTTO OBJECT with expression data and location data
-my_gobject = createGiottoObject(expression = osm_exprs,
- spatial_locs = osm_locs)
-
-metadata = data.table::fread(file = meta_path)
-my_gobject = addCellMetadata(my_gobject,
- new_metadata = metadata,
- by_column = T,
- column_cell_ID = 'CellID')
-```
-
-
-# 4. Standard R Save Methods
-
-Note that by default, plotting functions will return a plot object that may be saved or further manipulated. Manually save plot as a PDF in the current working directory:
-
-
-```{r, eval=FALSE}
-save_path = paste0(getwd(),'/first_plot.pdf')
-library(ggplot2)
-
-# This function serves only to ensure the following lines run consecutively.
-save_pdf_plot = function(){
- pdf(file = save_path, width = 7, height = 7)
- pl = spatPlot(my_gobject)
- dev.off()
-}
-
-save_pdf_plot()
-
-### Plot clusters, edit plot object, then save using the ggplot add-on, cowplot:
-mypl = spatPlot(gobject = my_gobject,
- cell_color = 'ClusterName')
-```
-
-
-![](images/saving_plots/unnamed-chunk-3-1.png)
-
-
-```{r, eval=FALSE}
-# Add a black background
-mypl = mypl + theme(panel.background = element_rect(fill ='black'),
- panel.grid = element_blank())
-
-# Add a legend
-mypl = mypl + guides(fill = guide_legend(override.aes = list(size=5)))
-
-# Save in the current working directory
-cowplot::save_plot(plot = mypl,
- filename = 'clusters_black.png',
- path = getwd(),
- device = png(),
- dpi = 300,
- base_height = 10,
- base_width = 10)
-
-```
-
-![](images/saving_plots/clusters_black.png)
-
-
-# 5. Save Plot Directly to the Default Folder
-
-The default save folder is the current working directory. This will be the case if instructions are not provided, or if a *save_dir* is not specified within **giottoInstructions**. See the [createGiottoInstructions documentation](http://giottosuite.com/reference/createGiottoInstructions.html) and [Giotto Object](./getting_started_gobject.html) for default
-arguments and more details.
-
-
-```{r, eval=FALSE}
-spatPlot(my_gobject,
- cell_color = 'ClusterName',
- save_plot = TRUE)
-```
-
-
-![](images/saving_plots/unnamed-chunk-4-1.png)
-
-
-
-# 6. Save plot Directly, but Overwrite Default Save Parameters
-
-In this example, assume it is desired that the plot is: - Shown in the console - Not returned as an object from the plotting function call -Saved in a subdirectory of the current working directory as a .png file with a dpi of 200, height of 9 inches, and width of 9 inches. - Saved with the file name "my_name"
-
-See [Giotto Object](./getting_started_gobject.html) for more details.
-
-Run the command **showSaveParameters()** to see all available parameters.
-
-
-```{r, eval=FALSE}
-# Specify new subdirectory name
-results_directory = 'my_subfolder/'
-
-# Plot clusters, create, and save to a new subdirectory with specifications above.
-spatPlot(my_gobject,
- cell_color = 'ClusterName',
- save_plot = TRUE,
- return_plot = FALSE,
- save_param = list(save_folder = results_directory, # Create subdirectory
- save_name = 'my_name',
- save_format = 'png',
- units = 'in',
- base_height = 9,
- base_width = 9))
-```
-
-
-![](images/saving_plots/unnamed-chunk-5-1.png)
-
-
-
-# 7. Just View the Plot
-
-See [Giotto Object](./getting_started_gobject.html) for more details.
-
-Set both *save_plot* and *return_plot* to FALSE.
-
-
-```{r, eval=FALSE}
-# Plot without saving
-spatPlot(my_gobject,
- cell_color = 'ClusterName',
- save_plot = FALSE, return_plot = FALSE, show_plot = T)
-```
-
-
-![](images/saving_plots/unnamed-chunk-6-1.png)
-
-
-
-# 8. Just save the plot (FASTEST for large datasets!)
-
-See [Giotto Object](./getting_started_gobject.html) for more details.
-
-Set show_plot and return_plot to FALSE, set save_plot to TRUE.
-
-
-```{r, eval=FALSE}
-spatPlot(my_gobject,
- cell_color = 'ClusterName',
- save_plot = TRUE,
- return_plot = FALSE,
- show_plot = FALSE,
- save_param = list(save_name = 'only_save'))
-```
-
-
-# 9. Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
-R version 4.2.2 (2022-10-31 ucrt)
-Platform: x86_64-w64-mingw32/x64 (64-bit)
-Running under: Windows 10 x64 (build 22621)
-
-Matrix products: default
-
-locale:
-[1] LC_COLLATE=English_United States.utf8
-[2] LC_CTYPE=English_United States.utf8
-[3] LC_MONETARY=English_United States.utf8
-[4] LC_NUMERIC=C
-[5] LC_TIME=English_United States.utf8
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] ggplot2_3.4.1 GiottoData_0.2.1 Giotto_3.2.1
-
-loaded via a namespace (and not attached):
-[1] Rcpp_1.0.10 RColorBrewer_1.1-3 pillar_1.9.0 compiler_4.2.2
-[5] tools_4.2.2 digest_0.6.30 jsonlite_1.8.3 evaluate_0.20
-[9] lifecycle_1.0.3 tibble_3.2.1 gtable_0.3.3 lattice_0.20-45
-[13] png_0.1-7 pkgconfig_2.0.3 rlang_1.1.0 Matrix_1.5-1
-[17] cli_3.4.1 rstudioapi_0.14 parallel_4.2.2 yaml_2.3.7
-[21] xfun_0.38 fastmap_1.1.0 terra_1.7-18 withr_2.5.0
-[25] dplyr_1.1.1 knitr_1.42 systemfonts_1.0.4 rappdirs_0.3.3
-[29] generics_0.1.3 vctrs_0.6.1 cowplot_1.1.1 grid_4.2.2
-[33] tidyselect_1.2.0 reticulate_1.26 glue_1.6.2 data.table_1.14.6
-[37] R6_2.5.1 textshaping_0.3.6 fansi_1.0.4 rmarkdown_2.21
-[41] farver_2.1.1 magrittr_2.0.3 scales_1.2.1 codetools_0.2-18
-[45] htmltools_0.5.4 colorspace_2.1-0 ragg_1.2.4 labeling_0.4.2
-[49] utf8_1.2.3 munsell_0.5.0
-
-```
diff --git a/vignettes/seqfish_cortex.Rmd b/vignettes/seqfish_cortex.Rmd
deleted file mode 100644
index baef0703e..000000000
--- a/vignettes/seqfish_cortex.Rmd
+++ /dev/null
@@ -1,699 +0,0 @@
----
-title: "SeqFish+ Mouse Cortex Example"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{SeqFish+ Mouse Cortex Example}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-# Start Giotto
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure GiottoData, a small, helper module for tutorials, is installed.
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-# Dataset Explanation
-
-Several fields - containing 100's of cells - in the mouse cortex and subventricular zone were imaged for seqFISH+. The coordinates of the cells within each field are independent of each other, so in order to visualize and process all cells together imaging fields will be stitched together by providing x and y-offset values specific to each field.
-
-These offset values are known or estimates based on the original raw
-image:
-
-![](images/seqfish_cortex/cortex_svz_location_fields.png)
-
-# Download Data
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-my_working_dir = '/path/to/directory/'
-getSpatialDataset(dataset = 'seqfish_SS_cortex', directory = my_working_dir, method = 'wget')
-```
-
-# 1. Giotto Instructions and Preparation
-
-```{r, eval=FALSE}
-# set Giotto instructions
-instrs = createGiottoInstructions(save_plot = FALSE,
- show_plot = TRUE,
- save_dir = my_working_dir,
- python_path = NULL)
-
-# create giotto object from provided paths ####
-expr_path = paste0(my_working_dir, "cortex_svz_expression.txt")
-loc_path = paste0(my_working_dir, "cortex_svz_centroids_coord.txt")
-meta_path = paste0(my_working_dir, "cortex_svz_centroids_annot.txt")
-#This dataset contains multiple field of views which need to be stitched together
-# first merge location and additional metadata
-SS_locations = data.table::fread(loc_path)
-cortex_fields = data.table::fread(meta_path)
-SS_loc_annot = data.table::merge.data.table(SS_locations, cortex_fields, by = 'ID')
-SS_loc_annot[, ID := factor(ID, levels = paste0('cell_',1:913))]
-data.table::setorder(SS_loc_annot, ID)
-# create file with offset information
-my_offset_file = data.table::data.table(field = c(0, 1, 2, 3, 4, 5, 6),
- x_offset = c(0, 1654.97, 1750.75, 1674.35, 675.5, 2048, 675),
- y_offset = c(0, 0, 0, 0, -1438.02, -1438.02, 0))
-# create a stitch file
-stitch_file = stitchFieldCoordinates(location_file = SS_loc_annot,
- offset_file = my_offset_file,
- cumulate_offset_x = T,
- cumulate_offset_y = F,
- field_col = 'FOV',
- reverse_final_x = F,
- reverse_final_y = T)
-stitch_file = stitch_file[,.(ID, X_final, Y_final)]
-stitch_file$ID <- as.character(stitch_file$ID)
-my_offset_file = my_offset_file[,.(field, x_offset_final, y_offset_final)]
-```
-
-# 2. Create Giotto object & process data
-
-```{r, eval=FALSE}
-# create Giotto object
-SS_seqfish <- createGiottoObject(expression = expr_path,
- spatial_locs = stitch_file,
- offset_file = my_offset_file,
- instructions = instrs)
-# add additional annotation if wanted
-SS_seqfish = addCellMetadata(SS_seqfish,
- new_metadata = cortex_fields,
- by_column = T,
- column_cell_ID = 'ID')
-# subset data to the cortex field of views
-cell_metadata = pDataDT(SS_seqfish)
-cortex_cell_ids = cell_metadata[FOV %in% 0:4]$cell_ID
-SS_seqfish = subsetGiotto(SS_seqfish, cell_ids = cortex_cell_ids)
-# filter
-SS_seqfish <- filterGiotto(gobject = SS_seqfish,
- expression_threshold = 1,
- feat_det_in_min_cells = 10,
- min_det_feats_per_cell = 10,
- expression_values = c('raw'),
- verbose = T)
-# normalize
-SS_seqfish <- normalizeGiotto(gobject = SS_seqfish, scalefactor = 6000, verbose = T)
-# add gene & cell statistics
-SS_seqfish <- addStatistics(gobject = SS_seqfish)
-# adjust expression matrix for technical or known variables
-SS_seqfish <- adjustGiottoMatrix(gobject = SS_seqfish, expression_values = c('normalized'),
- covariate_columns = c('nr_feats', 'total_expr'),
- return_gobject = TRUE,
- update_slot = c('custom'))
-# visualize
-spatPlot(gobject = SS_seqfish)
-```
-
-![](images/seqfish_cortex/0-spatPlot2D.png)
-
-# 3. Dimension Reduction
-
-```{r, eval=FALSE}
-## highly variable features (HVF)
-SS_seqfish <- calculateHVF(gobject = SS_seqfish)
-```
-
-![](images/seqfish_cortex/1-HVFplot.png)
-
-```{r, eval=FALSE}
-## select genes based on highly variable features and gene statistics, both found in feature (gene) metadata
-gene_metadata = fDataDT(SS_seqfish)
-featgenes = gene_metadata[hvf == 'yes' & perc_cells > 4 & mean_expr_det > 0.5]$feat_ID
-## run PCA on expression values (default)
-SS_seqfish <- runPCA(gobject = SS_seqfish, genes_to_use = featgenes, scale_unit = F, center = F)
-screePlot(SS_seqfish)
-```
-
-![](images/seqfish_cortex/2-screePlot.png)
-
-```{r, eval=FALSE}
-plotPCA(gobject = SS_seqfish)
-```
-
-![](images/seqfish_cortex/3-PCA.png)
-
-```{r, eval=FALSE}
-SS_seqfish <- runUMAP(SS_seqfish, dimensions_to_use = 1:15, n_threads = 10)
-plotUMAP(gobject = SS_seqfish)
-```
-
-![](images/seqfish_cortex/4-UMAP.png)
-
-```{r, eval=FALSE}
-SS_seqfish <- runtSNE(SS_seqfish, dimensions_to_use = 1:15)
-plotTSNE(gobject = SS_seqfish)
-```
-
-![](images/seqfish_cortex/5-tSNE.png)
-
-# 4. Cluster
-
-```{r, eval=FALSE}
-## sNN network (default)
-SS_seqfish <- createNearestNetwork(gobject = SS_seqfish,
- dimensions_to_use = 1:15,
- k = 15)
-## Leiden clustering
-SS_seqfish <- doLeidenCluster(gobject = SS_seqfish,
- resolution = 0.4,
- n_iterations = 1000)
-plotUMAP(gobject = SS_seqfish,
- cell_color = 'leiden_clus',
- show_NN_network = T,
- point_size = 2.5)
-```
-
-![](images/seqfish_cortex/6-UMAP.png)
-
-```{r, eval=FALSE}
-## Leiden subclustering for specified clusters
-SS_seqfish = doLeidenSubCluster(gobject = SS_seqfish,
- cluster_column = 'leiden_clus',
- resolution = 0.2, k_neighbors = 10,
- pca_param = list(expression_values = 'normalized', scale_unit = F),
- nn_param = list(dimensions_to_use = 1:5),
- selected_clusters = c(5, 6, 7),
- name = 'sub_leiden_clus_select')
-## set colors for clusters
-subleiden_order = c( 1.1, 2.1, 3.1, 4.1, 5.1, 5.2,
- 6.1, 6.2, 7.1, 7.2, 8.1, 9.1)
-subleiden_colors = GiottogetDistinctColors(length(subleiden_order))
-names(subleiden_colors) = subleiden_order
-plotUMAP(gobject = SS_seqfish,
- cell_color = 'sub_leiden_clus_select', cell_color_code = subleiden_colors,
- show_NN_network = T, point_size = 2.5, show_center_label = F,
- legend_text = 12, legend_symbol_size = 3)
-```
-
-![](images/seqfish_cortex/10-UMAP.png)
-
-```{r, eval=FALSE}
-## show cluster relationships
-showClusterHeatmap(gobject = SS_seqfish, cluster_column = 'sub_leiden_clus_select',
- row_names_gp = grid::gpar(fontsize = 9), column_names_gp = grid::gpar(fontsize = 9))
-```
-
-![](images/seqfish_cortex/11-showClusterHeatmap.png)
-
-The following step requires the installation of {ggdendro}.
-
-```{r, eval=FALSE}
-# install.packages('ggdendro')
-library(ggdendro)
-showClusterDendrogram(SS_seqfish, h = 0.5, rotate = T, cluster_column = 'sub_leiden_clus_select')
-```
-
-![](images/seqfish_cortex/12-showClusterDendrogram.png)
-
-# 5. Visualize Spatial and Expression Space
-
-```{r, eval=FALSE}
-# expression and spatial
-spatDimPlot(gobject = SS_seqfish, cell_color = 'sub_leiden_clus_select',
- cell_color_code = subleiden_colors,
- dim_point_size = 2, spat_point_size = 2)
-```
-
-![](images/seqfish_cortex/13-spatDimPlot2D.png)
-
-```{r, eval=FALSE}
-# selected groups and provide new colors
-groups_of_interest = c(6.1, 6.2, 7.1, 7.2)
-group_colors = c('red', 'green', 'blue', 'purple'); names(group_colors) = groups_of_interest
-spatDimPlot(gobject = SS_seqfish, cell_color = 'sub_leiden_clus_select',
- dim_point_size = 2, spat_point_size = 2,
- select_cell_groups = groups_of_interest, cell_color_code = group_colors)
-```
-
-![](images/seqfish_cortex/14-spatDimPlot2D.png)
-
-# 6. Cell Type Marker Gene Detection
-
-```{r, eval=FALSE}
-## gini
-gini_markers_subclusters = findMarkers_one_vs_all(gobject = SS_seqfish,
- method = 'gini',
- expression_values = 'normalized',
- cluster_column = 'sub_leiden_clus_select',
- min_feats = 20,
- min_expr_gini_score = 0.5,
- min_det_gini_score = 0.5)
-topgenes_gini = gini_markers_subclusters[, head(.SD, 2), by = 'cluster']
-## violin plot
-violinPlot(SS_seqfish, feats = unique(topgenes_gini$feats), cluster_column = 'sub_leiden_clus_select',
- strip_text = 8, strip_position = 'right', cluster_custom_order = unique(topgenes_gini$cluster))
-```
-
-![](images/seqfish_cortex/15-violinPlot.png)
-
-```{r, eval=FALSE}
-# cluster heatmap
-topgenes_gini2 = gini_markers_subclusters[, head(.SD, 6), by = 'cluster']
-plotMetaDataHeatmap(SS_seqfish, selected_feats = unique(topgenes_gini2$feats),
- custom_feat_order = unique(topgenes_gini2$feats),
- custom_cluster_order = unique(topgenes_gini2$cluster),
- metadata_cols = c('sub_leiden_clus_select'), x_text_size = 10, y_text_size = 10)
-```
-
-![](images/seqfish_cortex/16-plotMetaDataHeatmap.png)
-
-# 7. Cell Type Annotation
-
-```{r, eval=FALSE}
-## general cell types
-## create vector with names
-clusters_cell_types_cortex = c('L6 eNeuron', 'L4 eNeuron', 'L2/3 eNeuron', 'L5 eNeuron',
- 'Lhx6 iNeuron', 'Adarb2 iNeuron',
- 'endothelial', 'mural',
- 'OPC','Olig',
- 'astrocytes', 'microglia')
-names(clusters_cell_types_cortex) = c(1.1, 2.1, 3.1, 4.1,
- 5.1, 5.2,
- 6.1, 6.2,
- 7.1, 7.2,
- 8.1, 9.1)
-SS_seqfish = annotateGiotto(gobject = SS_seqfish, annotation_vector = clusters_cell_types_cortex,
- cluster_column = 'sub_leiden_clus_select', name = 'cell_types')
-# cell type order and colors
-cell_type_order = c('L6 eNeuron', 'L5 eNeuron', 'L4 eNeuron', 'L2/3 eNeuron',
- 'astrocytes', 'Olig', 'OPC','Adarb2 iNeuron', 'Lhx6 iNeuron',
- 'endothelial', 'mural', 'microglia')
-cell_type_colors = subleiden_colors
-names(cell_type_colors) = clusters_cell_types_cortex[names(subleiden_colors)]
-cell_type_colors = cell_type_colors[cell_type_order]
-## violin plot
-violinPlot(gobject = SS_seqfish, feats = unique(topgenes_gini$feats),
- strip_text = 7, strip_position = 'right',
- cluster_custom_order = cell_type_order,
- cluster_column = 'cell_types', color_violin = 'cluster')
-```
-
-![](images/seqfish_cortex/17-violinPlot.png)
-
-```{r, eval=FALSE}
-# co-visualization
-spatDimPlot(gobject = SS_seqfish, cell_color = 'cell_types',
- dim_point_size = 2, spat_point_size = 2, dim_show_cluster_center = F, dim_show_center_label = T)
-```
-
-![](images/seqfish_cortex/18-spatDimPlot2D.png)
-
-```{r, eval=FALSE}
-## heatmap genes vs cells
-gini_markers_subclusters[, cell_types := clusters_cell_types_cortex[cluster] ]
-gini_markers_subclusters[, cell_types := factor(cell_types, cell_type_order)]
-data.table::setorder(gini_markers_subclusters, cell_types)
-plotHeatmap(gobject = SS_seqfish,
- feats = gini_markers_subclusters[, head(.SD, 3), by = 'cell_types']$feats,
- feat_order = 'custom',
- feat_custom_order = unique(gini_markers_subclusters[, head(.SD, 3), by = 'cluster']$feats),
- cluster_column = 'cell_types', cluster_order = 'custom',
- cluster_custom_order = unique(gini_markers_subclusters[, head(.SD, 3), by = 'cell_types']$cell_types),
- legend_nrows = 2)
-```
-
-![](images/seqfish_cortex/19-plotHeatmap.png)
-
-```{r, eval=FALSE}
-plotHeatmap(gobject = SS_seqfish,
- cluster_color_code = cell_type_colors,
- feats = gini_markers_subclusters[, head(.SD, 6), by = 'cell_types']$feats,
- feat_order = 'custom',
- feat_label_selection = gini_markers_subclusters[, head(.SD, 2), by = 'cluster']$feats,
- feat_custom_order = unique(gini_markers_subclusters[, head(.SD, 6), by = 'cluster']$feats),
- cluster_column = 'cell_types', cluster_order = 'custom',
- cluster_custom_order = unique(gini_markers_subclusters[, head(.SD, 3), by = 'cell_types']$cell_types),
- legend_nrows = 2)
-```
-
-![](images/seqfish_cortex/20-plotHeatmap.png)
-
-# 8. Spatial Grid
-
-```{r, eval=FALSE}
-SS_seqfish <- createSpatialGrid(gobject = SS_seqfish,
- sdimx_stepsize = 500,
- sdimy_stepsize = 500,
- minimum_padding = 50)
-spatPlot(gobject = SS_seqfish, show_grid = T, point_size = 1.5)
-```
-
-![](images/seqfish_cortex/21-spatPlot2D.png)
-
-# 9. Spatial Network
-
-```{r, eval=FALSE}
-## delaunay network: stats + creation
-plotStatDelaunayNetwork(gobject = SS_seqfish, maximum_distance = 400, save_plot = F)
-SS_seqfish = createSpatialNetwork(gobject = SS_seqfish, minimum_k = 2, maximum_distance_delaunay = 400)
-## create spatial networks based on k and/or distance from centroid
-SS_seqfish <- createSpatialNetwork(gobject = SS_seqfish, method = 'kNN', k = 5, name = 'spatial_network')
-SS_seqfish <- createSpatialNetwork(gobject = SS_seqfish, method = 'kNN', k = 10, name = 'large_network')
-SS_seqfish <- createSpatialNetwork(gobject = SS_seqfish, method = 'kNN', k = 100,
- maximum_distance_knn = 200, minimum_k = 2, name = 'distance_network')
-## visualize different spatial networks on first field (~ layer 1)
-cell_metadata = pDataDT(SS_seqfish)
-field1_ids = cell_metadata[FOV == 0]$cell_ID
-subSS_seqfish = subsetGiotto(SS_seqfish, cell_ids = field1_ids)
-spatPlot(gobject = subSS_seqfish, show_network = T,
- network_color = 'blue', spatial_network_name = 'Delaunay_network',
- point_size = 2.5, cell_color = 'cell_types')
-```
-
-![](images/seqfish_cortex/22-spatPlot2D.png)
-
-```{r, eval=FALSE}
-spatPlot(gobject = subSS_seqfish, show_network = T,
- network_color = 'blue', spatial_network_name = 'spatial_network',
- point_size = 2.5, cell_color = 'cell_types')
-```
-
-![](images/seqfish_cortex/23-spatPlot2D.png)
-
-```{r, eval=FALSE}
-spatPlot(gobject = subSS_seqfish, show_network = T,
- network_color = 'blue', spatial_network_name = 'large_network',
- point_size = 2.5, cell_color = 'cell_types')
-```
-
-![](images/seqfish_cortex/24-spatPlot2D.png)
-
-```{r, eval=FALSE}
-spatPlot(gobject = subSS_seqfish, show_network = T,
- network_color = 'blue', spatial_network_name = 'distance_network',
- point_size = 2.5, cell_color = 'cell_types')
-```
-
-![](images/seqfish_cortex/25-spatPlot2D.png)
-
-# 10. Spatial Genes
-
-## Individual spatial genes
-
-
-```{r, eval=FALSE}
-## 3 new methods to identify spatial genes
-km_spatialfeats = binSpect(SS_seqfish)
-spatGenePlot(SS_seqfish, expression_values = 'scaled', genes = km_spatialfeats[1:4]$feats,
- point_shape = 'border', point_border_stroke = 0.1,
- show_network = F, network_color = 'lightgrey', point_size = 2.5,
- cow_n_col = 2)
-```
-
-![](images/seqfish_cortex/26-spatGenePlot2D.png)
-
-## Spatial Genes Co-Expression Modules
-
-```{r, eval=FALSE}
-## spatial co-expression patterns ##
-ext_spatial_genes = km_spatialfeats[1:500]$feats
-## 1. calculate gene spatial correlation and single-cell correlation
-## create spatial correlation object
-spat_cor_netw_DT = detectSpatialCorFeats(SS_seqfish,
- method = 'network',
- spatial_network_name = 'Delaunay_network',
- subset_feats = ext_spatial_genes)
-## 2. cluster correlated genes & visualize
-spat_cor_netw_DT = clusterSpatialCorFeats(spat_cor_netw_DT,
- name = 'spat_netw_clus',
- k = 8)
-heatmSpatialCorFeats(SS_seqfish, spatCorObject = spat_cor_netw_DT, use_clus_name = 'spat_netw_clus',
- heatmap_legend_param = list(title = NULL))
-```
-
-![](images/seqfish_cortex/27-heatmSpatialCorFeats.png)
-
-```{r, eval=FALSE}
-# 3. rank spatial correlated clusters and show genes for selected clusters
-netw_ranks = rankSpatialCorGroups(SS_seqfish,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus')
-top_netw_spat_cluster = showSpatialCorFeats(spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- selected_clusters = 6,
- show_top_feats = 1)
-```
-
-![](images/seqfish_cortex/28-rankSpatialCorGroups.png)
-
-```{r, eval=FALSE}
-# 4. create metagene enrichment score for clusters
-cluster_genes_DT = showSpatialCorFeats(spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- show_top_feats = 1)
-cluster_genes = cluster_genes_DT$clus; names(cluster_genes) = cluster_genes_DT$feat_ID
-SS_seqfish = createMetafeats(SS_seqfish,
- feat_clusters = cluster_genes,
- name = 'cluster_metagene')
-spatCellPlot(SS_seqfish,
- spat_enr_names = 'cluster_metagene',
- cell_annotation_values = netw_ranks$clusters,
- point_size = 1.5, cow_n_col = 3)
-```
-
-![](images/seqfish_cortex/29-spatCellPlot2D.png)
-
-# 11. HMRF Spatial Domains
-
-```{r, eval=FALSE}
-hmrf_folder = paste0(my_working_dir,'/','11_HMRF/')
-if(!file.exists(hmrf_folder)) dir.create(hmrf_folder, recursive = T)
-my_spatial_genes = km_spatialfeats[1:100]$feats
-# do HMRF with different betas
-HMRF_spatial_genes = doHMRF(gobject = SS_seqfish,
- expression_values = 'scaled',
- spatial_genes = my_spatial_genes,
- spatial_network_name = 'Delaunay_network',
- k = 9,
- betas = c(28,2,3),
- output_folder = paste0(hmrf_folder, '/', 'Spatial_genes/SG_top100_k9_scaled'))
-## view results of HMRF
-for(i in seq(28, 32, by = 2)) {
- viewHMRFresults2D(gobject = SS_seqfish,
- HMRFoutput = HMRF_spatial_genes,
- k = 9, betas_to_view = i,
- point_size = 2)
-}
-## add HMRF of interest to giotto object
-SS_seqfish = addHMRF(gobject = SS_seqfish,
- HMRFoutput = HMRF_spatial_genes,
- k = 9, betas_to_add = c(28),
- hmrf_name = 'HMRF_2')
-## visualize
-spatPlot(gobject = SS_seqfish,
- cell_color = 'HMRF_2_k9_b.28',
- point_size = 3,
- coord_fix_ratio = 1)
-```
-
-![](images/seqfish_cortex/30-spatPlot2D.png)
-
-# 12. Cell Neighborhood: Cell-Type/Cell-Type Interactions
-
-```{r, eval=FALSE}
-cell_proximities = cellProximityEnrichment(gobject = SS_seqfish,
- cluster_column = 'cell_types',
- spatial_network_name = 'Delaunay_network',
- adjust_method = 'fdr',
- number_of_simulations = 2000)
-## barplot
-cellProximityBarplot(gobject = SS_seqfish,
- CPscore = cell_proximities,
- min_orig_ints = 5, min_sim_ints = 5)
-```
-
-![](images/seqfish_cortex/31-cellProximityBarplot.png)
-
-```{r, eval=FALSE}
-## heatmap
-cellProximityHeatmap(gobject = SS_seqfish,
- CPscore = cell_proximities,
- order_cell_types = T, scale = T,
- color_breaks = c(-1.5, 0, 1.5),
- color_names = c('blue', 'white', 'red'))
-```
-
-![](images/seqfish_cortex/32-cellProximityHeatmap.png)
-
-```{r, eval=FALSE}
-## network
-cellProximityNetwork(gobject = SS_seqfish,
- CPscore = cell_proximities, remove_self_edges = T,
- only_show_enrichment_edges = T)
-```
-
-![](images/seqfish_cortex/33-cellProximityNetwork.png)
-
-```{r, eval=FALSE}
-## network with self-edges
-cellProximityNetwork(gobject = SS_seqfish, CPscore = cell_proximities,
- remove_self_edges = F, self_loop_strength = 0.3,
- only_show_enrichment_edges = F,
- rescale_edge_weights = T,
- node_size = 8,
- edge_weight_range_depletion = c(1, 2),
- edge_weight_range_enrichment = c(2,5))
-```
-
-![](images/seqfish_cortex/12_d_network_cell_cell_enrichment_self.png)
-
-```{r, eval=FALSE}
-## visualization of specific cell types
-# Option 1
-spec_interaction = "astrocytes--Olig"
-cellProximitySpatPlot2D(gobject = SS_seqfish,
- interaction_name = spec_interaction,
- show_network = T,
- cluster_column = 'cell_types',
- cell_color = 'cell_types',
- cell_color_code = c(astrocytes = 'lightblue', Olig = 'red'),
- point_size_select = 4, point_size_other = 2)
-```
-
-![](images/seqfish_cortex/34-cellProximitySpatPlot2D.png)
-
-```{r, eval=FALSE}
-# Option 2: create additional metadata
-SS_seqfish = addCellIntMetadata(SS_seqfish,
- spatial_network = 'spatial_network',
- cluster_column = 'cell_types',
- cell_interaction = spec_interaction,
- name = 'astro_olig_ints')
-spatPlot(SS_seqfish, cell_color = 'astro_olig_ints',
- select_cell_groups = c('other_astrocytes', 'other_Olig', 'select_astrocytes', 'select_Olig'),
- legend_symbol_size = 3)
-```
-
-![](images/seqfish_cortex/35-spatPlot2D.png)
-
-# Part 13. Cell Neighborhood: Interaction Changed Features
-
-
-```{r, eval=FALSE}
-library(future)
-## select top 25th highest expressing genes
-gene_metadata = fDataDT(SS_seqfish)
-plot(gene_metadata$nr_cells, gene_metadata$mean_expr)
-plot(gene_metadata$nr_cells, gene_metadata$mean_expr_det)
-quantile(gene_metadata$mean_expr_det)
-high_expressed_genes = gene_metadata[mean_expr_det > 3.5]$feat_ID
-## identify genes that are associated with proximity to other cell types
-plan('multisession', workers = 6)
-ICFsForesHighGenes = findInteractionChangedFeats(gobject = SS_seqfish,
- selected_feats = high_expressed_genes,
- spatial_network_name = 'Delaunay_network',
- cluster_column = 'cell_types',
- diff_test = 'permutation',
- adjust_method = 'fdr',
- nr_permutations = 2000,
- do_parallel = T)
-## visualize all genes
-plotCellProximityFeats(SS_seqfish, icfObject = ICFscoresHighGenes,
- method = 'dotplot')
-```
-
-![](images/seqfish_cortex/36-plotCellProximityGenes.png)
-
-```{r, eval=FALSE}
-## filter genes
-ICFscoresFilt = filterICF(ICFscoresHighGenes)
-## visualize subset of interaction changed genes (ICFs)
-ICF_genes = c('Jakmip1', 'Golgb1', 'Dact2', 'Ddx27', 'Abl1', 'Zswim8')
-ICF_genes_types = c('Lhx6 iNeuron', 'Lhx6 iNeuron', 'L4 eNeuron', 'L4 eNeuron', 'astrocytes', 'astrocytes')
-names(ICF_genes) = ICF_genes_types
-plotICF(gobject = SS_seqfish,
- icfObject = ICFscoresHighGenes,
- source_type = 'endothelial',
- source_markers = c('Pltp', 'Cldn5', 'Apcdd1'),
- ICF_feats = ICF_genes)
-```
-
-![](images/seqfish_cortex/37-plotICF.png)
-
-# 14. Cell Neighborhood: Ligand-Receptor Cell-Cell Communication
-
-```{r, eval=FALSE}
-## LR expression
-## LR activity changes
-LR_data = data.table::fread(system.file("extdata", "mouse_ligand_receptors.txt", package = 'Giotto'))
-LR_data[, ligand_det := ifelse(LR_data$mouseLigand %in% SS_seqfish@feat_ID$rna, T, F)]
-LR_data[, receptor_det := ifelse(LR_data$mouseReceptor %in% SS_seqfish@feat_ID$rna, T, F)]
-LR_data_det = LR_data[ligand_det == T & receptor_det == T]
-select_ligands = LR_data_det$mouseLigand
-select_receptors = LR_data_det$mouseReceptor
-## get statistical significance of gene pair expression changes based on expression
-expr_only_scores = exprCellCellcom(gobject = SS_seqfish,
- cluster_column = 'cell_types',
- random_iter = 1000,
- feat_set_1 = select_ligands,
- feat_set_2 = select_receptors,
- verbose = FALSE)
-## get statistical significance of gene pair expression changes upon cell-cell interaction
-spatial_all_scores = spatCellCellcom(SS_seqfish,
- spatial_network_name = 'spatial_network',
- cluster_column = 'cell_types',
- random_iter = 1000,
- feat_set_1 = select_ligands,
- feat_set_2 = select_receptors,
- adjust_method = 'fdr',
- do_parallel = T,
- cores = 4,
- verbose = 'a little')
-## select top LR ##
-selected_spat = spatial_all_scores[p.adj <= 0.01 & abs(log2fc) > 0.25 & lig_nr >= 4 & rec_nr >= 4]
-data.table::setorder(selected_spat, -PI)
-top_LR_ints = unique(selected_spat[order(-abs(PI))]$LR_comb)[1:33]
-top_LR_cell_ints = unique(selected_spat[order(-abs(PI))]$LR_cell_comb)[1:33]
-plotCCcomDotplot(gobject = SS_seqfish,
- comScores = spatial_all_scores,
- selected_LR = top_LR_ints,
- selected_cell_LR = top_LR_cell_ints,
- cluster_on = 'PI')
-```
-
-![](images/seqfish_cortex/38-plotCCcomDotplot.png)
-
-```{r, eval=FALSE}
-## spatial vs rank ####
-comb_comm = combCCcom(spatialCC = spatial_all_scores,
- exprCC = expr_only_scores)
-## highest levels of ligand and receptor prediction
-## top differential activity levels for ligand receptor pairs
-plotRankSpatvsExpr(gobject = SS_seqfish,
- comb_comm,
- expr_rnk_column = 'LR_expr_rnk',
- spat_rnk_column = 'LR_spat_rnk',
- midpoint = 10)
-```
-
-![](images/seqfish_cortex/39-plotRankSpatvsExpr.png)
-
-```{r, eval=FALSE}
-## recovery
-plotRecovery(gobject = SS_seqfish,
- comb_comm,
- expr_rnk_column = 'LR_expr_rnk',
- spat_rnk_column = 'LR_spat_rnk',
- ground_truth = 'spatial')
-```
-
-![](images/seqfish_cortex/40-plotRecovery.png)
diff --git a/vignettes/seqscope_mouse_liver.rmd b/vignettes/seqscope_mouse_liver.rmd
deleted file mode 100644
index d23b97e11..000000000
--- a/vignettes/seqscope_mouse_liver.rmd
+++ /dev/null
@@ -1,367 +0,0 @@
----
-title: "Seq-Scope Mouse liver"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Seq-Scope Mouse liver}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Dataset explanation
-
-[Seqscope](https://pubmed.ncbi.nlm.nih.gov/34115981/) is a illumina sequencing based spatial sequencing platform developed by [Jun Hee Lee Lab](https://lee.lab.medicine.umich.edu/seq-scope). The basic strategy is to use illumina sequencing by synthesis to generate the spatial barcodes and use the barcodes to capture mRNAs in tissue.
-
-## Example Raw Data needed for seqscope:
-
-1st-seq data (single-ended, for generating spatial barcodes)
-
-- SeqScope_1st.fastq.gz 2nd-seq data (pair-ended, for generating count matrix)
-- SeqScope_2nd_R1.fastq.gz
-- SeqScope_2nd_R2.fastq.gz
-
-Image (for seqmentation)
-
-- Tile_No_Segmented.png
-
-## Preprocessing to generate count matrix
-
-Seqscope has its own pipeline to generate the count matrix(Gene barcode). Please refer to their [github page](https://github.com/leeju-umich/Cho_Xi_Seqscope) or use customized methods to proceed.
-
-
-```{r, eval=FALSE}
-# Note you need to install seqtk, STARsolo and clone their github page first. All bash scripts are stored in script directory of their github.
-
-## First generate the whitelist of spatial barcodes:
-bash extractCoord.sh [SeqScope_1st.fastq.gz] [SeqScope_2nd_R1.fastq.gz] [HDMI_length]
-## Second, generating the count matrix via STAR.Solo:
-bash align.sh [SeqScope_2nd_R1.fastq.gz] [abc_SeqScope_2nd_R2.fastq.gz] [HDMI_length] [whitelists.txt] [outprefix] [starpath] [seqtkpath] [geneIndex]
-```
-
-
-You should now have the count matrix for Giotto Object. Note the Spatial Barcodes are typically at 0.6 um resolution. One way to analyze is to use the getSimpleGrid.R or getSlidingGrid.R provided by Lee Lab to bin the counts and simply follow the Giotto analysis steps of [Visium](https://giottosuite.readthedocs.io/en/latest/subsections/datasets/ouse_visium_brain.html) and [Integration of Visium](https://giottosuite.readthedocs.io/en/latest/subsections/datasets/visium_prostate_integration.html)
-
-# Start Giotto
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-# Set up Giotto Environment
-
-
-```{r, eval=FALSE}
-library(Giotto)
-
-# 1. set working directory
-results_folder = 'path/to/result'
-
-# 2. set giotto python path
-# set python path to your preferred python version path
-# set python path to conda env/bin/ directory if manually installed Giotto python dependencies by conda
-# python_path = '/path_to_conda/.conda/envs/giotto/bin/python'
-# set python path to NULL if you want to automatically install (only the 1st time) and use the giotto miniconda environment
-# python_path = NULL
-#if(is.null(python_path)) {
-# installGiottoEnvironment()
-#}
-
-# 3. create giotto instructions
-instrs = createGiottoInstructions(save_dir = results_folder,
- save_plot = TRUE,
- show_plot = FALSE)
-```
-
-
-# 1. Create Giotto Subcellular Object
-
-In order to do single cell and subcellular analysis with Giotto, we suggest using the GiottoSubcellular Object. Giotto Subcellular objects take cell polygons and a Giotto Point file (a data.table contains Gene Name, Expression, x, y, etc). Therefore, first we need to do some transformation of the count matrix.
-
-
-**Giotto Point file formatting**
-
-Unlike normal cell by gene matrix, a Giotto Point file is usually a data.table contains Gene Name, Expression, x, y, where each row represent a subcellular point. For Seqscope data, one HDMI typically have more than one subcellular point.
-
-Example Giotto Point file for **Seqscope**
-
-
- HDMI Feat_ID Count sdimX sdimY
- ------- --------- ------- ------- -------
- HDMI1 GeneA
- HDMI1 GeneB
- HDMI2 GeneA
- HDMI3 GeneC
-
-
-
-## 1.1 Process Giotto Point file per tile
-
-
-```{r, eval=FALSE}
-##expression matrix
-countDir = "/path/to/Solo.out/GeneFull/raw"
-expr_matrix = Giotto::get10Xmatrix(path_to_data = countDir, gene_column_index = 2)
-
-##Spatial coordinates
-spatial_coords_Dir = "/path/to/extractCoord.sh/results/spatialcoordinates.txt"
-spatial_coords = fread("spatial_coords_Dir")
-colnames(spatial_coords)<-c("HDMI","Lane","Tile","X","Y")
-
-##Prepare Giotto Point
-# Subset expression and spatial info by tile
-spatial_coords_tile = spatial_coords[Tile == '2104']
-expr_matrix_tile = expr_matrix[, as.character(colnames(expr_matrix)) %in% spatial_coords_tile$HDMI]
-
-# convert expression matrix to minimal data.table object
-matrix_tile_dt = as.data.table(Matrix::summary(expr_matrix_tile))
-genes = expr_matrix_tile@Dimnames[[1]]
-samples = expr_matrix_tile@Dimnames[[2]]
-matrix_tile_dt[, gene := genes[i]]
-matrix_tile_dt[, hdmi := samples[j]]
-
-# merge data.table matrix and spatial coordinates to create input for Giotto Polygons
-gpoints = merge.data.table(matrix_tile_dt, spatial_coords_tile, by.x = 'hdmi', by.y = 'HDMI')
-gpoints = gpoints[,.(hdmi, X, Y, gene, x)]
-colnames(gpoints) = c('hdmi', 'x', 'y', 'gene', 'counts')
-```
-
-
-## 1.2 Prepare the polygon mask file
-
-Giotto can read in a variety of different mask files provided by common segmentation tools. But first we need to check if we need to filp the x and y axis.
-
-
-```{r, eval=FALSE}
-# check total counts per hdmi
-gpoints_aggr = gpoints[, sum(counts), by = .(hdmi, x, y)]
-colnames(gpoints_aggr) = c("hdmi","x","y","total_counts")
-setorder(gpoints_aggr, -total_counts)
-
-pl = ggplot()
-pl = pl + geom_point(data = gpoints_aggr[total_counts < 1000 & total_counts > 8], aes(x = x, y = y, color = total_counts), size = 0.05)
-pl = pl + scale_color_gradient2(midpoint = 15, low = 'blue', mid = 'yellow', high = 'red')
-pl
-```
-
-
-![](images/seqscope_mouse_liver/HDMI_scatter.png)
-
-Read polygon mask file
-
-
-```{r, eval=FALSE}
-segmentation_mask = "/path/to/segmentation.tif"
-final_polygons = createGiottoPolygonsFromMask(segmentation_mask,
- flip_vertical = FALSE,
- flip_horizontal = FALSE)
-plot(final_polygons)
-```
-
-
-![](images/seqscope_mouse_liver/polygon.png)
-
-
-**Polygon mask file manual formatting**
-
-However, sometimes Giotto does not read in the provided mask file and we will need a manual processing for the mask file and we will do that using terra and createGiottoPolygonsFromDfr.
-
-
-```{r, eval=FALSE}
-raster = terra::rast(x = segmentation_mask)
-terra_polygon = terra::as.polygons(x = raster, value = T)
-
-# convert polygon to data.table and remove unwantedly detected polygons (e.g. canvas etc)
-dt = GiottospatVector_to_dt(terra_polygon)
-npolygons = length(levels(factor(dt$part))) - 1
-filter_dt = dt[geom == 1 & hole == 0 & part %in% c(0:npolygons), .(x,y,part)]
-filter_dt[, part := as.factor(part)]
-
-# create new polygons from filtered data.table
-final_polygons = createGiottoPolygonsFromDfr(segmdfr = filter_dt)
-
-# create giotto points first to get the extent of the points (hdmi)
-original_points = createGiottoPoints(x = gpoints[,.(x, y, gene, hdmi, counts)])
-original_feat_ext = ext(original_points@spatVector)
-
-
-
-# convert polygon to spatRaster to change extent to that of original points
-final_spatraster = Giottopolygon_to_raster(polygon = final_polygons@spatVector)
-ext(final_spatraster$raster) = original_feat_ext
-final_polygons@spatVector = as.polygons(final_spatraster$raster)
-final_polygons@spatVector$poly_ID = final_spatraster$ID_vector[final_polygons@spatVector$poly_i]
-
-# flip and shift, if needed
-#final_polygons@spatVector = flip(final_polygons@spatVector)
-#yshift = ymin(original_feat_ext) - ymax(original_feat_ext)
-#final_polygons@spatVector = terra::shift(final_polygons@spatVector, dy = -yshift)
-
-plot(final_polygons)
-```
-
-
-## 1.3 Create Giotto Object
-
-Add a random jitter to the HDMI location to make a pseudo-in situ transcript file.
-
-
-```{r, eval=FALSE}
-# add giotto points class
-gpoints_subset = gpoints[hdmi %in% gpoints_aggr[total_counts > 5]$hdmi]
-
-# multiply rows with multiple counts and add jitter
-gpoints_extra = gpoints_subset[counts > 1]
-gpoints_extra = gpoints_extra[,rep(counts, counts), by = .(hdmi, gene, x, y)]
-gpoints_extra = rbind(gpoints_extra[,.(hdmi, gene, x, y)], gpoints_subset[counts == 1 ,.(hdmi, gene, x, y)])
-jitter_x = sample(1:3, size = nrow(gpoints_extra), replace = T)
-jitter_y = sample(1:3, size = nrow(gpoints_extra), replace = T)
-gpoints_extra[, x := x + jitter_x]
-gpoints_extra[, y := y + jitter_y]
-```
-
-
-```{r, eval=FALSE}
-# add subcellular information
-seqscope = createGiottoObjectSubcellular(gpoints = list(gpoints_extra[,.(x, y, gene, hdmi)]),
- gpolygons = list(final_polygons),
- instructions = instrs)
-
-# add centroids
-seqscope = addSpatialCentroidLocations(seqscope,
- poly_info = 'cell')
-
-#Overlap to Polygon information
-seqscope = calculateOverlapRaster(seqscope)
-seqscope = overlapToMatrix(seqscope)
-
-# Visualize top 200 expressed genes in situ
-spatInSituPlotPoints(seqscope, show_legend = F,
- show_image = FALSE,
- feats = list('rna' = seqscope@feat_info$rna@spatVector$feat_ID[1:200]),
- spat_unit = 'cell',
- point_size = 1,
- show_polygon = TRUE,
- use_overlap = F,
- polygon_feat_type = 'cell',
- polygon_color = 'red',
- polygon_bg_color = 'white',
- polygon_line_size = 0.2,
- coord_fix_ratio = TRUE,
- background_color = 'white')
-```
-
-
-![](images/seqscope_mouse_liver/top200.png)
-
-# 2. Process Giotto and Quality Control
-
-```{r, eval=FALSE}
-# filter
-seqscope <- filterGiotto(gobject = seqscope,
- expression_threshold = 1,
- feat_det_in_min_cells = 5,
- min_det_feats_per_cell = 5)
-
-#normalize
-seqscope <- normalizeGiotto(gobject = seqscope, scalefactor = 5000, verbose = T)
-# add statistics
-seqscope <- addStatistics(gobject = seqscope)
-
-# View cellular data
-# pDataDT(seqscope)
-# View rna data
-# fDataDT(seqscope)
-
-
-spatPlot2D(gobject = seqscope,
- cell_color = 'total_expr', color_as_factor = F,
- show_image = F,
- point_size = 2.5, point_alpha = 0.75, coord_fix_ratio = T)
-```
-
-
-![](images/seqscope_mouse_liver/total_expr.png)
-
-
-```{r, eval=FALSE}
-cellmeta = pDataDT(seqscope, feat_type = 'rna')
-hist(cellmeta$nr_feats, 100)
-```
-
-
-![](images/seqscope_mouse_liver/feature_distribution.png)
-
-# 3. Dimention Reduction
-
-
-```{r, eval=FALSE}
-# cluster cells
-seqscope <- calculateHVF(gobject = seqscope, HVFname = 'hvg_orig')
-
-seqscope <- runPCA(gobject = seqscope,
- expression_values = 'normalized',
- scale_unit = T, center = T)
-
-seqscope <- runUMAP(seqscope, dimensions_to_use = 1:100)
-```
-
-
-# 4. Cluster
-
-
-```{r, eval=FALSE}
-seqscope <- createNearestNetwork(gobject = seqscope, dimensions_to_use = 1:100, k = 5)
-seqscope <- doLeidenCluster(gobject = seqscope, resolution = 0.9, n_iterations = 1000)
-
-# visualize UMAP cluster results
-
-
-plotUMAP(gobject = seqscope, cell_color = 'leiden_clus',
- show_NN_network = F, point_size = 3.5)
-```
-
-
-![](images/seqscope_mouse_liver/leiden_umap.png)
-
-
-```{r, eval=FALSE}
-spatInSituPlotPoints(seqscope,
- show_polygon = TRUE,
- polygon_color = 'white',
- polygon_line_size = 0.1,
- polygon_fill = 'leiden_clus',
- polygon_fill_as_factor = T,
- coord_fix_ratio = T)
-```
-
-
-![](images/seqscope_mouse_liver/leiden_spat.png)
-
-# 5. Find spatial genes
-
-
-```{r, eval=FALSE}
-seqscope<-createSpatialNetwork(gobject = seqscope, minimum_k = 2, maximum_distance_delaunay = 100)
-
-km_spatialgenes = binSpect(seqscope, subset_feats = seqscope@feat_ID$rna)
-spatFeatPlot2D(seqscope, expression_values = 'scaled',
- feats = km_spatialgenes$feats[1:2],
- cell_color_gradient = c('blue', 'white', 'red'),
- point_shape = 'border', point_border_stroke = 0.01,
- show_network = T, network_color = 'lightgrey', point_size = 1.2,
- cow_n_col = 1)
-```
-
-
-![](images/seqscope_mouse_liver/spatgenes.png)
diff --git a/vignettes/singlecell_lung_adenocarcinoma.Rmd b/vignettes/singlecell_lung_adenocarcinoma.Rmd
deleted file mode 100644
index 9645e5485..000000000
--- a/vignettes/singlecell_lung_adenocarcinoma.Rmd
+++ /dev/null
@@ -1,409 +0,0 @@
----
-title: "Single Cell Human Lung Adenocarcinoma"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Single Cell Human Lung Adenocarcinoma}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure GiottoData, a small, helper module for tutorials, is installed.
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
-# The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-## Set up Giotto Environment
-
-``` {r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-# 1. set working directory
-results_folder = 'path/to/result'
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-
-# 3. create giotto instructions
-instrs = createGiottoInstructions(save_dir = results_folder,
- save_plot = TRUE,
- show_plot = FALSE,
- python_path = my_python_path)
-```
-
-## Dataset Explanation
-
-[Maynard et al.](https://pubmed.ncbi.nlm.nih.gov/32822576/) Processed Illumina Single Cell RNAseq of metastatic lung cancer using 49 clinical biopsies obtained from 30 patients before and during targeted therapy. The raw data can be found [here](https://www.ncbi.nlm.nih.gov/bioproject/591860).
-
-To run this vignette, download the files from this [Google drive](https://drive.google.com/drive/folders/1sDzO0WOD4rnGC7QfTKwdcQTx3L36PFwX)
-
-## Part 1: Create Giotto object
-
-Load data
-```{r, eval=FALSE}
-raw.data <- read.csv("Data_input/csv_files/S01_datafinal.csv",
- header=T, row.names = 1)
-```
-
-Load metadata
-```{r, eval=FALSE}
-metadata <- read.csv("Data_input/csv_files/S01_metacells.csv",
- row.names=1, header=T)
-```
-
-Find ERCC's, compute the percent ERCC, and drop them from the raw data.
-```{r, eval=FALSE}
-erccs <- grep(pattern = "^ERCC-",
- x = rownames(x = raw.data),
- value = TRUE)
-percent.ercc <- Matrix::colSums(raw.data[erccs, ])/Matrix::colSums(raw.data)
-ercc.index <- grep(pattern = "^ERCC-",
- x = rownames(x = raw.data),
- value = FALSE)
-raw.data <- raw.data[-ercc.index,]
-```
-
-
-``` {r, eval=FALSE}
-giotto_SC <- createGiottoObject(expression = raw.data,
- instructions = instrs)
-```
-
-Calculate percent ribosomal genes and add to metadata
-```{r, eval=FALSE}
-ribo.genes <- grep(pattern = "^RP[SL][[:digit:]]",
- x = rownames(raw.data), value = TRUE)
-percent.ribo <- Matrix::colSums(raw.data[ribo.genes, ])/Matrix::colSums(raw.data)
-
-giotto_SC <- addCellMetadata(giotto_SC,
- new_metadata = data.frame(percent_ribo = percent.ribo))
-```
-
-## Part 2: Process Giotto Object
-
-``` {r, eval=FALSE}
-giotto_SC <- filterGiotto(gobject = giotto_SC,
- expression_threshold = 1,
- feat_det_in_min_cells = 10,
- min_det_feats_per_cell = 500,
- expression_values = c('raw'),
- verbose = T)
-
-## normalize
-giotto_SC <- normalizeGiotto(gobject = giotto_SC, scalefactor = 6000)
-
-## add gene & cell statistics
-giotto_SC <- addStatistics(gobject = giotto_SC, expression_values = 'raw')
-```
-
-## Part 3: Dimension Reduction
-
-``` {r, eval=FALSE}
-## PCA ##
-giotto_SC <- calculateHVF(gobject = giotto_SC)
-giotto_SC <- runPCA(gobject = giotto_SC,
- center = TRUE,
- cale_unit = TRUE)
-screePlot(giotto_SC,
- ncp = 30,
- save_param = list(save_name = '3_scree_plot'))
-```
-
-![](images/singlecell_lung_adenocarcinoma/3_scree_plot.png)
-
-## Part 4: Cluster
-
-``` {r, eval=FALSE}
-## cluster and run UMAP ##
-# sNN network (default)
-giotto_SC <- createNearestNetwork(gobject = giotto_SC,
- dim_reduction_to_use = 'pca',
- dim_reduction_name = 'pca',
- dimensions_to_use = 1:10, k = 15)
-
-# UMAP
-giotto_SC = runUMAP(giotto_SC, dimensions_to_use = 1:10)
-
-# Leiden clustering
-giotto_SC <- doLeidenCluster(gobject = giotto_SC,
- resolution = 0.5,
- n_iterations = 1000)
-
-plotUMAP(gobject = giotto_SC,
- cell_color = 'leiden_clus',
- show_NN_network = T,
- point_size = 1.5,
- save_param = list(save_name = "4_Cluster"))
-```
-
-![](images/singlecell_lung_adenocarcinoma/4_Cluster.png)
-
-## Part 5: Differential Expression
-
-``` {r, eval=FALSE}
-markers_scran = findMarkers_one_vs_all(gobject=giotto_SC,
- method="scran",
- expression_values="normalized",
- cluster_column='leiden_clus',
- min_feats=3)
-markergenes_scran = unique(markers_scran[, head(.SD, 2), by="cluster"][["feats"]])
-
-plotMetaDataHeatmap(giotto_SC,
- expression_values = "normalized",
- metadata_cols = 'leiden_clus',
- selected_feats = markergenes_scran,
- y_text_size = 8,
- show_values = 'zscores_rescaled',
- save_param = list(save_name = '5_metaheatmap'))
-```
-
-![](images/singlecell_lung_adenocarcinoma/5_metaheatmap.png)
-
-## Part 6: FeaturePlot
-
-``` {r, eval=FALSE}
-# Plot known marker genes across different cell types. e.g. EPCAM for epithelial cells
-dimFeatPlot2D(giotto_SC,
- feats = c("EPCAM", "PMEL", "C1QA","COL1A1"),
- cow_n_col = 2,
- save_param = list(save_name = "6_featureplot"))
-```
-
-![](images/singlecell_lung_adenocarcinoma/6_featureplot.png)
-
-## Part 7: Cell type Annotation
-
-```{r}
-marker_genes = list(
- T_cells = c("CD2", "CD3D", "CD3E", "CD3G"),
- macrophages = c("MARCO", "CSF1R", "CD68", "GLDN", "APOE", "CCL3L1", "TREM2", "C1QB", "NUPR1", "FOLR2", "RNASE1", "C1QA"),
- dendritic = c("CD1E", "CD1C", "FCER1A", "PKIB", "CYP2S1", "NDRG2"),
- mast= c("CMA1", "TPSAB1", "TPSB2"),
- B_cells = c("IGLL5", "MZB1", "JCHAIN", "DERL3", "SDC1", "MS$A1", "BANK1", "PAX5", "CD79A"),
- B_cells_PB = c("PRDM1", "XSP1", "IRF4"),
- B_cell_mem = c("MS4A1", "IRF8"),
- housekeeping = c("ACTB", "GAPDH", "MALAT1"),
- neutrophils = c("FCGR3B", "ALPL", "CXCR1", "CXCR2", "ADGRG3", "CMTM2", "PROK2", "MME", "MMP25", "TNFRSF10C"),
- pdcs = c("SLC32A1", "SHD", "LRRC26", "PACSIN1", "LILRA4", "CLEC4C", "DNASE1L3", "SCT", "LAMP5"),
- carcinoma_cells = c("FCER1G", "IFI30", "LAPTM5", "ARHGDIB", "MALAT1"),
- epithelial = c("EPCAM", "CD151")
-)
-```
-
-```{r, eval=FALSE}
-library(dplyr)
-library(ComplexHeatmap)
-heatmap_table <- calculateMetaTable(gobject = giotto_SC,
- expression_values = 'normalized',
- metadata_cols = 'leiden_clus',
- selected_feats = unlist(marker_genes))
-
-zscores = value = zscores_rescaled_per_feat = NULL
-
-heatmap_table[, zscores := scale(value), by = c('variable')]
-heatmap_table[, zscores_rescaled_per_feat := scales::rescale(zscores, to = c(-1,1)), by = c('variable')]
-
-heatmap_table$cell_types_markers <- heatmap_table$variable
-
-heatmap_table <- heatmap_table %>%
- mutate(cell_types_markers = case_when(
- cell_types_markers %in% marker_genes[["B_cell_mem"]] ~ "B_cell_mem",
- cell_types_markers %in% marker_genes[["B_cells"]] ~ "B_cells",
- cell_types_markers %in% marker_genes[["carcinoma_cells"]] ~ "carcinoma_cells",
- cell_types_markers %in% marker_genes[["dendritic"]] ~ "dendritic",
- cell_types_markers %in% marker_genes[["epithelial"]] ~ "epithelial",
- cell_types_markers %in% marker_genes[["housekeeping"]] ~ "housekeeping",
- cell_types_markers %in% marker_genes[["macrophages"]] ~ "macrophages",
- cell_types_markers %in% marker_genes[["mast"]] ~ "mast",
- cell_types_markers %in% marker_genes[["neutrophils"]] ~ "neutrophils",
- cell_types_markers %in% marker_genes[["pdcs"]] ~ "pdcs",
- cell_types_markers %in% marker_genes[["T_cells"]] ~ "T_cells"
- ))
-
-heatmap_matrix <- heatmap_table[,c("leiden_clus", "variable","zscores_rescaled_per_feat")]
-heatmap_matrix <- tidyr::pivot_wider(heatmap_matrix,
- names_from = "leiden_clus",
- values_from = "zscores_rescaled_per_feat")
-rownames_matrix <- heatmap_matrix$variable
-colnames_matrix <- colnames(heatmap_matrix)
-
-heatmap_matrix <- as.matrix(heatmap_matrix[,-1])
-rownames(heatmap_matrix) <- rownames_matrix
-
-cell_types_heatmap <- unique(heatmap_table[,c("variable", "cell_types_markers")])
-colnames(cell_types_heatmap)[2] <- "cell_types"
-
-cell_types_heatmap <- cell_types_heatmap[order(cell_types),]
-
-n_leiden_clusters = max(giotto_SC@cell_metadata$cell$rna@metaDT$leiden_clus)
-
-panel_fun = function(index, nm) {
- grid.rect()
- grid.text(nm, 0.5, 0.5, gp = gpar(fontsize = 6))
-}
-
-## heatmap z-score per leiden cluster
-png(filename = "results/6_heatmap_all_clusters_cell_types.png",
- width = 2000,
- height = 1500,
- res = 300)
-Heatmap(heatmap_matrix,
- cluster_rows = FALSE,
- cluster_columns = FALSE,
- row_order = cell_types_heatmap$variable,
- column_order = as.character(1:n_leiden_clusters),
- row_names_gp = gpar(fontsize = 5),
- column_names_gp = gpar(fontsize = 8),
- column_names_rot = 45,
- heatmap_legend_param = list(title = "",
- labels_gp = gpar(fontsize = 8)),
- left_annotation = rowAnnotation(cell_types = anno_block(align_to = list(
- B_cell_mem = c("IRF8", "MS4A1"),
- B_cells = c("IGLL5", "MZB1", "JCHAIN", "DERL3", "SDC1", "MS$A1", "BANK1", "PAX5", "CD79A"),
- T_cells = c("CD2", "CD3D", "CD3E", "CD3G"),
- B_cells_PB = c("PRDM1", "XSP1", "IRF4"),
- carcinoma_cells = c("FCER1G", "IFI30", "LAPTM5", "ARHGDIB", "MALAT1"),
- dendritic = c("CD1E", "CD1C", "FCER1A", "PKIB", "CYP2S1", "NDRG2"),
- epithelial = c("EPCAM", "CD151"),
- housekeeping = c("ACTB", "GAPDH"),
- macrophages = c("MARCO", "CSF1R", "CD68", "GLDN", "APOE", "CCL3L1", "TREM2", "C1QB", "NUPR1", "FOLR2", "RNASE1", "C1QA"),
- mast = c("CMA1", "TPSAB1", "TPSB2"),
- neutrophils = c("FCGR3B", "ALPL", "CXCR1", "CXCR2", "ADGRG3", "CMTM2", "PROK2", "MME", "MMP25", "TNFRSF10C"),
- pdcs = c("SLC32A1", "SHD", "LRRC26", "PACSIN1", "LILRA4", "CLEC4C", "DNASE1L3", "SCT", "LAMP5")
- ),
- panel_fun = panel_fun,
- width = unit(2, "cm")
- ) )
-)
-dev.off()
-```
-
-![](images/singlecell_lung_adenocarcinoma/6_heatmap_all_clusters_cell_types.png)
-
-``` {r, eval=FALSE}
-lung_labels<-c("carcinoma_cells",#1
- "epithelial",#2
- "T_cells",#3
- "macrophages",#4
- "T_cells",#5
- "epithelial",#6
- "T_cells",#7
- "epithelial",#8
- "macrophages",#9
- "carcinoma_cells",#10
- "epithelial",#11
- "carcinoma_cells",#12
- "carcinoma_cells",#13
- "B_cells_PB",#14
- "neutrophils",#15
- "pDCs",#16
- "carcinoma_cells",#17
- "carcinoma_cells",#18
- "mast",#19
- "epithelial",#20
- "carcinoma_cells",#21
- "B_cells",#22
- "T_cells",#23
- "carcinoma_cells",#24
- "carcinoma_cells",#25
- "epithelial",#26
- "carcinoma_cells",#27
- "housekeeping",#28
- "housekeeping",#29
- "B_cells", #30
- "dendritic", #31,
- "neutrophils" #32
-)
-
-names(lung_labels) <- 1:32
-giotto_SC <- annotateGiotto(gobject = giotto_SC,
- annotation_vector = lung_labels ,
- cluster_column = 'leiden_clus',
- name = 'lung_labels')
-dimPlot2D(gobject = giotto_SC,
- dim_reduction_name = 'umap',
- cell_color = "lung_labels",
- show_NN_network = T,
- point_size = 1.5,
- save_param = list(save_name = "7_Annotation"))
-```
-
-![](images/singlecell_lung_adenocarcinoma/7_Annotation.png)
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.3
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] Giotto_4.0.2 GiottoClass_0.1.3
-
-loaded via a namespace (and not attached):
- [1] generics_0.1.3 utf8_1.2.4
- [3] SparseArray_1.2.3 bitops_1.0-7
- [5] gtools_3.9.5 lattice_0.21-9
- [7] magrittr_2.0.3 grid_4.3.2
- [9] Matrix_1.6-5 GenomeInfoDb_1.38.5
-[11] fansi_1.0.6 SingleCellExperiment_1.24.0
-[13] scales_1.3.0 codetools_0.2-19
-[15] abind_1.4-5 cli_3.6.2
-[17] rlang_1.1.3 crayon_1.5.2
-[19] XVector_0.42.0 Biobase_2.62.0
-[21] munsell_0.5.0 colorRamp2_0.1.0
-[23] DelayedArray_0.28.0 S4Arrays_1.2.0
-[25] parallel_4.3.2 tools_4.3.2
-[27] GiottoUtils_0.1.3 dplyr_1.1.4
-[29] colorspace_2.1-0 ggplot2_3.4.4
-[31] SpatialExperiment_1.12.0 GenomeInfoDbData_1.2.11
-[33] SummarizedExperiment_1.32.0 BiocGenerics_0.48.1
-[35] vctrs_0.6.5 R6_2.5.1
-[37] matrixStats_1.2.0 stats4_4.3.2
-[39] lifecycle_1.0.4 magick_2.8.2
-[41] zlibbioc_1.48.0 GiottoVisuals_0.1.2
-[43] S4Vectors_0.40.2 IRanges_2.36.0
-[45] pkgconfig_2.0.3 terra_1.7-65
-[47] pillar_1.9.0 gtable_0.3.4
-[49] data.table_1.14.10 glue_1.7.0
-[51] Rcpp_1.0.12 tidyselect_1.2.0
-[53] tibble_3.2.1 GenomicRanges_1.54.1
-[55] rstudioapi_0.15.0 MatrixGenerics_1.14.0
-[57] rjson_0.2.21 compiler_4.3.2
-[59] RCurl_1.98-1.14
-```
-
-
diff --git a/vignettes/singlecell_prostate_integration.Rmd b/vignettes/singlecell_prostate_integration.Rmd
deleted file mode 100644
index 4ddfb9841..000000000
--- a/vignettes/singlecell_prostate_integration.Rmd
+++ /dev/null
@@ -1,234 +0,0 @@
----
-title: "Integration of single cell datasets"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Integration of single cell datasets}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-``` {r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure GiottoData, a small, helper module for tutorials, is installed.
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-# Set up Giotto Environment
-
-
-``` {r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-# 1. set working directory
-results_folder = 'path/to/result'
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-
-# 2. create giotto instructions
-instrs = createGiottoInstructions(save_dir = results_folder,
- save_plot = TRUE,
- show_plot = FALSE,
- python_path = my_python_path)
-```
-
-
-# Dataset explanation
-
-This is a tutorial for Harmony integration of different single cell
-RNAseq datasets using two prostate cancer patient datasets. [Ma et
-al.](https:/pubmed.ncbi.nlm.nih.gov/33032611/) Processed 10X Single
-Cell RNAseq from two prostate cancer patients. The raw dataset can be
-found
-[here](https:/www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE157703)
-
-# Part 1: Create Giotto object from 10X dataset and join
-
-
-``` {r, eval=FALSE}
-giotto_P1<-createGiottoObject(expression = get10Xmatrix("path/to/P1_result/outs/filtered_feature_bc_matrix",
- gene_column_index = 2,
- remove_zero_rows = TRUE),
- instructions = instrs)
-
-giotto_P2<-createGiottoObject(expression = get10Xmatrix("path/to/P2_result/outs/filtered_feature_bc_matrix",
- gene_column_index = 2,
- remove_zero_rows = TRUE),
- instructions = instrs)
-
-giotto_SC_join = joinGiottoObjects(gobject_list = list(giotto_P1, giotto_P2),
- gobject_names = c('P1', 'P2'),
- join_method = "z_stack")
-```
-
-
-# Part 2: Process Joined object
-
-
-``` {r, eval=FALSE}
-giotto_SC_join <- filterGiotto(gobject = giotto_SC_join,
- expression_threshold = 1,
- feat_det_in_min_cells = 50,
- min_det_feats_per_cell = 500,
- expression_values = c('raw'),
- verbose = T)
-
-## normalize
-giotto_SC_join <- normalizeGiotto(gobject = giotto_SC_join,
- scalefactor = 6000)
-
-## add gene & cell statistics
-giotto_SC_join <- addStatistics(gobject = giotto_SC_join,
- expression_values = 'raw')
-```
-
-
-# Part 3: Dimension reduction and clustering
-
-
-``` {r, eval=FALSE}
-## PCA ##
-giotto_SC_join <- calculateHVF(gobject = giotto_SC_join)
-giotto_SC_join <- runPCA(gobject = giotto_SC_join,
- center = TRUE,
- scale_unit = TRUE)
-# Check screeplot to select number of PCs for clustering
-# screePlot(giotto_SC_join, ncp = 30, save_param = list(save_name = '3_scree_plot'))
-
-## WITHOUT INTEGRATION ##
-# --------------------- #
-
-## cluster and run UMAP ##
-# sNN network (default)
-showGiottoDimRed(giotto_SC_join)
-giotto_SC_join <- createNearestNetwork(gobject = giotto_SC_join,
- dim_reduction_to_use = 'pca',
- dim_reduction_name = 'pca',
- dimensions_to_use = 1:10,
- k = 15)
-
-# Leiden clustering
-giotto_SC_join <- doLeidenCluster(gobject = giotto_SC_join,
- resolution = 0.2,
- n_iterations = 1000)
-
-# UMAP
-giotto_SC_join = runUMAP(giotto_SC_join)
-
-plotUMAP(gobject = giotto_SC_join,
- cell_color = 'leiden_clus',
- show_NN_network = T,
- point_size = 1.5,
- save_param = list(save_name = "4_cluster_without_integration"))
-```
-
-
-![](images/singlecell_prostate_integration/4_cluster_without_integration.png){width="50.0%"}
-
-
-``` {r, eval=FALSE}
-dimPlot2D(gobject = giotto_SC_join,
- dim_reduction_name = 'umap',
- point_shape = 'no_border',
- cell_color = "leiden_clus",
- group_by = "list_ID",
- show_NN_network = F,
- point_size = 0.5,
- show_center_label = F,
- show_legend =F,
- save_param = list(save_name = "4_list_without_integration"))
-```
-
-
-![](images/singlecell_prostate_integration/4_list_without_integration.png){width="50.0%"}
-
-Harmony is a integration algorithm developed by [Korsunsky, I. et
-al.](https:/www.nature.com/articles/s41592-019-0619-0). It was designed
-for integration of single cell data but also work well on spatial
-datasets.
-
-
-``` {r, eval=FALSE}
-## WITH INTEGRATION ##
-# --------------------- #
-
-## data integration, cluster and run UMAP ##
-
-# harmony
-#library(devtools)
-#install_github("immunogenomics/harmony")
-library(harmony)
-
-#pDataDT(giotto_SC_join)
-giotto_SC_join = runGiottoHarmony(giotto_SC_join,
- vars_use = 'list_ID',
- do_pca = F)
-
-
-## sNN network (default)
-#showGiottoDimRed(giotto_SC_join)
-giotto_SC_join <- createNearestNetwork(gobject = giotto_SC_join,
- dim_reduction_to_use = 'harmony',
- dim_reduction_name = 'harmony',
- name = 'NN.harmony',
- dimensions_to_use = 1:10,
- k = 15)
-
-## Leiden clustering
-giotto_SC_join <- doLeidenCluster(gobject = giotto_SC_join,
- network_name = 'NN.harmony',
- resolution = 0.2,
- n_iterations = 1000,
- name = 'leiden_harmony')
-
-# UMAP dimension reduction
-#showGiottoDimRed(giotto_SC_join)
-giotto_SC_join = runUMAP(giotto_SC_join,
- dim_reduction_name = 'harmony',
- dim_reduction_to_use = 'harmony',
- name = 'umap_harmony')
-
-plotUMAP(gobject = giotto_SC_join,
- dim_reduction_name = 'umap_harmony',
- cell_color = 'leiden_harmony',
- show_NN_network = T,
- point_size = 1.5,
- save_param = list(save_name = "4_cluster_with_integration"))
-```
-
-
-![](images/singlecell_prostate_integration/4_cluster_with_integration.png){width="50.0%"}
-
-
-``` {r, eval=FALSE}
-dimPlot2D(gobject = giotto_SC_join,
- dim_reduction_name = 'umap_harmony',
- point_shape = 'no_border',
- cell_color = "leiden_harmony",
- group_by = "list_ID",
- show_NN_network = F,
- point_size = 0.5,
- show_center_label = F,
- show_legend =F ,
- save_param = list(save_name = "4_list_with_integration"))
-```
-
-
-![](images/singlecell_prostate_integration/4_list_with_integration.png){width="50.0%"}
diff --git a/vignettes/singlecell_prostate_standard.Rmd b/vignettes/singlecell_prostate_standard.Rmd
deleted file mode 100644
index a5cf174c8..000000000
--- a/vignettes/singlecell_prostate_standard.Rmd
+++ /dev/null
@@ -1,256 +0,0 @@
----
-title: "10X Single Cell RNA Sequencing"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{10X Single Cell RNA Sequencing}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure GiottoData, a small, helper module for tutorials, is installed.
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-## Set up Giotto Environment
-
-``` {r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-# 1. set working directory
-results_folder = 'path/to/result'
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-
-# 3. create giotto instructions
-instrs = createGiottoInstructions(save_dir = results_folder,
- save_plot = TRUE,
- show_plot = FALSE,
- python_path = my_python_path)
-```
-
-## Dataset Explanation
-
-[Ma et al.](https://pubmed.ncbi.nlm.nih.gov/33032611/) Processed 10X Single Cell RNAseq from two prostate cancer patients. The raw dataset can be found
-[here](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE157703)
-
-## Part 1: Create Giotto object from 10X dataset
-
-Note that you will need an input directory for barcodes.tsv(.gz) features.tsv(.gz) matrix.mtx(.gz)
-
-``` {r, eval=FALSE}
-giotto_SC <- createGiottoObject(expression = get10Xmatrix("/path/to/filtered_feature_bc_matrix",
- gene_column_index = 2,
- remove_zero_rows = TRUE),
- instructions = instrs)
-```
-
-## Part 2: Process Giotto Object
-
-``` {r, eval=FALSE}
-giotto_SC <- filterGiotto(gobject = giotto_SC,
- expression_threshold = 1,
- feat_det_in_min_cells = 50,
- min_det_feats_per_cell = 500,
- expression_values = c('raw'),
- verbose = T)
-
-## normalize
-giotto_SC <- normalizeGiotto(gobject = giotto_SC, scalefactor = 6000)
-
-## add mitochondria gene percentage and filter giotto object by percent mito
-library(rtracklayer)
-gtf <- import("Homo_sapiens.GRCh38.105.gtf.gz")
-gtf <- gtf[gtf$gene_name!="" & !is.na(gtf$gene_name)]
-mito <- gtf$gene_name[as.character(seqnames(gtf)) %in% "MT"]
-mito <- unique(mito)
-
-giotto_SC <- addFeatsPerc(giotto_SC,
- feats = mito,
- vector_name = 'perc_mito')
-
-giotto_SC <- subsetGiotto(giotto_SC,
- cell_ids = pDataDT(giotto_SC)[which(pDataDT(giotto_SC)$perc_mito < 15),]$cell_ID)
-
-
-## add gene & cell statistics
-giotto_SC <- addStatistics(gobject = giotto_SC, expression_values = 'raw')
-```
-
-## Part 3: Dimention Reduction
-
-``` {r, eval=FALSE}
-## PCA ##
-giotto_SC <- calculateHVF(gobject = giotto_SC)
-giotto_SC <- runPCA(gobject = giotto_SC, center = TRUE, scale_unit = TRUE)
-screePlot(giotto_SC, ncp = 30, save_param = list(save_name = '3_scree_plot'))
-```
-
-![](images/singlecell_rna_seq/3_scree_plot.png)
-
-## Part 4: Cluster
-
-``` {r, eval=FALSE}
-## cluster and run UMAP ##
-# sNN network (default)
-showGiottoDimRed(giotto_SC)
-giotto_SC <- createNearestNetwork(gobject = giotto_SC,
- dim_reduction_to_use = 'pca', dim_reduction_name = 'pca',
- dimensions_to_use = 1:10, k = 15)
-
-# UMAP
-giotto_SC = runUMAP(giotto_SC, dimensions_to_use = 1:10)
-
-# Leiden clustering
-giotto_SC <- doLeidenCluster(gobject = giotto_SC, resolution = 0.2, n_iterations = 1000)
-
-
-plotUMAP(gobject = giotto_SC,
- cell_color = 'leiden_clus', show_NN_network = T, point_size = 1.5,
- save_param = list(save_name = "4_Cluster"))
-```
-
-![](images/singlecell_rna_seq/4_Cluster.png)
-
-## Part 5: Differential Expression
-
-``` {r, eval=FALSE}
-markers_scran = findMarkers_one_vs_all(gobject=giotto_SC, method="scran",
- expression_values="normalized", cluster_column='leiden_clus', min_feats=3)
-markergenes_scran = unique(markers_scran[, head(.SD, 3), by="cluster"][["feats"]])
-
-plotMetaDataHeatmap(giotto_SC, expression_values = "normalized", metadata_cols = 'leiden_clus',
- selected_feats = markergenes_scran,
- y_text_size = 8, show_values = 'zscores_rescaled',
- save_param = list(save_name = '5_a_metaheatmap'))
-```
-
-![](images/singlecell_rna_seq/5_a_metaheatmap.png)
-
-``` {r, eval=FALSE}
-topgenes_scran = markers_scran[, head(.SD, 1), by = 'cluster']$feats
-# violinplot
-violinPlot(giotto_SC, feats = unique(topgenes_scran), cluster_column = 'leiden_clus',
- strip_text = 10, strip_position = 'right',
- save_param = list(save_name = '5_b_violinplot_scran', base_width = 5))
-```
-
-![](images/singlecell_rna_seq/5_b_violinplot_scran.png)
-
-## Part 6: FeaturePlot
-
-``` {r, eval=FALSE}
-# Plot known marker genes across different cell types. EPCAM for epithelial cells,
-# DPP4(CD26) for Epithelial luminal cells, PECAM1(CD31) for Endothelial cells and CD3D for T cells
-dimFeatPlot2D(giotto_SC, feats = c("EPCAM","DPP4","PECAM1","CD3D"), cow_n_col = 2, save_param = list(save_name = "6_featureplot"))
-```
-
-![](images/singlecell_rna_seq/6_featureplot.png)
-
-## Part 7: Cell type Annotation
-
-``` {r, eval=FALSE}
-prostate_labels<-c("Endothelial cells",#1
- "T cells",#2
- "Epithelial_basal",#3
- "Epithelial_luminal",#4
- "Fibroblasts",#5
- "T cells",#6
- "Epithelial_luminal",#7
- "Smooth muscle cells",#8
- "Macrophage & B cells",#9
- "Fibroblasts",#10
- "Mast cells",#11
- "Mesenchymal cells",#12
- "Neural Progenitor cells")#13
-names(prostate_labels)<-1:13
-giotto_SC<-annotateGiotto(gobject = giotto_SC, annotation_vector = prostate_labels ,
- cluster_column = 'leiden_clus', name = 'prostate_labels')
-dimPlot2D(gobject = giotto_SC, dim_reduction_name = 'umap',
- cell_color = "prostate_labels", show_NN_network = T, point_size = 1.5,
- save_param = list(save_name = "7_Annotation"))
-```
-
-![](images/singlecell_rna_seq/7_Annotation.png)
-
-## Part 8: Subset and Recluster
-
-``` {r, eval=FALSE}
-Subset_giotto_T<-subsetGiotto(giotto_SC,
- cell_ids = pDataDT(giotto_SC)[which(pDataDT(giotto_SC)$prostate_labels == "T cells"),]$cell_ID)
-## PCA
-
-Subset_giotto_T <- calculateHVF(gobject = Subset_giotto_T)
-Subset_giotto_T <- runPCA(gobject = Subset_giotto_T, center = TRUE, scale_unit = TRUE)
-screePlot(Subset_giotto_T, ncp = 20, save_param = list(save_name = '8a_scree_plot'))
-```
-
-![](images/singlecell_rna_seq/8a_scree_plot.png)
-
-``` {r, eval=FALSE}
-Subset_giotto_T <- createNearestNetwork(gobject = Subset_giotto_T,
- dim_reduction_to_use = 'pca', dim_reduction_name = 'pca',
- dimensions_to_use = 1:20, k = 10)
-
-# UMAP
-Subset_giotto_T = runUMAP(Subset_giotto_T, dimensions_to_use = 1:8)
-
-# Leiden clustering
-Subset_giotto_T <- doLeidenCluster(gobject = Subset_giotto_T, resolution = 0.1, n_iterations = 1000)
-
-
-plotUMAP(gobject = Subset_giotto_T,
- cell_color = 'leiden_clus', show_NN_network = T, point_size = 1.5,
- save_param = list(save_name = "8b_Cluster"))
-```
-
-![](images/singlecell_rna_seq/8b_Cluster.png)
-
-``` {r, eval=FALSE}
-markers_scran_T = findMarkers_one_vs_all(gobject=Subset_giotto_T, method="scran",
- expression_values="normalized", cluster_column='leiden_clus', min_feats=3)
-markergenes_scran_T = unique(markers_scran_T[, head(.SD, 5), by="cluster"][["feats"]])
-
-plotMetaDataHeatmap(Subset_giotto_T, expression_values = "normalized", metadata_cols = 'leiden_clus',
- selected_feats = markergenes_scran_T,
- y_text_size = 8, show_values = 'zscores_rescaled',
- save_param = list(save_name = '8_c_metaheatmap'))
-```
-
-![](images/singlecell_rna_seq/8_c_metaheatmap.png)
-
-``` {r, eval=FALSE}
-T_labels<-c("Naive T cells",#1
- "Tfh cells",#2
- "CD8 T cells",#3
- "NK T cells",#4
- "CD4 T cells")#5
-names(T_labels)<-1:5
-Subset_giotto_T<-annotateGiotto(gobject = Subset_giotto_T, annotation_vector = T_labels ,
- cluster_column = 'leiden_clus', name = 'subset_labels')
-dimPlot2D(gobject = Subset_giotto_T, dim_reduction_name = 'umap',
- cell_color = "subset_labels", show_NN_network = T, point_size = 1.5,
- save_param = list(save_name = "8d_Annotation"))
-```
-
-![](images/singlecell_rna_seq/8d_Annotation.png)
diff --git a/vignettes/singularity.Rmd b/vignettes/singularity.Rmd
deleted file mode 100644
index 519337969..000000000
--- a/vignettes/singularity.Rmd
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: "Singularity container"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Singularity container}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Singularity container with bash terminal
-
-You can set up a Singularity container based on the [Giotto Docker Image](https://hub.docker.com/r/giottopackage/suite) able to run in a bash environment.
-
-## Instructions
-
-Follow these instructions to create your own Singularity and run
-Giotto:
-
-1. singularity pull suite.sif docker://giottopackage/suite:latest
-2. singularity shell suite.sif
-3. R
-4. Run the following **in R**:
- 1. library(Giotto)
-5. Now you can run any analysis with Giotto!
diff --git a/vignettes/spatial_citeseq_human_skin.Rmd b/vignettes/spatial_citeseq_human_skin.Rmd
deleted file mode 100644
index 6934f0e20..000000000
--- a/vignettes/spatial_citeseq_human_skin.Rmd
+++ /dev/null
@@ -1,623 +0,0 @@
----
-title: "Multi-omics Spatial CITE-Seq Human skin"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Multi-omics Spatial CITE-Seq Human skin}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# 1 Dataset explanation
-
-To run this example, we will use the Skin dataset from the article [High-plex protein and whole transcriptome co-mapping at cellular resolution with spatial CITE-seq](https://www.nature.com/articles/s41587-023-01676-0)
-
-# 2 Start Giotto
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- Giotto::installGiottoEnvironment()
-}
-```
-
-# 3 Create Giotto object
-
-```{r, eval=FALSE}
-library(Giotto)
-
-instrs <- createGiottoInstructions(save_plot = TRUE,
- save_dir = "results",
- show_plot = TRUE)
-```
-
-Create spatial coords table
-
-```{r, eval=FALSE}
-x = data.table::fread("data/GSM6578065_humanskin_RNA.tsv.gz")
-spatial_coords = data.frame(cell_ID = x$X)
-spatial_coords = cbind(spatial_coords,
- stringr::str_split_fixed(spatial_coords$cell_ID,
- pattern = "x",
- n = 2))
-colnames(spatial_coords)[2:3] = c("sdimx", "sdimy")
-spatial_coords$sdimx = as.integer(spatial_coords$sdimx)
-spatial_coords$sdimy = as.integer(spatial_coords$sdimy)
-spatial_coords$sdimy = spatial_coords$sdimy*(-1)
-```
-
-Read rna and protein expression matrix
-
-```{r, eval=FALSE}
-rna_matrix = data.table::fread("data/GSM6578065_humanskin_RNA.tsv.gz")
-rna_matrix = rna_matrix[rna_matrix$X %in% spatial_coords$cell_ID,]
-rna_matrix = rna_matrix[match(spatial_coords$cell_ID, rna_matrix$X),]
-rna_matrix = t(rna_matrix[,-1])
-colnames(rna_matrix) = spatial_coords$cell_ID
-
-protein_matrix = data.table::fread("data/GSM6578074_humanskin_protein.tsv.gz")
-protein_matrix = protein_matrix[protein_matrix$X %in% spatial_coords$cell_ID,]
-protein_matrix = protein_matrix[match(spatial_coords$cell_ID, protein_matrix$X),]
-protein_matrix = t(protein_matrix[,-1])
-colnames(protein_matrix) = spatial_coords$cell_ID
-```
-
-Create Giotto object using RNA and Protein expression, as well as spatial positions
-
-```{r, eval=FALSE}
-my_giotto_object <- createGiottoObject(expression = list(rna = list(raw = rna_matrix),
- protein = list(raw = protein_matrix)),
- expression_feat = list("rna", "protein"),
- spatial_locs = spatial_coords,
- instructions = instrs)
-```
-
-Add tissue image
-
-```{r, eval=FALSE}
-my_giotto_image <- createGiottoImage(gobject = my_giotto_object,
- do_manual_adj = TRUE,
- scale_factor = 0.5,
- mg_object = "img/skin.jpg",
- negative_y = TRUE)
-
-my_giotto_object <- addGiottoImage(gobject = my_giotto_object,
- images = list(my_giotto_image),
- spat_loc_name = "raw")
-```
-
-Visualize image
-
-```{r, eval=FALSE}
-spatPlot2D(my_giotto_object,
- point_size = 3.5)
-```
-
-![](images/spatial_citeseq_human_skin/0-spatPlot2D.png)
-
-# 4 Processing
-
-## Filtering
-
-```{r, eval=FALSE}
-# RNA
-my_giotto_object <- filterGiotto(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- expression_threshold = 1,
- feat_det_in_min_cells = 1,
- min_det_feats_per_cell = 1)
-```
-
-```{r, eval=FALSE}
-# Protein
-my_giotto_object <- filterGiotto(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- expression_threshold = 1,
- feat_det_in_min_cells = 1,
- min_det_feats_per_cell = 1)
-```
-
-## Normalization
-
-```{r, eval=FALSE}
-# RNA
-my_giotto_object <- normalizeGiotto(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- norm_methods = "standard",
- scalefactor = 10000,
- verbose = TRUE)
-```
-
-```{r, eval=FALSE}
-# Protein
-my_giotto_object <- normalizeGiotto(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- scalefactor = 6000,
- verbose = T)
-```
-
-## Statistics
-
-```{r, eval=FALSE}
-# RNA
-my_giotto_object <- addStatistics(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna")
-```
-
-```{r, eval=FALSE}
-# Protein
-my_giotto_object <- addStatistics(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- expression_values = "normalized")
-```
-
-# 5 Dimention Reduction
-
-## Principal component analysis (PCA)
-
-```{r, eval=FALSE}
-# RNA
-my_giotto_object <- runPCA(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- expression_values = "normalized",
- reduction = "cells",
- name = "rna.pca")
-```
-
-```{r, eval=FALSE}
-# Protein
-my_giotto_object <- runPCA(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- expression_values = "normalized",
- scale_unit = T,
- center = F,
- method = "factominer")
-```
-
-# 6 Clustering
-
-## Uniform manifold approximation projection (UMAP)
-
-```{r, eval=FALSE}
-# RNA
-my_giotto_object <- runUMAP(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- expression_values = "normalized",
- reduction = "cells",
- dimensions_to_use = 1:10,
- dim_reduction_name = "rna.pca")
-```
-
-```{r, eval=FALSE}
-# Protein
-my_giotto_object <- runUMAP(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- expression_values = "normalized",
- dimensions_to_use = 1:10)
-```
-
-## Create nearest network
-
-```{r, eval=FALSE}
-# RNA
-my_giotto_object <- createNearestNetwork(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- type = "sNN",
- dim_reduction_to_use = "pca",
- dim_reduction_name = "rna.pca",
- dimensions_to_use = 1:10,
- k = 20)
-```
-
-```{r, eval=FALSE}
-# Protein
-my_giotto_object <- createNearestNetwork(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- type = "sNN",
- name = "protein_sNN.pca",
- dimensions_to_use = 1:10,
- k = 20)
-```
-
-## Find Leiden clusters
-
-```{r, eval=FALSE}
-# RNA
-my_giotto_object <- doLeidenCluster(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- nn_network_to_use = "sNN",
- name = "leiden_clus",
- resolution = 1)
-```
-
-```{r, eval=FALSE}
-# Protein
-my_giotto_object <- doLeidenCluster(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- nn_network_to_use = "sNN",
- network_name = "protein_sNN.pca",
- name = "leiden_clus",
- resolution = 1)
-```
-
-## Plot PCA
-
-```{r, eval=FALSE}
-# RNA
-plotPCA(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- dim_reduction_name = "rna.pca",
- cell_color = 'leiden_clus',
- title = "RNA PCA")
-```
-
-![](images/spatial_citeseq_human_skin/1-PCA.png)
-
-```{r, eval=FALSE}
-# Protein
-plotPCA(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- dim_reduction_name = "protein.pca",
- cell_color = 'leiden_clus',
- title = "Protein PCA")
-```
-
-![](images/spatial_citeseq_human_skin/2-PCA.png)
-
-## Plot UMAP
-
-```{r, eval=FALSE}
-# RNA
-plotUMAP(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- cell_color = 'leiden_clus',
- point_size = 2,
- title = "RNA Uniform Manifold Approximation & Projection (UMAP)",
- axis_title = 12,
- axis_text = 10 )
-```
-
-![](images/spatial_citeseq_human_skin/3-UMAP.png)
-
-```{r, eval=FALSE}
-# Protein
-plotUMAP(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- cell_color = 'leiden_clus',
- dim_reduction_name = "protein.umap",
- point_size = 2,
- title = "Protein Uniform Manifold Approximation & Projection (UMAP)",
- axis_title = 12,
- axis_text = 10 )
-```
-
-![](images/spatial_citeseq_human_skin/4-UMAP.png)
-
-## Plot spatial locations by cluster
-
-```{r, eval=FALSE}
-# RNA
-spatPlot2D(my_giotto_object,
- show_image = TRUE,
- point_size = 3.5,
- cell_color = "leiden_clus",
- title = "RNA Leiden clustering")
-```
-
-![](images/spatial_citeseq_human_skin/5-spatPlot2D.png)
-
-```{r, eval=FALSE}
-# Protein
-spatPlot2D(my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- cell_color = "leiden_clus",
- point_size = 3.5,
- show_image = TRUE,
- title = "Protein Leiden clustering")
-```
-
-![](images/spatial_citeseq_human_skin/6-spatPlot2D.png)
-
-# 7 Multi-omics integration
-
-## Create nearest network
-
-```{r, eval=FALSE}
-my_giotto_object <- createNearestNetwork(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- type = "kNN",
- dim_reduction_name = "rna.pca",
- name = "rna_kNN.pca",
- dimensions_to_use = 1:10,
- k = 20)
-```
-
-```{r, eval=FALSE}
-my_giotto_object <- createNearestNetwork(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "protein",
- type = "kNN",
- name = "protein_kNN.pca",
- dimensions_to_use = 1:10,
- k = 20)
-```
-
-## Calculate WNN
-
-```{r, eval=FALSE}
-my_giotto_object <- runWNN(my_giotto_object,
- modality_1 = "rna",
- modality_2 = "protein",
- pca_name_modality_1 = "rna.pca",
- pca_name_modality_2 = "protein.pca",
- k = 20)
-```
-
-## Create integrated UMAP
-
-```{r, eval=FALSE}
-my_giotto_object <- runIntegratedUMAP(my_giotto_object,
- modality1 = "rna",
- modality2 = "protein")
-```
-
-## Calculate Leiden clusters
-
-```{r, eval=FALSE}
-my_giotto_object <- doLeidenCluster(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- nn_network_to_use = "kNN",
- network_name = "integrated_kNN",
- name = "integrated_leiden_clus",
- resolution = 0.7)
-```
-
-## Plot integrated UMAP
-
-```{r, eval=FALSE}
-plotUMAP(gobject = my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- cell_color = 'integrated_leiden_clus',
- dim_reduction_name = "integrated.umap",
- point_size = 2.5,
- title = "Integrated UMAP using Integrated Leiden clusters",
- axis_title = 12,
- axis_text = 10)
-```
-
-![](images/spatial_citeseq_human_skin/7-UMAP.png)
-
-## Plot integrated spatial locations by cluster
-
-```{r, eval=FALSE}
-spatPlot2D(my_giotto_object,
- spat_unit = "cell",
- feat_type = "rna",
- cell_color = "integrated_leiden_clus",
- point_size = 3.5,
- show_image = TRUE,
- title = "Integrated Leiden clustering")
-```
-
-![](images/spatial_citeseq_human_skin/8-spatPlot2D.png)
-
-# 8 Calculate spatially variable genes
-
-```{r, eval=FALSE}
-my_giotto_object <- createSpatialNetwork(gobject = my_giotto_object,
- method = 'kNN',
- k = 6,
- maximum_distance_knn = 5,
- name = 'spatial_network')
-
-ranktest = binSpect(my_giotto_object,
- bin_method = 'rank',
- calc_hub = T,
- hub_min_int = 5,
- spatial_network_name = 'spatial_network')
-
-spatFeatPlot2D(my_giotto_object,
- expression_values = 'scaled',
- feats = ranktest$feats[1:6],
- cow_n_col = 2,
- point_size = 1.5)
-```
-
-![](images/spatial_citeseq_human_skin/9-spatFeatPlot2D.png)
-
-## Spatially correlated genes
-
-```{r, eval=FALSE}
-# 3.1 cluster the top 500 spatial genes into 20 clusters
-ext_spatial_genes = ranktest[1:500,]$feats
-
-# here we use existing detectSpatialCorGenes function to calculate pairwise distances between genes (but set network_smoothing=0 to use default clustering)
-spat_cor_netw_DT = detectSpatialCorFeats(my_giotto_object,
- method = 'network',
- spatial_network_name = 'spatial_network',
- subset_feats = ext_spatial_genes)
-```
-
-```{r, eval=FALSE}
-# 3.3 identify potenial spatial co-expression
-spat_cor_netw_DT = clusterSpatialCorFeats(spat_cor_netw_DT,
- name = 'spat_netw_clus',
- k = 3)
-
-# visualize clusters
-heatmSpatialCorFeats(my_giotto_object,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- heatmap_legend_param = list(title = NULL),
- save_param = list(base_height = 6,
- base_width = 8,
- units = 'cm'))
-```
-
-![](images/spatial_citeseq_human_skin/10-heatmSpatialCorFeats.png)
-
-# 9 Metagenes/co-expression modules
-
-```{r, eval=FALSE}
-# 3.4 create metagenes / co-expression modules
-cluster_genes = getBalancedSpatCoexpressionFeats(spat_cor_netw_DT,
- maximum = 30)
-
-my_giotto_object = createMetafeats(my_giotto_object,
- feat_clusters = cluster_genes,
- name = 'cluster_metagene')
-
-spatCellPlot(my_giotto_object,
- spat_enr_names = 'cluster_metagene',
- cell_annotation_values = as.character(c(1:7)),
- point_size = 1,
- cow_n_col = 3)
-```
-
-![](images/spatial_citeseq_human_skin/11-spatCellPlot2D.png)
-
-# 10 Spatially informed clustering
-
-```{r, eval=FALSE}
-my_spatial_genes = names(cluster_genes)
-
-my_giotto_object <- runPCA(gobject = my_giotto_object,
- feats_to_use = my_spatial_genes,
- name = 'custom_pca')
-
-my_giotto_object <- runUMAP(my_giotto_object,
- dim_reduction_name = 'custom_pca',
- dimensions_to_use = 1:20,
- name = 'custom_umap')
-
-my_giotto_object <- createNearestNetwork(gobject = my_giotto_object,
- dim_reduction_name = 'custom_pca',
- dimensions_to_use = 1:20,
- k = 3,
- name = 'custom_NN')
-
-my_giotto_object <- doLeidenCluster(gobject = my_giotto_object,
- network_name = 'custom_NN',
- resolution = 0.1,
- n_iterations = 1000,
- name = 'custom_leiden')
-
-spatPlot2D(my_giotto_object,
- show_image = FALSE,
- cell_color = 'custom_leiden',
- cell_color_code = c("#eb4034",
- "#5877e8",
- "#ebd834",
- "#9beb34",
- "#6fab6a",
- "#24703f",
- "#58e8cb",
- "#58d0e8",
- "#eb8f34",
- "#7f58e8",
- "#d758e8",
- "#e85892"),
- point_size = 3.5,
- background_color = "black",
- title = "Spatially informed clustering")
-```
-
-![](images/spatial_citeseq_human_skin/12-spatPlot2D.png)
-
-# 11 Session Info
-
-```{r, eval = FALSE}
-sessionInfo()
-```
-
-```{r, eval = FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.3
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] Giotto_4.0.2 GiottoClass_0.1.3
-
-loaded via a namespace (and not attached):
- [1] colorRamp2_0.1.0 bitops_1.0-7 rlang_1.1.3
- [4] magrittr_2.0.3 clue_0.3-65 GetoptLong_1.0.5
- [7] GiottoUtils_0.1.4 matrixStats_1.2.0 compiler_4.3.2
- [10] png_0.1-8 systemfonts_1.0.5 vctrs_0.6.5
- [13] stringr_1.5.1 shape_1.4.6 pkgconfig_2.0.3
- [16] SpatialExperiment_1.12.0 crayon_1.5.2 fastmap_1.1.1
- [19] backports_1.4.1 magick_2.8.2 XVector_0.42.0
- [22] labeling_0.4.3 utf8_1.2.4 rmarkdown_2.25
- [25] ragg_1.2.7 xfun_0.42 zlibbioc_1.48.0
- [28] beachmat_2.18.0 GenomeInfoDb_1.38.6 jsonlite_1.8.8
- [31] flashClust_1.01-2 DelayedArray_0.28.0 BiocParallel_1.36.0
- [34] terra_1.7-71 irlba_2.3.5.1 parallel_4.3.2
- [37] cluster_2.1.6 R6_2.5.1 RColorBrewer_1.1-3
- [40] stringi_1.8.3 reticulate_1.35.0 GenomicRanges_1.54.1
- [43] estimability_1.4.1 iterators_1.0.14 Rcpp_1.0.12
- [46] SummarizedExperiment_1.32.0 knitr_1.45 R.utils_2.12.3
- [49] FNN_1.1.4 IRanges_2.36.0 igraph_2.0.1.1
- [52] Matrix_1.6-5 tidyselect_1.2.0 rstudioapi_0.15.0
- [55] abind_1.4-5 yaml_2.3.8 doParallel_1.0.17
- [58] codetools_0.2-19 lattice_0.22-5 tibble_3.2.1
- [61] Biobase_2.62.0 withr_3.0.0 evaluate_0.23
- [64] circlize_0.4.15 pillar_1.9.0 MatrixGenerics_1.14.0
- [67] foreach_1.5.2 checkmate_2.3.1 DT_0.31
- [70] stats4_4.3.2 dbscan_1.1-12 generics_0.1.3
- [73] RCurl_1.98-1.14 S4Vectors_0.40.2 ggplot2_3.4.4
- [76] munsell_0.5.0 scales_1.3.0 gtools_3.9.5
- [79] xtable_1.8-4 leaps_3.1 glue_1.7.0
- [82] emmeans_1.10.0 scatterplot3d_0.3-44 tools_4.3.2
- [85] GiottoVisuals_0.1.4 data.table_1.15.0 ScaledMatrix_1.10.0
- [88] mvtnorm_1.2-4 Cairo_1.6-2 cowplot_1.1.3
- [91] grid_4.3.2 colorspace_2.1-0 SingleCellExperiment_1.24.0
- [94] GenomeInfoDbData_1.2.11 BiocSingular_1.18.0 cli_3.6.2
- [97] rsvd_1.0.5 textshaping_0.3.7 fansi_1.0.6
-[100] S4Arrays_1.2.0 ComplexHeatmap_2.18.0 dplyr_1.1.4
-[103] uwot_0.1.16 gtable_0.3.4 R.methodsS3_1.8.2
-[106] digest_0.6.34 BiocGenerics_0.48.1 SparseArray_1.2.3
-[109] ggrepel_0.9.5 FactoMineR_2.9 rjson_0.2.21
-[112] htmlwidgets_1.6.4 farver_2.1.1 htmltools_0.5.7
-[115] R.oo_1.26.0 lifecycle_1.0.4 multcompView_0.1-9
-[118] GlobalOptions_0.1.2 MASS_7.3-60.0.1
-```
diff --git a/vignettes/spatial_genomics_mouse_kidney.Rmd b/vignettes/spatial_genomics_mouse_kidney.Rmd
deleted file mode 100644
index ed8cf425e..000000000
--- a/vignettes/spatial_genomics_mouse_kidney.Rmd
+++ /dev/null
@@ -1,378 +0,0 @@
----
-title: "Spatial Genomics Mouse Kidney"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Spatial Genomics Mouse Kidney}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-# 1. Dataset explanation
-
-This tutorial covers Giotto object creation and simple exploratory analysis with the gene expression data generated on Spatial Genomics' GenePS instrument of kidney tissue resected from a 2-month-old female mouse. The data was generated using sequential fluorescence in situ hybridization (seqFISH) to visualize 220 genes directly in the sample.
-
-# 2. Start Giotto
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure Giotto Data is installed
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-# 3. Project Data Paths
-
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-# Set path to folder containing spatial genomics data
-datadir = '/path/to/Spatial/Genomics/data/'
-
-dapi = paste0(datadir, 'SG_MouseKidneyDataRelease_DAPI_section1.ome.tiff')
-mask = paste0(datadir, 'SG_MouseKidneyDataRelease_CellMask_section1.tiff')
-tx = paste0(datadir, 'SG_MouseKidneyDataRelease_TranscriptCoordinates_section1.csv')
-```
-
-
-# 4. Create a Giotto object
-
-
-```{r, eval=FALSE}
-# Create and plot giotto polygons
-gpoly = createGiottoPolygonsFromMask(mask, shift_vertical_step = F,
- shift_horizontal_step = F,
- flip_horizontal = F,
- flip_vertical = F)
-plot(gpoly)
-
-# Create and plot giotto points
-tx = data.table::fread(tx)
-gpoints = createGiottoPoints(tx)
-plot(gpoints, raster_size = 1e3)
-
-# Create giottoLargeImage and giottoObject
-gimg = createGiottoLargeImage(dapi, use_rast_ext = TRUE)
-
-sg = createGiottoObjectSubcellular(gpoints = list('rna' = gpoints),
- gpolygons = list('cell' = gpoly))
-sg = addGiottoLargeImage(sg, largeImages = list(image = gimg))
-```
-
-
-![](images/spatial_genomics_mouse_kidney/Polygons.png)
-
-![](images/spatial_genomics_mouse_kidney/Points.png)
-
-# 5. Aggregate, Normalize, and Filter Giotto Data
-
-
-```{r, eval=FALSE}
-# Aggregate
-sg = calculateOverlapRaster(sg,
- spatial_info = 'cell',
- feat_info = 'rna')
-sg = overlapToMatrix(sg)
-sg = addSpatialCentroidLocations(sg)
-# Filter and Normalize
-filterDistributions(sg, detection = 'feats')
-filterDistributions(sg, detection = 'cells')
-sg = filterGiotto(sg, feat_det_in_min_cells = 100, min_det_feats_per_cell = 20, expression_threshold = 1)
-sg = normalizeGiotto(sg)
-# Statistics
-sg = addStatistics(sg)
-```
-
-
-# 6. Dimension Reduction
-
-## 6.1 Highly Variable Features
-
-
-```{r, eval=FALSE}
-# Calculate highly variable features
-sg = calculateHVF(gobject = sg)
-cat(fDataDT(sg)[, sum(hvf == 'yes')], 'hvf found')
-# Only 18 hvf found -> better to use ALL genes -> feats_to_use = NULL
-sg = runPCA(gobject = sg,
- spat_unit = 'cell',
- expression_values = 'scaled',
- feats_to_use = NULL,
- scale_unit = F,
- center = F)
-```
-
-
-![](images/spatial_genomics_mouse_kidney/HVF.png)
-
-## 6.2 PCA
-
-
-```{r, eval=FALSE}
-# Visualize Screeplot and PCA
-screePlot(sg,
- ncp = 20,
- save_param = list(
- save_name = 'sg_screePlot'))
-plotPCA(sg,
- spat_unit = 'cell',
- dim_reduction_name = 'pca',
- dim1_to_use = 1,
- dim2_to_use = 2)
-```
-
-
-![](images/spatial_genomics_mouse_kidney/PCA.png)
-
-## 6.3 tSNE and UMAP
-
-
-```{r, eval=FALSE}
-# Run and Plot tSNE and UMAP
-sg = runtSNE(sg,
- dimensions_to_use = 1:10,
- spat_unit = 'cell',
- check_duplicates = FALSE)
-sg = runUMAP(sg,
- dimensions_to_use = 1:10,
- spat_unit = 'cell')
-plotTSNE(sg,
- point_size = 0.01,
- save_param = list(
- save_name = 'sg_tSNE'))
-plotUMAP(sg,
- point_size = 0.01,
- save_param = list(
- save_name = 'sg_UMAP'))
-```
-
-
-![](images/spatial_genomics_mouse_kidney/TSNE.png)
-
-![](images/spatial_genomics_mouse_kidney/UMAP.png)
-
-# 7. Clustering
-
-## 7.1 UMAP Leiden Clustering
-
-
-```{r, eval=FALSE}
-# Clustering and UMAP cluster visualization
-sg = createNearestNetwork(sg,
- dimensions_to_use = 1:10,
- k = 10,
- spat_unit = 'cell')
-sg = doLeidenCluster(sg,
- resolution = 0.25,
- n_iterations = 100,
- spat_unit = 'cell')
-# Plot Leiden clusters onto UMAP
-plotUMAP(gobject = sg,
- spat_unit = 'cell',
- cell_color = 'leiden_clus',
- show_legend = FALSE,
- point_size = 0.01,
- point_shape = 'no_border',
- save_param = list(save_name = 'sg_umap_leiden'))
-```
-
-
-![](images/spatial_genomics_mouse_kidney/LeidenUMAP.png)
-
-## 7.2 Spatial Leiden Clustering
-
-
-```{r, eval=FALSE}
-# Plot Leiden clusters onto spatial image plot
-my_spatPlot <- spatPlot2D(gobject = sg,
- spat_unit = 'cell',
- cell_color = 'leiden_clus',
- point_size = 0.4,
- point_shape = 'no_border',
- show_legend = TRUE,
- image_name = gimg,
- save_param = list(
- save_name = 'sg_spat_leiden',
- base_width = 15,
- base_height = 15))
-```
-
-
-![](images/spatial_genomics_mouse_kidney/LeidenSpatPlot6.png)
-
-# 8. Cell Type Marker Gene Detection
-
-
-```{r, eval=FALSE}
-# Identify gene markers per cluster
-markers = findMarkers_one_vs_all(gobject = sg,
- method = 'gini',
- expression_values = 'normalized',
- cluster_column = 'leiden_clus',
- min_feats = 1, rank_score = 2)
-# Display details about the marker genes
-markers[, head(.SD, 2), by = 'cluster']
-# Violinplots to show marker expression
-topgini_genes = unique(markers[, head(.SD, 2), by = 'cluster'])
-violinPlot(sg, feats = topgini_genes$feats[1:10], cluster_column = 'leiden_clus')
-violinPlot(sg, feats = topgini_genes$feats[11:20], cluster_column = 'leiden_clus')
-# Known markers to Annotate Giotto
-selected_genes = c('My12', 'G6pc', 'Ppp1r1a', 'Grik5', 'Hsd11b2', 'Rhbg', 'Mapk11',
- 'Egf17', 'Gpr55', 'Acsm2', 'Tpm2', 'D1c1', 'Shisa3',
- 'Tspan2', 'Sox17', 'Eef2', 'Cd79b', 'Ctss', 'Serpina1f', 'Cyp51')
-
-gobject_cell_metadata = pDataDT(sg)
-cluster_order = unique(gobject_cell_metadata$leiden_clus)
-# Plot markers to clusters heatmap
-plotMetaDataHeatmap(sg, expression_values = 'scaled',
- metadata_cols = c('leiden_clus'),
- selected_feats = selected_genes,
- custom_feat_order = rev(selected_genes),
- custom_cluster_order = cluster_order)
-```
-
-
-![](images/spatial_genomics_mouse_kidney/GeneExpressionViolin.png)
-
-![](images/spatial_genomics_mouse_kidney/ClusterHeatMap.png)
-
-# 9. Spatial Gene Expression Patterns
-
-## 9.1 Establish Delaunay Network
-
-
-```{r, eval=FALSE}
-plotStatDelaunayNetwork(gobject = sg, maximum_distance = 250)
-sg = createSpatialNetwork(gobject = sg, minimum_k = 2,
- maximum_distance_delaunay = 250)
-sg = createSpatialNetwork(gobject = sg, minimum_k = 2,
- method = 'kNN', k = 10)
-```
-
-
-![](images/spatial_genomics_mouse_kidney/DelaunayGraphs.png)
-
-## 9.2 Binspect by K-Means
-
-
-```{r, eval=FALSE}
-km_spatialgenes = binSpect(sg)
-spatFeatPlot2D(sg, expression_values = 'scaled',
- feats = km_spatialgenes[1:4]$feats,
- point_shape = 'no_border',
- show_network = F, network_color = 'lightgrey', point_size = 0.5,
- cow_n_col = 2)
-```
-
-
-![](images/spatial_genomics_mouse_kidney/KMeansBinSpect.png)
-
-## 9.3 Binspect by Rank
-
-
-```{r, eval=FALSE}
-rank_spatialgenes = binSpect(sg, bin_method = 'rank')
-spatFeatPlot2D(sg, expression_values = 'scaled',
- feats = rank_spatialgenes[1:4]$feats,
- point_shape = 'no_border',
- show_network = F, network_color = 'lightgrey', point_size = 0.5,
- cow_n_col = 2)
-```
-
-
-![](images/spatial_genomics_mouse_kidney/RankBinSpect.png)
-
-# 10. Spatial Co-Expression Patterns
-
-
-```{r, eval=FALSE}
-# Spatial Co-Expression
-spatial_genes = km_spatialgenes[1:500]$feats
-
-# 1. create spatial correlation object
-spat_cor_obj = detectSpatialCorFeats(sg,
- method = 'network',
- spatial_network_name = 'Delaunay_network',
- subset_feats = spatial_genes)
-
-# 2. identify most similar spatially correlated genes for one gene
-Acsm2_top10_genes = showSpatialCorFeats(spat_cor_obj, feats = 'Acsm2', show_top_feats = 10)
-
-spatFeatPlot2D(sg, expression_values = 'scaled',
- feats = Acsm2_top10_genes$variable[1:4], point_size = 0.5,
- point_shape = 'no_border')
-```
-
-
-![](images/spatial_genomics_mouse_kidney/Acsm2_SpatialCor.png)
-
-
-```{r, eval=FALSE}
-# 3. cluster correlated genes & visualize
-spat_cor_obj = clusterSpatialCorFeats(spat_cor_obj, name = 'spat_netw_clus', k = 10)
-
-heatmSpatialCorFeats(sg, spatCorObject = spat_cor_obj, use_clus_name = 'spat_netw_clus',
- heatmap_legend_param = list(title = 'Spatial Correlation'))
-```
-
-
-![](images/spatial_genomics_mouse_kidney/SpatialCorHeatMap.png)
-
-
-```{r, eval=FALSE}
-# 4. rank spatial correlated clusters and show genes for selected clusters
-netw_ranks = rankSpatialCorGroups(sg, spatCorObject = spat_cor_obj,
- use_clus_name = 'spat_netw_clus')
-top_netw_spat_cluster = showSpatialCorFeats(spat_cor_obj, use_clus_name = 'spat_netw_clus',
- show_top_feats = 1)
-```
-
-
-![](images/spatial_genomics_mouse_kidney/RankSpatialCorGroups.png)
-
-
-```{r, eval=FALSE}
-# 5. create metagene enrichment score for clusters
-cluster_genes = top_netw_spat_cluster$clus; names(cluster_genes) = top_netw_spat_cluster$feat_ID
-
-sg = createMetafeats(sg, feat_clusters = cluster_genes, name = 'cluster_metagene')
-spatCellPlot(sg,
- spat_enr_names = 'cluster_metagene',
- cell_annotation_values = netw_ranks[1:4]$clusters,
- point_size = 0.05, point_shape = 'no_border')
-spatCellPlot(sg,
- spat_enr_names = 'cluster_metagene',
- cell_annotation_values = netw_ranks[5:8]$clusters,
- point_size = 0.05, point_shape = 'no_border')
-spatCellPlot(sg,
- spat_enr_names = 'cluster_metagene',
- cell_annotation_values = netw_ranks[9:10]$clusters,
- point_size = 0.05, point_shape = 'no_border')
-```
-
-
-![](images/spatial_genomics_mouse_kidney/SpatialCorClusters2.png)
-
-## 10.1 Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
diff --git a/vignettes/spatial_transformations.Rmd b/vignettes/spatial_transformations.Rmd
deleted file mode 100644
index 64489ff32..000000000
--- a/vignettes/spatial_transformations.Rmd
+++ /dev/null
@@ -1,273 +0,0 @@
----
-title: "Spatial Transformations"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Spatial Transformations}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-# 1. Spatial Object Manipulation
-
-Spatial-omics data is defined both by the biological information that it contains and the way that it maps to space. When assembling and analyzing a spatial dataset, it may be necessary to spatially manipulate the data so that they are all in a common coordinate reference frame where all data is in at the same scaling and rotation, and properly overlaid.
-
-*Giotto* extends a set of generics from *terra* in order to make it simple to figure out where data is in space and to move it where you need it.
-
-# 2. Start Giotto
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure Giotto Data is installed
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-# 3. Load mini giotto object example
-
-First we will load in the a mini dataset put together from Vizgen's Mouse Brain Receptor Map data release. This mini giotto object has been pre-analyzed and comes with many analyses and data objects attached. Most of these analyses have been performed on the 'aggregate' spatial unit so we will set it as the active spatial unit in order to default to it.
-
-
-```{r, eval=FALSE}
-library(Giotto)
-
-viz <- GiottoData::loadGiottoMini(dataset = 'vizgen')
-activeSpatUnit(viz) <- 'aggregate'
-```
-
-
-# 4. Extract spatial info
-
-Then we will extract the spatial subobjects that we will use. These will be all subobjects in Giotto that contain coordinates data or directly map their data to space.
-
-
-```{r, eval=FALSE}
-image <- getGiottoImage(viz, image_type = 'largeImage', name = 'dapi_z0')
-spat_locs <- getSpatialLocations(viz)
-spat_net <- getSpatialNetwork(viz)
-gpoints <- getFeatureInfo(viz, return_giottoPoints = TRUE)
-gpoly <- getPolygonInfo(viz, polygon_name = 'aggregate', return_giottoPolygon = TRUE)
-```
-
-
-# 5. Defining bounds and extent
-
-One of the most convenient descriptors of where an object is in space is its minima and maxima in the coordinate plane, also known as the boundaries or spatial **extent** of that information. It can be thought of as bounding box around where your information exists in space. *Giotto* incorporates usage of the `SpatExtent` class and associated `ext()` generic from *terra* to describe objects spatially.
-
-
-```{r, eval=FALSE}
-ext(image) # giottoLargeImage
-```
-
-```{r, eval=FALSE}
-SpatExtent : 6400.029, 6900.037, -5150.007, -4699.967 (xmin, xmax, ymin, ymax)
-```
-
-```{r, eval=FALSE}
-ext(spat_locs) # spatLocsObj
-```
-
-```{r, eval=FALSE}
-SpatExtent : 6401.41164725267, 6899.10802819571, -5146.74746408943, -4700.32590047134 (xmin, xmax, ymin, ymax)
-```
-
-```{r, eval=FALSE}
-ext(spat_net) # spatNetObj
-```
-
-```{r, eval=FALSE}
-SpatExtent : 6401.411647, 6899.108028, -5146.747464, -4700.3259 (xmin, xmax, ymin, ymax)
-```
-
-```{r, eval=FALSE}
-ext(gpoints) # giottoPoints
-```
-
-```{r, eval=FALSE}
-SpatExtent : 6400.037, 6900.0317, -5149.9834, -4699.9785 (xmin, xmax, ymin, ymax)
-```
-
-```{r, eval=FALSE}
-ext(gpoly) # giottoPolygon
-```
-
-```{r, eval=FALSE}
-SpatExtent : 6391.46568586489, 6903.57332779812, -5153.89721175534, -4694.86823300896 (xmin, xmax, ymin, ymax)
-```
-
-
-## 5.1 Image extent
-
-With `giottoLargeImage` objects, you are additionally able to assign how they map to space using `ext()`. Note that modifications performed on one `giottoLargeImage` are applied to all references to that object unless `copy()` is used first.
-
-
-```{r, eval=FALSE}
-e <- ext(image) # save extent
-plot(image)
-```
-
-
-![](images/spatial_transformations/unnamed-chunk-5-1.png)
-
-
-```{r, eval=FALSE}
-# modify extent
-ext(image) <- c(0,40,0,10) # xmin, xmax, ymin, ymax
-plot(image)
-```
-
-
-![](images/spatial_transformations/unnamed-chunk-5-2.png)
-
-
-```{r, eval=FALSE}
-ext(image) <- e # replace
-```
-
-
-# 6. Spatial Transformations
-
-Commonly used spatial transformations are coordinate translations, flips, and rotations. *Giotto* extends generics from *terra* through the use of `spatShift()` (`shift()` in *terra*), `flip()`, and `spin()` respectively.
-
-## 6.1 coordinate translation
-
-`spatShift()` is used for simple coordinate translations. It takes the params `dx` and `dy` for distance to translate along either axis.
-
-
-```{r, eval=FALSE}
-plot(spat_locs)
-```
-
-
-![](images/spatial_transformations/unnamed-chunk-6-1.png)
-
-
-```{r, eval=FALSE}
-plot(spatShift(spat_locs, dx = 5e3))
-```
-
-
-![](images/spatial_transformations/unnamed-chunk-6-2.png)
-
-
-
-(pay attention to the x coords)
-
-## 6.2 flip
-
-`flip()` will flip the data over a defined line of either 'vertical' or 'horizontal' symmetry (default is 'vertical' with the line of symmetry being y = 0. The `direction` param partial matches for either 'vertical' or 'horizontal'. The `y0` and `x0` params define where the line of symmetry is.
-
-This is useful for assembling datasets where the data is based on coordinates where the y values increase negatively. This behavior is different from the default behavior in *terra* where objects are flipped over the minima of their extents. This difference is needed because often, values are defined in reference to the coordinate origin and any distance away from the axes is meaningful for alignment after flipping. If the default behavior of flipping over the extent is desired, NULL can be passed to the relevant `y0` or `x0` param.
-
-
-```{r, eval=FALSE}
-rb = getRainbowColors(100)
-plot(gpoly, col = rb)
-```
-
-
-![](images/spatial_transformations/unnamed-chunk-7-1.png)
-
-
-```{r, eval=FALSE}
-plot(flip(gpoly), col = rb) # flip to positive y
-```
-
-
-![](images/spatial_transformations/unnamed-chunk-7-2.png)
-
-
-```{r, eval=FALSE}
-plot(flip(gpoly, direction = 'h', x0 = 1e4), col = rb) # flip across x = 10000
-```
-
-
-![](images/spatial_transformations/unnamed-chunk-7-3.png)
-
-
-
-## 6.3 spin
-
-`spin()` allows rotating of vector data through degrees passed to `angle` param. The rotation happens about a coordinate defined by `x0` and `y0`. By default `x0` and `y0` are defined as the object center.
-
-
-```{r, eval=FALSE}
-plot(gpoints)
-```
-
-
-![](images/spatial_transformations/unnamed-chunk-8-1.png)
-
-
-```{r, eval=FALSE}
-plot(spin(gpoints, angle = 45))
-```
-
-
-![](images/spatial_transformations/unnamed-chunk-8-2.png)
-
-
-```{r, eval=FALSE}
-plot(spin(gpoints, angle = 45, x0 = 0, y0 = 0))
-```
-
-
-![](images/spatial_transformations/unnamed-chunk-8-3.png)
-
-
-
-# 7. Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
- R version 4.2.1 (2022-06-23)
- Platform: x86_64-apple-darwin17.0 (64-bit)
- Running under: macOS Big Sur ... 10.16
-
- Matrix products: default
- BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
- LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
-
- locale:
- [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
- attached base packages:
- [1] stats graphics grDevices utils datasets methods base
-
- other attached packages:
- [1] GiottoData_0.2.3 Giotto_3.3.1
-
- loaded via a namespace (and not attached):
- [1] Rcpp_1.0.11 pillar_1.9.0 compiler_4.2.1 tools_4.2.1
- [5] digest_0.6.31 scattermore_0.8 checkmate_2.2.0 jsonlite_1.8.4
- [9] evaluate_0.21 lifecycle_1.0.3 tibble_3.2.1 gtable_0.3.3
- [13] lattice_0.20-45 png_0.1-8 pkgconfig_2.0.3 rlang_1.1.1
- [17] igraph_1.4.2 Matrix_1.5-4 cli_3.6.1 rstudioapi_0.14
- [21] parallel_4.2.1 yaml_2.3.7 xfun_0.39 fastmap_1.1.1
- [25] terra_1.7-39 withr_2.5.0 dplyr_1.1.2 knitr_1.42
- [29] generics_0.1.3 vctrs_0.6.2 rprojroot_2.0.3 grid_4.2.1
- [33] tidyselect_1.2.0 here_1.0.1 reticulate_1.28 glue_1.6.2
- [37] data.table_1.14.8 R6_2.5.1 fansi_1.0.4 rmarkdown_2.21
- [41] ggplot2_3.4.2 magrittr_2.0.3 backports_1.4.1 scales_1.2.1
- [45] codetools_0.2-18 htmltools_0.5.5 colorspace_2.1-0 utf8_1.2.3
- [49] munsell_0.5.0
-
-```
diff --git a/vignettes/structure.Rmd b/vignettes/structure.Rmd
deleted file mode 100644
index 0757d9f9a..000000000
--- a/vignettes/structure.Rmd
+++ /dev/null
@@ -1,731 +0,0 @@
----
-title: "An introduction to the Giotto Suite classes"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{An introduction to the Giotto Suite classes}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-*Giotto* is a technique-agnostic framework and toolbox for spatial-omic analysis. Its structure and classes are designed to be flexible, intuitive, and readable. The framework supports working with both aggregate (cell x count) and un-aggregated spatial data where the polygon annotations are separate from the spatial expression data.
-
-# 1. Giotto Object Structure
-
-Usage of the *Giotto* package revolves around the `giotto` object. This is an S4 class that holds spatial expression data and facilitates its manipulation and visualization with the *Giotto* package's functions. Additional metadata and other outputs generated from certain functions, which may be used in downstream analyses, are also be stored within the `giotto` object. Its self-contained nature provides a convenient representation of the entire spatial experiment and is why most *Giotto* functions take a given `giotto` object as input and return a `giotto` object as output.
-
-Data is organized within the `giotto` object in defined `slots` as described in the diagram below.
-
-![](images/structure/Giotto_suite_object-01.svg)
-![](images/structure/Giotto_suite_object-02.svg)
-![](images/structure/Giotto_suite_object-03.svg)
-
-# 2. Nested Organization of the Giotto Object
-
-Biology happens across multiple scales of size and types of modalities. While it is possible to simply generate a new object for each combination of the two, the fact that data from most spatial methods are both high resolution and spatially contiguous, requires a more flexible approach that permits the coexistence of multiple spatial units within the same object. This allows the user to define the spatial unit(s) of biology that are most relevant to the analysis and re-aggregate the feature information to those units.
-
-With this organization it is convenient to compare expression across different spatial units. Additionally, by determining spatial overlaps between these spatial units, it becomes possible to represent the hierarchical organization of biological subunits and make queries using it.
-
-## 2.1 Spatial unit and feature type
-
-To accommodate this complexity, information is subnested within many of the `giotto` object's slots first by `spat_unit` (spatial unit) and then by `feat_type` (feature type). This structurally separates each set of information within *Giotto*'s framework so that there is minimal ambiguity.
-
-A summary of what information the object contains can be viewed by directly returning it.
-
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-library(data.table)
-
-vizmini = loadGiottoMini('vizgen')
-```
-
-
-
-```{r, eval=FALSE}
-vizmini
-```
-
-```{r, eval=FALSE}
- An object of class giotto
- >Active spat_unit: z0
- >Active feat_type: rna
- [SUBCELLULAR INFO]
- polygons : z0 z1 aggregate
- features : rna
- [AGGREGATE INFO]
- expression -----------------------
- [z0][rna] raw
- [z1][rna] raw
- [aggregate][rna] raw normalized scaled pearson
- spatial locations ----------------
- [z0] raw
- [z1] raw
- [aggregate] raw
- spatial networks -----------------
- [aggregate] Delaunay_network kNN_network
- spatial enrichments --------------
- [aggregate][rna] cluster_metagene
- dim reduction --------------------
- [aggregate][rna] pca umap tsne
- nearest neighbor networks --------
- [aggregate][rna] sNN.pca
- attached images ------------------
- giottoLargeImage : 4 items...
-
-
- Use objHistory() to see steps and params used
-
-```
-
-Included below is a description of the `giotto` object subnesting for each data slot and also the accessor functions for setting and getting information from them.
-
-```{r table2, eval = FALSE, echo=FALSE, message=FALSE, warnings=FALSE, results='asis'}
-tabl <- "
-| Tables | Are | Cool |
-|---------------|:-------------:|------:|
-| col 3 is | right-aligned | $1600 |
-| col 2 is | centered | $12 |
-| zebra stripes | are neat | $1 |
-"
-cat(tabl) # output the table in a format good for HTML/PDF/docx conversion
-```
-
- |Slot |Nested | Example | Internal Accessors |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@expression** | spat_unit - | | getExpression() |
- | | feat_type - | cell - rna - raw | setExpression() |
- | | name | | |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@cell_metadata** | spat_unit - | cell - rna | getCellMetadata() |
- | | feat_type | | setCellMetadata() |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@feat_metadata** | spat_unit - | cell - rna | getFeatMetadata() |
- | | feat_type | | setFeatMetadata() |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@spatial_grid** | spat_unit - | grid- grid | getSpatialGrid() |
- | | name | | setSpatialGrid() |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@dimension_reduction** | approach - | | |
- | | spat_unit - | | getDimReduction() |
- | | feat_type - | cells - cell - rna - pca - pca | setDimReduction() |
- | | method - | | |
- | | name | | |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@multiomics** | spat_unit - | | |
- | | feat_type - | cell - rna-protein - WNN - theta_weighted_matrix | getMultiomics() |
- | | method - | | setMultiomics() |
- | | name | | |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@nn_network** | spat_unit- | | getNearestNetwork() |
- | | method - | cell - sNN - sNN_results1 | setNearestNetwork() |
- | | name | | |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@spatial_enrichment** | spat_unit - | | getSpatialEnrichment()|
- | | feat_type - | cell - rna - results1 | setSpatialEnrichment()|
- | | name | | |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@spatial_info** | spat_unit | cell | getPolygonInfo() |
- | | | | setPolygonInfo() |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@spatial_locs** | spat_unit - | cell - raw | getSpatialLocations() |
- | | name | | setSpatialLocations() |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@spatial_network** | spat_unit - | cell - Delaunay_network1 | getSpatialNetwork() |
- | | name | | setSpatialNetwork() |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@feat_info** | feat_type | rna | getFeatureInfo() |
- | | | | setFeatureInfo() |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@images** | name | image | getGiottoImage() |
- | | | | setGiottoImage() |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@largeImages** | name | image | getGiottoImage() |
- | | | | setGiottoImage() |
- |---------------------------|------------------------|----------------------------------|-------------------------|
- |**\@instructions** | | | instructions() |
- |---------------------------|------------------------|----------------------------------|-------------------------|
-
-
-## 2.2 Show and list functions
-
-Show and list functions are also provided for determining what information exists within each of these slots and its nesting.
-
-- `show` functions print a preview of all the data within the slot, but do not return information
-
-
-```{r, eval=FALSE}
-showGiottoSpatLocs(vizmini)
-```
-
-```{r, eval=FALSE}
- ├──Spatial unit "z0"
- │ └──S4 spatLocsObj "raw" coordinates: (498 rows)
- │ An object of class spatLocsObj
- │ provenance: z0
- │ ------------------------
- │ sdimx sdimy cell_ID
- │ 1: 6405.067 -4780.499 40951783403982682273285375368232495429
- │ 2: 6426.020 -4972.519 240649020551054330404932383065726870513
- │ 3: 6428.456 -4799.158 274176126496863898679934791272921588227
- │ 4: 6408.155 -4816.583 323754550002953984063006506310071917306
- │
- │ ranges:
- │ sdimx sdimy
- │ [1,] 6402.438 -5146.726
- │ [2,] 6899.203 -4700.157
- │
- │
- │
- ├──Spatial unit "z1"
- │ └──S4 spatLocsObj "raw" coordinates: (504 rows)
- │ An object of class spatLocsObj
- │ provenance: z1
- │ ------------------------
- │ sdimx sdimy cell_ID
- │ 1: 6404.014 -4779.625 40951783403982682273285375368232495429
- │ 2: 6408.296 -4970.794 17685062374745280598492217386845129350
- │ 3: 6401.148 -4991.061 223553142498364321238189328942498473503
- │ 4: 6430.153 -4971.251 240649020551054330404932383065726870513
- │
- │ ranges:
- │ sdimx sdimy
- │ [1,] 6401.148 -5147.193
- │ [2,] 6899.323 -4700.410
- │
- │
- │
- └──Spatial unit "aggregate"
- └──S4 spatLocsObj "raw" coordinates: (461 rows)
- An object of class spatLocsObj
- provenance: z0 z1
- ------------------------
- sdimx sdimy cell_ID
- 1: 6637.881 -5140.465 100210519278873141813371229408401071444
- 2: 6471.978 -4883.541 101161259912191124732236989250178928032
- 3: 6801.610 -4968.685 101488859781016188084173008420811094152
- 4: 6789.055 -5105.338 101523780333017320796881555775415156847
-
- ranges:
- sdimx sdimy
- [1,] 6401.412 -5146.747
- [2,] 6899.108 -4700.326
-
-
-
-- `list` functions are (internal) functions that return a `data.table`
- of the available information and nesting.
-
-```
-
-```{r, eval=FALSE}
-Giottolist_expression(vizmini)
-```
-
-```{r, eval=FALSE}
-
- spat_unit feat_type name
- 1: z0 rna raw
- 2: z1 rna raw
- 3: aggregate rna raw
- 4: aggregate rna normalized
- 5: aggregate rna scaled
- 6: aggregate rna pearson
-```
-
-
-```{r, eval=FALSE}
-# Find specific spat_unit objects #
-Giottolist_expression(vizmini, spat_unit = 'z0')
-```
-
-```{r, eval=FALSE}
-
- spat_unit feat_type name
- 1: z0 rna raw
-
-```
-
-- `list names` (internal) functions return a `vector` of object names
- at the specified nesting
-
-
-
-```{r, eval=FALSE}
-Giottolist_expression_names(vizmini, spat_unit = 'z1', feat_type = 'rna')
-```
-
-
-## 2.3 Provenance
-
-Going further, sometimes different sources of information can be used when aggregating to a particular spatial unit. This is most easily shown with the subcellular datasets from the Vizgen MERSCOPE platform which provide both feature polygon information for multiple confocal planes within a tissue. The aggregated information produced then could be drawn from different z-planes or combinations thereof. Giotto tracks this provenance information for each set of aggregated data.
-
-
-```{r, eval=FALSE}
-expr_mat = getExpression(vizmini, spat_unit = 'aggregate')
-prov(expr_mat)
-```
-
-```{r, eval=FALSE}
- [1] "z0" "z1"
-```
-
-
-# 3. Giotto subobjects
-
-*Giotto* 3.0 update introduced S4 subobjects that are used within the `giotto` object and its processing. These subobjects provide more formalized definitions for what information and formatting is needed in each of the `giotto` object slots in order for it to be functional. These objects are standalone and extensible and commonly used spatial manipulation and plotting methods are being implemented for them.
-
-In addition, these subobjects carry several pieces of metadata in additional slots alongside the main information (e.g. also slots for `spat_unit` and `feat_type` alongside the `exprDT` slot for the `exprObj` S4). This makes it so that nesting information is retained when they are taken out of the `giotto` object and that nesting information does not need to be supplied anymore when interacting with the `setter` functions.
-
-`getter` functions now have an `output` param that **defaults** to extracting the information from the `giotto` object as the S4 subobject. When extracting information that will be modified and then returned to the `giotto` object, it is preferred that the information is extracted as the S4 both so that tagged information is not lost, and because it is convenient to work with the S4's main data slot through the `[` and `[<-` generics (see Section 3.5).
-
-## 3.1 Creating an S4 subobject
-
-### 3.1.1 Constructors
-
-For directly creating a subobject, constructor functions can be used.
-
-
-constructors
-
-
-`createExprObj()` `createCellMetaObj()` `createFeatMetaObj()`
-`createDimObj()` `createNearestNetObj()` `createSpatLocsObj()`
-`createSpatNetObj()` `createSpatEnrObj()` `createSpatialGrid()`
-`createGiottoPoints()` `createGiottoPolygonsFromDfr()`
-`createGiottoPolygonsFromMask()` `createGiottoImage()`
-`createGiottoLargeImage()`
-
-
-```{r, eval=FALSE}
-coords = data.table(
- sdimx = c(1,2,3),
- sdimy = c(1,2,3),
- cell_ID = c('A','B','C')
-)
-
-st = createSpatLocsObj(name = 'test',
- spat_unit = 'cell',
- coordinates = coords,
- provenance = 'cell')
-```
-
-There are non numeric or integer columns for the spatial location input at column position(s): 3 The first non-numeric column will be considered as a cell ID to test for consistency with the expression matrix. Other non numeric columns will be removed
-
-
-```{r, eval=FALSE}
-print(st)
-```
-
-```{r, eval=FALSE}
- An object of class spatLocsObj : "test"
- spat_unit : "cell"
- provenance: cell
- ------------------------
-
- preview:
- sdimx sdimy cell_ID
- 1: 1 1 A
- 2: 2 2 B
- 3: 3 3 C
-
- ranges:
- sdimx sdimy
- [1,] 1 1
- [2,] 3 3
-```
-
-
-### 3.1.2 Readers
-
-Alternatively, read functions can be used to take named nested lists of raw data input and convert them to lists of subobjects which are directly usable by the setter functions.
-
-
-readers
-
-`readPolygonData()` `readFeatData()` `readExprData()`
-`readCellMetadata()` `readFeatMetadata()` `readSpatLocsData()`
-`readSpatNetData()` `readSpatEnrichData()` `readDimReducData()`
-`readNearestNetData()`
-
-
-```{r, eval=FALSE}
-st2 = readSpatLocsData(list(cell2 = list(test1 = coords,
- test2 = coords)))
-```
-
-```{r, eval=FALSE}
- list depth of 2
-
-
- List item [1]:
- spat_unit: cell2
- name: test1
-```
-
-There are non numeric or integer columns for the spatial location input at column position(s): 3. The first non-numeric column will be considered as a cell ID to test for consistency with the expression matrix. Other non numeric columns will be removed
-
-
-```{r, eval=FALSE}
-
- List item [2]:
- spat_unit: cell2
- name: test2
-
-```
-
-There are non numeric or integer columns for the spatial location input at column position(s): 3. The first non-numeric column will be considered as a cell ID to test for consistency with the expression matrix. Other non numeric columns will be removed
-
-
-```{r, eval=FALSE}
-print(st2)
-```
-
-```{r, eval=FALSE}
- [[1]]
- An object of class spatLocsObj : "test1"
- spat_unit : "cell2"
- provenance: cell2
- ------------------------
-
- preview:
- sdimx sdimy cell_ID
- 1: 1 1 A
- 2: 2 2 B
- 3: 3 3 C
-
- ranges:
- sdimx sdimy
- [1,] 1 1
- [2,] 3 3
-
-
-
- [[2]]
- An object of class spatLocsObj : "test2"
- spat_unit : "cell2"
- provenance: cell2
- ------------------------
-
- preview:
- sdimx sdimy cell_ID
- 1: 1 1 A
- 2: 2 2 B
- 3: 3 3 C
-
- ranges:
- sdimx sdimy
- [1,] 1 1
- [2,] 3 3
-
-```
-
-## 3.2 Giotto Accessors
-
-*Giotto* provides `getter` and `setter` functions for manually accessing the information contained within the `giotto` object. Note that the `setters` require that the data be provided as compatible S4 subobjects or lists thereof. External data can read into the appropriate formats using the above `reader` functions. The `getter` functions return S4 subobjects by default.
-
-
-getters
-
-
-`getExpression()` `getCellMetadata()` `getFeatMetadata()`
-`getSpatialLocations()` `getDimReduction()` `getNearestNetwork()`
-`getSpatialNetwork()` `getPolygonInfo()` `getFeatureInfo()`
-`getSpatialEnrichment()` `getGiottoImage()`
-
-
-setters
-
-
-`setExpression()` `setCellMetadata()` `setFeatureMetadata()`
-`setSpatialLocations()` `setDimReduction()` `setNearestNetwork()`
-`setSpatialNetwork()` `setPolygonInfo()` `setFeatureInfo()`
-`setSpatialEnrichment()` `setGiottoImage()`
-
-
-
-```{r, eval=FALSE}
-expval = getExpression(vizmini)
-print(expval)
-```
-
-```{r, eval=FALSE}
- An object of class exprObj : "raw"
- spat_unit : "z0"
- feat_type : "rna"
- provenance: z0
-
- contains:
- 336 x 498 sparse Matrix of class "dgCMatrix"
-
- Adora1 . . . . . . . . . . 1 . . ......
- Adgrb1 . . . . 1 . . . . . . . . ......
- Adgrb3 . . . . . . . . . . 1 3 . ......
-
- ........suppressing 485 columns and 330 rows
-
- Blank-128 . . . . . . . . . . . . . ......
- Blank-145 . . . . . . . . . . . . . ......
- Gpr101 . . . . . . . . . . . . . ......
-
- First four colnames:
- 40951783403982682273285375368232495429
- 240649020551054330404932383065726870513
- 274176126496863898679934791272921588227
- 323754550002953984063006506310071917306
-
-```
-
-## 3.3 Get and set S4 spat_unit, feat_type, provenance
-
-`spatUnit()`, `featType()`, and `prov()` are replacement functions for tagged spatial unit, feature type, and provenance information respectively.
-
-
-```{r, eval=FALSE}
-# spat_unit
-spatUnit(expval) <- 'new_spat'
-spatUnit(expval)
-```
-
-```{r, eval=FALSE}
- [1] "new_spat"
-```
-
-```{r, eval=FALSE}
-# feat_type
-featType(expval) <- 'new_feat'
-featType(expval)
-```
-
-```{r, eval=FALSE}
- [1] "new_feat"
-```
-
-```{r, eval=FALSE}
-# provenance
-prov(expval) <- 'cell'
-prov(expval)
-```
-
-```{r, eval=FALSE}
- [1] "cell"
-```
-
-
-## 3.4 Setting an S4 subobject
-
-The `spat_unit`, `feat_type`, and `name` params no longer need to be given when setting an S4 subobject with tagged information into a `giottoObject`. However, if input is given to the `set` function parameters then it is prioritized over the tagged information and the tagged information is updated.
-
-
-```{r, eval=FALSE}
-# set exprObj to tagged nesting location
-vizmini <- setExpression(vizmini, expval)
-```
-
-```{r, eval=FALSE}
- Setting expression [new_spat][new_feat] raw
-```
-
-```{r, eval=FALSE}
-Giottolist_expression(vizmini)
-```
-
-```{r, eval=FALSE}
- spat_unit feat_type name
- 1: z0 rna raw
- 2: z1 rna raw
- 3: aggregate rna raw
- 4: aggregate rna normalized
- 5: aggregate rna scaled
- 6: aggregate rna pearson
- 7: new_spat new_feat raw
-```
-
-
-## 3.5 Working with S4 subobjects {#sec-working_with_subobjects}
-
-Giotto's S4 subobjects each wrap one main data object. The empty `[]` and `[]<-` operators are defined as shorthand for directly accessing this slot that contains the data. For example, with a `spatLocsObj`:
-
-`class(spatLocsObj[])` is equivalent to `class(spatLocsObj@coordinates)`
-
-In this way, the S4 subobjects can be used in contexts that the wrapped objects could be.
-
-
-```{r, eval=FALSE}
-st = getSpatialLocations(vizmini)
-class(st)
-```
-
-```{r, eval=FALSE}
- [1] "spatLocsObj"
- attr(,"package")
- [1] "Giotto"
-```
-
-```{r, eval=FALSE}
-# With empty brackets
-class(st[])
-```
-
-```{r, eval=FALSE}
- [1] "data.table" "data.frame"
-```
-
-
-**Setting information**
-
-
-```{r, eval=FALSE}
-print(st)
-```
-
-```{r, eval=FALSE}
- An object of class spatLocsObj : "raw"
- spat_unit : "z0"
- provenance: z0
- ------------------------
-
- preview:
- sdimx sdimy cell_ID
- 1: 6405.067 -4780.499 40951783403982682273285375368232495429
- 2: 6426.020 -4972.519 240649020551054330404932383065726870513
- 3: 6428.456 -4799.158 274176126496863898679934791272921588227
- 4: 6408.155 -4816.583 323754550002953984063006506310071917306
- 5: 6425.894 -4862.808 87260224659312905497866017323180367450
- ---
- 494: 6863.376 -4764.372 264234489423886906860498828392801290668
- 495: 6833.515 -4724.922 328891726607418454659643302361160567789
- 496: 6829.474 -4755.392 6380671372744430258754116433861320161
- 497: 6823.512 -4713.632 75286702783716447443887872812098770697
- 498: 6842.534 -4717.261 9677424102111816817518421117250891895
-
- ranges:
- sdimx sdimy
- [1,] 6402.438 -5146.726
- [2,] 6899.203 -4700.157
-
-```
-
-
-```{r, eval=FALSE}
-st[] = coords
-print(st)
-```
-
-```{r, eval=FALSE}
- An object of class spatLocsObj : "raw"
- spat_unit : "z0"
- provenance: z0
- ------------------------
-
- preview:
- sdimx sdimy cell_ID
- 1: 1 1 A
- 2: 2 2 B
- 3: 3 3 C
-
- ranges:
- sdimx sdimy
- [1,] 1 1
- [2,] 3 3
-
-```
-
-## 4. Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: aarch64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.2.1
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/Mexico_City
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods
-[7] base
-
-other attached packages:
-[1] data.table_1.14.10 GiottoData_0.2.6.1 GiottoUtils_0.1.2
-[4] Giotto_4.0.2 GiottoClass_0.1.2
-
-loaded via a namespace (and not attached):
- [1] rstudioapi_0.15.0 jsonlite_1.8.8
- [3] magrittr_2.0.3 magick_2.8.2
- [5] rmarkdown_2.25 fs_1.6.3
- [7] zlibbioc_1.48.0 vctrs_0.6.5
- [9] memoise_2.0.1 RCurl_1.98-1.13
- [11] terra_1.7-65 usethis_2.2.2
- [13] htmltools_0.5.7 S4Arrays_1.2.0
- [15] progress_1.2.3 curl_5.2.0
- [17] Rhdf5lib_1.24.1 SparseArray_1.2.3
- [19] rhdf5_2.46.1 KernSmooth_2.23-22
- [21] htmlwidgets_1.6.4 cachem_1.0.8
- [23] igraph_1.6.0 mime_0.12
- [25] lifecycle_1.0.4 pkgconfig_2.0.3
- [27] Matrix_1.6-4 R6_2.5.1
- [29] fastmap_1.1.1 GenomeInfoDbData_1.2.11
- [31] MatrixGenerics_1.14.0 shiny_1.8.0
- [33] digest_0.6.33 colorspace_2.1-0
- [35] AnnotationDbi_1.64.1 S4Vectors_0.40.2
- [37] pkgload_1.3.3 GenomicRanges_1.54.1
- [39] RSQLite_2.3.4 filelock_1.0.3
- [41] progressr_0.14.0 fansi_1.0.6
- [43] httr_1.4.7 abind_1.4-5
- [45] compiler_4.3.2 proxy_0.4-27
- [47] remotes_2.4.2.1 bit64_4.0.5
- [49] withr_2.5.2 backports_1.4.1
- [51] DBI_1.2.0 pkgbuild_1.4.3
- [53] biomaRt_2.58.0 sessioninfo_1.2.2
- [55] rappdirs_0.3.3 DelayedArray_0.28.0
- [57] rjson_0.2.21 classInt_0.4-10
- [59] GiottoVisuals_0.1.1 tools_4.3.2
- [61] units_0.8-5 httpuv_1.6.13
- [63] glue_1.6.2 rhdf5filters_1.14.1
- [65] promises_1.2.1 grid_4.3.2
- [67] sf_1.0-15 checkmate_2.3.1
- [69] generics_0.1.3 gtable_0.3.4
- [71] class_7.3-22 hms_1.1.3
- [73] xml2_1.3.6 utf8_1.2.4
- [75] XVector_0.42.0 BiocGenerics_0.48.1
- [77] pillar_1.9.0 stringr_1.5.1
- [79] later_1.3.2 dplyr_1.1.4
- [81] BiocFileCache_2.10.1 lattice_0.21-9
- [83] gmp_0.7-3 bit_4.0.5
- [85] tidyselect_1.2.0 SingleCellExperiment_1.24.0
- [87] Biostrings_2.70.1 miniUI_0.1.1.1
- [89] knitr_1.45 IRanges_2.36.0
- [91] SummarizedExperiment_1.32.0 stats4_4.3.2
- [93] xfun_0.41 Biobase_2.62.0
- [95] devtools_2.4.5 matrixStats_1.2.0
- [97] stringi_1.8.3 yaml_2.3.8
- [99] evaluate_0.23 codetools_0.2-19
-[101] tibble_3.2.1 colorRamp2_0.1.0
-[103] cli_3.6.2 arrow_14.0.0.2
-[105] xtable_1.8-4 reticulate_1.34.0
-[107] munsell_0.5.0 Rcpp_1.0.11
-[109] GenomeInfoDb_1.38.5 dbplyr_2.4.0
-[111] png_0.1-8 XML_3.99-0.16
-[113] parallel_4.3.2 ellipsis_0.3.2
-[115] ggplot2_3.4.4 assertthat_0.2.1
-[117] blob_1.2.4 prettyunits_1.2.0
-[119] ClusterR_1.3.2 profvis_0.3.8
-[121] urlchecker_1.0.1 bitops_1.0-7
-[123] SpatialExperiment_1.12.0 scales_1.3.0
-[125] e1071_1.7-14 purrr_1.0.2
-[127] crayon_1.5.2 rlang_1.1.2
-[129] cowplot_1.1.2 KEGGREST_1.42.0
-```
diff --git a/vignettes/team.Rmd b/vignettes/team.Rmd
deleted file mode 100644
index 9a6240587..000000000
--- a/vignettes/team.Rmd
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title: "Meet the team!"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Meet the team!}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Members of the team
-
-- [Ruben Dries](https://www.drieslab.com/)
-- [Jiaji George Chen]
-- [Joselyn C. Chávez-Fuentes](https://josschavezf.github.io/)
-- [Guo-Cheng Yuan](https://labs.icahn.mssm.edu/yuanlab/)
-- [Edward Ruiz]
-- [Wen Wang]
-- [Junxiang Xu]
-- [Iqra Amin]
-
-
-
diff --git a/vignettes/terra.Rmd b/vignettes/terra.Rmd
deleted file mode 100644
index 16a95c8af..000000000
--- a/vignettes/terra.Rmd
+++ /dev/null
@@ -1,83 +0,0 @@
----
-title: "Terra bio"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Terra bio}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Launching Giotto on the Cloud
-
-You can run all your pipelines using Giotto on the Cloud through Terra.bio platform.
-
-# 1. Setting up your Terra account
-
-Go to [Terra](https://app.terra.bio/) on your Chrome browser and [Sign Up]{.title-ref} using the same email address that you will use for the billing account on Google Cloud Platform.
-
-# 2. Creating a Billing Account
-
-- Create an account on the Google Cloud Platform.
-- Set Terra as a billing user on your account.
-- Select your Google account to create your billing project on Terra.
-
-For additional information about billing account go to this [link](https://support.terra.bio/hc/en-us/articles/360048632271-Understanding-Terra-costs-and-billing).
-
-# 3. Create A Workspace
-
-- Create a workspace within your billing account.
-
-
-**Note** All users with access permissions to your workspace will share the same billing account.
-
-
-- Launch a Virtual Machine with a Cloud environment.
-
-# 4. Create a Cloud Environment
-
-In Terra, you can run Cloud Environments using Jupyter notebooks or the RStudio App. We recommend to your either the Juypyter notebook + Python + Bioconductor or RStudio + Bioconductor options.
-
-![](images/terra/01_environments.png)
-
-You can customize the memory usage, the number of CPUs, and the persistent disk size for your virtual machine.
-
-![](images/terra/01_vm.png)
-
-Now you can install the Giotto package by running the R commmand:
-
-```{r, eval=FALSE}
-remotes::install_github('drieslab/Giotto')
-```
-
-# 5. Create a ready-to-use Cloud Environment with Giotto
-
-You can pre-install the Giotto package while launching the Jupyter notebook or the RStudio App.
-
-- To create a customized Jupyter notebook, use our Terra-based Docker image: **giottopackage/terra_jupyter_suite:latest**
-
-![](images/terra/02_docker.png)
-
-- To create a customized RStudio session use the startup script url: **gs://fc-c374290b-2c96-4980-8b43-92770eebf1b1/suite.sh**
-
-![](images/terra/03_startup_script.png)
-
-- Click on Create Environment
-
-# 6. Share your workspace with collaborators
-
-You can share your workspace with collaborators, including data, notebooks, and workflows stored in your workspace.
-
-- Go to the Dashboard tab on your workspace and click the three dots on the upper right corner.
-- Select Share option.
-- Add the email of your collaborator. They will receive an invitation for joining the worskpace.
-- You can select which permissions are granted to your collaborator (reader, writer or owner).
-- Click the save button.
-
-![](images/terra/04_share.png)
-
-**Considerations**
-
-- Keep in mind that all Cloud environments (virtual machines) launched within the same workspace are linked to the same billing account.
-- Simultaneous modification of notebooks are not allowed.
-- Opening the notebook while someone else is editing will show a message, but the current editor is not notified when someone else is trying to open the notebook.
-
diff --git a/vignettes/visium_cytassist_human_glioblastoma.Rmd b/vignettes/visium_cytassist_human_glioblastoma.Rmd
deleted file mode 100644
index df8604e21..000000000
--- a/vignettes/visium_cytassist_human_glioblastoma.Rmd
+++ /dev/null
@@ -1,411 +0,0 @@
----
-title: "Visium CytAssist Multi-omics Human Glioblastoma"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Visium CytAssist Multi-omics Human Glioblastoma}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# 1 Dataset explanation
-
-The [Human glioblastoma (FFPE) dataset](https://www.10xgenomics.com/resources/datasets/gene-and-protein-expression-library-of-human-glioblastoma-cytassist-ffpe-2-standard/) was obtained from 10x Genomics. The tissue was sectioned as described in Visium CytAssist Spatial Gene Expression for FFPE -- Tissue Preparation Guide Demonstrated Protocol (CG000518). 5 µm tissue sections were placed on Superfrost glass slides, then IF stained following deparaffinization, then hard coverslipped. Sections were imaged, decoverslipped, followed by Demonstrated Protocol (CG000494).
-
-More information about this dataset can be found [here](https://www.10xgenomics.com/resources/datasets/gene-and-protein-expression-library-of-human-glioblastoma-cytassist-ffpe-2-standard).
-
-# 2 Start Giotto
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- Giotto::installGiottoEnvironment()
-}
-```
-
-```{r, eval=FALSE}
-library(Giotto)
-
-# 1. set results directory
-results_directory = 'results'
-
-# 2. set giotto python path
-# set python path to your preferred python version path
-# set python path to NULL if you want to automatically install (only the 1st time) and use the giotto miniconda environment
-python_path = NULL
-if(is.null(python_path)) {
- installGiottoEnvironment()
-}
-
-# 3. create giotto instructions
-instrs = createGiottoInstructions(save_dir = results_directory,
- save_plot = TRUE,
- show_plot = TRUE,
- python_path = python_path)
-```
-
-# 3 Create Giotto object
-
-The minimum requirements are
-
-- matrix with expression information (or path to)
-- x,y(,z) coordinates for cells or spots (or path to)
-
-createGiottoVisiumObject() will automatically detect both rna and protein modalities within the expression matrix creating a multi-omics Giotto object.
-
-```{r, eval=FALSE}
-# Provide path to visium folder
-data_directory <- 'path/to/visium/data'
-
-# Create Giotto object
-visium = createGiottoVisiumObject(visium_dir = data_directory,
- expr_data = 'raw',
- png_name = 'tissue_lowres_image.png',
- gene_column_index = 2,
- instructions = instrs)
-```
-
-How to work with Giotto instructions that are part of your Giotto object:
-
-- Show the instructions associated with your Giotto object with showGiottoInstructions()
-- Change one or more instructions with changeGiottoInstructions()
-- Replace all instructions at once with replaceGiottoInstructions()
-- Read or get a specific Giotto instruction with readGiottoInstructions()
-
-```{r, eval=FALSE}
-# show instructions associated with the giotto object
-
-showGiottoInstructions(visium)
-```
-
-# 4 Processing
-
-- Filter features and cells based on detection frequencies
-- Normalize expression matrix (log transformation, scaling factor and/or z-scores)
-- Add cell and feature statistics (optional)
-- Adjust expression matrix for technical covariates or batches (optional).
-
-```{r, eval=FALSE}
-# Subset on spots that were covered by tissue
-metadata = pDataDT(visium)
-in_tissue_barcodes = metadata[in_tissue == 1]$cell_ID
-visium = subsetGiotto(visium, cell_ids = in_tissue_barcodes)
-
-## Visualize aligned tissue
-spatPlot2D(gobject = visium,
- point_alpha = 0.7)
-```
-
-![](images/visium_cytassist_human_glioblastoma/0-spatPlot2D.png)
-
-```{r, eval=FALSE}
-# Filtering, normalization, and statistics
-
-## RNA feature
-visium <- filterGiotto(gobject = visium,
- expression_threshold = 1,
- feat_det_in_min_cells = 50,
- min_det_feats_per_cell = 1000,
- expression_values = c('raw'),
- verbose = TRUE)
-
-visium <- normalizeGiotto(gobject = visium,
- scalefactor = 6000,
- verbose = TRUE)
-
-visium <- addStatistics(gobject = visium)
-
-### Visualize number of features after processing
-spatPlot2D(gobject = visium,
- point_alpha = 0.7,
- cell_color = 'nr_feats',
- color_as_factor = FALSE)
-```
-
-![](images/visium_cytassist_human_glioblastoma/1-spatPlot2D.png)
-
-```{r, eval=FALSE}
-## Protein feature
-visium <- filterGiotto(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein',
- expression_threshold = 1,
- feat_det_in_min_cells = 50,
- min_det_feats_per_cell = 1,
- expression_values = 'raw',
- verbose = TRUE)
-
-visium <- normalizeGiotto(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein',
- scalefactor = 6000,
- verbose = TRUE)
-
-visium <- addStatistics(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein')
-
-### Visualize number of features after processing
-spatPlot2D(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein',
- point_alpha = 0.7,
- cell_color = 'nr_feats',
- color_as_factor = FALSE)
-```
-
-![](images/visium_cytassist_human_glioblastoma/2-spatPlot2D.png)
-
-# 5 Dimention Reduction
-
-```{r, eval=FALSE}
-# Identify highly variable features (HVF)
-visium <- calculateHVF(gobject = visium)
-```
-
-![](images/visium_cytassist_human_glioblastoma/3-HVFplot.png)
-
-```{r, eval=FALSE}
-# PCA
-
-## RNA
-visium <- runPCA(gobject = visium)
-
-screePlot(visium, ncp = 30)
-```
-
-![](images/visium_cytassist_human_glioblastoma/4-screePlot.png)
-
-```{r, eval=FALSE}
-### Visualize RNA PCA
-plotPCA(gobject = visium)
-```
-
-![](images/visium_cytassist_human_glioblastoma/5-PCA.png)
-
-```{r, eval=FALSE}
-## Protein
-visium <- runPCA(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein')
-
-screePlot(visium,
- spat_unit = 'cell',
- feat_type = 'protein',
- ncp = 30)
-```
-
-![](images/visium_cytassist_human_glioblastoma/6-screePlot.png)
-
-```{r, eval=FALSE}
-### Visualize Protein PCA
-plotPCA(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein')
-```
-
-![](images/visium_cytassist_human_glioblastoma/7-PCA.png)
-
-# 6 Clustering
-
-```{r, eval=FALSE}
-# cluster and run UMAP
-# sNN network (default)
-
-## RNA feature
-visium <- createNearestNetwork(gobject = visium,
- dimensions_to_use = 1:10,
- k = 30)
-
-## Protein feature
-visium <- createNearestNetwork(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein',
- dimensions_to_use = 1:10,
- k = 30)
-
-# Leiden clustering
-
-## RNA feature
-visium <- doLeidenCluster(gobject = visium,
- resolution = 1,
- n_iterations = 1000)
-
-## Protein feature
-visium <- doLeidenCluster(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein',
- resolution = 1,
- n_iterations = 1000)
-
-# UMAP
-
-## RNA feature
-visium <- runUMAP(visium,
- dimensions_to_use = 1:10)
-
-plotUMAP(gobject = visium,
- cell_color = 'leiden_clus',
- show_NN_network = TRUE,
- point_size = 2)
-```
-
-![](images/visium_cytassist_human_glioblastoma/8-UMAP.png)
-
-```{r, eval=FALSE}
-## Protein feature
-visium <- runUMAP(visium,
- spat_unit = 'cell',
- feat_type = 'protein',
- dimensions_to_use = 1:10)
-
-plotUMAP(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein',
- cell_color = 'leiden_clus',
- show_NN_network = TRUE,
- point_size = 2)
-```
-
-![](images/visium_cytassist_human_glioblastoma/9-UMAP.png)
-
-```{r, eval=FALSE}
-# Visualize spatial plot
-
-## RNA feature
-spatPlot2D(gobject = visium,
- show_image = TRUE,
- cell_color = 'leiden_clus',
- point_size = 2)
-```
-
-![](images/visium_cytassist_human_glioblastoma/10-spatPlot2D.png)
-
-```{r, eval=FALSE}
-## Protein feature
-spatPlot2D(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein',
- show_image = TRUE,
- cell_color = 'leiden_clus',
- point_size = 2)
-```
-
-![](images/visium_cytassist_human_glioblastoma/11-spatPlot2D.png)
-
-# 7 Multi-omics integration
-
-The Weighted Nearest Neighbors allows to integrate two or more modalities acquired from the same sample. WNN will re-calculate the clustering to provide an integrated umap and leiden clustering. For running WNN, the Giotto object must contain the results of running PCA calculation for each modality.
-
-```{r, eval=FALSE}
-# Calculate kNN
-
-## RNA modality
-visium <- createNearestNetwork(gobject = visium,
- type = 'kNN',
- dimensions_to_use = 1:10,
- k = 20)
-
-## Protein modality
-visium <- createNearestNetwork(gobject = visium,
- spat_unit = 'cell',
- feat_type = 'protein',
- type = 'kNN',
- dimensions_to_use = 1:10,
- k = 20)
-
-
-# Run WNN
-visium <- runWNN(visium,
- spat_unit = "cell",
- modality_1 = "rna",
- modality_2 = "protein",
- pca_name_modality_1 = "pca",
- pca_name_modality_2 = "protein.pca",
- k = 20,
- integrated_feat_type = NULL,
- matrix_result_name = NULL,
- w_name_modality_1 = NULL,
- w_name_modality_2 = NULL,
- verbose = TRUE)
-
-# Run Integrated umap
-visium <- runIntegratedUMAP(visium,
- modality1 = "rna",
- modality2 = "protein",
- spread = 5,
- min_dist = 0.5,
- force = FALSE)
-
-# Calculate integrated clusters
-visium <- doLeidenCluster(gobject = visium,
- spat_unit = "cell",
- feat_type = "rna",
- nn_network_to_use = "kNN",
- network_name = "integrated_kNN",
- name = "integrated_leiden_clus",
- resolution = 1)
-
-# Visualize integrated umap
-plotUMAP(gobject = visium,
- spat_unit = "cell",
- feat_type = "rna",
- cell_color = 'integrated_leiden_clus',
- dim_reduction_name = "integrated.umap",
- point_size = 1.5,
- title = "Integrated UMAP using Integrated Leiden clusters",
- axis_title = 12,
- axis_text = 10 )
-```
-
-![](images/visium_cytassist_human_glioblastoma/12-UMAP.png)
-
-```{r, eval=FALSE}
-# Visualize spatial plot with integrated clusters
-spatPlot2D(visium,
- spat_unit = "cell",
- feat_type = "rna",
- cell_color = "integrated_leiden_clus",
- point_size = 2,
- show_image = FALSE,
- title = "Integrated Leiden clustering")
-```
-
-![](images/visium_cytassist_human_glioblastoma/13-spatPlot2D.png)
-
-# 8 Session Info
-
-```{r, eval=FALSE}
-sessionInfo()
-
-R version 4.3.2 (2023-10-31)
-Platform: aarch64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.1.2
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-loaded via a namespace (and not attached):
- [1] vctrs_0.6.5 cli_3.6.2 knitr_1.45 rlang_1.1.3 xfun_0.41 stringi_1.8.3
- [7] purrr_1.0.2 pkgload_1.3.4 promises_1.2.1 shiny_1.8.0 xtable_1.8-4 glue_1.7.0
-[13] htmltools_0.5.7 httpuv_1.6.13 pkgbuild_1.4.3 rmarkdown_2.25 evaluate_0.23 ellipsis_0.3.2
-[19] fastmap_1.1.1 yaml_2.3.8 lifecycle_1.0.4 memoise_2.0.1 stringr_1.5.1 compiler_4.3.2
-[25] miniUI_0.1.1.1 sessioninfo_1.2.2 fs_1.6.3 htmlwidgets_1.6.4 Rcpp_1.0.12 urlchecker_1.0.1
-[31] rstudioapi_0.15.0 later_1.3.2 digest_0.6.34 R6_2.5.1 usethis_2.2.2 magrittr_2.0.3
-[37] tools_4.3.2 mime_0.12 devtools_2.4.5 profvis_0.3.8 remotes_2.4.2.1 cachem_1.0.8
diff --git a/vignettes/visium_cytassist_lungcancer.Rmd b/vignettes/visium_cytassist_lungcancer.Rmd
deleted file mode 100644
index 3d9c552e5..000000000
--- a/vignettes/visium_cytassist_lungcancer.Rmd
+++ /dev/null
@@ -1,586 +0,0 @@
----
-title: "Visium CytAssist Human Lung Cancer"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Visium CytAssist Human Lung Cancer}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Dataset Explanation
-
-The human lung cancer (FFPE) dataset was obtained from 10x Genomics using their CytAssist Visium technology that has been recently developed to allow users to perform standard histology workflows on two standard glass slides before transferring the transcriptional probes on the two-area capture visium slide.
-
-More information about this dataset can be found [here](https://www.10xgenomics.com/resources/datasets/human-lung-cancer-ffpe-2-standard/).
-
-![](images/visium_cytassist_lungcancer/CytAssist_Visium_workflow.png){width="90.0%"}
-
-# Start Giotto
-
-To run the current vignette you need to install the Giotto Suite branch.
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite and GiottoData packages are installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-# 1. Create a Giotto object
-
-The minimum requirements are
-
-- matrix with expression information (or path to)
-- x,y(,z) coordinates for cells or spots (or path to)
-
-```{r, eval=FALSE}
-library(Giotto)
-
-# Provide path to visium folder
-data_path = '/path/to/data/directory'
-
-# to automatically save figures in save_dir set save_plot to TRUE
-results_dir = '/path/to/results/directory'
-
-myinstructions = createGiottoInstructions(save_dir = results_dir,
- save_plot = TRUE,
- show_plot = TRUE)
-
-# Create Giotto object
-visium_lungcancer = createGiottoVisiumObject(visium_dir = data_path,
- expr_data = 'raw',
- png_name = 'tissue_lowres_image.png',
- gene_column_index = 2,
- instructions = myinstructions)
-
-# check metadata
-pDataDT(visium_lungcancer)
-
-# check available image names
-showGiottoImageNames(visium_lungcancer) # "image" is the default name
-
-# show aligned image
-spatPlot(gobject = visium_lungcancer, cell_color = 'in_tissue', show_image = T, point_alpha = 0.7)
-```
-
-![](images/visium_cytassist_lungcancer/0-spatPlot2D.png){width="50.0%"}
-
-How to work with Giotto instructions that are part of your Giotto object:
-
-- show the instructions associated with your Giotto object with **showGiottoInstructions()**
-- change one or more instructions with **changeGiottoInstructions()**
-- replace all instructions at once with **replaceGiottoInstructions()**
-- read or get a specific Giotto instruction with **readGiottoInstructions()**
-
-```{r, eval=FALSE}
-# show instructions associated with giotto object (visium_lungcancer)
-showGiottoInstructions(visium_lungcancer)
-```
-
-# 2. Processing steps
-
-- filter genes and cells based on detection frequencies
-- normalize expression matrix (log transformation, scaling factor and/or z-scores)
-- add cell and gene statistics (optional)
-- adjust expression matrix for technical covariates or batches (optional). These results will be stored in the *custom* slot.
-
-```{r, eval=FALSE}
-visium_lungcancer <- filterGiotto(gobject = visium_lungcancer,
- expression_threshold = 1,
- feat_det_in_min_cells = 50,
- min_det_feats_per_cell = 1000,
- expression_values = c('raw'),
- verbose = T)
-visium_lungcancer <- normalizeGiotto(gobject = visium_lungcancer, scalefactor = 6000, verbose = T)
-visium_lungcancer <- addStatistics(gobject = visium_lungcancer)
-```
-
-## Visualize aligned tissue with number of features after processing
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = visium_lungcancer, show_image = T, point_alpha = 0.7)
-```
-
-![](images/visium_cytassist_lungcancer/1-spatPlot2D.png){width="50.0%"}
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = visium_lungcancer, show_image = T, point_alpha = 0.7,
- cell_color = 'nr_feats', color_as_factor = F)
-```
-
-![](images/visium_cytassist_lungcancer/2-spatPlot2D.png){width="50.0%"}
-
-# 3. Dimension Reduction
-
-- identify highly variable features (HVF)
-
-```{r, eval=FALSE}
-visium_lungcancer <- calculateHVF(gobject = visium_lungcancer)
-```
-
-![](images/visium_cytassist_lungcancer/3-HVFplot.png){width="50.0%"}
-
-- perform PCA
-- identify number of significant principal components (PCs)
-
-```{r, eval=FALSE}
-visium_lungcancer <- runPCA(gobject = visium_lungcancer)
-screePlot(visium_lungcancer, ncp = 30)
-```
-
-![](images/visium_cytassist_lungcancer/4-screePlot.png){width="50.0%"}
-
-```{r, eval=FALSE}
-plotPCA(gobject = visium_lungcancer)
-```
-
-![](images/visium_cytassist_lungcancer/5-PCA.png){width="50.0%"}
-
-- run UMAP and/or t-SNE on PCs (or directly on matrix)
-
-```{r, eval=FALSE}
-visium_lungcancer <- runUMAP(visium_lungcancer, dimensions_to_use = 1:10)
-plotUMAP(gobject = visium_lungcancer)
-```
-
-![](images/visium_cytassist_lungcancer/6-UMAP.png){width="50.0%"}
-
-```{r, eval=FALSE}
-visium_lungcancer <- runtSNE(visium_lungcancer, dimensions_to_use = 1:10)
-plotTSNE(gobject = visium_lungcancer)
-```
-
-![](images/visium_cytassist_lungcancer/7-tSNE.png){width="50.0%"}
-
-# 4. Clustering
-
-- create a shared (default) nearest network in PCA space (or directly on matrix)
-- cluster on nearest network with Leiden or Louvain (k-means and hclust are alternatives)
-
-```{r, eval=FALSE}
-# Create shared nearest network (SNN) and perform leiden clustering
-visium_lungcancer <- createNearestNetwork(gobject = visium_lungcancer, dimensions_to_use = 1:10, k = 30)
-visium_lungcancer <- doLeidenCluster(gobject = visium_lungcancer, spat_unit = 'cell', feat_type = 'rna', resolution = 0.4, n_iterations = 1000)
-
-# visualize UMAP cluster results
-plotUMAP(gobject = visium_lungcancer, cell_color = 'leiden_clus', show_NN_network = T, point_size = 2)
-```
-
-![](images/visium_cytassist_lungcancer/8-UMAP.png){width="50.0%"}
-
-```{r, eval=FALSE}
-# visualize tSNE cluster results
-plotTSNE(gobject = visium_lungcancer, cell_color = 'leiden_clus', show_NN_network = T, point_size = 2)
-```
-
-![](images/visium_cytassist_lungcancer/9-tSNE.png){width="50.0%"}
-
-```{r, eval=FALSE}
-# visualize expression and spatial results
-spatDimPlot(gobject = visium_lungcancer, cell_color = 'leiden_clus',
- dim_point_size = 2, spat_point_size = 2)
-```
-
-![](images/visium_cytassist_lungcancer/10-spatDimPlot2D.png){width="50.0%"}
-
-```{r, eval=FALSE}
-spatDimPlot(gobject = visium_lungcancer, cell_color = 'nr_feats', color_as_factor = F,
- dim_point_size = 2, dim_show_legend = T, spat_show_legend = T, spat_point_size = 2)
-```
-
-![](images/visium_cytassist_lungcancer/11-spatDimPlot2D.png){width="50.0%"}
-
-# 5. Differential expression
-
-```{r, eval=FALSE}
-# Cell type marker detection
-# Gini markers
-gini_markers_subclusters = findMarkers_one_vs_all(gobject = visium_lungcancer,
- method = 'gini',
- expression_values = 'normalized',
- cluster_column = 'leiden_clus',
- min_featss = 20,
- min_expr_gini_score = 0.5,
- min_det_gini_score = 0.5)
-
-# get top 2 genes per cluster and visualize with violin plot
-topgenes_gini = gini_markers_subclusters[, head(.SD, 2), by = 'cluster']$feats
-violinPlot(visium_lungcancer, feats = unique(topgenes_gini), cluster_column = 'leiden_clus',
- strip_text = 8, strip_position = 'right')
-```
-
-![](images/visium_cytassist_lungcancer/12-violinPlot.png){width="50.0%"}
-
-```{r, eval=FALSE}
-# cluster heatmap
-plotMetaDataHeatmap(visium_lungcancer,
- selected_feats = topgenes_gini,
- metadata_cols = c('leiden_clus'),
- x_text_size = 10, y_text_size = 10)
-```
-
-![](images/visium_cytassist_lungcancer/13-plotMetaDataHeatmap.png){width="50.0%"}
-
-```{r, eval=FALSE}
-# umap plots
-dimFeatPlot2D(visium_lungcancer,
- expression_values = 'scaled',
- feats = gini_markers_subclusters[, head(.SD, 1), by = 'cluster']$feats,
- cow_n_col = 3, point_size = 1)
-```
-
-![](images/visium_cytassist_lungcancer/14-dimFeatPlot2D.png){width="50.0%"}
-
-```{r, eval=FALSE}
-# Cell type marker detection
-# Scran markers
-scran_markers_subclusters = findMarkers_one_vs_all(gobject = visium_lungcancer,
- method = 'scran',
- expression_values = 'normalized',
- cluster_column = 'leiden_clus')
-
-# get top 2 genes per cluster and visualize with violin plot
-topgenes_scran = scran_markers_subclusters[, head(.SD, 2), by = 'cluster']$feats
-violinPlot(visium_lungcancer, feats = unique(topgenes_scran),
- cluster_column = 'leiden_clus',
- strip_text = 10, strip_position = 'right')
-```
-
-![](images/visium_cytassist_lungcancer/15-violinPlot.png){width="50.0%"}
-
-```{r, eval=FALSE}
-# cluster heatmap
-plotMetaDataHeatmap(visium_lungcancer,
- selected_feats = topgenes_scran,
- metadata_cols = c('leiden_clus'),
- x_text_size = 10, y_text_size = 10)
-```
-
-![](images/visium_cytassist_lungcancer/16-plotMetaDataHeatmap.png){width="50.0%"}
-
-```{r, eval=FALSE}
-# umap plots
-dimFeatPlot2D(visium_lungcancer,
- expression_values = 'scaled',
- feats = scran_markers_subclusters[, head(.SD, 1), by = 'cluster']$feats,
- cow_n_col = 3, point_size = 1)
-```
-
-# 6. Cell Type Enrichment
-
-Visium spatial transcriptomics does not provide single-cell resolution, making cell type annotation a harder problem. Giotto provides several ways to calculate enrichment of specific cell-type signature gene lists:
-
-- PAGE
-- hypergeometric test
-- Rank
-- DWLS
-
-Corresponded Single cell dataset can be generated from [Single Cell Human Lung Adenocarcinoma](https://drieslab.github.io/Giotto/articles/singlecell_lung_adenocarcinoma.html) vignette. You can also download the Giotto object, or count matrix and metadata from [here](https://drive.google.com/drive/folders/1lv3KYkJoTy4vzJxyRT0zhm6RALVO89M8)
-
-Load the single-cell object
-
-```{r, eval=FALSE}
-giotto_SC <- Giotto::loadGiotto("sc_lung_carcinoma")
-```
-
-## PAGE
-
-The cell-type specific signature gene list was obtained from a previous study focused on investigating the therapy-induced evolution of lung cancer revealed by single-cell RNA sequencing. More information about the paper and scRNA-seq dataset can be found [here](https://doi.org/10.1016/j.cell.2020.07.017).
-
-```{r, eval=FALSE}
-# umap plots
-# Create PAGE matrix
-# PAGE matrix should be a binary matrix with each row represent a gene marker and each column represent a cell type
-# There are several ways to create PAGE matrix
-# 1.1 create binary matrix of cell signature genes
-# small example #
-Tcells_markers = c("CD2", "CD3D", "CD3E", "CD3G")
-macrophage_markers = c("MARCO", "CSF1R", "CD68", "GLDN", "APOE", "CCL3L1", "TREM2", "C1QB", "NUPR1", "FOLR2", "RNASE1", "C1QA")
-dendritic_markers = c("CD1E", "CD1C", "FCER1A", "PKIB", "CYP2S1", "NDRG2")
-mast_markers = c("CMA1", "TPSAB1", "TPSB2")
-Bcell_markers = c("IGLL5", "MZB1", "JCHAIN", "DERL3", "SDC1", "MS$A1", "BANK1", "PAX5", "CD79A")
-Bcell_PB_markers = c("PRDM1", "XSP1", "IRF4")
-Bcell_mem_markers = c("MS4A1", "IRF8")
-housekeeping_markers = c("ACTB", "GAPDH", "MALAT1")
-neutrophils_markers = c("FCGR3B", "ALPL", "CXCR1", "CXCR2", "ADGRG3", "CMTM2", "PROK2", "MME", "MMP25", "TNFRSF10C")
-pdcs_markers = c("SLC32A1", "SHD", "LRRC26", "PACSIN1", "LILRA4", "CLEC4C", "DNASE1L3", "SCT", "LAMP5")
-
-signature_matrix = makeSignMatrixPAGE(sign_names = c('T_Cells', 'Macrophage', 'Dendritic', 'Mast', 'B_cell', 'Bcell_PB', 'Bcells_memory',
-'Housekeeping', 'Neutrophils', 'pDCs'),
- sign_list = list(Tcells_markers,
- macrophage_markers,
- dendritic_markers,
- mast_markers,
- Bcell_markers,
- Bcell_PB_markers,
- Bcell_mem_markers,
- housekeeping_markers,
- neutrophils_markers,
- pdcs_markers))
-
-# 1.3 enrichment test with PAGE
-markers_scran = findMarkers_one_vs_all(gobject=giotto_SC, method="scran",
- expression_values="normalized", cluster_column = "leiden_clus", min_feats=3)
-
-top_markers <- markers_scran[, head(.SD, 10), by="cluster"]
-celltypes<-levels(factor(markers_scran$cluster))
-sign_list<-list()
-for (i in 1:length(celltypes)){
- sign_list[[i]]<-top_markers[which(top_markers$cluster == celltypes[i]),]$feats
-}
-
-PAGE_matrix_3 = makeSignMatrixPAGE(sign_names = celltypes,
- sign_list = sign_list)
-
-# runSpatialEnrich() can also be used as a wrapper for all currently provided enrichment options
-visium_lungcancer = runPAGEEnrich(gobject = visium_lungcancer, sign_matrix = signature_matrix, min_overlap_genes = 1)
-
-# 1.4 heatmap of enrichment versus annotation (e.g. clustering result)
-cell_types = colnames(signature_matrix)
-plotMetaDataCellsHeatmap(gobject = visium_lungcancer,
- metadata_cols = 'leiden_clus',
- value_cols = cell_types,
- spat_enr_names = 'PAGE',
- x_text_size = 8,
- y_text_size = 8,
- show_plot = T,
- save_param = list(save_name="7_a_metaheatmap"))
-```
-
-![](images/visium_cytassist_lungcancer/7_a_metaheatmap.png){width="50.0%"}
-
-```{r, eval=FALSE}
-cell_types_subset = colnames(signature_matrix)
-spatCellPlot(gobject = visium_lungcancer,
- spat_enr_names = 'PAGE',
- cell_annotation_values = cell_types_subset,
- cow_n_col = 4, coord_fix_ratio = NULL, point_size = 0.75,
- save_param = list(save_name="7_b_spatcellplot_1"))
-```
-
-![](images/visium_cytassist_lungcancer/7_b_spatcellplot_1.png){width="80.0%"}
-
-```{r, eval=FALSE}
-spatDimCellPlot(gobject = visium_lungcancer,
- spat_enr_names = 'PAGE',
- cell_annotation_values = c('B_cell','Macrophage'),
- cow_n_col = 1, spat_point_size = 1.2,
- plot_alignment = 'horizontal',
- save_param = list(save_name="7_d_spatDimCellPlot", base_width=7, base_height=10))
-```
-
-![](images/visium_cytassist_lungcancer/7_d_spatDimCellPlot.png){width="80.0%"}
-
-# 7. Spatial Grids
-
-```{r, eval=FALSE}
-visium_lungcancer <- createSpatialGrid(gobject = visium_lungcancer,
- sdimx_stepsize = 400,
- sdimy_stepsize = 400,
- minimum_padding = 0)
-
-spatPlot(visium_lungcancer, cell_color = 'leiden_clus', point_size = 2.5, show_grid = T,
-grid_color = 'red', spatial_grid_name = 'spatial_grid')
-```
-
-![](images/visium_cytassist_lungcancer/18-spatPlot2D.png){width="50.0%"}
-
-# 8. Spatial Network
-
-```{r, eval=FALSE}
-## Delaunay network: stats + creation
-plotStatDelaunayNetwork(gobject = visium_lungcancer, maximum_distance = 400)
-```
-
-![](images/visium_cytassist_lungcancer/19-plotStatDelaunayNetwork.png){width="50.0%"}
-
-```{r, eval=FALSE}
-visium_lungcancer = createSpatialNetwork(gobject = visium_lungcancer, minimum_k = 0)
-showNetworks(visium_lungcancer)
-spatPlot(gobject = visium_lungcancer, show_network = T,
-network_color = 'blue', spatial_network_name = 'Delaunay_network')
-```
-
-![](images/visium_cytassist_lungcancer/20-spatPlot2D.png){width="50.0%"}
-
-# 9. Spatial Genes
-
-```{r, eval=FALSE}
-# kmeans binarization
-kmtest = binSpect(visium_lungcancer)
-spatFeatPlot2D(visium_lungcancer, expression_values = 'scaled',
- feats = kmtest$feats[1:6], cow_n_col = 2, point_size = 1.5)
-```
-
-![](images/visium_cytassist_lungcancer/21-spatFeatPlot2D.png){width="50.0%"}
-
-```{r, eval=FALSE}
-## rank binarization
-ranktest = binSpect(visium_lungcancer, bin_method = 'rank')
-spatFeatPlot2D(visium_lungcancer, expression_values = 'scaled',
- feats = ranktest$feats[1:6], cow_n_col = 2, point_size = 1.5)
-```
-
-![](images/visium_cytassist_lungcancer/22-spatFeatPlot2D.png){width="50.0%"}
-
-```{r, eval=FALSE}
-## spatially correlated genes ##
-ext_spatial_genes = kmtest[1:500]$feats
-
-# 1. calculate gene spatial correlation and single-cell correlation
-# create spatial correlation object
-spat_cor_netw_DT = detectSpatialCorFeats(visium_lungcancer,
- method = 'network',
- spatial_network_name = 'Delaunay_network',
- subset_feats = ext_spatial_genes)
-
-# 2. identify most similar spatially correlated genes for one gene
-DNAI1_top10_genes = showSpatialCorFeats(spat_cor_netw_DT, feats = 'DNAI1', show_top_feats = 10)
-
-spatFeatPlot2D(visium_lungcancer, expression_values = 'scaled',
- feats = c('RSPH1', 'C20orf85', 'DNAAF1','TEKT2'), point_size = 3)
-```
-
-![](images/visium_cytassist_lungcancer/23-spatFeatPlot2D.png){width="50.0%"}
-
-```{r, eval=FALSE}
-spatFeatPlot2D(visium_lungcancer, expression_values = 'scaled',
- feats = c('TEKT2', 'CFAP157', 'MAPK15', 'MS4A8', 'CDHR3', 'C9orf24'), point_size = 3)
-```
-
-![](images/visium_cytassist_lungcancer/24-spatFeatPlot2D.png){width="50.0%"}
-
-```{r, eval=FALSE}
-# 3. cluster correlated genes & visualize
-spat_cor_netw_DT = clusterSpatialCorFeats(spat_cor_netw_DT, name = "spat_netw_clus", k = 10)
-
-heatmSpatialCorFeats(visium_lungcancer,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- save_param = list(save_name = '22-z1-heatmap_correlated_genes',
- save_format = 'pdf',
- base_height = 6,
- base_width = 8,
- units = 'cm'),
- heatmap_legend_param = list(title = NULL))
-```
-
-![](images/visium_cytassist_lungcancer/22-z1-heatmap_correlated_genes.png){width="50.0%"}
-
-```{r, eval=FALSE}
-# 4. rank spatial correlated clusters and show genes for selected clusters
-netw_ranks = rankSpatialCorGroups(visium_lungcancer,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- save_param = c(save_name = '22-z2-rank_correlated_groups',
- base_height = 3, base_width = 5))
-
-top_netw_spat_cluster = showSpatialCorFeats(spat_cor_netw_DT, use_clus_name = 'spat_netw_clus',
- selected_clusters = 6, show_top_feats = 1)
-```
-
-![](images/visium_cytassist_lungcancer/22-z2-rank_correlated_groups.png){width="50.0%"}
-
-```{r, eval=FALSE}
-# 5. create metagene enrichment score for clusters
-cluster_genes_DT = showSpatialCorFeats(spat_cor_netw_DT, use_clus_name = 'spat_netw_clus', show_top_feats = 1)
-cluster_genes = cluster_genes_DT$clus; names(cluster_genes) = cluster_genes_DT$feat_ID
-
-visium_lungcancer = createMetafeats(visium_lungcancer, feat_clusters = cluster_genes, name = 'cluster_metagene')
-
-showGiottoSpatEnrichments(visium_lungcancer)
-
-spatCellPlot(visium_lungcancer,
- spat_enr_names = 'cluster_metagene',
- cell_annotation_values = netw_ranks$clusters,
- point_size = 1.5, cow_n_col = 4)
-```
-
-![](images/visium_cytassist_lungcancer/25-spatCellPlot2D.png){width="80.0%"}
-
-# 10. HMRF Domains
-
-```{r, eval=FALSE}
-# HMRF requires a fully connected network!
-visium_lungcancer = createSpatialNetwork(gobject = visium_lungcancer, minimum_k = 2, name = 'Delaunay_full')
-
-# spatial genes
-my_spatial_genes <- kmtest[1:100]$feats
-
-# do HMRF with different betas
-hmrf_folder = paste0(results_dir,'/','HMRF_results/')
-if(!file.exists(hmrf_folder)) dir.create(hmrf_folder, recursive = T)
-
-# if Rscript is not found, you might have to create a symbolic link, e.g.
-# cd /usr/local/bin
-# sudo ln -s /Library/Frameworks/R.framework/Resources/Rscript Rscript
-HMRF_spatial_genes = doHMRF(gobject = visium_lungcancer,
- expression_values = 'scaled',
- spatial_network_name = 'Delaunay_full',
- spatial_genes = my_spatial_genes,
- k = 5,
- betas = c(0, 10, 3),
- output_folder = paste0(hmrf_folder, '/', 'Spatial_genes/SG_topgenes_k5_scaled'))
-
-## alternative way to view HMRF results
-# results = writeHMRFresults(gobject = ST_test,
-# HMRFoutput = HMRF_spatial_genes,
-# k = 5, betas_to_view = seq(0, 25, by = 5))
-# ST_test = addCellMetadata(ST_test, new_metadata = results, by_column = T, column_cell_ID = 'cell_ID')
-
-## add HMRF of interest to giotto object
-visium_lungcancer = addHMRF(gobject = visium_lungcancer,
- HMRFoutput = HMRF_spatial_genes,
- k = 5, betas_to_add = c(0,10,20),
- hmrf_name = 'HMRF')
-
-showGiottoSpatEnrichments(visium_lungcancer)
-
-## visualize
-spatPlot(gobject = visium_lungcancer, cell_color = 'HMRF_k5_b.0', point_size = 3)
-```
-
-![](images/visium_cytassist_lungcancer/26-spatPlot2D.png){width="50.0%"}
-
-```{r, eval=FALSE}
-spatPlot(gobject = visium_lungcancer, cell_color = 'HMRF_k5_b.10', point_size = 3)
-```
-
-![](images/visium_cytassist_lungcancer/27-spatPlot2D.png){width="50.0%"}
-
-```{r, eval=FALSE}
-sessionInfo()
-
-R version 4.3.2 (2023-10-31)
-Platform: aarch64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.1.2
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-loaded via a namespace (and not attached):
- [1] vctrs_0.6.5 cli_3.6.2 knitr_1.45 rlang_1.1.3 xfun_0.41 stringi_1.8.3
- [7] purrr_1.0.2 pkgload_1.3.4 promises_1.2.1 shiny_1.8.0 xtable_1.8-4 glue_1.7.0
-[13] htmltools_0.5.7 httpuv_1.6.13 pkgbuild_1.4.3 rmarkdown_2.25 evaluate_0.23 ellipsis_0.3.2
-[19] fastmap_1.1.1 yaml_2.3.8 lifecycle_1.0.4 memoise_2.0.1 stringr_1.5.1 compiler_4.3.2
-[25] miniUI_0.1.1.1 sessioninfo_1.2.2 fs_1.6.3 htmlwidgets_1.6.4 Rcpp_1.0.12 urlchecker_1.0.1
-[31] rstudioapi_0.15.0 later_1.3.2 digest_0.6.34 R6_2.5.1 usethis_2.2.2 magrittr_2.0.3
-[37] tools_4.3.2 mime_0.12 devtools_2.4.5 profvis_0.3.8 remotes_2.4.2.1 cachem_1.0.8
-```
diff --git a/vignettes/visium_mouse_brain.Rmd b/vignettes/visium_mouse_brain.Rmd
deleted file mode 100644
index 0e6047bdf..000000000
--- a/vignettes/visium_mouse_brain.Rmd
+++ /dev/null
@@ -1,871 +0,0 @@
----
-title: "Visium Mouse Brain"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Visium Mouse Brain}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# Dataset explanation
-
-[10X genomics](https://www.10xgenomics.com/spatial-transcriptomics/) recently launched a new platform to obtain spatial expression data using a Visium Spatial Gene Expression slide.
-
-The Visium brain data to run this tutorial can be found [here](https://support.10xgenomics.com/spatial-gene-expression/datasets/1.1.0/V1_Adult_Mouse_Brain)
-
-Visium technology:
-
-![](images/general_figs/visium_technology.png)
-
-High resolution png from original tissue:
-
-![]images/general_figs/mouse_brain_highres.png)
-
-# Set up Giotto Environment
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-# 1. Create Giotto Visium Object and visualize
-
-```{r, eval=FALSE}
-library(Giotto)
-
-# 1. set working directory
-results_folder = 'path/to/result'
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-
-# 3. Create Giotto Instructions
-instrs = createGiottoInstructions(save_dir = results_folder,
- save_plot = TRUE,
- show_plot = FALSE,
- python_path = my_python_path)
-```
-
-```{r, eval=FALSE}
-## provide path to visium folder
-data_path = '/path/to/Brain_data/'
-
-## directly from visium folder
-visium_brain = createGiottoVisiumObject(visium_dir = data_path,
- expr_data = 'raw',
- png_name = 'tissue_lowres_image.png',
- gene_column_index = 2,
- instructions = instrs)
-
-## show associated images with giotto object
-showGiottoImageNames(visium_brain) # "image" is the default name
-
-## check metadata
-pDataDT(visium_brain)
-
-## show plot
-spatPlot2D(gobject = visium_brain,
- cell_color = 'in_tissue',
- point_size = 2,
- cell_color_code = c('0' = 'lightgrey', '1' = 'blue'),
- show_image = T,
- image_name = 'image')
-```
-
-![](images/visium_mouse_brain/0-spatPlot2D.png)
-
-# 2. Process Giotto Visium Object
-
-```{r, eval=FALSE}
-## subset on spots that were covered by tissue
-metadata = pDataDT(visium_brain)
-in_tissue_barcodes = metadata[in_tissue == 1]$cell_ID
-visium_brain = subsetGiotto(visium_brain,
- cell_ids = in_tissue_barcodes)
-
-## filter
-visium_brain <- filterGiotto(gobject = visium_brain,
- expression_threshold = 1,
- feat_det_in_min_cells = 50,
- min_det_feats_per_cell = 1000,
- expression_values = c('raw'),
- verbose = T)
-
-## normalize
-visium_brain <- normalizeGiotto(gobject = visium_brain,
- scalefactor = 6000,
- verbose = T)
-
-## add gene & cell statistics
-visium_brain <- addStatistics(gobject = visium_brain)
-
-## visualize
-spatPlot2D(gobject = visium_brain,
- show_image = T,
- point_alpha = 0.7,
- cell_color = 'nr_feats',
- color_as_factor = F)
-```
-
-![](images/visium_mouse_brain/1-spatPlot2D.png)
-
-# 3. Dimension Reduction
-
-```{r, eval=FALSE}
-## highly variable features / genes (HVF)
-visium_brain <- calculateHVF(gobject = visium_brain,
- save_plot = TRUE)
-```
-
-![](images/visium_mouse_brain/2-HVFplot.png)
-
-```{r, eval=FALSE}
-## run PCA on expression values (default)
-gene_metadata = fDataDT(visium_brain)
-featgenes = gene_metadata[hvf == 'yes' & perc_cells > 3 & mean_expr_det > 0.4]$feat_ID
-
-## run PCA on expression values (default)
-visium_brain <- runPCA(gobject = visium_brain,
- feats_to_use = featgenes)
-
-screePlot(visium_brain, ncp = 30)
-```
-
-![](images/visium_mouse_brain/3-screePlot.png)
-
-```{r, eval=FALSE}
-dimPlot2D(gobject = visium_brain,
- dim_reduction_to_use = "pca")
-```
-
-![](images/visium_mouse_brain/4-dimPlot2D.png)
-
-```{r, eval=FALSE}
-## run UMAP and tSNE on PCA space (default)
-visium_brain <- runUMAP(visium_brain,
- dimensions_to_use = 1:10)
-plotUMAP(gobject = visium_brain)
-```
-
-![](images/visium_mouse_brain/5-UMAP.png)
-
-```{r, eval=FALSE}
-visium_brain <- runtSNE(visium_brain,
- dimensions_to_use = 1:10)
-plotTSNE(gobject = visium_brain)
-```
-
-![](images/visium_mouse_brain/6-tSNE.png)
-
-# 4. Clustering
-
-```{r, eval=FALSE}
-## sNN network (default)
-visium_brain <- createNearestNetwork(gobject = visium_brain,
- dimensions_to_use = 1:10,
- k = 15)
-
-## Leiden clustering
-visium_brain <- doLeidenCluster(gobject = visium_brain,
- resolution = 0.4,
- n_iterations = 1000)
-
-plotUMAP(gobject = visium_brain,
- cell_color = 'leiden_clus',
- show_NN_network = T,
- point_size = 2.5)
-```
-
-![](images/visium_mouse_brain/7-UMAP.png)
-
-```{r, eval=FALSE}
-# spatial and dimension plots
-spatDimPlot(gobject = visium_brain,
- cell_color = 'leiden_clus',
- dim_point_size = 2,
- spat_point_size = 2.5)
-```
-
-![](images/visium_mouse_brain/8-spatDimPlot2D.png)
-
-```{r, eval=FALSE}
-spatDimPlot(gobject = visium_brain,
- cell_color = 'nr_feats',
- color_as_factor = F,
- dim_point_size = 2,
- spat_point_size = 2.5)
-```
-
-![](images/visium_mouse_brain/9-spatDimPlot2D.png)
-
-```{r, eval=FALSE}
-# dimension plots grouped by cluster
-spatPlot2D(visium_brain,
- cell_color = 'leiden_clus',
- coord_fix_ratio = 1)
-```
-
-![](images/visium_mouse_brain/10-spatPlot2D.png)
-
-Plot with group by:
-
-```{r, eval=FALSE}
-spatPlot2D(visium_brain,
- cell_color = 'leiden_clus',
- group_by = 'leiden_clus',
- coord_fix_ratio = 1,
- cow_n_col = 6,
- show_legend = F,
- save_param = list(base_width = 14, base_height = 14))
-```
-
-![](images/visium_mouse_brain/11-spatPlot2D.png)
-
-Highlight one or more groups:
-
-```{r, eval=FALSE}
-spatPlot2D(visium_brain,
- cell_color = 'leiden_clus',
- select_cell_groups = '8',
- coord_fix_ratio = 1,
- show_other_cells = TRUE,
- cell_color_code = c('8' = 'red'),
- other_cell_color = "grey",
- other_point_size = 1.5,
- save_param = list(base_width = 7, base_height = 7))
-```
-
-![](images/visium_mouse_brain/12-spatPlot2D.png)
-
-# 5. Subset data
-
-```{r, eval=FALSE}
-# create and show subset
-DG_subset = subsetGiottoLocs(visium_brain,
- x_max = 6500, x_min = 3000,
- y_max = -2500, y_min = -5500,
- return_gobject = TRUE)
-
-spatDimPlot(gobject = DG_subset,
- cell_color = 'leiden_clus',
- spat_point_size = 5)
-```
-
-![](images/visium_mouse_brain/13-spatDimPlot2D.png)
-
-# 6. marker gene detection for clusters
-
-```{r, eval=FALSE}
-## ------------------ ##
-## Gini markers
-gini_markers_subclusters = findMarkers_one_vs_all(gobject = visium_brain,
- method = 'gini',
- expression_values = 'normalized',
- cluster_column = 'leiden_clus',
- min_feats = 20,
- min_expr_gini_score = 0.5,
- min_det_gini_score = 0.5)
-
-topgenes_gini = gini_markers_subclusters[, head(.SD, 2), by = 'cluster']$feats
-
-# violinplot
-violinPlot(visium_brain,
- feats = unique(topgenes_gini),
- cluster_column = 'leiden_clus',
- strip_text = 8,
- strip_position = 'right',
- save_param = list(base_width = 5, base_height = 10))
-```
-
-![](images/visium_mouse_brain/14-violinPlot.png)
-
-```{r, eval=FALSE}
-# cluster heatmap
-plotMetaDataHeatmap(visium_brain,
- selected_feats = unique(topgenes_gini),
- metadata_cols = c('leiden_clus'),
- x_text_size = 10, y_text_size = 10)
-```
-
-![](images/visium_mouse_brain/15-plotMetaDataHeatmap.png)
-
-```{r, eval=FALSE}
-# umap plots
-dimFeatPlot2D(visium_brain,
- expression_values = 'scaled',
- feats = gini_markers_subclusters[, head(.SD, 1), by = 'cluster']$feats,
- cow_n_col = 4,
- point_size = 0.75,
- save_param = list(base_width = 8, base_height = 8))
-```
-
-![](images/visium_mouse_brain/16-dimFeatPlot2D.png)
-
-```{r, eval=FALSE}
-## ------------------ ##
-# Scran Markers
-scran_markers_subclusters = findMarkers_one_vs_all(gobject = visium_brain,
- method = 'scran',
- expression_values = 'normalized',
- cluster_column = 'leiden_clus')
-
-topgenes_scran = scran_markers_subclusters[, head(.SD, 2), by = 'cluster']$feats
-
-# violinplot
-violinPlot(visium_brain,
- feats = unique(topgenes_scran),
- cluster_column = 'leiden_clus',
- strip_text = 10, strip_position = 'right',
- save_param = list(base_width = 5))
-```
-
-![](images/visium_mouse_brain/17-violinPlot.png)
-
-```{r, eval=FALSE}
-# cluster heatmap
-plotMetaDataHeatmap(visium_brain,
- selected_feats = topgenes_scran,
- metadata_cols = c('leiden_clus'))
-```
-
-![](images/visium_mouse_brain/18-plotMetaDataHeatmap.png)
-
-```{r, eval=FALSE}
-# umap plots
-dimFeatPlot2D(visium_brain,
- expression_values = 'scaled',
- feats = scran_markers_subclusters[, head(.SD, 1), by = 'cluster']$feats,
- cow_n_col = 3,
- point_size = 1,
- save_param = list(base_width = 8, base_height = 8))
-```
-
-![](images/visium_mouse_brain/19-dimFeatPlot2D.png)
-
-# 7. Cell type enrichment
-
-Visium spatial transcriptomics does not provide single-cell resolution, making cell type annotation a harder problem. Giotto provides several ways to calculate enrichment of specific cell-type signature gene lists:
-
-- PAGE
-- hypergeometric test
-- Rank
-- [DWLS Deconvolution](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-021-02362-7) Corresponded Single cell dataset can be generated from [here](http://mousebrain.org/). Giotto_SC is processed from the downsampled [Loom](https://satijalab.org/loomr/loomr_tutorial) file and can also be downloaded from GiottoData::getSpatialDataset().
-
-```{r, eval=FALSE}
-# download data to results directory ####
-# if wget is installed, set method = 'wget'
-# if you run into authentication issues with wget, then add " extra = '--no-check-certificate' "
-GiottoData::getSpatialDataset(dataset = 'scRNA_mouse_brain', directory = results_folder)
-
-sc_expression = paste0(results_folder, "/brain_sc_expression_matrix.txt.gz")
-sc_metadata = paste0(results_folder,"/brain_sc_metadata.csv")
-
-giotto_SC = createGiottoObject(expression = sc_expression,
- instructions = instrs)
-
-giotto_SC = addCellMetadata(giotto_SC,
- new_metadata = data.table::fread(sc_metadata))
-
-giotto_SC = normalizeGiotto(giotto_SC)
-```
-
-## 7.1 PAGE enrichment
-
-```{r, eval=FALSE}
-# Create PAGE matrix
-# PAGE matrix should be a binary matrix with each row represent a gene marker and each column represent a cell type
-# There are several ways to create PAGE matrix
-# 1.1 create binary matrix of cell signature genes
-# small example #
-gran_markers = c("Nr3c2", "Gabra5", "Tubgcp2", "Ahcyl2",
- "Islr2", "Rasl10a", "Tmem114", "Bhlhe22",
- "Ntf3", "C1ql2")
-
-oligo_markers = c("Efhd1", "H2-Ab1", "Enpp6", "Ninj2",
- "Bmp4", "Tnr", "Hapln2", "Neu4",
- "Wfdc18", "Ccp110")
-
-di_mesench_markers = c("Cartpt", "Scn1a", "Lypd6b", "Drd5",
- "Gpr88", "Plcxd2", "Cpne7", "Pou4f1",
- "Ctxn2", "Wnt4")
-
-PAGE_matrix_1 = makeSignMatrixPAGE(sign_names = c('Granule_neurons',
- 'Oligo_dendrocytes',
- 'di_mesenchephalon'),
- sign_list = list(gran_markers,
- oligo_markers,
- di_mesench_markers))
-
-# ----
-
-# 1.2 [shortcut] fully pre-prepared matrix for all cell types
-sign_matrix_path = system.file("extdata", "sig_matrix.txt", package = 'GiottoData')
-brain_sc_markers = data.table::fread(sign_matrix_path)
-PAGE_matrix_2 = as.matrix(brain_sc_markers[,-1])
-rownames(PAGE_matrix_2) = brain_sc_markers$Event
-
-# ---
-
-# 1.3 make PAGE matrix from single cell dataset
-markers_scran = findMarkers_one_vs_all(gobject = giotto_SC,
- method = "scran",
- expression_values = "normalized",
- cluster_column = "Class",
- min_feats = 3)
-
-top_markers = markers_scran[, head(.SD, 10), by = "cluster"]
-celltypes = levels(factor(markers_scran$cluster))
-
-sign_list = list()
-
-for (i in 1:length(celltypes)){
- sign_list[[i]] = top_markers[which(top_markers$cluster == celltypes[i]),]$feats
-}
-
-PAGE_matrix_3 = makeSignMatrixPAGE(sign_names = celltypes,
- sign_list = sign_list)
-
-# 1.4 enrichment test with PAGE
-
-# runSpatialEnrich() can also be used as a wrapper for all currently provided enrichment options
-visium_brain <- runPAGEEnrich(gobject = visium_brain,
- sign_matrix = PAGE_matrix_2)
-
-# 1.5 heatmap of enrichment versus annotation (e.g. clustering result)
-cell_types_PAGE = colnames(PAGE_matrix_2)
-
-plotMetaDataCellsHeatmap(gobject = visium_brain,
- metadata_cols = 'leiden_clus',
- value_cols = cell_types_PAGE,
- spat_enr_names = 'PAGE',
- x_text_size = 8,
- y_text_size = 8)
-```
-
-![](images/visium_mouse_brain/20-plotMetaDataCellsHeatmap.png)
-
-```{r, eval=FALSE}
-# 1.6 visualizations
-spatCellPlot2D(gobject = visium_brain,
- spat_enr_names = 'PAGE',
- cell_annotation_values = cell_types_PAGE[1:4],
- cow_n_col = 2,
- coord_fix_ratio = 1,
- point_size = 1.25,
- show_legend = T)
-```
-
-![](images/visium_mouse_brain/21-spatCellPlot2D.png)
-
-```{r, eval=FALSE}
-spatDimCellPlot2D(gobject = visium_brain,
- spat_enr_names = 'PAGE',
- cell_annotation_values = cell_types_PAGE[1:4],
- cow_n_col = 1,
- spat_point_size = 1,
- plot_alignment = 'horizontal',
- save_param = list(base_width = 7, base_height = 10))
-```
-
-![](images/visium_mouse_brain/22-spatDimCellPlot2D.png)
-
-## 7.2 HyperGeometric test
-
-```{r, eval=FALSE}
-visium_brain <- runHyperGeometricEnrich(gobject = visium_brain,
- expression_values = "normalized",
- sign_matrix = PAGE_matrix_2)
-
-cell_types_HyperGeometric = colnames(PAGE_matrix_2)
-
-spatCellPlot(gobject = visium_brain,
- spat_enr_names = 'hypergeometric',
- cell_annotation_values = cell_types_HyperGeometric[1:4],
- cow_n_col = 2,
- coord_fix_ratio = NULL,
- point_size = 1.75)
-```
-
-![](images/visium_mouse_brain/23-spatCellPlot2D.png)
-
-## 7.3 Rank Enrichment
-
-```{r, eval=FALSE}
-# Create rank matrix, not that rank matrix is different from PAGE
-# A count matrix and a vector for all cell labels will be needed
-rank_matrix = makeSignMatrixRank(sc_matrix = getExpression(giotto_SC,
- values = "normalized",
- output = "matrix"),
- sc_cluster_ids = pDataDT(giotto_SC)$Class)
-
-colnames(rank_matrix) = levels(factor(pDataDT(giotto_SC)$Class))
-
-visium_brain <- runRankEnrich(gobject = visium_brain,
- sign_matrix = rank_matrix,
- expression_values = "normalized")
-
-# Plot Rank enrichment result
-spatCellPlot2D(gobject = visium_brain,
- spat_enr_names = 'rank',
- cell_annotation_values = colnames(rank_matrix)[1:4],
- cow_n_col = 2,
- coord_fix_ratio = 1,
- point_size = 1,
- save_param = list(save_name = "spat_enr_Rank_plot"))
-```
-
-![](images/visium_mouse_brain/spat_enr_Rank_plot.png)
-
-## 7.4 DWLS spatial deconvolution
-
-```{r, eval=FALSE}
-# Create DWLS matrix, not that DWLS matrix is different from PAGE and rank
-# A count matrix a vector for a list of gene signatures and a vector for all cell labels will be needed
-DWLS_matrix = makeSignMatrixDWLSfromMatrix(matrix = getExpression(giotto_SC,
- values = "normalized",
- output = "matrix"),
- cell_type = pDataDT(giotto_SC)$Class,
- sign_gene = top_markers$feats)
-
-visium_brain <- runDWLSDeconv(gobject = visium_brain,
- sign_matrix = DWLS_matrix)
-
-
-# Plot DWLS deconvolution result
-spatCellPlot2D(gobject = visium_brain,
- spat_enr_names = 'DWLS',
- cell_annotation_values = levels(factor(pDataDT(giotto_SC)$Class))[1:4],
- cow_n_col = 2,
- coord_fix_ratio = 1,
- point_size = 1,
- save_param = list(save_name = "DWLS_plot"))
-```
-
-![](images/visium_mouse_brain/DWLS_plot.png)
-
-```{r, eval=FALSE}
-# Plot DWLS deconvolution result with Pie plots
-spatDeconvPlot(visium_brain,
- show_image = T,
- radius = 50,
- save_param = list(save_name = "spat_DWLS_pie_plot"))
-```
-
-![](images/visium_mouse_brain/spat_DWLS_pie_plot.png)
-
-# 8. Spatial Grid
-
-```{r, eval=FALSE}
-visium_brain <- createSpatialGrid(gobject = visium_brain,
- sdimx_stepsize = 400,
- sdimy_stepsize = 400,
- minimum_padding = 0)
-
-showGiottoSpatGrids(visium_brain)
-
-spatPlot2D(visium_brain,
- cell_color = 'leiden_clus',
- show_grid = T,
- grid_color = 'red',
- spatial_grid_name = 'spatial_grid')
-```
-
-![](images/visium_mouse_brain/24-spatPlot2D.png)
-
-# 9. spatial network
-
-```{r, eval=FALSE}
-visium_brain <- createSpatialNetwork(gobject = visium_brain,
- method = 'kNN',
- k = 5,
- maximum_distance_knn = 400,
- name = 'spatial_network')
-
-showGiottoSpatNetworks(visium_brain)
-
-spatPlot2D(gobject = visium_brain,
- show_network= T,
- network_color = 'blue',
- spatial_network_name = 'spatial_network')
-```
-
-![](images/visium_mouse_brain/25-spatPlot2D.png)
-
-# 10. Spatial Genes
-
-```{r, eval=FALSE}
-## rank binarization
-ranktest = binSpect(visium_brain,
- bin_method = 'rank',
- calc_hub = T,
- hub_min_int = 5,
- spatial_network_name = 'spatial_network')
-
-spatFeatPlot2D(visium_brain,
- expression_values = 'scaled',
- feats = ranktest$feats[1:6],
- cow_n_col = 2,
- point_size = 1.5)
-```
-
-![](images/visium_mouse_brain/26-spatFeatPlot2D.png)
-
-# 11. Spatial Co-Expression modules
-
-```{r, eval=FALSE}
-# cluster the top 500 spatial genes into 20 clusters
-ext_spatial_genes = ranktest[1:1500,]$feats
-
-# here we use existing detectSpatialCorGenes function to calculate pairwise distances between genes (but set network_smoothing=0 to use default clustering)
-spat_cor_netw_DT = detectSpatialCorFeats(visium_brain,
- method = 'network',
- spatial_network_name = 'spatial_network',
- subset_feats = ext_spatial_genes)
-
-# 2. identify most similar spatially correlated genes for one gene
-top10_genes = showSpatialCorFeats(spat_cor_netw_DT,
- feats = 'Ptprn',
- show_top_feats = 10)
-
-spatFeatPlot2D(visium_brain,
- expression_values = 'scaled',
- feats = top10_genes$variable[1:4],
- point_size = 3)
-```
-
-![](images/visium_mouse_brain/27-spatFeatPlot2D.png)
-
-```{r, eval=FALSE}
-# cluster spatial genes
-spat_cor_netw_DT = clusterSpatialCorFeats(spat_cor_netw_DT,
- name = 'spat_netw_clus',
- k = 20)
-
-# visualize clusters
-heatmSpatialCorFeats(visium_brain,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- heatmap_legend_param = list(title = NULL),
- save_param = list(base_height = 6, base_width = 8, units = 'cm'))
-```
-
-![](images/visium_mouse_brain/28-heatmSpatialCorFeats.png)
-
-```{r, eval=FALSE}
-# 4. rank spatial correlated clusters and show genes for selected clusters
-netw_ranks = rankSpatialCorGroups(visium_brain,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- save_param = list(base_height = 3, base_width = 5))
-
-top_netw_spat_cluster = showSpatialCorFeats(spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- selected_clusters = 6,
- show_top_feats = 1)
-```
-
-![](images/visium_mouse_brain/29-rankSpatialCorGroups.png)
-
-```{r, eval=FALSE}
-# 5. create metagene enrichment score for clusters
-cluster_genes_DT = showSpatialCorFeats(spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- show_top_feats = 1)
-
-cluster_genes = cluster_genes_DT$clus
-names(cluster_genes) = cluster_genes_DT$feat_ID
-
-visium_brain <- createMetafeats(visium_brain,
- feat_clusters = cluster_genes,
- name = 'cluster_metagene')
-
-spatCellPlot(visium_brain,
- spat_enr_names = 'cluster_metagene',
- cell_annotation_values = netw_ranks$clusters,
- point_size = 1,
- cow_n_col = 5,
- save_param = list(base_width = 15))
-```
-
-![](images/visium_mouse_brain/30-spatCellPlot2D.png)
-
-# 12. Spatially informed clusters
-
-```{r, eval=FALSE}
-# top 30 genes per spatial co-expression cluster
-table(spat_cor_netw_DT$cor_clusters$spat_netw_clus)
-
-coexpr_dt = data.table::data.table(genes = names(spat_cor_netw_DT$cor_clusters$spat_netw_clus),
- cluster = spat_cor_netw_DT$cor_clusters$spat_netw_clus)
-
-data.table::setorder(coexpr_dt, cluster)
-top30_coexpr_dt = coexpr_dt[, head(.SD, 30) , by = cluster]
-my_spatial_genes = top30_coexpr_dt$genes
-
-
-visium_brain <- runPCA(gobject = visium_brain,
- feats_to_use = my_spatial_genes,
- name = 'custom_pca')
-
-visium_brain <- runUMAP(visium_brain,
- dim_reduction_name = 'custom_pca',
- dimensions_to_use = 1:20,
- name = 'custom_umap')
-
-visium_brain <- createNearestNetwork(gobject = visium_brain,
- dim_reduction_name = 'custom_pca',
- dimensions_to_use = 1:20,
- k = 5,
- name = 'custom_NN')
-
-visium_brain <- doLeidenCluster(gobject = visium_brain,
- network_name = 'custom_NN',
- resolution = 0.15,
- n_iterations = 1000,
- name = 'custom_leiden')
-
-cell_meta = pDataDT(visium_brain)
-cell_clusters = unique(cell_meta$custom_leiden)
-
-selected_colors = getDistinctColors(length(cell_clusters))
-names(selected_colors) = cell_clusters
-
-spatPlot2D(visium_brain,
- cell_color = 'custom_leiden',
- cell_color_code = selected_colors,
- coord_fix_ratio = 1)
-```
-
-![](images/visium_mouse_brain/31-spatPlot2D.png)
-
-```{r, eval=FALSE}
-plotUMAP(gobject = visium_brain,
- cell_color = 'custom_leiden',
- cell_color_code = selected_colors,
- point_size = 1.5)
-```
-
-![](images/visium_mouse_brain/32-UMAP.png)
-
-# 13. Spatial domains with HMRF
-
-```{r, eval=FALSE}
-# do HMRF with different betas on top 30 genes per spatial co-expression module
-hmrf_folder = paste0(results_folder,'/','11_HMRF/')
-if(!file.exists(hmrf_folder)) dir.create(hmrf_folder, recursive = T)
-
-HMRF_spatial_genes = doHMRF(gobject = visium_brain,
- expression_values = 'scaled',
- spatial_genes = my_spatial_genes,
- k = 20,
- spatial_network_name="spatial_network",
- betas = c(0, 10, 5),
- output_folder = paste0(hmrf_folder, '/', 'Spatial_genes/SG_topgenes_k20_scaled'))
-
-visium_brain <- addHMRF(gobject = visium_brain,
- HMRFoutput = HMRF_spatial_genes,
- k = 20,
- betas_to_add = c(0, 10, 20, 30, 40),
- hmrf_name = 'HMRF')
-
-spatPlot2D(gobject = visium_brain,
- cell_color = 'HMRF_k20_b.40')
-```
-
-![](images/visium_mouse_brain/33-spatPlot2D.png)
-
-# 14. Session info
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
-R version 4.3.2 (2023-10-31)
-Platform: x86_64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.3.1
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-other attached packages:
-[1] shiny_1.8.0 Giotto_4.0.2 GiottoClass_0.1.3
-
-loaded via a namespace (and not attached):
- [1] later_1.3.2 bitops_1.0-7 tibble_3.2.1
- [4] R.oo_1.26.0 polyclip_1.10-6 lifecycle_1.0.4
- [7] Rdpack_2.6 edgeR_4.0.14 doParallel_1.0.17
- [10] globals_0.16.2 lattice_0.22-5 MASS_7.3-60.0.1
- [13] backports_1.4.1 magrittr_2.0.3 limma_3.58.1
- [16] sass_0.4.8 rmarkdown_2.25 jquerylib_0.1.4
- [19] yaml_2.3.8 metapod_1.10.1 httpuv_1.6.14
- [22] reticulate_1.35.0 cowplot_1.1.3 RColorBrewer_1.1-3
- [25] abind_1.4-5 zlibbioc_1.48.0 Rtsne_0.17
- [28] quadprog_1.5-8 GenomicRanges_1.54.1 purrr_1.0.2
- [31] R.utils_2.12.3 BiocGenerics_0.48.1 RCurl_1.98-1.14
- [34] pracma_2.4.4 tweenr_2.0.2 circlize_0.4.15
- [37] GenomeInfoDbData_1.2.11 IRanges_2.36.0 S4Vectors_0.40.2
- [40] ggrepel_0.9.5 irlba_2.3.5.1 listenv_0.9.1
- [43] terra_1.7-71 dqrng_0.3.2 parallelly_1.36.0
- [46] DelayedMatrixStats_1.24.0 colorRamp2_0.1.0 codetools_0.2-19
- [49] DelayedArray_0.28.0 scuttle_1.12.0 ggforce_0.4.1
- [52] tidyselect_1.2.0 shape_1.4.6 farver_2.1.1
- [55] ScaledMatrix_1.10.0 matrixStats_1.2.0 stats4_4.3.2
- [58] GiottoData_0.2.7.0 jsonlite_1.8.8 GetoptLong_1.0.5
- [61] BiocNeighbors_1.20.2 ellipsis_0.3.2 progressr_0.14.0
- [64] iterators_1.0.14 systemfonts_1.0.5 foreach_1.5.2
- [67] dbscan_1.1-12 tools_4.3.2 ragg_1.2.7
- [70] Rcpp_1.0.12 glue_1.7.0 SparseArray_1.2.3
- [73] xfun_0.42 MatrixGenerics_1.14.0 GenomeInfoDb_1.38.6
- [76] dplyr_1.1.4 withr_3.0.0 fastmap_1.1.1
- [79] bluster_1.12.0 fansi_1.0.6 digest_0.6.34
- [82] rsvd_1.0.5 R6_2.5.1 mime_0.12
- [85] textshaping_0.3.7 colorspace_2.1-0 Cairo_1.6-2
- [88] gtools_3.9.5 R.methodsS3_1.8.2 utf8_1.2.4
- [91] tidyr_1.3.1 generics_0.1.3 smfishHmrf_0.1
- [94] data.table_1.15.0 FNN_1.1.4 S4Arrays_1.2.0
- [97] scatterpie_0.2.1 uwot_0.1.16 pkgconfig_2.0.3
-[100] gtable_0.3.4 ComplexHeatmap_2.18.0 GiottoVisuals_0.1.4
-[103] SingleCellExperiment_1.24.0 XVector_0.42.0 htmltools_0.5.7
-[106] clue_0.3-65 scales_1.3.0 Biobase_2.62.0
-[109] GiottoUtils_0.1.5 png_0.1-8 SpatialExperiment_1.12.0
-[112] scran_1.30.2 ggfun_0.1.4 knitr_1.45
-[115] rstudioapi_0.15.0 reshape2_1.4.4 rjson_0.2.21
-[118] checkmate_2.3.1 cachem_1.0.8 GlobalOptions_0.1.2
-[121] stringr_1.5.1 parallel_4.3.2 miniUI_0.1.1.1
-[124] RcppZiggurat_0.1.6 pillar_1.9.0 grid_4.3.2
-[127] vctrs_0.6.5 promises_1.2.1 BiocSingular_1.18.0
-[130] beachmat_2.18.0 xtable_1.8-4 cluster_2.1.6
-[133] evaluate_0.23 magick_2.8.2 cli_3.6.2
-[136] locfit_1.5-9.8 compiler_4.3.2 rlang_1.1.3
-[139] crayon_1.5.2 future.apply_1.11.1 labeling_0.4.3
-[142] fs_1.6.3 plyr_1.8.9 stringi_1.8.3
-[145] BiocParallel_1.36.0 munsell_0.5.0 Matrix_1.6-5
-[148] sparseMatrixStats_1.14.0 future_1.33.1 ggplot2_3.4.4
-[151] statmod_1.5.0 SummarizedExperiment_1.32.0 rbibutils_2.2.16
-[154] Rfast_2.1.0 igraph_2.0.1.1 memoise_2.0.1
-[157] RcppParallel_5.1.7 bslib_0.6.1
-```
-
-
diff --git a/vignettes/visium_mouse_kidney.Rmd b/vignettes/visium_mouse_kidney.Rmd
deleted file mode 100644
index b1e764744..000000000
--- a/vignettes/visium_mouse_kidney.Rmd
+++ /dev/null
@@ -1,486 +0,0 @@
----
-title: "Visium Mouse Kidney"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Visium Mouse Kidney}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-Warning: This tutorial was written with Giotto version 2.0.0.9046.This is an older version and results could be slightly different
-
-# Dataset explanation
-
-[10X genomics](https://www.10xgenomics.com/spatial-transcriptomics/) recently launched a new platform to obtain spatial expression data using a Visium Spatial Gene Expression slide.
-
-The Visium kidney data to run this tutorial can be found [here](https://support.10xgenomics.com/spatial-gene-expression/datasets/1.0.0/V1_Mouse_Kidney)
-
-Visium technology:
-
-![](images/general_figs/visium_technology.png)
-
-High resolution png from original tissue:
-
-![](images/general_figs/mouse_kidney_highres.png)
-
-# Set up Giotto Environment
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-# 1. Giotto global instructions and preparations
-
-```{r, eval=FALSE}
-library(Giotto)
-
-# 1. set working directory
-results_folder = '/path/to/directory/'
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-python_path = NULL # alternatively, "/local/python/path/python" if desired.
-```
-
-```{r, eval=FALSE}
-## create instructions
-instrs = createGiottoInstructions(save_dir = results_folder,
- save_plot = TRUE,
- show_plot = FALSE,
- python_path = python_path)
-
-## provide path to visium folder
-data_path = '/path/to/Kidney_data/'
-```
-
-# 2. Create Giotto object & process data
-
-```{r, eval=FALSE}
-## directly from visium folder
-visium_kidney = createGiottoVisiumObject(visium_dir = data_path,
- expr_data = 'raw',
- png_name = 'tissue_lowres_image.png',
- gene_column_index = 2,
- instructions = instrs)
-
-## check metadata
-pDataDT(visium_kidney)
-
-# check available image names
-showGiottoImageNames(visium_kidney) # "image" is the default name
-
-## show aligned image
-spatPlot(gobject = visium_kidney, cell_color = 'in_tissue', show_image = T, point_alpha = 0.7)
-```
-
-![](images/visium_mouse_kidney/0-spatPlot2D.png)
-
-```{r, eval=FALSE}
-## subset on spots that were covered by tissue
-metadata = pDataDT(visium_kidney)
-in_tissue_barcodes = metadata[in_tissue == 1]$cell_ID
-visium_kidney = subsetGiotto(visium_kidney, cell_ids = in_tissue_barcodes)
-
-## filter
-visium_kidney <- filterGiotto(gobject = visium_kidney,
- expression_threshold = 1,
- feat_det_in_min_cells = 50,
- min_det_feats_per_cell = 1000,
- expression_values = c('raw'),
- verbose = T)
-
-## normalize
-visium_kidney <- normalizeGiotto(gobject = visium_kidney, scalefactor = 6000, verbose = T)
-
-## add gene & cell statistics
-visium_kidney <- addStatistics(gobject = visium_kidney)
-
-## visualize
-spatPlot2D(gobject = visium_kidney, show_image = T, point_alpha = 0.7)
-```
-
-![](images/visium_mouse_kidney/1-spatPlot2D.png)
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = visium_kidney, show_image = T, point_alpha = 0.7,
- cell_color = 'nr_feats', color_as_factor = F)
-```
-
-![](images/visium_mouse_kidney/2-spatPlot2D.png)
-
-# 3. Dimension reduction
-
-```{r, eval=FALSE}
-## highly variable features (genes)
-visium_kidney <- calculateHVF(gobject = visium_kidney)
-```
-
-![](images/visium_mouse_kidney/3-HVFplot.png)
-
-```{r, eval=FALSE}
-## run PCA on expression values (default)
-visium_kidney <- runPCA(gobject = visium_kidney)
-screePlot(visium_kidney, ncp = 30)
-```
-
-![](images/visium_mouse_kidney/4-screePlot.png)
-
-```{r, eval=FALSE}
-plotPCA(gobject = visium_kidney)
-```
-
-![](images/visium_mouse_kidney/5-PCA.png)
-
-```{r, eval=FALSE}
-## run UMAP and tSNE on PCA space (default)
-visium_kidney <- runUMAP(visium_kidney, dimensions_to_use = 1:10)
-plotUMAP(gobject = visium_kidney)
-```
-
-![](images/visium_mouse_kidney/6-UMAP.png)
-
-```{r, eval=FALSE}
-visium_kidney <- runtSNE(visium_kidney, dimensions_to_use = 1:10)
-plotTSNE(gobject = visium_kidney)
-```
-
-![](images/visium_mouse_kidney/7-tSNE.png)
-
-# 4. Clustering
-
-```{r, eval=FALSE}
-## sNN network (default)
-visium_kidney <- createNearestNetwork(gobject = visium_kidney, dimensions_to_use = 1:10, k = 15)
-## Leiden clustering
-visium_kidney <- doLeidenCluster(gobject = visium_kidney, resolution = 0.4, n_iterations = 1000)
-plotUMAP(gobject = visium_kidney, cell_color = 'leiden_clus', show_NN_network = T, point_size = 2.5)
-```
-
-![](images/visium_mouse_kidney/8-UMAP.png)
-
-# 5. Co-visualize
-
-```{r, eval=FALSE}
-# expression and spatial
-spatDimPlot(gobject = visium_kidney, cell_color = 'leiden_clus',
- dim_point_size = 2, spat_point_size = 2.5)
-```
-
-![](images/visium_mouse_kidney/9-spatDimPlot2D.png)
-
-```{r, eval=FALSE}
-spatDimPlot(gobject = visium_kidney, cell_color = 'nr_feats', color_as_factor = F,
- dim_point_size = 2, spat_point_size = 2.5)
-```
-
-![](images/visium_mouse_kidney/10-spatDimPlot2D.png)
-
-# 6. Cell type marker gene detection
-
-## gini
-
-```{r, eval=FALSE}
-gini_markers_subclusters = findMarkers_one_vs_all(gobject = visium_kidney,
- method = 'gini',
- expression_values = 'normalized',
- cluster_column = 'leiden_clus',
- min_featss = 20,
- min_expr_gini_score = 0.5,
- min_det_gini_score = 0.5)
-topgenes_gini = gini_markers_subclusters[, head(.SD, 2), by = 'cluster']$feats
-
-# violinplot
-violinPlot(visium_kidney, feats = unique(topgenes_gini), cluster_column = 'leiden_clus',
- strip_text = 8, strip_position = 'right')
-```
-
-![](images/visium_mouse_kidney/11-violinPlot.png)
-
-```{r, eval=FALSE}
-violinPlot(visium_kidney, feats = unique(topgenes_gini), cluster_column = 'leiden_clus',
- strip_text = 8, strip_position = 'right',
- save_param = c(save_name = '11-z1-violinplot_gini', base_width = 5, base_height = 10))
-```
-
-![](images/visium_mouse_kidney/11-z1-violinplot_gini.png)
-
-```{r, eval=FALSE}
-# cluster heatmap
-plotMetaDataHeatmap(visium_kidney,
- selected_feats = topgenes_gini,
- metadata_cols = c('leiden_clus'),
- x_text_size = 10, y_text_size = 10)
-```
-
-![](images/visium_mouse_kidney/12-plotMetaDataHeatmap.png)
-
-```{r, eval=FALSE}
-# umap plots
-dimFeatPlot2D(visium_kidney,
- expression_values = 'scaled',
- feats = gini_markers_subclusters[, head(.SD, 1), by = 'cluster']$feats,
- cow_n_col = 3, point_size = 1)
-```
-
-![](images/visium_mouse_kidney/13-dimFeatPlot2D.png)
-
-## scran
-
-```{r, eval=FALSE}
-scran_markers_subclusters = findMarkers_one_vs_all(gobject = visium_kidney,
- method = 'scran',
- expression_values = 'normalized',
- cluster_column = 'leiden_clus')
-topgenes_scran = scran_markers_subclusters[, head(.SD, 2), by = 'cluster']$feats
-
-violinPlot(visium_kidney, feats = unique(topgenes_scran),
- cluster_column = 'leiden_clus',
- strip_text = 10, strip_position = 'right')
-```
-
-![](images/visium_mouse_kidney/14-violinPlot.png)
-
-```{r, eval=FALSE}
-# cluster heatmap
-plotMetaDataHeatmap(visium_kidney, selected_feats = topgenes_scran,
- metadata_cols = c('leiden_clus'))
-```
-
-![](images/visium_mouse_kidney/15-plotMetaDataHeatmap.png)
-
-```{r, eval=FALSE}
-# umap plots
-dimFeatPlot2D(visium_kidney, expression_values = 'scaled',
- feats = scran_markers_subclusters[, head(.SD, 1), by = 'cluster']$feats,
- cow_n_col = 3, point_size = 1)
-```
-
-![](images/visium_mouse_kidney/16-dimFeatPlot2D.png)
-
-# 7. cell-type annotation
-
-Visium spatial transcriptomics does not provide single-cell resolution, making cell type annotation a harder problem. Giotto provides 3 ways to calculate enrichment of specific cell-type signature gene list:
-
-- PAGE
-- rank
-- hypergeometric test
-
-# 8. Spatial grid
-
-```{r, eval=FALSE}
-visium_kidney <- createSpatialGrid(gobject = visium_kidney,
- sdimx_stepsize = 400,
- sdimy_stepsize = 400,
- minimum_padding = 0)
-spatPlot(visium_kidney, cell_color = 'leiden_clus', show_grid = T,
- grid_color = 'red', spatial_grid_name = 'spatial_grid')
-```
-
-![](images/visium_mouse_kidney/17-spatPlot2D.png)
-
-# 9. spatial network
-
-```{r, eval=FALSE}
-## delaunay network: stats + creation
-plotStatDelaunayNetwork(gobject = visium_kidney, maximum_distance = 400)
-```
-
-![](images/visium_mouse_kidney/18-plotStatDelaunayNetwork.png)
-
-```{r, eval=FALSE}
-visium_kidney = createSpatialNetwork(gobject = visium_kidney, minimum_k = 0)
-showNetworks(visium_kidney)
-spatPlot(gobject = visium_kidney, show_network = T,
- network_color = 'blue', spatial_network_name = 'Delaunay_network')
-```
-
-![](images/visium_mouse_kidney/19-spatPlot2D.png)
-
-# 10. Spatial genes
-
-## Spatial genes
-
-```{r, eval=FALSE}
-## kmeans binarization
-kmtest = binSpect(visium_kidney)
-spatFeatPlot2D(visium_kidney, expression_values = 'scaled',
- feats = kmtest$feats[1:6], cow_n_col = 2, point_size = 1.5)
-```
-
-![](images/visium_mouse_kidney/20-spatFeatPlot2D.png)
-
-```{r, eval=FALSE}
-## rank binarization
-ranktest = binSpect(visium_kidney, bin_method = 'rank')
-spatFeatPlot2D(visium_kidney, expression_values = 'scaled',
- feats = ranktest$feats[1:6], cow_n_col = 2, point_size = 1.5)
-```
-
-![](images/visium_mouse_kidney/21-spatFeatPlot2D.png)
-
-## Spatial co-expression patterns
-
-```{r, eval=FALSE}
-## spatially correlated genes ##
-ext_spatial_genes = kmtest[1:500]$feats
-
-# 1. calculate gene spatial correlation and single-cell correlation
-# create spatial correlation object
-spat_cor_netw_DT = detectSpatialCorFeats(visium_kidney,
- method = 'network',
- spatial_network_name = 'Delaunay_network',
- subset_feats = ext_spatial_genes)
-
-# 2. identify most similar spatially correlated genes for one gene
-Napsa_top10_genes = showSpatialCorFeats(spat_cor_netw_DT, feats = 'Napsa', show_top_feats = 10)
-
-spatFeatPlot2D(visium_kidney, expression_values = 'scaled',
- feats = c('Napsa', 'Kap', 'Defb29', 'Prdx1'), point_size = 3)
-```
-
-![](images/visium_mouse_kidney/22-spatFeatPlot2D.png)
-
-```{r, eval=FALSE}
-# 3. cluster correlated genes & visualize
-spat_cor_netw_DT = clusterSpatialCorFeats(spat_cor_netw_DT,
- name = 'spat_netw_clus', k = 8)
-
-heatmSpatialCorFeats(visium_kidney,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- save_param = list(save_name = '22-z1-heatmap_correlated_genes',
- save_format = 'pdf',
- base_height = 6,
- base_width = 8, units = 'cm'),
- heatmap_legend_param = list(title = NULL))
-```
-
-![](images/visium_mouse_kidney/22-z1-heatmap_correlated_genes.pdf)
-
-```{r, eval=FALSE}
-# 4. rank spatial correlated clusters and show genes for selected clusters
-netw_ranks = rankSpatialCorGroups(visium_kidney,
- spatCorObject = spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- save_param = list(save_name = '22-z2-rank_correlated_groups',
- base_height = 3,
- base_width = 5))
-```
-
-![](images/visium_mouse_kidney/22-z2-rank_correlated_groups.png)
-
-```{r, eval=FALSE}
-top_netw_spat_cluster = showSpatialCorFeats(spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- selected_clusters = 6,
- show_top_feats = 1)
-
-# 5. create metagene enrichment score for clusters
-cluster_genes_DT = showSpatialCorFeats(spat_cor_netw_DT,
- use_clus_name = 'spat_netw_clus',
- show_top_feats = 1)
-cluster_genes = cluster_genes_DT$clus
-names(cluster_genes) = cluster_genes_DT$feat_ID
-
-visium_kidney = createMetafeats(visium_kidney,
- feat_clusters = cluster_genes,
- name = 'cluster_metagene')
-
-showGiottoSpatEnrichments(visium_kidney)
-
-spatCellPlot(visium_kidney,
- spat_enr_names = 'cluster_metagene',
- cell_annotation_values = netw_ranks$clusters,
- point_size = 1.5, cow_n_col = 4)
-```
-
-![](images/visium_mouse_kidney/23-spatCellPlot2D.png)
-
-# 11. HMRF domains
-
-```{r, eval=FALSE}
-# HMRF requires a fully connected network!
-visium_kidney = createSpatialNetwork(gobject = visium_kidney,
- minimum_k = 2,
- name = 'Delaunay_full')
-
-# spatial genes
-my_spatial_genes <- kmtest[1:100]$feats
-
-# do HMRF with different betas
-hmrf_folder = paste0(results_folder,'/','HMRF_results/')
-if(!file.exists(hmrf_folder)) dir.create(hmrf_folder, recursive = T)
-
-# if Rscript is not found, you might have to create a symbolic link, e.g.
-# cd /usr/local/bin
-# sudo ln -s /Library/Frameworks/R.framework/Resources/Rscript Rscript
-HMRF_spatial_genes = doHMRF(gobject = visium_kidney,
- expression_values = 'scaled',
- spatial_network_name = 'Delaunay_full',
- spatial_genes = my_spatial_genes,
- k = 5,
- betas = c(0, 1, 6),
- output_folder = paste0(hmrf_folder, '/', 'Spatial_genes/SG_topgenes_k5_scaled'))
-```
-
-```{r, eval=FALSE}
-## alternative way to view HMRF results
-#results = writeHMRFresults(gobject = ST_test,
-# HMRFoutput = HMRF_spatial_genes,
-# k = 5, betas_to_view = seq(0, 25, by = 5))
-#ST_test = addCellMetadata(ST_test, new_metadata = results, by_column = T, column_cell_ID = 'cell_ID')
-
-
-## add HMRF of interest to giotto object
-visium_kidney = addHMRF(gobject = visium_kidney,
- HMRFoutput = HMRF_spatial_genes,
- k = 5, betas_to_add = c(0, 2),
- hmrf_name = 'HMRF')
-
-## visualize
-spatPlot(gobject = visium_kidney,
- cell_color = 'HMRF_k5_b.0',
- point_size = 5)
-```
-
-![](images/visium_mouse_kidney/24-spatPlot2D.png)
-
-```{r, eval=FALSE}
-spatPlot(gobject = visium_kidney,
- cell_color = 'HMRF_k5_b.2',
- point_size = 5)
-```
-
-![](images/visium_mouse_kidney/25-spatPlot2D.png)
-
-# Export and create Giotto Viewers
-
-```{r, eval=FALSE}
-# check which annotations are available
-combineMetadata(visium_kidney)
-
-# select annotations, reductions and expression values to view in Giotto Viewer
-viewer_folder = paste0(results_folder, '/', 'mouse_visium_kidney_viewer')
-
-exportGiottoViewer(gobject = visium_kidney,
- output_directory = viewer_folder,
- factor_annotations = c('in_tissue',
- 'leiden_clus'),
- numeric_annotations = c('nr_feats'),
- dim_reductions = c('tsne', 'umap'),
- dim_reduction_names = c('tsne', 'umap'),
- expression_values = 'scaled',
- expression_rounding = 2,
- overwrite_dir = T)
-```
diff --git a/vignettes/visium_prostate_integration.Rmd b/vignettes/visium_prostate_integration.Rmd
deleted file mode 100644
index c65f95532..000000000
--- a/vignettes/visium_prostate_integration.Rmd
+++ /dev/null
@@ -1,524 +0,0 @@
----
-title: "Visium Prostate Integration"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Visium Prostate Integration}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# 1 Dataset explanation
-
-[10X genomics](https://www.10xgenomics.com/spatial-transcriptomics/) recently launched a new platform to obtain spatial expression data using a Visium Spatial Gene Expression slide.
-
-The Visium Cancer Prostate data to run this tutorial can be found [here](https://www.10xgenomics.com/resources/datasets/human-prostate-cancer-adenocarcinoma-with-invasive-carcinoma-ffpe-1-standard-1-3-0) The Visium Normal Prostate data to run this tutorial can be found [here](https://www.10xgenomics.com/resources/datasets/normal-human-prostate-ffpe-1-standard-1-3-0)
-
-Visium technology:
-
-![](images/general_figs/visium_technology.png){width="50.0%"}
-
-High resolution png from original tissue:
-
-![](images/general_figs/Visium_FFPE_Human_Normal_Prostate_image.png){width="50.0%"}
-
-![](images/general_figs/Visium_FFPE_Human_Prostate_Cancer_image.png){width="50.0%"}
-
-
-# 2 Start Giotto
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- Giotto::installGiottoEnvironment()
-}
-```
-
-```{r, eval=FALSE}
-library(Giotto)
-
-# 1. set working directory
-results_directory = getwd()
-
-# 2. set giotto python path
-# set python path to your preferred python version path
-# set python path to NULL if you want to automatically install (only the 1st time) and use the giotto miniconda environment
-python_path = NULL
-if(is.null(python_path)) {
- installGiottoEnvironment()
-}
-```
-
-```{r, eval=FALSE}
-# 3. create giotto instructions
-instrs = createGiottoInstructions(save_dir = results_directory,
- save_plot = TRUE,
- show_plot = TRUE,
- python_path = python_path)
-```
-
-
-# 3 Create Giotto objects and join
-
-```{r, eval=FALSE}
-# This dataset must be downlaoded manually; please do so and change the path below as appropriate
-data_directory <- getwd()
-
-## obese upper
-N_pros = createGiottoVisiumObject(
- visium_dir = paste0(data_directory,'/Visium_FFPE_Human_Normal_Prostate'),
- expr_data = 'raw',
- png_name = 'tissue_lowres_image.png',
- gene_column_index = 2,
- instructions = instrs
-)
-```
-
-```{r, eval=FALSE}
-## obese lower
-C_pros = createGiottoVisiumObject(
- visium_dir = paste0(data_directory,'/Visium_FFPE_Human_Prostate_Cancer/'),
- expr_data = 'raw',
- png_name = 'tissue_lowres_image.png',
- gene_column_index = 2,
- instructions = instrs
-)
-```
-
-```{r, eval=FALSE}
-# join giotto objects
-# joining with x_shift has the advantage that you can join both 2D and 3D data
-# x_padding determines how much distance is between each dataset
-# if x_shift = NULL, then the total shift will be guessed from the giotto image
-testcombo = joinGiottoObjects(gobject_list = list(N_pros, C_pros),
- gobject_names = c('NP', 'CP'),
- join_method = 'shift', x_padding = 1000)
-```
-
-```{r, eval=FALSE}
-# join info is stored in this slot
-# simple list for now
-testcombo@join_info
-```
-
-```{r, eval=FALSE}
-# check joined Giotto object
-fDataDT(testcombo)
-```
-
-```{r, eval=FALSE}
-pDataDT(testcombo)
-```
-
-```{r, eval=FALSE}
-showGiottoImageNames(testcombo)
-```
-
-```{r, eval=FALSE}
-showGiottoSpatLocs(testcombo)
-```
-
-```{r, eval=FALSE}
-showGiottoExpression(testcombo)
-```
-
-```{r, eval=FALSE}
-# this plots all the images by list_ID
-spatPlot2D(gobject = testcombo, cell_color = 'in_tissue',
- show_image = T, image_name = c("NP-image", "CP-image"),
- group_by = 'list_ID', point_alpha = 0.5,
- save_param = list(save_name = "1a_plot"))
-```
-
-![](images/visium_prostate_integration/1a_plot.png)
-
-```{r, eval=FALSE}
-# this plots one selected image
-spatPlot2D(gobject = testcombo, cell_color = 'in_tissue',
- show_image = T, image_name = c("NP-image"), point_alpha = 0.3,
- save_param = list(save_name = "1b_plot"))
-```
-
-![](images/visium_prostate_integration/1b_plot.png)
-
-```{r, eval=FALSE}
-# this plots two selected images
-spatPlot2D(gobject = testcombo, cell_color = 'in_tissue',
- show_image = T, image_name = c( "NP-image", "CP-image"),
- point_alpha = 0.3,
- save_param = list(save_name = "1c_plot"))
-```
-
-![](images/visium_prostate_integration/1c_plot.png)
-
-# 4 Process Giotto Objects
-
-```{r, eval=FALSE}
-# subset on in-tissue spots
-metadata = pDataDT(testcombo)
-in_tissue_barcodes = metadata[in_tissue == 1]$cell_ID
-testcombo = subsetGiotto(testcombo, cell_ids = in_tissue_barcodes)
-```
-
-```{r, eval=FALSE}
-## filter
-testcombo <- filterGiotto(gobject = testcombo,
- expression_threshold = 1,
- feat_det_in_min_cells = 50,
- min_det_feats_per_cell = 500,
- expression_values = c('raw'),
- verbose = T)
-```
-
-```{r, eval=FALSE}
-## normalize
-testcombo <- normalizeGiotto(gobject = testcombo, scalefactor = 6000)
-```
-
-```{r, eval=FALSE}
-## add gene & cell statistics
-testcombo <- addStatistics(gobject = testcombo, expression_values = 'raw')
-
-fmeta = fDataDT(testcombo)
-testfeats = fmeta[perc_cells > 20 & perc_cells < 50][100:110]$feat_ID
-
-violinPlot(testcombo, feats = testfeats, cluster_column = 'list_ID', save_param = list(save_name = "2a_plot"))
-```
-
-![](images/visium_prostate_integration/2a_plot.png)
-
-```{r, eval=FALSE}
-plotMetaDataHeatmap(testcombo, selected_feats = testfeats, metadata_cols = 'list_ID', save_param = list(save_name = "2b_plot"))
-```
-
-![](images/visium_prostate_integration/2b_plot.png)
-
-```{r, eval=FALSE}
-## visualize
-spatPlot2D(gobject = testcombo, group_by = 'list_ID', cell_color = 'nr_feats', color_as_factor = F, point_size = 0.75, save_param = list(save_name = "2c_plot"))
-```
-
-![](images/visium_prostate_integration/2c_plot.png)
-
-# 5 Dimention Reduction
-
-```{r, eval=FALSE}
-## PCA ##
-testcombo <- calculateHVF(gobject = testcombo)
-```
-
-![](images/visium_prostate_integration/0-HVFplot.png)
-
-```{r, eval=FALSE}
-testcombo <- runPCA(gobject = testcombo, center = TRUE, scale_unit = TRUE)
-```
-
-```{r, eval=FALSE}
-screePlot(testcombo, ncp = 30, save_param = list(save_name = "3a_screeplot"))
-```
-
-![](images/visium_prostate_integration/3a_screeplot.png)
-
-# 6 Clustering
-
-## 6.1 Without Integration
-
-Integration is usually needed for dataset of different conditions to minimize batch effects. Without integration means without using any integration methods.
-
-```{r, eval=FALSE}
-## cluster and run UMAP ##
-# sNN network (default)
-testcombo <- createNearestNetwork(gobject = testcombo,
- dim_reduction_to_use = 'pca', dim_reduction_name = 'pca',
- dimensions_to_use = 1:10, k = 15)
-
-# Leiden clustering
-testcombo <- doLeidenCluster(gobject = testcombo, resolution = 0.2, n_iterations = 1000)
-
-# UMAP
-testcombo = runUMAP(testcombo)
-
-plotUMAP(gobject = testcombo,
- cell_color = 'leiden_clus', show_NN_network = T, point_size = 1.5,
- save_param = list(save_name = "4.1a_plot"))
-```
-
-![](images/visium_prostate_integration/4.1a_plot.png)
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = testcombo, group_by = 'list_ID',
- cell_color = 'leiden_clus',
- point_size = 1.5,
- save_param = list(save_name = "4.1b_plot"))
-```
-
-![](images/visium_prostate_integration/4.1b_plot.png)
-
-```{r, eval=FALSE}
-spatDimPlot2D(gobject = testcombo,
- cell_color = 'leiden_clus',
- save_param = list(save_name = "4.1c_plot"))
-```
-
-![](images/visium_prostate_integration/4.1c_plot.png)
-
-## 6.2 With Harmony integration
-
-Harmony is a integration algorithm developed by [Korsunsky, I. et al.](https://www.nature.com/articles/s41592-019-0619-0). It was designed for integration of single cell data but also work well on spatial datasets.
-
-```{r, eval=FALSE}
-## data integration, cluster and run UMAP ##
-
-# harmony
-#library(devtools)
-#install_github("immunogenomics/harmony")
-library(harmony)
-```
-
-```{r, eval=FALSE}
-## run harmony integration
-testcombo = runGiottoHarmony(testcombo, vars_use = 'list_ID', do_pca = F)
-```
-
-```{r, eval=FALSE}
-## sNN network (default)
-testcombo <- createNearestNetwork(gobject = testcombo,
- dim_reduction_to_use = 'harmony', dim_reduction_name = 'harmony', name = 'NN.harmony',
- dimensions_to_use = 1:10, k = 15)
-
-## Leiden clustering
-testcombo <- doLeidenCluster(gobject = testcombo,
- network_name = 'NN.harmony', resolution = 0.2, n_iterations = 1000, name = 'leiden_harmony')
-
-# UMAP dimension reduction
-testcombo = runUMAP(testcombo, dim_reduction_name = 'harmony', dim_reduction_to_use = 'harmony', name = 'umap_harmony')
-
-
-plotUMAP(gobject = testcombo,
- dim_reduction_name = 'umap_harmony',
- cell_color = 'leiden_harmony',
- show_NN_network = F,
- point_size = 1.5,
- save_param = list(save_name = "4.2a_plot"))
-```
-
-![](images/visium_prostate_integration/4.2a_plot.png)
-
-```{r, eval=FALSE}
-# If you want to show NN network information, you will need to specify these arguments in the plotUMAP function
-# show_NN_network = T, nn_network_to_use = 'sNN' , network_name = 'NN.harmony'
-```
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = testcombo, group_by = 'list_ID',
- cell_color = 'leiden_harmony',
- point_size = 1.5,
- save_param = list(save_name = "4.2b_plot"))
-```
-
-![](images/visium_prostate_integration/4.2b_plot.png)
-
-```{r, eval=FALSE}
-spatDimPlot2D(gobject = testcombo,
- dim_reduction_to_use = 'umap', dim_reduction_name = 'umap_harmony',
- cell_color = 'leiden_harmony',
- save_param = list(save_name = "4.2c_plot"))
-```
-
-![](images/visium_prostate_integration/4.2c_plot.png)
-
-```{r, eval=FALSE}
-# compare to previous results
-spatPlot2D(gobject = testcombo,
- cell_color = 'leiden_clus',
- save_param = list(save_name = "4_w_o_integration_plot"))
-```
-
-![](images/visium_prostate_integration/4_w_o_integration_plot.png)
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = testcombo,
- cell_color = 'leiden_harmony',
- save_param = list(save_name = "4_w_integration_plot"))
-```
-
-![](images/visium_prostate_integration/4_w_integration_plot.png)
-
-# 7 Cell type annotation
-
-Visium spatial transcriptomics does not provide single-cell resolution, making cell type annotation a harder problem. Giotto provides several ways to calculate enrichment of specific cell-type signature gene list:
-
-- PAGE
-- hypergeometric test
-- Rank
-- [DWLS Deconvolution](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-021-02362-7)
-
-This is also the easiest way to integrate Visium datasets with single cell data. Example shown here is from [Ma et al.](https://pubmed.ncbi.nlm.nih.gov/33032611/) from two prostate cancer patients. The raw dataset can be found [here](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE157703) Giotto_SC is processed variable in the [single cell RNAseq tutorial](https://giottosuite.com/articles/singlecell_prostate_standard_Sep29_21.html). You can also get access to the processed files of this dataset using getSpatialDataset
-
-```{r, eval=FALSE}
-# download data to results directory ####
-# if wget is installed, set method = 'wget'
-# if you run into authentication issues with wget, then add " extra = '--no-check-certificate' "
-getSpatialDataset(dataset = 'scRNA_prostate', directory = data_directory)
-```
-
-```{r, eval=FALSE}
-sc_expression = paste0(data_directory, "/prostate_sc_expression_matrix.csv.gz")
-sc_metadata = paste0(data_directory, "/prostate_sc_metadata.csv")
-
-giotto_SC <- createGiottoObject(
- expression = sc_expression,
- instructions = instrs
-)
-```
-
-```{r, eval=FALSE}
-giotto_SC <- addCellMetadata(giotto_SC,
- new_metadata = data.table::fread(sc_metadata))
-
-giotto_SC<- normalizeGiotto(giotto_SC)
-```
-
-## 7.1 PAGE enrichment
-
-```{r, eval=FALSE}
-# Create PAGE matrix
-# PAGE matrix should be a binary matrix with each row represent a gene marker and each column represent a cell type
-# markers_scran is generated from single cell analysis ()
-markers_scran = findMarkers_one_vs_all(gobject=giotto_SC,
- method="scran",
- expression_values="normalized",
- cluster_column='prostate_labels',
- min_feats=3)
-```
-
-```{r, eval=FALSE}
-top_markers <- markers_scran[, head(.SD, 10), by="cluster"]
-celltypes<-levels(factor(markers_scran$cluster))
-sign_list<-list()
-
-for (i in 1:length(celltypes)){
- sign_list[[i]]<-top_markers[which(top_markers$cluster == celltypes[i]),]$feats
-}
-
-PAGE_matrix = makeSignMatrixPAGE(sign_names = celltypes,
- sign_list = sign_list)
-```
-
-```{r, eval=FALSE}
-testcombo = runPAGEEnrich(gobject = testcombo,
- sign_matrix = PAGE_matrix,
- min_overlap_genes = 2)
-
-cell_types_subset = colnames(PAGE_matrix)
-
-# Plot PAGE enrichment result
-spatCellPlot(gobject = testcombo,
- spat_enr_names = 'PAGE',
- cell_annotation_values = cell_types_subset[1:4],
- cow_n_col = 2,coord_fix_ratio = NULL, point_size = 1.25,
- save_param = list(save_name = "5a_PAGE_plot"))
-```
-
-![](images/visium_prostate_integration/5a_PAGE_plot.png)
-
-## 7.2 Hypergeometric test
-
-```{r, eval=FALSE}
-testcombo = runHyperGeometricEnrich(gobject = testcombo,
- expression_values = "normalized",
- sign_matrix = PAGE_matrix)
-cell_types_subset = colnames(PAGE_matrix)
-spatCellPlot(gobject = testcombo,
- spat_enr_names = 'hypergeometric',
- cell_annotation_values = cell_types_subset[1:4],
- cow_n_col = 2,coord_fix_ratio = NULL, point_size = 1.75,
- save_param = list(save_name = "5b_HyperGeometric_plot"))
-```
-
-![](images/visium_prostate_integration/5b_HyperGeometric_plot.png)
-
-## 7.3 Rank Enrichment
-
-```{r, eval=FALSE}
-# Create rank matrix, not that rank matrix is different from PAGE
-# A count matrix and a vector for all cell labels will be needed
-sc_expression_norm = getExpression(giotto_SC,
- values = "normalized",
- output = "matrix")
-
-prostate_feats = pDataDT(giotto_SC)$prostate_label
-
-rank_matrix = makeSignMatrixRank(sc_matrix = sc_expression_norm,
- sc_cluster_ids = prostate_feats)
-colnames(rank_matrix)<-levels(factor(prostate_feats))
-testcombo = runRankEnrich(gobject = testcombo, sign_matrix = rank_matrix,expression_values = "normalized")
-
-# Plot Rank enrichment result
-spatCellPlot2D(gobject = testcombo,
- spat_enr_names = 'rank',
- cell_annotation_values = cell_types_subset[1:4],
- cow_n_col = 2,coord_fix_ratio = NULL, point_size = 1,
- save_param = list(save_name = "5c_Rank_plot"))
-```
-
-![](images/visium_prostate_integration/5c_Rank_plot.png)
-
-## 7.4 DWLS Deconvolution
-
-```{r, eval=FALSE}
-# Create DWLS matrix, not that DWLS matrix is different from PAGE and rank
-# A count matrix a vector for a list of gene signatures and a vector for all cell labels will be needed
-DWLS_matrix<-makeSignMatrixDWLSfromMatrix(matrix = sc_expression_norm,
- cell_type = prostate_feats,
- sign_gene = top_markers$feats)
-testcombo = runDWLSDeconv(gobject = testcombo, sign_matrix = DWLS_matrix)
-
-
-# Plot DWLS deconvolution result
-spatCellPlot2D(gobject = testcombo,
- spat_enr_names = 'DWLS',
- cell_annotation_values = levels(factor(prostate_feats))[1:4],
- cow_n_col = 2,coord_fix_ratio = NULL, point_size = 1,
- save_param = list(save_name = "5d_DWLS_plot"))
-```
-
-![](images/visium_prostate_integration/5d_DWLS_plot.png)
-
-# 8 Session Info
-
-```{r, eval=FALSE}
-sessionInfo()
-
-R version 4.3.2 (2023-10-31)
-Platform: aarch64-apple-darwin20 (64-bit)
-Running under: macOS Sonoma 14.1.2
-
-Matrix products: default
-BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
-LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
-
-locale:
-[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-
-time zone: America/New_York
-tzcode source: internal
-
-attached base packages:
-[1] stats graphics grDevices utils datasets methods base
-
-loaded via a namespace (and not attached):
- [1] vctrs_0.6.5 cli_3.6.2 knitr_1.45 rlang_1.1.3 xfun_0.41 stringi_1.8.3
- [7] purrr_1.0.2 pkgload_1.3.4 promises_1.2.1 shiny_1.8.0 xtable_1.8-4 glue_1.7.0
-[13] htmltools_0.5.7 httpuv_1.6.13 pkgbuild_1.4.3 rmarkdown_2.25 evaluate_0.23 ellipsis_0.3.2
-[19] fastmap_1.1.1 yaml_2.3.8 lifecycle_1.0.4 memoise_2.0.1 stringr_1.5.1 compiler_4.3.2
-[25] miniUI_0.1.1.1 sessioninfo_1.2.2 fs_1.6.3 htmlwidgets_1.6.4 Rcpp_1.0.12 urlchecker_1.0.1
-[31] rstudioapi_0.15.0 later_1.3.2 digest_0.6.34 R6_2.5.1 usethis_2.2.2 magrittr_2.0.3
-[37] tools_4.3.2 mime_0.12 devtools_2.4.5 profvis_0.3.8 remotes_2.4.2.1 cachem_1.0.8
-```
diff --git a/vignettes/visualizations.Rmd b/vignettes/visualizations.Rmd
deleted file mode 100644
index 9e67f6f02..000000000
--- a/vignettes/visualizations.Rmd
+++ /dev/null
@@ -1,590 +0,0 @@
----
-title: "Visualizations"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Visualizations}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-
-# 1. Dataset explanation
-
-This tutorial walks through the visualization capabilities of Giotto. The clustering and dimension reduction methods focused on within the [dimension reduction](./dimension_reduction.html) tutorial will be revisited and utilized to create heatmaps, violin plots, and visualizations that are unique to Giotto: spatial maps and networks.
-
-This tutorial uses a merFISH dataset of mouse hypothalamic preoptic regions from [Moffitt et al.](https://doi.org/10.1126/science.aau5324). A complete walkthrough of that dataset can be found [here](./merFISH_hypoth_220915.html). To download the data used to create the Giotto Object below, please ensure that
-[wget](https://www.gnu.org/software/wget/?) is installed locally.
-
-# 2. Start Giotto
-
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure Giotto Data is installed
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment
- Giotto::installGiottoEnvironment()
-}
-```
-
-
-# 3. Create a Giotto object
-
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-# Specify path from which data may be retrieved/stored
-data_directory = paste0(getwd(),'/gobject_visual_data/')
-# alternatively, "/path/to/where/the/data/lives/"
-
-# Specify path to which results may be saved
-results_directory = paste0(getwd(),'/gobject_visual_results/')
-# alternatively, "/path/to/store/the/results/"
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-
-# Get the dataset
-getSpatialDataset(dataset = 'merfish_preoptic',
- directory = data_directory,
- method = 'wget')
-```
-
-```{r, eval=FALSE}
-### Giotto instructions and data preparation
-# Optional: Set Giotto instructions
-instrs = createGiottoInstructions(save_plot = TRUE,
- show_plot = TRUE,
- save_dir = results_directory,
- python_path = my_python_path)
-```
-
-```{r, eval=FALSE}
-# Create file paths to feed data into Giotto object
-expr_path = paste0(data_directory, "merFISH_3D_data_expression.txt.gz")
-loc_path = paste0(data_directory, "merFISH_3D_data_cell_locations.txt")
-meta_path = paste0(data_directory, "merFISH_3D_metadata.txt")
-
-### Create Giotto object
-testobj <- createGiottoObject(expression = expr_path,
- spatial_locs = loc_path,
- instructions = instrs)
-```
-
-```{r, eval=FALSE}
-# Add additional metadata
-metadata = data.table::fread(meta_path)
-
-testobj = addCellMetadata(testobj,
- new_metadata = metadata$layer_ID,
- vector_name = 'layer_ID')
-
-testobj = addCellMetadata(testobj,
- new_metadata = metadata$orig_cell_types,
- vector_name = 'orig_cell_types')
-
-### Process the Giotto Object
-# Note that for the purposes of this tutorial, the entire dataset will be visualized.
-# Thus, filter parameters are set to 0, so as to not remove any cells.
-# Note that since adjustment is not required, adjust_params is set to NULL.
-
-testobj <- processGiotto(testobj,
- filter_params = list(expression_threshold = 0,
- feat_det_in_min_cells = 0,
- min_det_feats_per_cell = 0),
- norm_params = list(norm_methods = 'standard',
- scale_feats = TRUE,
- scalefactor = 1000),
- stat_params = list(expression_values = 'normalized'),
- adjust_params = NULL)
-```
-
-
-# 4. Visualize the Dataset
-
-This dataset includes eight sequential slices. As such it can be visualized both in 2D and 3D.
-
-In 2D:
-
-
-```{r, eval=FALSE}
-spatPlot(gobject = testobj, point_size = 1.5)
-```
-
-![](images/visualizations/unnamed-chunk-3-1.png)
-
-
-
-In 3D:
-
-
-```{r, eval=FALSE}
-spatPlot3D(gobject = testobj, point_size = 1, axis_scale = 'real')
-```
-
-![](images/visualizations/newplot.png)
-
-
-
-# 5. Create and Visualize Clusters
-
-First, run a PCA on the data. For the purposes of this tutorial, no highly variable genes will be identified or used in the reduction for simplicity. The data will simply undergo a dimension reduction through PCA. Then, run a UMAP on the data for pre-clustering visualization. The UMAP may also be plotted in 2D and 3D.
-
-
-```{r, eval=FALSE}
-# Run PCA
-testobj <- runPCA(gobject = testobj, feats_to_use = NULL, scale_unit = FALSE, center = TRUE)
-```
-
-```{r, eval=FALSE}
-# Run UMAP
-testobj <- runUMAP(gobject = testobj, dimensions_to_use = 1:8, n_components = 3, n_threads = 4)
-# Plot UMAP in 2D
-plotUMAP_2D(gobject = testobj, point_size = 1.5)
-```
-
-![](images/visualizations/unnamed-chunk-5-1.png)
-
-
-```{r, eval=FALSE}
-# Plot UMAP 3D
-plotUMAP_3D(gobject = testobj, point_size = 1.5)
-```
-
-
-![](images/visualizations/newplot1.png)
-
-
-
-Now, the data may be clustered. Create a nearest network, and then create Leiden clusters. The clusters may be visualized in 2D or 3D, as well as upon the UMAP and within the tissue.
-
-
-```{r, eval=FALSE}
-# Create a k Nearest Network for clustering
-testobj <- createNearestNetwork(gobject = testobj, dimensions_to_use = 1:8, k = 10)
-```
-
-```{r, eval=FALSE}
-# Preform Leiden clustering
-testobj <- doLeidenCluster(gobject = testobj,
- resolution = 0.25,
- n_iterations = 200,
- name = 'leiden_0.25.200')
-
-# Plot the clusters upon the UMAP
-plotUMAP_3D(gobject = testobj, cell_color = 'leiden_0.25.200', point_size = 1.5,
- show_center_label = F, save_param = list(save_name = 'leiden_0.25.200_UMAP_3D'))
-```
-
-![](images/visualizations/newplot2.png)
-
-
-
-Visualize Leiden clusters within the tissue by creating a Spatial Plot, grouping by layer_ID.
-
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = testobj,
- point_size = 1.0,
- cell_color = 'leiden_0.25.200',
- group_by = 'layer_ID',
- cow_n_col = 2,
- group_by_subset = c(260, 160, 60, -40, -140, -240))
-```
-
-
-![](images/visualizations/unnamed-chunk-8-1.png)
-
-
-
-Visualize expression levels within the tissue by creating a Spatial Plot, grouping by layer_ID, and specifying *cell_color* as the number of features detected per cell.
-
-
-```{r, eval=FALSE}
-# Plot cell_color as a representation of the number of features/ cell ("nr_feats")
-spatPlot2D(gobject = testobj, point_size = 1.5,
- cell_color = 'nr_feats', color_as_factor = F,
- group_by = 'layer_ID', cow_n_col = 2, group_by_subset = c(260, 160, 60, -40, -140, -240))
-```
-
-
-![](images/visualizations/unnamed-chunk-9-1.png)
-
-
-
-# 6. Compare Clusters
-
-We can compare clusters using a heatmap:
-
-
-```{r, eval=FALSE}
-showClusterHeatmap(gobject = testobj, cluster_column = 'leiden_0.25.200', save_plot = T)
-```
-
-
-![](images/visualizations/unnamed-chunk-10-1.png)
-
-
-
-We can plot a dendogram to explore cluster similarity:
-
-
-```{r, eval=FALSE}
-showClusterDendrogram(testobj, h = 0.5, rotate = T, cluster_column = 'leiden_0.25.200')
-```
-
-
-![](images/visualizations/unnamed-chunk-11-1.png)
-
-
-
-# 7 Visualize Cell Markers
-
-Marker features may be identified by calling **findMarkers_one_vs_all**. This function detects differentially expressed features by comparing a single cluster to all others. Currently, three methods are supported: "*scran*", "*gini*", and "*mast*". Here, the "*gini*" method is employed; details on the gini method may be found [here](../docs/reference/findGiniMarkers.html).
-
-
-```{r, eval=FALSE}
-markers = findMarkers_one_vs_all(gobject = testobj,
- method = 'gini',
- expression_values = 'normalized',
- cluster_column = 'leiden_0.25.200',
- min_feats = 1, rank_score = 2)
-```
-
-```{r, eval=FALSE}
-topgini_genes = unique(markers[, head(.SD, 2), by = 'cluster']$feats)
-```
-
-
-Create a violinplot:
-
-
-```{r, eval=FALSE}
-violinPlot(testobj, feats = topgini_genes, cluster_column = 'leiden_0.25.200', strip_position = 'right')
-```
-
-
-![](images/visualizations/unnamed-chunk-13-1.png)
-
-
-
-Create a heatmap of top gini genes by cluster:
-
-
-```{r, eval=FALSE}
-plotMetaDataHeatmap(testobj, expression_values = 'scaled',
- metadata_cols = c('leiden_0.25.200'),
- selected_feats = topgini_genes)
-```
-
-
-![](images/visualizations/unnamed-chunk-14-1.png)
-
-
-
-# 8. Visualize Cell Types in Tissue
-
-To do this, the Leiden clusters must be annotated. Leveraging the provided cell metadata and Giotto Spatial Plots, Leiden clusters may be manually assigned a cell type. Alternative approaches (i.e. in the absence of cell metadata with cell type identification ) could involve the analysis of each cluster for enrichment in cell-specific marker genes.
-
-Since cell type annotations are included within the metadata that was loaded into the Giotto Object, the UMAP may be plotted with cell-type annotations. If cell types are known, Leiden clusters may be manually assigned to a cell type, as will be done here.
-
-
-```{r, eval=FALSE}
-# Plot the UMAP, annotated by cell type.
-plotUMAP_3D(testobj,
- cell_color = 'orig_cell_types',
- save_param = list(save_name = 'Original_Cell_Types_UMAP_3D'))
-```
-
-
-![](images/visualizations/newplot3.png)
-
-
-
-Manually assign cell types to clusters via inspection of UMAP plots. Specifically, the UMAP plots saved as *"leiden_0.25.200_UMAP3D"* and *"Original_Cell_Types_UMAP3D"* are being compared for assignment.
-
-
-```{r, eval=FALSE}
-# Manually assign Leiden clusters to a cell type
-cluster_range = unique(testobj@cell_metadata$cell$rna$leiden_0.25.200)
-
-# Note that cell types were condensed (i.e. "Endothelial 1", "Endothelial 2", ... were
-# combined into one cell type "Endothelial")
-manual_cluster = c('Inhibitory', 'Excitatory', 'Inhibitory', 'Astrocyte', 'OD Mature',
- 'Endothelial', 'Microglia', 'OD Mature', 'OD Immature', 'Astrocyte',
- 'Ependymal', 'Pericytes', 'Ambiguous', 'Microglia', 'Inhibitory', 'Inhibitory')
-
-names(manual_cluster) = as.character(sort(cluster_range))
-
-testobj = annotateGiotto(gobject = testobj,
- annotation_vector = manual_cluster,
- cluster_column = 'leiden_0.25.200',
- name = 'cell_types')
-
-cell_types_in_plot = c('Inhibitory', 'Excitatory','OD Mature', 'OD Immature',
- 'Astrocyte', 'Microglia', 'Ependymal','Endothelial',
- 'Pericytes', 'Ambiguous')
-
-# This Giotto function will provide a distinct color palette. Colors
-# may change each time the function is run.
-mycolorcode = getDistinctColors(length(cell_types_in_plot))
-
-names(mycolorcode) = cell_types_in_plot
-
-# Visualize the assigned types in the UMAP
-plotUMAP_3D(testobj, cell_color = 'cell_types', point_size = 1.5,
- cell_color_code = mycolorcode,
- save_param = list(save_name = 'manual_cluster_typing_UMAP_3D'))
-```
-
-
-![](images/visualizations/newplot4.png)
-
-
-
-Now that each Leiden cluster has an associated cell type, cell types may be viewed in tissue in 2D and in 3D within a Spatial Plot by specifying the *cell_color* parameter as the name of the annotation, 'cell_types'.
-
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = testobj, point_size = 1.0,
- cell_color = 'cell_types', group_by = 'layer_ID',
- cell_color_code = mycolorcode, cow_n_col = 2,
- group_by_subset = c(seq(260, -290, -100)))
-```
-
-
-![](images/visualizations/unnamed-chunk-17-1.png)
-
-
-
-
-```{r, eval=FALSE}
-spatPlot3D(testobj,
- cell_color = 'cell_types', axis_scale = 'real',
- sdimx = 'sdimx', sdimy = 'sdimy', sdimz = 'sdimz',
- show_grid = F, cell_color_code = mycolorcode)
-```
-
-
-![](images/visualizations/newplot5.png)
-
-
-
-The plots may be subset by cell type in 2D and 3D.
-
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = testobj, point_size = 1.0,
- cell_color = 'cell_types', cell_color_code = mycolorcode,
- select_cell_groups = c('Microglia', 'Ependymal', 'Endothelial'), show_other_cells = F,
- group_by = 'layer_ID', cow_n_col = 2, group_by_subset = c(seq(260, -290, -100)))
-```
-
-
-![](images/visualizations/unnamed-chunk-19-1.png)
-
-
-
-
-```{r, eval=FALSE}
-spatPlot3D(testobj,
- cell_color = 'cell_types', axis_scale = 'real',
- sdimx = 'sdimx', sdimy = 'sdimy', sdimz = 'sdimz',
- show_grid = F, cell_color_code = mycolorcode,
- select_cell_groups = c('Microglia', 'Ependymal', 'Endothelial'), show_other_cells = F)
-```
-
-
-![](images/visualizations/newplot6.png)
-
-
-
-# 9. Visualize Cell Networks
-
-It is preferred to use Delaunay geometry to create spatial networks. In other cases, k-nearest neighbor may be used to create a spatial network. Specifying the *method* parameter within [createSpatialNetwork](../docs/reference/createSpatialNetwork.html) will accomplish this. By default, this function runs the Delaunay method. Here, both methods, as well as potential modifications to the k-nearest networks, will be shown.
-
-
-```{r, eval=FALSE}
-### Spatial Networks
-# The following function provides insight to the Delaunay Network. It will be shown in-console
-# if this command is run as written.
-plotStatDelaunayNetwork(gobject= testobj,
- method = 'delaunayn_geometry',
- maximum_distance = 50,
- show_plot = T,
- save_plot = F)
-```
-
-
-![](images/visualizations/unnamed-chunk-21-1.png)
-
-
-```{r, eval=FALSE}
-# Create Spatial Network using Delaunay geometry
-testobj = createSpatialNetwork(gobject = testobj,
- delaunay_method = 'delaunayn_geometry',
- minimum_k = 2,
- maximum_distance_delaunay = 50)
-
-# Create Spatial Networks using k-nearest neighbor with varying specifications
-testobj <- createSpatialNetwork(gobject = testobj,
- method = 'kNN',
- k = 5,
- name = 'spatial_network')
-
-testobj <- createSpatialNetwork(gobject = testobj,
- method = 'kNN',
- k = 10,
- name = 'large_network')
-
-testobj <- createSpatialNetwork(gobject = testobj,
- method = 'kNN',
- k = 100,
- maximum_distance_knn = 200,
- minimum_k = 2,
- name = 'distance_network')
-
-# Now, visualize the different spatial networks in one layer of the dataset
-# Here layer 260 is selected, and only high expressing cells are included
-cell_metadata = getCellMetadata(testobj)[]
-highexp_ids = cell_metadata[layer_ID==260][total_expr>=100]$cell_ID
-subtestobj = subsetGiotto(testobj, cell_ids = highexp_ids)
-```
-
-```{r, eval=FALSE}
-# Re-annotate the subset Giotto Object
-subtestobj = annotateGiotto(gobject = subtestobj,
- annotation_vector = manual_cluster,
- cluster_column = 'leiden_0.25.200',
- name = 'cell_types')
-```
-
-```{r, eval=FALSE}
-spatPlot(gobject = subtestobj, show_network = T,
- network_color = 'blue', spatial_network_name = 'Delaunay_network',
- point_size = 1.5, cell_color = 'cell_types',
- save_param = list(save_name = 'Delaunay_network_spatPlot'))
-```
-
-
-![](images/visualizations/unnamed-chunk-21-3.png)
-
-
-
-
-```{r, eval=FALSE}
-spatPlot(gobject = subtestobj, show_network = T,
- network_color = 'blue', spatial_network_name = 'spatial_network',
- point_size = 2.5, cell_color = 'cell_types',
- save_param = list(save_name = 'spatial_network_spatPlot'))
-```
-
-
-![](images/visualizations/unnamed-chunk-22-1.png)
-
-
-
-
-```{r, eval=FALSE}
-spatPlot(gobject = subtestobj, show_network = T,
- network_color = 'blue', spatial_network_name = 'large_network',
- point_size = 2.5, cell_color = 'cell_types',
- save_param = list(save_name = 'large_network_spatPlot'))
-```
-
-
-![](images/visualizations/unnamed-chunk-23-1.png)
-
-
-
-
-```{r, eval=FALSE}
-spatPlot(gobject = subtestobj, show_network = T,
- network_color = 'blue', spatial_network_name = 'distance_network',
- point_size = 2.5, cell_color = 'cell_types',
- save_param = list(save_name = 'distance_network_spatPlot'))
-```
-
-
-![](images/visualizations/unnamed-chunk-24-1.png)
-
-
-
-# 10. Session Info
-
-
-```{r, eval=FALSE}
-sessionInfo()
-```
-
-```{r, eval=FALSE}
- R version 4.2.2 (2022-10-31 ucrt)
- Platform: x86_64-w64-mingw32/x64 (64-bit)
- Running under: Windows 10 x64 (build 22621)
-
- Matrix products: default
-
- locale:
- [1] LC_COLLATE=English_United States.utf8
- [2] LC_CTYPE=English_United States.utf8
- [3] LC_MONETARY=English_United States.utf8
- [4] LC_NUMERIC=C
- [5] LC_TIME=English_United States.utf8
-
- attached base packages:
- [1] stats graphics grDevices utils datasets methods base
-
- other attached packages:
- [1] GiottoData_0.2.1 Giotto_3.2.1
-
- loaded via a namespace (and not attached):
- [1] matrixStats_0.63.0 RcppAnnoy_0.0.20 doParallel_1.0.17
- [4] RColorBrewer_1.1-3 httr_1.4.5 rprojroot_2.0.3
- [7] tools_4.2.2 utf8_1.2.3 R6_2.5.1
- [10] irlba_2.3.5.1 uwot_0.1.14 lazyeval_0.2.2
- [13] BiocGenerics_0.44.0 colorspace_2.1-0 GetoptLong_1.0.5
- [16] withr_2.5.0 tidyselect_1.2.0 compiler_4.2.2
- [19] progressr_0.13.0 textshaping_0.3.6 cli_3.4.1
- [22] ggdendro_0.1.23 DelayedArray_0.24.0 plotly_4.10.1
- [25] labeling_0.4.2 scales_1.2.1 rappdirs_0.3.3
- [28] systemfonts_1.0.4 digest_0.6.30 dbscan_1.1-11
- [31] rmarkdown_2.21 R.utils_2.12.2 pkgconfig_2.0.3
- [34] htmltools_0.5.4 MatrixGenerics_1.10.0 fastmap_1.1.0
- [37] htmlwidgets_1.6.2 rlang_1.1.0 GlobalOptions_0.1.2
- [40] rstudioapi_0.14 shape_1.4.6 farver_2.1.1
- [43] generics_0.1.3 jsonlite_1.8.3 crosstalk_1.2.0
- [46] BiocParallel_1.32.6 dplyr_1.1.1 R.oo_1.25.0
- [49] magrittr_2.0.3 BiocSingular_1.14.0 Matrix_1.5-1
- [52] Rcpp_1.0.10 munsell_0.5.0 S4Vectors_0.36.2
- [55] fansi_1.0.4 abind_1.4-5 reticulate_1.26
- [58] lifecycle_1.0.3 R.methodsS3_1.8.2 terra_1.7-18
- [61] yaml_2.3.7 MASS_7.3-58.1 grid_4.2.2
- [64] parallel_4.2.2 crayon_1.5.2 lattice_0.20-45
- [67] cowplot_1.1.1 beachmat_2.14.0 circlize_0.4.15
- [70] magick_2.7.4 knitr_1.42 ComplexHeatmap_2.14.0
- [73] pillar_1.9.0 igraph_1.4.1 rjson_0.2.21
- [76] codetools_0.2-18 ScaledMatrix_1.6.0 stats4_4.2.2
- [79] magic_1.6-1 glue_1.6.2 evaluate_0.20
- [82] data.table_1.14.6 png_0.1-7 vctrs_0.6.1
- [85] foreach_1.5.2 gtable_0.3.3 purrr_1.0.1
- [88] tidyr_1.3.0 clue_0.3-63 ggplot2_3.4.1
- [91] xfun_0.38 rsvd_1.0.5 ragg_1.2.4
- [94] viridisLite_0.4.1 geometry_0.4.7 tibble_3.2.1
- [97] iterators_1.0.14 IRanges_2.32.0 cluster_2.1.4
- [100] ellipsis_0.3.2 here_1.0.1
-
-```
diff --git a/vignettes/vizgen_mouse_brain.Rmd b/vignettes/vizgen_mouse_brain.Rmd
deleted file mode 100644
index 94647f294..000000000
--- a/vignettes/vizgen_mouse_brain.Rmd
+++ /dev/null
@@ -1,668 +0,0 @@
----
-title: "Vizgen Mouse Brain Receptor Map"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Vizgen Mouse Brain Receptor Map}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-*Giotto* version `2.0.0.998`. Please check the version you are using to get the same results.
-
-# 1. Dataset explanation
-
-This vignette covers Giotto object creation and simple exploratory analysis with the subcellular [MERFISH Mouse Brain Receptor Map dataset](https://vizgen.com/applications/neuroscience-showcase/) provided by Vizgen with their MERSCOPE platform.
-
-Transcripts are captured at the single-molecule level with subcellular spatial resolution (≤100nm). This dataset includes information from 9 full coronal mouse brain slices (3 positions with 3 biological replicates) that were profiled for 483 genes. This vignette works with slice 1, replicate 1.
-
-**Provided Outputs:**
-
-- List of all **detected transcripts** and their spatial locations in three dimensions (CSV)
-
-Show first 4 rows
-
-```{r, echo=FALSE}
-kableExtra::kable(data.frame(V1 = c(0,1,2,3),
- barcode_id = c(2,2,11,13),
- global_x = c(159.9778,165.9403,158.4767,171.2179),
- global_y = c(4208.468,4321.805,4320.901,4283.950),
- global_z = c(4,4,5,0),
- x = c(1762.116,1817.324,1748.217,1866.191),
- y = c(159.9814,1209.3922,1201.0283,858.8855),
- fov = c(0,0,0,0),
- gene = c('Htr1b','Htr1b','Htr6','Adora1')))
-```
-
-- Output from the cell segmentation analysis:
-
-- **transcripts** (cols) per **cell** (rows) aggregated count matrix (CSV)
-
-Show first 4 rows and columns
-
-```{r, echo=FALSE}
-kableExtra::kable(data.frame(V1 = c(110883424764611924400221639916314253469,135188247894899244046039873973964001182,164766962839370328502017156371562646881,165747897693809971960756442245389760838),
- Oxgr1 = c(0,0,0,0),
- Htr1a = c(0,0,0,0),
- Htr1b = c(0,0,0,1)))
-```
-
-- **cell metadata** (CSV)
-
-Show first 4 rows
-
-```{r, echo=FALSE}
-kableExtra::kable(data.frame(V1 = c(110883424764611924400221639916314253469,135188247894899244046039873973964001182,164766962839370328502017156371562646881,165747897693809971960756442245389760838),
- fov = c(0,0,0,0),
- volume = c(432.1414,1351.8026,1080.6533,1652.0007),
- center_x = c(156.5633,156.5093,159.9653,167.5793),
- center_y = c(4271.326,4256.962,4228.180,4323.868),
- min_x = c(151.5305,148.2905,152.1785,158.2265),
- max_x = c(161.5961,164.7281,167.7521,176.9321),
- min_y = c(4264.620,4247.664,4220.556,4314.192),
- max_y = c(4278.033,4266.261,4235.805,4333.545)))
-```
-
-- **cell boundaries** (HDF5)
-
-- The **DAPI** and **Poly T mosaic images** (TIFF)
-
-`Vizgen Data Release V1.0. May 2021`
-
-# 2. Set up Giotto
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure GiottoData, a small, helper module for tutorials, is installed.
-if(!"GiottoData" %in% installed.packages()) {
- pak::pkg_install(("drieslab/GiottoData")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-```{r, eval=FALSE}
-library(Giotto)
-library(GiottoData)
-
-# 1. set working directory where project outputs will be saved to
-results_folder = '/path/to/save/directory/'
-
-# Optional: Specify a path to a Python executable within a conda or miniconda
-# environment. If set to NULL (default), the Python executable within the previously
-# installed Giotto environment will be used.
-my_python_path = NULL # alternatively, "/local/python/path/python" if desired.
-```
-
-
-# 3. Giotto global instructions and preparations
-
-Define plot saving behavior and project data paths
-
-```{r, eval=FALSE}
-# Directly saving plots to the working directory without rendering them in the editor saves time.
-instrs = createGiottoInstructions(save_dir = results_folder,
- save_plot = TRUE,
- show_plot = FALSE,
- return_plot = FALSE,
- python_path = my_python_path)
-
-# Add Needed paths below:
-# provide path to pre-aggregated information
-expr_path = '/path/to/datasets_mouse_brain_map_BrainReceptorShowcase_Slice1_Replicate1_cell_by_gene_S1R1.csv'
-# provide path to metadata (includes spatial locations of aggregated expression)
-meta_path = '/path/to/datasets_mouse_brain_map_BrainReceptorShowcase_Slice1_Replicate1_cell_metadata_S1R1.csv'
-# provide path to the detected transcripts (single molecule level transcript spatial information)
-tx_path = '/path/to/datasets_mouse_brain_map_BrainReceptorShowcase_Slice1_Replicate1_detected_transcripts_S1R1.csv'
-# define path to cell boundaries folder
-bound_path = '/path/to/cell_boundaries'
-# path to image scale conversion values
-img_scale_path = 'path/to/micron_to_mosaic_pixel_transform.csv'
-# provide path to the dapi image of slice 1 replicate 1
-img_path = 'path/to/mosaic_DAPI_z0.tif'
-```
-
-
-# 4. Create Giotto object from aggregated data
-
-Vizgen provides a cell by transcript output matrix (`cell_by_gene.csv`) with the subcellular spatial transcript information already aggregated by the provided polygon cell annotations into a count matrix.
-
-Along with the count matrix, metadata information about the field of view (FOV), spatial location, and volume of the cell (annotation polygons) is also provided through the `cell_metadata.csv`.
-
-**Pre-aggregated** information can be loaded into Giotto with the usual generic `createGiottoObject()` function. For starting from the raw subcellular information, skip to Section 10. To create the Giotto object, the `cell_by_gene` expression matrix and the `cell_metadata` information are first read into R. Since Giotto accepts the expression information with features (in this case genes/transcript counts) as rows and cells as columns, the expression matrix must first be transposed to create the object.
-
-Additionally for this dataset, y values should be inverted when loaded to match the included images. For more information consult ths standard workflow at getting_started_images section.
-
-
-```{r, eval=FALSE}
-# read expression matrix and metadata
-expr_matrix = readExprMatrix(expr_path)
-meta_dt = data.table::fread(meta_path)
-
-# create giotto object
-vizgen <- createGiottoObject(expression = Giottot_flex(expr_matrix),
- spatial_locs = meta_dt[,.(center_x, -center_y, V1)],
- instructions = instrs)
-# add metadata of fov and volume
-vizgen <- addCellMetadata(vizgen,
- new_metadata = meta_dt[,.(fov, volume)])
-```
-
-## 4.1 Visualize cells in space.
-
-```{r, eval=FALSE}
-spatPlot2D(vizgen,
- point_size = 0.5)
-```
-
-![](images/vizgen_mouse_brain/0-overview_spatplot.png)
-
-## 4.2 Visualize cells by FOV.
-
-```{r, eval=FALSE}
-# FOVs as a factor
-spatPlot2D(vizgen, point_size = 0.5,
- cell_color = 'fov',
- show_legend = F)
-
-# FOVs sequentially
-spatPlot2D(vizgen, point_size = 0.5,
- cell_color = 'fov',
- color_as_factor = F,
- cell_color_gradient = c('white', 'pink', 'red'),
- show_legend = F)
-```
-
-![](images/vizgen_mouse_brain/1-FOVs.png)
-![](images/vizgen_mouse_brain/1b-FOVs.png)
-
-# 5. Attaching images
-
-Images for confocal planes z0 to z6 are provided for both **DAPI** (cell nucleus staining) and **polyT** for all datasets. A `micron_to_mosaic_pixel_transform.csv` is included within the `images` folder that provides scaling factors to map the image to the spatial coordinates. For this dataset:
-
-micron_to_mosaic_pixel_transform.csv
-
-```{r, echo=FALSE}
-kableExtra::kable(data.frame(V1 = c(9.205861,0,0),
- V2 = c(0,9.20585,0),
- V3 = c(279.2204,349.8105,1)))
-```
-
-
-Here we will attach the z0 dapi image to the Giotto object. **Note:** It is recommended for the image files to be local. Placing the images on the cloud or network may be very slow.
-
-
-```{r, eval=FALSE}
-# Load in image as a giottoLargeImage object that maps spatial coordinates 1:1 with pixel coordinates
-dapi0 = createGiottoLargeImage(raster_object = img_path,
- name = 'image')
-
-# Preview image
-plot(dapi0)
-```
-
-
-![](images/vizgen_mouse_brain/2-dapi0_preview.png)
-
-Attaching the `giottoLargeImage` to our Giotto object (provided as a list of 1) and then updating it to map the image to the spatial coordinates which are in microns.
-
-
-```{r, eval=FALSE}
-# Adds the giottoLargeImage object to giotto object while also shifting values into the negatives
-vizgen = addGiottoImage(gobject = vizgen,
- largeImages = list(dapi0),
- negative_y = TRUE)
-
-# Read in image scale transform values
-img_scale_DT = data.table::fread(img_scale_path)
-x_scale = img_scale_DT$V1[[1]]
-y_scale = img_scale_DT$V2[[2]]
-x_shift = img_scale_DT$V3[[1]]
-y_shift = -img_scale_DT$V3[[2]]
-
-# Update image to reverse the above transformations to convert mosaic pixel to micron
-# 'first_adj' means that the xy shifts are applied before the subsequent scaling
-vizgen = updateGiottoLargeImage(gobject = vizgen,
- largeImage_name = 'image',
- x_shift = -x_shift,
- y_shift = -y_shift,
- scale_x = 1/x_scale,
- scale_y = 1/y_scale,
- order = 'first_adj')
-```
-
-## 5.1 Check image alignment
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = vizgen,
- largeImage_name = 'image',
- point_size = 0.5,
- show_image = TRUE)
-```
-
-![](images/vizgen_mouse_brain/3-img_overlay.png)
-
-## 5.2 Zooming in by subsetting the dataset
-
-```{r, eval=FALSE}
-zoom = subsetGiottoLocs(gobject = vizgen,
- x_min = 2000,
- x_max = 2500,
- y_min = -2500,
- y_max = -2000)
-
-spatPlot2D(gobject = zoom,
- largeImage_name = 'image',
- point_size = 1,
- show_image = TRUE)
-```
-
-![](images/vizgen_mouse_brain/4-img_overlay_zoom.png)
-
-# 6. Data processing
-
-```{r, eval=FALSE}
-vizgen <- filterGiotto(gobject = vizgen,
- expression_threshold = 1,
- feat_det_in_min_cells = 100,
- min_det_feats_per_cell = 20)
-
-vizgen <- normalizeGiotto(gobject = vizgen,
- scalefactor = 1000,
- verbose = TRUE)
-
-# add gene and cell statistics
-vizgen <- addStatistics(gobject = vizgen)
-```
-
-## 6.1 Visualize the number of features per cell.
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = vizgen,
- show_image = F,
- point_alpha = 0.7,
- cell_color = 'nr_feats',
- color_as_factor = F,
- point_border_col = 'grey',
- point_border_stroke = 0.01,
- point_size = 0.5)
-```
-
-![](images/vizgen_mouse_brain/5-nr_feats.png)
-
-# 7. Dimension reduction
-
-Skipping highly variable feature (HVF) detection. PCA will be calculated based on all available genes.
-
-```{r, eval=FALSE}
-vizgen <- runPCA(gobject = vizgen,
- center = TRUE,
- scale_unit = TRUE)
-# visualize variance explained per component
-screePlot(vizgen,
- ncp = 30)
-```
-
-![](images/vizgen_mouse_brain/6-screePlot.png)
-
-```{r, eval=FALSE}
-plotPCA(gobject = vizgen,
- point_size = 0.5)
-```
-
-![](images/vizgen_mouse_brain/7-PCA.png)
-
-```{r, eval=FALSE}
-vizgen = runUMAP(vizgen,
- dimensions_to_use = 1:10)
-
-plotUMAP(gobject = vizgen,
- point_size = 0.5)
-```
-
-![](images/vizgen_mouse_brain/8-UMAP.png)
-
-# 8. Leiden Clustering
-
-Calculate nearest neighbor network and perform Leiden clustering.
-
-```{r, eval=FALSE}
-vizgen <- createNearestNetwork(vizgen,
- dimensions_to_use = 1:10,
- k = 15)
-
-# Default name for the results is 'leiden_clus' which is then appended to the cell metadata
-vizgen <- doLeidenCluster(vizgen,
- resolution = 0.2,
- n_iterations = 100)
-```
-
-Cell Metadata Preview
-
-```{r, eval=FALSE}
-print(pDataDT(vizgen))
-```
-
-```{r, eval=FALSE}
-cell_ID fov volume leiden_clus
-1: 110883424764611924400221639916314253469 0 432.1414 9
-2: 135188247894899244046039873973964001182 0 1351.8026 9
-3: 164766962839370328502017156371562646881 0 1080.6533 9
-4: 165747897693809971960756442245389760838 0 1652.0007 9
-5: 260943245639750847364278545493286724628 0 1343.3786 9
----
- 78258: 165273009496786595275688065919008183969 1225 1159.6232 9
-78259: 250474226357477911702383283537224741401 1225 1058.0623 9
-78260: 66106840181174834341279408890707577820 1225 1155.3068 9
-78261: 66165211106933093510165165316573672348 1225 394.8081 9
-78262: 71051447268015582817266088343399517927 1225 798.6088 9
-```
-
-Visualize the Leiden clustering results ('leiden_clus') mapped onto the UMAP dimension reduction.
-
-```{r, eval=FALSE}
-plotUMAP(vizgen,
- cell_color = 'leiden_clus',
- point_size = 0.5)
-```
-
-![](images/vizgen_mouse_brain/9-UMAP.png)
-
-Visualize the leiden clustering mapped onto the spatial data.
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = vizgen,
- cell_color = 'leiden_clus',
- point_size = 0.5,
- background_color = 'black')
-```
-
-![](images/vizgen_mouse_brain/10-spatPlot2D.png)
-
-# 9. Spatial expression patterns
-
-Spatially interesting gene expression can be detected by first generating a spatial network then performing Binary Spatial Extraction of genes.
-
-```{r, eval=FALSE}
-# create spatial network based on physical distance of cell centroids
-vizgen = createSpatialNetwork(gobject = vizgen,
- minimum_k = 2,
- maximum_distance_delaunay = 50)
-
-# perform Binary Spatial Extraction of genes
-km_spatialgenes = binSpect(vizgen)
-```
-
-Preview km_spatialgenes
-
-```{r, eval=FALSE}
-print(km_spatialgenes$feats[1:30])
-```
-
-```{r, eval=FALSE}
-[1] "Slc47a1" "Chat" "Th" "Insrr" "Slc17a7" "Pln"
-[7] "Lmod1" "Blank-119" "Hcar1" "Glp1r" "Ptgdr" "Avpr2"
-[13] "Gpr20" "Myh11" "Glp2r" "Npy2r" "Gpr182" "Chrm1"
-[19] "Adgrd1" "Mrgprf" "Trhr" "Gfap" "Slc17a8" "Nmbr"
-[25] "Pth2r" "Rxfp1" "Musk" "F2rl1" "Dgkk" "Chrm5"
-```
-
-
-```{r, eval=FALSE}
-# visualize spatial expression of select genes obtained from binSpect
-spatFeatPlot2D(vizgen,
- expression_values = 'scaled',
- feats = km_spatialgenes$feats[c(1,2,3,5,16,22)],
- cell_color_gradient = c('blue', 'white', 'red'),
- point_shape = 'border',
- point_border_col = 'grey',
- point_border_stroke = 0.01,
- point_size = 0.2,
- cow_n_col = 2)
-```
-
-
-![](images/vizgen_mouse_brain/11-spatFeatPlot2D.png)
-
-# 10. Working with subcellular information {#sec-subcellular}
-
-*These steps may require a strong computer.*
-
-Vizgen provides the raw information used to generate the aggregated data through the detected_transcripts.csv and cell_boundaries hdf5 files. Giotto can also work directly with this information.
-
-## 10.1 (Optional) Define region of interest and find FOVs needed
-
-Loading information by only grabbing the needed FOVs can cut down on computational requirements.
-
-
-```{r, eval=FALSE}
-subsetFOVs = meta_dt[center_x > 2000 & center_x < 3100 &
- center_y > 2500 & center_y < 3500]$fov
-subsetFOVs = unique(subsetFOVs)
-```
-
-FOVs needed
-
-```{r, eval=FALSE}
-print(subsetFOVs)
-```
-
-```{r, eval=FALSE}
-[1] 220 221 222 223 224 225 245 246 247 248 249 250 275 276 277 278 279 280 302
-[20] 303 304 305 306 307 330 331 332 333 334 335 358 359 360 361 362 363
-```
-
-**Note:** The following steps will be assuming that this step was run.
-
-## 10.2 Creating a giottoPolygon object
-
-Cell boundary annotations are represented in Giotto as `giottoPolygon` objects which can be previewed by directly plotting them.
-
-```{r, eval=FALSE}
-# read polygons and add them to Giotto
-# fovs param is optional
-# polygon_feat_types determines which Vizgen polygon z slices are loaded (There are 0 - 6)
-polys = readPolygonFilesVizgenHDF5(boundaries_path = bound_path,
- polygon_feat_types = c(0,6),
- flip_y_axis = TRUE,
- fovs = subsetFOVs)
-
-# polys is produced as a list of 2 giottoPolygon objects (z0 and z6)
-# previewing the first one...
-plot(polys[[1]])
-```
-
-![](images/vizgen_mouse_brain/13-poly.png)
-
-## 10.3 Creating a giottoPoints object
-
-Giotto represents single-molecule transcript level spatial data as `giottoPoints` objects.
-
-```{r, eval=FALSE}
-tx_dt = data.table::fread(tx_path)
-# select transcripts in FOVs
-tx_dt_selected = tx_dt[fov %in% subsetFOVs]
-tx_dt_selected$global_y = -tx_dt_selected$global_y
-# (note the inverted y is the same as when spatial locations were loaded)
-
-# create Giotto points from transcripts
-gpoints = createGiottoPoints(x = tx_dt_selected[,.(global_x, global_y, gene, global_z)])
-
-# preview the giottoPoints object (Including specific feats to plot is highly recommended)
-# Not providing the feats param will plot ALL features detected
-plot(gpoints,
- feats = c('Gfap', 'Ackr1'),
- point_size = 0.1)
-```
-
-![](images/vizgen_mouse_brain/14-point.png)
-
-## 10.4 Creating a subcellular Giotto object
-
-```{r, eval=FALSE}
-# Create new giotto instructions to set different save directory if desired
-# instrs_sub = createGiottoInstructions(show_plot = FALSE,
-# return_plot = FALSE,
-# save_plot = TRUE,
-# save_dir = "path/to/subcellular/save/folder")
-
-vizgen_subcellular = createGiottoObjectSubcellular(gpoints = list(rna = gpoints),
- gpolygons = polys,
- # instructions = instrs_sub
-)
-
-# Find polygon centroids and generate associated spatial locations
-vizgen_subcellular = addSpatialCentroidLocations(vizgen_subcellular,
- poly_info = c('z0', 'z6'))
-
-
-# Append images **(Details about these functions can be found in step 5)**
-# Run following two commented lines if skipping to this step
-# dapi0 = createGiottoLargeImage(raster_object = img_path, name = 'image')
-# img_scale_DT = data.table::fread(img_scale_path)
-vizgen_subcellular = addGiottoImage(gobject = vizgen_subcellular,
- largeImages = list(dapi0), negative_y = TRUE)
-x_scale = img_scale_DT$V1[[1]] ; y_scale = img_scale_DT$V2[[2]]
-x_shift = img_scale_DT$V3[[1]] ; y_shift = -img_scale_DT$V3[[2]]
-vizgen_subcellular = updateGiottoLargeImage(gobject = vizgen_subcellular,
- largeImage_name = 'image', x_shift = -x_shift, y_shift = -y_shift,
- scale_x = 1/x_scale, scale_y = 1/y_scale, order = 'first_adj')
-```
-
-Alternatively to append subcellular data to existing giotto object.
-
-The subcellular information can also be attached to giotto objects built with the pre-aggregated information.
-
-```{r, eval=FALSE}
-# Subset dataset to work with smaller area
-vizgen_subset = subsetGiottoLocs(vizgen,
- x_min = 2000, x_max = 3000,
- y_min = -3500, y_max = -2500)
-
-# add points to Giotto object
-vizgen_subset = addGiottoPoints(gobject = vizgen_subset,
- gpoints = list(rna = gpoints))
-# There will be a warning that 14 features are not present in vizgen_subset
-# (They were previously removed during data processing in step 6)
-
-# add polygons to Giotto object
-vizgen_subset = addGiottoPolygons(gobject = vizgen_subset,
- gpolygons = polys)
-# If the polygons had not already been read readPolygonFilesVizgen() should be used instead
-# vizgen_subset = readPolygonFilesVizgen(gobject = vizgen_subset,
-# boundaries_path = bound_path,
-# polygon_feat_types = c(0,6)) # Defines which z slices (polys) are read in
-
-# Calculate centroid locations
-vizgen_subset = addSpatialCentroidLocations(vizgen_subset,
- poly_info = c('z0', 'z6'))
-```
-
-**Visualize subset**
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = vizgen_subset,
- show_image = TRUE,
- largeImage_name = 'image',
- cell_color = 'leiden_clus',
- point_size = 2.5)
-```
-
-![](images/vizgen_mouse_brain/12-spatPlot2D.png)
-
-```{r, eval=FALSE}
-# identify genes for visualization
-gene_meta = fDataDT(vizgen_subset)
-data.table::setorder(gene_meta, perc_cells)
-gene_meta[perc_cells > 25 & perc_cells < 50]
-
-# visualize points with z0 polygons (confocal plane)
-spatInSituPlotPoints(vizgen_subset,
- feats = list('rna' = c("Oxgr1", "Htr1a", "Gjc3", "Axl",
- 'Gfap', "Olig1", "Epha7")),
- polygon_feat_type = 'z0',
- use_overlap = FALSE,
- point_size = 0.1,
- polygon_line_size = 1,
- show_polygon = TRUE,
- polygon_bg_color = 'white',
- polygon_color = 'white')
-```
-
-![](images/vizgen_mouse_brain/12b-spatInSituPlotPoints.png)
-
-```{r, eval=FALSE}
-# visualize select genes with z0 polygons (confocal plane)
-spatInSituPlotPoints(vizgen_subcellular,
- feats = list('rna' = c("Oxgr1", "Htr1a", "Gjc3", "Axl",
- 'Gfap', "Olig1", "Epha7")),
- polygon_feat_type = 'z0',
- use_overlap = FALSE,
- point_size = 0.1,
- polygon_line_size = 0.1,
- show_polygon = TRUE,
- polygon_bg_color = 'white',
- polygon_color = 'white',
- coord_fix_ratio = TRUE,
- save_param = list(base_height = 10,
- base_width = 10))
-```
-
-![](images/vizgen_mouse_brain/15-spatInSituPlotPoints.png)
-
-```{r, eval=FALSE}
-# Zoom in further and visualize with image
-vizgen_subcellular_zoom = subsetGiottoLocs(vizgen_subcellular,
- poly_info = c('z0','z6'),
- x_min = 2400, x_max = 2600,
- y_min = -3200, y_max = -3000)
-
-spatInSituPlotPoints(vizgen_subcellular_zoom,
- feats = list('rna' = c("Oxgr1", "Htr1a", "Gjc3", "Axl",
- 'Gfap', "Olig1", "Epha7")),
- polygon_feat_type = 'z0',
- use_overlap = FALSE,
- point_size = 0.5,
- polygon_line_size = 0.2,
- show_polygon = TRUE,
- polygon_bg_color = 'white',
- polygon_color = 'white',
- polygon_alpha = 0.1,
- show_image = TRUE,
- largeImage_name = 'image',
- coord_fix_ratio = TRUE,
- save_param = list(base_height = 10,
- base_width = 10))
-```
-
-![](images/vizgen_mouse_brain/16-spatInSituPlotPoints.png)
-
-```{r, eval=FALSE}
-spatInSituPlotPoints(vizgen_subcellular_zoom,
- feats = list('rna' = c("Oxgr1", "Htr1a", "Gjc3", "Axl",
- 'Gfap', "Olig1", "Epha7")),
- polygon_feat_type = 'z6', # Use polygon from z slice 6 this time
- use_overlap = FALSE,
- point_size = 0.5,
- polygon_line_size = 0.2,
- show_polygon = TRUE,
- polygon_bg_color = 'white',
- polygon_color = 'white',
- polygon_alpha = 0.1,
- show_image = TRUE,
- largeImage_name = 'image',
- coord_fix_ratio = TRUE,
- save_param = list(base_height = 10,
- base_width = 10))
-```
-
-![](images/vizgen_mouse_brain/17-spatInSituPlotPoints.png)
-
diff --git a/vignettes/xenium_breast_cancer.rmd b/vignettes/xenium_breast_cancer.rmd
deleted file mode 100644
index 80979b5bd..000000000
--- a/vignettes/xenium_breast_cancer.rmd
+++ /dev/null
@@ -1,1373 +0,0 @@
----
-title: "Xenium Human Breast Cancer Pre-Release"
-output: rmarkdown::html_vignette
-vignette: >
- %\VignetteIndexEntry{Xenium Human Breast Cancer Pre-Release}
- %\VignetteEngine{knitr::rmarkdown}
- %\VignetteEncoding{UTF-8}
----
-
-# 1. Set up Giotto environment
-
-```{r, eval=FALSE}
-# Ensure Giotto Suite is installed.
-if(!"Giotto" %in% installed.packages()) {
- pak::pkg_install("drieslab/Giotto")
-}
-
-# Ensure the Python environment for Giotto has been installed.
-genv_exists = Giotto::checkGiottoEnvironment()
-if(!genv_exists){
- # The following command need only be run once to install the Giotto environment.
- Giotto::installGiottoEnvironment()
-}
-```
-
-```{r, eval=FALSE}
-library(Giotto)
-
-# 1. ** SET WORKING DIRECTORY WHERE PROJECT OUPUTS WILL SAVE TO **
-results_folder = '/path/to/save/directory/'
-
-# 2. set giotto python path
-# set python path to your preferred python version path
-# set python path to NULL if you want to automatically install (only the 1st time) and use the giotto miniconda environment
-python_path = NULL
-if(is.null(python_path)) {
- installGiottoEnvironment()
-}
-
-# 3. Create Giotto instructions
-# Directly saving plots to the working directory without rendering them in the editor saves time.
-instrs = createGiottoInstructions(save_dir = results_folder,
- save_plot = TRUE,
- show_plot = FALSE,
- return_plot = FALSE)
-```
-
-
-# 2. Dataset explanation
-
-This vignette covers Giotto object creation and simple exploratory analysis with 10x Genomics' subcellular *Xenium In Situ* platform data using their [Human Breast Cancer Dataset](https://www.10xgenomics.com/products/xenium-in-situ/preview-dataset-human-breast) provided with their recent [bioRxiv
-pre-print](https://www.biorxiv.org/content/10.1101/2022.10.06.510405v1).
-
-The data from the first tissue replicate will be worked with:
-
-![](images/xenium_breast_cancer/large_preview.png)
-
-# 3. Project data paths
-
-Xenium's exact output folder structure and which file/formats will be available in the final release are still subject to change. This tutorial will be updated for any differences at release.
-
-**Note:** The cell_feature_matrix.tar.gz must be unpacked into a subdirectory within the xenium working directory before starting.
-
-
-```{r, eval=FALSE}
-# ** SET PATH TO FOLDER CONTAINING XENIUM DATA **
-xenium_folder = '/path/to/xenium/data/outputs'
-
-# general files (some are supplemental files)
-settings_path = paste0(xenium_folder, 'experiment.xenium')
-he_img_path = paste0(xenium_folder, 'Xenium_FFPE_Human_Breast_Cancer_Rep1_he_image.tif')
-if_img_path = paste0(xenium_folder, 'Xenium_FFPE_Human_Breast_Cancer_Rep1_if_image.tif')
-panel_meta_path = paste0(xenium_folder, 'Xenium_FFPE_Human_Breast_Cancer_Rep1_panel.tsv') # (optional)
-
-# files (SUBCELLULAR): (tutorial focuses on working with these files)
-cell_bound_path = paste0(xenium_folder, 'cell_boundaries.csv.gz')
-nuc_bound_path = paste0(xenium_folder, 'nucleus_boundaries.csv.gz')
-tx_path = paste0(xenium_folder, 'transcripts.csv.gz')
-feat_meta_path = paste0(xenium_folder, 'cell_feature_matrix/features.tsv.gz') # (also used in aggregate)
-
-# files (AGGREGATE):
-expr_mat_path = paste0(xenium_folder, 'cell_feature_matrix')
-cell_meta_path = paste0(xenium_folder, 'cells.csv.gz') # contains spatlocs
-```
-
-
-# 4. Xenium feature types exploration
-
-`features.tsv.gz` within `cell_feature_matrix.tar.gz` provides information on the different feature types available within Xenium's two types of expression outputs:
-
-1. aggregated cell by feature matrix
-2. transcript detections in `transcripts.csv.gz`
-
-There are four types of probes used, each of which is represented in both exports:
-
-- `gene expression`: Gene expression detection
-- `blank codeword`: Unused codeword - there are no probes that will generate the codeword
-- `negative control codeword`: Valid codewords that do not have any probes that should yield that code, so they can be used to assess the specificity of the decoding algorithm
-- `negative control probe`: Probes that exist in the panel, but target ERCC or other non-biological sequences, which can be used to assess the specificity of the assay
-
-
-```{r, eval=FALSE}
-# load features metadata
-# (make sure cell_feature_matrix folder is unpacked)
-feature_dt = data.table::fread(feat_meta_path, header = FALSE)
-colnames(feature_dt) = c('ensembl_ID','feat_name','feat_type')
-
-# find the feature IDs that belong to each feature type
-feature_dt[, table(feat_type)]
-feat_types = names(feature_dt[, table(feat_type)])
-
-feat_types_IDs = lapply(
- feat_types, function(type) feature_dt[feat_type == type, unique(feat_name)]
-)
-names(feat_types_IDs) = feat_types
-```
-
-
-
-```{r, eval=FALSE}
-# feat_type
-# Blank Codeword Gene Expression
-# 159 313
-# Negative Control Codeword Negative Control Probe
-# 41 28
-```
-
-
-This dataset has 313 probes that are dedicated for gene expression transcript detection.
-
-
-
-```{r, eval=FALSE}
-# [1] "ABCC11" "ACTA2" "ACTG2" "ADAM9" "ADGRE5" "ADH1B"
-# [7] "ADIPOQ" "AGR3" "AHSP" "AIF1" "AKR1C1" "AKR1C3"
-# [13] "ALDH1A3" "ANGPT2" "ANKRD28" "ANKRD29" "ANKRD30A" "APOBEC3A"
-# [19] "APOBEC3B" "APOC1" "AQP1" "AQP3" "AR" "AVPR1A"
-# [25] "BACE2" "BANK1" "BASP1" "BTNL9" "C15orf48" "C1QA"
-# [31] "C1QC" "C2orf42" "C5orf46" "C6orf132" "CAV1" "CAVIN2"
-# [37] "CCDC6" "CCDC80" "CCL20" "CCL5" "CCL8" "CCND1"
-# [43] "CCPG1" "CCR7" "CD14" "CD163" "CD19" "CD1C"
-# [49] "CD247" "CD27" "CD274" "CD3D" "CD3E" "CD3G"
-# [55] "CD4" "CD68" "CD69" "CD79A" "CD79B" "CD80"
-# [61] "CD83" "CD86" "CD8A" "CD8B" "CD9" "CD93"
-# [67] "CDC42EP1" "CDH1" "CEACAM6" "CEACAM8" "CENPF" "CLCA2"
-# [73] "CLDN4" "CLDN5" "CLEC14A" "CLEC9A" "CLECL1" "CLIC6"
-# [79] "CPA3" "CRHBP" "CRISPLD2" "CSF3" "CTH" "CTLA4"
-# [85] "CTSG" "CTTN" "CX3CR1" "CXCL12" "CXCL16" "CXCL5"
-# [91] "CXCR4" "CYP1A1" "CYTIP" "DAPK3" "DERL3" "DMKN"
-# [97] "DNAAF1" "DNTTIP1" "DPT" "DSC2" "DSP" "DST"
-# [103] "DUSP2" "DUSP5" "EDN1" "EDNRB" "EGFL7" "EGFR"
-# [109] "EIF4EBP1" "ELF3" "ELF5" "ENAH" "EPCAM" "ERBB2"
-# [115] "ERN1" "ESM1" "ESR1" "FAM107B" "FAM49A" "FASN"
-# [121] "FBLIM1" "FBLN1" "FCER1A" "FCER1G" "FCGR3A" "FGL2"
-# [127] "FLNB" "FOXA1" "FOXC2" "FOXP3" "FSTL3" "GATA3"
-# [133] "GJB2" "GLIPR1" "GNLY" "GPR183" "GZMA" "GZMB"
-# [139] "GZMK" "HAVCR2" "HDC" "HMGA1" "HOOK2" "HOXD8"
-# [145] "HOXD9" "HPX" "IGF1" "IGSF6" "IL2RA" "IL2RG"
-# [151] "IL3RA" "IL7R" "ITGAM" "ITGAX" "ITM2C" "JUP"
-# [157] "KARS" "KDR" "KIT" "KLF5" "KLRB1" "KLRC1"
-# [163] "KLRD1" "KLRF1" "KRT14" "KRT15" "KRT16" "KRT23"
-# [169] "KRT5" "KRT6B" "KRT7" "KRT8" "LAG3" "LARS"
-# [175] "LDHB" "LEP" "LGALSL" "LIF" "LILRA4" "LPL"
-# [181] "LPXN" "LRRC15" "LTB" "LUM" "LY86" "LYPD3"
-# [187] "LYZ" "MAP3K8" "MDM2" "MEDAG" "MKI67" "MLPH"
-# [193] "MMP1" "MMP12" "MMP2" "MMRN2" "MNDA" "MPO"
-# [199] "MRC1" "MS4A1" "MUC6" "MYBPC1" "MYH11" "MYLK"
-# [205] "MYO5B" "MZB1" "NARS" "NCAM1" "NDUFA4L2" "NKG7"
-# [211] "NOSTRIN" "NPM3" "OCIAD2" "OPRPN" "OXTR" "PCLAF"
-# [217] "PCOLCE" "PDCD1" "PDCD1LG2" "PDE4A" "PDGFRA" "PDGFRB"
-# [223] "PDK4" "PECAM1" "PELI1" "PGR" "PIGR" "PIM1"
-# [229] "PLD4" "POLR2J3" "POSTN" "PPARG" "PRDM1" "PRF1"
-# [235] "PTGDS" "PTN" "PTPRC" "PTRHD1" "QARS" "RAB30"
-# [241] "RAMP2" "RAPGEF3" "REXO4" "RHOH" "RORC" "RTKN2"
-# [247] "RUNX1" "S100A14" "S100A4" "S100A8" "SCD" "SCGB2A1"
-# [253] "SDC4" "SEC11C" "SEC24A" "SELL" "SERHL2" "SERPINA3"
-# [259] "SERPINB9" "SFRP1" "SFRP4" "SH3YL1" "SLAMF1" "SLAMF7"
-# [265] "SLC25A37" "SLC4A1" "SLC5A6" "SMAP2" "SMS" "SNAI1"
-# [271] "SOX17" "SOX18" "SPIB" "SQLE" "SRPK1" "SSTR2"
-# [277] "STC1" "SVIL" "TAC1" "TACSTD2" "TCEAL7" "TCF15"
-# [283] "TCF4" "TCF7" "TCIM" "TCL1A" "TENT5C" "TFAP2A"
-# [289] "THAP2" "TIFA" "TIGIT" "TIMP4" "TMEM147" "TNFRSF17"
-# [295] "TOMM7" "TOP2A" "TPD52" "TPSAB1" "TRAC" "TRAF4"
-# [301] "TRAPPC3" "TRIB1" "TUBA4A" "TUBB2B" "TYROBP" "UCP1"
-# [307] "USP53" "VOPP1" "VWF" "WARS" "ZEB1" "ZEB2"
-# [313] "ZNF562"
-```
-
-
-```{r, eval=FALSE}
-# [1] "BLANK_0006" "BLANK_0013" "BLANK_0037" "BLANK_0069" "BLANK_0072"
-# [6] "BLANK_0087" "BLANK_0110" "BLANK_0114" "BLANK_0120" "BLANK_0147"
-# [11] "BLANK_0180" "BLANK_0186" "BLANK_0272" "BLANK_0278" "BLANK_0319"
-# [16] "BLANK_0321" "BLANK_0337" "BLANK_0350" "BLANK_0351" "BLANK_0352"
-# [21] "BLANK_0353" "BLANK_0354" "BLANK_0355" "BLANK_0356" "BLANK_0357"
-# [26] "BLANK_0358" "BLANK_0359" "BLANK_0360" "BLANK_0361" "BLANK_0362"
-# [31] "BLANK_0363" "BLANK_0364" "BLANK_0365" "BLANK_0366" "BLANK_0367"
-# [36] "BLANK_0368" "BLANK_0369" "BLANK_0370" "BLANK_0371" "BLANK_0372"
-# [41] "BLANK_0373" "BLANK_0374" "BLANK_0375" "BLANK_0376" "BLANK_0377"
-# [46] "BLANK_0378" "BLANK_0379" "BLANK_0380" "BLANK_0381" "BLANK_0382"
-# [51] "BLANK_0383" "BLANK_0384" "BLANK_0385" "BLANK_0386" "BLANK_0387"
-# [56] "BLANK_0388" "BLANK_0389" "BLANK_0390" "BLANK_0391" "BLANK_0392"
-# [61] "BLANK_0393" "BLANK_0394" "BLANK_0395" "BLANK_0396" "BLANK_0397"
-# [66] "BLANK_0398" "BLANK_0399" "BLANK_0400" "BLANK_0401" "BLANK_0402"
-# [71] "BLANK_0403" "BLANK_0404" "BLANK_0405" "BLANK_0406" "BLANK_0407"
-# [76] "BLANK_0408" "BLANK_0409" "BLANK_0410" "BLANK_0411" "BLANK_0412"
-# [81] "BLANK_0413" "BLANK_0414" "BLANK_0415" "BLANK_0416" "BLANK_0417"
-# [86] "BLANK_0418" "BLANK_0419" "BLANK_0420" "BLANK_0421" "BLANK_0422"
-# [91] "BLANK_0423" "BLANK_0424" "BLANK_0425" "BLANK_0426" "BLANK_0427"
-# [96] "BLANK_0428" "BLANK_0429" "BLANK_0430" "BLANK_0431" "BLANK_0432"
-# [101] "BLANK_0433" "BLANK_0434" "BLANK_0435" "BLANK_0436" "BLANK_0437"
-# [106] "BLANK_0438" "BLANK_0439" "BLANK_0440" "BLANK_0441" "BLANK_0442"
-# [111] "BLANK_0443" "BLANK_0444" "BLANK_0445" "BLANK_0446" "BLANK_0447"
-# [116] "BLANK_0448" "BLANK_0449" "BLANK_0450" "BLANK_0451" "BLANK_0452"
-# [121] "BLANK_0453" "BLANK_0454" "BLANK_0455" "BLANK_0456" "BLANK_0457"
-# [126] "BLANK_0458" "BLANK_0459" "BLANK_0460" "BLANK_0461" "BLANK_0462"
-# [131] "BLANK_0463" "BLANK_0464" "BLANK_0465" "BLANK_0466" "BLANK_0467"
-# [136] "BLANK_0468" "BLANK_0469" "BLANK_0470" "BLANK_0471" "BLANK_0472"
-# [141] "BLANK_0473" "BLANK_0474" "BLANK_0475" "BLANK_0476" "BLANK_0477"
-# [146] "BLANK_0478" "BLANK_0479" "BLANK_0480" "BLANK_0481" "BLANK_0482"
-# [151] "BLANK_0483" "BLANK_0484" "BLANK_0485" "BLANK_0486" "BLANK_0487"
-# [156] "BLANK_0488" "BLANK_0489" "BLANK_0497" "BLANK_0499"
-```
-
-
-```{r, eval=FALSE}
-# [1] "NegControlCodeword_0500" "NegControlCodeword_0501"
-# [3] "NegControlCodeword_0502" "NegControlCodeword_0503"
-# [5] "NegControlCodeword_0504" "NegControlCodeword_0505"
-# [7] "NegControlCodeword_0506" "NegControlCodeword_0507"
-# [9] "NegControlCodeword_0508" "NegControlCodeword_0509"
-# [11] "NegControlCodeword_0510" "NegControlCodeword_0511"
-# [13] "NegControlCodeword_0512" "NegControlCodeword_0513"
-# [15] "NegControlCodeword_0514" "NegControlCodeword_0515"
-# [17] "NegControlCodeword_0516" "NegControlCodeword_0517"
-# [19] "NegControlCodeword_0518" "NegControlCodeword_0519"
-# [21] "NegControlCodeword_0520" "NegControlCodeword_0521"
-# [23] "NegControlCodeword_0522" "NegControlCodeword_0523"
-# [25] "NegControlCodeword_0524" "NegControlCodeword_0525"
-# [27] "NegControlCodeword_0526" "NegControlCodeword_0527"
-# [29] "NegControlCodeword_0528" "NegControlCodeword_0529"
-# [31] "NegControlCodeword_0530" "NegControlCodeword_0531"
-# [33] "NegControlCodeword_0532" "NegControlCodeword_0533"
-# [35] "NegControlCodeword_0534" "NegControlCodeword_0535"
-# [37] "NegControlCodeword_0536" "NegControlCodeword_0537"
-# [39] "NegControlCodeword_0538" "NegControlCodeword_0539"
-# [41] "NegControlCodeword_0540"
-```
-
-
-```{r, eval=FALSE}
-# [1] "NegControlProbe_00042" "NegControlProbe_00041" "NegControlProbe_00039"
-# [4] "NegControlProbe_00035" "NegControlProbe_00034" "NegControlProbe_00033"
-# [7] "NegControlProbe_00031" "NegControlProbe_00025" "NegControlProbe_00024"
-# [10] "NegControlProbe_00022" "NegControlProbe_00019" "NegControlProbe_00017"
-# [13] "NegControlProbe_00016" "NegControlProbe_00014" "NegControlProbe_00013"
-# [16] "NegControlProbe_00012" "NegControlProbe_00009" "NegControlProbe_00004"
-# [19] "NegControlProbe_00003" "NegControlProbe_00002" "antisense_PROKR2"
-# [22] "antisense_ULK3" "antisense_SCRIB" "antisense_TRMU"
-# [25] "antisense_MYLIP" "antisense_LGI3" "antisense_BCL2L15"
-# [28] "antisense_ADCY4"
-```
-
-
-# 5. Loading Xenium data
-
-## 5.1 Manual Method
-
-Giotto objects can be manually assembled feeding data and subobjects into a creation function. A convenience function for automatically loading the xenium data from the directory and generating a giotto object is also available. (See Section 5.2])
-
-Xenium outputs can be analyzed as either the subcellular information or as aggregated data where each detected cell's subcellular data has been spatially assigned to a cell centroid. This tutorial will work mainly with the subcellular data and how to work with it, however a workflow to load in just the aggregated data is also available through the convenience function.
-
-### 5.1.1 Load transcript-level data
-
-`transcripts.csv.gz` is a file containing x, y, z coordinates for individual transcript molecules detected during the Xenium run. It also contains a QC Phred score for which this tutorial will set a cutoff at 20, the same as what 10x uses.
-
-
-```{r, eval=FALSE}
-tx_dt = data.table::fread(tx_path)
-data.table::setnames(x = tx_dt,
- old = c('feature_name', 'x_location', 'y_location'),
- new = c('feat_ID', 'x', 'y'))
-cat('Transcripts info available:\n ', paste0('"', colnames(tx_dt), '"'), '\n',
- 'with', tx_dt[,.N], 'unfiltered detections\n')
-
-# filter by qv (Phred score)
-tx_dt_filtered = tx_dt[qv >= 20]
-cat('and', tx_dt_filtered[,.N], 'filtered detections\n\n')
-
-# separate detections by feature type
-tx_dt_types = lapply(
- feat_types_IDs, function(types) tx_dt_filtered[feat_ID %in% types]
-)
-
-invisible(lapply(seq_along(tx_dt_types), function(x) {
- cat(names(tx_dt_types)[[x]], 'detections: ', tx_dt_types[[x]][,.N], '\n')
-}))
-```
-
-
-
-```{r, eval=FALSE}
-# Transcripts info available:
-# "transcript_id" "cell_id" "overlaps_nucleus" "feat_ID" "x" "y" "z_location" "qv"
-# with 43664530 unfiltered detections
-# and 34813341 filtered detections
-#
-# Blank Codeword detections: 8805
-# Gene Expression detections: 34764833
-# Negative Control Codeword detections: 1855
-# Negative Control Probe detections: 37848
-```
-
-
-Giotto loads these filtered subcellular detections in as a `giottoPoints` object and determines the correct columns by looking for columns named `'feat_ID',` `'x'`, and `'y'`.
-
-Here, we use the list of `data.table`s generated in the previous step to create a list of `giottoPoints` objects. When previewing these objects using `plot()`, the default behavior is to plot ALL points within the object. For objects that contain many feature points, it is highly recommended to specify a subset of features to plot using the `feats` param.
-
-
-```{r, eval=FALSE}
-gpoints_list = lapply(
- tx_dt_types, function(x) createGiottoPoints(x = x)
-) # 208.499 sec elapsed
-
-# preview QC probe detections
-plot(gpoints_list$`Blank Codeword`,
- point_size = 0.3,
- main = 'Blank Codeword')
-plot(gpoints_list$`Negative Control Codeword`,
- point_size = 0.3,
- main = 'Negative Control Codeword')
-plot(gpoints_list$`Negative Control Probe`,
- point_size = 0.3,
- main = 'Negative Control Probe')
-
-# preview two genes (slower)
-plot(gpoints_list$`Gene Expression`, # 77.843 sec elapsed
- feats = c('KRT8', 'MS4A1'))
-tx_dt_types$`Gene Expression`[feat_ID %in% c('KRT8', 'MS4A1'), table(feat_ID)]
-```
-
-
-
-```{r, eval=FALSE}
-# feat_ID
-# KRT8 MS4A1
-# 530190 20926
-```
-
-
-![](images/xenium_breast_cancer/gpoints_blnk.png)
-![](images/xenium_breast_cancer/gpoints_ngcode.png)
-![](images/xenium_breast_cancer/gpoints_ngprbe.png)
-![](images/xenium_breast_cancer/gpoints_expr.png)
-
-### 5.1.2 Load polygon data
-
-Xenium output provides segmentation/cell boundary information in .csv.gz files. These are represented within Giotto as `giottoPolygon` objects and can also be directly plotted. This function also determines the correct columns to use by looking for columns named `'poly_ID'`, `'x'`, and `'y'`.
-
-
-```{r, eval=FALSE}
-cellPoly_dt = data.table::fread(cell_bound_path)
-nucPoly_dt = data.table::fread(nuc_bound_path)
-
-data.table::setnames(cellPoly_dt,
- old = c('cell_id', 'vertex_x', 'vertex_y'),
- new = c('poly_ID', 'x', 'y'))
-data.table::setnames(nucPoly_dt,
- old = c('cell_id', 'vertex_x', 'vertex_y'),
- new = c('poly_ID', 'x', 'y'))
-
-gpoly_cells = createGiottoPolygonsFromDfr(segmdfr = cellPoly_dt,
- name = 'cell',
- calc_centroids = TRUE)
-gpoly_nucs = createGiottoPolygonsFromDfr(segmdfr = nucPoly_dt,
- name = 'nucleus',
- calc_centroids = TRUE)
-```
-
-
-`giottoPolygon` objects can be directly plotted with `plot()`, but the field of view here is so large that it would take a long time and the details would be lost. Here, we will only plot the polygon centroids for the cell nucleus polygons by accessing the calculated results within the `giottoPolygon`'s `spatVectorCentroids` slot.
-
-
-```{r, eval=FALSE}
-plot(x = gpoly_nucs, point_size = 0.1, type = 'centroid')
-```
-
-
-![](images/xenium_breast_cancer/gpolys_centroids.png)
-
-### 5.1.3 Create Giotto Object
-
-Now that both the feature data and the boundaries are loaded in, a subcellular Giotto object can be created.
-
-
-```{r, eval=FALSE}
-xenium_gobj = createGiottoObjectSubcellular(
- gpoints = list(rna = gpoints_list$`Gene Expression`,
- blank_code = gpoints_list$`Blank Codeword`,
- neg_code = gpoints_list$`Negative Control Codeword`,
- neg_probe = gpoints_list$`Negative Control Probe`),
- gpolygons = list(cell = gpoly_cells,
- nucleus = gpoly_nucs),
- instructions = instrs
-)
-```
-
-
-## 5.2 Load dataset - Convenience Function {#sec-autoload}
-
-The dataset can also be loaded through a convenience function.
-
-
-```{r, eval=FALSE}
-subcellular = createGiottoXeniumObject(xenium_dir = xenium_folder,
- data_to_use = 'subcellular',
- bounds_to_load = c('cell', 'nucleus'),
- qv_threshold = 20,
- h5_expression = F,
- instructions = instrs,
- cores = NA) # set number of cores to use
-```
-
-
-```{r, eval=FALSE}
-# A structured Xenium directory will be used
-#
-# Checking directory contents...
-# > analysis info found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_analysis.tar.gz
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_analysis.zarr.zip
-# > boundary info found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cell_boundaries.csv.gz
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cell_boundaries.parquet
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_nucleus_boundaries.csv.gz
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_nucleus_boundaries.parquet
-# > cell feature matrix found
-# └──cell_feature_matrix
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cell_feature_matrix.h5
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cell_feature_matrix.zarr.zip
-# > cell metadata found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cells.csv.gz
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cells.parquet
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cells.zarr.zip
-# > image info found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_he_image.tif
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_morphology_focus.ome.tif
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_morphology_mip.ome.tif
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_morphology.ome.tif
-# > panel metadata found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_panel.tsv
-# > raw transcript info found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_transcripts.csv.gz
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_transcripts.parquet
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_transcripts.zarr.zip
-# > experiment info found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_experiment.xenium
-# Directory check done
-# Loading feature metadata...
-# Loading transcript level info...
-# |--------------------------------------------------|
-# |==================================================|
-# Loading boundary info...
-# Loading cell metadata...
-# Building subcellular giotto object...
-# > points data...
-# Selecting col "feature_name" as feat_ID column
-# Selecting cols "x_location" and "y_location" as x and y respectively
-# > polygons data...
-# [cell] bounds...
-# Selecting col "cell_id" as poly_ID column
-# Selecting cols "vertex_x" and "vertex_y" as x and y respectively
-# [nucleus] bounds...
-# Selecting col "cell_id" as poly_ID column
-# Selecting cols "vertex_x" and "vertex_y" as x and y respectively
-# 1. Start extracting polygon information
-# 2. Finished extracting polygon information
-# 3. Add centroid / spatial locations if available
-# 3. Finish adding centroid / spatial locations
-# 3. Start extracting spatial feature information
-# 4. Finished extracting spatial feature information
-# Calculating polygon centroids...
-# Start centroid calculation for polygon information layer: cell
-# Start centroid calculation for polygon information layer: nucleus
-```
-
-
-```{r, eval=FALSE}
-aggregate = createGiottoXeniumObject(xenium_dir = xenium_folder,
- data_to_use = 'aggregate',
- h5_expression = F,
- instructions = instrs,
- cores = NA) # set number of cores to use
-```
-
-
-```{r, eval=FALSE}
-# A structured Xenium directory will be used
-#
-# Checking directory contents...
-# > analysis info found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_analysis.tar.gz
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_analysis.zarr.zip
-# > boundary info found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cell_boundaries.csv.gz
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cell_boundaries.parquet
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_nucleus_boundaries.csv.gz
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_nucleus_boundaries.parquet
-# > cell feature matrix found
-# └──cell_feature_matrix
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cell_feature_matrix.h5
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cell_feature_matrix.zarr.zip
-# > cell metadata found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cells.csv.gz
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cells.parquet
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_cells.zarr.zip
-# > image info found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_he_image.tif
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_morphology_focus.ome.tif
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_morphology_mip.ome.tif
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_morphology.ome.tif
-# > panel metadata found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_panel.tsv
-# > raw transcript info found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_transcripts.csv.gz
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_transcripts.parquet
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_transcripts.zarr.zip
-# > experiment info found
-# └──Xenium_FFPE_Human_Breast_Cancer_Rep1_experiment.xenium
-# Directory check done
-# Loading feature metadata...
-# Loading cell metadata...
-# Loading aggregated expression...
-# Building aggregate giotto object...
-# Consider to install these (optional) packages to run all possible
-# Giotto commands for spatial analyses: trendsceek multinet RTriangle
-# Giotto does not automatically install all these packages as they are
-# not absolutely required and this reduces the number of dependencies
-# List of 4
-# $ raw :Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
-# .. ..@ i : int [1:10663545] 1 2 29 30 36 37 39 42 44 47 ...
-# .. ..@ j : int [1:10663545] 0 0 0 0 0 0 0 0 0 0 ...
-# .. ..@ Dim : int [1:2] 313 167782
-# .. ..@ Dimnames:List of 2
-# .. .. ..$ : Named chr [1:313] "ABCC11" "ACTA2" "ACTG2" "ADAM9" ...
-# .. .. .. ..- attr(*, "names")= chr [1:313] "1" "2" "3" "4" ...
-# .. .. ..$ : chr [1:167782] "1" "2" "3" "4" ...
-# .. ..@ x : num [1:10663545] 3 1 1 3 1 1 1 1 1 1 ...
-# .. ..@ factors : list()
-# $ Negative_Control_Probe :Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
-# .. ..@ i : int [1:24312] 18 20 22 22 22 22 20 25 26 20 ...
-# .. ..@ j : int [1:24312] 48 79 79 130 175 205 214 215 223 248 ...
-# .. ..@ Dim : int [1:2] 28 167782
-# .. ..@ Dimnames:List of 2
-# .. .. ..$ : Named chr [1:28] "NegControlProbe_00042" "NegControlProbe_00041" "NegControlProbe_00039" "NegControlProbe_00035" ...
-# .. .. .. ..- attr(*, "names")= chr [1:28] "314" "315" "316" "317" ...
-# .. .. ..$ : chr [1:167782] "1" "2" "3" "4" ...
-# .. ..@ x : num [1:24312] 1 1 1 1 1 1 1 1 1 1 ...
-# .. ..@ factors : list()
-# $ Negative_Control_Codeword:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
-# .. ..@ i : int [1:1777] 33 14 3 31 3 8 24 10 22 27 ...
-# .. ..@ j : int [1:1777] 177 373 381 583 605 673 733 850 924 1033 ...
-# .. ..@ Dim : int [1:2] 41 167782
-# .. ..@ Dimnames:List of 2
-# .. .. ..$ : Named chr [1:41] "NegControlCodeword_0500" "NegControlCodeword_0501" "NegControlCodeword_0502" "NegControlCodeword_0503" ...
-# .. .. .. ..- attr(*, "names")= chr [1:41] "342" "343" "344" "345" ...
-# .. .. ..$ : chr [1:167782] "1" "2" "3" "4" ...
-# .. ..@ x : num [1:1777] 1 1 1 1 1 1 1 1 1 1 ...
-# .. ..@ factors : list()
-# $ Blank_Codeword :Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
-# .. ..@ i : int [1:8404] 114 76 33 7 34 8 119 91 6 116 ...
-# .. ..@ j : int [1:8404] 83 111 114 138 183 245 312 322 338 354 ...
-# .. ..@ Dim : int [1:2] 159 167782
-# .. ..@ Dimnames:List of 2
-# .. .. ..$ : Named chr [1:159] "BLANK_0006" "BLANK_0013" "BLANK_0037" "BLANK_0069" ...
-# .. .. .. ..- attr(*, "names")= chr [1:159] "383" "384" "385" "386" ...
-# .. .. ..$ : chr [1:167782] "1" "2" "3" "4" ...
-# .. ..@ x : num [1:8404] 1 1 1 1 1 1 1 1 1 1 ...
-# .. ..@ factors : list()
-# NULL
-# list depth of 1
-# finished expression data
-# List of 1
-# $ raw:Classes ‘data.table’ and 'data.frame': 167782 obs. of 3 variables:
-# ..$ x_centroid: num [1:167782] 378 382 320 259 371 ...
-# ..$ y_centroid: num [1:167782] 844 859 869 852 865 ...
-# ..$ cell_ID : chr [1:167782] "1" "2" "3" "4" ...
-# ..- attr(*, ".internal.selfref")=
-# NULL
-# list depth of 1
-# There are non numeric or integer columns for the spatial location input at column position(s): 3
-# The first non-numeric column will be considered as a cell ID to test for consistency with the expression matrix
-# Other non numeric columns will be removed
-# finished spatial location data
-# finished cell metadata
-# No spatial networks are provided
-# No spatial enrichment results are provided
-# No dimension reduction results are provided
-# No nearest network results are provided
-```
-
-
-# 6. Visualize Giotto object and cells
-
-## 6.1 Spatial info
-
-Print the available spatial cell and nucleus boundary information (polygons) within the Giotto object `spatial_info` slot.
-
-
-```{r, eval=FALSE}
-showGiottoSpatialInfo(xenium_gobj)
-```
-
-
-
-```{r, eval=FALSE}
-# For Spatial info: cell
-#
-# An object of class "giottoPolygon"
-# Slot "name":
-# [1] "cell"
-#
-# Slot "spatVector":
-# class : SpatVector
-# geometry : polygons
-# dimensions : 167782, 1 (geometries, attributes)
-# extent : 0, 7525.9, 0, 5478.038 (xmin, xmax, ymin, ymax)
-# coord. ref. :
-#
-# Slot "spatVectorCentroids":
-# class : SpatVector
-# geometry : points
-# dimensions : 167782, 1 (geometries, attributes)
-# extent : 2.189156, 7523.163, 1.406448, 5476.467 (xmin, xmax, ymin, ymax)
-# coord. ref. :
-#
-# Slot "overlaps":
-# NULL
-#
-# -----------------------------
-#
-# For Spatial info: nucleus
-#
-# An object of class "giottoPolygon"
-# Slot "name":
-# [1] "nucleus"
-#
-# Slot "spatVector":
-# class : SpatVector
-# geometry : polygons
-# dimensions : 167782, 1 (geometries, attributes)
-# extent : 1.4875, 7524.413, 0, 5478.038 (xmin, xmax, ymin, ymax)
-# coord. ref. :
-#
-# Slot "spatVectorCentroids":
-# class : SpatVector
-# geometry : points
-# dimensions : 167782, 1 (geometries, attributes)
-# extent : 2.596845, 7523.503, 0.8111559, 5477.374 (xmin, xmax, ymin, ymax)
-# coord. ref. :
-#
-# Slot "overlaps":
-# NULL
-#
-# -----------------------------
-```
-
-
-## 6.2 Spatial locations
-
-Print the available spatial locations within the Giotto object's `spatial_locs` slot. These are generated from the centroids calculation for the polygons, and will be used for any generated aggregate information.
-
-
-```{r, eval=FALSE}
-showGiottoSpatLocs(xenium_gobj)
-```
-
-
-
-```{r, eval=FALSE}
-# ├──Spatial unit "cell"
-# │ └──S4 spatLocsObj "raw" coordinates: (167782 rows)
-# │ An object of class spatLocsObj
-# │ provenance: cell
-# │ ------------------------
-# │ cell_ID sdimx sdimy
-# │ 1: 1 377.6355 843.5235
-# │ 2: 2 382.0902 858.9148
-# │ 3: 3 319.8592 869.1546
-# │ 4: 4 259.2721 851.8312
-# │
-# │ ranges:
-# │ sdimx sdimy
-# │ [1,] 2.189156 1.406448
-# │ [2,] 7523.162860 5476.466538
-# │
-# │
-# │
-# └──Spatial unit "nucleus"
-# └──S4 spatLocsObj "raw" coordinates: (167782 rows)
-# An object of class spatLocsObj
-# provenance: nucleus
-# ------------------------
-# cell_ID sdimx sdimy
-# 1: 1 377.8125 842.8358
-# 2: 2 384.3298 858.9976
-# 3: 3 321.9175 869.2366
-# 4: 4 257.3259 851.5493
-#
-# ranges:
-# sdimx sdimy
-# [1,] 2.596845 0.8111559
-# [2,] 7523.503184 5477.3741650
-```
-
-
-## 6.3 Plot the generated centroids information
-
-
-```{r, eval=FALSE}
-spatPlot2D(xenium_gobj,
- spat_unit = 'cell',
- point_shape = 'no_border',
- point_size = 0.5,
- point_alpha = 0.4,
- save_param = list(
- base_width = 7,
- base_height = 7,
- save_name = '1_spatplot'))
-```
-
-
-![](images/xenium_breast_cancer/1_spatplot.png)
-
-# 7. Generate aggregated expression based on feature and boundary (polygon) information
-
-## 7.1 Calculate the overlaps of the `'rna'` feature data within the `'cell'` polygon boundary info.
-
-This updates the `'cell'` `giottoPolygon` overlaps slot with features that are overlapping the `'cell'` polygons.
-
-
-```{r, eval=FALSE}
-xenium_gobj = calculateOverlapRaster(xenium_gobj,
- spatial_info = 'cell',
- feat_info = 'rna')
-
-showGiottoSpatialInfo(xenium_gobj)
-```
-
-
-
-```{r, eval=FALSE}
-# For Spatial info: cell
-#
-# An object of class "giottoPolygon"
-# Slot "name":
-# [1] "cell"
-#
-# Slot "spatVector":
-# class : SpatVector
-# geometry : polygons
-# dimensions : 167782, 1 (geometries, attributes)
-# extent : 0, 7525.9, 0, 5478.038 (xmin, xmax, ymin, ymax)
-# coord. ref. :
-# names : poly_ID
-# type :
-# values : 1
-# 2
-# 3
-#
-# Slot "spatVectorCentroids":
-# class : SpatVector
-# geometry : points
-# dimensions : 167782, 1 (geometries, attributes)
-# extent : 2.189156, 7523.163, 1.406448, 5476.467 (xmin, xmax, ymin, ymax)
-# coord. ref. :
-# names : poly_ID
-# type :
-# values : 1
-# 2
-# 3
-#
-# Slot "overlaps":
-# $rna
-# class : SpatVector
-# geometry : points
-# dimensions : 43664530, 3 (geometries, attributes)
-# extent : -1.874261, 7522.837, 4.415276, 5473.721 (xmin, xmax, ymin, ymax)
-# coord. ref. :
-# names : poly_ID feat_ID feat_ID_uniq
-# type :
-# values : 18790 BLANK_0180 1
-# 370 LUM 2
-# 18183 CLECL1 3
-#
-#
-# -----------------------------
-#
-# For Spatial info: nucleus
-# ...
-# truncated
-```
-
-
-## 7.2 Assign polygon overlaps information to expression matrix
-
-In order to create an aggregated expression matrix, the `'rna'` features overlapped by the `'cell'` polygon boundaries are sent to be combined into a cell/feature matrix (named as `'raw'`) in the Giotto object's `expression` slot.
-
-
-```{r, eval=FALSE}
-xenium_gobj = overlapToMatrix(xenium_gobj,
- poly_info = 'cell',
- feat_info = 'rna',
- name = 'raw')
-
-showGiottoExpression(xenium_gobj)
-```
-
-
-
-```{r, eval=FALSE}
-# └──Spatial unit "cell"
-# └──Feature type "rna"
-# └──Expression data "raw" values:
-# An object of class exprObj
-# for spatial unit: "cell" and feature type: "rna"
-# Provenance: cell
-#
-# contains:
-# 313 x 167782 sparse Matrix of class "dgCMatrix"
-#
-# LUM 2 . 3 . 1 1 2 . . 2 . 5 . ......
-# TCIM 1 1 . 4 1 1 13 . . . . . . ......
-# RUNX1 . . . . . . . . . . 1 . . ......
-#
-# ..............................
-# ........suppressing 167769 columns and 307 rows
-# ..............................
-#
-# CD1C 1 . . . . . . . . . . . . ......
-# CYP1A1 . . . . . . . . . . . . . ......
-# CRHBP . . . . . . . . . . . . . ......
-#
-# First four colnames:
-# 1 2 3 4
-```
-
-
-## 7.3 Feature metadata
-
-Append features metadata from `panel.tsv` which includes information on what cell types the features are commonly markers for. There are 313 rows in this file. One for each of the gene expression probes, thus these metadata should be appended only to feat_type 'rna'.
-
-
-```{r, eval=FALSE}
-panel_meta = data.table::fread(panel_meta_path)
-data.table::setnames(panel_meta, 'Name', 'feat_ID')
-
-# Append this metadata
-xenium_gobj = addFeatMetadata(gobject = xenium_gobj,
- feat_type = 'rna',
- spat_unit = 'cell',
- new_metadata = panel_meta,
- by_column = TRUE,
- column_feat_ID = 'feat_ID')
-xenium_gobj = addFeatMetadata(gobject = xenium_gobj,
- feat_type = 'rna',
- spat_unit = 'nucleus',
- new_metadata = panel_meta,
- by_column = TRUE,
- column_feat_ID = 'feat_ID')
-
-# to return a specific metadata as data.table
-# (spat_unit = 'cell', feat_type = 'rna' are default)
-# fDataDT(xenium_gobj)
-
-# Print a preview of all available features metadata
-showGiottoFeatMetadata(xenium_gobj)
-```
-
-
-
-```{r, eval=FALSE}
-# ├──Spatial unit "cell"
-# │ ├──Feature type "rna"
-# │ │ An object of class featMetaObj
-# │ │ Provenance: cell
-# │ │ feat_ID Ensembl ID Annotation
-# │ │ 1: LUM ENSG00000139329 Fibroblasts
-# │ │ 2: TCIM ENSG00000176907 Breast glandular cells
-# │ │ 3: RUNX1 ENSG00000159216 Breast cancer
-# │ │ 4: RAPGEF3 ENSG00000079337 Adipocytes
-# │ │
-# │ ├──Feature type "blank_code"
-# │ │ An object of class featMetaObj
-# │ │ Provenance: cell
-# │ │ feat_ID
-# │ │ 1: BLANK_0424
-# │ │ 2: BLANK_0401
-# │ │ 3: BLANK_0447
-# │ │ 4: BLANK_0449
-# │ │
-# │ ├──Feature type "neg_code"
-# │ │ An object of class featMetaObj
-# │ │ Provenance: cell
-# │ │ feat_ID
-# │ │ 1: NegControlCodeword_0503
-# │ │ 2: NegControlCodeword_0514
-# │ │ 3: NegControlCodeword_0535
-# │ │ 4: NegControlCodeword_0519
-# │ │
-# │ └──Feature type "neg_probe"
-# │ An object of class featMetaObj
-# │ Provenance: cell
-# │ feat_ID
-# │ 1: NegControlProbe_00003
-# │ 2: antisense_SCRIB
-# │ 3: NegControlProbe_00012
-# │ 4: antisense_LGI3
-# │
-# └──Spatial unit "nucleus"
-# ├──Feature type "rna"
-# │ An object of class featMetaObj
-# │ Provenance: nucleus
-# │ feat_ID Ensembl ID Annotation
-# │ 1: LUM ENSG00000139329 Fibroblasts
-# │ 2: TCIM ENSG00000176907 Breast glandular cells
-# │ 3: RUNX1 ENSG00000159216 Breast cancer
-# │ 4: RAPGEF3 ENSG00000079337 Adipocytes
-# │
-# ├──Feature type "blank_code"
-# │ An object of class featMetaObj
-# │ Provenance: nucleus
-# │ feat_ID
-# │ 1: BLANK_0424
-# │ 2: BLANK_0401
-# │ 3: BLANK_0447
-# │ 4: BLANK_0449
-# │
-# ├──Feature type "neg_code"
-# │ An object of class featMetaObj
-# │ Provenance: nucleus
-# │ feat_ID
-# │ 1: NegControlCodeword_0503
-# │ 2: NegControlCodeword_0514
-# │ 3: NegControlCodeword_0535
-# │ 4: NegControlCodeword_0519
-# │
-# └──Feature type "neg_probe"
-# An object of class featMetaObj
-# Provenance: nucleus
-# feat_ID
-# 1: NegControlProbe_00003
-# 2: antisense_SCRIB
-# 3: NegControlProbe_00012
-# 4: antisense_LGI3
-```
-
-
-## 7.4 Data filtering
-
-Now that an aggregated expression matrix is generated the usual data filtering and processing can be applied We start by setting a count of 1 to be the minimum to consider a feature expressed. A feature must be
-detected in at least 3 cells to be included. Lastly, a cell must have a minimum of 5 features detected to be included.
-
-
-```{r, eval=FALSE}
-xenium_gobj = filterGiotto(gobject = xenium_gobj,
- spat_unit = 'cell',
- poly_info = 'cell',
- expression_threshold = 1,
- feat_det_in_min_cells = 3,
- min_det_feats_per_cell = 5)
-```
-
-
-
-```{r, eval=FALSE}
-# truncated
-# ...
-# Feature type: rna
-# Number of cells removed: 2945 out of 167782
-# Number of feats removed: 0 out of 313
-```
-
-
-## 7.5 Add data statistics
-
-
-```{r, eval=FALSE}
-xenium_gobj = addStatistics(xenium_gobj, expression_values = 'raw')
-
-showGiottoCellMetadata(xenium_gobj)
-showGiottoFeatMetadata(xenium_gobj)
-```
-
-
-```{=html}
-
-```
-```{=html}
-cell metadata
-```
-```{=html}
-
-```
-
-```{r, eval=FALSE}
-# ├──Spatial unit "cell"
-# │ ├──Feature type "rna"
-# │ │ An object of class cellMetaObj
-# │ │ Provenance: cell
-# │ │ cell_ID nr_feats perc_feats total_expr
-# │ │ 1: 1 62 19.80831 156
-# │ │ 2: 2 41 13.09904 63
-# │ │ 3: 3 38 12.14058 54
-# │ │ 4: 4 47 15.01597 114
-# │ │
-# │ ├──Feature type "blank_code"
-# │ │ An object of class cellMetaObj
-# │ │ Provenance: cell
-# │ │ cell_ID
-# │ │ 1: 1
-# │ │ 2: 2
-# │ │ 3: 3
-# │ │ 4: 4
-# │ │
-# │ ├──Feature type "neg_code"
-# │ │ An object of class cellMetaObj
-# │ │ Provenance: cell
-# │ │ cell_ID
-# │ │ 1: 1
-# │ │ 2: 2
-# │ │ 3: 3
-# │ │ 4: 4
-# │ │
-# │ └──Feature type "neg_probe"
-# │ An object of class cellMetaObj
-# │ Provenance: cell
-# │ cell_ID
-# │ 1: 1
-# │ 2: 2
-# │ 3: 3
-# │ 4: 4
-# │
-# └──Spatial unit "nucleus"
-# ├──Feature type "rna"
-# │ An object of class cellMetaObj
-# │ Provenance: nucleus
-# │ cell_ID
-# │ 1: 1
-# │ 2: 2
-# │ 3: 3
-# │ 4: 4
-# │
-# ├──Feature type "blank_code"
-# │ An object of class cellMetaObj
-# │ Provenance: nucleus
-# │ cell_ID
-# │ 1: 1
-# │ 2: 2
-# │ 3: 3
-# │ 4: 4
-# │
-# ├──Feature type "neg_code"
-# │ An object of class cellMetaObj
-# │ Provenance: nucleus
-# │ cell_ID
-# │ 1: 1
-# │ 2: 2
-# │ 3: 3
-# │ 4: 4
-# │
-# └──Feature type "neg_probe"
-# An object of class cellMetaObj
-# Provenance: nucleus
-# cell_ID
-# 1: 1
-# 2: 2
-# 3: 3
-# 4: 4
-```
-
-
-```{r, eval=FALSE}
-# ├──Spatial unit "cell"
-# │ ├──Feature type "rna"
-# │ │ An object of class featMetaObj
-# │ │ Provenance: cell
-# │ │ feat_ID Ensembl ID Annotation nr_cells perc_cells
-# │ │ 1: LUM ENSG00000139329 Fibroblasts 101666 61.676687
-# │ │ 2: TCIM ENSG00000176907 Breast glandular cells 84842 51.470240
-# │ │ 3: RUNX1 ENSG00000159216 Breast cancer 94086 57.078205
-# │ │ 4: RAPGEF3 ENSG00000079337 Adipocytes 13286 8.060084
-# │ │ total_expr mean_expr mean_expr_det
-# │ │ 1: 946217 5.7403192 9.307113
-# │ │ 2: 300377 1.8222668 3.540428
-# │ │ 3: 229633 1.3930914 2.440671
-# │ │ 4: 16645 0.1009785 1.252823
-# │ │
-# │ ├──Feature type "blank_code"
-# │ │ An object of class featMetaObj
-# │ │ Provenance: cell
-# │ │ feat_ID
-# │ │ 1: BLANK_0424
-# │ │ 2: BLANK_0401
-# │ │ 3: BLANK_0447
-# │ │ 4: BLANK_0449
-# │ │
-# │ ├──Feature type "neg_code"
-# │ │ An object of class featMetaObj
-# │ │ Provenance: cell
-# │ │ feat_ID
-# │ │ 1: NegControlCodeword_0503
-# │ │ 2: NegControlCodeword_0514
-# │ │ 3: NegControlCodeword_0535
-# │ │ 4: NegControlCodeword_0519
-# │ │
-# │ └──Feature type "neg_probe"
-# │ An object of class featMetaObj
-# │ Provenance: cell
-# │ feat_ID
-# │ 1: NegControlProbe_00003
-# │ 2: antisense_SCRIB
-# │ 3: NegControlProbe_00012
-# │ 4: antisense_LGI3
-# │
-# └──Spatial unit "nucleus"
-# ├──Feature type "rna"
-# │ An object of class featMetaObj
-# │ Provenance: nucleus
-# │ feat_ID Ensembl ID Annotation
-# │ 1: LUM ENSG00000139329 Fibroblasts
-# │ 2: TCIM ENSG00000176907 Breast glandular cells
-# │ 3: RUNX1 ENSG00000159216 Breast cancer
-# │ 4: RAPGEF3 ENSG00000079337 Adipocytes
-# │
-# ├──Feature type "blank_code"
-# │ An object of class featMetaObj
-# │ Provenance: nucleus
-# │ feat_ID
-# │ 1: BLANK_0424
-# │ 2: BLANK_0401
-# │ 3: BLANK_0447
-# │ 4: BLANK_0449
-# │
-# ├──Feature type "neg_code"
-# │ An object of class featMetaObj
-# │ Provenance: nucleus
-# │ feat_ID
-# │ 1: NegControlCodeword_0503
-# │ 2: NegControlCodeword_0514
-# │ 3: NegControlCodeword_0535
-# │ 4: NegControlCodeword_0519
-# │
-# └──Feature type "neg_probe"
-# An object of class featMetaObj
-# Provenance: nucleus
-# feat_ID
-# 1: NegControlProbe_00003
-# 2: antisense_SCRIB
-# 3: NegControlProbe_00012
-# 4: antisense_LGI3
-```
-
-
-## 7.6 Normalize expression
-
-
-```{r, eval=FALSE}
-xenium_gobj = normalizeGiotto(gobject = xenium_gobj,
- spat_unit = 'cell',
- scalefactor = 5000,
- verbose = T)
-```
-
-
-## 7.7 Calculate highly variable features
-
-
-```{r, eval=FALSE}
-xenium_gobj = calculateHVF(gobject = xenium_gobj,
- spat_unit = 'cell',
- save_param = list(
- save_name = '2_HVF'))
-
-cat(fDataDT(xenium_gobj)[, sum(hvf == 'yes')], 'hvf found')
-```
-
-
-
-```{r, eval=FALSE}
-# 22 hvf found
-```
-
-
-![](images/xenium_breast_cancer/2_HVF.png)
-
-Basing clustering on only 22 highly variable genes will not be helpful. Will be using all 313 genes for clustering.
-
-# 8. Dimension reduction and clustering
-
-## 8.1 PCA
-
-By default, `runPCA()` uses the subset of genes discovered to be highly variable and then assigned as such in the feature metadata. Instead, this time, using all genes is desireable, so `feats_to_use` will be set to `NULL`.
-
-
-```{r, eval=FALSE}
-xenium_gobj = runPCA(gobject = xenium_gobj,
- spat_unit = 'cell',
- expression_values = 'scaled',
- feats_to_use = NULL,
- scale_unit = F,
- center = F)
-
-# Visualize Screeplot and PCA
-screePlot(xenium_gobj,
- ncp = 20,
- save_param = list(
- save_name = '3a_screePlot'))
-showGiottoDimRed(xenium_gobj)
-plotPCA(xenium_gobj,
- spat_unit = 'cell',
- dim_reduction_name = 'pca',
- dim1_to_use = 1,
- dim2_to_use = 2)
-```
-
-
-
-```{r, eval=FALSE}
-# Dim reduction on cells:
-# -------------------------
-#
-# .
-# └──Spatial unit "cell"
-# └──Feature type "rna"
-# └──Dim reduction type "pca"
-# └──S4 dimObj "pca" coordinates: (165019 rows 21 cols)
-# Dim.1 Dim.2
-# 1 -2.459551 -0.418277
-# 2 -2.002147 -3.239184
-# 3 -1.588884 -2.195826
-```
-
-
-![](images/xenium_breast_cancer/3a_screePlot.png)
-![](images/xenium_breast_cancer/3b_PCA.png)
-
-## 8.2 tSNE and UMAP
-
-
-```{r, eval=FALSE}
-xenium_gobj = runtSNE(xenium_gobj,
- dimensions_to_use = 1:10,
- spat_unit = 'cell')
-xenium_gobj = runUMAP(xenium_gobj,
- dimensions_to_use = 1:10,
- spat_unit = 'cell')
-
-plotTSNE(xenium_gobj,
- point_size = 0.01,
- save_param = list(
- save_name = '4a_tSNE'))
-plotUMAP(xenium_gobj,
- point_size = 0.01,
- save_param = list(
- save_name = '4b_UMAP'))
-```
-
-
-![](images/xenium_breast_cancer/4a_tSNE.png)
-![](images/xenium_breast_cancer/4b_UMAP.png)
-
-## 8.3 sNN and Leiden clustering
-
-
-```{r, eval=FALSE}
-xenium_gobj = createNearestNetwork(xenium_gobj,
- dimensions_to_use = 1:10,
- k = 10,
- spat_unit = 'cell')
-xenium_gobj = doLeidenCluster(xenium_gobj,
- resolution = 0.25,
- n_iterations = 100,
- spat_unit = 'cell')
-
-# visualize UMAP cluster results
-plotUMAP(gobject = xenium_gobj,
- spat_unit = 'cell',
- cell_color = 'leiden_clus',
- show_legend = FALSE,
- point_size = 0.01,
- point_shape = 'no_border',
- save_param = list(save_name = '5_umap_leiden'))
-```
-
-
-![](images/xenium_breast_cancer/5_umap_leiden.png)
-
-## 8.4 Visualize UMAP and spatial results
-
-
-```{r, eval=FALSE}
-spatPlot2D(gobject = xenium_gobj,
- spat_unit = 'cell',
- cell_color = 'leiden_clus',
- point_size = 0.1,
- point_shape = 'no_border',
- background_color = 'black',
- show_legend = TRUE,
- save_param = list(
- save_name = '6_spat_leiden',
- base_width = 15,
- base_height = 15))
-```
-
-
-![](images/xenium_breast_cancer/6_spat_leiden.png)
-
-# 9. Subcellular visualization
-
-
-```{r, eval=FALSE}
-spatInSituPlotPoints(xenium_gobj,
- show_image = FALSE,
- feats = NULL,
- point_size = 0.05,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_alpha = 1,
- polygon_color = 'black',
- polygon_line_size = 0.01,
- polygon_fill = 'leiden_clus',
- polygon_fill_as_factor = TRUE,
- coord_fix_ratio = TRUE,
- save_para = list(
- save_name = '7_polys'))
-```
-
-
-![](images/xenium_breast_cancer/7_polys.png)
-
-The dataset is too large to visualize with subcellular polygons and features clearly so a spatial subset is needed.
-
-
-```{r, eval=FALSE}
-xenium_gobj_subset = subsetGiottoLocs(xenium_gobj,
- x_max = 4500,
- x_min = 3500,
- y_max = 5500,
- y_min = 4500)
-
-spatInSituPlotPoints(xenium_gobj_subset,
- show_image = FALSE,
- feats = list('rna' = c(
- "LUM", "CXCR4", "ITGAX")),
- feats_color_code = c(
- "LUM" = 'green',
- 'CXCR4' = 'blue',
- 'ITGAX' = 'red'),
- point_size = 0.05,
- show_polygon = TRUE,
- polygon_feat_type = 'cell',
- polygon_color = 'black',
- polygon_line_size = 0.01,
- polygon_fill = 'leiden_clus',
- polygon_fill_as_factor = TRUE,
- coord_fix_ratio = TRUE,
- save_param = list(
- save_name = '8_subset_in_situ'))
-```
-
-
-![](images/xenium_breast_cancer/8_subset_in_situ.png)