Note: markers_df_hhc & markers_df_hth are dataframes from the Seurat::FindMarkers function.
Important: Please ensure that you execute Seurat::FindMarkers in the proper sequence. In Seurat::FindMarkers, the group specified by ident.1 is treated as the test group, while ident.2 is treated as the reference group.
For example, the disease progression follows the order: HC → HIV → HIV/MTB.
markers_df_hth <- Seurat::FindMarkers(object = seurat_obj, ident.1 = "HIV_MTB", ident.2 = "HIV", assay = "RNA")
markers_df_hhc <- Seurat::FindMarkers(object = seurat_obj, ident.1 = "HIV", ident.2 = "HC", assay = "RNA")The test dataset and corresponding script are located in ./data/*.rds and ./sample_data.R, respectively. Simply running sample_data.R will reproduce the exact plot shown in this repository.
source("define_functions.R")markers_df_common <- common_de_marker_selection(
de_list_1 = markers_df_hhc,
de_list_2 = markers_df_hth,
suffix_list = c("_hhc", "_hth"),
xtitle = "LogFC (HIV vs HC)",
ytitle = "LogFC (HIV_MTB vs HIV)",
plot_title = "Common Gene LogFC Distribution among Three Groups"
)
print(markers_df_common$plot)mart <- biomaRt::useMart("ensembl", dataset = "hsapiens_gene_ensembl")
converted_common_markers <- common_de_geneid_converter(
common_de_list = markers_df_common$common_markers, mart = mart
)common_enrich <- common_markers_enrichment(converted_common_markers)Hint: You might consider integrating additional databases at this stage, such as REACTOME and WikiPathways, among others.
p1 <- common_plot_kegg_results(
common_enrich,
hjust = 1.7,
title = "KEGG for CD4 Naive in four quadrants"
)
print(p1)print("Please consider cite the packages 'clusterProfiler' and 'biomaRt' used in this repository.")
