Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c897f9
commit 6e5f23a
Showing
20 changed files
with
543 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
Package: CrypticIBDcheck | ||
Type: Package | ||
Title: Identifying cryptic relatedness in genetic association studies | ||
Version: 0.3-1 | ||
Date: 2012-04-14 | ||
Title: Identifying Cryptic Relatedness in Genetic Association Studies | ||
Version: 0.3-3 | ||
Date: 2018-05-14 | ||
Author: Annick Joelle Nembot-Simo, Jinko Graham and Brad McNeney | ||
Maintainer: Brad McNeney <mcneney@sfu.ca> | ||
Depends: R (>= 2.14.0), rJPSGCS (>= 0.2-5), car (>= 2.0-9), ellipse (>= | ||
0.3-5) | ||
Imports: chopsticks | ||
Imports: chopsticks, methods | ||
Suggests: parallel | ||
Description: Exploratory tools to identify closely related subjects using autosomal genetic marker data. | ||
License: GPL-3 | ||
LazyData: yes | ||
Packaged: 2013-09-20 21:38:23 UTC; mcneney | ||
LazyData: true | ||
NeedsCompilation: yes | ||
Packaged: 2018-05-17 08:25:12 UTC; mcneney | ||
Repository: CRAN | ||
Date/Publication: 2013-09-21 08:05:29 | ||
Date/Publication: 2018-05-17 09:01:55 UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
export(countIBS,IBDcheck,new.IBD,IBD,SNPgenmap,filter.control,sim.control) | ||
importFrom("grDevices", "devAskNewPage") | ||
importFrom("graphics", "lines", "plot", "title") | ||
importFrom("methods", "is", "new") | ||
importFrom("stats", "approxfun", "cor", "pnorm", "qchisq", "quantile", | ||
"rbinom", "sd", "var") | ||
importFrom("utils", "flush.console") | ||
importFrom("rJPSGCS","GeneDrops","read.pedfile","write.pedfile","write.parfile","FitGMLD") | ||
importFrom("car","showLabels") | ||
importFrom("ellipse","ellipse") | ||
S3method(plot,IBD) | ||
useDynLib("CrypticIBDcheck", .registration = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
## filter.control is a function to set parameters that control quality control | ||
## filters: snpcallrate, MAF, samplecallrate and HWEp | ||
|
||
filter.control<-function(filter=TRUE,snpcallrate=0.9,MAF=0.01, | ||
samplecallrate=0.9, HWEp=0.001) { | ||
list(filter=filter,snpcallrate=snpcallrate,MAF=MAF, | ||
samplecallrate=samplecallrate, HWEp=HWEp) | ||
} | ||
|
||
################################################################ | ||
snpfilter <- function(snpmatlist1,filter){ | ||
|
||
SNP.support=snpmatlist1$snp.support | ||
SNP.support=remove.cdlIBS(SNP.support) #remove cdlIBS columns, if present | ||
snpobjt=snpmatlist1$snp.data | ||
|
||
sumsnp<-chopsticks::summary(snpobjt) | ||
nbs=ncol(snpobjt) | ||
|
||
#snps call rate test | ||
callr=(sumsnp$Call.rate>=filter$snpcallrate) | ||
snpobjt1<-snpobjt[,(callr)] | ||
SNP.support1<-SNP.support[callr,] | ||
|
||
#MAF test | ||
sumsnp1<-chopsticks::summary(snpobjt1) | ||
maft=(sumsnp1$MAF>=filter$MAF) | ||
snpobjt1<-snpobjt1[,(maft)] | ||
SNP.support1<-SNP.support1[maft,] | ||
|
||
#samples call rate test | ||
callrvt=(row.summary(snpobjt1)$Call.rate>=filter$samplecallrate) | ||
snpobjt1<-snpobjt1[(callrvt),] | ||
snpmatlist1$subject.support<-snpmatlist1$subject.support[(callrvt),] | ||
|
||
#Remove SNPs not found by SNPgenmap (NA genetic location) | ||
ind<-is.na(SNP.support1$Gen_loc) | ||
SNP.support1<-SNP.support1[!ind,] | ||
snpobjt1<-snpobjt1[,(!ind)] | ||
|
||
#Do test of HWE and keep SNPs that pass | ||
vecpval=as.numeric(as.vector(SNP.support1$pvalue_HWE)) | ||
hwvec<-( vecpval>filter$HWEp & !is.na(SNP.support1$pvalue_HWE) ) | ||
|
||
snpmatlist1$snp.data<-snpobjt1[,(hwvec)] | ||
snpmatlist1$snp.support<-SNP.support1[hwvec,] | ||
|
||
|
||
return(snpmatlist1) | ||
|
||
} | ||
|
||
## filter.control is a function to set parameters that control quality control | ||
## filters: snpcallrate, MAF, samplecallrate and HWEp | ||
|
||
filter.control<-function(filter=TRUE,snpcallrate=0.9,MAF=0.01, | ||
samplecallrate=0.9, HWEp=0.001) { | ||
list(filter=filter,snpcallrate=snpcallrate,MAF=MAF, | ||
samplecallrate=samplecallrate, HWEp=HWEp) | ||
} | ||
|
||
################################################################ | ||
snpfilter <- function(snpmatlist1,filter){ | ||
|
||
SNP.support=snpmatlist1$snp.support | ||
SNP.support=remove.cdlIBS(SNP.support) #remove cdlIBS columns, if present | ||
snpobjt=snpmatlist1$snp.data | ||
|
||
sumsnp<-chopsticks::summary(snpobjt) | ||
nbs=ncol(snpobjt) | ||
|
||
#snps call rate test | ||
callr=(sumsnp$Call.rate>=filter$snpcallrate) | ||
snpobjt1<-snpobjt[,(callr)] | ||
SNP.support1<-SNP.support[callr,] | ||
|
||
#MAF test | ||
sumsnp1<-chopsticks::summary(snpobjt1) | ||
maft=(sumsnp1$MAF>=filter$MAF) | ||
snpobjt1<-snpobjt1[,(maft)] | ||
SNP.support1<-SNP.support1[maft,] | ||
|
||
#samples call rate test | ||
callrvt=(chopsticks::row.summary(snpobjt1)$Call.rate>=filter$samplecallrate) | ||
snpobjt1<-snpobjt1[(callrvt),] | ||
snpmatlist1$subject.support<-snpmatlist1$subject.support[(callrvt),] | ||
|
||
#Remove SNPs not found by SNPgenmap (NA genetic location) | ||
ind<-is.na(SNP.support1$Gen_loc) | ||
SNP.support1<-SNP.support1[!ind,] | ||
snpobjt1<-snpobjt1[,(!ind)] | ||
|
||
#Do test of HWE and keep SNPs that pass | ||
vecpval=as.numeric(as.vector(SNP.support1$pvalue_HWE)) | ||
hwvec<-( vecpval>filter$HWEp & !is.na(SNP.support1$pvalue_HWE) ) | ||
|
||
snpmatlist1$snp.data<-snpobjt1[,(hwvec)] | ||
snpmatlist1$snp.support<-SNP.support1[hwvec,] | ||
|
||
|
||
return(snpmatlist1) | ||
|
||
} | ||
|
Oops, something went wrong.