├── .cache └── v │ └── cache │ └── lastfailed ├── .coverage ├── .github └── workflows │ ├── deploy.yml │ └── python-publish.yml ├── .gitignore ├── LICENSE ├── MANIFEST.in ├── README.md ├── docs ├── Makefile ├── documentations.md ├── make.bat ├── post_process_html.py └── source │ ├── _static │ ├── alabaster.css │ ├── basic.css │ ├── custom.css │ ├── doctools.js │ ├── documentation_options.js │ ├── file.png │ ├── language_data.js │ ├── minus.png │ ├── plus.png │ ├── pygments.css │ ├── searchtools.js │ └── sphinx_highlight.js │ ├── conf.py │ ├── documentations.md2~ │ ├── documentations.md~ │ ├── documentations.rst │ └── index.rst ├── examples ├── analytic_example │ ├── Albanian.tree.152tax.nwk │ ├── Anolis.tre │ ├── demo2.tree │ ├── demo2_ls.tsv │ ├── demo_acr_ls.sh │ ├── metadata_tab.csv │ ├── metadata_tab_ls.csv │ ├── show_tree_props.py │ └── svl.csv ├── automatic_query │ ├── basic_example1.nw │ ├── basic_example1_metadata1.tsv │ ├── collapse_demo.sh │ ├── color.config.collapsed │ ├── color.config.query │ ├── color.config.template │ ├── highlight_demo.sh │ └── prune_demo.sh ├── basic_example0 │ ├── boolean.tsv │ ├── categorical.tsv │ ├── categorical_ancestor.tsv │ ├── categorical_duplicated.tsv │ ├── data.array │ ├── demo1.tree │ ├── numerical.tsv │ ├── run_demo.sh │ ├── show_tree_props.py │ └── show_tree_props_ancestor.py ├── basic_example1 │ ├── basic_example1.nw │ ├── basic_example1_metadata.tsv │ ├── basic_example1_metadata1.tsv │ ├── basic_example1_metadata2.tsv │ └── example1_demo.sh ├── basic_example2 │ ├── FluA_H3_AA.fas │ ├── MCC_FluA_H3.nw │ ├── MCC_FluA_H3_Genotype.txt │ ├── diauxic.array │ ├── diauxic.nw │ └── example2_demo.sh ├── custom_color │ ├── basic_example1.nw │ ├── basic_example1_metadata1.tsv │ ├── basic_example1_metadata2.tsv │ ├── color.boolean.config │ ├── color.categorical.config │ ├── color.config.template │ ├── color.datamatrix.config │ ├── color.numerical.config │ ├── color.numerical2.config │ ├── color.numerical3.config │ ├── data_1col.array │ ├── data_2col.array │ ├── data_nan.array │ └── demo1.tree ├── pratical_example │ ├── emapper │ │ ├── 7955.ENSDARP00000116736.aln.faa │ │ ├── 7955.ENSDARP00000116736.nw │ │ ├── 7955.out.emapper.annotations │ │ ├── 7955.out.emapper.pfam │ │ ├── 7955.out.emapper.smart.out │ │ ├── emapper_demo.sh │ │ ├── nifH.faa.aln │ │ ├── nifH.nw │ │ ├── nifH.out.emapper.annotations │ │ └── nifH.out.emapper.pfam │ └── gtdb_r202 │ │ ├── ar122_metadata_r202_lite.tar.gz │ │ ├── bac120_metadata_r202_lite.tar.gz │ │ ├── gtdbv202.nw │ │ ├── gtdbv202_annotated.ete.tar.gz │ │ ├── gtdbv202full_demo.sh │ │ ├── gtdbv202lite_demo.sh │ │ ├── merge_gtdbtree.py │ │ └── progenome3.tar.gz ├── supporting_information │ ├── figure1.zip │ ├── figure2.zip │ └── figure3.zip └── taxonomy_example │ ├── archaea.nw │ ├── archaea_annotated.nw │ ├── demo3.tree │ ├── demo3.tsv │ ├── demo4.tree │ ├── demo4.tsv │ ├── gtdb_v202.tree │ ├── missing_gtdb_v202.tree │ ├── missing_ncbi.tree │ ├── motus.tree │ ├── ncbi.tree │ └── show_tree_props.py ├── pyproject.toml ├── setup.py ├── tests ├── .coverage ├── data_matrix.tsv ├── test_alignment.py ├── test_analytic.py ├── test_annotate.py ├── test_emapper.py ├── test_plot.py ├── test_prune.py └── test_taxonomic.py └── treeprofiler ├── __init__.py ├── app.py ├── drivers └── chromedriver ├── layouts ├── __init__.py ├── conditional_layouts.py ├── general_layouts.py ├── pfam2color.json ├── phylosignal_layouts.py ├── profile_layouts.py ├── profile_layouts.py~ ├── select_layouts.py ├── seq_layouts.py ├── smart2color.json ├── staple_layouts.py ├── staple_layouts.py~ ├── taxon_layouts.py └── text_layouts.py ├── main.py ├── src ├── __init__.py ├── acr_continuous.py ├── ete_format.py ├── ls.py ├── phylosignal.py └── utils.py ├── static ├── css │ ├── bootstrap-grid.css │ ├── bootstrap-grid.css.map │ ├── bootstrap-grid.min.css │ ├── bootstrap-grid.min.css.map │ ├── bootstrap-grid.rtl.css │ ├── bootstrap-grid.rtl.css.map │ ├── bootstrap-grid.rtl.min.css │ ├── bootstrap-grid.rtl.min.css.map │ ├── bootstrap-reboot.css │ ├── bootstrap-reboot.css.map │ ├── bootstrap-reboot.min.css │ ├── bootstrap-reboot.min.css.map │ ├── bootstrap-reboot.rtl.css │ ├── bootstrap-reboot.rtl.css.map │ ├── bootstrap-reboot.rtl.min.css │ ├── bootstrap-reboot.rtl.min.css.map │ ├── bootstrap-utilities.css │ ├── bootstrap-utilities.css.map │ ├── bootstrap-utilities.min.css │ ├── bootstrap-utilities.min.css.map │ ├── bootstrap-utilities.rtl.css │ ├── bootstrap-utilities.rtl.css.map │ ├── bootstrap-utilities.rtl.min.css │ ├── bootstrap-utilities.rtl.min.css.map │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ ├── bootstrap.min.css.map │ ├── bootstrap.rtl.css │ ├── bootstrap.rtl.css.map │ ├── bootstrap.rtl.min.css │ ├── bootstrap.rtl.min.css.map │ └── explore_tree.css └── js │ ├── bootstrap.bundle.js │ ├── bootstrap.bundle.js.map │ ├── bootstrap.bundle.min.js │ ├── bootstrap.bundle.min.js.map │ ├── bootstrap.esm.js │ ├── bootstrap.esm.js.map │ ├── bootstrap.esm.min.js │ ├── bootstrap.esm.min.js.map │ ├── bootstrap.js │ ├── bootstrap.js.map │ ├── bootstrap.min.js │ ├── bootstrap.min.js.map │ └── explore_tree.js ├── tree_annotate.py ├── tree_image.py ├── tree_plot.py ├── treeprofiler └── views ├── __init__.py ├── explore_tree_v3.html ├── job_running.html ├── tree_details.html └── upload_tree.html /.cache/v/cache/lastfailed: -------------------------------------------------------------------------------- 1 | { 2 | "tests/test_alignment.py": true, 3 | "tests/test_annotate.py": true, 4 | "tests/test_emapper.py": true, 5 | "tests/test_plot.py": true, 6 | "tests/test_prune.py": true, 7 | "tests/test_taxonomic.py": true 8 | } -------------------------------------------------------------------------------- /.coverage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/.coverage -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Sphinx docs to GitHub Pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | build-and-deploy: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Check out the code 14 | uses: actions/checkout@v2 15 | 16 | - name: Set up Python 17 | uses: actions/setup-python@v2 18 | with: 19 | python-version: '3.x' 20 | 21 | - name: Install dependencies 22 | run: | 23 | python -m pip install --upgrade pip 24 | pip install sphinx sphinx-rtd-theme 25 | 26 | - name: Build the documentation 27 | run: make html 28 | working-directory: ./docs 29 | 30 | - name: Post-process HTML files 31 | run: python post_process_html.py 32 | working-directory: ./docs 33 | 34 | - name: Deploy to GitHub Pages 35 | env: 36 | ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} 37 | run: | 38 | cd docs/build/html 39 | git init 40 | git config user.name 'github-actions[bot]' 41 | git config user.email 'github-actions[bot]@users.noreply.github.com' 42 | git add . 43 | git commit -m "Deploy documentation" 44 | git push --force --quiet "https://${{ secrets.ACTIONS_DEPLOY_KEY }}@github.com/${{ github.repository }}.git" master:gh-pages -------------------------------------------------------------------------------- /.github/workflows/python-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Upload Python Package 10 | 11 | on: 12 | release: 13 | types: [published] 14 | 15 | permissions: 16 | contents: read 17 | 18 | jobs: 19 | deploy: 20 | 21 | runs-on: ubuntu-latest 22 | 23 | steps: 24 | - uses: actions/checkout@v3 25 | - name: Set up Python 26 | uses: actions/setup-python@v3 27 | with: 28 | python-version: '3.x' 29 | - name: Install dependencies 30 | run: | 31 | python -m pip install --upgrade pip 32 | pip install build 33 | - name: Build package 34 | run: python -m build 35 | - name: Publish package 36 | uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 37 | with: 38 | user: __token__ 39 | password: ${{ secrets.PYPI_API_TOKEN }} 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | dist/ 3 | dist/* 4 | # Ignore build artifacts 5 | build/ 6 | build/* 7 | docs/build/ 8 | docs/build/* 9 | # Ignore Sphinx static files (if necessary) 10 | docs/source/_static/ 11 | docs/source/_templates/ 12 | *.egg-info/ 13 | __pycache__/ 14 | __pycache__/* 15 | .covarage 16 | .cache/ 17 | .cache/* 18 | tests/htmlcov/ 19 | tests/htmlcov/* 20 | 21 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include treeprofiler/static * 2 | recursive-include treeprofiler/views *.html 3 | include README.md 4 | include LICENSE -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/post_process_html.py: -------------------------------------------------------------------------------- 1 | import os 2 | import glob 3 | 4 | def replace_static_path(file_path): 5 | with open(file_path, 'r', encoding='utf-8') as file: 6 | content = file.read() 7 | 8 | # Replace occurrences of '_static' with 'static' 9 | content = content.replace('_static', 'static') 10 | 11 | with open(file_path, 'w', encoding='utf-8') as file: 12 | file.write(content) 13 | 14 | def process_html_files(directory): 15 | html_files = glob.glob(os.path.join(directory, '**/*.html'), recursive=True) 16 | for html_file in html_files: 17 | replace_static_path(html_file) 18 | 19 | if __name__ == "__main__": 20 | html_dir = os.path.join('build', 'html') # Adjust this if your build directory is different 21 | process_html_files(html_dir) 22 | -------------------------------------------------------------------------------- /docs/source/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* This file intentionally left blank. */ 2 | -------------------------------------------------------------------------------- /docs/source/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Base JavaScript utilities for all Sphinx HTML documentation. 6 | * 7 | * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | "use strict"; 12 | 13 | const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ 14 | "TEXTAREA", 15 | "INPUT", 16 | "SELECT", 17 | "BUTTON", 18 | ]); 19 | 20 | const _ready = (callback) => { 21 | if (document.readyState !== "loading") { 22 | callback(); 23 | } else { 24 | document.addEventListener("DOMContentLoaded", callback); 25 | } 26 | }; 27 | 28 | /** 29 | * Small JavaScript module for the documentation. 30 | */ 31 | const Documentation = { 32 | init: () => { 33 | Documentation.initDomainIndexTable(); 34 | Documentation.initOnKeyListeners(); 35 | }, 36 | 37 | /** 38 | * i18n support 39 | */ 40 | TRANSLATIONS: {}, 41 | PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), 42 | LOCALE: "unknown", 43 | 44 | // gettext and ngettext don't access this so that the functions 45 | // can safely bound to a different name (_ = Documentation.gettext) 46 | gettext: (string) => { 47 | const translated = Documentation.TRANSLATIONS[string]; 48 | switch (typeof translated) { 49 | case "undefined": 50 | return string; // no translation 51 | case "string": 52 | return translated; // translation exists 53 | default: 54 | return translated[0]; // (singular, plural) translation tuple exists 55 | } 56 | }, 57 | 58 | ngettext: (singular, plural, n) => { 59 | const translated = Documentation.TRANSLATIONS[singular]; 60 | if (typeof translated !== "undefined") 61 | return translated[Documentation.PLURAL_EXPR(n)]; 62 | return n === 1 ? singular : plural; 63 | }, 64 | 65 | addTranslations: (catalog) => { 66 | Object.assign(Documentation.TRANSLATIONS, catalog.messages); 67 | Documentation.PLURAL_EXPR = new Function( 68 | "n", 69 | `return (${catalog.plural_expr})` 70 | ); 71 | Documentation.LOCALE = catalog.locale; 72 | }, 73 | 74 | /** 75 | * helper function to focus on search bar 76 | */ 77 | focusSearchBar: () => { 78 | document.querySelectorAll("input[name=q]")[0]?.focus(); 79 | }, 80 | 81 | /** 82 | * Initialise the domain index toggle buttons 83 | */ 84 | initDomainIndexTable: () => { 85 | const toggler = (el) => { 86 | const idNumber = el.id.substr(7); 87 | const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); 88 | if (el.src.substr(-9) === "minus.png") { 89 | el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; 90 | toggledRows.forEach((el) => (el.style.display = "none")); 91 | } else { 92 | el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; 93 | toggledRows.forEach((el) => (el.style.display = "")); 94 | } 95 | }; 96 | 97 | const togglerElements = document.querySelectorAll("img.toggler"); 98 | togglerElements.forEach((el) => 99 | el.addEventListener("click", (event) => toggler(event.currentTarget)) 100 | ); 101 | togglerElements.forEach((el) => (el.style.display = "")); 102 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); 103 | }, 104 | 105 | initOnKeyListeners: () => { 106 | // only install a listener if it is really needed 107 | if ( 108 | !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && 109 | !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS 110 | ) 111 | return; 112 | 113 | document.addEventListener("keydown", (event) => { 114 | // bail for input elements 115 | if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; 116 | // bail with special keys 117 | if (event.altKey || event.ctrlKey || event.metaKey) return; 118 | 119 | if (!event.shiftKey) { 120 | switch (event.key) { 121 | case "ArrowLeft": 122 | if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; 123 | 124 | const prevLink = document.querySelector('link[rel="prev"]'); 125 | if (prevLink && prevLink.href) { 126 | window.location.href = prevLink.href; 127 | event.preventDefault(); 128 | } 129 | break; 130 | case "ArrowRight": 131 | if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; 132 | 133 | const nextLink = document.querySelector('link[rel="next"]'); 134 | if (nextLink && nextLink.href) { 135 | window.location.href = nextLink.href; 136 | event.preventDefault(); 137 | } 138 | break; 139 | } 140 | } 141 | 142 | // some keyboard layouts may need Shift to get / 143 | switch (event.key) { 144 | case "/": 145 | if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; 146 | Documentation.focusSearchBar(); 147 | event.preventDefault(); 148 | } 149 | }); 150 | }, 151 | }; 152 | 153 | // quick alias for translations 154 | const _ = Documentation.gettext; 155 | 156 | _ready(Documentation.init); 157 | -------------------------------------------------------------------------------- /docs/source/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | const DOCUMENTATION_OPTIONS = { 2 | VERSION: '[1.2.2-beta]', 3 | LANGUAGE: 'en', 4 | COLLAPSE_INDEX: false, 5 | BUILDER: 'html', 6 | FILE_SUFFIX: '.html', 7 | LINK_SUFFIX: '.html', 8 | HAS_SOURCE: true, 9 | SOURCELINK_SUFFIX: '.txt', 10 | NAVIGATION_WITH_KEYS: false, 11 | SHOW_SEARCH_SUMMARY: true, 12 | ENABLE_SEARCH_SHORTCUTS: true, 13 | }; -------------------------------------------------------------------------------- /docs/source/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/docs/source/_static/file.png -------------------------------------------------------------------------------- /docs/source/_static/language_data.js: -------------------------------------------------------------------------------- 1 | /* 2 | * language_data.js 3 | * ~~~~~~~~~~~~~~~~ 4 | * 5 | * This script contains the language-specific data used by searchtools.js, 6 | * namely the list of stopwords, stemmer, scorer and splitter. 7 | * 8 | * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. 9 | * :license: BSD, see LICENSE for details. 10 | * 11 | */ 12 | 13 | var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; 14 | 15 | 16 | /* Non-minified version is copied as a separate JS file, if available */ 17 | 18 | /** 19 | * Porter Stemmer 20 | */ 21 | var Stemmer = function() { 22 | 23 | var step2list = { 24 | ational: 'ate', 25 | tional: 'tion', 26 | enci: 'ence', 27 | anci: 'ance', 28 | izer: 'ize', 29 | bli: 'ble', 30 | alli: 'al', 31 | entli: 'ent', 32 | eli: 'e', 33 | ousli: 'ous', 34 | ization: 'ize', 35 | ation: 'ate', 36 | ator: 'ate', 37 | alism: 'al', 38 | iveness: 'ive', 39 | fulness: 'ful', 40 | ousness: 'ous', 41 | aliti: 'al', 42 | iviti: 'ive', 43 | biliti: 'ble', 44 | logi: 'log' 45 | }; 46 | 47 | var step3list = { 48 | icate: 'ic', 49 | ative: '', 50 | alize: 'al', 51 | iciti: 'ic', 52 | ical: 'ic', 53 | ful: '', 54 | ness: '' 55 | }; 56 | 57 | var c = "[^aeiou]"; // consonant 58 | var v = "[aeiouy]"; // vowel 59 | var C = c + "[^aeiouy]*"; // consonant sequence 60 | var V = v + "[aeiou]*"; // vowel sequence 61 | 62 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 63 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 64 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 65 | var s_v = "^(" + C + ")?" + v; // vowel in stem 66 | 67 | this.stemWord = function (w) { 68 | var stem; 69 | var suffix; 70 | var firstch; 71 | var origword = w; 72 | 73 | if (w.length < 3) 74 | return w; 75 | 76 | var re; 77 | var re2; 78 | var re3; 79 | var re4; 80 | 81 | firstch = w.substr(0,1); 82 | if (firstch == "y") 83 | w = firstch.toUpperCase() + w.substr(1); 84 | 85 | // Step 1a 86 | re = /^(.+?)(ss|i)es$/; 87 | re2 = /^(.+?)([^s])s$/; 88 | 89 | if (re.test(w)) 90 | w = w.replace(re,"$1$2"); 91 | else if (re2.test(w)) 92 | w = w.replace(re2,"$1$2"); 93 | 94 | // Step 1b 95 | re = /^(.+?)eed$/; 96 | re2 = /^(.+?)(ed|ing)$/; 97 | if (re.test(w)) { 98 | var fp = re.exec(w); 99 | re = new RegExp(mgr0); 100 | if (re.test(fp[1])) { 101 | re = /.$/; 102 | w = w.replace(re,""); 103 | } 104 | } 105 | else if (re2.test(w)) { 106 | var fp = re2.exec(w); 107 | stem = fp[1]; 108 | re2 = new RegExp(s_v); 109 | if (re2.test(stem)) { 110 | w = stem; 111 | re2 = /(at|bl|iz)$/; 112 | re3 = new RegExp("([^aeiouylsz])\\1$"); 113 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 114 | if (re2.test(w)) 115 | w = w + "e"; 116 | else if (re3.test(w)) { 117 | re = /.$/; 118 | w = w.replace(re,""); 119 | } 120 | else if (re4.test(w)) 121 | w = w + "e"; 122 | } 123 | } 124 | 125 | // Step 1c 126 | re = /^(.+?)y$/; 127 | if (re.test(w)) { 128 | var fp = re.exec(w); 129 | stem = fp[1]; 130 | re = new RegExp(s_v); 131 | if (re.test(stem)) 132 | w = stem + "i"; 133 | } 134 | 135 | // Step 2 136 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 137 | if (re.test(w)) { 138 | var fp = re.exec(w); 139 | stem = fp[1]; 140 | suffix = fp[2]; 141 | re = new RegExp(mgr0); 142 | if (re.test(stem)) 143 | w = stem + step2list[suffix]; 144 | } 145 | 146 | // Step 3 147 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 148 | if (re.test(w)) { 149 | var fp = re.exec(w); 150 | stem = fp[1]; 151 | suffix = fp[2]; 152 | re = new RegExp(mgr0); 153 | if (re.test(stem)) 154 | w = stem + step3list[suffix]; 155 | } 156 | 157 | // Step 4 158 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 159 | re2 = /^(.+?)(s|t)(ion)$/; 160 | if (re.test(w)) { 161 | var fp = re.exec(w); 162 | stem = fp[1]; 163 | re = new RegExp(mgr1); 164 | if (re.test(stem)) 165 | w = stem; 166 | } 167 | else if (re2.test(w)) { 168 | var fp = re2.exec(w); 169 | stem = fp[1] + fp[2]; 170 | re2 = new RegExp(mgr1); 171 | if (re2.test(stem)) 172 | w = stem; 173 | } 174 | 175 | // Step 5 176 | re = /^(.+?)e$/; 177 | if (re.test(w)) { 178 | var fp = re.exec(w); 179 | stem = fp[1]; 180 | re = new RegExp(mgr1); 181 | re2 = new RegExp(meq1); 182 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 183 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 184 | w = stem; 185 | } 186 | re = /ll$/; 187 | re2 = new RegExp(mgr1); 188 | if (re.test(w) && re2.test(w)) { 189 | re = /.$/; 190 | w = w.replace(re,""); 191 | } 192 | 193 | // and turn initial Y back to y 194 | if (firstch == "y") 195 | w = firstch.toLowerCase() + w.substr(1); 196 | return w; 197 | } 198 | } 199 | 200 | -------------------------------------------------------------------------------- /docs/source/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/docs/source/_static/minus.png -------------------------------------------------------------------------------- /docs/source/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/docs/source/_static/plus.png -------------------------------------------------------------------------------- /docs/source/_static/pygments.css: -------------------------------------------------------------------------------- 1 | pre { line-height: 125%; } 2 | td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } 3 | span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } 4 | td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } 5 | span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } 6 | .highlight .hll { background-color: #ffffcc } 7 | .highlight { background: #f8f8f8; } 8 | .highlight .c { color: #8f5902; font-style: italic } /* Comment */ 9 | .highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */ 10 | .highlight .g { color: #000000 } /* Generic */ 11 | .highlight .k { color: #004461; font-weight: bold } /* Keyword */ 12 | .highlight .l { color: #000000 } /* Literal */ 13 | .highlight .n { color: #000000 } /* Name */ 14 | .highlight .o { color: #582800 } /* Operator */ 15 | .highlight .x { color: #000000 } /* Other */ 16 | .highlight .p { color: #000000; font-weight: bold } /* Punctuation */ 17 | .highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */ 18 | .highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */ 19 | .highlight .cp { color: #8f5902 } /* Comment.Preproc */ 20 | .highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */ 21 | .highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */ 22 | .highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */ 23 | .highlight .gd { color: #a40000 } /* Generic.Deleted */ 24 | .highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */ 25 | .highlight .ges { color: #000000 } /* Generic.EmphStrong */ 26 | .highlight .gr { color: #ef2929 } /* Generic.Error */ 27 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 28 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 29 | .highlight .go { color: #888888 } /* Generic.Output */ 30 | .highlight .gp { color: #745334 } /* Generic.Prompt */ 31 | .highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */ 32 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 33 | .highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */ 34 | .highlight .kc { color: #004461; font-weight: bold } /* Keyword.Constant */ 35 | .highlight .kd { color: #004461; font-weight: bold } /* Keyword.Declaration */ 36 | .highlight .kn { color: #004461; font-weight: bold } /* Keyword.Namespace */ 37 | .highlight .kp { color: #004461; font-weight: bold } /* Keyword.Pseudo */ 38 | .highlight .kr { color: #004461; font-weight: bold } /* Keyword.Reserved */ 39 | .highlight .kt { color: #004461; font-weight: bold } /* Keyword.Type */ 40 | .highlight .ld { color: #000000 } /* Literal.Date */ 41 | .highlight .m { color: #990000 } /* Literal.Number */ 42 | .highlight .s { color: #4e9a06 } /* Literal.String */ 43 | .highlight .na { color: #c4a000 } /* Name.Attribute */ 44 | .highlight .nb { color: #004461 } /* Name.Builtin */ 45 | .highlight .nc { color: #000000 } /* Name.Class */ 46 | .highlight .no { color: #000000 } /* Name.Constant */ 47 | .highlight .nd { color: #888888 } /* Name.Decorator */ 48 | .highlight .ni { color: #ce5c00 } /* Name.Entity */ 49 | .highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */ 50 | .highlight .nf { color: #000000 } /* Name.Function */ 51 | .highlight .nl { color: #f57900 } /* Name.Label */ 52 | .highlight .nn { color: #000000 } /* Name.Namespace */ 53 | .highlight .nx { color: #000000 } /* Name.Other */ 54 | .highlight .py { color: #000000 } /* Name.Property */ 55 | .highlight .nt { color: #004461; font-weight: bold } /* Name.Tag */ 56 | .highlight .nv { color: #000000 } /* Name.Variable */ 57 | .highlight .ow { color: #004461; font-weight: bold } /* Operator.Word */ 58 | .highlight .pm { color: #000000; font-weight: bold } /* Punctuation.Marker */ 59 | .highlight .w { color: #f8f8f8 } /* Text.Whitespace */ 60 | .highlight .mb { color: #990000 } /* Literal.Number.Bin */ 61 | .highlight .mf { color: #990000 } /* Literal.Number.Float */ 62 | .highlight .mh { color: #990000 } /* Literal.Number.Hex */ 63 | .highlight .mi { color: #990000 } /* Literal.Number.Integer */ 64 | .highlight .mo { color: #990000 } /* Literal.Number.Oct */ 65 | .highlight .sa { color: #4e9a06 } /* Literal.String.Affix */ 66 | .highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */ 67 | .highlight .sc { color: #4e9a06 } /* Literal.String.Char */ 68 | .highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */ 69 | .highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */ 70 | .highlight .s2 { color: #4e9a06 } /* Literal.String.Double */ 71 | .highlight .se { color: #4e9a06 } /* Literal.String.Escape */ 72 | .highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */ 73 | .highlight .si { color: #4e9a06 } /* Literal.String.Interpol */ 74 | .highlight .sx { color: #4e9a06 } /* Literal.String.Other */ 75 | .highlight .sr { color: #4e9a06 } /* Literal.String.Regex */ 76 | .highlight .s1 { color: #4e9a06 } /* Literal.String.Single */ 77 | .highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */ 78 | .highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */ 79 | .highlight .fm { color: #000000 } /* Name.Function.Magic */ 80 | .highlight .vc { color: #000000 } /* Name.Variable.Class */ 81 | .highlight .vg { color: #000000 } /* Name.Variable.Global */ 82 | .highlight .vi { color: #000000 } /* Name.Variable.Instance */ 83 | .highlight .vm { color: #000000 } /* Name.Variable.Magic */ 84 | .highlight .il { color: #990000 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/source/_static/sphinx_highlight.js: -------------------------------------------------------------------------------- 1 | /* Highlighting utilities for Sphinx HTML documentation. */ 2 | "use strict"; 3 | 4 | const SPHINX_HIGHLIGHT_ENABLED = true 5 | 6 | /** 7 | * highlight a given string on a node by wrapping it in 8 | * span elements with the given class name. 9 | */ 10 | const _highlight = (node, addItems, text, className) => { 11 | if (node.nodeType === Node.TEXT_NODE) { 12 | const val = node.nodeValue; 13 | const parent = node.parentNode; 14 | const pos = val.toLowerCase().indexOf(text); 15 | if ( 16 | pos >= 0 && 17 | !parent.classList.contains(className) && 18 | !parent.classList.contains("nohighlight") 19 | ) { 20 | let span; 21 | 22 | const closestNode = parent.closest("body, svg, foreignObject"); 23 | const isInSVG = closestNode && closestNode.matches("svg"); 24 | if (isInSVG) { 25 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 26 | } else { 27 | span = document.createElement("span"); 28 | span.classList.add(className); 29 | } 30 | 31 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 32 | const rest = document.createTextNode(val.substr(pos + text.length)); 33 | parent.insertBefore( 34 | span, 35 | parent.insertBefore( 36 | rest, 37 | node.nextSibling 38 | ) 39 | ); 40 | node.nodeValue = val.substr(0, pos); 41 | /* There may be more occurrences of search term in this node. So call this 42 | * function recursively on the remaining fragment. 43 | */ 44 | _highlight(rest, addItems, text, className); 45 | 46 | if (isInSVG) { 47 | const rect = document.createElementNS( 48 | "http://www.w3.org/2000/svg", 49 | "rect" 50 | ); 51 | const bbox = parent.getBBox(); 52 | rect.x.baseVal.value = bbox.x; 53 | rect.y.baseVal.value = bbox.y; 54 | rect.width.baseVal.value = bbox.width; 55 | rect.height.baseVal.value = bbox.height; 56 | rect.setAttribute("class", className); 57 | addItems.push({ parent: parent, target: rect }); 58 | } 59 | } 60 | } else if (node.matches && !node.matches("button, select, textarea")) { 61 | node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); 62 | } 63 | }; 64 | const _highlightText = (thisNode, text, className) => { 65 | let addItems = []; 66 | _highlight(thisNode, addItems, text, className); 67 | addItems.forEach((obj) => 68 | obj.parent.insertAdjacentElement("beforebegin", obj.target) 69 | ); 70 | }; 71 | 72 | /** 73 | * Small JavaScript module for the documentation. 74 | */ 75 | const SphinxHighlight = { 76 | 77 | /** 78 | * highlight the search words provided in localstorage in the text 79 | */ 80 | highlightSearchWords: () => { 81 | if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight 82 | 83 | // get and clear terms from localstorage 84 | const url = new URL(window.location); 85 | const highlight = 86 | localStorage.getItem("sphinx_highlight_terms") 87 | || url.searchParams.get("highlight") 88 | || ""; 89 | localStorage.removeItem("sphinx_highlight_terms") 90 | url.searchParams.delete("highlight"); 91 | window.history.replaceState({}, "", url); 92 | 93 | // get individual terms from highlight string 94 | const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); 95 | if (terms.length === 0) return; // nothing to do 96 | 97 | // There should never be more than one element matching "div.body" 98 | const divBody = document.querySelectorAll("div.body"); 99 | const body = divBody.length ? divBody[0] : document.querySelector("body"); 100 | window.setTimeout(() => { 101 | terms.forEach((term) => _highlightText(body, term, "highlighted")); 102 | }, 10); 103 | 104 | const searchBox = document.getElementById("searchbox"); 105 | if (searchBox === null) return; 106 | searchBox.appendChild( 107 | document 108 | .createRange() 109 | .createContextualFragment( 110 | '
' + 111 | '' + 112 | _("Hide Search Matches") + 113 | "
" 114 | ) 115 | ); 116 | }, 117 | 118 | /** 119 | * helper function to hide the search marks again 120 | */ 121 | hideSearchWords: () => { 122 | document 123 | .querySelectorAll("#searchbox .highlight-link") 124 | .forEach((el) => el.remove()); 125 | document 126 | .querySelectorAll("span.highlighted") 127 | .forEach((el) => el.classList.remove("highlighted")); 128 | localStorage.removeItem("sphinx_highlight_terms") 129 | }, 130 | 131 | initEscapeListener: () => { 132 | // only install a listener if it is really needed 133 | if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; 134 | 135 | document.addEventListener("keydown", (event) => { 136 | // bail for input elements 137 | if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; 138 | // bail with special keys 139 | if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; 140 | if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { 141 | SphinxHighlight.hideSearchWords(); 142 | event.preventDefault(); 143 | } 144 | }); 145 | }, 146 | }; 147 | 148 | _ready(() => { 149 | /* Do not call highlightSearchWords() when we are on the search page. 150 | * It will highlight words from the *previous* search query. 151 | */ 152 | if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); 153 | SphinxHighlight.initEscapeListener(); 154 | }); 155 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # For the full list of built-in configuration values, see the documentation: 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 5 | 6 | # -- Project information ----------------------------------------------------- 7 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information 8 | import os 9 | 10 | project = 'treeprofiler' 11 | copyright = '2024, Ziqi Deng & Jaime Huerta-Cepas' 12 | author = 'Ziqi Deng & Jaime Huerta-Cepas' 13 | release = '[1.2.2-beta]' 14 | 15 | # -- General configuration --------------------------------------------------- 16 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration 17 | 18 | # Enable markdown support 19 | 20 | source_suffix = { 21 | '.rst': 'restructuredtext', 22 | '.md': 'markdown', 23 | } 24 | 25 | templates_path = ['_templates'] 26 | exclude_patterns = [] 27 | 28 | 29 | 30 | # -- Options for HTML output ------------------------------------------------- 31 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output 32 | 33 | html_theme = 'alabaster' 34 | html_static_path = ['static'] 35 | 36 | # Update the output directory to use 'static' instead of '_static' 37 | def setup(app): 38 | app.connect('build-finished', rename_static) 39 | 40 | def rename_static(app, exception): 41 | if app.builder.name == 'html': 42 | static_dir = os.path.join(app.outdir, '_static') 43 | new_static_dir = os.path.join(app.outdir, 'static') 44 | if os.path.exists(static_dir): 45 | os.rename(static_dir, new_static_dir) 46 | # Run the post-processing script to update paths in HTML files 47 | os.system('python post_process_html.py') -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. treeprofiler documentation master file, created by 2 | sphinx-quickstart on Mon Jun 24 17:10:40 2024. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to treeprofiler's documentation! 7 | ======================================== 8 | 9 | .. toctree:: 10 | :maxdepth: 3 11 | :caption: Contents: 12 | 13 | documentations 14 | 15 | 16 | Indices and tables 17 | ================== 18 | 19 | * :ref:`genindex` 20 | * :ref:`modindex` 21 | * :ref:`search` 22 | -------------------------------------------------------------------------------- /examples/analytic_example/Albanian.tree.152tax.nwk: -------------------------------------------------------------------------------- 1 | (((97CDAF6238:0.08034,94CYAF6237:0.10559)node_3:0.0053,(97CDAF6240:0.04761,(03ESAY2109:0.04105,03ESAY2098:0.02771)node_6:0.02046)node_4:0.01021)node_1:0.09501,(00CZAY4286:0.07746,((85UGM62320:0.09015,((00GAAJ3391:0.08297,(98CMAJ6934:0.0551,(00GAAJ3398:0.03617,03ESAY2099:0.03707)node_24:0.00303)node_17:0.00348)node_12:0.02373,(((((03ESAY2111:0.04048,00GRAF5753:0.01741)node_42:0,(98FRAJ0552:0.00429,97FRAJ0558:0.03683)node_43:0.00824)node_32:0.01188,(02GRAY0270:0.01527,97YUAF9960:0.0529)node_33:0.01822)node_25:0.05533,(00SEAY5240:0.07261,(98CMAJ6932:0.07492,(98CMAJ6933:0.0436,96CMAJ6134:0.04942)node_44:0.00725)node_34:0.02994)node_26:0.01185)node_18:0.00416,(00CZAY4248:0.01387,((00CZAY4362:0.03677,(00CZAY4336:0.00436,00CZAY4296:0.02224)node_45:0)node_35:0.00888,(00UAAF3968:0.02177,(97BYAF3275:0.01362,(02SIAJ1139:0.0074,(03RUAY0393:0.01051,02GRAY0302:0.02615)node_64:0.00462)node_54:0.01955)node_46:0)node_36:0.00449)node_27:0.00817)node_19:0.05679)node_13:0)node_9:0.00322)node_7:0.0098,((99SEAY5206:0.03711,(99SDAY2494:0.04645,(90UGAF7846:0.01791,(99UGAF4478:0.03204,(00KEAF7083:0.04136,(00KEAF7079:0.04577,(95SEAF9673:0.0688,(98UGAF4508:0.07972,98UGAF4509:0.06631)node_65:0.01299)node_55:0.00598)node_47:0.00303)node_37:0.00531)node_28:0.00406)node_20:0)node_14:0.00509)node_10:0.02819,(((99ESAY7467:0.06136,((02GRAY0300:0.05935,02GRAY0299:0.05522)node_38:0.02987,((99ESAY7468:0.05473,02GRAY0303:0.04641)node_48:0.04545,((96SNAY1630:0.0252,01SNAY1629:0.01877)node_56:0.01025,(01SNAY1631:0.04107,99DEAF7536:0.15941)node_57:0.00642)node_49:0.01232)node_39:0.04451)node_29:0.00869)node_21:0.00091,(97CMAJ6931:0.05378,(97CMAJ6930:0.0535,92UGAB8332:0.05638)node_30:0.00733)node_22:0.00646)node_15:0.00995,(00KEAF7081:0.07835,(98SDAY2482:0.07198,(((98UGAF4507:0.05514,(94SEAF9670:0.03669,(00ITAY0121:0.06983,(98ITAF5286:0.00409,98ITAF5285:0.00452)node_73:0.04079)node_66:0.0091)node_58:0.00719)node_50:0.00473,(95SEAF7771:0.10634,(((92UGU51190:0.06022,99UGAF4493:0.04027)node_74:0.01307,(00KEAF7089:0.0948,91UGAF7368:0.05055)node_75:0)node_67:0.01049,(99KEAF7063:0.0136,00KEAF7055:0.03226)node_68:0.00821)node_59:0)node_51:0.00426)node_40:0.00428,(((94SEAF9671:0.08146,99BEAF8999:0.04088)node_60:0.0144,(((00KEAF7068:0.05611,97TZAF1872:0.02777)node_76:0.00795,(00KEAF7084:0.05095,((00KEAF7070:0.03123,00KEAF7053:0.06091)node_84:0.00479,((((00KEAF7067:0.03463,02GRAY0301:0.0585)node_102:0.01386,(99KEAF7075:0.04308,(00KEAF7080:0.09532,(00KEAF7069:0.04636,02GRAY0314:0.04512)node_119:0.01033)node_111:0.00972)node_103:0.0077)node_94:0.00511,(98UGAF4512:0.0617,(00KEAF7066:0.03658,00KEAF7052:0.11474)node_104:0.02015)node_95:0.00772)node_89:0.01537,(00KEAF7077:0.06533,93RWAY3406:0.05473)node_90:0.00403)node_85:0.00528)node_81:0.00819)node_77:0.01018)node_69:0.00438,(01TZAY3314:0.05929,00SEAY5249:0.0362)node_70:0.01472)node_61:0)node_52:0.00447,((01TZAY3305:0.04997,(01TZAY3306:0.04652,(99KEAF7065:0.06116,02GRAY0287:0.05906)node_78:0.00375)node_71:0.00359)node_62:0,(00KEAF7086:0.04441,((95SEAF9669:0.05804,02GRAY0290:0.05699)node_79:0.00938,((02GRAY0283:0.0491,(02GRAY0291:0.03739,00GRAY6884:0.03127)node_86:0.00387)node_82:0,((02GRAY0295:0.07941,((02GRAY0282:0.05049,02GRAY0281:0.01713)node_96:0.03186,(02GRAY0294:0.06911,02GRAY0272:0.04313)node_97:0.00532)node_91:0.00324)node_87:0.00647,(((02GRAY0297:0.08787,(02GRAY0274:0.00496,02GRAY0273:0.03791)node_105:0.03113)node_98:0,(02GRAY0275:0.03065,(((02GRAY0298:0.06635,(02GRAY0277:0.01748,(02GRAY0279:0.02771,02GRAY0278:0.01931)node_134:0.03571)node_128:0.0049)node_120:0.00426,(02GRAY0280:0.01883,(01ALAY1715:0,(02GRAY0293:0.01965,02GRAY0292:0)node_135:0.02927)node_129:0.00909)node_121:0.00377)node_112:0.00432,((02GRAY0289:0.05073,02GRAY0288:0.0116)node_122:0.03069,((02GRAY0285:0.02677,02GRAY0284:0.02208)node_130:0.01343,((02GRAY0271:0.00988,02GRAY0276:0.0628)node_136:0.01702,(02GRAY0286:0.04233,02GRAY0296:0.01805)node_137:0.00443)node_131:0.00424)node_123:0.00411)node_113:0)node_106:0)node_99:0.00417)node_92:0.00447,(((01ALAY1690:0.01796,(00ALAY1713:0.02229,01ALAY1691:0.00393)node_114:0.00446)node_107:0.00456,(01ALAY1656:0,02ALAY1658:0.01729)node_108:0)node_100:0.00855,(((03ALAY1707:0.01716,(01ALAY1692:0.01703,((01ALAY1654:0,(02ALAY1659:0,(02ALAY1698:0.01314,01ALAY1657:0.02218)node_146:0.00424)node_141:0)node_138:0.00854,((99ALAY1712:0.00842,01ALAY1655:0.00843)node_142:0,(02ALAY1653:0.03043,(98ALAY1709:0.00593,(02ALAY1710:0.00994,02ALAY1660:0.02523)node_150:0.01771)node_147:0.00696)node_143:0)node_139:0.00421)node_132:0)node_124:0)node_115:0.00424,((00ALAY1714:0,02ALAY1696:0.03541)node_125:0.00425,(97ALAY1664:0.01327,(03ALAY1704:0.0311,((00ALAY1705:0.00858,01ALAY1652:0)node_144:0.00875,((02ALAY1711:0,02ALAY1697:0.00853)node_148:0,(00GRAF5768:0.03063,00GRAF5754:0.00871)node_149:0.0048)node_145:0.00868)node_140:0)node_133:0.00442)node_126:0.0042)node_116:0)node_109:0,((01ALAY1689:0.00413,03ALAY1703:0.01753)node_117:0.00867,(03ALAY1706:0.0086,(03ALAY1662:0.00429,03ALAY1663:0.00877)node_127:0.00426)node_118:0.00432)node_110:0)node_101:0)node_93:0.01745)node_88:0)node_83:0.00435)node_80:0.00873)node_72:0)node_63:0.00429)node_53:0.01264)node_41:0.00447)node_31:0)node_23:0.01845)node_16:0.01376)node_11:0.00449)node_8:0.00303)node_5:0.01023)node_2:0.04473)ROOT:0; -------------------------------------------------------------------------------- /examples/analytic_example/Anolis.tre: -------------------------------------------------------------------------------- 1 | ((((((((ahli:0.1308887296,allogus:0.1308887296):0.109078899,rubribarbus:0.2399676286):0.3477240729,imias:0.5876917015):0.1279779191,((((sagrei:0.2576204042,(bremeri:0.1097436524,quadriocellifer:0.1097436524):0.1478767518):0.06150599843,ophiolepis:0.3191264027):0.08721921759,mestrei:0.4063456203):0.1298140501,(((jubar:0.1188659524,homolechis:0.1188659524):0.09052271908,confusus:0.2093886715):0.04215577182,guafe:0.2515444433):0.2846152271):0.1795099503):0.1377237125,((((garmani:0.2000335809,opalinus:0.2000335809):0.01968719882,grahami:0.2197207797):0.2178099139,valencienni:0.4375306936):0.1226128606,(lineatopus:0.4713710622,reconditus:0.4713710622):0.08877249208):0.2932497789):0.06703519523,(((evermanni:0.2135202715,stratulus:0.2135202715):0.3521520586,(((krugi:0.3267560653,pulchellus:0.3267560653):0.1312930371,(gundlachi:0.3864660126,poncensis:0.3864660126):0.0715830898):0.03035078065,(cooki:0.395288192,cristatellus:0.395288192):0.09311169105):0.07727244709):0.1495575755,(((brevirostris:0.2757423466,(caudalis:0.1704974619,marron:0.1704974619):0.1052448847):0.02672749452,websteri:0.3024698411):0.09835748687,distichus:0.400827328):0.3144025776):0.2051986227):0.03488732303,(((barbouri:0.8021085018,(((alumina:0.2681076879,semilineatus:0.2681076879):0.219367178,olssoni:0.4874748658):0.2622236606,(etheridgei:0.5883072151,(fowleri:0.3770938401,insolitus:0.3770938401):0.211213375):0.1613913113):0.05240997539):0.0672038969,((((whitemani:0.3420271265,((haetianus:0.2669834072,breslini:0.2669834072):0.06962183477,((armouri:0.1483909526,cybotes:0.1483909526):0.04416718222,shrevei:0.1925581348):0.1440471072):0.005421884492):0.1066560095,(longitibialis:0.2521253346,strahmi:0.2521253346):0.1965578014):0.09143002532,marcanoi:0.5401131613):0.2505275207,((((((baleatus:0.04173045424,barahonae:0.04173045424):0.05263675531,ricordii:0.09436720956):0.2036021511,eugenegrahami:0.2979693606):0.0851110199,christophei:0.3830803805):0.09095334022,cuvieri:0.4740337207):0.1076385501,(barbatus:0.1467942669,(porcus:0.09310584235,(chamaeleonides:0.07630236186,guamuhaya:0.07630236186):0.01680348049):0.05368842459):0.4348780039):0.2089684112):0.07867171672):0.07597999248,((((((((altitudinalis:0.1748899419,oporinus:0.1748899419):0.09220318062,isolepis:0.2670931225):0.2538920892,(allisoni:0.29602293,porcatus:0.29602293):0.2249622817):0.03703491197,(((argillaceus:0.1142165228,centralis:0.1142165228):0.0249762444,pumilis:0.1391927672):0.2356256274,loysiana:0.3748183946):0.1832017291):0.08522862529,guazuma:0.6432487489):0.04644117492,((placidus:0.1869579579,sheplani:0.1869579579):0.3773659809,(alayoni:0.3793818065,(angusticeps:0.2172126961,paternus:0.2172126961):0.1621691104):0.1849421323):0.125365985):0.07887044542,((alutaceus:0.120861969,inexpectatus:0.120861969):0.4042515809,(((clivicola:0.3359598029,(cupeyalensis:0.08606303065,cyanopleurus:0.08606303065):0.2498967723):0.1189736423,(alfaroi:0.2802339379,macilentus:0.2802339379):0.1746995073):0.0092278683,vanidicus:0.4641613135):0.06095223642):0.2434468193):0.09435314761,(argenteolus:0.6564331946,lucius:0.6564331946):0.2064803223):0.08237887432):0.01002346021):0.04468414858,(((bartschi:0.5247253674,vermiculatus:0.5247253674):0.249459768,((((baracoae:0.05853977536,(noblei:0.02140617522,smallwoodi:0.02140617522):0.03713360014):0.02849164237,luteogularis:0.08703141773):0.017899207,equestris:0.1049306247):0.6297194497,(((monticola:0.6055537678,(bahorucoensis:0.3841100683,(dolichocephalus:0.1509270933,hendersoni:0.1509270933):0.2331829749):0.2214436996):0.03149201716,darlingtoni:0.637045785):0.03288736013,(((aliniger:0.1783542747,singularis:0.1783542747):0.1377057507,chlorocyanus:0.3160600254):0.2135626601,coelestinus:0.5296226856):0.1403104596):0.0647169293):0.0395350609):0.1207482386,occultus:0.8949333739):0.1050666261); 2 | -------------------------------------------------------------------------------- /examples/analytic_example/demo2.tree: -------------------------------------------------------------------------------- 1 | (((Taxa_3:0.315846,Taxa_5:0.422178)0.545875:0.0385092,((Taxa_18:0.388122,Taxa_7:0.985396)0.318374:0.828223,Taxa_9:0.177426)0.265897:0.771543)0.0802899:0.401106,(((((Taxa_2:0.181537,Taxa_24:0.214816)0.439897:0.424456,(Taxa_4:0.594816,(Taxa_19:0.851287,Taxa_11:0.68534)0.847939:0.873462)0.412267:0.182597)0.159413:0.395892,((Taxa_21:0.780085,Taxa_27:0.664065)0.234349:0.0823137,Taxa_25:0.453853)0.954538:0.492088)0.933185:0.913332,(Taxa_23:0.275857,((Taxa_33:0.00324651,(((((Taxa_12:0.746924,Taxa_29:0.696673)0.280301:0.0753355,Taxa_32:0.823437)0.146984:0.952473,(Taxa_39:0.366719,Taxa_34:0.131826)0.609102:0.671279)0.0569089:0.0610909,((Taxa_31:0.409543,Taxa_35:0.788844)0.19897:0.379211,(Taxa_26:0.196771,Taxa_16:0.0575939)0.361985:0.653138)0.103264:0.402985)0.90548:0.571406,((Taxa_1:0.203551,Taxa_10:0.23586)0.955513:0.909292,(Taxa_22:0.535001,Taxa_8:0.915806)0.101069:0.950469)0.144645:0.302824)0.969809:0.876503)0.591674:0.24749,((Taxa_20:0.714847,Taxa_13:0.390023)0.662764:0.536636,Taxa_0:0.796089)0.0484831:0.303489)0.397979:0.415642)0.905509:0.69042)0.609907:0.0676367,(Taxa_15:0.287597,(Taxa_6:0.0559056,(((Taxa_38:0.954381,Taxa_28:0.418919)0.548035:0.769888,Taxa_14:0.985328)0.622702:0.397739,(Taxa_30:0.376698,((Taxa_17:0.777726,Taxa_37:0.976008)0.726916:0.1183,Taxa_36:0.863807)0.801466:0.21711)0.265329:0.203699)0.173537:0.0471398)0.567606:0.118348)0.328258:0.715199)0.0802899:0.00717829); 2 | -------------------------------------------------------------------------------- /examples/analytic_example/demo2_ls.tsv: -------------------------------------------------------------------------------- 1 | name profile1 2 | Taxa_0 False 3 | Taxa_1 True 4 | Taxa_2 False 5 | Taxa_3 False 6 | Taxa_4 False 7 | Taxa_5 True 8 | Taxa_6 False 9 | Taxa_7 True 10 | Taxa_8 False 11 | Taxa_9 True 12 | Taxa_10 False 13 | Taxa_11 False 14 | Taxa_12 False 15 | Taxa_13 False 16 | Taxa_14 False 17 | Taxa_15 False 18 | Taxa_16 False 19 | Taxa_17 False 20 | Taxa_18 True 21 | Taxa_19 False 22 | Taxa_20 False 23 | Taxa_21 False 24 | Taxa_22 False 25 | Taxa_23 True 26 | Taxa_24 False 27 | Taxa_25 False 28 | Taxa_26 False 29 | Taxa_27 True 30 | Taxa_28 False 31 | Taxa_29 False 32 | Taxa_30 False 33 | Taxa_31 False 34 | Taxa_32 False 35 | Taxa_33 False 36 | Taxa_34 False 37 | Taxa_35 False 38 | Taxa_36 False 39 | Taxa_37 False 40 | Taxa_38 False 41 | Taxa_39 False 42 | -------------------------------------------------------------------------------- /examples/analytic_example/demo_acr_ls.sh: -------------------------------------------------------------------------------- 1 | # start ACR computing for Country trait and Lineage-Specificity analysis for is_Albania and is_Greece traits 2 | treeprofiler annotate \ 3 | --tree Albanian.tree.152tax.nwk \ 4 | --internal name \ 5 | --metadata metadata_tab_ls.csv \ 6 | --acr-discrete-columns Country \ 7 | --delta-stats \ 8 | --ls-columns is_Albania is_Greece \ 9 | --prec-cutoff 0.7 \ 10 | --sens-cutoff 0.7 \ 11 | --threads 4 \ 12 | -o ./ 13 | 14 | # Visualize ACR annotation 15 | treeprofiler plot \ 16 | -t Albanian.tree.152tax_annotated.ete \ 17 | --acr-discrete-layout Country 18 | 19 | # Visualize Lineage-Specificity annotation 20 | treeprofiler plot -t Albanian.tree.152tax_annotated.ete \ 21 | --ls-layout is_Albania is_Greece -------------------------------------------------------------------------------- /examples/analytic_example/metadata_tab.csv: -------------------------------------------------------------------------------- 1 | id Country 2 | 98CMAJ6932 Africa 3 | 98CMAJ6933 Africa 4 | 96CMAJ6134 Africa 5 | 00SEAY5240 WestEurope 6 | 97CDAF6240 Africa 7 | 97CDAF6238 Africa 8 | 97CMAJ6930 Africa 9 | 97CMAJ6931 Africa 10 | 98CMAJ6934 Africa 11 | 00GAAJ3398 Africa 12 | 00GAAJ3391 Africa 13 | 99KEAF7075 Africa 14 | 99KEAF7063 Africa 15 | 99KEAF7065 Africa 16 | 00KEAF7077 Africa 17 | 00KEAF7079 Africa 18 | 00KEAF7089 Africa 19 | 00KEAF7070 Africa 20 | 00KEAF7069 Africa 21 | 00KEAF7068 Africa 22 | 00KEAF7066 Africa 23 | 00KEAF7067 Africa 24 | 00KEAF7080 Africa 25 | 00KEAF7083 Africa 26 | 00KEAF7052 Africa 27 | 00KEAF7055 Africa 28 | 00KEAF7084 Africa 29 | 00KEAF7081 Africa 30 | 00KEAF7086 Africa 31 | 00KEAF7053 Africa 32 | 93RWAY3406 Africa 33 | 98SDAY2482 Africa 34 | 99SDAY2494 Africa 35 | 96SNAY1630 Africa 36 | 01SNAY1629 Africa 37 | 01SNAY1631 Africa 38 | 97TZAF1872 Africa 39 | 01TZAY3305 Africa 40 | 01TZAY3314 Africa 41 | 01TZAY3306 Africa 42 | 85UGM62320 Africa 43 | 90UGAF7846 Africa 44 | 91UGAF7368 Africa 45 | 92UGAB8332 Africa 46 | 92UGU51190 Africa 47 | 98UGAF4508 Africa 48 | 98UGAF4512 Africa 49 | 98UGAF4509 Africa 50 | 98UGAF4507 Africa 51 | 99UGAF4478 Africa 52 | 99UGAF4493 Africa 53 | 03RUAY0393 EastEurope 54 | 00UAAF3968 EastEurope 55 | 97BYAF3275 EastEurope 56 | 02SIAJ1139 EastEurope 57 | 00CZAY4362 EastEurope 58 | 00CZAY4336 EastEurope 59 | 00CZAY4296 EastEurope 60 | 00CZAY4286 EastEurope 61 | 00CZAY4248 EastEurope 62 | 94CYAF6237 WestEurope 63 | 95SEAF7771 WestEurope 64 | 94SEAF9671 WestEurope 65 | 94SEAF9670 WestEurope 66 | 95SEAF9673 WestEurope 67 | 95SEAF9669 WestEurope 68 | 99SEAY5206 WestEurope 69 | 00SEAY5249 WestEurope 70 | 99BEAF8999 WestEurope 71 | 98FRAJ0552 WestEurope 72 | 97FRAJ0558 WestEurope 73 | 03ESAY2109 WestEurope 74 | 03ESAY2099 WestEurope 75 | 03ESAY2098 WestEurope 76 | 03ESAY2111 WestEurope 77 | 99ESAY7468 WestEurope 78 | 99ESAY7467 WestEurope 79 | 99DEAF7536 WestEurope 80 | 98ITAF5286 WestEurope 81 | 98ITAF5285 WestEurope 82 | 00ITAY0121 WestEurope 83 | 97ALAY1664 Albania 84 | 98ALAY1709 Albania 85 | 99ALAY1712 Albania 86 | 00ALAY1705 Albania 87 | 00ALAY1713 Albania 88 | 00ALAY1714 Albania 89 | 02ALAY1698 Albania 90 | 02ALAY1710 Albania 91 | 02ALAY1711 Albania 92 | 01ALAY1654 Albania 93 | 01ALAY1691 Albania 94 | 01ALAY1692 Albania 95 | 01ALAY1655 Albania 96 | 01ALAY1656 Albania 97 | 01ALAY1715 Albania 98 | 01ALAY1657 Albania 99 | 01ALAY1689 Albania 100 | 01ALAY1690 Albania 101 | 01ALAY1652 Albania 102 | 02ALAY1658 Albania 103 | 02ALAY1659 Albania 104 | 02ALAY1653 Albania 105 | 02ALAY1696 Albania 106 | 02ALAY1660 Albania 107 | 02ALAY1697 Albania 108 | 03ALAY1703 Albania 109 | 03ALAY1704 Albania 110 | 03ALAY1662 Albania 111 | 03ALAY1706 Albania 112 | 03ALAY1663 Albania 113 | 03ALAY1707 Albania 114 | 02GRAY0314 Greece 115 | 02GRAY0290 Greece 116 | 00GRAF5768 Greece 117 | 00GRAF5754 Greece 118 | 02GRAY0286 Greece 119 | 02GRAY0285 Greece 120 | 02GRAY0271 Greece 121 | 02GRAY0298 Greece 122 | 02GRAY0296 Greece 123 | 02GRAY0284 Greece 124 | 02GRAY0277 Greece 125 | 02GRAY0275 Greece 126 | 02GRAY0282 Greece 127 | 02GRAY0281 Greece 128 | 02GRAY0295 Greece 129 | 02GRAY0280 Greece 130 | 02GRAY0294 Greece 131 | 02GRAY0291 Greece 132 | 02GRAY0287 Greece 133 | 00GRAY6884 Greece 134 | 02GRAY0276 Greece 135 | 02GRAY0289 Greece 136 | 02GRAY0288 Greece 137 | 02GRAY0283 Greece 138 | 02GRAY0279 Greece 139 | 02GRAY0278 Greece 140 | 02GRAY0272 Greece 141 | 02GRAY0274 Greece 142 | 02GRAY0273 Greece 143 | 02GRAY0293 Greece 144 | 02GRAY0292 Greece 145 | 02GRAY0297 Greece 146 | 02GRAY0302 Greece 147 | 02GRAY0301 Greece 148 | 02GRAY0270 Greece 149 | 00GRAF5753 Greece 150 | 02GRAY0300 Greece 151 | 02GRAY0299 Greece 152 | 02GRAY0303 Greece 153 | 97YUAF9960 EastEurope 154 | -------------------------------------------------------------------------------- /examples/analytic_example/metadata_tab_ls.csv: -------------------------------------------------------------------------------- 1 | id Country is_Albania is_Greece 2 | 98CMAJ6932 Africa False False 3 | 98CMAJ6933 Africa False False 4 | 96CMAJ6134 Africa False False 5 | 00SEAY5240 WestEurope False False 6 | 97CDAF6240 Africa False False 7 | 97CDAF6238 Africa False False 8 | 97CMAJ6930 Africa False False 9 | 97CMAJ6931 Africa False False 10 | 98CMAJ6934 Africa False False 11 | 00GAAJ3398 Africa False False 12 | 00GAAJ3391 Africa False False 13 | 99KEAF7075 Africa False False 14 | 99KEAF7063 Africa False False 15 | 99KEAF7065 Africa False False 16 | 00KEAF7077 Africa False False 17 | 00KEAF7079 Africa False False 18 | 00KEAF7089 Africa False False 19 | 00KEAF7070 Africa False False 20 | 00KEAF7069 Africa False False 21 | 00KEAF7068 Africa False False 22 | 00KEAF7066 Africa False False 23 | 00KEAF7067 Africa False False 24 | 00KEAF7080 Africa False False 25 | 00KEAF7083 Africa False False 26 | 00KEAF7052 Africa False False 27 | 00KEAF7055 Africa False False 28 | 00KEAF7084 Africa False False 29 | 00KEAF7081 Africa False False 30 | 00KEAF7086 Africa False False 31 | 00KEAF7053 Africa False False 32 | 93RWAY3406 Africa False False 33 | 98SDAY2482 Africa False False 34 | 99SDAY2494 Africa False False 35 | 96SNAY1630 Africa False False 36 | 01SNAY1629 Africa False False 37 | 01SNAY1631 Africa False False 38 | 97TZAF1872 Africa False False 39 | 01TZAY3305 Africa False False 40 | 01TZAY3314 Africa False False 41 | 01TZAY3306 Africa False False 42 | 85UGM62320 Africa False False 43 | 90UGAF7846 Africa False False 44 | 91UGAF7368 Africa False False 45 | 92UGAB8332 Africa False False 46 | 92UGU51190 Africa False False 47 | 98UGAF4508 Africa False False 48 | 98UGAF4512 Africa False False 49 | 98UGAF4509 Africa False False 50 | 98UGAF4507 Africa False False 51 | 99UGAF4478 Africa False False 52 | 99UGAF4493 Africa False False 53 | 03RUAY0393 EastEurope False False 54 | 00UAAF3968 EastEurope False False 55 | 97BYAF3275 EastEurope False False 56 | 02SIAJ1139 EastEurope False False 57 | 00CZAY4362 EastEurope False False 58 | 00CZAY4336 EastEurope False False 59 | 00CZAY4296 EastEurope False False 60 | 00CZAY4286 EastEurope False False 61 | 00CZAY4248 EastEurope False False 62 | 94CYAF6237 WestEurope False False 63 | 95SEAF7771 WestEurope False False 64 | 94SEAF9671 WestEurope False False 65 | 94SEAF9670 WestEurope False False 66 | 95SEAF9673 WestEurope False False 67 | 95SEAF9669 WestEurope False False 68 | 99SEAY5206 WestEurope False False 69 | 00SEAY5249 WestEurope False False 70 | 99BEAF8999 WestEurope False False 71 | 98FRAJ0552 WestEurope False False 72 | 97FRAJ0558 WestEurope False False 73 | 03ESAY2109 WestEurope False False 74 | 03ESAY2099 WestEurope False False 75 | 03ESAY2098 WestEurope False False 76 | 03ESAY2111 WestEurope False False 77 | 99ESAY7468 WestEurope False False 78 | 99ESAY7467 WestEurope False False 79 | 99DEAF7536 WestEurope False False 80 | 98ITAF5286 WestEurope False False 81 | 98ITAF5285 WestEurope False False 82 | 00ITAY0121 WestEurope False False 83 | 97ALAY1664 Albania True False 84 | 98ALAY1709 Albania True False 85 | 99ALAY1712 Albania True False 86 | 00ALAY1705 Albania True False 87 | 00ALAY1713 Albania True False 88 | 00ALAY1714 Albania True False 89 | 02ALAY1698 Albania True False 90 | 02ALAY1710 Albania True False 91 | 02ALAY1711 Albania True False 92 | 01ALAY1654 Albania True False 93 | 01ALAY1691 Albania True False 94 | 01ALAY1692 Albania True False 95 | 01ALAY1655 Albania True False 96 | 01ALAY1656 Albania True False 97 | 01ALAY1715 Albania True False 98 | 01ALAY1657 Albania True False 99 | 01ALAY1689 Albania True False 100 | 01ALAY1690 Albania True False 101 | 01ALAY1652 Albania True False 102 | 02ALAY1658 Albania True False 103 | 02ALAY1659 Albania True False 104 | 02ALAY1653 Albania True False 105 | 02ALAY1696 Albania True False 106 | 02ALAY1660 Albania True False 107 | 02ALAY1697 Albania True False 108 | 03ALAY1703 Albania True False 109 | 03ALAY1704 Albania True False 110 | 03ALAY1662 Albania True False 111 | 03ALAY1706 Albania True False 112 | 03ALAY1663 Albania True False 113 | 03ALAY1707 Albania True False 114 | 02GRAY0314 Greece False True 115 | 02GRAY0290 Greece False True 116 | 00GRAF5768 Greece False True 117 | 00GRAF5754 Greece False True 118 | 02GRAY0286 Greece False True 119 | 02GRAY0285 Greece False True 120 | 02GRAY0271 Greece False True 121 | 02GRAY0298 Greece False True 122 | 02GRAY0296 Greece False True 123 | 02GRAY0284 Greece False True 124 | 02GRAY0277 Greece False True 125 | 02GRAY0275 Greece False True 126 | 02GRAY0282 Greece False True 127 | 02GRAY0281 Greece False True 128 | 02GRAY0295 Greece False True 129 | 02GRAY0280 Greece False True 130 | 02GRAY0294 Greece False True 131 | 02GRAY0291 Greece False True 132 | 02GRAY0287 Greece False True 133 | 00GRAY6884 Greece False True 134 | 02GRAY0276 Greece False True 135 | 02GRAY0289 Greece False True 136 | 02GRAY0288 Greece False True 137 | 02GRAY0283 Greece False True 138 | 02GRAY0279 Greece False True 139 | 02GRAY0278 Greece False True 140 | 02GRAY0272 Greece False True 141 | 02GRAY0274 Greece False True 142 | 02GRAY0273 Greece False True 143 | 02GRAY0293 Greece False True 144 | 02GRAY0292 Greece False True 145 | 02GRAY0297 Greece False True 146 | 02GRAY0302 Greece False True 147 | 02GRAY0301 Greece False True 148 | 02GRAY0270 Greece False True 149 | 00GRAF5753 Greece False True 150 | 02GRAY0300 Greece False True 151 | 02GRAY0299 Greece False True 152 | 02GRAY0303 Greece False True 153 | 97YUAF9960 EastEurope False False 154 | -------------------------------------------------------------------------------- /examples/analytic_example/show_tree_props.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from ete4 import Tree 3 | 4 | filename = sys.argv[1] 5 | 6 | t = Tree(open(filename), parser=1) 7 | 8 | print("Target tree internal node Root contains the following properties: ") 9 | print(t.props) 10 | 11 | print(f"Target tree leaf node {next(t.leaves()).name}contains the following propertiies: ") 12 | print(next(t.leaves()).props) -------------------------------------------------------------------------------- /examples/analytic_example/svl.csv: -------------------------------------------------------------------------------- 1 | species,svl 2 | ahli,4.039125443 3 | alayoni,3.815704818 4 | alfaroi,3.526654599 5 | aliniger,4.036556538 6 | allisoni,4.375390078 7 | allogus,4.040138442 8 | altitudinalis,3.842994419 9 | alumina,3.588940722 10 | alutaceus,3.554890814 11 | angusticeps,3.788595498 12 | argenteolus,3.971307363 13 | argillaceus,3.757868992 14 | armouri,4.121684075 15 | bahorucoensis,3.827445029 16 | baleatus,5.05305601 17 | baracoae,5.042779747 18 | barahonae,5.076957937 19 | barbatus,5.003946306 20 | barbouri,3.663931948 21 | bartschi,4.280547466 22 | bremeri,4.113370744 23 | breslini,4.051110808 24 | brevirostris,3.874154977 25 | caudalis,3.911742966 26 | centralis,3.697941213 27 | chamaeleonides,5.04234927 28 | chlorocyanus,4.275448057 29 | christophei,3.884651809 30 | clivicola,3.758726128 31 | coelestinus,4.297965447 32 | confusus,3.938442349 33 | cooki,4.091535064 34 | cristatellus,4.189820018 35 | cupeyalensis,3.462013706 36 | cuvieri,4.875011919 37 | cyanopleurus,3.630161001 38 | cybotes,4.210982161 39 | darlingtoni,4.302036009 40 | distichus,3.928795837 41 | dolichocephalus,3.908550316 42 | equestris,5.113993807 43 | etheridgei,3.657990601 44 | eugenegrahami,4.128504414 45 | evermanni,4.165605231 46 | fowleri,4.288779949 47 | garmani,4.769473237 48 | grahami,4.154274265 49 | guafe,3.87745744 50 | guamuhaya,5.036952602 51 | guazuma,3.76388385 52 | gundlachi,4.18810472 53 | haetianus,4.316542212 54 | hendersoni,3.859834574 55 | homolechis,4.032805981 56 | imias,4.099687407 57 | inexpectatus,3.537438641 58 | insolitus,3.80047052 59 | isolepis,3.657087744 60 | jubar,3.952604971 61 | krugi,3.886500048 62 | lineatopus,4.128611788 63 | longitibialis,4.242103429 64 | loysiana,3.701240244 65 | lucius,4.198914766 66 | luteogularis,5.101085197 67 | macilentus,3.715764783 68 | marcanoi,4.079484699 69 | marron,3.831810283 70 | mestrei,3.987147344 71 | monticola,3.770613039 72 | noblei,5.083472618 73 | occultus,3.663048694 74 | olssoni,3.79389884 75 | opalinus,3.838376465 76 | ophiolepis,3.637962029 77 | oporinus,3.845669505 78 | paternus,3.802961204 79 | placidus,3.773967107 80 | poncensis,3.820377531 81 | porcatus,4.258990989 82 | porcus,5.038034268 83 | pulchellus,3.799022266 84 | pumilis,3.46686027 85 | quadriocellifer,3.901619072 86 | reconditus,4.482606994 87 | ricordii,5.013963084 88 | rubribarbus,4.078469213 89 | sagrei,4.067161768 90 | semilineatus,3.696630586 91 | sheplani,3.682924257 92 | shrevei,3.983003234 93 | singularis,4.057997494 94 | smallwoodi,5.035095592 95 | strahmi,4.274271278 96 | stratulus,3.869880695 97 | valencienni,4.321524401 98 | vanidicus,3.62620586 99 | vermiculatus,4.802849398 100 | websteri,3.916546094 101 | whitemani,4.097478535 102 | -------------------------------------------------------------------------------- /examples/automatic_query/basic_example1.nw: -------------------------------------------------------------------------------- 1 | ((Phy004OQ34_STRCA:0.0568325,(Phy004PA1B_ANAPL:0.0321232,(Phy0054BO3_MELGA:0.0174991,Phy003I7ZJ_CHICK:0.0135553):0.0754738):0.033434):0.0208482,(Phy004VACL_55661:0.12776,(((Phy004Y9VQ_LEPDC:0.0622317,Phy00508FR_NIPNI:0.0255705):0.0173668,((Phy004XRVA_HALAL:5e-09,Phy004Y35P_HALLE:5e-09):0.0287387,(Phy0050IUO_OPIHO:0.0971924,(Phy004W8WJ_FALPE:0.0133407,Phy004W8WI_FALPE:0.0151088):0.034729):0.000998087):0.00509275):0.00450124,(((((Phy004Z0OU_MELUD:0.0946703,Phy004V34S_CORBR:0.0843079):0.0296135,(Phy004U0LB_BUCRH:0.0424413,Phy004Z7RR_MERNU:0.115361):0.00300258):0.0131996,(Phy004TLNA_APAVI:0.0443506,Phy00527O5_PICPB:0.0684612):0.00933244):0.0128688,Phy004STVX_187382:0.0385265):0.00468641,(((Phy004O1E0_APTFO:0.0038266,Phy00535AU_PYGAD:0.0330561):0.0122123,(Phy004SNJQ_CHAVO:0.0713465,Phy004UIZ8_CALAN:0.0575794):0.0102997):0.000904602,(Phy004OLZM_COLLI:0.0203921,Phy004OLZN_COLLI:5e-09):0.0549953):0.00198396):0.00477864):0.00743975):0.0208482); -------------------------------------------------------------------------------- /examples/automatic_query/basic_example1_metadata1.tsv: -------------------------------------------------------------------------------- 1 | #name sample1 sample2 sample3 sample4 sample5 random_type bool_type bool_type2 2 | Phy003I7ZJ_CHICK 0.05 0.12 0.86 0.01 0.69 medium 1 true 3 | Phy0054BO3_MELGA 0.64 0.67 0.51 0.29 0.14 medium 1 true 4 | Phy00508FR_NIPNI 0.89 0.38 0.97 0.49 0.26 low 1 FALSE 5 | Phy004O1E0_APTFO 0.1 0.09 0.38 0.31 0.41 medium 0 TRUE 6 | Phy004PA1B_ANAPL 0.77 0.03 0.52 0.07 0.23 medium 1 TRUE 7 | Phy004TLNA_APAVI 0.05 0.3 0.61 0.45 0.47 medium 1 false 8 | Phy004OLZM_COLLI 0.82 0.34 0.2 0.06 0.12 low 0 TRUE 9 | Phy004OQ34_STRCA 0.46 0.76 0.08 0.79 0.17 high 1 FALSE 10 | Phy00527O5_PICPB 0.68 0.27 0.89 0.36 0.49 high 1 FALSE 11 | Phy004STVX_187382 0.33 0.95 0.22 0.34 0.38 low 1 TRUE 12 | Phy004UIZ8_CALAN 0.87 0.26 0.33 0.67 0.74 medium 1 TRUE 13 | Phy004SNJQ_CHAVO 0.56 0.76 0.27 0.84 0.52 medium 0 FALSE 14 | Phy0050IUO_OPIHO 0.4 0.78 0.53 0.42 0.46 medium 1 FALSE 15 | Phy004OLZN_COLLI 0.9 0.89 0.48 0.48 0.13 low 1 FALSE 16 | Phy004W8WI_FALPE 0.8 0.64 0.93 0.38 0.55 medium 0 TRUE 17 | Phy004W8WJ_FALPE 0.31 0.48 0.22 0.83 0.36 medium 1 FALSE 18 | Phy004U0LB_BUCRH 0.26 0.67 0.87 0.83 0.01 high 1 FALSE 19 | Phy004VACL_55661 0.38 0.6 0.84 0.54 0.02 low 0 FALSE 20 | Phy004V34S_CORBR 0.96 0.73 0.23 0.57 0.35 low 0 FALSE 21 | Phy004Z0OU_MELUD 0.8 0.03 0.56 0.32 0.63 medium 1 FALSE 22 | Phy004Y35P_HALLE 0.68 0.07 0.91 0.8 0.06 high 0 TRUE 23 | Phy00535AU_PYGAD 0.34 0.73 0.3 0.39 0.2 high 1 FALSE 24 | Phy004Y9VQ_LEPDC 0.49 0.27 0.02 0.61 0.58 low 0 FALSE 25 | Phy004XRVA_HALAL 0.21 0.16 0.53 0.11 0.62 high 1 FALSE 26 | Phy004Z7RR_MERNU 0.85 0.12 0.33 0.19 0.81 low 0 FALSE 27 | -------------------------------------------------------------------------------- /examples/automatic_query/collapse_demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## annotate tree 4 | treeprofiler annotate \ 5 | --tree ./basic_example1.nw \ 6 | --input-type newick \ 7 | --metadata ./basic_example1_metadata1.tsv \ 8 | --bool-prop bool_type bool_type2 \ 9 | --counter-stat relative \ 10 | -o ./ 11 | 12 | # select tree internal node where sample1_avg feature < 0.50 13 | treeprofiler plot \ 14 | --tree basic_example1_annotated.ete \ 15 | --input-type ete \ 16 | --heatmap-layout sample1 \ 17 | --collapsed-by "sample1_avg < 0.50" 18 | 19 | # collapse tree internal nodes, where `high` relative counter > 0.35 in random_type_counter property 20 | treeprofiler plot \ 21 | --tree basic_example1_annotated.ete \ 22 | --input-type ete \ 23 | --rectangle-layout random_type \ 24 | --collapsed-by "random_type_counter:high > 0.35" \ 25 | --column-width 70 -------------------------------------------------------------------------------- /examples/automatic_query/color.config.collapsed: -------------------------------------------------------------------------------- 1 | # TreeProfiler Conditional query Configuration 2 | # This file defines custom colors for properties of annotated tree nodes. 3 | # Columns: PROP, VALUE, COLOR, CONDITION 4 | 5 | # PROP: Property of the annotated tree node 6 | # VALUE: Value of the property to be colored 7 | # COLOR: Color to apply 8 | # CONDITION: operator 9 | 10 | PROP,VALUE,COLOR,CONDITION 11 | #random_type_counter:high,0.35,red,> 12 | sample1_avg,0.50,green,> 13 | 14 | -------------------------------------------------------------------------------- /examples/automatic_query/color.config.query: -------------------------------------------------------------------------------- 1 | # TreeProfiler Conditional query Configuration 2 | # This file defines custom colors for properties of annotated tree nodes. 3 | # Columns: PROP, VALUE, COLOR, CONDITION 4 | 5 | # PROP: Property of the annotated tree node 6 | # VALUE: Value of the property to be colored 7 | # COLOR: Color to apply 8 | # CONDITION: operator 9 | 10 | PROP,VALUE,COLOR,CONDITION 11 | random_type,low,red,= 12 | sample1,0.50,red,> 13 | -------------------------------------------------------------------------------- /examples/automatic_query/color.config.template: -------------------------------------------------------------------------------- 1 | # TreeProfiler Conditional query Configuration 2 | # This file defines custom colors for properties of annotated tree nodes. 3 | # Columns: PROP, VALUE, COLOR, CONDITION 4 | 5 | # PROP: Property of the annotated tree node 6 | # VALUE: Value of the property to be colored 7 | # COLOR: Color to apply 8 | # CONDITION: operator 9 | PROP,VALUE,COLOR,CONDITION -------------------------------------------------------------------------------- /examples/automatic_query/highlight_demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## annotate tree 4 | treeprofiler annotate \ 5 | --tree ./basic_example1.nw \ 6 | --input-type newick \ 7 | --metadata ./basic_example1_metadata1.tsv \ 8 | --bool-prop bool_type bool_type2 \ 9 | --counter-stat relative \ 10 | -o ./ 11 | 12 | 13 | # select tree node whose name contains `FALPE` character 14 | treeprofiler plot \ 15 | --tree ./basic_example1_annotated.nw \ 16 | --input-type newick \ 17 | --highlighted-by "name contains FALPE" 18 | 19 | 20 | # select tree node whose sample1 feature > 0.50, here we using ete format which can resume the datatype 21 | treeprofiler plot \ 22 | --tree ./basic_example1_annotated.ete \ 23 | --input-type ete \ 24 | --highlighted-by "sample1 > 0.50" \ 25 | --heatmap-layout sample1 26 | 27 | # if use tree in newick format, we need to attach the prop2type file which can resume the datatype 28 | treeprofiler plot \ 29 | --tree basic_example1_annotated.nw \ 30 | --input-type newick \ 31 | --prop2type basic_example1_prop2type.txt \ 32 | --highlighted-by "sample1 > 0.50" \ 33 | --heatmap-layout sample1 34 | 35 | 36 | # select tree node where sample1 feature > 0.50 AND sample2 < 0.2 37 | treeprofiler plot \ 38 | --tree basic_example1_annotated.ete \ 39 | --input-type ete \ 40 | --heatmap-layout sample1 sample2 sample3 sample4 sample5 \ 41 | --highlighted-by "sample1>0.50,sample2<0.2" 42 | 43 | # select tree node where sample1 feature > 0.50 OR sample2 < 0.2 44 | treeprofiler plot \ 45 | --tree basic_example1_annotated.ete \ 46 | --input-type ete \ 47 | --heatmap-layout sample1 sample2 sample3 sample4 sample5 \ 48 | --highlighted-by "sample1>0.50" \ 49 | --highlighted-by "sample2<0.2" -------------------------------------------------------------------------------- /examples/automatic_query/prune_demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## annotate tree 4 | treeprofiler annotate \ 5 | --tree ./basic_example1.nw \ 6 | --input-type newick \ 7 | --metadata ./basic_example1_metadata1.tsv \ 8 | --bool-prop bool_type bool_type2 \ 9 | --counter-stat relative \ 10 | -o ./ 11 | 12 | # Conditional pruning, prune leaf node whose name contain "FALPE" 13 | treeprofiler plot \ 14 | --tree basic_example1_annotated.ete \ 15 | --pruned-by "name contains FALPE" -------------------------------------------------------------------------------- /examples/basic_example0/boolean.tsv: -------------------------------------------------------------------------------- 1 | #name,boolean_column,integer_column 2 | Taxa_0,True,0 3 | Taxa_1,True,1 4 | Taxa_2,False,0 5 | Taxa_3,False,1 6 | Taxa_4,True,0 -------------------------------------------------------------------------------- /examples/basic_example0/categorical.tsv: -------------------------------------------------------------------------------- 1 | name,categorical1 2 | Taxa_0,A 3 | Taxa_1,B 4 | Taxa_2,B 5 | Taxa_3,C 6 | Taxa_4,C -------------------------------------------------------------------------------- /examples/basic_example0/categorical_ancestor.tsv: -------------------------------------------------------------------------------- 1 | name,categorical1 2 | Taxa_0,A 3 | Taxa_1,B 4 | Taxa_2,B 5 | Taxa_3,C 6 | Taxa_4,C 7 | Taxa_0||Taxa_1,A 8 | Taxa_2||Taxa_4,C -------------------------------------------------------------------------------- /examples/basic_example0/categorical_duplicated.tsv: -------------------------------------------------------------------------------- 1 | #name,categorical1 2 | Taxa_0,A 3 | Taxa_0,B 4 | Taxa_2,B 5 | Taxa_2,C 6 | Taxa_3,C 7 | Taxa_3,A 8 | Taxa_4,C -------------------------------------------------------------------------------- /examples/basic_example0/data.array: -------------------------------------------------------------------------------- 1 | Taxa_0,-2.591,1.937,-3.898,0.447,-1.349 2 | Taxa_1,3.366,-1.871,4.362,1.585,-2.479 3 | Taxa_2,0,-0.098,0,-3.326,2.746 4 | Taxa_3,3.671,-0.947,-4.509,-3.131,-2.194 5 | Taxa_4,0.676,-2.356,-4.825,0.115,0 -------------------------------------------------------------------------------- /examples/basic_example0/demo1.tree: -------------------------------------------------------------------------------- 1 | ((Taxa_3:0.219065,(Taxa_4:0.188681,Taxa_2:0.5196)0.166914:0.90365)0.138062:0.0632016,(Taxa_0:0.190563,Taxa_1:0.458423)0.138062:0.97338); 2 | -------------------------------------------------------------------------------- /examples/basic_example0/numerical.tsv: -------------------------------------------------------------------------------- 1 | name,random_column1,random_column2,random_column3 2 | Taxa_0,0.45303222603186877,1.9801547427961053,43 3 | Taxa_1,0.3276816717486982,2.901485035789767,18 4 | Taxa_2,0.7817176831389784,0.8169962886608579,88 5 | Taxa_3,0.538278090458638,-2.9731013860390583,95 6 | Taxa_4,0.5915676489932427,-2.0927680151507433,17 7 | -------------------------------------------------------------------------------- /examples/basic_example0/run_demo.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/examples/basic_example0/run_demo.sh -------------------------------------------------------------------------------- /examples/basic_example0/show_tree_props.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from ete4 import Tree 3 | 4 | filename = sys.argv[1] 5 | 6 | t = Tree(open(filename), parser=1) 7 | 8 | print("Target tree internal node Root contains the following properties: ") 9 | print(t.props) 10 | 11 | print("Target tree leaf node Taxa_0 contains the following propertiies: ") 12 | print(t['Taxa_0'].props) -------------------------------------------------------------------------------- /examples/basic_example0/show_tree_props_ancestor.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from ete4 import Tree 3 | 4 | filename = sys.argv[1] 5 | 6 | t = Tree(open(filename), parser=1) 7 | 8 | print("Target tree internal node if Taxa_0 and Taxa_1 contains the following properties: ") 9 | print(t.common_ancestor(['Taxa_0', 'Taxa_1']).props) 10 | -------------------------------------------------------------------------------- /examples/basic_example1/basic_example1.nw: -------------------------------------------------------------------------------- 1 | ((Phy004OQ34_STRCA:0.0568325,(Phy004PA1B_ANAPL:0.0321232,(Phy0054BO3_MELGA:0.0174991,Phy003I7ZJ_CHICK:0.0135553)1:0.0754738)0.954:0.033434)0.985:0.0208482,(Phy004VACL_55661:0.12776,(((Phy004Y9VQ_LEPDC:0.0622317,Phy00508FR_NIPNI:0.0255705)0.908:0.0173668,((Phy004XRVA_HALAL:5e-09,Phy004Y35P_HALLE:5e-09)0.997:0.0287387,(Phy0050IUO_OPIHO:0.0971924,(Phy004W8WJ_FALPE:0.0133407,Phy004W8WI_FALPE:0.0151088)0.98:0.034729)0.62:0.000998087)0.5:0.00509275)0.605:0.00450124,(((((Phy004Z0OU_MELUD:0.0946703,Phy004V34S_CORBR:0.0843079)0.946:0.0296135,(Phy004U0LB_BUCRH:0.0424413,Phy004Z7RR_MERNU:0.115361)0.692:0.00300258)0.834:0.0131996,(Phy004TLNA_APAVI:0.0443506,Phy00527O5_PICPB:0.0684612)0.505:0.00933244)0.913:0.0128688,Phy004STVX_187382:0.0385265)0.819:0.00468641,(((Phy004O1E0_APTFO:0.0038266,Phy00535AU_PYGAD:0.0330561)0.97:0.0122123,(Phy004SNJQ_CHAVO:0.0713465,Phy004UIZ8_CALAN:0.0575794)0.88:0.0102997)0.655:0.000904602,(Phy004OLZM_COLLI:0.0203921,Phy004OLZN_COLLI:5e-09)1:0.0549953)0.775:0.00198396)0.87:0.00477864)0.724:0.00743975)0.985:0.0208482); -------------------------------------------------------------------------------- /examples/basic_example1/basic_example1_metadata.tsv: -------------------------------------------------------------------------------- 1 | #name sample1 sample2 sample3 sample4 sample5 random_type bool_type bool_type2 abs_data list_data abs_data2 2 | Phy003I7ZJ_CHICK 0.05 0.12 0.86 0.01 0.69 medium 1 TRUE 97 w,t,t 50 3 | Phy0054BO3_MELGA 0.64 0.67 0.51 0.29 0.14 medium 1 TRUE 16 r,q,s 245 4 | Phy00508FR_NIPNI 0.89 0.38 0.97 0.49 0.26 low 1 FALSE 87 z,f,p 122 5 | Phy004O1E0_APTFO 0.1 0.09 0.38 0.31 0.41 medium 0 TRUE 6 z,t,b 138 6 | Phy004PA1B_ANAPL 0.77 0.03 0.52 0.07 0.23 medium 1 TRUE 72 z,r,p 201 7 | Phy004TLNA_APAVI 0.05 0.3 0.61 0.45 0.47 medium 1 FALSE 22 u,e,i 148 8 | Phy004OLZM_COLLI 0.82 0.34 0.2 0.06 0.12 low 0 TRUE 36 u,w,v 199 9 | Phy004OQ34_STRCA 0.46 0.76 0.08 0.79 0.17 high 1 FALSE 59 k,f,g 221 10 | Phy00527O5_PICPB 0.68 0.27 0.89 0.36 0.49 high 1 FALSE 75 z,m,w 127 11 | Phy004STVX_187382 0.33 0.95 0.22 0.34 0.38 low 1 TRUE 44 f,x,v 224 12 | Phy004UIZ8_CALAN 0.87 0.26 0.33 0.67 0.74 medium 1 TRUE 74 p,f,b 207 13 | Phy004SNJQ_CHAVO 0.56 0.76 0.27 0.84 0.52 medium 0 FALSE 77 d,b,e 146 14 | Phy0050IUO_OPIHO 0.4 0.78 0.53 0.42 0.46 medium 1 FALSE 34 p,s,z 182 15 | Phy004OLZN_COLLI 0.9 0.89 0.48 0.48 0.13 low 1 FALSE 31 o,y,n 127 16 | Phy004W8WI_FALPE 0.8 0.64 0.93 0.38 0.55 medium 0 TRUE 81 r,q,v 206 17 | Phy004W8WJ_FALPE 0.31 0.48 0.22 0.83 0.36 medium 1 FALSE 20 d,u,b 250 18 | Phy004U0LB_BUCRH -0.26 0.67 0.87 0.83 0.01 high 1 FALSE 67 q,t,b 161 19 | Phy004VACL_55661 -0.38 0.6 0.84 0.54 0.02 low 0 FALSE 33 h,m,i 101 20 | Phy004V34S_CORBR 0.96 0.73 0.23 0.57 0.35 low 0 FALSE 62 k,o,y 177 21 | Phy004Z0OU_MELUD -0.8 0.03 0.56 0.32 0.63 medium 1 FALSE 41 z,m,x 183 22 | Phy004Y35P_HALLE -0.68 0.07 0.91 0.8 0.06 high 0 TRUE 45 w,d,o 122 23 | Phy00535AU_PYGAD -0.34 0.73 0.3 0.39 0.2 high 1 FALSE 1 e,w,n 183 24 | Phy004Y9VQ_LEPDC -0.49 0.27 0.02 0.61 0.58 low 0 FALSE 3 t,z,y 125 25 | Phy004XRVA_HALAL -0.21 0.16 0.53 0.11 0.62 high 1 FALSE 96 j,l,j 198 26 | Phy004Z7RR_MERNU -0.85 0.12 0.33 0.19 0.81 low 0 FALSE 51 y,j,w 89 27 | -------------------------------------------------------------------------------- /examples/basic_example1/basic_example1_metadata1.tsv: -------------------------------------------------------------------------------- 1 | #name sample1 sample2 sample3 sample4 sample5 random_type bool_type bool_type2 2 | Phy003I7ZJ_CHICK 0.05 0.12 0.86 0.01 0.69 medium 1 TRUE 3 | Phy0054BO3_MELGA 0.64 0.67 0.51 0.29 0.14 medium 1 TRUE 4 | Phy00508FR_NIPNI 0.89 0.38 0.97 0.49 0.26 low 1 FALSE 5 | Phy004O1E0_APTFO 0.1 0.09 0.38 0.31 0.41 medium 0 TRUE 6 | Phy004PA1B_ANAPL 0.77 0.03 0.52 0.07 0.23 medium 1 TRUE 7 | Phy004TLNA_APAVI 0.05 0.3 0.61 0.45 0.47 medium 1 FALSE 8 | Phy004OLZM_COLLI 0.82 0.34 0.2 0.06 0.12 low 0 TRUE 9 | Phy004OQ34_STRCA 0.46 0.76 0.08 0.79 0.17 high 1 FALSE 10 | Phy00527O5_PICPB 0.68 0.27 0.89 0.36 0.49 high 1 FALSE 11 | Phy004STVX_187382 0.33 0.95 0.22 0.34 0.38 low 1 TRUE 12 | Phy004UIZ8_CALAN 0.87 0.26 0.33 0.67 0.74 medium 1 TRUE 13 | Phy004SNJQ_CHAVO 0.56 0.76 0.27 0.84 0.52 medium 0 FALSE 14 | Phy0050IUO_OPIHO 0.4 0.78 0.53 0.42 0.46 medium 1 FALSE 15 | Phy004OLZN_COLLI 0.9 0.89 0.48 0.48 0.13 low 1 FALSE 16 | Phy004W8WI_FALPE 0.8 0.64 0.93 0.38 0.55 medium 0 TRUE 17 | Phy004W8WJ_FALPE 0.31 0.48 0.22 0.83 0.36 medium 1 FALSE 18 | Phy004U0LB_BUCRH -0.26 0.67 0.87 0.83 0.01 high 1 FALSE 19 | Phy004VACL_55661 -0.38 0.6 0.84 0.54 0.02 low 0 FALSE 20 | Phy004V34S_CORBR 0.96 0.73 0.23 0.57 0.35 low 0 FALSE 21 | Phy004Z0OU_MELUD -0.8 0.03 0.56 0.32 0.63 medium 1 FALSE 22 | Phy004Y35P_HALLE -0.68 0.07 0.91 0.8 0.06 high 0 TRUE 23 | Phy00535AU_PYGAD -0.34 0.73 0.3 0.39 0.2 high 1 FALSE 24 | Phy004Y9VQ_LEPDC -0.49 0.27 0.02 0.61 0.58 low 0 FALSE 25 | Phy004XRVA_HALAL -0.21 0.16 0.53 0.11 0.62 high 1 FALSE 26 | Phy004Z7RR_MERNU -0.85 0.12 0.33 0.19 0.81 low 0 FALSE 27 | -------------------------------------------------------------------------------- /examples/basic_example1/basic_example1_metadata2.tsv: -------------------------------------------------------------------------------- 1 | #name abs_data list_data abs_data2 2 | Phy003I7ZJ_CHICK 97 w,t,t 50 3 | Phy0054BO3_MELGA 16 r,q,s 245 4 | Phy00508FR_NIPNI 87 z,f,p 122 5 | Phy004O1E0_APTFO 6 z,t,b 138 6 | Phy004PA1B_ANAPL 72 z,r,p 201 7 | Phy004TLNA_APAVI 22 u,e,i 148 8 | Phy004OLZM_COLLI 36 u,w,v 199 9 | Phy004OQ34_STRCA 59 k,f,g 221 10 | Phy00527O5_PICPB 75 z,m,w 127 11 | Phy004STVX_187382 44 f,x,v 224 12 | Phy004UIZ8_CALAN 74 p,f,b 207 13 | Phy004SNJQ_CHAVO 77 d,b,e 146 14 | Phy0050IUO_OPIHO 34 p,s,z 182 15 | Phy004OLZN_COLLI 31 o,y,n 127 16 | Phy004W8WI_FALPE 81 r,q,v 206 17 | Phy004W8WJ_FALPE 20 d,u,b 250 18 | Phy004U0LB_BUCRH 67 q,t,b 161 19 | Phy004VACL_55661 33 h,m,i 101 20 | Phy004V34S_CORBR 62 k,o,y 177 21 | Phy004Z0OU_MELUD 41 z,m,x 183 22 | Phy004Y35P_HALLE 45 w,d,o 122 23 | Phy00535AU_PYGAD 1 e,w,n 183 24 | Phy004Y9VQ_LEPDC 3 t,z,y 125 25 | Phy004XRVA_HALAL 96 j,l,j 198 26 | Phy004Z7RR_MERNU 51 y,j,w 89 27 | -------------------------------------------------------------------------------- /examples/basic_example1/example1_demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # *Annotate multiple metadatas into tree, seperated by , 4 | echo "Annotate example tree with two metadata tables" 5 | treeprofiler annotate \ 6 | --tree basic_example1.nw \ 7 | --input-type newick \ 8 | --metadata basic_example1_metadata1.tsv basic_example1_metadata2.tsv \ 9 | -o ./ 10 | 11 | echo "Visualize properties categorical data random_type in rectangle_layout, numerical data sample1, sample2 in heatmap_layout and barplot_layout." 12 | treeprofiler plot \ 13 | --tree basic_example1_annotated.ete \ 14 | --input-type ete \ 15 | --rectangle-layout random_type \ 16 | --binary-layout bool_type \ 17 | --heatmap-layout sample1 sample2 sample3 \ 18 | --barplot-layout sample4 sample5 \ 19 | --profiling-layout random_type \ 20 | --column-width 40 \ 21 | --padding-x 3 22 | 23 | # **Visualize categorical properties 'random_type' with differen layouts 24 | echo "Visualize annotated example tree by showing categorical property random_type with label_layout, rectangle_layout and colorbranch_layout." 25 | treeprofiler plot \ 26 | --tree basic_example1_annotated.ete \ 27 | --rectangle-layout random_type 28 | 29 | treeprofiler plot \ 30 | --tree basic_example1_annotated.ete \ 31 | --colorbranch-layout random_type 32 | 33 | treeprofiler plot \ 34 | --tree basic_example1_annotated.ete \ 35 | --label-layout random_type 36 | 37 | treeprofiler plot \ 38 | --tree basic_example1_annotated.ete \ 39 | --background-layout random_type 40 | 41 | treeprofiler plot \ 42 | --tree basic_example1_annotated.ete \ 43 | --piechart-layout random_type 44 | 45 | # Convert ategorical properties random_type into presence-absence profiling matrix using --profiling_layout 46 | echo "Visualize random_type into presence-absence profiling matrix" 47 | treeprofiler plot \ 48 | --tree basic_example1_annotated.ete \ 49 | --input-type ete \ 50 | --profiling-layout random_type 51 | 52 | # Visualize list data 53 | echo "Visualize annotated example tree by showing presence-absence matrix of composition of each element of property list_data with multi_profiling_layout" 54 | treeprofiler plot \ 55 | --tree basic_example1_annotated.ete \ 56 | --input-type ete \ 57 | --profiling-layout list_data 58 | 59 | # Visualize binary data 60 | echo "Visualize annotated example tree by showing boolean property bool_type with binary_layout and bool_type2 with revbinary_layout." 61 | treeprofiler plot \ 62 | --tree basic_example1_annotated.ete \ 63 | --input-type ete \ 64 | --binary-layout bool_type bool_type2 65 | 66 | treeprofiler plot \ 67 | --tree basic_example1_annotated.ete \ 68 | --input-type ete \ 69 | --binary-aggregate-layout bool_type bool_type2 70 | 71 | treeprofiler plot \ 72 | --tree basic_example1_annotated.ete \ 73 | --input-type ete \ 74 | --binary-unicolor-layout bool_type bool_type2 75 | 76 | treeprofiler plot \ 77 | --tree basic_example1_annotated.ete \ 78 | --input-type ete \ 79 | --binary-unicolor-aggregate-layout bool_type bool_type2 80 | 81 | treeprofiler plot \ 82 | --tree basic_example1_annotated.ete \ 83 | --input-type ete \ 84 | --binary-matrix-layout bool_type bool_type2 85 | 86 | # Visualize numerical data 87 | echo "Visualize annotated example tree by showing numerical property sample[1-5] with heatmap_layout, and abs_data with barplot_layout" 88 | treeprofiler plot \ 89 | --tree basic_example1_annotated.ete \ 90 | --colorbranch-layout dist sample1 91 | 92 | treeprofiler plot \ 93 | --tree basic_example1_annotated.ete \ 94 | --heatmap-layout sample1 sample2 sample3 sample4 sample5 95 | 96 | treeprofiler plot \ 97 | --tree basic_example1_annotated.ete \ 98 | --heatmap-mean-layout sample1 sample2 sample3 sample4 sample5 99 | 100 | treeprofiler plot \ 101 | --tree basic_example1_annotated.ete \ 102 | --heatmap-zscore-layout sample1 sample2 sample3 sample4 sample5 103 | 104 | treeprofiler plot \ 105 | --tree basic_example1_annotated.ete \ 106 | --bubble-layout sample1 sample2 sample3 sample4 sample5 107 | 108 | # Visualize numerical data with barplot 109 | echo "Visualize annotated example tree by showing numerical property abs_data[1-2] with barplot_layout" 110 | treeprofiler plot \ 111 | --tree basic_example1_annotated.ete \ 112 | --input-type ete \ 113 | --barplot-layout abs_data abs_data2 \ 114 | --barplot-width 250 \ 115 | --barplot-scale abs_data 116 | 117 | # Visualize numerical data with different heatmap normalization methods 118 | echo "Visualize annotated example tree by showing numerical property sample[1-5] with heatmap_layout" 119 | treeprofiler plot \ 120 | --tree basic_example1_annotated.ete \ 121 | --input-type ete \ 122 | --heatmap-layout sample1 sample2 sample3 sample4 sample5 123 | 124 | treeprofiler plot \ 125 | --tree basic_example1_annotated.ete \ 126 | --input-type ete \ 127 | --heatmap-mean-layout sample1 sample2 sample3 sample4 sample5 128 | 129 | treeprofiler plot \ 130 | --tree basic_example1_annotated.ete \ 131 | --input-type ete \ 132 | --heatmap-zscore-layout sample1 sample2 sample3 sample4 sample5 133 | 134 | # Visualize numerical data with numerial matrix layout 135 | echo "Visualize annotated example tree by showing numerical property sample[1-5] with numerical matrix" 136 | treeprofiler plot \ 137 | --tree basic_example1_annotated.ete \ 138 | --input-type ete \ 139 | --numerical-matrix-layout sample1 sample2 sample3 sample4 sample5 140 | 141 | -------------------------------------------------------------------------------- /examples/basic_example2/MCC_FluA_H3.nw: -------------------------------------------------------------------------------- 1 | ((((A/Ho_Chi_Minh/459.6/2010:0.817173,(A/Swine/HK/2857/2011:0.445517,(A/Swine/HK/2454/2012:1.09181,A/Swine/HK/1071/2012:1.09181)1:0.353702)1:1.37166)1:0.850062,(((A/Swine/GX_NS3106/2011:0.250125,A/Swine/GX_NS3108/2011:0.250125)1:0.382378,A/Swine/GX/2803/2011:0.632503)1:1.09215,(((A/Swine/HK_NS2439/2011:0.819138,(A/Swine/HK/2503/2011:0.641632,A/Swine/HK_NS2733/2012:1.64163)1:0.177506)1:0.374295,A/Swine/GX_NS2783/2010:0.193432)1:0.404295,(((A/Swine/HK/3238/2011:0.596238,((A/Swine/HK_NS2698/2012:1.20451,(A/Swine/GX_NS2394/2012:0.965017,A/Swine/HK/1284/2012:0.965017)1:0.239488)1:0.336576,(A/Swine/HK/3700/2011:0.232946,(A/Swine/HK/168/2012:0.942846,A/Swine/GD/1599/2012:0.942846)1:0.2901)1:0.308136)1:0.0551568)1:0.201832,(A/Swine/GD/3767/2011:0.627528,(A/Swine/HK/459/2012:1.49581,A/Swine/HK_NS2810/2011:0.495808)1:0.13172)1:0.170542)1:0.106745,(((A/Swine/GX/508/2012:1.04157,A/Swine/GX/2242/2011:0.0415737)1:0.273239,((A/Swine/HK/3280/2012:0.998586,A/Swine/GX/650/2012:0.998586)1:0.126725,(A/Swine/GX_NS1409/2012:0.721517,(A/Swine/GD_NS2892/2012:0.458781,A/Swine/GD_NS2701/2012:0.458781)1:0.262735)1:0.403794)1:0.189502)1:0.160639,(A/Swine/GD/2919/2012:0.862203,A/Swine/HK_NS1651/2012:0.862203)1:0.613249)1:0.429363)1:0.692912)1:0.126929)1:0.942579)1:0.975537,(A/Swine/Binh_Duong/03_10/2010:0.190485,A/Swine/Binh_Duong/03_08/2010:0.190485)1:2.45229)1:1.74938,((((A/South_Carolina/NHRC0001/2006:1.27248,(((A/California/UR06-0589/2007:1.63347,((((A/Kyrgyzstan/WRAIR1255P/2008:0.545095,(A/California/VRDL165/2009:1.16698,((A/Singapore/H2010.559C/2010:0.375559,A/Czech_Republic/126/2012:2.37556)1:0.885349,(A/New_York/20342/2010:0.950061,(A/Boston/DOA52/2011:1.58677,((A/Czech_Republic/119/2012:0.741535,A/Petrozavodsk/RII01/2012:0.741535)1:0.527776,(A/Hokkaido/30-1-a/2013:1.7133,A/Moscow/RII05/2012:0.713297)1:0.556014)1:1.31746)1:0.363293)1:0.310847)1:0.906068)1:0.378118)1:0.17855,A/Thailand/CU370/2008:0.723645)1:0.787556,(A/California/UR07-0017/2008:1.27758,A/Ohio/UR07-0105/2008:1.27758)1:0.233618)1:0.949355,A/Brisbane/09/2006:0.460556)1:0.172917)1:0.34287,A/Colorado/UR06-0023/2007:1.97634)1:0.18225,A/Tokyo/Ut-Sk-1/2007:2.15859)1:0.113887)1:0.282897,(A/California/NHRC0001/2005:0.470605,A/Hong_Kong/NHRC0001/2005:0.470605)1:0.0847724)1:0.118838,(A/Mexico/InDRE29/2006:1.26699,A/Mexico/InDRE2160/2005:0.266995)1:0.407221)1:0.467309,(((A/New_York/238/2005:0.758404,A/Netherlands/42/2006:1.7584)1:0.342386,A/New_York/463/2005:1.10079)1:0.212156,(A/New_York/334/2004:0.498764,(A/Malaysia/29890/2004:0.693689,(A/Hong_Kong/HKU39/2004:1.27302,((A/Malaysia/29997/2004:1.51224,A/Western_Australia/38/2003:0.512237)1:0.333238,((A/Moscow/328/2003:0.752734,A/Hanoi/BM767/2003:0.752734)1:0.297636,(A/HaNoi/BM544/2004:2.91959,(A/HaNoi/1766/2001:1.1215,(A/Netherlands/126/2001:1.74137,(A/New_York/435/2000:1.01408,(A/Auckland/615/2002:3.2658,(A/Malaysia/10816/1999:0.621964,(A/Malaysia/12990/1999:0.941532,(A/New_York/452/1999:1.45152,(A/New_York/523/1998:0.986257,(A/New_York/603/1996:1.11501,(A/New_York/582/1996:1.97883,A/New_York/657/1994:4.56797)1:0.863818)1:2.12876)1:0.534732)1:0.509992)1:0.319568)1:0.356168)1:0.251713)1:0.272712)1:0.619874)1:1.20191)1:0.86922)1:0.204894)1:0.572451)1:0.579335)1:0.194925)1:0.185818)1:0.171421)1:1.74938); -------------------------------------------------------------------------------- /examples/basic_example2/MCC_FluA_H3_Genotype.txt: -------------------------------------------------------------------------------- 1 | #name PB2 PB1 PA HA NP NA M NS 2 | A/Swine/Binh_Duong/03_10/2010 trig trig trig HuH3N2 trig HuH3N2 trig trig 3 | A/Swine/Binh_Duong/03_08/2010 trig trig trig HuH3N2 trig HuH3N2 trig trig 4 | A/Swine/HK/2857/2011 pdm pdm pdm HuH3N2 trig HuH3N2 pdm pdm 5 | A/Swine/HK/1071/2012 pdm pdm pdm HuH3N2 trig HuH3N2 pdm pdm 6 | A/Swine/HK/2454/2012 pdm pdm pdm HuH3N2 trig HuH3N2 pdm pdm 7 | A/Swine/GX_NS2783/2010 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 8 | A/Swine/HK_NS2733/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 9 | A/Swine/HK_NS2439/2011 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 10 | A/Swine/HK/2503/2011 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 11 | A/Swine/GX/2803/2011 pdm trig pdm HuH3N2 pdm HuH3N2 pdm pdm 12 | A/Swine/GX_NS3108/2011 pdm trig pdm HuH3N2 pdm HuH3N2 pdm pdm 13 | A/Swine/GX_NS3106/2011 pdm trig pdm HuH3N2 pdm HuH3N2 pdm pdm 14 | A/Swine/GD/3767/2011 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 15 | A/Swine/GX_NS2394/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 16 | A/Swine/HK_NS2698/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 17 | A/Swine/HK/1284/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 18 | A/Swine/HK/3238/2011 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 19 | A/Swine/HK/459/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 20 | A/Swine/HK_NS2810/2011 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 21 | A/Swine/HK/3700/2011 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 22 | A/Swine/HK/168/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 23 | A/Swine/GD/1599/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 24 | A/Swine/HK_NS1651/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 25 | A/Swine/GD/2919/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 26 | A/Swine/GX/650/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 27 | A/Swine/GX/2242/2011 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 28 | A/Swine/GX/508/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 29 | A/Swine/HK/3280/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm pdm 30 | A/Swine/GX_NS1409/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm trig 31 | A/Swine/GD_NS2701/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm trig 32 | A/Swine/GD_NS2892/2012 pdm pdm pdm HuH3N2 pdm HuH3N2 pdm trig 33 | A/Ho_Chi_Minh/459.6/2010 HuH3N2 HuH3N2 pdm 34 | A/Auckland/615/2002 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 35 | A/Boston/DOA52/2011 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 36 | A/Brisbane/09/2006 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 37 | A/California/NHRC0001/2005 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 38 | A/California/UR06-0589/2007 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 39 | A/California/UR07-0017/2008 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 40 | A/California/VRDL165/2009 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 41 | A/Colorado/UR06-0023/2007 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 42 | A/Czech_Republic/119/2012 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 43 | A/Czech_Republic/126/2012 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 44 | A/HaNoi/1766/2001 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 45 | A/HaNoi/BM544/2004 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 46 | A/Hanoi/BM767/2003 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 47 | A/Hokkaido/30-1-a/2013 HuH3N2 HuH3N2 48 | A/Hong_Kong/HKU39/2004 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 49 | A/Hong_Kong/NHRC0001/2005 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 50 | A/Kyrgyzstan/WRAIR1255P/2008 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 51 | A/Malaysia/10816/1999 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 52 | A/Malaysia/12990/1999 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 53 | A/Malaysia/29890/2004 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 54 | A/Malaysia/29997/2004 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 55 | A/Mexico/InDRE2160/2005 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 56 | A/Mexico/InDRE29/2006 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 57 | A/Moscow/328/2003 HuH3N2 HuH3N2 HuH3N2 HuH3N2 58 | A/Moscow/RII05/2012 HuH3N2 HuH3N2 HuH3N2 59 | A/Netherlands/126/2001 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 60 | A/Netherlands/42/2006 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 61 | A/New_York/20342/2010 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 62 | A/New_York/238/2005 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 63 | A/New_York/334/2004 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 64 | A/New_York/435/2000 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 65 | A/New_York/452/1999 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 66 | A/New_York/463/2005 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 67 | A/New_York/523/1998 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 68 | A/New_York/582/1996 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 69 | A/New_York/603/1996 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 70 | A/New_York/657/1994 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 71 | A/Ohio/UR07-0105/2008 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 72 | A/Petrozavodsk/RII01/2012 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 73 | A/Singapore/H2010.559C/2010 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 74 | A/South_Carolina/NHRC0001/2006 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 75 | A/Thailand/CU370/2008 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 76 | A/Tokyo/Ut-Sk-1/2007 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 77 | A/Western_Australia/38/2003 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 HuH3N2 78 | -------------------------------------------------------------------------------- /examples/basic_example2/example2_demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # annotate diauxic tree with diauxic numerical matrix metadata 5 | echo "annotate diauxic tree with diauxic numerical matrix metadata" 6 | treeprofiler annotate \ 7 | --tree diauxic.nw \ 8 | --input-type newick \ 9 | --metadata diauxic.array \ 10 | --internal name \ 11 | --outdir ./ 12 | 13 | # visualize annotated diauxic tree by showing numerical data from col1-col7 with numerical matrix 14 | echo "visualize annotated diauxic tree by showing numerical data from col1-col7 with numerical matrix" 15 | treeprofiler plot \ 16 | --tree diauxic_annotated.ete \ 17 | --input-type ete \ 18 | --numerical-matrix-layout col1 col2 col3 col4 col5 col6 col7 19 | 20 | # annotate diauxic tree with diauxic numerical matrix metadata 21 | echo "annotate diauxic tree with diauxic data matrix as one property" 22 | treeprofiler annotate \ 23 | --tree diauxic.nw \ 24 | --input-type newick \ 25 | --data-matrix diauxic.array \ 26 | --internal name \ 27 | --outdir ./ 28 | 29 | treeprofiler plot \ 30 | --tree diauxic_annotated.ete \ 31 | --input-type ete \ 32 | --numerical-matrix-layout diauxic.array 33 | 34 | # annotate MCC_FluA_H3 tree with MCC_FluA_H3_Genotype metadata and MCC_FluA_H3 multiple sequence alignment 35 | echo "annotate MCC_FluA_H3 tree with MCC_FluA_H3_Genotype metadata and MCC_FluA_H3 multiple sequence alignment" 36 | treeprofiler annotate \ 37 | --tree MCC_FluA_H3.nw \ 38 | --input-type newick \ 39 | --internal support \ 40 | --metadata MCC_FluA_H3_Genotype.txt \ 41 | --alignment FluA_H3_AA.fas \ 42 | --outdir ./ 43 | 44 | # Visualize annotated MCC_FluA_H3 tree all feature with retangular block in aligned panel using --categorical_matrix_layout 45 | echo "visualize annotated MCC_FluA_H3 tree all feature with retangular block" 46 | treeprofiler plot \ 47 | --tree MCC_FluA_H3_annotated.nw \ 48 | --input-type newick \ 49 | --categorical-matrix-layout PB2 PB1 PA HA NP NA M NS 50 | 51 | # visualize MCC_FluA_H3 MSA 52 | echo "visualize MCC_FluA_H3 tree with MSA " 53 | treeprofiler plot \ 54 | --tree MCC_FluA_H3_annotated.nw \ 55 | --input-type newick \ 56 | --alignment-layout 57 | -------------------------------------------------------------------------------- /examples/custom_color/basic_example1.nw: -------------------------------------------------------------------------------- 1 | ((Phy004OQ34_STRCA:0.0568325,(Phy004PA1B_ANAPL:0.0321232,(Phy0054BO3_MELGA:0.0174991,Phy003I7ZJ_CHICK:0.0135553):0.0754738):0.033434):0.0208482,(Phy004VACL_55661:0.12776,(((Phy004Y9VQ_LEPDC:0.0622317,Phy00508FR_NIPNI:0.0255705):0.0173668,((Phy004XRVA_HALAL:5e-09,Phy004Y35P_HALLE:5e-09):0.0287387,(Phy0050IUO_OPIHO:0.0971924,(Phy004W8WJ_FALPE:0.0133407,Phy004W8WI_FALPE:0.0151088):0.034729):0.000998087):0.00509275):0.00450124,(((((Phy004Z0OU_MELUD:0.0946703,Phy004V34S_CORBR:0.0843079):0.0296135,(Phy004U0LB_BUCRH:0.0424413,Phy004Z7RR_MERNU:0.115361):0.00300258):0.0131996,(Phy004TLNA_APAVI:0.0443506,Phy00527O5_PICPB:0.0684612):0.00933244):0.0128688,Phy004STVX_187382:0.0385265):0.00468641,(((Phy004O1E0_APTFO:0.0038266,Phy00535AU_PYGAD:0.0330561):0.0122123,(Phy004SNJQ_CHAVO:0.0713465,Phy004UIZ8_CALAN:0.0575794):0.0102997):0.000904602,(Phy004OLZM_COLLI:0.0203921,Phy004OLZN_COLLI:5e-09):0.0549953):0.00198396):0.00477864):0.00743975):0.0208482); -------------------------------------------------------------------------------- /examples/custom_color/basic_example1_metadata1.tsv: -------------------------------------------------------------------------------- 1 | #name sample1 sample2 sample3 sample4 sample5 random_type bool_type bool_type2 2 | Phy003I7ZJ_CHICK 0.05 0.12 0.86 0.01 0.69 medium 1 TRUE 3 | Phy0054BO3_MELGA 0.64 0.67 0.51 0.29 0.14 medium 1 TRUE 4 | Phy00508FR_NIPNI 0.89 0.38 0.97 0.49 0.26 low 1 FALSE 5 | Phy004O1E0_APTFO 0.1 0.09 0.38 0.31 0.41 medium 0 TRUE 6 | Phy004PA1B_ANAPL 0.77 0.03 0.52 0.07 0.23 medium 1 TRUE 7 | Phy004TLNA_APAVI 0 0.3 0.61 0.45 0.47 medium 1 FALSE 8 | Phy004OLZM_COLLI 0.82 0.34 0.2 0.06 0.12 low 0 TRUE 9 | Phy004OQ34_STRCA 0.46 0.76 0.08 0.79 0.17 high 1 FALSE 10 | Phy00527O5_PICPB 0.68 0.27 0.89 0.36 0.49 high 1 FALSE 11 | Phy004STVX_187382 0.33 0.95 0.22 0.34 0.38 low 1 TRUE 12 | Phy004UIZ8_CALAN 0.87 0.26 0.33 0.67 0.74 medium 1 TRUE 13 | Phy004SNJQ_CHAVO 0.56 0.76 0.27 0.84 0.52 medium 0 FALSE 14 | Phy0050IUO_OPIHO 0.4 0.78 0.53 0.42 0.46 medium 1 FALSE 15 | Phy004OLZN_COLLI 0.9 0.89 0.48 0.48 0.13 low 1 FALSE 16 | Phy004W8WI_FALPE 0.8 0.64 0.93 0.38 0.55 medium 0 TRUE 17 | Phy004W8WJ_FALPE 0.31 0.48 0.22 0.83 0.36 medium 1 FALSE 18 | Phy004U0LB_BUCRH -0.26 0.67 0.87 0.83 0.01 high 1 FALSE 19 | Phy004VACL_55661 -0.38 0.6 0.84 0.54 0.02 low 0 FALSE 20 | Phy004V34S_CORBR 0.96 0.73 0.23 0.57 0.35 low 0 FALSE 21 | Phy004Z0OU_MELUD -0.8 0.00 0.56 0.32 0.63 medium 1 FALSE 22 | Phy004Y35P_HALLE -0.68 0.07 0.91 0.8 0.06 high 0 TRUE 23 | Phy00535AU_PYGAD -0.34 0.73 0.3 0.39 0 high 1 FALSE 24 | Phy004Y9VQ_LEPDC -0.49 0.27 0 0.61 0.58 low 0 FALSE 25 | Phy004XRVA_HALAL -0.21 0.16 0.53 0 0.62 high 1 FALSE 26 | Phy004Z7RR_MERNU -0.85 0.12 0.33 0.19 0.81 low 0 FALSE 27 | -------------------------------------------------------------------------------- /examples/custom_color/basic_example1_metadata2.tsv: -------------------------------------------------------------------------------- 1 | #name abs_data list_data abs_data2 2 | Phy003I7ZJ_CHICK 97 w,t,t 50 3 | Phy0054BO3_MELGA 16 r,q,s 245 4 | Phy00508FR_NIPNI 87 z,f,p 122 5 | Phy004O1E0_APTFO 6 z,t,b 138 6 | Phy004PA1B_ANAPL 72 z,r,p 201 7 | Phy004TLNA_APAVI 22 u,e,i 148 8 | Phy004OLZM_COLLI 36 u,w,v 199 9 | Phy004OQ34_STRCA 59 k,f,g 221 10 | Phy00527O5_PICPB 75 z,m,w 127 11 | Phy004STVX_187382 44 f,x,v 224 12 | Phy004UIZ8_CALAN 74 p,f,b 207 13 | Phy004SNJQ_CHAVO 77 d,b,e 146 14 | Phy0050IUO_OPIHO 34 p,s,z 182 15 | Phy004OLZN_COLLI 31 o,y,n 127 16 | Phy004W8WI_FALPE 81 r,q,v 206 17 | Phy004W8WJ_FALPE 20 d,u,b 250 18 | Phy004U0LB_BUCRH 67 q,t,b 161 19 | Phy004VACL_55661 33 h,m,i 101 20 | Phy004V34S_CORBR 62 k,o,y 177 21 | Phy004Z0OU_MELUD 41 z,m,x 183 22 | Phy004Y35P_HALLE 45 w,d,o 122 23 | Phy00535AU_PYGAD 1 e,w,n 183 24 | Phy004Y9VQ_LEPDC 3 t,z,y 125 25 | Phy004XRVA_HALAL 96 j,l,j 198 26 | Phy004Z7RR_MERNU 51 y,j,w 89 27 | -------------------------------------------------------------------------------- /examples/custom_color/color.boolean.config: -------------------------------------------------------------------------------- 1 | # TreeProfiler Color Configuration 2 | # This file defines custom colors for properties of annotated tree nodes. 3 | # Columns: PROP, VALUE, COLOR, CONDITION 4 | 5 | # PROP: Property of the annotated tree node 6 | # VALUE: Value of the property to be colored 7 | # COLOR: Color to apply 8 | # CONDITION: Special case for numerical values (optional, e.g., COLOR_MIN, COLOR_MAX, COLOR_MID) 9 | 10 | PROP,VALUE,COLOR,CONDITION 11 | bool_type,True,blue, 12 | bool_type2,True,yellow, 13 | 14 | -------------------------------------------------------------------------------- /examples/custom_color/color.categorical.config: -------------------------------------------------------------------------------- 1 | # TreeProfiler Color Configuration 2 | # This file defines custom colors for properties of annotated tree nodes. 3 | # Columns: PROP, VALUE, COLOR, CONDITION 4 | 5 | # PROP: Property of the annotated tree node 6 | # VALUE: Value of the property to be colored 7 | # COLOR: Color to apply 8 | # CONDITION: Special case for numerical values (optional, e.g., COLOR_MIN, COLOR_MAX, COLOR_MID) 9 | 10 | PROP,VALUE,COLOR,CONDITION 11 | random_type,high,red, 12 | random_type,medium,blue, 13 | #random_type,low,#008000, 14 | -------------------------------------------------------------------------------- /examples/custom_color/color.config.template: -------------------------------------------------------------------------------- 1 | # TreeProfiler Color Configuration 2 | # This file defines custom colors for properties of annotated tree nodes. 3 | # Columns: PROP, VALUE, COLOR, CONDITION 4 | 5 | # PROP: Property of the annotated tree node 6 | # VALUE: Value of the property to be colored 7 | # COLOR: Color to apply 8 | # CONDITION: Special case for numerical values (optional, e.g., COLOR_MIN, COLOR_MAX, COLOR_MID) 9 | 10 | PROP,VALUE,COLOR,CONDITION 11 | -------------------------------------------------------------------------------- /examples/custom_color/color.datamatrix.config: -------------------------------------------------------------------------------- 1 | # TreeProfiler Color Configuration 2 | # This file defines custom colors for properties of annotated tree nodes. 3 | # Columns: PROP, VALUE, COLOR, CONDITION 4 | 5 | # PROP: Property of the annotated tree node 6 | # VALUE: Value of the property to be colored 7 | # COLOR: Color to apply 8 | # CONDITION: Special case for numerical values (optional, e.g., COLOR_MIN, COLOR_MAX, COLOR_MID) 9 | 10 | PROP,VALUE,COLOR,CONDITION 11 | *,5,red,COLOR_MAX 12 | *,0,white,COLOR_MID 13 | *,-5,blue,COLOR_MIN 14 | -------------------------------------------------------------------------------- /examples/custom_color/color.numerical.config: -------------------------------------------------------------------------------- 1 | # TreeProfiler Color Configuration 2 | # This file defines custom colors for properties of annotated tree nodes. 3 | # Columns: PROP, VALUE, COLOR, CONDITION 4 | 5 | # PROP: Property of the annotated tree node 6 | # VALUE: Value of the property to be colored 7 | # COLOR: Color to apply 8 | # CONDITION: Special case for numerical values (optional, e.g., COLOR_MIN, COLOR_MAX, COLOR_MID) 9 | 10 | PROP,VALUE,COLOR,CONDITION 11 | sample1,0,yellow, 12 | sample2,0,yellow, 13 | sample3,0,yellow, 14 | sample4,0,yellow, 15 | sample5,0,yellow, 16 | -------------------------------------------------------------------------------- /examples/custom_color/color.numerical2.config: -------------------------------------------------------------------------------- 1 | # TreeProfiler Color Configuration 2 | # This file defines custom colors for properties of annotated tree nodes. 3 | # Columns: PROP, VALUE, COLOR, CONDITION 4 | 5 | # PROP: Property of the annotated tree node 6 | # VALUE: Value of the property to be colored 7 | # COLOR: Color to apply 8 | # CONDITION: Special case for numerical values (optional, e.g., COLOR_MIN, COLOR_MAX, COLOR_MID) 9 | 10 | PROP,VALUE,COLOR,CONDITION 11 | sample1,,red,COLOR_MAX 12 | sample1,,green,COLOR_MID 13 | sample1,,blue,COLOR_MIN -------------------------------------------------------------------------------- /examples/custom_color/color.numerical3.config: -------------------------------------------------------------------------------- 1 | # TreeProfiler Color Configuration 2 | # This file defines custom colors for properties of annotated tree nodes. 3 | # Columns: PROP, VALUE, COLOR, CONDITION 4 | 5 | # PROP: Property of the annotated tree node 6 | # VALUE: Value of the property to be colored 7 | # COLOR: Color to apply 8 | # CONDITION: Special case for numerical values (optional, e.g., COLOR_MIN, COLOR_MAX, COLOR_MID) 9 | 10 | PROP,VALUE,COLOR,CONDITION 11 | sample1,5,red,COLOR_MAX 12 | sample1,0,green,COLOR_MID 13 | sample1,-5,blue,COLOR_MIN -------------------------------------------------------------------------------- /examples/custom_color/data_1col.array: -------------------------------------------------------------------------------- 1 | Taxa_0,-2.591 2 | Taxa_1,3.366 3 | Taxa_2,0 4 | Taxa_3,3.671 5 | Taxa_4,0.676 6 | -------------------------------------------------------------------------------- /examples/custom_color/data_2col.array: -------------------------------------------------------------------------------- 1 | Taxa_0,-2.591,1.937 2 | Taxa_1,3.366,-1.871 3 | Taxa_2,0,-0.098 4 | Taxa_3,3.671,-0.947 5 | Taxa_4,0.676,-2.356 6 | -------------------------------------------------------------------------------- /examples/custom_color/data_nan.array: -------------------------------------------------------------------------------- 1 | Taxa_0,-2.591,1.937,-3.898,0.447,-1.349 2 | Taxa_1,3.366,-1.871,4.362,,-2.479 3 | Taxa_2,0,-0.098,0,-3.326,2.746 4 | Taxa_3,3.671,-0.947,nan,-3.131,-2.194 5 | Taxa_4,0.676,-2.356,-4.825,0.115,0 6 | -------------------------------------------------------------------------------- /examples/custom_color/demo1.tree: -------------------------------------------------------------------------------- 1 | ((Taxa_3:0.219065,(Taxa_4:0.188681,Taxa_2:0.5196)0.166914:0.90365)0.138062:0.0632016,(Taxa_0:0.190563,Taxa_1:0.458423)0.138062:0.97338); 2 | -------------------------------------------------------------------------------- /examples/pratical_example/emapper/7955.ENSDARP00000116736.nw: -------------------------------------------------------------------------------- 1 | (((((51511.ENSCSAVP00000016940:0.158066,7719.ENSCINP00000003956:0.0715116)1:0.685123,(51511.ENSCSAVP00000016659:0.458069,7719.ENSCINP00000004447:0.451218)1:0.731775)1:0.549732,(((7029.J9LIK7:1.8714,((37001.A0A1A9W1P0:1.43532,((((30069.A0A182Y7A0:0.109679,(112268.A0A182VQ93:0.0929036,139723.A0A182M5Y6:0.160477)0.993:0.0608013)0.492:0.0179005,62324.A0A182RCW2:0.0507756)0.95:0.101812,(199890.A0A182PA25:0.193524,(30066.A0A182V190:0.022659,(1518534.A0A182LFH4:0.00559581,34691.A0A182XID1:0.0117884)0.87:0.0149649)1:0.137063)0.876:0.0559168)0.99:0.425529,(43151.W5JCA5:0.699385,(41427.A0A182J735:0.151694,74873.A0A084W6W1:0.339786)0.99:0.221894)0.784:0.195796)0.997:0.940013)0.995:1.0505,(6832.A0A553N979:1.60682,543379.A0A232EKI4:2.64306)0.449:0.18711)0.867:0.431665)0.962:0.577083,(45351.A7S4C8:0.714079,(46731.A0A3M6TA68:0.107814,50429.A0A2B4RUK1:0.0310038)0.986:0.529838)0.987:0.671037)0.843:0.291244,(((((45351.A7S162:0.344321,(46731.A0A3M6T6Q0:0.0420827,50429.A0A2B4RUE6:0.0899533)0.551:0.104403)1:0.994189,(7739.C3ZIW1:5e-09,(7739.C3YXH3:5e-09,7739.C3ZIW3:5e-09)0.979:0.0520272)1:1.16508)0.283:0.161917,(7574.A0A1S3IK29:0.632305,(283909.R7UHV7:0.552476,((37653.A0A0L8G262:0.399862,(6573.A0A210QTK4:0.221807,225164.V4A869:0.246292)0.851:0.0626978)0.804:0.0350949,(400727.A0A2T7PT95:0.456984,(188477.A0A433U4Z3:0.245739,6526.A0A2C9K4K6:0.221854)0.999:0.234178)0.877:0.0763618)0.994:0.13056)0.982:0.154203)0.938:0.240569)0.228:0.107136,7739.C3XPU2:0.564534)0.889:0.169291,(7668.W4XZV3:0.510028,307972.A0A2G8L3N1:0.516718)1:0.961281)0.786:0.101519)0.175:0.0922844)0.98:0.27609,((59894.ENSFALP00000007718:0.0979313,7955.ENSDARP00000065136:0.158194)0.996:0.184792,(74533.ENSPTIP00000014334:0.859077,(7955.ENSDARP00000109674:0.121211,137246.A0A401TC09:5.09964)0.051:0.00971525)0.992:0.183428)0.999:0.423922)1:0.268014,((9258.ENSOANP00000018980:0.645213,((64176.ENSPMRP00000017811:0.674144,(103695.ENSPVIP00000017506:0.542395,(96440.ENSSMRP00000003871:0.498696,((8663.ENSNSUP00000003328:0.178798,8673.ENSPTXP00000020660:0.0670246)1:0.867166,61221.ENSVKKP00000029045:0.364907)0.941:0.191691)0.412:0.094069)0.258:0.0682123)0.913:0.125611,(143630.A0A402FGQ0:0.694712,8508.ENSSPUP00000018842:0.463956)0.869:0.103962)0.649:0.128894)0.148:0.0151367,(((7897.ENSLACP00000015915:0.454982,((((8364.ENSXETP00000041856:0.084237,8355.A0A1L8H4Q1:0.0544556)0.81:0.128755,8355.A0A1L8H4M6:0.247511)0.97:0.318527,137246.A0A401TB08:0.263918)0.815:0.103259,(((((37003.ENSKMAP00000018969:0.177781,52670.A0A2I4C4P9:0.265743)0.993:0.147561,((((((((((52904.ENSSMAP00000015064:0.15379,(173247.ENSENLP00000038795:0.0837064,(1841481.ENSSLDP00000013209:0.00800326,41447.ENSSDUP00000028226:0.002683)0.99:0.0296178)0.521:0.0130695)0.823:0.0138355,8187.ENSLCAP00010016052:0.0680135)0.908:0.0136271,((144197.ENSSPAP00000022019:0.0489426,(80966.ENSAPOP00000027715:0.0495013,(161767.ENSAPEP00000017927:0,80972.ENSAOCP00000001385:0)1:0.0453809)0.995:0.0640649)0.989:0.0400865,64144.ENSATEP00000028323:0.0968843)0.724:0.00344532)0.907:0.0144415,((43700.ENSMALP00000012065:0.225007,((211598.ENSANIP00000021270:1.23055,205130.ENSMAMP00000019766:0.691244)0.661:0.387376,205130.ENSMAMP00000005315:0.0432355)0.909:0.12355)0.684:0.0352169,215358.ENSLCRP00005011976:0.189479)0.9:0.0295718)0.615:0.00409441,(((61819.ENSACIP00000020373:0.154094,((47969.ENSOABP00000003944:5e-09,8128.ENSONIP00000041809:0.0275862)1:0.104159,(((8153.ENSHBUP00000022213:3.2182e-05,303518.ENSPNYP00000008816:0.188988)0.27:0.000373492,(32507.ENSNBRP00000026855:0.167025,106582.ENSMZEP00005029097:0.0156937)0.906:0.0506262)0.9:0.0127799,(106582.ENSMZEP00005037752:1.138,8154.ENSACLP00000007040:0.0168798)0.649:0.0123525)0.7:0.0287682)0.971:0.0537392)0.998:0.0881364,(69293.ENSGACP00000025614:0.228302,375764.ENSSORP00005058467:0.240522)0.837:0.0280954)0.877:0.0236475,8167.A0A484CCM0:0.0893891)0.835:0.0126881)0.843:0.0141442,8175.ENSSAUP00010029879:0.138834)0.723:0.0151074,((441366.ENSGWIP00000038103:0.244695,181472.ENSSFAP00005012771:0.136977)0.949:0.0614204,56723.ENSLBEP00000036857:0.239925)0.59:0.0244794)0.914:0.039811,((586833.ENSMMDP00005051289:0.171778,8049.ENSGMOP00000008291:0.308997)0.975:0.132827,(109280.ENSHCOP00000022970:0.417854,(31033.ENSTRUP00000030644:0.119917,99883.ENSTNIP00000013035:0.153871)0.995:0.132066)0.848:0.0475984)0.161:0.0269198)0.353:0.00587306,94237.ENSMMOP00000016395:0.273602)0.95:0.0738413,(30732.ENSOMEP00000009309:0.101848,8090.ENSORLP00000008031:0.135757)1:0.256328)0.797:0.0470035)0.512:0.0604323,((((32473.ENSXCOP00000002276:0.00756242,8083.ENSXMAP00000028829:6e-09)0.993:0.0544923,(33528.ENSGAFP00000008062:0.0489423,8083.ENSXMAP00000026894:1.29463)0.402:0.0344646)0.934:0.0497637,(8081.ENSPREP00000019676:0.050746,(48699.ENSPLAP00000022694:0.00330884,(48698.ENSPFOP00000007556:5e-09,48701.ENSPMEP00000001243:0.00657595)0.616:0.00988642)0.909:0.0227976)0.991:0.0666246)1:0.187149,(8078.ENSFHEP00000001063:0.146408,28743.ENSCVAP00000022398:0.332033)0.86:0.0853057)0.975:0.152325)0.628:0.445578,59463.ENSMLUP00000020118:5.25363)0.551:0.168403,((27687.ENSECRP00000015713:0.379261,(((((137246.A0A401TMR2:1.45988,299321.ENSDCDP00000007017:0.133698)0.879:0.230759,((42514.ENSPNAP00000014501:0.170403,7994.ENSAMXP00000021366:0.205775)0.999:0.242699,(8005.ENSEEEP00000033982:0.103752,7998.ENSIPUP00000031919:0.214389)0.225:0.044679)0.979:0.132088)0.551:0.0819925,((623744.A0A553PV69:0.315965,(7955.ENSDARP00000116736:0.1268,(84645.A0A498NKF5:0.0662158,((75366.ENSSGRP00000059520:0.0130979,(307959.ENSSRHP00000066963:5e-09,1608454.ENSSANP00000016801:0.00261643)0.751:0.00276856)0.991:0.0445849,(1608454.ENSSANP00000026698:5e-09,(75366.ENSSGRP00000074183:0.018437,307959.ENSSRHP00000051429:5e-09)0.906:0.00767843)0.995:0.0560618)0.957:0.0687215)0.985:0.130922)0.246:0.0799229)0.997:0.201754,(7950.ENSCHAP00000039357:0.236355,7950.ENSCHAP00000039408:0.016153)1:0.356911)0.621:0.0790219)0.962:0.123985,((6277.A0A498SGZ8:0.188798,(42157.A0A182ELX1:5e-09,6282.A0A044R7Z7:0.00617456)0.884:0.0980795)1:2.64299,(8010.ENSELUP00000026168:0.100964,((8022.A0A060Z608:0.0261198,(8032.ENSSTUP00000101309:0.00730257,8030.ENSSSAP00000057928:5e-09)0.744:0.00415786)0.606:0.00630971,(62062.ENSHHUP00000013468:0.0170539,8022.A0A060YN57:0.0670071)0.036:0.00488907)0.965:0.0704336)0.866:0.227021)0.626:0.157119)0.842:0.109918,(1676925.ENSPKIP00000014805:0.30333,113540.ENSSFOP00015035795:0.210835)0.928:0.0834731)0.975:0.118258)0.225:0.0539792,7918.ENSLOCP00000017063:0.204614)0.878:0.101176)0.72:0.0863013)0.867:0.0886083)0.935:0.138255,(((8496.A0A151MW63:0.0258236,38654.A0A3Q0FUE5:0.057701)1:0.38346,((59729.ENSTGUP00000032655:0.568396,(59729.ENSTGUP00000021519:0.167108,299123.ENSLSDP00000017092:0.0358829)0.73:0.156709)0.109:0.137319,(2489341.ENSSHBP00005007544:0.233614,223781.ENSACCP00020024610:0.451818)0.176:0.140261)0.994:0.340526)0.986:0.24262,(13735.ENSPSIP00000014905:0.153654,(8469.M7CJF0:0.0795904,((2587831.ENSTMTP00000028378:0.0141039,8478.ENSCPBP00000031582:0.00853657)0.976:0.0322879,(55544.A0A4D9DLX2:0.0560778,(38772.ENSGAGP00000006237:0.0562781,106734.ENSCABP00000018274:0.0291558)0.991:0.0659261)0.366:0.00483383)0.936:0.0515784)0.957:0.103036)1:0.384615)0.899:0.153839)0.891:0.147695,((9305.ENSSHAP00000018268:0.0496476,(9315.ENSMEUP00000011978:0.00303947,(29139.ENSVURP00010004263:0.014417,38626.ENSPCIP00000039513:0.00755054)0.876:0.0181206)0.391:0.02422)1:0.303674,((9365.ENSEEUP00000013295:0.224779,42254.ENSSARP00000005616:0.101545)0.339:0.018888,(((9371.ENSETEP00000007296:5e-09,9371.ENSETEP00000008111:0.248792)1:0.174468,((9785.ENSLAFP00000006292:0.0624577,127582.A0A2Y9R5B9:0.0291878)0.509:0.0057716,(((((9785.ENSLAFP00000023554:0.0170038,((9785.ENSLAFP00000024998:0.0086484,9785.ENSLAFP00000023389:0.0187193)0.768:0.0256652,9785.ENSLAFP00000027808:0.0623337)0.688:0.00914595)0.306:0.00919403,9785.ENSLAFP00000027441:0.0228517)0.846:0.0101858,((9785.ENSLAFP00000025852:0.0144433,(9785.ENSLAFP00000027253:0.0481508,9785.ENSLAFP00000028793:0.0611494)0.629:0.00530822)0.815:0.00881218,9785.ENSLAFP00000028173:0.0612521)0.953:0.0222305)0.998:0.120406,(9785.ENSLAFP00000018379:0.025716,9785.ENSLAFP00000027515:0.0350774)0.999:0.111215)1:0.343265,9813.ENSPCAP00000011892:0.175784)0.592:0.0169137)0.83:0.0194454)1:0.121285,((59463.ENSMLUP00000005861:5e-09,59463.ENSMLUP00000016733:0.0959792)1:0.281127,(((((9838.ENSCDRP00005013165:0.0302664,(51154.ENSCWAP00000005800:5e-09,9823.ENSSSCP00000050664:0.101159)1:0.0540889)0.828:0.016794,((310752.A0A383YUA7:0.0162191,(9755.ENSPCTP00005020186:0.00542053,(118797.A0A340XCN5:0.00274858,(9739.ENSTTRP00000009721:0.0188995,(1706337.A0A341BQX3:0.00541871,9749.Q8SPZ3:5e-09)0.753:0.00310781)0.035:0.00544911)0.891:0.0081716)0.764:0.00289524)0.353:0.00267305,(68415.ENSMMSP00000026578:0.019492,(((72004.ENSBMUP00000028863:0,30521.ENSBGRP00000021669:0,43346.ENSBBBP00000018891:0)1:5e-09,(30522.A0A4W2I2P0:5e-09,9913.ENSBTAP00000001420:5e-09)0.82:0.00402518)0.999:0.0641773,(9925.ENSCHIP00000030141:5e-09,9940.ENSOARP00000016707:0.00274854)0.966:0.0175284)0.901:0.0214505)1:0.116016)0.867:0.012614)0.994:0.0680646,((9796.ENSECAP00000032751:6e-09,83772.ENSEASP00005028399:0.00277527)0.996:0.0512906,((37032.ENSSSUP00005028514:0.0557603,(9691.ENSPPRP00000022844:5e-09,(74533.ENSPTIP00000024834:0.347735,(9685.ENSFCAP00000045749:5e-09,61383.ENSLCNP00005018106:5e-09)0.799:0.0050872)0:8e-09)0.788:0.0286633)1:0.13063,(((9646.ENSAMEP00000017825:0.00277515,(9643.ENSUAMP00000000913:0.00277467,(29073.ENSUMAP00000023207:0,116960.A0A3Q7Y5W2:0)1:5e-09)0.867:0.00554559)0.997:0.025543,(9708.A0A2U3VT95:0.0152476,(9713.A0A2U3Y5G3:5e-09,29088.A0A2Y9HEV7:0.00552861)0.87:0.00731623)0.96:0.0139118)0.652:0.00261156,((9669.ENSMPUP00000008945:5e-09,(391180.A0A2Y9L4Q2:0.00853498,452646.ENSNVIP00000005141:0.00283143)0.243:0.00281656)0.992:0.0259509,(9627.ENSVVUP00000039187:5e-09,(9615.ENSCAFP00000064590:5e-09,286419.ENSCAFP00020009510:5e-09)0.816:0.00459768)1:0.0860558)0.012:0.0147336)0.995:0.0768422)0.992:0.0758405)0.801:0.0145829)0.607:0.00598348,(59479.ENSRFEP00010016808:0.0606529,(132908.ENSPVAP00000015400:0.0496845,9402.L5JZ91:0.0190028)0.999:0.0861042)0.983:0.0533155)0.88:0.0185886,(9361.ENSDNOP00000004075:0.142434,(9978.ENSOPRP00000005906:0.180194,((((51338.ENSCCNP00000017223:0.113727,(10020.ENSDORP00000023664:0.166569,51337.ENSJJAP00000008090:0.0851416)0.819:0.0158238)0.917:0.0186016,(1026970.ENSNGAP00000007306:0.0528436,((((79684.ENSMOCP00000023219:0.0618083,(10029.G3GY68:0.0181039,10036.ENSMAUP00000025852:0.0348866)0.997:0.120055)0.204:0.015896,(230844.ENSPEMP00000010300:0.0168324,230844.ENSPEMP00000031900:0.203096)0.882:0.0278722)0.756:0.00464319,(10047.ENSMUGP00000017526:0.172254,(10116.ENSRNOP00000074031:0.0351231,(10093.MGP_PahariEiJ_P0034306:0.0548266,(10089.MGP_CAROLIEiJ_P0027554:0.00916664,(10103.ENSMSIP00000005017:0.100476,(10103.ENSMSIP00000031034:0.00548249,(10090.ENSMUSP00000104298:0.00608584,10096.MGP_SPRETEiJ_P0028933:0.00794745)0:6e-09)0.856:0.0108939)0.661:0.00677797)0.962:0.0252008)0.995:0.0631709)0.999:0.0856406)0.896:0.024172)0.812:0.0141653,56216.A0A1A6GWM4:0.16769)0.924:0.0256324)0.981:0.038424)0.953:0.0316076,(((885580.ENSFDAP00000011613:0.0243145,10181.G5B5D6:0.0133648)0.95:0.0183849,(10160.ENSODEP00000024162:0.0410183,((37548.ENSCAPP00000017521:0.00725124,10141.ENSCPOP00000029751:0.00296023)1:0.104152,34839.ENSCLAP00000010404:0.0151183)0.314:0.00338991)0.93:0.0178441)0.999:0.0643551,(9994.ENSMMMP00000022491:0.00528319,(99837.ENSSDAP00000002829:0.00525555,(9999.ENSUPAP00010019485:0.00265366,43179.ENSSTOP00000019678:5e-09)0:6e-09)0.754:0.00264805)1:0.0625995)0.054:0.00483605)0.857:0.00999831,((9986.ENSOCUP00000025959:0.280959,9986.ENSOCUP00000000989:0.00654146)0.95:0.057824,((37347.ENSTBEP00000010189:0.0616707,246437.L9KM90:0.0848149)1:0.209307,(((379532.ENSPCOP00000031758:0.0196578,(30608.ENSMICP00000039812:0.0421943,1328070.ENSPSMP00000026875:0.144527)0.88:0.0162963)0.996:0.039746,((9483.ENSCJAP00000066800:0.0524866,9516.ENSCCAP00000029525:0.0154752)0.999:0.0476961,((591936.ENSPTEP00000010553:0.00517036,((61621.ENSRBIP00000028632:0,61622.ENSRROP00000026843:0)1:0.00258262,((336983.ENSCANP00000028904:0.0154486,(9531.ENSCATP00000032045:5e-09,(9568.ENSMLEP00000037099:0.00254383,9555.ENSPANP00000033477:0.00254159)0:5e-09)0.948:5e-09)1:0.0402561,(60711.ENSCSAP00000007551:5e-09,(9565.ENSTGEP00000031378:0.00258658,(9541.ENSMFAP00000038526:5e-09,9544.ENSMMUP00000011334:5e-09)0.855:0.00294782)0:5e-09)0.171:5e-09)0.837:0.00290391)0.771:0.00294529)0.983:0.0210214,(9601.ENSPPYP00000008923:0.0131036,((9597.ENSPPAP00000011040:0,9606.ENSP00000269305:0,9598.ENSPTRP00000014836:0)1:5e-09,10116.ENSRNOP00000064177:0.0216633)0.846:0.010509)0.895:0.0076727)0.981:0.0281132)0.963:0.0262857)0:5e-09,(1868482.ENSTSYP00000023752:0.0319681,30611.ENSOGAP00000015106:0.119301)0.296:0.00915925)0.917:0.0309785)0.901:0.0197488)0.727:0.0105797)0.43:0.00711956)0.476:0.0291947)0.914:0.0287868)0.671:0.0269055)0.254:0.0260318)0.859:0.0806397)0.987:0.209812)1:0.538123)0.312:0.0781441)1:0.268014); -------------------------------------------------------------------------------- /examples/pratical_example/emapper/emapper_demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # annotate tree of nifH with eggNOG-mapper annotations and taxonomic annotations 4 | echo "Start mapping tree with annotation metadata" 5 | treeprofiler annotate \ 6 | --tree nifH.nw \ 7 | --input-type newick \ 8 | --emapper-annotation nifH.out.emapper.annotations \ 9 | --emapper-pfam nifH.out.emapper.pfam \ 10 | --alignment nifH.faa.aln \ 11 | --taxon-column name \ 12 | --taxadb NCBI \ 13 | --taxon-delimiter '.' \ 14 | --taxa-field 0 \ 15 | -o ./ 16 | 17 | 18 | # visualize annotated trees with all eggnog mapper features 19 | echo "Visualizing annotated tree with all eggnog mapper features......" 20 | treeprofiler plot \ 21 | --tree nifH_annotated.ete \ 22 | --input-type ete \ 23 | --emapper-layout \ 24 | --domain-layout \ 25 | --taxonclade-layout \ 26 | --column-width 70 27 | -------------------------------------------------------------------------------- /examples/pratical_example/gtdb_r202/ar122_metadata_r202_lite.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/examples/pratical_example/gtdb_r202/ar122_metadata_r202_lite.tar.gz -------------------------------------------------------------------------------- /examples/pratical_example/gtdb_r202/bac120_metadata_r202_lite.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/examples/pratical_example/gtdb_r202/bac120_metadata_r202_lite.tar.gz -------------------------------------------------------------------------------- /examples/pratical_example/gtdb_r202/gtdbv202_annotated.ete.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/examples/pratical_example/gtdb_r202/gtdbv202_annotated.ete.tar.gz -------------------------------------------------------------------------------- /examples/pratical_example/gtdb_r202/gtdbv202full_demo.sh: -------------------------------------------------------------------------------- 1 | # full gtdb annotation requires >6G disk space and >15G RAM memory 2 | # download archaea and bacteria trees from gtdb 3 | echo "Downloading archaea and bacteria trees from GTDB database, version 202" 4 | wget https://data.gtdb.ecogenomic.org/releases/release202/202.0/ar122_r202.tree 5 | wget https://data.gtdb.ecogenomic.org/releases/release202/202.0/bac120_r202.tree 6 | 7 | #merge two trees into one as gtdb tree 8 | echo "Merging archaea and bacteria trees into one" 9 | python merge_gtdbtree.py ar122_r202.tree bac120_r202.tree > gtdbv202.nw 10 | 11 | # download metadata of archaea and bacteria 12 | echo "Downloading metadata of archaea and bacteria from GTDB database, version 202" 13 | wget https://data.gtdb.ecogenomic.org/releases/release202/202.0/ar122_metadata_r202.tar.gz 14 | wget https://data.gtdb.ecogenomic.org/releases/release202/202.0/bac120_metadata_r202.tar.gz 15 | 16 | # annotate gtdb tree with ar122 metadata, bac120 metadata and progenome3 habitat information 17 | echo "Annotate GTDB tree with ar122 metadata, bac120 metadata and progenome3 habitat information..." 18 | treeprofiler annotate \ 19 | --tree gtdbv202.nw \ 20 | --input-type newick \ 21 | --metadata ar122_metadata_r202.tar.gz bac120_metadata_r202.tar.gz progenome3.tsv \ 22 | --taxon-column name \ 23 | --taxadb GTDB \ 24 | --gtdb-version 202 \ 25 | -o . 26 | 27 | # visualize annotated tree with selected properties 28 | echo "Visualizing annotated GTDB tree with GTDB metadata, which are genome_size, protein_count, gc_percentage, ncbi_assembly_level, ncbi_genome_category" 29 | echo "And progenome3 habitat information aquatic_habitat, host_associated, soil_habitat..." 30 | treeprofiler plot \ 31 | --tree gtdbv202_annotated.ete \ 32 | --input-type ete \ 33 | --barplot-layout genome_size protein_count \ 34 | --heatmap-layout gc_percentage \ 35 | --binary-layout aquatic_habitat host_associated soil_habitat \ 36 | --rectangle-layout ncbi_assembly_level ncbi_genome_category \ 37 | --taxonclade-layout \ 38 | --column-width 70 39 | 40 | 41 | -------------------------------------------------------------------------------- /examples/pratical_example/gtdb_r202/gtdbv202lite_demo.sh: -------------------------------------------------------------------------------- 1 | 2 | # annotate gtdb tree with ar122 metadata lite, bac120 metadata lite and progenome3 habitat information 3 | echo "Annotate GTDB tree with ar122 metadata lite, bac120 metadata lite and progenome3 habitat information..." 4 | treeprofiler annotate \ 5 | --tree gtdbv202.nw \ 6 | --input-type newick \ 7 | --metadata ar122_metadata_r202_lite.tar.gz bac120_metadata_r202_lite.tar.gz progenome3.tar.gz \ 8 | --taxon-column name \ 9 | --taxadb GTDB \ 10 | --gtdb-version 202 \ 11 | -o . 12 | 13 | # visualize annotated tree with selected properties 14 | echo "Visualizing annotated GTDB tree with GTDB metadata, which are genome_size, protein_count, gc_percentage, ncbi_assembly_level, ncbi_genome_category" 15 | echo "And progenome3 habitat information aquatic_habitat, host_associated, soil_habitat..." 16 | treeprofiler plot \ 17 | --tree gtdbv202_annotated.ete \ 18 | --input-type ete \ 19 | --barplot-layout genome_size protein_count \ 20 | --heatmap-layout gc_percentage \ 21 | --binary-layout aquatic_habitat host_associated soil_habitat \ 22 | --rectangle-layout ncbi_assembly_level ncbi_genome_category \ 23 | --taxonclade-layout \ 24 | --column-width 70 25 | -------------------------------------------------------------------------------- /examples/pratical_example/gtdb_r202/merge_gtdbtree.py: -------------------------------------------------------------------------------- 1 | 2 | import sys 3 | from ete4 import Tree 4 | 5 | # load gtdb trees and combine 6 | # ar122_r202.tree & bac120_r202.tree 7 | tree = Tree(open(sys.argv[1])) 8 | tree_bact = Tree(open(sys.argv[2])) 9 | 10 | root_node_bac = next(n.root for n in tree_bact.traverse()) 11 | root_node_arch = next(n.root for n in tree.traverse()) 12 | root_node_arch.add_child(root_node_bac) 13 | sys.stdout.write(root_node_arch.write(parser=0)) 14 | #root_node_arch.write(outfile='merge_gtdb.tree',format_root_node=True) 15 | -------------------------------------------------------------------------------- /examples/pratical_example/gtdb_r202/progenome3.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/examples/pratical_example/gtdb_r202/progenome3.tar.gz -------------------------------------------------------------------------------- /examples/supporting_information/figure1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/examples/supporting_information/figure1.zip -------------------------------------------------------------------------------- /examples/supporting_information/figure2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/examples/supporting_information/figure2.zip -------------------------------------------------------------------------------- /examples/supporting_information/figure3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/examples/supporting_information/figure3.zip -------------------------------------------------------------------------------- /examples/taxonomy_example/demo3.tree: -------------------------------------------------------------------------------- 1 | (Taxa_2:0.471596,((Taxa_0:0.767844,Taxa_1:0.792161)0.313833:0.684109,Taxa_3:0.805286):0.188666); 2 | -------------------------------------------------------------------------------- /examples/taxonomy_example/demo3.tsv: -------------------------------------------------------------------------------- 1 | #name gtdb_taxid 2 | Taxa_0 GB_GCA_011358815.1@sample1 3 | Taxa_1 RS_GCF_000019605.1@sample2 4 | Taxa_2 RS_GCF_003948265.1@sample3 5 | Taxa_3 GB_GCA_003344655.1@sample4 -------------------------------------------------------------------------------- /examples/taxonomy_example/demo4.tree: -------------------------------------------------------------------------------- 1 | ((Taxa_4:0.888775,(Taxa_0:0.612914,(Taxa_1:0.803821,Taxa_2:0.10554)0.103931:0.980682)0.622309:0.434342):0.557351,Taxa_3:0.749563); 2 | -------------------------------------------------------------------------------- /examples/taxonomy_example/demo4.tsv: -------------------------------------------------------------------------------- 1 | #name gtdb_taxid 2 | Taxa_0 GB_GCA_011358815.1@sample1 3 | Taxa_1 RS_GCF_000019605.1@sample2 4 | Taxa_2 RS_GCF_003948265.1@sample3 5 | Taxa_3 GB_GCA_003344655.1@sample4 6 | Taxa_4 NA -------------------------------------------------------------------------------- /examples/taxonomy_example/gtdb_v202.tree: -------------------------------------------------------------------------------- 1 | (GB_GCA_011358815.1:1,(RS_GCF_000019605.1:1,(RS_GCF_003948265.1:1,GB_GCA_003344655.1:1):0.5):0.5); -------------------------------------------------------------------------------- /examples/taxonomy_example/missing_gtdb_v202.tree: -------------------------------------------------------------------------------- 1 | (Taxa_1:1,(RS_GCF_000019605.1:1,(Taxa_2:1,GB_GCA_003344655.1:1):0.5):0.5); -------------------------------------------------------------------------------- /examples/taxonomy_example/missing_ncbi.tree: -------------------------------------------------------------------------------- 1 | ((9606, Taxa_0), 10090); -------------------------------------------------------------------------------- /examples/taxonomy_example/motus.tree: -------------------------------------------------------------------------------- 1 | ((mOTUv4.0_000001:0.3,mOTUv4.0_000003:0.4):0.2,(mOTUv4.0_000006:0.5,(mOTUv4.0_000008:0.3,mOTUv4.0_000010:0.4):0.2):0.3); 2 | -------------------------------------------------------------------------------- /examples/taxonomy_example/ncbi.tree: -------------------------------------------------------------------------------- 1 | ((9606, 9598), 10090); -------------------------------------------------------------------------------- /examples/taxonomy_example/show_tree_props.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from ete4 import Tree 3 | 4 | filename = sys.argv[1] 5 | 6 | t = Tree(open(filename), parser=1) 7 | 8 | print("Target tree internal node Root contains the following properties: ") 9 | print(t.props) 10 | 11 | print("Target tree leaf node contains the following propertiies: ") 12 | print(next(t.leaves()).props) -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=61.0", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "treeprofiler" 7 | description = "A command line tool to annotate and visualize metadata in phylogenetic tree." 8 | version = "2.0.4" 9 | authors = [ 10 | { name="Ziqi Deng", email="dengziqi1234@gmail.com" }, 11 | { name="Jaime Huerta-Cepas", email="jhcepas@gmail.com" }, 12 | ] 13 | readme = "README.md" 14 | license = { file="LICENSE" } 15 | requires-python = ">=3.10" 16 | classifiers = [ 17 | "Programming Language :: Python :: 3", 18 | "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", 19 | "Development Status :: 6 - Mature", 20 | "Environment :: Console", 21 | "Environment :: X11 Applications :: Qt", 22 | "Intended Audience :: Developers", 23 | "Intended Audience :: Other Audience", 24 | "Intended Audience :: Science/Research", 25 | "Natural Language :: English", 26 | "Operating System :: MacOS", 27 | "Operating System :: Microsoft :: Windows", 28 | "Operating System :: POSIX :: Linux", 29 | "Topic :: Scientific/Engineering :: Bio-Informatics", 30 | "Topic :: Scientific/Engineering :: Visualization", 31 | "Topic :: Software Development :: Libraries :: Python Modules", 32 | ] 33 | 34 | dependencies = [ 35 | "numpy>=1.25,<2", 36 | "biopython>=1.8", 37 | "selenium>=4.24.0", 38 | "scipy>=1.8.0", 39 | "matplotlib>=3.4.0", 40 | "pymc>=5.0.0", 41 | "pyvirtualdisplay", 42 | "webdriver_manager>=4.0", 43 | ] 44 | 45 | [project.urls] 46 | "Homepage" = "http://dengzq1234.github.io/TreeProfiler/" 47 | 48 | [project.scripts] 49 | treeprofiler = "treeprofiler:main" 50 | treeprofiler-desktop = "treeprofiler.app:start_server" 51 | 52 | [tool.setuptools.packages.find] 53 | where = ["."] 54 | 55 | [tool.setuptools] 56 | include-package-data = true 57 | 58 | [tool.setuptools.package-data] 59 | treeprofiler = [ 60 | "examples/**/*", 61 | "layouts/pfam2color.json", 62 | "layouts/smart2color.json" 63 | ] -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from setuptools import setup, find_packages 4 | import os 5 | 6 | def get_files(directory): 7 | file_list = [] 8 | for root, dirs, files in os.walk(directory): 9 | for file in files: 10 | file_path = os.path.join(root, file) 11 | file_list.append(file_path) 12 | return file_list 13 | 14 | VERSION = '2.0.4' 15 | install_requires = ['ete4', 'selenium', 'biopython','scipy'] 16 | example_files = get_files('examples/') 17 | test_files = get_files('tests/') 18 | long_description = open("README.md").read() 19 | setup( 20 | name='TreeProfiler', 21 | version=VERSION, 22 | # metadata for upload to PyPI 23 | description='TreeProfiler is command-line tool for profiling metadata table into phylogenetic tree with descriptive analysis and output visualization', 24 | long_description=long_description, 25 | long_description_content_type='text/markdown', 26 | author='Ziqi Deng, Jaime Huerta-Cepas', 27 | author_email='dengziqi1234@gmail.com, jhcepas@gmail.com', 28 | maintainer = 'Ziqi Deng', 29 | maintainer_email = 'dengziqi1234@gmail.com', 30 | url="https://github.com/compgenomicslab/MetaTreeDrawer", 31 | 32 | #package_dir = {'treeprofiler' : '' }, 33 | packages=find_packages(), 34 | include_package_data=True, 35 | package_data = { 36 | 'treeprofiler' : [ 37 | 'static/css/*', 38 | 'static/js/*', 39 | 'views/*.html', 40 | 'layouts/pfam2color.json', 41 | 'layouts/smart2color.json', 42 | ], 43 | }, 44 | #scripts=['treeprofiler.py'], 45 | entry_points = { 46 | 'console_scripts': [ 47 | 'treeprofiler=treeprofiler.treeprofiler:main', 48 | 'treeprofiler-desktop=treeprofiler.app:start_server', # Link to app.py's start_server 49 | ] 50 | }, 51 | data_files=[ 52 | ('examples', example_files), 53 | ('tests', test_files) 54 | ], 55 | install_requires=install_requires, 56 | keywords = "tree annotation, tree visualization, phylogeny, phylogenetics, phylogenomics", 57 | ) 58 | 59 | -------------------------------------------------------------------------------- /tests/.coverage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/tests/.coverage -------------------------------------------------------------------------------- /tests/data_matrix.tsv: -------------------------------------------------------------------------------- 1 | A 1 2 | B 2 3 | D 3 4 | E 4 5 | -------------------------------------------------------------------------------- /tests/test_alignment.py: -------------------------------------------------------------------------------- 1 | 2 | import sys 3 | import os 4 | import tarfile 5 | from io import StringIO, BytesIO 6 | import unittest 7 | sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..')) 8 | 9 | #from collections import namedtuple 10 | from tempfile import NamedTemporaryFile, TemporaryDirectory 11 | 12 | from ete4 import Tree 13 | from treeprofiler import tree_annotate 14 | from treeprofiler.src import utils 15 | 16 | class TestMSA(unittest.TestCase): 17 | def test_annotate_msa(self): 18 | # test alignment 19 | # load tree 20 | internal_parser = "name" 21 | parser = utils.get_internal_parser(internal_parser) 22 | 23 | test_tree_msa = utils.ete4_parse("(A:1,(B:1,(E:1,D:1)Internal_1:0.5)Internal_2:0.5)Root;") 24 | 25 | # load metadata 26 | with NamedTemporaryFile(suffix='.faa') as f_alignment: 27 | f_alignment.write(b'>A\nMAEIPDETIQQFMALT---HNIAVQYLSEFGDLNEALNSYYASQTDDIKDRREEAH\n>B\nMAEIPDATIQQFMALTNVSHNIAVQY--EFGDLNEALNSYYAYQTDDQKDRREEAH\n>E\nMAEIPDATIQ---ALTNVSHNIAVQYLSEFGDLNEALNSYYASQTDDQPDRREEAH\n>D\nMAEAPDETIQQFMALTNVSHNIAVQYLSEFGDLNEAL--------------REEAH') 28 | f_alignment.flush() 29 | 30 | #metadata_dict, node_props, columns, prop2type = tree_annotate.parse_csv([f_annotation.name]) 31 | 32 | test_tree_annotated_msa, annotated_prop2type = tree_annotate.run_tree_annotate(test_tree_msa, 33 | alignment=f_alignment.name) 34 | 35 | expected_tree_msa = '(A:1[&&NHX:alignment=MAEIPDETIQQFMALT---HNIAVQYLSEFGDLNEALNSYYASQTDDIKDRREEAH],(B:1[&&NHX:alignment=MAEIPDATIQQFMALTNVSHNIAVQY--EFGDLNEALNSYYAYQTDDQKDRREEAH],(E:1[&&NHX:alignment=MAEIPDATIQ---ALTNVSHNIAVQYLSEFGDLNEALNSYYASQTDDQPDRREEAH],D:1[&&NHX:alignment=MAEAPDETIQQFMALTNVSHNIAVQYLSEFGDLNEAL--------------REEAH])Internal_1:0.5[&&NHX:alignment=MAE-PD-TIQQFMALTNVSHNIAVQYLSEFGDLNEALNSYYASQTDDQPDRREEAH])Internal_2:0.5[&&NHX:alignment=MAE-PD-TIQQFMALTNVSHNIAVQYLSEFGDLNEALNSYYA-QTDDQ-DRREEAH])Root[&&NHX:alignment=MAEIPD-TIQQFMALTNVSHNIAVQYLSEFGDLNEALNSYYA-QTDD--DRREEAH];' 36 | self.assertEqual(test_tree_annotated_msa.write(props=['alignment'], parser=parser, format_root_node=True), expected_tree_msa) 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | #pytest.main(['-v']) -------------------------------------------------------------------------------- /tests/test_prune.py: -------------------------------------------------------------------------------- 1 | 2 | import sys 3 | import os 4 | from io import StringIO 5 | import unittest 6 | 7 | sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..')) 8 | 9 | #from collections import namedtuple 10 | from tempfile import NamedTemporaryFile 11 | 12 | from treeprofiler import tree_annotate 13 | from treeprofiler.src import utils 14 | 15 | class TestPrune(unittest.TestCase): 16 | # test pruned_by in order to test if data type is process correctly 17 | def test_pruned_by_00(self): 18 | # test "contains" in leaf name 19 | # load tree 20 | internal_parser = "name" 21 | parser = utils.get_internal_parser(internal_parser) 22 | 23 | test_tree = utils.ete4_parse("(A:1,(B:1,(E:1,D:1)Internal_1:0.5)Internal_2:0.5)Root;") 24 | 25 | # load metadata 26 | with NamedTemporaryFile(suffix='.tsv') as f_annotation: 27 | f_annotation.write(b'#name\talphabet_type\nA\tvowel\nB\tconsonant\nD\tconsonant\nE\tvowel\n') 28 | f_annotation.flush() 29 | 30 | metadata_dict, node_props, columns, prop2type = tree_annotate.parse_csv([f_annotation.name]) 31 | 32 | expected_tree = '((B:1[&&NHX:alphabet_type=consonant],(E:1[&&NHX:alphabet_type=vowel],D:1[&&NHX:alphabet_type=consonant])Internal_1:0.5[&&NHX:alphabet_type_counter=consonant--1||vowel--1])Internal_2:0.5[&&NHX:alphabet_type_counter=consonant--2||vowel--1])Root[&&NHX:alphabet_type_counter=consonant--2||vowel--2];' 33 | 34 | test_tree_annotated, annotated_prop2type = tree_annotate.run_tree_annotate(test_tree, 35 | metadata_dict=metadata_dict, node_props=node_props, 36 | columns=columns, prop2type=prop2type) 37 | props = ['alphabet_type', 'alphabet_type_counter'] 38 | condition_inputs = ["name contains A"] 39 | pruned_tree = utils.conditional_prune(test_tree_annotated, condition_inputs, prop2type) 40 | 41 | self.assertEqual(pruned_tree.write(props=props, parser=parser, format_root_node=True), expected_tree) 42 | 43 | def test_pruned_by_01(self): 44 | # test "contains" in leaf node in categorical data 45 | # load tree 46 | internal_parser = "name" 47 | parser = utils.get_internal_parser(internal_parser) 48 | 49 | test_tree = utils.ete4_parse("(A:1,(B:1,(E:1,D:1)Internal_1:0.5)Internal_2:0.5)Root;") 50 | 51 | # load metadata 52 | with NamedTemporaryFile(suffix='.tsv') as f_annotation: 53 | f_annotation.write(b'#name\talphabet_type\nA\tvowel\nB\tconsonant\nD\tconsonant\nE\tvowel\n') 54 | f_annotation.flush() 55 | 56 | metadata_dict, node_props, columns, prop2type = tree_annotate.parse_csv([f_annotation.name]) 57 | 58 | test_tree_annotated, annotated_prop2type = tree_annotate.run_tree_annotate(test_tree, 59 | metadata_dict=metadata_dict, node_props=node_props, 60 | columns=columns, prop2type=prop2type) 61 | 62 | expected_tree = '((B:1[&&NHX:alphabet_type=consonant],(D:1[&&NHX:alphabet_type=consonant])Internal_1:0.5[&&NHX:alphabet_type_counter=consonant--1||vowel--1])Internal_2:0.5[&&NHX:alphabet_type_counter=consonant--2||vowel--1])Root[&&NHX:alphabet_type_counter=consonant--2||vowel--2];' 63 | props = ['alphabet_type', 'alphabet_type_counter'] 64 | condition_inputs = ["alphabet_type=vowel"] 65 | pruned_tree = utils.conditional_prune(test_tree_annotated, condition_inputs, prop2type) 66 | self.assertEqual(pruned_tree.write(props=props, parser=parser, format_root_node=True), expected_tree) 67 | 68 | def test_pruned_by_02(self): 69 | # test "contains" in internal node in categorical data 70 | # load tree 71 | internal_parser = "name" 72 | parser = utils.get_internal_parser(internal_parser) 73 | 74 | test_tree = utils.ete4_parse("(A:1,(B:1,(E:1,D:1)Internal_1:0.5)Internal_2:0.5)Root;") 75 | 76 | # load metadata 77 | with NamedTemporaryFile(suffix='.tsv') as f_annotation: 78 | f_annotation.write(b'#name\talphabet_type\nA\tvowel\nB\tconsonant\nD\tconsonant\nE\tvowel\n') 79 | f_annotation.flush() 80 | 81 | metadata_dict, node_props, columns, prop2type = tree_annotate.parse_csv([f_annotation.name]) 82 | 83 | test_tree_annotated, annotated_prop2type = tree_annotate.run_tree_annotate(test_tree, 84 | metadata_dict=metadata_dict, node_props=node_props, 85 | columns=columns, prop2type=prop2type) 86 | props = ['alphabet_type', 'alphabet_type_counter'] 87 | expected_tree = '(A:1[&&NHX:alphabet_type=vowel],(B:1[&&NHX:alphabet_type=consonant])Internal_2:0.5[&&NHX:alphabet_type_counter=consonant--2||vowel--1])Root[&&NHX:alphabet_type_counter=consonant--2||vowel--2];' 88 | condition_inputs = ["alphabet_type_counter:consonant < 2"] 89 | pruned_tree = utils.conditional_prune(test_tree_annotated, condition_inputs, prop2type) 90 | 91 | self.assertEqual(pruned_tree.write(props=props, parser=parser, format_root_node=True), expected_tree) 92 | 93 | def test_pruned_by_03(self): 94 | # test operators in leaf node in numerical data 95 | # load tree 96 | internal_parser = "name" 97 | parser = utils.get_internal_parser(internal_parser) 98 | 99 | test_tree = utils.ete4_parse("(A:1,(B:1,(E:1,D:1)Internal_1:0.5)Internal_2:0.5)Root;") 100 | 101 | # load metadata 102 | with NamedTemporaryFile(suffix='.tsv') as f_annotation: 103 | f_annotation.write(b'#name\tcol1\nA\t1\nB\t2\nD\t3\nE\t4\n') 104 | f_annotation.flush() 105 | 106 | metadata_dict, node_props, columns, prop2type = tree_annotate.parse_csv([f_annotation.name]) 107 | 108 | test_tree_annotated, annotated_prop2type = tree_annotate.run_tree_annotate(test_tree, 109 | metadata_dict=metadata_dict, node_props=node_props, 110 | columns=columns, prop2type=prop2type) 111 | props = ['col1', 'col1_avg', 'col1_sum', 'col1_max', 'col1_min', 'col1_std'] 112 | 113 | expected_tree = '(((E:1[&&NHX:col1=4.0],D:1[&&NHX:col1=3.0])Internal_1:0.5[&&NHX:col1_avg=3.5:col1_sum=7.0:col1_max=4.0:col1_min=3.0:col1_std=0.7071067811865476])Internal_2:0.5[&&NHX:col1_avg=3.0:col1_sum=9.0:col1_max=4.0:col1_min=2.0:col1_std=1.0])Root[&&NHX:col1_avg=2.5:col1_sum=10.0:col1_max=4.0:col1_min=1.0:col1_std=1.2909944487358056];' 114 | condition_inputs = ["col1 < 3"] 115 | pruned_tree = utils.conditional_prune(test_tree_annotated, condition_inputs, prop2type) 116 | self.assertEqual(pruned_tree.write(props=props, parser=parser, format_root_node=True), expected_tree) 117 | 118 | def test_pruned_by_04(self): 119 | # test operators in internal node in numerical data 120 | # load tree 121 | internal_parser = "name" 122 | parser = utils.get_internal_parser(internal_parser) 123 | 124 | test_tree = utils.ete4_parse("(A:1,(B:1,(E:1,D:1)Internal_1:0.5)Internal_2:0.5)Root;") 125 | 126 | # load metadata 127 | with NamedTemporaryFile(suffix='.tsv') as f_annotation: 128 | f_annotation.write(b'#name\tcol1\nA\t1\nB\t2\nD\t3\nE\t4\n') 129 | f_annotation.flush() 130 | 131 | metadata_dict, node_props, columns, prop2type = tree_annotate.parse_csv([f_annotation.name]) 132 | 133 | test_tree_annotated, annotated_prop2type = tree_annotate.run_tree_annotate(test_tree, 134 | metadata_dict=metadata_dict, node_props=node_props, 135 | columns=columns, prop2type=prop2type) 136 | 137 | props = ['col1', 'col1_avg', 'col1_sum', 'col1_max', 'col1_min', 'col1_std'] 138 | 139 | expected_tree = '(A:1[&&NHX:col1=1.0])Root[&&NHX:col1_avg=2.5:col1_sum=10.0:col1_max=4.0:col1_min=1.0:col1_std=1.2909944487358056];' 140 | condition_inputs = ["col1_avg < 3.5"] 141 | pruned_tree = utils.conditional_prune(test_tree_annotated, condition_inputs, prop2type) 142 | 143 | self.assertEqual(pruned_tree.write(props=props, parser=parser, format_root_node=True), expected_tree) 144 | 145 | def test_pruned_by_05(self): 146 | # test "contains" in leaf node in list data 147 | # internal_nodes annotation list data 148 | internal_parser = "name" 149 | parser = utils.get_internal_parser(internal_parser) 150 | 151 | test_tree = utils.ete4_parse("(A:1,(B:1,(E:1,D:1):0.5):0.5)Root;") 152 | 153 | with NamedTemporaryFile(suffix='.tsv') as f_annotation: 154 | f_annotation.write(b'#name\tlist_data\nA\ta,b,c\nB\tc,d\nD\ta,c,d,e\nE\te,d,b\n') 155 | f_annotation.flush() 156 | 157 | metadata_dict, node_props, columns, prop2type = tree_annotate.parse_csv([f_annotation.name]) 158 | 159 | test_tree_annotated, annotated_prop2type = tree_annotate.run_tree_annotate(test_tree, 160 | metadata_dict=metadata_dict, node_props=node_props, 161 | columns=columns, prop2type=prop2type) 162 | props = ['list_data', 'list_data_counter'] 163 | expected_tree = '((B:1[&&NHX:list_data=c|d],(E:1[&&NHX:list_data=e|d|b])N4:0.5[&&NHX:list_data_counter=a--1||b--1||c--1||d--2||e--2])N5:0.5[&&NHX:list_data_counter=a--1||b--1||c--2||d--3||e--2])Root[&&NHX:list_data_counter=a--2||b--2||c--3||d--3||e--2];' 164 | condition_inputs = ['list_data contains a'] 165 | pruned_tree = utils.conditional_prune(test_tree_annotated, condition_inputs, prop2type) 166 | 167 | self.assertEqual(pruned_tree.write(props=props, parser=parser, format_root_node=True), expected_tree) 168 | 169 | def test_pruned_by_06(self): 170 | # test "contains" in internal node in list data 171 | # load tree 172 | internal_parser = "name" 173 | parser = utils.get_internal_parser(internal_parser) 174 | 175 | test_tree = utils.ete4_parse("(A:1,(B:1,(E:1,D:1):0.5):0.5);") 176 | with NamedTemporaryFile(suffix='.tsv') as f_annotation: 177 | f_annotation.write(b'#name\tlist_data\nA\ta,b,c\nB\tc,d\nD\ta,c,d,e\nE\te,d,b\n') 178 | f_annotation.flush() 179 | 180 | metadata_dict, node_props, columns, prop2type = tree_annotate.parse_csv([f_annotation.name]) 181 | 182 | test_tree_annotated, annotated_prop2type = tree_annotate.run_tree_annotate(test_tree, 183 | metadata_dict=metadata_dict, node_props=node_props, 184 | columns=columns, prop2type=prop2type) 185 | props = ['list_data', 'list_data_counter'] 186 | expected_tree = '(A:1[&&NHX:list_data=a|b|c])Root[&&NHX:list_data_counter=a--2||b--2||c--3||d--3||e--2];' 187 | condition_inputs = ['list_data_counter:a<2'] 188 | pruned_tree = utils.conditional_prune(test_tree_annotated, condition_inputs, prop2type) 189 | 190 | self.assertEqual(pruned_tree.write(props=props, parser=parser, format_root_node=True), expected_tree) 191 | 192 | if __name__ == '__main__': 193 | unittest.main() 194 | #pytest.main(['-v']) -------------------------------------------------------------------------------- /treeprofiler/__init__.py: -------------------------------------------------------------------------------- 1 | from .main import main -------------------------------------------------------------------------------- /treeprofiler/drivers/chromedriver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/treeprofiler/drivers/chromedriver -------------------------------------------------------------------------------- /treeprofiler/layouts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compgenomicslab/TreeProfiler/8836d2a21e31050690d1d8d6f92346335944f95a/treeprofiler/layouts/__init__.py -------------------------------------------------------------------------------- /treeprofiler/layouts/general_layouts.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | import Bio 3 | from Bio import AlignIO 4 | from Bio.Align import MultipleSeqAlignment 5 | from Bio.Align.AlignInfo import SummaryInfo 6 | import numpy as np 7 | from distutils.util import strtobool 8 | import matplotlib as mpl 9 | import matplotlib.colors as mcolors 10 | from itertools import chain 11 | import math 12 | 13 | from ete4.smartview import TreeStyle, NodeStyle, TreeLayout, PieChartFace, LegendFace, RectFace 14 | from ete4.smartview.renderer.draw_helpers import * 15 | 16 | from treeprofiler.src.utils import to_code, call, counter_call, check_nan 17 | from treeprofiler.src import utils 18 | 19 | Box = namedtuple('Box', 'x y dx dy') # corner and size of a 2D shape 20 | 21 | def get_piechartface(node, prop, color_dict=None, radius=20, tooltip=None): 22 | pair_delimiter = "--" 23 | item_seperator = "||" 24 | piechart_data = [] 25 | counter_props = node.props.get(prop).split(item_seperator) 26 | for counter_prop in counter_props: 27 | k, v = counter_prop.rsplit(pair_delimiter, 1) 28 | #k, v = counter_prop.split(pair_delimiter) 29 | piechart_data.append([k,float(v),color_dict.get(k,None),None]) 30 | 31 | if piechart_data: 32 | piechart_face = PieChartFace(radius=radius, data=piechart_data, padding_x=5, tooltip=tooltip) 33 | 34 | return piechart_face 35 | else: 36 | return None 37 | 38 | def get_aggregated_heatmapface(node, prop, min_color="#EBEBEB", max_color="#971919", tooltip=None, 39 | width=70, height=None, padding_x=1, padding_y=0, count_missing=True, max_count=0): 40 | counter_props = node.props.get(prop).split('||') 41 | total = 0 42 | positive = 0 43 | for counter_prop in counter_props: 44 | k, v = counter_prop.split('--') 45 | if count_missing: 46 | if not check_nan(k): 47 | if strtobool(k): 48 | positive += float(v) 49 | total += float(v) # Consider missing data in total 50 | else: 51 | if not check_nan(k): 52 | total += float(v) # Doesn't consider missing data in total 53 | if strtobool(k): 54 | positive += float(v) 55 | 56 | total = int(total) 57 | # ratio = positive / total if total != 0 else 0 58 | # if ratio < 0.05 and ratio != 0: # Show minimum color for too low 59 | # ratio = 0.05 60 | 61 | # Adjust the maximum color based on 'total' to simulate darkening 62 | adjusted_max_color = utils.make_color_darker_scaled(max_color, positive, max_count, base=10, scale_factor=10) 63 | #adjusted_max_color = make_color_darker(max_color, darkening_factor=0.01) # Example factor 64 | #gradient_color = color_gradient(min_color, adjusted_max_color, mix=ratio) 65 | 66 | if not tooltip: 67 | tooltip = f'{node.name}Tree annotating ...
11 |{{tree_info['annotated_tree']}}17 | 18 |
{{tree_info['metadata']}}20 | 21 | Go back to upload 22 | 23 | 24 |