snpsToGenes: snpsToGenes

Description Usage Arguments Value Author(s) Examples

Description

This function maps SNPs to genes based on their genomic location. All SNPs within a specified distance from a gene are assigned to that gene.

Usage

1
snpsToGenes(snpLocs, geneLocs, dist = 0)

Arguments

snpLocs

A dataframe or matrix specifying SNP locations. It should contain 3 columns: snpName, chr, position.

geneLocs

A dataframe or matrix specifying gene locations. It should contain 4 columns: geneName, chr, start, end.

dist

An integer specifying a distance from the gene boundaries (number of bases).

Value

Returns a list of vectors containing SNP IDs, one for each gene. Genes with no assigned SNPs are not included in the list.

Author(s)

Michael Mooney <mooneymi@ohsu.edu>

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# Load SNP locations from a Plink .map file
snpLocs = read.delim(plink_map_file, sep="", header=F, stringsAsFactors=F)
snpLocs = snpLocs[,c(2,1,4)]
colnames(snpLocs) = c("snpName", "chr", "pos")

# Map SNPs to genes
snpMap = snpsToGenes(snpLocs, geneLocs, dist=1000)
## End(Not run)

mooneymi/gsaPermute documentation built on May 23, 2019, 6:11 a.m.