Database#

class biotite.application_v2.mmseqs.Database(app: T, path: PathLike[str] | str | None = None, suffix: str = '')[source]#

Bases: Generic[T]

A database produced by MMseqs2 or Foldseek.

A database is represented by a directory containing exactly one database prefix. If no path is given, the directory is temporary and is removed when this object is discarded. Use copy() or move() to make it persistent.

Parameters:
appLocalApp

The application the database is compatible with.

pathpath-like, optional

The database directory. By default, a temporary directory is created.

suffixstr, optional

A suffix appended to the database prefix.

Attributes:
pathPath

The database directory.

namePath

The complete database prefix passed to the command line program.

copy(destination: PathLike[str] | str, force: bool = False) → Self#

Copy the database into a persistent directory.

Parameters:
destinationpath-like

The destination directory.

forcebool, optional

If true, replace a non-empty destination.

Returns:
databaseDatabase

A persistent copy with the same concrete type and metadata.

is_compatible_with(app: MMseqsLikeApp) → TypeGuard[T]#

Check whether the database can be used by the given application.

Parameters:
appMMseqsApp or FoldseekApp

The application to check.

Returns:
compatiblebool

True if the database and application have the same concrete type.

move(destination: PathLike[str] | str, force: bool = False) → None#

Move the database into a persistent directory.

Parameters:
destinationpath-like

The destination directory.

forcebool, optional

If true, replace a non-empty destination.

set_parent(parent: Database[T]) → None#

Keep the owner of this database’s directory alive.

Some databases are views of files in another database’s directory. If that directory is temporary, retaining its owner prevents premature deletion while the view is still in use.

Parameters:
parentDatabase

The database that owns the shared directory.