Question: biomaRt getBM returns allele as logical instead of character
1
gravatar for Christian Ruckert
3.8 years ago by
Germany
Christian Ruckert170 wrote:

The following biomaRt query returns the minor_allele column as logical instead of character:
 

library("biomaRt")

mart <- useMart(host="feb2014.archive.ensembl.org", biomart="ENSEMBL_MART_SNP")
ensembl <- useDataset("hsapiens_snp", mart=mart)


res <- getBM(attributes=c("chr_name","chrom_start","chrom_strand","allele","refsnp_id", "refsnp_source","minor_allele", "minor_allele_freq"),
filters=c("chr_name", "chrom_start", "chrom_end"), values=list("11", 108202735,108202740), mart=ensembl)

> res
  chr_name chrom_start chrom_strand        allele   refsnp_id refsnp_source
1       11   108202738            1           C/T rs186666661         dbSNP

  minor_allele minor_allele_freq
1         TRUE       0.000459137

> class(res$minor_allele)
[1] "logical"

 

If using a wider range the minor allele is returned correctly:

> res <- getBM(attributes=c("chr_name", "chrom_start","chrom_strand","allele","refsnp_id", "refsnp_source",  "minor_allele", "minor_allele_freq"),
filters=c("chr_name", "chrom_start", "chrom_end"), values=list("11", 108202650,108202740),
mart=ensembl)

> res
  chr_name chrom_start chrom_strand        allele   refsnp_id refsnp_source
1       11   108202681            1 HGMD_MUTATION    CD991612   HGMD-PUBLIC
2       11   108202681            1 HGMD_MUTATION    CD991613   HGMD-PUBLIC
3       11   108202685            1           A/G  rs28904920         dbSNP
4       11   108202685            1 HGMD_MUTATION   CM0910523   HGMD-PUBLIC
5       11   108202716            1           A/C rs199915459         dbSNP
6       11   108202738            1           C/T rs186666661         dbSNP
  minor_allele minor_allele_freq
1                             NA
2                             NA
3                             NA
4                             NA
5            C       0.000459137
6            T       0.000459137

> class(res$minor_allele)
[1] "character"

Is there any way to circumvent this behaviour

 

Regards,

Christian

 

 

biomart error getbm logical • 670 views
ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by Christian Ruckert170
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 228 users visited in the last hour