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

Question about making amalgam plots #1

Open
Marcel-TK opened this issue Jan 14, 2021 · 3 comments
Open

Question about making amalgam plots #1

Marcel-TK opened this issue Jan 14, 2021 · 3 comments
Labels
helpful question Further information is requested

Comments

@Marcel-TK
Copy link

Dear Dr Quinn,
I am using your package, amalgam to analyze microbiome data and really would like to thank you for making it easy to run. However I would love if possible that you provide guidance for the interpretation of the output (https://github.com/Marcel-TK/Caecilians-microbiome-analysis/blob/main/plot_amalgam_Cante_j.pdf. I have read the original article of amalgam and visited the github repository of the package but still have some questions unanswered. First, do we know what are the group of variables at each corner of the simplex (var1, var2 and var3)? Second is there a way to tell on the plot which samples are yellow and which ones are purple ? Third, How can one replicate figure 3 in the supplement material; more generally can one extract the results and customize the plots ? These are some of the questions that answering would help me understand my results and describe them as well.

@tpq
Copy link
Owner

tpq commented Jan 15, 2021

Hello Marcel,

Thanks for your interest in the package! I'll try to answer these questions one at a time,

First, do we know what are the group of variables at each corner of the simplex (var1, var2 and var3)?

The figure is intended to serve as a "dashboard" to monitor the progress and results of the genetic algorithm. I recommend you extract the data from the object to determine which variables are in the corners (discussed below).

Second is there a way to tell on the plot which samples are yellow and which ones are purple ?

My answer here is similar to the first -- it is perhaps easiest to extract the data from the object and inspect manually to determine which samples are which (discussed below).

Third, How can one replicate figure 3 in the supplement material; more generally can one extract the results and customize the plots ?

The answer to all 3 questions are within the amalgam object. You can look at what meta-data is saved using the str function:

library(amalgam)
x <- randAcomp(100, 10)
A <- amalgam(x, n.amalgams = 3)
str(A)

What you want is the data stored in the $amalgams slot, which you can access via:

A$amalgams

A boxplot of this will get you something resembling Supplemental Figure 3:

boxplot(A$amalgams)

These data are also used to produce ilr-PCA plots. A non-ggplot2 version would like:

library(compositions)
A_ilr <- ilr(A$amalgams)
pca <- prcomp(A_ilr)$x
plot(pca[,1], pca[,2])

But of course you can customize however you'd like!

@tpq tpq added question Further information is requested helpful labels Jan 15, 2021
@tpq tpq changed the title Interpreting amalgam output and furthering microbiome data analysis Question about making amalgam plots Jan 15, 2021
@Marcel-TK
Copy link
Author

Hi Thom,
Thank you for providing these answers, I find them useful and I can now interact with the amalgam output the way I wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
helpful question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants
@tpq @Marcel-TK and others