dataesr/scientific-paragraphs-categorization huggingface dataset:
We again compared Scrublet to other approaches based on marker genes or total counts. As before, predicted doublets consistently expressed combinations of marker genes for distinct maturing progenitor states (Figure  6D ), while only some predicted doublets had above average total transcript counts (Figure  6E ). This dataset was also instructive in highlighting a shortcoming of our approach when one of its assumptions is violated. Namely, Scrublet can detect cell aggregate doublets only if both parent cell types are observed as singlets elsewhere in the dataset. Through manual curation, we identified a small group of transcriptomes co-expressing markers of erythroblasts and mature macrophages (Figure  6C ). Macrophages and KIT+ erythroblasts are known to physically associate in the bone marrow in erythroblastic islands  (Manwani and Bieker, 2008)  and have been observed in other scRNA-seq datasets  (Grun et al.
DISCUSSION We proposed and tested a classification scheme for cell multiplets, focusing on cell doublets, as these are expected to form the majority of multiplets in all but specialized cases. The classifier is trained using the data itself and reasonable assumptions about the structure of gene expression space. The application to simulated data and then to four empirical datasets demonstrates that the approach can accurately identify doublets formed by cells from distinct states, as assessed by formal estimates of recall and precision where possible. The cell transcriptomes that scored as doublets with the highest confidence were also those found after manual curation of the data to co-express marker genes of distinct cell states. The classification approach outper-formed manual curation and simple total counts-based approaches, although it benefitted from being combined with total counts information.
We demonstrated the practical benefits of doublet removal in removing artifactual states and in improving the signal-to-noise in the expression of cell type-specific genes. Although the method appears to perform well, its underlying assumptions do impose some limitations. First, the method assumes that multiplets are rare. This is required (1) to justify the study of doublets rather than all multiplets and (2) for the doublets simulated by the classifier to overwhelmingly reflect doublet states rather than higher-order states. Second, the method strictly requires that every cell state contributing to a doublet also be represented as a singlet state in the dataset. If a particular singlet cell state is excluded experimentally, it trivially cannot be detected as part of a multiplet state, because the missing parent state does not contribute to the simulated doublet pool used for doublet classification.
This limitation could be appreciated in the final dataset, from cells purified conditional on expression of a cell surface protein, KIT. We found that cell doublets resulting from incomplete dissociation of a KIT+ erythroid cell and a KIT-macrophage could not be detected by the classifier because no singlet macrophage state was present in the dataset. An extension of this limitation is that the method could underperform if cell clumps with a stereotyped composition occurred in a sample. Scrublet performs best for doublets resulting from random co-encapsulation because the frequency of such doublet states can be predicted by the frequency of singlet states. Doublets from incomplete dissociation can still be effectively detected provided that they are rare and that the singlet states are well represented in the data.
A third limitation of the approach is its sensitivity to the structure of the single-cell state manifold. Scrublet performs best in identifying doublets formed between distinct parent states. This limitation is quantified for any given dataset by the calculated detectable doublet fraction, ϕ D , which is expected to be high if singlet states are distributed among many discrete, well-separated states; it is only 50% if cells form two discrete and equal-sized clusters, and it can be lower than 50% for complex continuum manifolds. Countering this shortcoming is the notion that rare doublet states are only important to exclude if they form novel features on a cell state manifold, which would in turn make them detectable using the proposed approach. Therefore, the doublet detector provides a useful tool both for estimating the potential impact of doublets on downstream hypothesis generation through the magnitude of f D and for identifying bona fide doublet states for exclusion.
METHOD DETAILS The Scrublet Algorithm-A formal basis for the doublet classifier is provided in the "Scrublet Theory" section, below. Definitions-For clarity, we use the term "singlet" to refer to a transcriptome of a single cell and "doublet" to refer to a merged transcriptome of two cells. The majority of observed transcriptomes are expected to be singlets. General Approach-Starting with a raw counts matrix, X, where x i,j is the number of detected transcripts of gene j in cell i,.
4. Remove likely doublets by thresholding the doublet scores or by clustering observed cells and identifying clusters with uniformly high scores. Detailed Method-Throughout this paper and in the code provided online at github. com/ AllonKleinLab/scrublet, we implement the doublet detector as described in the following sections. However, our online code also allows for arbitrary preprocessing, enabling users to apply their preferred methods for gene filtering, normalization, dimensionality reduction, etc. , prior to running the core doublet detector code. Default Preprocessing: Starting with a background-filtered, UMI-based counts matrix for the observed cells, we perform normalization, gene filtering, and principal components analysis (PCA): 1. Normalize each cell by its total counts, setting the post-normalization total to the average total of all cells.
4. Run PCA (unweighted). Store the eigenvectors (gene loadings) for transformation of simulated doublets (below). Note that for three of the datasets ("human-mouse", "Demuxlet PBMCs", and "PBMCs at multiple concentrations"), we used a variant of steps 3 and 4 that maintains the sparse nature of the data and reduces computational costs, as this will likely be important for dealing with increasingly large single-cell datasets. Namely, in step 3 the data were standardized but not mean-centered, and for step 4 truncated singular value decomposition (SVD) was used in place of PCA. These alternative options are available in the pre-processing pipeline implemented in our online code. Doublet Simulation: Doublets are simulated by adding the unnormalized counts from randomly sampled observed transcriptomes.
4. Apply the eigenvectors from step 4 of "Preprocessing" to embed simulated doublets in the same PCA space as the observed transcriptomes. KNN Classifier: For the default preprocessing, a KNN graph is built using Euclidean distance in the combined PCA embedding of the observed and simulated cells. Scrublet further allows for constructing a KNN graph in a user-defined embedding, in place of PCA. To set the number of neighbors, Scrublet accepts a parameter k for the average number of observed transcriptome neighbors, and a parameter r for the ratio of the number of simulated doublets to observed transcriptomes. The adjusted number of graph neighbors, k adj = round(k•(1+r)), is used to construct the graph. We have found that setting k = round(0. 5 • number of cells) and r≥2 works well. For large datasets, an approximate nearest neighbor algorithm is used for graph construction, as this dramatically improves speed with little cost in accuracy  (Bernhardsson, 2013).
Testing Scrublet Splatter Simulations: We used the Splatter R package (v1. 0. 3)  (Zappia et al. , 2017)  to simulate ground truth data for testing the doublet detector. For each set of parameters, we simulated 10 replicates with 5000 cells and 2000 genes, using default parameters except where noted below. Doublets were simulated at a rate of 5% by randomly sampling (without replacement) pairs of cells and summing their counts; cells used to generate doublets were then removed from the data. The table below summarizes the conditions simulated for Figure  2. Prior to predicting doublets, PCA was run using genes with at least 3 counts in at least 3 cells. For Figures  2B  and 2C , we used all PCs with eigenvalues that were at least 20% of the maximum eigenvalue. For Figure  2D , the top 4 PCs were used for all conditions.
Human-Mouse Dataset Pre-processing and Doublet Detector Parameters. : Separate pre-filtered counts matrices for human and mouse genes were downloaded from 10X Genomics (support. 10xgenomics. com/ single-cell-gene-expression/datasets/2. 1. 0/hgmm_12k), along with species assignments for each barcode (6,164 human cells, 5,915 mouse cells, and 741 mixed human/mouse multiplets). To create a single counts matrix blind to the species of origin, each cell's UMI counts for genes with identical mouse and human names (n = 15,642 genes) were added together, and all other genes were excluded. For truncated SVD, we used the top 20% most highly variable genes with ≥3 counts in ≥5 cells (n=2,372 genes) and kept the first two PCs. Scrublet was run using k = 50, r = 10, and ρ = 0. 12 (twice the observed rate of human-mouse doublets).
Demuxlet PBMC Dataset Pre-processing and Doublet Detector Parameters. : A filtered counts matrix (14,619 cells and 35,635 genes) was downloaded from GEO (GEO: GSM2560248), and demuxlet singlet/ doublet calls were obtained from the paper's GitHub page (github. com/yelabucsf/ demuxlet_paper_code). For truncated SVD, we used the top 25% most highly variable genes with ≥2 counts in ≥3 cells (n=3,197 genes) and kept the first 25 PCs. Scrublet was run using k = 50, r = 5, and ρ = 0. 12 (the observed doublet rate). To classify cells as singlets or doublets, a threshold was set by eye using the histogram of doublet scores for simulated doublets (Figure  4D ).
PBMCs at Multiple Concentrations Pre-processing and Doublet Detector Parameters. : Filtered counts matrices were downloaded from 10X Genomics (PBMC-4k: support. 10xgenomics. com/single-cell-geneexpression/datasets/2. 1. 0/pbmc4k; PBMC-8k: support. 10xgenomics. com/single-cell-geneexpression/datasets/2. 1. 0/pbmc8k). For truncated SVD, we used the top 15% most highly variable genes with ≥3 counts in ≥3 cells (PBMC-4k, n=1,129 genes; PBMC-8k, n=1,307 genes) and kept the first 30 PCs. Scrublet was run using k = 50, r =5, and ρ = 0. 03 (PBMC-4k) or ρ = 0. 06 (PBMC-8k), based on the expected doublet rates (support. 10xgenomics. com/permalink/3vzDu3zQjY0o2AqkkkI4CC). To classify cells as singlets or doublets, a threshold was set by eye using the histogram of doublet scores for simulated doublets.
2-D Visualization. : Transcriptomes were visualized using a force-directed layout of the four-nearest-neighbor graph of observed cells, where neighbors were identified using Euclidean distance in PC space. Alternative visualizations were generated from the PCA coordinates t-SNE with perplexity=30 and angle=0. 5 and UMAP using 10 nearest neighbors. Mapping PBMC-8k to PBMC-4k. : To map the PBMC-8k data to the PBMC-4k data, we TPM-normalized both datasets, ran PCA on the PBMC-4k cells, and used the same eigenvectors to transform the PBMC-8k data. The PBMC-4k cells were clustered using spectral clustering of the four-nearest-neighbor graph with 30 clusters. We then mapped each PBMC-8k cell to its nearest PBMC-4k cell (Euclidean distance) and calculated the number of PBMC-8k cells mapping to each PBMC-4k cluster.
Identifying Marker Genes. : The PBMC-8k dataset was used as an example to show that removing doublets can improve detection of cell type-specific marker genes  (Figures S4E and S4F). Our goal was to identify highly specific marker genes at the level of major cell types, so we first used Louvain clustering  (Blondel et al. , 2008)  to make an initial set of clusters and then merged clusters manually to give one cluster per cell type (B-cells, T-cells, natural killer cells, monocytes, dendritic cells, and two doublet-specific clusters). For each cluster, we tested genes expressed in >5% of cells in the cluster. For a gene to be considered a marker, there were two requirements. First, it had to be significantly differentially expressed between cells within the cluster and cells outside the cluster, using a Wilcoxon rank-sum test (scipy.
Hematopoietic Progenitor Dataset Pre-processing and Doublet Detector Parameters. : The raw counts matrix was downloaded from GEO (GEO: GSM2388072). Restricting to cells from library batches 2, 3, and 4, we also excluded cells with fewer than 700 total counts or with >15% mitochondrial gene counts (n=4,273 cells final). For PCA, we filtered genes using the same method as the original paper  (Tusi et al. , 2018) , keeping genes with mean expression >0. 05 counts and a coefficient of variation >2 (n=7,255 genes), and kept the first 40 PCs. Scrublet was run using k = 50, r = 5, and ρ = 0. 1. To classify cells as singlets or doublets, a threshold was set by eye using the histogram of doublet scores for simulated doublets. After removing high-scoring cells (Scrublet score >0. 28, n=146 cells), we re-ran Scrublet and observed additional likely doublets that had been residing at the core of a dense doublet cluster in the original data (round 2 Scrublet score >0.
Marker Gene Co-expression Score. : The marker gene co-expression score was created by identifying highly specific marker genes for each cell type, smoothing expression of these genes over the four-nearest-neighbor graph (see "Graph-based smoothing", below), and summing the products of pairs of non-overlapping marker genes. The combined marker overlap score was calculated as described in the "Demuxlet PBMC dataset" section, above. We combined the following pairs of marker genes to identify doublets that were also detected by Scrublet (Figure  6D ): Early erythroid and early neutrophil: Car1 × Mpo Early erythroid and late neutrophil: Car1 × Ngp MPP and late neutrophil: Cd34 × Ngp And to identify macrophage-erythroblast doublets (n=37 cells) undetected by Scrublet (Figure  6C ): C1qa × Hba-a1 Graph-Based Smoothing: We used a diffusion-based method to smooth data over the KNN graph for the purposes of finding overlapping marker gene expression (Figures  4F  and 6D ).
In detail, we computed the smoothing operator S = expm(-βL), where L is the Laplacian matrix of the KNN graph, β is the strength of smoothing (β =1 throughout), and expm is the matrix exponential (scipy. linalg. expm from the SciPy Python package). If X* is the smoothed version of gene expression vector X, then X* = SX. Scalability Testing: To test how Scrublet scales with cell number as shown in Figure  S1 , we timed our implementation for different numbers of cells, using a computer with a 2. 1 GHz processor and 48 GB of memory, though this amount of memory was only necessary for the largest datasets. Timing was broken into stages: preprocessing and embedding, doublet simulation, and the nearest neighbor classifier. To generate datasets of different sizes (n=10 replicates per dataset size), we randomly sampled the desired number of cells from the Demuxlet PBMC dataset, and for each cell randomly sampled from its transcripts with replacement.
DATA AND SOFTWARE AVAILABILITY Python code and examples implementing the doublet detector are provided at github. com/ AllonKleinLab/scrublet. Scrublet has also been incorporated into SPRING (kleintools. hms. harvard. edu/tools/spring. html), an interactive tool for single-cell data exploration  (Weinreb et al. , 2018). (D) Application of Scrublet to the transcriptomic data. After calculating doublet scores (i), the histogram of scores for simulated doublets was used to determine a threshold for detection of neotypic doublets (ii). Applying this threshold to observed cell barcodes (iii) yielded doublet predictions for each transcriptome (iv). ϕ D , predicted detectable doublet rate. See also Figure  S3.
Participants Participants were recruited from the Brown University community: n = 39, 22 female, mean age = 20. 2 (SD = 3. 1, range = 18-36). Data from all 39 participants was included for both behavioral and EEG analysis. Sample size was selected based on a recent EEG study using a similar task and focusing on the P300  (Jepma et al. , 2016). All human subject procedures were approved by the Brown University Institutional Review Board and conducted in agreement with the Declaration of Helsinki.
Cannon task Participants performed a modified predictive inference task that is available on GitHub (Bruckner, 2019; copy archived at https://github. com/elifesciences-publications/AdaptiveLearning) and was programmed in Matlab (Mathworks, Natick, MA, USA), using the Psychtoolbox-2 (http://psychtoolbox. org/) package. The task was based on predictive inference tasks in which participants are asked to predict the next in a series of outcomes  (Nassar et al. , 2010; Nassar et al. , 2012; Nassar et al. , 2016) , but differed from previous such tasks the following ways: (1) the outcomes were generated from both changepoint and oddball processes to dissociate learning from surprise, (2) information necessary for performance evaluation was not available at time of outcome so that signals related to belief updating could be dissociated from valenced performance evaluation signals, (3) the task space was circular, and (4) the generative process was cast in terms of a cannon shooting cannonballs.
g. , movements toward recent outcome) rather than memory (returning to a pre-oddball location). Nonetheless, inclusion of these trials in our behavioral models does not change the primary results reported here. Unlike standard regression in which the error distribution is assumed to be normal, our model imposed a circular (Von-Mises) distribution of errors around the predicted update. Maximum posterior coefficients for each individual subject were estimated using the fmincon optimization tool in Matlab (Mathworks, Natick, MA, USA) and t-tests were performed on the regression coefficients across participants to test for significant contributions of each term to update behavior. Weak Gaussian zero-centered priors were included to regularize coefficients of interest. In the purely behavioral analysis the width of priors over coefficients on standardized predictors was set to 5.
EEG acquisition EEG was recorded from a 64-channel Synamps2 system (0. 1-100 Hz bandpass; 500 Hz sampling rate). Data were collected using CPz as a reference channel and re-referenced to the grand mean for analysis. Continuous EEG data was epoched with respect to the outcome presentation for each trial. Preprocessing was done manually in Matlab (Mathworks, Natick MA) using the EEGLAB toolbox (https://sccn. ucsd. edu/eeglab/index. php) as described previously  (Collins and Frank, 2018)  and included the following steps: (1) epoching and alignment to outcome onset, (2) epoch rejection by inspection, (3) channel removal and interpolation by inspection, (4) bandpass filtering [. 1-50 hz], (5) removal of blink and eye movement components using ICA.
EEG analysis EEG Data for individual participants were analyzed using a mass univariate approach. Specifically, the trial series EEG data for a given participant, channel, and time relative to outcome onset was regressed onto an explanatory matrix that included the following explanatory variables: (1) intercept, (2) changepoint, (3) oddball, (4) condition, (5) block. Explanatory variables 2 and three were binary variables marking trials in which a surprising event occurred (i. e. changepoint or oddball) whereas four reflected the overall task context (i. e. whether oddballs or changepoints were present in the current statistical context), and five conveyed whether the participant successfully 'blocked' the cannonball on each trial. Surprise and learning contrasts were created as the sum and difference of the changepoint and oddball coefficients, respectively.
Acknowledgements We would like to thank  Julie Helmers  and  Andrea Mueller  for their help collecting EEG and behavioral data  Rob Chambliss  for help cleaning EEG data, and  Romy Fro  ¨mer and  Rachel Ratz-Lubashevsky  for helpful discussion. This work was funded by  NIH  grants  F32MH102009  and  K99AG054732  (MRN),  NIMH   R01 MH080066-01  and  NSF  Proposal # 1460604  (MJF). RB was supported by a Promos travel grant from the  German Academic Exchange Service (DAAD). The funders had no role in study design, data collection and analysis, decision to publish or preparation of the manuscript.
Data availability All analysis code has been made available on GitHub (https://github. com/learning-memory-anddecision-lab/NassarBrucknerFrank_eLife_2019. git; copy archived at https://github. com/elifesciencespublications/NassarBrucknerFrank_eLife_2019). All behavioral and EEG data has been made available on Dryad (https://doi. org/10. 5061/dryad. 570pf8n). The following dataset was generated:.
We analysed XMM-Newton EPIC data for 53 galaxy clusters. Through 2D spectral maps, we provide the most detailed and extended view of the spatial distribution of temperature (kT), pressure (P), entropy (S) and metallicity (Z) of galaxy clusters to date with the aim of correlating the dynamical state of the system to six cool-core diagnoses from the literature. With the objective of building 2D maps and resolving structures in kT, P, S and Z, we divide the data in small regions from which spectra can be extracted. Our analysis shows that when clusters are spherically symmetric the cool-cores (CC) are preserved, the systems are relaxed with little signs of perturbation, and most of the CC criteria agree. The disturbed clusters are elongated, show clear signs of interaction in the 2D maps, and most do not have a cool-core.
1 as done in  Lopes et al. (2018) , but most of the times they are in the same X-ray observation as the main cluster and are shown together with the main cluster in some of the Figs. 1-10. Data reduction was done with SAS version 16. 1. 0 (July 2017) and calibration files updated to 2017 July. Background flares were identified and rejected by applying a 1. 8σ clipping method to the count rate histogram of the the light curves in the energy range of [1-10] keV. Point sources were detected by visual inspection, confirmed in the High Energy Catalogue 2XMMi Source, and excluded from our analysis. To take into account each detector background contribution, we obtained a background spectrum in an outer annulus of the observation in the [10-12] keV energy band. A corresponding background spectrum was also extracted from the blank sky background file by  Read & Ponman (2003)  and then rescaled to obtain a normalisation parameter that will be used in the spectral fits.
(2009) , based on Chandra data. In Table  2 , we classify A2244 as a CCrelaxed cluster, since its overall spherical shape is preserved. • Abell 2572: The core of A2572 is found to be double, consisting of two X-ray peaks of similar intensity separated by about 3 arcmim. The ICM between the two Xray peaks appears undisturbed  (Ebeling et al. 1995). In addition to that, according to these authors, A2572 and HCG94 are falling toward each other at a velocity of about 1000 km s -1 but no clear signs of dynamical interaction are discernible in the ROSAT X-ray data of A2572. Our 2D maps don't show strong signs of perturbation. The kT map has presents a small range in temperature (from 2. 8 to 3. 6 keV), and the Z map shows a central elongation of higher metallicity. • Abell 2597: This is a CC cluster, but  McNamara et al.