mortonjt / ancomP

Analysis of Composition of Microbiomes
11 stars 2 forks source link

Longitudinal Data Entry Error #3

Open Potts29 opened 7 years ago

Potts29 commented 7 years ago

Hi Jamie,

I am encountering an error (Error: not an unreplicated complete block design) when trying to run ANCOM through shiny. Our dataset consists of microbiome data for a number of mice across multiple rounds of their menstrual cycle. For each mouse we have samples collected at 3 stages of the menstrual cycle across 3 cycles. I listed the menstrual cycle stages as groups (Group1 through Group3) and the mice as the IDs (ID1 through ID 7). Thus my input file (in the subjects on rows OTUs on columns format) is a csv file with columns A through AAA having the OTUs and raw counts for each sample, the second last column containing the groups, and finally the last columns containing IDs. I can successfully run the data when I don't include the ID column (and don't check the box for repeated measures). I would like to run the program to assess potential longitudinal shifts but can't sort out how to properly format my data. I'm not sure if this issue is happening because a given ID (eg. ID1 corresponding to the first mouse) has 3 group 1 samples (representing the samples collected during the 1st stage of the three menstrual cycles the mice were followed across) or if there is something else I need to do to enable the data to run properly. For reference, this error pops up within 5 seconds of starting the ANCOM run with this data set. This is my first time posting this sort of an issue so my apologies if I've left out pertinent details, please let me know if there is anything further that you require to sort this issue out,

Thank you!

mortonjt commented 7 years ago

Hi @Potts29 , this repository doesn't have support for R code. Also, this is actually a little out-dated, the most up-to-date code can be found on scikit-bio

If you don't have any missing data, you can plug in the Friedman-Chisquare test directly into the scikit-bio version to test for your repeated measures. If you are having additional problems with the Shiny app, I'd contact Shyamal Peddada who is the corresponding author for ANCOM.

jelsema commented 7 years ago

Hello @Potts29

I am the one who initially wrote the shiny app for ancom.R. The error that you are receiving stems from the Friedman test, not from ancom.R itself. The R package in its latest form (as far as I am aware) supports to general models: (1) An unreplicated design, wherein each treatment is comprised of independent samples; and (2) A randomized complete block (RCB) design.

The RCB design assumes that there is only one replication of each treatment per block. Your experimental design appears more sophisticated than this - if I am reading your comment correctly, then you have a design that could be called "Randomized blocks with sampling", because each block (mouse ID) contributes more than 1 observation for each treatment (menstrual cycle).

The good news is that I just got off the phone with Shyamal Peddada (whom @mortonjt suggested you contact), and it appears that the R code has been written to accommodate more sophisticated designs (a general mixed model). The nature of the project is somewhat involved, so Shyamal some time ago had someone else (able to devote more time to software development) take over the programming. From what I understand, the plan is to release an updated package with everything incorporated, including into the shiny app, but it is not available as yet. Therefore, to use ANCOM on your data, you appear to have two options:

  1. Use the scikit-bio version that @mortonjt mentioned (assuming that the python version has incorporated the mixed model).

  2. Ask the author of the ANCOM paper, Dr Siddhartha Mandal, for the R code to run the analysis for your experimental design. Siddhartha's personal website (and email) can be found HERE.

Good luck!

Potts29 commented 7 years ago

Hi Jamie and Casey,

I wanted to write to thank you both for your responses! I had to be away from work for a while over the holidays so I hadn't responded but thank you both for your help! I'm trying out the scikit-bio option this afternoon.

Ryan

On 4 January 2017 at 17:03, Casey Jelsema notifications@github.com wrote:

Hello @Potts29 https://github.com/Potts29

I am the one who initially wrote the shiny app for ancom.R. The error that you are receiving stems from the Friedman test, not from ancom.R itself. The R package in its latest form (as far as I am aware) supports to general models: (1) An unreplicated design, wherein each treatment is comprised of independent samples; and (2) A randomized complete block (RCB) design.

The RCB design assumes that there is only one replication of each treatment per block. Your experimental design appears more sophisticated than this - if I am reading your comment correctly, then you have a design that could be called "Randomized blocks with sampling", because each block (mouse ID) contributes more than 1 observation for each treatment (menstrual cycle).

The good news is that I just got off the phone with Shyamal Peddada (whom @mortonjt https://github.com/mortonjt suggested you contact), and it appears that the R code has been written to accommodate more sophisticated designs (a general mixed model). The nature of the project is somewhat involved, so Shyamal some time ago had someone else (able to devote more time to software development) take over the programming. From what I understand, the plan is to release an updated package with everything incorporated, including into the shiny app, but it is not available as yet. Therefore, to use ANCOM on your data, you appear to have two options:

1.

Use the scikit-bio version that @mortonjt https://github.com/mortonjt mentioned (assuming that the python version has incorporated the mixed model). 2.

Ask the author of the ANCOM paper, Dr Siddhartha Mandal, for the R code to run the analysis for your experimental design. Siddhartha's personal website (and email) can be found here: https://sites.google.com/site/siddharthamandal1985/home

Good luck!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mortonjt/ancomP/issues/3#issuecomment-270500130, or mute the thread https://github.com/notifications/unsubscribe-auth/AXim-Ujy6Ab5AjBaPBw6FK783Y4-Ft6aks5rPBdJgaJpZM4LSOUl .

--

Ryan Potts, BSc MSc