# InterCellar: an R-Shiny app for interactive analysis and exploration of cell-cell communication in single-cell transcriptomics

## Documentation for package ‘InterCellar’ version 2.10.0

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Package NEWS.

## Help Pages

annotateGO | Perform GO annotation of input data
annotatePathways | Annotate pathways for input data
buildPairsbyFunctionMatrix | Build binary matrix with int-pairs in rows, functions in cols
checkLL_RR | Manually change the annotation of L-L and R-R pairs
circlePlot | Plot circle plot
combineAnnotations | Combine GO annotation and pathways in a unique object
createBarPlot1_ggplot | Create ggplot barplot to be saved in tiff
createBarPlot2_CV | Create barplot of number of interaction for selected cluster
createBarPlot2_ggplot | Create ggplot barplot of Nint per cluster selected
createBarPlot_CV | Create Barplot cluster-verse
createNetwork | Create Network of clusters
dendroIntPairModules | Get dendrogram of int pair modules
elbowPoint | Determine the elbow point on a curve (from package akmedoids)
ensemblLink | Get html link to ensembl
getBack2BackBarplot | Get back-to-back barplot for 2 conditions comparison
getBarplotDF | Get dataframe for plotting barplot (all clusters)
getBarplotDF2 | Get dataframe for barplot (by cluster)
getClusterA_Names | Get cluster names only from sender cluster A
getClusterColors | Get colors for clusters
getClusterNames | Get clusters names from initial input data
getClusterNetwork | Creating edges dataframe for network of clusters
getClusterSize | Get Clusters size
getDistinctCouplets | Get table of unique int-pairs/clust-pairs couplets
getDotPlot_selInt | Functions to plot DotPlots
getGeneTable | Get table for gene-verse
getGObiomaRt | Connection to Ensembl via biomaRt to get GO terms
getHitsf | Subfunction to calculate significant functions by permutation test
getIntFlow | Get subset of interactions corresponding to a certain viewpoint and flow
getNtermsBYdb | Calculate number of terms of a database
getNumLR | Get number of unique ligands and receptors
getPieChart | Get Pie Chart of unique couplets

getRadar_df

#' Get radar plot of relative numbers of interactions for a certain cell type #' #' @param tab_c1 barplot dataframe from Viewpoint generated by getBarplotDF2() containing data for condition 1 #' @param tab_c2 barplot dataframe from Viewpoint generated by getBarplotDF2() containing data for condition 2 #' @param tab_c3 barplot dataframe from Viewpoint generated by getBarplotDF2() containing data for condition 3 #' @param lab_c1 label for condition 1 #' @param lab_c2 label for condition 2 #' @param lab_c3 label for condition 3 #' @param cell_name label of cell type of interest #' #' @return plot #' @importFrom fmsb radarchart #' @importFrom data.table transpose getRadarPlot <- function(tab_c1, tab_c2, tab_c3, lab_c1, lab_c2, lab_c3, cell_name) if(is.null(tab_c3)) df <- merge(tab_c1, tab_c2, by = "Clusters", all = TRUE) colnames(df) <- c("Clusters", "nint_c1", "nint_c2") else df <- merge(tab_c1, tab_c2, by = "Clusters", all = TRUE) df <- merge(df, tab_c3, by = "Clusters", all = TRUE) colnames(df) <- c("Clusters", "nint_c1", "nint_c2", "nint_c3") df[is.na(df)] <- 0 cluster_names <- df$Clusters # add max and min max_nint <- max(df[, -1]) df <- add_column(df, max_nint, .after = "Clusters") df <- add_column(df, "min_nint" = 0, .after = "max_nint") radar_df <- data.table::transpose(df[, -1]) if(is.null(lab_c3)) rownames(radar_df) <- c("max", "min", lab_c1, lab_c2) else rownames(radar_df) <- c("max", "min", lab_c1, lab_c2, lab_c3) colnames(radar_df) <- cluster_names color <- c("#438ECC", "#E97778", "#00BA38") fmsb::radarchart( radar_df, axistype = 1, # Customize the polygon pcol = color, pfcol = scales::alpha(color, 0.5), plwd = 2, plty = 1, # Customize the grid cglcol = "grey", cglty = 1, cglwd = 0.8, # Customize the axis axislabcol = "grey30", # Variable labels vlcex = 1.2, vlabels = colnames(radar_df), caxislabels = round(seq(from = 0, to = radar_df["max",1], length.out = 5)), title = cell_name ) legend( x = "bottomleft", legend = rownames(radar_df[-c(1,2),]), horiz = FALSE, bty = "n", pch = 20 , col = color, text.col = "black", cex = 1, pt.cex = 1.5 ) Get radar df of relative numbers of interactions for a certain cell type

getRankedTerms | Get table with ranked functional terms
getSignificantFunctions | Calculate significant function per intpair module
getSignificantFunctions_multiCond | Get significance of functional terms related to unique int-pairs per condition
getSignif_table | Wrapper for other functions to get significant table of func terms
getSunburst | Get Sunburst plot of selected functional terms
getUMAPipModules | Get UMAP for IP modules
getUniqueDotplot | Plot dotplot containing only unique int-pair/cluster pairs with many conditions
getUniqueIntpairs_byCond | Get table of unique int-pairs by condition
goLink | Get GO link
input.data | Input Data example
read.cellchat | Read dataframe of cell-cell communication from CellChat (ligand/receptor)
read.CPDBv2 | Read output from CellPhoneDB v2.
read.customInput | Read custom input file and re-structure it with InterCellar format
read.icellnet | Read ICELLNET dataframe
read.SCsignalR | Read output from SingleCellSignalR
run_app | Run the Shiny Application
subsetAnnot_multiCond | Subset int-pair by function matrices to unique int-pairs by condition
subsetFuncMatBYFlow | Subset pairs-function matrix by selected flow
swap.RLint | Swaps interaction pairs that are R-L to L-R
uniprotLink | Get html link to uniprot
updateInputLR | Function that orders all interaction pairs as L-R. Leaves unchanged the R-R and L-L