**Background:** Frogs are economically important for agricultural ecosystems, but meningitis-like infectious disease (MID) poses a threat. The gut microbiota of frogs plays roles in nutrient cycling and immunity, yet the effects of sex and health on these communities are poorly understood, and the relationship between frog habitat and soil microbes remains unclear. This study aimed to determine how frog sex, health status, and habitat influence symbiotic bacteria and community assembly mechanisms to guide sustainable frog farming and conservation.
**Methods:** Sixteen adult black-spotted frogs (Pelophylax nigromaculata) (8 females, 8 males, 7 months old) were collected from a farm in Xuanzhou District, Anhui Province, China in February 2020. Based on sex and health status (MID infection), they were divided into four groups: male healthy (MH, n=4), female healthy (FH, n=4), male unhealthy (MNH, n=4), and female unhealthy (FNH, n=4). Additionally, soil samples were collected from three habitat types: frog-aggregation soil (AS), native soil (NS), and soybean soil (SS), each with three replicates. Microbial DNA was extracted from gut contents and soil, and the V3-V4 regions of the 16S rRNA gene were sequenced using Illumina MiSeq. Bioinformatic analysis included alpha diversity (Chao1, Shannon, Simpson, Phylogenetic Diversity), beta diversity (NMDS, PERMANOVA, ANOSIM), taxonomic composition, co-occurrence network analysis (Spearman correlations, r>|0.9|, p<0.01), functional prediction (PICRUSt for gut, FAPROTAX for soil), and community assembly analysis (βNTI and RCbray).
**Key Results:** A total of 1,018,720 high-quality sequences were obtained from frog gut samples, yielding 1,214 ASVs. Soil samples contained 4,461 ASVs. Alpha diversity showed no significant differences in gut bacterial richness or Shannon index between sexes or health statuses (t-test, p>0.05). However, beta diversity revealed significant separation: between female and male groups (ANOSIM: Bray-Curtis, r=0.650, p=0.031) and between healthy and unhealthy groups (ANOSIM: Bray-Curtis, r=0.740, p=0.044). Soil bacterial communities also differed significantly among habitats (r=0.942, p=0.005). At the genus level, Ruminococcaceae was significantly enriched in females, while Laribacter was enriched in males (Kruskal-Wallis, p<0.05). Parabacteroides was significantly higher in unhealthy frogs, whereas Odoribacter and Akkermansia were higher in healthy frogs. Co-occurrence network analysis showed that healthy females had more complex networks than healthy males, but diseased males exhibited the greatest network complexity (MNH: 1251 links, 12 modules, modularity 0.911; MH: 440 links, 4 modules, modularity 0.817). In soil, AS had the most complex network (50 nodes, 472 connections, average degree 19.265). Functional prediction (PICRUSt) indicated that healthy frogs had significantly higher relative abundances of Carbohydrate Biosynthesis, Secondary Metabolite Biosynthesis, C1 Compound Utilization and Assimilation, and Nucleic Acid Processing compared to unhealthy frogs. In soil, FAPROTAX showed that SS was enriched in human_pathogens_all, nitrogen_respiration, nitrate_respiration, nitrogen_fixation, and iron_respiration, while AS was enriched in sulfur_respiration, hydrocarbon_degradation, methylotrophy, and dark_sulfur oxidation. Community assembly analysis revealed that deterministic processes dominated in male frogs (average βNTI=2.17) and in MNH (average βNTI=3.15), while stochastic processes dominated in females (average βNTI=0.21) and in both health groups (H and NH). In soil, deterministic processes were more influential in SS.
**Clinical Implications:** This study demonstrates that sex and health status significantly alter the gut microbiota composition, network complexity, and community assembly in captive frogs, with MID infection suppressing metabolic functions. The findings suggest that managing frog sex ratios and health could improve gut microbial stability and resistance to disease. Additionally, different habitat soils (especially soybean soil) shape distinct bacterial communities with enhanced nitrogen cycling functions, which could be leveraged to improve soil fertility and frog farming sustainability. These insights support the development of targeted probiotic or environmental interventions to enhance frog health and agricultural productivity, contributing to sustainable amphibian conservation and farming practices.