pxblat.Server(host: str, port: int, two_bit: Path | str, *, can_stop: bool = True, mask: bool = False, tile_size: int = 11, step_size: int = 11, max_aa_size: int = 8000, max_dna_hits: int = 100, max_gap: int = 2, max_nt_size: int = 40000, max_trans_hits: int = 200, min_match: int = 2, rep_match: int = 0, seq_log: bool = False, ip_log: bool = False, debug_log: bool = False, trans: bool = False, syslog: bool = False, no_simp_rep_mask: bool = False, log: str | Path | None = None, log_facility: str | None = None, per_seq_max: str | Path | None = None, index_file: str | Path | None = None, daemon=True, use_others: bool = False, timeout: int = 60, block: bool = False)[source]

Initializes a gfServer object with the given parameters.

Parameters:
host : str

The hostname or IP address to bind the server to.

port : int

The port number to bind the server to.

two_bit : Path | str

The path to the 2bit file or the URL of the 2bit file.

can_stop : bool, optional

Whether to allow the server to be stopped. Defaults to True.

mask : bool, optional

Whether to use masking from the 2bit file. Defaults to False.

tile_size : int, optional

The size of n-mers to index. Defaults to 11 for nucleotides, 4 for proteins (or translated nucleotides).

step_size : int, optional

The spacing between tiles. Defaults to tileSize.

max_aa_size : int, optional

The maximum size of protein or translated DNA queries. Defaults to 8000.

max_dna_hits : int, optional

The maximum number of hits for a DNA query that are sent from the server. Defaults to 100.

max_gap : int, optional

The number of insertions or deletions allowed between n-mers. Defaults to 2 for nucleotides, 0 for proteins.

max_nt_size : int, optional

The maximum size of untranslated DNA query sequence. Defaults to 40000.

max_trans_hits : int, optional

The maximum number of hits for a translated query that are sent from the server. Defaults to 200.

min_match : int, optional

The number of n-mer matches that trigger detailed alignment. Defaults to 2 for nucleotides, 3 for proteins.

rep_match : int, optional

The number of occurrences of a tile (n-mer) that triggers repeat masking the tile. Defaults to 0.

seq_log : bool, optional

Whether to include sequences in the log file (not logged with syslog). Defaults to False.

ip_log : bool, optional

Whether to include user’s IP in the log file (not logged with syslog). Defaults to False.

debug_log : bool, optional

Whether to include debugging info in the log file. Defaults to False.

trans : bool, optional

Whether to translate database to protein in 6 frames, and it is best to run this on RepeatMasked data. Defaults to False.

syslog : bool, optional

Whether to log to syslog. Defaults to False.

no_simp_rep_mask : bool, optional

Whether to suppress simple repeat masking. Defaults to False.

log : str | Path | None, optional

The path to the log file that records server requests. Defaults to None.

log_facility : str | None, optional

The syslog facility to log to. Defaults to None.

per_seq_max : str | Path | None, optional

The path to a file that contains one seq filename (possibly with ‘:seq’ suffix) per line. Defaults to None.

index_file : str | Path | None, optional

The path to the index file created by gfServer index. Saving index can speed up gfServer startup by two orders of magnitude. Defaults to None.

daemon : bool, optional

Whether to run the server as a daemon process. Defaults to True.

use_others : bool, optional

Whether to allow other users to access the server. Defaults to False.

timeout : int, optional

The number of seconds to wait for the server to start. Defaults to 60.

block : bool, optional

Whether to block until the server is ready. Defaults to False.

Raises:
  • ValueError – If the given two_bit file or URL is invalid.

  • OSError – If there is an error starting the server process.

Returns:

None

Examples

Create a server object with options.

>>> from pxblat import Server
>>> server = Server("localhost", 65000, "tests/data/test_ref.2bit", can_stop=True, step_size=5)
>>> server.start()
>>> server.wait_ready()
>>> server.stop()
>>> server.can_stop
True
>>> server.step_size = 10
>>> server.step_size
10