{'fraction_non_alphanumeric': 0.033311561071195296, 'fraction_numerical': 0.016546919224907468, 'mean_word_length': 5.246260199456029, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 2, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 2, 'zh_pornsignals.json': 0}}
Behavioral Variation in the Pygmy Halfbeak Dermogenys collettei: Comparing Shoals With Contrasting Ecologies

Variation in biotic and abiotic factors among populations affects individual behaviors by transforming the social landscape and shaping mating systems. Consequently, describing behaviors in natural populations requires consideration of the biological and physical factors that different individuals face. Here, we examined variation in socio-sexual and locomotor behaviors in a small, livebearing, freshwater fish, the pygmy halfbeak Dermogenys collettei, across natural populations in Singapore. The pygmy halfbeak is a surface feeding fish that spends most of the time near the water surface, making it ideal for non-invasive behavioral observations. We compared behaviors between sexes among 26 shoals while simultaneously accounting for environmental variation. We demonstrated that sexual interactions and locomotor behaviors differed among shoals with varying levels of canopy cover and water flow. Specifically, in areas with greater canopy cover, sexual interactions decreased, whereas time spent in a stationary position increased. Sexual interactions were more numerous in still water, where fish spent less time swimming. Variation in the expression of socio-sexual and locomotor behaviors were not associated with differences in the amount of aquatic vegetation, water depth or halfbeak shoal size. Agonistic interactions were robust to environmental effects, showing little variation among environments. However, there were strong sex effects, with males performing more agonistic behaviors and spending less time in a stationary position compared to females, regardless of the environment. Moreover, sexual interactions, measured as actively performed by males and passively received by females, were on average more frequent in males than in females. Our findings help us explore the proximal causes of intraspecific behavioral variation and suggest that fundamental information on socio-sexual behaviors from wild populations can lead to a better understanding of how sexual selection operates when the strength of natural selection varies across environments.


INTRODUCTION
Animals exhibit wide variation in behaviors when assessed within individuals, among individuals and among populations (Sih et al., 2004;Miller and Svensson, 2014). In natural populations, this ubiquitous behavioral variation is shaped by, and interacts with, varying biotic and abiotic characteristics of the environment (Emlen and Oring, 1977;Miller and Svensson, 2014). However, predicting how different behavioral responses vary with biotic and abiotic characteristics remains challenging. Individuals have limited time and energy budgets and may therefore face potential trade-offs among behaviors, which can themselves be mediated by environmental characteristics (Magnhagen and Magurran, 2008). Additionally, males and females often face varying costs associated with different behaviors, driven by a difference in reproductive investment and potentially mediated by the environment (Magurran and Seghers, 1994). Such behavioral trade-offs have important consequences for how animals respond to inter-versus intra-sexual selection (Ahnesjö et al., 2008) and defining such interactions can shed light on how selection acts in natural populations.
Socio-sexual (e.g., courtship and agonistic behaviors) and locomotor behaviors represent two categories of behaviors that may be especially subject to trade-offs and are often influenced by the environment (Endler, 1995;Penaluna et al., 2016;Suriyampola et al., 2017). Whether individuals invest more in courtship or agonistic behaviors may depend on the relative fitness benefits associated with performing either of these socio-sexual behaviors (Fitze et al., 2008;Weir et al., 2011). Environmental characteristics can mediate these gains, for example by influencing how information is transmitted (Sundin et al., 2016;Ehlman et al., 2018) and potentially modifying the type of interactions with conspecifics (e.g., Magellan and Magurran, 2006). Certain environmental characteristics may also result in differences in locomotor behaviors, particularly when enabling or interfering with individuals' movement through the environment (e.g., Marras et al., 2015). Tradeoffs between socio-sexual and locomotor behaviors may also occur and be sensitive to the environment. For example, behaviors that increase survival (e.g., anti-predator behaviors, such as remaining stationary) potentially reduce the opportunity to perform behaviors that increase reproductive success (e.g., conspicuous mating behaviors), with this association being more relevant in environments with high predation risk (e.g., Rypstra et al., 2016;Edomwande and Barbosa, 2020). Explaining the variation in socio-sexual and locomotor behavior therefore requires these behaviors to be assessed across a range of environmental conditions. Differences between the sexes also play a major role in determining among-population variation in socio-sexual and locomotor behaviors. Classically defined sex roles suggest that sexual selection should be stronger on males than females, as lower costs of gamete investment for males lead to greater benefits of multiple mating (Bateman, 1948;Lindsay et al., 2019). Consequently, males are generally expected to invest more of their time and energy engaged in courtship behaviors to attract partners (inter-sexual selection) and agonistic behaviors toward rivals to compete for reproductive opportunities (intra-sexual selection; Andersson, 1994). Males may also be more spatially active than females, particularly if locomotor activity increases the probability of finding a mate (e.g., Stark et al., 2005). In contrast, the strength of sexual selection is typically lower on females, who invest more resources in gamete and offspring production rather than mate acquisition (Kokko and Jennions, 2008), and generally devote time in choosing mates rather than courting them (e.g., Rosenthal, 2017). Moreover, carrying eggs or offspring increases cost of locomotion and risk of predation (Quicazan-Rubio et al., 2019), often accounting for a reduced mobility in females relative to males. Together, this suggest that across most taxa, selection acts differently on males and females and that sex-specific behavior may be influenced by biotic and abiotic conditions.
Measuring multiple behaviors across a range of environmental conditions is a powerful approach for identifying selection pressures and evolutionary constraints under ecologically relevant situations. Among viviparous fishes, the vast majority of research examining how behaviors are shaped by environmental characteristics in nature has been performed in Poeciliid fishes (order Cyprinodontiformes), a diverse group of fishes found primarily in the Neotropics, that represent a single evolutionary origin of viviparity (Blackburn, 2015). Here, we examine how behaviors change across different environments in a halfbeak fish from the family Zenarchopteridae (order Beloniformes). Halfbeaks are a relatively understudied group of fishes that represent an independent evolutionary origin of viviparity that occurred in a geographically distinct region (Southeast Asia) from the more commonly studied Poeciliids. Specifically, we focus on the pygmy halfbeak, Dermogenys collettei, a small, internally fertilizing, viviparous fish inhabiting freshwater rivers, streams and lakes in the Malay Peninsula (Downing Meisner, 2001;Nurul Farhana et al., 2018). Pygmy halfbeaks are characterized by an elongated lower jaw that facilitates prey capture at the surface of the water, where they spend the vast majority of their time. The halfbeaks live in mixed-sex shoals with frequent interactions among conspecifics and breed throughout the year (Greven, 2010;Ho et al., 2015). In this species, females give birth approximately every 30 days and males show a preference for females based on their breeding cycle (Ogden et al., 2020). Pygmy halfbeaks are sexually dimorphic in body size, with adult females being larger than males, and sexually dichromatic, with adult males expressing more red and yellow coloration than females, particularly on their modified anal fins (Greven, 2010). Females choose mates on the basis of the amount of red coloration displayed by a male (Reuland et al., 2020a), while male mate choice is based on the size of a sex-specific orange gravid spot on the female's abdomen that varies in size with the reproductive cycle (Ogden and Fitzpatrick, 2019). Sexual dimorphism, along with sex-specific behaviors, allows the sexes to be easily identified in natural populations. Male halfbeaks routinely perform a series of well-characterized courtship behaviors, whereas agonistic interactions are observed in both sexes (see the methods of this study and Greven, 2010;Baker and Lim, 2012;Ho et al., 2015). However, male halfbeaks are usually more aggressive than females (Greven, 2010) and form dominance hierarchies in laboratory conditions (Reuland et al., 2020b). These attributes make halfbeaks an ideal system for conducting non-invasive behavioral observations of natural populations across a range of environmental conditions.
In this study, we quantified socio-sexual (courtship and agonistic) and locomotor (swimming and stationary) behavior in 26 natural halfbeak shoals in Singapore. We tested the hypothesis that socio-sexual and locomotor behaviors differ between the sexes and are associated with differences in a range of environmental characteristics experienced among shoals (canopy cover, water depth, aquatic vegetation, and water flow). These environmental characteristics can influence fish behaviors in a variety of ways (Table 1). Previous research has focused on the association(s) between behaviors and environmental characteristics in species that swim throughout the water column [e.g., other viviparous species like Poeciliids (Head et al., 2010), other shoaling species like zebrafish, Danio rerio (Suriyampola et al., 2016(Suriyampola et al., , 2017 or stickleback, Gasterosteus aculeatus (Kim, 2016)]. In contrast, halfbeaks spend the vast majority of their time at the water surface and may therefore respond differently to environmental characteristics (e.g., water depth). This makes it challenging to derive specific a priori hypotheses and predictions about the associations between behaviors and environmental characteristics in this understudied group of viviparous fishes. Nevertheless, based on how environmental characteristics generally influence behaviors in other fish species (Table 1) and our knowledge on halfbeak biology, we predict that: (i) increases in canopy cover will be associated with reduced swimming behavior, fewer sexual and agonistic interactions and an increase in stationary behavior, (ii) increases in aquatic vegetation will be associated with a reduction in sexual and agonistic interactions and an increase in time spent stationary and/or swimming, (iii) increases in water depth will be associated with a reduction in time spent swimming, in sexual and agonistic interactions and an increase in time spent stationary, (iv) increases in water flow will be associated with a reduction in sexual interactions, an increase in agonistic interactions, a reduction in time spent swimming, and an increase in time spent stationary (keeping the same position against the flow). We also predict that, (v) males halfbeaks will perform more agonistic behaviors than females, while females will perform more stationary (anti-predator) behaviors than males.

Field Sites
To quantify fish behavior, we performed non-invasive field observations on 26 pygmy halfbeak shoals in July-August 2019. All field observations were approved by the National Parks Board

Effects of environment Potential effects on behaviors
Canopy cover Abundant canopy cover decreases food availability (Binckley and Resetarits, 2007;Zandonà et al., 2011) and/or quality (Wong and Fikri, 2016) for insect-eating fish, reduces light intensity and thereby the efficacy of visual cues used in courtship or the visual information available to predators (Vales and Bunnell, 1988;Binckley and Resetarits, 2007), and/or increases predation risk from piscivorous birds that use canopy as stakeout locations (Loegering and Anthony, 1999).
Increasing canopy cover may decrease sexual interactions due to reduced efficiency of sexual signaling and increased predation risk, reduce agonistic behaviors due to increased predation risk, reduce swimming due to reduced food availability, and increase stationary behavior due to increased predation risk.
Increasing aquatic vegetation may reduce agonistic behaviors unless aquatic plants are defensible resources. All social interactions should decrease due to fewer encounters with conspecifics. Aquatic vegetation may also reduce anti-predatory behaviors (e.g., remaining stationary) due to reduced predation risk and increase swimming as a search for conspecifics or sexual mates.

Water depth
Deeper water can increase predation risk, as piscivorous fish are more abundant in deeper water (Linehan et al., 2001;Rypel et al., 2007). Water depth may also alter shoal size and social dynamics, affecting hierarchy and social interactions (Sneddon et al., 2006;Flood and Wong, 2017).
Deeper water may reduce sexual and agonistic interactions if fish density decreases, while it may increase anti-predatory behaviors (e.g., remaining stationary and reducing swimming behavior) due to increased predation risk.
Water flow Faster flowing water can restrict spatial movements of fish and thus reduce foraging areas (Salonen and Peuhkuri, 2007) and reduce or alter movement (Allouche and Gaudin, 2001). It can affect predators/prey interactions (Gemmell et al., 2014;Stewart et al., 2014), increase competition for food (Suriyampola et al., 2017) and increase energetic costs of swimming (Head et al., 2010). Water flow can alter fish communication (Mogdans and Bleckmann, 2012) and shoal size (Hockley et al., 2014) and shoal dynamics by either making shoals more (Suriyampola et al., 2016) or less cohesive (Suriyampola et al., 2017).
Faster flowing water may generally reduce all social interactions due to reduced communication possibilities. Sexual interactions may be reduced due to increased energetic costs, while agonistic behaviors may increase due to increased competition for resources. Fish may increase stationary behaviors and reduce swimming behaviors in response to increased flow (fish stay more in the same position).
We focus on four commonly studied environmental characteristics -canopy cover, aquatic vegetation, water depth and water flow -and describe how increases in each environment characteristics can potentially alter factors relevant for fish behaviors. We then suggest potential effect(s) of each environment characteristics on the socio-sexual (courtship and agonistic) and locomotor (swimming and stationary) behaviors we examined in this study.
of Singapore (permit number NP/RP19-077a). All shoals were located within three separate water systems (see Supplementary  Figure 1), including eleven shoals at Jurong Lake Gardens (1 • 20 11.0 N 103 • 43 41.0 E), seven shoals in Seletar river in the Springleaf Nature Park (1 • 24 01.0 N 103 • 48 59.6 E), and eight shoals in an unnamed stream along Squirrel Trail located in Windsor Nature Park (1 • 21 36.3 N 103 • 49 36.6 E). Shoals were identified each day of observation within each water system as a semi-stable aggregation of halfbeaks along a stretch of water's edge. Shoals were not observed far from the water edge (within 2 m) and never covered an area larger than 2 m in diameter. Adjacent shoals were considered separated if at least 3 m distant. Occasionally, individuals or small subgroups (1-4 individuals) were observed to leave their shoal, possibly toward other shoals.
In these cases, we still considered the shoals as independent units (see below). We performed real-time behavioral observations of adult male and female pygmy halfbeaks (described below) in each shoal. GMT + 08:00). None of the behaviors examined in this study were affected by the time of day during which observation occurred (LMM; χ 2 < 4.43, p > 0.11, see Supplementary  Table 4 for all the details). Because our data is zero inflated, a common feature of behavioral data, we calculated average behavioral scores within each shoal and day of observation. Thus, we treated the shoal as the individual unit of replication in our analyses (note that we obtained qualitatively similar results when we treated individuals as the unit of replication in zero inflated models that accounted for shoal identity). In three cases, two shoals were sampled at the same location on different days. In these cases, we assumed that the observed fish were independent as it is unlikely we observed the same fish on different days. Observation took place from the shore, bridges, or platforms, close to the edge of the water. After finding a shoal, the observers (AD and EFI) positioned themselves as close as possible to the water's edge and remained as still as possible. Focal observations started when the fish resumed normal behaviors (usually within few minutes). Briefly, a clearly visible focal individual was randomly chosen in the shoal, with no regard to its current behavior. After selecting a focal individual, the focal observation was immediately initiated. Sex was determined during the observation based on body size (adult females are larger than adult males) and occurrence or absence of the typical sexspecific behaviors (see section below for detailed descriptions). If sex of the fish was not clearly established, the observation was excluded from the analyses. Focal observations within the same shoal and day were performed consecutively. To minimize (not exclude) the risk of resampling the same individual, a new focal individual was selected from another area in the shoal from where the previous focal individual was last seen. Since a large number of observations in a small shoal increases the risk of observing the same individual twice, we limited the number of observations for all shoals and thereby additionally reducing the risk of pseudo-replication.

Behavioral Observations
During observations, a verbal description of the behavior of a single focal individual was recorded using the audio-recording function of a smartphone. Socio-sexual and locomotor behaviors were categorized using a previously defined protocol, based on a consistent ethogram (modified from Greven, 2010), and are described below. Audio files where analyzed using BORIS software (Friard and Gamba, 2016) and behaviors were coded in an excel file for each individual observation. As observations varied in duration, we time-standardized all behavioral scores to obtain the number of behaviors performed per minute.

Sexual Behaviors
Halfbeaks spend considerable amounts of time performing sexual interactions, mainly in the form of courtship behaviors (Greven, 2010;Ogden et al., 2020. see also the Supplementary video). Courtship usually begins with an individual, generally the male, slowly approaching in the line of sight of an individual of the other sex. If courtship continues, the male either starts following the female, where the male swims within 2-3 body lengths of the female, or circling the female, where the male slowly swims in a circular path around the female (Greven, 2010). As courtship continues, males perform a swimming under behavior, where the male's head is positioned under the female's genital pore while she maintains a position that is more or less stationary (Greven, 2010). Swimming under is the most conspicuous and time-consuming sexual behavior performed by males (Ogden et al., 2020;see results). While swimming under a female, males can perform checking behaviors, where the male touches the female's body with his upper beak, and nipping behaviors, where the male rapidly opens and closes his beak (note that observations of checking behavior were rare in this study and nipping was not observed at all as it is impossible to observe when viewing fish from above, Greven, 2010). Switching to new female may occur at any point during these bouts of courtship, where a male changes the female that the courtship behaviors are directed toward. Following often prolonged bouts of courtship, males can perform a mating attempt, where the male rapidly (∼40-80 ms, Greven, 2010) moves from the position under the female, twists his body and attempts to transfer sperm to the female's genital pore using a modified anal fin (andropodium). Females can likely influence male mating success through her decision to maintain a still position, although this has yet to be empirically validated. These behaviors were scored differently between the sexes as only males perform these distinct courtship behaviors.
For males, we recorded the duration and number of courtship behaviors directed toward females, while for females we recorded the duration and number of courtship behaviors they experienced during the behavioral observation. This allows us to describe sexspecific sexual interactions. Thus, if males and females are equally likely to perform and receive courtship behaviors then we would not expect sex effects to emerge in our analyses.
We derived two metrics of total courtship behaviors for each shoal. Within sex, we first created an index of the total duration of sexual interactions by summing the shoal-mean values of all continuous measures of courtship (i.e., the total time spent following and swimming under). We then created an index of the total number of sexual interactions by summing the shoal-mean values of all discrete courtship events that were observed (i.e., the total number of approaching, circling, checking, switching to a new female and mating attempts).

Agonistic Behaviors
Halfbeak males (and to a lesser degree females, see the Supplementary video) perform frequent agonistic interactions both within and between sexes (Berten and Greven, 1991;Greven, 2006;2010;Reuland et al., 2020b). We recorded agonistic interactions between individuals, which were clearly visible when observing fish from above (see Supplementary video). Agonistic behaviors include chase and being chased behaviors, which occurs when a focal individual either pursues or is pursued by a conspecific at higher than normal swimming speed (often in a sprint, Greven, 2010). We also recorded the number of displace and being displaced behaviors, where an individual approaches another causing one to move away (Greven, 2010). Furthermore, we recorded the number of frontal threatening behaviors, where an individual aggressively approached a conspecific, usually from the front and without increasing swimming speed, with the two individuals facing each other (Greven, 2010). The frontal threatening behavior is often the first step toward a sustained escalated contest, but the conflict is usually resolved by an individual moving away before escalation. We recorded biting behavior, when individuals rapidly approach a conspecific and bite or hit it on the body or fins (Greven, 2010). Generally, escalated agonistic behaviors involving body contact between two individuals are rare, but when they do occur they involve fish biting each other and locking their beaks together (known as wrestling). Wrestling was never recorded in our observations.
We generated an index of the total number agonistic behaviors for each shoal by summing the shoal-mean values of the total number of chase/being chased, displace/being displaced, frontal threatening and biting behaviors observed, separately for males and females. Under laboratory conditions, halfbeak males form dominance hierarchies, where dominant individuals are more likely to perform agonistic behaviors and subordinate individuals are more likely to receive agonistic behaviors (Reuland et al., 2020b). Therefore, by including agonistic behaviors that were both performed and received by focal fish during the observations, our metric of the total number agonistic behaviors captures overall levels of shoal agonistic behaviors, regardless of a focal individual's position in a potential dominance hierarchy.

Locomotor Behaviors
When not involved in agonistic or courtship activity, halfbeaks perform locomotor behaviors at the water surface. Locomotor behaviors include swimming, moving spatially without direct interactions with conspecifics, and stationary behaviors, where individuals exhibit no spatial translocation and do not interact with conspecifics. We focus on the total duration of stationary behaviors and the total duration of swimming behaviors by calculating the shoal-mean values of each behavioral category for each shoal.

Characterization of Environmental Variation
After behavioral observations, we characterized the ecological characteristics of the location were the shoal was observed (Supplementary Figure 1). Specifically, we described the amount of canopy cover above each shoal, the density of aquatic vegetation, the depth of the water, and water flow at each site. To quantify canopy cover, AD and EFI stood by the water edge where a shoal was found and noted whether and how much land-based vegetation hung over the shoal within 2 m upstream and downstream from the shoal location. Estimates of canopy cover were made regardless of how high the vegetation was above the water surface. We classified shoals as having canopy cover that was absent (n = 10, no canopy above the observation site), intermediate (n = 8, incomplete canopy cover above the site) or full (n = 8, complete canopy cover above the site). The amount of aquatic vegetation present in the water where each shoal was observed was scored as present (n = 15, at least part of the shoal was observed swimming near aquatic vegetation), or absent (n = 11, no aquatic vegetation was growing in the water where shoal was observed). Water depth was estimated for each shoal by placing a stick of known length inside the water to estimate whether it was deeper or shallower than 30 cm and classified as either shallow (n = 16, <∼30 cm) or deep (n = 10, >∼30 cm). Water flow was classified as either still (n = 13) or moving (n = 13), based on the movement of floating debris on the water surface. We expect halfbeaks to be affected in a similar way as floating debris since halfbeaks occupy the very top of the water column.
Where possible, we estimated the number of individuals present in each shoal. To do this, AD and EFI independently counted the number of halfbeaks present at the site three times each. The average of the six counts was then used. We were unable to estimate shoal size in four shoals, reducing the sample size to 22 in analyses assessing shoal size.

Assessing Covariance Among Socio-Sexual and Locomotor Behaviors
We examined sex-specific patterns of covariance among sociosexual behaviors (total duration of sexual interactions, number of sexual interactions, number of agonistic behaviors) and locomotor behaviors (duration of stationary behavior and duration of swimming behavior) by constructing a Spearman correlation matrix. Correlations were calculated using the Hmsic package 1 in R (version 4.0.2), with each sex treated separately.

Principal Component Analysis on Fish Behaviors
When examining how socio-sexual and locomotory behaviors are associated with ecological variables, we first used principal component analysis (PCA) to combine our five behavioral index variables (total duration of sexual interactions, number of sexual interactions, number of agonistic behaviors, duration of stationary behaviors and duration of swimming behaviors) into a reduced set of orthogonal principal components (PCs). This analytical step reduced the number of independent tests performed when assessing if behaviors differ according to ecological variables, accounts for potential collinearity among behavioral variables, and facilitates comparisons of duration and count data in a single analysis. The PCA returned three PCs with eigenvalues ≥ 1, which cumulatively accounted for 90.0% of the total variance in the data and were considered in further analyses (Supplementary Table 2). When interpreting each PC, we considered loading values that are ∼70% of the variable with the largest loading to contribute strongly to that PC (Mardia et al., 1979).

Do Socio-Sexual and Locomotor Behaviors Differ Based on Environmental Characteristics and Sex?
We performed distinct linear mixed effects models (LMM) to assess how each of the three PCs vary accordingly to four environmental variables when considered separately (canopy cover, aquatic vegetation, water depth and water flow). In all models, we included sex as a fixed effect and the interaction between each environmental variable and sex. Non-significant interaction terms were removed and simplified models are presented. All models include shoal identity as a random effect to account for the fact that males and females were sampled from the same shoal within each of the 26 shoals assessed. We refrained from building more complex models that included multiple environmental variables as we were concerned about overfitting our models given the number of shoals assessed (n = 26) and total number of levels in our fixed effects (n = 3 levels for canopy cover, n = 2 levels for aquatic vegetation, n = 2 levels for water depth, n = 2 levels for water flow). The LMM models were performed using the lmer function in the lme4 package 2 in R [example of model's syntax: PC1∼Sex * Canopy + (1| Shoal)]. The interaction between fixed effects was removed if not significant. Significant main effects of canopy cover (the only predictor variable with more than two levels) were examined using pairwise Tukey post hoc comparisons in the emmeans package 3 in R. The direction of all other significant effects was determined by examining model parameters and visually with the aid of the effects package 4 in R.
When assessing how shoal size differed among different environments, we accounted for the left skewed distribution of shoal size using generalized linear models (GLM) fitted with a quasipoisson error distribution using the glm function in R. As above, we examined ecological variables (canopy cover, aquatic vegetation, and water depth) as fixed effects in separate models. To assess how shoal size was related to socio-sexual and locomotor behaviors we performed separate LMM using the lmer function in the lme4 package, where PC1, PC2, and PC3 were entered as dependent variables (in separate models) whereas group size (log transformed) and sex were included as fixed effects and shoal identity was entered as random effect. Non-significant interaction terms were removed and simplified models are presented.

A Note on Water Systems
Although the shoals originated from three different water systems (i.e., Jurong Lake Gardens, Springleaf Nature Park, Windsor Nature Park), we were unable to incorporate this data structure into our analyses for several reasons. First, we could not model the different water systems as random effects, as three levels are too few to allow for reliable estimates of the amongsites variation (Harrison et al., 2018). Second, our dataset is not large enough to adequately incorporate many random factors (Harrison et al., 2018). Third, the ecological variables we investigated varied differently within each water system, which leads to overparameterized and unbalanced models when including water system as a fixed effect in our analyses. Given these limitations, we did not include water system in our analyses, as our primary aim was to assess how intraspecific behaviors vary across sex and ecological and social context.

Descriptive Summary of Halfbeak Behaviors and Shoal Size
Sexual, agonistic and locomotor behaviors were variable among shoals and between the sexes (summarized in Supplementary  Table 3). Despite general similarities in the pattern of sociosexual behaviors observed in male and female halfbeaks, the duration and number of sexual interactions, as well as number of agonistic behaviors and duration of swimming duration, was reduced in females. The mean shoal size was 34.59 (±7.68 S.E.) across 22 shoals but the number of individuals in each shoal varied widely, ranging from 6-128 individuals.
Within shoals, males followed females (16.18 ± 1.74 s/min, mean ± S.E.) nearly eight times longer than they swam under females (2.06 ± 0.54 s/min, mean ± S.E.). When considering the total duration of sexual interactions recorded, males spent nearly one third of their time performing either following or swimming under behaviors, although in one shoal males devoted as much as 74% of their time in performing courtship behaviors. Similarly, females were followed by males (10.06 ± 1.68 s/min, mean ± S.E.) eight times longer than they had males swimming under them (1.23 ± 0.33 s/min, mean ± S.E.). However, females had a total duration of sexual interactions (courtship behavior received from males) for around one fifth of their time. When considering discrete sexual interactions (see Supplementary Table 3 for details), males performed on average 1 (0.97 ± 0.19 behaviors/min; mean ± S.E.) discrete sexual interactions (including approaching, circling a female, checking, switching to a new female or attempting to mate) every minute within the shoals, with circling a female being the most common (0.41 ± 0.13 behaviors/min, mean ± S.E.) discrete behavior observed. While females also received more circling behaviors (0.13 ± 0.04 behaviors/min, mean ± S.E.) than any other discrete courtship behavior, they experienced on average less than one sexual interaction every 2 min (0.43 ± 0.08 behaviors/min, mean ± S.E.).
Chasing behaviors made up the vast majority of agonistic behaviors observed in both males (0.85 ± 0.26 behaviors/min, mean ± S.E.) and females (0.15 ± 0.08 behaviors/min, mean ± S.E., see Supplementary Table 3). However, while within a shoal, males performed an average of 1.78 (±0.30 S.E.) agonistic behaviors each minute, females performed 0.23 (±0.10 S.E.) agonistic behaviors each minute. All other agonistic behaviors occurred less frequently, with females generally showing lower rates of agonistic behaviors than males (Supplementary Table 3).
Males spent slightly more time swimming than stationary, and together these locomotor behaviors accounted for an average of 57% of the males' time in the shoal (34.38 ± 2.14 s/min, mean ± S.E, see Supplementary Table 3). In contrast, females spent more than twice as much of their time remaining stationary than swimming, with these locomotor behaviors making up an average of 77% of a female's time in the shoal (46.22 ± 1.81 s/min, mean ± S.E., Supplementary  Table 3). When only considering behaviors where durations were recorded, it was clear that males allocated roughly equivalent amounts of time to performing sexual (mean of 30.4%), stationary (mean of 24.4%) and swimming (mean of 32.9.5%) behaviors (Supplementary Table 3). Females spent about a fifth of their time on sexual interactions (receiving courtship behaviors from males, mean of 18.8%), a fifth on swimming (mean of 23.4%), and more than half of their time on remaining stationary (mean of 53.6%). The remaining time (12.3% for males and 4.2% for females) was not measured directly and was spent by individuals in performing discrete behaviors (e.g., chasing, biting, or circling) that were not considered when measuring continuous behavior.

Assessing Covariance Among Socio-Sexual and Locomotor Behaviors
There was evidence for covariance among socio-sexual and locomotor behaviors in both males and females ( Table 2). In shoals where males performed longer durations of sexual interactions, males also performed greater numbers of sexual interactions. Males faced an apparent trade-off in their time budget, performing sexual behaviors for shorter durations and swimming for shorter durations when they stayed stationary for longer durations (Table 2a). Among females, there was apparently a similar trade-off, with stationary duration being negatively correlated with both the duration of sexual interactions (received courtship behaviors) and swimming behaviors. None of the other behaviors were correlated for either sex ( Table 2). In particular, agonistic behaviors were not significantly associated with any other behavior for either males or females.

Principal Component Analysis of Fish Behaviors
The first principal component (PC1) explains 43% of total variability and is primarily loaded positively by the total duration of stationary behavior and negatively by the duration and number of sexual interactions (Supplementary Table 1). Therefore, increases in PC1 reflect individuals remaining stationary for long durations and performing (males) or receiving (females) less courtship behaviors. The second PC (PC2) explains 27% of total variability and is primarily positively loaded by the total duration of swimming behavior and negatively loaded by the duration of sexual interactions (Supplementary Table 1). Increases in PC2 are consistent with reductions in courtship behaviors and increases in swimming behavior. Finally, the third PC (PC3) explains 20% of total variability and is primarily loaded by the total number of agonistic behaviors (Supplementary Table 1), such that increases in PC3 indicate more frequent agonistic behaviors.

Do Socio-Sexual and Locomotor Behaviors Differ Based on Environmental Characteristics and Sex?
Variation in canopy cover was associated with a shoal-level difference in PC1, the composite measure of stationary behavior and sexual activity (LMM: χ 2 = 8.05, p = 0.02, Figure 1A and Table 3a). Post hoc tests revealed that PC1 values were significantly lower when the canopy cover was absent than when canopy cover was full (Tukey post hoc: t-ratio = 1.13, p = 0.03), while PC1 values in sites with average canopy were intermediate and did not differ from sites where the canopy cover was either absent (Tukey post hoc; t-ratio = 0.24, p = 0.83) or full (Tukey post hoc: t-ratio = 0.89, p = 0.12). This indicates that longer and more numerous sexual interactions and shorter stationary behaviors were performed in sites where the canopy cover was absent, while the opposite occurred in sites where the canopy cover was full. PC2, the composite measure representing duration of swimming behavior and sexual activity, and PC3, the composite measure of agonistic behaviors counts, were not associated with variation in canopy cover (Table 3a).
Neither aquatic vegetation nor water depth were associated with any difference in PC1, PC2, or PC3, suggesting that halfbeak behavior did not differ among variants of these environmental characteristics (Tables 3b,c). The composite measure of duration of swimming behavior and sexual activity (PC2) significantly varied according to water flow (LMM: χ 2 = 5.53, p = 0.02, Table 3d), with longer sexual interactions occurring for both males and females in sites with still water and longer durations TABLE 2 | Spearman correlation coefficients (above the diagonal) and respective p values (below the diagonal) are shown for the total duration and number of sexual interactions, the total number of agonistic behaviors, and the total duration of stationary and swimming behaviors in each shoal in (a) males and (b) females. The sexual interactions for males is based on the performed courtship behaviors while for females it is based on received courtship behaviors. Significant correlations are highlighted in bold.

Sexual interactions (duration) Sexual interactions (number) Agonistic behaviors Swimming behaviors Stationary behaviors a) Males
FIGURE 1 | The boxplots represent in (A) the association between PC1 (43% of variance explained) and canopy cover, where duration and number of sexual interactions decrease and stationary behavior increases with increasing canopy cover. In (B) the association between PC2 (20% of variance explained) and water flow, where duration of sexual interactions increases and time spent swimming decreases in still water compared to moving water.
of swimming behaviors in sites with moving water (Figure 1B). PC1 and PC3, on the contrary, were not affected by water flow. PC1 values significantly differed between the sexes, with males performing more sexual interactions for longer durations, while females spent more of their time remaining stationary within each shoal (LMMs: χ 2 = 48.15, p < 0.001; see Tables 3ad and Figure 2A). PC2 did not differ between sexes (LMMs in Tables 3a-d, Figure 2B), suggesting that the contrast between the time spent in sexual interaction and swimming was not different across sexes. For PC3 there was a clear influence of sex, with males performing more agonistic behaviors than females (LMMs: χ 2 = 12.33, p < 0.001; Tables 3a-d, Figure 2C). Significant differences between the sexes in PC1 and PC3 were consistent across all models (Tables 3a-d). In Each environment was tested separately for each PC. PC1 explains 43% of total variance and is the composite score representing duration and number of sexual interactions (negatively loaded) and duration of swimming (positively loaded). PC2 explains 27% of total variance and is the composite score representing duration of sexual interactions (negatively loaded) and duration stationary behavior (positively loaded). PC3 explains 20% of total variance and is the composite score representing agonistic interactions (positively loaded). Statistically significant results in bold.
general, these finding suggest that males perform less stationary and more agonistic behaviors as well as experienced more and longer sexual interactions than females across a range of environments.

DISCUSSION
By comparing socio-sexual and locomotor behaviors among natural halfbeak shoals, we demonstrate that halfbeaks behave differently in different environments. However, contrary to our predictions, only two of the environmental characteristics considered influenced how halfbeak shoals invest time in different types of activities. Sexual interactions and locomotor behaviors varied according to both canopy cover and water flow. In contrast, neither the depth of the water nor the presence of aquatic vegetation showed any association with sexual or locomotor behaviors. Agonistic behaviors were frequent across all shoals and robust to changes in the external environment. Males were less stationary than females and spent more time swimming. Moreover, males were more aggressive and experienced on average more sexual interactions than females. We observed larger shoals in environments with still water as well as in sites characterized by the absence of aquatic vegetation. Shoal size did not affect any behavior considered, but large shoals may require more individuals to be sampled to get a better estimate of mean behaviors. Together, these results provide some support for the hypothesis that environmental characteristics covary with socio-sexual and locomotor behaviors among halfbeak shoals. Canopy cover was associated with differences in socio-sexual and locomotor behaviors in wild halfbeak shoals, with halfbeaks performing more sexual interactions when canopy cover was absent and remaining stationary for longer durations when canopy cover was full. There are multiple non-mutually exclusive explanations for these results. First, dense canopy may reduce food (i.e., insect) availability (Binckley and Resetarits, 2007;Zandonà et al., 2011). As halfbeaks exclusively feed on small invertebrates on the surface of the water, changes in food availability associated with increased canopy cover may lead halfbeaks to prioritize energy conservation at the cost of sociosexual interactions and movement or alter halfbeak feeding behaviors toward a 'sit and wait' strategy. Second, canopy cover limits the amount or intensity of light reaching the water surface with possible effects on mate choice based on visual stimuli (as seen for example in P. reticulata Endler, 1987; and in the poison frog Dendrobates pumilio, Summers et al., 1999). Halfbeaks may therefore perform fewer costly sexual displays when light conditions are poor. If this is the case, it would be interesting to test if shoals permanently inhabiting environments with reduced light intensity have evolved morphological differences compared to populations in open areas. Such variation in male ornamental coloration due to differences in light condition have been previously observed in sticklebacks (Rick et al., 2014) and guppies (Kemp et al., 2018). Third, canopy cover may alter predation risk. As pygmy halfbeaks are specialized surface feeders and spend most of its time at the water surface, avian predation is likely a main predation pressure in this species (Ho et al., 2015). The rich avian fauna of Singapore counts eight different kingfisher species, as well as twenty-two species of herons (Davison and Yeap, 2010; Nature Societey (Singapore), 2020), most of which potentially prey on halfbeaks. Canopy could increase shelter and stakeout locations for such piscivorous birds. Stationary behavior may be a successful anti-predator strategy against avian predators  Table 3).
in halfbeaks, and in our study we found a negative correlation between sexual interactions and remaining stationary, which supports a prediction from the predation hypothesis (Loegering and Anthony, 1999;Kelley, 2008). Water flow rate was associated with an expected reduction in sexual interactions but also an unexpected increase in swimming behavior. Swimming across the water body may enhance fish success in finding floating food. Moreover, faster flowing water can reduce shoal size (Hockley et al., 2014) and shoal cohesion (Suriyampola et al., 2017). It seems plausible that in less cohesive shoals, males may spend more time moving in search of females and less time in courting them. Additionally, halfbeak mating success is strongly dependent on the ability of males and female to maintain synchronized positions. It is possible that faster water flow reduces fish ability to stay still and males therefore reduce mating effort as copulation success is low. Sexual interactions may be more common on days when the water flow is slower (e.g., in the dry season). Sampling the same locations on several different days and/or times of the year and directly quantify flow rates would help to further resolve how water flow shapes halfbeak behaviors.
Interestingly, our findings of how halfbeaks respond to differences in canopy cover and water flow differ from the patterns found in guppies, P. reticulata, a model system where the numerous interactions between environments and behaviors are well-studied. In most Trinidadian drainages, the original habitat of guppies, it is well established that guppy populations living upstream of waterfall barriers show different characteristics than populations living downstream of waterfalls (Endler, 1995). These differences include age and body size at maturity, male coloration, sexual behavior (reviewed in Houde, 1997) and ejaculate traits (Devigili et al., 2019). Specifically, male guppies in downstream populations are smaller and less colored, and perform fewer sexual displays. Downstream Trinidadian rivers are characterized by less canopy cover (Torres-Dowdall et al., 2012) and slower water flow (Reznick et al., 2001). Our finding of increased sexual behaviors when canopy cover is absent and water flow is low therefore contrast with the body of literature on guppies. Importantly, these among-population differences in guppies are related to predator abundance directly, rather than stream characteristics per se. Guppy predation is mainly due to other fishes, typically species of Characidae and Cichlidae families (Magurran, 2005). These guppy predators are absent in upstream sites, releasing upstream population from predation and resulting in evolutionary-derived differences between guppy populations. In contrast, the distribution of potential halfbeak predators in Singapore suggests piscivorous fish and birds are present throughout all of the local halfbeak habitats we evaluated (Davison and Yeap, 2010;Baker and Lim, 2012). Hence, we do not expect some water bodies to be deprived of potential predators. Instead, local variation in environmental conditions might influence the small-scale distribution of halfbeak predators within same sites or the antipredatory behavioral response of prey fishes. These differences may explain why our results suggest that guppies and halfbeaks respond differently to the environmental characteristics of canopy cover and water flow. Water depth and aquatic vegetation were not associated with the behavioral traits measured in halfbeaks. Both of these environmental characteristics were hypothesized to influence the strength of predation from piscivorous fish. Our results therefore suggest that predation imposed by other fishes actually may be low or constant in the studied populations (Ho et al., 2015). However, additional surveys and experiments are necessary to validate this hypothesis. Contrary to our hypothesis, as well as a recent laboratory experiment demonstrating that adding a visual obstruction to the environment reduces aggression between male halfbeaks (Reuland et al., 2020b), in this study aquatic vegetation was not associated with differences in agonistic interactions in natural halfbeak populations. It is plausible that the specialized surface-dwelling lifestyle of halfbeaks may reduce the importance of both water depth and aquatic vegetation in shaping sociosexual behaviors, particularly when compared with other fish species that swim throughout the water column.
We observed large variation in group sizes across shoals. Larger shoals were found in environments characterized by the absence of aquatic vegetation and slower flowing water. A simple explanation for this result is that when the space at (or just below) the water surface is restricted, individuals are unable to form large shoals. Alternatively, larger shoals may provide more benefits in obstacle-free environments. For example, in other systems, aquatic plants can work as refuge against predators (Lantz et al., 2010;Orrock et al., 2013;Penaluna et al., 2016) but in environments lacking such refuges, gathering in bigger groups can reduce predation through dilution, group guarding and improved collective decision making (e.g., Magurran et al., 1985;Godin, 1997;Hoare et al., 2004;Brown et al., 2006;Ward et al., 2011). Still or slowly flowing water has been linked with larger aggregations of fish compared to faster flowing water (e.g., Hockley et al., 2014;Eggertsen et al., 2016), but the opposite has been shown as well (e.g., Shelton et al., 2020). Many factors interact with flow to alter shoaling behavior, for example, parasite infection (Hockley et al., 2014) and the presence or absence of predators (Allouche and Gaudin, 2001). Furthermore, freshwater fishes like chub (Leuciscus cephalus) seek out more turbulent waters in areas with high flows since turbulence acts as a cover from avian predators (Allouche and Gaudin, 2001). Clarifying the interaction between shoal size, environmental characteristics and predation risk will be an important next step.
Socio-sexual and locomotor behaviors consistently differed when measured in males and females. Sexual interactions and agonistic behaviors were more pronounced in males than females and females stayed stationary for longer across all environments. Halfbeaks therefore seem to conform to classic sex roles, with males performing more agonistic behaviors, primarily directed at other males, and being the courting sex. The difference in the amount of sexual interactions measured in males and females support the recent finding of strong male mate choice in the halfbeak (Ogden et al., 2020). In the laboratory, male halfbeaks prefer females with large gravid spots which may indicate female sexual receptivity (Ogden et al., 2020). Similar male preferences for females with large gravid spots in natural populations could explain the sex-specific rate in sexual interactions we detected, although this idea requires further study. An alternative explanation is that natural shoals have female-biased sex ratios. This explanation seems unlikely however, as natural shoals appeared to have either equal or slightly male biased sex ratios (AD and EFI pers. obs.). Moreover, females likely spend time out of the mating pool when gravid, suggesting that the operational sex ratio is likely male biased. Therefore, we suggest that male mate choice represents the most parsimonious explanation for the sex-specific difference in sexual interactions.

CONCLUSION
In conclusion, we report that socio-sexual and locomotor behaviors vary in environments characterized by different canopy cover and water flow, but are not influenced by shoal size among natural populations of halfbeaks in Singapore. Key follow up studies should include, (i) assessing whether behavioral variation within and between sexes is influenced by more complex environmental interactions, (ii) testing these complex interactions experimentally, (iii) determining if separated populations evolved according to environmental differences, and (iv) whether there are genetic signatures of this difference across populations. This study represents the first examination of halfbeak behaviors in natural populations and highlights the suitability for studying behavioral ecology using this species. We also suggest that future research may focus on comparing the pygmy halfbeak, together with other halfbeaks species, with the well-studied Poeciliid fishes (sensu Reznick et al., 2007).

DATA AVAILABILITY STATEMENT
The original contributions presented in the study are included in the article/Supplementary Material, further inquiries can be directed to the corresponding author/s.

ETHICS STATEMENT
The animal study was reviewed and approved by National Parks Board of Singapore NP/RP19-077a.

AUTHOR CONTRIBUTIONS
AD, EFI, and JF designed the study and analyzed the data. AD, EFI, and NP organized the field work. AD and EFI collected the data. All authors contributed in writing the manuscript.

ACKNOWLEDGMENTS
We thank the editor JZ-V as well as two reviewers for the helpful comments provided. We also want to thank the staff at the Singapore National Parks for the support and Jonathan Ho Kit Ian for the helpful suggestions on where to find wild halfbeaks in Singapore. We thank Mirjam Amcoff for help during the organization of the field trip and Laurence Gwee for the help with permit documents.

SUPPLEMENTARY MATERIAL
The Supplementary Material for this article can be found online at: https://www.frontiersin.org/articles/10.3389/fevo.2021. 607600/full#supplementary-material and includes the R code used to perform all statistical analyses.