dataesr/scientific-paragraphs-categorization huggingface dataset:
For content analysis, we used a data subset including only the tweets identified as not being text reuse. We performed a pre-processing phase by removing stop-words, in order to calculate word frequency only for the meaningful terms. For network analysis, we excluded retweets because we wanted to consider direct mentions and replies. Finally, given the very low number of tweets generated by the members of group NR and by the Organizers, we decided to focus our analysis on the registered groups only (i. e. , A, B, OtherReg). To calculate the importance of authors in the network, we used the degree centrality measure based on the number of incoming links held by each node, i. e. , the number of mentions received by an author. Data and commented code are available in a public online repository (ref.
Appendix: text reuse detection details In this work it was necessary, starting from the dataset built in the way described in Section 4. 1, to identify the so-called text reuses, so as to identify the tweets containing parts of the text taken directly from the book The Late Mattia Pascal or paraphrasing it. This operation was used to automatically identify, for later analysis, tweets that presented original content, comments, or free reinterpretations written by the participants. To do this, each tweet was compared with the full text of the novel, following specific text pre-processing operations and using two text reuse algorithms that have shown good performance in the literature.
BLAST (Basic Local Alignment Search Tool) is a pretty old yet efficient algorithm used to compare biomedical sequences, such as DNA and protein sequences  (Altschul et al. ,  L i b r a r y H i T e c h 1990). The algorithm is designed to be capable of aligning query sequences against massive databases, such as different genomes, while still retaining a relatively small processing time. BLAST has been recently used in the field of text reuse detection, to identify reuses in Finnish newspapers  (Vesanto et al. , 2017)  and Chinese literary texts  (Vierthaler and Gelein, 2019). We followed  Vesanto et al. (2017)  and used the protein version of the NCBI BLAST software, BLASTP  (McGinnis and Madden, 2004). The data are encoded into protein-like sequences, which BLAST can read and use to find pairs where parts of genetic material (text, in our case) overlap.
Results The use of passim and BLAST on the dataset produced the following results: out of 14,072 tweets, passim identified only 550 text reuses (4%), BLAST 7,267 (51. 6%). Through a manual sample analysis (n= 100), we found that a good number of tweets in which parts of the novel have been used were not identified as textual reuse by neither of the two algorithms. This is probably due to the fact that we are dealing with tweets that are very short texts, for which the algorithms in question should be suitably modified and contains many misspelled words. BLAST performed better with 20% of false negatives in the manually checked sample. The use of such text reuse detection algorithms has allowed us to automatically remove a large number of text reuses from the dataset and focus our manual analysis on a much more limited subset of tweets.
Imaging datasets in cancer research are growing exponentially in both quantity and information density. These massive datasets may enable derivation of insights for cancer research and clinical care, but only if researchers are equipped with the tools to leverage advanced computational analysis approaches such as machine learning and artificial intelligence. In this work, we highlight three themes to guide development of such computational tools: scalability, standardization, and ease of use. We then apply these principles to develop PathML, a generalpurpose research toolkit for computational pathology. We describe the design of the PathML framework and demonstrate applications in diverse use-cases. PathML is publicly available at www. pathml. com.
Big Data, image analysis, and machine learning in cancer research Imaging has long been a cornerstone of cancer research and clinical care, providing insight into tissue morphology and spatial intercellular dynamics. Technological advances in recent years have enabled microscopy at a larger scale than ever before, leading to exponential growth in the size of commonly available datasetsa trend that is likely to continue to accelerate in coming years. "Big Data" in biomedical imaging can be conceptualized along two orthogonal axes: sample size and data dimensionality (Figure  1 ). The first axis (n) can be measured by simply counting the number of cases in a dataset. Scaling in this dimension has been chiefly driven by advances in high-throughput imaging technologies. A notable example can be seen in the field of pathology, where increasing adoption of digital workflows results in slide scanning being routinely incorporated into pathologists' workflows, consequently creating large databases of whole slide images (WSIs).
Early adopters of digital pathology workflows are scanning more than 1 million slides per year  [1]  several orders of magnitude larger than current benchmark datasets such as TCGA, and an indication of the potential volume of data that large academic tertiary care hospitals can expect to routinely generate as workflows are increasingly digitized. At the same time, data are also growing in the amount of information captured in each image, which we refer to as data dimensionality (d). This is chiefly driven by emerging technologies in spatial omics (i. e. , spatial quantification of molecular markers such as proteins or RNA) and highly multiplexed imaging (reviewed in  [2] ). In contrast to brightfield images with three channels (red, green, and blue), each of these high-dimensional images may have upwards of 10,000 channels, each representing a specific target.
Volumetric imaging further increases information content in each specimen by adding a depth dimension, enabling the capture of 3dimensional tissue morphology. Thus, dataset sizes can grow even while the number of cases remains constant. This rapid proliferation of imaging data has significant implications for cancer research, especially in conjunction with accompanying metadata such as genomics and outcomes. Large sample sizes provide sufficient power for discovery and quantification of histological patterns associated with clinically and biologically relevant features, with recent work demonstrating the potential of these methods to improve clinical and diagnostic workflows  [3] [4] [5]  and discover image-based biomarkers that recapitulate molecular features  [6, 7]. Similarly, the rich contextual information captured in high-dimensional imaging data lays the groundwork for interrogation of tumor microenvironment at unprecedented resolution  [8, 9].
The ubiquity of brightfield microscopy makes it an especially attractive candidate for image-based biomarker development, as digital workflows are increasingly deployed in a wider variety of clinical contexts. However, while increasing scale of imaging datasets presents new opportunities and avenues of investigation, it also presents major challenges. Namely, these advances are only possible by leveraging computational image analysis methods, particularly deep learning. Deep learning models are flexible and powerful and have demonstrated remarkable success at identifying patterns in large datasets. As cancer research enters the age of "Big Data," machine learning and is therefore poised to become an increasingly essential tool in the researcher's toolkit, necessary for making use of massive datasets to study impactful questions in cancer biology and clinical care.
Scalability As datasets grow, analysis tools must be carefully designed to meet the technical challenges presented by scaling up in both n and d. Algorithms should be parallelized wherever possible, reducing computation time by running tasks concurrently. To enable efficient computation at the massive scale of tomorrow's datasets, tools should embrace distributed processing and provide easy integration with commonly used open source big data solutions for on-premise, cloud, and hybrid infrastructures (e. g. , Kubernetes, Hadoop YARN, Slurm, etc. ). Support for hardware accelerators such as Graphics Processing Units (GPUs) and Tensor Processing Units (TPUs) is a requirement for computationally intensive tasks such as training machine learning models. Finally, tools should enable users to work with data that are larger than available memoryan important feature for accommodating larger data and supporting exploratory research on consumer-grade computers.
PathML: a toolkit for computational pathology We applied these guiding principles to development of PathML, an open-source toolkit designed for digital pathology research. There are several existing tools that serve various needs in computational pathology. Some tools provide implementations of specific workflows or workflow components but are not designed as fully customizable, general-purpose libraries  [13] [14] [15] [16] [17]. HistomicsTK  [18]  offers a Python API for running aspects of analysis workflows, but is built around a specific data management platform (Girder) rather than being platform-agnostic. QuPath  [19]  is an open-source tool for viewing and analyzing WSIs which has a scripting language for programmatic analysis but does not natively support Python. SquidPy  [20]  is primarily focused on spatial omics rather than general-purpose image analysis.
To fill this unmet need, we developed PathML as a general-purpose toolkit for computational pathology, designed to be both highly performant and easy to use for researchers without requiring extensive training in programming or data science. PathML provides a general framework for creating and running preprocessing pipelines, unifying analysis of varying file formats (e. g. , TIFF, DICOM, proprietary file formats from vendors, etc. ), imaging modalities (e. g. , H&E, IHC, Vectra Opal, CODEX, etc. ), and dataset scales (from individual images to millions of images) under a single object-oriented API, with data structures and design choices specifically tailored to digital pathology (Figure  2 ). The PathML library is written in Python 3 to promote ease of use and integration with the broader ecosystem of standard tools for data science and machine learning; however, we leverage libraries such as NumPy  [21]  and PyTorch which are written in low-level languages such as C, C++, and CUDA to handle computationally intensive operations more efficiently.
An extensive suite of unit testing and integration testing helps ensure that all code in PathML is free of bugs and is working as expected. By developing PathML as an open source tool, we hope to build a community of users and collaborators to collectively accelerate the pace of innovation in digital pathology research. The first step in a PathML workflow is loading the raw image file to create a SlideData object, which is the central data class representing an image and associated metadata. To accommodate the wide array of file formats commonly used in digital pathology, we provide three separate backends for reading image files, each supporting a complementary set of file formats (Supplementary Table  1 ). Each backend adheres to a standardized API, enabling users to manipulate images with a consistent interface regardless of file format or imaging modality (Supplementary Vignette 1).
, tiles) are extracted and passed to the preprocessing pipeline independently. Smaller images are processed in this framework as a single tile containing the entire image. All processed tiles are then aggregated together into an on-disk array optimized for storing and manipulating large imaging datasets. This design allows for efficient preprocessing of large datasets of gigapixel images, as the data parallelism approach can efficiently scale up to make use of additional computational resources (e. g. , cores in a multi-core computing unit, computing nodes in a cluster, etc. ). We use the dask. distributed  [22]  scheduler on the backend, which allows for distributed preprocessing on many common high-performance computing platforms, including support for both on-premise and cloud computing environments.
As tiles are processed, they are aggregated together and written to disk. We define a file specification (h5path) which leverages the Hierarchical Data Format (HDF5) to enable efficient read/write access to regions of the processed image without loading the entire image into memory. Along with the processed images and masks, each h5path file contains associated slidelevel and tile-level metadata. Each SlideData object is backed by a corresponding h5path file on disk, allowing for intuitive object-oriented workflows scalable to larger-than-memory images. After a preprocessing pipeline has been run, we provide utilities to load the processed images into machine learning frameworks for downstream tasks (e. g. , PyTorch DataLoaders). Preprocessing pipelines may themselves include transformations which encapsulate machine learning algorithms, for example using a model to perform nucleus detection and/or classification on each tile.
PathML further provides PyTorch implementations of commonly used models such as U-Net  [24]  and HoVer-Net  [25]. Finally, we provide streamlined access to domain-specific datasets including PanNuke  [26] , PESO  [27] , and DeepFocus  [28]  for use in model training and benchmarking for various tasks. With support from open-source contributors, we hope that the inventory of available datasets and machine learning models will continue to expand. In sum, PathML provides comprehensive support for each step in the computational pathology research workflow. We define a framework for preprocessing images and metadata which is streamlined and flexible for a wide variety of file formats and imaging modalities, implemented in an efficient, open source, fully tested and thoroughly documented Python package.
Conclusion With biomedical imaging datasets growing exponentially in both number of samples and dimensionality (i. e. , data within each sample), machine learning is emerging as an increasingly essential tool for cancer researchers. To support these efforts, software tools must be designed with emphasis on scalability, standardization, and ease of use. Here we introduce PathML, a framework built with these best practices in mind that aims at lowering the barrier of entry to digital pathology, and show how a number of heterogeneous computational pathology use cases can be readily implemented in very few lines of code. With comprehensive support for all aspects of computational pathology research, from loading a wide variety of imaging modalities and file formats, to building modular and completely customizable pre-processing pipelines, to parallel-computing provisions, and integrations with other tools in the machine learning, AI, and single-cell analysis ecosystems, PathML can be employed to tackle a variety of biologically relevant problems.
Acknowledgements The authors would like to thank  Jason Johnson ,  Jerri Zhang , the  Artificial Intelligence Operations and Data Science Services group , and many collaborators in the  Department of Informatics & Analytics at Dana-Farber Cancer Institute  and in the  Department of Pathology and Laboratory Medicine at Weill Cornell Medicine  for their continuous support and critical feedback that improved this work. We thank  Angeles Duran ,  Jorge Moscat , and  Maria T. Diaz-Meco  for providing the images used in Supplementary Figure 1, panels f and g. ML's work is supported by  NCI   P50CA211024 ,  DoD PC160357 ,  DoD PC180582 , and the  Prostate Cancer Foundation.
To assess the landscape of infinite sites violations, we start with a simulation approach using the PCAWG dataset of 2,658 whole-genome sequenced cancers. We resample a tumour's observed mutations, preserving mutational signature exposures (96 mutation types, trinucleotide contexts)  10, 11  but otherwise assuming uniform activity of mutational processes across the callable regions of a diploid genome (uniform permutation model; Table  S1 , Methods). Given that mutation rates are most certainly not uniform and that any deviation from uniformity will only increase the number of violations  5  , this derives a lower bound. Even at this lower bound, these simulations indicate at least one violation in 147 tumours (5. 5%, Figure  2a ). Overall, biallelic parallel mutations represent the most common class of infinite sites model violation, with different tumour types showing different contributions from the other classes.
SNVs and indels are called using Mutect2 (GATK v4. 0. 8. 1) on the base quality score-recalibrated PCAWG bam files and filtered following best practices  21. The Genome Aggregation Database (gnomAD) was provided as a germline resource for population allele frequencies and an additional panel of normals was also derived from all matched normal cases. To prevent filtering of biallelic variants, FilterMutectCalls is run with the --max-alt-allele-count flag set to 2. Additional filtering against potentially missed germline SNPs was done by requiring a posterior probability for the alternative allele to be germline (P_GERMLINE) < -1 for both of the alternate alleles and requiring a minimal depth of 19 high quality reads (mapping quality ≥ 35 and base quality ≥ 20) in the matched normal sample.
The distance d between the midpoints of the two adjacent C5-C6 bonds as well as their torsion angle is indicated. (d) Scatter plot showing the distances and angles indicated in (c) as observed in crystal structures from the RCSB protein data bank. (e) Sequence logos of motifs enriched at loci with biallelic mutations in colorectal adenocarcinoma (SBS10, 28) and oesophageal/stomach adenocarcinoma (SBS17).
Acknowledgements This work was supported by the  Francis Crick Institute , which receives its core funding from  Cancer Research UK  ( FC001202 ), the  UK Medical Research Council  ( FC001202 ), and the  Wellcome Trust  ( FC001202 ). This project was enabled through access to the  MRC eMedLab Medical Bioinformatics infrastructure , supported by the  Medical Research Council  (grant number  MR/L016311/1 ). JD is a postdoctoral fellow of the European Union's  Horizon 2020 research programme  ( Marie Skłodowska-Curie Grant  Agreement No. 703594-DECODE ) and the  Research Foundation-Flanders  ( FWO 12J6916N ). PVL is a Winton Group Leader in recognition of the  Winton Charitable Foundation 's support towards the establishment of  The Francis Crick Institute. This research was funded in part by the  Wellcome Trust  ( FC001202 ).
In addition, we use stability selection to increase the robustness of our approach. Finally, gap safe screening rules speed up computations enough that our method can run at a genome-wide scale. To our knowledge, this is the first framework for GWAS on diverse populations combining feature selection at the LD-groups level, a multitask approach to address population structure, stability selection, and safe screening rules. We show that our approach outperforms state-of-the-art methods on both a simulated and a real-world cancer datasets.
Related work 2,1 -norm regularization Our approach is closely related to the group Lasso 5 and multitask Lasso,  6  which both make use of an 2,1 -norm regularization. More precisely, the group Lasso corresponds to a special case of Equation (  1 ), with a single task (T = 1), resulting in sparsity at the group levels. Using a group Lasso where the groups are defined based on LD blocks has been successfully applied to GWAS on up to 20 000 SNPs. 3  The multitask Lasso corresponds to a special case of Equation (  1 ), with each group containing exactly one SNP. This formulation ties sparsity patterns across tasks and has been applied before to multi-population GWAS, although only a few thousand SNPs. 7  The multitask group Lasso we propose can also be reformulated as an 2,1 -norm regularization problem, through the creation of a new dataset ( X, y) where X ∈ R n×pT is a block-diagonal matrix such that each of the T diagonal blocks corresponds to the SNP matrix X (t) ∈ R nt×p for task t, and y is a n-dimensional vector obtained by stacking the phenotype vectors for each task.
Gap safe screening rules To speed up the computation of the solution of Equation (  2 ), we call upon gap safe screening rules,  9  which are used to efficiently identify features for which the regression coefficients will be zero and hence ignore them when solving the problem. Such screening rules have been proposed for a large number of popular regularized regressions, 9 including 2,1 -norm regularizations. In particular, Equation (2) can be solved using the Gap Safe Rule package a. We briefly summarize the idea underlying gap safe screening rules in Appendix B. 3.
Stability selection Unfortunately, in GWAS, penalized regression approaches often lack stability, that is to say, robustness to slight variations in the input dataset. 22  However, stability increases both the reliability of the results and the interpretability. To address this limitation, stability selection 8,22 consists of performing feature selection repeatedly on subsamples of the data and only retains the features most often selected. More specifically, given a subsample I ⊂ {1,. , n} of size n/2 of the data, we call S λ (I) the set of features selected by the selection procedure of interest (for example, a Lasso), with hyperparameter λ, on this subsample of the data. For any feature j ∈ {1,. , p}, we call Π λ j the probability that feature j is selected on a random subsample of size n/2 of the data.
This probability is determined, given m such random subsamples I 1 , I 2 ,. , I m , as the proportion of those subsamples for which the feature selection procedure selects feature j: Π λ j = 1 m m k=1 1 j∈S λ (Ik). Finally, given a a threshold 1 2 < π cutoff ≤ 1 (in this work, we used π cutoff = 0. 75), the stable set of selected features is determined as S stable = {j : max λ∈Λ Π λ j ≥ π cutoff }. a https://github. com/EugeneNdiaye/Gap_Safe_Rules.
Preprocessing Quality control and imputation We removed SNPs with a minor allele frequency lower than 5%, a p-value for Hardy-Weinberg Equilibrium in controls lower than 10%, or a missing genotyping rate larger than 10%. We removed duplicate SNPs and excluded samples with more than 10% of SNPs missing. We imputed missing genotypes in DRIVE using IMPUTE2. 24  LD pruning We performed LD pruning using PLINK  26  with a LD cutoff of r 2 > 0. 85 and a window size of 50Mb, both to reduce the number of SNPs and to better capture population structure using PCA. 25  1 000 000 SNPs remain in the simulated data and 313 237 in DRIVE. PCA and population structure We used PLINK  26  to compute principal components of the genotypes. We thus identify two populations in the simulated data, matching the CEU and YRI populations (see Supplementary Figure  C1a ).
MuGLasso provides the most stable selection Figures 1b (simulated data) and 2b (DRIVE) show the stability index of MuGLasso as a function of the number of subsamples. Increasing the number of subsamples increases the stability of the selection. We use 100 bootstrap samples in all subsequent experiments as it appears to be an acceptable trade-off between runtime and stability. On the ROC plot, the black dot indicates the performance of the stratified GWAS at the Bonferonnicorrected significance threshold. Tables  2  and 3  show the stability index of the different methods, on simulated data and DRIVE, respectively. We ran the adjusted GWAS once on the entire data set, as would usually be done, and therefore cannot report its stability. Our results again illustrate that stability selection does increase the stability of Lasso methods.