dataesr/scientific-paragraphs-categorization huggingface dataset:
Introduction Molecular networks have become a cornerstone of metabolomics analysis approaches, notably since the establishment of the GNPS with the creation of large community-based MS2 databases,  1  and the Feature-Based Molecular Networking (FBMN) approach, which combines cosine clustering with quantitative comparative metabolomics. 2, 3  In the form of mass spectral networks, the spectral data becomes easier to interpret, with ions being represented by nodes, connected by edges if their spectral similarity calculated by a cosine score exceeds a set threshold. The potential identity of the nodes can be established by dereplication, using the MS2 spectral libraries available on the GNPS, giving insight into the identity of neighbouring nodes using the network topology. The main caveat of this reliance on dereplication is that only a low percentage of the total nodes can be annotated using MS2 databases,  4  leaving the user with a large amount of unknown nodes.
Improvements have been proposed to increase the annotation coverage, including dereplication using in-silico spectral libraries,  5, 6  annotation with shared spectral patterns with MS2LDA,  7  or with chemical compound classifications enabled by CANOPUS  8, 9  or MolNetEnhancer. 10  However, most nodes in networks remain without precise dereplication, which can be attributed to different reasons: (i) nodes being originated from truly unknown compounds, (ii) nodes from known compounds absent from databases, (iii) nodes that remain undereplicated due to low cosine scores owing to different acquisition parameters and (iv) nodes that represent known or unknown molecules but from ion species absent from databases. Since the first two points can mostly be solved by a global community effort and that the third one implies standardization across methods and instruments, we here focused on the last point.
While in a typical LC-MS based metabolites profiling analysis, a metabolite can produce mass spectral molecular features in the form of various adducts in both positive and negative ionization modes, most spectral libraries contain a majority of [M+H] + ions, which could explain the low annotation rate in networks. Moreover, ion species of a same molecule do not necessarily have similar MS2 spectra, meaning that multiple nodes from a same molecule will form separate clusters. The existence of adduct and fragment nodes in a network implies that the user must often perform manual inspection to locate the redundant ions. To overcome this hurdle and assist in the annotation process, we here introduce a Python library named MolNotator, centred on highlighting molecules within the ions constituting mass spectral networks.
After running MolNotator, molecules are represented as nodes, displayed amidst the ions they produced, in their ionization context (adducts, complexes, fragments, etc. ). Within this context, all ions produced by a molecule can be easily spotted, and moreover, by using the neutral nodes as anchors, positive and negative ionization data can be merged into a single network. In its core, MolNotator relies on combinatorial triangulations to compute the molecular nodes, allowing the most relevant interpretation of the data given the present ions. Furthermore, using the metadata MolNotator computes, a dereplication module was added, with optional retention time and ion species filters to reduce false positive annotations. In addition to MS 2 dereplication with MGF files, the module can also dereplicate neutral nodes using molecular masses or formulae from user-provided CSV or TSV files.
MolNotator was validated using a set of 156 purified secondary metabolites from lichen origin that were analysed in Data-Dependent Acquisition (DDA) and manually processed to extract each MS/MS spectra. Using MolNotator, 92. 3% of the targeted molecules were correctly predicted with an average < 2 ppm mass error. Methods have been developed to deal with adduct annotation 11-15 and a method similar to this one was recently published, called Ion Identity Molecular Networking (IIMN), 16 which uses chromatographic shape correlations for clustering instead of combi-natorial triangulations. Indeed, the authors of IIMN also report that ion species diversity in databases is lacking and that many nodes in molecular networks are redundant. MolNotator improves dereplication possibilities by propagating annotations to the neutral nodes and helps producing databases from scratch with its MGF Updater module: the inputted MGF can be updated with the adduct annotation of each ion and the molecule they belong to.
Notably, this method merges positive and negative ionization modes which are typically studied separately. During our validation, most molecules were found in both positive and negative modes, however, running MolNotator on experimental data (complex extracts with molecules present at lower abundance) will show how each mode will lead to the detection of their unique molecules. We further demonstrate that dereplication is also improved through the use of MolNotator by applying its adduct and retention time filters and by the use of molecular mass for formula-based dereplication. MolNotator is available to the community as a Python package.
LC-MS analysis All molecules were analyzed with a generic data dependent LC-HRMS/MS method in both positive and negative ionization modes. Chromatographic separation was performed on an Acquity UPLC system (Waters, Milford, MA, USA) interfaced to a Q-Exactive Focus mass spectrometer (Thermo Scientific, Bremen, Germany), using a heated electrospray ionisation source (HESI-II). The LC conditions were as follows: column: Waters BEH C18 100 x 2. 1 mm, 1. 7 µm; mobile phase: (A) Milli-Q water + 0. 1% formic acid; (B) UPLC grade acetonitrile with 0. 1% formic acid; gradient: 5% B (0 min), 100% B (7 min), 100% B (10 min), 5% B (10. 01 min), 5% B (11 min); flow rate: 600 µL/min; injection volume: 2 µL. The optimised parameters of the HESI-II source were: source voltage: 3. 5 kV, gas flow rate (N 2 ): 48 units; auxiliary gas flow rate: 11 units; reserve gas flow rate: 2.
MZmine 2 parameters Thermo's proprietary raw files were converted to mzXML 18 format using the MSConvert module  19  from ProteoWizard. 20, 21  All files were imported in MZmine 2. 39  22  for Linux and were processed using the GenOuest computer cluster located in Rennes, France, using an Intel(R) Xeon(R) Gold 5220 CPU, 2. 20GHz. The parameters used are available in the Supporting Information (Table  S1 ). The ADAP chromatogram builder and deconvolution modules were used. 23  The processed ion data was exported in MGF format and the attributes for each feature in CSV format.
MolNotator Python package, dependencies, and parameters used The MGF and CSV files obtained from MZmine were placed in the mzmine_out folder the MolNotator project before starting the process. To use MolNotator, it is important to note that each sample file ("sample. mzXML" for example) should be prefixed "POS_" and "NEG_", respectively for the positive and negative ionization data, and aside from the prefix, the sample should have the same name in both modes (i. e. "POS_sample. mzXML" and "NEG_sample. mzXML"), so that they can be linked during the mode merging process. The main libraries MolNotator relies on are matchms 0. 6. 2, 24 pandas 1. 3. 5  25  and numpy 1. 19. 4. 26  The networks are produced using Cytoscape 3. BNR NEG = ["[M-H]-", "[2M-H]-"], BNR POS = ["[M+H]+", "[M+Na]+", "[M+NH4]+", "[2M+H]+", "[2M+Na]+", "[2M+NH4]+"].
Data and Code availability The MolNotator package can be downloaded from GitHub and Pypi. We suggest creating a new Python environment prior to using MolNotator. The package is provided with a small sample of the data for testing purposes, and the full dataset is available on Zenodo (https://doi. org/10. 5281/zenodo. 5792605). Two project folders are provided, one prior to the use of MolNotator and one after processing, containing the final networks. Both come with a style folder for Cytoscape to fit each network type.
Results and discussion Lichen Database Orbitrap spectra extraction and manual curation. Spectra from the files of the 156 analytes were extracted semi-automatically as done in our previous work  17  and added to the GNPS servers in addition to the other Lichen Database spectra already present there (negative and positive ionization modes). Doing so, 335 anion and 367 cation adducts were collected, the molecules which produced them were used to validate MolNotator. This dataset will be referred to hereafter as LDB-Orbitrap. MolNotator glossary of terms. Adducts: protonated and deprotonated molecules along with all ion species used to compute the molecular masses. These can be anions or cations, and also dimers, trimers or any formula provided by the user in the adduct table. See the blue and red nodes connected to the black node in Figure  1.
Method validation. Out of the 156 metabolites, 144 (92. 3%) were correctly represented as molecular nodes. The average mass error, highly dependent on the instrument and its calibration, was 1. 8 ppm, with 70% of compounds being calculated within a 0 to 2 ppm range (Figure  5A ). A dereplication was carried out using LDB-Orbitrap files now available on the GNPS servers. 137 out of the 144 predicted molecules were thus dereplicated. As MolNotator can also be used to extract spectra and produce databases, and by comparison to the manually curated LDB-Orbitrap library, the method retrieved 529 anion adducts and 649 cation adducts, compared to the corresponding 335 and 367 already in the library.
Thus, it is fair to state that (de)protonated molecules do not represent the overwhelming majority of ions encountered in LC-MS data, nor are they necessarily the most abundant ionized species for each molecule. Moreover, not taking into account the ionization context of molecules is a major contributing factor to the low dereplication rates in molecular networks as these adducts are absent from spectral databases. These results emphasize the importance of clustering redundant features from molecules, something MolNotator can do as part of metabolomics analysis workflows.
Discussion MolNotator represents LC-MS/MS data as true molecular networks, with predicted neutrals linked to all adducts and in-source fragments that are associated to them, whether they are formed in negative or positive ionization mode. The method was validated using spectra from the LDB, 92. 3% of which were correctly predicted, thereby retrieving 1178 spectra compared to the 702 already collected manually, due to the annotation of additional ion species for these LDB molecules. In addition to providing context for the ions in a mass spectral network, MolNotator has proven to be an efficient way of producing a spectral database from raw data, as the additional spectra can be simply pulled from the original data (MGF file) and added to the library, along with their dereplication and adduct annotation.
However, 12 molecules could not be correctly predicted as neutral nodes, mostly due too a low adduct count (0 or 1 ion produced, see Supporting information). While the data tested here was from pure standards, where the target analyte is highly concentrated, MolNotator can also function with complex samples. The library already contains functionality that can triangulate compounds between files: in a sample in which a molecule would be represented by a single ion, thus making triangulation of the neutral impossible, it will extrapolate the knowledge from other samples where more ions were produced to compute the neutral. Hence, in the network of the first sample, that single ion will be connected nonetheless to its molecular node. This makes the method highly effective when processing large metabolomics datasets, in which the number of samples will help the overall triangulations.
Regarding the run time, MolNotator's main bottleneck is Adnotator, which was capable of processing samples containing 300 ions in 1 minute, and was tested in other experiments with samples containing several thousand spectra and processing them in a dozen minutes. Future improvements should include the use of parallel computing and graph theory to greatly enhance performance on Adnotator and MolNet as well. Besides making insightful networks, our analysis also highlights the amount of redundant data in LC-MS/MS experiments and the implications it has on dereplication. This point was also stressed in the IIMN publication for Ion Identity Networks, also suggesting that databases should integrate more adduct species. 16  The main differences of MolNotator compared to IIMN are the calculation methods used (combinatorial triangulations instead of chromatographic shape correlations), the use of molecular nodes in the networks which include accurate mass dereplications, and the merging of positive and negative ionization modes that resulted in networks combining both ionization modes.
The use of precursorbased triangulations can prevail if the chromatographic peaks are too low quality because of the low(er) abudance of the metabolite and/or the low MS 1 to MS/MS ratio typically observed during DDA analyses. Thus, MolNotator offers a complementary approach that is independent of chromatographic shapes. The use of the neutral nodes for dereplication make it easier to create MS/MS libraries when most information available is in the form of compound (structure) databases, which is common with understudied organisms, like lichens. The use of both complementary ionization modes in the same network allows for a more comprehensive assessment of the sample's chemical content, instead of focusing on only one ionization mode. As such, MolNotator facilitates the more widespread use of dual ionization acquisition polarities and the combined data processing, analysis and interpretation.
We further aim to map the ion species distributions in (public) experimental data akin to the distributions displayed of the validation dataset. We will also create additional ion speciesenriched spectral libraries to gain a more comprehensive overview of the impact of ion species on metabolomics data. Finally, using the MolNotator ion species assignments, we would like to investigate the mass spectral network creation based on a unique ion species type, such as a protonated or deprotonated species. This would yield further insights in the true extent of unique chemicals metabolomics data can capture and how they relate to each other. We conclude that by using MolNotator, metabolomics researchers can directly deal with molecules instead of mass spectral features or ions, and thus get a glimpse of the samples' the full molecular content.
Acknowledgement We acknowledge the  GenOuest bioinformatics core facility  (https://www. genouest. org) for providing the computing infrastructure. We thank  Rennes Métropole  for the "Mobilité sortante" grant to support the collaboration with J. L. Wolfender's laboratory. We also thank  R. Lücking  and  H. Sipman  ( Botanic Garden and Botanical Museum in Berlin ) for giving us access to samples from  S. Huneck ' chemical library and  J. A. Elix  ( Canberra ) for standards from his own collection.
7. 1 27 by importing the node and edge tables produced by MolNotator. All parameters are described and available in the parameter file provided with the dataset on Zenodo (https://doi. org/10. 5281/zenodo. 5792605). They are also transcribed here pro forma. Duplicate filter: mass error = 0. 002 Da, retention time error = 10 s. Fragnotator: matched peaks = 3, score threshold = 0. 1, mass error = 0. 001 Da, retention time error = 10 s. Adnotator: mass error = 0. 002 Da, precursor mass error = 0. 1 Da, retention time error = 10 s, cosine threshold = 0. 2, hard cosine threshold = 0. 6, adducts searched= 21 in POS, 22 in NEG (see SI) run BNR (Basic Neutral Requirements, see SI) = True, BNR NEG = ["[M-H]-", "[2M-H]-"], BNR POS = ["[M+H]+", "[M+Na]+", "[M+NH4]+", "[2M+H]+", "[2M+Na]+", "[2M+NH4]+"].
MGF updater: skipped. Dereplicator: ion dereplication was carried out using the LDB 17 (cosine threshold = 0. 5, matched peaks = 2, precursor error = 0. 004 Da, mass error = 0. 002 Da, retention time error = 10 s, top hits = 3, adduct filter = True, retention time filter = True). Neutral dereplication was made using a TSV file produced by merging the COCONUT 28 and LOTUS 29 databases (precursor mass error = 0. 001 Da, top hits = 3). MolNet parameters: mass error = 0. 002 Da, cosine threshold = 0. 98, matched peaks = 8.
Significance: Image reconstruction of fNIRS data is a useful technique for transforming channel-based fNIRS into a volumetric representation and managing spatial variance based on optode location. We present an innovative integrated pipeline for image reconstruction of fNIRS data using either MRI templates or individual anatomy. Aim: We demonstrate a pipeline with accompanying code to allow users to clean and prepare optode location information, prepare and standardize individual anatomical images, create the light model, run the 3D image reconstruction, and analyze data in group space. Approach: We synthesize a combination of new and existing software packages to create a complete pipeline, from raw data to analysis. Results: This pipeline has been tested using both templates and individual anatomy, and on data from different fNIRS data collection systems.
Nonetheless, it is recommended that users read the steps on preparing individual anatomical files to determine whether their files meet the formatting requirements. Once the MRI data are prepared, the next step is to create the light model. There are multiple software packages that handle this step; we describe one implementation using Homer2  16  (https:// homer-fnirs. org/). It is noteworthy that the pipeline is also fully compatible with Homer3 as well. Then, fNIRS data must be pre-processed. Again, there are multiple options here, and we describe a solution using Homer2. The next step is image reconstruction. Here, we use tools from the NeuroDOT package  17  (https://github. com/WUSTL-ORL/NeuroDOT_Beta). We then run an individual-level GLM on the data, again, using NeuroDOT tools. Finally, we describe how to transfer the data into a common group space for a group-level analysis.
Collecting Digitization Data To locate the optodes on the head, we collect digitizations with a Polhemus Patriot FCC Class B digitizing device (https://polhemus. com/scanning-digitizing/digitizing-products/). The device consists of an electromagnetic receiver, placed on top of the head, and a wand used to mark the placement of the tip at each optode. The device default is set to capture the locations in inches from the receiver, but we changed this to centimeters to be compatible with Homer2  14, 16  (which we use in subsequent pipeline steps). Typically, digitizations are assumed to be in the format of one point per row, where the first set of points are reference landmarks on the head, followed by the sources, and then the detectors. Figure  2  shows a typical digitization captured with a small amount of error, pulling points out of alignment (in this case due to reaching across the head).
Creating Digitization Templates One of the challenges of using a digitizing pen is that errors in positioning can arise. For instance, in Fig. 2 , several points are slightly mis-localized, resulting in a distorted geometry. This can be caused by a slight slippage in the digitizing pen when the participant moves, inducing a slight mis-localization of the pen tip. Such minor errors are difficult to identify on the fly, particularly when the head being digitized is on the body of a squirmy child. To combat errors in mislocalization of points, we developed a package for the R language (https://www. r-project. org/), digitizeR (www. github. com/samhforbes/digitizeR), which takes digitized input from multiple participants for a given head size, creates a digitization template, and identifies and fixes mis-localization errors in individual caps.
In particular, once collected, the digitizations for each participant can be read into digitizeR by cap size. For ease of visualizing caps as they change, we also recommend RStudio. The digitizeR package will read in the Polhemus output files (saved in ASCII text format) and create a list for each cap size. Next, digitizeR finds the best caps to align the other caps to for each cap size. This is done using the Kabsch algorithm,  18  a method of finding the optimal rotation between two matrices to reduce the root mean squared deviation. DigitizeR uses this algorithm to align each cap to all the other caps in that size. Since every digitization runs the risk of participant movement throwing off the values for any given point (or the entire cap), each cap is rotated to match every other cap. The assumption here is that all the caps that were digitized well will all align with each other, and the caps that were digitized poorly will fail to align.
In this paper, we used the three-step method which uses the R function threestep_alignment(), although the best approach may be dependent on the types of errors being seen in the data. In the case of our dataset, we wanted to minimize the number of points we were replacing while ensuring our caps were as correct as possible. While some trial and error can be necessary to determine the best distances for the caps at hand, the three-point method is a good option for this purpose. The points that were removed as part of this procedure are then filled in with the equivalent point from the template once the cap is aligned to make a complete cap that is aligned in the same space as the template cap. We tested the three-step method by taking two templates, loading them in as caps and moving the first point [the landmark nasion (NZ)] much further away from the other points.
Preparing for Use with Homer2/ Homer3 The final versions of the digitized caps after alignment to the template can be saved and exported from R using the built-in functions from the digitizeR package. The save_caps option automatically saves each of the caps in its own folder as a digpts. txt file, saved in the format that is necessary for Homer2/Homer 3, which includes reference, source, or detector labels for each point. In addition, the caps are converted by default to distances in millimeters (from centimeters), making them automatically ready to use for import into Homer2 or Homer3. Full documentation for any of the digitizeR functions can be found at www. github. com/samhforbes/ digitizeR.
In infant scans, we have found improved performance with the ROBEX-based brain mask. For details on using these functions, we can see the instruction guide available at https://github. com/developmentaldynamicslab/MRI-NIRS_Pipeline. The next step of the pipeline is to put the T1 weighted scan into anterior commissure (AC)posterior commissure (PC) alignment. To do this, the brain mask in the prior step is used to extract the brain from the T1-weighted image, which is subsequently aligned with a skullstripped Talairach Atlas image using auto_tlrc command from AFNI. The rigid body transform from the resulting transform is saved and used to reorient the subject T1-weighted scan and brain mask into AC-PC alignment. Next, we pad the image with zeros. This ensures that the surface generated will be closed when imported into AtlasViewer.
The next step is to create the light model that will be used for image reconstruction. As this uses previously described tools,  14  we describe these steps briefly here. We used the AtlasViewerGUI package within Homer2 or Homer3 to project the corrected digitized points for each participant onto the segmented atlas created by cleaning up and segmenting the participant's MRI scan. 2] [23] [24]  Photon migration Monte Carlo simulations with 100 million photons were run to generate sensitivity profiles for each channel and wavelength. In the data presented here, this process was carried out using the high performance computing cluster supported by the Research and Specialist Computing Support service at the University of East Anglia, which enabled the running of simulations for all channels and participants in parallel by utilizing multiple cores.