dataesr/scientific-paragraphs-categorization huggingface dataset:
In this analysis, ASV counts estimated from faecal microbiota data were aggregated at the genus level within each time point of interest (day 0 or day 132) using the tax_glom function of the phyloseq package v. 1. 32. 0. They were then filtered to retain those reaching 5% prevalence (n = 45 and 41 at day 0 and day 132 respectively), and normalized with the centered log-ratio transformation of the mixOmics package  81. 1  H NMR data consisted in the 319 metabolite signal intensities retained following filtering and outlier identification with ASCA. Clinical data consisted of 18 parameters. At day 0, ADG was not considered as no variation occurred leaving 17 parameters. FEC was not considered as it was used to define the groups to be compared. Data integration was performed following the DIABLO (data integration analysis for biomarker discovery using latent variable approaches for Omics studies) framework  82  as implemented in the mixOmics package v.
6. 12. 2. This algorithm implements a sparse generalized canonical correlation discriminant analysis (sGCC-DA)  42, 82. Briefly, DIABLO performs feature selection, thereby retaining the only bacterial genera, metabolite signal or clinical parameters with best discriminative ability between groups. Using this sparse dataset, DIA-BLO then seeks for latent components (linear combinations of features from each dataset, i. e. 1 H-NMR, faecal microbiota, and clinical parameters) that simultaneously explains as much as possible of the covariance between input datasets and the status of interest, i. e. pony resistance potential before or under infection  42, 82. We applied this analysis to discriminate between TR and TS ponies either before the onset of pasture season (day 0) or at pasture turnout (day 132).
In each case, the number of features to be retained was determined by cross-validation analysis (10 × fivefold) with the tune. block. splsda() function exploring grids of 10-20 genera with increments of 5, 10 to 80 metabolite signals with increments of 10 and 5 to 10 clinical parameters with increment of 1. The correlation matrix between each input datasets was determined after running a partial least square analysis using the pls() function  81. Following data integration, we applied linear regression models to quantify group and time variation in the levels of seven features that distinguished between TR and TS ponies both at day 0 and day 132. These most discriminant features had either an absolute contribution of 0. 25 on the first sGCC-DA axis. For metabolite signal intensities, no metabolite matched this condition and all features contributing to the 1st axis at day 0 and 132 were retained.
While they performed 1 H-NMR on faecal material, we wanted to evaluate how our results obtained from blood 1 H-NMR could match theirs. Raw data were retrieved and processed as ours, but following Peachey et al. ' read truncation parameters  35. This process left 3,305,166 sequences assigned to 5233 ASVs. ASV counts per sample and ASV taxonomic assignments from Clark et al. Blood parameters of interest were validated in an independent set of 24 ponies with high FEC (821 eggs/g on average, ranging between 250 and 1700 eggs/g). Increased alkaline phosphatase had already been described in infected horses  32  and was not considered for validation.
Data availability R script and raw data matrices are available. All the phenotypic and H-NMR data have been uploaded under the github repository available under the https:// github. com/ guiSa lle/ STROM AEQ repository. The raw sequences of the gut metagenome 16S rRNA targeted locus are available in NCBI under the Sequence Read Archive (SRA), with the BioProject number PRJNA413884 and SRA accession numbers from SAMN07773451 to SAMN07773550.
Subjects' Recruitment The subjects of this study were adult, healthy, entire, domestic male dogs (Canis familaris) whose owners requested a chemical castration because of urinary marking, aggressivity toward other dogs, escaping and/or mounting behaviors. Such behavioral issues could have environmental, psychiatric (i. e. , neuropathological) or hormonal origins. They could have existed for years without being addressed by the owners or just recently have been discovered by the owners after the dog's adoption. However, these variables were not considered in the inclusion or exclusion criteria since they were irrelevant for the purpose of Data were collected on a total of 18 dogs which had been recruited during routine visits or behavioral consultations by the clinical investigators or their collaborators.
As these methods require large datasets, data from several animals has to be processed together, making it difficult to identify the rhythm of each animal. Also, they do not always factor the cyclic aspects (here, circadian rhythm) into the time series. We developed a mathematical Fourier transform-based method to detect changes in the circadian activity rhythm of animals, called 'Fourier-Based Approximation with Thresholding' (FBAT  [13] ). Fourier analysis is a powerful tool to analyse continuous cyclic functions. The assumption is that all cyclic signals with a frequency can be decomposed into a cosine function of frequency and with an infinity of other cosine curves called harmonics ℎ ( represents the rank of the harmonic), i. e. = |ℎ | 2π + ℎ where ℎ is the harmonic of rank represented by a complex number with |ℎ | its modulus and ℎ its argument.
The rationale for FBAT is as follows. Fourier transform is used to extract the cyclic component that reflects the circadian rhythm of two days. If the difference between the two days is higher than a certain threshold, then we consider that the rhythm has changed. The FBAT method proved to outperform the machine learning methods that we tested (see above) in terms of accuracy of the detection of deviations due to health or other disorders. Here, we present the FBAT method and then test it on four datasets obtained on cattle farms. The datasets span various daily routines that include various disease episodes (acidosis, lameness, mastitis and other infectious diseases), reproductive events (oestrus, calving) or external stimuli that can stress animals. We assess the performance of the method by its capacity to detect activity-rhythm anomalies caused by such events, and we check whether performance varies between causes.
Equipment used to detect cow activity and calculate activity level We used data from the CowView system (GEA Farm Technology, Bönen, Germany), which is an RTLS that gives the position of each cow in a barn every second. Each cow is equipped with a tag on its neck collar. The position of the cow is determined by triangulation based on radio waves emitted by the tag and captured by fixed antennas in the barn. The cow's activity is inferred from its position: 'eating' if the cow is positioned at the feeding table, 'resting' if the cow is in a resting area (typically cubicles), else 'in alleys'. The time spent in each activity (expressed in seconds) is used to calculate the level of activity of the cow for each hour of the day by attributing a weight to each activity. The weights are derived from a factorial correspondence analysis (see  [4]  for details on the calculations).
This analysis was performed on three farms with a total of more than 800 cows that were managed under different conditions (e. g. conventional vs. automatic milking, mixed diet vs. roughage and concentrate distributed separately). As the weights obtained on each farm showed good closeness, we elected to use averaged weights that can be applied on any dataset, i. e. -0. 23 for resting, +0. 16 for in alleys, and +0. 42 for eating. All weights are expressed in s -1 , and hence activity level is unitless. Each cow is then represented by a time series of its level of activity for each hour.
Datasets We used four datasets to test our method. Two datasets are from the INRAE Herbipôle experimental unit (DOI: https://doi. org/10. 15454/1. 5572318050509348E12) and include data from experiments carried out for other purposes unrelated to this study. Two datasets are from commercial farms. All the data are from dairy cows. -Dataset 1 includes 28 cows monitored for 6 months. The cows were administered lipopolysaccharide (LPS) in the mammary gland on one day to induce inflammation. They were milked at fixed times twice a day. The food was delivered in the morning then pushed back close to the feeding gates three times in the afternoon. -Dataset 2 includes 28 cows monitored for 3 months. Half of the cows received a high-starch diet during 1 month to induce sub-acute ruminal acidosis. They were milked at fixed times twice a day, and fed twice a day.
-Dataset 3 comes from three commercial farms on which a total of 40 dairy cows were monitored for 1 month to detect oestrus from their milk progesterone profile (i. e. sudden drop in progesterone for at least 3 consecutive days). On two farms, the cows were milked at fixed times twice or three times a day, and food was delivered twice a day or only once in the morning then pushed back after each milking. The third farm was equipped with an automatic milking system, so the cows had no fixed milking times. Food was delivered in the morning and regularly pushed back by a robot. -Dataset 4 comes from a commercial farm with 300 cows monitored for 12 months. Like above, the farm was equipped with an automatic milking system, and food was delivered in the morning and regularly pushed back by a robot.
On each farm, the caretakers logged any event as soon as it was observed (oestrus, calving, lameness (scored visually as per Welfare Quality protocol  [15] ), clinical mastitis, clinical signs of other disease, accident-related health problems, disturbances such as handling for vaccination, change of pen, mixing of animals) in a logbook, together with the treatment applied to the animal. In addition, Datasets 1, 2 and 3 provide a labelling of days where inflammation (Dataset 1), acidosis (Dataset 2) or oestrus (Dataset 3) was checked or detected via additional measures. In Dataset 1, cow body temperature was monitored to check that they reacted to LPS. In Dataset 2, ruminal pH was monitored using a sensor (eCow bolus, Exeter, UK). According to the method proposed by Villot et al. [16] , we normalized the ruminal pH values of each cow to take into account inter-individual variability, sensor drift and sensor noise, and then we considered that a cow was under subacute ruminal acidosis (SARA) when the normalized ruminal pH (NpH) decreased by at least 0.
3 for more than 50 min/d and the daily standard deviation in NpH was above 0. 2 or the daily NpH range was above 0. 8. In Dataset 3, progesterone was assayed in the milk, and oestrus was detected when progesterone concentration dropped dramatically for several days (e. g. from 20 down to 5 ng/mL). Datasets 1 to 3 can thus be considered as reference datasets, as the labelling of abnormal days does not depend solely on visual observations. Dataset 4 from a large commercial farm served to test our method in real-world field conditions. Based on the available literature  [17] [18] [19] , we considered a certain number of days before and one day after each type of event where we suspected modified cow behaviour (Tab. 1). We excluded from analysis the subsequent days after the event (up to Day 7) because we did not have enough information to rule on whether or not the behaviour was likely modified and because our focus was on the early stages when caretakers need to take action.
**** Tab. 1 here **** A 36-h time series was considered abnormal if it contained more than 12 h from a day labelled abnormal. We split each dataset into two blocks: 30% of all time series were taken at random and used as training set, from which threshold τ was calculated (see Section 2. 5), and the remaining 70% was used as test set, to test whether threshold τ can accurately distinguish series labelled normal vs. abnormal.
Overall performances of FBAT with thresholds adjusted to each dataset Tab. 2 gives the overall performances of FBAT on the four datasets. The results for threshold τ and , were similar across all datasets, although , was slightly lower in Dataset 4 than in the other datasets. The method thus appears to perform equally well in various conditions. The calculation time -especially the time to calculate Threshold τ -depended on the farm and especially on the size of the dataset from the farm (see, for instance, Dataset 4, which is far larger than the others and required a much longer calculation time). It can be argued that the value of threshold τ can change from one dataset to another depending on the number and type of events contained in the dataset. However, we did not observe this kind of effect: there were no marked variations in τ (between 1886 and 2216) between datasets despite their differences in number and type of events (e.
g. Dataset 3 contains 29 oestrus and no other events). Moreover, FBAT can compute τ without requiring a huge amount of data. Dataset 3 comprised only 40 cows for 1 month and yet produced a similar τ to the other datasets, leading to high values of , and ,. In all datasets, , was above 75%, which means a farmer would receive less than 25% false alerts. By contrast, , was around 30%, which means that the method detects less than one third of the series labelled abnormal. At first glance, the method cannot reliably help farmers detect anomalies in cows. Note, however, that within the sequence of days surrounding an event -which we labelled abnormal as defined in Tab. 1 -the circadian activity rhythm of the cows may not be modified on all days, which could explain the apparent poor performance in terms of ,.
We therefore questioned whether it was possible to detect at least one day with a modified circadian rhythm in a sequence surrounding a given event. Furthermore, days on which circadian activity rhythm changed may have been included in the training set and were thus excluded from the analyses on the test sets. **** Tab. 2 here **** 3. 2 Performance of FBAT for detecting one day with a modified circadian rhythm within sequences surrounding events, using a fixed threshold Given that threshold τ varied little between datasets (Tab. 2), we decided to set τ to a fixed 2000 for all datasets. This allowed us to skip the training phase and use the whole datasets to test our method. We then explored whether the method could detect at least one day with a modified circadian rhythm within a sequence surrounding a given event.
We applied this procedure for each type of event. We obtained a , of 70. 1%, 79. 1%, 77. 9%, and 81. 7% for Datasets 1 to 4, respectively. On all datasets combined, , was 81. 1%, which further confirms that FBAT does not produce many false alerts (less than 20%). We cannot exclude that part of these alerts are actually not false alerts but correspond to events that caretakers did not record in the logbooks as they missed or considered unimportant. For instance, subclinical diseases like SARA are difficult to detect without close monitoring of the ruminal pH and so are often missed by direct observation. Likely events such as a power or a mechanical failure cutting the lighting in the barn or delaying food delivery or the milking may have gone unreported, whereas these stimuli act as synchronizers of circadian rhythm  [2].
The proportion of abnormal sequences in which at least one day was detected with a modified circadian rhythm was 76%, 71. 2%, 69. 2% and 61. 3% for Datasets 1 to 4, respectively. This proportion varied according to type of event to be detected (Tab. 3). In very few cases (1. 3% of all abnormal cow*days in Dataset 4), there were two events that co-occurred, e. g. lameness and other disturbances. The corresponding cow*days were used to calculate the proportion of abnormal sequences detected for the two types of events. **** Tab. 3 here **** The rhythm anomalies that were best detected were those due to accidental events: only Dataset 4 contained accidental events (n=10), and all of them were detected. Under 'accidental events', we included accidental injuries, vaginal laceration, and retained placenta, all of which occur abruptly on a given day and are likely to cause cows substantial discomfort, which explains why they are easily detectable through disruption of the activity rhythm.
Nearly all calvings were detected: only one calving was missed out of the 180 present in the datasets. Next, 90% of oestruses were detected on average. Oestrus and calving are known to affect cow behaviour: overt oestrus causes hyperactivity, and cows about to calve lie down or change activity due to a change of pen, the pain induced by calving, and the presence of the calf  [20]. On Dataset 3, where the exact time of oestrus was detected from milk progesterone on 40 cows, the proportion of detected oestrus was lower than in the other datasets (only 69. 2%). It is likely that some cows had silent oestrus, i. e. with no overt behavioural signs. Unfortunately, this dataset does not include records of detection of oestrus by the caretakers (i. e. based on behavioural observations), so we cannot estimate whether our method detects more oestrus than a farmer would or only the overt cases of oestrus detectable by simple visual observation of the animals.
Diseases with inflammation or pain were also well detected, with an average of 97. 8%, 84. 1%, and 88. 2% events detected for lameness, mastitis, and other diseases, respectively. However, only 81. 5% of LPS-induced udder inflammation events were detected. This slightly lower detection rate may be due to the fact that the inflammation is less marked when induced by LPS than by pathogens, or that the sickness behaviour is less marked with a simple inflammation than when pathogens are present. Indeed, pain, hyperthermia, and decreased rumination last less than 24 h after LPS injection  [21]. Overall, 69% of SARA events were detected (only in Dataset 2 where ruminal pH was monitored). Animals do not always suffer when their ruminal pH is low. Their gut flora can adapt to diet containing high amounts of starch and low pH, and animal behaviour can return to normal from one day to the next  [22, 23].
Mixing very clearly disturbs the animals, triggering aggressive interactions, weakening group cohesion, and inducing chronic stress  [25, 26]. However, in this study, we inferred the 'mixing' category from instances when one or more animals were moved from one pen to another, and so we thus cannot be sure that these animals were mixed with unfamiliar pen-mates. Therefore, the moderate proportion of mixings and other disturbances that FBAT detects likely reflects the fact that not all of them actually disturbed the cows. Mixing and other disturbances represented 92% of all events recorded but were not accurately detected. When mixings and other disturbances are excluded from the analysis, the overall performance of our method-in terms of proportion of events detected-reached 94. 6% in Dataset 4, which was used for field-validation.
Timing of the detection of abnormal rhythm Fig. 3  shows the timing of detection of an abnormal rhythm -when detected -in relation to the logging of events by caretakers in Dataset 4. On these figures, the day when an event was logged starts at 00:00 because we have no indication as to the exact moment when the caretaker noticed the event. Rhythm anomalies due to 'other disturbances' started to be detected from 12 h on the day the event was logged -probably at the time that the event actually occurredand continued to be detected up to 2 days after. Likewise, anomalies due to accidents were detected from 10 h on the day the event was logged, and more than 90% of them were detected within the next 4 h. Therefore, events that occur abruptly in time likely translate very rapidly into activity rhythm modifications, which means the method can promptly detect these problems.
Second, this tool can also serve for assessing animal welfare. Indeed, oestrus and calving frequency should be about the same across farms, and so any variations between farms are likely to be due essentially to health disorders and stress experienced by the animals. FBAT could thus be used as an overall measure of animal health and stress status, based on the occurrence of disturbing events. Applying FBAT on a sample of farms along with a reference method for animal welfare assessment such as the Welfare Quality method  [15]  would help to check whether it can be used for such a purpose. FBAT could also be used to phenotype animals according to their sensitivity to potentially stressful events. FBAT is easy to implement. The Fourier transform is a well-known technique that can be readily computed in several programming languages.
It is quicker to compute than machine learning methods: the computation time is 6 to 280 times shorter than the more advanced machine learning algorithms DTW, Hive-Cote or BOSS, and 13 to 22 times shorter than the neural network methods FCN and Resnet  [13]. The farms from which data were used in our study had different routines that may have affected the rhythm of their cows. The cows were milked at fixed intervals on some farms vs. with an automatic milking system allowing cows to choose when to be milked on other farms. Food was delivered two or three times a day on some farms vs. more evenly distributed across the day by a robot pusher in other farms. Furthermore, the type of events detected differed between datasets. Despite such variations, the threshold that optimized the distinction between a normal vs.
modified rhythm was stable, enabling us to apply the same threshold to all datasets, which resulted in similar performances across all farms except the farms from Dataset 3, as discussed above. The fact that the threshold does not vary much between farms should be checked on a larger population of farms. If the stability is confirmed, then a pre-defined threshold could be used without having to go through training to define the threshold for a given farm, thus making FBAT very easy to apply. It remains possible to adjust the threshold to a given farm or even to each cow of that farm, in which case data will need to be recorded for a few weeks to estimate the threshold before it can be applied to detect anomalies on that farm or cow. FBAT is to be applied on data produced by close animal monitoring, which cannot feasibly be done without activity sensors.
We applied FBAT on data from a RTLS tool. Extending the method to data from other sensors only requires eliciting the weights attributed to each activity to calculate the activity level and compute the threshold used to compare daily variations between days. This can be done on a few datasets, as achieved here. FBAT was designed to be integrated in precision livestock farming tools to help farmers manage their animals. However, it has also the potential to detect anomalies in humans to guide healthcare or in wild animals to detect disturbances (e. g. by humans or predators). We anticipate that chronobiological studies could apply FBAT to help relate circadian rhythm anomalies to specific events.
Detected visually by caretakers or from milk progesterone profile3LPS injected in the mammary gland4Detected from ruminal pH5Interventions, e. g. vaccination, oestrus synchronization, anthelmintic treatment, claw trimming, relocation Tab. 2. Overall performance of FBAT on four datasets. The threshold τ used to differentiate normal vs. abnormal time series was computed on training sets (30% of each dataset). , and , are for the percentage of normal series detected as normal and the percentage of abnormal series detected as abnormal (i. e. with a modified circadian rhythm) on test sets (70% of each dataset). Training time is the time to compute threshold τ. Test time is the time to detect any changes in activity rhythm. Tab. 3. Performance of FBAT expressed in terms of detection of at least one day with a modified circadian rhythm within a sequence surrounding an event, stratified by type of events (with a fixed threshold τ = 2000).