API¶
Python Module¶
Entry points¶
These functions are available after you import apybiomart
and should be used as the main entry
points for apybiomart. If you want more control, you can use the internal classes described below.
-
async
apybiomart.apybiomart.
aquery
(attributes: List[str], filters: Dict[str, Union[str, int, list, tuple, bool]], dataset: str = 'hsapiens_gene_ensembl', save: bool = False, output: str = 'apybiomart_aquery.csv') → pandas.core.frame.DataFrame[source]¶ Launch asynchronous query using the given attributes, filters and dataset.
- Parameters
attributes – list of attributes to include
filters – dict of filter name : value to filter results
dataset – BioMart dataset name (default: “hsapiens_gene_ensembl”)
save – save results to a CSV file [default: False]
output – output filename if saving results [default: ‘apybiomart_aquery.csv’]
-
apybiomart.apybiomart.
find_attributes
(dataset: str = 'hsapiens_gene_ensembl', save: bool = False, output: str = 'apybiomart_attributes.csv') → pandas.core.frame.DataFrame[source]¶ Retrieve and list available attributes for a given mart.
- Parameters
dataset – BioMart dataset name (default: “hsapiens_gene_ensembl”)
save – save results to a CSV file [default: False]
output – output filename if saving results [default: ‘apybiomart_attributes.csv’]
-
apybiomart.apybiomart.
find_datasets
(mart: str = 'ENSEMBL_MART_ENSEMBL', save: bool = False, output: str = 'apybiomart_datasets.csv') → pandas.core.frame.DataFrame[source]¶ Retrieve and list available datasets for a given mart.
- Parameters
mart – BioMart mart name (default: “ENSEMBL_MART_ENSEMBL”)
save – save results to a CSV file [default: False]
output – output filename if saving results [default: ‘apybiomart_datasets.csv’]
-
apybiomart.apybiomart.
find_filters
(dataset: str = 'hsapiens_gene_ensembl', save: bool = False, output: str = 'apybiomart_filters.csv') → pandas.core.frame.DataFrame[source]¶ Retrieve and list available filters for a given mart.
- Parameters
dataset – BioMart dataset name (default: “hsapiens_gene_ensembl”)
save – save results to a CSV file [default: False]
output – output filename if saving results [default: ‘apybiomart_filters.csv’]
-
apybiomart.apybiomart.
find_marts
(save: bool = False, output: str = 'apybiomart_marts.csv') → pandas.core.frame.DataFrame[source]¶ Retrieve and list available marts.
- Parameters
save – save results to a CSV file [default: False]
output – output filename if saving results [default: ‘apybiomart_marts.csv’]
-
apybiomart.apybiomart.
query
(attributes: List[str], filters: Dict[str, Union[str, int, list, tuple, bool]], dataset: str = 'hsapiens_gene_ensembl', save: bool = False, output: str = 'apybiomart_query.csv') → pandas.core.frame.DataFrame[source]¶ Launch synchronous query using the given attributes, filters and dataset.
- Parameters
attributes – list of attributes to include
filters – dict of filter name : value to filter results
dataset – BioMart dataset name (default: “hsapiens_gene_ensembl”)
save – save results to a CSV file [default: False]
output – output filename if saving results [default: ‘apybiomart_query.csv’]
Internal classes¶
These are the internal classes used by apybiomart, and can be imported with
from apybiomart.classes import <ClassName>
. Use them if you want more control over the
application.
-
class
apybiomart.classes.
AttributesServer
(dataset: str, save: bool = False, output: str = 'apybiomart_attributes.csv')[source]¶ Class used to retrieve and list available attributes for a dataset.
-
dataset
¶ BioMart dataset name
-
-
class
apybiomart.classes.
DatasetServer
(mart: str, save: bool = False, output: str = 'apybiomart_datasets.csv')[source]¶ Class used to retrieve and list available datasets for a mart.
-
mart
¶ BioMart mart name
-
-
class
apybiomart.classes.
FiltersServer
(dataset: str, save: bool = False, output: str = 'apybiomart_filters.csv')[source]¶ Class used to retrieve and list available filters for a dataset.
-
dataset
¶ BioMart dataset name
-
-
class
apybiomart.classes.
MartServer
(save: bool = False, output: str = 'apybiomart_marts.csv')[source]¶ Class used to retrieve and list available marts.
-
class
apybiomart.classes.
Query
(attributes: List[str], filters: Dict[str, Union[str, int, list, tuple, bool]], dataset: str, save: bool = False, output: str = 'apybiomart_query.csv')[source]¶ Class used to perform either synchronous or asynchronous queries on BioMart.
-
attributes
¶ list of attributes to include
-
filters
¶ dict of filter name : value to filter results
-
dataset
¶ BioMart dataset name
-