dataesr/scientific-paragraphs-categorization huggingface dataset:
Reading data MNE supports multiple file formats written by M/EEG hardware vendors. Apart from Neuromag FIF files, which are the default storage format, MNE can natively read multiple other formats ranging for MEG data including 4D Neuroimaging BTI, KIT, and CTF, and for EEG data B/EDF, EGI, and EEGLAB set 2. Despite this heterogeneity of systems, MNE offers a coherent interface to the metadata of the recordings using the so-called measurement info 3. Regardless of the input format, all processed files can be saved as FIF files or in the HDF5 format 4. MNE can handle multimodal data containing different channel types, the most common being magnetometer, gradiometer, EEG, electrooculogram (EOG), electrocardiogram (ECG), and stimulus trigger channels that encode the stimulation paradigm. MNE also supports electromyogram (EMG), stereotactic EEG (sEEG) and electrocorticography (ECoG), functional near-infrared spectroscopy (fNIRS) or miscellaneous (misc) channel types.
Declaring and renaming channel types is a common step in the preparation of M/EEG datasets before analysis. In our case, once the files were read in, some of the channels needed to be renamed and their channel types corrected in the measurement info (see  (Wakeman and Henson, 2015) ): the EEG061 and EEG062 electrodes were set as EOG, EEG063 was set as ECG, and EEG064 was set as a miscellaneous channel type as it was a free-floating electrode. If this step is omitted, some preprocessing functions may fall back to potentially less optimal defaults, for example, using the average of the magnetometers instead of the ECG channel when searching for cardiac events. Neuromag MEG recordings are often preprocessed first using the Signal Space Separation (SSS) method  (Taulu, 2006) , otherwise known as Maxwell filtering.
MEG and EEG data preprocessing The data provided by OpenfMRI  (Poldrack and Gorgolewski, 2017)  already contain files processed using the proprietary Elekta software MaxFilter, which is what we use in our analysis for the sake of reproducibility. However, MNE offers an open source reimplementation and extension of SSS as well. Before running SSS, it is crucial that bad channels are marked, as otherwise SSS may spread the artifacts from the bad channels to all other MEG channels in the data. This step is preferably done manually with visual inspection. When using the MNE implementation of Maxwell filtering, we reused the list of bad channels available from the Elekta MaxFilter logs in the dataset. Results comparing raw data, data processed by Elekta MaxFilter, and data processed by the MNE maxwell filter function are provided in Figure  1.
16, the default filter will adapt the filter length and transition band size based on the cutoff frequencies, as done in the EEGLAB software  (Widmann et al. , 2015; Parks and Burrus, 1987; Ifeachor and Jervis, 2002)   5. Although no default parameters will fit all analysis requirements, MNE chooses parameters that aim to achieve reasonable stop-band attenuation without excessive filter ringing. To illustrate this point, we compare filters across MNE versions using frequency response and impulse response plots in Figure  3. The stop-band attenuation and transition bandwidth in Figure  3A  and Figure  3B  are less restricted in the newer versions, which results in less steep attenuation but also less temporal ringing in the impulse response (see Figures  3C  and D ). It can be seen that the previous default parameters gave rise to stronger filtering artifacts as indicated by higher impulse response amplitudes across the time window.
Epoching In event-related M/EEG studies, a trigger channel (in this data STI101) contains binary-coded trigger pulses to mark the onset/offset of events. These pulses can be automatically extracted from the data during analysis and the values on the trigger channel are mapped to the event IDs. MNE offers the possibility to extract events when the signal in the trigger channel increases, decreases, or both. It also allows the construction of binary masks to facilitate selecting only the desired events. We masked out the higher order bits in the trigger channel when extracting the events as these corresponded to key presses. After extraction, events can be freely manipulated or created as necessary by the user, as they only require i) the sample number, and ii) some integer code relevant for the experiment or analysis.
As a next step, we extracted segments of data from the continuous recording around these events and stored them as single trials, which are also called epochs, in MNE. The Epochs object can store data for multiple events and the user can select a subset of these as epochs[event id] 7. Moreover, MNE offers the possibility for the user to define a hierarchy of events by using tags (similar in flavor to hierarchical event descriptors by Bigdely-Shamlo et al. (  2013 )). This is done using event id which is a dictionary of key-value pairs with keys being the tags separated by a forward slash (/) and values being the trigger codes 8. For the paradigm used in this study we used: At the highest level of hierarchy are 'face' and 'scrambled'. A 'face' can be 'famous' or 'unfamiliar'. And a famous face can be 'first', 'immediate' or 'long' (This distinction between the three categories of famous faces was not used in our analysis).
Source reconstruction The MNE software relies on the FreeSurfer package  (Dale et al. , 1999; Fischl et al. , 1999)  for the processing of anatomical MRI images. This automatic procedure is run using the command recon-all on the T1 MRI of each subject. This provides many useful pieces of information, but the most critical here are the cortical reconstruction (a high resolution triangulation of the interface between the white and the gray matter) and the inner skull surface. For inverse source reconstruction and beamforming, we must first compute the forward solution, often called a gain or lead field matrix. It describes the sensitivity of the sensors to a given set of dipoles  (Mosher et al. , 1999). Computing the gain matrix, which is a linear operator, requires having a so-called source space of dipole locations, a conductor model for the head, and the sensor locations relative to those dipoles.
Head conductivity model MNE can use simple spherical conductor models but when the MRI of subjects are available, the recommended approach is to use a piecewise-constant conductivity model of the head. Tissue conductivities are defined for each region inside and between the segmented interfaces forming the inner skull, outer skull and the outer skin. It corresponds to a so-called three layer model, however a single layer is possible when using only MEG data. The default electrical conductivities used by MNE are 0. 3 S/m for the brain and the scalp, and 0. 006 S/m for the skull, i. e. , the conductivity of the skull is assumed to be 1/50 of that of the brain and the scalp. With such a head model, Maxwell equations are solved with a boundary element model (BEM). In addition to the T1 MRI image, fast low-angle shot (FLASH) images are provided in the present dataset.
Group source reconstruction To analyze data at the group level, some form of data normalization is necessary, whereby data from all subjects is transformed to a common space in a manner that helps compensate for intersubject differences. This procedure, called morphing by the MNE software, exploits the FreeSurfer spherical coordinate system defined for each hemisphere  (Dale et al. , 1999; Fischl et al. , 1999). In our analysis, the data are morphed to the standard FreeSurfer average subject named fsaverage. The morphing procedure is performed in three steps. First, the subsampled data defined on the high resolution surface are spread to neighboring vertices using an isotropic diffusion process. Next, registration is used to interpolate the data on the average surface. And finally, the data defined on the average surface is subsampled to yield the same number of source locations in all subjects (here, 10242 locations per hemisphere).
With these broader insights in mind, we will make an attempt to extract from our analysis practical recommendations that should facilitate future M/EEG analyses. We encourage the reader not to the analysis presented here as a direct justifications for parameter choices used in their analyses, but instead learn the principles underlying the choices made in our examples. The general rule is: assess your options and chose the optimal measure at each processing step, then visualize and automate as much as you can. Practical recommendations: 1. Know your I/O. Make sure to have a clear idea about the meta-data available in your recordings and that the software package knows about relevant auxiliary channels, e. g, stim, EOG, ECG. Use custom MNE functions and other libraries to add quick reading support if I/O for a file-type is not readily supported.
6. Be mindful of non-deterministic steps. To maximize reproducibility, make sure to fix the random initialization of non-deterministic algorithms such as ICA. Not only does it ensure reproducibility, debugging is also easier when the code is deterministic. Prefer automated scripts as opposed to interactive or manual pipelines wherever possible. 7. Keep software versions fixed. In an ideal world, software (and hardware) versions would not matter, as each operation necessary for data analysis should be tested against known results to ensure consistency across platforms and versions. However, this ideal cannot always be met in practice. To limit difficulties, do not change software versions, hardware or operating system versions in the middle of your analysis. Keep in mind that MNE is based on several other pieces of software.
Updating them can have an impact on the outcome of MNE routines. Once data analysis is complete, cross-checking on different platforms or with different software versions can be useful for community feedback and identifying fragile or problematic steps. In order to facilitate the reproduction of all the results presented in this manuscript, all the code used to make the figures in this paper, but also much more, is available at http://mne-tools. github. io/mne-biomag-group-demo/.
thank  Sami Aboud  for discussions on the manuscript and proof-reading. This work was supported by  National Institute of Biomedical Imaging and Bioengineering  grants  5R01EB009048 ,  NIH   R01 MH106174  and  P41RR014075 ,  National Institute on Deafness and Other Communication Disorders  fellowship  F32DC012456 ,  NSF  awards  0958669  and  1042134 , the  French National Research Agency  ( ANR-14-NEUC-0002-01 ) and the  European Research Council Starting  Grant  SLAB ERC-YStG-676943.
Each hazard that is identified must be evaluated and classified  4, 5, 7. This process requires a documentation and regulation database, which facilitates the recovery of characteristics and regulations of these dangerous goods. Moreover, there is a need to use a GIS technology to manage, maintain and retrieve geographical data. The Geographic information systems (GIS) are widely used in risk analysis in the transportation of hazardous materials. The GIS models help to quantify and provide better accuracy by analyzing the risk related to various parameters  8. Furthermore, to be able to respond effectively in case of accidents involving hazardous materials, we have to develop different scenarios, in order to anticipate and identify the affected area, by the use of a monitoring module based on GPS and GIS technology in combination with atmospheric dispersion models  22.
It is a publish /subscribe messaging transport, that is an adequate protocol to connect small device to constrained networks  17. It is a many to many communication protocol for passing messages between multiple clients through a central broker, and it uses less power to maintain an open connection, to receive and send messages to them. The Cloud IoT broker server represents the service layer in an IoT infrastructure. It consists of an MQTT broker (Mosquitto broker), MQTT client (Node server), and a data server (Mongodb). Furthermore, embedded into a container docker and based on cloud computing technology, our cloud-IoT broker server can offer two basic services as infrastructures for storage and to deliver information to other microservices  17, 18. First, the monitoring microservice socket is listening to connection, then from the client's side, the number and the vehicle to truck is chosen.
After that, every some seconds the data collection microservice sends vehicle location to the monitoring microservice, which is connected to a database for storing the user information. Moreover, in order to produce a map that combines the location information of vehicle with other data that shows road characteristics displayed in "layers", we use a GIS microservice based on Qgis server. The later also allows the read and the store of a geographical data. For spatial data storage, we use the PostgreSQL and PostGIS extension. The client application was developed using leaflet API to building a mapping javascript application combined with AngularJs framework. This monitoring microservice can be useful for seeing which dangerous materials exist in a given territory and to have a real-time knowledge of the movements of transported materials that can enable possible accident 20.
PhageTerm also provides the orientation of packaging for pac phages, as determined by the strand carrying the significant peak. PhageTerm returns "Multiple" for phages that contain more than one significant peak on the same strand without τ > 0. 35. Phages for which no significant peaks were found might either use a headful packaging mechanism without a preferred packaging site (T4-like), or be Mu-like phages. To differentiate both possibilities, the software computes the number of fragments for which one read matches the host and the other read matches the phage genome for paired-ends, or each side of the same read for single-reads sequencing. Phages in the sample were, on average, fragmented into G/F pieces where F is the average fragment size and G the size of the phage genome. In the case of Mu-like phages, out of G/F phage fragments, two should be hybrid fragments.
Availability and implementation. The PhageTerm software is provided as a command line tool (https://sourceforge. net/projects/phageterm), as a Galaxy Toolshed, and on a Galaxy web server (https://galaxy. pasteur. fr). Phage de novo assembly. To determine the termini of an unknown phage, a first step of de novo assembly was required to obtain a reference sequence. To validate that this assembly step did not alter the result of the software, we assembled the six reference phages (lambda, HK97, T7, P1, T4 and Mu) de novo using SPAdes 21 with standard options. When using a reference assembled de novo one should consider two possible caveats: (i) assemblers frequently introduce mistakes at the edges of contigs due to the presence of low abundance reads that do not correspond to the actual phage sequence.
This usually results in a drop of coverage at the contig ends. In such cases PhageTerm should still be able to call the termini correctly, but we recommend correcting the contig ends when possible. (ii) In the case of phages with terminal repeats, most assemblers will output a contig with a single copy of the repeat, which is the desired input for PhageTerm. Note, however that some assemblers might create a contig with a repeat at each end. In such a case PhageTerm will incorrectly call multiple termini. We tested this hypothesis using the T7 reference genome (NC_001604, Table  S1 ) and the PhageTerm output was "Multiple" on both strands for the two analysis methods. Nucleotide sequence accession numbers. The complete genome sequences of phiCD24-1, phiCD111, phiCD146, phiCD481-1, phiCD505, phiCD506, phiMMP01, and phiMMP03 were deposited in European Nucleotide Archive under the accession no.
LN681534, LN681535, LN681536, LN681538, LN681539, LN681540, LN681541, LN681542. The de novo assemblies performed on reference phage genomes are available at SourceForge (https:// sourceforge. net/projects/phageterm). Phages used in this study are described in Table  S1. The raw reads data of all phages were deposited in sequence read archive (SRA) under the accession number SRP093616 (Table  S2 ).
DTR. Phages with direct terminal repeats are expected to have one significant peak in each orientation, and the forward peak should be to the left of the reverse peak. The region between the peaks should show twice the average sequence coverage (Fig. 2C ). Because of their terminal redundancy, DNA assemblers typically attribute the first base of DTR phages randomly. A typical example of this is phage T7, a Podoviridae that has exact short direct terminal repeats of 160 bases  20. The PhageTerm software was able to determine the exact characteristics of T7: the nature of its termini (Fig. 1B ), the termini positions, and the exact length of its direct terminal repeats (Table  1 ). Headful packaging. Phages using a headful packaging mechanism typically generate a concatemer containing several copies of their genome.
S3 ). This phenomenon is amplified by the fact that the cleavage position of the terminase at pac sites can be imprecise, leading to several possible termini. As an example of this packaging mechanism we re-sequenced phage P1, a promiscuous myophage. PhageTerm was able to determine the exact characteristics of P1: the nature of the termini (Figs  1B  and 2D ), the pac mode of packaging and an estimation of the average number of genome per concatemer (Tables  1  and 2 ). Other phages have been determined to package their genome through a headful packaging mechanism but with no preferred packaging signal. The packaged phage genomes are circularly permuted with random termini. No signal can be recovered for this type of phage. As expected, PhageTerm wasn't able to detect any termini when analysing T4, a Myoviridae phage of E.
PhageTerm results. The PhageTerm software produces a detailed report containing several useful plots (coverage, SPC), a data table, information about termini types, and packaging mode. A sequence file beginning with the identified terminus is also generated and output. Some additional information is also extracted depending on phage characteristics: (i) an estimation of the phage concatemers size (pac phages); (ii) the sequence located between the two termini (cos and DTR). Clostridium difficile Phages. C. difficile is currently the principal cause of antibiotic-induced infectious diarrhoea in humans  25. Most C. difficile isolates analyzed to date carry one or several prophages; however, only a few of the prophages have been fully characterized. The packaging modes of four phages included in this study have been determined experimentally in our laboratory using the ligation-digestion method and were compared with the packaging modes predicted by PhageTerm.
PhageTerm determined that phiCD481-1 and phiCD506 were cos phages, and found 13-nt 3′ overhangs for both phages (Table  S1 ). These phages also showed the expected decrease in coverage between the termini of 3′cos phages (Fig. 2B ). PhiCD146, phiMMP01 and phiMMP03 were found to be pac phages. PhiCD211 was found to have direct terminal repeats of 378 bp. No termini could be detected for phiCD505 and phiCD24-1, which could indicate a T4-like packaging mechanism. Finally, phiCD111 showed an atypical coverage plot, with decreasing coverage after a significant peak at the end of the genome, and another significant peak at another distant position. No packaging mechanism could be assigned to this phage. SRA Phages. To test the versatility and robustness of the PhageTerm software on data generated by others, we have downloaded the raw sequencing data of six phages (T3, T7, HP1, Efm1, Slur09, and PBES-2) from the sequence read archive (SRA).
Among these phages, four have known termini and packaging modes (T7, T3, HP1, and Efm1; detailed in supplementary table  S1 ). PhageTerm was able to identify the correct termini and packaging modes for T3 and T7, along with exact short DTRs of 160 and 231 bases, respectively. For phage Efm1 and PBES-2, the PhageTerm software found a 3′ cohesive sequence of nine bases and direct terminal repeats of 443 bases, respectively. User Phages. In the SourceForge deposit (https://sourceforge. net/projects/phageterm), we will also add interesting reports with user's consent. One such example of an interesting report is that of Phi85, due to its long DTR. All PhageTerm results are detailed in Table  2  and reports for all phages mentioned in this paper are available in the SourceForge deposit. Important note on sequencing library preparation methods.
The methods described here rely on the random fragmentation of phage DNA and the availability of DNA termini to adapter ligation. As a consequence, methods that rely on transposases to ligate the adapters, such as Nextera, should not produce suitable data for PhageTerm and similar strategies  26. We confirmed this by analyzing the data of phage HP1 and Slur09 that we retrieved from SRA. These phages were sequenced using Illumina Nextera kits, which led to the loss of the termini sequence. As expected no termini could be detected when using the data generated for these two phages. Transduction. Bacteriophages can also mediate horizontal gene transfer through transduction. During generalized transduction, a small number of viral particles can contain random fragments of host DNA, while during specialized transduction, only host DNA near the site of integration of the phage DNA can be transduced.
In a recent publication by Rashid, J. et al. 27  analyzing termini and packaging of C. difficile phages, researchers inferred packaging mechanism by looking at homologies between the terminase of newly-sequenced phages and that of phages with known packaging mechanisms. This strategy only provides partial and uncertain information about packaging mode and no information on termini type and sequences. Recently, another study made available a procedure to analyze whole genomes, physical ends and packaging strategies of phages using a pre-existing software  28. This procedure can be very time-consuming and contains numerous steps requiring bioinformatic skills, including the installation of the Phamerator program  29  and the management of the related SQL databases. Finally, a concomitant study  30  predicted genome terminus by calculating two criteria, read edge frequencies and neighboring coverage ratio.
Finding these procedures heavy and unwieldy for most phage scientists was that motivated us to develop PhageTerm as an easy-to-use program that consolidates into a single straightforward analysis numerous highly-valuable pieces of information about phage termini and packaging mode. PhageTerm provides a rapid and reliable analysis of NGS data to determine phage termini and packaging mode, as long as sequencing data is generated following two simple rules: (i) random fragmentation should always be used when preparing sequencing libraries, and (ii) paired-end sequencing should be used to obtain a more complete characterization of the termini. Based on our data, PhageTerm outperformed other available phage analysis software by the accuracy of its analyses, its simplicity of its use, and the detailed reports it generates.
Increasing the availability of information on phage termini will shed light on the diversity of packaging mechanisms in nature. PhageTerm will assign termini regardless of whether it corresponds to a known phage packaging mechanism. As such, the software might help in the identification of novel packaging strategies. We encourage scientist community to contact us in the case of such discovery and we will be happy to update the software to better take into account any novel class. Finally, similar approaches should be possible to determine the termini of Archaea and eukaryotic viruses.