# Comparing Two pathfindR Results

The function combine_pathfindR_results() allows combination of two pathfindR active-subnetwork-oriented enrichment analysis results for investigating common and distinct terms between the groups. Below is an example for comparing results using two different rheumatoid arthritis-related data sets (RA_output and RA_comparison_output).

combined_df <- combine_pathfindR_results(result_A = RA_output,
result_B = RA_comparison_output,
plot_common = FALSE)
#> You may run combined_results_graph() to create visualizations of combined term-gene graphs of selected terms

By default, combine_pathfindR_results() plots the term-gene graph for the common terms in the combined results. For not plotting the graph, set plot_common = FALSE.

The function combined_results_graph() can be used to create this graph (using only selected terms etc.) later on. By default, the function creates the graph using all common terms:

combined_results_graph(combined_df) By supplying a vector of selected terms to the selected_terms arguments, you may plot the term-gene graph for the selected terms:

combined_results_graph(combined_df,
selected_terms = c("hsa04144", "hsa04141", "hsa04140")) By default, combined_results_graph() creates the graph using term IDs. To use term descriptions instead, set use_description = TRUE:

combined_results_graph(combined_df,
use_description = TRUE,
selected_terms = combined_df\$Term_Description[1:4])

For changing the layout of the graph ("auto" by default), you may use the layout argument.

For changing how the sizes of the term nodes are determined, you may use the node_size argument. The options are "num_genes" (default) and "p_val" for using the number of significant genes in the term and the -log10(p) value of the term, respectively:

combined_results_graph(combined_df,
selected_terms = c("hsa04144", "hsa04141", "hsa04140"),
node_size = "p_val")
{"ft_lang_label":"__label__en","ft_lang_prob":0.7310998,"math_prob":0.9321137,"size":1631,"snap":"2023-14-2023-23","text_gpt3_token_len":346,"char_repetition_ratio":0.15488629,"word_repetition_ratio":0.0091743115,"special_character_ratio":0.20846106,"punctuation_ratio":0.108,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9724975,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-05-29T04:30:36Z\",\"WARC-Record-ID\":\"<urn:uuid:c723f645-a611-4a52-9290-593e5c093256>\",\"Content-Length\":\"333358\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:70d7a51f-bb8c-440a-bb8e-2961ac69645f>\",\"WARC-Concurrent-To\":\"<urn:uuid:62a5596a-cca7-4137-81e7-947068b81772>\",\"WARC-IP-Address\":\"13.66.202.75\",\"WARC-Target-URI\":\"https://cran.microsoft.com/snapshot/2020-10-11/web/packages/pathfindR/vignettes/comparing_results.html\",\"WARC-Payload-Digest\":\"sha1:ZYFRLUYAW6EHOWOYJAFTGLFNSTSKYFWZ\",\"WARC-Block-Digest\":\"sha1:XUZARVOUFK4ZEJ4LFYS6HWDLBEKA6CQB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224644683.18_warc_CC-MAIN-20230529042138-20230529072138-00097.warc.gz\"}"}