napistu.ontologies.mirbase
Functions
|
Read miRBase cross-reference data from an HTML page. |
Load miRBase cross-reference data by combining mature database and links tables. |
- napistu.ontologies.mirbase.load_mirbase_table(table_type: str, table_defs: Dict = {'mature_database_links': {'header': ['rna_id', 'database_entry', 'primary_id', 'secondary_id'], 'url': 'https://mirbase.org/download/CURRENT/database_files/mature_database_links.txt'}, 'mature_database_url': {'header': ['database_entry', 'database', 'url_template', 'unknown'], 'url': 'https://mirbase.org/download/CURRENT/database_files/mature_database_url.txt'}}, timeout: int | None = 30) DataFrame
Read miRBase cross-reference data from an HTML page.
This function parses HTML content that contains miRBase cross-reference data stored in paragraph tags with <br> separators, converting it to a pandas DataFrame.
- Parameters:
table_type (str) – The type of miRBase table to load (e.g., ‘mature_database_url’, ‘mature_database_links’).
table_defs (Dict, optional) – Dictionary containing table definitions with URLs and headers, by default MIRBASE_TABLE_SPECS.
timeout (int, optional) – Timeout in seconds for the HTTP request, by default 30.
- Returns:
DataFrame containing the parsed miRBase cross-reference data. Each row represents one cross-reference entry.
- Return type:
pd.DataFrame
- Raises:
ValueError – If the table_type is invalid or no data is found in the HTML.
ConnectionError – If unable to connect to the URL or HTTP request fails.
Examples
>>> df = load_mirbase_table("mature_database_url") >>> print(df.shape) (1000, 4) >>> print(df.head())
- napistu.ontologies.mirbase.load_mirbase_xrefs() DataFrame
Load miRBase cross-reference data by combining mature database and links tables.
This function loads the miRBase mature database and links tables, then merges them to create a comprehensive cross-reference dataset.
- Returns:
DataFrame containing merged miRBase cross-reference data with database information and links.
- Return type:
pd.DataFrame
- Raises:
ValueError – If table loading fails or merge operation fails
ConnectionError – If unable to connect to miRBase URLs