How to pass variable filename to python ete? -


i trying load newick string file using following code:

filename = templist[1].lower().replace(" ","") + ".nwk" tt = tree(filename, format=1) 

but getting following error:

 tt = tree(filename, format=1) # loads tree structure newick string. returned variable tt root node tree.   file "/python2.7/dist-packages/ete2-2.2.1072-py2.7.egg/ete2/coretype/tree.py", line 225, in __init__     read_newick(newick, root_node = self, format=format)   file "/python2.7/dist-packages/ete2-2.2.1072-py2.7.egg/ete2/parser/newick.py", line 237, in read_newick     'unexisting tree file or malformed newick tree structure.' ete2.parser.newick.newickerror: unexisting tree file or malformed newick tree structure. 

i have verified file format, , ok. think passing variable in wrong way, can please guide me pass filename variable.

when pass filename string without using variable working fine, need use variable value load tree.

are sure format=1 correct?

according documentation -

for named internal nodes use format 1

are sure newick tree has named internal nodes? if not, try without passing value format argument.


also, please make sure filename either absolute path file, or if relative path , example a.nwk , make sure file exists in directory running python script.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -