Hi,

Is there any easy way to convert the output of getSNPlocs(), i.e., a
GRanges with ambiguity codes, to something more like a VCF? Or would it be
better to just access the dbSNP VCF file?

I've made a function that does the above (shown below), but it would be
nice to have a built-in path.

stripRefSNPs <- function(x) {
  x[x$alt != getSeq(Hsapiens, x, as.character = TRUE)]
}
explodeSNPAlleles <- function(x) {
  alleles <- strsplit(IUPAC_CODE_MAP[x$alleles_as_ambig], NULL)
  x <- x[rep(seq_len(length(x)), elementLengths(alleles))]
  x$alleles_as_ambig <- NULL
  x$alt <- unlist(alleles)
  stripRefSNPs(x)
}

Thanks,
Michael

	[[alternative HTML version deleted]]

