Therefore, we sought to optimize bwa-mem for alignment of data from multi-species samples in order to reduce alignment time and increase the specificity of alignments. In the multi-species cases examined, there was one majority member  and one minority member (i.e. human or the Wolbachia endosymbiont wBm) of the sequence data. Increasing bwa-mem seed length from the default value reduced the number of read pairs from the majority sequence member that incorrectly aligned to the reference genome of the minority sequence member. Combining both source genomes into a single reference genome increased the specificity of mapping, while also reducing the central processing unit (CPU) time. In Plasmodium, at a seed length of 18 nt, 24.1 % of reads mapped to the human genome using 1.7±0.1 CPU hours, while 83.6 % of reads mapped to the Plasmodium genome using 0.2±0.0 CPU hours . In contrast, 97.1 % of the reads mapped to a combined Plasmodium–human reference in only 0.7±0.0 CPU hours. Overall, the results suggest that combining all references into a single reference database and using a 23 nt seed length reduces the computational time, while maximizing specificity. Similar results were found for simulated sequence reads from a mock metagenomic data set. We found similar improvements to computation time in a publicly available human-only data set.As sequencing technologies have evolved, the tools to analyze these sequences have made similar advances. However, for multi-species samples, we observed important and adverse differences in alignment specificity and computation time for  BWA, Burrows–Wheeler aligner; CPU, central processing unit; LGT, lateral gene transfer; MEM, maximum exact matches; SRA, Sequence Read Archive; SW, Smith–Waterman Alignment.http://www.internationalgenome.org, accession number ERR022446), the three Plasmodium–human datasets are available from the Wellcome Trust Sanger Institute in the SRA , the Brugia–Wolbachia dataset is available from the University of Maryland Institute for Genome Sciences in the SRA (accession number SRR5188379 https://www.ncbi.nlm.nih.gov/sra/?term=SRR5188379) and the simulated data from the mock metagenome dataset is available from the University of Maryland Institute for Genome Sciences in Dryad doi:10.5061/dryad.m1m0p. Tables S1, S2, and S3 are available in the online Supplementary Material.The human dataset analyzed during the current study is available from the 1000 Genomes Project in the Sequence Read Archive (SRA) (bwa)-aln and bwa-mem (maximum exact matches). In this case, optimization could be obtained with bwa-mem by using a combined reference, containing all of the genomes of the species present, and changing the seed stringency. There are many uses for aligners for multi-species datasets that will benefit from this optimization including: (a) use in dual-species RNASeq datasets where mis-mapping leads to inappropriate gene expression calculations, (b) use in identifying discordant read pairs that suggest horizontal/lateral gene transfer, and (c) use to cull datasets, for instance removing human reads from clinical pathogen data sets prior to data deposition. All of these cases will benefit from the increased specificity of the optimization here with little loss to sensitivity.As most organisms do not live in isolation, it can be informative to study combinations of organisms in co-culture. This has been greatly facilitated by ever improving sequencing data and tools. However, many of these tools were not developed for multi-species datasets, and it is not immediately apparent that optimization is needed or what optimization is needed. How multi-species datasets are handled varies even between generations of the same aligner, like the Burrows–Wheeler aligner (bwa). The bwa software package allows users to align highly similar sequences to a large reference genome based on searches for exact matches with the Burrows–Wheeler transform [bwa algorithms: bwa-aln (or bwa-backtrack), bwa-sw (Smith–Waterman Alignment) and bwa-mem (maximum exact matches). bwa-aln was the original bwa algorithm and was developed for 36–100 bp reads [bwa-aln allows for gaps and mismatches, facilitating the identification of insertions and deletions [bwa-aln was 10–20× faster than the leading alignment tool, without sacrificing accuracy [One of the most popular tools for aligning genome sequencing reads to a reference genome is the Burrows–Wheeler aligner -based analysis [melt) [bwa-generated alignments. melt was used in the 1000 Genomes Project to identify structural variants and LINE element insertion and deletion events in these samples [bwa-aln to align read pairs to identify lateral gene transfers (LGTs) from a donor organism to a recipient organism [bwa-aln to accurately identify these categories of reads.While analysis , it has s [melt) , which i samples . LGTSeekorganism . LGTSeekorganism . This apbwa-mem aligns the sequencing reads to the reference more quickly than bwa-aln [Wolbachia endosymbionts and Drosophila ananassae, and was solved by combining the reference genomes. In this case, in preliminary work, bwa-aln and bwa-mem were both used for the alignments, but the counts were wildly different. More specifically, bwa-mem mapped bona fide Wolbachia sequencing reads to the D. ananassae reference genome, when only a very small portion of the read matched the Drosophila reference genome. This likely results from the fact that bwa was designed with the intent of mapping sequence data from a single organism to a single reference genome. However, as more tools use bwa for multi-species comparisons and more researchers use it in host–pathogen samples, these misalignments can significantly confound analyses.While  bwa-aln , we have bwa-aln  from Wolbwa-mem in eukaryote/eukaryote and eukaryote/prokaryote dual-species datasets by altering various options to prevent incorrect mappings. We identified appreciable effects upon altering the seed length of bwa-mem alignments, which determines the minimum base pair length of an exact match, and by default is 19 nt. Since bwa-mem can handle larger reference databases, we also separately analyzed the effect of combining host–pathogen references into one larger database. Both methods decrease computational time, while increasing or maintaining specificity of the alignments. During this research, we also observed that the computational time spent on human genome sequence alignments, in general, could be decreased by increasing the seed length, which we attribute to the time spent attempting to align poor quality, off-target, non-human contaminant sequences to the reference genome.Here, we sought to optimize http://www.internationalgenome.org, ERR0 22446). The data is from a Colombian male and the sample (HG01133) of B-lymphocytes was collected from the peripheral vein [The 100 bp paired-end Illumina human dataset is available from the 1000 Genomes Project in the Sequence Read Archive (SRA)  from a study that extracted DNA from leukocyte-depleted blood samples or after short-term in vitro culture [The 76 bp paired-end Illumina  culture . These s culture .Brugia–Wolbachia dataset is available from the University of Maryland Institute for Genome Sciences in the SRA (SRR5188379) from a currently unpublished study designed to test DNA amplification methods on low input DNA samples. DNA was extracted from a population of Brugia malayi worms. Qiagen Repli-G (Qiagen) was used to amplify 2 ng genomic DNA with tetramethylammonium chloride (TMAC)[The 101 bp paired-end de (TMAC). A genomart, version 2.3.7 sd of 105 bp was generated across the reference genomes: Acinetobacter baumanii ATCC17978; Actinomyces odontolyticus ATCC17982; Bacillus cereus ATCC10987; Bacteroides vulgatus ATCC8482; Clostridium beijerinckii ATCC51743; Deinoccous radiodurans DSM20539; Enterococcus faecalis ATCC47077; Escherichia coli ATCC700926; Helicobacter pylori ATCC700392; Lactobacillus gasseri DSM 20243; Listeria monocytogenes ATCCBAA-679; Methanobrevibacter smithii ATCC35061; Neisseria meningitidis ATCCBAA-335; Propionibacterium acnes DSM16379; Pseudomonas aeruginosa ATCC47085; Rhodobacter sphaeroides ATCC17023; Staphylococcus aureus ATCCBAA-1718; Staphylocococcus epidermidis ATCC12228; Streptococcus agalactiae ATCCBAA-611; Streptococcus mutans ATCC7 00610; and Streptococcus pneumoniae ATCCBAA-334.A dataset of 101 bp paired-end sequencing reads from a mock metagenomic community was simulated with sam output files using bwa v. 0.7.12. The qsub -m function, as implemented in GE 6.2u5 lx24-amd64 dated December 1, 2009, was used to generate a summary report from each experiment including the central processing unit (CPU) time for each script that was executed. To reduce variation in CPU times, all jobs were executed on a single multi-core node ensuring that <40 % of the total number of cores and <75 % of total memory were used. Each job was executed in triplicate, and no replicate jobs were running simultaneously. For bwa-aln/sampe alignments, the script contained aln commands for each fastq file executed sequentially followed by the sampe command, which were all executed with the default parameters. For bwa-mem alignments, the script contained a single command to align the sequencing read pairs to their respective references; default parameters were used except where seed length was altered. The Ensembl GRCh37 human reference containing the decoy sequence was used for alignments to the human genome. The B. malayi genome [Brugia and Wolbachia. The Wolbachia wBm genome [Brugia reference was made by using all contigs except Bm_006. The Plasmodium reference used was version 3.0 of high quality Plasmodium falciparum 3D7 draft genome released by PlasmoDB-9.3 [Plasmodium reference was created by adding the Plasmodium contigs to the GRCh37 fasta file. samtoolsflagstat v.1.1 was used to determine the number of total reads, secondary reads, and mapped reads in each sample. To correct for the number of secondary reads, the percentage of reads mapping was calculated as (mapped reads – secondary reads)/(paired in sequencing reads) ×100.All alignments were written as i genome  version m genome  referencmoDB-9.3 . The comB. malayi worms and their Wolbachia endosymbiont strain wBm from an unpublished study examining DNA amplification methods; it will be referred to as the Brugia–Wolbachia dataset (mega-blast (v. 2.2.17) search against the NCBI nucleotide database NT. We typically find that in mega-blast searches of this nature that some percentage of reads have no match, and that the best criterion to use is the percentage of reads with a best match relative to the number of reads that have any match, and this criterion was used in all other instances. Based on this criterion, this dataset was estimated to contain 79.7 % reads with matches having best matches to B. malayi and 14.5 % reads with best matches to Wolbachia wBm. However, the version of NT used for these searches does not have the B. malayi genome, so most reads did not have matches, making this measurement skewed in this case. If we instead focus on all reads, 14.1 % of reads had a best match to B. malayi and 2.6 % of reads had a best match to Wolbachia wBm, which is likely a better reflection of the composition of this data.Four types of datasets were used for this study: eukaryote/prokaryote, eukaryote/eukaryote, eukaryote only and simulated metagenomic. The first dataset contained 101 bp paired-end Illumina sequencing reads from a population of  dataset . Using tP. falciparum sequenced from a human sample from the SRA (ERR015379) [Plasmodium–human dataset  ; it will dataset . Parsingmega-blast search against NT, this dataset was estimated to contain 94.7 % of reads with matches having best matches to human sequences.The third dataset contained 101 bp paired-end Illumina sequence reads that have been simulated from a mock metagenomic community (Dryad doi:10.5061/dryad.m1m0p); it will be referred to as the mock metagenomic dataset . The finbwa-mem was used to align three different whole genome sequencing datasets to the respective reference databases with varying seed lengths from 18 to 30 nt. In the two dual-species datasets, the sequencing reads were aligned to the reference genome of each species separately, as well as a combined reference of both genomes. The 1000 Genomes dataset was only aligned to the human reference genome. The lowest variation in percentage of reads mapped with bwa-mem was observed in the 1000 Genomes dataset, where the total percentage of reads mapped only varied by 0.49 % across all seed lengths tested  decreased markedly from 3.3 to 2.9 % when increasing the seed length from 18 to 20 nt , but this is likely a result of the undesirable decrease in the number of reads aligned (Table S1).The decrease , Fig. 4.eference . Overallof 23 nt . The decbwa-aln and bwa-mem. We expected that bwa-mem would map more reads, since it could map reads with more sequencing errors, as well as greater sequence variation. Consistent with these expectations, in all cases tested, bwa-aln mapped a lower percentage of reads relative to bwa-mem . Conversely, we anticipated that when the vast majority of reads did not map to the reference, bwa-mem would spend large amounts of compute time trying to incorrectly align them to the genome (i.e. Plasmodium–human against the human genome and Brugia–Wolbachia against the Wolbachia genome). As expected, these latter two cases were aligned more quickly with bwa-aln than bwa-mem at the lower seed lengths tested , including the unplaced genomic contig GL000220.1 with 69 056 reads in 161 802 bp, the unplaced genomic contig GL000226.1 with 16 735 reads in 15 008 bp, and the decoy sequence contig hs37d5 with 569 969 reads in 35 477 943 bp.The Plasmodium reads to the human genome reference enabled alignment of related poorly mapping reads through any of bwa’s processes like chaining, filtering chaining, and seed extension. We used the 10.2 % of Plasmodium reads aligning to the human reference with bwa-aln as our proxy for high-quality matches. Those reads and their mates were removed from the fastq files and these modified human–Plasmodiumfastq files were realigned to the human genome using bwa-mem for all seed lengths tested. We found that the percentage of reads mapping to the human reference with bwa-mem was the same from both the filtered fastq files and the initial fastq files after accounting for the removal of the 10.2 % of the reads that correctly aligned to Plasmodium (Table S3).We further wanted to examine whether high-quality matches of Plasmodium genome with bwa-aln/sampe and bwa-mem. There were 16 995 093 Plasmodium positions with >5× coverage in the bwa-mem alignment with a seed length of 18 nt, while there were 16 698 169 Plasmodium positions with >5× coverage in the bwa-aln/sampe alignment. When modified fastq files were made by removing reads identified as human using bwa-aln/sampe and those modified files were mapped with bwa-aln/sampe back to the Plasmodium genome, 16 698 614 Plasmodium positions still had >5× coverage, which is remarkably similar to the 16 698 169 Plasmodium positions with >5× coverage when mapping all reads to the Plasmodium genome without filtering. However, when modified fastq files were made after removing reads identified as human using bwa-mem and those modified files were mapped with bwa-aln/sampe back to the Plasmodium genome, only 14 214 800 Plasmodium positions still had >5× coverage, which is only 85 % of the positions with coverage in the Plasmodium genome using all reads and bwa-aln/sampe. Therefore, the excess removal of reads based on their alignment with bwa-mem at a seed length of 18 nt may result in a loss of coverage of ~2 000 000 Plasmodium positions that could lead to an inability to call SNPs and other important genetic variants.There was no substantial difference between mapping to the New algorithms are making remarkable advances to expand the complexity of alignments to best capture all the genomic variation in a single organism . These iBrugia–Wolbachia and Plasmodium–human read mappings suggests this may not occur all the time. Plasmodium reads map to the human genome and Brugia reads map to the Wolbachia genome, which could result in transcripts appearing to be transcribed that are not. It also could result in erroneous assessment of the level of differential gene expression.Numerous studies have reported transcriptomics-based gene expression differences of two organisms within a single sample . For theThis may also present problems in mapping-based metagenomics analyses, and our results suggest that using a combined reference and increasing the seed length may lead to improvements. The exact seed length is not clear, and further work using real sequencing data from mock communities, as opposed to simulated data, may be necessary to resolve the matter.bwa, provide fast and efficient mechanisms for removing such human reads from parasite and pathogen sequencing projects. However, the results presented here suggest that too many sequences may be erroneously targeted for removal. Specifically, only 85 % of the positions have coverage in the Plasmodium genome after removing ‘human’ reads with bwa-mem with a seed length of 18 nt relative to removing ‘human’ reads with bwa-aln/sampe.In parasite and pathogen sequencing projects that require the direct isolation of nucleic acids from a human patient, sequencing reads are often screened prior to deposition in public repositories, like the SRA , to remoBrugia–Wolbachia and the Plasmodium–human datasets suggest that this may not be the case with bwa-mem without further optimization. While we focus on differences between bwa-aln/sampe and bwa-mem, it is important that any aligner be thoroughly tested when used in these scenarios for the particular organisms under study.Lastly, pipelines like PathSeq  and LGTSGiven the results presented here, one solution that should be employed whenever possible is to include the genomes of all expected organisms in a single reference database. Doing so increased the specificity of the alignments and decreased computation times. This strategy has already been used in human genome sequencing projects that include the Broad Institute’s ‘decoy’ genome sequence in their reference genome. The ‘decoy’ genome sequence contains sequences frequently encountered in human whole-genome sequencing projects that are otherwise not in the reference .In some studies, however, not all reference organisms are known. For example, when running algorithms like PathSeq  or LGTSebwa-mem is 19 nt. We initially identified this problem with a seed length of 19 nt; however, it is much more apparent and easier to interrogate at a seed length of 18 nt. Lastly, there may be scenarios that warrant the use of legacy aligners, like bwa-aln, which may be less sensitive, but have a higher degree of specificity.While much of our analysis focuses on a seed length of 18 nt, it is important to remember that the default seed length for Analysis of genomic data can be computationally intensive, leading to long CPU times and high analysis costs. Our analysis suggests that almost all datasets can benefit from an increase in the seed length to reduce CPU time and associated costs. However, this decrease in computation time may affect the ability to identify ‘split reads’, where a read matches two different locations in the genome, suggesting structural variation in genomics projects and splicing in transcriptomics projects. As such, further work may be needed by specialists in a field  to demonstrate how changing the seed length may or may not affect the validity of structural variation and gene structure predictions. Split reads in RNASeq projects of dual-species projects need to be handled with care, balancing the sensitivity of detecting splice junctions with the specificity of correct mapping. At a minimum, this can be dealt with in multi-species datasets by aligning to a combined reference that contains all known members of the consortium sequenced.bwa-mem was optimized to reduce alignment time and increase the specificity of alignments. While this optimization might not be necessary for all datasets, we found it to be particularly helpful in sequencing data obtained simultaneously from multiple organisms. In these cases, there was one dominant sequence source (i.e. Plasmodium or Brugia) and one minority sequence source (i.e. human or Wolbachia). Increasing the seed length reduced the number of read pairs aligning, incorrectly, to the reference genome from the minority sequence source (human or Wolbachia). Overall, increasing the seed length to 23 nt and combining both organisms into one reference genome can reduce the CPU time, sometimes quite substantially, with more specificity in the mapping, as was the case with the Plasmodium–human dataset. In some situations, the use of legacy aligners may also be warranted. Less substantial, but still possibly significant, improvements to CPU time upon changing the seed length were found in all cases. This suggests using a 23 nt seed length by default may be desirable.As sequencing technologies continue to advance and sequencing becomes less expensive, the tools to analyze these sequences need to be optimized for the intended study. Here, 1000 Genomes Project. Wellcome Trust Sanger Institute. Sequence Read Archive – ERR022446 (2017).Wellcome Trust Sanger Institute. Sequence Read Archive – ERR015379 (2017).Wellcome Trust Sanger Institute. Sequence Read Archive – ERR012739 (2017).Wellcome Trust Sanger Institute. Sequence Read Archive – ERR015360 (2017).University of Maryland Institute for Genome Sciences. Sequence Read Archive – SRR5188379 (2017).University of Maryland Institute for Genome Sciences. Dryad – doi:10.5061/dryad.m1m0p (2017).


Recently described stochastic models of protein evolution have demonstrated that the inclusion of structural information in addition to amino acid sequences leads to a more reliable estimation of evolutionary parameters. We present a generative, evolutionary model of protein structure and sequence that is valid on a local length scale. The model concerns the local dependencies between sequence and structure evolution in a pair of homologous proteins. The evolutionary trajectory between the two structures in the protein pair is treated as a random walk in dihedral angle space, which is modeled using a novel angular diffusion process on the two-dimensional torus. Coupling sequence and structure evolution in our model allows for modeling both “smooth” conformational changes and “catastrophic” conformational jumps, conditioned on the amino acid changes. The model has interpretable parameters and is comparatively more realistic than previous stochastic models, providing new insights into the relationship between sequence and structure evolution. For example, using the trained model we were able to identify an apparent sequence–structure evolutionary motif present in a large number of homologous protein pairs. The generative nature of our model enables us to evaluate its validity and its ability to simulate aspects of protein evolution conditioned on an amino acid sequence, a related amino acid sequence, a related structure or any combination thereof. ETDBN captures dependencies between sequence and structure evolution, accounts for alignment uncertainty, and models the local dependencies between aligned sites.α atoms to represent protein structure and additionally used Ornstein-Uhlenbeck (OU) processes to construct Bayesian probabilistic models of protein structure evolution. These models emphasize estimation of evolutionary parameters such as the evolutionary time between species, tree topologies and alignment, and attempt to fully account for sources of uncertainty. For the sake of computational tractability, the aforementioned approaches treat the Cartesian coordinates associated with atoms as evolving independently of another. A non-probabilistic approach by α atoms connected by spring forces. The major benefit of LFENMs is that they do not assume independence of atomic coordinates and take into account non-local dependencies due to physical interactions. In their current formulation LFENMs do not distinguish between the differing chemical nature of different amino acids and therefore do not account for the variable effect of sequence mutation on protein structure evolution.A key step in modeling protein structure evolution is selecting a suitable structural representation and corresponding evolutionary model. Early works by ψ dihedral angles .Partially in order to mitigate this, each hidden state specifies a distribution over a pair of site-classes at each aligned position. This gives rise to the possibility of a ‘jump event’. A jump event allows a large change in dihedral angle or secondary structure (e.g. helix to sheet) to occur at a given aligned position and also introduces a directional coupling between changes in amino acid that are informative of changes in dihedral angle or secondary structure conformation.ap and bp, in a homologous pair are associated with a pair of observation sequences aO and bO obtained from experimental data, respectively. An ith site observation pair, i in an alignment abM of ap and bp, where i of the alignment , i is taken to run from 1 to m, m is the length of the alignment abM, and ap and bp, respectively. |ap| and |ap| give the number of sites in ap and bp, respectively.The two proteins, α atoms at aligned site i belonging to each of the two proteins. A site observation corresponding to a particular protein at aligned site i, α atom: an amino acid .site-class specific, whereas parameters that are shared across all site-classes are termed global. The use of site-class specific parameters, such as site-class specific amino acid frequencies and dihedral angle diffusion parameters, as described in the next section, is intended to model site-specific physical–chemical properties  diffusion, was specifically developed for this paper in Central to our model is evolutionary dependence between dihedral angles, tW is the two-dimensional Wiener process, A is the drift matrix, Topologically, the WN diffusion (see  The pdf  weights It is shown in Despite involving an infinite sum over Maximum Likelihood Estimation (MLE) for diffusions is based on the transition probability density (tpd), which only has a tractable analytical form for very few specific processes. A highly tractable and accurate approximation to the tpd is given for the WN diffusion. This approximation results from weighting the tpd of the OU process in the same fashion as the linear drifts are weighted in A further desirable property of the pseudo-tpd is that it obeys the time-reversibility equation, which in terms of unique time-reversible diffusion with constant diffusion coefficient and stationary pdf  between the dihedral angles is captured by α3. A depiction of a WN diffusion with given drift and diffusion parameters is shown in constant evolution and jump events. Constant evolution occurs when the site-class starting in protein ap at aligned site i, bp at aligned site i, We now turn to the meaning of the site-class pairs. Two modes of evolution are modeled: α-helix in one protein with a proline at the homologous position in a second protein would be expected to break the α-helix in the second protein and to strongly inform the plausible dihedral angle conformations in the second protein.As already stated, a site-class specifies the parameters of the three conditionally independent stochastic processes describing amino acid, dihedral angle, and secondary structure evolution. A limitation of “constant evolution” is that the coupling between the three stochastic processes is somewhat weak. This in part stems from the time-reversibility of the stochastic processes—swapping the order of one of the three observation pairs at a homologous site, e.g.  instead of , does not alter the likelihood in Ideally, we would consider a model in which the underlying site-classes were not fixed over the evolutionary trajectory separating the two proteins, as in the case of constant evolution as described above, but instead were able to ‘evolve’ in time. This would allow occasional switches in the underlying site-class at a particular homologous site, which would create a stronger dependency between amino acid, dihedral angle and secondary structure evolution, that furthermore captures the directional coupling we desire. Such an approach is considered computationally intractable due to the introduction of context-dependence when having to consider neighboring dependencies amongst evolutionary trajectories at adjacent sites.jump event. A jump event occurs when In order to approximate this ‘ideal’ model in a computationally efficient manner we introduce the notion of a iH, together with the evolutionary time abt separating proteins ap and bp, specifies a joint distribution over a site-class pair:iH. iH.The hidden state at node The site-class jump probabilities have been chosen so that time-reversibility holds, in other words:iH, together with a site-class pair abt, specifies the joint likelihood over site observation pairs:The hidden state at node i is described in terms of the same site-class iH and cr. Note that the strength of the evolutionary dependency within an observation pair is a function of the evolutionary time abt.In the case of constant evolution, evolution at aligned abt. A jump event is an abstraction that captures the end-points of the evolutionary process, but ignores the potential evolutionary trajectory linking the two site observations. The advantage of abstracting the evolutionary trajectory is that there is no need to perform a computationally expensive marginalization over all possible trajectories, as might be necessary in a model where the hidden states evolve along a tree. The likelihood of an observation pair is now simply a sum over the four possible site-class pairs:In the case of a jump event, the evolutionary processes are, after the evolutionary jump, restarted independently in the stationary distribution of the new site-class. Thus the site observations In order to identify aligned sites having potential evolutionary motifs encoding jump events, a specific criterion was developed.i’s such that For a particular protein pair, inference was performed under the model conditioned on the amino acid sequence and dihedral angles for both proteins In a second filtering step, amino acid sequences and a single set of dihedral angles corresponding to one of the proteins were used  and a test dataset of 38 protein pairs  were assembled from 1,032 protein families in the HOMSTRAD database. For further details see ‘Construction of test and training datasets' in the Maximum Likelihood Estimation of the model parameters, on StEM, .For further details of the E- and M-steps of the StEM algorithm and for details about model selection please refer to ‘Model training and selection’ in the Fourteen models were trained . The 64 hidden state model was chosen as the best model, as it had the lowest Bayesian Information Criterion BIC, .Whilst ETDBN has a general scope with respect to applications , we envision the primary application being inference of evolutionary parameters.t-test gave a p-value of 0.578, thus failing to reject the null hypothesis that there is no difference between branch lengths estimated using sequence only versus angles only. This indicates that there is sufficient evolutionary information in the dihedral angles to estimate the evolutionary times and that the model is consistent in its estimates, lacking a significant tendency to underestimate or overestimate the evolutionary times when either sequence or dihedral angles are used.A paired Interestingly, the variance in the sampled evolutionary times is higher when dihedral angles only are used, as compared with sequence only see  online.bp (bX) were treated as missing and hence sampled  under our model, the angular distance between sampled dihedral angles is exactly zero  the curves for the real and sampled protein pairs show a good correspondence, however, for larger evolutionary times the model tends to underestimate angular distances. This may reflect the fact that the tpd of the WN diffusion specified is localized around its mean, even when the evolutionary time is large; therefore, dihedral angles distant from this mean are unlikely to be sampled. To a certain extent this is mitigated by the jump model, which occasionally allows for large changes in dihedral angle, but may still be somewhat limited in its flexibility, as jumps can only occur between two site-classes. The majority of protein pairs in our training dataset represent smaller evolutionary times  and therefore protein pairs with larger evolutionary times and their associated jumps are underrepresented in our dataset, which may also explain the underestimation.An additional possibility is that ETDBN does not attempt to model global dependencies. The conditional independence structure in  enables ap, bp), the dihedral angles of bp in each pair were treated as missing, and these missing dihedral angles were sampled under the model given a particular combination of observation types. The average angular distance between the sampled and known dihedral angles was used as the measure of predictive accuracy.Predictive accuracy was measured using 38 homologous protein pairs in the test dataset. For every protein pair . In all ten cases there is an improvement in predictive accuracy. The improvement in predictive accuracy is reasonable, as knowledge of the sequence evolutionary trajectory is expected to encode information about structure evolution and hence will inform the dihedral angle conformational possibilities.Under combination 3, we add in the amino acid sequence of a homologous protein , we treat both amino acid sequences as observed, as well as the dihedral angles of the homologous protein (ap)—in all cases the predictive accuracy improves over combination 4. This is anticipated as the homologous dihedral angles are expected to be the best proxy for missing dihedral angles and are therefore expected to be more informative than secondary structure alone. Note that the availability of a homologous amino acid sequence pair here and in combination 4 is consequential as it informs the evolutionary time abt parameter, which will typically constrain the distribution over dihedral angles and reduce the associated uncertainty.Under combination 5 . On average, there is a slight improvement in predictive accuracy when fixing the alignment, albeit the magnitude of improvement is not substantial. This demonstrates the accuracy of the alignment HMM.Finally, in combination 6, the same data observations as in combination 5 are used, except the alignment is treated as given a priori  rather than as unobserved. The HOMSTRAD alignment is based on a structural and sequence alignment of m is the length of alignment abM and is typically much smaller than The alignment HMM accounts for alignment uncertainty in a principled manner, which is particularly useful when an appropriate alignment is unavailable. However, it should be noted that inference scales It should be emphasized that we do not expect ETDBN to compete with structure prediction packages such as Rosetta  or homolevolutionary motif present in a large number of protein pairs in our test and training datasets.One benefit of ETDBN is that the 64 evolutionary hidden states learned during the training phase are interpretable. We give an example of a hidden state encoding a jump event that was subsequently found to represent an r1 and r2 is associated with specific amino acid changes. In site-class r1 the amino acid frequencies are relatively spread out amongst a number of amino acids, whereas in site-class r2 the frequencies are particularly concentrated in favor of glycine (Gly) and asparagine (Asp), with glycine being significantly more probable in site-class r2 than r1. This suggests that, conditioned on hidden state 3, an exchange between a glycine to another amino acid is likely indicative of a jump and hence a corresponding change in dihedral angle. This is consistent with what we find in a subsequent analysis of evolutionary motifs. This particular jump occurs in coil regions.Evolutionary hidden state 3  was seleHaving selected hidden state 3, positions in 238 protein pairs were analyzed for evidence of the corresponding evolutionary motif. 38 protein pairs in the test dataset and a further 200 from the training dataset were analyzed using the criteria described in the Methods section. Using the first criterion, 84 protein sites in 59 protein pairs corresponding to Mycoplasma capricolum) and 1poh (Escherichia coli), were identified as having the evolutionary motif , with the exception of positions N38/N38 and E39/G39, which both have high posterior jump probabilities (≈ 1.0). The exchange between a glutamate (at position 39 in 1poh) and a glycine (at position 39 in 1pch) appears to be responsible for the shift in dihedral angle. This exchange corresponds to a significant jump in dihedral angle:  state 3 .r1 indicates that a number of amino acids  other than glutamate plausibly coincide with the particular dihedral angle conformation specified by site-class r1. The involvement of glycine in a jump is not surprising as it is a small and flexible amino acid, whereas the role of asparagine is less clear. In our analysis of 238 protein pairs we found that of the seven positions meeting the criteria for hidden state 3 and involving an exchange with asparagine (Asn), four were an exchange between an asparagine and a glycine, whereas the remaining three were between asparagine and one of lysine, histidine, or serine.Site-class A valuable feature of our model is its ability to account for alignment uncertainty by summing over possible pairwise alignments using the TKF92 model as a prior distribution over indel histories, whilst simultaneously taking into account neighboring dependencies amongst aligned sites. Doing so results in a sample of alignments rather than a single alignment. Nevertheless, a single Maximum A Posteriori (MAP) pairwise alignment may be obtained from the alignment samples and used for downstream analysis.aA, bA), a secondary structure sequence pair , a dihedral angle sequence pair  and combinations thereof.ETDBN and several other alignment methods  were used to infer pairwise alignments from simulated and real data under various combinations of data observations, for example: an amino acid sequence pair , ETDBN (11B.5) had a similar degree of accuracy when compared with several other sequence-based methods . This demonstrates that ETDBN has performance comparable to that of other commonly-used sequence alignment methods.When benchmarking the MAP estimated alignments against the HOMSTRAD alignments B, using aS, bS) alone, ETDBN (11B.6) had substantially lower alignment similarity compared with sequence only, which was expected given that a similar result was obtained for the simulated data (11A.6). However, when including the real sequences (11B.7) the predictive accuracy was once again comparable to sequence only inferences (11B.1–11B.5).Using  alone (11B.8), the alignment similarity was found to be somewhat worse than the sequence only cases. Furthermore, when introducing the sequences (11.9) and secondary structures (11B.10) in addition to the dihedral angles, the similarity remained worse than the sequence only methods (11B.1–11B.5), despite the additional information. These results are in contrast to the results we obtained for simulated data (11A.8–11A.10).When using  faired the best, likely because they use a criteria similar to that used to align the HOMSTRAD alignments. When interpreting these results it is important to note the HOMSTRAD alignments should not be considered the true underlying alignments and may even be strongly biased. For example, they may favor the closest structural superimposition of structures or the most parsimonious alignments, with the fewest number of indels. In the evolutionary modeling context our goal is to distinguish between homologous sites  and indels. In practice, it is extremely difficult to obtain the true underlying alignment (sets of homologies and indels), because it would require an experiment where every indel event since the common ancestor is observed, a seeming impossible task outside of simulation or laboratory conditions.After further investigation, the trend of lower alignment similarity seen in The main achievement of this work is a computationally tractable, generative and interpretable probabilistic model of protein sequence and structure evolution on a local scale.Previous stochastic models of protein sequence and structure evolution emphasized estimation of evolutionary parameters . ETDBN iLike previous models, ETDBN is capable of dealing with alignment uncertainty by marginalizing over indel histories; it predicts pairwise MAP consensus alignments with accuracy similar to that of score-based and statistical alignment methods.The generative nature of ETDBN allows us to demonstrate that the underlying empirical distributions over dihedral angles (depicted using Ramachandran plots) are captured and that the model is capable of predicting missing observations, such as dihedral angles, from a variety of different data types. For example, an amino acid sequence, a homologous amino acid sequence, a homologous secondary structure, a homologous set of dihedral angles, or any combination thereof.Based on its local nature, ETDBN does not constitute a homology modeling method in itself. Rather, it can be used as a building block, much like fragment libraries model local structure in protein structure prediction methods. ETDBN places the homology modeling problem on a statistical footing, enabling a number of approaches to later be used, such as multi-level modeling, that is, combining fine-grained distributions  and coarse-grained distributions . In particular, a method referred to as ‘the Reference Ratio method’ can be used to combine fine-grained and coarse-grained distributions in a statistically principled manner see . HoweverIn addition to multi-level modeling, probabilistic models such as ETDBN allow one to account for and to make statements about uncertainty  in a rigorous manner. In principle, ETDBN, like TorusDBN , could bA final key feature of our evolutionary model is its interpretable nature. This interpretability enables the identification of potential evolutionary motifs—common patterns of sequence–structure evolution. We identify one such evolutionary motif in 34 different homologous protein pairs. A major direction for future research is the further identification of such evolutionary motifs. Understanding these evolutionary motifs, may 1) improve homology modeling predictions; 2) provide more accurate estimates of evolutionary parameters; and 3) produce better models of protein evolution that more realistically capture evolutionary trajectories through sequence and structure space, which may help identify functionally relevant positions that are potential drug targets.il is the length of sequence i and N is the number of sequences, although MCMC approaches are possible , but are less capable of capturing angular shift . This is to a considerable extent mitigated by the introduction of jump events, as discussed before. A more realistic model would model the entire evolutionary trajectory, allowing an arbitrary number of switches between site-classes together with neighboring dependencies amongst adjacent sites along the evolutionary trajectory. Similar context-dependent models are typically computationally expensive and require sophisticated inference procedures .http://www.computingforbiology.org/software/etdbn.Julia code (tested on both Windows and Linux platforms) is available at: Molecular Biology and Evolution online.Supplementary DataClick here for additional data file.


Efforts such as International HapMap Project and 1000 Genomes Project resulted in a catalog of millions of single nucleotides and insertion/deletion (INDEL) variants of the human population. Viewed as a reference of existing variants, this resource commonly serves as a gold standard for studying and developing methods to detect genetic variants. Our analysis revealed that this reference contained thousands of INDELs that were constructed in a biased manner. This bias occurred at the level of aligning short reads to reference genomes to detect variants. The bias is caused by the existence of many theoretically optimal alignments between the reference genome and reads containing alternative alleles at those INDEL locations. We examined several popular aligners and showed that these aligners could be divided into groups whose alignments yielded INDELs that agreed strongly or disagreed strongly with reported INDELs. This finding suggests that the agreement or disagreement between the aligners’ called INDEL and the reported INDEL is merely a result of the arbitrary selection of one of the optimal alignments. The existence of bias in INDEL calling might have a serious influence in downstream analyses. As such, our finding suggests that this phenomenon should be further addressed. The International HapMap Project and 1000 Genomes Project  producedAlthough methods of aligning reads to genomes are diverse, they are essentially based on two important steps: finding seeds (which are exact matches between a substring of a read and substrings of the genome) and extending seeds into full alignments. Further, the extension of seeds into a full alignment often utilizes a technique based on the local pairwise sequence alignment . Variantdisagree with those reported in existing variant profiles. This finding implies that thousands of INDELs that have been reported in public resources were constructed based on algorithmic bias of alignment strategies. This source of bias adds to the list of biases in variant calling caused by sequencing technologies or coverage  is the score of an optimal alignment between x1⋯xi and y1⋯yj, for 1≤i≤n and 1≤j≤m. With M=i and M=j, the matrix M is constructed based on the following relation: In a simple alignment model with no penalty for gap opening, an optimal alignment between match is the cost of substituting xi for yj and ε is the cost of deleting xi or inserting yj.where x and y depends on the computation of three matrices M,X, and Y. Here, M is the score of an optimal alignment between x1⋯xi and y1⋯yj, where xi is aligned with yj. X is the score of an optimal alignment in which xi aligns with a gap. And, Y is the score of an optimal alignment in which yj aligns with a gap. The computation of the three matrices can be done based on the following relations: In the affine gap model, finding an optimal alignment between ε is the cost of inserting or deleting a base, and ρ is the cost of inserting or deleting the first base .where In Eqs. M is filled, one starts from the entry with the highest cost and retraces all steps at which optimal decisions  such that M is maximum. 2: returnTraceTo construct all optimal alignments under the non-affine gap model after the matrix Trace returns all optimal alignments ending at xi and yj. Trace is done by identifying whether each of the three conditions in Eq. xi and yj. Then, the algorithm correctly returns the union of all of the optimal alignments ending at xi and yj.As described in Algorithm 1, the call M,X, and Y are filled, one starts from the entry of M with maximum value and retraces all the steps at which optimal decisions  in each recursive call.To construct all optimal alignments under the affine gap model, the process is similar. After the matrices We hypothesize that the usage of an aligner to detect variants will result in incorporating the aligner’s bias into the construction of a variant profile. Specifically, this bias will exhibit itself at INDEL locations that have multiple optimal alignments. In our analysis the reference human genome, obtained from NCBI, build GRCh37, and the known variant profile obtained from the Integrated Variant Set release from the 1000 Genomes Project Consortium, we found that among 1,442,639 INDEL locations, 6,685 of them had multiple optimal alignments.i has two known alleles: A and ACGA, where A is in the reference genome, and ACGA is an alternative allele.Suppose that the INDEL location g is represented as xAy (gi is A).Suppose the reference genome u be a suffix of x, and v be a prefix of y. (Both presumably have length k). In other words, u and v are k-substrings of the genome that are on the left and the right of the allele A.Let r=uACGAv. The string r is presumed to be the substring of another genome that differs from the reference genome at the exact location i with allele ACGA. We varied the length of u and v between 25 and 50. Thus, the length of the read r is around 50 to 100. .We will create a string r to the reference genome, and if r is correctly mapped to location i, then two possible optimal alignments can be observed:Now if we align A|ACGA, which agrees with the known profile. The other alignment resulted in a variant call at location i−1 that is different from the known profile. In general, there can be many optimal alignments but only one of them results in a variant call that agrees with the known variant profile.Of these two optimal alignments, the one on the left resulted in the variant i, each string r is created for each alternative allele.If there are multiple alternative INDEL alleles at location r’s that are constructed as we have described. For each INDEL location with more than one optimal pairwise alignments, there are exactly 10 reads with length between roughly 50 to 100, as described above, yielding a 10x coverage at those INDEL locations. To test whether the existing variant profile consists of INDELs that might have been constructed based on a bias alignment method, we employed several popular short-read aligners to all strings in Let To demonstrate that many of these INDELs were created based on the bias of some alignment algorithms, we set out to reverse engineer the process of determining these INDELs based on various alignment algorithms. In the reverse engineering process, we create a set of reads To map and align reads in  Bowtie2 , BWA-SW  Bowtie2 , CUSHAW2 Bowtie2 , Smalt [ Bowtie2 , SRmappe Bowtie2 , SHRiMP2 Bowtie2 , RazerS  Bowtie2 , GASSST  Bowtie2 , SeqAlto Bowtie2 , Masai [ Bowtie2 , and Soa Bowtie2 . Most alThe set of reads Aligners whose correctly mapped reads  are aligned in high agreement with the known variant profile, about 99 % in agreement. These aligners include Bowtie2, BWA (MEM version), and SHRiMP2;Aligners whose correctly mapped reads are aligned in moderate agreement with the known variant profile (between 70–75 %). These include RazerS and CUSHAW2; andAligners whose correctly mapped reads are aligned in high disagreement with the known variant profiles (less than 10 %). These include GASSST and Smalt.As shown in Table mentclass2pt{minimi, there are ni optimal pairwise alignments (under the affine-gap model), then the probability pi that an aligner produces an alignment that yields a call in agreement with the known variant profile is N is the number of INDEL locations with multiple pairwise alignments that the aligner can map correctly reads in To analyze if there exists alignment bias in reported variant profiles, we compare an aligner’s degree of agreement with reported variant profiles to the expected agreement if the algorithmic choice happens by chance. Suppose that at INDEL location λ is the observed difference between actual and expected agreement, μ and σ are the expected agreement and its variance. As described above, The last column of Table mentclass2pt{minimalternative possibilities of INDELs from these optimal alignments. This is tedious and not being done in practice. Existing variant profiles do not report alternative possibilities of INDELs; they only report one.The existence of multiple optimal alignments giving raise to different INDEL calls is an inherent problem. We have demonstrated that in many cases there are more than one theoretically optimal alignment, each of which has the same chance of being biologically correct. It is important to note that there is no correct optimal alignment among all possible optimal alignments: they are all optimal and thus equal probability of being the correct alignment. In other words, it does not matter which optimal alignment an aligner chooses and a variant caller utilizes the aligner’s result, there must be inevitably some bias. The only way to cope with this is for an aligner to report all optimal alignments and for a variant caller to derive all complexity of each INDEL location as the number of optimal alignments that can be had when reads bearing alternative alleles are aligned (under the affine-gap model) to the reference genome at this location. Figure Thus, it is useful to examine known INDEL locations and characterize the extent to which they are affected by multiple optimal alignments. We define the The accuracy of calling variants can be improved by increasing coverage (i.e. using more reads) and realigning reads that overlap INDEL locations. But we argue that neither increasing coverage nor realigning reads around INDELs can help resolve the problem caused by multiple optimal alignments. Increasing reads can reduce the damaging effect of sequencing errors, which occur independently across reads. While realigning reads around an INDEL as described by Li  can achiWe have demonstrated that the current INDEL profile constructed and curated by the 1000 Genome Project exhibits a bias at certain INDEL locations. These locations can be identified by counting the number of optimal alignments between reads containing alternative alleles to the reference genome at those locations. The bias is essentially an effect of either short-read aligners or variant callers themselves having to choose one out of many equally theoretically optimal alignments. There is no obvious way to “standardize" this phenomenon by designating one optimal alignments as the “canonical" one. As such, it seems the only way to deal with this is reporting all optimal alignments and consequently reporting all alternative INDEL calls as the result of those alignments.If this phenomenon is not addressed, there can be potential serious problems relating to the analysis and study of INDEL. For example, certain alignment techniques will result in wrong calls at those INDEL locations. Case in point is Smalt, which was able to map 96 % of the reads, but very few of the alignments produced the “correct" INDEL calls (as specified by the existing INDEL information). At these location, Smalt was wrong simply because it chooses a different optimal alignment from the one based on which the INDEL was constructed.


In addition to the features analysed by JoY, which include secondary structure, solvent accessibility and sidechain hydrogen bonds, XSuLT annotates each amino acid residue with residue depth, chain and ligand interactions, inter-residue contacts, sequence entropy, root mean square deviation and secondary structure and disorder prediction. It is also now integrated with built-in 3D visualization which interacts with the formatted alignment to facilitate inspection and understanding. Results can be downloaded as stand-alone HTML for the formatted alignment and as XML with the underlying annotation data. XSuLT is freely available at  From the advent of macromolecular sequencing methods, the comparative analysis of biological sequences has been fundamental to the study of molecular evolution and function, as well as for practical applications in biotechnology and medicine. The alignment of sequences is a cornerstone technique in the development of many computational and statistical methods, providing a convenient and powerful representation of common features. However, it is often a challenging task and, in less than trivial cases, results may be dependent on context and interpretation, requiring experts to be able to visualize and analyse alignments efficiently. Numerous excellent tools have been developed for this purpose, notably Jalview , SeaViewThe program JoY  was deveHere we present the website XSuLT, an enhanced version of JoY that introduces additional functionality using modern web technologies. It is geared towards expanding the range of encoded features, improving user friendliness, and refining its utility for the process of comparative modelling and the development of constructs. Unlike the original JoY, which seeks to support a variety of output formats, for instance Postscript and Rich Text Format, XSuLT is fully focused on HTML output, which it generates by transforming an XML (Extensible Markup Language) file containing the annotated alignment using an XSLT (Extensible Stylesheet Language Transformations) template, from which the name of the program is derived. This way, all the data from the various sources are aggregated into a single, general and extensible file, which can be complexly formatted without specialized software in a wholly cross-platform manner, paving the way for customizing or incorporating additional features more easily in the future.Like JoY, XSuLT is not designed to generate alignments of its own. Instead, it post-processes multiple sequence alignments (MSA) previously generated by other programs, using structural information from PDB files or predictions to annotate them. Due to this reliance, structural alignment programs like SALIGN , ExpressXSuLT analyses each structure and sequence in the alignment, and the alignment as a whole, for the features described below. The alignment and all the annotations are stored as an XML file denominated as ‘XTEML’, the format of which is described in more detail in the Residue solvent accessibility: residues with a relative solvent-accessible surface area of <7% are defined as buried and displayed in uppercase letters  are also labelled using italics, due to their key role in important conformational features. In MSA, secondary structure consensus at a 70% threshold is also displayed on an additional line with a's on red background for alpha helices; b's on blue background for beta strands and 3's on orange background for 310 helices.Hydrogen bonds: residues with sidechain hydrogen bonds to main-chain amides are formatted in bold and those bonded to main-chain carbonyl are underlined.Physicochemical properties: sequences without structural annotation are coloured according to the Taylor colour scheme , depth is another metric related to the ‘buriedness’ of a residue, and has been found to be associated with characteristics like stability and conservation . WhereasRinaccess is a related but distinct metric introduced in the program Ghecom for the analysis of pockets in proteins  alignment, as is often done for homology modelling, XSuLT calculates the percentage sequence identity (PID) of the first non-structure sequence to each of the structures, listing it at the end. The PID is a common metric to assess the degree of similarity of a sequence to its homologues or templates, but it was not previously shown on JoY.XSuLT also adds two further annotations calculated on a position level, taking into account all provided structures or sequences: Shannon entropy and Root Mean Square Deviation (RMSD).i,af is the relative frequency of amino acid a at alignment position ii, f,gap is the relative frequency of gaps at the same position and n is the minimum of 20 and the number of sequences in the alignment. This formula yields values bounded between zero  and one .The Shannon entropy is a concept from information theory related to the diversity or variability of states in a system. Applied to biological sequences in an alignment, it is useful as a measure of residue conservation . XSuLT iS = 0) and over the 0–9 range for other entropy values over 0.1 intervals . Additionally, entropy is also available as a colour scheme in the 3D visualization, described on the following section, which allows to directly identify the regions on the structure that are most variable or conserved in terms of their sequence.The calculated entropy is displayed on the formatted alignment as an additional row with values starting from * for fully conserved positions ,  (<6 Å),  (<8 Å) and  (≥8 Å). The symbols were chosen as a visually intuitive illustration of the closeness of the superposition that the RMSD represents. Thus, positions lying close in space are represented with a narrow underscore while those far apart are labelled with the full block. This makes it easy to recognize at first glance which regions of an alignment superpose more tightly and which ones are more flexible.The RMSD values of the Cα atoms at each aligned position are binned at a series of thresholds and presented with symbols corresponding to each of them: _ (RMSD < 2 Å), A further enhancement of XSuLT with respect to JoY is its interactive integration with the light-weight 3D visualization plugin 3Dmol.js , providihttp://structure.bioc.cam.ac.uk/xsult. Due to its reliance of modern technologies, only relatively recent browsers supporting HTML5 are supported, with Google Chrome recommended for best performance.XSuLT is freely available as a web server at http://salilab.org/modeller/manual/node496.html. The PIR format is recommended, as it allows specifying explicitly which sequences in the alignment are expected to have structural information. Moreover, it is also the only one to support labelling a sequence as a model, which enables the annotation of modelled  structures with secondary structure predictions. As the fully MODELLER-compliant format can be cumbersome, XSuLT also supports a simplified version that only includes the labelling of each sequence as either a structure or a pure sequence. When using the FASTA format, any sequence for which no matching PDB is found, is automatically treated as a sequence. In either case, for performance reasons, the maximum number of sequences in a single alignment currently allowed is 25.The program requires two types of input. First, an MSA , which can be uploaded either as a file or pasted into the provided textbox. The server accepts two formats: FASTA and PIR/ALI. For the latter format, XSuLT conforms to the conventions used by MODELLER ,51, descThe structures of the sequences comprise the second required input. The only allowed format for this is PDB. There are two options available to provide the data, either by manually uploading the PDB files using the labelled button or by specifying the PDB and chain identifiers on the field provided.It is essential that the sequence identifiers in the alignment match the PDB filenames and that the sequence in the alignment be identical to the residues in the PDB. If providing the PDB via its code and chain, it is worth verifying that the aligned sequence corresponds to the ATOM sequence of observed residues in the PDB, and not to the SEQRES sequence, which may contain residues not experimentally resolved, as this is a common source of error. The software will attempt to rectify automatically certain frequent issues with PDBs, but the user is advised to make sure their files are standards-compliant.Once the job is submitted, the user is redirected to a page that will show its status and periodically refresh until the job is completed. Alternatively, if a problem occurs either due to an issue with the input data or the server, an error message with an explanation will be shown. In either case, the URL of the page can be saved and revisited later.The server output Figure  consistsThe 3D visualization box displays the superposition of the cartoon representation of all structures according to the provided alignment. Structures are initially coloured according to a rainbow spectrum, starting in red at the N-terminus and progressing to blue at the C-terminus, but two other colour schemes are also provided: each structure in a different colour and entropy spectrum, which colours residues according to their normalized Shannon entropy in a blue-green-red scale. Additionally, check boxes are provided to toggle the display of particular sequences and to keep the visualization box fixed in view during scrolling, in order to be able to interact with the end of long alignments.The XSuLT formatted alignment constitutes the primary output of the program. It shows the provided alignment annotated according to the analyses described previously using the format shown on Figure Hovering with the mouse over an aligned position will also display the stick representation of the sidechains on the 3D visualization box, and clicking on it will zoom and centre the view on it. This can be useful to identify easily any misaligned residues and to optimize the structural equivalence of ambiguous positions.The PIR formatted alignment, including any edits performed to make it fully compatible with MODELLER.A compressed ZIP file containing the superposed PDB files.A stand-alone HTML file of the formatted alignment for reference and off-site viewing. However, due to the reliance on a number of JavaScript libraries , it is still necessary to be online to view them. Due to technical limitations, this HTML file requires the user to load the PDB files manually for the 3D visualization using the button provided. Additionally, the file includes the ability to extract the alignment in FASTA format using the button at the bottom. A trimmed down version without 3D and buttons more suitable for printing is also available.The XTEML file containing the alignment and all the generated annotation data, which the user can process if they are interested in any of the raw data.At the end of the results page, several generated files are made available for download:Generated results are kept on the server as long as storage capacity allows, for a minimum of one month.The features analysed and mapped by JoY and now XSuLT onto one-letter amino acid alignments allow for the rapid identification of structural features that are likely to be important to the fold or function. With the addition of the integrated 3D visualization, this ability is further enhanced.The example presented on Figure http://structure.bioc.cam.ac.uk/toccata, manuscript in preparation), which classifies chains and domains into consensus categories from SCOP (Our group routinely uses JoY and XSuLT for the preparation and analysis of new structures –13 and hrom SCOP  and CATHrom SCOP  familiesThe new architecture based on XML and XSLT simplifies the process of adding annotations and customizing the output and we plan to take advantage of this to integrate more sources of data in the future.Supplementary DataClick here for additional data file.


Understanding how proteins mutate is critical to solving a host of biological problems. Mutations occur when an amino acid is substituted for another in a protein sequence. The set of likelihoods for amino acid substitutions is stored in a matrix and input to alignment algorithms. The quality of the resulting alignment is used to assess the similarity of two or more sequences and can vary according to assumptions modeled by the substitution matrix. Substitution strategies with minor parameter variations are often grouped together in families. For example, the BLOSUM and PAM matrix families are commonly used because they provide a standard, predefined way of modeling substitutions. However, researchers often do not know if a given matrix family or any individual matrix within a family is the most suitable. Furthermore, predefined matrix families may inaccurately reflect a particular hypothesis that a researcher wishes to model or otherwise result in unsatisfactory alignments. In these cases, the ability to compare the effects of one or more custom matrices may be needed. This laborious process is often performed manually because the ability to simultaneously load multiple matrices and then compare their effects on alignments is not readily available in current software tools. This paper presents SubVis, an interactive R package for loading and applying multiple substitution matrices to pairwise alignments. Users can simultaneously explore alignments resulting from multiple predefined and custom substitution matrices. SubVis utilizes several of the alignment functions found in R, a common language among protein scientists. Functions are tied together with the Shiny platform which allows the modification of input parameters. Information regarding alignment quality and individual amino acid substitutions is displayed with the JavaScript language which provides interactive visualizations for revealing both high-level and low-level alignment information. Prediction of protein similarity through sequence alignment is an important tool for a number of biological applications including the understanding of evolutionary divergence, identification of active/conserved regions in proteins, and identification of key structural motifs in proteins. Identification of similarities among protein families, individual proteins, or even short segments of a protein chain can give scientists insights as to how an amino acid insertion or mutation may alter the active regions within the putative protein. Accurate alignment of two or more proteins being compared is an important first step in evaluating similarity and many algorithms exist that use a wide range of criteria to find the best alignment .i and amino acid j, s is the substitution score, q is the set of observed frequencies, p is the probability of random appearance, and λ is a positive scaling constant allowing for the use of different logarithm bases without changing observed frequencies. Conservative substitutions have a positive score and non-conservative substitutions have a negative score . One of the parameters influencing alignment scores is the chosen substitution matrix capturing the likelihood of amino acid substitutions . Substitve score . Standarve score  and BLOSve score  matricesve score . Other mve score  and the Predefined matrices may not adequately model substitutions for a variety of reasons. New substitution strategies may be required and result in the modification of existing matrices  or the cMultiple substitution matrices can be compared to find the most appropriate one . Rios etThere are few tools for addressing the complex problem of choosing the most appropriate substitution matrix for protein sequence alignments. Because of these needs, we have developed SubVis, a highly interactive R  package  •Allows the uploading or text entry of FASTA  sequence •Utilizes widely-known R functions from the Biostrings package . •Permits the application of several widely-used substitution matrices and multiple custom matrices. •Provides intuitive and interactive visualizations to facilitate simultaneous exploration of protein alignments produced by multiple substitution matrices. Detail information, such as the log-odds score for each substitution, is available through mouse interaction. •Employs the Shiny package  and JavaIn this paper, we present background information including the difficulties associated with choosing a substitution matrix and previous attempts using visualization to help understand the effect of substitution matrices. We describe the organization and implementation of SubVis. Finally, we provide a case study illustrating the utility of SubVis.a priori information makes the seriousness of the error difficult to judge and contributes to uncertainty that obfuscates biological insight.Performing quality pairwise sequence alignments is a critical first step in protein analyses such as the formation of multiple sequence alignments and phylogenic tree construction . As descP-value is often used to judge assigned alignment scores , and apply multiple substitution matrices. Applied matrices can include PAM matrices, BLOSUM matrices, or custom matrices. After performing the alignment, options exist for the high-level exploration of percent identities and alignment pair scores. Interactions also exist for the low-level exploration of individual amino acids across selected substitution matrices by position in the aligned sequence, properties , pattern matching, and locations of insertions and deletions (indels).SubVis consists of three functional units: interface and parameter management, alignment processing, and visualization. Interface and parameter management controls the capture of alignment parameters, including selected substitution matrices. It also allows the user to choose the visualization  and options for selecting and searching displayed items. Alignment processing accepts alignment parameters captured from the interface and includes those in the construction of alignments. The visualization component displays the alignments after each of the selected parameters (including the substitution matrix) has been applied and provides detailed information with mouse interaction.Shiny is a recently developed R package for building web applications and was chosen for this system because of the GUI widgets available and its integration with R. The first screen shown when starting SubVis is the parameter view under the “Options” tab which captures alignment input such as the proteins to be aligned, the predefined and custom matrices to be applied, gap penalties, and scoring type. Users are allowed to load (and change) the following parameters: •Protein sequences. Two protein sequences in FASTA (pattern and the other represents the subject. (Sequences are referred to as the pattern or subject to be consistent with the Biostrings package where they are defined in context of the functions utilized in the SubVis implementation.)in FASTA  format c •Predefined substitution matrices. Multiple PAM and BLOSUM matrices can be selected by checking the corresponding boxes. Individual gap penalties can be entered for each predefined matrix. Predefined PAM matrices included in SubVis are PAM30, PAM40, PAM70, PAM120, and PAM250. Predefined BLOSUM matrices included in SubVis are BLOSUM45, BLOSUM50, BLOSUM62, BLOSUM80, and BLOSUM100. •Custom substitution matrices. Multiple space delimited text files each containing a custom matrix can be loaded. Users can load custom multiple matrices by selecting a master file that lists the filename of each matrix. In the master file listing the custom matrices, each filename is on a separate line. Following each filename on the same line are space delimited gap penalties for each custom matrix. In addition to exploring different matrices, users can explore the effects of penalties by repeating the same matrix file name with variations in gap and extension penalties.  •Alignment score type. Users can choose from local, global, overlap, local–global, and global-local scoring. •View choice. Clicking the “GO” button in the parameter capture view performs the alignment and automatically switches to the “VIZ” tab where users can choose from three visualization views. The overview provides quality information by sorting and displaying four percent identity variations : •pairwiseAlignment. Accepts the two protein sequences (pattern and subject), gap costs, alignment score type, and substitution matrices entered as parameters. Alignment choices include local alignments using the Smith–Waterman algorithm  In the top-left corner, the gap penalties for that alignment are displayed along with the selected score type. Beneath the alignment score for each matrix type along the left side, the log-odds score and the substitution that occurred are displayed for amino acids appearing in the same column as the one selected. Above the set of alignments is a histogram that shows the type and number of the amino acids (and gaps) occurring in that column.Classifying amino acids according to their properties is an important part of protein research . SubVis pattern and subject for each pair. Alignment sequences can be navigated forward and backward by clicking a button. To maintain positional context, incrementally moving forward or backward only shifts the alignment one-half of the number of amino acids currently displayed. SubVis also has an option for showing only the pattern or only the subject.There are many additional interactions to ease alignment navigation. Instead of colored boxes, the single letter amino acid abbreviation can be displayed. The default layout shows both the The search view includes several options for locating a desired alignment region. Users can search alignments by amino acid position in the aligned sequence by entering the position number into a text box. Searches can also locate indels, regions where the pattern and subject of an alignment pair match, and sections that match an input sequence. Indel locations and areas that fulfill match criteria are shown as red with the remainder of the sequence in gray.We now present an example of how SubVis can aid in the exploration of alignment sequences produced by multiple matrices and their associated penalties. Intrinsically disordered proteins  contain Xenopus laevis proteins. The BLOSUM62 and DISORDER matrices were both loaded into SubVis as custom matrices using a subset of the associated gap/extension costs reported by Radivojac et al.  Specifically, the subset included the following custom matrices listed by label and matrix type followed by :CM0: DISORDER CM1: DISORDER CM2: DISORDER CM3: BLOSUM62 CM4: BLOSUM62 CM5: BLOSUM62 The overview produced by SubVis  shows thThe search view and detail view in SubVis allowed us to learn more about the similarities and differences between CM0 and CM3. In the search view, individual regions were visually scanned by incrementally advancing the alignments from beginning to end. The region outlined with solid black rectangles in SubVis allows scientists to load protein sequences and visually explore alignment differences that result from varying predefined and custom substitution matrices. This platform allows scientists to view coarse-grain and fine-grain information ranging from summary alignment scoring to specific amino acid substitution details. Additional interactions include searching multiple alignment pairs and classifying amino acids according to a selected property. The ability to load sequences, apply desired alignment parameters (including substitution matrices), search alignments, classify amino acids, and access detailed substitution scores facilitate the comparison of established substitution matrices and the evaluation of matrices being developed for specific purposes.SubVis utilizes general R programming constructs and the Biostrings package, both of which are well-known in the bioinformatics community. SubVis is available as an R package on CRAN. The package contains the data sets and custom matrices used to produce the presented figures. There is also a detailed vignette included in the package and demonstration videos located on GitHub. The SubVis package allows users to access the vignette through a “Help” tab persistent in all views. The help content includes (but is not limited to) descriptions of interactions, specific error messages, and the specific format of the file listing custom matrices and their associated penalties. The help section also explains the location of created files (sequence files created by text box entry and custom matrices) and when read/write permissions for those locations may be needed. The help content is organized by subject and can be accessed quickly by clicking on corresponding links at the top of the page.Substitution matrices are crucial to alignment algorithms but current tools do not allow the simultaneous exploration of alignments resulting from multiple matrices. This work presents SubVis, an interactive R package for visually exploring the effects of substitution matrices on protein sequence alignment. Widely used matrices and multiple user-defined custom matrices can be applied to alignments. SubVis utilizes Shiny for capturing parameters, R to process alignments, and JavaScript to visualize overview and detail results. Users can easily transition from overall metrics, such as percent identity and alignment score, to detailed information for individual amino acids and vice versa. Many interactions allow the display of desired information including log-odds ratios, pattern matches, and amino acid classification by property.There are many opportunities for future work. For example, we plan to extend SubVis from pairwise sequence alignments to multiple sequence alignments and include more descriptors of alignment quality. We would also like to include the ability to dynamically build or modify individual substitution matrices and then immediately investigate the effects of changes on the alignment. Other avenues include the addition of automatic recommendation of substitution matrices so that the researcher can quickly narrow the number of matrices to be evaluated and the incorporation of visual alignment clustering to make comparison more intuitive to users.Project name: SubVishttps://cran.r-project.org/web/packages/SubVis/Project home page - Package: https://github.com/sabarlowe/SubVisProject home page - Demo videos: Operating system(s): Platform independentTested browsers: Mozilla Firefox and Google ChromeProgramming languages: R and JavaScriptOther requirements: R (> 3.3.0), Shiny (R package), Biostrings (R package), and a web browserLicense: GNU GPL > 3NP_005275.1), G-protein coupled receptor 12 (NP_005279.1), DDX4 Homo sapiens (AAH47455.1), DDX4 Xenopus laevis (NP_001081728.1), and supplemental sequences were downloaded from the Protein database at the National Center for Biotechnology Information (Data: The FASTA sequences for G-protein coupled receptor 6 isoform b (ormation . The dat10.7717/peerj.3492/supp-1Supplemental Information 1Click here for additional data file.10.7717/peerj.3492/supp-2Supplemental Information 2Click here for additional data file.10.7717/peerj.3492/supp-3Supplemental Information 3Click here for additional data file.


Transcripts are frequently modified by structural variations, which lead to fused transcripts of either multiple genes, known as a fusion gene, or a gene and a previously non-transcribed sequence. Detecting these modifications, called transcriptomic structural variations (TSVs), especially in cancer tumor sequencing, is an important and challenging computational problem. We introduce SQUID, a novel algorithm to predict both fusion-gene and non-fusion-gene TSVs accurately from RNA-seq alignments. SQUID unifies both concordant and discordant read alignments into one model and doubles the precision on simulation data compared to other approaches. Using SQUID, we identify novel non-fusion-gene TSVs on TCGA samples.The online version of this article (10.1186/s13059-018-1421-5) contains supplementary material, which is available to authorized users. BCR-ABL1 is a well-known fusion oncogene for chronic myeloid leukemia )We present SQUID, the first computational tool that is designed to predict both types of TSVs comprehensively from RNA-seq data. SQUID divides the reference genome into segments and builds a genome segment graph (GSG) from both concordant and discordant RNA-seq read alignments. Using an efficient, novel integer linear program (ILP), SQUID rearranges the segments in the GSG so that as many read alignments as possible are concordant with the rearranged sequence. TSVs are represented by pairs of breakpoints realized by the rearrangement. In this way, it can detect both fusion-gene events and TSVs incorporating previously non-transcribed regions in transcripts. Discordant reads that cannot be made concordant through the optimal rearrangement given by the ILP are discarded as false positive discordant reads, likely due to misalignments. By building a consistent model of the entire rearranged genome and maximizing the number of overall concordant read alignments, SQUID drastically reduces the number of spurious TSVs reported compared with other methods.% more accurate than applying WGS-based SV detection methods to RNA-seq data directly. It is similarly more accurate than the pipeline that uses de novo transcript assembly and transcript-to-genome alignment to detect TSVs. We also show that SQUID is able to detect more TSVs involving non-transcribed regions than any existing fusion-gene detection method.SQUID is highly accurate. It is usually >20We use SQUID to detect TSVs within 401 TCGA tumor samples of four cancer types  of the National Institutes of Health  and 27.1% for HCC1395 (47 out of 173). The maximum sensitivity of fusion-gene TSV prediction is limited by these numbers, which explains the relatively low sensitivity we observed. For non-fusion-gene TSVs, only 13.0% in HCC1954 (36 out of 277) and 21.7% in HCC1395 (13 out of 83) can possibly be identified.We use WGS data for the corresponding cell lines to validate the novel TSVs predicted by SQUID , bladder urothelial carcinoma (BLCA), lung adenocarcinoma (LUAD), and prostate adenocarcinoma (PRAD). TCGA aliquot barcodes of the corresponding samples are listed in Additional file To estimate the accuracy of SQUID’s prediction for selected TCGA samples, we use WGS data for the same patients to validate TSV junctions. There are 72 WGS experiments available for the 400 samples . We use the same approach with WGS to validate SQUID predictions as in the previous section. SQUID’s overall validation rate is 88.21%, which indicates that SQUID is quite accurate and reliable on TCGA data.We find that most samples have ∼18–23 TSVs, including ∼3–4 non-fusion-gene TSVs among all four cancer types Fig. 4. For BRCInter-chromosomal TSVs are more prevalent than intra-chromosomal TSVs for all cancer types Fig. c, althou4For a large proportion of breakpoints occurring multiple times within a cancer type, their partner in the TSV is likely to be fixed and to reoccur every time that breakpoint is used. To quantify this, for each breakpoint that occurred ≥3 times, we compute the entropy of its partner promiscuity. Specifically, we derive a discrete empirical probability distribution of partners for each breakpoint and compute the entropy of this distribution. This measure, thus, represents the uncertainty of the partner given one breakpoint, with higher entropy corresponding to a less conserved partnering pattern. In Fig. 4TSGs protect cells from becoming cancer cells. Usually their functions involve inhibiting cell cycle, facilitating apoptosis, and so on . MutatioZFHX3 gene encodes a transcription factor that transactivates cyclin-dependent kinase inhibitor 1A (CDKN1A), a cell cycle inhibitor  is an indicator function, which is 1 if x is true and 0 otherwise. Comparison between permuted elements is defined as comparing their index in permutation, that is, π(v)<π(u) states that segment v is in front of segment u in rearrangement π. We write e∼ if e is compatible with π and f.where π and f, it needs to connect the right side of the segment in front to the left side of the segment following it. As we will see below, the edges of a GSG are derived from read alignments. An edge being compatible with π and f is essentially equivalent to stating that the corresponding read alignments are concordant with respect to the target genome determined by π and f. When  is clear, we refer to edges that are compatible as concordant edges and edges that are incompatible as discordant edges.The above two edge compatibility Eqs. With the above definitions, we formulate an optimization problem as follows:Input: A set of segments S and a GSG G=.Output: Permutation π on S and orientation function f that maximizes: π,f) such that when aligning reads to the rearranged sequence, as many reads as possible will be aligned concordantly. This objective function includes both concordant alignments and discordant alignments and sets them in competition, which is effective in reducing the number of false positives when tumor transcripts outnumber normal transcripts. There is the possibility that some rearranged tumor transcripts will be outnumbered by normal counterparts. To be able to detect TSVs in this case, depending on the setting, we may weight discordant read alignments more than concordant read alignments. Specifically, for each discordant edge e, we multiply the weight w(e) by a constant α that represents our estimate of the ratio of normal transcripts over tumor counterparts.This objective function tries to find a rearrangement of genome segments  and those that correspond to the reference genome as . An edge e can be predicted as a TSV if e∼ and The final TSVs are modeled as pairs of breakpoints. Denote the permutation and orientation corresponding to an optimally rearranged genome as  of Problem xe=1 if edge e∼ and 0 if not.zuv=1 if segment u is before v in the permutation π∗ and 0 otherwise.yu=1 if f∗(uh)=1 for segment u.We use ILP to compute an optimal solution . Plugging in ut, the first equation in (1[π(u)>π(v)]=1−f(ut) and can be rewritten as 1[π(u)<π(v)]=f(uh)=yu. Note that 1[π(u)<π(v)] has the same meaning as zuv; it leads to the constraint zuv=yu. Similarly, the second equation in . Each alignment R[i]=Ai has four components: a chromosome (Chr), an alignment starting position (Spos), an alignment ending position, and an orientation . We require that the alignments Ai are sorted by their position in the read. A split-aligned end R= is concordant if all the following conditions hold: We define concordance criteria separately for split-alignment and paired-end alignment. If one end of a paired-end read is split into several parts and each part is aligned to a location, the end has split alignments. Denote the vector of the split alignments of an end as R’s mate as M=. An alignment of the paired-end read is concordant if the following conditions all hold: If the end is not split, but continuously aligned, the alignment automatically satisfies Eq. R is in front of the leftmost split of the reverse read M, since the two ends in a read pair may overlap. For a paired-end read to be concordant, each end should satisfy split-read alignment concordance  the start position and end position of each interval of overlapping discordant alignments and (2) an arbitrary position in each 0-coverage region.Ideally, both ends of a discordant read should be in separate segments, otherwise, a discordant read in a single segment will always be discordant, no matter how the segments are rearranged. Assuming discordant read alignments of each TSV pile up around the breakpoints and do not overlap with the discordant alignments of other TSVs, we set a breakpoint on the start and end positions of each contiguous interval of overlapping discordant alignments.Each segment that contains discordant read alignments may also contain concordant alignments that connect the segment to its adjacent segments. To avoid having all segments in a GSG connected to their adjacent segments and thus, creating one big connected component, we pick the starting point of each 0-coverage region as a breakpoint. By adding those breakpoints, different genes will be in separate connected components unless some discordant reads support their connection. Overall, the size of each connected component is not very large. The number of nodes generated by each gene is approximately the number of exons located in them and these gene subgraphs are connected only when there is a potential TSV between them.In a GSG, an edge is added between two vertices when there are reads supporting the connection. For each read spanning different segments, we build an edge such that when traversing the segments along the edge, the read is concordant with the new sequence [Eqs.  and 9)]]9)]. Exaα. The discordant edge weight coefficient α represents the normal/tumor cell ratio  and the rearranged genome, and use the new genome as the reference genome for alignment, and hg38 with the original annotated gene positions as the target genome for sequencing. Flux Simulator  was usedAfter simulating SVs in the genome, we need to transform the SVs into a set of TSVs, because not all SVs affect the transcriptome, and thus, not all SVs can be detected by RNA-seq. To derive a list of TSVs, we compare the positions of simulated SVs with the gene annotation. If a gene is affected by an SV, some adjacent nucleotides in the corresponding transcript may be in a far part of the RSVsim-generated genome. The adjacent nucleotides may be consecutive nucleotides inside an exon if the breakpoint breaks the exon, or the endpoints of two adjacent exons if the breakpoint hits the intron. So for each SV that hits a gene, we find the pair of nucleotides that are adjacent in the transcript and separated by the breakpoints, and convert them into the coordinates of the RSVsim-generated genome, thus, deriving the TSV.We compare SQUID to the pipeline of de novo transcriptome assembly and transcript-to-genome alignment. We also use the same set of simulations to test whether existing WGS-based SV detection methods can be directly applied to RNA-seq data. For the de novo transcriptome assembly and transcript-to-genome alignment pipeline, we use all combinations of the existing software Trinity , Trans-AAdditional file 1Table S1 with descriptions, Figures S1–S8 with descriptions. (PDF 2979 kb)Additional Text, Additional file 2Precision and sensitivity table for simulated data with different read lengths and fragment lengths. (TSV 7.43 KB)Additional file 3SQUID predictions for the HCC1395 cell line. (TSV 5 KB)Additional file 4SQUID predictions for the HCC1954 cell line. (TSV 4 KB)Additional file 5Aliquot barcodes of used TCGA samples. (TSV 13 KB)