Hello:
I just installed ete3 on a Linux cluster. I give the following commands:
(base) $ conda activate ete3
(ete3) $ python ete3_example.py
And I get a syntax error:
File "ete3_example.py", line 8
print t.write() # (A:1.000000,(B:1.000000,(E:1.000000,D:1.000000)1.000000:0.500000)1.000000:0.500000);
^
SyntaxError: invalid syntax
ete3_example.py is a script copied from the ete3 tutorial. (See below.)
I thought that ete3 is a python library?
If not, how do I run ete3 scripts?
Can I integrate ete3 functions into a python script?
Thank you very much for your help.
Tanya
ete3_example.py
from ete3 import Tree
# Loads a tree with internal node names
t = Tree("(A:1,(B:1,(E:1,D:1)Internal_1:0.5)Internal_2:0.5)Root;", format=1)
# And prints its newick using the default format
print t.write() # (A:1.000000,(B:1.000000,(E:1.000000,D:1.000000)1.000000:0.500000)1.000000:0.500000);
# To print the internal node names you need to change the format:
print t.write(format=1) # (A:1.000000,(B:1.000000,(E:1.000000,D:1.000000)Internal_1:0.500000)Internal_2:0.500000);
# We can also write into a file
t.write(format=1, outfile="new_tree.nw")