Description Usage Arguments Details Value See Also Examples
This function is designed to ingest data in the form output by functions like
get_bw_data()
.
1 2 3 4 5 6 7 |
data |
A data frame where rows are samples and columns are genes and metadata. |
condition |
A string. The name of the column in |
genes |
A character vector. The column names that contain the genes for
the differential expression. If |
method |
A string. The correlation test method. Must be |
padj_method |
A string. The method of adjusting the p-values for
multiple hypothesis testing. Must be one of |
This function has no way of dealing with batch effects. To allow for these,
you should correct your data (with e.g. linear_correct()
)
beforehand.
A tibble with 8 columns:
gene
: The gene name.
log2fc
: The log2 fold-change between case and control.
pvalue
: The p-value for that gene being differentially expressed.
padj
: Adjusted p-values.
base_med
: The median raw value for the baseline samples.
case_med
: The median raw value for the case samples.
base_mean
: The mean raw value for the baseline samples.
case_mean
: The mean raw value for the case samples. For method = "pearson"
the log2fc
is of the
means of the two groups. Otherwise, it is of the medians.
Other differential expression methods:
deseq()
,
edger()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | if (requireNamespace("mirmisc", quietly = TRUE)) {
bwms_data <- get_combined_cohort_data(
c("bw", "ms"),
log2 = TRUE, tot_counts = TRUE,
gene_predicate = ~ stats::median(.) > 0,
) %>%
dplyr::filter(!is.na(meta_pre_eclampsia)) %>%
dplyr::mutate(tot_counts = log2(tot_counts + 1))
genes <- dplyr::intersect(mirmisc::get_gene_names(), names(bwms_data))
bwms_corr <- linear_correct(
bwms_data,
correct_cols = genes,
correct_for_cols = c("log2_tot_counts", "cohort",
"meta_q_pcr_actb_ct", "meta_q_pcr_ercc_ct"),
keep_effect_cols = "meta_pre_eclampsia"
)[[1]]
cor_de(bwms_corr, "meta_pre_eclampsia")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.