create_array: 'Create GBS.array objects'

Description Usage Arguments Value Examples

View source: R/create_array.R

Description

Create GBS.array objects from Geno4imputeR objects. It will compute population allele frq based on families of selfed kids. Original Geno4imputeR will be updated and returned. A set of GBS.array objects will be output to the directory by chromosomes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
create_array(geno, ped, pargeno, pp = NULL, pinfo = NULL,
  outdir = "largedata/obs", bychr = FALSE, bychunk = NULL)

get_snpinfo(geno, ped, self_cutoff)

pedinfo(ped)

est_pop_maf(geno, pinfo, ped, self_cutoff)

est_maf(pgeno)

est_missing(pgeno)

ped_focal(ped, pargeno, focalp)

get_array_item(subgeno, myped, focalp, pp)

Arguments

geno

a data.frame of gentoype. coded with 0 (major), 1 (het), 2 (minor) and 3 (missing).

ped

a data.frame of pedigree information, must include three columns: proid (progeny id), parent1 (the first parent id), parent2 (the 2nd parent id).

pargeno

A data.frame with two columns: "parentid" and "true_p". The 2nd column indicates whether the true parental genotype is available.

outdir

path of the output dir.

bychr

Wether to split the data by 10 chromsomes.

Value

Return updated Geno4imputeR object. The GBS.array objects will be output to the given directory by family and chr.

Details of the GBS.array objects. Slot1: true_parents, a list of data.frame(hap1, hap2). Slot2: gbs_parents, a list of genotypes. For example, c(1, 2, 2, 0, 3). Slot3: true_kids, a list of data.frame(hap1, hap2). Slot4: gbs_kids, a list of kid genotypes. For example, c(1, 1, 3, 1, 2). Slot5: pedigree, a data.frame (kid, p1, p2). Note, p1 is the focal parent. Slot6: freq, a vector of reference allele freq for all SNPs.

See https://github.com/yangjl/imputeR/blob/master/vignettes/imputeR-vignette.pdf for more details.

Examples

1
2
create_array(Geno4imputeR, ped, outdir="largedata/", 
maf_cutoff=0.002, lmiss_cutoff=0.8, imiss_cutoff=0.8, size_cutoff=40)

yangjl/imputeR documentation built on May 4, 2019, 2:28 p.m.