dataesr/scientific-paragraphs-categorization huggingface dataset:
Results This section illustrates the usage of BrainSpace for gradient mapping and null model generation. Examples and evaluations are based on 217 subjects from the Human Connectome Project (HCP) dataset  38  , as in prior work  20. Matlab code is presented in the main version of the paper. Corresponding Python codes are available in the Supplementary Information. Generating gradients. To illustrate the basic functionality of the toolbox, we computed gradients derived from resting-state functional MRI functional connectivity (FC). In short, the input matrix was made sparse (to 10% sparsity) and a cosine similarity matrix was computed. Next, three different manifold algorithms (i. e. , principal component analysis (PCA), Laplacian eigenmaps (LE), diffusion mapping (DM)) were applied, followed by plotting their first and second gradients on the cortical surface (Figure  2 ).
Resulting gradients (Fig. 3 ) derived from all dimensionality reduction techniques resemble those published previously  11  , although for PCA the somatomotor to visual gradient explains more variance than the default mode to sensory gradient. Aligning gradients. Gradient alignment across modalities. Based on subjects present in both the FC dataset as well as those used in the validation group of ref. 22  (n = 70), we examined the correspondence between gradients computed from different modalities and evaluated increases in correspondence through gradient Fig. 1  A typical gradient identification workflow. Starting from an input matrix (here, functional connectivity), we use a kernel function to build the affinity matrix (here capturing the connectivity of each seed region). This matrix is decomposed, often via linear rotations or non-linear manifold learning techniques into a set of principal eigenvectors describing axes of largest variance.
Joint embedding, on the other hand, identifies a joint solution that maximizes their similarity, resulting in a gradient that may be more of a 'hybrid' of the input manifolds. Joint embedding is, thus, a technique to identify correspondence and to map from one space to another, and conceptually related to widely used multivariate associative techniques such as canonical correlation analysis or partial least squares which seek to maximize the linear associations between two multidimensional datasets  39. Note that the computational cost of joint embedding is substantially higher, so Procrustes analysis may be the preferred option when computational resources are a limiting factor. Gradient alignment across individuals. Researchers may also be interested in comparing gradient values between individuals  31  , for example to assess perturbations in FC gradients as a measure of brain network hierarchy.
One possible approach could be to first build a group-level gradient template, to which both diagnostic groups are aligned using Procrustes rotation. After that, the two groups can be compared statistically and at each vertex, for example using tools suitable for surface-based linear modeling  40. In the example below, we computed a template gradient from an out-of-sample dataset of 134 subjects from the HCP dataset (the validation cohort used by  20  ). Next, we used the Procrustes analysis to align individual's gradients of each subject to the group level template (Fig. 6 , Fig. 7 ). Gradients across different spatial scales. The gradients presented so far were all derived at a vertex-wise level, which requires considerable computational resources. To minimize time and space requirements and to make results comparable to parcellation-based studies, some users may be interested in deriving gradients from parcellated data.
3  Gradient construction with different dimensionality reduction techniques. Gradient 1 (G1) and 2 (G2) of FC were computed using a cosine similarity affinity computation, followed by either PCA, LE, or DM. Gradients were z-scored before plotting. resulting in more marked alterations in the overall shape of the gradients. For further evaluation, we related the above gradients across multiple scales relative to Mesulam's classic scheme of cortical laminar differentiation and hierarchy  22, 43. It shows a clear correspondence between the first gradient and the Mesulam hierarchy for high resolution data of 300 nodes and more, regardless of the parcellation scheme. While high correspondence was still seen for functional parcellations at lower granularity, it was markedly reduced when using structural parcellations.
For researchers interested in using Mesulam's parcellation, it has been provided on Conte69 surfaces in the shared folder of the BrainSpace toolbox. We also provide the data required to reproduce the evaluated FC and MPC gradients across these different spatial scales. Such gradients can be used to stratify other imaging measures, including functional activation and connectivity patters  28, 31, 44  , meta-analytical syntheses  11, 29  , cortical thickness measures or Amyloid-beta PET uptake data  45. Null models. Here, we present an example to assess the significance of correlations between FC gradients and data from other modalities (cortical thickness and T1w/T2w image intensity in this example). We present code (see Fig. 9 ) to generate previously proposed spin tests  46  , which preserve the autocorrelation of the permuted features by rotating the feature data on the sphere.
In our example (Fig. 10 ), the correlations between FC gradients and T1w/T2w stay significant (two-tailed, p < 0. 001) even when comparing the correlation to 1000 null models whereas correlations between FC gradients and cortical thickness was non-significant (two-tailed, p = 0. 12). Test-retest stability. The HCP dataset has four rs-fMRI scans, split over two days. As such, we can leverage this data to assess test-retest stability of gradients. Here, we assessed the test-retest stability of gradients at the group level. Specifically, we redid the analysis of Fig. 2 , but split the dataset by day of scanning. Stability was very high for LE and DM (r > 0. 99) and moderate-to-high for PCA (r ≈ 0. 72) (Supplementary Fig. 1 ).
Discussion While tools for unsupervised manifold identification and their alignment are extensively used in data science across multiple research domains  47  , and while few prior connectome level studies made their workflow openly accessible (see refs. 11, 15, 48 ), we currently lack a unified software package that incorporates the major steps of gradient construction and evaluation for neuroimaging and connectome datasets. We filled this gap with Brain-Space, a compact open-access Matlab/Python toolbox for the identification and analysis of low-dimensional gradients for any given regional or connectome-level feature. As such, BrainSpace provides an entry point for researchers interested in studying gradients as windows into brain organization and function. BrainSpace is a simple and modular package accessible to beginners, yet expandable for advanced programmers.
As such, using manifolds as a new coordinate system 34 may complement widely used parcellation approaches  2, 42, 51  and be can be useful for the compact representation of findings and aid in the interpretation and communication of results. Although, we have only illustrated the use of our toolbox with neocortical surface data, the gradient-based functionality of BrainSpace is not restricted to these regions and can also be used with other datasets (e. g. , hippocampal measures, subcortical measures, and volumetric data). However, as of version 0. 1, visualization is only available for surface meshes. Extending the visualization functionality of BrainSpace to support other cerebral structures and volumetric data is a promising line of future work.
As of version 0. 1, BrainSpace provides three of the most widely used dimensionality reduction techniques for macroscale gradient mapping: PCA for linear embedding, and LE and DM for non-linear dimensionality reduction. 1. PCA is a linear approach that transforms the data to a low-dimensional space represented by a set of orthogonal components that explain maximal variance. Given a column-wise demeaned version of the input matrix X d , the low-dimensional representation is computed as follows: G PCA ¼ US T ; where U are the left singular vectors and S a diagonal matrix of singular values obtained after factorizing the input matrix using singular value decomposition, X d = USV T. Although here we present the singular value decomposition version below, PCA can also be performed via eigendecomposition of the covariance matrix of X.
All aforementioned dimensionality reduction approaches assume that our highdimensional data lies on some low-dimensional manifold embedded in ambient space, which is typically the case with neuroimaging datasets. These techniques, therefore, provide a convenient approach to handle the curse of dimensionality inherent to neuroimaging data. Moreover, they facilitate comparison by recovering representations with the same number of dimensions even when source data is noncomparable in ambient space (for example when subjects have different fMRI time series of different lengths). PCA, in particular, is able to discover the low-dimensional structure when the data lies in an approximately linear manifold, but performs poorly when there are non-linear relationships within the data. In such scenarios, LE and DM are more appropriate to discover the intrinsic geometric structure.
From a technical point of view, the advantage of PCA over the non-linear approaches included in BrainSpace is that it provides a mapping from the high-to the lowdimensional space rather than simply producing the new low-dimensional representations. Hence, the choice between linear and non-linear dimensionality reduction is problem-dependent and may also be influenced by the nature of the data under study. Alignment of gradients. Gradients computed separately for two or more datasets (e. g. , patients vs controls, left vs right hippocampi) may not be directly comparable due to different eigenvector orderings in case of eigenvalue multiplicity (i. e. , eigenvalues with the same value) and sign ambiguity of the eigenvectors  54. Aligning gradients improves comparability and correspondence. However, we recommend visually inspecting the alignment results; if the manifold spaces are substantially different, then alignments may not provide sensible output.
In version 0. 1 of the BrainSpace toolbox, gradients can be aligned using Procrustes analysis  55  or implicitly by joint embedding. Procrustes analysis. Given a source G s and a target G t representation, Procrustes analysis seeks an orthogonal linear transformation ψ to align the source to the target, such that ψðG s Þ and G t are superimposed. Translation and scaling can also be performed by initially centering and normalizing the data prior to estimation of the transformation. For multiple datasets, a generalized Procrustes analysis can be employed. Let G k ; k ¼ 1; 2; ; N be the low-dimensional representations of N different datasets (i. e. , input matrices X K ). The procedure proceeds iteratively by aligning all representations G k to a reference and updating the reference G R ¼ 1 N.
P k ψðG k Þ by averaging the aligned representations. In the first iteration, the reference can be chosen from the available representations, or an out-of-sample template can be provided (e. g. , from a hold-out group). Joint embedding. Joint embedding is a dimensionality reduction technique that finds a common underlying representation of multiple datasets via simultaneous embedding  37. The main challenge of this technique is to find a meaningful approach to establish correspondences between original datasets (i. e. , X). In version 0. 1 of BrainSpace, joint alignment is implemented based on spectral embedding and available for LE and DM. The only difference with these methods is that the embedding, rather than using the affinity matrices individually, is based on the joint affinity matrix J , built as: where A k is the intra-dataset affinity of the input matrix X k and A ij is the inter-dataset affinity between X i and X j.
Acknowledgements Mr. Vos de Wael  was funded by the  Savoy Foundation for Epilepsy Research. Dr. Oualid Benkarim  was funded by a  Healthy Brains for Healthy Lives  (HBHL) postdoctoral fellowship. Dr. Jessica Royer  was supported by a  Canadian Open Neuroscience Platform (CONP)  fellowship. Dr Smallwood  was supported by the  European Research Council  ( WANDERINGMINDS-ERC646927 ). Dr. Paquola  was funded through a postdoctoral fellowship of the  Transforming Autism Care Consortium (TACC)  and the  Fonds de la recherche du Québec-Santé (FRQ-S). Dr. Boris Bernhardt  acknowledges research support from the  National Science and Engineering Research Council of Canada (NSERC ,  Discovery-1304413 ), the  Canadian Institutes of Health Research (CIHR ,  FDN-154298 ), the  Azrieli Center for Autism Research of the Montreal Neurological Institute (ACAR) ,  SickKids Foundation  ( NI17-039 ), and the  Canada Research Chairs (CRC) Program.
Code availability Our toolbox is freely available at: http://github. com/MICA-MNI/BrainSpace. The toolbox contains a parallel Python and Matlab implementation with closely-matched functionality (The Python implementation of BrainSpace incorporates a wrapper for VTK, which helps simplify object creation and pipelining). Along with the code, the toolbox contains several surface models, parcellations across multiple scales, and example data to reproduce the evaluations presented in this tutorial. Additional documentation of the proposed toolbox is available for both Python and Matlab implementations via http:// brainspace. readthedocs. io.
Acknowledgments This work was supported by  CNRS , the  Agence Nationale de la Recherche  ( ANR-14-OHRI-0001-01 ,  ANR-16-CE29-0011-03 ),  IdEx Bordeaux  ( ANR-10-IDEX-03-02 ),  Conseil Régional d'Aquitaine  ( 2011-1603009 ) and the  France-BioImaging national infrastructure  ( ANR-10-INBS-04-01 ). A. G. G. acknowledges financial support from the  Fondation pour la Recherche Médicale  and the  Fonds Recherche du Québec-Nature et Technologies.
A mixture of paraffin oil and acacia gum without LA was used as a control solution (paraffin emulsion), to limit differences in viscosity and lubricity between control and taste solutions, which could be detected by the subjects. LA and paraffin emulsions were prepared for less than 24 h before tasting. Healthy men were enrolled in this study. The mean age and BMI were 22 ± 2 years old (range: 19-34) and 23 ± 3 kg/m 2 (range: 19-29), respectively. All of the subjects were nonsmokers or mild smokers who had not smoked during the day before GEP recordings. Heavy smokers (20 or more cigarettes per day) were not included. As shown in previous data  (34) , only heavy smoking alters gustatory pathways, and GEPs obtained in response to salty and sweet solutions were similar in mild and moderate smokers and nonsmokers (unpublished observations).
Experimental design The taste-delivery system has been described in detail in previous studies  (29, 30). Briefly, control and taste solutions were driven through the system by compressed air. Two parallel silicone tubes were used: one for the control solution and the other for the taste solution. Switching between the control and taste solutions was performed by two electromagnetic valves controlled by an electronic device. This electronic device (stimulator) sent a signal to the computer software (SystemPLUS EVOLUTION, 2007 Micromed S. p. A) when the taste solution was administered (with 1 ms precision), resulting in a precise time recording of the GEPs. Participants put the two parallel tubes (silicone tubing, P/N 10025-02S, Bio-Chem valve) in their mouth, placed 1. 5 ± 0. 5 cm from the dental arch on the midline of the tongue.
GEP recording and data analysis Electroencephalographic (EEG) measurements were recorded according to the international 10-20 system using a conventional EEG recording system. Five sites were recorded by surface electrodes defined by their scalp topography: centro-parietal electrode Pz, central electrode Cz, and frontal electrodes Fz, Fp1, Fp2. The electrodes were referenced against linked earlobes (ear clip electrodes enfolded by Ag, 10 mm diameter; SystemPLUS EVO-LUTION). The ground electrode was placed on the forehead. Disposable cup electrodes enfolded by Ag-AgCl (6 mm diameter), with a long polyurethane cable (SystemPLUS EVOLUTION), were used. Electrodes were placed after using first a pumice paste and then a conductive and adhesive paste. The EEG measurements were amplified, filtered, and digitized using Micromed software (SystemPLUS EVOLUTION, 2007 Micromed S.
Post hoc analyses (Tukey's tests) were performed when the result was found to be significant. Then, GEP parameters in response to paraffin solutions on the one hand, and in response to LA solutions on the other hand, were compared between both experiments using one-way ANOVA. GEPs recorded in Fp1 and Fp2 electrodes were not analyzed because of the too large variability of the recording (artifacts due to eye movements, possible activation from an anticipation phenomenon, and projections from several cerebral sensory areas). A P value below 0. 05 was considered statistically significant. SAS 9. 2 software (SAS Institute Inc. , Cary, NC) was used for all analyses.
Acknowledgments BCJM was supported by the  Engineering and Physical Sciences Research Council (UK) , grant number  RG78536. AJO was supported by the  National Institutes of Health  (Grant  R01 DC005216 ). MGH was supported by the  National Institutes of Health  (Grant  R01 DC009838 ). SS was supported by  National Institutes of Health  grants and by an  ERC   Advanced Grant  (Neume). PXJ and EVE were supported by grants from the  Fund for Scientific Research -Flanders and Research Fund KU Leuven. CJP was supported by the  Biotechnology and Biological Sciences Research Council (UK) , grant number  BB/M007423/1 , and by the  National Institute for Health Research Manchester Biomedical Research Centre. We thank the Editor and two anonymous reviewers for constructive comments on an earlier version of this manuscript.
Cerebello-hippocampal physiological interactions in a familiar homecage environment In order to question the potential functional relevance of cerebello-hippocampal anatomical connectivity, we implanted mice (n = 21) with arrays of bipolar LFP recording electrodes in bilateral dorsal hippocampus (HPC) and unilaterally in two highly RABV-labeled regions of the central cerebellum, lobule VI (midline) and Crus I (left hemisphere). For comparison, we also simultaneously recorded LFP from cerebellar regions with minimal RABV labeling (lobule II or lobule III; Figure  1M ; Figure  3A  and B ). Data were excluded from further analysis in cases where postmortem histological inspection revealed that electrode positions were off-target (Figure  3-figure supplement 1 ). The spectral profile of cerebellar and hippocampal LFP activity was first assessed during active movement in a familiar home-cage environment (epochs with speed >3 cm/s; see Materials and methods).
Abbreviations, I, lobule I; III, lobule III; IV/V, lobule IV/V; VIa and VI b-c, lobule VIa and VI b-c, respectively; IX, lobule IX; X, lobule X; Sim, lobule simplex; Cr I, Crus I; Cr II, Crus II; Par, paramedian lobule; CP, copula, PFL, paraflocculus, FL, flocculus. ; dPFC and vPFC, dorsal and ventral paraflocculus, respectively. DOI: https://doi. org/10. 7554/eLife. 41896. 009 Representative simultaneous raw LFP recordings (colored lines) and LFP filtered in the theta frequency range (q, 6-12 Hz, overlaid gray lines) recorded during active movement in the homecage condition as defined by instantaneous speed. Solid magenta line indicates data epochs in which speed was above the required threshold for inclusion in further analysis (3 cm/s, dashed line (20 mice). In one mouse in which speed data was not available we used neck electromyograph (EMG) data to define periods of active movement).
Behavior In all conditions, behavioral data were analyzed using custom-made Matlab scripts. Instantaneous speed (or virtual speed) was derived from video tracking data (or virtual X and Y coordinates recorded as voltage signals in Neuralynx Cheetah software) and downsampled to 10 Hz for consistency with spectrogram and coherogram data (see below). Only epochs of active movement, defined by a sustained speed above 3 cm/s for a minimum of 4 s, were selected for further analysis. In the home-cage environment, there was one case in which video tracking was not available and the epochs of active movement were thus defined by an amplitude threshold in EMG signal and the presence of a high theta/delta ratio in the hippocampal recordings. For linear track and virtual reality-based experiments, active movement periods (instantaneous speed >3 cm/s) were analyzed from each 12 min session (three sessions per day) for overall calculations.
Electrophysiology LFP data was z-scored, notch filtered (filter centered to 50 Hz to remove electrical line noise) and detrended (using local-linear regression with a moving window of 1 s in 0. 5 s steps to remove the DC component) prior to subsequent analysis. Multi-taper Fourier analyses (Chronux toolbox  [Bokil et al. , 2010] ) were used to calculate power and coherence of the LFP data. We used a 1 s sliding window in 0. 1 s step and four tapers for all analysis. Time points with large-amplitude, low frequency artifacts, identified by threshold crossings of the mean z-score power in 0. 5-5 Hz band, were removed from further analysis. Similarly, peri-MFB electrical stimulation times (±0. 5 s) in linear track and virtual environment conditions were also excluded from analysis. For overall power spectra and coherence calculations, the means of the spectrograms and coherograms were respectively computed.
Spectral power between 0. 1 and 500 Hz was z-scored to homogenize values and reduce the impact of inter-animal and inter-region global variations. Frequency axes in both spectral power and coherence plots were presented in logarithmic scale to facilitate visualization across a large frequency band. Frequencies between 48-52 Hz were removed from coherence plots due to the presence of a spurious peak related to the notch filtering. Data duration of recordings made in the home-cage environment, varied across mice (range, 12 to 132 min). Therefore, to reduce the impact of data length on subsequent analyses and also to match with subsequent linear track experiments (duration of 12 min), for each mouse we concatenated the LFP in to 12 min blocks. When multiple 12 min blocks were available (number of data blocks ranged from 1 to 11), we calculated the average coherence across all blocks.
Statistical analysis Statistical analyses were conducted using Matlab Statistical Toolbox and Prism (Graphpad, USA). Normality was assessed using a Shapiro-Wilk test. Parametric and non-parametric tests were then used accordingly. For bootstrap calculations on the correlation of theta power and theta coherence with speed, we computed the Spearman's correlation between these variables and a randomly shuffled rearrangement of instantaneous speed values. We repeated this 1000 times in order to obtain the cumulative probability distribution of the random correlation values. The confident limits for a = 0. 05 were obtained by finding the correlation values at probabilities of 0. 025 and 0. 975.