Problem with getsequence() function in biomaRt
1
0
Entering edit mode
snamjoshi87 ▴ 40
@snamjoshi87-11184
Last seen 7.1 years ago

I've used this code before to get sequences but not it does not seem to work. I have updated Bioconductor and BiomaRt to their latest versions.

When I run this code (where genes is a dataframe of one column with my genes of interest (official gene symbol):

ensembl <- useMart("ensembl", dataset = "mmusculus_gene_ensembl")
seq <- getSequence(id = genes,
                   type = "mgi_symbol",
                   seqType = "coding",
                   mart = ensembl)

I get the following error:

Error in paste("no getSequence method for objects of class:", class(object)) :
  argument "object" is missing, with no default

Any ideas what I might be doing wrong? I don't think one of my other loaded packages is interfering but it might be the case...

Session info:

R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                 
 [3] LC_TIME=en_US.UTF-8           LC_COLLATE=en_US.UTF-8       
 [5] LC_MONETARY=en_US.UTF-8       LC_MESSAGES=en_US.UTF-8      
 [7] LC_PAPER=en_US.UTF-8          LC_NAME=en_US.UTF-8          
 [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

attached base packages:
 [1] grid      stats4    parallel  stats     graphics  grDevices utils     datasets
 [9] methods   base     

other attached packages:
 [1] BiocInstaller_1.24.0 gridExtra_2.2.1      seqinr_3.3-3         org.Hs.eg.db_3.4.0  
 [5] mgu74a.db_3.2.3      org.Mm.eg.db_3.4.0   AnnotationDbi_1.36.0 Biobase_2.34.0      
 [9] xlsx_0.5.7           xlsxjars_0.6.1       rJava_0.9-8          magrittr_1.5        
[13] biomaRt_2.30.0       Biostrings_2.42.0    XVector_0.14.0       IRanges_2.8.1       
[17] S4Vectors_0.12.0     BiocGenerics_0.20.0  stargazer_5.2        reshape2_1.4.2      
[21] ggplot2_2.2.0       

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.8      plyr_1.8.4       bitops_1.0-6     tools_3.3.2      zlibbioc_1.20.0
 [6] RSQLite_1.1      tibble_1.2       gtable_0.2.0     DBI_0.5-1        stringr_1.1.0   
[11] ade4_1.7-4       XML_3.98-1.5     scales_0.4.1     assertthat_0.1   colorspace_1.3-1
[16] labeling_0.3     stringi_1.1.2    RCurl_1.95-4.8   lazyeval_0.2.0   munsell_0.4.3 

biomart • 1.3k views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 9 hours ago
United States

You may have been able to use a data.frame in the past, but a quick look at the current help will explain the problem:

    id: An identifier or vector of identifiers.

And a data.frame is categorically not a vector.

ADD COMMENT
0
Entering edit mode

This helped part of the way but then I was still getting an error! Turns out that the seqinr package (from CRAN) which I had loaded also has a getsequence() function and it was overriding the biomaRt one.

ADD REPLY

Login before adding your answer.

Traffic: 666 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6