dataesr/scientific-paragraphs-categorization huggingface dataset:
We also benchmarked EpiScanpy  32  , a recent analysis pipeline for various single-cell epigenomic data (scATAC-seq, scDNA methylation, …) developed in Python. We applied hierarchical clustering on the reduced feature space obtained by each method and used an ARI metric to evaluate their ability to identify cell phenotypes. ChromSCape with default parameters manages to separate almost perfectly the 4 cell types, with an ARI of 0. 998 (Figure  2a ), as Cusanovich2018 and CisTopic (both an ARI of 0. 996, Figure  2b ), followed closely by EpiScanpy (ARI of 0. 940, Figure  2b ). ChromSCape, EpiScanpy and SnapATAC were all run on 50kbp bins, but SnapATAC had noisier clusters and a slightly poorer ARI (0. 822). We also compared the agility of ChromSCape to manipulate and interpret scChIP-seq datasets to two applications with graphic interface, using the same reference dataset (Figure  2c ), with either default settings or optimizing input and settings.
scOrange is a stand-alone platform allowing researchers to create workflows to analyze single-cell datasets, offering a wide variety of analytical modules. While for scRNA-seq many workflows have been developed and are ready-to-use, in the case of epigenomic datasets, users need to have prior computational knowledge to organize a proper workflow. We managed to group cells according to sample of origin only with an optimized workflow (Figure  2c , default vs optimized). SCRAT is a Shiny/R package presented as a user interface to analyze single-cell epigenomic data. The default option for SCRAT is to count reads within 'ENCODE Clusters' corresponding to co-regulatory open chromatin regions obtained from DNAse-seq datasets, not adapted for the analysis of repressive histone marks like H3K27me3.
In order to use SCRAT for our reference scChIP-seq datasets, we had to pre-compute counts on pre-defined peaks called on the 'pseudo-bulk' (see Methods and 'Optimized' panel), limiting the usability of SCRAT. In addition, in contrast to ChromSCape, both applications do not propose functionalities to associate genomic regions to gene annotation, limiting the biological interpretation of the results obtained with differential analysis. Like single-cell transcriptomics approaches, single-cell epigenomic technologies can be influenced by various batch effects, e. g. library preparation, batch of hydrogel beads or efficacy of immuno-precipitation or cleavage. To overcome this, we have implemented in ChromSCape a module for batch correction based on the fastMNN method  18. To test this functionality, we used three datasets: two from our previous study (HBCx-95 and HBCx95-CapaR, collected with batch1 beads) and a new dataset, HBCx95 -batch 2, which is a biological replicate of HBCx-95, i.
e a PDX tumor from the same PDX model but a different mouse, processed with a new batch of beads. Using ChromSCape, we analyzed together the three H3K27me3 tumor samples. As shown in Supplementary Figure  2 , a strong batch effect separates the two biological replicates before batch correction (left panel). After applying batch correction (right panel), cells from the two biological replicates of untreated HBCx-95 tumors successfully mix, but not with cells from the resistant tumor, suggesting that the module corrects for batch effect without overcorrecting biological differences. We also evaluated the usability of ChromSCape for other types of single-cell histone modification data obtained by other technologies than scChIP-seq. We analyzed two public datasets of scCUT&Tag and scChIC-seq targeting H3K27me3 and H3K4me3 marks respectively.
ChromSCape facilitates the analysis of such public dataset as the user can directly upload the GEO single-cell BED files into the application. We recommend here for H3K27me3 mark -accumulating in broad peaks -to aggregate the signal into 50kbp bins, and for H3K4me3 mark -accumulating in sharp peaks -to count within 5kbp bins or around gene TSS (+/-2500bp). As shown in Supplementary Figure  1a , for the scCUT&Tag dataset the two K562 replicates showed no batch effect and were clustered together separately from H1 cells (ARI = 0. 976). For the scChIC-seq dataset (Supplementary Figure  1b ), 7 clusters are clearly observable on the UMAP representation, as was found by the authors in their study  4.
ChromSCape classifies cells from scATAC-seq data In order to assess the capacity of ChromSCape to analyze all types of single-cell epigenomic data, we re-analysed a scATAC-seq dataset (GSE99172) containing 8 cell lines and 4 patientderived cells. This dataset was partly produced and analyzed in a study by chromVar, a dedicated scATAC-seq analytical tool  31  ; we used the same color code as in this study. This dataset contains various biological samples as well as technical replicates for two cell lines, K562 & GM12878, for which there are 6 and 4 technical replicates respectively. Due to a relatively low number of cells per sample (n=96 per sample), we set the read count threshold to 1,000 for cells to be included in the analysis. We measured the ability of ChromSCape to classify cells according to cell type of origin using assignment scores for each sample X and each cluster Y (number of cells from sample X assigned to cluster Y / total number of cells of sample X).
ChromSCape deconvolves epigenomes of the tumor micro-environment To further showcase the use of ChromSCape, we interrogated the heterogeneity of chromatin states within the tumor micro-environment of two breast tumor subtypes: luminal and triplenegative (TNBC) breast tumors. Tumor micro-environment is a key player in tumor evolution processes, and can vary between tumor types and with response to cancer therapy. Here our goal was to compare H3K27me3 landscapes of cells from the tumor micro-environment of luminal and TNBC subtypes, resistant or not to cancer treatment. The HBCx-22 and HBCx-22-TamR datasets correspond to mouse cells from a pair of luminal ER + breast PDXs 1 : HBCx-22, responsive to Tamoxifen and HBCx-22-TamR, resistant to Tamoxifen. The HBCx-95 and HBCx-95-CapaR correspond to a triple-negative breast cancer (TNBC) tumor model of acquired resistance to chemotherapy  1.
We analyzed together these four H3K27me3 mouse scChIP-seq datasets, two of which had not been analyzed in our previous study  1. Using ChromSCape, we propose a comprehensive view of cell populations based on their chromatin profiles, and show the identification of tumor-type and treatment-specific cell populations and respective chromatin features. All plots in Figure  4  were automatically generated by the application and are downloadable from the interface. In the quality filtering step, a threshold of 2,000 reads per cell was set due to a relatively high initial number of cells (n = 5,516 cells). After the dimensionality reduction step (Figure  4a  & b), we applied our consensus clustering approach on the filtered dataset with k = 2 to k = 10 clusters. We chose to partition the data into k = 4 clusters based on the knee method, as a plateau in the relative change in area under the CDF curve was observed between k = 4 and k = 5 clusters (Figure  4c-d  & Supplementary Figure  34a-b ).
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  1. 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.
Discussion ChromSCape is a 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. We show that ChromSCape performs as well or better than state of the art singlecell epigenomic analytic tools to identify cell identities from an in-silico mix of H3K27me3 scChIP-seq datasets. It also manages to identify sub-populations within a complex scATACseq benchmarking dataset, showing its wide range of application for epigenomic analysis. In addition, using ChromSCape to study the epigenome of mouse stromal cells in breast tumors, we can identify the various epigenomes within the tumor micro-environment.
Implementation ChromSCape is an R package developed in Shiny/R. It uses 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, umap, colourpicker, kableExtra, knitr, viridis, ggplot2, gplots, png, grid, gridExtra, DT) as well as for data manipulation (Matrix, dplyr, tidyr, stringr, irlba, rlist, qualV, stringdistr). ChromSCape uses Bioconductor packages (i) for the manipulation of single-cell data with SingleCellExperiment, scater  15  , scran  16  , (ii) for the manipulation of genomic regions with IRanges and GenomicRanges 17 , (iii) for the manipulation of genomic files with Rsamtools and BiocParallel, (iv) for the correction of batch effects with batchelor 18 and (v) to determine the optimal number of clusters with ConsensusClusterPlus  19.
Input datasets, quality control and pre-processing Input files for ChromSCape are either one or multiple count matrices with genomic regions in rows and cells in columns or single-cell BAM or BED files. In this case, a directory containing single-cell BAM or BED files must be specified and the count matrix created by aggregating the signal into successive genomic bins, peaks (BED file must be provided by user) or into regions around genes Transcription Start Sites (TSS). For H3K27me3 scChIP-seq datasets, with a distribution in broad peaks, we recommend using bins of 50kbp, while for H3K4me3 scChIPseq or scATAC-seq datasets we recommend using smaller bins (e. g 5kb), knowns peaks or regions around TSS. The 'condition' or 'label' of each cell is then heuristically determined using file names and the number of conditions specified by the user.
Guidelines and link towards datasets are given in the user guide (https://vallotlab. github. io/ChromSCape/ChromSCape_guide. html). In order to efficiently remove outlier cells from the analysis, e. g. cells with excessively high or low coverage, the user sets a threshold on a minimum read count per cell and the upper percentile of cells to remove. The latter could correspond to doublets, e. g. two cells in one droplet, while lowly covered cells are not informative enough or may correspond to barcodes ligated to contaminant DNA or library artifacts. Regions not supported by a minimum userdefined percentage of cells that have a coverage greater than 1,000 reads are filtered out. Defaults parameters were chosen based on the analysis of multiple scChIP-seq datasets from our previous study 1 : 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.
For instance, the user should verify whether the QC filtering steps and normalization procedure were efficient by checking the distribution of cells in PC1 and PC2 space. Cells should group independently of normalized coverage. In our hands, for our scChIPseq H3K27me3 datasets, minimum coverage of 1,600 unique reads per cell was required to separate cells independently of coverage post normalization  1. A batch correction option using mutual nearest neighbors 'FastMNN' function from 'batchelor' package  18  is implemented to remove any known batch effect in the reduced feature space.
Hierarchical clustering, filtering and consensus clustering Using the first 50 first PCs of computed PCA as input, hierarchical clustering is performed, taking 1-Pearson's correlation score as distance metric. 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 out (p is set at 1 % by default). The correlation threshold t is calculated as a user-defined percentile of Pearson's pairwise correlation scores for a randomized dataset (percentile is recommended to be set as the 99th percentile). Correlation heatmaps before and after correlation filtering and the number of remaining cells are displayed to inform users on the filtering process.
ChromSCape uses Bioconductor ConsensusClusterPlus package  19  to determine what is the appropriate k-partition of the filtered dataset into k clusters. To do so, it evaluates the stability of the clusters and computes item consensus score for each cell for each possible partition from k=2 to 10. For each k, consensus partitions of the dataset are 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 is then chosen by the user; one option is to maximize intra-cluster correlation scores based on the graphics displayed on the 'Consensus Clustering' tab after processing. Clustering memberships can be visualized in two dimensions with the t-SNE or UMAP plot.
Peak calling for genomic region annotation This step of the analysis is optional, but recommended in order to refine the peak annotation prior to enrichment analysis. To be able to run this module, some additional command line tools are required such as SAMtools  22  , BEDTools 23 and MACS2  24. 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 and splits 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 (<1,000bp) to a gene transcription start site (TSS); these genes will be later used as input for the enrichment analysis.
01 and 1). If users have specified batches, the differential analysis is done using the 'pairwiseWilcox' function from the scran package  16  , setting the batch of origin as a 'blocking level' for each cell. For the top 100 most significant differential regions, single-cell H3K27me3 enrichment levels can be visualized overlaying H3K27me3 counts for each cell at selected genes onto a t-SNE plot. 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  27   scATAC-seq datasets: The scATAC-seq dataset is composed of two cell types derived from two acute myeloid leukaemia (AML) (patients SU070 and SU353 blastocytes (blast) and leukemic stem cells (LSC) from  29  ) as well as multiple cell lines : GM12878 (4 replicates), TF1, BJ, H1, HL60, K562 (3 replicates) from  30  , K562 (3 replicates) from  31  ; monocytes (Mono) and lymphoid primed multipotent progenitor (LMPP) from  29.
The count matrix of reads in peaks was downloaded from GEO accession number GSE99172 [https://www. ncbi. nlm. nih. gov/geo/query/acc. cgi?acc=GSE99172], split into distinct matrices for each sample and formatted to be accepted as input by ChromSCape. H3K27me3 scChIP-seq mouse datasets: The samples correspond to mouse cells from patientderived xenograft (PDX) originating from two different human donors  1. Raw FASTQ reads were processed using the latest version of our scChIP-seq data engineering pipeline (see above) to produce 50kbp binned count matrices given as input to ChromSCape (matrices available at https://figshare. com/projects/Single-Cell_ChIP-seq_of_Mouse_Stromal_Cells_in_PDX_tumour_models_of_resistance/66419).
Code availability Source code, guidelines for installation and use of the application are provided at https://github. com/vallotlab/ChromSCape. A docker container containing the application and it's dependecies is available on DockerHub (pacomito/chromscape:v0. 0. 9001), instructions on how to launch it are available on the github page. Codes for the benchmark of 'SnapATAC', 'CisTopic', 'Cusanovich2018' and 'EpiScanpy' are available at https://github. com/vallotlab/ChromSCape_benchmarking. Data availability In this study, in addition of using publicly available single-cell datasets, we produced H3K27me3 scChIP-seq data for MDA-MB-468 sample and a new replicate of untreated HBCx-95. The sequencing data that support the findings of this study have been deposited in the National Center for Biotechnology Information Gene Expression Omnibus (GEO) and are accessible through the GEO Series accession number GSE152502 [https://www.
H3K4me3 scChIC-seq human white blood cells dataset 4 : n=285 white blood cells from a human male donor were downloaded as gzipped single-cell BED files from GSE105012[https://www. ncbi. nlm. nih. gov/geo/query/acc. cgi?acc=GSE105012], inputted directly into ChromSCape and aggregated into 50kbp bins (default). H3K27me3 scCUT&Tag human H1 and K562 cells 5 : A replicate of K562 cell line comprising of n=908 cells from GSE124680 [https://www. ncbi. nlm. nih. gov/geo/query/acc. cgi?acc=GSE124680], another replicate of n=479 K562 cells and n=486 H1 cells from GSE124690 [https://www. ncbi. nlm. nih. gov/geo/query/acc. cgi?acc=GSE124690] were downloaded as gzipped single-cell BED files, inputted directly into ChromSCape and aggregated around gene TSS (+/-2500bp). Datasets H3K27me3 scChIP-seq human in-silico mix of 4 cell types: The samples correspond to n=326 human tumor cells from untreated PDX (HBCx-22), n=201 human T cells (Jurkat) and n=306 B cells (Ramos) taken from 1 and n=454 cells from the MDA-MB-468 triple-negative breast cancer cell line (HBCx-22, Jurkat and Ramos data are from GSE117309 within differentially enriched regions (either enriched or depleted regions in the studied histone mark).
We apply hypergeometric tests to identify gene sets from the MSigDB v5 database over-represented 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. [https://www. ncbi. nlm. nih. gov/geo/query/acc. cgi?acc=GSE117309]), MDA-MB-468 is available at GSE152502 [https://www. ncbi. nlm. nih. gov/geo/query/acc. cgi?acc=GSE152502]). H3K27me3 scChIP-seq human datasets: The samples correspond to human cells from patientderived xenograft (PDX) originating from two different human donors 1. For this study, we added a new scChIP-seq dataset, corresponding to a biological replicate of HBCx-95 (GSE152502 [https://www.
TbCAPs: implementation We implemented the CAPs processing pipeline as a toolbox in Matlab version 2017a (The MathWorks, Natick, USA). This software is freely accessible at https://c4science. ch/source/CAP_Toolbox. git. It contains a graphical user interface to facilitate the different steps of the pipeline. In addition, we also provide a scripted version of a typical analysis pipeline for power-users. An illustrative display of the graphical user interface at the end of a typical analysis is provided in Figure  2. Next, we describe the steps to be performed by the user, and the available options at each stage of the analysis.
Data preparation The toolbox requires four different input files, to be selected at once when clicking on the A. Load data button: first, the preprocessed fMRI data should be provided as a Matlab structure of size 1 × S. Each cell should contain a matrix of size T × V. Second, framewise displacement over time for all subjects should be provided as a matrix of size T × S. Third, a NIFTI file header containing the dimensionality information about the data at hand should be included. Fourth,  a mask of size V all (all the acquired voxels) should be passed as a logical vector, setting to 1 the V voxels to include for CAP analysis.
3 mm, and excised volumes were estimated with cubic spline interpolation. Although scrubbing is performed within TbCAPs, we reasoned that if we wished to try and assign scrubbed frames to CAPs in our additional analyses regarding head motion, it would make more sense to have previously corrected these volumes to the best of our abilities. Then, individual fMRI volumes were smoothed at a full-width at half maximum value of 5 mm, and in order to make the analyses computationally more affordable, spatial resolution was downsampled at 3 mm × 3 mm × 3 mm. Finally, each voxel-wise time course was z-scored to obtain the resting-state functional imaging input data to our pipeline.
The output composite score positively correlated with true positives, true negatives, sensitivity and specificity (ρ =0. 24, 1. 00, 0. 25 and 1. 00, respectively), thus summarising overall task performance. We z-scored this output measure across subjects, in order to quantify performance with respect to the overall population. We then extracted the behavioural data related to the 181 subjects considered in this work. To study sustained attention, we focussed on a right dorsolateral cortex seed from the task-positive network, which we extracted from the associated independent component map provided by  [31]. Our hypothesis was that the expression of different TPN configurations would relate to sustained attention performance.
Acknowledgments Constantin Tuleasca gratefully acknowledges receipt of a ' Young Researcher in Clinical Research Grant' (Jeune Chercheur en Recherche Clinique)  from the  University of Lausanne (UNIL) ,  Faculty of Biology and Medicine (FBM) , and the  Lausanne University Hospital (CHUV). In addition, the authors would like to thank  Raphaël Liégeois  for his rereading of the manuscript.
Target selection KLASS targets were selected from the Grism Lens-Amplified Survey from Space 1 (GLASS,  Schmidt et al. 2014; Treu et al. 2015). GLASS was a large Hubble Space Telescope (HST) program which obtained grism spectroscopy of the fields of ten massive galaxy clusters. GLASS used the Wide Field Camera 3 (WFC3) G102 and G141 grisms to obtain spectra over the wavelength range 0. 8-1. 6 µm, with spectral resolution R ∼ 150. The GLASS data are publicly available, including HST grism spectra for all the galaxies presented in this paper 2. KLASS z ∼ 1-3 targets were selected from the GLASS sample based on having at least one bright nebular emission line (Hα,  [OIII]  or  [OII] ) falling within the KMOS YJ range (1-1. 35 µm), and away from bright OH sky lines.
OBSERVATIONS AND DATA REDUCTION A full description of the KLASS observations and data reduction procedures are given by  Mason et al. (2019) , we provide a brief overview here. KLASS uses the KMOS YJ band (1 -1. 35 µm), with spectral resolution R ∼ 3400. Each 24 integral field unit (IFU) of KMOS has 14×14 spaxels of 0. 2 × 0. 2. Observations were carried out in service mode during Periods 96-99 (October 2015 -October 2017). Observations were executed in one hour observing blocks, where each block consisted of 1800s of science integration and 900s on sky, using alternating ABA science-sky-science integrating units. The final exposure time was ∼ 10 h per target. Science frames were dithered by one pixel (0. 2 ) between frames. One star was observed in every field to monitor the point spread function (PSF) and the accuracy of dither offsets (except A2744, due to a broken IFU, a bright galaxy target was used to monitor dither offsets in this case).