Last updated: 2021-06-18
Checks: 4 3
Knit directory: MS_lesions/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish
to commit the R Markdown file and build the HTML.
The global environment had objects present when the code in the R Markdown file was run. These objects can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment. Use wflow_publish
or wflow_build
to ensure that the code is always run in an empty environment.
The following objects were defined in the global environment when these results were created:
Name | Class | Size |
---|---|---|
broad_cols | character | 1.7 Kb |
broad_ord | character | 808 bytes |
broad_short | list | 2.1 Kb |
coef_regex | character | 136 bytes |
coloc_f | character | 168 bytes |
cols_fn | function | 402 Kb |
confounders | character | 328 bytes |
disease_cols | character | 864 bytes |
disease_ord | character | 376 bytes |
do_muscat_run | function | 6.7 Kb |
gsea_regex | character | 168 bytes |
gtf_f | character | 168 bytes |
labels_f | character | 168 bytes |
lesion_cols | character | 1.4 Kb |
lesion_ord | character | 680 bytes |
load_labelled_dt | function | 10.7 Kb |
load_meta_dt | function | 25.8 Kb |
load_names_dt | function | 101.2 Kb |
lof_f | character | 232 bytes |
magma_f | character | 136 bytes |
matter_cols | character | 464 bytes |
matter_ord | character | 176 bytes |
nice_cols | character | 1.9 Kb |
outlier_cols | character | 464 bytes |
outlier_ord | character | 176 bytes |
path_dir | character | 136 bytes |
path_names | character | 1.5 Kb |
paths_list | list | 2.3 Kb |
plot_coefficients_scatter | function | 247 Kb |
plot_design_pca | function | 229 Kb |
plot_gsea_dotplot | function | 432.7 Kb |
plot_gsea_results_inter | function | 52 Kb |
plot_gsea_results_intra | function | 61.1 Kb |
plot_logfc_distns | function | 133.1 Kb |
plot_mds | function | 643.9 Kb |
plot_mds_heatmap | function | 265.6 Kb |
plot_n_signif_barplot | function | 247.3 Kb |
plot_n_signif_heatmap | function | 161.9 Kb |
plot_random_effect_pca | function | 811.8 Kb |
plot_top_genes_heatmap_fn | function | 532.6 Kb |
plot_upset | function | 222 Kb |
q | function | 1008 bytes |
render_muscat_results | function | 72.1 Kb |
run_descs | list | 3.6 Kb |
run_muscat_and_gsea | function | 95.9 Kb |
save_dir | character | 136 bytes |
sex_cols | character | 608 bytes |
sex_ord | character | 248 bytes |
soup_dir | character | 136 bytes |
source_cols | character | 896 bytes |
source_ord | character | 408 bytes |
test_ord | character | 1 Kb |
tfs_f | character | 168 bytes |
unique_labs | character | 720 bytes |
unique_ls | list | 712 bytes |
var_cols | character | 2.5 Kb |
var_types | character | 184 bytes |
The command set.seed(20210118)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
To ensure reproducibility of the results, delete the cache directory ms10_muscat_template_broad_cache
and re-run the analysis. To have workflowr automatically delete the cache directory prior to building the file, set delete_cache = TRUE
when running wflow_build()
or wflow_publish()
.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 856df8d. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .DS_Store
Ignored: .Rhistory
Ignored: .Rprofile
Ignored: .Rproj.user/
Ignored: ._.DS_Store
Ignored: ._MS_lesions.sublime-project
Ignored: .log/
Ignored: MS_lesions.sublime-project
Ignored: MS_lesions.sublime-workspace
Ignored: analysis/.__site.yml
Ignored: analysis/figure/
Ignored: analysis/ms02_doublet_id_cache/
Ignored: analysis/ms03_SampleQC_cache/
Ignored: analysis/ms04_conos_cache/
Ignored: analysis/ms05_splitting_cache/
Ignored: analysis/ms06_sccaf_cache/
Ignored: analysis/ms07_soup_cache/
Ignored: analysis/ms08_modules_cache/
Ignored: analysis/ms09_ancombc_cache/
Ignored: analysis/ms09_ancombc_clean_1e3_cache/
Ignored: analysis/ms09_ancombc_clean_2e3_cache/
Ignored: analysis/ms10_muscat_run01_cache/
Ignored: analysis/ms10_muscat_run02_cache/
Ignored: analysis/ms10_muscat_template_broad_cache/
Ignored: analysis/ms10_muscat_template_fine_cache/
Ignored: analysis/ms11_paga_cache/
Ignored: analysis/ms12_markers_cache/
Ignored: analysis/ms13_labelling_cache/
Ignored: analysis/ms14_lesions_cache/
Ignored: analysis/supp06_sccaf_cache/
Ignored: analysis/supp09_ancombc_cache/
Ignored: analysis/supp10_muscat_cache/
Ignored: analysis/supp10_muscat_heatmaps_cache/
Ignored: code/muscat_plan.txt
Ignored: data/
Ignored: figures/
Ignored: output/
Untracked files:
Untracked: analysis/supp10_muscat_heatmaps.Rmd
Untracked: analysis/temp_igll5.R
Untracked: asedrhg.png
Untracked: code/jobs/muscat_job_2021-06-17_broad.slurm
Untracked: code/jobs/muscat_job_2021-06-17_fine_gm.slurm
Untracked: code/jobs/muscat_job_2021-06-17_fine_wm.slurm
Untracked: code/supp09_ancombc.R
Unstaged changes:
Modified: analysis/ms10_muscat_template_broad.Rmd
Modified: analysis/ms10_muscat_template_fine.Rmd
Modified: analysis/ms12_markers.Rmd
Modified: analysis/ms14_lesions.Rmd
Modified: analysis/supp09_ancombc.Rmd
Modified: code/jobs/muscat_job_2021-06-05_broad.slurm
Modified: code/jobs/muscat_job_2021-06-05_fine_wm.slurm
Modified: code/ms09_ancombc.R
Modified: code/ms10_muscat_fns.R
Modified: code/ms10_muscat_runs.R
Modified: code/ms12_markers.R
Modified: code/ms14_lesions.R
Deleted: code/supp08_ancombc.R
Modified: code/supp10_muscat.R
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/ms10_muscat_template_broad.Rmd
) and HTML (docs/ms10_muscat_template_broad.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | ac17711 | Macnair | 2021-06-15 | Split top gene heatmaps by uniqueness |
Rmd | b9b46aa | Macnair | 2021-06-10 | Fix mistake in logFC filtering |
Rmd | 8ccd4e7 | Macnair | 2021-06-08 | Update muscat reports |
Rmd | a58ad15 | Macnair | 2021-06-08 | Update multiple aspects of muscat |
run_descs[run_tag]
$run10
[1] "lesions vs ctrl, GM, glmmtmb-nb, broad celltypes"
print(params)
$pb_f
[1] "output/ms07_soup/pb_sum_broad_2021-06-01.rds"
$subset_spec
$subset_spec$matter
[1] "GM"
$pb_soup_f
[1] "output/ms07_soup/pb_soup_broad_maximum_2021-06-01.rds"
$labels_f
[1] "data/byhand_markers/validation_markers_2021-05-31.csv"
$cluster_var
[1] "type_broad"
$formula_str
[1] "~ lesion_type + sex + age_norm + pmi_cat"
$padj_cut
[1] 0.05
$min_cells
[1] 10
$method_spec
$method_spec$method
[1] "glmmtmb-nb"
$method_spec$random_var
[1] "patient_id"
$filter
[1] "both"
$soup_cut
[1] 0.1
$paths_list
$paths_list$position
[1] "data/gmt_pathways/c1.all.v7.4.symbols.gmt"
$paths_list$curated
[1] "data/gmt_pathways/c2.all.v7.4.symbols.gmt"
$paths_list$mirs
[1] "data/gmt_pathways/c3.mir.v7.4.symbols.gmt"
$paths_list$TFs
[1] "data/gmt_pathways/c3.tft.v7.4.symbols.gmt"
$paths_list$go_bp
[1] "data/gmt_pathways/c5.go.bp.v7.4.symbols.gmt"
$paths_list$hpo
[1] "data/gmt_pathways/c5.hpo.v7.4.symbols.gmt"
$paths_list$immune
[1] "data/gmt_pathways/c7.immunesigdb.v7.4.symbols.gmt"
$paths_list$celltype
[1] "data/gmt_pathways/c8.all.v7.4.symbols.gmt"
$paths_list$hallmark
[1] "data/gmt_pathways/h.all.v7.4.symbols.gmt"
$n_cores
[1] 24
$output_fs
$output_fs$res_f
[1] "output/ms10_muscat/run10/muscat_res_run10_%s.rds"
$output_fs$res_dt_f
[1] "output/ms10_muscat/run10/muscat_res_dt_run10_%s.txt.gz"
$output_fs$ranef_dt_f
[1] "output/ms10_muscat/run10/muscat_ranef_dt_run10_%s.txt.gz"
$output_fs$fgsea_pat
[1] "output/ms10_muscat/run10/fgsea_dt_run10_%s_%s.txt.gz"
$output_fs$mds_dist_ls_f
[1] "output/ms10_muscat/run10/mds_dist_ls_run10_%s.rds"
$output_fs$mds_dist_f
[1] "output/ms10_muscat/run10/mds_dist_run10_%s.rds"
$output_fs$mds_all_f
[1] "output/ms10_muscat/run10/mds_all_dt_run10_%s.txt.gz"
$output_fs$mds_sep_f
[1] "output/ms10_muscat/run10/mds_sep_dt_run10_%s.txt.gz"
$output_fs$xl_f
[1] "output/ms10_muscat/run10/muscat_run10_%s.xlsx"
$output_fs$xl_wide_f
[1] "output/ms10_muscat/run10/muscat_wide_run10_%s.xlsx"
$output_fs$fgsea_xl_f
[1] "output/ms10_muscat/run10/muscat_GSEA_run10_%s.xlsx"
$output_fs$params_f
[1] "output/ms10_muscat/run10/muscat_params_run10_%s.rds"
$output_fs$log_f
[1] "output/ms10_muscat/run10/muscat_log_run10_%s.txt"
$call
run_muscat_and_gsea(run_tag = run_tag, pb_f = pb_f, subset_spec = subset_spec,
pb_soup_f = pb_soup_f, labels_f = labels_f, cluster_var = cluster_var,
labels_dt = labels_dt, formula_str = formula_str, padj_cut = padj_cut,
fgsea_cut = fgsea_cut, fc_cut = fc_cut, min_cells = min_cells,
method_spec = method_spec, filter = filter, soup_cut = soup_cut,
paths_list = paths_list, n_cores = n_cores, output_fs = output_fs)
$time_stamp
[1] "2021-06-17"
$fc_cut
[1] 1
plot_design_pca(pb, params$formula_str)
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
if (mds_flag) {
print(plot_mds(mds_all_dt, pb, labels_dt,
params$formula_str, params$cluster_var))
}
fig.path
you set was ignored by workflowr.
if (mds_flag) {
for (cl in levels(mds_sep_dt$cluster_id)) {
cat('## ', cl, '\n')
print(plot_mds(mds_sep_dt, pb, labels_dt,
params$formula_str, params$cluster_var, cl = cl))
cat('\n\n')
}
}
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
if (mds_flag) {
for (cl in levels(mds_sep_dt$cluster_id)) {
cat('## ', cl, '\n')
dist_cl = .calc_dist_cl(mds_dist, cl)
print(plot_mds_heatmap(dist_cl, pb, params$formula_str, params$cluster_var))
cat('\n\n')
}
}
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
for (what in c('test', 'confounder', 'all')) {
if (what == 'all') {
tmp_dt = copy(stacked_dt)
} else {
tmp_dt = stacked_dt[ var_type == what ]
}
cat('## ', what, ' variables\n')
print(plot_n_signif_barplot(tmp_dt, facet_by = 'cluster_id'))
cat('\n\n')
}
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
print(plot_n_signif_heatmap(signif_dt, params$cluster_var))
fig.path
you set was ignored by workflowr.
Some genes can be significant for multiple comparisons; the plots below how the genes are distributed across all comparisons.
for (cl in levels(signif_dt$cluster_id)) {
cat('## ', cl, '\n')
suppressWarnings(plot_upset(signif_dt, cl = cl))
cat('\n\n')
}
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
The plots below how the genes are distributed across all clusters within the same coefficient.
for (v in levels(fct_drop(signif_dt$test_var))) {
cat('## ', v, '\n')
suppressWarnings(plot_upset(signif_dt, v = v))
cat('\n\n')
}
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
geom_path: Each group consists of only one observation. Do you need to adjust
the group aesthetic?
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
print(plot_logfc_distns(res_dt, params$padj_cut, params$fc_cut, max_fc))
fig.path
you set was ignored by workflowr.
this_type = 'test'
for (how_unique in names(unique_ls)) {
cat('# Top ', how_unique, ' genes, ', this_type,
' variables{.tabset}\n', sep='')
for (cl in levels(top_dt$cluster_id)) {
tmp_dt = top_dt[ unique_var %in% unique_ls[[how_unique]] &
cluster_id == cl & var_type == this_type ]
tb = unique(tmp_dt$type_broad)
if ( nrow(tmp_dt) == 0 )
next
cat('## ', cl, '\n')
hm_obj = plot_top_genes_heatmap_fn(tmp_dt, labels_dt, max_fc,
title = paste(tb, cl, sep=': '))
draw(hm_obj, padding = unit(c(0.5, 0.1, 0.1, 0.1), "in"))
.add_fdr_legend('logfc')
cat('\n\n')
}
}
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
this_type = 'confounder'
for (how_unique in names(unique_ls)) {
cat('# Top ', how_unique, ' genes, ', this_type,
' variables{.tabset}\n', sep='')
for (cl in levels(top_dt$cluster_id)) {
tmp_dt = top_dt[ unique_var %in% unique_ls[[how_unique]] &
cluster_id == cl & var_type == this_type ]
tb = unique(tmp_dt$type_broad)
if ( nrow(tmp_dt) == 0 )
next
cat('## ', cl, '\n')
hm_obj = plot_top_genes_heatmap_fn(tmp_dt, labels_dt, max_fc,
title = paste(tb, cl, sep=': '))
draw(hm_obj, padding = unit(c(0.5, 0.1, 0.1, 0.1), "in"))
.add_fdr_legend('logfc')
cat('\n\n')
}
}
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
for (this_type in c('test', 'confounder')) {
cat('# All GWAS-associated genes, ', this_type,
' variables{.tabset}\n', sep='')
for (cl in levels(top_dt$cluster_id)) {
tmp_dt = top_gwas_dt[ cluster_id == cl & var_type == this_type ]
tb = unique(tmp_dt$type_broad)
if ( nrow(tmp_dt) == 0 )
next
cat('## ', cl, '\n')
hm_obj = plot_top_genes_heatmap_fn(tmp_dt, labels_dt, max_fc,
title = paste(tb, cl, sep=': '))
draw(hm_obj, padding = unit(c(0.5, 0.1, 0.1, 0.1), "in"))
.add_fdr_legend('logfc')
cat('\n\n')
}
}
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
this_type = 'test'
cat('# GSEA results for ', this_type, ' variables{.tabset}\n', sep = '')
for (p in names(paths_list)) {
# restrict to relevant GO terms
cat('## ', p, '\n', sep='')
dt = fgsea_list[[p]] %>% .[var_type == this_type]
if (nrow(dt[ padj < 0.05 ]) == 0)
next
# plot
print(plot_gsea_dotplot(dt, labels_dt, top_n_paths = top_n_paths))
cat('\n\n')
}
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.
fig.path
you set was ignored by workflowr.