Make Neighborhood Plot
make_neighborhood_plot.RdGenerates a UMAP plot highlighting the neighborhood of a given sample, showing its nearest neighbors and their group assignments.
Usage
make_neighborhood_plot(
single_sample_prediction_output,
this_sample_id,
prediction_in_title = TRUE,
add_circle = TRUE,
label_column = "DLBCLone_wo",
point_size = 0.5,
point_alpha = 0.9,
line_alpha = 0.9
)Arguments
- single_sample_prediction_output
A list containing prediction results and annotation data frames. Must include elements
prediction(data frame with prediction results) andanno_df(data frame with UMAP coordinates and annotations).- this_sample_id
Character. The sample ID for which the neighborhood plot will be generated.
- prediction_in_title
Logical. If
TRUE, includes the predicted label in the plot title.- add_circle
Plot will include a circle surrounding the set of neighbors. Set to FALSE to disable.
- label_column
Specify the column that contains the DLBCLone prediction you want to show. Default: the optimized Other-balanced "DLBCLone_wo".
- point_size
Numeric. The size of the points in the plot. Default: 0.5.
- point_alpha
Numeric. The transparency level of the points in the plot. Default: 0.9.
- line_alpha
Numeric. The transparency level of the lines connecting the sample to its neighbors. Default: 0.9.
Value
A ggplot2 object representing the UMAP plot with
the selected sample and its neighbors highlighted.