dataesr/scientific-paragraphs-categorization huggingface dataset:
S3 ). Our quantitative estimates for each feature were averages over a taxonomically diverse sampling of eukaryotic records (see Methods). We used Bayesian model selection to ask which of these properties were most likely to be included in a linear model predicting the retention index of each gene. Following Ref. [7] , this approach identifies likely predictors with quantified uncertainty, while acting without prior favouring of any given hypotheses, and automatically guarding against overfitting and the appearance of correlated predictors providing redundant information. In both mtDNA and ptDNA datasets, models where high hydrophobicity and high GC content predict high gene retention were strongly favoured (Fig. 1B ). It is well-known that oDNA generally has lower GC content than nuclear DNA, because of the asymmetric mutational pressure arising from the hydrolytic deamination of cytosine to uracil, reducing GC content in the high mutation system of oDNA  [20].
Traces show mean and 95% credible intervals for Bayesian generalised linear mixed model (GLMM) (see Methods for priors). The associated p-value is a frequentist interpretation from bootstrapping, against the null hypothesis of no relationship. Crystal structures are coloured according to the number of species in our dataset that retain the gene for each subunit. peared in all the model structures with highest posterior probability. Their appearance together in a Bayesian model selection framework suggests that they provide independent information on gene encoding, despite a correlation (albeit rather weak) between the features (Supplementary Fig. S3 ). GLMs using hydrophobicity and carboxyl pKa, trained using a subset of genes from a given species, were able to to predict the encoding compartment of an independent test set from that species with high performance (True Positive/Negative rates: mt TP 0.
Methods Source data. We used the mitochondrion and plastid sequences available from NCBI RefSeq  [32] , and annotated eukaryotic whole genome data also from NCBI. The accessions and references for the endosymbiont/relative pairs are given in Supplementary Table  S2. For biochemical and biophysical gene properties, we used the values from  [7] , described in the Supplementary Text, using BioPython  [33]  to assign these to given gene sequences. We averaged gene statistics over representative species from a collection of diverse taxa, both using model species (Homo sapiens, Arabidopsis thaliana, Saccharomyces cerevisiae, Reclinomonas americana, Chondrus crispus, Plasmodium falciparum) and randomly selected members of different taxa (Supplementary Text; Supplementary Fig. S9 ). We used crystal structures and associated HTML descriptions from the PDB  [34]  references 1oco, 1q90, 2h88, 2wsc, 5iu0, 5mdx, 5mlc, 5o31, 5xte, 6cp3, 6fkf.
We used PDBePISA  [35]  to estimate subunit binding energies with two different protocols, both removing ligands and incorporating them into the overall binding energy value for a subunit (Supplementary Text). We used estimated taxonomies from NCBI's Common Taxonomy Tree tool  [36]. Gene labelling and evolutionary transitions. Gene annotations are inconsistent across such a diverse dataset. For organelle genomes, we used two approaches. In a supervised approach, where the full set of unique labels found was manually curated and assigned a 'correct' label based on biological knowledge. In an unsupervised approach, we used BLASTn to perform an all-against-all comparison of all genes in our dataset. We scored each comparison as the proportional length of the region of identity compared to the reference sequence, multiplied by the proportion of identities across that region.
Scores over 0. 75 were interpreted as 'hits' (e. g. 75% identity over the full sequence, or full identity over 75% of the sequence). If more than 25% of appearance of gene label X in the BLAST output involved a 'hit' with gene labels Y , we interpreted X and Y as referring to the same gene. This process built a set of pairwise identities, which we then resolved interatively into groups of gene labels assumed to refer to the same gene. We then assigned the most prevalent gene label to all members of that group. In each case, we retained only genes that were present in more than ten species in our dataset. For annotated whole genome data, we used pattern matching for gene annotations based on regular expression identifiers to identify nuclear-encoded subunits of organellar protein complexes (expressions in Supplementary Text).
Using these curated gene sets, we assigned 'barcodes' of gene presence/absence (binary strings of length L, with 0 denoting gene absence and 1 denoting gene presence) to each species in our dataset. Each of these species is a tip on an estimated taxonomic tree describing their putative evolutionary relationship. Assuming that gene loss is rare and gene gain is very rare, we iteratively reconstructed parent barcodes on this tree by assigning a 0 for gene X if all descendants lack X , and 1 otherwise. We then identified parent-child pairs where the child barcode had fewer genes than the parent (the opposite is impossible by construction). For each such instance, we record the transition from parent barcode to child barcode as a loss event. Retention indices. Our simple retention index is defined as follows.
2 is anticipated, compatible with previous findings  [7] ; a beta-binomial(1, 1) prior distribution on the model space, and a minimally informative inverse gamma prior for noise. Further prior information, and the effects of varying them, are given in Supplementary Text and Supplementary Fig. S11. We implemented the selection process in the R package mombf. We additionally used linear modelling penalised using ridge and LASSO protocols, tree-based, and random forest regression, described in the Supplementary Text and implemented using glmnet, tree, and randomForest packages. Classification of subcellular encoding. We used Bayesian model averaging for generalised linear models (GLMs) predicting encoding compartments with priors giving probability 1/2 for the inclusion of each parameter, implemented in BMA.
Materials & Methods Source data. We used the mitochondrion and plastid sequences available from NCBI RefSeq  [1] , and annotated eukaryotic whole genome data also from NCBI. The accessions and references for the endosymbiont/relative pairs are given in Supplementary Table  S2. For biochemical and biophysical gene properties, we used the values from  [2] , described in the Supplementary Text, using BioPython  [3]  to assign these to given gene sequences. We averaged gene statistics over representative species from a collection of diverse taxa, both using model species (Homo sapiens, Arabidopsis thaliana, Saccharomyces cerevisiae, Reclinomonas americana, Chondrus crispus, Plasmodium falciparum) and randomly selected members of different taxa (Supplementary Text; Supplementary Fig. S9 ). Codes used in the figures are [Hyd]rophobicity, [HydI] hydrophobicity index, [GC] content, [Len]gth, [pK1] carboxyl pKa, [pK2] amino pKa, [MW] molecular weight, [AG/CW] energies of gene expression.
We used crystal structures and associated HTML descriptions from the PDB  [4]  references 1oco, 1q90, 2h88, 2wsc, 5iu0, 5mdx, 5mlc, 5o31, 5xte, 6cp3, 6fkf. We used PDBePISA  [5]  to estimate subunit binding energies with two different protocols, both removing ligands and incorporating them into the overall binding energy value for a subunit (Supplementary Text). We used estimated taxonomies from NCBI's Common Taxonomy Tree tool  [6]. Gene labelling and evolutionary transitions. Gene annotations are inconsistent across such a diverse dataset. For organelle genomes, we used two approaches. In a supervised approach, where the full set of unique labels found was manually curated and assigned a 'correct' label based on biological knowledge. In an unsupervised approach, we used BLASTn to perform an all-against-all comparison of all genes in our dataset.
We scored each comparison as the proportional length of the region of identity compared to the reference sequence, multiplied by the proportion of identities across that region. Scores over 0. 75 were interpreted as 'hits' (e. g. 75% identity over the full sequence, or full identity over 75% of the sequence). If more than 25% of appearance of gene label X in the BLAST output involved a 'hit' with gene labels Y , we interpreted X and Y as referring to the same gene. This process built a set of pairwise identities, which we then resolved interatively into groups of gene labels assumed to refer to the same gene. We then assigned the most prevalent gene label to all members of that group. In each case, we retained only genes that were present in more than ten species in our dataset. For annotated whole genome data, we used pattern matching for gene annotations based on regular expression identifiers to identify nuclear-encoded subunits of organellar protein complexes (expressions in Supplementary Text).
2 is anticipated, compatible with previous findings  [2] ; a beta-binomial  (1, 1)  prior distribution on the model space, and a minimally informative inverse gamma prior for noise. Further prior information, and the effects of varying them, are given in Supplementary Text and Supplementary Fig. S11. We implemented the selection process in the R package mombf. We additionally used linear modelling penalised using ridge and LASSO protocols, tree-based, and random forest regression, described in the Supplementary Text and implemented using glmnet, tree, and randomForest packages. Classification of subcellular encoding. We used Bayesian model averaging for generalised linear models (GLMs) predicting encoding compartments with priors giving probability 1/2 for the inclusion of each parameter, implemented in BMA.
Alternative retention index definitions In addition to our simple retention index, which relies on an estimated phylogeny linking observations in our dataset, we considered another assumption-free index. Here, we construct the set of unique oDNA presence/absence patterns in our dataset (as in Fig. 1A ), and simply count the occurrences c i of each gene i in this dataset. The index is given by log c i / max j log c j. This index relies on no evolutionary assumptions, and thus cannot account for the evolutionary relationship between sampled species. Considering only the set of unique barcodes goes some way towards accounting for the sampling bias in the dataset (for example, almost all metazoans have the same presence/absence profile, but this profile will only occur once in the unique set).
Biochemical and biophysical properties of genes and products Our assignment of biochemical and biophysical properties of genes and their products follows that in Ref. [2]. The length* (in number of amino acids of gene product) and GC content (trivially counted) of genes are taken straightforwardly from a sequence. Chemical properties of amino acids were taken from the compilation at http://www. sigmaaldrich. com/life-science/metabolomics/learning-center/ amino-acid-reference-chart. html. The hydrophobicity and hydrophobicity index of a gene product was computed using this compilation (original data from Ref. [9] ). Amine group pK a , carboxyl group pK a , and molecular weight* values were calculated using this compilation (original data from  [10] ). Glucose energy costs* were computed using the A glucose metric, based on the absolute nutrient cost required for amino acid biosynthesis, from Ref.
To compute a single value for each statistic of interest, a protocol is required to summarise the many different values seen for a given gene across the species in our dataset. For robustness, we considered several different averaging protocols. First, we averaged gene statistics over a set of model species taken from diverse eukaryotic groups (Homo sapiens, Arabidopsis thaliana, Saccharomyces cerevisiae, Reclinomonas americana, Chondrus crispus, Plasmodium falciparum). Second, we randomly selected a member of each clade branching from the eukaryotic group (see clade names above) and averaged over the set containing these random samples. Most statistics were very strongly correlated for these different choices (Fig. S9A ). The exception was GC content, which is well known to evolve differently in different clades.
Packages and libraries Our pipeline uses the following R packages: ape  [24] , arm  [25] , blme  [26] , BMA  [27] , caper  [28] , cowplot  [29] , e1071  [30] , geiger  [31] , GGally  [32] , ggnewscale  [33] , ggplot2  [34] , ggpubr  [35] , ggpval  [36] , ggrepel  [37] , ggtree  [38] , ggtreeExtra  [39] , glmnet  [40] , gridExtra  [41] , hexbin  [42] , igraph  [43] , lme4  [44] , logistf  [45] , mombf  [46] , nlme  [47] , phangorn  [48] , phytools  [49] , randomForest  [50] , stringdist  [51] , stringr  [52] , and tree  [53]. We also use BioPython  [3]  for parsing sequences and computing gene statistics, PyMOL  [8]  for visualisation, and BLAST  [54]  for sequence comparisons. S1.
1. (D) Performance (True/False Positive/Negative) of GLMs involving hydrophobicity and carboxyl pKa on predicting encoding compartment of genes outside the training set. Each set of points corresponds to a model for one organism. (E) Binding energy and encoding compartment. Traces show mean and 95% credible intervals for Bayesian generalised linear mixed model (GLMM) (see Methods for priors). The associated p-value is a frequentist interpretation from bootstrapping, against the null hypothesis of no relationship. Crystal structures are coloured according to the number of species in our dataset that retain the gene for each subunit.
Mean linear model regression performance (Spearman's ρ between predicted and observed indices) predicting retention index in test sets for different cases. Non-standard genes (msh1/muts, matr, mttb) are removed from mtDNA sets for these experiments. Labels show simple retention index vs barcode retention index; 'pruned' dataset (retaining only mt genes from families nad, sdh, atp, cox, cytb, rp and pt from psa, psb, rp, rbc, ndh, atp, pet) vs unpruned. Each LM uses only GC content and hydrophobicity.
are [apico]mplexa, [bacill]ariophyta, [bigyr]a, [cerco]zoa, [chatto]nellaceae, [crypto]phyceae, [disco]sea, [eumyc]etozoa, [eusti]gmatophyceae, [fungi], [glauco]cystophyceae, [hapto]phyta, [heter]olobosea, [jakob]ida, [malaw]imonas, [metaz]oa, [oligo]hymenophorea, [oomyc]ota, [phaeo]phyceae, [rhodo]phyta, [virid]iplantae. Clades in the plastid dataset are [apico]mplexa, [bacill]ariophyta, [chlora]rachniophyceae, [crypto]phyceae, [dicty]ochophyceae, [dinop]hyceae, [eugle]nida, [eusti]gmatophyceae, [glauc]ocystophyceae, [hapto]phyta, [mallo]monadaceae, [pelag]omonadales, [phaeo]phyceae, [rhodo]phyta, [virid]iplantae.
Data As a case study, we considered changes in bat phylogenetic diversity across a disturbance gradient in the Selva Lacandona of Chiapas, Mexico. Medellín et al. (2000)  collected the abundance of bat species in four habitats (rainforests, cacao plantations, old fields and cornfields). We obtained the phylogeny of 34 observed species using a consensus ultrametric tree (function consensus. edge, R package phytools; Revell, 2012) on 9,999 credible birthdeath, tip-dated completed trees downloaded from http://vertlife. org/phylosubsets on 2021/02/12  (Upham et al. , 2019). For species names, we followed  Upham et al. (2019). Branch lengths on the consensus tree were obtained using mean edge length, ignoring credible trees in which the branch is absent  (Revell, 2012).
Analyses Our objective in the analysis of this dataset, in addition to simply illustrate our theoretical developments, was to depict how disturbance changes the level of bat phylogenetic diversity by identifying which among the rarity, distinctiveness, and effective originality of bat species is/are affected. For that, we calculated, in each habitat, the phylogenetic diversity using Y  and α I, for α varying between 0 and 3 with a step of 0. 1. We explored then in detail the patterns of phylogenetic diversity in terms of effective originality. Additionally, we analyzed species distinctiveness in the species pool (using indices ED and eq    that both discard abundance data).
Results In the species pool, for values of α of 1, 2 and 3, according to eq    the two Vespertilionidae species (Bauerus dubiaquercus and Myotis keaysi) are the most phylogenetically distinct, being the sole members of their clade in the dataset (Fig. 3 ). The least distinctive species are the two Artibeus species as they are in the most species-rich part of the phylogenetic tree, where both terminal and internal branches are numerous and relatively short. For low values of α, the distinctiveness is strongly influenced by the length of the terminal branches. This has two main consequences: the species perceived as least distinct are the two Carollia species that diverged recently; and the two Vespertilionidae species are no longer perceived as the most distinct, as their terminal branches are shorter than those of Thyroptera tricolor, Pteronotus parnellii and Mormoops megalophylla.
e. , neither threatened nor near threatened) at a global scale with either stable or unknown population trends except M. megalophylla that is least-concern but with decreasing population trends, and B. dubiaquercus that is near threatened (+ Vampyressa pusilla classified as data deficient). Our results showed that M. megalophylla and B. dubiaquercus are among the most phylogenetically distinct species in our study area. Only one individuals of M. megalophylla and three individuals of B. dubiaquercus were observed in our case study (out of a total of 2405 bats). M. megalophylla was observed in old fields and B. dubiaquercus in rainforest and old fields. These scarce occurrences prevented us to evaluate the possible direct effects of agriculture on their population size. However, both species are aerial insectivous species  (Rodríguez-Aguilar et al.
(2019)  observed that, in semi-natural grasslands of south west Japan, low-abundance and phylogenetically distinct species were threatened by land-use intensification, resulting in plant phylogenetic diversity loss. To make our mathematical framework readily available for data analysis, we have updated and added R functions in package adiv of R (Pavoine 2020, 2021; R Core Team, 2021) (see also Appendix C). adiv is dedicated to the analysis of diversity in ecology and now integrates a range of functions to measure both species-level originality and community-level diversity. It constitutes thus a useful tool to implement our framework. Compared to previous studies that connected a single index of distinctiveness or of effective originality to a single diversity index (e. g. Isaac et al. , 2007; Ricotta et al.
Data statement R scripts and data have been placed in Appendixes C to E. We also integrated scripts in package 'adiv'  (Pavoine 2020 (Pavoine , 2021) )  into functions named 'distinctAb ', 'distinctDis',     'distinctTree', 'FPdivparam', 'plot. FPdivparam' as indicated in Appendix C, and data in the     dataset named 'batcomm'.
Dataset The dataset used in this study comes from the REPO 2 MSE cohort, which characteristics were previously reported  [24]. It contains multi-channel scalp-EEG recordings from 568 patients with epilepsy, and annotations of seizure onsets from an experienced epileptologist. 1212 distinct seizures, each in one record file, are available with each record being cut to contain a single seizure with a median of 3. 0 minutes of interictal recording before the annotated seizure onset. EEG recordings were either sampled at 256Hz (89. 6%), 512Hz (10. 2%) or 1024 Hz (0. 2%). The median number of files containing a seizure was of 2 per patient, a maximum of 9 and a minimum of 1. EEG recordings were saved in TRC format and later converted using MATLAB to. mat files for subsequent processing in Python.
BN is used to re-center the data and to ensure a non-linear ReLU activation, as this has been proven to speed-up training and improve model performance  [25]. A 30% dropout (DO) operation is used before each FC layer and 0. 05 weighted kernel and bias regularization are used to avoid overfitting. Models are trained for a maximum of 120 epochs with early-stopping if no improvement of the validation loss is made after 15 epochs. Stochastic Gradient Descend (SGD) optimizer is used with a learning-rate of 0. 005. The training was performed on a computing server with 2 AMD EPYC 7551 32-Core Processors and 500 GB of RAM, equipped with an Nvidia Tesla T4 GPU. The models were implemented with Keras using the Tensorflow v1. 4 backend. Training on set A takes 99 minutes for 50 epochs, or a mean time of 118 seconds per epoch.
To reduce false positive detection in the interictal part, we consider a window positive if the log-odds of the ictal evidence over the interictal evidence is superior to a threshold th. This method assumes statistical independence between each subsequent segment, which is not the case for EEG time-series, but it is still the method of choice since each segment is processed independently by the network. As there is no signal without seizures in the dataset, metrics at the seizure-level are reported according to the negative and positive parts of the signal. A seizure is correctly detected if the onset is detected in the ictal part of the signal and counted as a false positive if detected in the interictal part (see Figure  1 ). We also defined a difference filter method aiming at detecting the transition between the pre-ictal and ictal segments.
The 3x5 model can keep relatively high sensitivity at a high threshold because the distribution is more shifted towards the positive class than for the other models and the opposite is observed for the 3x131 model. The 3x91 model is the most balanced with F1-scores of 0. 759 and 0. 566 for decision thresholds of 0. 15 and 0. 85 respectively. All models have an AUC of 0. 87. Performance at the segment-level is in line with the aforementioned studies using DL. Direct comparison is however not possible as this study constitutes the first DL work on the target dataset. This summarizes the performance of the models at the segment-level. However, the performance of the seizure detection method depends on complete EEG signals and not only on classification of short segments. Since the detection of seizure patterns does not require that all sub-segments are classified  correctly, a careful design of the post-processing method can potentially increase the performance at the seizure-level.
Acknowledgement This work has been supported by the  H2020 DeepHealth Project  ( GA No. 825111 ) and by the  H2020   RECIPE  project (GA No. 801137 ). The REPO 2 MSE cohort was funded by the  French Ministery of Health  (PHRC national 2009) and sponsored by  Hospices Civils de Lyon , and involved the following investigators:  Philippe Ryvlin  (Lyon, PI),  Sylvain Rheims  (Lyon, co-PI),  Philippe Derambure (Lille) ,  Edouard Hirsch (Strasbourg), Louis Maillard (Nancy) ,  Francine Chassoux  ( Paris-St-Anne ),  Arnaud Biraben  (Rennes),  Cécile Marchal  (Bordeaux),  Luc Valton  (Toulouse),  Fabrice Bartolomei  (Marseille),  Jérôme Petit  ( La Teppe ),  Vincent Navarro (Paris-Salpétrière), Philippe Kahane (Grenoble) ,  Bertrand De Toffol (Tours) ,  Pierre Thomas (Nice).
2. 3. 1. Fraud remains a "rare" event Among transactions, bank accounts, exchanges or any other fraud targets, most operations will be legitimate (nonfraudulent). Because fraud is so rare, datasets will be extremely biased in favor of nonfraud, which can seriously bias the models that are built from these data sets. The management of imbalanced classes generally requires data or algorithm transformation and the adjustment of precision measures. To illustrate the problem, let us consider that 3% of the transactions are fraudulent (positive). An algorithm that classifies by default all transactions as negatives (nonfraudulent) will have an accuracy of 97% although it does not detect a single fraudulent transaction. To address this issue of imbalanced data, there are various approaches. Confusion matrix, for instance, supports a more appropriate assessment of performances in an imbalanced setting.