extfieldsofstudy: Medicine Psychology

text:
Machine Learning Methods for Predicting Postpartum Depression: Scoping Review

Background: Machine learning (ML) offers vigorous statistical and probabilistic techniques that can successfully predict certain clinical conditions using large volumes of data. A review of ML and big data research analytics in maternal depression is pertinent and timely, given the rapid technological developments in recent years. Objective: This study aims to synthesize the literature on ML and big data analytics for maternal mental health, particularly the prediction of postpartum depression (PPD). Methods: We used a scoping review methodology using the Arksey and O’Malley framework to rapidly map research activity in ML for predicting PPD. Two independent researchers searched PsycINFO, PubMed, IEEE Xplore, and the ACM Digital Library in September 2020 to identify relevant publications in the past 12 years. Data were extracted from the articles’ ML model, data type, and study results. Results: A total of 14 studies were identified. All studies reported the use of supervised learning techniques to predict PPD. Support vector machine and random forest were the most commonly used algorithms in addition to Naive Bayes, regression, artificial neural network, decision trees, and XGBoost (Extreme Gradient Boosting). There was considerable heterogeneity in the best-performing ML algorithm across the selected studies. The area under the receiver operating characteristic curve values reported for different algorithms were support vector machine (range 0.78-0.86), random forest method (0.88), XGBoost (0.80), and logistic regression (0.93). Conclusions: ML algorithms can analyze larger data sets and perform more advanced computations, which can significantly improve the detection of PPD at an early stage. Further clinical research collaborations are required to fine-tune ML algorithms for prediction and treatment. ML might become part of evidence-based practice in addition to clinical knowledge and existing research evidence. (JMIR Ment Health 2021;8(11):e29838) doi: 10.2196/29838

Background
Postpartum depression (PPD) is considered one of the most frequent maternal morbidities after delivery, with severe implications for the mother and child. According to the National Institute of Mental Health, United States, 10%-15% of women have maternal depression during and after pregnancy worldwide, whereas in low-and middle-income countries, this percentage could be as high as 18%-25% [1] and seems to depend on the cultural and traditional characteristics of the population [2]. Both the Diagnostic and Statistical Manual of Mental Disorders (DSM-IV) and the International Classification of Diseases (ICD)-10 recognize maternal depression as a mental illness with different classifications [3]. PPD, the most common complication of childbearing, is a term applied to depressive symptoms that occur within 4 weeks of giving birth and possibly as late as 30 weeks postpartum [4]. PPD is a significant public health issue that affects women as well as child's physical and mental health and cognitive and interactive development [5], thus making the child vulnerable to developing psychiatric disorders during adolescence [6]. A depressed mother may not establish a positive relationship with her infant [7], and this may continue to affect children into toddlerhood, preschool years, and beyond [8]. Infants of depressed mothers have shown poor nutrition, poor general health, and more frequent diarrheal episodes, and in extreme cases, maternal suicide and infanticide may occur [9,10]. PPD is generally an overlooked health problem that can lead to serious complications and should be addressed in a timely manner [11].
As there is no single etiology for PPD, a single prevention method or treatment will be ineffective. There is a need for a multifactorial approach combining psychological, psychosocial, and biological predictive factors of PPD to contemplate various etiological factors and individual variations [12,13]. An effective PPD prediction model can help health care providers in the early identification and effective management of at-risk patients [14], with evidence from previous studies exploring this possibility and feasibility [15].
Machine learning (ML) algorithms are broadly grouped into 3 categories: (1) supervised, (2) unsupervised, and (3) semisupervised learning. In supervised learning, data with known labels are used to train a model that can predict the label for new data [16]. ML-based predictive models are gaining popularity for combining a huge amount of data into a single model and evaluating the model's predictive value for previously unseen individuals, for example, at-risk and new patients. ML approaches rely on the use of advanced statistical and probabilistic techniques to construct systems with the ability to automatically learn from data. This enables patterns in data to be more readily and accurately identified and more accurate predictions to be made from data sources (eg, more accurate diagnosis and prognosis) [17]. ML has been used for prediction in psychiatry [18]. ML methods have been successfully used to predict major depressive disorder persistence, chronicity, severity [19], and treatment response [20]. The key to building good ML models is in the rigorous selection of appropriate features and algorithms [17]. Recently, a scoping review of ML application in mental health identified over 190 studies that applied ML in the detection and diagnosis of mental disorders and over 60 studies to predict the progression of mental health problems over time [21]. These studies reported the use of electronic health records (EHRs), mood rating scales, brain imaging data, smartphone monitoring systems, and social media platforms to predict, classify, or subgroup mental health illnesses, including depression, schizophrenia, and suicide ideation and attempts [22]. Two main ML algorithms have been commonly reported in depression prediction studies, namely, support vector machine (SVM) and random forest (RF) algorithms [21]. Depression prediction studies using these 2 methods have achieved relatively good results [23][24][25].
There is an opinion that ML will help mental health practitioners redefine mental illnesses more objectively than is currently done in the Diagnostic and Statistical Manual of Mental Disorders [3] and would help in the early identification of these illnesses to make interventions more effective [22]. Thus, in addition to disease-model refinement, ML may benefit psychiatry by characterizing those at risk and personalizing and discovering pharmacological therapeutics [26,27].
A literature review of ML and big data research analytics in maternal depression is pertinent and timely, given the rapid technological developments in recent years. This review aims to provide a concise snapshot of the literature on ML applications for predicting PPD. Previous reviews have demonstrated ML techniques to be robust and scalable for general depression and mental health, but no review to date has mapped ML applications within maternal mental health research and practice. Our overall aim is to examine the current state of affairs of ML applications in PPD, providing a snapshot of the methods used. Keeping in view the rapid advancements in ML and the recent use of ML in mental health research, we chose to focus specifically on exploring broadly the nature of research activity, as per the first goal of scoping reviews by Arksey and O'Malley [28].

Objective
It is hoped that this scoping review will (1) inform mental health researchers of the methods and applications of ML in the context of prediction of PPD, (2) identify the best-performing algorithm, and (3) identify the evaluation criteria for the best-performing algorithm.

Overview
The Arksey and O'Malley framework was used in addition to methodological improvements for scoping review [28][29][30]. Our methods also align with the PRISMA-ScR (Preferred Reporting Items for Systematic Reviews and Meta-Analyses extension for Scoping Reviews) checklist [31]. A scoping review methodology was chosen to map the body of literature on the use of ML in predicting PPD, including a greater range of study designs and methodologies, to provide a descriptive overview of the reviewed material.

Search Strategy
The search strategy was adapted from Shatte et al [21], which is a similar review of big data applications in mental health. As ML and PPD stretch across interdisciplinary fields, the search was conducted in both health and information technology databases. First, a literature search was conducted using health-related research databases, including PsycINFO and PubMed. Next, the information technology databases IEEE Xplore and the ACM Digital Library were searched. Finally, databases that index both fields, including Scopus and Web of Science, were searched. The search period for relevant studies was conducted in September 2020. The search terms included variations in the terms for the following: The search was conducted on titles, keywords, and abstracts with AND entered into the database search to link different categories (a, b, and c) of search terms. Truncation symbols ( * ) were used to search for all possible forms of a search term (Multimedia Appendix 1). Forward reference searching, that is, examining the references cited in these articles, and backward reference searching, that is, reviewing the references cited in these articles, were applied to identify further studies that met the inclusion criteria.

Study Selection
Articles were included and excluded (Textbox 1) in the review if the following criteria were met. Textbox 1. Inclusion and exclusion criteria.

•
The article reported on a method or application of machine learning (ML) to address postpartum depression only, based on the authors' descriptions of their analyses: if they deemed it ML, the paper was included.
• The article evaluated the performance of the ML algorithm or big data technique used to predict postpartum depression.
• The article was published in a peer-reviewed publication.

•
The article was available in English.

•
The article was published between 2009 and 2021.

Exclusion criteria
• The article did not report ML applications in postpartum depression (eg, the paper commented on the use of ML in diagnosis, treatment, or prognosis of general depression, anxiety, and other mental health issues).

•
The article did not focus on postpartum depression.

•
The full text of the article was not available (eg, conference or abstracts).
• If articles were commentaries and essays. Two reviewers (KS and AFK) independently reviewed all studies and reached a consensus on all included studies after consultation with the third author (ZAB).

Data Extraction and Analysis Plan
For data extraction and analysis, we used the same framework already used in a similar scoping review [32]. For each article, data were extracted regarding (1) overall aim of research, that is, prediction and area of focus, that is, PPD; (2) input data type used; (3) type of ML algorithms used; and (4) the best-performing algorithm, that is, results.
To analyze the data, a narrative review synthesis method [32] was selected to capture the extensive range of research investigating ML and big data for PPD prediction. A meta-analysis was not deemed appropriate, given the aim of identifying research activity in the interdisciplinary field of big data and maternal mental health.

Overview
The search strategies using a combination of search terms identified 1392 articles that included a search term from each category in their abstract or title (PRISMA-ScR flowchart). The range for publication year of relevant articles was 2009-2021. A total of 24 articles were duplicates. A database search was carried out by KS and AFK. Abstracts of 368 articles were read by both authors to perform an initial screening of eligibility for this scoping review. Of these, 347 were excluded because they did not focus specifically on PPD. A total of 21 articles were selected for full-text review, but 3 were conference papers and abstract only, and 4 did not use ML to predict PPD. This resulted in a total sample of 14 studies, including one preprint and one focused on predicting PPD in fathers, which met the inclusion criteria according to all authors ( Figure 1). The selected 14 studies were reviewed in full by 2 authors (including KS and AFK). A mutual consensus was reached after the final approval from ZAB. In the subsequent narrative analysis, we focus on the 14 studies that reported using the ML model to predict PPD (see Tables 1 and 2 for a summary of the main study characteristics).   A narrative synthesis of ML activity, particularly in the context of PPD, indicated the emerging nature of this field, with most studies being published in recent years. Publication dates ranged from 2009 to 2020; however, most articles were very recent. There is a 5-year gap between the first 2009 article [34] and the next study in 2014 [39], and publications have accelerated recently with 7 papers published in 2020.
Few studies have focused on developing and testing an ML algorithm for the detection and prediction of PPD, whereas other studies focused on comparing the effects of different ML algorithms to predict PPD and explore which factors in the model are the most important for PPD prediction.

Type of Input Data
When we examined the 14 studies, we identified a subgroup of 7 studies that reported on the use of ML-based models to predict PPD using clinical or hospital data and EHRs. The other 5 studies reported on the application of ML algorithms for the prediction of PPD using data from social media platforms, including Facebook, Twitter, and Reddit. However, these studies were designed to evaluate a prediction model more broadly and did not report details on ML algorithms, training, and testing procedures. Of the remaining 2 studies, one reported on the use of population data and the other used emotion-aware system data. The outcome variable PPD was assessed using psychometric tools such as Patient Health Questionnaire-9, Patient Health Questionnaire-2, Edinburgh Postnatal Depression Scale, Postpartum Depression Predictors Inventory, and ICD-9 and ICD-10 codes in the case of hospital and EHR data, whereas linguistic features were used to predict PPD from text data of social networks.

Reported Best-Performing Algorithm
There was considerable heterogeneity in the best-performing ML algorithm across the selected studies. To report the best-performance algorithm, most studies used sensitivity, specificity, and area under the curve (AUC). Only 5 studies described the technical approaches to cross-validation using either 5-fold or 10-fold cross-validation. One study reported that of 4 ML algorithms, including Naive Bayes, LR, SVM, and ANN, Naive Bayes showed the best balance between sensitivity and specificity as a predictive model for PPD during the first week after delivery according to the G function, with a value of 0.73 [24]. Another study using 6 ML models, including SVM, RF, Naive Bayes, L2-regularized LR, XGBoost, and DT, reported that SVM had the best performance, and the difference across the performance of SVM, L2-regularized LR, RF, Naive Bayes, and XGBoost was minimal, although differences existed with respect to sensitivity and specificity [35]. In total, 9 different ML algorithms, including RF, stochastic gradient boosting, SVM, recursive partitioning and regression trees, Naive Bayes, kNN, LR, and neural network, were used to report the overall classification accuracies of the 9 models ranging from 0.650 (kNN) to 0.791 (RF). The RF method achieved the highest area under the receiver operating characteristic curve (AUROC) value of 0.884, followed by SVM, which achieved the second-best performance with an AUC value of 0.864 [44].
Using the SVM and RF algorithms, the model based on SVM and feature selection RF had the best prediction effects (sensitivity=0.69, AUC=0.78) [36]. Five ML algorithms were trained: RF, DT, XGBoost, regularized LR, and multilayer perceptron. LR with L2 regularization was found to be the best-performing algorithm using data available up to childbirth. The AUC was 0.937 (95% CI 0.912-0.962) and 0.886 (95% CI 0.879-0.893) in hospital data sets, respectively [37]. SVM led to slightly better results in terms of F1 in the validation stage compared with stochastic gradient descent and passive aggressive classifiers [41].
Tortajada et al [34] developed 4 models for predicting PPD using a multilayer perceptron and evaluated them with the geometric mean of accuracies using a hold-out strategy. They reported that the developed models could predict PPD during the first 32 weeks after delivery with high accuracy. A similar study reported that hold-out validation showed that multilayer perceptron outperformed other techniques such as SVM and LR used in one study with 91.7% accuracy for depressive content identification and up to 86.9% accuracy for PPD content prediction [40]. Another study using gradient boosting and elastic net methods reported that the boosted trees algorithm produced the best-performing model, predicting postpartum psychiatric admission in the validation data with good discrimination (AUC 0.80, 95% CI 0.76-0.83) and achieved good calibration. This model outperformed the benchmark LR model and the elastic net model [33]. Natarajan et al [23] reported a successful functional gradient boosting algorithm that demonstrated the potential of ML in predicting PPD.
Hochman et al [38] built a model using XGBoost, an algorithm based on gradient-boosted DTs, and assessed the overall model predictive performance using the AUROC. 95% CIs were estimated using bootstrapping. The prediction model achieved an AUC of 0.712 (95% CI 0.690-0.733), with a sensitivity of 0.349 and a specificity of 0.905 at the 90th percentile risk threshold, identifying PPDs at a rate more than 3 times higher than the overall set (positive and negative predictive values were 0.074 and 0.985, respectively).
After developing a series of statistical models using regression models to predict a mother's likelihood of PPD, the postnatal model performed the best [39]. Predictive models were developed as a series of SVM classifiers using behavior, emotion, linguistic style, and discussion topics as features. The model incorporating behavior and discussion topic features alone yielded greater recall, with 0.77 and 0.82, respectively, which may be useful for screening purposes [42]. A study using hospital data showed that ensemble classifiers represent a leading solution for predicting psychological disorders related to pregnancy [43].
Many studies did not mention which statistical tools were used for analysis; however, most used a variety of software packages in R, SAS, and Python 3. Studies have reported the use of standard libraries available for data preparation (eg, missing variables), a variety of typical ML models, and natural language processing (NLP) analyses (such as topic modeling) included in their standard packages such as R.

Principal Findings
Most of the reviewed studies used supervised classification techniques rather than other ML techniques to predict PPD. This is perhaps indicative of the extensive focus on detection and diagnosis in the literature, which is typically designed using large, retrospective, labeled data sets ideal for classification tasks [45]. All reviewed studies concluded that ML models were effective in predicting PPD, whether clinical data, EHRs, population data, and data from social media platforms. All the studies implied that the ML approach was more beneficial compared with traditional statistical approaches. However, the level of accuracy, sensitivity, or specificity that is considered acceptable varies depending on the aims of the study and the data set. None of the studies explicitly compared the ML performance with other traditional statistical analyses. In all studies, the ML approach aided researchers in answering their research questions.
The results from a cohort study for predicting PPD using hospital data reported that in the case of a small sample size, SVM can avoid overfitting while providing efficient computing time and better prediction results in depression [46,47]. The same study proposed that when the data set is small, SVM is more practical than RF in prediction research for PPD [36]. Several previous studies used the SVM algorithm to make PPD predictions, as SVM is an example of supervised learning that is most commonly used in classification problems. It focuses on minimizing the structural risks within a set of available data [36]. It has significant advantages and performs well in situations with relatively less available sample data [48]. SVM is a classifier that transforms input data into a multidimensional hyperplane using kernels to discriminate between 2 classes [49]. Jiménez-Serrano et al [24] collected data on postpartum women from 7 Spanish hospitals and used the Edinburgh Postnatal Depression Scale score as the outcome indicator to train a PPD prediction model based on SVM. Natarajan et al [23] used social media as a data source, and based on the mental health data of 173 mothers, an SVM-based PPD prediction model was established. De Choudhury [39] developed an SVM model to identify high-risk emotions and behaviors predictive of PPD using the content of Twitter posts. As these studies either target different populations or use different methods to detect the occurrence of PPD, the model prediction effects cannot be easily compared [36].
In contrast, RF models were built using a DT as the basic classifier. RF approaches have high classification accuracy, strong inductive capacity, a simple parameter adjustment process, fast calculation speed, relatively low sensitivity to missing data values, and the ability to output feature importance [50,51]. RF is an ensemble learning method that operates by constructing a multitude of DTs and outputting the class that is voted by a majority of the trees [52], and Shin et al [44] reported RF to be the best-performing algorithm for predicting PPD.
Tortajada et al [34] developed another prediction model for PPD using multilayer perceptron and pruning for pregnant Spanish women using data from 7 Spanish general hospitals from 2003 to 2004. ANNs have a remarkable ability to characterize discriminating patterns and derive meaning from complex and noisy data sets. They have been widely applied in general medicine for the differential diagnosis, classification, prediction of disease, and condition prognosis. For instance, ANNs have been applied to the diagnosis of dementia using clinical data [53] and more recently for predicting Alzheimer disease using mixed effects neural networks [54].
There is a great deal of debate about which ML model evaluation metric is best [55]. Making sense of reported ML evaluation metrics is made even more difficult because different performance parameters often provide conflicting results and the optimal ML algorithm also depends significantly on the composition of the data set [56]. Some reviewed studies reported varying degrees of accuracy and were not always explicitly clear regarding the meaning of the resulting performance metrics. Owing to the negative effects of PPD on mothers and infants [57,58], such as the negative effects on the physical and mental health of mothers, the closeness of the mother-infant bond, and infant development, it is important to have a model with high sensitivity while maintaining a high AUROC value. The selection of indicators for evaluating depression prediction models varies across studies. For example, Natarajan et al [23] and De Choudhury [39] emphasized the accuracy of the model's prediction of PPD. Jiménez-Serrano et al [24] emphasized the sensitivity and specificity of the model. The balance between the two is the geometric mean. The AUROC is also widely used to evaluate the comprehensive performance of a model [23,25].
PPD is a highly prevalent problem but frequently goes undetected, leading to substantial treatment delays [59]. EHRs collect a large number of biometric markers and patient characteristics that could foster the detection of PPD in primary care settings. NLP and ML have the potential to complement clinical practice by categorizing and analyzing data from clinical notes [60]. NLP is a computerized process that analyzes and codes human language into text [61] that ML algorithms can analyze and use to predict outcomes [62]. Advances in technology, such as social media, smartphones, wearables, and neuroimaging, have allowed mental health researchers and clinicians to collect a vast range of data at a rapidly growing rate [63]. ML is a vigorous technique with the ability to analyze these data. A data-driven primary intervention approach using ML and EHR data may be leveraged to reduce the burden of health care providers in identifying PPD risk [37].
In the studies included in our review, individuals experiencing PPD were identified through screening surveys, their public sharing of a diagnosis on social media, Twitter, Facebook, or Reddit, and were distinguishable from control users by patterns in their language and web-based activity [23,40,42]. Automated detection methods may help identify depressed or otherwise at-risk individuals through the large-scale passive monitoring of social media and, in the future, may complement existing screening procedures [64]. Social media data and EHRs both hold the promise of innovating in the maternal mental health domain, particularly when leveraged by ML techniques [21].
Finally, there are some challenges to consider when using ML techniques in mental health applications. ML models are inevitably limited by the quality of the data used to develop the model. As such, ML does not replace other research or analytic approaches; rather, it has the potential to add value to mental health research. Many ML techniques require access to training data sets, which calls for collaboration between researchers and clinicians to maximize the usefulness of the models developed. It is important to highlight that ML might become part of evidence-based practice, in addition to clinical knowledge and existing research evidence. Greater collaboration between mental health researchers and clinicians (eg, for the provision of training data sets and for feedback on the clinical usefulness of ML algorithms) will be needed to continue to advance the applications of ML in mental health. Analyzing big data on clinical outcomes, in addition to genetic, biomedical, behavioral, environmental, and demographic patient characteristics, could help predict maternal depression. EHR databases can provide valuable, real-world, practice-based evidence to support better prediction models for at-risk patients [65]. In this way, ML offers a solution for analyzing idiographic research questions in big data [66].

Limitations
This study has a few limitations. The aim of this scoping review was to provide a snapshot of the research activity in a summarized format while using a systematic search method. In line with the aims of a scoping review, we did not identify specific study designs in advance and did not assess the quality of the included studies [28]. Moreover, because of restrictions in the search methodology, there may be a chance to have missed some relevant articles, for example, broad search terms and the exclusion of nonpeer reviewed literature. This is a common limitation reported in scoping review studies attributed to maintaining a balance between breadth and depth of analysis within a rapid timeframe [67]. This review successfully mapped a cross-section of the literature on the use of ML for PPD prediction and provides a useful synthesis for researchers and clinicians to understand the potential of ML in this field. This study did not examine the effectiveness of individual ML models for predicting PPD. Such research questions would be suitable for future systematic reviews, guided by the framework outlined in our results tables, that is, the effectiveness of specific ML techniques within specific data types for specific clinical applications.

Conclusions
To conclude, the use of ML to predict PPD has revealed exciting advances, particularly in recent years. Compared with traditional statistical methods, ML algorithms are capable of analyzing larger data sets and performing more advanced computations. Overall, it is clear that ML can significantly improve the detection of PPD at an early stage. Research into the applications of ML to identify potential PPD predictors has demonstrated positive results. However, this work is currently limited, and further research is required to identify additional benefits of ML on maternal mental health. ML techniques and the performance of ML models may differ depending on the type, content, and accuracy of the original data; thus, it may be challenging to evaluate the performance of a single model. With ML tools becoming more accessible to researchers and clinicians, it is expected that the field will continue to grow and that novel applications for mental health will follow. Further clinical research collaborations are required to fine-tune ML algorithms for prediction and treatment. As ML algorithms continue to be refined and improved, it might be possible to help clinicians identify maternal mental illnesses at an earlier stage when interventions may be more effective and personalized treatments based on an individual's unique characteristics. Moreover, the current lack of procedural evaluation guidelines leaves many clinicians and researchers in the field with no means to systematically evaluate the claims, maturity, and clinical readiness of an ML study [68].


PerFSeeB: Designing Long High-weight Single Spaced Seeds for Full Sensitivity Alignment with a Given Number of Mismatches

Background: Technical progress in computational hardware allows researchers to use new approaches for sequence alignment problems. A standard procedure is usually based on pre-aligning of short subsequences followed by proper comparison of neighbouring parts. For this purpose index ﬁles are created that store all subsequences (or numbers associated with them) and their positions within a reference sequence. Index ﬁles designed on subsequences of 32–64 symbols for a human reference genome can now be easily stored without any compression even on a budget computer. The main goal now is to choose a combination of symbols (a spaced seed) that will tolerate various mismatches between reference and given sequences. An ideal spaced seed should allow us to ﬁnd all such positions (full sensitivity). By increasing the seed’s weight by one we usually reduce the number of candidate positions fourfold. At the same time longer seeds also reduce the number of signatures to be checked. Results: Several algorithms to assist seed generation are presented. The ﬁrst one allows us to ﬁnd all permitted spaced seeds iteratively. The results obtained with the algorithm show speciﬁc patterns of the seeds of the highest weight. Among the best seeds, there are periodic seeds with a simple relation between the period of a seed, its length and the length of a read. The second algorithm generates blocks for periodic seeds. A list of blocks is found for blocks of up to 50 symbols and up to 9 mismatches. The third algorithm uses those lists to ﬁnd spaced seeds for reads of an arbitrary length. Conclusions: Lists of long high-weight spaced seeds are found and available in Supplementary Materials. The seeds are best in terms of weights compared to seeds from other papers and can usually be applied to shorter reads. Codes for all algorithms are available at https://github.com/vtman/PerFSeeB.

Background
Sequence analysis is used to understand the features, structure, function of organisms. By comparing sequences obtained for well-known and unexplored organisms we may understand the biology of the unexplored ones. Currently, experimental techniques cannot provide us with whole sequences but only with many subsequences that need to be concatenated/merged in some way to form a long sequence. Thus, researchers have to solve a general sequence alignment problem before they can produce any meaningful conclusions related to the biological properties of an organism.
Suppose two long sequences are similar in some way. One sequence (a reference sequence) is known, the other sequence is to be found. For example, as a reference sequence, we may use a human genome sequence (an "averaged" sequence based on data obtained from several persons). We want to know a genome sequence for another person, i.e. a patient with a specific disease. The current hardware for genome sequence allows us to find only chunks of the unknown genome of the "patient". Those chunks (called reads) are usually relatively short (hundreds of base pairs) and may contain errors. We assume that the reference and "patient" sequences are similar, so we may use the reference sequence to align a set of reads accounting for possible mismatches.
The standard procedure is to consider each read and find its possible positions within the reference sequence such that the distance between a given read and a part of the reference sequence is minimal. The distance between two strings x and y was introduced in [1] and can be determined in several ways. We may define a list of elementary operations which convert a source string x into a target string y. Each operation may have a different cost, the distance is then a sum of all costs. If we cannot transform x into y, then the cost is ∞. According to [2], depending on permissible elementary operations the most common distances are: Levenshtein (or edit) distance (insertions, deletions, substitutions are allowed at equal cost of 1; symmetric, i.e. d(x, y) = d(y, x)) [3], Hamming distance (only substitutions, symmetric) [4], episode distance (only insertions, is not symmetric) [5], longest common subsequence distance (insertions and deletions, all costing 1, symmetric) [6].
The similarity between two strings was originally measured using dynamic programming algorithms, see [7,8,9]. However, due to time complexity, the use of these algorithms became impractical for the increased size of data available. While it is natural to position a read in a way to achieve the smallest distance, the found location may not always be the best one. With progress related to sequencing hardware and the amount of data provided the original problem can be simplified as many reads may overlap, so for each position within a reference sequence, there are tens/hundreds of reads that have regions similar to a chosen reference chunk. So, ideally, we need to align reads in such a way that there are fewer discrepancies between each other when aligned. In any case, the initial problem is to find possible candidate positions for each read.
In the late 90s several new algorithms, e.g. BLAST [10,11], appeared based on ideas of filtration and indexing. Short sequence fragments were used. To align a read we require fragments from the read to be also found in a reference sequence. The search is sped up using various indexing, e.g. hash-tables, which may provide a researcher with "false-matching" positions. The fragments were considered as contiguous segments. Once candidate positions based on full matching of contiguous regions are found, algorithms extend regions around the common parts to calculate a similarity score (seed-and-extend approach).
Originally only contiguous fragments were considered, however, in [12] and [13] spaced seeds were introduced. By a seed we mean a vector with all elements from a binary alphabet. We may use a bit-wise representation (1 when a symbol at a given position is taken into account and 0 when it is ignored). We position three sequences with respect to each other (a reference sequence, a read and a seed). To find the distance we consider only those elements of the reference sequence and the read that have 1-element of the seed at the same position. When there is 0-element of the seed, the distance between the corresponding elements of the reference sequence and the read does not contribute to the total distance.
The number of 1s within a seed is called its weight, while the number of all symbols (0s or 1s) gives its length/span. In [12] the most sensitive seed was 111010010100110111. Some spaced seeds for different weights can be found in [14]. The idea of spaced seeds was extended for other problems: vector [15], indel [16], neighbour [17] seeds. In ZOOM software [18] spaced seeds are generated to perform alignment with at most 2 mismatches. In PerM software [19] so-called periodic spaced seeds are used to improve the efficiency of mapping. Fast alignment-free string comparison based on spaced seeds (spaced-words) is discussed in [20].
Later approaches based on multiple seeds were used, e.g. [21,22] (a good review can be found in [23]). Seeds in a multiple seed environment are designed to have less overlap between each other and thus are increasing chances to hit common regions.
Seed design may also deal with a non-binary alphabet. For example, in YASS [24] a three-letter alphabet (#, @, −) is used, where # stands for a nucleotide match, @ is for a match or transition (A ↔ G or C ↔ T mutations) and − is used when we ignore corresponding symbols.
The sensitivity of seeds is usually measured using probabilistic approaches. In this paper, we consider an extreme case of full sensitivity seeds under the assumption that a read has at most n m mismatches. This means that these seeds should allow us to find all candidate positions. Full sensitivity seeds are also known as lossless seeds [25] and were applied to filtration problems. A lossless filtration means that all fragments will be found (in case of lossy filtration we may miss some of them).
For a given length of reads, there are a lot of seeds that can be used for our task. In the general case, a seed of higher weight should provide us with less candidate positions for alignment. As there are 4 symbols for genome alignment problems, then by increasing the weight of seed by one we reduce the number of candidate positions by 4 times. This factor 4 is valid only in the perfect case of discrete uniform distribution when all four symbols A, C, G, T have the same chance to appear at a given position in a sequence and all such events for any two positions are independent. In practice, the factor is smaller, however, this does not change the fact that seeds of higher weight are preferable for alignment problems.
There may be several seeds of the maximum weight. Longer seeds require us to generate and check fewer index/hash values. We observed that most long highweight seeds have a periodic structure. However, this structure is not a perfect one like discussed in [25] where a seed is made of several repetitions of structure A separated by structure B. We have an integer number of repetitions of structure A and a "remainder" of this structure (which is a number of first elements of structure A). The size of a periodic block has a simple relation with lengths of reads and the seed. It is possible to generate those periodic blocks within a reasonable time frame (from a fraction of a second for blocks less than 30 symbols to several hours for cases of 50 symbols).

Problem setup
Suppose there is a reference sequence of length L and we are given a set of shorter sequences (reads) of length n r . For human genome problems L ≈ 3.2 · 10 9 and n r ≈ 100-300. Let there be a seed s of length n s and weight w. Each symbol of sequences is usually either a letter A, C, G, T or a symbol N when the symbol is unknown or specific masking has been applied. For simplicity, we assume that only 4 letters are present. Therefore each symbol can be coded with 2 bits. When a seed is positioned at given elements of the reference sequence or a read, corresponding 1elements select w elements within the sequences. Thus we may form 2w-bit numbers. For a read we get (n r − n s + 1) numbers, for the reference sequence there are (L − n s + 1) ≈ L numbers. Therefore we get a list of pairs ("position", "signature"). We may sort the list by "signature" values. In this way for each 2w-bit "signature" value found of a read, we may obtain a set of positions within the reference sequence having the same "signatures" values.
For human genome problems all positions can be coded with a 32-bit number. Therefore storing the whole list in memory requires L(32 + 2w) bits. If w = 32, then the memory required is 39 GB; for w = 64 we need 64 GB. After the list is sorted by "signature" values we may split it on shorter vectors having the same number of identical bits which can be ignored for the whole vector. For example, a spaced seed of weight 24 provides us with a 24-vector of letters A, C, G, T for a given position within the reference sequence. We may combine all pairs ("position", "signature") in groups having the same 8 letters for "signature", e.g. the first 8 letters. Therefore we may omit those 8 letters in a chosen group and store only the other 24 − 8 = 16 letters. Of course, by varying the number of the same letters in groups, we may increase or decrease the number of such groups. However, it is safe to assume that 8 letters are used, so we reduce storage requirements: L(16 + 2w), i.e. 32 GB for w = 32 and 58 GB for w = 64. This means that index files created for a chosen seed can be easily stored even on a budget computer. In principle, we may create index files for multiple seeds of different weight, however in this paper we focus only on a single seed case.
In many other approaches based on probabilistic ideas quality of seeds generated is based on sensitivity, i.e. the chance that seed will allow us to find all candidate positions within a reference sequence. Here we consider the extreme case and require that a seed allows us to find all positions. On the other hand, we also restrict the matching of two sequences to a specific case. We set a number n m of mismatches and consider full matching when two strings are of the same length and have not more than n m mismatches. Cases of insertions/deletions, transitions/transversions are not considered in this paper and will be discussed in future papers. This approach seems to be a limited one. However, insertions/deletions are very small (but important) fractions among all other cases, thus we may successfully align almost all reads. So, for reads that are not aligned we may 1) use other approaches, e.g. those based on dynamic programming (see X-drop approach to improve performance [26]) or seeds designed to account for other mutations, 2) align the second sequence for paired-end data, 3) align with respect to already pre-aligned other reads not containing insertions/deletions. Thus in this paper, we deal with full sensitivity seeds that allowed us to have not more than n m mismatches.
By increasing the seed's weight we reduce the number of positions within the reference sequence that have identical "signature" values. So, we aim to find seeds of the highest weight possible for reads of given lengths. Several seeds may exist. To choose the best one we pick up seeds of maximum length. In this way, we are reducing the number (n r − n s + 1) of "signatures" generated for each read. Of course, each seed may provide us with a different number of candidate positions within a reference sequence. Therefore we cannot guarantee that a smaller number of "signature" values will provide us with an also smaller number of total candidate positions to be processed compared to a larger number of different "signatures" obtained with a different seed. However, in a general case of pure random sequences, this should be true, i.e. the total number of candidate positions should be proportional to (n r − n s + 1).
The procedure to choose the best seeds is described below. We set a positive integer number w and for a given number of mismatches n m and length n r of reads we check if there are any seeds that have weight w. It is clear that by increasing lengths n r we may increase maximum possible weight of seeds we can generate. However, the maximum weight of seeds may stay constant for a range of n r values. If we have two lengths n r1 and n r2 of reads (n r1 < n r2 ), then all seeds found for (n m , w, n r1 ) triple are also valid seeds for (n m , w, n r2 ). There may be seeds for (n m , w, n r2 ) that are not valid seeds for (n m , w, n r1 ). Therefore there is a higher chance that the longest seeds found for (n m , w, n r1 ) are shorter than the longest seeds found for (n m , w, n r2 ). While it may be good to choose the longest seeds valid for (n m , w, n r2 ), they may not be valid seeds for (n m , w, n r1 ). Therefore, once we have found seeds valid for (n m , w) by increasing value n r iteratively, we stop and choose the longest seeds among them.

Seed validation
Let there be a seed s of length n s . We want to check if the seed meets the full sensitivity requirement for any read of length n r and a given maximum number n m of mismatches. Suppose n m and n r are set. Then we create n m -vector of indices i k , k = 1, 2, . . . , n m such that 1 ≤ i k ≤ n r . By definition, the length of a seed is not greater than the length of a read, n s ≤ n r . We may shift the first element of a seed by δ with respect to the first element of the read. As the last element of the seed should be within the read's elements, then δ can vary from 0 to (n r − n s ). For each value of δ we check that none of 1-elements of the seed shifted by δ has indices i k , k = 1, 2, . . . , n m . If for any possible combination of indices i k , there is at least one value of δ (depending on i k , k = 1, . . . , n m ) the requirement is met, then the seed is a valid seed for given n m and n r . See Figure 1.
Parameter δ has (n r − n s + 1) values. By padding the seed vector with 0-elements from left and right we can form (n r − n s + 1) vectors of length n r . We pad from left and right and the total number of 0-elements to be used for each vector is (n r − n s ). Padding can be performed in any way, however it may be more convenient to have the first element of the seed aligned with the first element of the read for the first vector, the next vectors are just the previous vectors padded by one 0-element from left (see Figure 1). Or we may align the last elements of a seed and read and pad by 0-element from right (see Figure 4).
In any case for a given seed we form (n r −n s +1) vectors of length n r . We generate all possible combinations of i k indices. There are n m indices and we want them all to be different. There are such combinations. If for any of these combinations all (n r − n m + 1) vectors/rows contain at least one 1-element for chosen indices i k , then the seed cannot be used, otherwise, the seed meets the requirements. We want seed validation to be performed as quickly as possible on a modern computer. Therefore we may store each n r -vector as an n r -bit number. It may often be reasonable to pad each vector with 1-elements to a 128-bit number (or several 128-bit numbers). Then SIMD instructions (single instruction, multiple data) can be used to perform comparison or various logical operations. For a given set of indices i k , k = 1, . . . , n m we may create a 128-bit vector V such that all its elements are 1 except i k -th ones which are 0. Then for each row R p , p = 1, . . . , (n r − n m + 1) we check if R p |V equals V (by "|" we mean bitwise logical OR operation). If it is true, then the seed can be used for the given combination of n m indices. In Figure 2 we use examples for Figure 1. For convenience we pad all vectors to 24-vectors (by merging with four 1-elements). For example 1 (i 1 = 7, i 2 = 12) only one row (R 3 ) has met the requirement R p |V = V , therefore for this combination of indices the seed can be used. However, for example 3 (i 1 = 4, i 2 = 13) no row meets the requirement. Therefore, the seed cannot be used for the given combination of indices and, as the result, it cannot provide us with full sensitivity. Only when the procedure is successful for all C nm nr combinations, then the seed is valid. There is an alternative approach to validate seeds. We create n r binary vectors/columns U t , t = 1, . . . , n r , of length (n r − n m + 1), see Figure 3. As before we may also pad them with 1-elements to form numbers of a given length, e.g. 32-, 64or 128-bit numbers. The task is to consider all C nm nr combinations of columns U t and perform logical OR operation, i.e.
and check if the resultant column has all 1-elements (let us call it the saturated vector). Now we try to reduce the number of columns. We may identify the same columns and leave only different ones (10 out of 36 columns are removed in the example in Figure 4). So, as n m = 4 and n r = 36, then instead of C 4 36 = 58905 combinations, we should check only C 4 26 = 14950. The next step is to identify those columns that are subsets of other columns. We denote U k ⊂ U m if U k |U m is U m . This means that all 1-elements of column U k are also 1-elements of U m (however, there may be positions q such that element q of U m is 1-element but element q of U k is 0element). Removing columns that are subsets of other columns allows us to further decrease the number of combinations. For the example in Figure 4 we excluded extra 16 columns, so the total number of combinations is C 4 36−10−16 = C 4 10 = 210, i.e. the number of combinations we need to check is 280 times fewer compared to the original case. Note that similar approaches can be used when we form resultant columns. For instance, we may generate i k indices iteratively. We consider i 1 from 1 to (n r − n m + 1) (as other (n m − 1) indices are to be generated, they all should be different, so i 1 can never be equal to n r ). Then i 2 is from (i 1 + 1) to n r − n m + 2, similarly i 3 is from (i 2 + 1) to (n r − n m + 3), and so on. If U i3 ⊂ (U i1 |U i2 ), then U i3 can be skipped.

Seed expansion
It is agreed that a seed should start and end with 1-element. So, there is only 1 seed of length 1 (1), there is also only 1 seed of length 2 (11), 2 seeds of length 3 (101, 111), 4 seeds of length 4 (1001, 1011, 1101, 1111). Therefore for a read of length n r there are seeds in total. As validation of each seed is also quite time-consuming, we should identify ways to reduce the number of candidate seeds. For example, seed 10001110100100011101 is a valid seed for n r = 30 and n m = 3. Any subset of this seed is also a valid seed (of lower weight). So, 1110100100011101, 100011101001000111, 10001010100100010101 are also valid seeds. Therefore, we can implement the following procedure. Assume we have already found all valid seeds of length less or equal to k. We pad all these seeds with 0-elements from their right ends, so we get vectors of length k. Then we concatenate them with 1-element (also at the right ends of the padded seeds). Before applying the validation procedure we form a seed by removing the first 1-element and all 0-elements from the left end and check that the seed is in the list of valid seeds. For example, an original valid seed was 100111011 (of length 9) and we aim to find valid seeds of length 13, then the extended seed is 1001110110001 and we need to check if 1110110001 is already in the list of valid seeds. Clear that seed is valid if and only if the reverse seed (the order of elements is reversed) is valid. So, seeds 1001110110001 and 1000110111001 are valid (or are not valid) at the same time.

Periodic seeds
The above procedure allows reducing the number of candidate seeds. However, there are still a lot of seeds to be validated, so finding all possible seeds for a read's length of more than 45 is very slow. However, we can observe a very important property. There are almost always periodic seeds such that where T is the size of the periodic block. Such seeds have a whole number n b of these periodic blocks and the "remainder" (the first n d > 0 elements of the block), so n s = n b · T + n d . There may be seeds of different period T for the same length n r of a read. For example, in Figure 5 there are seeds found for n r = 43, n m = 4. The maximum weight is w = 12. We get two pairs of seeds for T = 19, three pairs for T = 17 and one for T = 13.
Note that when such seeds can be found there are often other (shorter) seeds available. There are also several exceptions from the observation. For some values of n r and n m we may have seeds such that (4) is valid for smaller values of n r , e.g. n r − 1, n r − 2. However, there may be cases when the formula is not true for the best seeds. See Table 1. For 80% of read lengths formula (4) is valid for a given value of n r , for 87% is true when smaller n r can be used.
Suppose there is a periodic seed such that n s = n b T + n d and formula (4) is true. We want to check if a seed is a valid one for a given n m , see Figure 6. We need to generate indices j k , k = 1, . . . , n r such that 1 ≤ j k ≤ n r and check if the resultant column U j1 |U j2 | . . . |U nm is the saturated vector. If the seed is valid, then its periodic block should also meet the same requirements. For this purpose, we just choose j k such that (1 + T ) ≤ j k ≤ 2T . Now we assume that the resultant column for the periodic block is not the saturated one for all possible combinations of indices. For any index j k , 1 ≤ j k ≤ n r , we may write down j k = j * k + m · T , where (1 + T ) ≤ j * k ≤ 2T and m is an integer number. Therefore U j k ⊂ U j * k and instead of U j k we may consider U j * k .

Periodic blocks
Validation of a periodic block is done in the way of validation of the whole seed. We just need to generate all possible combinations of indices j k , k = 1, . . . , n m such that 1 ≤ j k ≤ T and check if the resultant column is not the saturated one.
A periodic block is valid if and only if its reverse is valid. We may also perform a cyclic rotation of elements of the block, those new blocks are valid at the same time. As the result, we have groups of 2T periodic blocks of length T (some of them may be identical) that are valid/not valid at the same time. We call them equivalent blocks. Therefore it is enough to consider the validity of only one block. To reduce the number of blocks to be considered we require that the first element is always 0element and the last element is always 1-element. See examples of equivalent blocks generated for a given periodic block in Figure 7. We need a procedure to choose only one block instead of 2T blocks. Of course, for some blocks (e.g. 00101101) there may be cases of identical blocks obtained via reversion/cyclic rotation. By varying indices j k we create patterns of 0-elements. Those patterns should be within the periodic block (or one of the equivalent blocks obtained by cyclic rotation) since there should be a row such the corresponding elements of the chosen columns are all 0-elements. Therefore each periodic block must have a contiguous chunk of n m 0-elements. Therefore when we generate various periodic blocks we may always assume that the first n m elements are 0-elements. To choose one block we pick up the one with the highest number of 0-elements at the beginning. As among blocks obtained for the reverse block, there will also be a block with the maximum number of 0-elements, we need to perform a further comparison. We may count the number of 1-elements in contiguous blocks from the left/right side of the zero-block and choose the block with fewer 1-elements. If the contiguous are the same, then consider neighbouring blocks of 0-elements (and choose the smallest one). We repeat the procedure if it is needed.
As we want to find seeds of maximum weight, it is reasonable to also find periodic blocks of maximum weight. Suppose there are blocks found for weight w. By replacing 1-elements with 0-elements we form periodic blocks of weight (w − 1). However, there may also be blocks of weight (w − 1) that cannot be formed by replacing 1-elements in blocks of weight w. For example, there are 5 blocks for T = 11, n m = 2 and weight w = 7: 00011011111, 00101011111, 00101110111, 00101111011, 00110101111. Block 00010110111 of weight w = 6 cannot be formed from those blocks. Seeds are formed of an integer number of periodic blocks and a "remainder". There is a possibility that the best seeds are formed of blocks of non-maximum weight. However, when we generated seeds of non-maximum weight, they never formed seeds of weight larger than seeds formed from maximum-weight blocks.
All ideas mentioned above allow us to reduce the number of blocks to be validated. It is also possible to parallelise processing, so each CPU thread validates only specific seeds from a pre-generated list. Together with SIMD instructions for validation steps generation of periodic blocks is sped up. It may take less than a second for n r < 35, however, finding periodic blocks for n r ≈ 50 may still take hours as trillions of blocks should be validated.

Forming periodic spaced seeds
The final step of PerFSeeB approach (periodic full sensitivity blocks) is to form spaced seeds of maximum weight. For this purpose, we consider all periodic blocks formed for a given number n m of mismatches. As n s = n b T +n d , n b ≥ 1, 1 ≤ n d < T , and n r = n s + T − 1, then n r = n b T + n d + T − 1 = (n b + 1)T + (n d − 1) ≥ 2T or T ≤ n r /2. For each periodic block we form all equivalent blocks and check if 1) the first symbol of the block is 1-element, 2) n d -th element is also 1-element. In principle, there is no need to consider blocks obtained from the reverse periodic block as the final seed will be a reverse of seeds formed from the original block. Once the seed is formed we count its weight. By processing all periodic blocks we find seeds of maximum weight.

Results
We have written a code to generate the best periodic blocks of size T for a given number n m of mismatches. A user can specify an initial number n 1 of 1-elements in those blocks. If no valid blocks are found for a given n 1 , then the value of n 1 is incremented by one and the procedure restarts until at least one valid block is found. The code was applied for n m values from 2 to 9, and for T values from 10 to 50 (and from 10 to 70 for n m = 2). Maximum weight n 1 and density of best blocks (defined as n 1 /T ) are shown in Table 2.
Note that while values n 1 and ρ tend to increase with the block size, they are not monotonic in general. See examples for n m = 5 and n m = 8 in Figure 8  When all maximum-weight blocks are found for a given range of T , we may find periodic spaced seeds of the maximum weight for any given value of n r . Of course, there may be cases of seeds composed of periodic blocks of different sizes. For example, if the length of reads is n r = 35, the maximum weight of possible seeds is w = 17 and there are seeds formed for blocks of sizes 7, 10, 11, 13, e.g.
• T = 7, n b = 4, n d = 1, b = 1011100, s = 10111001011100101110010111001; • T = 10, n b = 2, n d = 6, b = 1101111000, s = 11011110001101111000110111; • T = 11, n b = 2, n d = 3, b = 11111000110, s = 1111100011011111000110111; • T = 13, n b = 1, n d = 10, b = 1011111011100, s = 10111110111001011111011. For a given length n r of reads, we plot sizes of corresponding periodic blocks, see Figure 9. We see that sizes of best blocks tend to work in a specific range of n r values. Best blocks are often those having peak density values. For example, if n m = 8, the most frequent block sizes are T = 18, 21, 33, 36, 39 (Figure 9), we see peak density values for them in Figure 8. Note that values of T also increase with the length of reads. So, while we can find seeds for any n r , they may not be the densest as there we have not generated periodic blocks for large values of T .
The final goal is to set the weight w of seeds, then find the minimum length of reads that have valid seeds of this weight and choose the longest seeds when several seeds are available. In Table 3 we present examples of these seeds for weights w (multiples of 8). As seeds may be very long we present only periodic blocks, number n b of these blocks and values of "remainders" n d , see Tables 4 and 5. The full list of spaced seeds found for various values of n r and w (n r ≤ 400, w ≤ 320) is in Supplementary Materials. Users can generate their seeds using codes (https://github.com/vtman/PerFSeeB).
We plot weights of the best seeds as a function of reads' length in Figure 10. Based on lemmas in [27], it is possible to show that for a contiguous seed of weight/length q the minimum length of reads when the seeds are valid is K = q(n m + 1), so the ratio is r = q/K → r ∞ = 1 nm+1 when q → ∞. The corresponding values of r ∞ are also shown in Figure 10 (dashed lines). Depending on values of n m and n r the spaced seeds are more dense (per read's length) compared to contiguous seeds by 20-68% (n r = 50), 40-95% (n r = 100), 60-113% (n r = 150), 70-128% (n r = 200).

Discussion
To compare quality of spaced seed generated with PerFSeeB approach we present a list of most popular seeds in Table 6. These seeds are generated for given sensitivity levels. When there were several seeds presented in a paper, we choose a seed obtained for highest sensitivity levels. We may see that the seeds are usually relatively short and of a smaller weight. Unlike PerfSeeB approach, the other algorithms did not usually put any restrictions on the number of mismatches. Several seeds were generated for a multiple-seed approach.
Our goal is to have full sensitivity seeds. Therefore we aim to check how the other seeds work under such requirements. For a given seed and a number of mismatches n m we vary lengths' n r of reads in order to check when the seed is valid. These numbers are provided in Table 7. We may see that seeds generated directly with the extension procedure (usually n r < 45) and seeds generated with PerFSeeB approach (they all called "best" seeds in Table 7) are valid for shorter reads: by approximately 15% for w ≤ 12, by 20% for w = 20, 22 and by 32% for w = 39-46. We have also provided weights of PerFSeeB seeds for lengths n r found for each seed. These weights are usually 30-40% higher compared to the given ones.

Conclusions
PerFSeeB approach proposed in this paper is based on the designing of periodic blocks. Resultant spaced seeds are guaranteed to find all positions within a reference sequence when a given number of mismatches is set. Each periodic seed is an integer number of periodic blocks and a "remainder" (a number of the first symbols of the block). The size of a periodic block is the difference between read's and seed's lengths plus one. This relation is empirical and was observed for seeds generated by iterative extension procedure for reads of length less than 45.
Periodic blocks are found for the number mismatches n m from 2 to 9 and block's length T up to 50 (or 70 for n m = 2). Those blocks can be used to generate spaced seeds required for any given length of reads. The seeds found with PerFSeeB approach might not be of the highest weight for long reads (>200) as longer periodic blocks are needed to be found, however, they definitely meet the requirements. Codes used to generate periodic blocks and final seeds are designed to account for SIMD instructions, can work in a multithreading environment and are publicly available at (https://github.com/vtman/PerFSeeB). While the authors did their best to minimise the number of candidate blocks to be validated, there may be trillions of them to be checked for periods T around 50.

Declarations
Abbreviations Not applicable.
Ethics approval and consent to participate Not applicable.

Consent for publication
Not applicable.

Availability of data and materials
The codes to generate periodic blocks and seeds are publicly available at https://github.com/vtman/PerFSeeB. Figure 1 Checking if a seed is a full sensitivity one for a given length of a read and number of mismatches. Figure 2 Seed validation based on padded rows. When the requirement is met, the row is in green colour, otherwise, in red colour.           Table 7 Minimum lengths of reads required to achieve full sensitivity for a given number nm of mismatches. Minimum lengths found with PerFSeeB approach are in bold. For the found lengths the corresponding weights of seeds generated with the proposed approach are in parentheses.  Figure 1 Checking if a seed is a full sensitivity one for a given length of a read and number of mismatches.

Figure 2
Seed validation based on padded rows. When the requirement is met, the row is in green colour, otherwise, in red colour.

Figure 3
Seed validation based on columns. When the requirement is met, the row is in green colour, otherwise, in red colour. Reducing the number of combinations when checking seed's validity.

Figure 5
All seeds of maximum weight (12) found for reads of length 43, number of mismatches is 4. Flipped seeds are not shown.

Figure 6
A seed is valid only when its periodic block is valid.   Maximum numbers of 1-elements per length of periodic blocks, nm = 5 and nm = 8.

Figure 10
Weights of the best spaced seeds per reads' lengths (solid lines). Maximum ratios for contiguous seeds (dashed lines).

Supplementary Files
This is a list of supplementary les associated with this preprint. Click to download.