Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About using FDR in heatmap #751

Open
Pedramto89 opened this issue Sep 6, 2023 · 3 comments
Open

About using FDR in heatmap #751

Pedramto89 opened this issue Sep 6, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@Pedramto89
Copy link

Story

I did an analysis for cell-to-cell proximity and tried to visualize the results via heatmap built in function in giotto. However, I am not sure how in this code or plot, the FDR has been involved and should be interpreted.

...

Error Message

# Your error message here

Expected behavior

I expected to see a kind of plot that involves the FDR results into the cell-to-cell proximity enrichment scores. I used this code:
"cell_proximity_results <- cellProximityEnrichment(
gobject = my_giotto_object,
spatial_network_name = "kNN_network",
cluster_column = "subcluster_combined",
number_of_simulations = 1000,
adjust_method = "fdr",
set_seed = TRUE,
seed_number = 1234
)"

image

If applicable, add screenshots to help explain your problem.
NOTE: Screenshots of the attempted function call and full error message(s) are helpful for troubleshooting!

System Information

Please replace the following according to your machine:

  • OS: Mac OS 13.5.1 (22G90), Apple M1
@Pedramto89 Pedramto89 added the bug Something isn't working label Sep 6, 2023
@Pedramto89
Copy link
Author

Hi @RubD
I hope you are well. I am still waiting for your response. In the cell proximity analysis in Giotto, I am not sure how we should visualize the statically significant results?
Thnx!

@RubD
Copy link
Collaborator

RubD commented Oct 17, 2023

hi @Pedramto89, the result from cellProximityEnrichment() is a simple list.

The first element of the list is the raw simulation table data and the second element provides a data.table with information about enrichment and significance (e.g. fdr). You can work with the data.table or convert that into a data.frame if you want (e.g. as.data.frame(cell_proximity_results[[2]]) and then filter the results as you wish.

@Pedramto89
Copy link
Author

Thank you for your prompt response @RubD !

I guess you are referring to this:
"> str(cell_proximity_results)
List of 2
$ raw_sim_table:Classes ‘data.table’ and 'data.frame': 35023 obs. of 5 variables:
..$ unified_int: chr [1:35023] "NA--NA" "Malignant_1--Malignant_1" "Malignant_1--Malignant_3" "Fibroblast_2--Malignant_1" ...
..$ type_int : chr [1:35023] NA "homo" "hetero" "hetero" ...
..$ round : chr [1:35023] "original" "original" "original" "original" ...
..$ V1 : num [1:35023] 17096 608 86 274 301 ...
..$ orig : chr [1:35023] "original" "original" "original" "original" ...
..- attr(, ".internal.selfref")=
..- attr(
, "index")= int(0)
.. ..- attr(, "__unified_int")= int [1:35023] 26 52 79 111 135 164 194 223 249 275 ...
$ enrichm_res :Classes ‘data.table’ and 'data.frame': 29 obs. of 13 variables:
..$ unified_int : Factor w/ 29 levels "","Fibroblast_1",..: 29 28 27 26 25 24 23 22 21 20 ...
..$ type_int : chr [1:29] NA "homo" "homo" "homo" ...
..$ original : num [1:29] 17096 608 399 197 475 ...
..$ simulations : num [1:29] 0 186 123 62 151 ...
..$ enrichm : num [1:29] 14.06 1.71 1.7 1.65 1.65 ...
..$ p_higher_orig: num [1:29] 0 0 0 0 0 0 0 0.039 0.384 0.659 ...
..$ p_lower_orig : num [1:29] 1 1 1 1 1 1 1 0.963 0.644 0.356 ...
..$ p.adj_higher : num [1:29] 0 0 0 0 0 ...
..$ p.adj_lower : num [1:29] 1 1 1 1 1 ...
..$ PI_value : num [1:29] 42.18 5.12 5.09 4.95 4.95 ...
..$ int_ranking : int [1:29] 1 2 3 4 5 6 7 8 9 10 ...
..$ first_type : chr [1:29] "Malignant_1" "Fibroblast_3" "Malignant_3" ...
..$ second_type : chr [1:29] "NA" "Malignant_1" "Fibroblast_3" "Malignant_3" ...
..- attr(
, ".internal.selfref")="

As you know, in most biological experiments, the statistical ajd.p.val cutoff is lower than 0.05;however, here, I see p.adj_higher and p.adj_lower which makes me confused about which one should I select as the cutoff?
ALso, for the enrichm, I guess the more is the score, the more probable that two cells are close to each other spatially, and negative values show the opposite, am I correct?
I tried to read the documentation but could not find any useful like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants