The function snpposi.plot plots the positions and density of
SNPs in the alignment.
The function snpposi.test tests whether SNPs are randomly
distributed in the genome, the alternative hypothesis being that they
are clustered. This test is based on the distances of each SNP to the
closest SNP. This provides one measure of clustering for each SNP.
Different statistics can be used to summarise these values (argument
stat), but by default the statistics used is the median.
snpposi.plot and snpposi.test are generic functions with
methods for vectors of integers or numeric (indicating SNP position),
and for DNAbin objects.
snpposi.plot(...)## S3 method for class 'integer':
snpposi.plot(x, genome.size, smooth=0.1,
col="royalblue", alpha=.2, codon=TRUE, start.at=1, \dots)
## S3 method for class 'numeric':
snpposi.plot(x, \dots)
## S3 method for class 'DNAbin':
snpposi.plot(x, \dots)
snpposi.test(...)
## S3 method for class 'integer':
snpposi.test(x, genome.size, n.sim=999, stat=median, \dots)
## S3 method for class 'numeric':
snpposi.test(x, \dots)
## S3 method for class 'DNAbin':
snpposi.test(x, \dots)
DNAbin object.integer
method.randtest.fasta2DNAbin to read fasta alignments with minimum
RAM use.if(require(ape)){
data(woodmouse)
snpposi.plot(woodmouse, codon=FALSE)
snpposi.plot(woodmouse)
snpposi.test(c(1,3,4,5), 100)
snpposi.test(woodmouse)
}Run the code above in your browser using DataLab