User:Jts1882/clade/Newick

Tests and examples of using Newick format data directly or indirectly with clade.

Simple case
CladeN version for testing.

Open Tree of Life: Felidae (directly)
Cladogram using newick data from Open Tree of Life Felidae ("ott_id":563159)

https://tree.opentreeoflife.org/opentree/opentree9.1@ott563159/Felidae

Note: the use of Lua patterns to reformat the text (remove the _ott suffix and italicising taxa)

{{clade |style=font-size:100%;line-height:100%; {{clade |style=font-size:100%;line-height:100%; }}
 * newick1-pattern=([%a_]*)_([s?p?%.?_%u%d]*)_?(ott[%d]*)
 * newick1-replace=%1 %2
 * newick1=((((Catopuma_badia_ott763032, ... Panthera_tigris_ott42314))Panthera_ott563154))Felidae_ott563159;
 * newick1-pattern=([%a_]*)_([s?p?%.?_%u%d]*)_?(ott[%d]*)
 * newick1-replace=%1 %2
 * newick1=((((Catopuma_badia_ott763032,Catopuma_temminckii_ott763025)Catopuma_ott763015,(Pardofelis_marmorata_ott660452)Pardofelis_ott86186),((((Caracal_caracal_ott1033549)Caracal_ott1033548,(Profelis_aurata_ott660447)Profelis_ott660451),(Leptailurus_serval_ott86170)Leptailurus_ott86169),((Leopardus_guttulus_ott5839530,Leopardus_braccatus_ott3613208,Leopardus_pajeros_ott3613206,((Leopardus_pardalis_albescens_ott743811)Leopardus_pardalis_ott752746,Leopardus_wiedii_ott507553),((Leopardus_tigrinus_ott774309,(Leopardus_geoffroyi_ott774303,Leopardus_guigna_ott507542)),(Leopardus_jacobita_ott904397,Leopardus_colocolo_ott86175)))Leopardus_ott774314,((Lynx_vulgaris_ott6145642,Lynx_environmental_sample_ott4941869,Lynx_rufus_ott507545,(Lynx_canadensis_ott507549,(Lynx_lynx_ott886829,Lynx_pardinus_ott442049)))Lynx_ott886828,((((Acinonyx_jubatus_ott752759)Acinonyx_ott752758)Acinonychinae_ott626920,((Puma_concolor_couguar_ott736439,Puma_concolor_coryi_ott532124)Puma_concolor_ott42307,Puma_yagouaroundi_ott86162)Puma_ott86161),(((Otocolobus_manul_ott86183)Otocolobus_ott86182,(Prionailurus_rubiginosus_ott507541,Prionailurus_iriomotensis_ott418475,(Prionailurus_viverrinus_ott862641,(Prionailurus_bengalensis_bengalensis_ott5557509,Prionailurus_bengalensis_euptilurus_ott547362,Prionailurus_bengalensis_chinensis_ott198595)Prionailurus_bengalensis_ott280108),Prionailurus_planiceps_ott86166)Prionailurus_ott570215),(Felis_venatica_ott6145636,Felis_chaus_ott983181,Felis_sp._NG192_ott340411,(Felis_nigripes_ott983179,(Felis_margarita_ott983177,(Felis_catus_ott563166,(Felis_silvestris_lybica_ott983183,Felis_silvestris_silvestris_ott754039,Felis_silvestris_bieti_ott54743,Felis_silvestris_ornata_ott54741,Felis_silvestris_cafra_ott54737)Felis_silvestris_ott563163))))Felis_ott563165)))))),((Neofelis_diardi_ott882766,(Neofelis_nebulosa_nebulosa_ott882765)Neofelis_nebulosa_ott763016)Neofelis_ott763018,((((Panthera_onca_mesembrina_ott735488)Panthera_onca_ott42322,(Panthera_leo_leo_ott5557508,Panthera_leo_atrox_ott927561,Panthera_leo_bleyenberghi_ott825431,Panthera_leo_spelaea_ott798329,Panthera_leo_persica_ott547996,Panthera_leo_krugeri_ott371429)Panthera_leo_ott563151),(Panthera_pardus_fusca_ott600110,Panthera_pardus_japonensis_ott182670,Panthera_pardus_saxicolor_ott42320,Panthera_pardus_orientalis_ott42318)Panthera_pardus_ott42324),(Panthera_uncia_ott532117,(Panthera_tigris_jacksoni_ott575331,Panthera_tigris_amoyensis_ott449298,Panthera_tigris_sondaica_ott445492,Panthera_tigris_sumatrae_ott42316,Panthera_tigris_altaica_ott19403,Panthera_tigris_tigris_ott19399,Panthera_tigris_corbetti_ott19397)Panthera_tigris_ott42314))Panthera_ott563154))Felidae_ott563159;

{{#subst:clade {{!}}style=font-size:100%;line-height:100%; {{!}}newick1-pattern=([%a_]*)_([s?p?%.?_%u%d]*)_?(ott[%d]*) {{!}}newick1-replace=%1 %2 {{!}}newick1=((((Catopuma_badia_ott763032,Catopuma_temminckii_ott763025)Catopuma_ott763015,(Pardofelis_marmorata_ott660452)Pardofelis_ott86186),((((Caracal_caracal_ott1033549)Caracal_ott1033548,(Profelis_aurata_ott660447)Profelis_ott660451),(Leptailurus_serval_ott86170)Leptailurus_ott86169),((Leopardus_guttulus_ott5839530,Leopardus_braccatus_ott3613208,Leopardus_pajeros_ott3613206,((Leopardus_pardalis_albescens_ott743811)Leopardus_pardalis_ott752746,Leopardus_wiedii_ott507553),((Leopardus_tigrinus_ott774309,(Leopardus_geoffroyi_ott774303,Leopardus_guigna_ott507542)),(Leopardus_jacobita_ott904397,Leopardus_colocolo_ott86175)))Leopardus_ott774314,((Lynx_vulgaris_ott6145642,Lynx_environmental_sample_ott4941869,Lynx_rufus_ott507545,(Lynx_canadensis_ott507549,(Lynx_lynx_ott886829,Lynx_pardinus_ott442049)))Lynx_ott886828,((((Acinonyx_jubatus_ott752759)Acinonyx_ott752758)Acinonychinae_ott626920,((Puma_concolor_couguar_ott736439,Puma_concolor_coryi_ott532124)Puma_concolor_ott42307,Puma_yagouaroundi_ott86162)Puma_ott86161),(((Otocolobus_manul_ott86183)Otocolobus_ott86182,(Prionailurus_rubiginosus_ott507541,Prionailurus_iriomotensis_ott418475,(Prionailurus_viverrinus_ott862641,(Prionailurus_bengalensis_bengalensis_ott5557509,Prionailurus_bengalensis_euptilurus_ott547362,Prionailurus_bengalensis_chinensis_ott198595)Prionailurus_bengalensis_ott280108),Prionailurus_planiceps_ott86166)Prionailurus_ott570215),(Felis_venatica_ott6145636,Felis_chaus_ott983181,Felis_sp._NG192_ott340411,(Felis_nigripes_ott983179,(Felis_margarita_ott983177,(Felis_catus_ott563166,(Felis_silvestris_lybica_ott983183,Felis_silvestris_silvestris_ott754039,Felis_silvestris_bieti_ott54743,Felis_silvestris_ornata_ott54741,Felis_silvestris_cafra_ott54737)Felis_silvestris_ott563163))))Felis_ott563165)))))),((Neofelis_diardi_ott882766,(Neofelis_nebulosa_nebulosa_ott882765)Neofelis_nebulosa_ott763016)Neofelis_ott763018,((((Panthera_onca_mesembrina_ott735488)Panthera_onca_ott42322,(Panthera_leo_leo_ott5557508,Panthera_leo_atrox_ott927561,Panthera_leo_bleyenberghi_ott825431,Panthera_leo_spelaea_ott798329,Panthera_leo_persica_ott547996,Panthera_leo_krugeri_ott371429)Panthera_leo_ott563151),(Panthera_pardus_fusca_ott600110,Panthera_pardus_japonensis_ott182670,Panthera_pardus_saxicolor_ott42320,Panthera_pardus_orientalis_ott42318)Panthera_pardus_ott42324),(Panthera_uncia_ott532117,(Panthera_tigris_jacksoni_ott575331,Panthera_tigris_amoyensis_ott449298,Panthera_tigris_sondaica_ott445492,Panthera_tigris_sumatrae_ott42316,Panthera_tigris_altaica_ott19403,Panthera_tigris_tigris_ott19399,Panthera_tigris_corbetti_ott19397)Panthera_tigris_ott42314))Panthera_ott563154))Felidae_ott563159; }}

Amphibiaweb newick test

 * cladogram using Newick string from https://github.com/AmphibiaWeb/aw-assets/commit/781e484c88dd85650b0b6e52c4ebf63757560dd3

Fish Tree of Life test

 * Source: https://fishtreeoflife.org/downloads/taxonomy/cohort/Elopomorpha_phylogram.tre

Note use of two replacements, the first to italicise terminals, the second to clear internal node info. {{clade |style=line-height:75%;font-size:75%; |newick1-pattern1=([%w_]+)(:%d%.%d*e?-?%d*) |newick1-replace1=%1 |newick1-pattern2=:%d%.%d*e?-?%d* |newick1-replace2= |newick1=((((((((((((((((((((((((Myrichthys_breviceps:0.04081586313, ... Megalops_cyprinoides:0.1343743457):0.1985870933):0.1160002706);
 * 1={{clade

{{clade box |collapsible=hide |newick1-pattern1=([%w_]+)(:%d%.%d*e?-?%d*) |newick1-replace1=%1 |newick1-pattern2=:%d%.%d*e?-?%d* |newick1-replace2= |newick1=((((((((((((((((((((((((Myrichthys_breviceps:0.04081586313,Myrichthys_ocellatus:0.0658490116):0.06576222887,Myrichthys_magnificus:0.122284606):0.006275526739,Myrichthys_maculosus:0.05626350521):0.04858840303,((Callechelys_marmorata:0.08551118539,Callechelys_catostoma:0.1085831938):0.0133213501,Leiuranus_semicinctus:0.1851632138):0.03520639763):0.01605867834,((Ophichthus_lithinus:0.06034929036,Pisodonophis_cancrivorus:0.1035918588):0.0126017797,Pisodonophis_sangjuensis:0.08262372711):0.08764792541):0.008027781035,(Ophisurus_macrorhynchos:0.2211354335,Xyrias_revulsus:0.03575511412):0.06066345681):0.01410133075,((Ophichthus_puncticeps:0.05043623721,Ophichthus_asakusae:0.07199179611):0.01692726233,(Brachysomophis_crocodilinus:0.1169567083,Ophichthus_rex:0.04652736206):0.009924893107):0.005098235914):0.01070643147,(((Ophichthus_gomesii:0.05972469376,Ophichthus_zophochir:0.03355265797):0.04331635477,Ophichthus_triserialis:0.09417414013):0.02412596903,Echiophis_punctifer:0.1207206042):0.0142889754):0.01208178797,Ophichthus_serpentinus:0.06889988433):0.01281598844,(Ophichthus_polyophthalmus:0.1232516856,Apterichtus_klazingai:0.1020641937):0.03860721416):0.01309425978,Ophichthus_altipennis:0.09075155579):0.0278784154,(Echelus_uropterus:0.037662264,Echelus_myrus:0.008087792192):0.07701069448):0.009574174033,(Brachysomophis_cirrocheilos:0.08320159921,Brachysomophis_henshawi:1.0000005e-06):0.06640522872):0.05156967308,Oxyconger_leptognathus:0.1105410878):0.06480935704,(((((((Myrophis_microchir:0.09353366755,Myrophis_platyrhynchus:0.0106397967):0.1017438684,Ahlia_egmontis:0.1372884293):0.0420703945,(Myrophis_punctatus:0.05170456451,Myrophis_vafer:0.03663570122):0.02507347221):0.09700537508,(Scolecenchelys_breviceps:0.01676969274,Scolecenchelys_aoki:0.008272559077):0.08267999636):0.03195879707,Muraenichthys_gymnopterus:0.2196905987):0.05433400777,Apterichtus_australis:0.1125987242):0.02697614954,Scolecenchelys_gymnota:0.09127903627):0.05660446202):0.0291542086,(((Muraenesox_bagio:0.1622848156,Muraenesox_cinereus:0.1058537939):0.03460736517,Congresox_talabonoides:0.1024862067):0.1567792587,Cynoponticus_ferox:0.1447369983):0.1006045151):0.03440115494,(((((((((Gnathophis_nystromi_ginanago:0.02213264812,Gnathophis_nystromi_nystromi:0.04771047654):0.02864008955,Gnathophis_longicauda:0.04834869238):0.02094900491,(Gnathophis_capensis:0.05754661035,Gnathophis_bathytopos:0.005092082272):0.04028687598):0.1010131952,Rhynchoconger_flavus:0.1040960195):0.0176757855,(((Hoplunnis_tenuis:0.1713846843,Saurenchelys_fierasfer:0.1043673495):0.01688108129,Venefica_procera:0.07741544721):0.02195754075,Nettastoma_melanurum:0.0870288476):0.02409792625):0.01081553538,(Macrocephenchelys_brachialis:0.1444367092,Xenomystax_congroides:0.0771115211):0.02325683381):0.01530030176,(((Bathycongrus_retrotinctus:0.02045671792,Bathyuroconger_vicinus:0.01357957398):0.0275514596,Bathycongrus_wallacei:0.02739403239):0.1013279621,(Uroconger_syringinus:0.05179611893,Uroconger_lepturus:0.04712122429):0.1698002235):0.06372500161):0.009894675712,((Facciolella_oxyrhyncha:0.05942422237,Facciolella_gilbertii:0.03673139578):0.03270378031,Venefica_proboscidea:0.09495850003):0.09482056591):0.04160917602,(((Gorgasia_taiwanensis:0.001381747357,Heteroconger_hassi:0.008632582211):0.0140018729,Heteroconger_lentiginosus:0.0251980954):0.1442171217,Paraconger_notialis:0.1445663377):0.06188122763):0.0173204645):0.01833965771,(((((Ariosoma_scheelei:0.1419406298,Ariosoma_meeki:0.09268034704):0.04107468728,Ariosoma_balearicum:0.160758636):0.03047244406,((Ariosoma_shiroanago:0.05261142221,Poeciloconger_kapala:0.0162168554):0.02668983809,Ariosoma_major:0.04010168024):0.0758512322):0.1753317368,(Parabathymyrus_macrophthalmus:0.1076101096,Ariosoma_anago:0.2361450048):0.1202178714):0.170098781,(((Conger_oceanicus:0.09097367353,Conger_myriaster:0.016328254):0.01242662394,Conger_conger:0.1156818098):0.08827425571,Conger_japonicus:0.1911719877):0.1481818808):0.02871983773):0.02003889874,(((Coloconger_cadenati:0.1340831291,Derichthys_serpentinus:0.1739944139):0.01052436885,(Nessorhamphus_ingolfianus:0.04953023508,Nessorhamphus_danae:0.0704020388):0.05708078045):0.03323845783,Thalassenchelys_coheni:0.1927331806):0.06678717205):0.03995193976,(((((((((((((((((Gymnothorax_prionodon:0.03770353501,Gymnothorax_polygonius:0.03129615012):0.01479084102,(Gymnothorax_kidako:0.03886369124,Gymnothorax_margaritophorus:0.05918378721):0.008750746228):0.02394668684,Gymnothorax_chilospilus:0.1019211287):0.01563825056,Gymnothorax_zonipectis:0.1455549397):0.01907661946,(Gymnothorax_richardsonii:0.1007969861,Echidna_polyzona:0.1669557165):0.01953370841):0.04254064784,(((Gymnothorax_javanicus:0.01918790078,Gymnothorax_reticularis:0.02227577239):0.007424548024,Gymnothorax_fimbriatus:0.05285175286):0.006993315584,(Gymnothorax_reevesii:0.03754748471,Gymnothorax_eurostus:0.0828844167):0.02365771129):0.07099338991):0.02072782925,(((Gymnothorax_punctatus:0.1283692482,Gymnothorax_pseudothyrsoideus:0.02455120258):0.1008816515,(Gymnothorax_polyuranodon:1.0000005e-06,Gymnothorax_undulatus:1.0000005e-06):0.0797249138):0.05103679989,Gymnothorax_rueppelliae:0.1496575123):0.03508319886):0.0116781083,(Rhinomuraena_quaesita:0.1690671964,Strophidon_sathete:0.1671129223):0.02161682085):0.02725333712,(Gymnothorax_favagineus:0.02135654131,Gymnothorax_isingteena:0.05019410888):0.1441784969):0.01653336175,((((((Muraena_augusti:0.06541909536,Muraena_lentiginosa:0.04941689451):0.01901174539,Muraena_argus:0.0257206368):0.02287819784,Muraena_helena:0.07555807383):0.007916510755,Muraena_melanotis:0.09766056847):0.07653048379,Enchelycore_nigricans:0.1216066668):0.01793603825,(((Echidna_catenata:0.1255273075,Echidna_nebulosa:0.07811558185):0.05773151611,(Gymnothorax_pictus:0.1075342456,Gymnothorax_flavimarginatus:0.05743466421):0.05109880488):0.008579373364,Gymnothorax_castaneus:0.1521041027):0.02480315189):0.01462366155):0.01233364419,((((Gymnothorax_miliaris:0.05694095946,Gymnothorax_buroensis:0.1313124499):0.06153449267,(Gymnothorax_meleagris:0.04758785464,Gymnothorax_hepaticus:0.08040708648):0.02469878515):0.05822850509,(Pseudechidna_brummeri:0.1825506502,Enchelycore_anatina:0.1516593546):0.0381537734):0.01821110862,(((Gymnothorax_vicinus:0.01758082533,Gymnothorax_moringa:0.04063883345):0.05031894447,Gymnothorax_funebris:0.132622959):0.05034564045,Enchelynassa_canina:0.1814621295):0.03642468608):0.008690285118):0.03969208238,(((((((Echidna_xanthospilos:0.03026607143,Gymnothorax_maderensis:0.02298704143):0.02079371302,Gymnothorax_bacalladoi:0.07114827281):0.09748463453,Muraena_robusta:0.1407700767):0.02067596675,Gymnothorax_unicolor:0.1617264567):0.0285733766,(Gymnothorax_elegans:0.08451411408,Gymnothorax_nudivomer:0.08400578398):0.05089512792):0.01752642015,(((Gymnothorax_melatremus:0.1171216156,Gymnothorax_saxicola:0.06488294151):0.05240052689,Gymnothorax_ocellatus:0.140280457):0.03942841401,Gymnothorax_fuscomaculatus:0.1951393392):0.02601981595):0.01616445642,(Enchelycore_bayeri:0.1416697009,Enchelycore_carychroa:0.1433766628):0.04365507016):0.016989336):0.09856598173,Gymnomuraena_zebra:0.1568942013):0.07595973139,(((Scuticaria_okinawae:0.01339598763,Scuticaria_tigrina:0.04283702944):0.1010692817,Uropterygius_micropterus:0.1389006379):0.07273216343,Uropterygius_macularius:0.1838843286):0.06255071507):0.03204072965,((Uropterygius_xanthopterus:0.2070188512,Gymnothorax_australicola:0.1210514154):0.0327682988,Anarchias_seychellensis:0.1443462783):0.1241202672):0.1078416708,Pythonichthys_asodes:0.2195104576):0.09605893017,((((Chilorhinus_platyrhynchus:0.03557874501,Chilorhinus_suensonii:0.04660035171):0.1020082165,Kaupichthys_nuchalis:0.2078089118):0.06483650782,Kaupichthys_hyoproroides:0.1655767265):0.1545757786,((Bassanago_bulbiceps:0.001678399391,Bassanago_hirsutus:1.0000005e-06):0.01599554011,Bassanago_albescens:0.008540670028):0.08301547766):0.02723647863):0.03706481476):0.03796454143,((((((((((((Anguilla_bengalensis_labiata:0.002636339014,Anguilla_nebulosa:0.003352520611):0.03880743922,(Anguilla_luzonensis:0.01897460151,Anguilla_interioris:0.01547464132):0.005131521909):0.0021904837,((Anguilla_bicolor_bicolor:0.006414345995,Anguilla_bicolor_pacifica:0.01220974107):0.01975325554,Anguilla_obscura:0.02508210431):0.007902699919):0.003589542876,(Anguilla_marmorata:0.01438106177,Anguilla_bengalensis_bengalensis:0.126497071):0.008514459458):0.01282647761,(Anguilla_celebesensis:0.02493168713,Anguilla_megastoma:0.03894642447):0.01247463993):0.009624340994,Anguilla_reinhardtii:0.02592303195):0.006282629758,Anguilla_malgumora:0.04663467206):0.01170061573,(((Anguilla_rostrata:0.009872851046,Anguilla_anguilla:0.08481983131):0.02523339901,Anguilla_japonica:0.04464428395):0.01025921965,Anguilla_mossambica:0.06566654838):0.00788089883):0.005247760551,Anguilla_dieffenbachii:0.02152787115):0.01204105549,(Anguilla_australis_schmidtii:1.0000005e-06,Anguilla_australis_australis:0.0007690625745):0.02885522532):0.06937925946,((((Serrivomer_samoensis:0.05051169867,Serrivomer_sector:0.01936303533):0.02756175209,Serrivomer_jesperseni:0.09404976382):0.01325515834,Stemonidium_hypomelas:0.09197726044):0.09193335809,((Nemichthys_curvirostris:0.04288620334,Nemichthys_scolopaceus:0.07745306512):0.2708690415,Avocettina_infans:0.1732605537):0.09899836058):0.01926755365):0.0356975145,(((Moringua_javanica:0.1725165266,Moringua_edwardsi:0.02000051472):0.1315128179,Neoconger_mucronatus:0.1520001343):0.1534114206,(Eurypharynx_pelecanoides:0.2625810186,Saccopharynx_ampullaceus:0.22591741):0.159691338):0.152397426):0.05594567379):0.02902948868,(((((Dysomma_anguillare:0.1090318664,Ilyophis_brunneus:0.05570702421):0.01804542924,Meadia_roseni:0.08417366899):0.02021172957,(Simenchelys_parasitica:0.02059770667,Histiobranchus_bathybius:0.02587885501):0.08093490109):0.01743087973,((Synaphobranchus_kaupii:1.0000005e-06,Synaphobranchus_affinis:0.00204073952):0.04699171685,Diastobranchus_capensis:0.08803645944):0.06943503696):0.04008938976,Meadia_abyssalis:0.08947643746):0.07793303268):0.1669886492,(((((Notacanthus_abbotti:1.0000005e-06,Notacanthus_bonaparte:0.1558451612):0.07795573945,(Polyacanthonotus_challengeri:0.03550336519,Polyacanthonotus_rissoanus:0.08322675242):0.03232144699):0.0710542261,((Halosauropsis_macrochir:0.08966693636,Aldrovandia_phalacra:0.0744350051):0.03111708305,Halosaurus_carinicauda:0.04389760541):0.06213572918):0.01226915917,Aldrovandia_affinis:0.2529010965):0.1670980425,((((((Albula_argentea:0.105799704,Albula_nemoptera:0.1122578873):0.02667347057,Albula_koreana:0.05144767602):0.02581517761,(Albula_gilberti:0.04278421986,Albula_esuncula:0.02278828104):0.0382877337):0.03752624151,Albula_vulpes:0.08266829779):0.05513231242,Albula_glossodonta:0.09343764018):0.4260758399,Pterothrissus_gissu:0.0941017577):0.03982944196):0.06740327528):0.1173694195,(((Elops_saurus:0.01596503893,Elops_affinis:0.01093685556):1.0000005e-06,(Elops_machnata:0.001047366555,Elops_hawaiensis:0.01041223594):0.01123598542):0.2826058031,(Megalops_atlanticus:0.1037871785,Megalops_cyprinoides:0.1343743457):0.1985870933):0.1160002706);
 * caption=Cladogram from Fish Tree of Life Newick data
 * text= Elopomorpha
 * content= {{clade |style=line-height:75%;font-size:75%;

}} }}

Deepfin full tree
Family level phylogeny based on Deepfin 4 Phylogeny of All Fishes

Cladogram constructed using downloaded newick file 12862_2017_958_MOESM2_ESM.tre

Example 1
Code:

Output:

Example 2
Code:

Output: