fastqe / biomojify

Convert bioinformatics files to an emoji format.
BSD 3-Clause "New" or "Revised" License
15 stars 3 forks source link

Add phylogeny #20

Open lonsbio opened 4 years ago

lonsbio commented 4 years ago

Need a scheme to translate names to emojjy, but with a suitable phylogeny framework in Python should be straight forward from there onwards

e.g. using ete3

from ete3 import Tree
import pyemojify
t = Tree("((Human,Gorilla),(Mouse,Rat));")
test_emoji = [":man:",":monkey:",":mouse:",":rat:"]
for c, leaf in enumerate(t):
  leaf.name = test_emoji[c]
  leaf.name = pyemojify.emojify(leaf.name)
print( t.get_tree_root())

will give


      /-👨
   /-|
  |   \-🐒
--|
  |   /-🐭
   \-|
      \-🐀
lonsbio commented 4 years ago

As with the main code, actual emoji can be used instead of the pyemojify ":emoji:" format to break the limited number of emoji available.

lonsbio commented 4 years ago

This paper and this repo serve as a guide for a complete example to be implemented: