Empress: shear features without associated feature metadata?

I made a SEPP insertion tree which includes reference dataframe sequences in addition to the rep-seqs taxa from my study. Is there a way to shear off the taxa from the tree that aren't in my rep-seqs (i.e. don't have associated feature metadata)? In the 'Shear Tree' menu you can only select metadata to exclude, but I don't see an 'include only' options. Any advice is appreciated!

1 Like

Hey Lisa!

I think the --p-shear-to-feature-metadata flag of qiime empress tree-plot should do the trick. This flag will shear the tree before creating the visualization, so it'll work independently of the "Shear Tree" menu -- your tree will just load in the browser, already sheared just to the tips that are present in the feature metadata.

A complication is that this particular option (shearing to the feature metadata) is only available through tree-plot, not community-plot. If you need to use community-plot (i.e. you have a feature table / sample metadata you want to include), I don't think there will be an easy out-of-the-box solution: you would probably need to shear the tree using scikit-bio or something, save this tree to a new file, and then rerun EMPress using it.

Let me know how if this helps!

1 Like

Hi @fedarko and @lisa5,

You could maybe try the filter-tree function in q2-phylogeny, which will sheer the tree based on feature metadata you pass in. (If Im not reading the question totally incorrectly). Its not on-the-fly like empress, and will make you a permanently sheered tree, but it might play better with your community plots?



Oh cool, I didn't know that existed! Yeah, using qiime phylogeny filter-tree should work perfectly (as a replacement for the following sentence). Thanks for the heads-up @jwdebelius!


Sometimes, when you want something, its easier to just convince people to let you add it than argue with a cobbled together pipeline :woman_shrugging:

1 Like

Fantastic - both methods totally worked. Thank you so much!!!


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.