Learn R Programming

GenCAT (version 1.0.3)

map2class: Mapping SNPs to Classes

Description

The function maps SNPs to classes based on genome coordinates

Usage

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.

Value

A data frame with SNP information including class label.

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab