privefl / bigsnpr

R package for the analysis of massive SNP arrays.
https://privefl.github.io/bigsnpr/
183 stars 43 forks source link

Handle insertions/deletions coded as I/D in snp_match() #494

Open privefl opened 2 months ago

privefl commented 2 months ago

It is useful when only one data frame is coding insertions/deletions like this.

I think we can simply use {dplyr} to transform the other data frame in the same format with

mutate(no_ID = (nchar(a0) + nchar(a1)) == 2,
       a0 = ifelse(no_ID, a0, ifelse(nchar(a0) == 1, "D", "I")),
       a1 = ifelse(no_ID, a1, ifelse(nchar(a1) == 1, "D", "I")),
       no_ID = NULL)
privefl commented 2 months ago

Maybe should implement this directly in snp_match() somehow.