N2 fixation dominates nitrogen cycling in a mangrove fiddler crab holobiont

Mangrove forests are among the most productive and diverse ecosystems on the planet, despite limited nitrogen (N) availability. Under such conditions, animal-microbe associations (holobionts) are often key to ecosystem functioning. Here, we investigated the role of fiddler crabs and their carapace-associated microbial biofilm as hotspots of microbial N transformations and sources of N within the mangrove ecosystem. 16S rRNA gene and metagenomic sequencing provided evidence of a microbial biofilm dominated by Cyanobacteria, Alphaproteobacteria, Actinobacteria, and Bacteroidota with a community encoding both aerobic and anaerobic pathways of the N cycle. Dinitrogen (N2) fixation was among the most commonly predicted process. Net N fluxes between the biofilm-covered crabs and the water and microbial N transformation rates in suspended biofilm slurries portray these holobionts as a net N2 sink, with N2 fixation exceeding N losses, and as a significant source of ammonium and dissolved organic N to the surrounding environment. N stable isotope natural abundances of fiddler crab carapace-associated biofilms were within the range expected for fixed N, further suggesting active microbial N2 fixation. These results extend our knowledge on the diversity of invertebrate-microbe associations, and provide a clear example of how animal microbiota can mediate a plethora of essential biogeochemical processes in mangrove ecosystems.

N-cycling functional diversity of the crab's carapace microbiome. Most of the metagenome reads were attributed to the Gene Ontology categories: metabolic processes, transport, and catalytic activity (Fig. 2a). Among metabolic processes, the main subcategories were those related to aerobic respiration, central carbon cycling, peptidases, and housekeeping genes, but also pathways involving N compounds (Fig. 2b). Browsing of the proteins involved in N-cycling (according to the KEGG nitrogen metabolism reference pathway: https :// www.genom e.jp/kegg-bin/show_pathw ay?map00 910) revealed that the microbial community was capable of all N-cycling pathways, including N 2 fixation, ammonium (NH 4 + ) oxidation (and potentially methane oxidation), NO 3 − reduction to nitrites (NO 2 − ) and assimilatory NO 2 − reduction to NH 4 + , dissimilatory NO 2 − reduction to NH 4 + , NO 2 − reduction to nitric oxide (NO) and subsequent reduction to nitrous oxide (N 2 O) and to N 2 (Fig. 2c). The studied N-cycling pathways represented 0.32% of all the classified proteins, 0.75% of the "Metabolic processes" category, and 5% of the "Nitrogen compound metabolic process" subcategory. A full list of all classified proteins is provided in Supplementary Information 2. Unclassified sequences attributed to the nifH/frxC protein family were included in the N 2 fixation category (sequences classified to specific frxC family proteins were not included). Major prokaryotic groups that could be taxonomically classified and attributed to these processes were indicated to be Alphaproteobacteria (24% of all N-cycling related sequences), Cyanobacteria (20%), Bacteroidetes (9%), Actinobacteria (6%), Chloroflexi (2%) and Gammaproteobacteria (2%) (Supplementary Information 2). In more detail, these phyla constituted e.g. taxonomic orders Sphingomonadales, Rhodobacterales, Flavobacteriales, and Nostocales (Supplementary Information 2). Our identified prokaryotes harboured a large array of metabolic features, carrying marker genes for up to 5 different N-cycling pathways (e.g., Alphaproteobacteria). For example, NO 3 − reduction pathways in biofilms were carried out by Alphaproteobacteria, Actinobacteria, Bacteroidetes, Cyanobacteria, Chloroflexi and Gammaproteobacteria, as shown in the metagenome data ( Supplementary Information 2).

Figure 2.
Functional profiling of the crab's carapace microbiota using metagenomics: (a) Gene Ontology functional categories of metagenome sequences (%) that constituted the majority of the metagenomic data (45.3% classified reads) with (b) a breakdown of the subcategories (%) among the classified metabolic processes and (c) metabolic processes of the nitrogen cycle (5% of the "Nitrogen compound metabolic process" subcategory). Pathways consist of the sum of counts for related proteins. The analysis was limited to functional categories > 0.1%.  Table 1). The relative abundance of biofilm associated nirS and nrfA were 6.7 ± 3.1 × 10 -5 and 10.5 × 10 -5 per 16S rRNA gene copy, respectively. Contrarily, NH 4 + oxidation to NO 2 − had considerably lower capacity, contributed solely by archaea (2.1 ± 0.2 × 10 -6 per 16S rRNA gene copy). Bacterial amoA was not detected on carapace by qPCR.

Scientific RepoRtS
Net N fluxes associated with fiddler crab holobiont. Biofilm-covered crabs actively released NH 4 + and dissolved organic nitrogen (DON) which corresponded to 34% and 57% of total dissolved N production (DIN + DON) in the microcosms with crabs, respectively (Table 2). Net production of NO 3 − and NO 2 − was quantitatively less important, comprising together < 9% of total dissolved N production. Net N 2 fluxes in the microcosms were negative, indicating the dominance of N 2 fixation over denitrification.

Microbial NO 3
− reduction and production in the biofilm. Anoxic slurry incubations of biofilms collected from multiple crab carapaces revealed that the dominant process was denitrification with 3.89 ± 0.72 µmol N g dw −1 biofilm d −1 , while DNRA was considerably lower (0.82 ± 0.05 µmol N g dw −1 biofilm d −1 ) (Fig. 3). Anammox was a negligible process in the biofilm, as 29 N 2 production was always below the detection limit (data not shown). In the oxic biofilm slurries, NO 3 − increased from 6.4 to 20.6 µmol N l −1 , which corresponded to 0.56 ± 0.01 µmol N g dw −1 biofilm d −1 of potential nitrification rate.
Natural abundance of stable isotopes. The δ 13 C values were similar among all crab tissues, while δ 15 N values varied among samples with lowest values found in carapace biofilm samples (Fig. 4, Supplementary Information 3). Plotting natural abundances in a biplot together with values recorded in the literature for multiple primary producers and other crab species from the same site (data from Nagata et al. 40 ) shows that crab tissues (gill, muscle and viscera) are depleted with regards to 15 N as compared to other crab species (Fig. 4).

Discussion
Using multiple lines of evidence integrating biogeochemical measurements, stable isotope probing, 16S rRNA gene and metagenomic sequencing and qPCR of functional genes, we constructed a flowchart of holobiont N-cycling (Fig. 5). Combining evidence from potential and measured fluxes with the key microbial players presumably responsible of N transformations within the biofilm, we show that fiddler crab holobionts are hotspots of benthic N-cycling, acting as relevant sources of fixed N to their surrounding environment.
The crab microbiota fix atmospheric N 2 . The highest measured rates were attributed to negative N 2 fluxes, suggesting N 2 fixation as the dominant process. N 2 fixation was also one of the most dominant metabolic processes compared to other N-cycling pathways within the metagenome, and depleted 15 N stable isotope signatures further point at N 2 fixation as a relevant process within the biofilm. Dinitrogen fixation is a common process in mangrove ecosystems, where the highest activities are found associated with the mangrove rhizosphere 39 . The presence of N 2 fixing prokaryotes in the mangrove rhizosphere is often explained by a mutualistic relation-   41 . Similarly, although it remains speculative whether fiddler crabs take advantage of N 2 fixers residing on their carapace, the depleted 15 N signatures in their tissues compared to other detritivores crab species from the same site may indicate a nutritional relationship between the fiddler crab host and its microbiota. Additionally, the alpha diversity of the crab biofilm prokaryotic community (Shannon's H ~ 5.5) was within the lower range of prokaryotic diversity reported in previous studies focusing on sediments 42,43 , suggesting the occurrence of selection processes on the crab's carapace.  . Signature of N 2 fixation in crab's carapace biofilms stable isotope ratios: biplot of the natural abundance of 13 C and 15 N isotopes for different samples (carapace, gill, muscle, viscera) from the fiddler crab (Leptuca thayeri, n = 5), and for different primary producers (as potential sources of detritus) and other detritivores crab species from the Cananéia estuarine system (data from Nagata et al. 40 ).
Scientific RepoRtS | (2020) 10:13966 | https://doi.org/10.1038/s41598-020-70834-0 www.nature.com/scientificreports/ Biofilm-covered fiddler crabs were collected from an open muddy bank near a tidal creek, where sunlight stimulates the growth of unique phototrophic microorganisms, different from those found landward 44 . These fiddler crabs constantly migrate between burrows and the sediment surface and such vertical and horizontal migrations across contrasting environmental gradients (light regime, salinity, redox conditions, nutrients, organic matter) have the potential to create strong selective pressures on its biofilm-associated prokaryotes, although prior studies found that the fiddler crabs' carapace was colonized by multiple microbial pools from the burrow walls 17,18 .
The most represented taxa within the biofilm was the Cyanobacteria genus Geitlerinema, which dominated the community with ~ 12% of all 16S rRNA gene sequences (see Supplementary Fig. 1) suggesting an important role within the assemblage. Geitlerinema contains biofilm-forming species that are capable of photosynthetic anoxygenic N 2 fixation 45 . Due to its environmental plasticity, Geitlerinema spp. photosystem machinery may reduce oxygen production allowing oxygen-sensitive processes such as N 2 fixation to operate in its cell or in neighbouring bacteria 45 . Other potential N 2 fixers in our dataset were affiliated to well-known diazotrophic bacterial taxa like Sphingomonadales, Rhodobacteriales and Flavobacteriales. For example, Erythrobacter (the top alphaproteobacterial ASVs, Supplementary Fig. 1) is suspected to be diazotrophic 46 and forms facilitative consortia with N 2 -fixing cyanobacteria 47 . Similarly, on the crabs' carapace, a N 2 -fixing consortium (Fig. 5) might Figure 5. Flowchart of N-cycling by the fiddler crab holobiont: all fluxes were obtained combining data from incubations of single crab holobiont (in situ rates, solid lines) and suspended biofilm (potential rates, dashed lines). Note that reported rates differ from those in Table 2  www.nature.com/scientificreports/ represent an association arranged along environmental gradients within the biofilm (e.g. light, oxygen) and whose strategy is to cooperate in order to enhance diazotrophic activity under N-limiting conditions 48,49 . The dominance of Geitlerinema spp. might be ascribed to its metabolic plasticity allowing it to cope with both high sulphide concentrations, which may build-up in clogged burrows, and air exposure when the crab leaves to the surface 45 .
Nitrogen is both assimilated and lost. Nitrification (i.e. the recycling of N through oxidation of NH 4 + to NO 3 − ) doesn't appear to play an important role on the crab's carapace (Fig. 5). Accordingly, nitrifying bacteria affiliated to Nitrospira and Nitrosomonas represented only a minor fraction of the biofilm bacterial community. The low abundance of these microbial taxa is also a common feature across different benthic environments 50,51 . Sequences encoding proteins such as amoA and likely pmoA, responsible for NH 4 + and methane oxidation, were present in the metagenome. However, it is difficult to discriminate the relevance of nitrification from the metagenomic dataset, as both monooxygenases are membrane-bound and evolutionary-related enzymes, thus frequently annotated together 52 . Additionally, our measured potential rates of nitrification were low, further indicating limited nitrification (Fig. 5).
Sequences encoding key enzymes for both assimilative and dissimilative (denitrification and DNRA) NO 3 − reduction process were detected in our metagenome, indicating the metabolic potential for both these processes to occur on the carapace. Though DNRA genetic potential was quantitatively similar to that of denitrification, process measurements indicated a much higher expression of the latter, and denitrification was a dominant pathway of NO 3 − reduction in the biofilm slurries (Fig. 5). Nevertheless, despite the high potential denitrification rates found in our incubations under anaerobic conditions, the metabolic capacity of denitrifiers is likely limited by low NO 3 − background concentrations in the surrounding water (NO 3 − < 0.5 µM). A previous study showed that NO 3 − produced during nitrification can partly support denitrification inside the biofilm 28 . However, in our study nitrification and excretion by the fiddler crab holobiont could only support 8-15% of denitrification potential. Furthermore, the high potential of assimilatory NO 2 − reduction to NH 4 + in the biofilm likely promotes competition for NO 3 − between the different microbial populations. Therefore, the predominance of potential denitrification over DNRA in our biofilm slurry incubations might be explained by the C:N ratio or by NO 2 − concentrations 53 . The major groups likely involved in dissimilative processes in our samples were Alphaproteobacteria, Actinobacteria, Bacteroidota, Chloroflexi and Gammaproteobacteria, taxa which frequently harbour these proteins in the marine environment 54 . The genuses Janibacter (Intrasporangiaceae) and Aquimarina (Flavobacteriaceae) were highly represented in the crab's microbiota and both have the metabolic capacity to reduce NO 3 −55,56 . Most identified bacteria possess all four genes (nar/nap, nir, nor and nos) which allow for complete NO 3 − reduction to N 2 as the end product 57 . The genus Blastomonas (Sphingomonadales), also highly represented, include members known for their chemotrophic lifestyle, capable of using NO 3 − and its reduction products as electron acceptors 51,58-61 . Furthermore, the phylogenetic assignment of nar and nir genes indicates that the cyanobacterium Geitlerinema spp. may be involved in both N 2 fixation and dissimilative NO 3 − reduction. On the other hand, the major groups containing the array of genes NapC/NirT/Nrf (therein nrfA), responsible for DNRA, were assigned primarily to Chloroflexi (Anaerolineae) and to unclassified Gammaproteobacteria.
The transcription of most marker genes encoding for NO 3 − reduction and its derivatives typically occurs under low oxygen conditions 62 , which we may also expect within the crab's biofilm. However, temporal oxygen fluctuation on the carapace is inevitable when the host leaves its burrow to the surface and it is exposed to air and oxygen production via photosynthesis by associated phototrophs (e.g. Nostocales). Oxygen rise should supress the metabolic capacity of anaerobic bacteria, and especially of those that are respiring NO 3 − . However, Marchant et al. 63 demonstrated that in dynamic environments with strong oxygen oscillations such as permeable sediments subject to daily tidal inundations, the transcription of denitrification genes happens both under oxic and anoxic conditions, suggesting that in the short time (hours) terminal reductases are not immediately suppressed and the electron flow continues. The occurrence of anoxic niches within the biofilm would further allow the microbial community to physiologically dispose of excess reducing equivalents 63,64 . Aerobic denitrification, on the other hand, is unlikely to occur under these conditions as indicated by the low number of reads of the key marker gene-periplasmic nitrate reductase (nap; review by 65 )-in our samples. Similarly, anammox appeared to be a negligible process within the biofilm, probably being suppressed by the fluctuating environmental conditions (temperature, O 2 , and nutrient concentrations) experienced by the crab holobionts, which are unfavourable to slow-growing anammox bacteria 66 . This is also the case in mangrove sediments where the contribution of anammox to N removal is usually of minor importance 67 .
Overall, we speculate that dissimilative processes like denitrification have little ecological meaning here as they are constrained by low N availability in the water column or within sediments. Furthermore, the presence of both assimilative and dissimilative NO 3 − reduction processes within the biofilm (see Fig. 3) suggests strong competition for N between denitrifiers and other bacteria/microalgae. As potential rates generally overestimate in situ rates due to high substrate availability, we argue that the biofilm tends to recycle and relocate N via coupled dissimilative and assimilative processes, avoiding permanent N losses and acting as a net N 2 sink and as a source of particulate and dissolved N to the environment.
Host excretion further releases N. As a matter of fact, we show significant DON release by the fiddler crab and associated microbiota (Fig. 5). This is an interesting finding since most of decapod crustaceans primarily excrete ammonia (NH 3 ) or the conjugated acid NH 4 +68 . Nevertheless, it has been shown that some decapods (e.g., shrimps living at lower temperatures than in our study site), can excrete DON, although this never exceeds NH 4 + excretion 69 . In the fiddler crab, the significant amount of released DON might partly derive from fixed N which is not assimilated by the crab and its associated bacteria or microalgae. The biochemical mechanisms Scientific RepoRtS | (2020) 10:13966 | https://doi.org/10.1038/s41598-020-70834-0 www.nature.com/scientificreports/ that promote such DON release should be addressed in future studies. Furthermore, it has rarely been questioned whether NH 4 + excretion by animals is solely a physiological process or if it might also be attributed to invertebrate-bacteria associations 70 . For example, Samuiloviene et al. 38 found active transcription of nrfA gene (encoding for DNRA) in tube dwelling chironomid larvae, suggesting the presence of active ammonifiers. In our study, the results from both qPCR and metagenomic analyses corroborate the presence of ammonifiers within the biofilm, which can potentially contribute up to 46% of net NH 4 + production by the fiddler crab holobiont.
The crab holobiont contributes to the ecosystem N budget. N 2 fixation was one of the most dominant pathways compared to other N-cycling processes associated with fiddler crab microbiota, suggesting that this characteristic benthic invertebrate has a potentially relevant role in mangrove ecosystems as a vector of newly fixed N to the surrounding environment. The study area is a system where N 2 fixation is an important conduit for bioavailable N 39 . Therefore, fixed N is an essential element in mangrove food webs, including detritus-feeding fiddler crabs. On the other hand, by selective grazing on bacteria or microalgae 15,71,72 these crabs can redistribute or reduce N 2 fixation in mangrove forests. Measured dissolved N production by the host, which likely comes from crab excretion, exudation of newly fixed N or its turnover within the biofilm, together with that associated to crab faeces-not measured here-can enrich with N the surrounding benthic system. Moreover, as the fiddler crabs intermolt and molt cycles last < 150 days 73 , the labile organic matter of the biofilm-covered carapace is delivered to the benthic system at least 3 times per year and can prime heterotrophy by relieving the very high C:N sediment ratios. In a wider ecosystem context, considering a minimum abundance of 10 crab individuals per square meter 74 , fiddler crabs can produce 33 µmol m −2 d −1 of dissolved N which compensate/reverse dissolved N uptake measured at the sediment-water interface (− 71 µmol m −2 d −1 ; 39 ). In addition, N 2 fixation associated with fiddler crabs can deliver 135 µmol N m −2 d −1 which compares to 27% of N 2 fixation in surface microbial mats (500 µmol m −2 d −1 ; 39 ). Unlike most bioturbating invertebrates, fiddler crabs temporally leave their burrows while feeding, mating or for territorial defence, moving to the surface sediment during low tide 24,75,76 . During high tide the crabs plug their burrows with sediment, residing either in a formed air chamber or crawling deeper to the flooded part of the burrow 23,77,78 . Because of crab respiration (~ 7 µmol O 2 crab −1 h −1 , data not shown) or oxidation of end-metabolic compounds (e.g., NH 4 + , H 2 S), oxygen is gradually consumed in the burrows 79 , promoting NO 3 − reduction processes and transient accumulation of NH 4 + , despite these latter processes likely having little quantitative relevance at the ecosystem level.

Conclusion
Mangroves ecosystems are increasingly challenged by anthropogenic activities, which may result in pressure to these ecosystems in terms of increasing nutrient or organic matter loading 80 . Under the pristine conditions of Cananéia region 39 , crab's biofilm microbiota may be dominated by diazotrophic members, contributing fixed N to the environment, and possibly to the host. Conversely, if exposed to eutrophic conditions, fiddler crab holobionts may experience changes in the biofilm composition and metabolic repertoire, with a suppression of the energy-costly process of N 2 fixation and an increase of dissimilative losses of excess N. Future studies should extend this combined molecular and biogeochemical approach to other study areas along environmental gradients, in order to verify to which degree fiddler crab carapace microbiota is environmentally assembled vs determined by host factors.

Material and methods
Study site. Specimens of the Atlantic mangrove fiddler crab (Leptuca thayeri, Rathbun 1900) were collected in their burrows during low tide from a muddy bank nearby a small channel (25°2′55.50″, 47°58′31.24″) located in the estuarine system of Cananéia, on the south coast of Brazil. During the sampling event surface (0.5 m depth) water temperature in the channel was 19.5 °C, salinity was 26.2 and dissolved oxygen concentration was 184.4 µM. This pristine estuarine system receives seasonally variable nutrient inputs depending on rainfalls, however, dissolved inorganic nitrogen (DIN) concentration in the system rarely exceeds > 4 µM of DIN 81 . The estuarine system, extending over an area of 110 km 2 , is part of the Cananéia-Iguape complex and is characterized by the presence of mangroves, restingas, inland seas and islands (Cananéia, Cardoso, Comprida, and Iguape). The region is part of the Cananéia-Iguape-Paranaguá Environmental Protection Area, and is recognized by UNESCO as part of the Biosphere Reserve. The estuarine system is connected to the South Atlantic Ocean by the Cananéia and Icapara inlets located, respectively, to the south and north of the system. Water circulation in the estuary channels is driven by a daily tidal flow and inflow of freshwater from continental drainage of several small rivers up to 6 m 3 s −1 during dry season 82 . The intertidal stands are composed by Spartina meadows at the outermost portion, followed by Laguncularia racemosa in two stages of development. Rhizophora mangle followed by Avicennia schauerianna occupy the inner parts of the mangrove forests 83 . DNA extraction. Samples for DNA analysis were collected in the field from the carapace of randomly selected crabs (n = 3, with total surface area of ~ 8 cm 2 ) by using swabs (after rinsing in 0.2-µm-filtered seawater), which were later preserved in RNAlater (Zymo Research). In the laboratory, DNA was extracted from three samples using the QIAamp Fast DNA Stool Mini Kit (QIAGEN). The lysis temperature was increased to 90 °C to improve the bacterial cell rupture. The final extracted DNA was subsampled for (1) 16S rRNA gene amplicon sequencing, (2) shotgun metagenomic sequencing, and (3) functional gene quantification by qPCR. Metagenome sequencing was carried out in one pooled sample (n = 3) to get sufficient amount of DNA for shotgun sequencing.
Scientific RepoRtS | (2020) 10:13966 | https://doi.org/10.1038/s41598-020-70834-0 www.nature.com/scientificreports/ 16S rRNA gene amplicon sequencing. 16S rRNA gene sequences were amplified from extracted DNA using the primer pair Probio Uni and/Probio Rev, targeting the V3 region of the 16S rRNA gene sequence as described previously by Milani et al. 84 . High-throughput sequencing was performed at the DNA sequencing facility of GenProbio srl (www.genpr obio.com) on an Illumina MiSeq with the length of 250 × 2 bp, according to the protocol previously reported in Milani et al. 84 . Sequencing yielded 144,418 paired-end reads (range 102,813-185,876) and the fastq data was analysed according to the DADA2 pipeline 85 using the DADA2 1.12.1 package with R. Default settings were used with some exceptions, during quality trimming: truncLen = c(150,150), maxEE = 5, truncQ = 2, m, trimLeft = c (21,22). This allowed to keep high quality reads and remove leftover primers from the sequences. FastQC 0.11.8 was used to manually check the quality of the trimmed reads 86 . During merging of the reads: minOverlap = 10, and during chimera removal: allowOneOff = TRUE, minFoldPar-entOverAbundance = 4. Sequences were classified against the SILVA 138 database 87 , and chloroplast sequences were removed. The final amplicon sequence variant (ASV) data was normalized as relative abundance (%). Shannon's H alpha diversity was calculated in the software Explicet 2.10.15 88 after sub-sampling to the lowest sample size (88,457 counts). A full list of all ASVs, taxonomic classifications and sequence counts are available in Supplementary Information 1.

Shotgun metagenomic sequencing. Shotgun-based metagenomics analysis was performed on Illumina
NextSeq with sequence length of 150 × 2 bp. Raw sequencing data consisted of 17.8 million paired-end reads and was manually checked for quality using FastQC 86 . Illumina adapters had been removed by the sequencing facility, and that no remains of PhiX control sequences were left was checked by mapping reads against the PhiX genome (NCBI Reference Sequence: NC_001422.1) using Bowtie2 2.3.4.3 89 . Reads were quality trimmed using Trimmomatic 0.36 90 with the following parameters: LEADING:20 TRAILING:20 MINLEN:50. FastQC was used to check the quality of the trimmed reads. The trimmed data consisted of 17.4 million paired-end reads, with an average quality Phred score of 33 per base, and an average read length of 144 bp. Because low merging rate of the pairs, ~ 37% with PEAR 0.9.10 91 , the quality trimmed forward (R1) and reverse (R2) readpairs were annotated separately. Protein annotation against the NCBI NR database was conducted by using the aligner Diamond 0.9.10 92 in combination with BLASTX 2.6.0+ 93 with an e-value threshold of 0.001. The data was imported into the software MEGAN 6.15.2 94 and analysed for taxonomy, using default lowest common ancestor (LCA) settings, with the NCBI accession numbers linked to NCBI taxa (MEGAN supplied database: prot_ acc2tax-Nov2018X1.abin). Protein annotated sequences were analysed in MEGAN using the supplied database acc2interpro-June2018X.abin that links accession numbers to the InterPro database and Gene Ontology (GO) categories. The taxonomy and protein data attributed to N-cycling were extracted from MEGAN and the average read count for R1 and R2 was used for further analysis. In total, 9.0-9.2 million sequences were classified to taxonomy, and 4.9-5.0 million sequences to proteins (range of R1 and R2 data). To link taxonomy with protein classifications the "read name-to-taxonomy" and "read name-to-protein" tables were extracted from MEGAN using the inbuilt functions of the software. These tables were combined based on identical read names. A full list of taxonomy, related N-cycling proteins, and sequence counts are available in Supplementary Information 2.

Individual microcosm incubations.
In the laboratory, collected fiddler crabs (n = 50) were left overnight in three aquaria (volume 20 l) with ambient water, continuous aeration and temperature control fixed at 19 °C for further experimental activities. Afterwards, single intermolt fiddler crab individuals were transferred into Plexiglas microcosms (n = 5, i.d. 4 cm, height ~ 20 cm, volume = 227 ± 3 ml) filled with unfiltered seawater from the sampling site. In parallel, control microcosms with water alone (n = 3) were prepared in order to correct process rates measured in crab microcosms. All microcosms were equipped with rotating magnets to ensure continuous water mixing (25 rpm) and were initially submersed, with the top open, in an incubation tank. Dark incubations started when microcosms top opening was closed with gas tight lids and lasted for < 6 h. At the beginning (from the incubation tank, in quadruplicate) and end of the incubations (from each microcosms) 50 ml aliquots were transferred to 12 ml exetainers (Labco Ltd) and fixed with 100 µl of 7 M ZnCl 2 for N 2 :Ar measurements. In addition, two aliquots of 20 ml were collected, filtered (GF/F filters) and transferred into PE tubes and glass vials for inorganic and organic N analyses, respectively. Filtered water samples for spectrophotometric analyses were immediately frozen at − 20 °C until analysis (see details below). After incubation, crabs from all microcosms were used to determine carapace area, dry weight (at 60 °C for 48 h), and thereafter analysed for isotopic composition. The measured N excretion/production rates were normalized for the dry weigh (dw) crab biomass. ). Rates were expresses as NO x − amount produced per individual crab, taking into account the mean dry weight of biofilm per carapace. Potential NO 3 − reduction processes (denitrification, DNRA and anammox) were measured in anoxic incubations. For this incubation biofilm slurries were transferred into 12 ml exetainers (n = 24) without air bubbles and continuously suspended on a rotating shaker. An overnight preincubation was necessary to consume all dissolved oxygen and 14 NO 3 − . Dissolved oxygen concentrations were monitored in additional 20 ml glass scintillation vials (n = 2) equipped with optical sensor spots (PyroScience GmbH). Thereafter, half of the exetainers was added with 15 NO 3 − to a final concentration of 100 µM whereas the remaining exetainers were added with 15 NH 4 + + 14 NO 3 − to a final concentration 100 µM. After the various additions, microbial activity was immediately terminated in three replicates of each treatment by adding 100 µl of 7 M ZnCl 2 . The other exetainers were maintained on the rotating shaker and incubated in the dark at 19 °C for 12 h. Every four hours three replicates from each treatment were retrieved and microbial activity terminated by adding 100 µl of 7 M ZnCl 2 . This was followed by determination of isotopic composition of produced 15 N-N 2 and 15 N-NH 4 + with the protocol explained below.

Analytical procedures and rates calculation. Dissolved inorganic N concentrations were measured
with a continuous flow analyser (Technicon AutoAnalyzer II, SEAL Analytical) using colorimetric methods 96 . NO 3 − was calculated as the difference between NO x − and NO 2 − . Dissolved NH 4 + was analysed using the method by Treguer and Le Corre 94 . Net N 2 fluxes were measured via the N 2 :Ar technique by membrane inlet mass spectrometry (MIMS) at Ferrara University (Bay Instruments 97 ;) and corrected for Ar concentration and solubility based on incubation water temperature and salinity 98 . Isotopic samples for 29 N 2 and 30 N 2 production were analysed by gas chromatography-isotopic ratio mass spectrometry (GC-IRMS) at the University of Southern Denmark. Briefly, headspace subsamples were injected into a GC extraction line equipped with an ascarite trap, a Porapak R chromatographic column, a copper column heated to 600 °C, and a Mg(ClO 4 ) 2 trap 99 . The extraction line was coupled to an isotope ratio mass spectrometer (IRMS, Thermo Delta V Plus, Thermo Scientific) by means of a Conflo III interface. Samples for 15 NH 4 + production were analysed by the same GC-IRMS after conversion of NH 4 + to N 2 97 by the addition of alkaline hypobromite 100 . Slopes of the linear regression of 29 N 2 and 30 N 2 concentration against time were used to calculate production rates of labelled N 2 -p 29 N 2 and p 30 N 2 , respectively. Since p 29 N 2 was not significant in 15 NH 4 + + 14 NO 3 − treatment, we deduced that anammox rate was negligible. Denitrification potential rate was calculated from the equations reported in the Thamdrup and Dalsgaard 101 . The slope of the linear regression of 15 NH 4 + concentration against time was used to calculate the production rate of labelled NH 4 + -p 15 NH 4 + . Potential DNRA rate was calculated according to Bonaglia et al. 102 . These NO 3 − reduction rates were thus corrected for the actual 15 N enrichment, and for individual specimen taking into account mean dry weight of biofilm per carapace.
Organic C and total N content and their isotopic composition in different crab tissues (~ 1 mg) were analyzed with a mass spectrometer (IRMS, Thermo Delta V, Thermo Scientific) coupled with elemental analyzer (ECS-4010, Costech Instruments) at the University of Sao Paulo. Before measurements samples were acidified with 1 M HCl to remove carbonates. C and N content was presented in percentage and their isotopic signatures were expressed in the form of δ ‰, according to the following equation: where R sample is the isotopic ratio in the sample and R reference is the isotopic ratio in the reference standard (Vienna Pee Dee Belminite (V-PDB) and atmospheric N 2 , respectively).

Data availability
The raw sequence data supporting this study have been uploaded online and are available at the NCBI BioProject PRJNA549720.