Description Usage Arguments Value Author(s) Examples
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.
1 | snpsToGenes(snpLocs, geneLocs, dist = 0)
|
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). |
Returns a list of vectors containing SNP IDs, one for each gene. Genes with no assigned SNPs are not included in the list.
Michael Mooney <mooneymi@ohsu.edu>
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.