draw.detsel.graphs: Plot Graphical Outputs

Description Usage Arguments Details Value References Examples

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
## 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) 

Example output

Loading required package: ash
[1] TRUE
Read 967 items
The data file data.dat contains 100 loci, with 2-5 alleles per locus, and 2 populations
The average values of population-specific measures of differentiation are:
----------------------------------------------
Pair		F_1			F_2
1-2		0.0847			0.054
----------------------------------------------
The program will now create 1 simulation files. Please wait, this can take some time...
Simulating data in output file: `Pair_1_2_50_50.dat`...
All the simulations have been completed.
The difference between observed and simulated values of population-specific measures of differentiation are:
-------------------------------------------------------------------------
Pair		F_1 (obs)	F_1 (sim)	F_2 (obs)	F_2 (sim)
Pair_1_2	0.08468		0.08403		0.05398		0.05066
-------------------------------------------------------------------------
Computing p-values. Please wait, this can take some time...
The p-values for each locus in population pair 1-2 are:
-------------------
    Locus      P-value
1       1  9.36789e-03
2       2  8.36078e-01
3       3  9.40787e-01
4       4  2.74520e-01
5       5  8.36078e-01
6       6  8.43678e-01
7       7  5.73381e-01
8       8  3.95890e-01
9       9  6.04348e-01
10     10  8.43678e-01
11     11  9.70382e-01
12     12  4.26136e-01
13     13  3.34588e-01
14     14  8.12950e-01
15     15  8.04144e-01
16     16  7.68481e-01
17     17  4.72678e-01
18     18  6.35940e-01
19     19  7.90642e-01
20     20  6.70484e-01
21     21  8.36078e-01
22     22  8.36078e-01
23     23  6.28071e-01
24     24  7.35186e-01
25     25  2.69923e-01
26     26  7.49147e-01
27     27  4.41417e-01
28     28  0.00000e+00
29     29  1.34467e-01
30     30  4.04654e-01
31     31  8.29567e-01
32     32  7.09077e-01
33     33  8.36078e-01
34     34  6.19213e-01
35     35  1.75924e-01
36     36  4.31727e-01
37     37  2.85570e-01
38     38  8.36078e-01
39     39  5.33113e-01
40     40  3.05798e-01
41     41  8.78314e-01
42     42  8.12950e-01
43     43  8.86951e-01
44     44  9.15217e-01
45     45  8.60861e-01
46     46  5.20290e-01
47     47  7.46922e-01
48     48  8.26629e-01
49     49  5.33113e-01
50     50  6.95652e-01
51     51  6.28071e-01
52     52  6.53019e-01
53     53  8.86951e-01
54     54  9.65956e-02
55     55  9.35901e-01
56     56  0.00000e+00
57     57  1.59090e-02
58     58  9.70382e-01
59     59  6.88881e-01
60     60  9.64186e-01
61     61  6.17553e-01
62     62  2.95736e-02
63     63  2.68178e-01
64     64  8.97006e-01
65     65  7.07588e-01
66     66  0.00000e+00
67     67  3.32211e-01
68     68  7.68481e-01
69     69  6.19213e-01
70     70  7.07588e-01
71     71  4.96168e-01
72     72  8.99169e-01
73     73  8.43678e-01
74     74  4.41417e-01
75     75  4.96676e-01
76     76  8.43678e-01
77     77  3.12081e-01
78     78  8.29567e-01
79     79  9.35901e-01
80     80  9.40787e-01
81     81  9.13639e-01
82     82  3.95890e-01
83     83  2.00570e-01
84     84  8.36078e-01
85     85  9.40787e-01
86     86  7.27134e-01
87     87  9.13639e-01
88     88  7.90642e-01
89     89  5.73381e-01
90     90  6.88881e-01
91     91  0.00000e+00
92     92  7.27134e-01
93     93  1.79937e-02
94     94  4.61221e-01
95     95  9.40787e-01
96     96  1.78729e-04
97     97  0.00000e+00
98     98  5.10016e-03
99     99  2.25559e-03
100   100 -2.22045e-16
-------------------
The above results are saved in file: P-values_1_2.dat
Reading simulation files for populations 1 and 2. Please wait, this can take some time...
Plotting graphs...
Done.

DetSel documentation built on May 2, 2019, 6:11 p.m.