Variance Estimation for the Nucleotide Substitution Models                                                                                  

F81:variance estimators of the nucleotide substitution number for F81 model.
F81=function(seq1,seq2)

F84:variance estimators of the nucleotide substitution number for F84 model.
F84=function(seq1,seq2)

HKY85:variance estimators of the nucleotide substitution number for HKY85 model.
HKY85=function(seq1,seq2)

TN93:variance estimators of the nucleotide substitution number for TN93 model.
TN93=function(seq1,seq2)

Note:"seq1" and "seq2" are the read data of the two sequences, such as x1 and x2 belows.

Run the codes:
First you need to install the R package "seqinr". You can run the codes using either of
the following two ways.
(a) On the R window, open the file, press "ctrl+a", then press "ctrl+r" or
(b) Save the F81.txt, F84.txt, HKY85.txt and TN93.txt in D:\ and on the R window type:
      source("D:/F81.txt"), source("D:/F84.txt"), source("D:/HKY85.txt") and
      source("D:/TN93.txt").

You need to load the data of the two sequences and set the name for them.
Then you can use the F81, F84, HKY85 and TN93 function to find the variance of the
substitution number for two sequences as follows.

For example,
> x1 <- read.fasta(file="D:/AY090666.fasta")
> x2 <- read.fasta(file="D:/AY090687.fasta")
> F81(x1,x2)
   The 4 variance estimators are
   V1= 0.000524515 , V2= 0.000526922 , V3= 1.298986e-07 , and V4= 0.0005243851 .
> F84(x1,x2)
   The 4 variance estimators are
   V1= 0.0005245847 , V2= 0.000528068 , V3= 2.254411e-07 , and V4= 0.0005243593 .
> HKY85(x1,x2)
   The 4 variance estimators are
   V1= 0.0005821599 , V2= 0.0005914688 , V3= 1.291229e-06 , and V4= 0.0005808686 .
> TN93(x1,x2)
   The 4 variance estimators are
   V1= 0.0005821599 , V2= 0.0005914688 , V3= 1.291229e-06 , and V4= 0.0005808686 .