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
98 stars 25 forks source link

snpgdsLDpruning #38

Closed jjpadilla closed 6 years ago

jjpadilla commented 6 years ago

Hi, i would like to do pruning based on relatedness of my samples. I ran the code following the paper of Reed et al, 2015.

snpSUB <- snpgdsLDpruning(genofile, ld.threshold = ld.thresh, sample.id = geno.sample.ids, # only analyze the filtered samples snp.id = colnames(genotype)) # only analyze the filtered snps

Unfortunately, i always giot this error message. could you help me on solving this? Thanks in advance!

Error in .InitFile2(cmd = paste(ifelse(inherits(gdsobj, "SeqVarGDSClass"), : Some of sample.id do not exist!

zhengxwen commented 6 years ago

Some of the sample IDs you passed to the function snpgdsLDpruning() are not in the GDS file. please read the sample id:

samp_id <- read.gdsn(index.gdsn(genofile, "sample.id"))

to see which sample IDs you can use in the GDS file.