zhengxwen / SNPRelate

R package: parallel computing toolset for relatedness and principal component analysis of SNP data (Development version only)
http://www.bioconductor.org/packages/SNPRelate
101 stars 25 forks source link

Error indexing gdsn created from snpgdsVCF2GDS #29

Closed dvjim closed 7 years ago

dvjim commented 7 years ago

I ran:

gds.file <- "F1.gds" vcf.file <- "F1_227_195.vcf" SNPRelate::snpgdsVCF2GDS(vcf.file, gds.file) snpgdsOpen("F1.gds")

And was able to run a summary and open the gds file, but when I tried to run the following code, I received this error : chr<- read.gdsn(index.gdsn("F1.gds", "snp.chromosome")) Error: inherits(node, "gdsn.class") is not TRUE

traceback() 5: stop(sprintf(ngettext(length(r), "%s is not TRUE", "%s are not all TRUE"), ch), call. = FALSE, domain = NA) 4: stopifnot(inherits(node, "gdsn.class")) 3: index.gdsn("F1.gds", "snp.chromosome") 2: stopifnot(inherits(node, "gdsn.class")) 1: read.gdsn(index.gdsn("F1.gds", "snp.chromosome"))

zhengxwen commented 7 years ago

You should open the GDS file first,

f <- snpgdsOpen("F1.gds")
chr <- read.gdsn(index.gdsn(f, "snp.chromosome"))