Schematic of experimental setup. Twenty participants were split into two groups (first group: 4 females (pink), 6 males (blue); second group: 5 females, 5 males), with one group starting on vegan diet for 2 weeks and then immediately changing to ketogenic diet (Group A), whereas the other group started with ketogenic diet and changed to vegan diet (Group B). Data (indicated on the bottom) were collected directly before first diet as baseline, and at the end of the first and second diets. For microbiome samples, data were collected on different days (refer to Extended Data Fig. 1k for more details).