dataesr/scientific-paragraphs-categorization huggingface dataset:
In gene models where at least 80% of reads mapped to one strand (with >20 unambiguously mapped reads in total), we considered that strand as the correct one. In gene models where >20% mapped to opposite strands (or when fewer that 20 reads were recovered) we identified the longest open reading frame on each strand, translated this to a putative protein sequence and used BLAST to search the Drosophila and human UNIPROT databases (UP000000803 and UP000005640, respectively) for similar sequences. Strandedness was then assigned based on the best BLAST score (with a minimum threshold of 50). Using this approach we were able to assign strandedness to 40,047 out of 54,699 gene models (the strandedness of 19,334 genes was modified from the original annotation, 13,990 of which using the snRNAseq data and 5,344 of which using coding sequence similarity).
Strandedness was assigned to each fragment based on the snRNAseq reads mapping to each fragment, as described above (strand assigned if at least 80% of the reads mapped to one strand, both strands included if >20% of the reads mapped to opposite strands). The resulting set included 452,770 annotated intergenic features. Analysis of snRNAseq data. The analysis was performed using the Seurat v4. 0. 3 scRNA-seq R package, following on the associated documentation  (Hao et al. , 2021). Genes transcribed in fewer than five cells were removed from the analysis. Cells with fewer than 100 transcribed genes or more than 10% of the genes mapped to the mitochondrial genes, were also excluded from the analysis. Datasets were normalized (Seurat function LogNormalize) and variable genes were found using the vst method with a maximum of 2000 variable features.
Next, the datasets were scaled and principal component analysis (PCA) was performed. A Shared Nearest Neighbor (SNN) graph was computed with 20 dimensions (resolution 1. 0) to identify the clusters. Uniform Manifold Approximate and Projection (UMAP) was used to perform clustering and dimensionality reduction. Known markers for epidermis, neurons, sensory organs, glia, muscles and haemocytes were plotted using the Seurat function DotPlot (Figure  3C ). We identified differentially expressed (DE) genes in each cluster by comparing the expression profiles with those of the rest of the cells using Wilcoxon rank sum-based approach, with a log fold change of >0. 25 and a minimum cell percentage of 0. 1. The resulting list of DE genes for each cell type was further annotated by identifying putative gene orthologues from Drosophila melanogaster and Homo sapiens based on reciprocal best BLASTP hits.
We functionally annotated our cell clusters by GO term enrichment analysis using the TopGO v2. To integrate and compare the five snRNAseq datasets, we used the anchoring approach provided by Seurat. First, we extracted the raw counts from each Seurat object, performed data normalization (function LogNormalize) and found variable features independently for each dataset. Then, we performed the identification and integration of the anchors with 20 dimensions, followed by scaling, PCA and the construction of an SNN graph with 20 dimensions (resolution 1). A UMAP was used to perform clustering and dimensionality reduction. Closely related cell clusters were merged and labelled based on the cell-type markers shown in Figure  3C. The relative numbers of cells assigned to each cluster were extracted, calculated from the Seurat object and visualized using the function barplot of the ggplot2 v3.
3. 5 R package. We also performed the same analysis on Seurat with non-integrated data, to test the effect of the anchoring method on the clustering and the recovery of the putative cell types (we obtained similar results, shown in Figure  S10 ). To examine the impact of the gene annotation in the analysis, we performed the same analysis as described above using the entire genome, including parts of the genome that lack gene annotations (see section on Genome annotation), for read mapping. The two integrated datasets were compared using Clustree v0. 4. 3  (Zappia and Oshlack, 2018)  to visualize the overlap of clusters. The datasets were also integrated using Liger v1. 0. 0 package  (Welch et al. , 2019)  and SeuratWrappers v0. 3. 0 to explore the effect of the integration method. The datasets were first pre-processed separately (normalization, finding most variable features, and scaling the data without centering) according to the Liger tutorial.
Genes and cell clusters associated with molting. Using an existing dataset  (Sinigaglia et al. , 2021) , we identified 57 genes that are strongly upregulated in Parhyale legs 3-4 days prior to molting (DESeq2  (Love et al. , 2014) , p. adj < 0. 001). We used the Seurat function Dotplot to compare their expression between cell clusters (Figure  S11 ).
Comparing the distribution of cells across cell clusters. We tested whether the proportion of cells recovered in each cell cluster is similar in controls and regenerated legs. We used an ANOVA to test the effect of each of three factors on cell count: which condition each cell is associated with (control/regenerated), which cell cluster it belongs to, and which experiment it was sampled from (0month/2months /6months; all experiments shown in Figure  4A ). For the regression, we used a negative binomial distribution, because it captured best the dispersion of our cell count dataset. We used the Anova function from the R package car with a Fisher test and deviance as error estimate. We found there was no significant effect of the control/regeneration condition (either as a simple explanatory variable or in interaction with other variables).
However the experiment and the cell type of origin had a strong impact on cell count distribution (p-values < 0. 001 and < 2. 2 x 10-16, respectively). To further identify differences between experiments and cell clusters, we used the R function emmeans. In the 6-month dataset there were significantly more cells in one of the cell clusters associated with molting (cluster 18 in Figure  4D , cluster 12 in Figure  S8B ). In addition, there were significantly more epidermal cells in the 0-month dataset (compared to the 6-month dataset) and significantly more cells in the muscle and neuronal clusters in the 2-month dataset compared to 0-month or 6-month. However, no statistically significant difference was observed between cells from regenerated legs and controls in any cluster. When mapping reads to the entire genome, epidermal cells are more abundant after regeneration (p-value ~ 0.
Differential expression analysis. Differential expression analysis of uninjured versus regenerated legs was performed separately on non-normalized and non-integrated counts of the 2-month and 6-month datasets using the R package Seurat v4. 0. 3 function FindMarkers and the bimod method. We chose this method because it gave the most exhaustive list of differentially expressed genes compared to other methods (Wilcoxon test, t test, LR test, MAST), which gave very similar but smaller lists of DE genes. Visualization of gene abundance for the differentially expressed genes (in Figure  S12D ) was done using the Seurat function DotPlot.
Prediction of control versus regenerated condition based on transcriptome. In order to test the presence of a transcriptional signature of regeneration, we tried to predict the regeneration state (regenerated versus control) for each cell based on our snRNAseq data using the R package scPred v1. 9. 2. scPred was designed to predict cluster of origin, but we reasoned that it could be used to predict any given status of a cell. As a control, we also used the same procedure to predict the cluster of origin of each cell  (epidermis, muscle, etc. ). The 2-month and 6-month datasets were subsampled, such that the number of uninjured and regenerated cells was identical within each cluster for each experiment: we sampled 7,291 cells for each of the uninjured and regenerated 2-month experiments (a total of 14,582 cells) and 5,694 cells for each of the uninjured and regenerated 6-month experiments (a total of 11,388 cells).
Each dataset was normalized and scaled, and a PCA was computed, using the Seurat functions NormalizeData, ScaleData and RunPCA. Training of the machine learning model was done either on the 6-month or the 2-month datasets using the scPred functions getFeatureSpace and trainModel with the model svmRadial (  Figures 4E-F  and S13D-E, respectively). We tested other models (e. g. mda, knn, random forest) but they gave either similar or worse results on the training set. Testing was done on the dataset that had not been used for training, measuring the percentage of cells for which a correct prediction was made by the trained model. Baseline values corresponding to the percentage of cells that would be correctly assigned just by chance were calculated as the proportions of cells present in the dataset for each category (for instance 50% and 36% of cells in the 2-month dataset classified as 'regenerated' or 'epidermal', respectively).
In spite of these limitations, a given transcript should be detected with similar efficiency across all cell types. Therefore, droplet-based snRNAseq allows us to identify cell types/states based on the differential expression of the subset of mRNAs that are efficiently captured. We focus here on marker transcripts that could be found in our datasets. Orthology assignments are based on reciprocal best BLAST hits with Drosophila (for gene names see FlyBase, http://flybase. org/). The numbering of cell clusters below refers to the analysis (UMAP and dot plots) shown in Figure  3. Epidermal cells: Cell clusters 0, 1, 2, 11 and 19 form a large supercluster of cells (almost 40% of captured cells) expressing overlapping sets of markers. Genes whose functions are associated with the arthropod exoskeleton (chitin synthase kkv  (Ostrowski et al.
The cluster is also enriched in the expression of genes associated with signalling, adhesion, sugar transport and axon pruning in the context of neuron-glia interactions in Drosophila  (rau, uzip, Tret1-2, draper; (Awasaki et al. , 2006; Ding et al. , 2011; MacDonald et al. , 2006; Sieglitz et al. , 2013; Volkenhoff et al. , 2015) ). Dot plots of marker genes that are specifically upregulated 3-4 days prior to molting  (Sinigaglia et al. , 2021)  (left of the dash line) and selected markers for epidermis and accessory cells of sensory organs (right of dash line). For each marker we indicate the level of expression per cluster (heat map) and the fraction of cells in each cluster expressing the marker (circle size). Genes associated with molting are upregulated in cell clusters 18, 22 and 28 in the 6-month dataset.
40. 0 package (Alexa A and Rahnenfuhrer J, 2021. topGO: Enrichment Analysis for Gene Ontology. DOI: 10. 18129/B9. bioc. top-GO) and the database org. Dm. eg. db v3. 11. 4 (Carlson M, 2019. org. Mm. eg. db: Genome wide annotation for Mouse. DOI: 10. 18129/B9. bi-oc. org. Mm. eg. db) on the list of DE genes.
Most DE genes were found to be differentially expressed in just a single experiment (2-month or 6-month only) or to be differentially expressed in opposite directions in the two experiments. Only a small proportion of DE genes are coherently upregulated or down-regulated in both experiments (horizontal lines), suggesting that a larger share of differential expression is due to experimental variation than to regeneration. (D) Dot plot representation of the differentially expressed genes. The top 50 genes that are DE in the 2-month dataset, in the 6-month dataset or in both conditions are displayed (up to 150 genes per cell type). Genes are named with their best reciprocal blast hit in D. melanogaster (when available).
Acknowledgements We thank  Francesco Lamanna  for advice on snRNAseq,  Marie Sémon  for support on statistical analysis,  Chiara Sinigaglia  for sharing unpublished RNAseq data,  Franco Iamunno  and the electron microscopy facility of the  Stazione Zoologica Anton Dohrn  for support on scanning electron microscopy,  Benjamin Gillet  and  Sandrine Hughes  for support on NGS sequencing, and the  Centre Technologique des Microstructures of the Université Claude Bernard Lyon 1  for help in SEM sample preparation. We are grateful to  Evelyn Houliston  and  Michael Akam  for critical comments on the manuscript and to numerous colleagues for additional feedback. This work was supported by the  Marie Curie ITN programme EvoCell  ( H2020-MSCA-ITN-2017 #766053 ) and the  European Research Council  grant ReLIVE (ERC-2015-AdG # 694918 ), funded under the  European Union   Horizon 2020 programme , and by a doctoral fellowship from  Boehringer Ingelheim Fonds.
Finally, existing BCI toolboxes are focused on EEG and other brain signals but usually do not include processing tools for other bio signals. Therefore, in this paper, we describe BioPyC, a free, open-source and easy-to-use Python platform for offline EEG and biosignal processing and classification. Based on an intuitive and well-guided graphical interface, four main modules allow the user to follow the standard steps of the BCI process without any programming skills: (1) reading different neurophysiological signal data formats, (2) filtering and representing EEG and bio signals, (3) classifying them, and (4) visualizing and performing statistical tests on the results. We illustrate BioPyC use on four studies, namely classifying mental tasks, the cognitive workload, emotions and attention states from EEG signals.
Approach We developed and tested BioPyC, an open-source and easy-to-use software for offline EEG and physiological signal processing and classification. BioPyC is free of charge, permissively licensed AGPL ( https://choosealicense. com/licenses/agpl-3. 0/; accessed on 25 August 2021) and written in Python  [12] , an open-source programming language that is not only backed by an extensive standard library, but also by vast additional scientific computing libraries. This toolbox allows users to make offline EEG and biosignals analyses, i. e. , to apply signal processing and classification algorithms to neurophysiological signals, such as EEG, electrocardiographic (ECG) signals, EDA or respiratory signal. See https://gitlab. inria. fr/biopyc/BioPyC/; accessed on 25 August 2021. In order to facilitate those analyses, BioPyC offers a graphical user interface (GUI) based on Jupyter  [13]  that allows users to handle the toolbox without any prior knowledge in computer science or machine learning.
Finally, with BioPyC, users can apply and study algorithms for the main steps of biosignals analysis, i. e. , pre-processing, signal processing, classification, statistical analysis and data visualization, as Figure  1 summarizes. BioPyC enables users to work on two types of data sets: either raw data sets, which require the subsequent use of the pre-processing module (described below), or pre-processed data sets, which allow users to directly apply signal processing and machine learning algorithms on them. The pre-processing module of BioPyC offers basic features, i. e. , bandpass filtering, cleaning and epoching raw EEG signals. Next, for the processing step, BioPyC offers two modules that enable users to use signal processing tools, such as spatial filters and feature extraction, but also machine learning algorithms for the classification of neurophysiological signals.
Finally, another module enables users to automatically apply appropriate statistical tests on the obtained classification performances, to compare algorithms, and to obtain visualization plots describing those performances. While some of the popular existing toolboxes, such as MOABB  [11] , pyRiemann  [14]  or MNE  [15] , listed in the "state-of-the-art" section below, have features in common with BioPyC, e. g. , programming language or supported operating systems, as well as modules of the above-mentioned BCI process, e. g. , signal processing or data visualization, none of them allow users to apply and study signal and classification algorithms for both EEG and physiological signals. BioPyC is indeed the first one which allows to study and compare classification algorithms for neurophysiological signals (at the moment EEG, EDA, respiration and ECG), offering modules for all the steps of this offline (hybrid) BCI and/or physiological computing process.
Concerning the statistics, both tests and visualization for comparing classification algorithms performances are done automatically by BioPyC, again facilitating and speeding up users' analyses: to the best of our knowledge, no other toolbox offers automatic statistical testing. This paper is organized as follows: in Section 2, we present the state of the art of BCI platforms, the different features they offer, and conclude on the distinctive features that make BioPyC unique. In Section 3, we describe BioPyC modules and the data flow in more details, including the different algorithms that were implemented for the processing and classification of both EEG and biosignals, as well as the statistical tests available. Then, in Section 4, we present results of multiple research studies that were conducted using BioPyC so far, to illustrate its use and usefulness.
On the one hand, BioPyC was applied to a widely used mental task data set, i. e. , the "BCI competition IV data set 2a"  [16]. On the other hand, we used it for studying different users' mental states, e. g. , cognitive workload, emotions and attention states. Finally, the discussion and conclusion come in Section 5, followed by the future works and improvements from which BioPyC could benefit in Section 6.
State-of-the-Art BCIs Platforms So far, several platforms for online experiments (i. e. , BioSig  [17] , Timeflux  [18] , BCI2000  [19] , OpenViBE  [20] , TOBI  [21] , BCILab  [22]  or BCI++  [23] ) and also for offline studies (i. e. , MOABB, MNE, EEGLAB  [24] , PyEEG) and finally for both online and offline studies (i. e. , FieldTrip  [25] , Gumpy  [26] ) have been developed for researchers in order to build setups that would best suit their needs. They all have modules dedicated to the various BCI processing steps: data acquisition, signal processing, classification, statistical hypothesis testing and visualization  [27]. We synthesized in Figure  2  the features of each of these existing platforms, i. e. , online vs. offline studies, the availability of a graphical user interface (GUI), the existence of modules for statistical testing or data visualization, the programming language, and the supported systems as well as the type of license, in order to list the strengths and weaknesses of each one.
Supported Systems If BCI2000  [19] , OpenViBE  [20] , TOBI  [21]  and BCI++  [23]  do not support all operating systems, i. e. , Windows, Mac OS X and Linux, all other platforms, i. e. , BCILAB  [22] , pyriemann  [14] , Wyrm  [29] , gumpy  [26] , FieldTrip  [25] , pyEEG  [28] , BioSig  [17] , MNE  [15]  and MOABB  [11]  do.
Distinctive Features of BioPyC BioPyC differs from several existing BCI platforms, due to the use of Python as its programming language. This difference should be highlighted, as Python is free of chargecompared to MATLAB, which is not-and simple and extendable by non-computer scientists, whereas C++ requires deep engineering skills. However, several BCI platforms, such as MOABB, MNE, PyEEG, pyRiemann, gumpy and Wyrm, are also implemented in Python but only MOABB offers algorithms for the full offline EEG signal classification process, i. e. , pre-processing, signal processing and classification. This last feature makes MOABB closely resemble BioPyC. However, those two platforms differ in three main ways: (1) BioPyC comes with a GUI based on Jupyter notebook  [13] , which acts as a tutorial and allows users to interact with the toolbox in a guided way without requiring any programming nor programming skills, whereas MOABB and other Python-based platforms do not offer any GUI, and thus require programming by the user.
Those existing platforms are thus most likely not usable by many BCI researchers coming from diverse backgrounds, such as cognitive science, neuroscience or psychology, with possibly no programming background; (2) MOABB allows users to perform an offline analysis only after having shared their data sets in open source, whereas BioPyC users can analyze their data sets on their own. It is an important feature to point out because most BCI researchers would want to analyze their own data before sharing them in open source; and (3) BioPyC offers modules for both statistical testing and visualization for comparing classification algorithms performance, and enables convenient analysis since tests and plots are chosen and applied automatically by the software, based on the data characteristics. More generally and more importantly, BioPyC enables its users to classify physiological signals-i.
Performances Once algorithms are applied on the pre-processed data, classification performances scores-either the accuracy or the F1-score, depending on whether the classes are balanced or not-are automatically calculated for each subject and for each algorithm that is selected for the study. The accuracy score is calculated with scikit-learn "accuracy_score" method if the data set classes are balanced, or with scikit-learn "f1_score" method if they are unbalanced. Those classification performances are framed into a table using the Python library pandas  [60] , and can be directly stored into a directory that was previously indicated by the user through a Jupyter textbox, and/or used by the module "statistical analysis", in order to make statistical testing and plotting.
emotions). Our various experiments from the different analyses performed for BioPyC revealed several positive aspects of the software, i. e. , the modularity, the comparison of classification algorithms, the statistical analyses, as well as the data visualization. First, the modularity of the software is highlighted with the different data sets formats that were used for the offline analysis presented above. Data sets for workload, emotions and attention were in a Matlab format (". mat") and contained pre-processed data. The data set with the motor imagery tasks was in a GDF (". gdf") format and required a pre-processing step before performing the signal processing and classification steps. Second, the data sets with a two-class paradigm, namely motor imagery, workload, and emotions (both valence and arousal) were used for comparing the classification algorithms, which is one of the advantages of BioPyC.
Current Status and Future Work BioPyC is currently publicly available on GitHub at https://gitlab. inria. fr/biopyc/ BioPyC/; accessed on 25 August 2021. Users have to clone the repository and install all dependencies (Jupyter, voilà, numpy, pandas, pingouin, pyRiemann, scikit learn, scikit_posthocs, MNE 0. 17 and braindecode) using pip. Then, users have to find the file BioPyC. ipynb and run "voila BioPyC. ipynb" in order to display the interface in a web browser and initialize the application. All instructions will then be given by the application that is made as an intuitive tutorial. In its current stage, BioPyC offers the different modules that allow users to follow the standard steps of the BCI process, i. e. , reading different EEG data format, filtering and cleaning EEG signals, classifying EEG signals and finally visualizing and performing statistical tests on the classification performance results.