dataesr/scientific-paragraphs-categorization huggingface dataset:
Using detailed contact tracing data, we presented a novel approach to estimating transmission heterogeneity over time on a continuous scale, i. e. , time-varying overdispersion (k t ) and other related statistics. We applied our approach to investigate and compare the epidemiology and temporal transmission heterogeneity with two coronavirus datasets from Hong Kong notable for superspreading: SARS in 2003, and the ongoing COVID-19 pandemic  (1, 17).
transmission pairs was the same as for COVID-19, though we additionally reviewed publicly available reports to identify the con rmed index cases of large clusters where contact tracing data was ambiguous. As before, we constructed two datasets for sensitivity resulting in 472 transmission pairs (comprising 552 cases) for SARS where the speci c infector and infectee was known, and 1,061 pairs (comprising 1,160 cases) when including infectees linked to common exposure settings.
Estimating transmission heterogeneity of SARS and COVID-19 Heterogeneity in transmission can be modelled according to a negative binomial distribution and corresponding dispersion parameter k t to the individual numbers of secondary infections (offspring distribution), where the mean parameter, μ, is equivalent to the effective reproductive number (Re). Following the approach described by Lloyd Smith et al. ,  (2)  we generated offspring distributions for each of the primary and sensitivity datasets for SARS and COVID-19 by counting the number of secondary cases per primary case or exposure setting for all resolved and unresolved pairs. Cases without traceable onward transmission, including cases without a known source (unlinked singleton cases), were included in each distribution as chain terminating cases i.
e. , zero secondary cases, excluding those SARS cases without contact tracing data as before. Negative binomial distributions were tted by maximum likelihood (ML) estimation to the primary and sensitivity offspring distributions independently using tdistrplus v1. 1-3 xing Re = 1 for control interpretation of k between groups and datasets. Uncertainty around each point estimate of k was generated by parametric bootstrap resampling (n=1,000). Final overall estimates were a composite of the primary (upper bound) and sensitivity analyses (lower bound) calculated as the median and 95% quantiles of the combined bootstrapped distributions (See Supplementary Table  S1  for independent results). To provide an intuitive comparison of overall transmission heterogeneity between SARS and COVID-19 on a linear scale, we calculated the proportion of individuals responsible for 80% of onward transmission (Prop80, by analogy to the 20/80 rule) as per the formula below given Re = 1 (3):    Figures.
ACKNOWLEDGMENTS This project was supported by the  Health and Medical Research Fund, Food and Health Bureau, Government of the Hong Kong Special Administrative Region  (grant no. COVID190118 ), and the  Collaborative Research Scheme  (Project No. C7123-20G ) of the  Research Grants Council of the Hong Kong SAR Government , and  AIR @InnoHK administered by  Innovation and Technology Commission. BJC is supported by a  RGC Senior Research Fellow Scheme grant  ( HKU SRFS2021-7S03 ) from the  Research Grants Council of the Hong Kong Special Administrative Region, China.
Characterization of and transmission pairs COVID-19, we characterized case clusters transmissions pairs con rmed between Jan 23, 2020, and Apr 5, 2021, using data provided by the Centre for Health Protection in Hong Kong, which was available for all 9,195 local cases detected during the study period. This period covered the epidemic waves of local transmission of COVID-19 in Hong Kong. Clusters linked to known imported index cases were excluded to limit inference of NPI effects to local measures only i. e. , excluding travel related measures. Characterization, including the generation of transmission pairs, was performed as per our previous study with complete details of the construction process also available in the supplementary methods  (1). Overall, we constructed two datasets each for COVID-19 and SARS sensitivity analyses.
First for COVID-19, we identi ed 4,697 resolved transmission pairs (comprising 6,531 cases) where the speci c infector and infectee could be identi ed (the primary dataset). Second, we additionally included cases whose infector was unknown but who could be traced to a common exposure source, i. e. , as infectees linked directly to an exposure setting (hereafter denoted as unresolved transmission pairs & the sensitivity dataset), increasing the number of pairs to 6,196 pairs (comprising 7,640 cases). For SARS in 2003, contact tracing was performed and data provided by the Department of Health, and could be matched to demographic data for 1,293 (73. 6%) of the 1,755 cases con rmed within Hong Kong. The 462 SARS cases with that could not be matched were excluded from all subsequent analyses. Generation of.
To simplify parameter estimation in time and control against biases in contact tracing data when case numbers were high, we estimated the median Re t using EpiNow2 (4) for each of the dynamics and xed sliding window periods which was then xed as the input as parameter μ when estimating k t. Uncertainty around each estimate was again generated by parametric bootstrap resampling. A nal composite estimate of k t was calculated by day as the median and 90% quantiles of the combined bootstrapped distribution of each of the variable window periods from both the primary and sensitivity datasets. We generated 90% CIs here instead of 95% for k t because more extreme values of k were most di cult to estimate accurately with small sample sizes (5) as a result of sub-setting the observed data. This also allowed easier visualization of k through time and matched with the results as presented for SARS in Lloyd-Smith et al  (2).
Data integration of single-cell data describes the task of embedding datasets obtained from different sources into a common space, so that cells with similar cell type or state end up close from one another in this representation independently from their dataset of origin. Data integration is a crucial early step in most data analysis pipelines involving multiple batches and allows informative data visualization, batch effect reduction, high resolution clustering, accurate label transfer and cell type inference. Many tools have been proposed over the last decade to tackle data integration, and some of them are routinely used today within data analysis workflows. Despite constant endeavors to conduct exhaustive benchmarking studies, a recent surge in the number of these methods has made it difficult to choose one objectively for a given use case.
Furthermore, these tools are generally provided as rigid pieces of software allowing little to no user agency on their internal parameters and algorithms, which makes it hard to adapt them to a variety of use cases. In an attempt to address both of these issues at once we introduce transmorph, an ambitious unifying framework for data integration. It allows building complex data integration pipelines by combining existing and original algorithmic modules, and is supported by a rich software ecosystem to easily benchmark modules, analyze and report results. We demonstrate transmorph capabilities and the value of its expressiveness by solving a variety of practical single-cell applications including supervised and unsupervised joint datasets embedding, RNA-seq integration in gene space and label transfer of cell cycle phase within cell cycle genes space.
Introduction Batch effects occur in most applications involving datasets gathered across multiple sources or experiments, and describe strong dataset-specific signals which are often irrelevant to the studied questions. Data integration is a computational paradigm aiming to learn a joint embedding of datasets in which batch effects are regressed out [Fig. 1a ], so that only dataset-independent factors are expressed. The idea is to learn this space by leveraging information contained in several datasets, each of those being biased by its own specific batch effects. We focus here on the so-called horizontal data integration  [1]  which seeks to integrate cells measured in the same domain with overlapping feature spaces. This is different from vertical and diagonal data integration where cells are measured in different domains, also known as multi-omics data integration.
This scenario involves specific strategies and algorithms which are beyond the scope of this work (see for instance  [2] ). Data integration is an important preprocessing step for applications involving several datasets. In some cases something as simple as centering and normalization/scaling of features may suffice, but more complex batch effects often require more subtle, dedicated algorithms to be satisfyingly removed. Data integration can serve various purposes. The most common usage is to embed items from all datasets into a joint low dimensional space like in the Harmony tool  [3] , which can then be used to carry out downstream learning algorithms such as clustering, label transfer or visualization. Another use case is to directly perform integration in the initial domain like in the MNN tool  [4] , so that algorithms needing interpretable features such as matrix factorization methods can be used.
Finally, integration can be carried out without embedding data points into an explicit feature space, for instance by outputting a joint graph of cells across datasets like in the BBKNN tool  [5]. Data integration finds particularly important applications in single-cell biology. A single-cell dataset is generated from a biological tissue, and contains individual molecular measurements (for instance gene expression, SNPs or chromatin accessibility) about single cells of the tissue. The strength of single-cell analysis is its ability to both provide an insight into intrinsic cell state, while also giving access to population-level information, that can for instance be used to estimate cell types distribution within a tissue. Due to genetic and environmental differences between individuals, batch effects are very prone to appear in medicine when dealing with single-cell datasets coming from different patients.
The intertwine of batch-dependent and batch-independent factors is an obstacle for the analysis of large comprehensive datasets built by aggregating data from different individuals, notably when building cell atlases (see for instance  [6] ). Data integration is therefore a necessary technology to develop in order to mitigate dataset-specific signal while preserving relevant biological signal proper to the system of interest. Many approaches have been proposed over the last decade to tackle data integration in single-cell, resorting to a variety of algorithmic strategies. Some methods such as mutual nearest neighbors (MNN)  [4] , CONOS  [7] , Harmony  [3] , Seurat  [8]  and BBKNN  [5]  work under the hypothesis that batch effects are almost orthogonal to biological effects. This allows these tools to leverage data geometry using nearest neighbors across datasets as a proxy for cell-cell similarity.
Other data integration methods like SCOT  [9]  and Pamona  [10]  use optimal transport-based algorithms to estimate cell-cell similarity, assuming the existence of similar manifolds supporting datasets containing cells of the same type. We would also like to mention the existence of neural network-based tools like the ones implemented in scVI  [11] , which make use of variational autoencoder compression to directly learn dataset embeddings inside a joint latent space. If the ever-growing number of data integration methods is beneficial by bringing new ideas to the field, and despite constant efforts of many talented researchers to provide exhaustive benchmarks like in  [12, 13] , it becomes more and more difficult to choose the right data integration methodology for a given application  [1].
Furthermore, existing data integration tools are provided as rigid algorithmic pipelines, allowing little to no user agency to adapt them to specific use cases, for instance when the output type of a certain tool is not adapted to the needs of a given workflow. This urges the need for a data integration framework which would help conceiving data integration pipelines by articulating computational modules, factoring boilerplate code and common preprocessing steps, while providing a sound interface to work with existing workflows  [Fig 1b]  as well as benchmarking algorithms and datasets. To address these needs we introduce transmorph [Fig  1c] , an open-source data integration framework implemented in python providing great modularity, high integration quality and performance, robust implementation, and the ability to be extended over time with new cutting-edge algorithms.
The framework also provides annotated, high quality and ready-to-use datasets to benchmark algorithms [Fig  1c]. Finally, it is meant to be easily expansible by allowing the user to define new algorithmic modules if necessary. In this framework, data integration models can be assembled by combining four classes of algorithms: transformations, matchings, embeddings and checkings [Fig  1d]. • Transformation algorithms take as input a set of datasets and return a new representation for each of them, embedded in some feature space (there can be one separate feature space per dataset, or one common feature space). Transformations are generally used during preprocessing: classic examples are PCA, neighborhood-based data pooling or common highly variable genes selection. • Matching algorithms estimate a similarity measure between cells across datasets.
They are the core component of our integration framework, as their quality directly influences cell-cell proximity in the final embedding. transmorph uses three main categories of matching; (a) labelbased matchings which require datasets to be labeled beforehand and matches items of similar label; (b) neighbor-based matchings which match items close items with respect to some metric; (c) transport-based matchings which leverage a distance metric between items within or across datasets to compute a similarity between items relying on topological correspondence. The next sections demonstrate how important it is to choose a matching which is relevant for a given application. • Embedding algorithms are a special class of transformations which take as additional input similarity relationships between samples that were estimated via a matching.
They return an integrated view of all datasets jointly embedded in a common feature space, so that matched items tend to be close from one another in the final representation. The embedding step is in general the last step in an integration model, and is chosen depending on the required output type. For instance, a joint embedding of datasets in an abstract space is suited for applications like visualization or clustering, while matrix factorization algorithms often require the embedding to be performed in an expressive feature space. The next sections show how choosing the right embedding algorithm allows adapting an integration pipeline to a given scenario. • Checking algorithms are special quality control points that can be added to a pipeline in order to test a condition. They are used to either set a branching point that leads to different outcomes, or create an iterative structure within a model ("repeat until the integrated representation satisfies this property").
This type of strategy is notably used within the Harmony algorithm, where an iterative clustering and correction procedure is applied until an integration metric (Local Inverse Simpson's Index in this case) is considered to be satisfactory. This expressive framework allows building complex data integration models suited for many applications, with high computational efficiency and integration quality because each algorithmic module can be optimized independently. It also provides an objective comparison between algorithmic modules for a given application. Finally, it is supported by a sound software ecosystem with benchmarking databanks, pre-built models and post-analysis tools which allows one to easily setup entire data integration pipelines [Fig  1c]. Our framework is provided as an open-source python package, and the next results showcase its capabilities to solve a variety of challenging real-life problems in single-cell, while being on par with existing tools in terms of performance.
Building a high quality model to tackle joint dataset embedding The first data integration challenge consists in computing a low dimensional joint embedding of two or more datasets, so that similar cells end up close to one another independently from their source. This is typically used for visual data exploration or as a preprocessing step before carrying out a clustering algorithm, allowing clusters to only depend on cell type rather than on the original batch. A good joint dataset embedding algorithm should be able to function in a fully unsupervised fashion while being improved by additional labeling information, and should not require to choose a reference dataset as this induces an important bias. Ideally, it should also be able to tackle joint embedding of more than two datasets at the same time, with reasonable computational efficiency.
We selected three state-of-the-art algorithms able to solve this problem: Harmony  [3]  which uses a clustering-driven, iterative strategy to optimize the embedded representation. ScVI  [11] , a deep learning framework which uses variational autoencoders to compute a latent integrated representation of datasets. BBKNN  [5]  which builds a weighted joint graph of datasets together using a batch-balanced variant of k-nearest neighbors. We embedded Harmony, scVI latent representation and BBKNN result into a 2D space using UMAP  [16]  so that the output space is comparable between all methods. We also included the transmorph pre-built model EmbedMNN to the benchmark, described in [Fig  2b]. This integration model is inspired from CONOS  [7] , and combines a nearest neighbors-based joint graph construction step with a low dimensional graph construction, followed by an embedding step using UMAP or minimum distortion embedding (MDE)  [17].
EmbedMNN can work either in a fully unsupervised fashion, or can take into account label information to prune matching edges between samples of different labels; we test both variants in this application. with the unsupervised version of EmbedMNN. e. LISI-batch score of various integration algorithms (higher is better), mean is marked. f. LISI-class score of various integration algorithms (lower is better), mean is marked. g. Execution time of various integration algorithms. The benchmarking databank consists of 11 single-cell osteosarcoma datasets gathered from  [18] , containing approximately 65,000 cells in total, which have been automatically annotated using 10 different cell types. This use case is quite challenging due to dataset size, number of batches and number of classes, but illustrates a reasonable real-life use case of data integration.
ScVI was the longest to complete with around 10 minutes in total, but in all fairness the minimum loss seemed to be reached between the 2 min and 3 min mark. Computed joint representations were overall reasonable for all methods, with both convincing batch mixing and cell type clustering. Nonetheless, no method was able to provide both perfect batch mixing and meaningful cell type clustering, which is to be expected on such complex datasets (large number of cells, >10 patients, 10 cell types). Unsurprisingly, the supervised version of EmbedMNN outperformed all other methods by a large margin both in terms of local class purity and clustering class purity [Fig. 2c , 2f and Sup. Fig. 2 ], with a very low LISI-class score for all cell types and a near-100% cluster purity, as it leveraged complete label information.
Performing integration in gene space by using an appropriate embedding In some applications, providing a joint embedding of datasets into an abstract space is not suited, as original features do carry important interpretable information. This is for instance the case when performing matrix factorization algorithms such as independent component analysis of non-negative matrix factorization. In this case, it is necessary to perform the integration directly within gene space, which brings some technical difficulties. Notably, gene spaces are typically very large which is detrimental for scalability of distance-based algorithms due to the curse of dimensionality. In this scenario, EmbedMNN, Harmony, scVI or BBKNN are not adapted, as they are unable to return an output in full gene space. We would normally need to find another integration method, install it, reprocess our data and adapt the workflow.
In this example, we showcase how the modular nature of the transmorph model API can instead provide a way to easily adapt an existing model to a new application. To do this, we identify the embedding step of EmbedMNN not to be adapted to a full gene space application. To tackle this limitation, we can swap this module for something more adapted [Fig. 3b ] like a linear correction step in gene space using correction vectors which is similar to what is used within MNN  [4]  and Seurat  [8]. Given a reference dataset, the correction approach consists in first, finding some matchings between query and reference items, then compute correction vectors from these queries to their references, to finally propagate these correction vectors along the query dataset to end up with corrected profiles. This will demonstrate how simple module swapping allows reusing a model in a different scenario.
We use 14 nasopharyngal carcinoma datasets gathered from  [22]  to benchmark the strategy [Fig. 3a ]. The goal is to embed these datasets in the space defined as the intersection of their common most variable genes, so that cells sharing the same annotation end up in close proximity after integration. This is once again a challenging task as the datasets are quite large (more than 60,000 cells to embed), there are 8 different cell annotations, some datasets do not contain cells from all types, and the embedding space is large for a geometrical approach (more than 900 genes). To measure integration quality from another angle, we carry out independent component analysis (ICA) on T cells from all datasets, which allows us to observe dataset-specific gene expression signals. As we can see, before integration the dataset-specific signal appears to be strongly correlated with several independent components (ICs) computed by ICA [Sup.
Fig. 3, top]. BKNNCorrection completes in a very reasonable time of 1 minute and 33 seconds, and provides a convincing correction  [Fig 3c, 3d, 3e]. We were not able to successfully carry out Seurat integration on these datasets in a reasonable time and memory usage. According to the LISI metric we use to measure integration quality, LISI-batch is greatly increased while LISI-class is maintained if not decreased after integration using BKNNCorrection. Overall, this showcases how transmorph provides a new way to easily tweak models, allowing them to tackle different scenarios with satisfying efficiency and integration quality. We also eventually ensure most of the dataset-specific signal has disappeared after integration [Sup. Fig. 3 , bottom], resulting in a weak correlation with any of ICs recomputed by ICA on the integrated dataset.
This is a desired property for subsequent accurate interpretation of the independent components through, for example, functional enrichment analysis. Figure  3 : a. UMAP representation of the nasopharyngal carcinoma datasets (n > 60, 000) in their common genes space. b. Architecture of the BKNNCorrection integration model, computational modules are executed left to right and top to bottom. c. Integration result using BKNNCorrection. d. LISI-batch before and after integration (higher is better), mean is marked. e. LISI-class before and after integration (lower is better), mean is marked.