Our results demonstrate the power of the alignment-free autoregressive model in generalizing to regions of sequence space traditionally considered beyond the reach of prediction and design.The ability to design functional sequences and predict effects of variation is central to protein engineering and biotherapeutics. State-of-art computational methods rely on models that leverage evolutionary information but are inadequate for important applications where multiple sequence alignments are not robust. Such applications include the prediction of variant effects of indels, disordered proteins, and the design of proteins such as antibodies due to the highly variable complementarity determining regions. We introduce a deep generative model adapted from natural language processing for prediction and design of diverse functional sequences without the need for alignments. The model performs state-of-art prediction of missense and indel effects and we successfully design and test a diverse 10 The ability to design functional sequences is central to protein engineering and biotherapeutics. Here the authors introduce a deep generative alignment-free model for sequence design applied to highly variable regions and design and test a diverse nanobody library with improved properties for selection experiments. Designing and generating biomolecules with known functions is now a major goal of biotechnology and biomedicine, propelled by our ability to synthesize and sequence DNA at increasingly low costs. However, since the space of possible protein sequences is so large (for a protein of length 100 this is 10130), deep mutational scans5 and even very large libraries  barely scratch the surface of the possibilities. As the vast majority of possible sequences will be non-functional proteins, it is crucial to minimize or eliminate these sequences from libraries. Therefore, the open challenge is to develop computational methods that can accelerate this search and bias the search space for protein sequences that are likely to be functional. This will enable the design of libraries for tractable high-throughput experiments that are optimized for functional sequences and variants that are distant in sequence.Over the past 20 years, success in protein engineering has emerged from two distinct approaches, directed evolution6. Single-domain antibodies, or nanobodies, are composed solely of the variable domain of the canonical antibody heavy chain. The increasing demand for and success with the rapid and efficient discovery of novel nanobodies using phage and yeast display methods10 have spurred interest in the design of optimal starting libraries. Previous statistical and structural modeling of antibody repertoires18 have addressed the characterization of sequences of natural antibodies or predicted higher affinity sequences from immunization or selection experiments. One of the biggest challenges is to design libraries diverse enough to target many antigens but also be well-expressed, stable, and non-poly-reactive. In fact, a large, state-of-art synthetic library contains a substantial fraction of non-functional proteins8 because library construction methods lack higher-order sequence constraints. Eliminating these non-functional proteins requires multiple rounds of selection and poses the single highest barrier to identifying high-affinity antibodies. In order to circumvent these limitations, there has been an emphasis on very large libraries (~109–1010) to achieve these desired features20.Antibody design is a particularly challenging problem in the area of statistical modeling of sequences for the purposes of prediction and design. Antibodies are valuable tools for molecular biology and therapeutics because they can detect low concentrations of target antigens with high sensitivity and specificity22, to generally more 3D structures and conformational plasticity24, protein interactions28, and most recently, mutation effects34. However, these state-of-art methods and established methods38 rely on sequence families and alignments, and alignment-based methods are inherently unsuitable for the statistical description of the variable length, hypermutated complementarity determining regions (CDRs) of antibody sequences, which encode the diverse specificity of binding to antigens. While antibody numbering schemes such as IMGT provide consistent alignments of framework residues, alignments of the CDRs rely on symmetrical deletions39. Alignment-based models are also unreliable for low-complexity or disordered proteins40 and cannot handle variants that are insertions and deletions. Indels make up 15–21% of human polymorphisms43, 44% of human proteins contain disordered regions longer than 30 amino acids44, and both are enriched in association with human diseases such as cystic fibrosis, many cancers46, cardiovascular and neurodegenerative diseases, and diabetes48.Instead of experimentally producing unnecessarily massive, largely non-functional libraries, we can design smart libraries of fit and diverse nanobodies for the development of highly specific and possibly therapeutic nanobodies. One way to approach this is to leverage the information in natural sequences to learn constraints on specific amino acids in individual positions in a way that captures their dependency on amino acids in other positions. The sequences of these variants contain rich information about what contributes to a stable, functional protein, and in recent years generative models of these natural protein sequences have been powerful tools for the prediction of the first 3D fold from sequences alone50 and translation52 use generative models that do not require “word alignment”, e.g., between equisemantic sentences, but instead employ an autoregressive likelihood to tackle context-dependent language prediction and generation. Using this process, an audio clip is decomposed into discrete time steps, a sentence into words, and a protein sequence into amino acid residues. Models that decompose high-dimensional data into a series of steps predicted sequentially are termed autoregressive models, and they are well suited to variable-length data that have not been forced into a defined structure such as a multiple-sequence alignment. Autoregressive generative models are uniquely suited for modeling and designing the complex, highly diverse CDRs of antibodies. Here, we develop and apply a new autoregressive generative model that aims to capture key statistical properties of sets of sequences of variable lengths.By contrast, the deep models that have transformed our ability to generate realistic speech such as text-to-speech30, which does require aligned sequences and is an independent evaluation, testing against experimental data that was reported to outperform all currently available methods34. In addition to this state-of-the-art performance, our new alignment-free method is inherently more general. It can deal with a much larger class of sequences and take into account variable-length effects. Another recently developed method53 does aim to quantify the mutation effects without the need for alignments. However, this method requires 80% of the mutational data labeled with experimental outcomes from the same experiments it is tested on as well as fine-tuning with specific families as input. Previous neural language models56 are so far not suitable for mutation effect prediction for sequences without extensive experimental data or for sequences with high variabilities, such as the CDRs of antibody variable domains. By contrast, a fully unsupervised, alignment-free generative model of functional sequences is therefore desirable for the design of efficient nanobody libraries.We first test our method on the problem of prediction of mutation effects, which are typically analyzed using alignment-based statistical methods. The new method performs on par with the DeepSequence machine-learning VAE-based method57 as naïve antibody repertoires have been shown to have functional sequences with the capacity to target diverse antigens58 and used it to generate probable sequences. In this manner, we designed a sequence library that is 1000-fold smaller than state-of-art synthetic libraries but has an almost twofold higher expression level, from which we identified a candidate binder for affinity maturation. A well-designed library can also be used in continuously evolving systems59 to combine the hypermutation and affinity maturation processes of living organisms in a single experiment. Smart library design opens doors to more efficient search methods of nanobody sequence space for rapid discovery of stable and functional nanobodies.We then trained our validated statistical method on naïve nanobody repertoiresProtein sequences observed in organisms today result from mutation and selection for functional, folded proteins over time scales of a few days to a billion years. Generative models can be used to parameterize this view of evolution. Namely, they express the probability that a sequence mentclass2pt{minimmentclass2pt{minim60 and recurrent neural networks61. However, we encountered exploding gradients62 during training on long sequence families with LSTM63 or GRU64 architectures. Instead, we parameterize this process with dilated convolutional neural networks . The model is tasked with predicting an amino acid at some position in the sequence given all the previous amino acids in the sequence, i.e., forward language modeling. The causal structure of the model allows for efficient training to a set of sequences, inference of mutation effects, and sampling of new sequences. By learning these sequential constraints, the model can be directly applied to generating novel, fit proteins, one residue at a time. The autoregressive nature of this model obviates the need for a structural alignment and opens doors for application to modeling and design of previously challenging sequences such as non-coding regions, antibodies, and disordered proteins.Many different neural network architectures can model an autoregressive likelihood, including attention-based models34, and they avoid the risk of overfitting that can occur as a result of circularity in supervised methods68. We compared the accuracy of this new, non-alignment-based model to state-of-art methods for a benchmark set of 40 deep mutational scans across 33 different proteins, totaling 690,257 individual sequences  and the EVmutation model29 that includes dependencies between pairs of sites (30/40 datasets); it performs on par with the state-of-the-art results of DeepSequence30 ; and it outperforms the supervised Envision model31 for 6/9 of the datasets tested  than the synthetic library (12)  using fluorescence-activated cell sorting (FACS) Fig. , from wh μM Fig. . This ex77, and demonstrated application to examples for which robust alignments cannot be constructed, such as sequences with multiple insertions, deletions, and substitutions, and cases for which protein structures and experimental data are not available. As for the comparison with a potentially competing alignment-free model, while we do not discount the utility of semi-supervised methods , great care must be taken in the way the split between training and test is conducted to evaluate the true generalizability of the method. For instance, randomized subsets excluded from training will still be learned from the labeled data in a way that is not generalizable to required predictions for other proteins89. Our model is not subject to these limitations as its training is fully unsupervised.Here we show how neural network-powered generative autoregressive models can be used to model sequence constraints independent of alignments and design novel functional sequences for previously out-of-reach applications such as nanobodies. The capability of these models is based on demonstrated state-of-the-art performance and on an extended range of applicability in the space of sequences. In the particular version in this paper, we validated our model first on deep mutational scan data, with on-par performance with the best currently available modelDue to their flexibility, deep autoregressive models could also open the door to new opportunities in biological sequence analysis and design. Unlike alignment-based techniques, since no homology between sequences is explicitly required, generative models with autoregressive likelihoods can be applied to variants with insertions and deletions, disordered proteins, multiple protein families, promoters, and enhancers, or even entire genomes. Specifically, the prediction of insertions and deletions and mutation effects in disordered regions has been a difficult research area, despite their prevalence in human genomes. Disordered regions are enriched in disease-associated proteins, so understanding variant effects will be important in understanding the biology and mechanism of genes indicated in cardiovascular, cancer, and neurodegenerative diseases. For example, classical tumor suppressor genes, such as p53, BRCA1, and VHL, and proteins indicated in Alzheimer’s disease, such as Tau, have long disordered regions where these models may prove particularly useful.90. As the cost to synthesize sequences decreases, the demand for methods that can design highly optimized and diverse sequences will increase as compared to constructing libraries via random or semi-random generation strategies.With this model, we designed a smart, diverse, and efficient library of fit nanobody sequences for experimental screening against target antigens. Designing individual hypervariable CDR sequences that make up a library of diverse, functional, and developable nanobodies allows for the much faster and cheaper discovery of new therapeutics, minimizing both library waste and necessary experimental steps. Our streamlined library  enables rapid, efficient discovery of candidate nanobodies, quickly providing a starting point for affinity maturation to enhance binding affinity. In combination with a continuous evolution system, candidate binders from the designed library have been identified and affinity matured after only a few rounds of selection with a single experiment91. Beyond antibody and antibody fragment libraries, this method is translatable to library design for any biomolecule of interest, including disordered proteins.A challenge of using synthetic libraries is the poly-reactivity of many sequences that in vivo, would be cleared by an organism’s immune system. Naïve llama repertoires also contain poly-specific sequences, so training a model on sequences from mature or memory B cell repertoires may provide information on how to improve library design in the future and minimize the poly-reactivity of the designed library sequences. Multi-chain proteins such as antibodies present an additional challenge that multiple domains must be designed together. Models incorporating direct long-range interactions such as dilated convolutions or attention may identify the relevant dependencies between domains, even when the domains are simply concatenated and generated sequentially. Paired antibody chains are more challenging to sequence than nanobodies, but more repertoires are becoming available92 for these applications. The addition of latent variables could also allow for the targeted design of high affinity and specificity sequences to a desired target antigen95. Conversely, we also anticipate better exploration of broader spans of sequence space for generation, either by exploiting variance explained by latent variables96 or diverse beam search strategies97. With the increased number of available sequences and growth in both computing power and new machine learning algorithms, autoregressive sequence models may enable exploration into previously inaccessible pockets of sequence space.Our model is the first alignment-free method demonstrating state-of-art mutation effect prediction without experimental data and applied at scale to design of protein sequences. New developments in machine learning will enhance the power of such autoregressive models and incorporating protein structural information may further improve the capacity to capture long-range dependencies30. Sequence sets are derived from alignments by extracting full sequences for each aligned region; sequence identities, boundaries, and weights are the only information provided to the model by alignments. The log-likelihood for a sequence is the sum of the cross-entropy between the true residue at each position and the predicted distribution over possible residues, conditioned on the previous characters. Since we encountered exploding gradients62 during training on long sequence families with LSTM63 or GRU64 architectures, we parameterize an autoregressive likelihood with dilated convolutional neural networks  immediately after each of the six residual blocks100. We use a batch size of 30 for all sequence families tested. Channel sizes of 24 and 48 were tested for all protein families, and channel size 48 was chosen for further use. Six models are built for each family: three replicates in both the N-to-C and C-to-N directions, respectively. Each model is trained for 250,000 updates using Adam with default parameters101 at which point the loss had visibly converged, and the gradient norm is clipped62 to 100.Sequences are represented by a 21-letter alphabet for proteins or a five-letter alphabet for RNAs, one for each residue type and a “start/stop” character. Training sequences are weighted inversely to the number of neighbors for each sequence at a minimum identity of 80%, except for viral families, where a 99% identity threshold was used, as was done previously30 and five datasets that include indels and nanobody thermostability data were added for this work  sites, asparagine deamination (NG) motifs, or sulfur-containing amino acids (cysteine and methionine), resulting in 3,690,554 sequences.Using the N-to-C terminus model trained on llama nanobody sequences, we generated 33,047,639 CDR3 sequences by ancestral sampling103 to find diverse members of the dataset in O(n) time. We used a diameter threshold of 0.575, resulting in 382,675 clusters. K-mer size and BIRCH diameter threshold were chosen to maximize the number of clusters within a memory constraint of 70 GB. From the cluster centroids, we chose the 185,836 most probable sequences for final library construction.From this large number of sequences, we then sought to choose roughly 200,000 CDR3 sequences that are both deemed fit by the model and as diverse from one another as possible to cover the largest amount of sequence space. First, we featurized these sequences into fixed length, L2 normalized k-mer vectors with k-mers of sizes 1, 2, and 3. We then used BIRCH clustering8 using HiFi Mastermix (New England Biolabs). The original NotI site in pYDS649 was then removed by amplification with primers NotI_removal_1F and Pyds_NbCM_cloning_R followed by cloning again into pYDS649 to generate the pYDS_NbCM display plasmid for the nanobody template.FragmentGENE_NbCM coding for the nanobody template was amplified with oligonucleotides NbCM_pydsF2.0 and NbCM_pydsR and then cloned into the pYDS649 yeast-display plasmid8 BJ5465 (MATα ura352 trp1 leu2Δ1 his3Δ200 pep4::HIS3 prb1Δ1.6 R can1 GAL) yeast cells, grown to OD600 1.6, were transformed, using an ECM 830 Electroporator (BTX-Harvard Apparatus), with 2.4 µg of NotI digested pYDS_NbCM vector and 9.9 µg of CDR3 library PCR product yielding 2.7 × 106 transformants. Library aliquots of 2.4 × 108 cells per vial were frozen in tryptophan dropout media containing 10% DMSO. A list of oligonucleotides can be found in Supplementary Table An oligonucleotide library was synthesized (Agilent) with the following design ACTCTGT [CDR3] ATCGT where CDR3 is a sequence for one of the computationally designed clones. Two hundred picomoles of the library were PCR amplified over 15 cycles with oligonucleotides Oligo_library_F and Oligo_library_R using Q5 polymerase (New England Biolabs). Amplified DNA was PCR purified (Qiagen) and ethanol precipitated in preparation for yeast transformation. In total, 4.8 × 108 were grown in tryptophan dropout media with glucose as the sugar source for 1 day at 30 °C and then passaged into media with galactose as the sole sugar source to induce expression of nanobodies at 25 °C. After 2 days of induction, one million cells from each library were stained with a 1:25 dilution of anti-HA AlexaFluor647 conjugated antibody  in Buffer A  for 30 min at 4 °C. After staining, cells were centrifuged, the supernatant was removed, and cells were resuspended in Buffer A for flow analysis with an Accuri C6  along with anti-fluorescein isothiocyanate (FITC) microbeads (Miltenyi) and FITC-labeled streptavidin for 35 min at 4 °C and then passed through an LD column (Miltenyi) to remove binders to microbeads and streptavidin. The remaining yeast was centrifuged and resuspended in binding buffer and incubated with 500 nM streptavidin-FITC and 2 µM of biotinylated HSA for 1 h at 4 °C. Yeast was then centrifuged and resuspended in binding buffer containing anti-FITC microbeads for 15 min at 4 °C before passing them into an LS column and eluting and collecting the bound yeast. For the first round of FACS, induced yeast was first stained with 1 µM of biotinylated HSA for 45 min at 4 °C and then briefly stained with 500 nM of streptavidin tetramer along with antiHA-488 to assess expression levels. Both yeast stainings were performed in FACS buffer . In total, 5 × 106 yeast were sorted and 28,000 were collected and expanded for the second round of FACS. The second round of FACS was performed under the same conditions as the first and from 3.8 × 106 sorted yeast 21,455 were collected. Nanobody Nb174684 was isolated from a screen of 36 clones for binding to HSA using a flow cytometer and then sequenced. In order to characterize the binding of Nb174684, yeast displaying Nb174684 were stained with varying amounts of AlexaFluor 488 labeled HSA and fluorescence was analyzed with a flow cytometer. FACS measurements were analyzed using FlowJo and the python package FlowCytometryTools.To find nanobody binders to HSA one round of magnetic-activated cell sorting (MACS) followed by two rounds of FACS  were performed on our yeast-displayed library of nanobodies. For MACS, 4 × 10Further information on research design is available in the Supplementary InformationDescription of Additional Supplementary FilesSupplementary Data 1Supplementary Data 2Supplementary Data 3Supplementary Data 4Supplementary Data 5Supplementary Data 6Supplementary Data 7Supplementary Data 8Reporting Summary


With the development of next-generation sequencing technology and bioinformatics tools, the process of assembling DNA sequences has become cheaper and easier, especially in the case of much shorter organelle genomes. The number of available DNA sequences of complete chloroplast genomes in public genetic databases is constantly increasing and the data are widely used in plant phylogenetic and biotechnological research. In this work, we investigated possible inconsistencies in the stored form of publicly available chloroplast genome sequence data. The impact of these inconsistencies on the results of the phylogenetic analysis was investigated and the bioinformatic solution to identify and correct inconsistencies was implemented. The whole procedure was demonstrated using five plant families  as examples. Chloroplasts are one of the main specifics of the plant cell. They are organelles specialized for carrying out photosynthesis. It is generally accepted that the existence of chloroplasts in a plant cell is the result of the evolution of a cyanobacterial-like prokaryote that managed to incorporate into a eukaryotic cell as an endosymbiont. Due to their ability to harness solar energy, chloroplasts are responsible for transforming ancient plant cells from heterotrophy to autotrophy .Chloroplasts possess a semi-autonomous genetic system called the plastome . The codThe chloroplast genome (cpDNA) is a double-stranded DNA molecule of about 120 kb to 160 kb in size that encodes about 100 proteins ,6. This The typical structure of the chloroplast genome consists of a large single-copy (LSC) and a small single-copy (SSC) region separated by two identical inverted repeat (IR) regions. Each land plant individual cell contains with equal frequency at least two structural haplotypes (heteroplasmy) that differ in the orientation of the single-copy regions, due to the homologous recombination between IRs ,12,13. TAlthough plastids are maternally inherited in more than 80% of angiosperms ,19,20,21Chloroplast genome sequences have been widely used in plant phylogenetics, phylogeography, and molecular evolution research. They have numerous advantages  compared to nuclear genomes .Advances in DNA sequencing have increased the affordability of cpDNA sequence data, while the multiplicity of cpDNA molecules ,28 has iSeveral types of bioinformatic approaches have been used in research to assemble chloroplast genome sequences , such asDue to the circularity of cpDNA and the existence of two SSC orientations, the same cpDNA sequence can be recorded in different forms. Because of a variety of the methods used to assemble sequences, and the fact that public databases do not require a particular form of the cpDNA sequence upon submission  (pp. 3–4Phylogenetics based on cpDNA can be performed (1) on data of one or more genes e.g., ,41), or , or 41])The aim of this research was to investigate the impact of the standardization of cpDNA sequence data on the results of phylogenetic analyses. For this purpose, we collected available cpDNA sequences of five plant families  and reformatted the sequence data into a strictly defined form. For each family, we created two datasets, the first with the original sequence data and the second with the standardized data. In addition, we created two alignments based on different evolutionary assumptions (with and without partitions). We used two phylogenetic methods  and compared the trees using four different tree distance methods.We acquired all available complete chloroplast genomes for the five families from the NCBI database in December 2020. Statistics of the input data and datasets for each family are presented in In all families except Campanulaceae, the length of the standardized sequence alignment was shorter than the length of the original sequence alignment, which was to be expected. In the standardized alignment of Lamiaceae, the length was only slightly shorter than the original one because the original sequences were already well aligned. The shortening of the alignment varied among families and it appeared that the length of the shortening was related to the alignment length of the original sequences and the number of sequences that needed to be standardized.Sequence standardization increased the number of partitions  for all datasets. The case of Campanulaceae, where the standardized sequence alignment was longer than that of the original sequences, can be explained by the increased number of partitions, indicating that more genes were successfully aligned after standardization.Statistics regarding the forms of cpDNA sequences belonging to two major groups of eudicots, asterids, and rosids  found inThe distances between the resulting phylogenetic trees are shown in T (73 on 1540 MRCA), with almost the same values for KC and BS distances. In the Asteraceae, there were similar topological differences in the ML-BI and NP-P comparisons. There were greater topological and length differences in the O-S comparisons compared to the other comparisons, as RF distance values were about 10 times greater, KCT more than 20 times, KC more than 30 times, and BS about five times greater. All Campanulaceae trees have the same topology and branch length, O-S distances were four to five times larger than the NP-P distances. Both the ML and BI analyses in Lamiaceae yielded the same tree and the other two comparisons showed minimal differences in topology and branch length. In Rosaceae, ML-BI distances showed small topological differences (RF max. 2 branches out of 323), same topologies for NP-P comparisons, while in O-S comparison all distances were at least five times larger than in the other comparisons.The analyses of the families showed different patterns of results. The results of Apiaceae showed that there were no topological differences in the ML-BI and NP-P trees, and comparisons of NP-P showed some differences in the edge branches. Comparisons of O-S trees showed consistent topological differences in RF (4 of 109 branches) and KCComparisons of different phylogenetic methods on the same alignment and partition scheme, in all families except Asteraceae, show that the methods ML and BI lead to exactly the same or slightly different tree topology.In the second type of comparison, of different partition schemes, the results showed consistent differences in BS distance and for some families, small differences in other distances. When the distance measuring topology and branch lengths (BS) showed differences and the distance measuring only topology (RF) did not, this indicated that the difference between trees was mainly in branch length. For all families, these results showed that the partitioning schemes did not have a large effect on the resulting topology, but they could affect the resulting branch lengths of the trees.Comparisons of the third type showed an increase in all distances compared to the second type of comparison in all families except Lamiaceae. An increase was notable in Apiaceae, Asteraceae, and Rosaceae, as all distances differed by an order of magnitude.Most cpDNA genomes have a quadripartite structure with two copies of a large inverted repeat (IR), separated by small (SSC) and large (LSC) single copy regions ,14.IR copies facilitate flip-flop recombination, leading to the presence of isoforms that differ in the orientation of single-copy regions ,12. CurrNicotiana tabacum L. [Marchantia polymorpha L. [Due to two properties of the cpDNA genome, namely its presence in two orientations and circularity, coupled with the lack of a strictly defined standard for the linear form of the sequence when posting data to public databases, databases are expected to contain sequence data in different linear forms. Fortunately, most of the sequences retrieved from the NCBI used the form described in the first assembled complete cpDNA genome sequences of bacum L.  and Marcorpha L. , as showThese differences in genome sequence form can be attributed to different tools and approaches in the assembly process. There are two main approaches to cpDNA genome assembly: the use of general whole-genome assemblers and, more recently, the use of targeted assemblers for organelles. General whole-genome assemblers, such as SOAPdenovo , ABySS , and SPAOrganelle-targeted assemblers such as Fast-Plast , GetOrgaNowadays, it is common practice to use publicly available data of whole cpDNA genomes in phylogenetic analyses, especially in research involving assembled genomes  between the results of different phylogenetic methods on the same dataset, (2) between the results of analyses of the same datasets with and without gene partitions, (3) between the results of the analyses of the original and standardized sequence data. If comparisons of type (1) show the same or very close topology of the resulting trees, this shows the stability of the results with respect to the phylogenetic methods used, and the resulting tree on the dataset is reliable. The values of the type (2) comparisons give a norm of how much variability to expect in the phylogenetic results when different partition schemes are used. The choice of partition scheme is a step in the phylogenetic analysis that covers our assumptions about the underlying genomic data. Results are expected to differ depending on choice, and if they do, the differences are not critical because the genomic data carry enough information to support the underlying phylogenetic structure. If we relate the comparative values of type (3) to type (2) comparisons, we can see how much the phylogenetic results are affected by working with different forms of cpDNA genomic data. Non-standardized cpDNA whole genome data may contain sequences with SSC regions in both orientations and sequences stored with different starting positions. Consequently, phylogenetic results based on data with this noise are less plausible than results based on data without it.In this study, we analyzed five family datasets that differ in the number of sequences and sequence lengths. The number of sequences in the dataset varies from 22 (Campanulaceae) to 237 (Asteraceae) sequences, and the percentage of how much longer the maximum length sequence is than the minimum length sequence varies from 3% (Asteraceae) to 24% (Rosaceae).The alignment lengths of the standardized sequences are shorter than the alignment lengths of the original sequences by 1 (Lamiaceae) to 30% (Asteraceae) in all datasets except Campanulaceae. In the Campanulaceae dataset, the alignment length increased by 2%. The alignment of the standardized data results in more aligned genes than the alignments of the original sequences in all datasets. The number of aligned genes increased by 10 (Lamiaceae) to 263% (Asteraceae).The longer alignment after data standardization, in the case of the family Campanulaceae, can be explained by the better alignment of the gene regions. The length of the alignment increased by 2%, but the number of aligned genes increased by 64%. The likely reason that standardization does not lead to even more aligned genes or a shortening of the overall alignment is that Campanulaceae species have highly rearranged genomes . AnotherIn the case of Lamiaceae, the relatively small increase in the number of aligned genes can be explained by the small number of standardized sequences and by the fact that the alignment of the original sequences aligns most of the annotated genes, namely 88 out of 100–120 unique genes [Comparisons of the results of different phylogenetic methods on the same dataset, in all families except Asteraceae, show that both phylogenetic methods result in trees with the same or slightly different tree topologies, suggesting that the phylogeny is stable and accurate. In the tree comparisons, the Asteraceae showed different results than the other families for the ML-BI and NP-P comparison types. This can be explained by the much larger dataset, where the space of possible phylogenetic trees is huge, with many resulting trees of similar likelihood.As expected, comparisons of the results on different partition schemes show some, but not large, differences. The results for the families Apiaceae, Campanulaceae, and Rosaceae differ only in branch length, while the resulting trees for the families Asteraceae and Lamiaceae also differ in topology. The results for the family Lamiaceae showed no differences between O-S and NP-P comparisons. This is not in contradiction with the research results, as the differences are very small in all cases. Small values of all tree distance measures indicate clean genomic data supporting a stable phylogenetic structure where different phylogenetic approaches result in only minor differences at best. The comparison of the resulting phylogenetic trees on the original and standardized sequence data yields value orders of magnitude larger than comparisons on different partition schemes in all families except Lamiaceae.We can conclude that in general (a) standardization leads to a shorter alignment, a higher number of aligned genes, and most likely a better tree, and that (b) standardization has a significantly greater impact on phylogenetic analyses than the choice of partition scheme.https://github.com/CroP-BioDiv/cpDNA_standardization (accessed on 30 May 2021)).We therefore recommend standardizing cpDNA genome sequence data before analysis and provide a Python script for this purpose (http://www.ncbi.nlm.nih.gov (accessed on 20 December 2020)). We acquired all genomes available at that time for asterids and rosids clades. In total 2620 sequences were downloaded. Of these data, datasets from five plant families  were constructed. The criteria for selecting families were to work with relatively close families whose dataset properties differed. The selected families differed in dataset size and range of sequence lengths. Some datasets contained only recently assembled sequences, while some included sequences uploaded more than 10 years ago. For some species, more than one genome could be found in the NCBI. In all cases, multiple genomes of the same species belonged to different subspecies and we decided to use the most recent genome for a species. To follow standard procedures in phylogenetic analyses, an outgroup sequence was included for each family.Complete chloroplast genome sequences were downloaded from the NCBI  replacing one or more sequence regions  with the inverse complement; (2) cyclically shifting the entire sequence by cutting part of a sequence at the end and inserting it at the beginning, or vice versa. We set the minimum value for the cyclic shift offset to 10 bp. The offset value was set to 10 bp because assemblies based on short-read sequence data sometimes incorrectly assign the ends of the LSC and SSC regions to the IR region and vice versa, for ~10 bp .Chloroplast genome sequences downloaded from the NCBI already contain annotations. These sequences have been annotated using different tools and different versions of tools, while some were manually edited. To work with consistent annotations, we annotated all genome sequences using GeSeq , as the Sequences without annotated inverted repeats were omitted from further analyses. For each family, we created two datasets, the first consisting of data from original genome sequences acquired from the NCBI and the second consisting of the same data in standard form.https://github.com/CroP-BioDiv/zcitools (accessed on 30 May 2021)).We designed a pipeline that included the following steps: acquisition of input data, annotating sequences, analysis of sequence data, reformatting into standard form, annotating sequences changed by standardization, alignment and phylogenetic analyses, comparisons of phylogenetic results, and representation of comparisons. The pipeline was implemented in Python using the Biopython package . The codFor each plant family, we created two alignments: one alignment from original sequences  and one from the same sequences in standardized form . For each alignment, we created two datasets: one without partitioning  and one with partitioning created from the corresponding annotation data . On each dataset, we performed two types of phylogenetic analyses, maximum likelihood (ML) and Bayesian inference (BI). For both phylogenetic analyses, we used a generalized time-reversible (GTR) substitution model with gamma-distributed rates over nucleotide sites.Alignment was performed with MAFFT v. 7.453 , using tT with λ = 0, which measures only topological differences, and KC with λ = 0.5, which measures differences in both traits. The values of the different distances are not comparable.The results of the phylogenetic analyses (trees) were compared with three distances: (a) Robinson–Foulds distance (RF) , (b) KenT was scaled by the number of distinct sequence pairs, KC was scaled by the number of distinct sequence pairs plus the number of sequences, and BS was scaled by the sum of branch lengths in both trees. The plot of tree distances . It was expected that the topologies of the resulting trees of the same dataset would be the same or very similar. Secondly (2), we compared different partition schemes on the same alignment. For four combinations , we compared resulting trees generated on non-partitioned and partitioned alignments. Since the comparison was made with trees generated using the same phylogenetic method, it was possible to compare both topology and branch lengths . It was expected that the resulting trees would be similar. Thirdly (3), we compared different sequence data. For four combinations  we compared resulting trees generated from original and standardized sequences. The comparison was performed on trees generated by the same phylogenetic method, using all distance methods . We wanted to check how the distances of this comparison type would relate to the distances of the first two comparison types.We have made three types of comparisons. Firstly (1), we compared different phylogenetic methods on the same alignment and partition scheme. We analyzed four data sets  using both maximum likelihood and Bayesian inference methods. Since the branch lengths between resulting trees of different phylogenetic methods were not comparable, it was possible to compare only the topology of the trees (RF, KC


Partial-volume correction (PVC) using the Geometric Transfer Matrix (GTM) method is used in positron emission tomography (PET) to compensate for the effects of spatial resolution on quantitation. We evaluate the effect of misspecification of scanner point-spread function (PSF) on GTM results in amyloid imaging, including the effect on amyloid status classification (positive or negative).11C]PiB) PET and structural T1 MR imaging were analyzed. FreeSurfer 5.3 (FS) was used to parcellate MR images into regions-of-interest (ROIs) that were used to extract radioactivity concentration values from the PET images. GTM PVC was performed using our “standard” PSF parameterization . Additional GTM PVC was performed with “incorrect” parameterizations, taken around the correct value. The result is a set of regional activity values for each of the GTM applications. For each case, activity values from various ROIs were combined and normalized to produce standardized uptake value ratios (SUVRs) for nine standard [11C]PiB quantitation ROIs and a global region. GTM operating-point characteristics were determined from the slope of apparent SUVR versus w curves.Twenty-nine subjects with Pittsburgh Compound B ([w on the order of 1 mm (3D) mainly produce only modest errors of up to a few percent. An exception was the anterior ventral striatum in which fractional errors of up to 0.29 per millimeter (3D) of error in w were observed.Errors in specification of While this study does not address all the issues regarding the quantitative strengths and weakness of GTM PVC, we find that with reasonable caution, the unavoidable inaccuracies associated with PSF specification do not preclude its use in amyloid quantitation.The online version contains supplementary material available at 10.1186/s40658-021-00403-5. Image-based partial volume correction is frequently used in positron emission tomography (PET) to compensate for the effects of imperfect spatial resolution on image quantitation. A commonly employed procedure is the Geometric Transfer Matrix (GTM) method , which iw) determined from point-source measurements. However, the true functional form of the scanner point-spread function (PSF) is not Gaussian and is not translationally invariant THK-5351. Both of these studies used simulated data.In amyloid PET imaging, GTM PVC results in substantial modification of outcome values, including standardized uptake value ratios (SUVR), which in turn, can affect amyloid-status classification, diagnostic group effect size, and longitudinal change measures –16. Give11C]PiB imaging using real scan data. We first aim to map the dependence of GTM PVC on regional uncorrected SUVR and assumed PSF w. We then aim to characterize GTM PVC errors that could reasonably be expected due to PSF misspecification. One particular concern addressed in this work is the potential for misclassification of the amyloid status (positive or negative) of subjects due to such errors.The goal of the present study is to perform an in-depth evaluation of the sensitivity of the GTM method to scanner point-spread function specification in [18F]AV-1451. Scans were selected based on previously determined uncorrected SUVRs (reference region: cerebellar gray matter) as described in the Image Processing and [11C]PiB Quantitation sections below, with the goal of spanning the range of observed [11C]PiB SUVR in our facility. To avoid inclusion of too many scans at the low end of [11C]PiB SUVR uptake spectrum, the final selection was limited to 29 subjects .Scans from subjects who previously had PET and magnetic resonance (MR) imaging acquired and analyzed at the University of Pittsburgh were selected for this analysis. Because this cohort is being used in a separate analysis, subjects must also have had a scan with the tau tracer, [11C]Pittsburgh Compound-B ([11C]PiB) SUVRs spanning the range of 0.97-2.42. Of these, 15 were classified as globally [11C]PiB positive and 14 were classified as globally [11C]PiB negative using our current standard threshold for non-partial-volume-corrected data of 1.346 developed from a sparse k-means-analysis modified [Selected PET scans had global [modified  from themodified . All stuAll subjects received T1-weighted MR scans on a Siemens PRISMA 3T scanner using a sagittal Magnetization Prepared Rapid Gradient Echo (MPRAGE) sequence .11C]PiB 50 min prior to the start of PET component of the scans. Prior to the PET, a low dose CT was acquired without contrast for the purpose of attenuation and scatter correction of the PET data. PET emission data were acquired over the interval 50-70 min post-injection. To allow for investigation of possible subject motion during the scan, raw PET data (sinograms) were binned into 4 5-min frames that were then reconstructed by FORE/Filtered back projection. In keeping with our quantitation pipeline, no post-reconstruction filtering was applied. PET reconstruction was performed using the manufacturer’s software and included corrections for scatter, deadtime, random coincidences, and decay.PET scans were acquired using a Siemens mCT PET/CT scanner. Subjects were injected with 560 MBq  of PiB ROIs  and a combined global region. Forty-six of the FS ROIs are used in the process, the combinations of which are delineated in Supplemental Table 11C]PiB ROI values to generate regional SUVR measures. Normalization by cerebellum gray matter activity was performed after each GTM correction.For each GTM case, FS regional activity values (after GTM correction) from various FS ROIs were combined (volume-weighted average) to produce radioactivity concentration values for a standard set of nine 1CPiB ROI11C]PiB activity values, the overall functional characteristics of GTM were determined by examining the apparent [11C]PiB SUVR as a function of the assumed point-spread function full-width at half-maximum for each of the standard quantitation regions described above.Starting with the various versions of the GTM-corrected regional [11C]PiB quantitation regions asWe defined GTM raw activity correction factors for the PiB region and constituent [11C]PiB ROIs as a function of w used in performing a GTM PVC. The plots illustrate the magnitude of the effect of GTM PVC on SUVR. Compared to uncorrected values (w = 0), the application of the GTM with the standard kernel (w = 5) spreads out the SUVR measures for all regions, a finding that is consistent with reports of PVC-associated effect size increases  PiB quantification regions and for the global region. We find an approximately linear relationship between these quantities for the global and the individual regions, as shown by the best-fit lines. Results for all regions are provided in Table R2) of the linear fit, and the slope and y-intercept of the fit. We also find that for each region, the fit lines cross the x-axis at some point over the range of CSUVR values encountered in this study. These are listed in Table CSUVR-intercept heading. The figures also show the values of FECer, the cerebellar gray matter (negative) contribution to the SUVR fractional error. Cerebellum activity correction factors CCer(w = 5mm) (not shown) span a tight range, compared to the CSUVR, with values from 1.02 to 1.11, a mean of 1.06 and a standard deviation of 0.02.In Fig.  for all 1CPiB quaFESUVR, root mean square (RMS) of FESUVR, and the FESUVR population standard deviation for each region taken over all subjects. The same quantities are then shown stratified by regional amyloid positivity based on the GTM-corrected SUVR using our standard [11C]PiB thresholds. The table also shows the volume of each region, averaged over subjects, as determined in the FreeSurfer analysis.An overall error-scale summary is presented in Table FESUVR, for all regions as in Fig. FESUVR in the vicinity of the [11C]PiB (GTM corrected) positivity thresholds indicated by the vertical lines in the plots. Thus, for example, in the global region, in the vicinity of our positivity threshold, we find about a 0.031 GTM-corrected-SUVR fractional error per millimeter of error in the PSF specification. Table x-axis), the positivity threshold indicated by the vertical lines, and the FESUVR at the GTM-corrected SUVR positivity threshold based on the fit.Figure w value. Thus, a positive error in the w specification would tend to make increasing SUVR values in a longitudinal study appear to increase slightly faster than in the case of no PSF error. Similarly, a negative error would result in an apparent slightly slower rate. The GTM method, assuming valid a priori assumptions and a correct PSF model, is expected to be unbiased for most situations [w value . This typically results  found in this study occurred in the anterior ventral striatum and a total of 8 subjects had anterior ventral striatum |FESUVR| values > 0.1 mm−1. All such values were negative  and are associated with subjects who were [11C]PiB negative and at the lowest end of the SUVR scale . There were two other regions in which |FESUVR| values > 0.1 mm−1 were observed. The anterior cingulate yielded one point with an FESUVR value of −0.12 mm−1 and the insula yielded one point at −0.10 mm−1. Both of these are from the same subject and are associated with GTM-corrected SUVR that are well below the corresponding regional positivity thresholds. The largest positive individual FESUVR was observed in the orbital frontal region of a [11C]PiB positive subject with a value of 0.082 mm−1.The operating point analysis shows that misspecification of the PSF produced a relatively modest effect on GTM partial volume correction in most cases. The highest m−1 Fig. . HoweverFESUVR values listed in Table FESUVR value of 0.090 mm−1 and the lateral temporal region to be the least sensitive with an RMS FESUVR value of 0.036 mm−1. The global region was found to be relatively insensitive to point-spread-specification error with an RMS FESUVR value of 0.039 mm−1.The RMS 3) used in this analysis, the anterior ventral striatum, which showed, by far, the greatest sensitivity to PSF specification error was, by far, the smallest, with an average volume of 1.7 cm3. As described above and as can be seen in Fig. FESUVR value of the anterior ventral striatum is driven by subjects with negative FESUVR values. These correspond to subjects with low SUVR  that typically have small volume-to-boundary ratios compared to larger regions.Regional sensitivity to PSF specification depends on differences in concentrations between neighboring regions coupled with region size. Our results are consistent with this: while the lateral temporal region is one of the largest regions  contribution to FESUVR from the GTM correction applied to cerebellar gray matter, which is used to normalize regional activity. In most cases, the cerebellar contribution is small; the exception being, unsurprisingly, when FESUVR values are near 0.In addition to the various regional CSUVR  up to about .023  for SUVR in the vicinity of positivity thresholds ) of our Siemens Biograph mCT. Errors in specification of w on the order of 1 mm (3D) mainly produce only modest errors of up to a few percent compared to the overall magnitude of the GTM correction itself. In the global region, operating point SUVR fractional errors per millimeter of w error (FESUVR) ranged from −0.043 to 0.071 mm−1 with an RMS value 0.039 mm−1. However, some caution is necessary in evaluation of some regions (see Table FESUVR values ranging from −0.29 to 0.048 mm−1. In the vicinity of the University of Pittsburgh positivity thresholds, FESUVR values were small in all regions, including global, and ranged from −0.036 to 0.045 mm−1.The GTM correction, assuming a Gaussian kernel, taken as a function of assumed kernel width, Additional file 1: Supplemental Figure 1. SUV of cerebellar gray matter as a function of GTM FWHM. The SUV scale is logarithmic.Additional file 2: Supplemental Table 1. FreeSurfer 5.3 constituents of the standard [11C]PiB quantitation regions. As described in the text, the anterior ventral striatum is composed of regions from the CIC atlas. Cerebellar gray matter is used as a reference region.Additional file 3. Proof that the derivative of the GTM-corrected activity values with respect to w is 0 at w = 0.


Current alignment tools typically lack an explicit model of indel evolution, leading to artificially short inferred alignments  due to inconsistencies between the indel history and the phylogeny relating the input sequences.https://github.com/acg-team/ProPIP and is distributed under the terms of the GNU GPL v3 license.We present a new progressive multiple sequence alignment tool ProPIP. The process of insertions and deletions is described using an explicit evolutionary model—the Poisson Indel Process or PIP. The method is based on dynamic programming and is implemented in a frequentist framework. The source code can be compiled on Linux, macOS and Microsoft Windows platforms. The algorithm is implemented in C++ as standalone program. The source code is freely available on GitHub at The use of an explicit indel evolution model allows to avoid over-alignment, to infer gaps in a phylogenetically consistent way and to make inferences about the rates of insertions and deletions. Instead of the arbitrary gap penalties, the parameters used by ProPIP are the insertion and deletion rates, which have biological interpretation and are contextualized in a probabilistic environment. As a result, indel rate settings may be optimised in order to infer phylogenetically meaningful gap patterns. Multiple sequence alignment (MSA) is a fundamental task required by most genomic analyses, with a multitude of alignment tools already available. Due to the inherent computational complexity of MSA inference, several heuristics have been proposed. The progressive approach is one of popular strategies that involves aligning pairs of sequences or alignments from the tips towards the root along the tree structure that represents the evolutionary relationship of the input sequences . At each internal node a dynamic programming instance (DP) aligns the partial solutions present in its two child nodes. In general, the partial MSA solutions at each inner node and hence also the final MSA at the tree root correspond to the local optima obtained by maximizing the partial solution in a smaller space spanned by local pairwise alignments. This approximation is however widely accepted and represents the status quo today. Typically the DP algorithm scales quadratically with the average length of the sequences , 2.i.e., artificially short alignments). Among notable exceptions are PRANK [Classically, however, aligners only consider substitutions and the length distribution of the observed sequence gaps. These methods typically do not explicitly model the evolution of indels (insertions/deletions). This shortcoming can lead to a disconnect between the history of indel events and the phylogenetic relationship of the sequences, and the consequent visible distortions are over-alignment  using DP, to obtain the homology history at the current node. More specifically, at each node the likelihood computation marginalizes over all possible indel and substitution scenarios given the sub-alignments obtained for the child nodes in the previous steps of the progressive algorithm. This includes homology histories where all characters have been deleted, i.e. unobserved or “empty” columns. In a given node, any two MSA columns from the child nodes can be aligned in three ways: either they matched, or any of the two columns is aligned with a column full of gaps. Each of these three states can in turn imply a number of scenarios which, depending on the depth of the tree and the number of gaps present, can also be large. The algorithm computes the likelihood for each of the three scenarios, In particular, we consider all possible places where a character may have been inserted along the phylogeny and all possible points where it may have been deleted. All these homology paths are listed and marginalised into a single likelihood value, without having to make a choice of one scenario (e.g. based on parsimony or ML).Our DP is locally optimal, i.e. in each internal node the two sub-alignments are aligned by full ML. Progressive application of DP, however, does not lead to a globally optimal solution. To overcome this greedy behaviour, we have enhanced our method with SB - stochastic backtracking , adaptedSB provides an ensemble of sub-optimal candidate solutions, distributed according to their individual probabilities. During progressive alignment with the SB option, SB is applied at each internal node. Instead of aligning only the optimal histories at the two children, the aligner generates an ensemble  of histories combining samples from the distributions at the children nodes. Therefore, the SB version of the algorithm reduces the chances to be trapped in local optima produced by the greedy nature of the default progressive DP.T , which tunes the deviation from the optimal alignment. For SB is parameterised by a temperature ProPIP can align either nucleotide  or amino acid  sequences, based on different substitution models available in the Bio++ library . Among tIn addition, users can choose to account for Across-Site Rate Variation (ASRV), which is implemented as a discretised Providing a reasonable initial guide tree  and indeThe same applies to indel rates (insertion rate and deletion rate), which are inferred from the data when not provided by the user. We compute the initial indel rate values of the PIP model from pairwise alignments using the Needleman-Wunsch algorithm with gap opening and extension penalties for nucleotide sequences and a Grantham distance-based scoring method for amino acids . The indlgorithm , 15. TheFinally, the various indel rates are averaged to obtain the initial insertion and deletion rate. The estimated indel rates eventually determine the resulting MSA gap pattern.ProPIP allows the optimisation of model parameters, such as indel rates or the instantaneous substitution rates between characters. These features are inherited from Bio++ libraries. When requesting parameter optimisation, the system automatically instantiates the appropriate OptimizationTools class object. As input, this object receives a pointer to the likelihood function, which can be evaluated under PIP if the user wishes to invoke this evolutionary model. It is also possible to specify the maximum number of iterations or a tolerance value at which the optimisation ends. The user can monitor the optimisation progress and the final values in the two files “profiler” and “messenger”. Among the various Bio++ functions that ProPIP couples with the PIP model are the Brent and BFGS optimisation routines. In both cases the method optimises all parameters until convergence, respecting the requested thresholds or the maximum number of steps. If, on the other hand, the user desires to fix parameters at given values, this can be specified via the “None” optimisation option.The syntax is the following: optimisation=ND-Brent. It is also possible to specify which parameters to ignore, for example if the user wants to optimise the insertion rate https://github.com/oneapi-src/oneTBB, which can be activated by the user (see documentation). The following parallelisation options are provided:To reduce the computational time, ProPIP was parallelised. We use the open source version of Intel Thread Building Blocks library available at parallel_for: In this option, for-loops have been rewritten to exploit tbb::parallel_for loops provided by Intel TBB. This loop instruction allows to split the looping range into smaller chunks that are then executed in parallel by TBB’s tasks. This approach has been applied to the vector and matrix initialization loops and to the actual dynamic programming forward phase, where the likelihood matrices are computed and the maximum likelihood score is sought. To preserve the optimisation algorithms in the parallel execution context, the local optimum comparison and variable update have been protected using a locking mechanism (tbb::mutex). The necessity of this lock clearly influences and limits the achievable parallelism of this approach.TBB Task: The TBB Task optimization provides more flexibility during the parallelization. Instead of parallelizing the internal loops this approach focuses to parallelize each node. The tree topology is processed in a post-order traversal, from the leaves towards the root of the tree. Starting from the root node each node creates 2 tasks (1 for each child node) and executes them in parallel before doing its own processing. This recursive process is repeated until the leafs of the binary tree are reached and the actual execution begins. Each node is executed as a separate parallel task, which leads to a more dynamic parallelism. Table n-taxa trees and as the number of columns to be aligned increases. The speed-up factor improves when increasing the number of taxa while it remains constant when augmenting the number of columns.Thread control: to have a better control of the parallel execution environment it is possible to limit the number of threads the TBB library will create and use to execute the parallel tasks. Finally, also thread pinning can be enabled, which allows to specify the CPUs the threads will be assigned to.Our previously published results  show thaFigures Popular state-of-the-art alignment software typically relies on gap penalties and modifying them visibly affects the inferred gap patterns. How to set these appropriately for a given dataset is unclear. The usual practice is using default values, which are inferred by software developers empirically, for example based on real data benchmarks. However, benchmarking and tuning MSA inference is known to be notoriously difficult . Defaulti.e., they allow to accommodate any special features of an individual dataset, rather than relying on generic indel values.In contrast, gap patterns inferred by ProPIP are controlled by insertion and deletion events that are mathematically described by a generative evolutionary process. Therefore, gap patterns inferred by ProPIP are phylogenetically consistent and require no a priori chosen gap costs. Instead, the initial indel rates are computed from the input sequences at hand and eventually can be optimised (for example by maximum likelihood). The resulting indel rates and events are biologically meaningful and, moreover, are dataset specific, The popular aligner PRANK was the first to correct for over-alignment using an algorithmic approach to distinguish insertions from deletions. MAFFT followed up with a different approach, based on using variable scoring matrix for different pairs or groups of sequences. ProPIP, the software presented here, avoids the over-alignment problem by using the explicit model to describe indel evolution over time.Previously, we showed that both PRANK and our PIP-based methods produce high quality and phylogenetically consistent alignments of similar length, but vary in the inferred gap pattern . The avaOn the other hand, one may rightfully doubt whether an MSA inference method based on a single-residue indel model like PIP is capable of inferring long gaps. While this will be the subject of a separate large-scale systematic study, our preliminary results show that ProPIP does infer long gaps when these are suggested by the data .Through the phylogeny-aware explicit description of indel evolution, the PIP model leads to more plausible MSAs than more traditional methods relying on arbitrary gap penalties. ProPIP avoids overalignment, estimate indel rates, and infers gap patterns that are consistent with the phylogeny. Overall, this leads to results that have a proper biological interpretation. Note that phylogenetic aligners are sensitive to the quality of the guide tree and are likely to perform rather poorly on structural benchmarks , 26. For


Chromatiblock is freely available under a GPL license, for macOS, GNU/Linux and Microsoft Windows from  Visualizing structural variation between complete prokaryotic genomes is important for identifying the genetic basis of strain differences. This is generally accomplished by displaying the results of serial pairwise comparisons or multiple alignments in linear or circular layouts. Serial pairwise comparisons can be created using tools such as Easyfig  or GenopMultiple alignment visualization tools such as Mauve  and GenoCurrent methods of visualizing multiple genomes either don’t scale well, or only capture limited information about structural variation. With complete genomes becoming more prevalent, there is an need for a tool that can do both well. Chromatiblock was designed to create a linear visual representation of structural variation, including the presence and absence of genomic regions in an easy-to-comprehend and scalable manner, adding to the visualization options available for alignments of large numbers of complete genomes.Chromatiblock is a Python script available under a GPL license and runs on macOS, GNU/Linux and Microsoft Windows operating systems. Chromatiblock can be used to create publication-quality images displaying arrangement and presence of syntenic blocks. The results can also be viewed as an interactive webpage that allows the user to zoom, pan and highlight shared regions across genomes.Chromatiblock takes an extended multi-fasta alignment (MAF) file as input, which can be generated by a variety of multi-genome alignment programs . AlternaClostridioides difficile genomes is shown in An example of a global alignment of 28 complete C. difficile pathogenicity locus (PaLoc) that contains the genes encoding the TcdA enterotoxin and TcdB cytotoxin, has been lost in the ST100 isolate. Plasmids carried by C. difficile are very chimeric, with large regions being shared, but with only the two MLST8 isolates carrying identical plasmids. In conclusion, Chromatiblock allows users to quickly and easily create publication-quality figures showing structural changes and genetic diversity at the whole genome level.The alignment difference view shows the presence and absence of all non-core blocks. Chromatiblock can use BLAST+ to categorize and color each non-core block based on a user-provided reference database of nucleotide or amino acid FASTA files. Categories can also be assigned based on the size of the contig in which the non-core block is found. The example in


Various ways to enhance the reference with pangenomic information have been proposed, but scalability combined with seamless integration to existing workflows remains a challenge.Variant calling workflows that utilize a single reference sequence are the PanVC with founder sequences, a scalable and accurate variant calling workflow based on a multiple alignment of reference sequences. Scalability is achieved by removing duplicate parts up to a limit into a founder multiple alignment, that is then indexed using a hybrid scheme that exploits general purpose read aligners. Our implemented workflow uses GATK or BCFtools for variant calling, but the various steps of our workflow  can be of independent interest as a basis for creating novel pangenome analysis workflows beyond variant calling.We present https://github.com/algbio/panvc-founders.Our open access tools and instructions how to reproduce our experiments are available at the following address: Bioinformatics online. The established method for variant calling is to align short reads to some reference genome and then determine the genomic loci for which enough reads support variation with respect to the reference genome. This standard approach suffers from the bias toward the variations chosen for the reference genome , raisingThe most straightforward method is to modify the reference genome or to encode variants into it in order to improve read alignment accuracy . This saves time and space in comparison to using the predicted haplotype sequences of the donors as is. The reads from a given sample are then aligned to them and, based on those alignments, a single ad hoc reference sequence is generated (PanVC Preprocessor). A conventional variant calling workflow is then run with the ad hoc reference and the same reads as its inputs . Finally, a co-ordinate transform is applied to the called variants to project them to the original reference co-ordinates, and the variants that are part of the ad hoc reference are reported as well (Projection). The workflow is illustrated in Our workflow on a high level consists of the four following steps. Founder sequences are generated from the variants of a group of donors  is determined for each node. The aligned position of the first node is 1. For all other nodes, the aligned position is calculated by taking the maximum over the length of the label of each in-edge added to the aligned position of the source node of that edge. These can be computed in linear time in any topological order of the graph.Next, an Certain paths through the graph will now correspond to the samples in the original VCF file. By following such a path, the predicted haplotype sequence of the sample in question may be read by concatenating the edge labels. The reference-guided multiple alignment may also be created by following these paths. After following an edge, the length of its label and the aligned position of the source node are subtracted from that of the target node. The resulting number of gap characters is then appended to the sequence after the edge label. v is the number of variant records such that their properties required by the algorithm may be accessed in constant time, and o is the maximum number of overlapping variants. Creating the variant graph may be done in 2.1.2For our variant graph, all the reference sequences can be read by following a path that goes from the first node to the last node. To align a set of reads on the reference sequences, we must embed the reads into the variant graph. As the number of unique paths of the variant graph, i.e. paths with different sequences of edges, is bounded below by the number of distinct samples in the original variant file, the alignment process may be computationally too expensive.founder segments  of at least L are considered where L is a user-defined parameter.L = 4. Now suitable cut positions are nodes 7 and 12 as they are connected by a bridge. The lengths of the resulting segments in terms of reference positions are 6, 5 and 7. In general, the label of the connecting edge is not required to be in a separate segment. Since the length of the label in this case is greater than L, creating such a segment is possible.Continuing the example in r, we cut by a bridge node between the first node and r and check the minimum number of paths between the first node and the bridge node (dynamic programming condition), as well as between the bridge node and r. Formally, we have the following equation:Q is the set of bridge nodes and d is a function that gives the number of unique paths between two nodes.We determine the best choice of cut positions to minimize the number of founder sequences by utilizing a dynamic programming algorithm. To determine the minimum number of paths between the first node and a node L, the segmentation with the most recently cut final segment is chosen. This does not worsen the segmentation since moving the starting position of the last segment left would not decrease the number of unique paths in it. For listing the cut positions, we maintain a tree of possible cut positions and backtrack from the final leaf node that represents the chosen segmentation. The preprocessing step may be done in O(vwz) time where v is the number of variant records, w is the maximum number of active candidate segmentations and z is the number of samples.To make the algorithm more practical, we utilize branch pruning. If at a given point there are multiple candidate segmentations in which the length of the last segment is at least Generating founder sequences from a segmentation. The paths in the segments of the variant graph are joined using a greedy algorithm similar to the one used by s and t is processed from left to right as follows. A bipartite graph f nodes in both S and T, and set of edges E is determined as follows. First each distinct path in s and t is assigned a node from S and T, respectively, while the remaining nodes are considered available. Then distinct paths in the concatenation of s and t  are sorted in descending order by number of occurrences. Each path is then processed by connecting the corresponding nodes in S and T by an edge. If the corresponding node has already been connected in either S or T but there is an available node, it will be assigned the path in question and the edge will be drawn. Otherwise, the next path will be considered. When all distinct paths have been processed, the remaining nodes are connected arbitrarily.S and T, and the sequences are joined as indicated by E. If some of the nodes are still available, the corresponding sequences may be filled with N characters. Similarly to the haplotype sequences, writing the founder sequences to the disk can be done in linear time with respect to the sum of the sequence lengths.To generate the founder sequences, a reference-guided multiple alignment is created like before. To this end, each segment may be processed separately as each pair of consecutive segments is connected by a single edge. The multiple alignment is created for each path represented by the nodes of kernel sequence  with reads generated from the variants of one bacterium from the same generation. We used paired-end reads of 100 bases with 1% error rate and varied coverage. From the called variants, we generated the predicted sequence of the bacterium and calculated the edit distance to the original with Edlib . The res3.1.1In all cases, our predicted sequence was significantly closer to the original than the baseline. E.g. with 20× coverage the predicted sequence generated from variants called by GATK had edit distance of 1116 from the original while our prediction with the same variant caller had edit distance of 1 when using the variants from the tenth generation of simulation with mutation rate of 0.002.We got consistently better results by using a variant calling workflow based on BCFtools instead of GATK in terms of edit distance to the original sequence. We believe this to have happened due to the random nature of the generated variants.Using founder sequences instead of all haplotype sequences of the related samples did not affect the results negatively.3.1.2L reduces the number of segment boundaries in the founder sequences, it also causes the number of generated founder sequences to approach that of the original samples. On the other hand, decreasing the value leads to short segments, which affects the variant calling results negatively. As the segment boundaries occur more frequently, the number of generated founder sequences would have to be increased in order to increase the likelihood of a subsequence matching to a given read occurring in the index.While increasing the value of L = 50 would produce results similar to generating an index from all of the haplotype sequences of the related samples. Different values of L did not affect the results of the second and the third experiment notably.Based on our results, we determined that choosing E.coli bacteria in order to show that our workflow produces good results with natural data. Since comparing the variant calling results to truth would be difficult, as the DNA sequences of the bacteria in the samples were not known, we decided to inspect the read alignment results. The sequencing data were downloaded from Sequence Read Archive (SRA) maintained by National Center for Biotechnology Information, Bethesda, MD, US. The identifiers of the data are listed in In our second experiment, we used 20 samples of real E.coli bacteria and generated generate pairwise alignments with each and E.coli K-12 substr. MG1655 using Edlib aligner , we used only a single E.coli K-12 substr. MG1655 reference sequence for indexing. Similarly to PanVC’s second stage, BWA-MEM was used to align the reads. For the second alternative workflow (Consensus), we chose 19 random E.coli reference sequences from the set of 99 references and added that of E.coli K-12 to the set. We then generated a consensus sequence with BCFtools ((PanVC (haplotypes)), we used the same 20 reference sequences as indexing inputs but generated the index with PanVC. The reads were aligned by running the PanVC workflow.We compared PanVC with founders to three other workflows. In the first workflow , the minimal number of aligned blocks that cover at a given proportion of the reference genome (‘LGAx’) and the number of mismatches per 100 kbp. The results are shown in To supplement our analysis, we chose five more samples from SRA for the strains of which 3.2.1The statistics collected with Samtools indicate that the alignment results were favorable for PanVC compared to baseline: The number of mapped reads and bases were higher. The number of unmapped reads and reads with zero mapping quality, as well as the number of mismatches were lower.Differences between PanVC with random haplotypes and PanVC with founder sequences were quite small. Indeed, using a random subset is another way of making PanVC scalable. However, we propose using founder sequences for this purpose as they are a deterministic and systematic means to take into account all haplotypes in the input. We also note that the number of reads with zero mapping quality was smaller when PanVC was used with founder sequences compared to either baseline or PanVC with haplotypes.While in the alignment results of both PanVC and baseline there are regions to which a smaller number of reads have been mapped, PanVC’s results show smaller differences among regions. When determining the heaviest path, PanVC takes deletions supported by the alignments into account while insertions are ignored. However, based on our results, this has not caused an increase in unmapped regions.In case of the consensus workflow, very few reads were mapped (some 3000 to 22 000 out of 1 million to 5.7 million depending on the sample). We believe this may have had to do with the large number of variants in the indexing input; there were some 300 000 loci out of 4.6 million that were not a starting position of a variant even after removing the overlapping variants.de novo sequenced contigs had fewer mismatches with the predicted sequence of PanVC compared to that of baseline when BCFtools was used for variant calling. When GATK was used the differences in the number of mismatches were small. The other metrics showed that the number of aligned blocks needed to cover a proportion of the predicted sequence generated with PanVC was smaller than that generated with baseline. Similarly, the minimum length of the aligned blocks in the set that is needed to cover at least a proportion of the predicted sequence generated with PanVC was greater than that generated with baseline.Comparison done with QUAST also indicates that the A natural step was to test our workflow with human data. We simulated a situation where the whole genome of an individual is sequenced but variant analysis is done on one chromosome only. We used the sequencing data for NA12878 from Illumina Platinum Genomes project . Based on the results we determined that the known variation is represented sufficiently well with a very small number of founders. We set L = 2 and generated two founder sequences for chromosome 1 in addition to the reference sequence.The value for For comparison we chose three other workflows: A baseline workflow used hs37d5 as the reference sequence. Second alternative workflow used GraphTyper 2  Xeon(R) CPU E7-4830 v3 processors running at 2.10 GHz. We measured the time and memory required and for the latter separated the steps that are specific to our workflow. As the time and memory usage were measured per-process, we used the maximum time when the number of steps done in parallel was smaller than the number of processors, and otherwise calculated an average time spent by one processor.At the same time, the proportions of mapped reads as well as the edit distances of the reads were determined by inspecting the alignment flags in the resulting BAM files. The results are shown in 3.4.1The timing results are shown in 3.4.2As seen in In our experiments, we tested our approach of using both multiple reference sequences as well as generating a modified reference sequence. We have shown that the approach yields good results in different types of scenarios. The precision and recall of our predicted variants is good compared to those received from both conventional and graph-based workflows. When tested with a set of reads generated from a sample that contained a high number of mutations, our prediction of the DNA sequence of the sample was very close to the truth. However, our attempts to show similar improvements with real sequencing data of human genome ended up with somewhat equivocal results: On a ground-truth data based on variant calls from a standard reference, best results were attained using no pangenomic information at all. On another real dataset, better read alignments were achieved using PanVC when compared to a standard workflow.We believe that the workflow achieves the good results by utilizing existing tools that are tried-and-tested for variant calling. Since the tools that we developed can be integrated to other conventional workflows, it is possible to improve their accuracy especially in handling difficult genomic regions.When generating the founder sequences, we considered allele phasing in that alleles from the same chromosome copy would occur in the same path. A natural direction to which improve our approach would be considering whether some variants occur in the same chromosome copy and placing the variants in question to the same founder sequence. The idea could be extended by generating one ad hoc reference sequence for each homologous chromosome. This would require support from other tools that are part of the workflow, though.Scalability of the workflow can be further improved by adding support to distributing the workload to a cluster. This has already been accomplished for the original PanVC workflow using Spark . We briefly tested some alternatives: One option was to choose the highest-scoring nucleotide for each position of the ad hoc reference instead of taking the nucleotide from the founder sequence with the highest score. Another was to use a dynamic programming algorithm to limit switching from one founder sequence to another. However, the current algorithm yielded the best variant calling results so far.Another important future extension to our workflow is adding support to structural variants. While graph-based pangenome representations may extend more naturally to encode such variants (btab516_Supplementary_DataClick here for additional data file.