R Under development (unstable) (2024-03-03 r86036 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## Purpose: Test script for pedgene package > ## Testing a simple 10-variant gene on both the X chrom and autosome > ## Authors: Dan Schaid and Jason Sinnwell > ## Created: 19-AUG-2013 > ## Updated: 11/7/2013 > > ## alternatively: > require(kinship2) Loading required package: kinship2 Loading required package: Matrix Loading required package: quadprog > require(pedgene) Loading required package: pedgene Loading required package: CompQuadForm Loading required package: survey Loading required package: grid Loading required package: survival Attaching package: 'survey' The following object is masked from 'package:graphics': dotchart > > data(example.ped) > data(example.geno) > data(example.map) > > > if(0) { + ## delete above line to look at pedigrees + ## quick look at the 3 pedigrees + pedall <- with(example.ped, pedigree(famid=ped, id=person, dadid=father, + momid=mother, sex=sex, affected=ifelse(is.na(trait), 0, trait))) + + plot(pedall[1]) + plot(pedall[2]) + plot(pedall[3]) + } > > > ## simple tests of two genes (10 variants each) > ## the genes are same variants, just on chroms 1 and X > pg.m2 <- pedgene(example.ped, example.geno, example.map, male.dose=2) > > pg.m1 <- pedgene(example.ped, example.geno, example.map, male.dose=1) > > > ## saved objects are of class pedgene, with items call (function call) > ## and pgdf, a data.frame with a row for each gene > class(pg.m2) [1] "pedgene" > names(pg.m2) [1] "pgdf" "call" "save" > > > print(pg.m2, digits=4) gene chrom n.variant n.noninform stat.kernel pval.kernel stat.burden 1 AA 1 7 3 144.8 0.3498 -2.048 2 AX X 7 3 124.1 0.2038 -2.168 pval.burden 1 0.04061 2 0.03019 > > > print(pg.m1, digits=4) gene chrom n.variant n.noninform stat.kernel pval.kernel stat.burden 1 AA 1 7 3 144.83 0.3498 -2.048 2 AX X 7 3 31.01 0.3297 -1.776 pval.burden 1 0.04061 2 0.07578 > > summary(pg.m2) Summary for pedgene object: Call: pedgene(ped = example.ped, geno = example.geno, map = example.map, male.dose = 2) gene chrom n.variant n.noninform stat.kernel pval.kernel stat.burden 1 AA 1 7 3 144.8264 0.3498380 -2.047518 2 AX X 7 3 124.0772 0.2037578 -2.167566 pval.burden 1 0.04060727 2 0.03019169 > > ## Testing first gene with dose=2-dose > geno.recode <- cbind(example.geno[,1:2], 2-example.geno[,grep("AA", names(example.geno))]) > pg.recode <- pedgene(example.ped, geno.recode, male.dose=2) > > ## note when map not given, assumes all 1 gene, and assigns "unknown" gene/chrom > pg.recode gene chrom n.variant n.noninform stat.kernel pval.kernel stat.burden 1 unknown unknown 7 3 2.472408e-49 0.9986723 0.001904113 pval.burden 1 0.9984807 > > proc.time() user system elapsed 1.12 0.25 1.37