Skip to content

Commit

Permalink
version 0.1-4
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Knueppel authored and gaborcsardi committed Sep 2, 2011
1 parent aa84b23 commit 29937c8
Show file tree
Hide file tree
Showing 71 changed files with 587 additions and 786 deletions.
14 changes: 7 additions & 7 deletions DESCRIPTION
@@ -1,13 +1,13 @@
Package: HapEstXXR
Type: Package
Version: 0.1-4
Date: 2011-09-2
Title: HapEstXXR
Version: 0.1-3
Date: 2010-08-06
Author: Sven Knueppel and Klaus Rohde
Maintainer: Sven Knueppel <sven.knueppel@dife.de>
Description: Haplotype-Based Analysis of Association for genetic traits
Depends: survival
License: GPL-2
Packaged: 2010-08-06 12:45:08 UTC; knueppel
Description: Multi-locus marker analysis
License: LGPL (>= 2.1)
LazyLoad: TRUE
Repository: CRAN
Date/Publication: 2010-08-06 14:23:32
Packaged: 2011-11-30 07:55:46 UTC; epi_nutzer
Date/Publication: 2011-11-30 12:28:19
83 changes: 83 additions & 0 deletions MD5
@@ -0,0 +1,83 @@
10a88cdad58231a4789abb2f432ca20f *DESCRIPTION
266fac7ae5c891f4c8296537dd9ead12 *NAMESPACE
7a27c9428493baf14ac86dfdd999f9de *R/allele1to2.R
d915eced680d427f786cff3f8dc8cf25 *R/allele1toR.R
03ee5f7bda7e451cf05e992da0ab64ed *R/allele2to1.R
fdcb00a65ca8d1ea270bfc90aa8a073e *R/allele2toR.R
bbeef9a8ad0979ed8524d6c2af4bab59 *R/alleleRto1.R
3319170fa67d5f7596bfa1d8a74f2dcf *R/alleleRto2.R
44df792416beab73762b30fa7cd4a2ec *R/catt.R
c17e2970ece27275ac93b3b7a98ac667 *R/coding.baseline.allele.R
e91d417096ccc89a25f3b355bf10733a *R/dec2bin.R
462cd6fa1b5753b14289fb4666a99d8f *R/hapest.caco.R
e36692655bc3c7133f0c8c5495ae2440 *R/itegeppXXR.R
5b5d5b6fd183c68ea8c44e0c42381425 *R/maf.R
5811f03b7302c49848030dc7f5a67503 *R/makeHaploviewInputFile.R
737dd89228644ebef77677592cdc1489 *R/makePlinkInputFile.R
793e6e82b098a4d6bcc9b5ce864e70cc *R/msr.R
5a9760733f1857bb58eb9e9d5c0f7806 *R/msr.binomial.forward.adjusted.R
8e45db8a208e9c8b00a2a88b80835732 *R/msr.binomial.forward.unadjusted.R
42fc4974a7332f488d2fe7ec805b5688 *R/msr.binomial.haplotype.test.adjusted.R
45ae3b530870e8a99255335bf9506391 *R/msr.binomial.haplotype.test.unadjusted.R
834cfb55baa08d762aa8f0b423b3fdc4 *R/msr.families.unadjusted.R
0ebe9eb80b3094a10451f038b2258e39 *R/msr.gaussian.forward.adjusted.R
6df7b284b71e3dd2e4349145ba338be1 *R/msr.gaussian.forward.unadjusted.R
ab87b89c040c04c6c2e401dc873dd33d *R/msr.gaussian.haplotype.test.adjusted.R
a2826d756da6a5dca7237a6380a46da5 *R/msr.gaussian.haplotype.test.unadjusted.R
f56ba600403b7bbc920b2478b631c56e *R/multi.snp.test.R
02093e52c30db13689f65f6c73954080 *R/order.families.R
9eb3a5a3555ccdcd72ee8133af01fcca *R/powerset.R
b57895f30c1cce9ea0d020dc37ed8cf2 *R/read.data.R
f50681b187a1cbd1e2f62b36d33472d0 *R/read.haploview.R
cc7a0978ef64e1ca3ff07a10165b6553 *R/single.haplotype.test.R
c0ebd3fc6042b02aae19509dc664ed35 *R/single.haplotype.test.binomial.R
aeae94d6b6b5d1e5618c50d1c55d3bdc *R/single.haplotype.test.families.R
d48003df62c633a3859b3ef398873e50 *R/single.haplotype.test.gaussian.R
8aa876e83571cdd7b89099548bd5736b *R/single.snp.test.R
54bf02cf2c8a72c0b446846c3a8dfa89 *R/single.snp.test.binomial.R
fd3e89ab2a76853fcce287dd6da59595 *R/single.snp.test.casecohort.R
e22d69506b523044f2cf18ddde20bbf3 *R/single.snp.test.casecohort.prentice.R
806e4ab4fe54872513ff6faa91a32f64 *R/single.snp.test.families.R
e3ef5aa42fbe80948840ce9d762c769b *R/single.snp.test.gaussian.R
bc638d8a425d1deeaf7e3b1b1c2814d6 *R/zzz.r
9458a2b761d29fed54b70dcb3f0aa5e5 *man/HapEstXXR-package.Rd
46d98d3e53e9f36d81e2c8c6e7721267 *man/allele1to2.Rd
ee72af4a6bfe051e4671639c63ba2e1a *man/catt.Rd
09513250009250e35b339207469b4e80 *man/coding.baseline.allele.Rd
68496cceb7f3b4515ceda0734b6cce18 *man/dec2bin.Rd
92447c52d1af0a28d8df652ad29e0f9c *man/itegeppXXR.Rd
84f3caced323826f902729158dc09dec *man/maf.Rd
8481ea65ab1a75e6fe1b8e142a30ea6f *man/makeHaploviewInputFile.Rd
17f8dddcd69bd61ef3f5308133fe943e *man/makePlinkInputFile.Rd
9ef194e51223ed02f82c1e075ac19ccb *man/msr.Rd
6ac3d7740823c0af8bdf6ca2a1b262db *man/multi.snp.test.Rd
4e64b89846dabd747caf277e404d3418 *man/order.families.Rd
56559a70e219118fe6443ffa5d6ec683 *man/powerset.Rd
c9e5b3f8305ce12d9e9793a0cd8c7bbb *man/read.data.Rd
c7054461e122093016c30189cef45c69 *man/read.haploview.Rd
ccc6637f0eefc5b5c60204d7bc8c94fc *man/single.haplotype.test.Rd
35230c36146a9ba8496a9751a2aa48eb *man/single.snp.test.Rd
4cc463c79c90993082a05fb9bd5e0670 *src/HapRshort.c
de9fa714586addcc87ed9534abc1ece2 *src/bool.h
c1b30846a6afbab9b55f300ae7ee954b *src/create_pattern_matrix.c
db10604ff6874846e94642a89c0cffdf *src/exist_pattern.c
16c16a32a2d6da07876903fffbd4c593 *src/fundamental.h
6548d2cfe2b66da4d7226e6088ed97de *src/haptdpnZR.c
4ea1990c6eacb79ac14ed87b19127809 *src/i_quicksort.c
9dddb0703f1e042848f22212f9e2b5f5 *src/itegeppXXR.c
feffe1f6474a9015b891805b3608a7eb *src/longhap.h
1c9d2646c4b3de442fdd42d0a84839e0 *src/matalloc.c
d3234869602579ecc3393ca30b9bdf4c *src/matalloc.h
f3c1ccd7c61394537518fe6179d9ee1c *src/matrix.c
c2d60251234f8776b5eacb4d68e4200b *src/matrix.h
280a0a647fa475d6d634af2da4fadc97 *src/message.c
17b1de79d281417937f036289ede93f9 *src/message.h
7abc1b2569398d74907396f360e39f0f *src/messageR.h
10954b138d457cc49c7e456c1c3d72b2 *src/nrutil.h
223f51753c25a246c5063b850428c0ec *src/powerset.c
416f00843b35a928100e4a6f73605e1d *src/quicksort.c
541555c8283c452fe18dbfcd6a70b68a *src/quicksort.h
d6a7515efafaf28368a825e870eb894f *src/readin.c
24452e92353ea4a0f4f99f6d36c175ca *src/readin.h
138b77419dd4536cb26a162e267c0fb1 *src/rng.c
c6d672fe2897078f23413ab0d1ba7cbd *src/rng.h
57 changes: 16 additions & 41 deletions NAMESPACE
Expand Up @@ -2,59 +2,34 @@
useDynLib(HapEstXXR)

export (

itegeppXXR ,
dec2bin,

allele1to2 , allele2to1 ,
alleleRto1 , alleleRto2 ,
allele1toR , allele2toR , catt ,

powerset,

coding.baseline.allele,

makePlinkInputFile ,
makeHaploviewInputFile,

makeHaploviewInputFile,
read.data ,
read.haploview,

order.families,

maf,
single.snp.test ,
single.snp.test.binomial , single.snp.test.gaussian ,
single.snp.test.families , single.snp.test.survival , multi.snp.test,
single.snp.test.families , multi.snp.test,
single.snp.test.casecohort,single.snp.test.casecohort.prentice,


single.haplotype.test, single.haplotype.test.binomial , single.haplotype.test.families ,

msr ,
msr.binomial.forward.unadjusted ,
msr.binomial.forward.adjusted ,
msr.binomial.haplotype.test.unadjusted,
msr.binomial.haplotype.test.adjusted,
msr.families.unadjusted,


msr.gaussian.forward.unadjusted ,
msr.gaussian.forward.adjusted ,
msr.gaussian.haplotype.test.unadjusted,
msr.gaussian.haplotype.test.adjusted,


msr.meta,
msr.meta.binomial.unadjusted.families.unadjusted,
msr.meta.error.check,
meta.func,
meta.fisher,
meta.rank,

single.haplotype.test, single.haplotype.test.binomial ,
single.haplotype.test.families ,
msr ,
msr.binomial.forward.unadjusted ,
msr.binomial.forward.adjusted ,
msr.binomial.haplotype.test.unadjusted,
msr.binomial.haplotype.test.adjusted,
msr.families.unadjusted,
msr.gaussian.forward.unadjusted ,
msr.gaussian.forward.adjusted ,
msr.gaussian.haplotype.test.unadjusted,
msr.gaussian.haplotype.test.adjusted,
hapest.caco


)



)
3 changes: 1 addition & 2 deletions R/allele1to2.R
Expand Up @@ -15,5 +15,4 @@ function ( geno , marker.label=NULL , miss.val=NA ) {
colnames (gg) <- paste ( rep(marker.label,each=2) , rep(c("a1","a2"),ncol(gg)/2) , sep="." )
rownames (gg) <- rownames(geno)
return(gg)
} # end of allele1to2

}
3 changes: 1 addition & 2 deletions R/allele1toR.R
Expand Up @@ -11,5 +11,4 @@ function ( geno , marker.label=NULL , miss.val=c(-1,NA) ) {
colnames(geno) <- marker.label
rownames (geno) <- rownames(geno)
return ( geno )
} ### allele1toR

}
3 changes: 1 addition & 2 deletions R/allele2to1.R
Expand Up @@ -25,5 +25,4 @@ function ( geno , marker.label=NULL , miss.val=NA ) {
colnames(code) <- marker.label
rownames (code) <- rownames(geno)
return ( code )
} ### end of allele2to1

}
3 changes: 1 addition & 2 deletions R/allele2toR.R
Expand Up @@ -26,5 +26,4 @@ function ( geno , marker.label=NULL , miss.val=NA ) {
colnames(code) <- marker.label
rownames (code) <- rownames(geno)
return ( code )
} ### end of allele2toR

}
3 changes: 1 addition & 2 deletions R/alleleRto1.R
Expand Up @@ -9,5 +9,4 @@ function ( geno , marker.label=NULL , miss.val=NA) {
colnames(geno) <- marker.label
rownames (geno) <- rownames(geno)
return ( geno )
} ### alleleRto1

}
3 changes: 1 addition & 2 deletions R/alleleRto2.R
Expand Up @@ -15,5 +15,4 @@ function ( geno , marker.label=NULL , miss.val=NA ) {
colnames (gg) <- paste ( rep(marker.label,each=2) , rep(c("a1","a2"),ncol(gg)/2) , sep="." )
rownames (gg) <- rownames(geno)
return(gg)
} # end of alleleRto2

}
1 change: 0 additions & 1 deletion R/catt.R
Expand Up @@ -29,4 +29,3 @@ function ( y , x , score=c(0,1,2) ) {
return ( res )

}

4 changes: 2 additions & 2 deletions R/coding.baseline.allele.R
Expand Up @@ -33,9 +33,9 @@ function ( geno , coding=c("minor","major") ) {
}
tmptab[1:4] <- rep(0,4)
}

} # coding "major"


return ( geno )
} # coding.baseline.allele

}
1 change: 0 additions & 1 deletion R/dec2bin.R
Expand Up @@ -39,4 +39,3 @@ function ( vec , npos=NA ) {
rownames(binres) <- vec
return ( binres )
}

7 changes: 3 additions & 4 deletions R/hapest.caco.R
Expand Up @@ -56,10 +56,10 @@ hapcaco <- data.frame (

hapsi <- which(!is.na(match(colnames(desres),hapcaco[,1])))
desres <- as.matrix(desres[ , hapsi, drop=FALSE ])
desres <- desres/2
# desres <- desres/2

if ( !any(colnames(desres)=="R") ) {
desres <- cbind(desres, R=1-rowSums(desres))
desres <- cbind(desres, R=2-rowSums(desres))
}
desres <- as.matrix(desres)

Expand All @@ -75,5 +75,4 @@ hapcaco <- data.frame (

return ( list ( haplotypes=hapcaco , desres=desres ) )

} # end of hapest.caco

}
3 changes: 1 addition & 2 deletions R/itegeppXXR.R
Expand Up @@ -105,5 +105,4 @@ function ( geno, des=0, lim=0.05 )
freq = as.numeric(em.freq), hapres = hr ,
likeres = zzz$likeres, desres = as.matrix(zzz$desres)) )

} # itegeppXR #############################

}
41 changes: 41 additions & 0 deletions R/maf.R
@@ -0,0 +1,41 @@
maf <-
function ( geno , marker.label=NA ) {
geno <- as.matrix(geno)
maf <- matrix ( 0 , nc=9 , nr=dim(geno)[2] )
colnames(maf) <- c(0:3,"Total","call.rate","minor.allele","maf","hwe.chisq.p.value")
for ( i in 1:dim(geno)[2] ) {
tabl <- table ( geno[,i] )
maf [i, names(tabl) ] <- tabl

N <- (maf[i,"1"]+maf[i,"2"]+maf[i,"3"])
maf[i,"Total"] <- N

maf[i,"call.rate"] <- 1- (maf[i,"0"]/N)


p <- (2*maf[i,"1"]+maf[i,"3"]) / N/2
maf[i,"maf"] <- ifelse(p<=0.5 , p , 1-p)
maf[i,"minor.allele"] <- ifelse( maf[i,"1"]<=maf[i,"2"], 1 , 2)

# hwe
observed <- maf[i,c("1","2","3")]
n1 <- ( 2*maf[i,"1"]+maf[i,"3"] )^2 / 4/N
n2 <- ( 2*maf[i,"2"]+maf[i,"3"] )^2 / 4/N
n3 <- ( 2*maf[i,"1"]+maf[i,"3"] )*( 2*maf[i,"2"]+maf[i,"3"] ) / (2*N)



expexted <- c(n1,n2,n3)
hwe.chisq <- sum(( observed-expexted )^2 / expexted)
maf[i,"hwe.chisq.p.value"] <- 1-pchisq(hwe.chisq,1)
}

maf <- maf[,c("1","3","2","Total","0","call.rate","minor.allele","maf","hwe.chisq.p.value")]
colnames(maf) <- c("1/1","1/2","2/2","Total","NMISS","call.rate","minor.allele","maf","hwe.chisq.p.value")

if ( !(all(is.na(marker.label))) ) {
rownames(maf) <- marker.label
}

return ( maf )
}
3 changes: 1 addition & 2 deletions R/makeHaploviewInputFile.R
Expand Up @@ -17,5 +17,4 @@ function ( famid , patid , fid , mid , sex , aff , geno , marker.name ,
write.table ( info.data , file=haploview.infofile,
quote=F,row.names=F,col.names=F,sep="\t")

} ## makeHaploviewInputFile

}
3 changes: 1 addition & 2 deletions R/makePlinkInputFile.R
Expand Up @@ -59,5 +59,4 @@ function ( famid , patid , fid , mid , sex , trait , CHR , SNP , POS ,
if ( (i%%1000) == 0 ) cat ( i , "\n" , sep="" )
}
}
} ## end of makePlinkInputFile

}
9 changes: 0 additions & 9 deletions R/meta.fisher.R

This file was deleted.

12 changes: 0 additions & 12 deletions R/meta.func.R

This file was deleted.

10 changes: 0 additions & 10 deletions R/meta.rank.R

This file was deleted.

0 comments on commit 29937c8

Please sign in to comment.