Skip to content

Commit

Permalink
🐛 Modification to apply the blast command modified to all similarity …
Browse files Browse the repository at this point in the history
…module
  • Loading branch information
rdenise committed Jul 30, 2024
1 parent 92dcae1 commit f20d4c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions taxmyphage/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def clustering_on_genomic_similarity(args: Namespace, threads: int, verbose: boo
verbose=verbose,
blastn_exe=args.blastn,
makeblastdb_exe=args.makeblastdb,
similarity_module=True,
)

dfT, pmv_outfile = pmv.run()
Expand Down
6 changes: 4 additions & 2 deletions taxmyphage/pmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(
blastn_exe: str = "blastn",
makeblastdb_exe: str = "makeblastdb",
output_dir: str = "",
similarity_module: bool = False,
):
"""
Args:
Expand All @@ -53,6 +54,7 @@ def __init__(
blastn_exe (str, optional): Path to the blastn executable. Defaults to "blastn".
makeblastdb_exe (str, optional): Path to the makeblastdb executable. Defaults to "makeblastdb".
output_dir (str, optional): Path to the output directory. Defaults to "".
similarity_module (bool, optional): Whether to use the similarity module. Defaults to False.
Returns:
None
Expand All @@ -72,7 +74,7 @@ def __init__(
self.dfT = pd.DataFrame()
self.db_blast = reference
self.blastn_result_file = ''
self.similarity_identical = file == reference
self.similarity_module = similarity_module

self.existing_files()

Expand Down Expand Up @@ -202,7 +204,7 @@ def blastn(self):
self.result_dir, os.path.basename(self.file) + ".blastn_vs2_self.tab.gz"
)
if not os.path.exists(outfile):
if self.similarity_identical:
if self.similarity_module:
cmd = (
f'{self.blastn_exe} -evalue 1 -max_target_seqs 10000 -num_threads {self.nthreads} '
f'-word_size 7 -reward 2 -penalty -3 -gapopen 5 -gapextend 2 -query {self.file} '
Expand Down

0 comments on commit f20d4c9

Please sign in to comment.