I'm trying to use the getBM() function of bioconductor to retrieve the sequences of some gene. Here's my script:
setwd(".")
options(stringsAsFactors = FALSE)
cat("\014")
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
listOfBiocPackages <- c("annotate", "GEOquery", "biomaRt")
bioCpackagesNotInstalled <- which( !listOfBiocPackages %in% rownames(installed.packages()) )
cat("package missing listOfBiocPackages[", bioCpackagesNotInstalled, "]: ", listOfBiocPackages[bioCpackagesNotInstalled], "\n", sep="")
# check there's still something left to install
if( length(bioCpackagesNotInstalled) ) {
BiocManager::install(listOfBiocPackages[bioCpackagesNotInstalled])
}
library("easypackages")
libraries(listOfBiocPackages)
mart <- useMart("ENSEMBL_MART_ENSEMBL")
mart <- useDataset("hsapiens_gene_ensembl", mart)
thisAnnotLookup <- getBM(mart=mart, attributes=c("affy_hg_u133a", "ensembl_gene_id", "gene_biotype", "external_gene_name", "gene_flank"), filter=c("affy_hg_u133a", "upstream_flank"), values=list(affyid=c("203423_at", "204088_at", "204511_at", "204911_s_at", "205234_at")), uniqueRows=TRUE, checkFilters=FALSE)
print(thisAnnotLookup)
This script gives the me following error:
'names' attribute [2] must be the same length as the vector [1]
which I cannot understand.
Can anyone help me solve this issue? Thanks!