dataesr/scientific-paragraphs-categorization huggingface dataset:
Binned description of unbinned models The previous examples use a binned description of the experimental measurement, which employs only two types of PDFs: Poisson distributions to describe the counting experiments in each bin, and Gaussian distributions for the constraints. Another common modeling option is unbinned models, which describe the continuous probability distribution of the measurement observables. It is used for instance to study the H → γγ decay of the Higgs boson at the LHC  [21, 22] , as well as in many results published by LHCb (see for instance refs. [23, 24] ). It requires support for arbitrary PDF forms, as needed to describe each measurement, and therefore more general and flexible tools than for binned models. For LHC measurements, this functionality is usually provided by the roofit package  [25]  distributed as part of ROOT, but this and other similar tools are not widely used outside the high-energy physics experimental community.
The signal and background distributions are represented respectively by Gaussian and exponential distributions, instead of the more complex shapes used in ref. [21]. The peak position and width of the Gaussian, as well as the expected signal and background yields are taken from ref. [21] , while the exponential slope of the background is assumed to be -0. 02 GeV -1 in all categories. The background normalizations and exponential slopes are free to vary in the fit, except for the slopes in five low-statistics categories which are kept fixed to avoid unstable fits. Five NPs are used to describe the leading systematic uncertainties: the uncertainty on the integrated luminosity of the dataset; on the reference cross-section for the gluon-fusion production process; on the effect of parton shower modeling on the signal yields; on the H → γγ reconstruction efficiency; and on the photon energy resolution.
This last uncertainty leads to a change in the width of the signal peak and therefore induces highly non-linear effects in the per-bin signal yields in a binned description of the likelihood. Systematic uncertainties on the background model are implemented using separate NPs in each category, following the spurious signal method described in ref. [21]. The values of the uncertainties listed above are all taken from ref. [21]. In total, 99 NPs are defined. The single POI is the Higgs boson signal strength µ, applied as a scaling factor to the expected signal yield in all categories. A dataset of events randomly generated from the model PDF is used as the "observed" data in this example.
Simplified model The SLLS model is built as a binned approximation to the full model. A fine binning is required to obtain an accurate description of the signal peak. In this example a uniform bin width of 0. 1 GeV is used, leading to 18150 bins in total for the 33 categories. 4 The m γγ distributions for two selected categories (the first and last in the order used in ref. [21] ) are shown in figure  6. The conversion is performed using an automated tool distributed as part of the fastprof package. All the NPs are retained, and their effect is described in terms of their linear JHEP04(2023)084. Distributions of the observable m γγ for two selected categories -the ones labeled 0-jet, p H T < 10 GeV (top) and p H T ≥ 650 GeV (bottom) in ref. [21]. The bin width is 0. 1 GeV in both cases. The signal and background contributions (blue and green histograms respectively) are shown together with the example dataset (black points), for the best-fit value of the model parameters.
An implementation of the SLLS framework is provided in the fastprof package at https://github. com/fastprof-hep/fastprof. The models are stored in a plain-text JSON format, and computations and other operations are performed using python tools based on the widely available numpy and scipy libraries. Together with other full and simplified likelihood formats with complementary functionality, it is hoped that the SLLS framework will encourage the further publication of detailed statistical models by LHC experiments and beyond.
B Binned approximation to an unbinned PDF We consider an extended unbinned PDF for an observable x, P (x; θ) n i=1 dx i = e -N (θ) n! N (θ) n n i=1 f (x i ; θ)dx i (B. 1) where f (x, θ) is the PDF for one observation of x, the dataset consists of the values x 1 • • • x n , θ are the model parameters, and the expected number of observations is N (θ). We include the infinitesimal volume elements dx i in the expression since these will be useful below. We introduce a set of bins B a , a = 1 • • • N bins that span the allowed range of x. In the spirit of finite-element analysis, we approximate f (x) by a form that is constant over each bin as f (x, θ) = where the indicator I a (x) is 1 if x ∈ B a and 0 otherwise, and w a = Ba I a (x)dx is the measure of bin B a. The value f a (θ) is the average of f (x, θ) over the bin B a , so that for a sufficiently fine binning and smooth f (x, θ), f (x, θ) ≈ f a (θ) for x ∈ B a.
Acknowledgments The author would like to thank  Nick Wardle  providing the code for the simplified likelihoods of ref. [9], and  Tetiana Hryn 'ova for valuable feedback. Plots in this paper were produced with matplotlib using the SciencePlots style package [31]. This research was funded, in whole or in part, by l' Agence Nationale de la Recherche (ANR) , project  ANR-22-CE31-0022.
As such, we lack a systematic understanding of the role of R-M systems in shaping plasmid transfer r outes acr oss known bacterial di v ersity. Here we investigate the avoidance of Type II restriction targets in plasmids, using a dataset of 8552 complete genomes from 72 species containing 21 814 plasmids, as well as a separate dataset of plasmids with information on host range  ( 26 ). Our results both confirm that avoidance of restriction targets is a general feature of bacterial genes and suggest that it may be greater in plasmids for 6-bp targets. By analysing the taxonomic distribution of Type II R-M systems and plasmids together, we show that avoidance patterns are associated with a plasmid's size and host range: small and broad host range plasmids show greater avoidance of R-M targets.
Predicting type II R-M systems Our analysis approach r equir es a presence / absence database of R-M systems targeting particular motifs across different species of bacteria. We ther efor e first de v eloped a pipeline 'rmsFinder' to detect Type II R-M systems and then predict their target motifs: ( https://github. com/liampshaw/rmsFinder ). Pre vious wor k (Oli v eira, Touchon, and Rocha 2016) determined protein similarity thresholds above which enzymes are likely to have the same target specificity. We use percentage amino acid identity scores of 50% for restriction endonucleases (REases) and 55% for methyltr ansfer ases (MTases) as default values to define predicted targets. rmsFinder uses pre viously pub lished hidden Mar kov models (HMMs) from either Oli v eira, Touchon, and Rocha (2016) (-hmm oli v eira) or  Tesson et al.
Results presented in this manuscript are from the 'all' mode of rmsFinder using REBASE v110 (downloaded 19 October 2021). We use the proteins defined within REBASE as Type II REases or MTases. We investigated the possibility of predicting the targets of Type IIG systems where the restriction and methylation functions are encoded in a single enzyme, but found that this was not reliable (data not shown) and so restricted our analysis only to Type II systems where the REase and MTase are separate enzymes.
Overall pipeline We de v eloped a pipeline to run rmsFinder on downloaded genomes from a different bacterial species to create a database of putati v e R-M systems with predicted targets (Supplementary Data S2) and also to compute exceptionality scores for all possible k-mers. The github repository for this paper contains analysis scripts ( https://github. com/ liampshaw/R-M-and-plasmids ); here we describe the overall approach.
Species genomes We downloaded genomes for all n = 104 species with > 25 complete genomes in NCBI RefSeq (as of 20 January 2022) then filtered them for quality with PanACoTA v1. 3. 1  ( 32 )  with the 'pr epar e' subcommand (-nor efseq, otherwise default parameter, meaning retained genomes have a maximum L90 of 100 and a maximum of 999 contigs). After filtering, n = 72 species had > 25 complete genomes (8552 genomes in total; 'RefSeq: > 25' dataset; for list of accessions see Supplementary Data S3). For each species, we used PanACoTA v1. 3. 1 to annotate genes and then perform a pangenome analysis. We defined a gene family as 'core' if > 99% of genomes had exactly one member (corepers subcommand of PanACoTA with '-t 0. 99 -X'). This is a mor e r elax ed definition than a strict core genome where all genomes are required to have exactly one copy of each core gene; such a definition can produce reduced core genomes when using public genomes, because an error in any single assembled genome can remove a gene from the core genome.
After annotating to find CDSs, we split each Ref-Seq genome into three gene components: core genes on the chromosome ('cor e'), non-cor e genes on the chromosome ('non-core'), and genes on other replicons ('plasmid'). Three species in our dataset contained secondary chromosomes: Burkholderia pseudomallei (81 / 91 isola tes), V ibrio cholerae (57 / 70) and Vibrio parahaemolyticus  (43 / 43). For the purposes of our analysis, we treated genes on these secondary chromosomes as 'plasmid' genes (excluding them did not change our conclusions). We analysed target avoidance both for the entire genome and for each pangenome component separately.
Plasmid genomes We downloaded the dataset of n = 10 634 plasmids previousl y anal ysed by Redondo-Salvo et al. ( 26 ). We used their existing classification of these plasmids into plasmid taxonomic units (PTUs). Redondo-Salvo et al. define the host range of a PTU from I-VI based on its observed distribution across taxonomic le v els, from narrow (I: within-species) to broad (VI: within-phylum) (see Supp. Dataset 2 of that paper). We filtered the plasmids to n = 4000 plasmids that were seen in species from our RefSeq: > 25 dataset (using Tax-Name in Redondo-Salvo et al. 's Dataset S2 and disregarding extra specificity after genus and species). Host range is not strongly correlated with plasmid size (e. g. for k = 6 linear model dataset, Spearman's ρ = 0. 046, P = 0. 10), so we include both of these variables.
R-M target distribution We ran rmsFinder on the 8552 filtered genomes in our dataset of 72 species. We detected 8616 putati v e R-M systems with a predicted target motif, with 2 592 genomes containing at least one R-M system (30. 3%). Some putati v e R-M systems 'overlapped', e. g. the same REase could be included in multiple putati v e systems if there were multiple MTases in close proximity. To avoid overcounting these systems, we considered the unique targets recognised per genome. Of the R-M-containing genomes, 1875 / 2592 (72. 3%) had R-M system(s) recognising just one motif (range: 0-18 putati v e R-M systems; Helicobacter pylori genomes accounted for all those with > 9 R-M systems). Six species contained no predicted R-M systems ( Bacillus anthr acis , Chlam ydia tr achomatis , Corynebacterium pseudotuberculosis , Limosilactobacillus r euteri , My cobacterium tuberculosis , Pisciric k ettsia salmonis ).
R-M systems targeted 104 known REBASE motifs corresponding to 341 unambiguous sequences (hereafter: 'targets') of which the majority were between 4 and 6 bases long (Table  1  ). Where a motif contained ambiguity codes (e. g. A TNNA T) we included all possibilities as independent targets i. e. with equal weighting compared to unambiguous targets. Out of the 99 motifs of 4-6 bases, 30 were targeted by only a single species. On average, a gi v en REBASE motif was targeted by systems found in a median of three species (range: 1-28) and 20 genomes (range: 1-615). We then aggregated these results by species into a binary presence / absence matrix of species against k -mers for k = 4, 5, 6 (Supplementary Data S4-6). In this matrix, entries are either 1 (denoting that a functional R-M system targets the k-mer), or 0 (denoting that no R-M system was observed in the dataset targeting the k -mer).
Where a k -mer has zero observed occurrences and zero expected occurrences, its score as calculated by R'MES is defined as zero. Using the taxonomic dictionary of the presence of systems targeting particular R-M targets we then calculated the median exceptionality score for defined groups of targets for each species. For example: assume that for a given species S a , we detect R-M systems which target k 1 , k 2 and k 3. A different species S b within the same genus has R-M systems targeting k 1 , k 4 and k 5. The within-species R-M targets of S a are { k 1 , k 2 , k 3 } and the within-genus targets are { k 1 , k 2 , k 3 , k 4 , k 5 }. This logic extends up the taxonomic hierarchy, up through family, order, class, phylum and finally to kingdom, the set of targets includes all k -mers targeted by any R-M system detected within our dataset.
Modelling palindrome avoidance controlling for phylogeny Genome composition is correlated with phylogeny and public databases are une v enly sampled, making ov erall findings about 'average' effects from comparati v e studies potentiall y misleading. Phylo geneticall y controlled anal yses are r equir ed to draw reliable conclusions  ( 36 , 37 ). We modelled the difference in R-M target avoidance between plasmid genes and core genes on the chromosome at a within-isolate le v el, subsampling to 10kbp; n = 4553 genomes across 60 species with at least 10 kb in each of the three pangenome components components ('cor e', 'non-cor e' and 'plasmid'). Differences between plasmids and chromosomes can be biased by the phylogenetic structure of bacteria. To account f or this, we f ollowed the methodology of Dewar et al.
( 38 ). For the species phylogeny, we constructed a 16S rRNA gene phylogeny as follows. First, we downloaded all available nucleotide sequences from NCBI's Bacterial 16S Ribosomal RNA RefSeq Targeted Loci Project (PRJNA33175). We then searched for our species, picked one sequence per species (the first one in the combined fasta file), aligned these sequences with mafft v7. 490 (default options)  ( 39 ) , built a tree with FastTree v2. 1 (-gtr model)  ( 40 ) , and then midpoint-rooted the tree before using it in modelling. This phylogeny is provided in supplementary material (Supplementary Data S7 and Supplementary Figure  S1 ). The phylogeny can be converted into an inverse matrix of relatedness between species, which can then be used to incorporate phylogenetic structure into the random effect of species.
Softw ar e All python and R code is available on github. Bioinformatic analysis of genomes and plasmids was carried out using the Biomedical Research Computing (BMRC) facility at the Uni v ersity of Oxford. We conducted downstream analyses in R v4. 1. 2 and RStudio v2022. 07. 2 using the following R packages: ape v5. 6-1, cowplot v1. 1. 1, dplyr v1. 1. 1, formatR v1. 14, ggbeeswarm v0. 6. 0, ggplot2 v3. 4. 1, ggrepel v0. 9. 3, ggridges v0. 5. 4, ggtree v3. 2. 1, MCMCglmm v2. 34, phytools v1. 0-3, reshape2 v1. 4. 4, tidyr v1. 2. 0, tidyverse v2. 0. 0.
To test this hypothesis, we assembled a dataset of highquality r efer ence genomes for species from NCBI RefSeq ( n = 72 species with > 25 genomes). Within each species, we separated genes into three pangenome components: genes where > 99% of genomes in the species had exactly one copy ('core'), other genes on the chromosome ('non-core'), and all genes carried on other replicons ('plasmid'). As an initial proxy for restriction targets, we first analysed the avoidance of short palindromes in each pangenome component for k = 4 and k = 6 (DNA palindromes r equir e k to be e v en). When testing evidence of avoidance of a specific target it is important to account for differences in sequence composition; for example, a GC-rich sequence should a priori contain fewer occurrences of an AT-rich target.
The taxonomic distribution of type II R-M systems correlates with target avoidance Our genomic dataset spanned a wide range of bacterial di v ersity (Supplementary Figure  S3 ). We hypothesised tha t sta tistical avoidance of a gi v en target would correlate with the distribution of R-M systems having that targeta proxy for frequency of encounter, and ther efor e for exposure to the selecti v e pressure from R-M. Reliable prediction of targets for novel sequences is only possible for Type II R-M systems where restriction and methylation are carried out by different enzymes  ( 22 )  (see Materials and Methods). We de v eloped a pipeline ('rmsFinder') to predict both the presence and targets of Type II R-M systems in our dataset using the cur ated REB ASE database of known R-M enzymes. We produced a presence-absence matrix of kmers targeted by Type II R-M systems across species in our dataset: when we detected a system with a target t in a genome from species s , we classed t as a within-species restriction target of s.
In turn, we used this presence-absence matrix to produce a taxonomic dictionary of targets for each species (Figure  2 A-C ), ranging from within-species to within-phylum targeting based on the detected presence of R-M systems across our dataset. We detected 8616 putati v e R-M systems where we could confidently predict their target and 2592 genomes contained at least one R-M system (30. 3%). Of these putati v e systems, 8100 (94. 0%) were carried on the chromosome. R-M systems targeted 104 known REBASE motifs. Accounting for ambiguous bases, R-M systems targeted 341 specific k -mers, the majority of which (52. 5%) were 6-bp targets (Table  1  ). Since motifs of k = 7 and 9 were not prevalent (only observed in 66 genomes) we analysed targets for k = 4, 5, 6 (99 / 104 motifs; Table  1  ) across our pangenome dataset.
whether R-M targets are avoided more in plasmid genes than core genes 'on average' across different bacteria when trying to combine different values of k. For k = 6, where R-M systems contain the highest number of unique k -mer targets and are widely distributed, targets within the same taxonomic family were avoided more by plasmid genes at nearby taxonomic le v els (species to family), with this differ ence decr easing at higher taxonomic orders (class, phylum) to no difference when considering avoidance of all observed R-M targets within the dataset (kingdom). Howe v er, it should be noted that for k = 4 plasmid genes had weaker avoidance than core genes (Supplementary Figure  S7 ), perhaps in line with the lack of difference between avoidance of palindromes in core and plasmid genes (Supplementary Figure  S1 ), and for k = 5 there was no clear difference (Supplementary Figure  S8 ), so we caution against generalising this result.
The density of within-species R-M targets increases with plasmid size It is the actual number of occurrences of a R-M target within a plasmid that determines the extent to which it will be restricted by the associated R-M system. The expected number of target occurr ences incr eases linearly with the size of the plasmid: for a plasmid of length L , the probability of containing a gi v en k -mer scales as ∼L / 4 k. For a random k -mer, one should expect a constant mean density. Howe v er, when we e xamine plasmids from the most prevalent species in our genomic dataset, Esc heric hia coli , the density of R-M targets increases with plasmid size: larger plasmids have a disproportionate number of targets (Figure  3 A, B ). This pattern is not as consistent across species, although the comparison between the smallest and largest plasmid sizes within a species is significant for k = 6 (Figure  3 C-E ).
From another perspecti v e, across all plasmids when   (A-C ) Methodological approach to connect Type II R-M system distribution to tar get av oidance: ( A ) We search for Type II R-M systems in n = 8552 genomes from 72 species, detecting complete systems with confident prediction of targets them in 2740 genomes (Table  1  ). From these hits, we created a taxonomic hierarchy of their targets across a set of species. ( B ) We construct a pangenome for each species in our dataset, then separate each individual isolate into genes in three pangenome components: core, non-core and plasmid. ( C ) We subsample pangenome components to a fixed size and use R'MES to calculate exceptionality scores for fixed-length k -mers for k = 4, 5, 6 for each species, using the taxonomic hierarchy of R-M targets to correlate exceptionality scores with R-M distribution.
Interestingly, the avoidance of 6-bp palindromes in plasmids that are not members of an assigned PTU suggests that they are most similar to PTUs with a within-species host range in terms of palindrome avoidance. Many singleton plasmids (those detected only once) are probably indeed restricted to single species, although notably there is a long tail of more negati v e e xceptionality scores, suggesting that some may hav e broader host ranges and / or be more recent entrants into the pangenome of that species with more avoidance of targets of R-M systems seen outside the species. To understand the effect of plasmid size, we then modelled avoidance of R-M targets. We modelled the avoidance of R-M targets using our taxonomic hierarchy in 4 000 PTUs seen in the same species as our dataset of complete genomes (see Methods).
Broad host range plasmids carry more methyltransferases The carriage of anti-restriction genes can help MGEs to evade restriction even when they carry sites recognized by the host  ( 47 ). Most of these sytems remain poorly described. Howe v er, a well-characterised way to evade restriction is by encoding a solitary Type II MTase. Such 'orphan' MTases ar e pr esent in man y prokary otes and likely have functions linked to genome regulation  ( 48 ) , but they can also provide a plasmid with effecti v e protection against restriction against multiple R-M targets  ( 49 ). Our hypothesis about the necessity of adaptation through gene carriage for large plasmids suggests that solitary MTases should be frequently carried by larger plasmids and particularly those with a broader host range. We searched all 10 634 plasmids in the Redono-Salvo dataset for MTases and REases.
DA T A A V AILABILITY Genomes analysed are all from public databases (NCBI) and accessions are available as Supplementary Data. Analysis scripts are on github ( https://github. com/liampshaw/R-M-and-plasmids ) as is rmsFinder, the tool we de v eloped to find and predict the targets of putati v e R-M systems ( https://github. com/liampshaw/rmsFinder ). The R-M-andplasmids github repository can be used to reproduce analyses (figures and tables) using intermediate data files made available via figshar e: https://doi. org/10. 6084/m9. figshar e. 21923121. v3. An archi v ed release of the tool rmsFinder that was de v eloped for this paper is availab le at the same DOI.
ACKNOWLEDGEMENTS We w ould lik e to thank the cur ators of REB ASE and its many contributors, who collecti v ely made this work possible. Thanks to  Santiago Redondo-Salvo  for discussions about PTU host range,  Sophie Schbath  for correspondence about  R'MES ,  Anna Dewar  for discussion of phylo geneticall y-controlled GLMMs, and the three re vie wers for their constructi v e comments. The views expressed are those of the author(s) and not necessarily those of the  NHS , the  NIHR  or the  Department of Health. For the purposes of open access, the author has applied a CC-BY public copyright licence to any author accepted manuscript version arising from this submission.