Hi,

I'm using VariantAnnotation, which is a very nice package, to annotate some
SNPs, based on
http://adairama.wordpress.com/2013/02/15/functionally-annotate-snps-and-indels-in-bioconductor
.

For SNPs annotated as intergenic and therefore falling between two genes
(PRECEDEID and FOLLOWID), is there a way of getting the actual distance
between the SNPs and these two genes?

I'm using:

head(m, 3)
         RS  Chr      Pos
1 rs2187668 chr6 32713862
2 rs9357152 chr6 32772938
3 rs3099844 chr6 31556955

target <- with(m,
      GRanges(seqnames=Rle(Chr),
         ranges=IRanges(Pos, end=Pos, names=RS),
         strand=Rle(strand("*"))
      )
)

loc <- locateVariants(target, TxDb.Hsapiens.UCSC.hg18.knownGene,
AllVariants())
names(loc) <- NULL
out <- as.data.frame(loc)

head(out, 3)
      names seqnames    start      end   LOCATION GENEID PRECEDEID FOLLOWID
GeneSymbol PrecedeSymbol FollowSymbol
1 rs2187668     chr6 32713862 32713862     intron   3117      <NA>
<NA>   HLA-DQA1          <NA>         <NA>
4 rs9357152     chr6 32772938 32772938 intergenic   <NA>      3119
3117       <NA>      HLA-DQB1     HLA-DQA1
5 rs3099844     chr6 31556955 31556955 intergenic   <NA>      4277
352961       <NA>          MICB        HCG26

I'd like to get the distance from rs9357152 to HLA-DQB1 and to HLA-DQA1.

Thanks,
Gad

	[[alternative HTML version deleted]]

