Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding read.treeqza to parse tree qza file from output of qiime2 #46

Merged
merged 4 commits into from Mar 1, 2021

Conversation

xiangpin
Copy link
Member

Description

Adding read.treeqza to parse tree file from output of qiime2 in phylogenetic inference step.
The tree file format is always newick format, but it is compressed as .qza file.

Related Issue

  • unzip the file to temporary folder.
  • checking whether the file contained .qza file is a newick format file.
  • parse the file with read.newick.

Example


> library(treeio)
>
> qzafile3 <- system.file("extdata/qiime2treeqza", "raxml-cat-tree.qza", package="treeio")
>
> qzafile4 <- system.file("extdata/qiime2treeqza", "raxml-cat-bootstrap-tree.qza", package="treeio")
># parse node.label = 'label'
> tr3 <- read.treeqza(qzafile3)
> tr3

Phylogenetic tree with 20 tips and 18 internal nodes.

Tip labels:
  ed1acad8a98e8579a44370733533ad7d3fed8006, 9b220cae8d375ea38b8b481cb95949cda8722fcb, 5aba6bd9debc23ded7041ffdcfe5d68a427e8ce8, 2e3b2c075901640c4de739473f9246385430b1ed, 682e91d7e510ab134d0625234ad224f647c14eb0, d44b129a6181f052198bda3813f0802a91612441, ...

Rooted; includes branch lengths.

># parse node.label = 'support'
> tr4 <- read.treeqza(qzafile4, node.label="support")
> tr4
'treedata' S4 object'.

...@ phylo:
Phylogenetic tree with 20 tips and 18 internal nodes.

Tip labels:
  d44b129a6181f052198bda3813f0802a91612441, aa4698d2e2b1fa71d08e2934a923aad7374a18f6, 6a36152105590b1eb095b9503e8f1f226fc73e43, 418f1d469f08c99976b313028cf6d3f18f61dd55, 9b220cae8d375ea38b8b481cb95949cda8722fcb, 5aba6bd9debc23ded7041ffdcfe5d68a427e8ce8, ...

Unrooted; includes branch lengths.

with the following features available:
        'support'.

@GuangchuangYu
Copy link
Member

it seems all the tip labels were encoded as uuid. Any idea?

@xiangpin
Copy link
Member Author

xiangpin commented Mar 1, 2021

Yes, qiime2 assigns version 4 universally unique identifiers (UUIDs) to each execution of an Action, and to all Results. It seems not be converted to other encoded format.

@GuangchuangYu
Copy link
Member

any possibility to convert them back to human readable labels?

@xiangpin
Copy link
Member Author

xiangpin commented Mar 1, 2021

I did't find the method to solve the problem. And I found the empress also did not parse the tip labels to human readable labels.

@GuangchuangYu GuangchuangYu merged commit 0ed7a8d into YuLab-SMU:master Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants