Plot Tsne
plot_umap.Rd
plot_umap
generates a umap plot using global variable features though umap.
Arguments
- object
SummarizedExperiment (or DEGdata) object, Data object for which differentially enriched proteins are annotated (output from
test_diff()
(ortest_diff_deg()
) andadd_rejections()
).- indicate
Character, Sets the color, shape and facet_wrap of the plot based on columns from the experimental design (colData).
- label
Logical, Whether or not to add sample labels.
- n
Integer(1), Sets the number of top variable proteins to consider.
- point_size
Integer(1), Sets the size of the points.
- label_size
Integer(1), Sets the size of the labels.
- plot
Logical(1), If
TRUE
(default) the PCA plot is produced. Otherwise (ifFALSE
), the data which the PCA plot is based on are returned.- if_square
Logical(1), if TRUE plot in a
- features
Character(1), the feature name in plot title, could be "proteins","genes", default is "features"
- n_neighbors
Integer(1), constraining the size of the local neighborhood UMAP will look at.
- theseed
Integer(1),Set random_state i umap. #' @param ...
Value
A scatter plot (generated by ggplot
).
Examples
# Load example
data(Silicosis_pg)
data <- Silicosis_pg
data_unique <- make_unique(data, "Gene.names", "Protein.IDs", delim = ";")
# Differential test
ecols <- grep("LFQ.", colnames(data_unique))
se <- make_se_parse(data_unique, ecols,mode = "delim")
filt <- filter_se(se, thr = 0, fraction = 0.4, filter_formula = ~ Reverse != "+" & Potential.contaminant!="+")
#> filter base on missing number is <= 0 in at least one condition.
#> filter base on missing number fraction < 0.4 in each row
#> filter base on giving formula
norm <- normalize_vsn(filt)
#> vsn2: 8762 x 20 matrix (1 stratum).
#> Please use 'meanSdPlot' to verify the fit.
imputed <- impute(norm, fun = "MinProb", q = 0.05)
#> Imputing along margin 2 (samples/columns).
#> [1] 0.3026531
# UMAP plot
plot_umap(imputed)
#> The random_state of umap is 17894
#> Warning: Use of `umap_df[[indicate[1]]]` is discouraged.
#> ℹ Use `.data[[indicate[1]]]` instead.
#> Warning: Use of `umap_df[[indicate[2]]]` is discouraged.
#> ℹ Use `.data[[indicate[2]]]` instead.