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

> ### Name: GhostKnockoff.filter
> ### Title: GhostKnockoff filter
> ### Aliases: GhostKnockoff.filter
> ### Keywords: Feature selection
> 
> ### ** Examples
> 
> 
> # We use genetic data as an example
> library(GhostKnockoff)
> 
> # load example vcf file from package "seqminer", this serves as the reference panel
> vcf.filename = system.file("vcf/1000g.phase1.20110521.CFH.var.anno.vcf.gz", package = "seqminer")
> 
> ## this is how the actual genotype matrix from package "seqminer" looks like
> example.G <- t(readVCFToMatrixByRange(vcf.filename, "1:196621007-196716634",annoType='')[[1]])
1 region to be extracted.
> example.G <- example.G[,apply(example.G,2,sd)!=0]
> example.G <- example.G[,1:100]
> 
> # compute correlation among variants
> cor.G<-matrix(as.numeric(corpcor::cor.shrink(example.G)), nrow=ncol(example.G))
Estimating optimal shrinkage intensity lambda (correlation matrix): 0.8744 

> 
> # fit null model
> fit.prelim<-GhostKnockoff.prelim(cor.G,M=5,method='asdp',max.size=500)
> 
> ### if only one study is involved
> Zscore_0<-as.matrix(rnorm(nrow(cor.G))) # hypothetical Z-scores
> Zscore_0<-Zscore_0+rbinom(nrow(cor.G),size=2,0.1) # set causal
> n.study<-c(5000)
> 
> # knockoff scores for each block, this can be run in parallel too
> GK.stat<-GhostKnockoff.fit(Zscore_0,n.study,fit.prelim,gamma=1,weight.study=NULL)
> 
> # knockoff filter
> GK.filter<-GhostKnockoff.filter(GK.stat$T_0,GK.stat$T_k)
> GK.filter$q
  [1] 1.0000000 1.0000000 0.2000000 0.4000000 1.0000000 1.0000000 1.0000000
  [8] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
 [15] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
 [22] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
 [29] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
 [36] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
 [43] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
 [50] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
 [57] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
 [64] 1.0000000 1.0000000 0.4000000 1.0000000 0.4000000 1.0000000 1.0000000
 [71] 1.0000000 1.0000000 1.0000000 0.4000000 0.4000000 1.0000000 1.0000000
 [78] 1.0000000 1.0000000 1.0000000 0.4000000 1.0000000 1.0000000 0.6888889
 [85] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
 [92] 1.0000000 1.0000000 1.0000000 0.4000000 1.0000000 1.0000000 1.0000000
 [99] 1.0000000 1.0000000
> 
> ### if multiple studies are involved, for a meta-analysis
> 
> # compute study correlation
> Zscore_0<-cbind(rnorm(nrow(cor.G)),rnorm(nrow(cor.G))) # hypothetical Z-scores
> Zscore_0<-Zscore_0+rbinom(nrow(cor.G),size=2,0.1) # set causal
> cor.study<-GhostKnockoff.GetCorStudy(Zscore_0,fit.prelim)
> 
> # note that all steps above can be run in parallel for nonoverlapping blocks of the genome.
> # Then the overall study correlation can be computed by averaging cor.study of all blocks.
> 
> # compute optimal weights and study dependency using overall study correlaton
> n.study<-c(5000,7500)
> Meta.prelim<-GhostKnockoff.prelim.Meta(cor.study, n.study)
P is not upper triangularERROR in osqp_setup: Problem data validation.