dataesr/scientific-paragraphs-categorization huggingface dataset:
We introduce the BrainBeats toolbox in response to these challenges, an open-source EEGLAB plugin providing an suite of signal processing and feature-extraction functions adhering to current guidelines and recommendations. The toolbox integrates three main protocols: 1) Heartbeat-evoked potentials (HEP) and oscillations (HEO); 2) EEG and HRV feature extraction; 3) Automated removal of heart artifacts from EEG signals. Accompanied by sample data and guidance, BrainBeats aims to facilitate brain-heart interplay research and reproducibility. This open-source toolbox offers a valuable resource for clinicians and researchers studying brain-heart interactions and can be tailored to unique research needs.
This has been done with ECG  [31] [32] [33]  and PPG to a lesser extent, to our knowledge  [34] [35] [36]. This approach presents promising applications by capturing both the state-related and trait-related variables. Note that, for both EEG and cardiovascular signals, the longer the recording, the more dominant the trait variable  [37] [38] [39]. Thus the applications depend on the recording parameters. Feature-based analyses (including qEEG or feature-based machine learning) are growing in interest for both clinicians and scholars, providing new objective metrics for making early predictions/forecasting of the development of mental and neurological disorders, of treatment-response, or of relapse  [40] [41] [42] [43] [44] [45] [46] [47] [48]. This approach is especially compelling with large datasets and real-world settings (e.
The advantages over alternative methods While many tools exist to process cardiovascular and EEG, and HRV signals independently from one another, none is currently available for jointly analyzing them. Furthermore, the tools available to process cardiovascular signals require expensive license purchase, do not allow processing large datasets in batch via command line, have proprietary algorithms that limit reproducibility, or require advanced programming skills by not providing a graphical user interface (GUI). To our knowledge, three open-source MATLAB toolboxes exist to support HEP analysis with a GUI. The ecg-kit toolbox  50  , the HEPLAB EEGLAB plugin  51  , and the CARE-rCortex toolbox  52. While HEPLAB and ecg-kit facilitate HEP analysis by detecting heartbeats and marking them in the EEG signals, they do not provide statistical tools for analysis and are limited to the time domain (i.
e. , ERP). The CARE-rCortex plugin addressed these issues by supporting ECG and respiratory signals, time-frequency domain analysis, statistics, and advanced baseline normalization and correction methods adapted to HEP analysis. However, it uses the Bonferroni method for multiple comparison correction, which is too conservative for the many comparisons in EEG analysis and the assumption about independence (across electrodes, time points or frequency bins), leading to an increase in type II  53. Furthermore, the toolbox does not offer command-line access for processing and analyzing large datasets for advanced users. Finally, recent studies recommend against baseline correction methods, as they reduce the signal-to-noise ratio (SNR) and are "statistically unnecessary and undesirable"  [54] [55] [56].
To address these limitations, we introduce the BrainBeats Matlab toolbox, implemented as an open-source EEGLAB plugin designed to process and analyze EEG and ECG/PPG signals jointly. It incorporates the following advantages over previous methods: I) An easy-to-use GUI (for non-programmers) and command line mode (for programmers aiming to perform automated processing and analysis on large datasets using more advanced parameters). II) Implementation of validated algorithms, parameters, and guidelines for processing cardiovascular signals, such as detecting R peaks, interpolating RR artifacts, and computing HRV metrics (e. g. , implanting guidelines for windowing, resampling, normalization, etc. 37, 57, 58  ). This is important because Vest et al. (2018) demonstrated how modest differences in these processing steps can lead to divergent results, contributing to the lack of reproducibility and clinical applicability of HRV metrics.
REPRESENTATIVE RESULTS: METHOD 1 BrainBeats first separates the ECG from EEG data to process them separately. EEG data are bandpass filtered using a zero-phase non-causal finite impulse response (FIR) filter to remove low-frequency drifts and high-frequency noise (highpass cutoff frequency = 1 Hz, low-pass cutoff = 45; transition bandwidth = 0. 5 Hz). If the data have at least 30 channels and have not been referenced, BrainBeats re-references them to infinity. Then, BrainBeats uses the clean_rawdata plugin to automatically detect and remove abnormal EEG channels (flatlinecriterion = 5; ChannelCriterion =. 8; LineNoiseCriterion = 5). Removed channels are plotted (Figure  1. 3, in red) and interpolated using spherical splines (Perrin et al. , 1989). CAUTION: These default parameters are implemented for the best performance for this sample dataset.
In most cases, we recommend users clean their datasets before launching BrainBeats to tune parameters for their datasets. For example, abnormal channels may not be reliably detected on low-density EEG montages using this default method. Next, BrainBeats detects R-peaks (from QRS complexes) on non-overlapping windows disregarding initial signal artifacts. The signal undergoes bandpass filtering and Pan-Tompkins (P&T) method  79  , including differentiation, squaring, integration, and smoothing. The P&T energy threshold is estimated to avoid disruption from large bumps, and if the RR interval variability exceeds 1. 5 times the median, it conducts a "search back" for missed peaks. The Rpeak's mean sign over 30 seconds determines the QRS complex sign, ensuring consistent detection. QRS detection and search back are based on an energy threshold defined by the signal's sample rate and smoothed ECG values.
The filtered ECG signal, identified R-peaks, NN intervals, and interpolated artifacts (from the best electrode) are plotted (see Figure  1. 4. ). Note that users can scroll through the R-peaks more closely using a scroll bar (30-s windows). This code is adapted from the validated algorithms developed for the Physionet Cardiovascular Signal toolbox  58, 80  (see reference for validation and performance comparison with other stateof-the-art algorithms). Next BrainBeats adds R-peak markers to the EEG signals, calculates inter-beat-intervals (IBIs), and removes trials with IBIs less than 550 ms (following recommendations  63, 81  ). The run_HEP function removes outlier trials (detected by MATLAB's isoutlier function, 'grubbs' method from custom RMS and SNR metrics) and generates a histogram of the resulting IBIs with fitted normal density (see Figure  1.
5. ). To determine the minimum epoch size cutoff following R-peak events, the 5th percentile of the IBI data is calculated (i. e. , the value below which 5% of the IBI falls, displayed as a dashed red line in the histogram). This epoch size maximizes the number of epochs and limits overlapping epochs. When all files are processed, users may import them into an EEGLAB STUDY to compute HEP (i. e. , ERP) and HEO (i. e. , ERSP and ITC) data on the whole group and run statistics at the group level. We recommend performing hierarchical linear modeling using the LIMO plugin  75    Then, HRV and EEG features are extracted in the time (NN), frequency, and nonlinear domains. See Table  1  for a list of the features currently available. The Lombscargle-periodogram is the default method to compute frequency HRV as it does not require interpolation or resampling unlike the Welch or FFT methods, better preserving original information.
Critical steps in the protocol Critical steps prior to launching Brainbeats include: having MATLAB and EELAB installed, installing the BrainBeats plugin, installing a few EEGLAB plugins (for Methods 1 and 3), possessing a dataset that includes both EEG and cardiovascular (ECG or PPG) signals and importing with appropriate EEGLAB plugin, knowing the name of the cardiovascular channel(s) to select from the list, selecting initial parameters in the main GUI. Note that, data importation cannot be automated as various plugins are required to be installed to account for the many different EEG data formats that exist (e. g. ,. edf,. bdf,. vhdr, etc. ). Warnings and error messages are implemented at various places in the toolbox to help users understand why they may encounter issues (e. g. , file length being too short for calculating a reliable measure of ultra-low frequency HRV, signal quality being too low for any reliable analysis, missing electrode locations etc.
Thus, one would end up rejecting most trials since they would not have the required length (especially if one wanted to examine frequencies as low as 1 Hz an additional 3 s before and after window of interest). Hence, future developments will implement the "reflection" method, which mirrors the signal from the window of interest (i. e. backward version of the signal) before and after to expand the available window. This provides smooth transitions and moves the edge effects further away. The mirrored sections are then removed. Finally, other features and methods will be added to assess interactions between EEG and cardiovascular signals. New methods will include for example EEG-ECG coherence, the "timeresolved directional brain/heart interplay measurement"  96  , or classification of HEP or feature data using machine learning (e.
PROTOCOL 1. 1. 1. 111 Method 1: Heartbeat-evoked potentials (HEP) 1. 1. Load data into EEGLAB: File > Load existing dataset > select "sample_data1. set". See Figure Note: this dataset was collected with a "wet" Biosemi system during a mind-wandering (shortened to 5 minutes to facilitate replication of the following steps) with 64 EEG channels and 2 ECG channels.
Then, Infomax ICA (or the Picard algorithm if installed) is performed with PCA-dimension reduction to account for effective data rank, and ocular and muscular components are classified and subtracted from the signal using ICLabel (as in Method 1, but on continuous data). One ocular component is removed with 98. 6% accuracy. A full tutorial is available at https://github. com/LIMO-EEG-Toolbox/limo_tools/wiki METHOD 2 RR and NN series obtained as in METHOD 1 (The same Figures 1. 3. and 1. 4. pop-up). However, EEG data are cleaned differently since EEG and ECG signals do not need to be time-locked with ms accuracy to extract features (unlike for HEP/HEO analysis). Here, instead of removing abnormal epochs, BrainBeats first removes segments with large EEG artifacts using artifact subspace reconstruction (ASR; SD criterion = 30; Figure 2.
Participants and procedure Participants were recruited through an online database of candidates for behavioural experiments in the greater Paris area. Inclusion criteria were: being 18 years of age or older, being a French native speaker, and not having a history of psychiatric or neurologic disorders. In total, 104 participants registered to take part in the main study. This study consisted of two sessions done during two visits scheduled approximately two weeks apart. Two participants who did not come back for the second session were excluded from analyses, so our sample comprises 102 subjects. Each session consisted of the current experiment and another independent experiment that will be reported in a separate paper. Participants were paid a fixed endowment of 50€ for participation in both sessions.
Data collection Model-free dependent variables were observed choice (costly or uncostly) and response time (RT). Trials with extreme RT were excluded (8. 9% per participant in total), keeping only trials with 0. 75 s < RT < 10 s and within the median ± 3 SD interval. The session number (categorical variable) and trial number within session (continuous variable) were regressed out. To better gauge the momentary willingness to accept costly options, we calculated at each trial the area under the curve (AUC) of indifference estimated by the OTG procedure. AUC was computed by applying the trapezoidal rule to each of the 50 cost levels for which the equivalent small reward was larger than zero. AUC was then z-scored per session and interpolated separately for each cost type (because only one cost type was presented at every trial).
When including all parameters, the extended discount and choice functions were the following: For delay: For risk (of losing L): For physical effort: For mental effort: The full model space contained 36 different combinations that are listed in Table  S4. Models were inverted using the Variational Bayesian Analysis (VBA) toolbox (available at https:// mbb-team. github. io/ VBA-toolb ox). It relies on a variational approach to Bayesian inference, thereby being orders of magnitude more efficient than sampling-based approaches  26. Inputs to VBA were prior parameter distributions, trial-by-trial option features and choices. The weights k on reward and costs, the power parameters γ and inverse choice temperatures β 1 were constrained to be positive and their prior distributions were centred on 1.
Data availability All data needed to evaluate the conclusions in the paper are present in the paper and/or the Supplementary Materials S1. The raw data (MATLAB datasets) can be provided by Roeland Heerema pending scientific review and a completed material transfer agreement. Requests for the data should be submitted to: mathias. pessiglione@ gmail. com. The toolbox used for online trial generation can be accessed at https:// github. com/ MBB-team/ OTG. Received: 13 March 2023; Accepted: 17 October 2023.
SNPs identification among the CGB, EC, RM, and O samples To discover SNPs among all samples, we made the SNP calling using the pipeline reported by  Osorio-Guarín et al. (2020). In summary, for all sequence files of each analyzed sample (downloaded and generated in this study), we used the FastQC software  (Andrews 2010)  to verify the quality of the Fastq files of each sample. The adapter's primers and sequences with quality less than Q30 and length less than 50 base pairs (bp) were filtered using Trim-Galore software  (Krueger 2012). The Burrows-Wheeler Aligner (BWA) software  (Li and Durbin 2009)  was used to align the sequences against the P. americana Hass cultivar reference genome version 2. 0 (~913 Megabases -Mb)  (Rendón-Anaya et al. 2019). We used Picard  (Picard 2022)  and the Genome Analysis ToolKit -GATK (GATK 2022) software to remove PCR duplicates, to correct mapping quality assignment, and to realign and recalibrate the reads.
The SNP calling was done using the Unifiedgenotyper option of the GATK. Finally, we used the VCFtools software  (Danecek et al. 2011)  for filtering the SNP markers with a Minimum Allele Frequency (MAF) under 5%, a minimum of 2X of Sequencing Depth (SD) per position, maintaining biallelic markers and excluding InDels (Insertion-deletion) markers. Samples and SNP markers with percentages higher than 20% (genotype level) and 5% (marker level) of missing data were excluded. The nucleotide sequences were obtained from different tissues and genomic resources  (Rendón-Anaya et al. , 2019; Talavera et al. , 2019). Then, the final filter for polymorphic SNP markers discovery was implemented to get four different datasets used in further analyses (Table  1 ). Metrics related to SNP markers such as Polymorphic Information Content (PIC), Minor Allele Frequency (MAF), Nucleotide Diversity (ND), Mean Depth of Sequencing (MDS), Genetic Diversity (GD), Observed Heterozygosity (Ho), and Transition/Transversion (Ts/Tv) statistics were determined in the dataset 3 using VCFtools software  (Danecek et al.
Unsupervised non-parametric Genetic Cluster Analysis Population stratification was characterized using dataset 1, which included 4931 SNPs identified in 199 samples (Table  1 ) using two complementary non-parametric approaches related to unsupervised machine learning: partitioning and hierarchical clustering. We had to perform a prior step to reduce the dimensionality of the SNP dataset through Principal Component Analysis (PCA)  (Alhusain and Hafez 2018; Foote et al. 2019 ) using R-glPca function in the R-adegenet package (Jombart and Ahmed 2011). Once dimensionality was reduced, we applied unsupervised non-parametric clustering approaches. For partitioning clustering, we used K-means  (MacQueen 1967; Lloyd 1982) , Partitioning Around Medoids (PAM), and Clustering Large Applications (CLARA)  (Kaufman and Rousseeuw 2009)  algorithms, and for hierarchical clustering, we ran AGglomerative NESting (AGNES) y DIANA algorithms (Divisive analysis)  (Kaufman and Rousseeuw 2009 ) using the ward.
D2 method in R software  (R 2022). To find the optimal number of subpopulations or K Clusters for each unsupervised nonparametric clustering algorithm, we conducted in R the two complementary methods NbClust  (Charrad et al. 2014)  and optCluster  (Sekula et al. 2017). First, we ran the NbClust algorithm, an internal measure's function that integrates 30 indexes to determine the optimal K value based on Ward. D2 method and the Euclidean distance evaluating three (K=3) to eight (K=8) putative subpopulations. Second, we ran the optCluster function, an improvement of the traditional clValid algorithm  (Brock et al. 2008 ) that optimizes both the K score and the clustering approach based on internal, stability, and biological measures. In this sense, the optCluster function validated at once all clustering algorithms by each approach using cross-entropy and algorithmic genetic methods, using weighted Spearman footrule distance  (Kumar and Vassilvitskii 2010) , evaluating three (K=3) to eight (K=8) putative subpopulations.
Statistical Genetic Structure Analysis To identify the genetic differentiation among detected clusters in the previous section, we conducted an analysis of molecular variance (AMOVA) using 1000 permutations in the R-poppr package  (Kamvar et al. 2014). Pairwise FST values were calculated in the R-dartR package  (Gruber et al. 2018) , while the genetic diversity measured by observed (Ho) and expected (He) heterozygosity were calculated in the R-hierfstat package  (Goudet et al. 2022). Mantel correlations test at 1000 permutations between genetic differentiation and geographic distance within and between pairs of clusters using the R-geosphere package  (Hijmans et al. 2021). Diagrams were drawn in the same software depicting pairwise FST/(1-FST) vs. geographic distance (Km),  following Rousset, (1997).
Meanwhile, bidirectional gene flow among pairs of populations was estimated as the number of migrants per generation (Nem) following the methodology described by  Beerli & Felsenstein, (1999) , which is the inverse surrogate of pairwise FST scores. We draw, using the R-qgraph package  (Epskamp et al. , 2012) , the networks depicting pairwise bidirectional migration rates across all datasets  (Epskamp et al. 2012).
Reconstruction of demographic scenarios We used the DIYABC Random Forest v1. 0 program  (Collin et al. 2021) , an extended version of DIYABC v2. 1. 0. This tree-based classification method uses supervised machine learning to classify demographic evolutionary scenarios and estimate their parameter robustness based on a certain number of simulations per scenario using the genetic groups obtained in the previous analysis. We simulated 120,000 sets for the 4931 selected loci of dataset 1 (Table  1 ), and 1000 trees for model choice and 1000 as the number of out-of-band testing samples to estimate the historical parameters given the highest posterior probability model from the eight simulated. Because there is no experimental estimate of the SNP mutation rate available for avocados, the mean mutation rate followed an a priori uniform distribution.
Maximum Likelihood method for Phylogenetic Analyses The phylogenetic analysis was conducted using dataset 2, which includes 3899 SNP markers for 202 avocado samples (Table  1 ) and an Outgroup (O), the close relative species P. schideana. Although this species could potentially hybridize with avocados  (Ashworth and Clegg 2003) , it behaved as an outgroup in our analyses. In a preliminary analysis (data not shown) in which we also used the species Phoebe bournei as an outgroup, P. schiedana was more related to this species than to avocados. Therefore, we decided to use only P. schiedana as an outgroup because we could recover more SNPs. The alignment of nucleotide sequences of all targeting SNPs was visualized and verified in Geneious v8. 1. 7  (Kearse et al. 2012 ). The phylogenetic tree was reconstructed using the Maximum Likelihood (ML) method in the PhyML v3.
Ancestry Analyses To determine which races of avocado are present in the CGB and EC, we ran two independent ancestry analyses using datasets 3 and 4 (Table  1 ) because each matrix presented a different number of polymorphic markers, 26048 and 227, respectively (Table  1 ). These datasets included genotypes with high genetic ancestry (>80%) to one genetic race (ME, GU, WI) and the Colombian group (CO) determined in the Unsupervised non-parametric Genetic Cluster Analysis. In the case of the CO group, we selected samples representing the two possible subpopulations detected in the Colombian collection (CO_Andean and CO_Caribbean) through phylogenetic analyses. The samples with a clear genetic ancestry for these five genetic clusters were used as reference genotypes to implement a supervised analysis in ADMIXTURE software  (Alexander and Lange 2011).
Results Number and statistics of SNP discovered in Avocado datasets. The sequencing of the 384 avocado genotypes of CGB and EC generated a total of 3. 132. 393. 704 sequence reads (Table  S1 ) that were merged with the available sequences for the 71 reference genotypes  (Talavera et al. 2019)   1 ). Considerable differences in the number of SNPs were observed in datasets, including EC genotypes, from which the DNA was obtained from root tissue. However, the number of sequences generated in the CGB (3 million -M to 52M) and EC (1. 3M to 56M) genotypes was similar (Table  S1 ). Then, a high number of sequences from avocado root tissue was generated, but the percentage of missing data among the samples was high in the SNP calling. It has been reported that the efficiency of the nucleic acid extraction process differs from the tissue used in DNA extraction processes because the physical (lignified grade) and chemical composition (higher presence of metabolite secondaries) and diameter of the root tissue can affect these processes.
Therefore, when working with root tissue in genomic approaches, it is recommended to use its tissue in the same conditions (dryness) and characteristics (size)  (Fisk et al. 2010; Zeng et al. 2015; Oliveira et al. 2015; Miller et al. 2017 ). However, the number of SNPs identified in this study demonstrates a priori the degree of differentiation and genetic diversity present among the evaluated germplasm, which is correlated with the average values of the PIC (0. 22), Ho (0. 27), and MAF (0. 19), being theses higher than the results reported by  Talavera et al. (2019). The statistics of SNPs were calculated using dataset 3 (Table  1 ), which had the highest SNP number (26048) mapping in 8082 contigs of the Hass genome reference. This dataset had a Ts/TV proportion of 1. 27, with 15487 transitions (Ts) and 10561 transversions (Tv) substitutions and an MDS mean of 5.
Data Archiving Statement This published article and supplementary material include all data generated or analyzed during this study. The data for this study was submitted to NCBI under BioProject: PRJNA878519, which contains 384 raw Illumina sequencing data. Published sequencing data used in this study from Talavera et al. (2019) were from NCBI PRJNA564105 number. The sequences of P. schideana used as an outgroup were downloaded from NCBI with SRR8295605 accession number published by Rendón-Anaya et al. (2019). ORCID Berdugo-Cely, J. A. https://orcid. org/0000-0002-2675-0462 Cortés, A. J. https://orcid. org/0000-0003-4178-0675 López-Hernández, F. https://orcid. org/0000-0002-4967-6955 Delgadillo, P. https://orcid. org/ 0000-0002-1416-7907  Cerón-Souza, I. https://orcid. org/0000 -0002-2731-0362  Reyes-Herrera, P.