plotCCNetwork function

Visualize cell cluster association network graph

Visualize cell cluster association network graph

The plotCCNetwork function takes cells belonging to the same phenotype as a cluster. When cell phenotypes are not provided, the plotCCNetwork functions identify cell clusters based on edge betweenness. Cell interactions between cell clusters are merged into one edge by mean. The thickness of the edge indicates the strength of interaction between cell clusters.

plotCCNetwork( network.data, cell_id = NULL, cell_cluster = FALSE, cluster_method = "louvain", vertex.colors = NULL, vertex.size = 10, vertex.label.cex = 0.8, vertex.label.dist = 1, vertex.label.color = "black", edge.width = 5, margin = 0, layout = layout_with_lgl, legend.cex = 1.5, legend.pt.cex = 3, proportion = 1, plotgraph = TRUE )

Arguments

  • network.data: The input network data is the result from the ConNetGNN function.
  • cell_id: A vector of cell phenotype.Methods include louvain (default), leading eigen and edge betweenness.
  • cell_cluster: A binary value. Whether to automatically identify cell clusters based on edge betweenness. Default: FALSE.
  • cluster_method: Community structure detection method
  • vertex.colors: The fill color of the vertex. The number of colors should match the number of cell phenotypes. If NULL (default), the system will automatically assign colors.
  • vertex.size: The size of the vertex. Default: 10.
  • vertex.label.cex: The font size for vertex labels. Default: 0.8.
  • vertex.label.dist: The distance of the label from the center of the vertex. If it is 0 then the label is centered on the vertex. Default: 1.
  • vertex.label.color: The color of the labels. Default: black.
  • edge.width: The width of the edge. This does not affect the relative size of the edge weights. Default: 5.
  • margin: The amount of empty space below, over, at the left and right of the plot, it is a numeric vector of length four. Usually values between 0 and 0.5 are meaningful, but negative values are also possible, that will make the plot zoom in to a part of the graph. If it is shorter than four then it is recycled. Default: 0.
  • layout: Either a function or a numeric matrix. It specifies how the vertices will be placed on the plot. For details, please refer to the igraphPackage. Default: layout_with_lgl.
  • legend.cex: The font size of legend. Default: 1.5.
  • legend.pt.cex: Expansion factor(s) for the points. Default: 3.
  • proportion: This parameter specifies what percentage of edges to display (edges are sorted by their weight in descending order). Default: 1, all edges are used.
  • plotgraph: Whether to draw the picture. Default: TRUE. If FALSE, the image will not be displayed but the network data will be returned in the igraph data format.

Returns

Graph or network data.

Details

plotCCNetwork

Examples

require(igraph) require(graphics) data(ConNetGNN_data) # Construct the cell phenotype vector. cell_id<-colnames(ConNetGNN_data[["cell_network"]]) temp<-unlist(strsplit(cell_id,"_")) cell_phen<-temp[seq(2,length(temp)-1,by=3)] names(cell_id)<-cell_phen head(cell_id) plotCCNetwork(ConNetGNN_data,cell_id,edge.width=10)
  • Maintainer: Xudong Han
  • License: GPL (>= 2)
  • Last published: 2023-08-08

Useful links