| Bioinformatics Toolbox™ | ![]() |
[Dn, Ds, Vardn, Vards]
= dnds(SeqNT1, SeqNT2)
[Dn, Ds, Vardn, Vards]
= dnds(SeqNT1, SeqNT2,
...'GeneticCode', GeneticCodeValue, ...)
[Dn, Ds, Vardn, Vards]
= dnds(SeqNT1, SeqNT2,
...'Method', MethodValue, ...)
[Dn, Ds, Vardn, Vards]
= dnds(SeqNT1, SeqNT2,
...'Window', WindowValue, ...)
[Dn, Ds, Vardn, Vards]
= dnds(SeqNT1, SeqNT2,
...'AdjustStops', AdjustStopsValue, ...)
[Dn, Ds, Vardn, Vards]
= dnds(SeqNT1, SeqNT2,
...'Verbose', VerboseValue, ...)
| SeqNT1, SeqNT2 | Nucleotide sequences. Enter either a string or a structure with the field Sequence. |
| GeneticCodeValue | Property to specify a genetic code. Enter a Code Number or a string with a Code Name from the table Genetic Code. If you use a Code Name, you can truncate it to the first two characters. Default is 1 or Standard. |
| MethodValue | String specifying the method for calculating substitution rates. Choices are:
|
| WindowValue | Integer specifying the sliding window size, in codons, for calculating substitution rates and variances. |
| AdjustStopsValue | Controls whether stop codons are excluded from calculations. Choices are true (default) or false. |
| VerboseValue | Property to control the display of the codons considered in the computations and their amino acid translations. Choices are true or false (default). |
| Dn | Nonsynonymous substitution rate(s). |
| Ds | Synonymous substitution rate(s). |
| Vardn | Variance for the nonsynonymous substitution rate(s). |
| Vards | Variance for the synonymous substitutions rate(s). |
[Dn, Ds, Vardn, Vards] = dnds(SeqNT1, SeqNT2) estimates the synonymous and nonsynonymous substitution rates per site between the two homologous nucleotide sequences, SeqNT1 and SeqNT2, by comparing codons using the Nei-Gojobori method.
dnds returns:
Dn — Nonsynonymous substitution rate(s).
Ds — Synonymous substitution rate(s).
Vardn — Variance for the nonsynonymous substitution rate(s).
Vards — Variance for the synonymous substitutions rate(s).
This analysis:
Assumes that the nucleotide sequences, SeqNT1 and SeqNT2, are codon-aligned, that is, do not have frame shifts
Tip If your sequences are not codon-aligned, use the nt2aa function to convert them to amino acid sequences, use the nwalign function to globally align them, then use the seqinsertgaps function to recover the corresponding codon-aligned nucleotide sequences. See Estimating Synonymous and Nonsynonymous Substitution Rates Between Two Nucleotide Sequences That Are Not Codon-Aligned. |
Excludes codons that include ambiguous nucleotide characters or gaps
Considers the number of codons in the shorter of the two nucleotide sequences
Caution If SeqNT1 and SeqNT2 are too short or too divergent, saturation can be reached, and dnds returns NaNs and a warning message. |
[Dn, Ds, Vardn, Vards] = dnds(SeqNT1, SeqNT2, ...'PropertyName', PropertyValue, ...) calls dnds with optional properties that use property name/property value pairs. You can specify one or more properties in any order. Each PropertyName must be enclosed in single quotation marks and is case insensitive. These property name/property value pairs are as follows:
[Dn, Ds, Vardn, Vards]
= dnds(SeqNT1, SeqNT2,
...'GeneticCode', GeneticCodeValue, ...) calculates
synonymous and nonsynonymous substitution rates using the specified
genetic code. Enter a Code Number or a string with a Code Name from
the table Genetic Code. If you
use a Code Name, you can truncate it to the first two characters.
Default is 1 or Standard.
[Dn, Ds, Vardn, Vards] = dnds(SeqNT1, SeqNT2, ...'Method', MethodValue, ...) allows you to calculate synonymous and nonsynonymous substitution rates using the following algorithms:
NG (default) — Nei-Gojobori method (1986) uses the number of synonymous and nonsynonymous substitutions and the number of potentially synonymous and nonsynonymous sites. Based on the Jukes-Cantor model.
LWL — Li-Wu-Luo method (1985) uses the number of transitional and transversional substitutions at three different levels of degeneracy of the genetic code. Based on Kimura's two-parameter model.
PBL — Pamilo-Bianchi-Li method (1993) is similar to the Li-Wu-Luo method, but with bias correction. Use this method when the number of transitions is much larger than the number of transversions.
[Dn, Ds, Vardn, Vards] = dnds(SeqNT1, SeqNT2, ...'Window', WindowValue, ...) performs the calculations over a sliding window, specified in codons. Each output is an array containing a rate or variance for each window.
[Dn, Ds, Vardn, Vards] = dnds(SeqNT1, SeqNT2, ...'AdjustStops', AdjustStopsValue, ...) controls whether stop codons are excluded from calculations. Choices are true (default) or false.
Tip When the 'AdjustStops' property is set to true, the following are true:
|
[Dn, Ds, Vardn, Vards] = dnds(SeqNT1, SeqNT2, ...'Verbose', VerboseValue, ...) controls the display of the codons considered in the computations and their amino acid translations. Choices are true or false (default).
Tip Specify true to use this display to manually verify the codon alignment of the two input sequences, SeqNT1 and SeqNT2. The presence of stop codons (*) in the amino acid translation can indicate that SeqNT1 and SeqNT2 are not codon-aligned. |
Estimating Synonymous and Nonsynonymous Substitution Rates Between the gag Genes of Two HIV Viruses
Retrieve two sequences from the GenBank® database for the gag genes of two HIV viruses.
gag1 = getgenbank('L11768');
gag2 = getgenbank('L11770');Estimate the synonymous and nonsynonymous substitution rates between the two sequences.
[dn ds vardn vards] = dnds(gag1, gag2)
dn =
0.0244
ds =
0.0697
vardn =
2.3509e-005
vards =
2.3438e-004
Estimating Synonymous and Nonsynonymous Substitution Rates Between Two Nucleotide Sequences That Are Not Codon-Aligned
Retrieve two nucleotide sequences from the GenBank database for the neuraminidase (NA) protein of two strains of the influenza A virus (H5N1).
hk01 = getgenbank('AF509094');
vt04 = getgenbank('DQ094287');
Extract the coding region from the two nucleotide sequences.
hk01_cds = featuresparse(hk01,'feature','CDS','Sequence',true); vt04_cds = featuresparse(vt04,'feature','CDS','Sequence',true);
Align the amino acids sequences converted from the nucleotide sequences.
[sc,al] = nwalign(nt2aa(hk01_cds),nt2aa(vt04_cds),'extendgap',1);
Use the seqinsertgaps function to copy the gaps from the aligned amino acid sequences to their corresponding nucleotide sequences, thus codon-aligning them.
hk01_aligned = seqinsertgaps(hk01_cds,al(1,:)) vt04_aligned = seqinsertgaps(vt04_cds,al(3,:))
Estimate the synonymous and nonsynonymous substitutions rates of the codon-aligned nucleotide sequences and also display the codons considered in the computations and their amino acid translations.
[dn,ds] = dnds(hk01_aligned,vt04_aligned,'verbose',true)
[1] Li, W., Wu, C., and Luo, C. (1985). A new method for estimating synonymous and nonsynonymous rates of nucleotide substitution considering the relative likelihood of nucleotide and codon changes. Molecular Biology and Evolution 2(2), 150–174.
[2] Nei, M., and Gojobori, T. (1986). Simple methods for estimating the numbers of synonymous and nonsynonymous nucleotide substitutions. Molecular Biology and Evolution 3(5), 418–426.
[3] Nei, M., and Jin, L. (1989). Variances of the average numbers of nucleotide substitutions within and between populations. Molecular Biology and Evolution 6(3), 290–300.
[4] Nei, M., and Kumar, S. (2000). Synonymous and nonsynonymous nucleotide substitutions" in Molecular Evolution and Phylogenetics (Oxford University Press).
[5] Pamilo, P., and Bianchi, N. (1993). Evolution of the Zfx And Zfy genes: rates and interdependence between the genes. Molecular Biology and Evolution 10(2), 271–281.
Bioinformatics Toolbox™ functions: dndsml, featuresparse, geneticcode, nt2aa, nwalign, seqinsertgaps, seqpdist
![]() | dna2rna | dndsml | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |