Last data update: 2014.03.03

R: Extract p-value weights from a GWAS resultfile
getSnpWeightsR Documentation

Extract p-value weights from a GWAS resultfile

Description

This is a very simple function that extracts for a number of SNPs their p-value from an association result file, e.g. generated by PLINK.

Usage

getSnpWeights(
  snps, 
  gwas.resultfile, 
  pColname = "P", 
  snpColname = "SNP"
) 

Arguments

snps

character. A vector of SNP identifiers for that p-values are extracted from gwas.resultfile.

gwas.resultfile

character. Path/filename to the file containing SNPs and p-values. Has to contain a column header line and be readable by the read.table function.

pColname

character. Name of the column containing p-values.

snpColname

character. Name of the column containing SNP identifiers.

Value

A vector containing wheights which are 1 plus the difference to the smallest log P among all SNPs requested. Names of the elements are the according SNP IDs.

Examples

## path to example data
gwas.resultfile <- system.file("extdata", "example.gwas", package = "boostSeq")

getSnpWeights(snps = c("rs8411", "rs7960808"), gwas.resultfile)  

Results