This function calculates Vst (variant fixation index) for populations given a list of duplicated loci
Arguments
- AD
data frame of total allele depth values of (duplicated, if
id.list
is not provided) SNPs- pops
character. A vector of population names for each individual. Must be the same length as the number of samples in AD
- id.list
character. A vector of duplicated SNP IDs. Must match the IDs in the AD data frame
- qGraph
logical. Plot the network plot based on Vst values (see details)
- verbose
logical. show progress
- ...
additional arguments passed to
qgraph
Details
Vst is calculated with the following equation
$$V_{T} = \frac{ V_{S} }{V_{T}}$$ where VT is the variance of normalized
read depths among all individuals from the two populations and VS is the
average of the variance within each population, weighed for population size
(see reference for more details)
See qgraph
help for details on qgraph output
References
Redon, Richard, et al. Global variation in copy number in the human genome. nature 444.7118 (2006)
Examples
if (FALSE) data(alleleINF)
data(ADtable)
DD<-dupGet(alleleINF)
#> categorizing deviant SNPs with
#> excess of heterozygotes z.all & chi.all
ds<-DD[DD$dup.stat=="deviant",]
ad<-ADtable[match(paste0(ds$CHROM,".",ds$POS),paste0(ADtable$CHROM,".",ADtable$POS)),]
vst(ad,pops=substr(colnames(ad)[-c(1:4)],1,11)) # \dontrun{}
#>
|
| | 0%
|
| | 1%
|
|= | 2%
|
|= | 3%
|
|== | 4%
|
|== | 5%
|
|=== | 6%
|
|=== | 7%
|
|==== | 8%
|
|==== | 9%
|
|===== | 10%
|
|====== | 11%
|
|====== | 12%
|
|======= | 13%
|
|======= | 14%
|
|======== | 15%
|
|======== | 16%
|
|========= | 17%
|
|========= | 18%
|
|========== | 19%
|
|========== | 20%
|
|========== | 21%
|
|=========== | 22%
|
|=========== | 23%
|
|============ | 24%
|
|============ | 25%
|
|============= | 26%
|
|============= | 27%
|
|============== | 28%
|
|============== | 29%
|
|=============== | 30%
|
|================ | 31%
|
|================ | 32%
|
|================= | 33%
|
|================= | 34%
|
|================== | 35%
|
|================== | 36%
|
|=================== | 37%
|
|=================== | 38%
|
|==================== | 39%
|
|==================== | 40%
|
|==================== | 41%
|
|===================== | 42%
|
|===================== | 43%
|
|====================== | 44%
|
|====================== | 45%
|
|======================= | 46%
|
|======================= | 47%
|
|======================== | 48%
|
|======================== | 49%
|
|========================= | 50%
|
|========================== | 51%
|
|========================== | 52%
|
|=========================== | 53%
|
|=========================== | 54%
|
|============================ | 55%
|
|============================ | 56%
|
|============================= | 57%
|
|============================= | 58%
|
|============================== | 59%
|
|============================== | 60%
|
|============================== | 61%
|
|=============================== | 62%
|
|=============================== | 63%
|
|================================ | 64%
|
|================================ | 65%
|
|================================= | 66%
|
|================================= | 67%
|
|================================== | 68%
|
|================================== | 69%
|
|=================================== | 70%
|
|==================================== | 71%
|
|==================================== | 72%
|
|===================================== | 73%
|
|===================================== | 74%
|
|====================================== | 75%
|
|====================================== | 76%
|
|======================================= | 77%
|
|======================================= | 78%
|
|======================================== | 79%
|
|======================================== | 80%
|
|======================================== | 81%
|
|========================================= | 82%
|
|========================================= | 83%
|
|========================================== | 84%
|
|========================================== | 85%
|
|=========================================== | 86%
|
|=========================================== | 87%
|
|============================================ | 88%
|
|============================================ | 89%
|
|============================================= | 90%
|
|============================================== | 91%
|
|============================================== | 92%
|
|=============================================== | 93%
|
|=============================================== | 94%
|
|================================================ | 95%
|
|================================================ | 96%
|
|================================================= | 97%
|
|================================================= | 98%
|
|==================================================| 99%
|
|==================================================| 100%
#> KKOGR07_000 KKOGR07_001 KKOGR07_002 KKOGR07_003 KKOGR07_004
#> KKOGR07_000 NA NA NA NA NA
#> KKOGR07_001 -0.05122414 NA NA NA NA
#> KKOGR07_002 -0.04371113 -0.042496590 NA NA NA
#> KKOGR07_003 -0.02603668 -0.026878950 -0.022139367 NA NA
#> KKOGR07_004 -0.01252776 -0.005286347 -0.009161007 0.0217061531 NA
#> KKOGR07_005 -0.04848016 0.001521456 0.004962315 0.0151247848 0.032953289
#> KKOGR07_006 -0.05562812 -0.014114825 -0.014535465 0.0077975184 0.015824418
#> KKOKT10_000 0.13616157 0.186596780 0.204152082 0.0869423330 0.256857888
#> KKOKT10_001 -0.05780229 -0.039294302 -0.035640345 -0.0310422447 -0.009366708
#> KKOKT10_002 -0.03738761 -0.016342567 -0.023458249 -0.0148268130 -0.001101267
#> KKOKT10_003 -0.02774479 -0.013764561 -0.012173887 -0.0150586122 0.019466392
#> KKOKT10_004 -0.02774910 -0.010272805 -0.016956333 -0.0193283672 0.027305690
#> KKOKT10_005 -0.01881313 0.008650971 0.009339490 -0.0006875292 0.041958367
#> KKOKT10_006 0.01223390 0.016782762 0.005973111 0.0373721639 -0.027712851
#> KKOKT10_007 -0.04286858 -0.003037995 -0.015330106 0.0092210254 0.000359757
#> KKOGR07_005 KKOGR07_006 KKOKT10_000 KKOKT10_001 KKOKT10_002
#> KKOGR07_000 NA NA NA NA NA
#> KKOGR07_001 NA NA NA NA NA
#> KKOGR07_002 NA NA NA NA NA
#> KKOGR07_003 NA NA NA NA NA
#> KKOGR07_004 NA NA NA NA NA
#> KKOGR07_005 NA NA NA NA NA
#> KKOGR07_006 -0.031420615 NA NA NA NA
#> KKOKT10_000 0.245367293 0.275764500 NA NA NA
#> KKOKT10_001 -0.033006393 -0.032583610 0.07668781 NA NA
#> KKOKT10_002 0.012029077 -0.001113533 0.17827212 -0.053217457 NA
#> KKOKT10_003 0.039989191 0.028427012 0.19380683 -0.051441882 -0.037921936
#> KKOKT10_004 0.033516110 0.018835012 0.14721069 -0.047534596 -0.031878762
#> KKOKT10_005 0.053380978 0.044445648 0.15893253 -0.030200484 -0.005879087
#> KKOKT10_006 0.072861128 0.050073301 0.35024893 -0.006957781 0.003017883
#> KKOKT10_007 0.001646667 -0.029910661 0.30899688 -0.044790561 -0.023194798
#> KKOKT10_003 KKOKT10_004 KKOKT10_005 KKOKT10_006 KKOKT10_007
#> KKOGR07_000 NA NA NA NA NA
#> KKOGR07_001 NA NA NA NA NA
#> KKOGR07_002 NA NA NA NA NA
#> KKOGR07_003 NA NA NA NA NA
#> KKOGR07_004 NA NA NA NA NA
#> KKOGR07_005 NA NA NA NA NA
#> KKOGR07_006 NA NA NA NA NA
#> KKOKT10_000 NA NA NA NA NA
#> KKOKT10_001 NA NA NA NA NA
#> KKOKT10_002 NA NA NA NA NA
#> KKOKT10_003 NA NA NA NA NA
#> KKOKT10_004 -0.0428280300 NA NA NA NA
#> KKOKT10_005 -0.0177511147 -0.018142971 NA NA NA
#> KKOKT10_006 0.0196278521 0.035513265 0.06519210 NA NA
#> KKOKT10_007 -0.0001255767 0.003424613 0.02279381 0.00874942 NA