dataesr/scientific-paragraphs-categorization huggingface dataset:
The random trees can be ultrametric or not. In the former case, tips are randomly coalesced with the same branch length distribution and number of tips as the tree of interest; similarly in the latter case, except the branches are randomly split from the stem. The number of modalities is then considered significant if BIC random /BIC test ≥ 4 for at least 95% of the random trees. This provides a conservative test of the significance of the modalities. Random trees were constructed using the R package ape. To test this approach, we investigated the ability of the eigengap heuristic to recover simulated shifts in ultrametric trees. We started by simulating a 100-tip pure-birth tree with speciation rate 0. 15. A given shift on that tree was simulated by randomly choosing a node located in the middle of the tree (i.
e. , excluding the first and last quartile of tree length), pruning all branches descending from that node, and grafting onto that node a new tree with proper length simulated under either a pure-birth model with a different speciation rate (ranging from 0. 05-0. 5) or a different diversification model (randomly chosen among the set of models represented in Supplemental Fig. 2 ). In a single tree, we simulated up to 10 shifts iteratively, all shifts being comprised of either shifts in speciation rate or diversification pattern (never both). Trees were pruned and grafted using our own code with functions from the R package phytools  (48). In total, 200 trees with 0-10 shifts in speciation rate and 200 trees with 0-10 shifts in diversification patterns were simulated. The recovery reliability of the eigengap heuristic was compared to MEDUSA (34) and BAMM  (35) , the most commonly used methods for identifying rate shifts.
We ran MEDUSA using the medusa function from the R package geiger (v2. 0. 3) with the initial speciation rate set to 0. 15 and extinction rate constrained to 0. We ran BAMM after setting priors for each simulated tree with the R package BAM M tools  (35). We did not compare our results to the non-parametric rate comparison (PRC) of (  36 ), because the approach is implemented only for pairwise comparisons and becomes prohibitively computationally expensive when iterated.
Empirical applications To illustrate our approach, we used two empirical datasets: the first one, representing Influenza A strains spanning two animal hosts and 25 countries, was used to illustrate the usefulness of the clustering on the spectral density profile; the second one, composed of 350 16s rRNA archaeal sequences collected from the sediment of Lake Dagow  (49) , was used to illustrate the identification of modalities within trees. We purposely chose applications on non-ultrametric trees, as analysis of these are not typically available to current techniques. To put together the viral dataset, we collected trees for a range of Influenza A virus strains from the NCBI Flu Virus Resource (http://www. ncbi. nlm. nih. gov/genomes/FLU/FLU. html). Protein-coding sequences for haemagglutinin (HA), matrix protein 1 (M1), neuraminidase (NA), nucleoprotein (NP), non-structural protein 1 (NS1), polymerase acid protein (PA), and polymerase basic protein 2 (PB2) were obtained for strains from avian and human hosts originating from 25 different countries.
Comparing and Clustering Phylogenies Using Spectral Density Profiles Many analyses involving phylogenetics require measuring the distance between phylogenetic trees (an inverse measure of their similarity) and clustering them according to their similarity. Once phylogenies have been transformed into their spectral density profiles, the distance between them can easily be computed using any probability distribution distance metric, and clustered using any traditional clustering algorithm. We used the popular Jensen-Shannon distance metric (58) as our distance metric (see Measuring the distance between spectral densities). This metric quantifies the square-root of the total divergence to the average probability distribution; it has the advantage of being symmetric and finite. We used this metric to cluster phylogenies with energy-based divisive clustering, which is a bottom-up hierarchical approach that provides resolution within clusters, and k-medoids clustering, which does not, although it is possible to get support values for cluster assignment using the silhouette width of each data point.
Acknowledgments We would like to thank  Julien Clavel ,  Jonathan Drury ,  Nancy Irwin ,  Marc Manceau , and  Olivier Missa  for helpful comments on the manuscript. EL would like to thank  Evan Charles  for helpful discussion. Funding was provided by the  CNRS  and grants  ECOEVOBIO-CHEX2011  from the  French National Research Agency  and PANDA from the  European Research Council (ERC)  attributed to HM.
Understanding patterns in the distribution and abundance of functional traits across a landscape is of fundamental importance to ecology. Mapping these distributions is particularly challenging for species-rich groups with sparse trait measurement coverage, such as flowering plants, insects, and microorganisms. Here, we use likelihood-based character reconstruction to infer and analyze the spatial distribution of unmeasured traits. We apply this framework to a microbial dataset comprised of 11,732 ketosynthase alpha gene sequences extracted from 144 soil samples from three continents to document the spatial distribution of putative microbial polyketide antibiotic production. Antibiotic production is a key competitive strategy for soil microbial survival and performance. Additionally, novel antibiotic discovery is highly relevant to human health, making natural antibiotic production by soil microorganisms a major target for bioprospecting.
Introduction How and why the functional traits of organisms (characteristics of an organism that are linked with its fitness or performance) vary across communities, space, and environmental gradients remains an important unanswered question  [1] [2] [3] [4] [5] [6]. A trait-based perspective on biogeography can reveal which processes shape the composition and function of ecological communities, help forecast how communities will respond to environmental change, and guide bioprospecting efforts. While interest in trait-based biogeography has motivated efforts to compile global trait databases, traits are poorly sampled in species-rich and ecologically important groups such as plants, plankton, insects, and microorganisms  [4, 6, 7]. The current incompleteness of trait databases is a major limitation, impeding our ability to build global ecosystem, bioclimatic, and biogeochemical models.
A general phylogenetic approach to trait-based biogeography One of the biggest limitations in trait-based biogeography for species-rich groups is the paucity of trait databases  [4, 6]. Here we present an approach based on phylogenetic character inference methods that can help circumvent this problem (Fig  1 ). This approach can be applied to any phylogenetic tree describing the relationship among sequences, individuals, or species (thereafter referred to as "clades"). We assume, as is the case in most trait databases, that the trait of interest for some of these clades has been characterized (the "reference" clades), but the trait of others has not (the "uncharacterized" clades, Fig  1A ). We infer the traits of the uncharacterized clades using the traits of characterized clades and likelihood-based character reconstruction methods (  [18] , Material and Methods, Fig  1B ).
For community 1 for example, this distribution would be given by ϕ 1 (x) = 9ϕ 1 (x) + ϕ 2 (x) + 5ϕ 3 (x). doi:10. 1371/journal. pone. 0130659. g001 soil samples using PCR, cloned, and sequenced (Material and Methods). This resulted in a total of 11,732 KSα sequences, 573 bp long, evenly distributed across 144 samples. Following the general phylogenetic approach outlined above, we assembled a database of KSα reference sequences. We found 70 KSα reference sequences with structurally characterized products: 7 are involved in spore pigment synthesis, and 63 are involved in the synthesis of a set of 58 unique antibiotic molecules that can be grouped into 20 different chemotypes (or groups of related chemical structures  [19] , Material and Methods & S1 Table ). We constructed a phylogenetic tree describing the evolutionary relationships among the environmental sequences and those of the reference database (.
However, since we collected presence-absence plant data in the distant (20 x 20 m) rather than local surroundings of each bacterial community, it is more likely that the marked correlation between plant and bacterial communities reflects the joint effect of a third geographicallystructured component on these communities. We cannot exclude the possibility that this third component corresponds to environmental variables we did not measure, a limitation inherent to beta-diversity studies  [32]. However, we measured the main environmental variables thought to have a significant influence on bacterial community composition. Hence, our results suggest that bacterial communities respond to long term, time-integrated environmental conditions (e. g. climate) that may be better reflected by surrounding plant community composition than short-term measures of soil characteristics  [33].
For example, the trait of interest could be the potential rate of enzyme activity of a particular functional gene variant, although a fair amount of microbial and genetic work is still needed to establish a reference database for enzymatic rates. Genetic variants of mcrA, amoA, nirS or nifH reflect different efficiencies of methanogenesis, nitrification, denitrification and N-fixation, respectively. Microbial rhodopsin genes would also lend themselves well to these types of analyses. These genes are distributed across a variety of aquatic and terrestrial environments, and code a suite of different traits important for cell survival, including proton transport (energy generation), chloride transport (maintenance of osmotic balance) and light sensing (phototaxis or gene expression). The approach could also be used to estimate a variety of prototypical microbial functional traits, such as ribosomal copy number  [39] , GC content, or genome size (see Table  1  from  [7]  for other examples).
Our phylogenetic approach also has many potential applications in trait-based biogeography in general. Indeed, major trait databases for rich groups such as flowering plants  [4]  and marine plankton  [6]  are very sparsely sampled. Approaches to filling in the gaps in these databases are sorely needed  [40]. Our approach, based on phylogeny, provides a new angle to the question  [41]. Future work aimed at comparing and potentially integrating these different approaches will be highly valuable. Such methods will help infer missing values in trait databases for both macro and microorganisms and map the diversity of traits at large spatial scales. In comparison with traditional biogeographic patterns based on sequence similarity groups, trait-based patterns may be less sensitive, as observed here.
Reference sequences, sequence alignment, and tree construction Reference sequences were found by searching the nucleotide database of GenBank for many variants of the phrase "polyketide synthase" or "ketosynthase alpha", then manually inspecting results for KSα genes, and finally using a BLAST search to find related sequences. Only sequences that had been experimentally implicated in the production of structurally characterized polyketides were included in subsequent analyses, resulting in a total of 79 reference sequences (S1 Table ). We used Clustal through the program BioEdit to align the 11,732 environmental KSα sequences, the 79 structurally characterized reference sequences, and a fabH outgroup (  [43] , S1 Material & Methods). We then used FastTree 2. 1. 0 [44]  to build a phylogeny of these sequences (GTR branch swapping as suggested by jModelTest 0.
Funding: H. M. acknowledges support from the  Centre National de la Recherche Scientifique  and the  Agence Nationale de la Recherche ANR-CHEX  grant  ECOEVOBIO. This project was supported by grant  DEB 0743885  from the  National Science Foundation  awarded to J. L. G and B. J. M. B. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Methods Microfluidic chip fabrication. The chip design has been iteratively optimized to reduce the transition times (onset and offset of delivery). The angle at which the continuous circulating buffer flow is directed in the chamber has been determined with the use of a finite-element software (Comsol). For fabrication, we used a computer-controlled micromilling machine (Minitech Mini-Mill/GX) which allows for submicronic precision, and a custom set of programs to generate G-code machine instructions. A microscope (0. 75× to 3× Microscope Body, Edmunds Optics) and camera where mounted on the micromilling machine to allow for precise positioning (≈ 1 μm in the tool axis direction) during tool change. Fabrication workflow was as follows: on a horizontal 40 × 40 × 4 mm PMMA slab, (i) the seven input/output through holes (600 μm-diameter drill, KT-0236-R, PMT Microtools, USA) were drilled, (ii) an area of 25 × 15 mm was surfaced with a 3 mm smoothing tool (3 mm-diameter radius-end mill, MSRS 230, NS Tools, Japan) to obtain a flat reference surface (optical grade), (iii) channels were milled (100 μm-diameter mill, TR-2-0040-S, PMT Microtools, USA), and finally (iv) the open chamber was milled (500 μm and 3 mm-diameter mills, resp.
The obtained ROIs were manually inspected and corrected when necessary. Eventually, the fluorescence traces were computed as the average intensity over each ROI. To record motor behavior, a miniature microscope connected to a fast infrared camera (120 Hz, TXG02, Baumer) was placed below the microfluidic device. We computed the raw orientation of the binarized image of the tail, and tail angle was defined as the deviation from the baseline orientation  22, 23. The tail beats after each pulse were counted by eye. All algorithms were written in Matlab.
Neuronal data analysis. A baseline fluorescence signal was estimated for each neuron by computing the 8 th percentile of fluorescence traces F(t) in sliding windows of 15 s 24. The resulting smooth curve b(t) locally approximated the baseline level and reflected slow fluctuations unrelated to the fast calcium transients evoked by neuronal activity. The relative variation of fluorescence intensity was calculated as Δ F/F = (Fb)/b. In a typical experiment, trains of stimulations separated by 15 s alternate with phases without stimulation. We defined the resting times as the set of times for which no stimulation was delivered in the previous 15 s. For each neuron, we computed the standard deviation of the relative variation of fluorescence during resting times σ = std(Δ F/F) rest and the normalized relative variation of fluorescence intensity Δ F/Fσ.
Acknowledgements We thank  HC Park  ( Kyungpook National University, Korea ) for the HuC promoter,  L. Looger  ( Howard Hughes Medical Institute, Ashburn, Virginia, USA ) for GCaMP3 and  K. Kawakami  ( National Institute of Genetics, Shizuoka, Japan ) for pT2KXIGin vector. We thank  N. Garroum  for helpfull assistance in simulating the flows in the microfluidic device during chip design,  V. Perez-Schuster  for help with the data analysis of two-photon calcium imaging,  T. Pietri  for helpful discussions, and  M. Kapsimali  for assistance in neuroanatomy of the zebrafish gustatory system. The post-doc work of M. S. M. was supported by  Neuropôle de recherche francilien (NeRF)  and  INSERM. One year of post-doc work of R. C. was supported by the  Fondation Pierre-Gilles de Gennes pour la recherche.
Ethics statement All work was conducted with approval of the Deakin University Animal Ethics Committee (A14/2011) and under the Department of Sustainability and Environment (Victoria, Australia) wildlife Research Permits (10005484). Kanowna Island is within the Wilsons Promontory Marine National Park and was accessed under permit from Parks Victoria. Data were collected on adult females provisioning pups from May to July (fall and winter) in 2011-2012 at Kanowna Island, northern Bass Strait (39°9. 1'S, 146°18. 5 'E) in southeastern Australia. Animal capture and anaesthesia methods have previously been detailed (same procedures without restraint board,  [34] ). Once captured, individuals were instrumented with a 3-axis accelerometer that measured surge (x, anterior-posterior), sway (y, lateral) and heave (z, dorsal-ventral) at 20 Hz (± 3g, G6A, 40 X 28 X 16.
3 mm, Cefas Technology Limited, Suffolk, United Kingdom), a GPS datalogger (5 min sample rate, Fastlock 2 GPS datalogger, 69 X 28 X 21 mm, Sirtrack, NZ), a time-depth-recorder (1 Hz, TDR, MK9-TDR, 68 X 17 X 17 mm, Wildlife Computers, Redmond, WA, USA) and an animal-borne video camera (Crittercam, 25 cm length X 5. 7 cm diameter, National Geographic Society,  Fig 1). Maximum recording time for the accelerometers was 8 days. The Crittercams were programmed to record video when submerged > 40 m on a duty cycle of 1 hour on: 3 hour off. TDR, head accelerometers and video data were successfully recovered on 8 animals with full sets of overlapping useable data available for 4 animals (Table  1 ).
Data processing The raw time and depth data were zero-offset corrected and processed using the statistical software program R 3. 0. 1  [35]. Maximum dive depth, and dive descent, ascent, and bottom durations were identified using changes in depth slopes (minimum dive depth threshold 15 m). Australian fur seals are predominately benthic foragers, and the maximum depth of Bass Strait on the shallow continental shelf is < 100 m  [9, 36]. Preliminary analysis showed that maximum dive depths of dives study ranged from 61-86 m. Therefore, the 40 m threshold for the video cameras allowed capture of all dives of interest. Depth and time data from the TDR were linearly interpolated from 1 Hz to 20 Hz to match the 20 Hz sampling frequency of the accelerometer. Additional data processing was required to remove artifacts in clock alignment among the TDR, video camera, and accelerometer.
The time stamps of the TDR, accelerometer, and video data were aligned visually to within ± 1 s using the raw surge acceleration with Eonfusion software (Eonfusion, v. 1. 2, www. myriax. com) and customized functions in R for each individual dive. Dives that did not have complete video coverage and dives not aligned within ± 1 s due to extensive clock drifts or malfunctions were excluded. Head movements were isolated from body movements and swimming movements using a 3 Hz3 Hz 3 Hz 3 Hz 3 Hz 3 Hz 3 Hz high-pass filter on each axis which also accentuated the peaks in variance (signal package in R, Fig  2C ,  [37] ). Identification of APC from the accelerometry data was performed using a custom-written function comprised of several custom routines in R modified from Viviant et al. (referred to as Function 1, available on request from authors,  [31] ).
Function 1 calculated the variance of acceleration signal along a moving 1. 5 s window of each dive to identify and count the peaks in head movement indicative of APCs (Fig 2D, S1 Text). This Function performed 6 general tasks: i) calculated the variance of acceleration, ii) defined the peaks in variance of acceleration using the variance threshold and minimum time between 2 successive peaks, iii) calculated the cumulative integral area under the peak of variance for each APC (g 2 ), iv) estimated the duration of the APC, v) counted the number of peaks within an APC, and vi) counted the number of total APC per dive. This data was determined for each of the three axes (surge, sway, and heave) individually on all dives for each animal. In addition, the values chosen for variance thresholds and minimum intervals were selected by a model optimization procedure (see Selection of variance threshold and minimum interval).
Calculation of acceleration error metrics The total counts of TP, TN, FP, and FN were used to calculate error metrics of detection, FP rate, and precision across all prey captures for each animal. The error metrics for each axis were averaged over all of the dives and individual APC for each animal (each data point equaled the mean per animal). All error metrics described below included both successful captures and unsuccessful capture attempts combined unless noted differently. Detection rate (true positive rate) was calculated as the proportion of true positives that were correctly identified as true positives out of all potential events with feeding (TP/(TP+FN), i. e. sensitivity or recall rate). FP rate, was calculated as the proportion of true positives that "misclassified" or incorrectly classified as a TP when there was no prey on video (FP/(FP+TP)).
To account for potential temporal, spatial, and prey distribution variation during a foraging trip, each dive with video was randomly assigned to either the training or testing subset. Each dive was only used once in the cross-validation process. Some dives were removed during the re-alignment of the datalogger clocks (see above), such that the actual proportion of dives in each subset ranged from 48-53% in the training subset (Table  1 ). Additionally, as the video camera only recorded for 1 hour every 4 hours when submerged > 40 m, video data was considered a random subsample of all dives. Overall, there were more dives that had prey present on video (74, 72 in each training or testing subset) compared to dives without potential prey present on video  (22, 25  in each subset, Table  1 ).
Statistical Analysis Statistical analysis was performed on the testing subset of data using the results of the optimization of Function 1 on the training dataset. To clarify, the training subset was used to select the animal-specific parameters by choosing the parameters with the greatest detection rate, followed by greatest precision. Next, the 50% testing subset was run on the animal-specific and generic parameters. All statistics and results below are reported for the 50% testing subset only, which was run on both generic and animal-specific parameters. Data from the testing subset were analyzed within a repeated measures framework using mixed-effects models in R 2. 6. 1 (nlme package,  [35, 43] ). Mixed-effects models (LME) utilize individual animal variation relative to the mean of the population while correcting for repeated measurements within and among animals.
Accelerometer unable to differentiate among prey types The prey composition data analysis included potential prey of both successful and unsuccessful attempts (Fig  6 ). The majority of potential prey identified by the accelerometer were fish (80. 5%, 82. 3%, 80. 4% surge, sway, heave). Video analysis for a larger dataset showed that benthic gurnard fish were the predominant taxonomic family (n = 18 seals, 1653 APC,  [38] ). Unknown prey comprised 15. 9%, 15. 4%, and 0% of the prey identified on the surge (n = 251 total), sway (n = 305 total), and heave (n = 189 total) axes respectively. Octopus (Octopus sp) and squid (Squid sp. ) represented only a small proportion of prey (0. 5-3,2%), and therefore it is not surprising that subsequent analyses (using either mean APC duration, integral area under the peak of variance of acceleration, or number of peaks per APC,  Fig 6)  were unable to discriminate among prey types on any of the 3 acceleration axes.
e. same dataset but organized across each dive rather than each individual APC like above). On all animals, video identified 71 foraging dives and 26 non-foraging dives (n = 97 dives total in testing subset, Table  1 ). The surge axis identified 70 foraging dives and 27 non-foraging dives (n = 97 dives total with generic parameters). At the level of the dive head-mounted accelerometers underestimated the number of foraging dives by 1. 4% on the surge axis (foraging dive identification error).