bioconductor v3.9.0 BiomaRt

In recent years a wealth of biological data has become available

Link to this section Summary

Functions

Class Mart

Display the analysis code from the 2009 Nature protocols paper

Gives a summary of the attribute pages

Exports getSequence results to FASTA format

Displays the filter options

Displays the filter type

Retrieves information from the BioMart database

Retrieves information from the BioMart database

Retrieves gene annotation information given a vector of identifiers

Retrieves information from two linked datasets

Retrieves sequences

Retrieves information from the BioMart database using an XML query

lists the attributes available in the selected dataset

List or search the datasets available in the selected BioMart database

lists the available BioMart databases hosted by Ensembl

Lists the available archived versions of Ensembl

List or search the options available for a specified filter.

List or search the filters available in the selected dataset

lists the available BioMart databases

Retrieve information from the BioMart databases

Select a dataset to use and updates Mart object

Connects to the selected BioMart database and dataset hosted by Ensembl

Connects to the selected BioMart database and dataset

Link to this section Functions

Class Mart

Description

Represents a Mart class, containing connections to different BioMarts

Author

Steffen Durinck

Display the analysis code from the 2009 Nature protocols paper

Description

This function opens an editor displaying the analysis code of the Nature Protocols 2009 paper

Usage

NP2009code()

Details

The edit function uses getOption("editor") to select the editor. Use, for instance, options(editor="emacs") to set another editor.

Seealso

edit

Author

Steffen Durinck, Wolfgang Huber

Examples

if(interactive()){
NP2009code()
}
Link to this function

attributePages()

Gives a summary of the attribute pages

Description

Attributes in BioMart databases are grouped together in attribute pages. The attributePages function gives a summary of the attribute categories and groups present in the BioMart. These page names can be used to display only a subset of the available attributes in the listAttributes function.

Usage

attributePages(mart)

Arguments

ArgumentDescription
martobject of class Mart, created with the useMart function.

Author

Steffen Durinck

Examples

if(interactive()){
mart = useMart("ensembl", dataset="hsapiens_gene_ensembl")
attributeSummary(mart)
}

Exports getSequence results to FASTA format

Description

Exports getSequence results to FASTA format

Usage

exportFASTA(sequences, file)

Arguments

ArgumentDescription
sequencesA data.frame that was the output of the getSequence function
fileFile to which you want to write the data

Author

Steffen Durinck

Examples

if(interactive()){
mart <- useMart("ensembl", dataset="hsapiens_gene_ensembl")

#seq<-getSequence(chromosome=c(2,2),start=c(100000,30000),end=c(100300,30500),mart=mart)
#exportFASTA(seq,file="test.fasta")

martDisconnect(mart = mart)
}
Link to this function

filterOptions()

Displays the filter options

Description

Displays a set of predetermed values for the specified filter (if available).

Usage

filterOptions(filter,mart)

Arguments

ArgumentDescription
filterA valid filter name.
martobject of class Mar created using the useMart functiont

Author

Steffen Durinck

Examples

if(interactive()){
mart = useMart("ensembl", dataset="hsapiens_gene_ensembl")
filterOptions("chromosome_name", mart)
}

Displays the filter type

Description

Displays the type of the filer given a filter name.

Usage

filterType(filter,mart)

Arguments

ArgumentDescription
filterA valid filter name. Valid filters are given by the listFilters function
martobject of class Mart, created using the useMart function

Author

Steffen Durinck

Examples

if(interactive()){
mart = useMart("ensembl", dataset="hsapiens_gene_ensembl")
filterType("chromosome_name", mart)
}

Retrieves information from the BioMart database

Description

This function is the main biomaRt query function. Given a set of filters and corresponding values, it retrieves the user specified attributes from the BioMart database one is connected to.

Usage

getBM(attributes, filters = "", values = "", mart, curl = NULL, 
checkFilters = TRUE, verbose = FALSE, uniqueRows = TRUE, bmHeader = FALSE,
quote = """)

Arguments

ArgumentDescription
attributesAttributes you want to retrieve. A possible list of attributes can be retrieved using the function listAttributes.
filtersFilters (one or more) that should be used in the query. A possible list of filters can be retrieved using the function listFilters.
valuesValues of the filter, e.g. vector of affy IDs. If multiple filters are specified then the argument should be a list of vectors of which the position of each vector corresponds to the position of the filters in the filters argument.
martobject of class Mart, created with the useMart function.
curlAn optional 'CURLHandle' object, that can be used to speed up getBM when used in a loop.
checkFiltersSometimes attributes where a value needs to be specified, for example upstream_flank with value 20 for obtaining upstream sequence flank regions of length 20bp, are treated as filters in BioMarts. To enable such a query to work, one must specify the attribute as a filter and set checkFilters = FALSE for the query to work.
verboseWhen using biomaRt in webservice mode and setting verbose to TRUE, the XML query to the webservice will be printed.
uniqueRowsIf the result of a query contains multiple identical rows, setting this argument to TRUE (default) will result in deleting the duplicated rows in the query result at the server side.
bmHeaderBoolean to indicate if the result retrieved from the BioMart server should include the data headers or not, defaults to FALSE. This should only be switched on if the default behavior results in errors, setting to on might still be able to retrieve your data in that case
quoteSometimes parsing of the results fails due to errors in the Ensembl data fields such as containing a quote, in such cases you can try to change the value of quote to try to still parse the results.

Value

A data.frame . There is no implicit mapping between its rows and the function arguments (e.g. filters , values ), therefore make sure to have the relevant identifier(s) returned by specifying them in attributes . See Examples.

Author

Steffen Durinck

Examples

mart <- useMart(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")
getBM(attributes = c("affy_hg_u95av2", "hgnc_symbol", "chromosome_name", "band"),
filters    = "affy_hg_u95av2",
values     = c("1939_at","1503_at","1454_at"),
mart       = mart)

Retrieves information from the BioMart database

Description

This function is the main biomaRt query function. Given a set of filters and corresponding values, it retrieves the user specified attributes from the BioMart database one is connected to

Usage

getBMlist(attributes, filters = "", values = "", mart, 
list.names = NULL, na.value = NA, verbose = FALSE, giveWarning = TRUE)

Arguments

ArgumentDescription
attributesAttributes you want to retrieve. A possible list of attributes can be retrieved using the function listAttributes.
filtersFilters (one or more) that should be used in the query. A possible list of filters can be retrieved using the function listFilters.
valuesValues of the filter, e.g. vector of affy IDs. If multiple filters are specified then the argument should be a list of vectors of which the position of each vector corresponds to the position of the filters in the filters argument.
martobject of class Mart, created with the useMart function.
list.namesnames for objects in list
na.valuevalue to give when result is empty
verboseWhen using biomaRt in webservice mode and setting verbose to TRUE, the XML query to the webservice will be printed.
giveWarningGives a warning about best practices of biomaRt and recommends using getBM instead of getBMlist

Author

Steffen Durinck

Examples

if(interactive()){
mart <- useMart("ensembl")
datasets <- listDatasets(mart)

}

Retrieves gene annotation information given a vector of identifiers

Description

This function retrieves gene annotations from Ensembl given a vector of identifiers. Annotation includes chromsome name, band, start position, end position, gene description and gene symbol. A wide variety of identifiers is available in Ensembl, these can be found with the listFilters function.

Usage

getGene( id, type, mart)

Arguments

ArgumentDescription
idvector of gene identifiers one wants to annotate
typetype of identifier, possible values can be obtained by the listFilters function. Examples are entrezgene, hgnc_symbol (for hugo gene symbol), ensembl_gene_id, unigene, agilentprobe, affy_hg_u133_plus_2, refseq_dna, etc.
martobject of class Mart, containing connections to the BioMart databases. You can create such an object using the function useMart.

Author

Steffen Durinck

Examples

if(interactive()){

mart = useMart("ensembl", dataset="hsapiens_gene_ensembl")

#example using affy id

g = getGene( id = "1939_at", type = "affy_hg_u95av2", mart = mart)
show(g)

#example using Entrez Gene id

g = getGene( id = "100", type = "entrezgene", mart = mart)
show(g)
}

Retrieves information from two linked datasets

Description

This function is the main biomaRt query function that links 2 datasets and retrieves information from these linked BioMart datasets. In Ensembl this translates to homology mapping.

Usage

getLDS(attributes, filters = "", values = "", mart, attributesL,
filtersL = "", valuesL = "", martL, verbose = FALSE, uniqueRows = TRUE, 
bmHeader=TRUE)

Arguments

ArgumentDescription
attributesAttributes you want to retrieve of primary dataset. A possible list of attributes can be retrieved using the function listAttributes.
filtersFilters that should be used in the query. These filters will be applied to primary dataset. A possible list of filters can be retrieved using the function listFilters.
valuesValues of the filter, e.g. list of affy IDs
martobject of class Mart created with the useMart function.
attributesLAttributes of linked dataset that needs to be retrieved
filtersLFilters to be applied to the linked dataset
valuesLValues for the linked dataset filters
martLMart object representing linked dataset
verboseWhen using biomaRt in webservice mode and setting verbose to TRUE, the XML query to the webservice will be printed. Alternatively in MySQL mode the MySQL query will be printed.
uniqueRowsLogical to indicate if the BioMart web service should return unique rows only or not. Has the value of either TRUE or FALSE
bmHeaderBoolean to indicate if the result retrieved from the BioMart server should include the data headers or not, defaults to TRUE. This should only be switched off if the default behavior results in errors, setting to off might still be able to retrieve your data in that case

Author

Steffen Durinck

Examples

if(interactive()){
human = useMart("ensembl", dataset = "hsapiens_gene_ensembl")
mouse = useMart("ensembl", dataset = "mmusculus_gene_ensembl")
getLDS(attributes = c("hgnc_symbol","chromosome_name", "start_position"),
filters = "hgnc_symbol", values = "TP53", mart = human,
attributesL = c("chromosome_name","start_position"), martL = mouse)
}

Retrieves sequences

Description

This function retrieves sequences given the chomosome, start and end position or a list of identifiers. Using getSequence in web service mode (default) generates 5' to 3' sequences of the requested type on the correct strand.

Usage

getSequence(chromosome, start, end, id, type, seqType, 
                   upstream, downstream, mart, verbose = FALSE)

Arguments

ArgumentDescription
chromosomeChromosome name
startstart position of sequence on chromosome
endend position of sequence on chromosome
idAn identifier or vector of identifiers.
typeThe type of identifier used. Supported types are hugo, ensembl, embl, entrezgene, refseq, ensemblTrans and unigene. Alternatively one can also use a filter to specify the type. Possible filters are given by the listFilters function
seqTypeType of sequence that you want to retrieve. Allowed seqTypes are given in the details section.
upstreamTo add the upstream sequence of a specified number of basepairs to the output.
downstreamTo add the downstream sequence of a specified number of basepairs to the output.
martobject of class Mart created using the useMart function
verboseIf verbose = TRUE then the XML query that was send to the webservice will be displayed.

Details

The type of sequence returned can be specified by the seqType argument which takes the following values:

  • 'cdna': for nucleotide sequences

  • 'peptide': for protein sequences

  • '3utr': for 3' UTR sequences

  • '5utr': for 5' UTR sequences

  • 'gene_exon': for exon sequences only

  • 'transcript_exon_intron': gives the full unspliced transcript, that is exons + introns

  • 'gene_exon_intron' gives the exons + introns of a gene;'coding' gives the coding sequence only

  • 'coding_transcript_flank': gives the flanking region of the transcript including the UTRs, this must be accompanied with a given value for the upstream or downstream attribute

  • 'coding_gene_flank': gives the flanking region of the gene including the UTRs, this must be accompanied with a given value for the upstream or downstream attribute

  • 'transcript_flank': gives the flanking region of the transcript exculding the UTRs, this must be accompanied with a given value for the upstream or downstream attribute

  • 'gene_flank': gives the flanking region of the gene excluding the UTRs, this must be accompanied with a given value for the upstream or downstream attribute

In MySQL mode the getSequence function is more limited and the sequence that is returned is the 5' to 3'+ strand of the genomic sequence, given a chromosome, as start and an end position. So if the sequence of interest is the minus strand, one has to compute the reverse complement of the retrieved sequence, which can be done using functions provided in the matchprobes package. The biomaRt vignette contains more examples on how to use this function.

Author

Steffen Durinck

Examples

if(interactive()){
mart <- useMart("ensembl", dataset="hsapiens_gene_ensembl")

seq = getSequence(id = "BRCA1",
type = "hgnc_symbol",
seqType = "peptide",
mart = mart)
show(seq)

seq = getSequence(id="1939_at",
type="affy_hg_u95av2",
seqType="gene_flank",
upstream = 20,
mart = mart)
show(seq)

}

Retrieves information from the BioMart database using an XML query

Description

DEPRECATED! - This function is a low level query function bypassing lots of biomaRts internal controls. It allows for a direct XML query to a known BioMart webservice host.

Usage

getXML(host="http://www.ensembl.org/biomart/martservice?", xmlquery)

Arguments

ArgumentDescription
hostURL to BioMart webservice, is set to http://www.ensembl.org/biomart/martservice? by default
xmlqueryXML query that needs to be send to the webservice

Details

This function has now been deprecated. Similar functionality can be achieved using the unexported function biomaRt:::.submitQueryXML` . If you are still using this function and this affects your work, please contact the package maintainer at https://github.com/grimbough/biomaRt/issues ## Author Steffen Durinck, Mike Smith ## Examples r if(interactive()){ xmlquery="<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE Query> <Query virtualSchemaName = 'default' uniqueRows = '1' count = '0' datasetConfigVersion = '0.6'> <Dataset name = 'hsapiens_gene_ensembl'> <Attribute name = 'ensembl_gene_id'/> <Filter name = 'chromosome_name' value = 'Y' /> </Dataset> </Query>" getXML(host = "www.ensembl.org/biomart/martservice?", xmlquery = xmlquery) }

Link to this function

listAttributes()

lists the attributes available in the selected dataset

Description

Attributes are the outputs of a biomaRt query, they are the information we want to retrieve. For example if we want to retrieve all entrez gene identifiers of genes located on chromosome X, entrezgene will be the attribute we use in the query. The listAttributes function lists the available attributes in the selected dataset

Usage

listAttributes(mart, page,what = c("name","description","page"))
    searchAttributes(mart, pattern)

Arguments

ArgumentDescription
martobject of class Mart created using the useMart function
pageShow only the attributes that belong to the specified attribute page.
whatvector of types of information about the attributes that need to be displayed. Can have values like name, description, fullDescription, page
patternCharacter vector defining the regular expression ( regex to be used for the search. If left blank the default is to use ".*" which will match everything.

Author

Steffen Durinck, Mike Smith

Examples

if(interactive()){

## list the available Ensembl marts and use Ensembl Genes
listEnsembl()
ensembl <- useEnsembl(biomart = "ensembl", dataset = 'hsapiens_gene_ensembl')

## list the available datasets in this Mart
listAttributes(mart = ensembl)

## the list of attributes is very long and gets truncated by R
## we can search for a term of interest to filter this e.g. 'start'
searchAttributes(mart = ensembl, pattern = "start")

## filter the attributes to give only entries containing 'entrez' or 'hgnc'
|searchAttributes(mart = ensembl, 'entrez|hgnc')|
}

List or search the datasets available in the selected BioMart database

Description

Lists or search the datasets available in the selected BioMart database

Usage

listDatasets(mart, verbose = FALSE)
    searchDatasets(mart, pattern)

Arguments

ArgumentDescription
martobject of class Mart created with the useMart function
verboseGive detailed output of what the method is doing, for debugging purposes
patternCharacter vector defining the regular expression ( regex to be used for the search. If left blank the default is to use ".*" which will match everything and return the same as listDatasets .

Author

Steffen Durinck, Mike Smith

Examples

if(interactive()){

## list the available Ensembl marts and use Ensembl Genes
listEnsembl()
ensembl <- useEnsembl(biomart = "ensembl")

## list the available datasets in this Mart
listDatasets(mart = ensembl)

## the list of Ensembl datasets grows ever larger (101 as of Ensembl 93)
## we can search for a term of interest to reduce the length e.g. 'sapiens'
searchDatasets(mart = ensembl, pattern = "sapiens")

## search for any dataset containing the word Rat or rat
|searchDatasets(mart = ensembl, pattern = "(R|r)at")|
}

lists the available BioMart databases hosted by Ensembl

Description

This function returns a list of BioMart databases hosted by Ensembl. To establish a connection use the useMart function.

Usage

listEnsembl(mart = NULL,host = "www.ensembl.org", version = NULL, 
                   GRCh = NULL, mirror = NULL, verbose = FALSE)

Arguments

ArgumentDescription
martmart object created with the useEnsembl function. This is optional, as you usually use listMarts to see which marts there are to connect to.
hostHost to connect to if different then www.ensembl.org
versionEnsembl version to connect to when wanting to connect to an archived Ensembl version
GRChGRCh version to connect to if not the current GRCh38, currently this can only be 37
mirrorSpecify an Ensembl mirror to connect to. The valid options here are 'www', 'uswest', 'useast', 'asia'. If no mirror is specified the primary site at www.ensembl.org will be used.
verboseGive detailed output of what the method is doing, for debugging purposes

Author

Steffen Durinck

Examples

if(interactive()){
listEnsembl()
}
Link to this function

listEnsemblArchives()

Lists the available archived versions of Ensembl

Description

Returns a table containing the available archived versions of Ensembl, along with the dates they were created and the URL used to access them.

Usage

listEnsemblArchives()

Author

Mike Smith

Examples

listEnsemblArchives()
Link to this function

listFilterValues()

List or search the options available for a specified filter.

Description

Some filters have a predefined list of values that can be used to search them. These functions give access to this list of options for a named filter, so you can check in the case where your biomaRt query is not finding anything.

Usage

listFilterValues(mart, filter)
    searchFilterValues(mart, filter, pattern)

Arguments

ArgumentDescription
martobject of class Mart created using the useMart , or useEnsembl functions
filterThe name of the filter whose options should be listed or searched. You can list available filters via listFilters
patternCharacter vector defining the regular expression ( regex to be used for the search. If left blank the default is to use ".*" which will match everything.

Seealso

listFilters

Author

Mike Smith

Examples

if(interactive()){

## Use the Ensembl human genes dataset
ensembl <- useEnsembl(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")

## we can search for the name of a filter we're interested in e.g. 'phenotype'
## we need to use the name of the filter in the next function
searchFilters(ensembl, pattern = "phenotype")

## list all the options available to the 'phenotype_source' filter
listFilterValues(mart = ensembl, filter = "phenotype_source")

## search the 'phenotype_description' filter for the term 'crohn'
searchFilterValues(mart = ensembl,
filter = "phenotype_description",
pattern = "crohn")
}

List or search the filters available in the selected dataset

Description

Filters are what we use as inputs for a biomaRt query. For example, if we want to retrieve all entrezgene identifiers on chromosome X, chromosome will be the filter, with corresponding value X.

Usage

listFilters(mart, what = c("name", "description"))
    searchFilters(mart, pattern)

Arguments

ArgumentDescription
martobject of class Mart created using the useMart function
whatcharacter vector indicating what information to display about the available filters. Valid values are name , description , options , fullDescription , filters , type , operation , filters8 , filters9 .
patternCharacter vector defining the regular expression ( regex to be used for the search. If left blank the default is to use ".*" which will match everything.

Author

Steffen Durinck, Mike Smith

Examples

if(interactive()){

## list the available Ensembl marts and use Ensembl Genes
listEnsembl()
ensembl <- useEnsembl(biomart = "ensembl", dataset = 'hsapiens_gene_ensembl')

## list the available datasets in this Mart
listFilters(mart = ensembl)

## the list of filters is long and not easy to read
## we can search for a term of interest to reduce this e.g. 'gene'
searchFilters(mart = ensembl, pattern = "gene")

## search the available filters to find entries containing 'entrez' or 'hgnc'
|searchFilters(mart = ensembl, 'entrez|hgnc')|
}

lists the available BioMart databases

Description

This function returns a list of BioMart databases to which biomaRt can connect to. By default all public BioMart databases are displayed. To establish a connection use the useMart function.

Usage

listMarts(mart = NULL, host="www.ensembl.org", path="/biomart/martservice",
port=80, includeHosts = FALSE, archive = FALSE, ssl.verifypeer = TRUE, 
ensemblRedirect = NULL, verbose = FALSE)

Arguments

ArgumentDescription
martmart object created with the useMart function. This is optional, as you usually use listMarts to see which marts there are to connect to.
hostHost to connect to. Defaults to www.ensembl.org
pathpath to martservice that should be pasted behind the host to get to web service URL
portport to use in HTTP communication
includeHostsboolean to indicate if function should return host of the BioMart databases
archiveBoolean to indicate if you want to access archived versions of BioMart database. Note that this argument is now defunct and setting this value to TRUE will produce an error. A better alternative is to specify the url of the archived BioMart you want to access. For Ensembl you can view the list of archives using listEnsemblArchives
ssl.verifypeerSet SSL peer verification on or off. By default ssl.verifypeer is set to TRUE
ensemblRedirectThis argument has now been deprecated.
verboseGive detailed output of what the method is doing, for debugging purposes

Details

If you receive an error message saying 'Unexpected format to the list of available marts', this is often because there is a problem with the BioMart server you are trying to connect to, and something other than the list of available marts is being returned - often some like a 'down for maintainance' page. If you browse to the provided URL and find a page that starts with ' <MartRegistry> ' this is the correct listing and you should report the issue on the Bioconductor support site: https://support.bioconductor.org

Author

Steffen Durinck, Mike Smith

Examples

if(interactive()){
listMarts()
}

Retrieve information from the BioMart databases

Description

select , columns and keys are used together to extract data from a Mart object. These functions work much the same as the classic biomaRt functions such as getBM etc. and are provide here to make this easier for people who are comfortable using these methods from other Annotation packages. Examples of other objects in other packages where you can use these methods include (but are not limited to): ChipDb , OrgDb GODb , InparanoidDb and ReactomeDb .

columns shows which kinds of data can be returned from the Mart object.

keytypes allows the user to discover which keytypes can be passed in to select or keys as the keytype argument.

keys returns keys from the Mart of the type specified by it's keytype argument.

select is meant to be used with these other methods and has arguments that take the kinds of values that these other methods return. select will retrieve the results as a data.frame based on parameters for selected keys and columns and keytype arguments.

Usage

columns(x)
  keytypes(x)
  keys(x, keytype, ...)
  select(x, keys, columns, keytype, ...)

Arguments

ArgumentDescription
xthe Mart object. The dataset of the Mart object must already be specified for all of these methods.
keysthe keys to select records for from the database. Keys for some keytypes can be extracted by using the keys method.
columnsthe columns or kinds of things that can be retrieved from the database. As with keys , all possible columns are returned by using the columns method.
keytypethe keytype that matches the keys used. For the select methods, this is used to indicate the kind of ID being used with the keys argument. For the keys method this is used to indicate which kind of keys are desired from keys

|... | other arguments. These include: list(" ", " ", list(list("pattern:"), list("the pattern to match (used by keys)")), " ", " ", list(list("column:"), list("the column to search on. This is used by keys and is ", " for when the thing you want to pattern match is different from ", " the keytype, or when you want to simply want to get keys that ", " have a value for the thing specified by the column argument.")), " ", " ", list(list("fuzzy:"), list("TRUE or FALSE value. Use fuzzy matching? (this is ", |

"        used with pattern by the keys method)")), "

", " ")

Value

keys , columns and keytypes each return a character vector or possible values. select returns a data.frame.

Author

Marc Carlson

Examples

## 1st create a Mart object and specify the dataset
mart<-useMart(dataset="hsapiens_gene_ensembl",biomart='ensembl')
## you can list the keytypes
keytypes(mart)
## you can list the columns
columns(mart)
## And you can extract keys when this is supported for your keytype of interest
k = keys(mart, keytype="chromosome_name")
head(k)
## You can even do some pattern matching on the keys
k = keys(mart, keytype="chromosome_name", pattern="LRG")
head(k)
## Finally you can use select to extract records for things that you are
## interested in.
affy=c("202763_at","209310_s_at","207500_at")
select(mart, keys=affy, columns=c('affy_hg_u133_plus_2','entrezgene'),
keytype='affy_hg_u133_plus_2')

Select a dataset to use and updates Mart object

Description

This function selects a dataset and updates the Mart object

Usage

useDataset(dataset,mart, verbose = FALSE)

Arguments

ArgumentDescription
datasetDataset you want to use. List of possible datasets can be retrieved using the function listDatasets
martMart object created with the useMart function
verboseGive detailed output of what the method is doing, for debugging

Author

Steffen Durinck

Examples

if(interactive()){
mart=useMart("ensembl")
mart=useDataset("hsapiens_gene_ensembl", mart = mart)
}

Connects to the selected BioMart database and dataset hosted by Ensembl

Description

A first step in using the biomaRt package is to select a BioMart database and dataset to use. The useEnsembl function enables one to connect to a specified BioMart database and dataset hosted by Ensembl without having to specify the Ensembl URL. To know which BioMart databases are available see the listEnsembl function. To know which datasets are available within a BioMart database, first select the BioMart database using useEnsembl and then use the listDatasets function on the selected Mart object.

Usage

useEnsembl(biomart, dataset, host, version = NULL, 
            GRCh = NULL, mirror = NULL, verbose = FALSE)

Arguments

ArgumentDescription
biomartBioMart database name you want to connect to. Possible database names can be retrieved with the function listEnsembl
datasetDataset you want to use. To see the different datasets available within a biomaRt you can e.g. do: mart = useEnsembl('ENSEMBL_MART_ENSEMBL'), followed by listDatasets(mart).
hostHost to connect to. Only needs to be specified if different from www.ensembl.org
versionEnsembl version to connect to when wanting to connect to an archived Ensembl version
GRChGRCh version to connect to if not the current GRCh38, currently this can only be 37
mirrorSpecify an Ensembl mirror to connect to. The valid options here are 'www', 'uswest', 'useast', 'asia'. If no mirror is specified the primary site at www.ensembl.org will be used.
verboseGive detailed output of what the method is doing while in use, for debugging

Author

Steffen Durinck & Mike Smith

Examples

if(interactive()){

mart <- useEnsembl("ensembl")

## using the US West mirror
us_mart <- useEnsembl(biomart = "ensembl", mirror = "uswest")
}

Connects to the selected BioMart database and dataset

Description

A first step in using the biomaRt package is to select a BioMart database and dataset to use. The useMart function enables one to connect to a specified BioMart database and dataset within this database. To know which BioMart databases are available see the listMarts function. To know which datasets are available within a BioMart database, first select the BioMart database using useMart and then use the listDatasets function on the selected BioMart, see listDatasets function.

Usage

useMart(biomart, dataset, host="www.ensembl.org",
path="/biomart/martservice", port=80, archive=FALSE, ssl.verifypeer =
TRUE, ensemblRedirect = NULL, version, verbose = FALSE)

Arguments

ArgumentDescription
biomartBioMart database name you want to connect to. Possible database names can be retrieved with the functio listMarts
datasetDataset you want to use. To see the different datasets available within a biomaRt you can e.g. do: mart = useMart('ensembl'), followed by listDatasets(mart).
hostHost to connect to. Defaults to www.ensembl.org
pathPath that should be pasted after to host to get access to the web service URL
portport to connect to, will be pasted between host and path
archiveBoolean to indicate if you want to access archived versions of BioMart databases. Note that this argument is now deprecated and will be removed in the future. A better alternative is to leave archive = FALSE and to specify the url of the archived BioMart you want to access. For Ensembl you can view the list of archives using listEnsemblArchives
ssl.verifypeerSet SSL peer verification on or off. By default ssl.verifypeer is set to TRUE
ensemblRedirectThis argument has now been deprecated.
versionUse version name instead of biomart name to specify which BioMart you want to use
verboseGive detailed output of what the method is doing while in use, for debugging

Author

Steffen Durinck

Examples

if(interactive()){

mart = useMart("ensembl")
mart=useMart(biomart="ensembl", dataset="hsapiens_gene_ensembl")
}