Learn R Programming

SNPassoc (version 1.4-9)

setupSNP: Convert columns in a dataframe to class 'snp'

Description

setupSNP Convert columns in a dataframe to class 'snp' summary.setupSNP gives a summary for an object of class 'setupSNP' including allele names, major allele frequencie, an exact thest of Hardy-Weinberg equilibrium and percentage of missing genotypes

Usage

setupSNP(data, colSNPs, sort = FALSE, info, sep = "/", ...)

Arguments

data
dataframe containing columns with the SNPs to be converted
colSNPs
Vector specifying which columns contain SNPs data
sort
should SNPs be sorted. Default is FALSE
info
if sort is TRUE a dataframe containing information about the SNPs regarding their genomic position and the gene where they are located
sep
character separator used to divide alleles in the genotypes
...
optional arguments

Value

  • a dataframe of class 'setupSNP' containing converted SNP variables. All other variables will be unchanged.

References

JR Gonzalez, L Armengol, X Sole, E Guino, JM Mercader, X Estivill, V Moreno. SNPassoc: an R package to perform whole genome association studies. Bioinformatics, 2007;23(5):654-5.

See Also

snp

Examples

Run this code
data(SNPs)
 myDat<-setupSNP(SNPs,6:40,sep="")


#sorted SNPs and having genomic information
 data(SNPs.info.pos)
 myDat.o<-setupSNP(SNPs,6:40,sep="",sort=TRUE, info=SNPs.info.pos)

# summary
 summary(myDat.o)

# plot one SNP
  plot(myDat,which=2)

Run the code above in your browser using DataLab