Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Package SNPassoc - Elementary Latin | LATIN 1, Exams of Latin language

Material Type: Exam; Class: Elementary Latin; Subject: Latin; University: University of California - Los Angeles; Term: Unknown 2009;

Typology: Exams

Pre 2010

Uploaded on 08/30/2009

koofers-user-ear-1
koofers-user-ear-1 🇺🇸

10 documents

Partial preview of the text

Download Package SNPassoc - Elementary Latin | LATIN 1 and more Exams Latin language in PDF only on Docsity! Package ‘SNPassoc’ July 18, 2009 Version 1.6-0 Date 2009-Jul-17 Depends R (>= 2.4.0), haplo.stats, survival, mvtnorm, gdata Title SNPs-based whole genome association studies Author Juan R González, Lluís Armengol, Elisabet Guinó, Xavier Solé, and Víctor Moreno Maintainer Juan R González <jrgonzalez@creal.cat> Description This package carries out most common analysis when performing whole genome association studies. These analyses include descriptive statistics and exploratory analysis of missing values, calculation of Hardy-Weinberg equilibrium, analysis of association based on generalized linear models (either for quantitative or binary traits), and analysis of multiple SNPs (haplotype and epistasis analysis). Permutation test and related tests (sum statistic and truncated product) are also implemented. License GPL (>= 2) URL http://www.r-project.org and http://www.creal.cat/jrgonzalez/software.htm Encoding latin1 Repository CRAN Date/Publication 2009-07-18 15:35:40 R topics documented: association . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Bonferroni.sig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 GenomicControl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 getSignificantSNPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 haplo.interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 HapMap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 int . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1 2 association interactionPval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 LD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 make.geno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 maxstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 odds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 permTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 plot.WGassociation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 plotMissing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 qqpval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 scanWGassociation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 setupSNP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 snp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 SNPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 sortSNPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Table.mean.se . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Table.N.Per . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 tableHWE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 WGassociation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Index 36 association Association analysis between a single SNP and a given phenotype Description This function carries out an association analysis between a single SNP and a dependent variable (phenotype) under five different genetic models (inheritance patterns): codominant, dominant, re- cessive, overdominant and log-additive. The phenotype may be quantitative or categorical. In the second case (e.g. case-control studies) this variable must be of class ’factor’ with two levels. Usage association(formula, data, model=c("all"), model.interaction= c("codominant"), subset, name.snp = NULL, quantitative = is.quantitative(formula,data), genotypingRate= 0, level = 0.95, ...) Arguments formula a symbolic description of the model to be fited (a formula object). It might have either a continuous variable (quantitative traits) or a factor variable (case-control studies) as the response on the left of the ~ operator and a term correspond- ing to the SNP on the right. This term must be of class snp (e.g. ~snp(var), where var is a given SNP), and it is required. Terms with additional covari- ates on the right of the ~ operator may be added to fit an adjusted model (e.g., Bonferroni.sig 5 association(log(protein)~snp10001*factor(recessive(snp100019))+blood.pre, data=datSNP, model="dominant") Bonferroni.sig Bonferroni correction of p values Description This function shows the SNPs that are statistically significant after correcting for the number of tests performed (Bonferroni correction) for an object of class "WGassociation" Usage Bonferroni.sig(x, model = "codominant", alpha = 0.05, include.all.SNPs=FALSE) Arguments x an object of class ’WGassociation’. model a character string specifying the type of genetic model (mode of inheritance). This indicantes how the genotypes should be collapsed when ’plot.summary’ is TRUE. Possible values are "codominant", "dominant", "recessive", "overdomi- nant", or "log-additive". The default is "codominant". Only the first words are required, e.g "co", "do", ... . alpha nominal level of significance. Default is 0.05 include.all.SNPs logical value indicating whether all SNPs are considered in the Bonferroni cor- rection. That is, the number of performed tests is equal to the number of SNPs or equal to the number of SNPs where a p value may be computed. The default value is FALSE indicating that the number of tests is equal to the number of SNPs that are non Monomorphic and the rate of genotyping is greater than the percentage indicated in the GeneticModel.pval function. Details After deciding the genetic model, the function shows the SNPs that are statistically significant at alpha level corrected by the number of performed tests. Value A data frame with the SNPs and the p values for those SNPs that are statistically significant after Bonferroni correction See Also WGassociation 6 GenomicControl Examples data(SNPs) datSNP<-setupSNP(SNPs,6:40,sep="") ans<-WGassociation(protein~1,data=datSNP,model="all") Bonferroni.sig(ans, model="codominant", alpha=0.05, include.all.SNPs=FALSE) GenomicControl Population substructure Description This function estimates an inflation (or deflation) factor, lambda, as indicated in the paper by Devlin et al. (2001) and corrects the p-values using this factor. Usage GenomicControl(x, snp.sel) Arguments x an object of class ’WGassociation’. snp.sel SNPs used to compute lambda. Not required. Details This method is only valid for 2x2 tables. This means that the object of class ’WGassociation’ might not have fitted the codominant model. See reference for further details. Value The same object of class ’WGassociation’ where the p-values have been corrected for genomic control. References B Devlin, K Roeder, and S.A. Bacanu. Unbiased Methods for Population Based Association Stud- ies. Genetic Epidemiology (2001) 21:273-84 See Also qqpval, WGassociation getSignificantSNPs 7 Examples data(SNPs) datSNP<-setupSNP(SNPs,6:40,sep="") res<-scanWGassociation(casco,datSNP,model=c("do","re","log-add")) # Genomic Control resCorrected<-GenomicControl(res) plot(resCorrected) getSignificantSNPs Extract significant SNPs from an object of class ’WGassociation’ Description Extract significant SNPs from an object of class ’WGassociation’ when genomic information is available Usage getSignificantSNPs(x, chromosome, model, sig = 1e-15) Arguments x an object of class ’WGassociation’ chromosome chromosome from which SNPs are extracted model genetic model from which SNPs are extracted sig statistical significance level. The default is 1e-15 Value A list with the following components: names the name of SNPs column the columns corresponding to the SNPs in the original data frame ... See Also WGassociation 10 inheritance Source HapMap project (http://www.hapmap.org) Examples data(HapMap) inheritance Collapsing (or recoding) genotypes into different categories (generally two) depending on a given genetic mode of inheritance Description codominant function recodifies a variable having genotypes depending on the allelic frequency in descending order. dominant, recessive, and overdominant functions collapse the three categories of a given SNP into two categories as follows: Let ’AA’, ’Aa’, and ’aa’ be the three genotypes. After determining the most frequent allele (let’s suppose that ’A’ is the major allele) the functions return a vector with to categories as follows. dominant: ’AA’ and ’Aa-aa’; recessive: ’AA-Aa’ and ’aa’; overdominant: ’AA-aa’ vs ’Aa’. additive function creates a numerical variable, 1, 2, 3 corresponding to the three genotypes sorted out by descending allelic frequency (this model is referred as log-additive). Usage codominant(o) dominant(o) recessive(o) overdominant(o) additive(o) Arguments o categorical covariate having genotypes Examples data(SNPs) dominant(snp(SNPs$snp10001,sep="")) overdominant(snp(SNPs$snp10001,sep="")) int 11 int Identify interaction term Description This is a special function used for ’haplo.interaction’ function. It identifies the variable that will interact with the haplotype estimates. Using int() in a formula implies that the interaction term between this variable and haplotypes is included in ’haplo.glm’ function. Usage int(x) Arguments x A factor variable. Value x See Also haplo.interaction Examples # Not Run # data(SNPs) # mod <- haplo.interaction(casco~int(sex)+blood.pre, data=SNPs, # SNPs.sel=c("snp10001","snp10004","snp10005")) # interactionPval Two-dimensional SNP analysis for association studies Description Perform a two-dimensional SNP analysis (interaction) for association studies with possible al- lowance for covariate Usage interactionPval(formula, data, quantitative = is.quantitative(formula, data), model = "codominant") 12 interactionPval Arguments formula a formula object. It might have either a continuous variable (quantitative traits) or a factor variable (case-control study) as the response on the left of the ~ operator and the terms corresponding to the covariates to be adjusted. A crude analysis is performed indicating ~1 data a required object of class ’setupSNP’. quantitative logical value indicating whether the phenotype (those which is in the left of the operator ~ in ’formula’ argument) is quantitative. The function ’is.quantitative’ returns FALSE when the phenotype is a variable with two categories (i.e. in- dicating case-control status). Thus, it is not a required argument but it may be modified by the user. model a character string specifying the type of genetic model (mode of inheritance). This indicates how the genotypes should be collapsed. Possible value are "codom- inant", "dominant", "recessive", "overdominant" or "log-additive". The default is "codominant". Only the first words are required, e.g "co", "do", "re", "ov", "log" Details The ’interactionPval’ function calculates, for each pair of SNPs (i,j), the likelihood underling the null model L0, the likelihood under each of the single-SNP, L(i) and L(j), the likelihood under an additive SNP model La(i,j), and the likelihood under a full SNP model (including SNP-SNP interaction), Lf(i,j). The upper triangle in matrix from this function contains the p values for the interaction (epistasis) log-likelihood ratio test, LRT, LRTij = -2 (log Lf(i,j) - log La(i,j)) The diagonal contains the p values from LRT for the crude effect of each SNP, LRTii = -2 (log L(i) - log L0) The lower triangle contains the p values from LRT comparing the two-SNP additive likelihood to the best of the single-SNP models, LRTji = -2 (log La(i,j) - log max(L(i),L(j))) In all cases the models including the SNPs are adjusted by the covariates indicated in the ’formula’ argument. This method is used either for quantitative traits and dicotomous variables (case-control studies). Value The ’interactionPval’ function returns a matrix of class ’SNPinteraction’ containing the p values corresponding to the different likelihood ratio tests above describe. Methods defined for ’SNPinteraction’ objects are provided for print and plot. The plot method uses ’image’ to plot a grid of p values. The upper triangle contains the interaction (epistasis) p values from LRT. The content in the lower triangle is the p values from the LRT comparing the additive model with the best single model. The diagonal contains the main effects pvalues from LRT. The ’plot.SNPinteraction’ function also allows the user to plot the SNPs sorted by genomic position and with the information about chromosomes as in the ’plotMissing’ function. Note two-dimensional SNP analysis on a dense grid can take a great deal of computer time and memory. make.geno 15 distance Marker location, used for locating of markers on LDplot. show.all If TRUE, show all rows/columns of matrix. Otherwise omit completely blank rows/columns. colorize LD parameter used for determining table cell colors cex Scaling factor for table text. If absent, text will be scaled to fit within the table cells. ... Optional arguments (’plot.LD.data.frame’ passes these to ’LDtable’ and ’LD- plot’). Value None Author(s) functions adapted from LD, LDtable and LDplot in package genetics by Gregory Warnes et al. (warnes@bst.rochester.edu) References genetics R package by Gregory Warnes et al. (warnes@bst.rochester.edu) See Also setupSNP snp make.geno Create a group of locus objects from some SNPs, assign to ’model.matrix’ class. Description This function prepares the CRITICAL element corresponding to matrix of genotypes necessary to be included in ’haplo.glm’ function. Usage make.geno(data, SNPs.sel) Arguments data an object of class ’setupSNP’ containing the the SNPs that will be used to esti- mate the haplotypes. SNPs.sel a vector indicating the names of SNPs that are used to estimate the haplotypes 16 maxstat Value the same as ’setupGeno’ function, from ’haplo.stats’ library, returns See Also snp Examples ## Not run: data(SNPs) # first, we create an object of class 'setupSNP' datSNP<-setupSNP(SNPs,6:40,sep="") geno<-make.geno(datSNP,c("snp10001","snp10002","snp10003")) ## End(Not run) maxstat max-statistic for a 2x3 table Description Computes the asymptotic p-value for max-statistic for a 2x3 table Usage maxstat(x, ...) ## Default S3 method: maxstat(x, y, ...) ## S3 method for class 'table': maxstat(x, ...) ## S3 method for class 'setupSNP': maxstat(x, y, colSNPs=attr(x,"colSNPs"), ...) ## S3 method for class 'matrix': maxstat(x, ...) Arguments x a numeric matrix with 2 rows (cases/controls) and 3 colums (genotypes) or a vector with case/control status or an object of class ’setupSNP’. odds 17 y an optional numeric vector containing the information for a given SNP. In this case ’x’ argument must contain a vector indicarting case/control status. If ’x’ argument is an object of class ’setupSNP’ this argument migth be the name of the variable containing case/control information. colSNPs a vector indicating which columns contain those SNPs to compute max-statistic. By default max-statistic is computed for those SNPs specified when the object of class ’setupSNP’ was created. ... further arguments to be passed to or from methods. Value A matrix with the chi-square statistic for dominant, recessive, log-additive and max-statistic and its asymptotic p-value. References Gonzalez JR, Carrasco JL, Dudbridge F, Armengol L, Estivill X, Moreno V. Maximizing association statistics over genetic models (2007). Submitted Sladek R, Rocheleau G, Rung J et al. A genome-wide association study identifies novel risk loci for type 2 diabetes (2007). Nature 445, 881-885 See Also setupSNP Examples # example from Sladek et al. (2007) for the SNP rs1111875 tt<-matrix(c(77,298,310,122,316,231),nrow=2,ncol=3,byrow=TRUE) maxstat(tt) data(SNPs) maxstat(SNPs$casco,SNPs$snp10001) myDat<-setupSNP(SNPs,6:40,sep="") maxstat(myDat,casco) odds Extract odds ratios, 95% CI and pvalues Description Extract odds ratios, 95 20 plot.WGassociation plot.WGassociation Function to plot -log p values from an object of class ’WGassociation’ Description Function to plot -log p values from an object of class ’WGassociation’ Usage ## S3 method for class 'WGassociation': plot(x, alpha = 0.05, plot.all.SNPs = FALSE, print.label.SNPs = TRUE, cutPval = c(0, 1e-10, 1), whole, ylim.sup=ifelse(is.null(attr(x,"fast")),1e-40, 1e-30), col.legend = c("red", "gray60"), sort.chromosome=TRUE, centromere, ...) Arguments x an object of class ’WGassociation’ alpha statistical significance nominal level. See details plot.all.SNPs are all SNPs plotted? If not, neither monomorphic nor SNPs with genotyping problems are plotted. The default is FALSE. print.label.SNPs are labels of SNPs printed? The default is TRUE cutPval when argument ’whole’ is TRUE in the ’x’ object (e.g. when whole genome analysis is carried out) ’cutPval divides the range of p values into intervals and codes these values according to which interval they fall (like ’cut’ function). The default is c(0, 1e-10, 1). That is, the p values are divided in those less than 1e-10 and those greater than 1e-10. whole is a whole genome carried out? If TRUE ’dataSNPs.pos’ argument in ’setup- SNP’ is required. ylim.sup superior limit for each panel. This value helps to obtain nicer plots col.legend the color of the bar corresponding to p values plotted in each panel. The default is "red" for those p values less than 1e-10 and "gray60" for those greater than 1e-10. sort.chromosome should chromosome be sorted? Set this argument to FALSE when genomic information corresponds to different genes. centromere numeric vector specifying the centromere positions. If missing, the default cen- tromere value of human genome are used. ... other graphical parameters plotMissing 21 Details A panel with different plots (one for each mode of inheritance) are plotted. Each of them represents the -log(p value) for each SNP. Two horizontal lines are also plotted. One one them indicates the nominal statistical significance level (see ’alpha’ argument) whereas the other one indicates the statistical significance level after Bonferroni correction. A different plot is created when the argument ’whole’ the object ’x’ is TRUE (see setupSNP func- tion). In that case a plot of p values in the -log sclae is plotted for each SNP and for each chromo- some. Value No return value, just the plot 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 association setupSNP WGassociation plotMissing Plot of missing genotypes Description Plot a grid showing which genotypes are missing Usage plotMissing(x, print.labels.SNPs = TRUE, main = "Genotype missing data", ...) Arguments x an object of class ’setupSNP’ print.labels.SNPs should labels of SNPs be printed? main title to place on plot ... extra arguments of ’image’ function Details This function uses ’image’ function to plot a grid with black pixels where the genotypes are missing. 22 qqpval Value None See Also setupSNP Examples data(SNPs) data(SNPs.info.pos) ans<-setupSNP(SNPs,colSNPs=6:40,sep="") plotMissing(ans) # The same plot with the SNPs sorted by genomic position and # showing the information about chromosomes ans<-setupSNP(SNPs,colSNPs=6:40,sort=TRUE,SNPs.info.pos,sep="") plotMissing(ans) qqpval Functions for inspecting population substructure Description This function plots ranked observed p values against the corresponding expected p values in -log scale. Usage qqpval(p, pch=16, col=4, ...) Arguments p a vector of p values pch symbol to use for points col color for points ... other plot arguments Value A plot See Also GenomicControl, WGassociation setupSNP 25 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 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) 26 snp snp SNP object Description snp creates an snp object is returns TRUE if x is of class ’snp’ as attempts to coerce its argument into an object of class ’snp’ reorder change the reference genotype summary gives a summary for an object of class ’snp’ including genotype and allele frequencies and an exact thest of Hardy-Weinberg equilibrium plot gives a summary for an object of class ’snp’ including genotype and allele frequencies and an exact thest of Hardy-Weinberg equilibrium in a plot. Barplot or pie are allowed [.snp is a copy of [.factor modified to preserve all attributes Usage snp(x, sep = "/", name.genotypes, reorder="common", remove.spaces = TRUE, allow.partial.missing = FALSE) is.snp(x) as.snp(x, ...) ## S3 method for class 'snp': additive(o) Arguments x either an object of class ’snp’ or an object to be converted to class ’snp’ sep character separator used to divide alleles when x is a vector of strings where each string holds both alleles. The default is "/". See below for details. name.genotypes the codes for the genotypes. This argument may be useful when genotypes are coded using three different codes (e.g., 0,1,2 or hom1, het, hom2) reorder how should genotypes within an individual be reordered. Possible values are ’common’ or ’minor’. The default is reorder="common". In that case, alle- les are sorted within each individual by common homozygous. remove.spaces logical indicating whether spaces and tabs will be removed from the genotypes before processing snp 27 allow.partial.missing logical indicating whether one allele is permitted to be missing. When set to ’FALSE’ both alleles are set to ’NA’ when either is missing. o an object of class ’snp’ to be coded as a linear covariate: 0,1,2 ... optional arguments Details SNP objects hold information on which gene or marker alleles were observed for different individ- uals. For each individual, two alleles are recorded. The snp class considers the stored alleles to be unordered , i.e., "C/T" is equivalent to "T/C". It assumes that the order of the alleles is not important. When snp is called, x is a character vector, and it is assumed that each element encodes both alleles. In this case, if sep is a character string, x is assumed to be coded as "Allele1<sep>Allele2". If sep is a numeric value, it is assumed that character locations 1:sep contain allele 1 and that remaining locations contain allele 2. additive.snp recodes the SNPs for being analyzed as a linear covariate (codes 0,1,2) Value The snp class extends "factor" where the levels is a character vector of possible genotype values stored coded by paste( allele1, "", allele2, sep="/") 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 association Examples # some examples of snp data in different formats dat1 <- c("21", "21", "11", "22", "21", "22", "22", "11", "11", NA) ans1 <- snp(dat1,sep="") ans1 dat2 <- c("A/A","A/G","G/G","A/G","G/G", "A/A","A/A","G/G",NA) ans2 <- snp(dat2,sep="/") ans2 dat3 <- c("C-C","C-T","C-C","T-T","C-C", "C-C","C-C","C-C","T-T",NA) ans3 <- snp(dat3,sep="-") ans3 30 Table.mean.se Table.mean.se Descriptive sample size, mean, and standard error Description This function computes sample size, mean and standard error of a quantitative trait for each geno- type (or combination of genotypes) Usage Table.mean.se(var, dep, subset = !is.na(var)) Arguments var quantitative trait dep variable with genotypes or any combination of them subset an optional vector specifying a subset of observations to be used in the descrip- tive analysis Value tp A matrix giving sample size (n), median (me) and standard error (se) for each genotype See Also Table.N.Per Examples data(SNPs) # sample size, mean age and standard error for each genotype # Table.mean.se(SNPs$snp10001,SNPs$protein) # The same table for a subset (males) # Table.mean.se(SNPs$snp10001,SNPs$protein,SNPs$sex=="Male") # The same table assuming a dominant model # Table.mean.se(dominant(snp(SNPs$snp10001,sep="")),SNPs$protein,SNPs$sex=="Male") Table.N.Per 31 Table.N.Per Descriptive sample size and percentage Description This function computes sample size and percentage for each category of a categorical trait (e.g. case-control status) for each genotype (or combination of genotypes). Usage Table.N.Per(var, dep, subset = !is.na(var)) Arguments var categorical trait. dep variable with genotypes or any combination of them subset an optional vector specifying a subset of observations to be used in the descrip- tive analysis. Value tp A matrix giving sample size (n),and the percentage ( for each genotype See Also Table.mean.se Examples data(SNPs) #sample size and percentage of cases and controls for each genotype # Table.N.Per(SNPs$snp10001,SNPs$casco) # The same table for a subset (males) # Table.N.Per(SNPs$snp10001,SNPs$casco,SNPs$sex=="Male") # The same table assuming a dominant model # Table.N.Per(dominant(snp(SNPs$snp10001,sep="")),SNPs$casco,SNPs$sex=="Male") 32 tableHWE tableHWE Test for Hardy-Weinberg Equilibrium Description Test the null hypothesis that Hardy-Weinberg equilibrium holds in cases, controls and both popula- tions. print print the information. Number of digits, and significance level can be changed Usage tableHWE(x, strata) Arguments x an object of class ’setupSNP’ strata a factor variable for a stratified analysis Details This function calculates the HWE test for those variables of class ’snp’ in the object x of class ’setupSNP’ Value A matrix with p values for Hardy-Weinberg Equilibrium Author(s) This function is based on an R function which computes an exact SNP test of Hardy-Weinberg Equilibrium written by Wigginton JE, Cutler DJ and Abecasis GR available at http://www. sph.umich.edu/csg/abecasis/Exact/r_instruct.html References Wigginton JE, Cutler DJ and Abecasis GR (2005). A note on exact tests of Hardy-Weinberg equi- librium. Am J Hum Genet 76:887-93 See Also setupSNP WGassociation 35 # ansAll<-WGassociation(protein,data=datSNP,model="all") #only codominant and log-additive ansCoAd<-WGassociation(protein~1,data=datSNP,model=c("co","log-add")) #for printing p values print(ansAll) print(ansCoAd) #for obtaining a matrix with the p palues pvalAll<-pvalues(ansAll) pvalCoAd<-pvalues(ansCoAd) # when all models are fitted and we are interested in obtaining p values for different genetic models # codominant model pvalCod<-codominant(ansAll) # recessive model pvalRec<-recessive(ansAll) # and the same for additive, dominant or overdominant #summary summary(ansAll) #for a detailed report WGstats(ansAll) #for plotting the p values plot(ansAll) # # Whole genome analysis # data(HapMap) # Next steps may be very time consuming. So they are not executed #myDat<-setupSNP(HapMap, colSNPs=3:9809, sort = TRUE, # info=HapMap.SNPs.pos, sep="") #resHapMap<-WGassociation(group~1, data=myDat, model="log") # However, the results are saved in the object "resHapMap" # to illustrate print, summary and plot functions summary(resHapMap) plot(resHapMap) print(resHapMap) Index ∗Topic datasets HapMap, 9 SNPs, 28 ∗Topic utilities association, 2 Bonferroni.sig, 4 GenomicControl, 5 getSignificantSNPs, 7 haplo.interaction, 8 inheritance, 10 int, 10 interactionPval, 11 intervals, 13 LD, 14 make.geno, 15 maxstat, 16 odds, 17 permTest, 18 plot.WGassociation, 19 plotMissing, 21 qqpval, 22 scanWGassociation, 23 setupSNP, 24 snp, 25 sortSNPs, 28 Table.mean.se, 29 Table.N.Per, 30 tableHWE, 31 WGassociation, 32 [.WGassociation (WGassociation), 32 [.setupSNP (setupSNP), 24 [.snp (snp), 25 [<-.setupSNP (setupSNP), 24 [[<-.setupSNP (setupSNP), 24 $<-.setupSNP (setupSNP), 24 additive (inheritance), 10 additive.snp (snp), 25 additive.WGassociation (WGassociation), 32 as.snp (snp), 25 association, 2, 21, 24, 27, 33, 34 Bonferroni.sig, 4 codominant (inheritance), 10 codominant.snp (snp), 25 codominant.WGassociation (WGassociation), 32 dominant (inheritance), 10 dominant.snp (snp), 25 dominant.WGassociation (WGassociation), 32 geneticModel (inheritance), 10 GenomicControl, 5, 22 getSignificantSNPs, 7, 24, 34 haplo.interaction, 8, 11 HapMap, 9 HapMap.SNPs.pos (HapMap), 9 inheritance, 10 int, 10 interactionPval, 11 intervals, 13 intervals.haplo.glm (intervals), 13 is.snp (snp), 25 labels.setupSNP (setupSNP), 24 labels.WGassociation (WGassociation), 32 LD, 14 LDplot (LD), 14 LDtable (LD), 14 make.geno, 15 36 INDEX 37 maxstat, 16 odds, 17 overdominant (inheritance), 10 overdominant.WGassociation (WGassociation), 32 permTest, 18, 24 plot.permTest (permTest), 18 plot.setupSNP (setupSNP), 24 plot.snp (snp), 25 plot.SNPinteraction (interactionPval), 11 plot.WGassociation, 19, 24, 33, 34 plotMissing, 21 print.haploOut (haplo.interaction), 8 print.intervals (intervals), 13 print.maxstat (maxstat), 16 print.permTest (permTest), 18 print.snp (snp), 25 print.SNPinteraction (interactionPval), 11 print.snpOut (association), 2 print.summary.snp (snp), 25 print.tableHWE (tableHWE), 31 print.WGassociation (WGassociation), 32 pvalues (WGassociation), 32 qqpval, 6, 22 recessive (inheritance), 10 recessive.snp (snp), 25 recessive.WGassociation (WGassociation), 32 reorder.snp (snp), 25 resHapMap (HapMap), 9 scanWGassociation, 19, 23, 34 setupSNP, 12, 15, 17, 21, 24, 24, 32, 34 snp, 15, 25, 25 SNPs, 28 SNPs.info.pos (SNPs), 28 sortSNPs, 28 summary.haplo.glm (intervals), 13 summary.setupSNP (setupSNP), 24 summary.snp (snp), 25 summary.WGassociation (WGassociation), 32 Table.mean.se, 29, 31 Table.N.Per, 30, 30 tableHWE, 31 WGassociation, 3, 5–7, 21–24, 29, 32 WGstats, 34 WGstats (WGassociation), 32
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved