CLI Usage

1. CLIs Overview

cli

CLI

Usage

server

Make a server to quickly find where DNA occurs in genome

client

A client for the genomic finding program that produces a .psl file

fatotwobit

Convert fasta to 2bit format

twobittofa

Convert 2bit to fasta format

We can get completion for current shell via pxblat --install-completion. The help message is got from

$ pxblat -h

Usage: pxblat [OPTIONS] COMMAND [ARGS]...

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion            Install completion for the current shell.                                                                                                                                                                                                    │
│ --show-completion               Show completion for the current shell, to copy it or customize the installation.                                                                                                                                                             │
│ --help                -h        Show this message and exit.                                                                                                                                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ client                                 A client for the genomic finding program that produces a .psl file                                                                                                                                                                    │
│ fatotwobit                             Convert DNA from fasta to 2bit format                                                                                                                                                                                                 │
│ server                                 Make a server to quickly find where DNA occurs in genome                                                                                                                                                                              │
│ twobittofa                             Convert all or part of .2bit file to fasta                                                                                                                                                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

 YangyangLi 2023 yangyang.li@northwstern.edu

1.1 Server

$ pxblat server -h

Usage: pxblat server [OPTIONS] COMMAND [ARGS]...

 Make a server to quickly find where DNA occurs in genome

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help  -h        Show this message and exit.                                                                                                                                                                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ files                    To get input file list                                                                                                                                                                                                                              │
│ start                    To set up a server                                                                                                                                                                                                                                  │
│ status                   To figure out if server is alive, on static instances get usage statics                                                                                                                                                                             │
│ stop                     To remove a server                                                                                                                                                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Start a server

$ pxblat server start localhost 650000 twobit.2bit
$ pxblat server start -h

 Usage: pxblat server start [OPTIONS] HOST PORT TWO_BIT

 To set up a server.
 gfServer start host port file(s)
 where the files are .2bit or .nib format files specified relative to the current directory

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    host         TEXT     [default: None] [required]                                                                                                         │
│ *    port         INTEGER  [default: None] [required]                                                                                                         │
│ *    two_bit      FILE     Two bit file [default: None] [required]                                                                                            │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --tile-size              INTEGER  Size of n-mers to index.  Default is 11 for nucleotides, 4 for proteins (or translated nucleotides). [default: 11]          │
│ --stepSize               INTEGER  Spacing between tiles. Default is tileSize. [default: 11]                                                                   │
│ --min-match              INTEGER  Number of n-mer matches that trigger detailed alignment. Default is 2 for nucleotides, 3 for proteins. [default: 2]         │
│ --trans                           Translate database to protein in 6 frames.                                                                                  │
│ --log                    TEXT     Keep a log file that records server requests. [default: None]                                                               │
│ --mask                            Use masking from .2bit file.                                                                                                │
│ --repMatch               INTEGER  Number of occurrences of a tile (n-mer) that triggers repeat masking the tile. Default is 1024. [default: 0]                │
│ --noSimpRepMask                   Suppresses simple repeat masking.                                                                                           │
│ --maxDnaHits             INTEGER  Maximum number of hits for a DNA query that are sent from the server. [default: 100]                                        │
│ --maxTransHits           INTEGER  Maximum number of hits for a translated query that are sent from the server. [default: 200]                                 │
│ --maxNtSize              INTEGER  Maximum size of untranslated DNA query sequence. [default: 40000]                                                           │
│ --perSeqMax              FILE     File contains one seq filename (possibly with ':seq' suffix) per line. [default: None]                                      │
│ --canStop                         If set, a quit message will actually take down the server.                                                                  │
│ --indexFile              FILE     Index file create by gfServer index. [default: None]                                                                      │
│ --timeout                INTEGER  Timeout in seconds. [default: 90]                                                                                           │
│ --help           -h               Show this message and exit.                                                                                                 │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Get files of a running server

$ pxblat server files localhost 650000
$ pxblat server files -h

 Usage: pxblat server files [OPTIONS] HOST PORT

 To get input file list.

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    host      TEXT     [default: None] [required]                                                                                                            │
│ *    port      INTEGER  [default: None] [required]                                                                                                            │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help  -h        Show this message and exit.                                                                                                                 │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Get status of a running server

$ pxblat server status localhost 650000
$ pxblat server status -h

 Usage: pxblat server status [OPTIONS] HOST PORT

 To figure out if server is alive, on static instances get usage statics.

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    host      TEXT     [default: None] [required]                                                                                                            │
│ *    port      INTEGER  [default: None] [required]                                                                                                            │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --trans            Translate database to protein in 6 frames.                                                                                                 │
│ --help   -h        Show this message and exit.                                                                                                                │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Stop a running server

$ pxblat server stop localhost 650000
$ pxblat server stop -h

 Usage: pxblat server stop [OPTIONS] HOST PORT

 To remove a server.

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    host      TEXT     [default: None] [required]                                                                                                            │
│ *    port      INTEGER  [default: None] [required]                                                                                                            │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help  -h        Show this message and exit.                                                                                                                 │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

1.2 Client

$ pxblat client localhost 65000 twobit_dir fasta1.fa out.psl
$ pxblat client -h

 Usage: pxblat client [OPTIONS] HOST PORT SEQDIR INFASTA OUTPSL

 A client for the genomic finding program that produces a .psl file.

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    host         TEXT     The name of the machine running the gfServer [default: None] [required]                                        │
│ *    port         INTEGER  The same port that you started the gfServer with [default: None] [required]                                    │
│ *    seqdir       PATH     The path of the .2bit or .nib files relative to the current dir [default: None] [required]                     │
│ *    infasta      PATH     Fasta format file.  May contain multiple records [default: None] [required]                                    │
│ *    outpsl       PATH     where to put the output [default: None] [required]                                                             │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --type           -t      TEXT     Database type. Type is one of: dna, prot, dnax [default: dna]                                           │
│ --qtype          -q      TEXT     Query type. Type is one of: dna, rna, prot, dnax, rnax [default: dna]                                   │
│ --prot                            Synonymous with -t=prot -q=prot.                                                                        │
│ --dots                   INTEGER  Output a dot every N query sequences. [default: 0]                                                      │
│ --nohead                          Suppresses 5-line psl header.                                                                           │
│ --minScore               INTEGER  Sets minimum score.  This is twice the matches minus the mismatches minus some sort of gap penalty.     │
│                                   Default is 30.                                                                                          │
│                                   [default: 30]                                                                                           │
│ --minIdentity            INTEGER  Sets minimum sequence identity (in percent).  Default is 90 for nucleotide searches, 25 for protein or  │
│                                   translated protein searches.                                                                            │
│                                   [default: 90.0]                                                                                         │
│ --out                    TEXT     Controls output file format.  Type is one of: psl, pslx, axt, maf, sim4, wublast, blast, blast8, blast9 │
│                                   [default: psl]                                                                                          │
│ --maxIntron              INTEGER  Sets maximum intron size. Default is 750000. [default: 750000]                                          │
│ --genome                 TEXT     dynamic                                                                                                 │
│ --genomeDataDir          TEXT     dynamic                                                                                                 │
│ --help           -h               Show this message and exit.                                                                             │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

1.3 fatotwobit

$ pxblat fatotwobit in.fa out.2bit
$ pxblat fatotwobit -h

 Usage: pxblat fatotwobit [OPTIONS] in.fa [inf2.fa in3.fa ...] out.2bit

 Convert DNA from fasta to 2bit format.

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    infa         in.fa [inf2.fa in3.fa ...]  The fasta files [required]                                                                  │
│ *    out2bit      out.2bit                    The output file [required]                                                                  │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --long                    Use 64-bit offsets for index. Allow for twoBit to contain more than 4Gb of sequence.                            │
│ --nomask                  Ignore lower-case masking in fa file.                                                                           │
│ --stripVersion            Strip off version number after '.' for GenBank accessions.                                                      │
│ --ignoreDups              Convert first sequence only if there are duplicate sequence names. Use 'twoBitDup' to find duplicate sequences. │
│ --help          -h        Show this message and exit.                                                                                     │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

1.4 twobittofa

$ pxblat twobittofa input.2bit out.fa
$ pxblat twobittofa -h

 Usage: pxblat twobittofa [OPTIONS] input.2bit out.fa

 Convert all or part of .2bit file to fasta.

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    input2bit      input.2bit  The input 2bit file [default: None] [required]                                                            │
│ *    outputfa       out.fa      The output fasta file [required]                                                                          │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --seq              TEXT     Restrict this to just one sequence.                                                                           │
│ --start            INTEGER  Start at given position in sequence (zero-based). [default: 0]                                                │
│ --end              INTEGER  End at given position in sequence (non-inclusive). [default: 0]                                               │
│ --seqList          TEXT     File containing list of the desired sequence names                                                            │
│ --noMask                    Convert sequence to all upper case.                                                                           │
│ --bpt              TEXT     Use bpt index instead of built-in one.                                                                        │
│ --bed              TEXT     Grab sequences specified by input.bed.                                                                        │
│ --bedPos                    With -bed, use chrom:start-end as the fasta ID in output.fa.                                                  │
│ --udcDir           TEXT     Place to put cache for remote bigBed/bigWigs.                                                                 │
│ --help     -h               Show this message and exit.                                                                                   │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

2. Reference

pxblat

Version: 1.2.8

Usage

pxblat [OPTIONS] COMMAND [ARGS]...

Options

--install-completion

Install completion for the current shell.

--show-completion

Show completion for the current shell, to copy it or customize the installation.

YangyangLi 2026 yangyang.li@northwstern.edu

client

A client for the genomic finding program that produces a .psl file.

Usage

pxblat client [OPTIONS] HOST PORT SEQDIR INFASTA OUTPSL

Options

-t, --type <tType>

Database type. Type is one of: dna, prot, dnax

Default:

'dna'

-q, --qtype <qType>

Query type. Type is one of: dna, rna, prot, dnax, rnax

Default:

'dna'

--prot

Synonymous with -t=prot -q=prot.

Default:

False

--dots <dots>

Output a dot every N query sequences.

Default:

0

--nohead

Suppresses 5-line psl header.

Default:

False

--minScore <minnScore>

Sets minimum score. This is twice the matches minus the mismatches minus some sort of gap penalty. Default is 30.

Default:

30

--minIdentity <minIdentity>

Sets minimum sequence identity (in percent). Default is 90 for nucleotide searches, 25 for protein or translated protein searches.

Default:

90.0

--out <out>

Controls output file format. Type is one of: psl, pslx, axt, maf, sim4, wublast, blast, blast8, blast9

Default:

'psl'

--maxIntron <maxIntron>

Sets maximum intron size. Default is 750000.

Default:

750000

--genome <genome>

dynamic

Default:

''

--genomeDataDir <genomeDataDir>

dynamic

Default:

''

Arguments

HOST

Required argument

The name of the machine running the gfServer

PORT

Required argument

The same port that you started the gfServer with

SEQDIR

Required argument

The path of the .2bit or .nib files relative to the current dir

INFASTA

Required argument

Fasta format file. May contain multiple records

OUTPSL

Required argument

where to put the output

fatotwobit

Convert DNA from fasta to 2bit format.

Usage

pxblat fatotwobit [OPTIONS] in.fa [inf2.fa in3.fa ...] out.2bit

Options

--long

Use 64-bit offsets for index. Allow for twoBit to contain more than 4Gb of sequence.

Default:

False

--nomask

Ignore lower-case masking in fa file.

Default:

False

--stripVersion

Strip off version number after ‘.’ for GenBank accessions.

Default:

False

--ignoreDups

Convert first sequence only if there are duplicate sequence names. Use ‘twoBitDup’ to find duplicate sequences.

Default:

False

Arguments

in.fa [inf2.fa in3.fa ...]

Required argument(s)

The fasta files

out.2bit

Required argument

The output file

server

Make a server to quickly find where DNA occurs in genome

Usage

pxblat server [OPTIONS] COMMAND [ARGS]...
files

To get input file list.

Usage

pxblat server files [OPTIONS] HOST PORT

Arguments

HOST

Required argument

PORT

Required argument

start

To set up a server.

gfServer start host port file(s)

where the files are .2bit or .nib format files specified relative to the current directory

Usage

pxblat server start [OPTIONS] HOST PORT TWO_BIT

Options

--tile-size <tileSize>

Size of n-mers to index. Default is 11 for nucleotides, 4 for proteins (or translated nucleotides).

Default:

11

--stepSize <stepSize>

Spacing between tiles. Default is tileSize.

Default:

11

--min-match <minMatch>

Number of n-mer matches that trigger detailed alignment. Default is 2 for nucleotides, 3 for proteins.

Default:

2

--trans

Translate database to protein in 6 frames.

Default:

False

--log <log>

Keep a log file that records server requests.

--mask

Use masking from .2bit file.

Default:

False

--repMatch <repMatch>

Number of occurrences of a tile (n-mer) that triggers repeat masking the tile. Default is 1024.

Default:

0

--noSimpRepMask

Suppresses simple repeat masking.

Default:

False

--maxDnaHits <maxDnaHits>

Maximum number of hits for a DNA query that are sent from the server.

Default:

100

--maxTransHits <maxTransHits>

Maximum number of hits for a translated query that are sent from the server.

Default:

200

--maxNtSize <maxNtSize>

Maximum size of untranslated DNA query sequence.

Default:

40000

--perSeqMax <perSeqMax>

File contains one seq filename (possibly with ‘:seq’ suffix) per line.

--canStop

If set, a quit message will actually take down the server.

Default:

False

--indexFile <indexFile>

Index file create by `gfServer index’.

--timeout <timeout>

Timeout in seconds.

Default:

90

Arguments

HOST

Required argument

PORT

Required argument

TWO_BIT

Required argument

Two bit file

status

To figure out if server is alive, on static instances get usage statics.

Usage

pxblat server status [OPTIONS] HOST PORT

Options

--trans

Translate database to protein in 6 frames.

Default:

False

Arguments

HOST

Required argument

PORT

Required argument

stop

To remove a server.

Usage

pxblat server stop [OPTIONS] HOST PORT

Arguments

HOST

Required argument

PORT

Required argument

twobittofa

Convert all or part of .2bit file to fasta.

Usage

pxblat twobittofa [OPTIONS] input.2bit out.fa

Options

--seq <seq>

Restrict this to just one sequence.

Default:

''

--start <start>

Start at given position in sequence (zero-based).

Default:

0

--end <end>

End at given position in sequence (non-inclusive).

Default:

0

--seqList <seqList>

File containing list of the desired sequence names

Default:

''

--noMask

Convert sequence to all upper case.

Default:

False

--bpt <bpt>

Use bpt index instead of built-in one.

Default:

''

--bed <bed>

Grab sequences specified by input.bed.

Default:

''

--bedPos

With -bed, use chrom:start-end as the fasta ID in output.fa.

Default:

False

--udcDir <udcDir>

Place to put cache for remote bigBed/bigWigs.

Default:

''

Arguments

input.2bit

Required argument

The input 2bit file

out.fa

Required argument

The output fasta file