jj_plot_blended_feature: Plot scatterplot of two features as combined colorscale

View source: R/jj_plot_blended_feature.R

jj_plot_blended_featureR Documentation

Plot scatterplot of two features as combined colorscale

Description

jj_plot_blended_feature translates two continuous feature scales to a red and green colorscale and plots a blended colorscale a scatterplot. Useful e.g. to visualize co-expression patterns.

Usage

jj_plot_blended_feature(df, x, y, colfeat1, colfeat2, pt_size = 1)

Arguments

df

sparse matrix, vector, or data.frame

x

vector with group annotation, has to have length equal to ncol(sparse_mat)/nrow(data.frame)/length(vector)

y

provide symbol_column to add text to all points that are highlighted (when use_text=TRUE)

colfeat1

vector specifying range of x axis (and for fc_fc plot range of y axis)

colfeat2

define marker_thres to highlight all points with absolute value above

pt_size

size of points

Value

ggplot scatterplot

Examples

library(Seurat)
dr_df = jj_get_reduction_coords(pbmc_small, 'tsne')
dr_df = jj_bind_features_with_dr_df(pbmc_small, assay= 'RNA', slot = 'data', features = c('CD19', 'CD79A'), dr_df = dr_df, cap_top = 'q95')
jj_plot_blended_feature(dr_df, x = 'tSNE_1', y = 'tSNE_2', colfeat1 = 'CD19', colfeat2 = 'CD79A', pt_size = 3)

mathosi/jj documentation built on Feb. 25, 2024, 2:29 p.m.