Skip to content

Commit 3dd8aeb

Browse files
committed
add modelname and outdir to ft2 treebuilder
1 parent cf037b6 commit 3dd8aeb

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

foldtree2/ft2treebuilder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def __init__ ( self , model , decoder_model = None, mafftmat = None , submat = N
3333
self.replace_dict_ord = { ord(k):ord(v) for k,v in self.replace_dict.items() }
3434
self.raxml_path = raxml_path
3535
self.raxmlng_path = raxml_path
36+
self.modelname = model.split('/')[-1].split('.')[0]
3637
if charmaps is None:
3738
self.rev_replace_dict_ord = { ord(v):ord(k) for k,v in self.replace_dict.items() }
3839
self.raxml_path = raxml_path
@@ -453,8 +454,9 @@ def decoder_reconstruction( self, ords , verbose = False):
453454

454455
def structs2tree(self, structs , outdir = None , ancestral = False , raxml_iterations = 20 , raxml_path = None , output_prefix = None , verbose = False , **kwargs ):
455456
#encode the structures
456-
457-
outfasta = os.path.join(outdir, 'encoded.fasta')
457+
if outdir is None:
458+
outdir = output_prefix
459+
outfasta = os.path.join(outdir, self.modelname + 'encoded.fasta')
458460
encoded_fasta = self.encode_structblob( blob=structs , outfile = outfasta )
459461
#replace special characters
460462
#encoded_fasta = self.replace_sp_chars( encoded_fasta=encoded_fasta , outfile = outfasta , verbose = verbose)

foldtree2/notebooks/benchmarks/alphabet_Information_content_benchmark.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4091,7 +4091,7 @@
40914091
"output_type": "stream",
40924092
"text": [
40934093
"\n",
4094-
" Family: 1067341\n"
4094+
" Family: 1372175\n"
40954095
]
40964096
}
40974097
],

0 commit comments

Comments
 (0)