getTopLoc: Creates a panel of the top n "unlinked" loci, and exports the...

View source: R/getTopLoc.R

getTopLocR Documentation

Creates a panel of the top n "unlinked" loci, and exports the list of loci

Description

getTopLoc Extracts the genotypes of individuals at the top n (by Fst) "unlinked" loci. The loci returned are in linkage equilibrium above a user defined r^2 threshold. The resultant file can then be used to simulate the panel efficacy using freqbasedsim. Alternatively, multiple panel sizes can be created by using truncated vectors of the exported loci names in the function subset_genepop from the genepopedit package (www.github.com/rystanley)

Usage

getTopLoc(GPD, LDpop = "Pop1", panel.size, FST.threshold = 0.05,
  allocate.PGD.RAM = 1, r2.threshold = 0.2, ld.window = NULL, where.PLINK,
  where.PGDspider, return.environment = TRUE,
  save.LociandIndividuals = FALSE)

Arguments

GPD

A file path to the GENEPOP format file you wish to create your panel from

LDpop

A string which denotes which of the two populations you wish to calculate linkage disequilibrium in. The options are "Pop1" or "Pop2", or "Both" if the LD is to be calculated based on both populations.

panel.size

An integer number of loci to include in the panel

FST.threshold

The minimum FST threshold required to retain a locus

allocate.PGD.RAM

An integer value in GB to specify the maximum amount of RAM to allocate to PGDspider. The default is 1 GB, which should be sufficient for most analyses.

r2.threshold

The minimum r^2 threshold to consider a pair of loci to be in LD

ld.window

Number of adjacent SNPs to compare each SNP against for LD - default is NULL, which translates to a window size of 99999, which essentially asks to compare each SNP against all others

where.PLINK

A file path to the PLINK installation folder

where.PGDspider

A file path to the PGDspider installation folder


bwringe/hybriddetective documentation built on March 22, 2023, 6:52 a.m.