Skip to contents

Run LFMM

Usage

lfmm_run(
  gen,
  env,
  K,
  lfmm_method = "ridge",
  p_adj = "fdr",
  sig = 0.05,
  calibrate = "gif"
)

Arguments

gen

genotype dosage matrix (rows = individuals & columns = SNPs) or vcfR object

env

dataframe with environmental data or a Raster* type object from which environmental values for the coordinates can be extracted

K

number of latent factors (if left as NULL (default), K value selection will be conducted)

lfmm_method

lfmm method (either "ridge" (default) or "lasso")

p_adj

method to use for p-value correction (defaults to "fdr"); other options can be found in p.adjust

sig

alpha level for determining candidate SNPs (defaults to 0.05)

calibrate

a character string, "gif" or "median+MAD". If the "gif" option is set (default), significance values are calibrated by using the genomic control method. Genomic control uses a robust estimate of the variance of z-scores called "genomic inflation factor". If the "median+MAD" option is set, the pvalues are calibrated by computing the median and MAD of the zscores. If NULL, the pvalues are not calibrated.