draw.detsel.graphs: Plot Graphical Outputs

Description Usage Arguments Details Value References Examples

View source: R/DetSel.R

Description

This command plots graphical outputs for DetSel analyses.

Usage

1
	draw.detsel.graphs(i,j,x.range,y.range,n.bins,m,alpha,pdf,outliers)

Arguments

i

population index

j

population index

x.range

the range of values in the x-axis, respectively, which takes the default values x.range = c(-1,1)

y.range

the range of values in the y-axis, respectively, which takes the default values y.range = c(-1,1)

n.bins

the size of the 2-dimensional array of n x n square cells used to bin the F_1 and F_2 estimates, which takes the default value n.bins = c(100,100)

m

the smoothing parameters of the ASH algorithm, which takes the default value m = c(2,2)

alpha

the alpha-level (hence 1 - alpha is the proportion of the distribution within the plotted envelope), which takes the default value alpha = 0.05

pdf

a logical variable, which is TRUE if the user wants graphics to be plotted in a pdf file

outliers

an optional vector that represents a list of candidate outliers, defined by the user

Details

Once the run.detsel and compute.p.values command lines have been executed, the function draw.detsel.graphs can be used to plot graphs with an estimation of the density of F_1 and F_2 estimates, as detailed in the appendix in Vitalis et al (2001). Note that if the arguments i and j are missing, then all the population pairs are plotted. It is noteworthy that our estimation of the density of the F_1 and F_2 estimates might be discontinuous, because of the discrete nature of the data (the allele counts). This is particularly true when the number of alleles upon which the distribution is conditioned is small. The command line draw.detsel.graphs produces as many conditional distributions per population pair as there are different allele numbers in the pooled sample. All the observed data points are plotted in each graph. The outlier loci are plotted with a star symbol. For the latter, the locus number (i.e., its rank in the data file) is provided on the graph. If the user choses not to provide a pre-defined list of outliers, then the outlier represent all the markers for which the empirical P-value is below the threshold alpha-level,

Value

The pdf files are created in the current directory.

References

Vitalis, R., Dawson, K., and Boursot, P. (2001) Interpretation of variation across marker loci as evidence of selection, Genetics 158: 1811–1823.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## This is to generate an example file in the working directory.
make.example.files()

## This will read an input file named 'data.dat' that contains co-dominant markers,
## and a maximum allele frequency of 0.99 will be applied (i.e., by removing 
## marker loci in the observed and simulated datasets that have an allele with
## frequency larger than 0.99).
read.data(infile = 'data.dat',dominance = FALSE,maf = 0.99)

## The following command line executes the simulations:
run.detsel(example = TRUE)

## This compute empirical P-values, assuming a range of values from -1 to 1
## in both dimensions, a grid of 50 x 50 bins, and a smoothing parameter m = 3
## in both dimensions.
compute.p.values(x.range = c(-1,1),y.range = c(-1,1),n.bins = c(50,50),m = c(3,3))

## This plots (on the screen) the 99% confidence regions corresponding to the
## pair of populations 1 and 2, using a 50 x 50 2-dimensions array.
draw.detsel.graphs(i = 1,j = 2,n.bins = c(50,50),alpha = 0.01,pdf = FALSE) 

## This is to clean up the working directory.
remove.example.files()

DetSel documentation built on Feb. 17, 2020, 5:09 p.m.