Skip to content

Instantly share code, notes, and snippets.

@hryk
Last active January 23, 2018 02:42
Show Gist options
  • Save hryk/174dd675a74efa224310c92659fcfa5f to your computer and use it in GitHub Desktop.
Save hryk/174dd675a74efa224310c92659fcfa5f to your computer and use it in GitHub Desktop.
Vizualize phylogenetic tree with phylocanvas
### https://raw.github.com/github/gitignore/9da1b5d8ce4e009ff627c4fe49a4488b2a3f60d4/Global/vim.gitignore
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
# Session
Session.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
### https://raw.github.com/github/gitignore/9da1b5d8ce4e009ff627c4fe49a4488b2a3f60d4/Global/macos.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### https://raw.github.com/github/gitignore/9da1b5d8ce4e009ff627c4fe49a4488b2a3f60d4/node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env

Visualize Phylogenetic Tree with phylocanvas

An example visualization of phylocanvas

Reference visualization of PeerJ Tree

Reference picture of phylogenetic tree is blow.

<!DOCTYPE html>
<head>
<title>Visualize phylogenetic tree with phylocanvas</title>
<script type="application/javascript"
src="https://cdn.rawgit.com/phylocanvas/phylocanvas-quickstart/v2.8.1/phylocanvas-quickstart.js"></script>
<script type="application/javascript" src="load_tree.js"></script>
<style>
#tree {
width: 100%;
height: 60em;
}
</style>
</head>
<body>
<div id="tree"></div>
<script type="application/javascript">
load_tree(document.getElementById("tree"));
</script>
</body>
//{{{ newick
var newick = "((Centruroides_vittatus:0.254086878757274,(Ixodes_scapularis:0.45878989309566154,Tetranychus_cinnabarinus:0.7986853050927685):0.0482759620501938):0.02080618470956883,((Mastigoproctus_giganteus:0.23578245117165975,Damon_variegatus:0.21444401582818973):0.045782851915262324,((Liphistius_sp:0.06512817496016976,Liphistius_malayensis:0.06391058974219144):0.10387033363431308,((((Aliatypus_coylei:0.0542040705434238,Antrodiaetus_unicolor:0.051677741385823484):0.0440159437387434,(Megahexura_fulva:0.11029600603675216,Sphodros_rufipes:0.10735532241757306):0.014393484257789524):0.0913430715196234,(Microhexura_montivaga:0.14131049470855372,((Nemesiid_sp:0.07172141520374897,(Trichopelma_laselva:0.05760072659901405,(Aphonopelma_iviei:0.03018534920963689,Acanthoscurria_geniculata:0.05093093081368749):0.020597124427261138):0.03182650358101835):0.01632735037672406,((Paratropis_sp:0.08466696082572778,(Pionothele_nsp:0.05780088454196286,Brachythele_longitarsus:0.05689592758803785):0.020790172068387847):0.009011443879046288,((Cyclocosmia_truncata:0.07287126088391571,Hebestatis_theveneti:0.05206917691459878):0.016703888238204012,(Idiops_bersebaensis:0.09766681326317017,(Promyrmekiaphila_clathrata:0.05948064197830516,(Aptostichus_stephencolberti:0.030717283700260833,Aptostichus_atomarius:0.01549250885699649):0.02823311710055154):0.01826080098140226):0.007193610123616301):0.010727974676549179):0.01017781263289641):0.02695918757456961):0.07691732430521869):0.04051390301909541,(((Hypochilus_pococki:0.1455494999441198,Kukulcania_hibernalis:0.16206624669187386):0.02656087001744667,((Calponia_harrisonfordi:0.18095845360454987,(Dysdera_crocata:0.16377060937914978,Segestria_sp:0.1535265064965855):0.05468272319611889):0.023014367892940646,((Loxosceles_griswold:0.12326967676567735,Scytodes_thoracica:0.1842871062125191):0.06100264947873413,(Diguetia_sp:0.18340142671305393,(Pholcus_phalangioides:0.09923952797393021,Pholcus_griswold:0.14291162236497357):0.07157276489948661):0.03796924680464553):0.026311004906033997):0.04580845408562917):0.028005624539242158,(Leptoneta_griswold:0.18732253430099566,((Stegodyphus_mimosarum_genome:0.17169622891313052,((Theridion_sp:0.13164494378992353,Latrodectus_tredecimguttatus:0.11547623570841992):0.06875933603627493,((Microdipoena_guttata:0.28829277729734204,(Ero_leonina:0.11798431625982009,(Tetragnatha_versicolor:0.13666346101425286,Leucauge_venusta:0.08505361201709483):0.03864368684575914):0.021860833769336896):0.01599533357291527,((Nesticus_cooperi:0.12522930863202086,(Frontinella_communis:0.12593565371021775,Pimoidae_sp:0.11255053799994086):0.025145268106465668):0.014235284407538407,(Nephila_clavipes:0.10882276957726811,((Micrathena_gracilis:0.05049167350202588,Verrucosa_arenata:0.05551697302039038):0.023311982750732874,(Neoscona_arabesca:0.0667424022303359,(Macracantha_arcuata:0.03190451645474357,Gasteracantha_hasselti:0.03056493012654027):0.05613263172825145):0.013174901940997574):0.046012332383707055):0.047301557341757006):0.01341569638731488):0.0285976586217509):0.03147604375220303):0.009784773637682709,((Oecobius_navus:0.1486446941100812,(Uloborus_sp:0.04812498270092347,Philopenella_herediae:0.044465740167590306):0.13477245924766945):0.018023281064276975,(Deinopis_longipes:0.11876176419584028,(((Amaurobius_ferox:0.07118578655068575,Callobius_sp:0.05339731994949304):0.0521926947938548,((Cicurina_vibora:0.08928112319524528,Calymmaria_persica:0.08985108695077393):0.037833128213679346,(Agelenopsis_emertoni:0.09028530069200802,(Badumna_longinquus:0.07787210455607307,(Amphinectid_sp:0.041177258773736236,Metaltella_simoni:0.0480839577667217):0.03552824408474964):0.030646428171644202):0.008942997136035635):0.014614759795945509):0.015981349070746553,(Homalonychus_theologus:0.1050303666631821,((Habronattus_signatus:0.126796207697359,(Anyphaenid_sp:0.10188560444566697,(Sergiolus_capulatus:0.07243907741060651,Trachelas_tranquillus:0.11715114134034632):0.016946375530369928):0.012371304282890239):0.015044255391896355,(Thomisidae_sp:0.12454296151862465,((Peucetia_longipalpis:0.07305564648719332,Anahita_punctulata:0.07283259534079511):0.013179721002126943,(Schizocosa_rovneri_like:0.07429795487097912,(Pisaurina_mira:0.07095593710519399,Dolomedes_triton:0.056503236138026325):0.009341981835509605):0.014811756300074586):0.008760560401925188):0.021140940895819638):0.015258610931700223):0.01160206321207291):0.06045667150438461):0.01343264202667449):0.012293618221280056):0.05642664018983268):0.07895399857489305):0.03776818425273576):0.04689320386543161):0.07731362035163947):0.020806184709568878);";
//}}}
var load_tree = function (div) {
var tree = Phylocanvas.createTree(div.id);
tree.setTreeType('rectangular');
tree.disableZoom = false;
tree.load(newick);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment