Browse code

Switched to useEnsembl istead of useMart

Robert Ivánek authored on 06/01/2022 15:09:36
Showing 3 changed files

... ...
@@ -44,7 +44,7 @@ importFrom(Biostrings, DNAStringSet, RNAStringSet, BStringSet, DNAString, RNAStr
44 44
 
45 45
 importFrom(BSgenome, bsapply)
46 46
 
47
-importFrom(biomaRt, getBM, useMart, listDatasets, listAttributes, listFilters)
47
+importFrom(biomaRt, getBM, useEnsembl, useMart, listDatasets, listAttributes, listFilters)
48 48
 
49 49
 importFrom(Rsamtools, scanBamFlag, scanBamHeader, scanBam, ScanBamParam, scanFaIndex, scanFa, BamFile, scanBamWhat, bamWhich)
50 50
 
... ...
@@ -1430,7 +1430,7 @@ addScheme <- function(scheme, name) {
1430 1430
 .getBiomart <- function(genome) {
1431 1431
     map <- .ucsc2Ensembl(genome)
1432 1432
     if (map$date == "head") {
1433
-        bm <- useMart("ensembl", dataset = map$dataset)
1433
+        bm <- useEnsembl(biomart="ensembl", dataset = map$dataset)
1434 1434
         ds <- listDatasets(bm)
1435 1435
         mt <- ds[match(map$dataset, ds$dataset), "version"]
1436 1436
         if (is.na(mt)) {
... ...
@@ -1449,7 +1449,7 @@ addScheme <- function(scheme, name) {
1449 1449
             ))
1450 1450
         }
1451 1451
     } else {
1452
-        bm <- useMart(host = sprintf("%s.archive.ensembl.org", tolower(sub(".", "", map$date, fixed = TRUE))), biomart = "ENSEMBL_MART_ENSEMBL", dataset = map$dataset)
1452
+        bm <- useEnsembl(biomart = "ENSEMBL_MART_ENSEMBL", dataset = map$dataset, host = sprintf("%s.archive.ensembl.org", tolower(sub(".", "", map$date, fixed = TRUE))))
1453 1453
         ds <- listDatasets(bm)
1454 1454
         mt <- ds[match(map$dataset, ds$dataset), "version"]
1455 1455
         if (is.na(mt)) {
... ...
@@ -1796,7 +1796,7 @@ be selected in that object. In the example code below, the older version of huma
1796 1796
 
1797 1797
 ```{r BiomartGeneRegionTrackShow, eval=FALSE}
1798 1798
 library(biomaRt)
1799
-bm <- useMart(host = "grch37.ensembl.org", 
1799
+bm <- useEnsembl(host = "grch37.ensembl.org", 
1800 1800
               biomart = "ENSEMBL_MART_ENSEMBL", 
1801 1801
               dataset = "hsapiens_gene_ensembl")
1802 1802
 biomTrack <- BiomartGeneRegionTrack(genome = "hg19", chromosome = chr, 
... ...
@@ -1807,7 +1807,7 @@ plotTracks(biomTrack)
1807 1807
 ```{r BiomartGeneRegionTrackDo, echo=FALSE, results='hide', fig.width=7.5, fig.height=1.25}
1808 1808
 library(biomaRt)
1809 1809
 if(hasBiomartConnection) {
1810
-  bm <- useMart(host = "grch37.ensembl.org", 
1810
+  bm <- useEnsembl(host = "grch37.ensembl.org", 
1811 1811
                 biomart = "ENSEMBL_MART_ENSEMBL", 
1812 1812
                 dataset = "hsapiens_gene_ensembl")
1813 1813
   biomTrack <- BiomartGeneRegionTrack(genome = "hg19", chromosome = chr, 
... ...
@@ -1851,7 +1851,7 @@ see the documentation in the `r Biocpkg("biomaRt")` package for details.
1851 1851
 
1852 1852
 
1853 1853
 ```{r BiomartGeneRegionTrackFilterShow, eval=FALSE}
1854
-bm <- useMart(host = "grch37.ensembl.org", 
1854
+bm <- useEnsembl(host = "grch37.ensembl.org", 
1855 1855
               biomart = "ENSEMBL_MART_ENSEMBL", 
1856 1856
               dataset = "hsapiens_gene_ensembl")
1857 1857
 biomTrack <- BiomartGeneRegionTrack(genome = "hg19", chromosome = chr, 
... ...
@@ -1863,7 +1863,7 @@ plotTracks(biomTrack, col.line = NULL, col = NULL, stackHeight = 0.3)
1863 1863
 ```
1864 1864
 ```{r BiomartGeneRegionTrackFilterDo, fig.width=7.5, fig.height=1.25, echo=FALSE, results='hide'}
1865 1865
 if(hasBiomartConnection) {
1866
-  bm <- useMart(host = "grch37.ensembl.org",
1866
+  bm <- useEnsembl(host = "grch37.ensembl.org",
1867 1867
                 biomart = "ENSEMBL_MART_ENSEMBL",
1868 1868
                 dataset = "hsapiens_gene_ensembl")
1869 1869
   biomTrack <- BiomartGeneRegionTrack(genome = "hg19", chromosome = chr, 
... ...
@@ -1892,7 +1892,7 @@ region. If that is not desired one needs to provide an explicit
1892 1892
 Biomart filter.
1893 1893
 
1894 1894
 ```{r BiomartGeneRegionTrackSymbolShow, eval=FALSE}
1895
-bm <- useMart(host = "grch37.ensembl.org", 
1895
+bm <- useEnsembl(host = "grch37.ensembl.org", 
1896 1896
               biomart = "ENSEMBL_MART_ENSEMBL",
1897 1897
               dataset = "hsapiens_gene_ensembl")
1898 1898
 biomTrack <- BiomartGeneRegionTrack(genome = "hg19", name = "ENSEMBL", 
... ...
@@ -1901,7 +1901,7 @@ plotTracks(biomTrack, transcriptAnnotation = "symbol")
1901 1901
 ```
1902 1902
 ```{r BiomartGeneRegionTrackSymbolDo, fig.width=7.5, fig.height=1.25, echo=FALSE, results='hide'}
1903 1903
 if(hasBiomartConnection) {
1904
-  bm <- useMart(host = "grch37.ensembl.org", 
1904
+  bm <- useEnsembl(host = "grch37.ensembl.org", 
1905 1905
                 biomart = "ENSEMBL_MART_ENSEMBL", 
1906 1906
                 dataset = "hsapiens_gene_ensembl")
1907 1907
   biomTrack <- BiomartGeneRegionTrack(genome = "hg19", name = "ENSEMBL", 
... ...
@@ -1934,7 +1934,7 @@ which is necessary because Ensembl used to call the gene symbol field
1934 1934
 
1935 1935
 ```{r BiomartGeneRegionTrackCustom, fig.width=7.5, fig.height=1.25, eval=FALSE, echo=F}
1936 1936
 library(biomaRt)
1937
-bm <- useMart(host="dec2012.archive.ensembl.org", biomart="ENSEMBL_MART_ENSEMBL",
1937
+bm <- useEnsembl(host="dec2012.archive.ensembl.org", biomart="ENSEMBL_MART_ENSEMBL",
1938 1938
               dataset="hsapiens_gene_ensembl")
1939 1939
 fm <- Gviz:::.getBMFeatureMap()
1940 1940
 fm[["symbol"]] <- "external_gene_id"