rotifer.db.ncbi.ftp.GenomeFeaturesCursor#
- class rotifer.db.ncbi.ftp.GenomeFeaturesCursor(exclude_type=['source', 'gene', 'mRNA'], autopid=False, codontable='Bacterial', progress=True, tries=3, batch_size=4, threads=15, timeout=10, cache='/tmp', *args, **kwargs)[source]#
Bases:
GenomeFeaturesCursor,GenomeCursorFetch genome annotation from the NCBI FTP site as dataframes.
Genomes are downloaded like
GenomeCursordoes, then converted to feature tables with one row per annotated feature.- Parameters:
- exclude_typelist of str, default
['source', 'gene', 'mRNA'] Feature types to ignore.
- autopidbool, default False
Automatically set protein identifiers.
- codontablestr or int, default ‘Bacterial’
Codon table used when the data does not define one.
- progressbool, default True
Whether to print a progress bar.
- triesint, default 3
Number of attempts to download data.
- batch_sizeint, default 4
Number of accessions per batch.
- threadsint, default 15
Number of processes used for parallel downloads.
- timeoutint, default 10
Maximum time, in seconds, to wait for a server connection.
- cachestr, optional
Directory for temporary files. Defaults to the rotifer cache directory.
- exclude_typelist of str, default
Examples
Load the feature tables of two genomes:
>>> from rotifer.db.ncbi import ftp >>> g = ['GCA_018744545.1', 'GCA_901308185.1'] >>> gfc = ftp.GenomeFeaturesCursor() >>> df = gfc.fetchall(g)