Thursday 11 June 2015

R biomaRt

Cited from The biomaRt user’s guide

  1. A first step is to check which BioMart web services are available. The function listMarts will display all available BioMart web services.
  2. The useMart function can now be used to connect to a specified BioMart database, this must be a valid name given by listMarts.
  3. BioMart databases can contain several datasets, for Ensembl every species is a different dataset. In a next step, the datasets are available in the selected BioMart database can be visualised by using the function listDatasets.
  4. To select a dataset we can up date the Mart object using the function useDataset.
  5. Or alternatively if the dataset one wants to use is known in advance, one can select a BioMart database and dataset in one step by useMart("database",dataset="dataset").
  6. The getBM function is the main query function in biomaRt. For some frequently used queries to Ensembl, wrapper functions are available: getGene and getSequence. biomaRt has four main arguments:
  • ˆ attributes: is a vector of attributes that one wants to retrieve (= the output of the query).
  • ˆ filters: is a vector of filters that one wil use as input to the query.
  • ˆ values: a vector of values for the filters. In case multple filters are in use, the values argument requires a list of values where each position in the list corresponds to the position of the filters in the filters argument.
  • ˆ mart: is and object of class Mart, which is created by the useMart function.
=============================================================

No comments:

Post a Comment