map2class: Mapping SNPs to Classes

Description Usage Arguments Details Value Author(s) Examples

View source: R/GenCAT_functions.R

Description

The function maps SNPs to classes based on genome coordinates

Usage

1
map2class(coords, SNPs, extend.boundary = 0)

Arguments

coords

A data frame containing chromosome and upper and lower coordinates for a each class to be mapped. This must include column names 'chr', 'start', 'stop', and 'class'.

SNPs

A data frame containing genome coordinates of SNPs. This must include column names 'SNP', 'chr', 'position'.

extend.boundary

Number of base pairs to extend the class coordinates for mapping.

Details

Genomic coordinates defining the class boundaies in object, coors, and SNP location in object, SNPs should be annotated within the same build.

Note: That if using the map2class function to map SNPs to classes to use in the GenCAT function, then additional columns for effect_allele and other_allele can be used.

Value

A data frame with SNP information including class label.

Author(s)

Eric Reed, Sara Nunez, Jing Qian, Andrea Foulkes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data('CardioData')
data('coords')

######################
#Mapping SNPs to genes
######################
print(head(coords))

#Subset CardioData to decrease CPU time
CardioDataSub<-CardioData[CardioData$chr < 15,]
set.seed(1)
CardioDataSub<-CardioDataSub[sample(1:nrow(CardioDataSub), 100),]

print(head(CardioDataSub))

CardioMapped<-map2class(coords, CardioDataSub, extend.boundary = 5000)

GenCAT documentation built on May 30, 2017, 1:31 a.m.