Running examples in 'ACMEeqtl-Ex.R' failed
The error most likely occurred in:

> ### Name: multisnpACME
> ### Title: Estimation of Multi-SNP ACME Model for Full-Tissue Genome and
> ###   All Local SNPs
> ### Aliases: multisnpACME
> 
> ### ** Examples
> 
> # First we generate a eQTL dataset in filematrix format 
> tempdirectory = tempdir()
> z = create_artificial_data(
+     nsample = 50,
+     ngene = 11,
+     nsnp = 51,
+     ncvrt = 1,
+     minMAF = 0.2,
+     saveDir = tempdirectory,
+     returnData = FALSE,
+     savefmat = TRUE,
+     savetxt = FALSE,
+     verbose = FALSE)
> 
> # Then we run multithreadACME to obtain single-SNP estimates.
> # In this example, we use 2 CPU cores (threads) 
> # for testing of all gene-SNP pairs within 100,000 bp.
> multithreadACME(
+     genefm = "gene",
+     snpsfm = "snps",
+     glocfm = "gene_loc",
+     slocfm = "snps_loc",
+     cvrtfm = "cvrt",
+     acmefm = "ACME",
+     cisdist = 10e+06,
+     threads = 1, # Use more for faster run
+     workdir = file.path(tempdirectory, "filematrices"),
+     verbose = FALSE)
Finished in 0 seconds
Finished in 0 seconds
Finished in 0 seconds
Finished in 0 seconds
Finished in 0 seconds
Finished in 0 seconds
Finished in 0 seconds
Finished in 0 seconds
Finished in 0 seconds
Finished in 0 seconds
Finished in 0.02 seconds
> 
> # Now the filematrix `ACME` holds estimations for all local gene-SNP pairs.
> 
> fm = fm.open(file.path(tempdirectory, "filematrices", "ACME"))
> TenResults = fm[,1:10]
> rownames(TenResults) = rownames(fm)
> close(fm)
> 
> show(t(TenResults))
      geneid snp_id    beta0      beta1 nits      SSE      SST          F
 [1,]      1      1 114.3747 164.298468    6 70.23063 84.16095 9.32249958
 [2,]      1      2 146.9906 104.708955    5 79.43809 84.16095 2.79430534
 [3,]      1      3 248.3731 -53.297432    8 82.07647 84.16095 1.19364576
 [4,]      2      4 152.5656 -28.712143    5 58.53136 59.45974 0.74547831
 [5,]      2      5 151.5951 -23.536547    5 58.78067 59.45974 0.54296895
 [6,]      2      6 137.9036  -3.493660    5 59.44054 59.45974 0.01518305
 [7,]      2      7 100.2717  56.258948    7 56.05362 59.45974 2.85597437
 [8,]      2      8 131.6374   4.338647    6 59.42598 59.45974 0.02669669
 [9,]      3      9 139.0213  12.939411    4 48.82208 48.97752 0.14963090
[10,]      3     10 157.7305 -12.139848   11 48.78336 48.97752 0.18705783
              eta        SE
 [1,]  1.43649302 0.7972499
 [2,]  0.71235131 0.5856060
 [3,] -0.21458613 0.1494263
 [4,] -0.18819542 0.1771115
 [5,] -0.15525930 0.1791377
 [6,] -0.02533408 0.2006827
 [7,]  0.56106530 0.4421209
 [8,]  0.03295908 0.2078457
 [9,]  0.09307500 0.2574778
[10,] -0.07696576 0.1644957
> 
> # Now we can estimate multi-SNP ACME models for each gene:
> multisnpACME(
+     genefm = "gene",
+     snpsfm = "snps",
+     glocfm = "gene_loc",
+     slocfm = "snps_loc",
+     cvrtfm = "cvrt",
+     acmefm = "ACME",
+     workdir = file.path(tempdirectory, "filematrices"),
+     genecap = Inf,
+     verbose = TRUE)
Loading and orthonormalizing covariates
Loading gene/SNP locations
Checking gene/SNP filematrices
Creating output filematrix
Scanning for gene 1
----Gene 1, added SNP 1 with AdjR2 0.1478
----Gene 1, added SNP 3 with AdjR2 0.1682
Scanning for gene 2
----Gene 2, added SNP 4 with AdjR2 0.0372
----Gene 2, added SNP 5 with AdjR2 0.0399
----Gene 2, added SNP 1 with AdjR2 0.0819
Scanning for gene 3
----Gene 3, added SNP 3 with AdjR2 0.0061
----Gene 3, added SNP 4 with AdjR2 0.0126
----Gene 3, added SNP 5 with AdjR2 0.0185
> 
> 
> 
> cleanEx()
Error: connections left open:
	D:\temp\RtmpwrxUC9\filematrices\snps.bmat (file)
	D:\temp\RtmpwrxUC9\filematrices\gene.bmat (file)
	D:\temp\RtmpwrxUC9\filematrices\ACME.bmat (file)
Execution halted