FPR4AM {Eagle} | R Documentation |
Set the false positive rate for AM
Description
The lambda parameter in AM
controls the false positive rate of the model
building process. This function uses permutation to find the lambda value for a desired false positive rate.
Usage
FPR4AM(
falseposrate = 0.05,
trait = trait,
numreps = 200,
fformula = NULL,
numlambdas = 50,
geno = NULL,
pheno = NULL,
map = NULL,
Zmat = NULL,
ncpu = detectCores(),
ngpu = 0,
seed = 101
)
Arguments
falseposrate |
the desired false positive rate. |
trait |
the name of the column in the phenotype data file that contains the trait data. The name is case sensitive and must match exactly the column name in the phenotype data file. This parameter must be specified. |
numreps |
the number of replicates upon which to base the calculation of the false positive rate. We have found 200 replicates to be sufficient but more is better. |
fformula |
the right hand side formula for the fixed effects part of the model. |
numlambdas |
the number of equidistant lambda values from 0 to 1 for which to calculate the false positive rate of the model building process. This should not need adjusting. |
geno |
the R object obtained from running |
pheno |
the R object obtained from running |
map |
the R object obtained from running |
Zmat |
the R object obtained from running |
ncpu |
a integer value for the number of CPU that are available for distributed computing. The default is to determine the number of CPU automatically. |
ngpu |
a integer value for the number of gpu available for computation. The default is to assume there are no gpu available. This option has not yet been implemented. |
seed |
a integer value for the starting seed for the permutations. |
Details
The false positive rate for AM
is controlled by its lambda parameter. Values close to
1 (0) decreases (increases) the false positive rate of detecting SNP-trait associations. There is no
analytical way of setting lambda for a specified false positive rate. So we are using permutation to do this empirically.
By setting falseposrate
to the desired false positive rate, this function will find the corresponding lambda value for AM
.
A table of other lambda values for a range of false positive rates is also given.
To increase the precision of the lambda estimates, increase numreps
.
Value
A list with the following components:
- numreps:
the number of permutations performed.
- lambda:
the vector of lambda values.
- falsepos:
the false positive rates for the lambda values.
- setlambda:
the lambda value that gives a false positive rate of
falseposrate
See Also
Examples
## Not run:
# Since the following code takes longer than 5 seconds to run, it has been tagged as dontrun.
# However, the code can be run by the user.
#
#-------------------------
# Example
#------------------------
# read the map
#~~~~~~~~~~~~~~
# File is a plain space separated text file with the first row
# the column headings
complete.name <- system.file('extdata', 'map.txt',
package='Lion')
map_obj <- ReadMap(filename=complete.name)
# read marker data
#~~~~~~~~~~~~~~~~~~~~
# Reading in a PLINK ped file
# and setting the available memory on the machine for the reading of the data to 8 gigabytes
complete.name <- system.file('extdata', 'geno.ped',
package='Lion')
geno_obj <- ReadMarker(filename=complete.name, type='PLINK', availmemGb=8)
# read phenotype data
#~~~~~~~~~~~~~~~~~~~~~~~
# Read in a plain text file with data on a single trait and two covariates
# The first row of the text file contains the column names y, cov1, and cov2.
complete.name <- system.file('extdata', 'pheno.txt', package='Lion')
pheno_obj <- ReadPheno(filename=complete.name)
# Suppose we want to perform the AM analysis at a 5% false positive rate.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ans <- FPR4AM(falseposrate = 0.05,
trait = 'y',
fformula=c('cov1+cov2'),
map = map_obj,
pheno = pheno_obj,
geno = geno_obj)
res <- AM(trait = 'y',
fformula=c('cov1+cov2'),
map = map_obj,
pheno = pheno_obj,
geno = geno_obj,
lambda = ans$setlambda)
## End(Not run)