Skip to content

Commit

Permalink
Passing hitlist_size to cblaster search local mode
Browse files Browse the repository at this point in the history
  • Loading branch information
brymerr921 committed Apr 25, 2022
1 parent 241894d commit 1c16caa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cblaster/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def diamond(
max_evalue=0.01,
min_identity=30,
min_coverage=50,
hitlist_size=5000,
cpus=None,
sensitivity='fast',
):
Expand All @@ -56,6 +57,7 @@ def diamond(
max_evalue (float): Maximum e-value threshold
min_identity (float): Minimum identity (%) cutoff
min_coverage (float): Minimum coverage (%) cutoff
hitlist_size (int): Maximum number of hits to save
cpus (int): Number of CPU threads for DIAMOND to use
Returns:
list: Rows from DIAMOND search result table (split by newline)
Expand Down Expand Up @@ -86,6 +88,7 @@ def diamond(
"--threads": str(cpus),
"--query-cover": str(min_coverage),
"--max-hsps": "1",
"--max-target-seqs": str(hitlist_size),
}

if sensitivity != "fast":
Expand Down Expand Up @@ -122,6 +125,7 @@ def search(
min_identity=30,
min_coverage=50,
max_evalue=0.01,
hitlist_size=5000,
**kwargs,
):
"""Launch a new BLAST search using either DIAMOND or command-line BLASTp (remote).
Expand All @@ -141,9 +145,11 @@ def search(
table = diamond(
query_file,
database,
sensitivity=dmnd_sensitivity,
min_identity=min_identity,
min_coverage=min_coverage,
max_evalue=max_evalue,
hitlist_size=hitlist_size,
**kwargs
)
else:
Expand All @@ -164,6 +170,7 @@ def search(
min_identity=min_identity,
min_coverage=min_coverage,
max_evalue=max_evalue,
hitlist_size=hitlist_size,
**kwargs
)
finally:
Expand Down
1 change: 1 addition & 0 deletions cblaster/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ def cblaster(
blast_file=blast_file,
cpus=cpus,
dmnd_sensitivity=dmnd_sensitivity,
hitlist_size=hitlist_size,
)
LOG.info(
"Found %i hits meeting score thresholds for local search", len(results)
Expand Down
2 changes: 1 addition & 1 deletion cblaster/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def add_searching_group(search):
"--hitlist_size",
type=int,
default=5000,
help="Maximum total hits to save from a remote BLAST search (def. 5000). Setting"
help="Maximum total hits to save from a local or remote BLAST search (def. 5000). Setting"
" this value too low may result in missed hits/clusters."
)
group.add_argument(
Expand Down

0 comments on commit 1c16caa

Please sign in to comment.