Sketch#

Database#

class pysylph.Database(items=None)#

A sketch database.

Sylph databases are simply a sequence of GenomeSketch concatenated together to be used for fast profiling or querying.

dump(path)#

Dump a database to a path.

load()#

Load a database from a file.

Parameters:

file (str, os.PathLike or file-like handle) – The path to the file containing the database, or a file-like object open in binary mode.

Example

>>> db = pysylph.Database.load("ecoli.syldb")
>>> db[0].name
'test_files/e.coli-K12.fasta.gz'

DatabaseFile#

class pysylph.DatabaseFile(path)#

A database file.

This class can be used to load GenomeSketch objects iteratively from a database file instead of loading it entirely through the Database.load class method.