rotifer.db.sql.sqlite3.IPGCursor#

class rotifer.db.sql.sqlite3.IPGCursor(path, replace=False, identical='c100', identical_column='c100i100', *args, **kwargs)[source]#

Bases: SequenceCursor, BaseSQLite3Cursor

Fetch identical protein group (IPG) reports from a local SQLite3 database.

Depending on identical, results are built either from a precomputed non-redundant clustering table (nr) or directly from the features table.

Parameters:
pathstr

Path to a local SQLite3 database.

replacebool, default False

If True, overwrite the database file.

identicalstr or None, default ‘c100’

Name of the clustering column used to group identical proteins. If None, IPGs are derived from features alone.

identical_columnstr, default ‘c100i100’

Column added to the report identifying the cluster representative.

See also

rotifer.db.sql.sqlite3.GeneNeighborhoodCursor

gene neighborhood cursor

rotifer.db.ncbi.entrez.IPGCursor

equivalent cursor backed by NCBI Entrez

Examples

>>> from rotifer.db.sql import sqlite3 as rdss
>>> ic = rdss.IPGCursor("genomes.sqlite3")
>>> df = ic.fetchall("YP_009724395.1")
__getitem__(accessions)[source]#

Fetch identical protein group reports, dictionary style.

Parameters:
accessionsstr or iterable of str

Database identifiers.

Returns:
pandas.DataFrame

Columns as listed in self._columns plus self._added_columns. Empty if the SQL file for the selected identical mode could not be found.

fetchall(accessions)[source]#

Fetch identical protein group reports for all accessions at once.

Parameters:
accessionsstr or iterable of str

Database identifiers.

Returns:
pandas.DataFrame