biomaRt
biomaRt copied to clipboard
getBM returns logical minor_allele column when minor_allele = T
Hi,
I ran into a case, where the minor_allele
of a SNP returned is coded as TRUE
.
The example below only queries one SNP rs1528723 which has T as the minor allele (dbSNP).
My guess: the minor allele column is never forced to be a character, hence R automatically assumes a T
to be a TRUE
.
library(biomaRt)
snp_ensembl <- useEnsembl(biomart = "snp", dataset = "hsapiens_snp", GRCh = 37)
chr <- 8
pos <- 35127386
out <- getBM(
attributes = c("refsnp_id",
"minor_allele"),
filters = c("chr_name", "start", "end"),
values = list(chr, pos, pos),
mart = snp_ensembl)
out
#> refsnp_id minor_allele
#> 1 rs1528723 TRUE
Created on 2019-05-07 by the reprex package (v0.2.1)