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

getCrossAssociation outputs #651

Open
antagomir opened this issue Oct 17, 2024 · 1 comment
Open

getCrossAssociation outputs #651

antagomir opened this issue Oct 17, 2024 · 1 comment

Comments

@antagomir
Copy link
Member

This issues suggests finding a way to provide user friendly output tables.

Let us run cross-association:

data(HintikkaXOData)
mae <- HintikkaXOData
mae[[1]] <- mae[[1]][1:20, 1:10]
mae[[2]] <- mae[[2]][1:20, 1:10]
mae[[1]] <- mae[[1]][rowSds(assay(mae[[1]])) > 0, ]
mae[[1]] <- transformAssay(mae[[1]], method = "rclr")
result <- getCrossAssociation(mae, method = "pearson", assay.type2 = "nmr", test.signif=TRUE)
head(result, 5)

This generates the following table:

               Var1     Var2         cor         pval        p_adj

CVJT01000011.50.2173 Butyrate -0.15394918 6.711047e-01 0.9882135995
AYSG01000002.292.2076 Butyrate -0.17674170 6.252300e-01 0.9882135995
CCPS01000022.154.1916 Butyrate 0.43730668 2.062956e-01 0.9882135995
EU622687.1.1587 Butyrate 0.06046832 8.682081e-01 0.9882135995
KY646024.1.1591 Butyrate 0.96598301 5.622406e-06 0.0002783091
...

Now, this is long format of the associations. Also wide format is possible with mode="matrix". However, that could be obtained separately for the different columns only.

When preparing material for publication, we sometimes want to show the effect size and FDR in the same table, like effect sizes first, then FDR in parentheses:

  X                    Y       

A 1.5 (0.05) 0.9 (0.001)
B 0 (0.8) 0.3 (0.1)

Ideally, there is function (already in some package?) that allows one to merge the effect sizes and p-values into a single table presentation like this? If not, we could think about providing such utility. Simple but pragmatic. It probably should be an independent function, rather than one more option in the already complex getCrossAssociation function.

@TuomasBorman
Copy link
Contributor

If there is existing package that works similarly to stats::cor (takes matrix as input and outputs similar output), then this should be already possible with association.fun parameter --> should be checked

res <- getCrossAssociation(mae, method = "pearson", assay.type2 = "nmr", association.fun = stats::cor)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants