- using R Under development (unstable) (2024-12-15 r87442)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
Debian clang version 19.1.4 (1)
Debian flang-new version 19.1.4 (1)
- running under: Debian GNU/Linux trixie/sid
- using session charset: UTF-8
- checking for file ‘fbati/DESCRIPTION’ ... OK
- this is package ‘fbati’ version ‘1.0-9’
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking serialization versions ... OK
- checking whether package ‘fbati’ can be installed ... OK
See the install log for details.
- used C compiler: ‘Debian clang version 19.1.4 (1)’
- used C++ compiler: ‘Debian clang version 19.1.4 (1)’
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [2s/3s] OK
- checking whether the package can be loaded with stated dependencies ... [2s/4s] OK
- checking whether the package can be unloaded cleanly ... [2s/3s] OK
- checking whether the namespace can be loaded with stated dependencies ... [2s/3s] OK
- checking whether the namespace can be unloaded cleanly ... [2s/3s] OK
- checking loading without being on the library search path ... [2s/4s] OK
- checking whether startup messages can be suppressed ... [3s/4s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [32s/47s] OK
- checking Rd files ... [0s/1s] OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking line endings in C/C++/Fortran sources/headers ... OK
- checking pragmas in C/C++ headers and code ... OK
- checking compilation flags used ... OK
- checking compiled code ... OK
- checking examples ... [3s/3s] ERROR
Running examples in ‘fbati-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: fbatge
> ### Title: fbatge
> ### Aliases: fbatge fbatgeAll
> ### Keywords: interface
>
> ### ** Examples
>
> example( fbati ) ## See fbati, creates a dataset for us in 'phe' and 'ped'
fbati> ## Data is simulated according to the formula in the
fbati> ## paper (you can see it from the code).
fbati>
fbati> ## Set the seed so you get the same results
fbati> set.seed(13)
fbati> ## Constants (you can vary these)
fbati> NUM_FAMILIES <- 500
fbati> AFREQ <- 0.1 ## Allele frequency
fbati> BG <- -0.25 ## main effect of gene
fbati> BE <- 0 ## main effect of environment
fbati> BGE <- 0.75 ## main gene-environment effect
fbati> ENV <- 0.2 ## environmental exposure frequency
fbati> ## (but don't modify this one)
fbati> MAX_PROB <- exp( BG*2 + BE*1 + BGE*2*1 )
fbati> #####################################
fbati> ## Create a random dataset (trios) ##
fbati> #####################################
fbati>
fbati> ## -- genotypes are set to missing for now,
fbati> ## everyone will be affected
fbati> ped <- as.ped( data.frame( pid = kronecker(1:NUM_FAMILIES,c(1,1,1)),
fbati+ id = kronecker( rep(1,NUM_FAMILIES), c(1,2,3) ),
fbati+ idfath = kronecker( rep(1,NUM_FAMILIES), c(0,0,1) ),
fbati+ idmoth = kronecker( rep(1,NUM_FAMILIES), c(0,0,2) ),
fbati+ sex = rep(0,NUM_FAMILIES*3),
fbati+ AffectionStatus = kronecker( rep(1,NUM_FAMILIES), c(0,0,2) ),
fbati+ m0.a = rep(0,NUM_FAMILIES*3), ## missing for now
fbati+ m0.b = rep(0,NUM_FAMILIES*3) ) ) ## missing for now
fbati> ## -- envioronment not generated yet
fbati> phe <- as.phe( data.frame( pid = ped$pid,
fbati+ id = ped$id,
fbati+ env = rep(NA,NUM_FAMILIES*3) ) ) ## missing for now
fbati> ## 50/50 chance of each parents alleles
fbati> mendelTransmission <- function( a, b ) {
fbati+ r <- rbinom( length(a), 1, 0.75 )
fbati+ return( a*r + b*(1-r) )
fbati+ }
fbati> ## Not the most efficient code, but it gets it done;
fbati> ## takes < 5 sec on pentium M 1.8Ghz
fbati> CUR_FAMILY <- 1
fbati> while( CUR_FAMILY<=NUM_FAMILIES ) {
fbati+ ## Indexing: start=father, (start+1)=mother, (start+2)=child
fbati+ start <- CUR_FAMILY*3-2
fbati+
fbati+ ## Draw the parental genotypes from the population
fbati+ ped$m0.a[start:(start+1)] <- rbinom( 1, 1, AFREQ ) + 1
fbati+ ped$m0.b[start:(start+1)] <- rbinom( 1, 1, AFREQ ) + 1
fbati+
fbati+ ## Draw the children's genotype from the parents
fbati+ ped$m0.a[start+2] <- mendelTransmission( ped$m0.a[start], ped$m0.b[start] )
fbati+ ped$m0.b[start+2] <- mendelTransmission( ped$m0.a[start+1], ped$m0.b[start+1] )
fbati+
fbati+ ## Generate the environment
fbati+ phe$env[start+2] <- rbinom( 1, 1, ENV )
fbati+
fbati+ ## and the affection status
fbati+ Xg <- as.integer(ped$m0.a[start+2]==2) + as.integer(ped$m0.b[start+2]==2)
fbati+ if( rbinom( 1, 1, exp( BG*Xg + BE*phe$env[start+2] + BGE*Xg*phe$env[start+2] ) / MAX_PROB ) == 1 )
fbati+ CUR_FAMILY <- CUR_FAMILY + 1
fbati+ ## otherwise it wasn't a valid drawn individual
fbati+ }
fbati> ##############
fbati> ## Analysis ##
fbati> ##############
fbati>
fbati> ## Print the first 4 families
fbati> print( head( ped, n=12 ) )
pid id idfath idmoth sex AffectionStatus m0.a m0.b
1 1 1 0 0 0 0 1 1
2 1 2 0 0 0 0 1 1
3 1 3 1 2 0 2 1 1
4 2 1 0 0 0 0 1 1
5 2 2 0 0 0 0 1 1
6 2 3 1 2 0 2 1 1
7 3 1 0 0 0 0 1 1
8 3 2 0 0 0 0 1 1
9 3 3 1 2 0 2 1 1
10 4 1 0 0 0 0 1 1
11 4 2 0 0 0 0 1 1
12 4 3 1 2 0 2 1 1
fbati> print( head( phe, n=12 ) )
pid id env
1 1 1 NA
2 1 2 NA
3 1 3 0
4 2 1 NA
5 2 2 NA
6 2 3 0
7 3 1 NA
8 3 2 NA
9 3 3 0
10 4 1 NA
11 4 2 NA
12 4 3 0
fbati> ## NOTE: We could have just put all of this info into a single dataframe otherwise,
fbati> ## that would look like just the results of this
fbati> data <- mergePhePed( ped, phe )
fbati> print( head( data, n=12 ) )
pid id idfath idmoth sex AffectionStatus m0.a m0.b env
1 1 1 0 0 0 0 1 1 NA
2 1 2 0 0 0 0 1 1 NA
3 1 3 1 2 0 2 1 1 0
334 2 1 0 0 0 0 1 1 NA
335 2 2 0 0 0 0 1 1 NA
336 2 3 1 2 0 2 1 1 0
667 3 1 0 0 0 0 1 1 NA
668 3 2 0 0 0 0 1 1 NA
669 3 3 1 2 0 2 1 1 0
1000 4 1 0 0 0 0 1 1 NA
1001 4 2 0 0 0 0 1 1 NA
1002 4 3 1 2 0 2 1 1 0
fbati> ## And run the analysis on all the markers
fbati> fbati( ped=ped, phe=phe, env="env" )
*** buffer overflow detected ***: terminated
Aborted
- checking PDF version of manual ... [4s/7s] OK
- checking HTML version of manual ... [1s/1s] OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 1 ERROR