Package: CatsCradle 1.1.0

Michael Shapiro

CatsCradle: This package provides methods for analysing spatial transcriptomics data and for discovering gene clusters

This package addresses two broad areas. It allows for in-depth analysis of spatial transcriptomic data by identifying tissue neighbourhoods. These are contiguous regions of tissue surrounding individual cells. 'CatsCradle' allows for the categorisation of neighbourhoods by the cell types contained in them and the genes expressed in them. In particular, it produces Seurat objects whose individual elements are neighbourhoods rather than cells. In addition, it enables the categorisation and annotation of genes by producing Seurat objects whose elements are genes.

Authors:Anna Laddach [aut], Michael Shapiro [aut, cre]

CatsCradle_1.1.0.tar.gz
CatsCradle_1.1.0.zip(r-4.5)CatsCradle_1.1.0.zip(r-4.4)
CatsCradle_1.1.0.tgz(r-4.4-any)
CatsCradle_1.1.0.tar.gz(r-4.5-noble)CatsCradle_1.1.0.tar.gz(r-4.4-noble)
CatsCradle_1.1.0.tgz(r-4.4-emscripten)
CatsCradle.pdf |CatsCradle.html
CatsCradle/json (API)
NEWS

# Install 'CatsCradle' in R:
install.packages('CatsCradle', repos = c('https://bioc.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/annaladdach/catscradle/issues

Datasets:

On BioConductor:CatsCradle-1.1.0(bioc 3.21)CatsCradle-1.0.0(bioc 3.20)

biologicalquestionstatisticalmethodgeneexpressionsinglecelltranscriptomicsspatial

6.61 score 3 stars 69 exports 194 dependencies

Last updated 2 months agofrom:33deb7f091. Checks:OK: 1 WARNING: 4. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 29 2024
R-4.5-winWARNINGNov 29 2024
R-4.5-linuxWARNINGNov 29 2024
R-4.4-winWARNINGNov 29 2024
R-4.4-macWARNINGNov 29 2024

Exports:aggregateFeatureMatrixaggregateGeneExpressionannotateGeneAsVectorannotateGenesByGeneSetannotateLRInteractionCountscellTypesPerCellTypeGraphFromCellMatrixcellTypesPerCellTypeGraphFromNbhdMatrixcollapseExtendedNBHDscombinatorialSpherescomputeCellTypesPerCellTypeMatrixcomputeEdgeGraphcomputeEdgeObjectcomputeGraphEmbeddingcomputeMoransIcomputeNBHDByCTMatrixcomputeNBHDVsCTObjectcomputeNeighbourEnrichmentcomputeNeighboursDelaunaycomputeNeighboursEuclideancountLRInteractionsPerCellcullEdgesdesymmetriseNNdirectedHausdorfDistanceedgeCutoffsByClusteringedgeCutoffsByPercentileedgeCutoffsByWatershededgeCutoffsByZScoreedgeLengthPlotedgeLengthsAndCellTypePairsexampleObjectsgeneSetsVsGeneClustersPValueMatrixgetAverageExpressionDFgetAverageExpressionMatrixgetClusterOrdergetExtendedNBHDsgetFeatureZScoresgetGeneClusterAveragesPerCellgetGeneNeighborsgetLigandReceptorNetworkgetLigandReceptorPairsInPanelgetNearbyGenesgetNearestNeighbourListsgetObjectSubsetClusteringPValuegetObjectSubsetClusteringStatisticsmake.getExamplemakeLRInteractionHeatmapmakeSummedLRInteractionHeatmapmeanGeneClusterOnCellUMAPmeanZPerClustermeanZPerClusterOnUMAPmedianComplementDistancemedianComplementPValuenbhdsAsEdgesToNbhdsAsListneighbourhoodDiameterorderGeneSetPValuesperformLigandReceptorAnalysispredictAnnotationpredictAnnotationAllGenespredictGeneAnnotationImplrandomiseNodeIndicesreadGmtrunGeometricClusteringTrialsrunMoransIsankeyFromMatrixstripGeneSetsymmetriseNNsymmetryCheckNNtagRowAndColNamestransposeObject

Dependencies:abindaskpassbabelgenebase64encBHBiobaseBiocFileCacheBiocGenericsbitbit64bitopsblobbslibcachemcaToolscliclustercodetoolscolorspacecommonmarkcowplotcpp11crayoncrosstalkcurldata.tableDBIdbplyrDelayedArraydeldirdigestdotCall64dplyrdqrngEBImageevaluatefansifarverfastDummiesfastmapfftwtoolsfilelockfitdistrplusFNNfontawesomefsfuturefuture.applygenericsGenomeInfoDbGenomeInfoDbDataGenomicRangesgeometryggplot2ggrepelggridgesglobalsgluegoftestgplotsgridExtragtablegtoolsherehighrhtmltoolshtmlwidgetshttpuvhttricaigraphIRangesirlbaisobandjpegjquerylibjsonliteKernSmoothknitrlabelinglaterlatticelazyevalleidenlifecyclelinproglistenvlmtestlocfitlpSolvemagicmagickmagrittrMASSMatrixMatrixGenericsmatrixStatsmemoisemgcvmimeminiUImsigdbrmunsellnetworkD3nlmeopensslparallellypatchworkpbapplypheatmappillarpkgconfigplogrplotlyplyrpngpolyclippracmaprogressrpromisespurrrR6RANNrappdirsRColorBrewerRcppRcppAnnoyRcppArmadilloRcppEigenRcppGSLRcppHNSWRcppParallelRcppProgressRcppTOMLRcppZigguratRCurlrdistreshape2reticulateRfastrjsonrlangrmarkdownROCRrprojrootRSpectraRSQLiteRtsneS4ArraysS4VectorssassscalesscattermoresctransformSeuratSeuratObjectshinySingleCellExperimentsitmosourcetoolsspspamSparseArraySpatialExperimentspatstat.dataspatstat.explorespatstat.geomspatstat.randomspatstat.sparsespatstat.univarspatstat.utilsstringistringrSummarizedExperimentsurvivalsystensortibbletidyrtidyselecttifftinytexUCSC.utilsutf8uwotvctrsviridisLitewithrxfunxtableXVectoryamlzlibbioczoo

CatsCradle

Rendered fromCatsCradle.Rmdusingknitr::rmarkdownon Nov 29 2024.

Last update: 2024-10-17
Started: 2023-10-03

CatsCradle Example Data

Rendered fromCatsCradleExampleData.Rmdusingknitr::rmarkdownon Nov 29 2024.

Last update: 2024-09-09
Started: 2024-07-16

CatsCradle Quick Start

Rendered fromCatsCradleQuickStart.Rmdusingknitr::rmarkdownon Nov 29 2024.

Last update: 2024-09-09
Started: 2024-05-22

CatsCradle SingleCellExperiment Quick Start

Rendered fromCatsCradleSingleCellExperimentQuickStart.Rmdusingknitr::rmarkdownon Nov 29 2024.

Last update: 2024-09-09
Started: 2024-08-15

CatsCradle Spatial Vignette

Rendered fromCatsCradleSpatial.Rmdusingknitr::rmarkdownon Nov 29 2024.

Last update: 2024-09-09
Started: 2023-12-04

Readme and manuals

Help Manual

Help pageTopics
This function takes a matrix where rows are features and columns are cells, and a neighbourhood list, and creates an matrix where columns are the neighbourhoods, the rows are are the features and the values are aggregated expression values for cells in each neighbourhood.aggregateFeatureMatrix
This function takes a Seurat object and a list of neighbourhoods and creates a Seurat object where the columns are the neighbourhoods, the rows are are the genes and the values are gene expression totals for the cells in each neighbourhoodaggregateGeneExpression
This function returns a numeric indicating which gene sets it does and does not belong to. This vector can be normalised to account for the sizes of the sets.annotateGeneAsVector
This function annotates genes with termsannotateGenesByGeneSet
This takes a data frame of interaction counts as found by countLRInteractionsPerCell(), the underlying Seurat object and the neighbourhood Seurat object and annotates the counts with the cell type and the neighbourhood type corresponding to the cells of the interaction counts.annotateLRInteractionCounts
This function converts a matrix as found by cellTypesPerCellTypeMatrix into a directed igraph whose vertices correspond to seurat_clusters and whose edge correspond to occupancy fraction.cellTypesPerCellTypeGraphFromCellMatrix
This function takes a neighbourhood-by-cell type matrix and produces a directed igraph showing the fractions of cells of each type in the neighbourhoods around cells of each type.cellTypesPerCellTypeGraphFromNbhdMatrix
This function takes an expanded neighbourhood list and collapses it to a nearest neighbourhood graph where all neighbours of degree <= n in the original graph are considered first neighbours.collapseExtendedNBHDs
Discovers the combinatorial ball of a given radius around a fixed set of genes in the nearest neighbor graph of a Seurat object.combinatorialSpheres
For each cell type, this function looks at the neighbourhoods around cells of that type and discovers the fractions of those cells of each type.computeCellTypesPerCellTypeMatrix
This function takes a spatial graph and computes a new spatial graph where edges become nodes and A-B edges (in the original graph) become connected to all A- edges and all B- edges.computeEdgeGraph
This function takes interactionResults and creates a seurat object where each point represents an edge between cells, and spatial coordinates are the centroids of edges between cells. The "expression matrix" is the binarised presence/absence of an interaction (ligand receptor pair) on an edge.computeEdgeObject
This function adds a force directed graph embedding to a seurat objectcomputeGraphEmbedding
This function takes a matrix where rows are features and columns are cells, and a neighbourhood list, and computes Moran's I.computeMoransI
This function computes a matrix where neighbourhoods are rows and cell types are columns. The values in the matrix indicate the number of cells of a given type within a neighbourhood.computeNBHDByCTMatrix
This function creates a seurat object using a neighbourhood by cell type matrixcomputeNBHDVsCTObject
This function calculates P values for whether cell types are more frequently neighbours than expected by chance. It does this by comparison to randomised neighbour graphs where edges are randomised but the degree of each node is preserved.computeNeighbourEnrichment
This function computes a spatial graph where neighbors are identified based on Delaunay triangulation.computeNeighboursDelaunay
This function computes a spatial graph where neighbors are identified based on euclidean distance and a user defined threshold.computeNeighboursEuclidean
This function takes a listing of the neighbouring cells together with the presence or absence of each ligand-receptor pair on each edge and produces a count showing for each cell, how many neighbours it has with that interaction either as source or as targetcountLRInteractionsPerCell
This subsets edges by our chosen criteracullEdges
This function takes the data frame of neighbor genes and reduces it so that each undirected edge is represented by only one directed edge. This ensures that randomisation does not magically split undirected edges into two edges.desymmetriseNN
This finds the directed Hausdorf distance from A to BdirectedHausdorfDistance
This finds proposed cutoffs for edge lengths by clustering the lengths of the edges for each cell type pair using k-means clustering with k = 2edgeCutoffsByClustering
This finds edge cutoffs by percentileedgeCutoffsByPercentile
This finds proposed cutoffs for edge lengths by computing the histogram of edge lengths for each cell type pair and then using the watershed algorithm to find the hump of the histogram containing the median.edgeCutoffsByWatershed
This finds edge cutoffs by z-scoreedgeCutoffsByZScore
edgeLengthPlotedgeLengthPlot
This function annotates edges with their distance and the types of cells they connectedgeLengthsAndCellTypePairs
This returns the names of available example objects.exampleObjects
exSeuratObjexSeuratObj
This compares the gene clusters to other gene sets e.g., GO, Hallmark, and determines the p-value for their overlaps when compared to a set of background genes.geneSetsVsGeneClustersPValueMatrix
This converts an average gene expression matrix to a data frame.getAverageExpressionDF
This computes average expression of each gene cluster in each cell cluster and returns the result as a matrixgetAverageExpressionMatrix
This functions retrieves an expression matrix from a seurat object or SingleCellExperiment and binarises it.getBinarisedMatrix
This gets the clusters in their cannonical ordergetClusterOrder
This function takes a nearest neighbour graph and a radius and calculates nth degree neighbour graphs where max(n) == radiusgetExtendedNBHDs
This gets z-scores for the values of featuresgetFeatureZScores
This produces a matrix giving the average expression of gene clusters in cells. By default, it uses all cells and all gene clusters.getGeneClusterAveragesPerCell
This function gets the neighbors of a given gene using either the gene Seurat object or its nearest neighbor graph returned from getNearestNeighbourListsgetGeneNeighbors
This function takes a binarised expression matrix, a set of ligand receptor pairs and a set of edges denoting neighbouring cells and annotates these with the ligand receptor interactions taking place on those edges in each direction.getInteractionsOnEdges
This function retrieves the Nichenetr ligand- receptor network for mouse or human.getLigandReceptorNetwork
This functions takes an Seurat object, its species and a ligand receptor network and subsets the ligand receptor network to those pairs that occur in the panelgetLigandReceptorPairsInPanel
Nearby genesgetNearbyGenes
This function extracts a shared nearest neighbor network from a Seurat objectgetNearestNeighbourLists
This function computes a p-value for the geometric clustering of a gene set (in UMAP or PCA reduction) based on the median distance from its complement to the set.getObjectSubsetClusteringPValue
This function computes statistics for the geometric clustering of a gene set (in UMAP or PCA reduction) based on the median distance from its complement to the set.getObjectSubsetClusteringStatistics
humanLRNhumanLRN
ligandReceptorResultsligandReceptorResults
This function makes the function whichretrieves and makes example data objects.make.getExample
This function takes ligandReceptorResults and plots a heatmap of -log10(pvalues).makeLRInteractionHeatmap
This function takes ligandReceptorResults and plots a heatmap of the total number of ligand receptor interactions between clusters.makeSummedLRInteractionHeatmap
Mean gene cluster on cell umapmeanGeneClusterOnCellUMAP
This finds the mean z-score for features in subsets of cells e.g., in each of the seurat_clustersmeanZPerCluster
This collects together mean z-score data together with UMAP coordinates from the gene seurat object for plotting.meanZPerClusterOnUMAP
This takes a set S of n points in dimension d given by an n x d matrix and a subset A given by a logical and returns the median distance from the complement to the given subset.medianComplementDistance
This takes a set S of n points in dimension d and a subset A and computes a p-value for the co-localization of the subset by comparing the median complement distance for the given set to values of the median complement distance computed for random subsets of the same size.medianComplementPValue
moransImoransI
moransILigandReceptormoransILigandReceptor
mouseLRNmouseLRN
nbhdsAsEdgesToNbhdsAsListnbhdsAsEdgesToNbhdsAsList
neighbourhoodDiameterneighbourhoodDiameter
This orders the gene set p-values (or -log10 p-values) and applies a cutoff (if given) to show only the significant gene sets for each gene clusterorderGeneSetPValues
Given a seurat object, a spatial graph, clusters and species this function identifies ligand-receptor interactions between neighbouring cells, identifies ligand-receptor interactions within and between clusters and calculates whether these are observed more frequently than expected by chance.performLigandReceptorAnalysis
This function permutes the rows of a matrix.permuteMatrix
This function makes annotation predictions for a set of genes based on gene sets (e.g., hallmark) and a CatsCradle object by considering the annotations of its neighboring genes.predictAnnotation
This function predicts the functions of all genes based on the functions of their neighbours.predictAnnotationAllGenes
This function is the implementation for predicting the functions of a gene based on the functions of its neighbours.predictGeneAnnotationImpl
This function performs degree-preserving randomisation of neighbour graphs.randomiseGraph
This function generates random indices for node BrandomiseNodeIndices
This function reads in gene sets in .gmt formatreadGmt
This runs random trials to determine the statistical significance of the clustering of a set of points within a larger set.runGeometricClusteringTrials
This function takes a matrix where rows are features and columns are cells, and a neighbourhood list, and computes Moran's I.runMoransI
This makes a sankey graph from a matrix of average expression. Our "Cat's Cradle".sankeyFromMatrix
seuratCellsseuratCells
seuratGenesseuratGenes
smallXeniumsmallXenium
This function strips out non-gene information from the beginning of GO sets, etc.stripGeneSet
This symmetrises a nearest neighbors graph.symmetriseNN
Tests whether a nearest neighbor graph is symmetricsymmetryCheckNN
This gussies up the rownames and colnames of MtagRowAndColNames
Create the transpose of a Seurat objecttransposeObject
xeniumCellsxeniumCells