R Under development (unstable) (2025-09-04 r88794 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 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: 9/8/2025 > > devel=FALSE > if(devel) { + .libPaths(c("/projects/bsi/pharmacogenetics/s212953.SchaidMethods/PedGene/Build/gitbranch/renv/library/R-4.4/x86_64-pc-linux-gnu/",.libPaths())) + library(CompQuadForm) + library(Pedixplorer) + library(survey) + dir="../" + rfiles <- list.files("../R/", pattern="*.R", full=TRUE) + for(rf in rfiles) source(rf) + dfiles <- list.files(path=paste0(dir,"/data/"), pattern="*.RData$") + for(d in dfiles) load(paste0(dir, "/data/",d)) + + } else { + ## alternatively: + + require(pedgene) + + data(example.ped) + data(example.geno) + data(example.map) + } Loading required package: pedgene Loading required package: Matrix 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 Loading required package: Pedixplorer > > > > ## 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 5.31 0.32 5.64