xpehh: Computes XP-EHH Statistics (standardized cross-population...

Description Usage Arguments Details Value See Also Examples

View source: R/xpehh.R

Description

This function computes XP-EHH Statistics (standardized cross-population EHH) using two populations and target-SNPs, then performs the SNPs' annotation and generate appropriate tables and graphics.

Usage

1
2
xpehh(pop1, pop2, popname1, popname2, snp.list = "all", filter = 2, method = "both",
annot = T, write.xls = "both", plot = T)

Arguments

pop1

Scalar character with the name of the first population to be compared to the second.

pop2

Scalar character with the name of the second population to be compared to the first one.

popname1

Scalar character with an optional name for the first population.

popname2

Scalar character with an optional name for the second population.

snp.list

Character vector. It could be a scalar named "all" (default) for loading all SNPs present in 'snps' directory, or a character vector with the exact names from the target-SNP files (also supposed to be in 'snps' directory).

filter

Numerical value for filtering significant XP-EHH scores (default = 2).

method

Scalar character. Indicates if applied method must be "bilateral", "unilateral", or "both" (default).

annot

Logical scalar. If TRUE (default), SNP annotation in xls files will be written with correspondent SNP's genes, as well as ancestral and derived allele present in the dataset. FALSE turns off this feature.

write.xls

Scalar character. It could be set to "all.snps" for annotating all SNPs included in this analysis, and "ss.snps" for annotating only SNPs statistically significants (defined by 'filter' argument), or 'both' (default) for both annotation outputs.

plot

Logical scalar. If TRUE (default), then XP-EHH-related plots bill be generated and saved as png figures.

Details

R binary file named 'scanhh.RData' must be loaded before running this function. Populations going to be analyzed must be provided as 'scanhh_list$NAME', where 'NAME' is the population name (see @Examples section). This function creates a new directory in 'rehh_out' folder, named 'xpehh', with two sub-directories: 'xpehh/graphics' for the plots, and 'xpehh/tables' for csv and xls files.

The 'method' parameter indicates which method will be applied ('bilateral', 'unilateral', or 'both'; default = 'both'). The default value for 'filter' parameter has been set to 2 accordingly the standard value described on original paper.

The 'annot' parameter turns on or off annotation procedure (default is TRUE, meaning "on"), while argument passed in 'write.xls' parameter tells which SNPs must be included on analysis ("all.snps", "ss.snps" or "both"). Plot argument enables the generation of two plots/figures per population.

If all parameter's arguments are used as they are by default, then a total of four simple files (.csv) containing XP-EHH results will be generated by analysis to both methods, as well as four .xls files from 'write.xls' parameter.

Except by annotation argument ('annot = T'), this function usually runs very fast. However, depending on how many target-SNPs are present in the dataset, the annotation velocity may vary considerably.

Value

XP-EHH files: simple result files (.csv), SNP annotation (.xls) and/or XP-EHH plots (.png).

See Also

make.scanhh

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
load('scanhh.RData')
xpehh(pop1 = scanhh_list$Africans, pop2 = scanhh_list$Europeans)
## End(Not run)

## Not run: 
load('scanhh.RData')
xpehh(pop1 = scanhh_list$Africans, pop2 = scanhh_list$Europeans), snp.list = 'all', filter = 2,
method = 'unilateral', annot = T, write.xls = 'ss.snps', plot = T)

## End(Not run)

cmcouto-silva/LD documentation built on Sept. 20, 2020, 2:46 p.m.