dataesr/scientific-paragraphs-categorization huggingface dataset:
4. 1. Moreover, the R10. 3 is only compatible with one sequencing kit, and does not handle methylation detection. We started this work with the basecaller Guppy version 3. 3. 3, the most widely used so far. Recent developments since then mostly concern extensions for improved detection of barcodes, faster runtime, and different environments (e. g. different GPU cards or PromethION instead of MinION). We also considered version 4. 2. 2, the most recent version at the time of writing, which improves accuracy by 1% compared to version 3. 3. 3. We will present the results for this latest release while pointing out the differences with the other one whenever necessary (failing which, the reader can safely assume that the behaviors are the same). We worked on a benchmark of 12 bacterial and two human datasets, sequenced with Nanopore MinION, in order to provide an overview of MinION sequencing errors on both prokaryotes and eukaryotes.
DNA and RNA read datasets We used sets of DNA reads from various bacterial species and two human samples, which had all been sequenced with Nanopore MinION without any prior PCR amplification. This prevents errors due solely to the amplification phase from being considered. Part of the bacterial datasets came from our own sequencing experiments, with the others originating from Wick et al. 2019  [4] , and human sequencing data come from Shafin et al. 2019  [13]. Details about all datasets are presented in Table  1. The associated reference bacterial genomes have various lengths and GC contents. In the remainder of this paper, bacterial species with less (resp. more) than 50% of GC content will be referred as "low (resp. high) GC" species. Experimental dataset. We used sequencing data of Streptococcus thermophilus strains CNRZ1066 and LMD-9 (see Data Availability section).
We used reference genomes that were available on NCBI: NC_006449. KSB2 1B and NUH29), Staphylococcus aureus, Stenotrophomonas maltophilia, Serratia marcescens and Shigella sonnei. All of these datasets were extracted and sequenced as described in  [14]. For each species, a reference genome generated from Illumina reads was also provided (see Data Availability section for fast5 files and reference genomes).
Shafin et al. dataset. We used two human sequencing data: HG002 and HG00733 (see Data Availability section). Details about DNA extraction and sequencing are provided in  [13]. We used the assembly GRCh38. p13 (GenBank assembly accession: GCA_000001405. 28) as reference genome. In addition to DNA sequencing analysis, we conducted a quick analysis of sequencing errors for RNA data. We used sequencing data of direct RNA sequencing Brassica napus Darmor-bzh  [15]. We asked the authors for fast5 files, which we then basecalled with Guppy 4. 2. 2. As reference, we used the corrected version of these reads, also kindly provided by the authors. The mean read length is 691 bp and GC content is 43. 82%. We focused our analysis on DNA sequencing data, thus in the remaining of this paper, we will state explicitly when we refer to RNA sequencing data, failing which the reader can safely consider that we refer to DNA sequencing datasets.
Basecalling and alignment Each dataset was basecalled using Guppy on the fast5 files containing raw signals emitted by nanopores. We used Guppy versions 3. 3. 3 (released on December 10 th 2019) and 4. 2. 2 (released on September 28 th 2020), the latter having a 1% improved modal accuracy compared to the former. Guppy currently provides two main modes: a HAC (High ACcuracy) mode and a FAST mode, which is a simplified version in which the computation time and accuracy are reduced. Note that at present, there does not exist any public repository of these critical software packages and their specifications: all this material can only be accessed through the Nanopore community website, which requires an account (https://community. nanoporetech. com/attachments/3640/download). Although most of the results presented relate to the HAC mode, we used both HAC and FAST, as well as a specific basecalling mode designed to retrieve methylation information (6mA dam and 5mC dcm methylation for bacterial data, 5mC CpG methylation for human data).
Moreover, reads ends are often "soft clipped" by the aligner, meaning that these read portions do not map the reference. We discarded reads for which the total length of soft clips represented more than half of the original read. For each bacterial dataset, we found mostly less than ten occurrences of such highly soft clipped reads. It represents less than 0. 01% of reads (except for S. marcescens dataset for which it represented 5%; around 0. 5% for human datasets). These highly soft clipped regions did not show notably low quality scores, but failed to be fully aligned. Moreover, we found that, although most of these large soft clipped regions that overlap do not align, some do. This suggests that these soft clipped regions might actually represent true variations from the reference genome.
Electrical signal from Fast5 files We analysed the raw electrical signal from Fast5 files of our datasets, and sought for correlations between this signal and the observed errors, in particular exploiting the translocation speed. We used the tool Tombo from ONT (https://github. com/nanoporetech/tombo), more precisely the "resquiggle" algorithm. In a nutshell, it uses the Fast5 files with added basecalled reads (from fastq files) as well as the associated reference genome, to map the signal to the reference genome. Thus we get, for each reference base, an estimation of the signal, i. e. the number and the value (normalized by Tombo) of all sampled electrical current. Knowing the rate at which the electrical is sampled, 4. 000 samples per second according to ONT, we computed the translocation rate, i.
Guppy HAC basecalling mode reduces error rates by about 2% compared to FAST mode We first evaluated the HAC and FAST Guppy basecalling modes, focusing on bacterial datasets. We provide results for both versions, 4. 2. 2 and 3. 3. 3, to show the software's evolution. FAST mode has not improved between the two versions and the difference in error rates between this mode and HAC mode has grown high enough for us to advise against continuing to use FAST mode, especially since the efficiency of HAC has improved and it is now only 2 (instead of 6) times slower than FAST in our measures. For each studied species and both basecalling modes, we computed global error rates (sum of insertions, deletions and substitution errors) on reference-read alignments (Table  2 ). We also provide the median and mean error rate and runtime over all bacterial species.
For HAC mode, the global error rate reaches about 5. 7%, with some variations depending on the species (less than 2% magnitude). We got a similar profile for FAST mode, except that the error rate is about 2% higher. Error rates for human datasets are 6. 6% with HAC and 8. 5% with FAST. In order to check for possible local effects, we also computed error rates (mismatches, insertions and deletions separately) on a sliding window along sequenced genomes (of size 1% the genome length). Fig  1  shows deletion errors, the most frequent ones, in the bacterial datasets using HAC. For each bacterial dataset, reads were aligned to the corresponding reference genome, then for each percent position in the reference genome we computed the mean error rate. The bacterial datasets are here represented as linearized genomes, with the start of the genome set to replication origin, located with Ori-Finder  [20]  from fasta files of reference  genomes.
As mentioned above, it is to be linked with deletion errors. More surprisingly, a slow base translocation is also associated to higher error rate (5 to 10% for speeds below 150 bases per second), this time being mainly associated to insertion errors. For RNA datasets, the global error rate is higher and reaches around 9. 65%. The distribution of error types also differs: there are more deletion errors (51%), less mismatches (27%), and a similar insertion rate (22%) for RNA sequencing data. The mean error rates for FAST are around 0. 7% higher than the mean error rates for HAC. Thus HAC mode is particularly useful. In the previous version of Guppy v3. 3. 3, these differences were not as strong: FAST error rates were about 0. 4% higher. It is worth noting that quality of sequenced raw reads drops at both ends (S1 Fig), around 100 bases, including adapters and part of the DNA/RNA sequence.
These lower quality scores are related to the initiation and termination fragments of the nanopore measurements, for which the signal is probably less stable. These error-prone read sections are generally clipped by the aligner (on average, the first and last 130 bases). For RNA datasets, the quality drop at read ends concerns globally the first 10 bases and last 20 bases, which are also clipped by the aligner. Overall, the global error rate difference is not the sole argument for the genuine improvement represented by HAC mode. For more specific types of errors the improvement may be huge, exceeding 80% for instance for correctly sequenced homopolymers of size 6, which represent more than half of the homopolymers of this size for HAC mode (S2 Fig). All results in the following were obtained using the HAC basecalling mode.
Bias in substitution errors For genotyping of individuals, the study of Single Nucleotide Polymorphism is of great importance and Nanopore sequencing is a promising technology for applications such as forensic profiling  [22] , although it is still imperfect, presenting a higher degree of mismatches than NGS. More detailed knowledge of this type of sequencing errors is essential to help reduce the signal-to-noise ratio between true variations and Nanopore sequencing errors. Transitions are more frequent than transversions. For each dataset studied, we enumerated the twelve possible pairs of substitutions X -Y, X 6 ¼ Y, where X is the nucleotide in the reference genome and Y the corresponding nucleotide in the read (Fig  2A ). We found that, for bacteria as well as for the human dataset, substitutions between A and G occurred about three to five times more often than the transversion error.
After basecalling each dataset in a dedicated methylation mode, reads were aligned against the associated reference genome, and substitution counts were finally established with respect to the predicted methylation status of the base in the read. We compared the substitution error distribution in two cases (Fig 2B ): (1) considering that a cytosine or adenine appears in a normal state in the read, and (2) considering that the substituted base appears methylated in the read. The substitution error profile is quite similar between bacteria and humans for non-methylated bases. The global trend of over-represented transition substitutions is found again for non-methylated bases, but not for methylated ones. Moreover, for methylated bases, the error profile is quite different depending on whether one considers low-or high-GC bacteria.
Low-GC species and reads are globally better sequenced NGS-sequenced data are known to exhibit GC-bias, mostly due to PCR amplification  [24, 25] , causing either GC-rich or AT-rich DNA sequences to have a lower depth of sequencing. Several articles  [26] [27] [28]  have concluded that Nanopore sequencers do not suffer from such bias, as its library preparation does not require a PCR amplification step. In fact, GC content bias is almost always considered in terms of read coverage, but there are other features worth considering. Here we analyze how the GC rate affects sequencing from several perspectives, be it in terms of depth of coverage, quality and/or error rate. We first checked that Nanopore sequencing was indeed free from a bias in depth of coverage. For each bacterial dataset separately, we computed the relative coverage for various %GC values of the genome.
Correlation between error rate and amount of reads Another useful prediction is the proportion of reads that can be expected at a given level of error or quality. Nanopore recommends a minimum threshold of 7 for data quality. We computed the distribution of reads according to their error rate, for thresholds ranging from 7 to 12, for bacterial datasets (S5 Fig). We decided to set the threshold for data quality to 10, as this yields more than 98% of reads below the 10% error rate (in contrast, the minimum threshold retains nearly a quarter of reads with an error rate greater than 10%). We estimated on bacterial datasets that this more realistic threshold corresponds to a more predictable error rate and reduces it globally by about 0. 5 to 2. 5% compared to the minimum threshold (see  Fig 5).
The counterpart is that this leads to a reduction in the number of reads (ranging from 5% to 33% for the most extreme dataset K. pneumoniae KSB2 1B). In fact, between values 7 and 10, the error rate and the amount of reads at this rate are clearly correlated (S6 Fig). It follows a More generally, the distribution of reads according to the error rate (or, equivalently, the quality) is the purpose of Fig 6. Again, we can notice around 1. 5-2% error difference between modes for high-and low-GC bacterial species. Moreover, the results for high-GC species show a more variable but more symmetrical distribution than for low-GC species. The results for Guppy 3. 3. 3 were similar, with a slight error increase.
Error rates were similar for Guppy 3. 3. 3, although about 0. 5% higher. Dinucleotide errors are uniformly distributed but can vary depending on the species considered and its GC content. Overall, the error rate is the lowest for low-GC species, and human data has similar profile to high-GC bacterial species, except for CG heteropolymers for which the error rate is much higher. It seemed that this higher error rate could not be related to CpG regions. Indeed, when we looked at predicted CpG regions (based on UCSC database, see Data Availability section), we found that the error rates of reads parts that aligned to these regions were very close to the global error rates of all human reads (i. e. around 6-8%), and not as high as the 11% observed for CG heteropolymers. We also studied sequencing accuracy for another type of STR, trinucleotide repetitions (2, 3, and 4+ occurrences).
Trinucleotide repeat expansion is a kind of mutation known to be involved in several more or less severe disorders (e. g. myotonic dystrophy or Huntington's disease  [34] ). For the analysis, nucleotides were merged in two groups of complementary base pairs: S (Strong) and W (Weak). We then defined four 3-mers groups, excluding already studied homopolymeric patterns: The distribution of occurrences (Fig  12A ) is quite similar between the different repetition lengths, and trinucleotide repeats are rapidly becoming scarce as their length increases. For each category (low-GC bacteria, high-GC bacteria and human), frequencies are quite even, except for S-only trinucleotides, less abundant in low-GC bacteria and human datasets, and W-only, less abundant in high-GC bacteria. Low-(resp. high-) GC species have less occurrences of S-only and mainly-S (resp.
W-only and mainly-W) trinucleotides, a trend that intensifies with repeat length. Sequencing accuracy results are shown in Fig 12B. Unexpectedly, accuracy for bacterial datasets seems normal, quite constant for the different repeat lengths and close to the global error rates (error rate around 4-6%). For human datasets, trinucleotide repeats are worse sequenced than for bacteria, especially "S-only" and "mainly-S" ones. Overall, for all species, trinucleotides containing more W bases are better sequenced, denoting again a GC bias in sequencing errors. However, one should keep in mind that larger datasets with high proportion of trinucleotides would be necessary to build a more precise profile: the number of occurrences of trinucleotides of size 4 and more is quite low here.
Perfect k-mers Perfectly sequenced k-mers are an interesting concept introduced in NanoOK  [12]. It gives an insight into the actual size of the reads that can be trusted to resolve ambiguities during assembly. For each bacterial dataset, we looked for the longest perfect k-mer in each read, and computed two figures: the ratio of reads in which a perfect k-mer of size at least k is present (Fig 13A ), and the size distribution of the largest window without sequencing errors in a read (Fig 13B ). Both curves show a clear shape. Fig 13A is a sigmoid that is similar for low and high-GC bacteria, with a clear drop between values 150 and 300 for k. Fig 13B corresponds globally to a lognormal distribution of mode 200 with a slightly positive skew. This is compatible with a strong random component in the distribution of errors.
Conclusion Due to the amount of data generated, fast5 files describing the original signal are rarely available for nanopore sequencing. For this reason, we focused mainly in this study on fastq files from two basecallers for which a majority of data are currently available, completing some of the findings with an analysis of the electrical signal. It concerns Guppy version 3. 3. 3 and 4. 2. 2, the most recent one, together with the best chemistry at the time of this study, R9. 4. 1. Since the chemistry changes much slower than the software part, we can only advise to keep the raw signal data because even years later, the evolution of the basecallers allows to significantly improve the accuracy of the read sequences. A comparison between the HAC and FAST basecalling modes of Guppy showed that the former produces more accurate reads, and we also clearly recommend using the HAC version if possible.
The gain is modest at a global level, but accuracy increases significantly for homopolymer sequencing. Recently, ONT announced a soon to come release of a new basecaller called "Bonito", which will enable users to train the basecaller on their own datasets, thereby increasing the sequencing accuracy even further. At the time of writing, Bonito is only released as a beta version. This research has revealed several important features of MinION sequencer's sequencing errors. It is all the more necessary since the technology provider, Oxford Technology Nanopore, communicates little about the precise characteristics of its devices and softwares and does not offer the software it distributes in open source. It includes results concerning RNA direct sequencing. We have first established that the quality score is strongly correlated to the error rate within reads.
thermophilus (CNRZ1066) 1,796,226 39. 08 R9. 4 6,049 330X Own data S. thermophilus (LMD-9) 1,856,368 39. 08 R9. 4 7,332 258X 1 for Streptococcus thermophilus CNRZ1066, NC_008532. 1 for Streptococcus thermophilus LMD-9. Wick et al. dataset. These bacterial data gather sequencing of seven species: Acinetobacter pitii, Haemophilus haemolyticus, Klebsiella pneumoniae (four strains: INF032, INF042, Size and GC content are computed on the reference genome, highest and lowest values are in bold. Mean read length is computed for aligned reads basecalled with Guppy 4. 2. 2 with the HAC mode, and is rounded up to the nearest integer. It is slightly lower (a few hundred bases) than for Guppy 3. 3. 3. Sequencing depth is computed as the sum of all aligned sequenced bases divided by the size of the reference genome.
This weakness could lead to an inappropriate or sub-optimal portfolio selection  [8]. Last but not least, VaR presented another inconvenience: this measure was required to be calculated on a daily basis; nevertheless, banks were required to "update their data sets no less frequently than once every three months and should also reassess them whenever market prices are subject to material changes". In practice, this implied the risk of critical biases on the estimator of the risk measure because of the datasets used for its calibration. Because of all this, the VaR value could provide an inadequate representation of risk because, in addition to not being sub-additive and as such not coherent, it is not adapted for risk allocation (see  [9] ). Coherence makes risk measures useful for risk management.
Distribution Fittings In this section, we briefly introduce parametric fittings; however, as this topic has been extensively discussed in other papers, we will mainly refer to  [27] , who fit various distributions on a risk dataset, such as a lognormal distribution, a generalised hyperbolic distribution or an alpha-stable distribution (among others), and subsequently compute various VaRs and ESs in each case. They demonstrated that the debate between the two types of risk measure is more a debate related to the underlying distributions than of risk measures themselves. Indeed, as demonstrated, given two different underlying distributions fitted on the same dataset, the ES at 99% obtained on a first distribution can be lower than a VaR at 97. 5% obtained on another. The important point to remember considering the matter of interest is that the fitting of parametric distributions defined on infinite support mechanically generates some information beyond the last point of the empirical distribution.
Distribution Mixtures A possible approach for the modelling of events, in particular in the tails, consists in the fitting of a mixture of distributions  [28]  on an historical dataset. Let p 1 (x),. , p n (x) be a finite set of probability density functions, P 1 (x),. , P n (x) the related cumulative distribution functions, w 1 ,. , w n a set of weights (w i ≥ 0 and ∑ n i=1 w i = 1) and some set of parameters θ ∈ Θ (if parametric distributions were to be considered), the distribution mixture density, f , and distribution function, F, can be expressed as follows, F(x; θ) = n ∑ i=1 , w i P i (x; θ), ( 14 ) f (x; θ) = n ∑ i=1 , w i p i (x; θ). ( 15 ) Figure  1  illustrates a mixture model considering Gaussian distributions.
• Expectation Step: Given θ 0 , we compute: L = E θ log L θ (x all ) x observed = n missed × E θ [log f θ (x truncated )] + n ∑ j=1 log f θ (x observed j ) (23) -Estimation of n missing : n missing = n observed 1-P θ 0 (x<u) P θ 0 (x<u) n missing values are drawn from the theoretical distribution of interest, with respect to the constraint x missing < u x all = (x observed , x missing ), where x all is the new set to be considered in the subsequent steps (in other words, the new partially synthesised dataset) -Loglikelihood function computation.
The Generative Adversarial Nets A generative adversarial network (GAN) (  [32, 33] ) is a machine learning environment in which two neural nets, the generator and the discriminator, compete with each other in a zero-sum game. Given a training set, this approach learns to create new data "similar" to those contained in the training set. The generator synthesises candidates while the discriminator assesses them. In summary, the generator intends to fool the discriminator by making it believe that the data have not been artificially created. There are 5 main components to carefully consider in the approach: the original and authentic dataset; the source of entropy, which takes the form of a random noise, fed into the generator; the generator itself, which intends to forge the behaviours of the original dataset; the discriminator which intends to distinguish the generator's output from the initial dataset and the actual "training" loop where we teach the generator to trick the discriminator and the discriminator to beware of the generator.