From f20d4c91b09c1fc7c461fe869aad3ea0d810110a Mon Sep 17 00:00:00 2001 From: rdenise Date: Tue, 30 Jul 2024 11:45:26 +0100 Subject: [PATCH] :bug: Modification to apply the blast command modified to all similarity module --- taxmyphage/actions.py | 1 + taxmyphage/pmv.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/taxmyphage/actions.py b/taxmyphage/actions.py index 367ebb4..2a8dee1 100644 --- a/taxmyphage/actions.py +++ b/taxmyphage/actions.py @@ -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() diff --git a/taxmyphage/pmv.py b/taxmyphage/pmv.py index c8d6db7..cc8435a 100755 --- a/taxmyphage/pmv.py +++ b/taxmyphage/pmv.py @@ -40,6 +40,7 @@ def __init__( blastn_exe: str = "blastn", makeblastdb_exe: str = "makeblastdb", output_dir: str = "", + similarity_module: bool = False, ): """ Args: @@ -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 @@ -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() @@ -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} '