### Data

The data set used for our analysis contains information about fish positions recorded with acoustic telemetry techniques between July and September 2009 in the Rhône River (France). In acoustic telemetry, the fish are tagged with acoustic transmitters that are then detected by receiver stations deployed in their natural environment. These data were collected as part of a research project conducted in a 1.8 km long and 140 m wide river segment. The purpose of the project was to track the movements of 94 fish captured in June 2009 in the river segment. For more details about the experiment see (Bergé et al. 2012; Capra et al. 2017; Lamonica et al. 2020). In favorable areas, fish position can be received every 3 s. However, the signal can be subject to discontinuity in certain area of the river segment. Moreover, the presence of tagged fish in the study area can be very irregular and highly dependent on the fish individuals and the fish species. To assess the quality of the individual fish data, we segment each day of observation into 288 5-min periods and compute the fraction \(\gamma\) of periods during which the position of the fish was recorded at least once. Based on this metric, we selected ten fish among the most frequently localized individuals that belong to three species: four barbels (*barbus barbus*), two catfishes (*ictalurus melas*) and four chubs (*squalius cephalus*). For each fish individual, we selected the 10 days exhibiting the highest \(\gamma\) values. On average we detected the presence of the fish in the study area \(85\%\) of the day, with a minimum presence of \(60\%\) and a maximum of \(100\%\). More details regarding the fish and day selection processes are available in Supplementary Information (Additional file 1: Figs. S1 and S2).

### Daily spatio-temporal trajectory

Fish trajectories are characterized by a sequence of visited locations. To build these sequences, both time and space need to be discretized. Each day is segmented into 288 5-min periods and the river segment is divided into a regular grid composed of square cells of lateral size 20 m. Each 5-min period is assigned a location (i.e. a grid cell) if a position was recorded in that time interval. If no position is recorded during a time period, we assign it an unknown location. If the presence of a fish is detected into several grid cells in a given 5-min period, we choose the cell with the highest number of records. In the event of a tie, one of them is drawn at random. Nevertheless, in most of the cases, fish individuals spend most of their time in one location during a time interval (Additional file 1: Fig. S3a). At the end of the process, we obtain 100 daily spatio-temporal trajectories (10 days for each of the ten selected fish). A daily trajectory is represented by a spatio-temporal sequence \(S=\{X_1,...,X_T\}\) of locations at which a fish was observed at each consecutive 5-min interval (\(T=288\)). It is important to note that some of these locations are unknown. However, the periods during which the presence of a fish is not detected in the study area during the selected days represents on average less than \(15\%\) of the time. Moreover, consecutive time periods with unknown location last generally less than 15 min (Additional file 1: Fig. S3b).

### Resting event networks

The daily spatio-temporal trajectories defined in the previous section can be decomposed in a succession of events devoting to different fish “activities”. An event *e* is a sub-sequence \(S_e \subseteq S\) of consecutive locations. It is characterized by a starting time period \(t_e\) and a duration \(\Delta _e\). In this work, we consider that a resting event *r* occurs when a fish rests in the same location during at least \(\lambda\) consecutive time periods (\(\Delta _e \ge \lambda\)). We assume that unknown locations are always associated with non resting event whatever their duration. We only consider resting event starting and ending during the day (i.e. \(t_e > 1\) and \(t_e + \Delta _e - 1 < 288\)).

For each fish, we obtain a collection of resting events *R* representing every resting events identified among the ten daily spatio-temporal trajectories. Whether an event belongs or not to *R* depends on the threshold \(\lambda\). Indeed, if \(\lambda =1\) all the events are considered as resting events, and inversely, if \(\lambda > 288\) the entire trajectory will be consider as a non resting event. We may assume that the chosen value will depend on the type of animal but, in our case, the value \(\lambda =3\) (15 min) seems to be a good compromise allowing us to preserve a reasonable number of resting events per day (between 6 and 28) while minimizing the variability across daily spatio-temporal trajectories (see Additional file 1: Fig. S4 for more details).

Now that the nodes of the resting event networks are formally defined, we need to connect them according to their similarities from both the spatial and temporal point of views. To this end, we propose two similarity metrics, \(\delta _t\) and \(\delta _s\), to link the events according to their spatio-temporal proximity. \(\delta _t\) computes the number of time periods shared by two events while \(\delta _s\) measures the spatial proximity between two events *e* and \(e'\) based on the distance \(d_{ee'}\) between the event locations (Eq. 1). To be more specific, the distance \(d_{ee'}\) is equal to the euclidean distance between the centroids of the cells where the events *e* and \(e'\) occurred (expressed in meters).

$$\begin{aligned} \delta _s(e,e')=\frac{1}{1+d_{ee'}} \end{aligned}$$

(1)

In this work, we decided to focus on the temporal proximity to build the topological structure of the networks and on the spatial proximity to define the intensity of interactions between events. More specifically, a link is created between two events \(e \ne e'\) if \(\delta _t(e,e')>0\) and the weight of a link between them is equal to \(\delta _s(e,e')\). The creation of a link thus implies that two events share at least one time period. Since two events occurring at the same day do not overlap in time, it therefore follows that there is no link between events occurring at the same day. This is an important characteristic of the resting event networks that we propose in this study. At the end of the process, we obtain one weighted undirected spatio-temporal resting event network per fish.

### Null model

To properly characterize the event networks and identify potential daily mobility patterns in fish trajectories we first need to define a null model (NM). Null model analysis are really useful to identify non-random patterns. In our case we need to generate random event networks preserving the observed events spatio-temporal characteristics: the number of events, the events duration and day of occurrence, and the global spatial distribution of events. The topology of the resting event network introduced in the previous section is strongly constrained in time. Indeed, the probability \({\mathbb {P}}(\delta _t(e,e')>0)\) of connecting two events in a random situation is highly dependent of the events’ duration and whether they occurred on the same day or not. We can however take these temporal constraints into account by generating random networks’ topology in which, for a given day, starting events time are drawn at random along the day. In other words, we reshuffled, for each fish, the starting time of every events of the resting event network while preserving the day of occurrence of the events and their duration. Regarding the spatial component of the network (i.e. link weights), we generated random weights \(\delta _s(e,e')\) by reshuffling the resting events’ location, thus preserving the spatial distribution of events locations over the 10 days of observation. Using this approach we generate 100 random event networks for each fish.

### Network measures

#### Degree

Networks topology can be quantitatively described by a wide variety of measures. The most important of them is probably the node degree. The degree of a node is the number of connections that links it to the rest of the network. To evaluate to what extent the degree distributions are characteristic of the event networks structure, we will compare these distributions to the ones returned by the null models.

#### Dilatation index

Resting event networks are also spatial networks. To characterize the spatial component of event networks we introduce the Dilatation Index (DI) defined as the average pairwise euclidean distance between connected events. This metric is expressed in meters and defined as follows,

$$\begin{aligned} DI=\frac{1}{|A|}\sum _{(e,e') \in A} d_{ee'} \end{aligned}$$

(2)

where \(A=\{(e,e') \in R \times R \,\, | \,\, e \ne e' \,\wedge \, \delta _t(e,e')>0\}\) represents the set of pairs of connected events. As defined above, \(d_{ee'}\) is equal to the euclidean distance between the centroids of the cells where the events *e* and \(e'\) occurred (expressed in meters). In order to contrast the results, two other dilatation indices are also considered, \(DI_{tot}\) defined as the average pairwise euclidean distance between all the events (i.e. \(A=\{(e,e') \in R \times R \,\, | \,\, e \ne e'\}\)), and, \(DI_{NM}\) defined as the average pairwise euclidean distance between connected events generated with the null model described above.

#### Network community structure

Community structure is an important network feature, revealing both the network internal organization and similarity patterns among its individual elements. In this study we used the Order Statistics Local Optimization Method (OSLOM) algorithm proposed in Lancichinetti et al. (2011) that detects statistically significant network community with respect to a global null model (i.e. random graph without community structure). This algorithm is non-parametric in the sense that it returns the optimal statistically significant partition without defining the number of communities *a priori*. More details about OSLOM are available in Supplementary Information. In our case, the purpose is to identify spatio-temporal communities clustering events exhibiting significant temporal and spatial proximity.

#### Network motifs

An interesting local network property is recurrent patterns, repeating themselves in a network, and usually called network motifs. In this study, a motif is defined as a displacement between spatio-temporal communities. To be more specific, two consecutive resting events occurring the same day can be interpreted as a spatio-temporal displacement between the community to which the first event belong to the community of the second event. We call this displacement a motif characterized by a movement between a community of origin and a community of destination that can be identical. A motif can be seen as an ordered pair of communities. Hence, for every fish and day of observation we can extract a list of daily motifs. Similarly to the method used in Clemente et al. (2018), the Sørensen index (Sørensen 1948) is used to define matrices of similarity between lists of daily motifs. This index varies from 0, when no agreement is found, to 1, when the two lists are identical. For each fish, we obtain 45 comparisons, each of them assessing the motifs similarity between 2 days of observation that can be used to investigate daily mobility patterns. More detail about the method used to compute the similarity between daily motifs are available in Supplementary Information.