Files
snpdiver/man/div_lambda_GC.Rd

49 lines
1.6 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrapper.R
\name{div_lambda_GC}
\alias{div_lambda_GC}
\title{Return lambda_GC for different numbers of PCs for GWAS on Panicum virgatum.}
\usage{
div_lambda_GC(
df,
type = c("linear", "logistic"),
snp,
svd = NA,
ncores = 1,
npcs = c(0:10),
saveoutput = FALSE
)
}
\arguments{
\item{df}{Dataframe of phenotypes where the first column is sample.ID and each
sample.ID occurs only once in the dataframe.}
\item{type}{Character string. Type of univarate regression to run for GWAS.
Options are "linear" or "logistic".}
\item{snp}{A bigSNP object with sample.IDs that match the df.}
\item{svd}{big_SVD object; Covariance matrix to include in the regression.
Generate these using \code{bigsnpr::snp_autoSVD()}.}
\item{ncores}{Number of cores to use. Default is one.}
\item{npcs}{Integer vector of principle components to use.
Defaults to c(0:10).}
\item{saveoutput}{Logical. Should output be saved as a csv to the
working directory?}
}
\value{
A dataframe containing the lambda_GC values for each number of PCs
specified. This is also saved as a .csv file in the working directory.
}
\description{
Given a dataframe of phenotypes associated with sample.IDs and
output from a PCA to control for population structure, this function will
return a .csv file of the lambda_GC values for the GWAS upon inclusion
of different numbers of PCs. This allows the user to choose a number of
PCs that returns a lambda_GC close to 1, and thus ensure that they have
done adequate correction for population structure.
}