Sustainable municipal wastewater treatment using an innovative integrated compact unit: microbial communities, parasite removal, and techno-economic analysis

The upflow anaerobic sludge blanket (UASB) reactors rely on bacterial communities to break down pollutants in wastewater (municipal or industrial). In this study, a novel combination of UASB followed by aerobic treatment has been proposed for the treatment of municipal wastewater focusing on bacterial communities using high-throughput sequencing and parasite removal in this novel combination of reactors. Moreover, economic estimation of the compact unit composed of two overlapping UASB reactors, followed by a downflow hanging non-woven fabric (DHNW) reactor, the anaerobic baffled reactor (ABR), and chlorine unit was investigated in this study based on community populations of 1000 and 10,000 inhabitants, with a municipal plant capacity of 54,000 and 540,000 m3/year. Cost estimation was conducted based on two scenarios, one considering the contingency cost and auxiliary facility, and the other excluding them. Non-metric multidimensional scaling (nMDS) revealed that the treatment stages structured the microbial communities. Proteobacteria was the most prevalent phylum in all treatment stages, followed by Bacteroidota in most stages. Firmicutes and Actinobacteria were also present in significant amounts. The treatment system achieved from 40 to 66.67% removal of parasites (parasitic nematode, Cryptosporidium, and microsporidia). Redundancy analysis (RDA) indicated a strong positive correlation between chemical and biological oxygen demand (COD/BOD) with Campylobacterales and could be used as a bioindicator of treatment performance. These findings can inform the development of more efficient and sustainable wastewater treatment systems that take into account microbial ecology and economic considerations.


Introduction
Water shortages caused by industrialization and urbanization gain attention to the reuse of treated wastewater (Bao and Fang 2012).Furthermore, 4.2 billion people lack access to safely managed sanitation, leaving 2 billion people to consume water contaminated by human feces (WHO 2023).These factors may contribute to the spread of diseases like cholera, dysentery, diarrhea, and typhoid in inhabitants living in these areas.The majority of developed countries have access to clean water and control wastewater pollution.As stated before in the literature wastewater management remains a challenge in low-and middle-income nations, particularly in rural and pre-urban areas (Weerasekara 2017;Hassan et al. 2021).
The produced wastewater from rural areas should be treated before direct discharge to save human health and control environmental pollution (Kamika et al. 2021;Hassan et al. 2022).Rural wastewater treatment has become a growing source of concern (Wu et al. 2011).Moreover, wastewater treatment plants are a significant investment because of their high capital, operating, and maintenance costs.Poor wastewater treatment plant functioning is a result of constrained municipal budgets, a lack of local competence, and a lack of finance in developing nations (Ćetković et al. 2022).
Centralized wastewater treatment systems, which use advanced collection and treatment methods, are typically designed to handle large volumes of wastewater (Hellal et al. 2021;Abdo et al. 2023).As a result, building such systems in peri-urban or small-town communities in low-income countries could put a financial burden on the local population (Chirisa et al. 2017;Liang and Yue 2021).In addition, the establishment of centralized sewage treatment plants in rural areas has many limitations.This requires a large number of pumps, sewerage networks, using of massive pipelines, large excavations, and many necessary access hatches for centralized systems.Governments typically operate these systems for collecting and treating large quantities of wastewater for a large population (Wilderer and Schreff 2000;Angelakis et al. 2022).
Decentralized systems are regarded as the ultimate solution for wastewater treatment in remote villages or towns with low population density.Decentralized systems are easier to use and more affordable than centralized systems, which require significant capital investment in sewerage infrastructure (Capodaglio 2017;Ibrahim et al. 2020;Abd-Elmaksoud et al. 2021).Moreover, the United States Environmental Protection Agency (USEPA) mentioned that decentralized wastewater treatment systems are more suitable for low-density populations with varying site conditions and these systems are more economical than centralized wastewater treatment plants (El-Khateeb et al. 2019).
There are several decentralized wastewater treatment systems such as septic tanks and constructed wetlands have been applied before (Abdel-Shafy et al. 2009;Abdel-Shafy and El-Khateeb 2013).The septic tank is the most commonly used as a decentralized wastewater system exclusive for developing countries (El-Khateeb and El-Gohary 2003;El-Khateeb et al. 2019).If septic tanks are not properly maintained, effluent can overflow into the neighborhood and have a negative influence on local health (Fizer et al. 2018).In turn over for constructed wetland systems, these systems need minimal operation and a small land area, they are inexpensive to operate and construct but still have some drawbacks such as their need for regular maintenance, continuous influent supply, affected by seasonal variations, and might be destroyed by overloads of ammonia and solids (Abdel-Shafy and El-Khateeb 2013;Abdel-Shafy et al. 2017).
The UASB reactors have been commonly used for wastewater treatment, especially in many tropical countries as low-cost technology.These systems have several advantages including; low operation costs, producing low sludge, high pollutants removal efficiencies, and able to produce methane that could be used as bioenergy (Abdel-Shafy et al. 2009;Chernicharo et al. 2015;Vassalle et al. 2020).The UASB process has a number of drawbacks, such as sensitivity to influent solids (which are ineffectively removed and prevent the formation of the granular bed), inability to produce discharge-quality effluent in some countries (100 mg COD/L), difficulty operating at lower temperatures (30 °C), and inability to reactively remove nitrogen or phosphorus, and difficulty managing pH for high-strength wastewaters (Rattier et al. 2022).Depending on the treatment stage and the efficiency of the system, bacterial concentrations can vary widely.For instance, secondary treated effluent might contain bacteria levels ranging from 10 5 to 10 7 gene/mL, whereas more advanced treatment processes can reduce this to less than 10 2 gene/mL (Wéry et al. 2008).Various microbial communities play crucial roles at different stages of wastewater treatment.In the primary and secondary stages, bacteria such as Proteobacteria, Bacteroidetes, and Firmicutes are predominant and help break down organic pollutants (Chen et al. 2022b).Aerobic bacteria oxidize organic matter into carbon dioxide and water (Demirbas et al. 2017), while anaerobic bacteria can convert organic matter to methane and carbon dioxide (Wilkie 2005).Nitrifying bacteria transform ammonia into nitrate, and denitrifying bacteria convert nitrate to nitrogen gas (Yang et al. 2016).The collective metabolic activities of these communities effectively reduce the pollutant load in wastewater.The integration of a DHNW system with UASB significantly enhanced wastewater treatment quality, achieving removal rates of 90%, 78%, 95%, and 72% for COD, BOD, total suspended solids (TSS), and TN, respectively.Moreover, there was a notable 3 log10 reduction in coliform levels (El-Khateeb et al. 2018).A combined approach using UASB/ DHS (downflow hanging sponge) and DHNW systems for municipal wastewater treatment resulted in over 90% removal of key pollutants, including COD and BOD, and more than 80% removal of total nitrogen (TN) (Zhao et al. 2021).Therefore, in this study, an innovative system DHNW will be used after the UASB system to improve the treated wastewater effluent.Accordingly, the main objectives of this study were to (1) assess the performance of the innovative compact unit (CU) composed of UASB, DHNW, and ABR on the treatment of raw sewage, (2) study the degradation efficiency of sewage in the CU, (3) characterize by amplicon sequencing, the microbial community, and identify the key microbial community in the different stages of sewage treatment and (4) study the techno-economic approach for the application of the CU.

The compact unit
The structure of the compact unit for wastewater treatment is as follows; the primary treatment is two overlapping UASB reactors, followed by a DHNW reactor (secondary treatment) and the ABR (tertiary treatment).The effluent of the ABR step is mixed with chlorine and represents the final effluent of the CU.The dimensions of the compact unit are 2.0 × 2.0 × 1.0 m in length, width, and depth, respectively.The dimensions of the UASB reactors are 2 × 1.25 × 1.0 m in length, width, and depth, respectively.The detention time (DT) was kept constant at 5 h in the UASB chamber.One more modification for the compact unit in this study period was that the new upper compartment was combined with the compact unit.The upper compartment is the container for the chlorine used for the disinfection of the final treated effluent in the middle of the piffled reactor.The chlorine container and the middle of the ABR reactor are connected with a controlled dropper (Figure S1).Figures S2  and S3 illustrate the process flow sheet and plant layout of the anaerobic (UASB)/aerobic (DHNW) /anaerobic (ABR) bioreactor compact unit wastewater treatment for 1000 and 10,000 persons used in the economic studies.Moreover, Table S1 shows the operating conditions of the compact unit.The operating conditions did not change during the period from January to December 2022.One sample from each stage was processed for microbial community analysis.The sampling plan considered all the treatment stages and a round of 42 batches of samples were collected during the period extended from January to December 2022.

DNA extraction, PCR amplification, and 16S rRNA amplicon sequencing
An analysis was performed on prokaryotic communities using a portion of all water samples (~ 500 mL) that were obtained and filtered through 0.22 μm membrane filters (Millipore, Bedford, MA, USA) (Gad et al. 2020).The filters were stored at − 20 °C until DNA extraction.DNA has been extracted from the filters by using the DNeasy PowerLyzer PowerSoil Kit (QIAGEN, USA), according to the manufacturer's instructions.To amplify the V4-V5 region of prokaryotic 16S rRNA genes, a universal primer pair consisting of 515F (5′-GTG YCA GCM GCC GCG GTA-3′) and 907R (5′-CCG YCA ATT YMT TTR AGT TT-3′) was utilized (Quince et al. 2011).The PCR amplification cycles for 16S rRNA genes consisted: of initial denaturation at 95 °C for 5 min, followed by 25 cycles of 95 °C for 30 s, 55 °C for 30 s, and 72 °C for 90 s, and a final extension at 72 °C for 10 min.Each PCR reaction was performed in a 25-μL reaction volume, consisting of 12.5 μL of the AmpliTaq ™ Gold PCR Master Mix (2 ×) (Applied Biosystems, CA, USA), 0.4 μM of each primer and ~ 20 ng DNA template.Once the PCR product was obtained, it was purified and quantified using a previously described method (Hu et al. 2017).The purified PCR products were sequenced on an Illumina MiSeq platform (Illumina Inc., San Diego, CA, USA) with a paired-end approach (2 × 250 bp).

Sequence analyses
The DADA2 v1.1.3software was utilized to denoise and assemble the raw paired-end reads, as well as cluster high-quality reads into amplicon sequence variants (ASVs) at 100% sequence identity, as previously described on the website (https:// benjj neb.github.io/ dada2/ tutor ial.html) (Callahan et al. 2016).Taxonomic assignment of the 16S rDNA reads was carried out using SILVA v138 by the RDP classifier (Klindworth et al. 2013;Quast et al. 2013).In order to standardize the uneven sequencing effort, all samples were subsampled randomly to match the smallest library size of 64,000 reads.The resulting analysis retained 10,188 prokaryotic ASVs after rarefying.

Parasite analysis
The parasite analysis was conducted on all collected batches.The sample volume for helminths ova quantification and molecular detection of protozoan pathogens was 5 L and 1 L per sample, respectively.Parasitic nematode ova were detected microscopically after floatation using zinc sulfate (Moodley et al. 2008).The protozoan pathogens investigated in this study were Cryptosporidium spp.and microsporidia.The used primers for microsporidia were PMP1, and PMP2, Cry-9, and Cry-15 (Spano et al. 1997;Fedorko et al. 2001).PCR was performed in a 25-µL using a Cosmo PCR red master mix (Willowfort company, Birmingham, UK) to detect the target protozoa in the samples.The reaction mixture contained 5 µL of the DNA template, 12.5 µL of the master mix, 0.5 µL of forward and reverse primers, and 6.5 µL of nuclease-free water.The predenaturation step was performed at 95 °C for 5 min, followed by 35 cycles of 30 s at 95 °C, 30 s at 55 °C, and 45 s at 60 °C.As a negative control, nucleasefree water was also included in each test.

Statistical analysis
The significance of differences in physicochemical parameters among the treatment stages of the treatment system was tested using permutational multivariate analysis of variance (PERMANOVA) and analysis of similarity (ANOSIM).The structure of prokaryotic communities between different treatment stages was characterized using nMDS.To examine the relationship between bacterial communities and physicochemical factors in the treatment system, RDA was employed.The predicted ecological and metabolic functions of the prokaryotic communities were inferred from taxonomy by a versatile Python script (collapse_table.py)and the FAPROTAX database (Louca et al. 2016).Statistical analyses and visualization were conducted using Origin (Pro) 2021 (OriginLab Corporation, Northampton, MA, USA), PRIMER v.7.0.21 (Quest Research Limited, Auckland, New Zealand), and R v4.2.2 (https:// www.r-proje ct.org/).

The performance of the sewage treatment via the compact unit
The results of PERMANOVA (p < 0.001) and ANO-SIM (p < 0.001) revealed that the treatment stages had a great influence on the variation of the physicochemical parameters.pH ranged from 6.8 to 7.8, confirming that the treatment sequence was standard for all stages of the proposed treatment.The average values of influents for COD, BOD, TSS, TKN, and TP were 387, 296, 140, 38.6, and 6.2 mg/L and these values reduced to 136, 99, 41, 34, and 5 mg/L, respectively, after anaerobic treatment and further reduced to 58, 25, 13, 15, and 3.9 mg/L after aerobic treatment (Fig. 1).The overall removal percentages corresponded to 85, 91, 90.7, 60.5, and 37% respectively, after all steps of the treatment.The current results are comparable with the results of Mahmoud et al. (2009), who used a combination of two systems for the treatment of municipal wastewater, the first anaerobic treatment and the second aerobic treatment.The removal of COD and BOD in that study reached 89 and 95%.However, our system is more economical, as shown in the following results.The results from our study revealed a significant positive correlation between pollutants removal (e.g., BOD, COD, and TSS) and temperature (Fig. 2).This implies that the efficiency of the integrated biological treatment system was heightened during the summer.For instance, the average removal rates for COD, BOD, TSS, and TKN in summer were 91.95%, 94.18%, 96.82%, and 57.22% respectively.In contrast, during winter, the corresponding removal rates for these parameters were 88.38%, 92.19%, 93.69%, and 53.69%.
Temperature plays a pivotal role in influencing microbial diversity within wastewater.It is well understood that temperature fluctuations can often be attributed to climatic conditions, sampling intervals, and the duration of daylight.Previous research has underscored the intricate interplay between organic pollutants and microorganisms, which is modulated by temperature variations (Sun et al. 2021;Muloiwa et al. 2023).In a study from the same area as ours, recorded wastewater temperatures ranged from 19.8 °C in winter to 34.8 °C in summer.Additionally, the summer months exhibited elevated concentrations of coliform and bacterial pathogens (El-Liethy et al. 2022).Consistent with this, our study found higher coliform concentrations and a reduced rate of coliform removal.

Richness, diversity, and taxonomic complexity of the bacterial community through the whole treatment steps
In this study, nMDS based on Bray-Curtis similarity index was carried out to characterize the microbial community in different wastewater treatment processes.The results showed an apparent dissimilarity of bacterial community composition among inlet, outlet, and sludge samples.Moreover, there was an obvious similarity in bacterial community composition in anaerobic and aerobic wastewater treatment processes as shown in Fig. 3.This similarity could be attributed to the aerobic stage following the anaerobic one.The Venn diagram analysis was conducted to identify the unique and shared ASVs in each treatment step of the compact wastewater treatment unit (Fig. 4).A total of 10,188 ASVs were detected across all wastewater treatment steps, with 1880, 1389, 1455, 2507, and 2318 unique ASVs in the inlet, anaerobic, aerobic, outlet, and sludge samples, respectively.The analysis revealed that 623 ASVs (6.12%) were shared between the anaerobic and aerobic stages, and only 7 ASVs (0.07%) were shared among the inlet, anaerobic, and aerobic stages.Only 3 ASVs (0.03%) were shared between the outlet and sludge samples (Fig. 4).Additionally, a small number of ASVs (0.02%) was found to be present among the anaerobic, aerobic, and outlet stages, as well as between the aerobic stage and sludge samples, while the fewest ASVs (0.01%) were observed between the inlet and anaerobic stages (Fig. 4). Figure 5A illustrates the distribution of bacterial phyla in different treatment stages, including the inlet, anaerobic, aerobic, outlet, and sludge samples.The most prevalent phyla were Proteobacteria, followed by Bacteroidota in the inlet, anaerobic, and outlet samples (Fig. 5A).Ye et al. (2017) also reported that Proteobacteria were the most abundant phylum in the anaerobic/anoxic/aerobic process of domestic and food wastewater samples, while Zeng et al. (2022) found that Proteobacteria and Bacteroidetes were the most abundant phyla in oxidation ditches of domestic wastewater.In addition, Zeng et al. (2022) reported that Proteobacteria and Bacteroidetes were the most common phyla in industrial wastewater treatment plants using anoxic/ oxic (AO) and anoxic/oxic membrane bioreactor (AO-MBR) units.It was noted that Proteobacteria and Bacteroidetes were the dominant bacteria in the anaerobic system used for biogas production from farm wastes (Tawfik et al. 2021).
The provided Fig. 5B shows the relative abundances of the top 10 microbial orders in different wastewater treatment stages.The anaerobic inlet stage has the highest relative abundance of Bacteroidales (19.78%), while the aerobic and outlet stages have the highest relative abundance of Burkholderiales (> 18.59%).This suggests that the two stages may have different microbial communities with different functions in the treatment process.These findings are consistent with previous studies that have shown significant changes in microbial communities during the wastewater treatment process (Gu et al. 2022).It is important to note that the microbial communities in the wastewater treatment system are dynamic and can be influenced by various factors such as the type of organic matter, temperature, pH, and hydraulic retention time (HRT).In the inlet of the UASB system, the most abundant bacterial community orders were Fusobacteriales, Rhodobacterales, Lachnospirales, and Enterobacterales.During anaerobic wastewater treatment, the dominant orders were Desulforvibrionales, Veillonellales, Selenomonadales, Synergistales, Eubacteriales, Peptostreptococcales, Lactobacillales, Bacteroidales, and Oscillospirales.In the aerobic wastewater treatment stage, the most common orders were Thermomicrobiales, Propinibacteriales, Halothiobacillales, Xanthomonadales, and Rhizobiales (Fig. 6).Zhao et al. (2014) reported Rhizobiales and Burkholderiales as the most abundant orders in aerobic tanks of wastewater treatment plants in 8 Chinese cities.In the present study, the most frequent orders in the sludge sample were Frankiales, Corynebacteriales, Clostridiales, and Micrococcales (Fig. 6).It was observed that the top 10 dominant orders in activated sludge of municipal wastewater treatment plants were determined as Sphingobacteriales, Anaerolineales, Actinomycetales, Clostridiales, Burkholderiales, Caldilineales, Rhizobiales, Acidimicrobiales, TM7_order_IS, and Rhodocyclales (Zhao et al. 2014).Similar studies found Hydrogenophilales and Pseudomonadales, respectively, as the dominant orders in sludge from wastewater treatment plants (Meng et al. 2016;Ban et al. 2022).
RDA is a multivariate statistical technique that can be used to identify correlations between microbial communities and physicochemical parameters in wastewater treatment systems (Muyzer et al. 1993).In a study by Wu et al. (2011), RDA was applied to investigate the microbial community composition and its relationship with the performance of a UASB reactor treating pharmaceutical wastewater.The study found that Campylobacterales, a group of Gram-negative bacteria, showed a strong positive association between COD and BOD in inlet, anaerobic and anerobic stages (Fig. 7).These parameters are commonly used to assess the organic loading and treatment performance of wastewater treatment systems (Tchobanoglus et al. 2003).The positive correlation between Campylobacterales and COD or BOD suggests that these bacteria may serve as bioindicators of treatment performance in UASB reactors.Previous studies have also reported the presence of Campylobacterales in various wastewater treatment systems, including activated sludge and anaerobic digestion (Qiao et al. 2013).The ability of Campylobacterales to degrade complex organic compounds and their resistance to various environmental stresses, such as high salinity and low pH, may explain their presence in wastewater treatment systems (Gupta et al. 2018).The RDA analysis indicated that nitrate and nitrite denitrification groups were correlated negatively with NO 2 -N and NO 3 -N (Fig. 8).Denitrification is a process by which bacteria convert nitrate (NO 3 -N) and nitrite (NO 2 -N) into nitrogen gas (N2).A negative correlation with NO 2 -N and NO 3 -N suggests that as denitrification bacteria thrive, the levels of these nitrogen compounds decrease.This aligns with the role of Others refer to the less contributed taxa and unclassified taxa denitrifying bacteria in reducing nitrogen compounds (Huang et al. 2017).The aerobic chemoheterotrophy displayed a positive correlation with TSS, COD, and BOD (Fig. 8).Heterotrophic bacteria exhibit the ability to utilize various organic compounds as sources of energy.These compounds encompass carbohydrates, fatty acids, and amino acids (Mara and Horan 2003).Furthermore, the function groups of bacteria including nitrate respiration and nitrogen respiration, and nitrate reduction demonstrated a positive correlation with NH 3 -N and TKN (Fig. 8).The conversion of nitrate to diverse gaseous nitrogen forms (e.g., nitric oxide, nitrous oxide), subsequently lost to the atmosphere, takes place under conditions characterized by limited oxygen.During this process, anaerobic bacteria utilize nitrate in respiration, facilitated by the presence Fig. 6 Heatmap for the microbial community at order level, the highly contributed orders Fig. 7 RDA showed the relationship between bacterial community and physicochemical factors in the treatment system Fig. 8 RDA showed the relationship of most important bacterial functional groups and physicochemical factors in the treatment system of a carbon source such as organic matter (Tiedje et al. 1984).
The network analysis conducted in this study revealed a positive correlation between several different phyla in the integrated treatment systems.Specifically, Actinobacteriota, Bacteroidota, Campylobacteriota, Chloroflexi, Desulfobacterota, Firmicutes, Fusobacteriota, and Proteobacteria were found to be positively correlated with each other (Fig. 9).This result suggests that these bacterial phyla may work in synergy to degrade and remove pollutants in the treatment systems.Similar findings were reported in a study by Chen et al. (2022a, b), which found that the microbial community structure in an integrated vertical-flow constructed wetland was highly complex and composed of multiple phyla that were positively correlated with each other.The authors suggested that this positive correlation between different bacterial phyla may be due to the complementary metabolic functions of different microorganisms, leading to the efficient removal of pollutants from wastewater.Overall, the positive correlation between different bacterial phyla in the integrated treatment systems suggests that these systems may be highly effective in removing pollutants from wastewater, as multiple microbial communities work together to achieve this goal.
The study reports the efficacy of an integrated wastewater treatment system in removing parasitic nematodes, Cryptosporidium, and microsporidia.The results show that the system was able to achieve removal efficiencies of 66.67%, 62.5%, and 40.5% for parasitic nematodes, Cryptosporidium, and microsporidia, respectively (Fig. 10).These findings are consistent with previous studies that have demonstrated the effectiveness of UASB-based systems in removing parasitic organisms from wastewater (Jimenez 2007;Yaya-Beas et al. 2015).The detection of Cryptosporidium in the inlet samples is concerning, as this parasite is known to cause gastrointestinal illness in humans and animals.The fact that the number of positive samples decreased from 8 to 3 in the outlets suggests that the UASB + DHNW + ABR system was effective in removing this pathogen from wastewater.Similarly, the reduction in the number of positive samples for microsporidia in the outlets also indicates the system's effectiveness in removing this parasite.The presence of Ascaris ova in inlet and outlet samples is consistent with previous studies that have reported the prevalence of this parasite in wastewater (Yaya-Beas et al. 2015;Nasr et al. 2019).The fact that the number of positive samples decreased from 6 to 2 in the outlets suggests that the integrated system was effective in removing this parasite.Overall, the results of this study suggest that the integrated wastewater treatment system (UASB + DHNW + ABR) is effective in removing sitic nematodes, Cryptosporidium, and microsporidia Fig. 9 Co-occurrence network using ggClusterNet R showing the correlation between bacterial ASVs in wastewater treatment system.A connection stands for a strong (Spearman's r > 0.8) and significant (adjusted p value < 0.001) correlation.The nodes represented the top 50 ASVs and their sizes showed their mean abundance from wastewater.However, further studies are needed to investigate the effectiveness of the system in removing other pathogens and to evaluate the long-term sustainability of the system.

Economic assessment
The techno-economic evaluation of the industrial scale wastewater treatment plant according to the definition of capital cost estimation (McCabe et al. 1993;Sinnott et al. 2005), the economic estimation in this study is classified as ''study estimate'' .It is based on the process description and sizing of major process equipment as will be discussed in the following results.The anaerobic/aerobic bioreactor compact unit was based on the following assumptions: Community population 1000-and persons water consumption 150 L/day (54 m 3 /year), wastewater plant capacity 54,000 and 540,000 m 3 /year (150 and 1500 m 3 /day), operating days for the wastewater treatment plant was assumed to be 360 days/year, a lifetime for equipment was assumed to be 25 years, treated wastewater sell price, 0.2 $/m 3 .

Total capital investment (TCI)
The total capital investment for the community population of 1000 and 10,000 persons in the compact unit is shown in Table 1.The fixed capital investment (FCI) is defined as the investment needed to make the plant ready for starting-up and it includes the costs of equipment; wastewater storage tank, screen, water pumps, the compact unit, treated water storage tank, land, field measurement instrument, piping, and installation cost.The cost estimation was conducted based on two scenarios, the first one considering the contingency cost and auxiliary facility, and the second one excluding the contingency cost and auxiliary facility.The total capital investment for the community population of 1000 and 10,000 persons including contingency costs and auxiliary facilities are $51,147 and $159,093, respectively, while the total capital investment for the community population of 1000 and 10,000 persons excludes contingency costs and the auxiliary facility is $43,733 and $134,800, respectively.

Total operating cost (TOC)
Tables 2 and 3 illustrate the overall operating costs for communities of 1000 and 10,000 people, divided into direct and indirect operating costs that include and exclude operational supplies, laboratory charges, indirect manufacturing costs, and general expenditures.The direct manufacturing cost (DMC) includes energy, labor, maintenance, operating supplies, and laboratory charges.
The indirect manufacturing costs include overhead, local taxes, and insurance.The general expenses include administration and research and development costs.The total cost includes the total operating cost (direct and indirect manufacturing costs and general expenses) and depreciation.For the labor cost, it was estimated at 133 $/month; the electricity cost was 0.1 $/KW h, and the treated water price is 0.2 $/m 3 .

Cost analysis
According to the cost analysis, the total cost of wastewater treatment for communities of 1000 and 10,000 people, including maintenance, operating supplies, laboratory charges, indirect operating costs, and general expenses, is $9,916 and $17,919, respectively, and the cost of a cubic meter of treated wastewater is $ 3.13 and $ 0.6.The profit for 1000 community populations is not feasible (− $598).However, the profit for 10,000 community populations is $85,223, and the payback period for 10,000 community populations is 1.87 years (22.44 months).
While the total cost of community populations of 1000 and 10,000 persons, excluding maintenance, operating supplies, laboratory charges, indirect operating costs, and general expenses are $7089 and $10,739, respectively, the cost of a cubic meter of treated wastewater is $0.13 and $0.02, respectively, the profit for community populations of 1000 and 10,000 is $3711 and $97,261, the payback period of community populations of 1000 and 10,000 is 11.79 years (141.5 months) and 1.39 years (16.68 months).

Conclusion
The compact integrated wastewater treatment unit was effective in reducing the physicochemical parameters of the wastewater with removal percentages of 85, 91, 90.7, 60.5, and 37% for COD, BOD, TSS, TKN, and TP, respectively.The microbial community composition varied among the different treatment stages, and a clear dissimilarity was observed between inlet, outlet, and anaerobic sludge samples.Proteobacteria was the most prevalent phylum in all samples, followed by Bacteroidota, and Actinobacteriota.The anaerobic and aerobic stages showed an obvious similarity in bacterial community composition, which may be attributed to the sequence of the treatment.The results of this study indicate that the treatment unit is a promising and economical technology for wastewater treatment.

Fig. 1
Fig. 1 The physicochemical characterization of wastewater in different treatment stages

Fig. 4 A
Fig. 4 A Venn diagram showing the unique and shared amplicon sequence variants (ASVs) among the different treatment stages

Fig . A
Fig. A Relative abundance of bacterial communities at the top ten phyla.B Relative abundance of bacterial communities at the top ten orders.Others refer to the less contributed taxa and unclassified taxa

Fig. 10
Fig. 10 Occurrence and removal of parasites in the treatment system

Table 1
Total capital cost include and exclude contingency and auxiliary facilities during the period extended from January to December 2022 (*) means total capital cost include contingency and auxiliary facilities (**) means total capital cost exclude contingency and auxiliary facilities

Table 2
Total cost (direct and indirect operating cost), profit, and payback period include maintenance, operating supplies, laboratory charges, indirect operating costs, and general expenses during the period extended from January to December 2022

Table 3
Total cost (direct and indirect manufacturing cost), profit, and payback period exclude maintenance, operating supplies, laboratory charges, indirect operating costs, and general expenses during the period extended from January to December 2022