metapang search bank¶
Match a query against a whole bank (a PanGBank collection or a local index built
with metapang index bank) to find which genomes and pangenomes it resembles. This
is the species-detection step of metapang profile exposed on its own.
Matching is done with sourmash MinHash sketches, so both the query and the index
are reduced to k-mer signatures and compared by containment or Jaccard similarity. A
bank holds two indexes, searched together: a pangenome index (one signature per
species pangenome) and a genome index (one signature per reference genome).
Synopsis¶
metapang search bank -q query.fasta.gz -p GTDB_refseq@2.0.0 [OPTIONS]
metapang search bank -q query.fasta.gz -i path/to/index [OPTIONS]
Inputs¶
The query is required, and the bank is given in exactly one of two ways.
-q,--query(required)The query file (fasta/fastq, gzipped accepted). It may be a genome or metagenomic reads. All sequences are folded into a single signature.
-p,--pangbankUse an index from
PanGBank, for exampleGTDB_refseq,GTDB_refseq@v1.0.0, orGTDB_refseq@latest. The index is downloaded and cached on first use.-i,--indexUse a local index directory (the output of
metapang index bank).
Note
Give either --pangbank or --index, not both.
Options¶
Option |
Default |
Description |
|---|---|---|
|
Search mode: |
|
|
|
Minimum score to report a match in the genome index. |
|
|
Minimum score to report a match in the pangenome index. |
|
off |
Use gather (min-set-cover) on the genome index instead of independent containment search. It deconvolves shared k-mers so only references that explain new sample k-mers are reported. |
|
|
Output file. One file per index ( |
|
Threads used to sketch the query. |
Search modes¶
The score column depends on --mode:
containmentthe fraction of the query k-mers contained in the match. Good for asking “is the query part of this reference”.
max_containmentthe larger of the two containments (query-in-match and match-in-query).
jaccardthe Jaccard index between the query and the match k-mer sets. Sensitive to size differences, so it is low when query and reference differ greatly in length.
Output¶
A TSV with the following columns:
query_namename of the query.
namename of the matched genome or pangenome.
scorescore of the match, per
--modeabove.coveragecoverage of the match, that is the containment of the match in the query.
By default two files are written, one for the pangenome index and one for the genome index, and the results are also shown as tables in the terminal.
With --gather, a single min-set-cover result is written for the genome index with
columns name, f_query (fraction of the query explained by this reference),
f_match, and cum_f_query (cumulative fraction of the query explained).
Examples¶
# search a genome against a PanGBank collection, by containment
metapang search bank -q genome.fasta.gz -p GTDB_refseq@2.0.0 -m containment
# detect species in reads with min-set-cover on the genome index
metapang search bank -q reads.fastq.gz -p GTDB_refseq@2.0.0 --gather -t 8
# search a locally built index and raise the genome threshold
metapang search bank -q genome.fasta.gz -i ./my_index -tg 0.7