Learn R Programming

dartR (version 1.0)

gl2nhyb: Create an input file for the program NewHybrids

Description

This function compares two sets of parental populations to identify loci that exhibit a fixed difference, returns an genlight object with the reduced data, and creates an input file for the program NewHybrids using the top 200 loci. In the absence of two identified parental populations, the script will select a random set 200 loci only (method=random) or the first 200 loci ranked on information content (AvgPIC).

Usage

gl2nhyb(gl, outfile = "nhyb.txt", p0 = NULL, p1 = NULL, t = 0,
  m = "random")

Arguments

gl

-- name of the genlight object containing the SNP data [required]

outfile

-- name of the file to become the input file for NewHybrids [default nhyb.txt]

p0

-- list of populations to be regarded as parental population 0 [default NULL]

p1

-- list of populations to be regarded as parental population 1 [default NULL]

t

-- sets the level at which a gene frequency difference is considered to be fixed [default 0]

m

-- specifies the method to use to select 200 loci for NewHybrids [default random]

Value

The reduced genlight object

Details

A fixed difference occurs when a SNP allele is present in all individuals of one population and absent in the other. There is provision for setting a level of tollerance, e.g. t = 0.05 which considers alleles present at greater than 95 a fixed difference. Only the 200 loci are retained, because of limitations of NewHybids.

It is important to stringently filter the data on RepAvg and CallRate if using the random option. One might elect to repeat the analysis using the random option and combine the resultant posterior probabilites should 200 loci be considered insufficient.

Examples

Run this code
# NOT RUN {
m <- gl2nhyb(gl, c("Pop1", "Pop4"), c("Pop7", "Pop9"), t=0, m="random")
# }

Run the code above in your browser using DataLab