egeulgen / pathfindR

pathfindR: Enrichment Analysis Utilizing Active Subnetworks
https://egeulgen.github.io/pathfindR/
Other
178 stars 25 forks source link

term_gene_heatmap() Error in term_genes_df$value #50

Closed choijamtsmunkhzul closed 4 years ago

choijamtsmunkhzul commented 4 years ago

Hello. Thanks for this nice package. But I have encountered some error when i try to use term_gene_heatmap() function. I downloaded this package via github latest development

Here is my workflow:

colnames(input_file) <- c("GENE", "CHANGE", "P_VALUE")
head(input_file)
#       GENE      CHANGE      P_VALUE
#4     Asb13 -0.28602171 0.0661498180

run_pathfindR() were worked well..

Issue: Here is the script:

term_gene_heatmap <- term_gene_heatmap(result_df =input_file_output, 
                                                                         genes_df = input_file, 
                                                                         num_terms = 20,
                                                                          use_description = TRUE,
                                                                          low = "red",
                                                                         mid = "black",
                                                                         high = "green")

But i got following ERROR:

Number of genes provided in input: 767
Number of genes in input after p-value filtering: 317
pathfindR cannot handle p values < 1e-13. These were changed to 1e-13
Could not find any interactions for 27 (8.52%) genes in the PIN
Final number of genes in input: 290
Error in term_genes_df$value[i] <- genes_df$CHANGE[genes_df$GENE == term_genes_df$Symbol[i]] : 
  replacement has length zero

How can i solve this problem?

Thank you.

egeulgen commented 4 years ago

hey @choisama, can you share input_file as an RDS file?

choijamtsmunkhzul commented 4 years ago

hey @choisama, can you share input_file as an RDS file?

Sure here is the input .rds file my_input.zip

Thank you

egeulgen commented 4 years ago

sorry I forgot, can you also share input_file_output please?

choijamtsmunkhzul commented 4 years ago

sorry I forgot, can you also share input_file_output please?

Understood, here is the output.rds file

my_output.zip

Thank you

egeulgen commented 4 years ago

hey @choisama,

I finally figured it out. In term_gene_heatmap, you need to use the same PIN as you did in run_pathfindR. For example, if you used mmu_STRING, you need to set pin_name_path = "mmu_STRING" so the final command should be:

term_gene_heatmap <- term_gene_heatmap(result_df =input_file_output, 
                                       genes_df = input_file, 
                                       num_terms = 20,
                                       use_description = TRUE,
                                       pin_name_path = "mmu_STRING",
                                       low = "red",
                                       mid = "black",
                                       high = "green")

Best, -E