Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Skbio with Tree
#1
Hi all,

I am new to this forum as well as python, and would be grateful for any help. I am working with a tree for my analyses and it does not seem to be in Newick format. I am not sure if this could be the reason for the error. I have run the 1st 2 commands below without any problems:

tree_dir = abspath('/home/allio/Documents/Zach_Master/Q2-all-gut-skin-oral/trees/')
host_tree_fp = 'MamPhy_fullPosterior_BDvr_Completed_5911sp_topoCons_NDexp_MCC_v2_target.tre'
However, when I run the command below:
host_tree = sk.TreeNode.read(join(tree_dir, host_tree_fp), convert_underscores=False)
I receive the error message:
Error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/allio/bin/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/skbio/io/registry.py", line 652, in read return registry.read(file, into=cls, format=format, **kwargs) File "/home/allio/bin/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/skbio/io/registry.py", line 513, in read return self._read_ret(file, format, into, verify, kwargs) File "/home/allio/bin/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/skbio/io/registry.py", line 519, in _read_ret io_kwargs) File "/home/allio/bin/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/skbio/io/registry.py", line 539, in _init_reader fmt, skwargs = self.sniff(file, **io_kwargs) File "/home/allio/bin/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/skbio/io/registry.py", line 431, in sniff % file) skbio.io._exception.UnrecognizedFormatError: Could not detect the format of <_io.BufferedReader name='/home/allio/Documents/Zach_Master/Q2-all-gut-skin-oral/trees/MamPhy_fullPosterior_BDvr_Completed_5911sp_topoCons_NDexp_MCC_v2_target.tre'>
Why is this occurring, and what are the possible solutions to this? Cheers!
Reply
#2
it looks MamPhy_fullPosterior_BDvr_Completed_5911sp_topoCons_NDexp_MCC_v2_target.tre is not in format recognozed by scikit-bio
And it's good to mention what packages you use / show full code, incl. the imports, etc. (minimal reproducible example)
supported file formats:
http://scikit-bio.org/docs/latest/io.htm...e-skbio.io
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020