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

Filtering and snpgdsLDpruning: filter has no effect #40

Closed flinz closed 6 years ago

flinz commented 6 years ago

I am trying to set a filter and then to LD pruning (1KG dataset).

f <- seqOpen("1KG_autosomes_phase3_shapeit2_mvncall_integrated_v5_20130502_lzma.seq.gds")
seqSetFilterChrom(f, 22, from.bp=1, to.bp=16219561)
# Number of selected variants: 2,005
snpset <- snpgdsLDpruning(f, ld.threshold=0.2, maf=0.01)

However, it seems like the pruning is performed on the whole 1KG dataset, not taking the filtering into account. I tried exporting to a new .gds file, then opening and filtering that one, and then the pruning works as intended.

Versions:

SNPRelate_1.14.0 SeqArray_1.20.1  gdsfmt_1.16.0 
flinz commented 6 years ago

I have missed the fact that i should provide snp.id to the function. Excuse the false alarm please.