Methods for concept recognition (CR) in clinical texts have largely been tested on abstracts or articles from the medical literature. However, texts from electronic health records (EHRs) frequently contain spelling errors, abbreviations, and other nonstandard ways of representing clinical concepts.Here, we present a method inspired by the BLAST algorithm for biosequence alignment that screens texts for potential matches on the basis of matching k-mer counts and scores candidates based on conformance to typical patterns of spelling errors derived from 2.9 million clinical notes. Our method, the Term-BLAST-like alignment tool (TBLAT) leverages a gold standard corpus for typographical errors to implement a sequence alignment-inspired method for efficient entity linkage. We present a comprehensive experimental comparison of TBLAT with five widely used tools. Experimental results show an increase of 10% in recall on scientific publications and 20% increase in recall on EHR records (when compared against the next best method), hence supporting a significant enhancement of the entity linking task. The method can be used stand-alone or as a complement to existing approaches.https://github.com/monarch-initiative/fenominal under the GNU General Public License v3.0.Fenominal is a Java library that implements TBLAT for named CR of Human Phenotype Ontology terms and is available at  Deep phenotyping of patients suspected of or diagnosed with a rare disease (RD) has become standard practice in the last ten years. In this context, deep phenotyping refers to the precise and comprehensive annotation of phenotypic abnormalities in a computer-readable format. Computational deep phenotyping relies on community-curated and -maintained ontologies that support the description of patient phenotype profiles via ontological concepts. The clinical utility of deep phenotyping has been showcased repeatedly over the years, in particular, in data sharing (The Human Phenotype Ontology (HPO) provides the most comprehensive resource for computational deep phenotyping and has become the de facto standard for encoding phenotypes in the RD domain, for both disease definitions as well as patient profiles to aid genomic diagnostics -based methods  have a well-defined linguistic interpretation (e.g. in terms of the root/lemma and part of speech tag) and can both be folded into the token short. The same can be stated for shorter and shortest. Tokens such as shoret or shprt, on the other hand, are more difficult to interpret automatically, although a human would instantly recognize them as common typographical errors of the token short. In this article, we investigate the accuracy of current phenotype CR methods in the presence of typographical errors.This article focuses on a challenge largely ignored or assumed to be implicitly solved by the existing phenotype CR tools—i.e. typographical errors often encountered in real-world clinical settings. Typographical errors can be seen as a subclass of lexical variation in the context of the CR task. They are significantly less structured than standard lexical variation, with the semantics of the tokens being harder to predict and interpret. For example, the tokens The contributions of this article are 3-fold. Firstly, we make available a gold standard corpus for typographical errors with relevance to clinical phenotyping. Secondly, we propose a novel method to perform fast and accurate token-level matching with applications to entity linkage in the presence of typographical errors. The method is conceptually inspired from sequence alignment algorithms—Basic Local Alignment Search Tool (BLAST) —and usesWe present an algorithm for CR of HPO terms in the presence of spelling errors, alternate spellings, partial matches, and altered orderings of the tokens that make up the term.The BLAST finds regions of local similarity between sequences without performing a comprehensive search of every residue against each other. Instead, BLAST uses short word segments to create alignment seeds that are extended if a specified match threshold is exceeded . The HPO version 02–2022 (February 2022) was used, which contains 16 801 terms and 18 999 exact synonyms. For instance, the term “Cataract” (HP:0000518) has five synonyms including “Lens opacity.”The starting point of our investigation was the creation of a gold standard corpus of clinical typographical errors derived from a real-world setting. The foundation of our corpus is represented by a set of 2 692 451 clinical notes collected from multiple individual clinics in a primary care setting in Australia and authored by 22 doctors. Given the heterogeneity of both the environment, as well as of the individual primary care physician practices, the notes did not follow a structured and uniform authoring template. We extracted the notes from the clinics using a data extraction tool available within the general practice medical records software. The same tool, enabled an initial deidentification, by removing personal health identification elements, such as names, addresses, phone numbers, dates of birth, and other government identifiers.https://spacy.io/. This resulted in sentences and a total of 159 236 294 tokens forming them (700 475 of which were unique)—see The deidentified notes were processed using a standard spaCy text processing pipeline (sentence splitter and tokenizer), available at actions:: . All rows consisting of sets of nonidentical tokens were validated by one of the authors (T.G.), who applied a best-judgment call of whether a pair of tokens could represent a realistic typographical error or not. This “gold standard” is used as a basis for all further experiments and is available for download at: https://github.com/monarch-initiative/fenominal.We assumed that a substantial proportion of the token set represented spelling errors or other nonstandard spellings. Therefore, we used the GoogleNews 3 million words and phrases word2vec model  and classified it into one of the six groups described and exemplified below. A 3-mer represents the decomposition of a word into all orderly occurring substrings of length 3, in our case with overlap—e.g. metame or meteta. Example: abnormalabbnormal.“Shift” errors (42.25%) represent a shift to the left or to the right of two out of the three characters in the 3-mer, e.g. tart_r or tar_ar or tarta_. Example: abnormalannormal.“Single replacement” errors (18.9%) denote a replacement of one of the three characters in the 3-mer with another, e.g. tart__ or tar__r or tar_a_. Example: abnormalandnormal.“Double replacement” errors (8.79%) are the same as “single replacement,” however, covering two characters, e.g. tart_a or tara_r. Example: abnormalabdnormal.“Gap shift” (5.63%) model an insertion of a random character in the middle of the 3-mer, e.g. taratr or tartra. Example: abnormalanbormal.“Inversions” (3.02%) are a form of “gap shifts” where two characters in the 3-mer are swapped around, e.g. bnoatr). For example, abnormalitormal.All other errors, denoting random 3-mer transitions, were placed in an “Other” category covering 21.41% of the total number of errors  token, transitioning into another 3-mer, belonging to a typographical error, given the gold standard corpus described in Section 2.3 as background. Below are the steps applied to each row in the gold standard corpus to build the matrix:Inspired conceptually by the method used to construct the PAM (Point Accepted Mutation) and BLOSUM (BLOcks SUbstitution Matrix) substitution matrices that underpin the most widely used approaches in sequence alignment, we built a similar scoring matrix aimed at encoding the probability of one 3-mer, belonging to a “canonical”  [0] abn abn; (ii) [1] bno bnr; (iii) [2] nor nrm; (iv) [3] orm rma; (v) [4] rma malAggregate the frequency of position-based transitions across the entire corpus for all 3-mers contained by “canonical” tokens to all other 3-mers contained by typographical errors. For example, given the pair actions is associated to actions in the gold standard), the identity association was removed when computing the frequencies . Secondly, the 3-mer transitions were computed from left to right—i.e. from the “canonical” token to one of the typographical errors and always driven by the indices of the 3-mers composing the “canonical” token—i.e. 3-mer at index 0 in the “canonical” token against 3-mer at index 0 in the typographical error, 3-mer at index 1 against 3-mer at index 1, and so on. This leads to three possible scenarios, subject to the difference in length between the “canonical” token and the typographical error: all 3-mers in the “canonical” token have a transition into 3-mers in the typographical error if the two have the same length; some 3-mers in the “canonical” token do not have a transition if “canonical” token is longer than the typographical error and vice-versa; and some 3-mers in the typographical error do not have a transition if “canonical” token is shorter than the typographical error.There are a few remarks worth noting. Firstly, while the consolidation described above includes the identical token  usually sums up the values listed in a substitution matrix when considering the comparison between nucleotides or amino acids in a query sequence and sequences in a database. A second component of the score is a gap penalty aimed to penalize noncontiguous alignments between the two sequences.Our method uses the same principles, applied however in a different manner. The alignment score sums up values for 3-mer transitions found between the query and the candidate tokens using the scoring matrix. In addition, it also caters for scenarios when such transitions are missing, while penalizing the lack of coverage for all 3-mers in the candidate token. More concretely, the frequency values of the error types  are used as a penalty in conjunction with identity transition values to fill in areas not covered by the scoring matrix because of the lack of data in the gold corpus.To understand how “close” an alignment is between a query sequence and a sequence retrieved from a background database, algorithms like BLAST recommend interpreting the score by observing its percentile placement in the context of the overall score distribution, which is computed by moving the query sequence in all possible positions against candidate sequences retrieved from the database.We adopted the concept of computing score distributions to support the interpretation of the score by using gold standard listed in abnormal. A maximal alignment score is achieved by summing up all identity state transitions, i.e.:To exemplify the score computation, abn + bno + nor + orm + rma + mal = 0.49 + 0.32 + 0.41 + 0.34 + 0.34 +0.40 = 2.3Similarly, an alignment score computed over a series of random transitions would be:abo + bno + nor + orm + rma + mal = 0.03 + 0.32 + 0.41 + 0.34 + 0.34 + 0.40 = 1.84abnormal, the score distribution ranges from an alignment score of 0.06  to 2.3 .As such, for the token There are two conclusions that can be drawn from the shape of the trends in The actual value of the alignment score cut-off can be deduced using the distributions depicted in fenominal (Fabulous phENOtype MINing ALgorithm) is a Java 17 software library that implements the TBLAT algorithm. fenominal aims to provide a module-based framework to perform HPO CR, with a particular focus on applications in resource-constraint clinical-sensitive environments—i.e. clinical settings where the data can only be accessed inside the organization’s firewall. The package includes a command-line interface that can be used to parse text files. Detailed instructions for use are available. The software is available under the GNU General Public License v3.0 at https://github.com/monarch-initiative/fenominal. fenominal is also available on Maven Central at https://search.maven.org/artifact/org.monarchinitiative.fenominal/fenominal (version 0.7.9 was current at the time of this writing).Doc2HPO —the original corpus, to record a baseline against a perfectly clean set of text entriesGSC+ (typo)—the original corpus with all tokens present in the set of ontology tokens with typographical errors—i.e. the 3858 mentioned in Electronic Health Record (EHR): A set of 100 anonymized clinical notes from Shriners Children’s—corpus named EHR hereafter. We chose to introduce this second corpus in order to diversify both the type of textual entries, as well as the underlying domain. The corpus was manually annotated by T.G. and P.N.R., which led to 1815 annotations using 252 unique HPO concepts. Although smaller in number of documents, the corpus is significantly larger in total number of tokens (59 470), as well as the unique number of tokens (5672), while maintaining a comparable coverage of “canonical” tokens across the HPO annotations (79.9%). The overlap between GSC+ and the EHR corpora was limited—51 unique HPO concepts and 101 unique “canonical” tokens.GenTypo: Finally, the GenTypo corpus was generated from the remainder of 2093 ontology tokens not present in the gold standard token corpus listed in GenTypo was created by systematically introducing shift, single replacement, and inversion typographical errors into each of the 2093 ontology tokens. The number of errors was also increased proportionally with the length of the tokens:for lengths less than 10, we introduce one error,for lengths of 10–17, we introduce three errors,for all other lengths, we introduce four errors.acylglycine in HP:0012073  was used to generate 24 new labels using 24 typographical errors, such as: “Abnormal urinary ackylglycine profile,” “Abnormal urinary acfydlrglycine profile,” or “Abnormal urinary aclgycine profile.” These labels were then used as input text in our experiments discussed in This resulted in a total of 38 108 unique typographical errors. This list was used to systematically replace “canonical” tokens in randomly chosen ontological concepts containing them, which resulted in 38 108 unique ontology labels. For example, the “canonical” token We performed a comprehensive evaluation of our approach, in conjunction with five state-of-the-art HPO CR tools discussed in Section 2.8.1.CR, as a task, is conceptually composed of two parts: boundary detection and entity linkage. Boundary detection refers to finding the spans of text that represent candidate-named entities, while entity linkage—given a target ontology—focuses on finding the best concept that matches the candidate-named entity. The alignment strategy proposed in this article is fit for this second component, and as such, in a practical scenario would require candidates to be provided as input. Consequently, the validation and results discussed here start from a set of potential named entity candidates and record the ability of finding the best matching HPO concept.dysplastic hip joints” was converted to “Dysplastic hip joints.” These were then provided to the tools listed in Section 2.8.1—in addition to ours—as input candidates for matching. All HPO IDs resulted from the annotations produced by the tools were aligned to HPO version 02–2022 using the same procedure as for the GSC+ corpus. Moreover, in order to ensure a fair comparison of the results, the evaluation metrics considered only the children of HP:0000118 , since PhenoTagger was trained to perform CR on this subset of HPO.From a process perspective, we used the text spans corresponding to the manual annotations recorded in the corpora introduced in Section 2.8.2 to create fake sentences—e.g. the text span “To ensure, we record the best performance of the tools, in some cases, we ran several experiments using different forms of the corpora. In particular, we wanted to emphasize the difference made by using the full-text entries versus named entities for approaches relying on BERT models, where the lack of context could negatively influence the annotation outcome. Consequently, as presented in the next section, PhenoTagger and ClinPheno were also run in baseline on the complete abstracts. To be able to produce results with Doc2HPO, we created well-formed sentences. Finally, due to the sensitive nature of the content, the EHR corpus was analyzed only with tools available in offline mode—i.e. PhenoTagger and ClinPheno.We used the standard metrics for evaluating named entity or CR performance: Precision, Recall, and F1. Precision is defined as the ratio between the correctly identified positives (true positives) and all identified positives. Recall is the ratio between the predicted true positives and the actual annotation outcomes produced by the tool. F1 = 2 × Precision × Recall/.As presented in Section 2.8.2, the results listed in Finally, A closer look at the errors produced by our alignment strategy on the typo corpora revealed that 86.2% were the same HPO entries not found by the exact matching approach, which is unsurprising since even a correct alignment would not have led to a correct entity linkage. 1.4% of the errors led to an incorrect alignment, which then led to an incorrect entity linkage. The rest of the 12.4% errors were associated with a lack of or an incorrect alignment, which led to no entity linkage.tugor rigors instead of tumor; spnal spinal instead of renal; rernal renal instead of sternal; reinal renal instead of spinal. Similarly, examples of tokens failed to be aligned included: nsaiss and nagls nails or thrumbs and thumns thumbs. The alignment of longer tokens was affected by the presence of multiple simultaneous types of errors. Examples include: annomaliss and anolamies anomalies. The same patterns were present in the GenTypo corpus evaluation, with the recall achieving a higher value because of the significantly larger diversity of tokens and ontology concepts when compared to the typo corpora. The errors we introduced were also less complex. They were, however, problematic enough to showcase the challenges standard phenotype concept recognizers would to address in a real-world clinical environment.Over 85% of the incorrectly aligned tokens were of length six or less, with single replacement and gap shift errors, combined with the lack of the addition of a single character, dominating the pool. Prominent examples include: In conclusion, the challenges we observed were related to the alignment of short tokens, where every change can have a significant impact, and of long tokens in the presence of complex typographical errors.The results discussed in the previous section show that our alignment strategy is generalizable to unseen tokens, as well as tokens of lengths over 10. While our focus has been on phenotypes and the HPO, in a clinical care context, the algorithm can be similarly employed using other health-related ontologies or subontologies, such as SNOMED CT or ICD. Moreover, its applicability is not limited to symptoms/phenotypes, but rather can be extended to diseases (e.g. Disease Ontology or Orphanet Rare Disease Ontology), drugs (e.g. DrugBank), or interventions —all of which cover medical concepts that are susceptible to typographical errors.As a limitation, it is, however, dependent on the type and number of typographical errors. While we have attempted to classify and describe most types of typographical errors, more than 20% of our corpus remained uncategorized. Most of these entries represent a combination of errors that increase the complexity of the alignment. The length of the target tokens also plays an important role in a successful alignment. Unsurprisingly, shorter tokens were harder to reconcile, due to the small number of 3-mers. Moreover, every character change in the target token leads to a change in at least one 3-mer (if the change occurs at the very beginning of very end) and usually three 3-mers (if the change occurs somewhere else in the token).t, the time complexity associated with computing the alignment score is O(nk), where k is t’s number of 3-mers (i.e. len(t) − 2) and n is the number of candidate ontology concept unigrams. n can be reduced to a worst-case scenario of log(n) subject to the candidate selection strategy, which in practice would be driven by t’s 3-mers.On a different note, the main driver behind the proposed method was the applicability in a clinical setting. Our view on applicability covers two aspects. Firstly, the HPO CR had to perform well in the presence of typographical errors, and as shown in Section 3.2 our alignment strategy delivered satisfactory results. Secondly, most clinical environments are still resource-constrained—e.g. they use desktop PCs or NUCs, which are not equipped for data-intensive tasks. Tools such as PhenoTagger (the state-of-the-art performer) rely on deep learning models and require appropriate resources to run . Our alignment strategy, however, can be coupled with an arbitrary (less resource-intensive) concept recognizer to improve performance on typographical errors without introducing additional computational overhead. The algorithm itself requires a fraction of a single CPU to run and has a memory footprint of 1.2MB for the scoring matrix + The aim of this article was to perform a systematic analysis of the impact of typographical errors on phenotype CR. We have introduced a gold standard of typographical errors collected from a real-world clinical setting and used the corpus to showcase the complexity of the domain. All state-of-the-art tools encountered significant difficulties in dealing with the types of errors populating the gold standard. In addition, we proposed a lightweight bioinformatics-inspired alignment strategy that can be used to augment any of the existing methods and boost their CR performance. The experimental results showed a significant improvement in recall on both an existing corpus, as well as one generated specifically for the purposes of our evaluation.btad716_Supplementary_DataClick here for additional data file.


Several brainstem nuclei have been identified as the primary central nervous system (CNS) source of important monoaminergic ascending fibers including the noradrenergic locus coeruleus, serotonergic dorsal raphe nucleus, and dopaminergic ventral tegmental area. However, due to practical challenges to their study, there is limited data regarding their To evaluate the structural connectivity of the following brainstem nuclei with limbic cortical areas: locus coeruleus, ventral tegmental area, periaqueductal grey, dorsal raphe nucleus, and nucleus tractus solitarius. Additionally, to develop a group average atlas of these limbic brainstem structures to facilitate future analyses.Each nucleus was manually masked from 197 Human Connectome Project (HCP) structural MRI images using FSL software. Probabilistic tractography was performed using FSL's FMRIB Diffusion Toolbox. Connectivity with limbic cortical regions was calculated and compared between brainstem nuclei. Results were aggregated to produce a freely available MNI structural atlas of limbic brainstem structures.A general trend was observed for a high probability of connectivity to the amygdala, hippocampus and DLPFC with relatively lower connectivity to the orbitofrontal cortex, NAc, hippocampus and insula. The locus coeruleus and nucleus tractus solitarius demonstrated significantly greater connectivity to the DLPFC than amygdala while the periaqueductal grey, dorsal raphe nucleus, and ventral tegmental area did not demonstrate a significant difference between these two structures.Monoaminergic and other modulatory nuclei in the brainstem project widely to cortical limbic regions. We describe the structural connectivity across the several key brainstem nuclei theorized to influence emotion, reward, and cognitive functions. An increased understanding of the anatomic basis of the brainstem's role in emotion and other reward-related processing will support targeted neuromodulatary therapies aimed at alleviating the symptoms of neuropsychiatric disorders. Yet, what it lacks in size it makes up for in complexity and a disproportional influence on processes ranging from autonomic functions to arousal and consciousness  the ascending sensory network consisting of the spinothalamic tracts, medial forebrain bundle, nucleus of the tractus solitarius (NTS), parabrachial nuclear complex and thalamic nuclei, (2) the descending motor network consisting of the periaqueductal grey (PAG), caudal raphe nucleus, and locus coeruleus (LC), and (3) the modulatory network with the serotonergic dorsal raphe (DRN), noradrenergic LC, and dopaminergic ventral tegmental area (VTA) , DRN (serotonin), and VTA (dopamine). Additionally, the PAG and NTS serve as inputs or centers of modulation to these monoamine neural networks . Severalvia this method. While there are several automated techniques, most recent attempts have been to mask brainstem nuclei using convolutional neural network-based segmentation, a deep learning image recognition technique, to delineate the substantia nigra  on MRI, manual and automated segmentation. Automated segmentation has been demonstrated to reliably delineate cortical structures  scans from the Human Connectome Project which provided a large dataset with scans acquired in a high resolution allowing for increased accuracy . For each subject, the multi-shell dMRI data were collected with both L/R and R/L phase encodings using the same gradient table, which were then merged into a single copy of multi-shell dMRI data after the correction of distortions with the HCP Preprocessing Pipeline. Average T1w and T2w images were then aligned to MNI space (with 0.7 mm resolution), with 6 degrees of freedom which also aligns with AC-PC line and the inter-hemispheric plane but which does not alter the original size and shape of the brain. Acquisition time was 32 min for T1w scans which the majority of the atlas used here was based on   structural MRI scans using FSLeyes software. The seed masks generated in this fashion included the Locus Coeruleus (LC), Nucleus Tractus Solitarius (NTS), Periaqueductal Grey (PAG), Dorsal Raphe Nucleus (DRN) and Ventral Tegmental Area (VTA).The anatomic boundaries used for each set of masks are described below and shown in boxv command was used to dilate each mask by a factor of 5 followed by an erosion of 5 to ensure edges were smoothed and gaps were filled.After initial masking was completed, the fslmaths th ventricle and the most rostral was the rostral pons. Laterally, the LC was defined to be 3 mm lateral to the midline at the anterior-lateral angle of the 4th ventricle  to derive fractional anisotropy maps for each ROI. The bedpost command was used to generate an estimate of crossing fiber orientation at the level of individual voxels. Then, utilizing a so called “ball and stick” model, we selected 3 sticks and left all other options as default. Importantly, at each voxel, all possible fiber orientations were considered taking into account standard assumptions about uncertainty when computing whether a given set of voxels will be considered to be “in-line” so as to count as a streamline. For more detail on the underlying algorithms please see these references  with modified Euler streaming  per seed and per target for each subject. To produce an overall POC from each seed mask to target, probabilities were averaged across all voxels in each map. We next created a population connectivity map across all 197 subjects. Each of the previously created proj_thresh maps was registered to MNI 1 mm standard space, thresholded at a level of 0.1 and binarized. These maps were then added across all 197 subjects such that each voxel value now represented the number of subjects with connectivity to the target.To calculate the probability of connectivity (POC) between each brainstem seed voxel to each of the 7 cortical and to the other 4 brainstem nuclei targets, we ran the FSL proj_thresh subroutine with a threshold of 1,250 on each probtrackx output. For each voxel in the seed mask with a value above the threshold, http://aws.amazon.com) EC2 instances running in parallel. Each AWS EC2 instance was an r4.large clone of an Amazon Machine Image (AMI) running Ubuntu 14.04 with FSL software version 5.0.10. FSL bedpostx directories for each subject and the probtrackx output files were stored on an Amazon S3 bucket.FSL software was implemented in a distributed fashion using Amazon Web Services  and Prism 8 software from Graphpad (https://www.graphpad.com/).Statistical analysis was carried out using the R software package  running R (version 3.6.3) and the means to each target region were compared with a single factor analysis of variance (ANOVA). A Tukey HSD test was then run to determine statistical significance of the variance in the means.Overall connectivity measurements were obtained by first taking the average of right and left connectivity for each subject specific seed-target relationship and then computing the mean across all subjects.applywarp command and the HCP subject specific nonlinear acpc_dc2standard file. The MNI152 NLIN 2009b T1 0.5 mm brain was used as reference . All other data is available upon request of the corresponding author.Summative images in MNI space are publicly available at: Lead-DBS utilizing an MNI-152 0.5 mm template brain is also showed (Complete results for the average POC for each seed to target relationship is reported in o showed .post-hoc t-test decompositions demonstrated significant (adjusted p<0.05) difference in the POC between each seed and target structure except as noted below. The only other exceptions to this were if the total POC was <0.03 for both structures.Within each seed region, ANOVA with multiple comparisons (ANOVA-MC) and The dorsal raphe nucleus demonstrated average POC to each target as follows: AMY 0.204 , VTA 0.193 , DLPFC 0.189 . However, ANOVA-MC did not demonstrate a significant difference between these structures .The locus coeruleus demonstrated the greatest POC to the DLPFC 0.349 , followed by the AMY 0.273  and Hippocampus 0.150  .The nucleus tractus solitarius showed the greatest POC to the LC 0.260 , followed by the DLPFC 0.257  and the AMY 0.184 . There was no significant difference between NTS-LC and NTS-DLPFC POC .P > 0.99). The third greatest POC was to the hippocampus at 0.157, significantly less than either the AMY (p < 0.001) or the DLPFC (p < 0.001)    .p > 0.05, two way ANOVA with multiple comparison) between the mean laterality for each seed nuclei regardless of which target was selected  and females (n = 101). P > 0.05 for all relations except for the PAG-insula connection with male POC = 0.135 and female POC = 0.154 (P = 0.025).The demographic characteristics of the data set was homogenous by design . The t-tin vivo segmentation of defined brainstem regions of interest in a large cohort of subjects and performed probabilistic tractography between these regions and several limbic target regions of interest in the study of emotion and reward. The seeds selected were the NTS, LC, DRN, VTA, and PAG. These were chosen because of their clinical significance, the importance and wide-ranging effects of their respective neurotransmitters, and their established role in emotion and reward processing. We evaluated the connectivity between each of these seeds individually to a set of limbic processing centers to test the hypothesis of whether there would be a high POC between brainstem nuclei and these regions. Lastly, we aggregated these results into an MNI atlas and have made this publicly available to all interested researchers. This data represents a unique comprehensive in vivo analysis of key brainstem nuclei in a large human population and is also one of the first such studies to examine the relationship of these structures utilizing the Human Connectome Project.In this study, we carried out manual Overall, our connectivity analysis of these five brainstem nuclei supports the role of the brainstem in emotional processing and confirmed our hypothesis that these brainstem nuclei demonstrate structural connectivity with known limbic regions. There is strong evidence that most mammals have analogous experiences to human emotion, even with far less evolved higher cortical centers, indicating that important processing occurs at levels below the cortex Craig, . In ordeEmotions can be thought of as mental representations associated with distinct sensory states with the evolutionary goal of producing relevant behavioral responses in an organism , DLPFC (0.19), hippocampus (0.12), insula (0.08) and OFC (0.07), as well as to brainstem structures such as the NTS (0.12) and VTA (0.19). There was also relatively greater variation between subjects for the DRN than for any other structure analyzed, congruent with prior work on the serotonin system that has shown significant difference across individuals  connectivity. This data supports electrophysiologic work in rats and non-human primates by demonstrating congruent anatomy in humans and supports the notion that a key role of the LC is to mediate attention, possibly through modulatory effects on the DLPFC, a cortical area known to become activated when subjects are asked to attend to specific stimuli  . The NTS is thought to be the main vagal afferent nucleus for “body state information”  . This, combined with relatively low OFC POC (0.07) and a relatively high hippocampus POC (0.17), demonstrates a distinct connectivity pattern to both frontal and temporal lobe structures. The VTA is a potential target for deep brain stimulation as well as other neuromodulation techniques, and it is therefore highly important to consider its connectivity profile , amygdala (0.22), hippocampus (0.17) and NTS (0.14) . InteresThe PAG is a complex, heterogenous group of neurons that interacts with many brain regions and has roles in cardiorespiratory control, pain, fear, anxiety, and goal directed defensive behaviors , consistent with the theory that these two regions encircling the aqueduct are closely linked and involved in the processing of aversive stimuli . While mSeveral attempts have been made to modulate these brainstem regions with varying degrees of success , but should not affect the overall pattern of results for a single nucleis as each nucleus was run through tractography independently. Lastly, our method cannot determine directionality and care should be taken in ascribing any directional connectivity.in vivo 7T high resolution imaging combined with novel methods such as track-density imaging has shown excellent results in delineating subcortical structures such as the thalamus  can be found in the article/SL and AB conceived of the project. AB designed the original algorithm and oversaw all aspects of the projected. SL primarily prepared the manuscript, collected and analyzed the data, and created the figures. MM, AI, MJ, DA, and WW contributed to data acquisition and drafted portions of the manuscript. SH, JA-C, and TK provided review of anatomical accuracy and expertise in interpretation of results as well as review of the final manuscript. AH assisted with figure creation and provided expertise to use the data in the creation of a Lead-DBS atlas. All authors contributed to the article and approved the submitted version.


DNA CpG methylation (CpGm) has proven to be a crucial epigenetic factor in the mammalian gene regulatory system. Assessment of DNA CpG methylation values via whole-genome bisulfite sequencing (WGBS) is, however, computationally extremely demanding.We present FAst MEthylation calling (FAME), the first approach to quantify CpGm values directly from bulk or single-cell WGBS reads without intermediate output files. FAME is very fast but as accurate as standard methods, which first produce BS alignment files before computing CpGm values. We present experiments on bulk and single-cell bisulfite datasets in which we show that data analysis can be significantly sped-up and help addressing the current WGBS analysis bottleneck for large-scale datasets without compromising accuracy.https://github.com/FischerJo/FAME.An implementation of FAME is open source and licensed under GPL-3.0 at  DNA methylation has been shown to be an essential building block of the gene regulatory system  and aberWhile there have been many attempts to speed-up the computation of DNA CpG methylation (CpGm) values, all previous approaches have relied on a two-step procedure. Bisulfite reads are first aligned to the genome and then CpGm values are computed from read alignment files.This separation into two steps creates an unnecessary overhead if the primary interest lies in the CpGm values, which is usually the case for mammalian genomes, as bisulfite alignment files consume large amounts of disk space, imposing extra I/O time and disk resources for the computations. Furthermore, most methods are built around existing read alignment software that was originally developed for traditional DNA read alignment. However, WGBS reads are more difficult to align as read T nucleotides may map to genomic C nucleotides. This not only requires more specialized index structures compared to traditional DNA alignment , but alsBased on how the asymmetric mapping problem is handled, available methods for WGBS read alignment can be classified into reduced alphabet (RA) and bisulfite-aware (BA) mapping approaches. RA mappers exchange C residues to T in all sequences (reads and reference), obtaining a reduced three letter alphabet, such that bisulfite converted cytosines do not count as sequencing errors during mapping. This reduction leads to false positive mappings in the genome  and, henk-mer based index with bitmasks to address converted cytosines , the first BA mapping method with an index that is tailored for the alignment of BS reads with direct computation of CpGm values. Our method is built on a novel data structure that exploits spaced Fast and Accurate MEthylation calling (FAME). Our method consists of two main building blocks, an index structure specifically tailored to model CpGm methylations, and an efficient alignment method that implements asymmetric mapping of read Ts to reference Cs based. We next give a more detailed overview of FAME and then discuss the index and alignment separately.To solve bisulfite-aware WGBS mapping efficiently, we propose k-mer based index structure , mapping spaced k-mers to the MetaCpGs they appear in.For index construction, a given reference genome is segmented into small windows of about 2 kb length, called Meta CpGs (MCpGs). Each MCpG stores the set of CpGs it comprises and their respective genomic location. Every second card see . The hask-mer object belonging to the same MCpG within a hash table cell , as this information is redundant. The second optimization throws out a distinct k-mer that occurs more than a predefined threshold, as such k-mers are likely to belong to repetitive regions. Repetitive genomic regions are problematic during an alignment, as reads stemming from such regions can map to all repeats and hence no unique match can be found. Removing highly repetitive k-mers from the index prevents matching to those repeats, thus avoiding a costly but unsuccessful alignment phase. This further reduces the index size and hence memory requirements. One downside of this approach is that low-quality reads stemming from the flank of a repetitive region might not be matched, as for such reads there might be too few k-mer hits—due to the repetitive k-mer filter and errors in the remaining k-mers—for the correct MCpG to be found. The third optimization introduces a bitmask for all reference k-mers. This bitmask has a 1 for all Ts in the unconverted refence k-mer, i.e. actual Ts in the reference, 0 for all other position in that reference k-mer. For a given read k-mer, we can thus discard reference k-mers if the read k-mer has a C at any positions with a 1 in the corresponding reference bitmask. This allows to reduce the number of false positives by a quick bitmask check already in the candidate retrieval phase.To make the index more efficient, three optimizations are applied to the index. The first optimization, which is lossless, removes all except one With the index structure at hand, we can now efficiently retrieve candidate regions for bisulfite-aware alignment, which is explained in the following section.candidate retrieval, each spaced k-mer of the read is looked up in the index using its hash value provided by ntHash. For each k-mer we, hence, get a collection of MCpGs where this k-mer might occur in. This way we obtain for each read an upper bound on how many of its k-mers are present in each MCpG. By setting a minimal number of k-mer occurrences q in a MCpG, most MCpGs can be excluded from further alignment steps.To align a read to the reference, FAME runs trough three phases compare . In the or a T is present in the read. An example of a bisulfite aware Shift-And automaton is given in In the second phase, similar to previous work , but iniIn the third phase, the unique best hit—if one exists—is used to compute an alignment between the read and the original reference genome at the matching position retrieved from the second phase. Instead of writing out intermediate alignment files, the CpGm counts are updated immediately in the CpG index. FAME applies a Dynamic Programming computation of the Levenshtein distance to find the best alignment between read and the matching subsequence of the reference leveraging banded alignment matrices, with the band width given by the number of errors in the unique best hit.For paired end reads the three phases work analogously, but are applied to both reads enforcing constraints on the matching corresponding to the insert size. We first generate candidate MCpGs for each of the two reads. An additional pruning step can then be applied after the first phase by throwing out all MCpGs of one read that do not have a corresponding MCpG that lies within insert size distance away to the paired read. For our usual 2 kb MCpG windows that means only considering an MCpG of read 1, for which either that same MCpG or one of the adjacent MCpGs are present for read 2, and vice versa. For the second phase, we match all MCpGs of each read and check if there is a unique best match, considering all combinations of match pairs between read 1 and read 2 that are at most insert size bps apart looking at the genomic coordinates of the match.Storing all data in memory allows highly parallel implementation of all three steps and results in fast processing, while the memory consumption is similar to other methods, requiring less memory than Bismark or Segemehl see . FurtherAll alignment phases can naturally be extended to support single cell experiments compare . For thaIn the following, we discuss data generation and preprocessing along with performance metrics used for our evaluation and comparison.p either from P given by the reference CpG. Conversion success rate is set to 99%, which is commonly observed in real WGBS experiments. Cytosines in non-CpG context are methylated with probability 0.01 reflecting real mammalian genomes. Finally, we introduced l errors, where l was drawn from a Poisson with To carry out an evaluation on data with known ground truth, we generate synthetic data resembling high quality WGBS reads. Each synthetic dataset consists of 25 million 100 bp reads sampled uniformly from chromosome 22 of human reference genome hg19. For each CpG in the genome we flip a coin and draw a methylation rate http://www.bioinformatics.babraham.ac.uk/projects/trim_galore/), following the original approach by trim_galore —length 85 —max_n 1 —paired —gzip LNCaP_pooled_1.fastq . gz LNCaP_pooled_2.fastq . gz —o trimmed/In preparation for the comparison on real data, we downloaded the 5 WGBS paired-read datasets of LNCaP cell by For the evaluation, we considered the 841 708 CpG positions out of 843 385 CpGs present on the array, where at least one tool mapped more than 5 WGBS reads. We considered the EPIC derived CpGm values as a baseline for this comparison.trim_galore —paired —clip_R1 6 —clip_R2 6 —gzip —length 90    CELLID_1. fastq . gz CELLID_2. fastq . gzTo test available methods on a recent single-cell dataset, we consider data of induced pluripotent stem cells generated in a study by . We can leverage orthogonal experiments measuring CpG methylation on real data, such as EPIC arrays, to obtain alignment independent methylation rates against which we can evaluate all WGBS estimates. We measure predicted against actual methylation rate in terms of the Root Mean Squared Error (RMSE):where We consider all CpG sites where at least one tool mapped more than 5 reads (considering this CpG as mappable) and set the predicted methylation rate of tools that do not have any mapped reads at this CpG to 0 if the ground truth methylation rate is larger than 0.5, and to 1 if the ground truth methylation rate is smaller than 0.5. This introduces a small penalty if a tool is not able to cover a region during alignment, although it was possible.We have developed FAME as a novel method for the quantification of DNA methylation rates at CpGs directly from bisulfite read data without producing intermediate alignment files . We compWe measure the quality of called methylation rates in terms of Spearman correlation coefficient and the RMSE between predicted and baseline methylation rates. With ground truth methylation rates known for synthetic data, and methylation estimates available from orthogonal experiments for real data, we can thus evaluate each method’s ability to call methylation rates. Furthermore, methylation calls serve as a proxy for read alignment performance, as the methylation calls are good if and only if the alignments are good. Thus, in our evaluation we are not concerned with the issues of typical read alignment evaluations, where ground truth read positions are inherently hard to obtain for real data.in silico data generation described in Section 3. The results for varying filter threshold t—the maximum times a k-mer is allowed to occur in the genome to be considered for the index—and the minimum number of reads q for a MCpG to be considered for alignment are given in t and smaller q the performance worsens but the runtime improves. These parameters provide a natural tradeoff between accuracy and runtime. We settle for default values We first designed a simulation study to determine FAME’s default parameters on an independent synthetic dataset following the Next, we generated synthetic data (25 million reads) sampled from human chromosome 22 resembling WGBS sequencing data (see Section 3). The performance of each tool was measured in terms of the combined runtime of read alignment and methylation calling on the whole genome, as well as quality of methylation calls. The results are given in We observe that FAME yields accurate results, improving on all tested RA mappers and yielding as good results as the most accurate mapper Segemehl. More importantly, FAME is running an order of magnitude faster than Segemehl and Bismark, the most accurate RA and BA approaches in our test, bringing down the computation time from several hours to minutes, whereas the second fastest method gemBS showed poor methylation rate calls.Our results further confirm that BA mappers, such as FAME and Segemehl, yield more accurate methylation rates than RA mappers, which supports the intuition considering the false positive matchings introduced by RA approaches see .In the next experiment, we used real WGBS data (437 million paired reads) from the LNCaP cell line, which were accompanied by EPIC array measurements .To this end, the analysis showed that FAME yields accurate results in a fraction of time of the state-of-the-art. The following analysis is concerned with the scalability of methylation calling to the sequencing yields produced from single cell experiments. A unique feature of FAME is to directly support single cell WGBS datasets, where reads of each cell are aligned, counted, and methylation rates are put out per cell, without additional overhead. We thus investigated the performance on single cell data using a dataset of 192 cells from In the scope of this work, we present a novel method to efficiently quantify CpG methylation from WGBS data and analyse its ability to accurately predict methylation rates on synthetic and real world data in comparison to state-of-the-art methylation callers.To overcome limitations of evaluations that are solely based on mapping efficiency, here we directly evaluate on synthetic data how close the predicted methylation rates are to the ground truth. Thus, any inefficiencies in read mapping, wrongly mapped reads, or mapping biases are captured by this evaluation as they lead to wrong or biased methylation estimates, which otherwise could be missed. While we generated the synthetic data in close resemblance of how reads are actually produced by a sequencing protocol, there might be issues in real world data that are not captured by this dataset. We, hence, compared on real-world data with the same underlying idea, to leverage baseline methylation rates to evaluate the estimation capabilities of the methods at hand. The actual methylation rates of a cell are unknown, yet we can do our best to evaluate on real data taking into account orthogonal experiments of quantification of DNA methylation. Here, we leverage estimates from EPIC arrays as comparison to the WGBS calls of each tool. While not being an actual ground truth, it gives a different view on methylation rates that does not suffer from the issues inherent in the process of read alignments with asymmetric mappings (Overall, both synthetic and real world evaluation matched our expectations that bisulfite aware mapper yield more accurate methylation estimates than tools that use a reduced alphabet for mapping, which is in line with previous findings (k-mers, would be an interesting line of work to be able to deploy FAME on standard laptops.While FAME heavily relies on the special index structure to achieve these fast and accurate estimates, its memory requirement is comparable to gemBS, and less than Bismark and Segemehl . Yet, alMethylation calling is arguably the major application of WGBS alignment methods, yet there are interesting downstream applications such as epiallele calling or cellular deconvolution that require WGBS read alignment information. FAME sacrifices writing out alignment files to increase on speed and reduce hard disk footprint compared to competitive tools, which currently renders FAME inapplicable to those downstream applications that require read-level methylation estimates. As FAME computes an alignment, it would be in principle possible to produce alignment files, but at the cost of breaking highly parallelized algorithmic steps using the index structure, adding runtime for costly IO file writing operations. Hence, further developments would be necessary to allow efficient alignment file generation for these downstream tasks.The introduced conceptual change to estimating CpG methylation without intermediate WGBS alignment files is paralleled by earlier development of methods for expression quantification from RNA-seq data (The focus of our work lies on the estimation of CpG methylation from WGBS data. As such, it is particularly well suited for the analysis of mammalian genomes. While extending to methylation in arbitrary context, e.g. for applications in plant biology, is generally possible, our constructed index would be much larger, forgoing the advantage in speed that our compact index structure provided in this work. For a specific methylation context, such as GpC methylation, our algorithm can easily be transferred. An interesting avenue for future work would thus be an adaption of our algorithm to NOME data by building the index for GpCs instead of CpGs. Hence, we could use FAME to get open chromatin calls from NOME-seq experiments (btad386_Supplementary_DataClick here for additional data file.


Comprehensive two-dimensional gas chromatography coupled with mass spectrometry (GC × GC–MS) has great potential for analyses of complicated mixtures and sample matrices, due to its separation power and possible high resolution. The second component of the measurement results, the mass spectra, is reproducible. However, the reproducibility of two-dimensional chromatography is affected by many factors and makes the evaluation of long-term experiments or cross-laboratory collaborations complicated. This paper presents a new open-source data alignment tool to tackle the problem of retention time shifts — with 5 different algorithms implemented: BiPACE 2D, DISCO, MSort, PAM, and TNT-DA, along with Pearson’s correlation and dot product as optional methods for mass spectra comparison. The implemented data alignment algorithms and their variations were tested on real samples to demonstrate the functionality of the presented tool. The suitability of each implemented algorithm for significantly/non-significantly shifted data was discussed on the basis of the results obtained. For the evaluation of the “goodness” of the alignment, Kolmogorov–Smirnov test values were calculated, and comparison graphs were generated. The DA_2DChrom is available online with its documentation, fully open-sourced, and the user can use the tool without the need of uploading their data to external third-party servers.The online version contains supplementary material available at 10.1007/s00216-023-04679-7. Two-dimensional comprehensive gas chromatography coupled with mass spectrometry (GC × GC–MS)  is a powTo demonstrate such situation when these obstacles come in play, we have used our research of human scent as an example. The data collection spreads over a 2-year span. During this time, various maintenances occurred causing different time shifts. Since the research is focused on non-target analysis, a special library of identified chemical compound had been developed. This library is based on one of the algorithms discussed later in this paper (MSort) and, ideally, should keep special codenames for each detected chemical compound. Without proper data alignment, the risk that compounds in the measured chromatograms may be labelled with the wrong codename (or one compound could have many such codenames) is significantly higher. These errors are hard to detect in later stages of data processing such as statistical analysis — thus, they are propagated into the later stages of data processing.There are commercial software programmes available to help overcome the problem of retention time shifts; the time correction tool is sometimes part of the official software supplied by the instrumentation manufacturer. However, these programmes are often patented, or their core code is protected by other means, making such software one of the “black box” steps involved in data treatment. This paper introduces an open-source tool to alter these commercial options and aims to contribute to the open-science effort in a field of GC × GC–MS data processing automation.Data alignment algorithms discussed in this paper can be divided into two groups: those with spectral dependency and those without spectral dependency. Algorithms without spectral dependency are suitable for GC × GC-FID  application because they work only with the peak coordinates . Coherent point drift (CPD) , 3 fits There are semi-automatic alignment algorithms without spectral dependencies , 8 that n × m, n dimension corresponds to the number of peaks in the aligned chromatogram, the m dimension corresponds to referential chromatogram) is then scored as a sum of the “match”/ “mismatch”/ “gap” rule and the value of the previous cell. Then, it traces back, from the end cell with the highest score, the path with the highest scoring values, which is the resulting “aligning” path  is the spectral similarity of the compared peaks; the exponential members of the equation take the squared difference between the retention times for the first and second dimension divided by tolerance parameters D. The higher the D value, the greater the time differences between the peaks tolerated. The exponential terms are called retention time (RT) penalty terms, and the user can assign an additional threshold parameters T1 and T2 and thus apply a search window discrimination to the peak comparison. The algorithm creates Best Bidirectional Hits tables (or maps) where the strength of the anchor point  is expressed as a count of connections to the other members of the specific anchor point cluster . DISCO [z scores (Fisher transformation). Then, X nearest peaks  from the referential chromatograms are compared to the inspected peak from the aligned chromatogram. If the spectral comparison exceeds the critical threshold, the inspected peak is marked as the anchor point. The overall execution of the alignment starts with a randomly picked chromatogram as the referential table of the anchor peaks. Through the iteration over all aligned chromatograms, anchor peaks which are not found in all samples are dropped, and the final referential table is a list of peaks found in every member of the aligned dataset. The alignment itself is done by a linear fitting method. MSort [w is weight parameter, Dd is the distance between the two compared peaks  and S is the spectral similarity of the two compared peaks. To speed up the calculation process, we added a similarity threshold parameter. If the spectral similarity of the two compared peaks does not exceed the threshold, the rest of the calculation is skipped. Based on the obtained results, the new variation of previously discussed algorithms was proposed — the non-targeted data alignment (TNT-DA) — see the Experimental section.Robinson et al.  altered ). DISCO  identifid. MSort  has a std. MSort  has no sd. MSort 2\documenAs all tested algorithms  were of the spectral dependant family, the final DA-2D_Chrom tool  providesThe main motivation of this experiment was to develop open-source alignment tool with multiple algorithms implemented in ready-to-deploy state. The tool was then used for the peak alignment of real human scent samples acquired by a non-target analysis approach and evaluated the potential of algorithms previously described in various studies. In the following paragraphs, all implemented data alignment and spectral comparison methods are tested and compared using DA_2DChrom. First, all implemented algorithms are used for data alignment of small sample set . The datAll human scent samples were acquired with the same methodology and measured under the same settings. Both steps were described in our previous work , a detaiIn total, samples from 40 volunteers  through all three system conditions were processed. The samples are named in a uniform way — first letter represents a biological sex of the volunteer, the following number is the ID of the volunteer in a database, and after the underscore, the ID of the sampling session follows. BiPACE 2D, DISCO, MSort, PAM, Smith–Waterman, TNT-DA, and additionally the modified anchor point algorithm were tested with multiple parameters if possible. In some cases, algorithms were modified (see following sections). Note that the modified anchor point algorithm was not tested on all 503 chromatograms, as finding the best automated solution was the main objective of this study.Find anchor peaks). Sample system_1_M13_4 was set as a referential chromatogram and the rest of the 19 samples were aligned, one by one, to the referential chromatogram. Each alignment process executed the following steps:To minimize the differences between algorithm executions, the new data alignment tool DA_2DCHROM  was desiFind anchor peaks → Check elution order → Export anchor points → Retention time shift correction → Export peak map → Export time corrected chromatogram.Find anchor peaks) are summed up in Table The selection rules and tuneable parameters for the alignment tool  test , 21. It m/z values are representing relative abundance of the m/z fragment in the obtained spectrum. Please, see the dataset Readme file. All calculations were performed on a common workstation .All results  discussed in the section “The following sections demonstrate the impact of switching between alignment algorithms and tuning of their parameters while using the introduced open-source data alignment tool. As the development of the 2D_Chrom involved lot of testing and visualizations of failed experiments, the main pitfall of automated data alignment algorithms was inspected — misidentification of the anchor peaks. The symptoms and solutions of this phenomenon are discussed in following paragraphs.The least demanding algorithm was a modified anchor point (RI). The execution of data alignment of one sample took less than 1 s. However, it took approximately 15–20 min to identify, mark, and export anchor peaks. Algorithms with a “search” window  took the same amount of time (15–20 min) for one sample. The PAM algorithm was slightly slower, and the execution of one sample took around 40 min to 1 h. The reason of lower time efficiency is the fact that PAM algorithm has no search window, or any other discrimination step; thus all peaks are compared against each other. The execution of the Smith–Waterman algorithm was counted in hours and exhibited severe misalignments while processing chromatograms with fewer peak counts, thus being left out of further testing.For DISCO, MSort, BiPACE 2D, and PAM, “alignment artefacts” appeared. They can be described as horizontal or vertical lines formed by misplaced aligned points . Second, a denser area along the alignment artefact lines distorted the resulting distributions. Considering the previous points, all alignment experiments were additionally visually checked for the performance evaluation.T1 and T2 were both set to value 0.99. D1 (threshold for time delta in the first dimension) was tested at levels 10, 50, and 100 in combination with D2 (threshold for time delta in the second dimension) values 0.25, 0.5, and 0.8. Performance improved with increasing S/N (100 <  < 300 < 500) and the D1 parameter. Even with the alignment of the highest D2 value (0.8), the alignment of the data in the second dimension was not sufficient, especially with second dimension retention times y > 4 s. For DISCO, the performance improved with increasing spectral similarity (30% <  < 80% < 90%) and with increasing S/N. MSort proved to be sensitive to user input (search window boundaries). The correctness of the alignment was raised with broader boundaries  and a higher threshold of similarity of the mass spectra. However, the user must set the boundaries with respect to distances between spectrally similar elution areas (in second dimension) or members of homologous series (in first dimension) to avoid anchoring on the wrong peaks. The PAM algorithm is rather time-consuming but, on the other hand, less discriminating than other inspected algorithms. Its sensitivity to various time shifts could be managed through the preference of spectral similarity  without any processing time trade-off. The value of w = 0.8 yielded the best results when considering the alignment in both dimensions.BiPACE 2D was tested with a different parameter configuration. Cut-off values m/z fragments and the other with characteristic masses (236 etc.) as base fragments (fragments with the highest intensity). As all the tested algorithms rely on the mass spectra reproducibility, the variations in spectra lead to the processing errors .All algorithms had one thing in common, their performance improved with a rising S/N. This could be caused by improper peak deconvolution done by software used for peak detection and data export. For fully separated peaks, the level of S/N does not impact the correctness of the presented mass spectra. Compared to that, the coelution of peaks caused disjunction of spectra because of wrong deconvolution. The most common example in the presented samples are higher ethyl esters of fatty acids and their saturated and non-saturated pairs, which were coeluting heavily. With lower S/N ratios, there were more than 4 peaks detected instead of two. The real peaks were often split into two “peaks”, one with spectrum containing lower Check elution order. When this step was left out of the alignment procedure, the number of anchor peak identification errors (mainly for mass similarity thresholds 30 and 80%) was dramatically higher  compared to the situation with this step involved. For example, for mass similarity > 30%, there were hundreds of detected anchor peaks for each chromatogram. However, with the check step on, the count of the anchor peaks seldomly reached over 150. At the early stages of the DA_2DChrom, the elution check was performed separately for the 1st dimension and the 2nd dimension. This approach, however, had issues while dealing with the peaks with the same retention times in one of the dimensions. Thus, the implemented elution check checks on the elution order with respect to the total elution time (sum of the retention times from both dimensions).For the complete commentary on the performance of all implemented algorithms, every algorithm and its parameter tuning were, in fact, tested twice. The final DA_2DChrom tool contains step In terms of data alignment, the modified anchor point algorithm (based on retention indices) outperformed other algorithms. There are two possible outcomes of this finding: first, when the user is dealing with a reasonable count of complicated samples, human processing time should be an acceptable trade-off for the algorithm performance. Second, if the user is familiar with the structure and common pattern in aligned chromatographs, there is a possibility to write a list of selection rules  for finding such anchor peaks automatically, which might be a very challenging task. For the completion of the study, the modified anchor point algorithm was used as a pre-process alignment, and all other algorithms were applied on the transformed dataset.Figure The pre-align step led to higher processing times of all algorithms (except PAM). Surprisingly, the performance of BiPACE 2D and DISCO was worse than without the pre-align step . MSort performed better as time shifts were reduced. The PAM results were not different from the alignment based on the raw data. Overall, considering the input effort, using modified anchor point algorithm as a pre-processing step has no positive effect on the quality of the final data alignment.m/z ratios, which is, for example, useful while distinguishing between members of homologous series.As spectral comparison was the main issue, additional options of spectral similarity were inspected  — spectrF1 score [F1 score 0.61 , and the spectral transformation with coefficients 0.53 and 1.3 improved the F1 score to 0.87   were measured, the peaks were manually identified, and subsequently, only the mass spectra were compared. The first chromatogram was set as a reference chromatogram. F1 score  was usedCanberra distances, cosine similarity  with threshold of 90 % and the w =0.4  for the TNT-DA was 0.0282 for the 1st dimension and 0.0819 for the 2nd dimension, and DISCO scored 0.0280 for the 1st dimension and 0.0812 for the 2nd dimension. The processing time was roughly the same in the dozens of minutes per sample. For visual comparison, 100 randomly chosen pairs were exported as distribution maps and visually compared (note that random.seed was set to 42). For both algorithms, alignment artefacts appeared  and TNT-DA were tested on the complete dataset containing 503 samples. On the basis of the results of the sample dataset alignment, DISCO selection rules and cosine similarity with spectral transformation were chosen as the best alternative considering the processing time demands and the achieved alignment of the data points. The spectral similarity threshold was set at 90 % (0.9) for both algorithms. The TNT-DA  dataset ) and theIn total, more than 1100 data alignment steps were carried out during this study using newly introduced open-source data alignment tool — DA_2DChrom. The performance differences of each implemented data alignment algorithm were demonstrated. For every algorithm with tuneable parameters, multiple alignment runs were carried out and compared to each other.T1 and T2 were rigid and only D1 and D2 were varied during the experiments. Adjustable parameters allow BiPACE 2D to deal with various time changes, but the algorithm must first be tuned. The DISCO algorithm is robust considering time shifts, and swift has no real tuneable attributes, which makes DICSO a very user-friendly approach. MSort is perfect for chromatograms with smaller time deviations. It has the quickest execution time, and if there is no significant time shift, MSort would be the best choice. The PAM algorithm is the most time-consuming. However, it does not discriminate any peaks in the comparison itself. The user can choose the weight of the spectral similarity and peak distance on a single parameter. The PAM should be error prone to significant time shift as well as to different peak distribution. The processing time of the PAM algorithm could be reduced by introducing the “search window” boundaries (like MSort or BiPACE2D). The transformation of retention time coordinates into retention index coordinates proved to be very efficient, especially in the 1st dimension, but this approach is not viable in automation of data processing. Smith–Waterman algorithm was excluded from further calculations due to time-consuming calculations and severe misalignments for unequally populated chromatograms.First, orientation experiments were performed on a reduced sample set containing twenty samples with the following result: BiPACE 2D has four controllable parameters. For our study, the discrimination rules precision score than cosine similarity, which, on the other hand, yielded better recall results. The user can also transform the mass spectra in order to favour characteristic masses (masses with higher m/z ratios).Choosing the right mass spectrum comparison method proved to be crucial and significantly improved the effectiveness of the algorithms. Thus, the DA_2DChrom was expanded for another tuneable argument for each algorithm — the user can choose between the Pearson’s correlation or cosine similarity when comparing mass spectra. The Pearson’s correlation reached higher In the second part, the TNT-DA algorithm, combining the speed of DISCO and selection rule of PAM, was proposed. The abilities of TNT-DA were compared to that of DISCO. Both algorithms were applied to the complete dataset (503 samples) and reached similar scores. TNT-DA is also implemented in the DA_2DChrom tool.The performance of the DA_2DChrom can be improved by filtering out the peaks detected in the elution areas of column bleeds of both dimensions . Subsequently, the results should be checked and realigned by different algorithm setups if needed.The proposed algorithm TNT-DA and more importantly the alignment tool can be further developed and updated as the main goal of this work is to help overcome data alignment problem for users relying on commercial processing software often supplied by instrument manufactures. With sufficient data alignment, non-targeted analyses of two-dimensional chromatographic data could be as close to the routine as they are for one dimensional GC methods. The script used for the experiments as well as its documentation and the dataset are fully available online.Supplementary file1 (PDF 95 KB)Supplementary file2 (XLSX 34 KB)Supplementary file3 (PDF 16 KB)Below is the link to the electronic supplementary material.


EasyModel provides a straightforward graphical interface for Modeller that can be used in only one browser.Three-dimensional protein structures are invaluable sources of information for the functional annotation of protein molecules. Describing the function of a protein sequence is one of the most common problems in biology. Generally, this problem can be facilitated by studying the tertiary structure of proteins. In the lack of protein structures, comparative modeling often provides a useful three-dimensional model of the protein associated with at least one known protein structure. Comparative modeling predicts the tertiary structure of a certain protein sequence (target) mainly based on its homological sequence to the sequence of one or more proteins with known structures (templates). MODELLER is one of the most widely used tools for homology or comparative modeling of three-dimensional protein structures. However, most users find it challenging to start with MODELLER as it is a command line based and requires knowledge of basic Python scripting to use it efficiently. In this study, a web-based interface has been designed to predict the tertiary structure of proteins based on Modeller, which does the comparative modeling automatically, and uses PHP and Python programming languages. This tool is called “EasyModel” and is available at  The basis of prediction by homology modeling is that the protein sequence is similar to one or more proteins with known structures. Based on the fact that proteins with similar sequences have identical structures. Homology modeling predicts a given protein sequence (target) establish on its alignment with one or more proteins of known structure (templates) and the alignment of target and template(s) sequences.1.The steps of this process are: (1) identification of homologs that can serve as template(s) for modeling; (2) alignment of the target sequence to the template(s); (3) backbone generation; (4) loop modeling; (5) side-chain modeling; (6) model optimization; and (7) validation of the model2. These interfaces are categorized into two types, web-based and desktop applications.Several computer programs and web servers serve as a graphical user interface for Modeller3, HHpred4, and Modbase5 can be mentioned. For desktop applications, ChimeraX6, and EasyModeller7 are notable choices.Among the web-based applications, Esypred3DModeller is a widely used program for the homology modeling of proteins, though some users find it challenging to navigate due to its command line interface and reliance on Python expertise. As a command line application without a graphical interface, users must possess basic knowledge of both the command line and Python to achieve optimal performance. To address this issue, various companies and individuals have developed visual interface software to make Modeller more accessible to users. However, these interfaces are depending on the operating system (Windows or Mac) or they consider it necessary to install Python on the operating system, also, some of them are no longer available or not under active development. Most of these programs are limited to basic modeling, and many older programs are no longer available due to their incompatibility with newer versions of Modeller.Therefore, the approach adopted in this study is developing and implementing an online bioinformatics interface for predicting the tertiary structure of proteins. For this prediction, the homology modeling method and Modeller are used. All the parts that researchers required, including Python, and the command line, have been removed so that researchers can complete all their modeling steps with only a straightforward graphical interface.The main focus of this study is to create an online bioinformatics tool that can predict the tertiary structure of proteins. To achieve this goal, the homology modeling method and Modeller are utilized. The tool has been designed to offer a simple graphical interface, eliminating the need for researchers to have experience with Python scripts or the command line. This simplifies the modeling process, allowing researchers to complete all necessary steps easily.8 score diagram ram Fig. , which dram Fig. .Figure 1https://salilab.org.The NGL viewer displays the best model on the right-hand side, while a list of available and downloadable models is provided on the left-hand side. The model with the lowest DOPE Score is also identified as the BEST MODEL. In addition to the built models, alignment files in ‘pir’ and ‘ali’ formats, as well as log files, can be downloaded individually or as a compressed file. To ensure the accuracy of the protein model, it is strongly advised to thoroughly review the sequence alignment. As such, the report includes an illustration of the sequence alignment at the end. All of these modeling tasks can be performed in just a few minutes, without requiring any programming or Python knowledge, or the installation of necessary software. The successful integration of the Modeller academic license into EasyModel’s server has enabled the user-friendly graphical interface for Modeller to be up and running. To make use of EasyModel, ensure you possess a valid Modeller academic license key, which can be obtained by visiting the website of Andrej Sali’s lab at In addition to the results obtained from this study, exploring other capabilities of modeller, such as analyzing protein-ligand interactions and generating independent diagrams of protein profiles, can further aid scientists in predicting the tertiary structure of sequences.9 is used to display molecules. This web-based interface has been designed to assist users who lack programming skills, knowledge of the command line, and proficiency in the Python programming language. With EasyModel, users can easily model, evaluate, analyze, and optimize protein models. The interface is capable of identifying the target sequence and template(s) structure, predicting the tertiary structure of the target sequence, and presenting the results in the form of graphs, log files, alignments, and data in constructed protein files. The screenshot of the EasyModel interface is shown in Fig. The primary objective of this study has been to create a frontend graphical user interface called “EasyModel” for Modeller, which has been built using PHP and Python. It is worth mentioning that the frontend of the tool has been developed using HTML5, Bootstrap, CSS, and JavaScript, furthermore, NGL viewerEasyModel offers three different sections to predict the tertiary structures of proteins. Based on their specific requirements, users can select one of these sections. The three sections available are: (1) basic modeling. (2) Advanced modeling-loop refining. (3) Advanced modeling-multiple templates.https://salilab.org/modeller/tutorial/basic.html.In cases where template selection and target-template alignments pose no challenge, basic modeling can be readily employed as a straightforward approach. Detailed step-by-step instructions on how to perform these steps are fully available at In the basic modeling section of the designed tool, users are able to import their desired protein PDB file. Here, the various steps of protein modeling using this tool for the lactate dehydrogenase protein sequence are demonstrated Fig. , 4.FigurUpon basic modeling operations, EasyModel automatically generates a log file. Following the Basic Modeling step, a graph illustrating the DOPE scores of both the input template and the generated model is presented. The DOPE score is a statistical potential-based scoring function utilized to assess the quality of a protein structure model by estimating its relative energy. This score enables the comparison and ranking of different models, with lower scores indicating higher-quality protein structure models. The resulting chart can be downloaded in various file formats, including jpg, png, pdf, and others Fig. .Figure 4http://bioinf.modares.ac.ir/software/easymodel/basic-modelling/sample.In Fig. In protein modeling, multiple templates are employed when there is no single template that closely matches the target protein sequence. In such scenarios, various templates can be utilized to model different segments of the target protein sequence, and subsequently, these models can be combined to generate a final model. The utilization of multiple templates can enhance the accuracy of the resulting model, particularly when the target protein possesses distinct structural features that are absent in any of the individual templates.http://bioinf.modares.ac.ir/software/easymodel/advanced-modelling/multiple-templates/sample.As it is shown in Fig. 10. Figure Loop Refining improves the accuracy of a protein structure model by optimizing poorly modeled loops. This method utilizes scoring functions and optimization protocols specially designed for loop modeling. It can also enhance the accuracy of a particular range of residues in the modelhttp://bioinf.modares.ac.ir/software/easymodel/advanced-modelling/loop-refining/sample.Upon completing the Loop Refining process, 10 different models and a log file of the program execution are created and saved. You can explore a sample result page at https://salilab.org/modeller/tutorial/advanced.html.Comprehensive, detailed, and step-by-step instructions for performing Modeller advanced modeling steps are fully accessible at


Considering the huge numbers of rare k-mers in large eukaryotic genomes, a series of high-performance computing techniques such as multi-threading and bit operation are used to improve the time and space efficiencies. The experimental results on tandem repeats and interspersed repeats show that RAfilter was able to filter 60%–90% false-positive HiFi alignments with almost no correct ones removed, while the sensitivities and precisions on ONT datasets were about 80% and 50% respectively.Telomere to telomere (T2T) assembly relies on the correctness of sequence alignments. However, the existing aligners tend to generate a high proportion of false-positive alignments in repetitive genomic regions which impedes the generation of T2T-level reference genomes for more important species. In this paper, we present an automatic algorithm called RAfilter for removing the false-positives in the outputs of existing aligners. RAfilter takes advantage of rare  De novo genome assembly is one of the fundamental problems in genomics. For a long time, the assembly of large eukaryotic genomes is challenging due to the high complexity of repetitive regions such as centromeres, telomeres, ribosomal DNA and transposons [nsposons . The misnsposons  and Oxfonsposons –6, and ansposons –10.Although these new tools have significantly improved the correctness and completeness of assemblies compared with the short read- or traditional long read- based assemblers, the generation of T2T-level chromosomes still needs a lot of manual or automatic works of gap filling in repetitive regions which may cause many mis-assemblies due to the false-positive alignments between repeat copies with high similarity. Theoretically, to detect false-positive alignments, one needs to decide if the aligned sequences are from the same genomic region or different regions with similar copies by evaluating the matching of copy-specific features such as single nucleotide polymorphisms (SNPs) and structural variations (SVs). Due to the difficulty and high computational cost of SNP and SV identification and matching evaluation, the existing alignment tools are not able to take fully advantage of copy-specific features to remove false-positive alignments, so that a large part of which still exist in their outputs.k-mer  to represent copy-specific feature so that different types of variants can be processed in a unified way. Then the kMAPQ can be calculated by evaluating the similarity of rare k-mer profiles of aligned sequences including the order and sequence of rare k-mers. Considering the huge numbers of rare k-mers in large eukaryotic genomes, a series of high-performance computing (HPC) techniques such as multi-threading and bit operation are used in RAfilter to improve the time and space efficiencies. We tested the performance of RAfilter in tandem repeats and interspersed repeats on both simulated and real datasets, and the experimental results show that it was able to effectively detect the false-positive alignments.In this paper, we present a novel algorithm called RAfilter  for further removing the false-positive alignments left in the outputs of existing alignment tools. Instead of removing the alignments in hard way, RAfilter assigns a kMAPQ (similar with MAPQ used in minimap2 ) score fWe tested the accuracy and efficiency of RAfilter on simulated and real datasets with both PacBio HiFi and ONT reads. The simulated datasets of only repetitive regions were generated from the human T2T reference genome (chm13 v2.0) which is the existing most high-quality reference genome containing the complete and accurate tandem and interspersed repeats in human genome. The rice genome of J4155S was used to simulate the whole genome sequencing datasets and generate a real dataset.The human T2T reference genome chm13 v2.0 ) was dow v2.0  waTo generate the simulated dataset on interspersed repeats, we randomly obtained a sequence of 100 kb from chromosome 17 of the human T2T reference genome (chm13 v2.0), and inserted 10 copies of it into chromosome 18 of the same reference genome at random positions as the interspersed repeats. These positions were recorded for assessment. To generate the copies, the substitutions and indels were added into the original sequence in the following way. First, we randomly selected 3% nucleotides and randomly changed each of them to one of the other three nucleotides with uniform probabilistic distribution. In the sequence with substitutions added, 1% nucleotides were randomly selected and removed. The HiFi and ONT reads were simulated for the whole modified chromosome 18 by the same tools with the same parameters as the experiments on tandem repeats, and were aligned by minimap2 with parameters “-t 32 -map-pb/map-ont -o”. Also, the “ground truth” was generated in the same way as tandem repeats. RAfilter was run on the alignments in the interspersed repeats (10 copies).https://github.com/marbl/CHM13 and aligned the reads with length longer than 100 kb to the T2T reference genome (chm13 v2.0) by minimap2 with parameters “-t 32 -map-ont -o”. For comparison, RAfilter was run with different numbers of threads such as 8, 16, 32 and 48. The program was run on a server with two EPYC 7H12 CPUs (each with 64 cores and 2.6 GHz) and 1024 GB memory. The usage time and CPU percentage were used to evaluate the time efficiency and the maximum memory usage was used to evaluate the space efficiency of RAfilter.To test the time and space efficiencies of RAfilter, we downloaded the whole-genome real ONT reads “rel6” of the human chm13 cell line from A, B, C show that the performance of RAfilter on the whole genome is different from that on the only-repeat-related datasets. Both precisions and sensitivities show very high variation with different kMAPQ thresholds. We also find that the performance on ONT dataset is better than that on HiFi dataset, which is different from the results on only-repeat-related datasets. Although not for sure, we believe the reason could be related to the proportion of repeat-related alignments. In the whole genome, the vast majority of the alignments are not in the repetitive regions, and minimap2 generated much fewer false-positive alignments on HiFi data than ONT data due to the difference in sequencing error rate. It could be easier for RAfilter to detect from a much larger set of false-positive alignments (ONT) than a smaller set (HiFi).To test the performance of RAfilter on whole genome level, we generated two simulated datasets (HiFi and ONT) of the whole rice genome J4155S downloaded from the project of PRJCA008812 [Fig. 5C, D show that only a small proportion of the false-positive alignments can be removed by MAPQ based filtering, and increasing the threshold from 10 to 50 did not change much. However, RAfilter was able to remove about half (or more) more false-positive alignments.To test the performance of RAfilter on the alignments left from normal MAPQ  based filtering, we first filtered them by the MAPQ thresholds 10, 20, 30, 40 and 50 respectively, and then do the further filtering by RAfilter with kMAPQ thresholds 10 and 12 for ONT and HiFi alignments respectively. The results from Fig. 5Finally, we tested the performance of RAfilter on a real rice genome J4155S. The real HiFi and ONT reads and the corresponding reference genome (contigs) were downloaded from CRR453541 and CRR453543 under the project [k-mers disappear in ONT reads leading to the lack of usable k-mers in some repetitive regions. Thus, the current version of RAfilter is not able to work well on these regions. One possible solution is to take advantage of the rare combinations of non-rare k-mers. More specifically, a motif that contains two or more non-rare k-mers may appear in the whole genome for only one or small number of times, and can be used as a marker in repetitive regions which is lack of rare k-mers.We presented RAfilter, a new algorithm for filtering false-positive alignments in repetitive genomic regions. We found that RAfilter is able to detect false-positives in both tandem repeats and interspersed repeats with high or acceptable precisions and sensitivities and high time and space efficiencies. Nevertheless, there are a number of areas that our methods and approaches can be further improved. First, due to the high sequencing error rate, a large proportion of rare k-mer sequences and k-mer orders. More information such as k-mer orientations and k-mer distances can be used in the calculation to improve the accuracy in the future.Second, when calculating kMAPQ score, current version of RAfilter only considers the k-mers. One possible solution is to use a selected set of rare k-mers instead of the whole set. In some regions that contain far-more-than-enough rare k-mers, a sub-sampling strategy can be tried to reduce the number and thus save the time and space.Last but not least, although a series of techniques are used to improve the time efficiency and space efficiency in RAfilter, the time and space requirements of large genomes are still not acceptable on personal computers due to the huge number of rare k-mer identification and positioning, and alignment filtering. In the first phase, the rare k-mers are identified and positioned on all DNA sequences related. In the second phase, the k-mer position information is searched for each alignment and used to decide if the alignment is false-positive. The input of RAfilter contains a set of alignments and the related sets of reference sequences and query sequences, and the output is the same set of alignments with kMAPQ scores assigned. The pipeline of RAfilter algorithm is illustrated in RAfilter is composed of two phases: rare k-mers and position them on the input reference and query sequences. First of all, we define rare k-mer formally as the k-mer which appears in the whole genome for less than or equal to m (e.g. 3) times. Due to the lack of whole genome sequence, we use the whole set of reference sequences to replace whole genome, because, in most situations of genome assembly, the reference sequences are non-redundant ones such as contigs and scaffolds which contain almost the same set of k-mers with same frequencies as the real genome. To identify rare k-mers, Jellyfish [https://github.com/gmarcais/Jellyfish) is used to collect all k-mers in reference sequences and count their appearing and then the ones with counts less than or equal to m are kept as rare k-mers.In the first phase, we identify the rare ellyfish  v2.3.0 , and then the integers are stored in a hash table. Second, for each reference or query sequence, a sliding window of length k (the k of k-mer) moves from the 5′ end to 3′ end. At each position, the k-mer in the window is searched in the hash table of rare k-mers by its corresponding Unit64 integer to see if any rare k-mer appears at this position. With bit operation, when moving the sliding window from one position to next, RAfilter generates the Unit64 integer of the new k-mer by taking advantage of that of the last k-mer, instead of the time-consuming recalculation. More specifically, to generate the new integer, we just need to left-shift the binary form of the old integer by 2 bits, add the 2 bits corresponding to the new nucleotide to the end, and mask the first 64–2 k bits. At each position, besides the k-mer in the window, we also check its reverse complement k-mer. Similarly, the Unit64 integer of reverse complement k-mer can be calculated by right-shifting the binary form with adding and masking. To speed up, this whole process was implemented with multi-threading technology. Since the tasks of different sequences are independent, RAfilter assigns each of them to one thread.Then we search in the reference and query sequences to find the positions that the identified rare k-mer list for each reference or query sequence with positions, sequences and orientations annotated. To decide if one alignment is false-positive or not, we need to obtain the corresponding rare k-mer sub-list for each of the two aligned sub-sequences from the rare k-mer position database built, which is not trivial due to the huge amount of rare k-mers and sequences in the whole genome. To efficiently search for a sub-list of rare k-mers with the given sequence ID, aligning starting position and aligning ending position, RAfilter uses a series of techniques to speed up and reduce the memory consumption. First of all, a file index is built for fast obtaining the rare k-mer information about the given sequence. The list of k-mers of each sequence is saved in the database file as a line, and the address of each line starting position is calculated by counting the total number of bytes in the previous lines. A hash table (file index) is used to save the mapping from sequence ID to the corresponding line starting address, so that RAfilter is able to find this line (the whole list of rare k-mers of the given sequence) by sequence ID within O [k-mers corresponding to the aligned sub-sequence from the whole list with high time and space efficiency. For reference sequence, RAfilter moves the whole list of rare k-mers from the file to the memory, and use a binary search algorithm (O(logn) time complexity) to search for the aligning starting position and aligning ending position. Since the alignments are sorted by the reference ID, one movement of rare k-mer list to memory solves all the alignments related to the same reference sequence, which significantly reduce IO times and save the space. For query sequence, instead of obtaining the sub-list from the whole list in memory, RAfilter implements the external binary search algorithm by file operations and directly does it in the file.After positioning, RAfilter gets a rare within O  time. Nek-mers corresponding to the two aligned sub-sequences, RAfilter takes advantage of them to calculate the kMAPQ score which evaluates the correctness of this alignment. More specifically, we need to get a value to evaluate the similarity of the two lists of k-mers. The most straightforward idea is to model this problem into a theoretical problem in computer science called Longest Common Subsequence (LCS) which tries to obtain a sequence from two input sequences which satisfies 1) this sequence is a sub-sequence of both of the two input sequences; and 2) the number of elements in this sequence is the largest among all the sequences satisfying 1). After obtaining the LCS of the two lists of k-mers, the length of LCS can be used to evaluate their similarity. However, due to the high time complexity O which can be solved by the algorithm with O(nlogn) time complexity. LIS problem tries to obtain a sequence from an input digital sequence which satisfies 1) this sequence is a sub-sequence of the input sequence; 2) this sequence is an increasing sequence and 3) the number of elements in this sequence is the largest among all the sequences satisfying 1) and 2). First of all, RAfilter obtains the common set of k-mers that appear in both of reference and query sub-lists. Second, a digital sequence of positions of the common k-mers in reference is generated and the order of the sequence depends on the order of common k-mer in query. Third, RAfilter obtains the LIS of this digital sequence by an algorithm combining greedy strategy and binary search. Finally, the kMAPQ score can be calculated by the length of LIS LISl and the lengths of reference and query sub-lists lr and lq as follows.For each alignment, after obtaining the two sub-lists of rare In this paper, we used precision and sensitivity to evaluate the accuracy of RAfilter. TP (True Positive), FP  and FN  are defined as follow: TP: the number of false-positive alignments correctly detected by RAfilter; FP: the number of correct alignments wrongly detected by RAfilter as false-positive alignments; FN: the number of false-positive alignments wrongly detected by RAfilter as correct alignments. With the definition of TP, FP and FN, we define the precision and sensitivity as follow.This work was supported by Shenzhen Science and Technology Program (Grant No. RCBS20210609103819020) and National Natural Science Foundation of China (Grant No. 32100501). The authors thank Shengcheng Zhang for the discussions about high-efficient implementation.W.P., J.Y. and Y.Y. designed this study. J.Y., X.Z. and H.J developed and tested RAfilter. J.Y., Y.Y and W.P. wrote the paper.https://github.com/panlab-bioinfo/RAfilter.git.The software, source codes and manual of RAfilter can be freely downloaded at None declared.