plot_corr_gene_expr_psi | R Documentation |
Plot gene expression on X-axis vs AS event PSI on Y-axis and calculate correlation between samples.
plot_corr_gene_expr_psi(
data,
quality_thrshld = "N",
external_gene_name,
vst_id,
unit,
log_expr = FALSE,
text = FALSE,
text_size = 10,
label_size = 3,
beautify = FALSE,
xzero = TRUE,
colour = c("score", "PSI"),
save_plot = FALSE,
out_plot_dir,
verbose = TRUE,
return_data = FALSE,
subttl = NULL
)
data |
A |
quality_thrshld |
vast-tools event quantification quality score threshold. Must be one of "N", "VLOW", "LOW", "OK", "SOK". For more info read the official documentation here under "Column 8, score 1". |
external_gene_name |
An ensembl-gene-name. |
vst_id |
vast-tools AS event ID. |
unit |
Was the vast-tools gene expression quantified in |
log_expr |
Logical. Should gene expression values on the X-axis be log2 transformed before calculating the correlations and plotting the data? Default |
text |
Logical. Do you want to label the point in the plot. Uses |
text_size |
Number How big should the text be? Default is |
label_size |
Number How big should the label text be? Default is |
beautify |
Remove pre-fixed or post-fixes from sample names. Kinda experimental. |
xzero |
Logical. Should x-axis start from zero? |
colour |
Either 'score' or 'PSI' to indicate if the points should be coloured by the AS event score (see |
save_plot |
Logical. Do you wanna save the plot to pdf? Uses |
out_plot_dir |
Path specifing location where to save the plot pdf. |
verbose |
Lofical, print info on correlation. |
return_data |
Logical. Do not plot the data but just return the data used to plot. Default |
subttl |
Character string in case you wanna add some info to the subtitle. For example one could specify the type of cell line or tissue. |
The plot title reports the correlation values of the:
Spearman's rho
Pearson's r
Kendall's tau
Chatterjee's xi
A ggplot2 plot or a data.frame
.
# 1. Get PSI values
grep_psi(inclusion_tbl = psi_tbl_path, vst_id = "HsaEX0000001") |>
tidy_vst_psi() -> psi_tbl
# 2. Get gene expression values
grep_gene_expression(vst_expression_tbl = expression_tbl_path,
ensembl_gene_id = gene_name ) |>
tidy_vst_expr() |>
# 3. Join gene expression table to PSI table
left_join(psi_tbl, by = "Sample") |>
# 4. Calculate correlations and plot
plot_corr_gene_expr_psi(external_gene_name = gene_name, unit = "TPM",
vst_id = "HsaEX0000001", text = TRUE,
beautify = TRUE, xzero = FALSE, verbose = FALSE,
subttl = "A great subtitle",
out_plot_dir = path_out, save_plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.