dataesr/scientific-paragraphs-categorization huggingface dataset:
Implementation ChromSCape is developed in Shiny/R employing various Shiny related packages (shinyjs, shinydashboard, shinyDirectoryInput) for the user interface. The application takes advantage of public R libraries for data vizualisation  (RcolorBrewer, colorRamps, Rtsne, colourpicker, kableExtra, knitr, viridis, ggplot2, gplots, png, grid, gridExtra, DT)  as well as for data manipulation  (tibble, dplyr, tidyr, stringr, irlba, reshape2, splitstackshape, rlist). Some available bioinformatics packages are used for manipulation of single-cell data (scater  (McCarthy et al. , 2017) , scran  (Lun ATL and JC, 2016) ), manipulation of genomic regions (IRanges and GRanges  (Lawrence et al. , 2013) ) and for clustering of cells (ConsensusClusterPlus  (Wilkerson et al. , 2010) ). Some custom functions are embedded in the application under the 'Modules' directory and serve for both manipulation and vizualisation of data sets.
Regions not supported by a minimum user-defined percentage of cells that have a coverage greater than 1,000 reads are filtered. Defaults parameters were chosen based on the analysis of multiple scChIP-seq datasets from our previous study  (Grosselin et al. , 2019) : a minimum coverage of 1,600 unique reads per cell, filtering out the cells with the top 5% coverage and keeping regions detected in at least 1 % of cells. Post quality control filtering, the matrices are normalized by dividing each cell by its total read count, and multiplying by the average total read count across all cells. At this step, the user can provide a list of genomic regions, in BED format, to exclude from the subsequent analysis, in cases of known copy number variation regions between cells for example.
In our hands, for our scChIP-seq H3K27me3 datasets, minimum coverage of 1,600 unique reads per cell was required to separate cells independently of coverage post normalization  (Grosselin et al. , 2019). We haven't observed any batch effect between our experiments in our first study most probably because we were working with a single batch of hydrogel beads. Therefore no correction is implemented in this version of the application, but we are planning to implement solutions to correct batch effect in a future version.
Correlation and Filtering Using the normalized dataset as input, hierarchical clustering is performed on the pairwise Pearson's correlation matrix. To improve the stability of our clustering approaches and to remove from the analysis isolated cells that do not belong to any subgroup, cells displaying a Pearson's pairwise correlation score below a threshold t with at least p % of cells are filtered (p is recommanded to be set at 1 % or 2 % depending on the dataset). The correlation threshold t is calculated as a user-defined percentile of Pearson's pairwise correlation scores for a randomized dataset (percentile is recomanded to be set as the 99th percentile). The correlation heatmaps before and after correlation filtering and the number of remaining cells are displayed to inform users on the filtering process.
Consensus Correlation Clustering ChromSCape uses Bioconductor ConsensusClusterPlus package  (Wilkerson et al. , 2010)  to examine the stability of the clusters and compute item consensus score for each cell. Consensus partitions of the dataset into a number of cluster ranging from 2 to 10 is done on the basis of 1,000 resampling iterations (80% of cells sampled at each iteration) of hierarchical clustering, with Pearson's dissimilarity as the distance metric and Ward's method for linkage analysis. The optimal number of clusters can be chosen in order to maximize intra-cluster correlation scores based on the graphics displayed on the 'Consensus Clustering' tab after processing. Clustering results can also be visualized in two dimensions with the t-SNE plot. This unsupervised clustering allows to discover clusters of cells based on their respective chromatin profile within a population without any prior knowledge.
Peak Calling for genomic region annotation This step of the analysis is optional, but recommended in order to obtain meaningful results with the enrichment analysis. To be able to run this module, some additional command line tools are required such as Samtools  (Li et al. , 2009) , Bedtools  (Quinlan and Hall, 2010)  and MACS2  (Liu, 2016). The user needs to input BAM files for the samples (one separate BAM file per sample), with each read being labeled with the barcode ID. ChromSCape merges all files according and split them again according to the previously determined clusters of cells (one separate BAM file per cluster). Customizable significance threshold for peak detection and merging distance for peaks (defaults to p-value=0. 05 and peak merge distance to 5,000) allows to identify peaks in close proximity (<1000bp) to a gene transcription start site (TSS); these genes will be later used as input for the enrichment analysis.
01 and 1). Using the refined annotation of peaks done in previous step, the final step is to look for enriched gene sets of the MSigDB v5 database  (Subramanian et al. , 2005)  in differentially enriched regions. We apply hypergeometric tests to identify gene sets from the MSigDB v5 database overrepresented within differentially enriched regions, correcting for multiple testing with the Benjamini-Hochberg procedure. Users can then visualize most significantly enriched or depleted gene sets corresponding to the epigenetic signatures of each cluster and download gene sets enrichment tables.
Application : ChromSCape deconvolves chromatin landscapes of the tumor micro-environment To showcase the use of ChromSCape to interrogate heterogeneity of chromatin landscapes within several samples, we analyzed together four H3K27me3 mouse scChIP-seq datasets (GSE117309), two of which had not been analyzed in our previous study  (Grosselin et al. , 2019). The raw FASTQ reads were processed using the latest version of our scChIP-seq data engineering pipeline that allowed a more precise removal of PCR and RT duplicates (code available at Github). Count matrices (available at Figshare) were formatted into a ChromSCape compliant format. The samples correspond to the mouse cells from patient-derived xenograft (PDX) originating from two different human donors. The HBCx-22 and HBCx-22-TamR datasets correspond to mouse cells from a pair of luminal ER + breast PDXs: HBCx-22, responsive to Tamoxifen and HBCx-22-TamR, resistant to Tamoxifen.
Correlation filtering (Fig. 1c-d ) was done setting the quantile threshold at 99%, i. e cells need to have a correlation score greater than 0. 44 with at least 1% of other cells to be kept for downstream analysis (Sup. Fig. 1 ). We note that this filtering step may be biased towards removing meaningful cells from samples with low cell number, as they might not have enough representative cells with each chromatin profile to pass treshold. After performing consensus clustering approach on the filtered dataset for k=2 to k=10 clusters, we chose to partition the data into k=4 clusters based on the knee method as a major leap in area under the CDF curve was observed between k=3 and k=4 clusters, and not between k=4 and k=5 (see Sup. To further identify the specific features of each chromatin-based population, we proceeded to peak calling, differential analysis and gene set enrichment analysis using default parameters (see Methods).
Gene set enrichment analysis (q-value < 0. 1) for genes located in regions depleted of H3K27me3 enrichment only revealed very few enriched gene lists, mostly for cluster C2 (Fig. 2d , multiple gene sets related to stem and cancer cells) and one list for C1 ("LPS_VS_CONTROL_MONOCYTE_UP") and (Fig. 2b ). Linking H3K27me3 enrichment to transcription is indeed indirect, we see our gene list tool more appropriate for H3K4me3 scChIP-seq or scATAC-seq datasets, where enriched regions are directly associated to gene transcription. In addition, we are working on improving this step in future versions of the application, including enhancer annotation for example. Overall, these results are consistent with our previous analysis of HBCx-95 scRNA-seq datasets where subpopulations were differentially expressing markers of fibroblasts, endothelial and macrophage cells  (Grosselin et al.
, 2019). This new analysis comprising the HBCx-22 dataset allowed us to identify the H3K27me3 signature of potential endothelial cells (cluster C4). These cells are present in each model, but might not have been previously detected in the previous scChIP-seq analysis due to low cell representation. In addition, the H3K27me3 signature of potential immune cells is restricted to cells from the TNBC model (cluster C3), suggesting that these immune cells are absent from the luminal tumor. Altogether, ChromSCape can effectively deconvolve chromatin landscapes in complex samples, such as tumors.
Conclusion ChromSCape is a standalone Shiny/R application designed for both biologists and bioinformaticians to analyze complex chromatin profiling datasets such as scChIP-seq datasets. The comprehensive application is quick to take over plus the direct visualization of cells clusters combined to configurable parameters and incremental saving of intermediary R objects eases bench-marking of parameters. With an analysis of several scChIP-seq datasets of mouse stromal cells, we show that heterogeneity of chromatin landscapes between and within cell populations can robustly be detected by implementing multiple filtering steps as well as consensus clustering approach. Overall, we predict that ChromSCape will be a useful tool to probe heterogeneity and dynamics of chromatin profiles in various biological settings, not only in cancer development but also in cell development and cellular differentiation.
The momentum of scRNA-seq datasets prompts for simple and powerful tools exploring their meaningful signatures. Here we present Single-Cell Signature Explorer (https://sites. google. com/site/fredsoftwares/ products/single-cell-signature-explorer), the first method for qualitative and high-throughput scoring of any gene set-based signature at the single cell level and its visualization using t-SNE or UMAP. By scanning datasets for single or combined signatures, it rapidly maps any multi-gene feature, exemplified here with signatures of cell lineages, biological hallmarks and metabolic pathways in large scRNAseq datasets of human PBMC, melanoma, lung cancer and adult testis.
INTRODUCTION The development of single cell RNA sequencing (scRNAseq) techniques yields an increasing number of datasets available to the scientific community. These comprise reference samples of human tissues and organs from healthy individuals as in the Human Cell Atlas repository  (1) , or published studies of samples from dysfunctional or pathological tissues. Therefore, it becomes important to assess in each single cell from such large data sets any kind of hallmark possibly defined by a gene set, and to visualize this feature across the dimensionality reduction plots such as those produced by t-distributed stochastic neighborhood embedding (t-SNE)  (2)  or Uniform Manifold Approximation and Projection (UMAP)  (3)  in a global and comprehensive viewpoint. This is conceptually similar to gene set enrichment analysis (GSEA)  (4) , which finds the functional significance of genes differentially expressed between bulk transcriptomes of two series of samples.
Single cell experiments Data for 4k and 8k PBMC obtained by 10× Genomics 3 chemistry V2 were downloaded from the 10× Genomics website (https://support. 10xgenomics. com/single-cell-gene-expression/datasets/2. 1. 0/pbmc8k, https://support. 10xgenomics. com/single-cell-geneexpression/datasets/2. 1. 0/pbmc4k). Data for 10k PBMC obtained by 10× Genomics 3 chemistry V3 were downloaded from the 10× Genomics website (https://support. 10xgenomics. com/singlecell-gene-expression/datasets/3. 0. 0/pbmc 10k protein v3). Data for 33k PBMC obtained by 10× Genomics 3 chemistry V1 were downloaded from the 10× Genomics website (https://support. 10xgenomics. com/singlecell-gene-expression/datasets/1. 1. 0/pbmc33k) Data for 19k of lung tumor and normal adjacent cells (5) obtained by 10× Genomics 3 chemistry V2 were downloaded from Array Express E-MAAB-6149 and E-MTAB-6653.
Noise reduction of datasets Single cell transcriptomic technology is powerful to explore gene expression at the single cell level, but may yield datasets in which technical noise can hinder biological variability. This technical noise from gene sampling fluctuations and cell-to-cell variations in sequencing efficiency  (8)  has motivated the development of various methods performing preprocessing of raw count normalizations  (9, 10, 11, 12, 13, 14). These either apply a single per-cell scaling factor to all gene counts, or deploy statistical models estimating the per-gene errors of UMI counts. However, a single scaling factor cannot optimally normalize both lowly and highly expressed genes, while standard statistical modeling by negative binomial regression overfit the UMI data  (15). A novel normalization procedure that addresses both issues by using regularized negative binomial regression was recently developed.
t-SNE/UMAP plots The t-SNE or UMAP plots were produced by Seurat  (16)  as follows: the raw data (FastQ files) were computed with CellRanger 3. 0 and then loaded in an R session with the Seurat 3. 0 toolkit package involving the normalization and variance stabilization package sctransform  (15). Samples were individually filtered using UMI and percentage of mitochondrial genes criteria. Samples were then merged using correction to align datasets as described in  (16). t-SNE or UMAP coordinates were then calculated using the 11 first PCA and exported in a table.
Single-Cell Signature Explorer Single-Cell Signature Explorer is a package of four successive tools dedicated to high throughput signature exploration in single-cell analysis: These four softwares were developed with usability, low memory usage and performance in mind. They require no complex command lines or computing skills, they can be used on a laptop but also scale up well on powerful workstations for fast computations. Results are obtained within minutes as a function of the number of explored gene sets (n) and size of each gene set (s): O(n*s). (i) Single-Cell Single-Cell Signature Scorer. This algorithm computes in each single cell transcriptome a score for any gene set from a database. More than 17 000 curated gene sets from MSigDB  (4, 17)  and Reactome  (18) , as well as additional user-defined gene sets can be computed by the software.
Each gene set is a list of HUGO gene symbols in a text file format labeled by the name of the gene set. The database can also be implemented by additional custom pathways composed of text files for the user-defined list of HUGO gene symbols. Scores were calculated as follows : The score of the GS x gene set in the C j cell was computed as the sum of all UMI for all the GS x genes expressed in C j , divided by the sum of all UMI expressed by C j : score of C j cell for GS x gene set = k i =1 U MI GSx i n i =1 U MI C j i × 100, where U MI G S x i are the UMI of the k genes from GS x found in the C j cell. We also implemented the possibility to subtract the contribution of a gene when it is preceded by a '-' sign in the gene list. Although single cell signature scores can be computed from raw UMI counts, their relative variance improves when computed from UMI normalized by Seurat's sctransform (see below).
The signature scores primarily represent a qualitative measure for further visualization on a t-SNE or other dimensionality reduced map, rather than a quantitative measure. In addition, as the number of genes in each signature is highly variable, a single cell score for a signature cannot be compared to that of another signature. The Single-Cell Signature Scorer was developed in Go language v1. 11. 5 (https://golang. org/). The software is multi-threaded to take full advantage of multicore processors. Single-Cell Signature Scorer can compute 13 million (1000 gene sets for 13 300 cells) scores in <4 30 on a bi-Xeon E5-2687w-v3 workstation. The Single-Cell Signature Scorer was compiled for GNU Linux and Microsoft C Windows™64 bits, and can be compiled for any platform using cross-compilation by Go.
Single-Cell Signature Merger. This algorithm merges scores from Single-Cell Signature Scorer and t-SNE coordinates produced by Seurat  (16)  to produce tables compatible with the Single-Cell Signature Viewer (see below). This software is multi-threaded and can merge in parallel a set of score tables with a t-SNE or UMAP coordinate table. Single-Cell Signature Viewer. This tool was developed to display the gene set scores computed by Single-Cell Signature Scorer on a t-SNE map. It takes as input a table score merged with t-SNE coordinates. Single-Cell Signature Viewer was written in R  (19)  with the Shiny package  (20)  to draw in real time a colored score scale of signatures selected from a drop-down list on t-SNE or UMAP maps. Since this scaling is sensitive to outliers, the viewer draws a density distribution of scores and provides a color scale cursor allowing users to prune such potential outliers.
Single-Cell Signature Combiner takes as input a table score merged with t-SNE or UMAP coordinates. Single-Cell Signature Combiner was written in R  (19)  with the Shiny package  (20)  to draw in real time on a t-SNE or UMAP plot a colored score scale of two signatures selected from the drop-down lists. As above, since this scaling is sensitive to potential outliers, the viewer draws a density distribution of scores and provides a color scale cursor allowing the user to prune such outliers. Code availability. Single-Cell Signature Explorer was developed using the high performance cross-platform Go language v1. 11. 1 (https://golang. org/) and the map viewers were developed using the cross-platform R  (19)  language with the Shiny package  (20). Files can be accessed at (https://sites. google.
Scoring of gene signature across single cells Although GSEA measures the relative enrichment of functionally defined sets of genes, it cannot characterize the gene signature from an isolated transcriptome, while the related ssGSEA  (21) , GSVA  (22)  and AutoCompare SES  (23)  achieve this by scoring the intrinsic enrichment of predefined gene sets in any single sample transcriptome. Nevertheless, both algorithms rely on statistics that are inappropriate for single cell transcriptomes mostly composed of zero values, and where the missing genes of each cell vary extensively across the entire scRNA-seq dataset. To address these issues with minimal computing time, here we introduce Single-Cell Signature Explorer, a package of four softwares dedicated to high-throughput signature exploration in single-cell transcriptome analysis.
The raw data are preprocessed with CellRanger 3. 0 and then with the Seurat 3. 0 and sctransform to normalize and stabilize variance of UMI counts across the data set. The score of the GS i gene set in the C j cell is then computed as the sum of all UMI for all the GS i genes expressed by C j , divided by the sum of all UMI expressed by C j. Using this, the scores of each single cell for thousands of gene sets (e. g. 17 000 gene sets from the Molecular Signatures Database (MSigDB) (http: //www. broad. mit. edu/gsea/msigdb/index. jsp) are computed within a few minutes, and these scores are then visualized across entire scRNA-seq datasets.
B-cell signature score and relevance As a first example, the scRNA-seq datasets of 4k and 8k PBMC from one healthy donor were downloaded (https://support. 10xgenomics. com/single-cell-gene-expression/datasets), integrated, processed and the resulting t-SNE was plotted. In parallel, each of these 12k single cells was individually scored for each of the ∼15 000 MSIgDB gene sets. As negative controls, these cells were also scored likewise for 1000 random gene sets, each composed of n randomly sampled genes without replacement (RGS1-RGS1000). The PBMC data set comprises a cluster of (n = 1731) B lymphocytes which can be defined either as cells expressing the B-cell identifying CD19 gene alone (n = 883 cells), or as (n = 1826) cells scoring for a 'B cell' signature composed of the four genes CD79A, CD79B, CD19, MS4A11.
Both cell counts and ROC curves indicated that the B-cell signature outperformed the single gene in spotting all B lymphocytes from the dataset, including the few (n = 109) plasmocytes which were mapped outside of the B-cell cluster (Figure  1 ). Single-Cell Signature Explorer may process datasets of raw or normalized UMI counts, yielding similar B-cell signature scores from these different data. Nevertheless the relative variability of B-cell signature scores was decreased within all B-cell clusters when computed from normalized UMI counts instead of raw UMI, and this decrease was even better with sctransformnormalized data than with log-normalized data (Supplementary Figure  S1 ). By contrast, no such improvement was seen for the other clusters of non-B cells, for which this signature is not relevant.
Signature score specificity and robustness To definitively validate the specificity of scores, we reasoned that PBMC formally identified as B lymphocytes by their cell surface expression of the CD19 antigen should match with cells identified by the above B-cell signature. We thus downloaded another data set comprising 10k PBMC from a healthy donor analyzed for both gene and cell surface protein expression by the Feature-Seq method  (24). This dataset was processed as above, its UMAP was plotted and the PBMC were visualized for expression of the CD19 cell surface marker and for the B-cell signature score. Both criteria appeared overlaid (Figure  2A ), supporting the specificity of signature mapping. Concurrent plots of each B-cell signature gene, taken individually, versus the cell surface CD19 expression displayed frequent CD19 + B cells lacking expres- sion of some B-cell signature genes (Figure  2B ), confirming that the signature outperformed its single genes in identifying B lymphocytes.
The robustness of the B-cell signature was then analyzed in three datasets from PBMC's of healthy donors with the V1, V2 and V3 generations of the 10× Genomics 3 chemistry platforms. The B-cell signature scores and their relative intracluster variances were then compared for the clusters of B cell, plasma cells (PC) and the non-B-cell clusters from each generation of platform. Although as expected, all the relative intra-cluster variances decreased with higher generations of platform, the B-cell signature scores consistently differentiated the B cells from the non-B-cell clusters with both platforms (Wilcoxon P < 10 -300 for V1, V2 and V3) (Figure  2C ). The same conclusion was reached for a further dataset of 64K melanoma tumor cells obtained with the MARS platform, processed as above and plotted as UMAP (7) (GSE12313, Figure  3 ).
Multipurpose applications of Single-Cell Signature Explorer Owing to the versatility of signatures from user-defined gene sets or curated databases, Single-Cell Signature Explorer allows not only to visualize relative enrichment of any gene set-based hallmark, but also to combine several of these, such as cell lineage, metabolic pathway and or biological function, as exemplified below. Of note however, the highly variable number of genes in signatures precludes comparisons of a single cell score for two different signatures. In-stead, combined signature scores allow straightforward visualization of their variation across the dataset. In the above-depicted 12k PBMC dataset (Figure  1 ), myeloid cells were identified by a myeloid-specific signature composed of 31 genes (Supplementary Table  S2  and Figure  S2a ).