Plot the product of loadings between the source and target loadings within a factor
Source:R/liana_tensor.R
plot_c2c_cells.RdPlot the product of loadings between the source and target loadings within a factor
Arguments
- factor_of_int
factor of interest e.g. Factor.8
- ...
Arguments passed on to
ComplexHeatmap::HeatmapmatrixA matrix. Either numeric or character. If it is a simple vector, it will be converted to a one-column matrix.
colA vector of colors if the color mapping is discrete or a color mapping function if the matrix is continuous numbers (should be generated by
colorRamp2). If the matrix is continuous, the value can also be a vector of colors so that colors can be interpolated. Pass toColorMapping. For more details and examples, please refer to https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#colors .nameName of the heatmap. By default the heatmap name is used as the title of the heatmap legend.
na_colColor for
NAvalues.rect_gpGraphic parameters for drawing rectangles (for heatmap body). The value should be specified by
gparandfillparameter is ignored.color_spaceThe color space in which colors are interpolated. Only used if
matrixis numeric andcolis a vector of colors. Pass tocolorRamp2.borderWhether draw border. The value can be logical or a string of color.
border_gpGraphic parameters for the borders. If you want to set different parameters for different heatmap slices, please consider to use
decorate_heatmap_body.cell_funSelf-defined function to add graphics on each cell. Seven parameters will be passed into this function:
j,i,x,y,width,height,fillwhich are column index, row index inmatrix, coordinate of the cell, the width and height of the cell and the filled color.x,y,widthandheightare allunitobjects.layer_funSimilar as
cell_fun, but is vectorized. Check https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#customize-the-heatmap-body .jitterRandom shifts added to the matrix. The value can be logical or a single numeric value. It it is
TRUE, random values from uniform distribution between 0 and 1e-10 are generated. If it is a numeric value, the range for the uniform distribution is (0,jitter). It is mainly to solve the problem of "Error: node stack overflow" when there are too many identical rows/columns for plotting the dendrograms. ADD: From version 2.5.6, the error of node stack overflow has been fixed, now this argument is ignored.row_titleTitle on the row.
row_title_sideWill the title be put on the left or right of the heatmap?
row_title_gpGraphic parameters for row title.
row_title_rotRotation of row title. Only 0, 90, 270 are allowed to set.
column_titleTitle on the column.
column_title_sideWill the title be put on the top or bottom of the heatmap?
column_title_gpGraphic parameters for column title.
column_title_rotRotation of column titles. Only 0, 90, 270 are allowed to set.
cluster_rowsIf the value is a logical, it controls whether to make cluster on rows. The value can also be a
hclustor adendrogramwhich already contains clustering. Check https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#clustering .cluster_row_slicesIf rows are split into slices, whether perform clustering on the slice means?
clustering_distance_rowsIt can be a pre-defined character which is in ("euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski", "pearson", "spearman", "kendall"). It can also be a function. If the function has one argument, the input argument should be a matrix and the returned value should be a
distobject. If the function has two arguments, the input arguments are two vectors and the function calculates distance between these two vectors.clustering_method_rowsMethod to perform hierarchical clustering, pass to
hclust.row_dend_sideShould the row dendrogram be put on the left or right of the heatmap?
row_dend_widthWidth of the row dendrogram, should be a
unitobject.show_row_dendWhether show row dendrogram?
row_dend_gpGraphic parameters for the dendrogram segments. If users already provide a
dendrogramobject with edges rendered, this argument will be ignored.row_dend_reorderApply reordering on row dendrograms. The value can be a logical value or a vector which contains weight which is used to reorder rows. The reordering is applied by
reorder.dendrogram.cluster_columnsWhether make cluster on columns? Same settings as
cluster_rows.cluster_column_slicesIf columns are split into slices, whether perform clustering on the slice means?
clustering_distance_columnsSame setting as
clustering_distance_rows.clustering_method_columnsMethod to perform hierarchical clustering, pass to
hclust.column_dend_sideShould the column dendrogram be put on the top or bottom of the heatmap?
column_dend_heightheight of the column cluster, should be a
unitobject.show_column_dendWhether show column dendrogram?
column_dend_gpGraphic parameters for dendrogram segments. Same settings as
row_dend_gp.column_dend_reorderApply reordering on column dendrograms. Same settings as
row_dend_reorder.row_orderOrder of rows. Manually setting row order turns off clustering.
column_orderOrder of column.
row_labelsOptional row labels which are put as row names in the heatmap.
row_names_sideShould the row names be put on the left or right of the heatmap?
show_row_namesWhether show row names.
row_names_max_widthMaximum width of row names viewport.
row_names_gpGraphic parameters for row names.
row_names_rotRotation of row names.
row_names_centeredShould row names put centered?
column_labelsOptional column labels which are put as column names in the heatmap.
column_names_sideShould the column names be put on the top or bottom of the heatmap?
column_names_max_heightMaximum height of column names viewport.
show_column_namesWhether show column names.
column_names_gpGraphic parameters for drawing text.
column_names_rotRotation of column names.
column_names_centeredShould column names put centered?
top_annotationA
HeatmapAnnotationobject.bottom_annotationA
HeatmapAnnotationobject.left_annotationIt should be specified by
rowAnnotation.right_annotationit should be specified by
rowAnnotation.kmApply k-means clustering on rows. If the value is larger than 1, the heatmap will be split by rows according to the k-means clustering. For each row slice, hierarchical clustering is still applied with parameters above.
splitA vector or a data frame by which the rows are split. But if
cluster_rowsis a clustering object,splitcan be a single number indicating to split the dendrogram bycutree.row_kmSame as
km.row_km_repeatsNumber of k-means runs to get a consensus k-means clustering. Note if
row_km_repeatsis set to more than one, the final number of groups might be smaller thanrow_km, but this might means the originalrow_kmis not a good choice.row_splitSame as
split.column_kmK-means clustering on columns.
column_km_repeatsNumber of k-means runs to get a consensus k-means clustering. Similar as
row_km_repeats.column_splitSplit on columns. For heatmap splitting, please refer to https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#heatmap-split .
gapGap between row slices if the heatmap is split by rows. The value should be a
unitobject.row_gapSame as
gap.column_gapGap between column slices.
show_parent_dend_lineWhen heatmap is split, whether to add a dashed line to mark parent dendrogram and children dendrograms?
widthWidth of the heatmap body.
heightHeight of the heatmap body.
heatmap_widthWidth of the whole heatmap (including heatmap components)
heatmap_heightHeight of the whole heatmap (including heatmap components). Check https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#size-of-the-heatmap .
show_heatmap_legendWhether show heatmap legend?
heatmap_legend_paramA list contains parameters for the heatmap legends. See
color_mapping_legend,ColorMapping-methodfor all available parameters.use_rasterWhether render the heatmap body as a raster image. It helps to reduce file size when the matrix is huge. If number of rows or columns is more than 2000, it is by default turned on. Note if
cell_funis set,use_rasteris enforced to beFALSE.raster_deviceGraphic device which is used to generate the raster image.
raster_qualityA value larger than 1.
raster_device_paramA list of further parameters for the selected graphic device. For raster image support, please check https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#heatmap-as-raster-image .
raster_resize_matWhether resize the matrix to let the dimension of the matrix the same as the dimension of the raster image? The value can be logical. If it is
TRUE,meanis used to summarize the sub matrix which corresponds to a single pixel. The value can also be a summary function, e.g.max.raster_by_magickWhether to use
image_resizeto scale the image.raster_magick_filterPass to
filterargument ofimage_resize. A character scalar and all possible values are infilter_types. The default is"Lanczos".post_funA function which will be executed after the heatmap list is drawn.
- factors
factors as formatted by `format_c2c_factors`