RNeXML/0000755000176200001440000000000013614247105011322 5ustar liggesusersRNeXML/NAMESPACE0000644000176200001440000000475713614140074012553 0ustar liggesusers# Generated by roxygen2: do not edit by hand S3method(nexml_read,XMLInternalDocument) S3method(nexml_read,XMLInternalNode) S3method(nexml_read,character) export(add_basic_meta) export(add_characters) export(add_meta) export(add_namespaces) export(add_trees) export(expand_prefix) export(flatten_multiphylo) export(get_all_meta) export(get_characters) export(get_characters_list) export(get_citation) export(get_flat_trees) export(get_level) export(get_license) export(get_meta) export(get_metadata) export(get_metadata_values) export(get_namespaces) export(get_otu) export(get_otus_list) export(get_rdf) export(get_taxa) export(get_taxa_list) export(get_trees) export(get_trees_list) export(meta) export(nexml) export(nexml.cell) export(nexml.char) export(nexml.characters) export(nexml.edge) export(nexml.format) export(nexml.matrix) export(nexml.member) export(nexml.node) export(nexml.otu) export(nexml.otus) export(nexml.polymorphic_states) export(nexml.row) export(nexml.seq) export(nexml.state) export(nexml.states) export(nexml.tree) export(nexml.trees) export(nexml.uncertain_state) export(nexml.uncertain_states) export(nexml_add) export(nexml_figshare) export(nexml_get) export(nexml_publish) export(nexml_read) export(nexml_to_simmap) export(nexml_validate) export(nexml_write) export(read.nexml) export(reset_id_counter) export(simmap_to_nexml) export(taxize_nexml) export(write.nexml) exportClasses(nexml) exportMethods("slot<-") exportMethods(slot) exportMethods(summary) import(XML) import(ape) import(httr) import(methods) import(reshape2) import(uuid) importClassesFrom(methods,MethodWithNext) importFrom(dplyr,"%>%") importFrom(dplyr,bind_rows) importFrom(dplyr,coalesce) importFrom(dplyr,left_join) importFrom(dplyr,matches) importFrom(dplyr,mutate) importFrom(dplyr,mutate_) importFrom(dplyr,select) importFrom(dplyr,select_) importFrom(lazyeval,interp) importFrom(methods,addNextMethod) importFrom(methods,cacheMethod) importFrom(methods,className) importFrom(methods,getClassDef) importFrom(methods,getGeneric) importFrom(methods,new) importFrom(methods,packageSlot) importFrom(methods,selectMethod) importFrom(plyr,arrange) importFrom(plyr,compact) importFrom(stats,na.omit) importFrom(stats,setNames) importFrom(stringi,stri_match_first_regex) importFrom(stringi,stri_replace_first_regex) importFrom(stringr,str_replace) importFrom(tidyr,spread) importFrom(utils,capture.output) importFrom(utils,head) importFrom(utils,object.size) importFrom(utils,packageName) importFrom(uuid,UUIDgenerate) importFrom(xml2,read_xml) RNeXML/LICENSE0000644000176200001440000000012013552353762012330 0ustar liggesusersYEAR: 2013 - 2014 COPYRIGHT HOLDER: Carl Boettiger ORGANIZATION: rOpenSci RNeXML/tools/0000755000176200001440000000000013552353762012472 5ustar liggesusersRNeXML/tools/README-unnamed-chunk-5-1.png0000644000176200001440000016673713552353762017214 0ustar liggesusersPNG  IHDRxa]^iCCPkCGColorSpaceGenericRGB8U]hU>sg#$Sl4t? % V46nI6"dΘ83OEP|1Ŀ (>/ % (>P苦;3ie|{g蹪X-2s=+WQ+]L6O w[C{_F qb Uvz?Zb1@/zcs>~if,ӈUSjF 1_Mjbuݠpamhmçϙ>a\+5%QKFkm}ۖ?ޚD\!~6,-7SثŜvķ5Z;[rmS5{yDyH}r9|-ăFAJjI.[/]mK 7KRDrYQO-Q||6 (0 MXd(@h2_f<:”_δ*d>e\c?~,7?& ك^2Iq2"y@g|U\ @IDATx ]ӹ8 5D[PU.hѦ5jJ[R >< 0 3 4(5*\ tֱ[E @h[NGyd:3ԩSS^J">ɓ'yرcӸqڼ @;{/ 80gﯻ1Vy@wuWZ￟F>/Ei^y|HrJҥKl!  @ @@δ:nWU&oVZ}3<wqk'_Ӄ>OJ[lE> j6: @+x^{/pe6',s-?lĉK@l @ @@]~vٸE3fLquJ.h> 7!н1a @ @xRl+`wVZi狃'{gGy$o6s4`4x.7޸עpwމimMlI>ϋ{MӦMK+rtP?_۽W^:zjos=ٳv[Ϊ6lX:qRK-_w|xClӟg7x#5*M0<׾4~K4 96o{G:sؘoL?>J|:ꨣR[k}I'|rz­:s |ɼُ4cƌ#@[AmDcW"HLC+HNh @ @A Vs\:thZs5oÜ:uj΢Lh ,@WE0'H\pAzWM7ݔno-DuNqw+.רC[w#/o܍ 6lnܿ_~y3.駟|ʹ[,}l(Ik;/ų"]l?!)i#72?vo+ 8 @ON8,pE|;-;??2QޠGMTCW=iȐ!MiO>lr?x8p`s=}wS޽_n/yAYm">H_8Zh?YfgϞi9}'^eb<"68㌴>Fipi4 [S3"@ P@ȒK.Yc40/ХK曧_"5ެ-裏F۷o[wZlN;i-J4F2 ~aD}ڨ_|^ 5|c_}lO~DP6rJ.q饗,z|#^{6o뮻nToVs}/9AO@Ĉ @4c=O?ݰs41U;(^dF6j6oQoO/rΈضZC&g 5ty%nd O<9:nܸ4bĈ1km#(-fۖ`ȑ9o#sQN\O2%o'f5׿%+"8n:$ Pުq @hȴ`C=`J@'H\z饳K/\M!k",Zk槛ۻ;zǵQ#Hk6mZ>`2z\D=Qs7J/D[gur͏kՏCrr<0~F7 fG @@Onj͋4O6 3ƏVnnlz+ھYdվ;.q(-6Xk~ߤIS;~ٱE"-joVťwuWy.Ω#xĉQ"6@F@ 6! @k٬meN:5֍Պ اO+;3_WҼKݻwOґGFiW\qETk4yVkoj2ԖzE= 6 n8Wk3w[h~>Ƶ[z*_+hy h<[S3"@ @L`vm&{71>:g=}E+6B{Rquo @TIGwM3fTUinJ@Нw޹ ED~5w )2a,8׷o{2 [ou\N[lEӟDŽ Җ[n7Gvذa85 H[9'Mgm&]wu|6mZ-r㵶.O"k?#F ۚF`=mVH>h{nї (P3\ @ P;cfm[ynmݖ6`[dFp72u_6,o {챲o9rdSO=Ep7/?A5oN>St|r){I̓"7בV+gz6w| ԝ ޺["@ и2xwm͌@)SRd."ie>q%BM"w^]xsmdGFz16 @ & ` j: @<P|  @ @혛 @ @ 0x @ @:& 17w @ @ @` %0 @ @tL@cn"@ @ @<K` @ @蘀oE @ @y. ;ϗ @ @ 1ގ @ @\@w/ @ @ @c;v @\rI:sСCS׮$@4@?i ;;#@ `K-Tz+?ӧ=zT~&@2x | @Xvesw]wMnǝ#L3gL]t @_@'@\z6xMc ܀  @u*P]u iX @ @s[ @ @ @` !H!@ @ @> @ @sH@wAz  @ @涀y @ @Csc @ @ 0x綸#@ @ @CC @ @- ;} @ @搀 @ @m޹- @ @ 0x @ @ @`n mqG @:IҔ)S:٬t/체^{^;; <8m???'ɧP @ @~tG38#M:;'8}{ .G?S)NguV袋Zkդ74o㬥 @ @xҊ+3wW]uԫW[# dƌiuM<@No v'L~ߥ<}L۷o#Lh& [ @ @ʲ G}O8cn^O>ev)mFi=L/b;vl-;8 @am4 @ P?DmXm 餓N>&c\7|i4o- @ @zV,7O׿Yd6?,dDR |A\ @J4Tw팜 @ԕkKĠ"hvZ޽{Zi_._tgGy$M<9͜93 0 g.i7.D/ZԠ=j/Q8J;ܶn6dzqϋ{MӦMK+rtP?_tmzW/K.SOM7_z5\&NnG}t>nOy⭷*{fbh.hӬF@5|IЍ @@ Ǎ7ޘm=O<$.FFm'ښk vۥȚڵk좼ߟ?ƚDP:)ocY @K?ku֩XVdqG}4E7Z߾}_wZ!irMxx#7x Ç~e#c6Gow.n|^ 5|c_}l|fF 8.D9K/4gզ^{핳뮛r+nq=?9jsumT_@kh @*#ty'(n 0[6۬SdF6j6oQoO/rΈضZC&g y%n7Mqƥ#Fp[d )G>2k[18r˥N:ry(./HZliv[}TF@2Ke @ @&O\kI>hL@FmL:5m)J6Dldxi=Y>9Xvek:TmOW]uU*.7|?aώ [xDm6K[vzvbӲ??ų֞mQ#mKx`g0aBzS9[:Ssz>;Q!@B]>qk @:o 'NLq @";7RD#5w )2ax㍲_߾}`E x 7e"4ZdO*GPs-L3g8lذzysl,^'Mg&dlM{#:mڴ&j|~ֶ]v%Ipஹz* <81bDݰyٽynڭ[\¢tWL_|,p@@WzO3鍚N @^ozY @5w1Llڢep7E5{뭷n-2u#vݻ{,_Qwȑ|l8 9P;:t%ĥ#ov(@-v}V^uUZBG3yr-yGydFE]4}%.$F@ m56 ()N6 @g&6E E#@@= L2%E",XNh>(Ʀl;ZdF.9vey5Y}nd0G-('AC2h@ 4gy<]4 @@=Gbz1 @K/ZdƟzhͻP>"0>dȐSߤ# ' pKjBsJ`Ϗ[;9X!@[E }ssL ]cfA @ @' ܌  @ @hYH @ @ @ v57c @ @D@A4 @ @|o͘ @ @m4  @ @:o[s3&@ @ @Axd!M @ @' ܌  @ @hYH @ @ @ v57c @ @D@A4 @ @|o͘ @ @m4  @ @:o[s3&@ @ @Axd!M @ @' ܌  @ @hYH @ @ @ v57c @ @D@A4 @ @|o͘ @ @m4  @ @:o[s3&@ @ @Axd!M @ @' ܌  @ @hYH @ @*0iҤ4eʔz^ÎkܸqiJKJtv 0 @  頃JkVӧg)ۚ~tᇧ_~9u--uss0 @ @{エ+UW]5իFظùk^{UNp. x2xoM͈ @s,;>4oC.I @ @y+ Ғ3=xGҖ[nf̘s7@ 6ܒ @sw ^|Ŵf^{- 4( <8K.i5לiU5x*#@ @+űc ^wuDO;Խ{J+߿<_u]3L:y4s4`e]o\tme hOvXśzwm6m&5?9ޛMV^y5ceW^ye_"zꩧ/=s)N81vmyaÆ>znzo7<^l9t<_w{ & ` j: @ @`^ q鬳j1c4QF &49o;3]|k_Z?~|Zb%2dHӟ^xX>|x6ɛ*s9믟}>tǧ:*kKOկ'vm瞛=SN9%?nR.!C+"=s$#FI&#e-mإ51 @ 0w"{gy&IZַUhԩ962e-_j>קOO . 馛nJu{-@n'{wsw]q9FF_Oft7sK[lE^pO?=iwO-X7Y_%)XcYw^gE{W&RR?x#iw]"CK.I=Ǫ[R8 а &F @@=?'pBl9\!Gق(oУG&?\!}Ym]w͟Ϧ7. 80w{Ҿ{YEp_rG9(Zs~EFZh.O/r~צӧ@'^x_<'2Ev"3.ˏLG?_ ޒmإ51 @Fz"#-24ԋ@i7t<"5޴Aڋ.(۷o.<]tѴN;%|ƍ,=#}?y#wYyQKqF)ڀl7_. .Ҝ[\owktgu]7g*G z<ߑd̷s1)E+~y@IDATՑ= fG `mt^QEihbjK-Tsj -Z[ιpmEкھ h XG @$[ne?U6uvll)Z+_kEFp[n:Rq(-6Xk~ߤIS;]obsDG֭[jK-^\E]{wܑvaraYj߭qLqxwm͌ @ulֶSN͵ucc"۴@V\qr3|+ͻ4y߽{}/y|lvWY6 w5hԖe-zlAmZ?c̙9x%pꪫw'#hAha(୿51" @ PY ւzdMҽޛxV[mԿ/~1-i%y睹_dΪEnmͺm~oڵk8p`-xcE[lQnVX>m|ҫ/Ǽ>MqQ7n xu@x~FO @JbF0_~-v1ǔ.}m^zxVq"J=DȤ=c~?x~?FdW^yeynZf*_N=\oС&.AryzVZiYq tЍ @'*p 7 ,@4sZ6pQ}98wy駟W^kѢC͉馛ޭ 6U]m[snmqϙgY޷}#9JXh4nu5+ @ 0j7,-hQvjޥ|?nܸ; Zߏ>(=:GqD0`@?Mo JEoXKM^F[{!C޽{8ߑo?j^ziyFa\p@@ mإ51 @ 0wkѾ/kϞ=MȞx63g‰'Xڏ~Z\ۥK4jԨTlvg >t衇ٻJ3fL5{삶me7Agn< Pu(D @(0yr\sMzGw$F>SNMo} %ٰ7xcs=snO]vڷ*7U֫*eo0gGن-XB@x饗r>C)j-bOTg-2x#OxDF@l @ @3|ψQ`ذa[nSN9%fѮ\rɼo7Ep ߍ:m„ i˧" _%iƏ~&ccbô/<-)jF0wWN'N,r9Pe%j[s >SgY5c#ٍ%wm4 @ 0vq4bĈ&@ilV^lPJy#Se.f=ceߨ;r4s|SOAD?A~z:]R=r y})k 7}c<{Ry"c6ꪫ6\/ʼnY:pPUr sA'9>@Ǝ?tqǥ;r7` @+)SZL݁'J:DfmSlַo]3f!ޅ^8 <89Un\[D@w.7 @ @Rgv-2dO=]wua(@v kvqL @ @ୟ0 @ @K@]\: @ @ @~xg- @ @m @ @Y #!@ @ @@xť3 @ @G@~H @ @ .vqL @ @ୟ0 @ @K@]\: @ @ @~xg- @ @m @ @Y #!@ @ @@xť3 @ @G@~H @ @ .vqL @ @ୟ0 @ @K@]\: @ @ @~xg- @ @m @ @Y #!@ @ @@xť3 @ @G@~H @ @ .vqL @ @ୟ0 @ @K@]\: @ @ @~xg- @ @m @ @@{&MLou]va4hРԳgϴ˧.w}xTQ@f @ @ov:蠃ZkSWoof9rdt%~:͘1#=.zj&f|j @ @O){W\1gꪩW^N>io|",vi4xt;/͜933&miV֏ Vh  @TE Je"WQFws\A}>tGPqL @ @@/Dzk^ꫛwBnXs5sn-A@ m55# @ 0x?%Qv!Zn9眓7VkG>RK_=-袭us Vx  @ԓkƎtuוC;RJ+|qp]w3<3=#iɹnr-]v%י-־F/ZaV{剋.(_ʽG֭~x?+哿qgf:.Ow\#Ow' @O J >͉E~oF&LPkk_Z/K4P^ȁF0yc=rk_Ӎ7ޘG}﨣BA>}'vmw[`AғO>N98͘1:Qd>fiqn)mFOaEY#@s9,  @ @g.A=3mg :4ַSNM_ ,3uO8tg>)AȺmD5Z\$s-{7 F@4Y3gLA|ʹ+GEI5X#EqE?ӁXfY>h6''MTwc>y]^ferw9/ ;( pn#@ @ D(0y矟Gق(oУG&fljj~8 2I?-gh4p{n_:s/yQJ}E/| y -P%2g#gϞi9}'^e"8Zl~iCZiʔ)_l\0E{wl4fA @Z8묳rg7h@m|滋lxkx⣏>"o߾/nul!N;kF(}<"70|)eOF]jk8&h@p]r^zi)7{WB.뮻n(-[oE+lM(Gʥ$.<Kp _mu5+ @ ?:Yqxmmޢߞ^~YmM"83<39c5jFO6l6nܸ4bĈ|\#ukmkȑ#s7#s-\:餓j/Ǒm[gVs.ohve(n&gcö#8"BߧvH} 8fB @Z){:Q(x饗rk<7Dli#tV-2ot뭷ݢ\Ck-jFs]wMӦMKQ]G]o%:묓կ^nq\n^۶67zjqx󫬲Jyinqd&-Gydkl>~ꫯF@ 6ښ @(+XjY[+PX!Vnnlz+ھ-XwA(Pw#p{9zKlVV]ZEZEDG֭[jK-^\mo׿U)"븭5c܏GM^m55# @ 0jYҍLԨ%O>9 }wK_Wwi{{^+͠fmkY-P[*" t7`\"\߭=6у j[yl>Ja^;*/ [%4 @ P?}&l<;|j/~i饗NK.dިej[[6kn[xv횊@h>k1Ƣw-(NZ +jY|w˟&;"7L5S@1լ @ @<(X~Zc)m]:,P[wkDz qI#{j_6W^yeynZf*86{}Cm6q6]vJgעEW^C7N@}ta @ Pu*p 7 ,@:s Fꫯ}G[% Oӣ>:g=w^zE+6BMj{M7.[l.ڑ <21ĵ4.6+=yErG6tk P&FD @*)PXd6oH-6@Q:6nܸT$LFmѣGs###HrH~llӟՏ_[hcw}K{wd,?_2dHݻwٯA #gr-v8WG?Q~Ř5W@q @ @\җT={,7!{'̜ 'xbq[E36R5|#c72\GUn(vCOvam[k(=CȄ3fLH^~?mmo[gqpw'3_iWo4ocY @ @y.0yr \sMzGw$F>odCdF67ޘsϜ[>蓃ڳ:TmOW]uU*.7|?aώ [xDm6K[vzv[ltxv-2x#9w~icǦ;,ϧw9'?ףD<hl^_#@ @sM`7/?7MÆ KQ&hrJ͢]{FZr%s-ލ78o6urkۄ R:EK/M7c=RK-?>=]~i饗%"M81w_nr:JԶ"hfSOb}~k? v>rVt.29X#x>=9' [53b @ P;c1bDE46T+Zdvmi 6(N_2DlRs{5|GfΜϝz9\v߃?VQGռK>S}ox" }=6oEooUWm~|_ 7`u͵j<@|W/5m.|BGN2%EjXNh3J:DfmrcS}62Ϙ1#E .¹ €R׮wG(u5:UX癯 @ @@:?k!E6odVu뭷^ՆmAk98Q"@ @ @@ 6ڊ @ @F@, @ @ hC @ @@4Km @ @4o @ @ ix;R( @ @& h+j>^2oO8Fr*r(BTPQ4ܐS= hxQ15$01RJTr̙BIcĿ5ϵ9܇zq_kku]5ϼw!   $ޤ,@@@@Mo}Qփ    I#@7i>5 E@@@@DHM@8ÇSNVH+So` ĭG}o߾]G.@7 W@HXرcv}, @2 ,^8I Ľ޸,@ /_TB뮻@@l֬Yvy͜( =v+F" 0)))n- ?aB@@ ]@/r@ d-?! @@@@@d _u#    @ O@@@@@ Y&g     x@@@@HVY7    Ľ޸,@@@@Uo~y֍    q/@7?! @@@@@d _u#    @ O@@@@@ Y&g     x@@@@HVY7   'I`ҥe˖6^s,%%fϞ $,@@@S%O?}g׷bŊi${g'Oܹs\tg$@j-"   8pU^e֩S *t_oؿu^z%'q`!@793D@@@ ,Z((ˠ ^ډM7d˗/^{@ADCB^   ς7h 97n;.t]kU2xc0/@@@Xx۷oȑ#M0re   "   prva}u/{>Ӗj5kִ={}gڊ+lv!TUZnvk֬We tZŊO>@5={Sڵ-Z;~.\hwZjjk38#Ѧf-O<کSڌ3lܹVdIkڴ 8#-[y{6lh?ov[ڵe~@ &ei   Ly٨Q2_tzڮ]cǎ6}tuw٧~j]~6n8+UTq5j԰~6m[vt~=PPw7n1!C؀\p9|m֭ /`O>yA.[J6l=öo߾`ִl24i-Y$A޽{ҥK{[}O?ʕ+?|w=x9HX iY   'W@Y]t|oz\}Xͤm۶\2eg\r;WX1[f+̙3MYfr\ݣ j׮]ȑ#.H;vX*ꃻ8q͛7 ^k};WlYkժVΏ1~뮻xvu/IQn]uAW n ի+ *[ H7/+ՠSn`L۰a 4*W,XwM;eʔ Yz^pn*ʎU{͛["EoNL6͔a@СChѢ8=GjNi;3]9?<8k^ob   >CV٢9=?ewlVݗYQe^{5%J2 ]]<]մU[vEx,Ν;/bO=zݿTK75|5ObdXe{a*r&LpYzx }n3NUo<=< ߉Y"   #cKΐ!FIYLRhQZd+S}'.|?њEnsTA%TKWYݰMMYmڴq_ *(w:/_O_^TV͞xt-[\pWYُgq*@7N?F@@@XT7VNVӦdrU s8ӎZ#V_|͞=5jTaݮ×_~Ft߮2̙3\|ŮoA@+BW|`U'k JwZwvAxtTh=<bOo}f   @ Y3+^ƍ3U`Xvox6SFpv7]UoyҥKS=Z矃!65S Z-wv5K~ o{<[8Ly)˳}!   q#p,ƴ4W[W Tի]tEC-bwQڤI,pnݺu騿 R'6iTS8Z -g'G ߍY#   G 4ܹZhlȦz[;*Vh*Trʹ#G ڠ,p[en#\rYʕ#/g8x5Gmժ?9眓阜 ͩ"!x1k@@@bR1Xٲe3G _=sQK/6j(ó zPg꼂={]z;T=hY'O[lÁլmf7ntիW/Cs2?`J܂'I IzA@@@Xv)CW-Z|˗F5`)SX޽{][<8p=cƌJ oc3j9spV U]p 8ZCV׎=-@7G@@@ f›)K5)7@S"ED  d{qJlÇSN߫~Y^} G TR%8\paЏFp݃]v o%xbwFVp`\duxxhp#@7q%+A@@@ ,Z(x}`&dk֬9 CY8tN5|b;v4ګjCn!8TP8v{衇ڵk[޽K,mOdD>;X,Y1i   %~`SN+Wڼyr/27&--ڷoo*٠,Ye~֥KtQF,Y|Mec<glCdSEڵkg[nu]l֮߸x/[v>Dּ__Go|kV   ꪫKM6ܹs fLmڴiּys+]۬Y3)ڥ^ӭG&L+XΝL2ܸqlkc5o6qD+WƮjղ3f{U*+nX]n5-7c:t(شNΚ; Kor}oV   M6鞯@6T|6w\kҤ?eU}^e>3$•W^in̪UۡCS`Sm. ߎ;RD @rn݂6m]v ,0y#ԩy98txgc߾}];x,Ĵ@ʯ!C ׆ b>}YZ@jܸzΜ9'%<@V`˖-UeV\9( ʬU W(Q"rI;VT5-ZUZ*Udrw>/B VnB@@@2 ԁ)CVb)aÆ0dK -.#    #@7v3A@@@@%@7[\ F@@@@bGo| f    dKo    Ď@@@@Ȗlq1@@@@-      -b0     ;xc[0@@@@@ [x`@@@@@ vη`&     @f     @oL@@@@@l @@@@@ ;߂      -.#    #@7v3A@@@@%@7[\ F@@@@bGo| f    dKo    Ď@@@@Ȗlq1@@@@-      -b0     ;xc[0@@@@@ [x`@@@@@ vRcg*@@@Q`ҥVD +W\".勞饗^O?4MMM{bWo~f   @\ Oֿ9rZbiÇEe{Jk&m5n@ 7b   ĝzeS*T(޷o}9څ^ b[}   q) SwׯkI(Px/_ͣH"o2D%#lV7h~W\i (Q•a 駟nz]w_e*W_~zUXY Ew5|5Oe Gw0qTb„ Wݻw5aÆ.SYQ?ǭ4*Xi$%;J@@@ko~2XE3SZjx)S>۶mˈUVl |əo`* amئ6h kӦRVAa5׍ Ȇj2US&q\jLup3k[l1֜ٽYSؗcs Lo}P   ULI&A2duMɔ媦2N;4_~tʼ/ tRJU;vm*_˝:u EU]_/v#@+]g_B]V]]v}vݻ|i <x[R@@@~/peYᇆY3+ƍgjj3+nL٩7PQUoy/gBjZik#rWkN^h2gϞ<Ho},   @ Ye馥ںX͗H\WbŬz駟K]tQtǩv-Xyҝ4i)Y g֭[7!΅2KE,f6G ~G{Fg}N~VT!#@ M@@@8Gݹsh.\覥z[;*Vh*TrYҥmȑAWeՔ}lpm>+W.\r [xZ3c>s2ZjիWvng,$,@@@XALm"Vl SzG_o=\ goԨQЏL>V|#xF 7ye˖A?U6۸q^z&z7xmTڵ*U CDȕHa-    pTVj3|z|lQ N2ō_JݻսӁl`3fꫯFh;v0=#lߙ3g! }@[Y %9dvmĈijtH:IY0   'F T#~4ս-RHxРAgwL>|:udׯ_P@=3Ýp/ܽ{wh]v o%xbwFVp`\duxx7l`s~.n@ &eu   4E:s,X0؄l͚5Q3gUZaС|A2vSRRcǎ7B{Wr p ™#GC=d֮]z ]d8p-h<:ǏF]uU b$ןߝU#   p֯_WȪO[ۤIG\}A$@@@"LR^z%SقMZܹi6l @IDATic3iӦYͭtҮofܦh^zinӧO=zS N0*Vb;w2eʸsƍ˗~aĉ\r ֪Uf̘V TDen:k8Zo3n+6 x#D@@@N7hmڴI*Jo^;w5iğ2e*W<+pWZjjjժ`jv: >QwG;`!V@H֭[PwӦMk.7VQ@z odZ_:u"/~Ndn8JG]VKXbG oD^!kC@@@"7o^5 ͮO\Mb?f͚,Y`ܹ.[HD^&kC$_rc@ og @ MOʂ@@8~߭W^< F`ѢE ijxz@@,pAbŊYٲeOx<ăo.@ "  sRJ۶mkGFG[fM,g\&    ,@7>kG@@@@ ן#    @2 M@@@@@ c     xv@@@@kq<    $d@@@@Zo\>&    ,@7>kG@@@@ ן#    @2 &Y;   xKZ%\r'eI#G؁iսzjժX!@oL@@@+~o#G{zc#@7~3E@@@ nUZzu۲eթS *7s[<ճ:J,y#@7~3E@@@ n-Z䂻pf4ѷ~MtҶuVKII3W8Nlv y    g}4h 9>۶m?=UVw+OA .gc   Ķ}y&kj[>/ h@@@;vX߾}݄{`O?Z͚5gϞyߙ?=쳶b [~:t*UdUVoݚ5k懦UݧVbEӧO@5={Sڵ-Z~ݻVZ}ggqF063yd{w]&6>˓'mܸѦNj3f̰sM6z,߉'^}Sk>ȝ*[Ώ1~뮻xvuۃ__nݺ.x̘1g)`LƏo7ooe*9'm?[O;4]0N_[~ }e~zwcڿ3kؽ{+_˝:u>}2hc25հU߬Z8PbŊtC}B VZVvNrlŦ eV_WQcp&rʚ袋*"@4@@@K/4T٬gߨrƍ3U`Xvox*|6x`WwEާc|?V-^ߎ9:Ν;]s5R_M~s ,D(ky_oCV   @Ye馥ں̗H\6^zѲOSSS[nGI,v,ܺuf:&|2\!\*BS_OI&ZhhyeJY&/ķ~@@@8Zh.\z[v5d+Vh+2*=0r ʲjfc)8u_͕+U\ٟj۪U+:_?Vs9'1 Dž !@7!>#@@@@ 6|S-[6äy {כjF+ۨQ 'TAAbI >c~\oT,hY'O[lYYeo۶6nW^Fh#yrofzݓ{gGy*@ r?   ĆڵkMj3|z|lQ N2ō_JݻսӁl`3fꫯFhڬLȪ)w̙n2afV&pVuuÁhkj &evߢE\mc]SpYsWo~;f   @L 7SjdS oE4㎕ Ç[N̿W^zڣ><3ܩRJpE'B޽{pk׮A/^ըQ .@4۴i~dG|wDHo}L   P֨o{  Y&jJ+ :4/ NyFj:wy繌]#رcꫯ/nά)PCٻk׶޽{C,YbpG چ3xe7 xȦsu.#q $@7>&KA@@@T _>xԩSmʕfle]ƤYM%%l?кtp9묳‡?jԨ`S%Kj yxӳU!) ڵsm5Ne˖jۊ/n/پe'h3x9iիWΝ;[onW^y{.Ȭ9'n;mN9+4H\/| "g_p~w  @rn݂6m]v1 ,0y#ԩy98t"@ppCek XVݻwUy,Zi,%C_SἙ2 ?U7vYs OV UVnb%yZ\sMl=@ ilK[rtB$J:(V\mv*߾} *jժ.5noeEϦ$C8F |,@@ >{9Gk1Ğ4@XT@֔!?Д۰aX1Ap&1@H( 9Y   5kt hԨ3 c(d,e  q/@7?! @@G %%-Ft1q+ѿox8^SG@NM @@@@HY'    $ބ,@@@@Eo|i։     '@7>) B@@@@d ,_u"    @ MOʂ@@@@@ Y&˗f     px @@@@HY'    $ބ,@@@@Eo|i։     '@7>) B@@@@d ,_u"    @ MOʂ@@@@@ Y&˗f     px @@@@HY'    $ބ,@@@@Eo|i։     '@7>) B@@@@d ,_u"    @ MOʂ@@@@@ Y&˗f     px @@@@HY'    $ބ,@@@Xtmٲ%& ٵk 2Į:P)SƮj{ JY fuk    @N~'߿9r"0o<mFۦ?׿7ްjժ$@@@Ph]n:uPB11DĿoر:tRRRm۶vW?lSNӧۢEQFf;e"(!   v}Y@`Ν֭[7͟?ԝ0aOݻۻk?{ @ Moʊ@@@8}Y0 }:]=h̘1־} }Ǭum֭pCob|GV   @L =1cʕ/׫W:tE^{r .:  @@@;vX߾}|{`^O?Z͚5gϞyߙ?=쳶b aVTɪVj~5kM2ObŊ֧Otמ={ܩvY-W{w\ZDwmj23Fv&OJ#2fc7ntpg̘asε%KZӦMmc9Vȑ#n>FaÆu}: Xx{@@@NylԨQ3N{ڮ]Fa,~j]~6n8+UTa5j԰~6m*I`ldSPw7n1!C؀\]56x^'|?zh̭R 6ݷo_0FkZlM4ɖ,Y ҥKqx :$ބ,@@@S#.]_m>We.B7mKKKsYt@|K.q+fk֬W^yŴI̙3MYfJ{X׮]]Vcǎ ޡ>,߉'Z޼y1 2G}Ε-[Zj岆Ώ1~뮻xvu/IQn]uڸzVǎw&Ǐ͛7۷~xٜ֓Uo{]~@ &e9  6V^}"3@ A*T*}^6馛2W^A]X-xw@/qAv;p۰a):h \`޽.\ئL! X .C|S0W)v=XͭH"~}7m6we/_'ZS0ԷhvmJC$j*kxVei?&UVAa5,wxu|rZjOl₻:j~|f #}]_e̙ʂU߬Z8PbŊtC}hek׮z@~wLש$FjC|:udׯݧM}Nx1Qܽ{wh]v o%xbwFVp`\du>aÆٝwi={43k4~ܥRJwܑ0!@ MR@@@8- ^})X` ٚ5kfΪСCmlp}=C &XŊݱsVLw8n8[|~7L8q+WTcWZjٌ3jժ@J\VY֭ J*-7Ⱦ_}lݢEqn짟~r?4| Xx{@@@N7hmڴI~Jo^;w5iğrYϫ3 ٿцr@@~  @HB7U[:w,9.]Sd~  Ąޘ L@+pZӦMH"V\rކ@k׮3gZժU%@@x $@>Jx;v ~2e  )`S@@@@@ ͹w"    T)     @܎;@@@@@S*@r@@@@@ xsnǝ     ) {Jy9     s9N@@@@@ =@@@@ȹޜq'     pJR~^    \o@@@@8xO)?/G@@@@r.@7v܉    R#    9 s;D@@@@NS@@@@@ ͹w"    T)     @܎;@@@@.]j[l9 ɉI뮳s= *~۷ooSNLo}0   @Ov}YXb2W_}e5mɓmŊw^;a` q&&H-܁   d-p^ܭS,fG --ͮJ[f.N:ga/zve (P^y< Gdb   ċE _?ApW^6w\ѣ+0`/|w< bFo| &   @|gb4hv˗{t%СC-W!e^F7@ [ B@@@S!@ĩ=:xwߝ!/]SF5 S]Y   ']`ǎַo_^a~RSSfֳ͚g ?=nsۡCRJVjUۭYf -uZŊO>k^{qڵkg-Z;߅ ݻVZ,NYњ69SlJJ >c7nSڌ3\ %KZӦMm~N_W":c~ZdopĽ@ʑ_[ܯ  $رcM5oF?kb @2 L6Znuɽ{oumֱcG>}zp._nƍRJ6mrU|l;wޝnܸ}ᇖ7o`ÇmȐ!ڵ .g֊+fO>y睙]?.[J[v 6~a۷o_eʔ%K ofr7ްn]Q}Ļ?   1".]_ԈW]xnm۶ fh)/_>S=Ye*f{W￷3gng͚!GAԮ]?, 73]eN81]pWAk>#w[ٲeUV.k8#~ˊ/62 C}_nݺ.v̘1g)};͛ouYl>QM{㕽۽{*X Sx=  @xxǃr tMsm/Ϋl(P ݸ;wR is5j?gm6lܹsիrn̂ L… ۜ9s2d*U\ .#|S|nEqoc1 x1m@@@bQh;w-Zo킏{w|Mͫ^ej5ߴAYVMYڷgFrʕ+G^pVP!^oVuX9̆s[r4H\J4$ee   t&be˖Gy.\_sE-ۨQ 'V@g꼂={]z;T=hY'O[lYYekC7իim࡙tT Bq[fLF)˷6cE 7~3G@@@ TVj3rѣGG *X;eʔ`}JݻսӁy3f}W3ڎ;LȪ)w̙nwfV&pVuuÁhkj6lpse2?Y u~P!@ Mo@@@8G **7@S[eFk ={lÇSN߫~t6{G3}E*U>88ꨆm݃3]v o%xbwFVp`\du>'޳: "1ė^@@@M6@6TMsε&MSl^kP3ϱmIf3a 5 GK"Y!PCESGD҃9uw}Ůg{}}?8}K?xܑ[ @`0 DˀUI>Jy)vѣG7z)Z:rǍ}݊xp=#9rd3fL5jT:{o2<;7`-?hAB @ nEC6an]v٥ Kbp쐎?+@{jM9 @ @$  @ @ >o~+"@ @ @br @ @' mobE @ @w@L."@ @ @@M @ @E @ @h} @ @ @`@1 @ @7" @ @ H`؀r @(0w4sXQ)<'0{͒%Kh?e @VFGySc @3JW H@; & @w=ZiĈi+XJ`ߡd|@mWA)]IDAT& @J*0~46m{6x,: @@WYJ @ @- mcu @ @* J @ @- mcu @ @* J @ @- mcu @ @* J @ @- mcu @ @* J @ @- mcu @ @* J @ @- mcu @ @* J @ @- mcu @ @` L6-͞={`%K? 2$r-^wܑ&Mn4bĈN;c9&͚5kBVwśH @V s福}cu{]ZguV{nMN2%]~iUVI;CKz'vyo}+s=i޼y׿u:wԩ~ (#0LYU  @ @SO=rjn^{-Z:*mr8qb⋫{xk^g׿>=C鬳J_w_b-ZqAs, @ @ϓwݴe +|p>}zSh g}vy_r;,E@?gΜt'V;s^ h  @_ j0=X7wwFot 'T }ӹ#܍mQf#4cƌ84hE? @ @%׿Vo^dFoq/^\]/}L8xؼ{cC@vVA @tI'Uqu5;C G>෿mWx裏VQҘ1cԗx1/&l&O|&Ǻϟ_}w+5kIz]wUfmW͵f?OҐ!C9眓V]uktק-җ4MoJzju;^{U.T=+iر^cMկϣna66x̙3cC@ێ* @ @\}|߬><頃J^{mQ~\rI` qV[:͚5 V-3P_z57vF9y>r)͎?~ӟo|_b>PzVanZpO>9-\.O]vY{wiڴiU8 ͝;7;ln|SAu % ma5 @ @` Į#8"Oqƥ|gsoЮ'clW_=?luI?pwo1Ůۛo r/9,YR_|q}z3c綾^V[motM7Umi„ ծwyg?[o7냺%o_:袋R|W?)vgI\XO=b't8=Cd:uju]tmݪnE;zWZ" ma @ @` D`8&|Rv7n-kf>Oh/~jwj&MN;-=;LG}tu<|tW. 8j;P#Z)#c=6iĈ%cz'?S찍37g[Ghd9^WUas)ozZ5ƈV5bq=:mϼ PV@[_u @hyŎ}j L`Nƨwh#}/N_j;܍s/yKuKGyjqc>;쳫?8v.ZzV )kD({1Ǥh ~Ut?tק'p}G:{-4En xrxs  @ @CVLc10ZNhAi__|Wk# GM8jm%Cҍ]Ï>}ݷ:+BcDex`ӧWƛ6,} _q~3{*܍}s}o|ͻN^йqw4l o;~ @ @oOzkZeUdɭXF<\,F<,vƈ޻C ;Zwu;wFeh10eʔbv|K94y䥦E[cUߥ.3~:ܱ|I'n}jg̘;vls|D_ܣŋS\m&"ookgp</q @ 07 ՗]zneg\]\rIS:=zk爇ŎnCM~z6umM|;yO?tsIVG<Ԭ@xZ=9ݻ}Ѻ׾ޱm-[wN.F>'@`xW* @ @`H8gΜno~+"@ @VGs=]wUc}nFm^U*zƮ޷ީ,:G^%=> x;v z6-آq_;xF<0-vX#Zg >o~+"@ @V1!bnR| ww}k][/tmFzIE#>W}Rxz8w9/o^qg.'x"=cռq-7qA}=sꫯghq7WXA@hˊ @ @A&ocnnHo|^xap7+6`U:<=S1碋.jQ?-zw5b7X]w;:X} K_k@ׁv}38#=3%w\_:G@AoA|  @ @I!bAj{;bĈiW#\ֵ>r!;L?j^< 2klu惎|G7y%|=Tj4|u?ogx-X3dȐ4jԨm뭷ޚ=fm9^ (# -* @x }=mq}Zk5!{ᇻ gyf=-u͇xՃ;v#<蠃R݊nӎs{mK,I'ݻcǎM'pBsޛz}M,wO8?]wuKU]ؓ&Mv﮶jNءl NlbU @ @` <͚oG7fΜ9HѲ!vn؟g#v6__η\OTwGۆ#z-~! =gcDgڭܶzo)ֻe[s{MNZՋ/N?ϫ^u???>T`ȳZҵY @ 0"wˎ@tܹ~׬YR}'K] .lvۭjwf„ ꫯnk>"S<s,ZjE`ݧӦMKwGۯ.x@ټyz/ZDx~x]1"dq͜933x}Ml}#Gx2tVׯ暕S#>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d xL&@ @ @@9o9{  @ @ % 3 @ @U&@ @ @@7d @ @W @ @Y,>  @ @ PN@[^e @ @d _QIIENDB`RNeXML/README.md0000644000176200001440000000703013552353762012611 0ustar liggesusers # RNeXML [![DOI](https://zenodo.org/badge/11856817.svg)](https://zenodo.org/badge/latestdoi/11856817) [![Build Status](https://api.travis-ci.org/ropensci/RNeXML.png)](https://travis-ci.org/ropensci/RNeXML) [![Windows build status](https://ci.appveyor.com/api/projects/status/dhiwp5blx2ns2yba/branch/master?svg=true)](https://ci.appveyor.com/project/cboettig/rnexml/branch/master) [![CRAN status](https://www.r-pkg.org/badges/version/RNeXML)](https://cran.r-project.org/package=RNeXML) [![codecov.io](https://codecov.io/github/ropensci/RNeXML/coverage.svg?branch=master)](https://codecov.io/github/ropensci/RNeXML?branch=master) ![downloads](http://cranlogs.r-pkg.org/badges/grand-total/RNeXML) - Maintainer: Carl Boettiger - Authors: Carl Boettiger, Scott Chamberlain, Hilmar Lapp, Kseniia Shumelchyk, Rutger Vos - License: BSD-3 - [Issues](https://github.com/ropensci/RNeXML/issues): Bug reports, feature requests, and development discussion. An extensive and rapidly growing collection of richly annotated phylogenetics data is now available in the NeXML format. NeXML relies on state-of-the-art data exchange technology to provide a format that can be both validated and extended, providing a data quality assurance and adaptability to the future that is lacking in other formats. See [Vos et al 2012](http://doi.org/10.1093/sysbio/sys025 "NeXML: Rich, Extensible, and Verifiable Representation of Comparative Data and Metadata.") for further details on the NeXML format. ## How to cite RNeXML has been published in the following article: > Boettiger C, Chamberlain S, Vos R and Lapp H (2016). “RNeXML: A > Package for Reading and Writing Richly Annotated Phylogenetic, > Character, and Trait Data in R.” *Methods in Ecology and Evolution*, > **7**, pp. 352-357. > [doi:10.1111/2041-210X.12469](http://doi.org/10.1111/2041-210X.12469) Although the published version of the article is pay-walled, the source of the manuscript, and a much better rendered PDF, are included in this package (in the `manuscripts` folder). You can also find it [freely available on arXiv](http://arxiv.org/abs/1506.02722). ## Installation The latest stable release of RNeXML is on CRAN, and can be installed with the usual `install.packages("RNeXML")` command. Some of the more specialized functionality described in the Vignettes (such as RDF manipulation) requires additional packages which can be installed using: ``` r install.packages("RNeXML", deps = TRUE) ``` The development version can be installed using: ``` r remotes::install_github("ropensci/RNeXML") ``` ## Getting Started See the vignettes below for both a general quick start and an overview of more specialized features. - [A Brief Introduction to RNeXML](https://docs.ropensci.org/RNeXML/articles/intro) - [RNeXML: A Package for Reading and Writing Richly Annotated Phylogenetic, Character, and Trait Data in R](https://github.com/ropensci/RNeXML/tree/master/manuscripts) (published in MEE). - [Handling Metadata in RNeXML](https://docs.ropensci.org/RNeXML/articles/metadata) - [The `nexml` S4 Object](https://docs.ropensci.org/RNeXML/articles/S4) - [Semantic data & SPARQL with RNeXML](https://docs.ropensci.org/RNeXML/articles/sparql) - [Extending NeXML: an example based on simmap](https://docs.ropensci.org/RNeXML/articles/simmap) ----- [![ropensci footer](http://ropensci.org/public_images/github_footer.png)](http://ropensci.org) RNeXML/man/0000755000176200001440000000000013614142014012066 5ustar liggesusersRNeXML/man/get_taxa.Rd0000644000176200001440000000102613552353762014167 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_taxa.R \name{get_taxa} \alias{get_taxa} \alias{get_otu} \title{get_taxa} \usage{ get_taxa(nexml) } \arguments{ \item{nexml}{a nexml object} } \value{ the list of taxa } \description{ Retrieve names of all species/otus otus (operational taxonomic units) included in the nexml } \examples{ comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex <- nexml_read(comp_analysis) get_taxa(nex) } \seealso{ \code{\link{get_item}} } RNeXML/man/expand_prefix.Rd0000644000176200001440000000371513552353762015236 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/prefixed-uris.R \name{expand_prefix} \alias{expand_prefix} \title{Expand namespace-prefixed string} \usage{ expand_prefix(x, namespaces = NULL) } \arguments{ \item{x}{a character vector of potentially namespace-prefixed strings} \item{namespaces}{a named vector of namespaces, with namespace prefixes being the names. A "base" namespace with an empty name can be included. If not provided, or if empty, the input vector is returned as is.} } \value{ a character vector, of the same length as the input vector } \description{ Substitutes the namespace prefix in the input vector of strings with the corresponding namespaces. } \details{ Namespace prefixes are expected to be separated by one or more semicolons. Prefixes that cannot be matched to the vector of namespaces will be left as is. For strings that do not have a namespace prefix, the vector of namespaces can contain a base namespace, identified as not having a name, with which these strings will be expanded. } \examples{ uris <- c("cc:license", "dc:title") ns <- c(dc = "http://purl.org/dc/elements/1.1/", dcterms = "http://purl.org/dc/terms/", dct = "http://purl.org/dc/terms/", cc = "http://creativecommons.org/ns#") # expansion is vectorized expand_prefix(uris, ns) # strings with non-matching or no prefix are left as is uris <- c(uris, "my:title", "title") expand_prefix(uris, ns) # NAs in the input list become NA in the output uris <- c(uris, NA) expand_prefix(uris, ns) # can include a "base" (unnamed) namespace for expanding unprefixed strings ns <- c(ns, "//local/") xuris <- expand_prefix(uris, ns) xuris xuris[uris == "title"] == paste0("//local/", uris[uris == "title"]) # different prefixes may expand to the same result expand_prefix("dcterms:modified", ns) == expand_prefix("dct:modified", ns) # or they may result in different expansions expand_prefix("dc:title", ns) != expand_prefix("dcterms:title", ns) } RNeXML/man/New.Rd0000644000176200001440000000211513552353762013124 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/constructors.R \name{New} \alias{New} \title{new with namespaced class name} \usage{ New(Class, ...) } \arguments{ \item{Class}{the name of the S4 class to be instantiated} \item{...}{additional parameters for \code{\link[methods:new]{methods::new()}}} } \description{ Convenience function for \code{\link[methods:new]{methods::new()}} that ensures that the provided class name is namespaced with a package name. } \details{ If the provided class name is not already namespaced (see \code{\link[methods:packageSlot]{methods::packageSlot()}}), it will be namespaced with this package. This mechanism is used by \code{new()} to disambiguate if the class name clashes with a class defined in another package. } \note{ This may not completely eliminate messages on standard error about classes with the same name having been found in different packages. If they appear, they will most likely have come from the call to the \code{\link[methods:initialize]{methods::initialize()}} generic that \code{new()} issues at the end. } RNeXML/man/coalesce_.Rd0000644000176200001440000000111713552353762014311 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{coalesce_} \alias{coalesce_} \title{Front-end to dplyr::coalesce to deal with NULL vectors} \usage{ coalesce_(...) } \arguments{ \item{...}{the vectors to coalesce on NA} } \value{ a vector of the same type and length as the last argument } \description{ Replaces any NULL argument with a vector of \code{NA}, and casts every vector to the same type as the last vector. After that, calls \code{\link[dplyr:coalesce]{dplyr::coalesce()}}. } \seealso{ \code{\link[dplyr:coalesce]{dplyr::coalesce()}} } RNeXML/man/taxize_nexml.Rd0000644000176200001440000000141713614102404015066 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize_nexml.R \name{taxize_nexml} \alias{taxize_nexml} \title{taxize nexml} \usage{ taxize_nexml( nexml, type = c("ncbi", "itis", "col", "tpl", "gbif", "wd"), warnings = TRUE, ... ) } \arguments{ \item{nexml}{a nexml object} \item{type}{the name of the identifier to use} \item{warnings}{should we show warning messages if no match can be found?} \item{...}{additional arguments to \verb{[taxadb::get_ids()]}} } \description{ Check taxonomic names against the specified service and add appropriate semantic metadata to the nexml OTU unit containing the corresponding identifier. } \examples{ \dontrun{ data(bird.orders) birds <- add_trees(bird.orders) birds <- taxize_nexml(birds, "NCBI") } } RNeXML/man/get_characters_list.Rd0000644000176200001440000000132413552353762016405 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/deprecated.R \name{get_characters_list} \alias{get_characters_list} \title{Extract the character matrix} \usage{ get_characters_list(nexml, rownames_as_col = FALSE) } \arguments{ \item{nexml}{nexml object (e.g. from read.nexml)} \item{rownames_as_col}{option to return character matrix rownames (with taxon ids) as it's own column in the data.frame. Default is FALSE for compatibility with geiger and similar packages.} } \value{ the list of taxa } \description{ Extract the character matrix } \examples{ comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex <- nexml_read(comp_analysis) get_characters_list(nex) } RNeXML/man/add_characters.Rd0000644000176200001440000000212513614102404015303 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/add_characters.R \name{add_characters} \alias{add_characters} \title{Add character data to a nexml object} \usage{ add_characters(x, nexml = new("nexml"), append_to_existing_otus = FALSE) } \arguments{ \item{x}{character data, in which character traits labels are column names and taxon labels are row names. x can be in matrix or data.frame format.} \item{nexml}{a nexml object, if appending character table to an existing nexml object. If omitted will initiate a new nexml object.} \item{append_to_existing_otus}{logical. If TRUE, will add any new taxa (taxa not matching any existing otus block) to the existing (first) otus block. Otherwise (default), a new otus block is created, even though it may contain duplicate taxa to those already present. While FALSE is the safe option, TRUE may be appropriate when building nexml files from scratch with both characters and trees.} } \description{ Add character data to a nexml object } \examples{ library("geiger") data(geospiza) geiger_nex <- add_characters(geospiza$dat) } RNeXML/man/nexml_write.Rd0000644000176200001440000000447113614102404014717 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nexml_write.R \name{nexml_write} \alias{nexml_write} \alias{write.nexml} \title{Write nexml files} \usage{ nexml_write( x = nexml(), file = NULL, trees = NULL, characters = NULL, meta = NULL, ... ) } \arguments{ \item{x}{a nexml object, or any phylogeny object (e.g. phylo, phylo4) that can be coerced into one. Can also be omitted, in which case a new nexml object will be constructed with the additional parameters specified.} \item{file}{the name of the file to write out} \item{trees}{phylogenetic trees to add to the nexml file (if not already given in x) see \code{\link{add_trees}} for details.} \item{characters}{additional characters} \item{meta}{A meta element or list of meta elements, see \code{\link{add_meta}}} \item{...}{additional arguments to add__basic_meta, such as the title. See \code{\link{add_basic_meta}}.} } \value{ Writes out a nexml file } \description{ Write nexml files } \examples{ ## Write an ape tree to nexml, analgous to write.nexus: library(ape); data(bird.orders) ex <- tempfile(fileext=".xml") write.nexml(bird.orders, file=ex) \dontrun{ # takes > 5s ## Assemble a nexml section by section and then write to file: library(geiger) data(geospiza) nexml <- add_trees(geospiza$phy) # creates new nexml nexml <- add_characters(geospiza$dat, nexml = nexml) # pass the nexml obj to append character data nexml <- add_basic_meta(title="my title", creator = "Carl Boettiger", nexml = nexml) nexml <- add_meta(meta("prism:modificationDate", format(Sys.Date())), nexml = nexml) ex <- tempfile(fileext=".xml") write.nexml(nexml, file=ex) ## As above, but in one call (except for add_meta() call). write.nexml(trees = geospiza$phy, characters = geospiza$dat, title = "My title", creator = "Carl Boettiger", file = ex) ## Mix and match: identical to the section by section: nexml <- add_meta(meta("prism:modificationDate", format(Sys.Date()))) write.nexml(x = nexml, trees = geospiza$phy, characters = geospiza$dat, title = "My title", creator = "Carl Boettiger", file = ex) } } \seealso{ \code{\link{add_trees}} \code{\link{add_characters}} \code{\link{add_meta}} \code{\link{nexml_read}} } RNeXML/man/add_namespaces.Rd0000644000176200001440000000374613552353762015335 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/add_namespaces.R \name{add_namespaces} \alias{add_namespaces} \title{Add namespaces} \usage{ add_namespaces(namespaces, nexml = new("nexml")) } \arguments{ \item{namespaces}{a named character vector of namespaces} \item{nexml}{a nexml object. will create a new one if none is given.} } \value{ a nexml object with updated namespaces } \description{ Add namespaces and their prefixes as a named vector of URIs, with the names being the prefixes. Namespaces have most relevance for meta objects' \code{rel} and \code{property}, and for embedded XML literals. } \details{ The implementation attempts to avoid duplication, currently using the prefix. I.e., namespaces with prefixes already defined will not get added. Namespaces needed by the NeXML format, and for commonly used metadata terms, are already included by default, see \code{\link[=get_namespaces]{get_namespaces()}}. } \note{ Often a user won't call this directly, but instead provide the namespace(s) through \code{\link[=add_meta]{add_meta()}}. } \examples{ ## Write multiple metadata elements, including a new namespace: website <- meta(href = "http://carlboettiger.info", rel = "foaf:homepage") # meta can be link-style metadata modified <- meta(property = "prism:modificationDate", content = "2013-10-04") nex <- add_meta(list(modified, website), namespaces = c(foaf = "http://xmlns.com/foaf/0.1/")) # prism prefix already included by default ## Add namespace "by hand" before adding meta: nex <- add_namespaces(c(skos = "http://www.w3.org/2004/02/skos/core#"), nexml = nex) history <- meta(property = "skos:historyNote", content = "Mapped from the bird.orders data in the ape package using RNeXML") nex <- add_meta(history, nexml = nex) } \seealso{ \code{\link[=meta]{meta()}} \code{\link[=add_meta]{add_meta()}} \code{\link[=get_namespaces]{get_namespaces()}} } RNeXML/man/get_taxa_list.Rd0000644000176200001440000000064413552353762015227 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_taxa.R \name{get_taxa_list} \alias{get_taxa_list} \alias{get_otus_list} \title{get_taxa_list} \usage{ get_taxa_list(nexml) } \arguments{ \item{nexml}{a nexml object} } \value{ the list of taxa } \description{ Retrieve names of all species/otus otus (operational taxonomic units) included in the nexml } \seealso{ \code{\link{get_item}} } RNeXML/man/summary-nexml-method.Rd0000644000176200001440000000430513614102404016452 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nexml_methods.R \name{summary,nexml-method} \alias{summary,nexml-method} \alias{summary.nexml} \title{Summary method for nexml objects} \usage{ \S4method{summary}{nexml}(object) } \arguments{ \item{object}{the \link[=nexml-class]{nexml} object} } \value{ A list with the following elements: \itemize{ \item \code{nblocks} the number of trees, otus, and characters blocks \item \code{ncharacters} the number of characters in each characters block \item \code{nstates} summary statistics of the number of character states per state set defined for each characters block \item \code{nnonstdstatedefs} the number of polymorphic and uncertain states defined for each character block \item \code{nmatrixrows} the number of rows in the matrix for each character block \item \code{ntrees} the number of trees contained in each trees block \item \code{notus} the number of OTUs defined in each OTUs block \item \code{nmeta} a list of the number of the number of metadata annotations at several levels, specifically: \itemize{ \item \code{nexml} at the top (nexml) level \item \code{otu} at the OTU level, for each OTUs block \item \code{char} at the character level, for each characters block \item \code{state} at the character state level, for each characters block } } } \description{ Generates a list of various counts of the major elements that comprise a \link[=nexml-class]{nexml} object, such as number of different kinds of blocks, characters, states, OTUs (taxa), etc. } \details{ The \link[methods:show]{show} method uses this summary for pretty-printing a summary of the NeXML object, but it can be used on its own as well, in particular for quick inspection of key properties of a NeXML file. } \examples{ nex <- nexml_read(system.file("examples", "comp_analysis.xml", package = "RNeXML")) s <- summary(nex) # number of major blocks: s$nblocks # each characters block defines 1 character: s$ncharacters # summary stats of states per character (for morphological matrices there is # typically one state set per character) s$nstates # note that first block is of continuous type, so no stats there # pretty-printed summary: nex # this is the same as show(nex) } RNeXML/man/add_trees.Rd0000644000176200001440000000135213552353762014327 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/add_trees.R \name{add_trees} \alias{add_trees} \title{add_trees} \usage{ add_trees(phy, nexml = new("nexml"), append_to_existing_otus = FALSE) } \arguments{ \item{phy}{a phylo object, multiPhylo object, or list of multiPhylo to be added to the nexml} \item{nexml}{a nexml object to which we should append this phylo. By default, a new nexml object will be created.} \item{append_to_existing_otus}{logical, indicating if we should make a new OTU block (default) or append to the existing one.} } \value{ a nexml object containing the phy in nexml format. } \description{ add_trees } \examples{ library("geiger") data(geospiza) geiger_nex <- add_trees(geospiza$phy) } RNeXML/man/simmap_to_nexml.Rd0000644000176200001440000000217513614102404015554 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/simmap.R \name{simmap_to_nexml} \alias{simmap_to_nexml} \alias{nexml_to_simmap} \title{Convert phylo with attached simmap to nexml object} \usage{ simmap_to_nexml(phy, state_ids = NULL) nexml_to_simmap(nexml) } \arguments{ \item{phy}{a phylo object containing simmap \code{phy$maps} element, from the phytools package} \item{state_ids}{a named character vector giving the state names corresponding to the ids used to refer to each state in nexml. If null ids will be generated and states taken from the phy$states names.} \item{nexml}{a nexml object} } \value{ a nexml representation of the simmap a simmap object (phylo object with a \verb{$maps} element for use in phytools functions). } \description{ Convert phylo with attached simmap to nexml object Convert nexml object with simmap to phylo } \section{Functions}{ \itemize{ \item \code{nexml_to_simmap}: Convert nexml object with simmap to phylo }} \examples{ simmap_ex <- read.nexml(system.file("examples","simmap_ex.xml", package="RNeXML")) phy <- nexml_to_simmap(simmap_ex) nex <- simmap_to_nexml(phy) } RNeXML/man/dot-methodWithNext.Rd0000644000176200001440000000220713552353762016134 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/S4-utils.R \name{.methodWithNext} \alias{.methodWithNext} \title{Saves the next method in the method meta data} \usage{ .methodWithNext(method, nextMethod, .cache = FALSE) } \arguments{ \item{method}{the \link[methods:MethodDefinition-class]{MethodDefinition} object to promote} \item{nextMethod}{the \link[methods:MethodDefinition-class]{MethodDefinition} object to record as the next method} \item{.cache}{whether to cache the promoted method definition object (using \code{\link[methods:cacheMethod]{methods::cacheMethod()}})} } \value{ an instance of \link[methods:MethodWithNext-class]{MethodWithNext}, which has the next method in the \code{nextMethod} slot } \description{ Promotes the given method definition to an instance of \link[methods:MethodWithNext-class]{MethodWithNext}, thereby recording the next method in the \code{nextMethod} slot. } \note{ \code{MethodWithNext} objects are normally returned by \code{\link[methods:addNextMethod]{methods::addNextMethod()}}, but a constructor function for the class seems missing (or is undocumented?). This provides one. } RNeXML/man/nexml_add.Rd0000644000176200001440000000165513614102404014316 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nexml_add.R \name{nexml_add} \alias{nexml_add} \title{add elements to a new or existing nexml object} \usage{ nexml_add( x, nexml = new("nexml"), type = c("trees", "characters", "meta", "namespaces"), ... ) } \arguments{ \item{x}{the object to be added} \item{nexml}{an existing nexml object onto which the object should be appended} \item{type}{the type of object being provided.} \item{...}{additional optional arguments to the add functions} } \value{ a nexml object with the additional data } \description{ add elements to a new or existing nexml object } \examples{ library("geiger") data(geospiza) geiger_nex <- nexml_add(geospiza$phy, type="trees") geiger_nex <- nexml_add(geospiza$dat, nexml = geiger_nex, type="characters") } \seealso{ \code{\link{add_trees}} \code{\link{add_characters}} \code{\link{add_meta}} \code{\link{add_namespaces}} } RNeXML/man/lcapply.Rd0000644000176200001440000000065013552353762014041 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{lcapply} \alias{lcapply} \title{Compact list then lapply} \usage{ lcapply(X, ...) } \arguments{ \item{X}{the list object} \item{...}{remaining arguments to \code{lapply()}} } \description{ Compacts the list (i.e., removes NULL objects), then calls \code{\link[base:lapply]{lapply()}} on the result with the remaining parameters. } RNeXML/man/slot-ResourceMeta-method.Rd0000644000176200001440000000160213614102404017206 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/meta.R \name{slot,ResourceMeta-method} \alias{slot,ResourceMeta-method} \alias{slot-ResourceMeta} \alias{slot<-,ResourceMeta-method} \title{Access or set slot of S4 object} \usage{ \S4method{slot}{ResourceMeta}(object, name) \S4method{slot}{ResourceMeta}(object, name) <- value } \arguments{ \item{object}{the object} \item{name}{name of the slot} \item{value}{the new value} } \description{ See \code{\link[methods:slot]{methods::slot()}}. This version allows using "property" consistently for both LiteralMeta and ResourceMeta (which internally uses "rel" because RDFa does), which is easier to program. It also allows using "meta" as an alias for "children" for ResourceMeta, to be consistent with the corresponding slot for instances of \code{Annotated}. } \seealso{ \code{\link[methods:slot]{methods::slot()}} } RNeXML/man/get_trees.Rd0000644000176200001440000000152713552353762014362 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_trees.R \name{get_trees} \alias{get_trees} \title{extract a phylogenetic tree from the nexml} \usage{ get_trees(nexml) } \arguments{ \item{nexml}{a representation of the nexml object from which the data is to be retrieved} } \value{ an ape::phylo tree, if only one tree is represented. Otherwise returns a list of lists of multiphylo trees. To consistently receive the list of lists format (preserving the hierarchical nature of the nexml), use \code{\link{get_trees_list}} instead. } \description{ extract a phylogenetic tree from the nexml } \examples{ comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex <- nexml_read(comp_analysis) get_trees(nex) } \seealso{ \code{\link{get_trees}} \code{\link{get_flat_trees}} \code{\link{get_item}} } RNeXML/man/get_metadata.Rd0000644000176200001440000000344113552353762015015 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_metadata.R \name{get_metadata} \alias{get_metadata} \title{get_metadata} \usage{ get_metadata(nexml, level = "nexml", simplify = TRUE) } \arguments{ \item{nexml}{a nexml object} \item{level}{the name of the level of element desired, see details} \item{simplify}{logical, see Details} } \value{ the requested metadata as a data.frame. Additional columns indicate the parent element of the return value. } \description{ get_metadata } \details{ 'level' should be either the name of a child element of a NeXML document (e.g. "otu", "characters"), or a path to the desired element, e.g. 'trees/tree' will return the metadata for all phylogenies in all trees blocks. If a metadata element has other metadata elements nested within it, the nested metadata are returned as well. A column "Meta" will contain the IDs consolidated from the type-specific LiteralMeta and ResourceMeta columns, and IDs are generated for meta elements that have nested elements but do not have an ID ("blank nodes"). A column "meta" contains the IDs of the parent meta elements for nested ones. This means that the resulting table can be self-joined on those columns. If \code{simplify} is \code{FALSE}, the type-specific "LiteralMeta" and "ResourceMeta" columns will be retained even if a consolidated "Meta" column is present. Otherwise, only the consolidated column will be included in the result. Also, if \code{simplify} is \code{TRUE} the values for "property" (LiteralMeta) and "rel" (ResourceMeta) will be consolidated to "property", and "rel" will be removed from the result. } \examples{ \dontrun{ comp_analysis <- system.file("examples", "primates.xml", package="RNeXML") nex <- nexml_read(comp_analysis) get_metadata(nex) get_metadata(nex, "otus/otu") } } RNeXML/man/toPhylo.Rd0000644000176200001440000000102113552353762014024 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_trees.R \name{toPhylo} \alias{toPhylo} \title{nexml to phylo} \usage{ toPhylo(tree, otus) } \arguments{ \item{tree}{an nexml tree element} \item{otus}{a character string of taxonomic labels, named by the otu ids. e.g. (from get_otu_maps for the otus set matching the relevant trees node.} } \value{ phylo object. If a "reconstructions" annotation is found on the edges, return simmap maps slot as well. } \description{ nexml to phylo coercion } RNeXML/man/Annotated-class.Rd0000644000176200001440000000074013552353762015415 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/classes.R \docType{class} \name{Annotated-class} \alias{Annotated-class} \title{Class of objects that have metadata as lists of meta elements} \description{ Class of objects that have metadata as lists of meta elements } \section{Slots}{ \describe{ \item{\code{meta}}{list of \code{meta} objects} \item{\code{about}}{for RDF extraction, the identifier for the resource that this object is about} }} RNeXML/man/nexml-class.Rd0000644000176200001440000000355513614102404014612 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/classes.R \docType{class} \name{nexml-class} \alias{nexml-class} \alias{nexml} \title{Class representing a NeXML document} \description{ The \code{nexml} class represents a NeXML document, and is the top of the class hierarchy defined in this package, corresponding to the root node of the corresponding XML document. } \details{ Normally objects of this type are created by the package as a result of reading a NeXML file, or of converting from another type, such as \code{ape::phylo}. Also, interacting directly with the slots of the class is normally not necessary. Instead, use the \code{get_XXX()} and \code{add_XXX()} functions in the API. } \section{Slots}{ \describe{ \item{\code{trees}}{list, corresponding to the list of \verb{} elements in NeXML. Elements will be of class \code{trees}.} \item{\code{characters}}{list, corresponding to the list of \verb{} elements in NeXML. Elements will be of class \code{characters}.} \item{\code{otus}}{list, corresponding to the list of \verb{} elements in NeXML. Elements will be of class \code{otus}.} \item{\code{about}}{inherited, see \link[=Annotated-class]{Annotated}} \item{\code{meta}}{inherited, see \link[=Annotated-class]{Annotated}} \item{\code{xsi:type}}{for internal use} \item{\code{version}}{NeXML schema version, do not change} \item{\code{generator}}{name of software generating the XML} \item{\code{xsi:schemaLocation}}{for internal use, do not change} \item{\code{namespaces}}{named character vector giving the XML namespaces} }} \examples{ nex <- nexml() # a nexml object with no further content nex <- new("nexml") # accomplishes the same thing nex@generator length(nex@trees) data(bird.orders) nex <- as(bird.orders, "nexml") summary(nex) length(nex@trees) } \seealso{ \code{\link[=read.nexml]{read.nexml()}} } RNeXML/man/dot-sigLabel.Rd0000644000176200001440000000127113552353762014703 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/S4-utils.R \name{.sigLabel} \alias{.sigLabel} \title{Create a label for a method signature} \usage{ .sigLabel(signature) } \arguments{ \item{signature}{the signature for which to create a label, as a vector or list of strings, or as an instance of \link[methods:signature-class]{signature}.} } \value{ a character string } \description{ Creates a label for a signature mirroring the result of \code{.sigLabel()} in the \code{methods} package, which unfortunately does not export the function. This is needed, for example, for the \code{excluded} slot in the \link[methods:MethodWithNext-class]{MethodWithNext} class. } RNeXML/man/dot-callGeneric.Rd0000644000176200001440000000253513552353762015375 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/S4-utils.R \name{.callGeneric} \alias{.callGeneric} \title{Calls the given generic with the given arguments} \usage{ .callGeneric(f, ..., .package = NULL) } \arguments{ \item{f}{the generic, as a character string or a \link[methods:standardGeneric-class]{standardGeneric} object} \item{...}{the arguments (named and/or unnamed) with which to call the matching method} \item{.package}{the package name for finding the generic (if \code{f} is a character string); by default the package is determined from the calling environment} } \value{ the value returned by the method } \description{ Calls the given generic with the given arguments, using the method whose signature matches the arguments. } \details{ Uses \code{\link[methods:selectMethod]{methods::selectMethod()}} to find the matching method. In theory, this is at best wholly redundant with what standard S4 generics already do by themselves. However, the generics dispatch for S4 seems (at least currently) broken at least if the first argument in the signature is a class that name-clashes with a class defined in another package. In that case, whether the standard dispatch works correctly or not can depend on \link[base:search]{search order}, and can change within a session depending on the order in which packages are loaded. } RNeXML/man/nexml_read.Rd0000644000176200001440000000226313552353762014515 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nexml_read.R \name{nexml_read} \alias{nexml_read} \alias{read.nexml} \alias{nexml_read.character} \alias{nexml_read.XMLInternalDocument} \alias{nexml_read.XMLInternalNode} \title{Read NeXML files into various R formats} \usage{ nexml_read(x, ...) \method{nexml_read}{character}(x, ...) \method{nexml_read}{XMLInternalDocument}(x, ...) \method{nexml_read}{XMLInternalNode}(x, ...) } \arguments{ \item{x}{Path to the file to be read in. Or an \code{\link[XML]{XMLInternalDocument-class}} or \code{\link[XML]{XMLInternalNode-class}}} \item{...}{Further arguments passed on to \code{\link[XML]{xmlParse}}} } \description{ Read NeXML files into various R formats } \examples{ # file f <- system.file("examples", "trees.xml", package="RNeXML") nexml_read(f) \dontrun{ # may take > 5 s # url url <- "https://raw.githubusercontent.com/ropensci/RNeXML/master/inst/examples/trees.xml" nexml_read(url) # character string of XML str <- paste0(readLines(f), collapse = "") nexml_read(str) # XMLInternalDocument library("httr") library("XML") x <- xmlParse(content(GET(url))) nexml_read(x) # XMLInternalNode nexml_read(xmlRoot(x)) } } RNeXML/man/get_level.Rd0000644000176200001440000000364413552353762014351 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_level.R \name{get_level} \alias{get_level} \title{get_level} \usage{ get_level(nex, level) } \arguments{ \item{nex}{a nexml object} \item{level}{a character vector indicating the class of node, see details} } \value{ Returns the attributes of specified class of nodes as a data.frame } \description{ get a data.frame of attribute values of a given node } \details{ level should be a character vector giving the path to the specified node group. For instance, \code{otus}, \code{characters}, and \code{trees} are top-level blocks (e.g. child nodes of the root nexml block), and can be specified directly. To get metadata for all "char" elements from all characters blocks, you must specify that \code{char} nodes are child nodes to \code{character} nodes: e.g. \code{get_level(nex, "characters/char")}, or similarly for states: \code{get_level(nex, characters/states)}. The return object is a data frame whose columns are the attribute names of the elements specified. The column names match the attribute names except for "id" attribute, for which the column is renamed using the node itself. (Thus would be rendered in a data.frame with column called "otus" instead of "id"). Additional columns are added for each parent element in the path; e.g. get_level(nex, "otus/otu") would include a column named "otus" with the id of each otus block. Even though the method always returns the data frame for all matching nodes in all blocks, these ids let you see which otu values came from which otus block. This is identical to the function call \code{get_taxa()}. Similarly, \code{get_level(nex, "otus/otu/meta")} would return additional columns 'otus' and also a column, 'otu', with the otu parent ids of each metadata block. (This is identical to a function call to \code{get_metadata}). This makes it easier to join data.frames as well, see examples } RNeXML/man/nexml_validate.Rd0000644000176200001440000000152213552353762015370 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nexml_validate.R \name{nexml_validate} \alias{nexml_validate} \title{validate nexml using the online validator tool} \usage{ nexml_validate(file, schema = CANONICAL_SCHEMA) } \arguments{ \item{file}{path to the nexml file to validate} \item{schema}{URL of schema (for fallback method only, set by default).} } \value{ TRUE if the file is valid, FALSE or error message otherwise } \description{ validate nexml using the online validator tool } \details{ Requires an internet connection. see http://www.nexml.org/nexml/phylows/validator for more information in debugging invalid files } \examples{ \dontrun{ data(bird.orders) birds <- nexml_write(bird.orders, "birds_orders.xml") nexml_validate("birds_orders.xml") unlink("birds_orders.xml") # delete file to clean up } } RNeXML/man/meta.Rd0000644000176200001440000000276713614102404013316 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/meta.R \name{meta} \alias{meta} \alias{nexml.meta} \title{Constructor function for metadata nodes} \usage{ meta( property = NULL, content = NULL, rel = NULL, href = NULL, datatype = NULL, id = NULL, type = NULL, children = list() ) } \arguments{ \item{property}{specify the ontological definition together with it's namespace, e.g. dc:title} \item{content}{content of the metadata field} \item{rel}{Ontological definition of the reference provided in href} \item{href}{A link to some reference} \item{datatype}{optional RDFa field} \item{id}{optional id element (otherwise id will be automatically generated).} \item{type}{optional xsi:type. If not given, will use either "LiteralMeta" or "ResourceMeta" as determined by the presence of either a property or a href value.} \item{children}{Optional element containing any valid XML block (XMLInternalElementNode class, see the XML package for details).} } \description{ Constructor function for metadata nodes } \details{ User must either provide property+content or rel+href. Mixing these will result in potential garbage. The datatype attribute will be detected automatically from the class of the content argument. Maps from R class to schema datatypes are as follows: character - xs:string, Date - xs:date, integer - xs:integer, numeric - xs:decimal, logical - xs:boolean } \examples{ meta(content="example", property="dc:title") } \seealso{ \code{\link{nexml_write}} } RNeXML/man/get_namespaces.Rd0000644000176200001440000000111613552353762015351 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_namespaces.R \name{get_namespaces} \alias{get_namespaces} \title{get namespaces} \usage{ get_namespaces(nexml) } \arguments{ \item{nexml}{a nexml object} } \value{ a named character vector providing the URLs defining each of the namespaces used in the nexml file. Names correspond to the prefix abbreviations of the namespaces. } \description{ get namespaces } \examples{ comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex <- nexml_read(comp_analysis) get_namespaces(nex) } RNeXML/man/get_rdf.Rd0000644000176200001440000000100313552353762014000 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_rdf.R \name{get_rdf} \alias{get_rdf} \title{Extract rdf-xml from a NeXML file} \usage{ get_rdf(file) } \arguments{ \item{file}{the name of a nexml file, or otherwise a nexml object.} } \value{ an RDF-XML object (XMLInternalDocument). This can be manipulated with tools from the XML R package, or converted into a triplestore for use with SPARQL queries from the rdflib R package. } \description{ Extract rdf-xml from a NeXML file } RNeXML/man/add_meta.Rd0000644000176200001440000000400613614102404014112 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/add_meta.R \name{add_meta} \alias{add_meta} \title{Add metadata to a nexml file} \usage{ add_meta( meta, nexml = new("nexml"), level = c("nexml", "otus", "trees", "characters"), namespaces = NULL, i = 1, at_id = NULL ) } \arguments{ \item{meta}{a meta S4 object, e.g. ouput of the function \code{\link{meta}}, or a list of these meta objects} \item{nexml}{(S4) object} \item{level}{the level at which the metadata annotation should be added.} \item{namespaces}{named character string for any additional namespaces that should be defined.} \item{i}{for otus, trees, characters: if there are multiple such blocks, which one should be annotated? Default is first/only block.} \item{at_id}{the id of the element to be annotated. Optional, advanced use only.} } \value{ the updated nexml object } \description{ Add metadata to a nexml file } \examples{ ## Create a new nexml object with a single metadata element: modified <- meta(property = "prism:modificationDate", content = "2013-10-04") nex <- add_meta(modified) # Note: 'prism' is defined in nexml_namespaces by default. ## Write multiple metadata elements, including a new namespace: website <- meta(href = "http://carlboettiger.info", rel = "foaf:homepage") # meta can be link-style metadata nex <- add_meta(list(modified, website), namespaces = c(foaf = "http://xmlns.com/foaf/0.1/")) ## Append more metadata, and specify a level: history <- meta(property = "skos:historyNote", content = "Mapped from the bird.orders data in the ape package using RNeXML") data(bird.orders) nex <- add_trees(bird.orders) # need to have created a trees block first nex <- add_meta(history, nexml = nex, level = "trees", namespaces = c(skos = "http://www.w3.org/2004/02/skos/core#")) } \seealso{ \code{\link{meta}} \code{\link{add_trees}} \code{\link{add_characters}} \code{\link{add_basic_meta}} } RNeXML/man/get_trees_list.Rd0000644000176200001440000000177213552353762015417 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_trees.R \name{get_trees_list} \alias{get_trees_list} \title{extract all phylogenetic trees in ape format} \usage{ get_trees_list(nexml) } \arguments{ \item{nexml}{a representation of the nexml object from which the data is to be retrieved} } \value{ returns a list of lists of multiphylo trees, even if all trees are in the same \code{trees} node (and hence the outer list will be of length \enumerate{ \item or if there is only a single tree (and hence the inner list will also be of length 1. This ensures a consistent return type regardless of the number of trees present in the nexml file, and also preserves any grouping of trees. } } \description{ extract all phylogenetic trees in ape format } \examples{ comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex <- nexml_read(comp_analysis) get_trees_list(nex) } \seealso{ \code{\link{get_trees}} \code{\link{get_flat_trees}} \code{\link{get_item}} } RNeXML/man/charzero_as_empty.Rd0000644000176200001440000000112613552353762016112 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{charzero_as_empty} \alias{charzero_as_empty} \title{Treats zero-length character vectors as empty strings} \usage{ charzero_as_empty(x) } \arguments{ \item{x}{the object to be tested for zero-length character vector} } \value{ an empty string if \code{x} is a character vector of length zero, and \code{x} otherwise } \description{ If the argument is a zero-length character vector (character(0)), returns an empty string (which is a character vector of length 1). Otherwise passes through the argument. } RNeXML/man/c-nexml-method.Rd0000644000176200001440000000155213614102404015200 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/concatenate_nexml.R \name{c,nexml-method} \alias{c,nexml-method} \title{Concatenate nexml files} \usage{ \S4method{c}{nexml}(x, ..., recursive = FALSE) } \arguments{ \item{x, ...}{nexml objects to be concatenated, e.g. from \code{\link{write.nexml}} or \code{\link{read.nexml}}. Must have unique ids on all elements} \item{recursive}{logical. If 'recursive = TRUE', the function recursively descends through lists (and pairlists) combining all their elements into a vector. (Not implemented).} } \value{ a concatenated nexml file } \description{ Concatenate nexml files } \examples{ \dontrun{ f1 <- system.file("examples", "trees.xml", package="RNeXML") f2 <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex1 <- read.nexml(f1) nex2 <- read.nexml(f2) nex <- c(nex1, nex2) } } RNeXML/man/constructors.Rd0000644000176200001440000000254113552353762015146 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/constructors.R, R/meta.R \name{nexml.tree} \alias{nexml.tree} \alias{nexml.trees} \alias{nexml.node} \alias{nexml.edge} \alias{nexml.otu} \alias{nexml.otus} \alias{nexml.char} \alias{nexml.characters} \alias{nexml.format} \alias{nexml.state} \alias{nexml.uncertain_state} \alias{nexml.states} \alias{nexml.uncertain_states} \alias{nexml.polymorphic_states} \alias{nexml.member} \alias{nexml.matrix} \alias{nexml.row} \alias{nexml.seq} \alias{nexml.cell} \alias{nexml.meta_} \title{Constructor for the respective class} \usage{ nexml.tree(...) nexml.trees(...) nexml.node(...) nexml.edge(...) nexml.otu(...) nexml.otus(...) nexml.char(...) nexml.characters(...) nexml.format(...) nexml.state(...) nexml.uncertain_state(...) nexml.states(...) nexml.uncertain_states(...) nexml.polymorphic_states(...) nexml.member(...) nexml.matrix(...) nexml.row(...) nexml.seq(...) nexml.cell(...) } \arguments{ \item{...}{optionally, parameters passed on to \code{\link[methods:new]{new()}}} } \description{ Creates an instance of the class corresponding to the respective NeXML element, and initializes its slots with the provided parameters, if any. } \details{ Usually, users won't need to invoke this directly. } \seealso{ \link[=meta]{nexml.meta()} for documentation of \code{nexml.meta()} } RNeXML/man/nexml_figshare.Rd0000644000176200001440000000256013614102404015352 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nexml_publish.R \name{nexml_figshare} \alias{nexml_figshare} \title{publish nexml to figshare} \usage{ nexml_figshare( nexml, file = "nexml.xml", categories = "Evolutionary Biology", tags = list("phylogeny", "NeXML"), visibility = c("public", "private", "draft"), id = NULL, ... ) } \arguments{ \item{nexml}{a nexml object (or file path to a nexml file)} \item{file}{The filename desired for the object, if nexml is not already a file. if the first argument is already a path, this value is ignored.} \item{categories}{The figshare categories, must match available set. see \code{fs_add_categories}} \item{tags}{Any keyword tags you want to add to the data.} \item{visibility}{whether the results should be published (public), or kept private, or kept as a draft for further editing before publication. (New versions can be updated, but any former versions that was once made public will always be archived and cannot be removed).} \item{id}{an existing figshare id (e.g. from fs_create), to which this file can be appended.} \item{...}{additional arguments} } \value{ the figshare id of the object } \description{ publish nexml to figshare } \examples{ \dontrun{ data(bird.orders) birds <- add_trees(bird.orders) doi <- nexml_figshare(birds, visibility = "public", repository="figshare") } } RNeXML/man/get_characters.Rd0000644000176200001440000000524213614102404015335 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_characters.R \name{get_characters} \alias{get_characters} \title{Get character data.frame from nexml} \usage{ get_characters( nex, rownames_as_col = FALSE, otu_id = FALSE, otus_id = FALSE, include_state_types = FALSE ) } \arguments{ \item{nex}{a nexml object} \item{rownames_as_col}{option to return character matrix rownames (with taxon ids) as it's own column in the data.frame. Default is FALSE for compatibility with geiger and similar packages.} \item{otu_id}{logical, default FALSE. return a column with the otu id (for joining with otu metadata, etc)} \item{otus_id}{logical, default FALSE. return a column with the otus block id (for joining with otu metadata, etc)} \item{include_state_types}{logical, default FALSE. whether to also return a matrix of state types (with values standard, polymorphic, and uncertain)} } \value{ the character matrix as a data.frame, or if \code{include_state_types} is TRUE a list of two elements, \code{characters} as the character matrix, and \code{state_types} as a matrix of state types. Both matrices will be in the same ordering of rows and columns. } \description{ Get character data.frame from nexml } \details{ RNeXML will attempt to return the matrix using the NeXML taxon (otu) labels to name the rows and the NeXML char labels to name the traits (columns). If these are unavailable or not unique, the NeXML id values for the otus or traits will be used instead. } \examples{ \dontrun{ # A simple example with a discrete and a continous trait f <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex <- read.nexml(f) get_characters(nex) # A more complex example -- currently ignores sequence-type characters f <- system.file("examples", "characters.xml", package="RNeXML") nex <- read.nexml(f) get_characters(nex) # if polymorphic or uncertain states need special treatment, request state # types to be returned as well: f <- system.file("examples", "ontotrace-result.xml", package="RNeXML") nex <- read.nexml(f) res <- get_characters(nex, include_state_types = TRUE) row.has.p <- apply(res$state_types, 1, function(x) any(x == "polymorphic", na.rm = TRUE)) col.has.p <- apply(res$state_types, 2, function(x) any(x == "polymorphic", na.rm = TRUE)) res$characters[row.has.p, col.has.p, drop=FALSE] # polymorphic rows and cols res$characters[!row.has.p, drop=FALSE] # drop taxa with polymorphic states # replace polymorphic state symbols in matrix with '?' m1 <- mapply(function(s, s.t) ifelse(s.t == "standard", s, "?"), res$characters, res$state_types) row.names(m1) <- row.names(res$characters) m1 } } RNeXML/man/get_license.Rd0000644000176200001440000000147113552353762014660 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_basic_metadata.R \name{get_license} \alias{get_license} \title{Get license from metadata} \usage{ get_license(nexml) } \arguments{ \item{nexml}{a nexml object} } \value{ the license if the metadata asserts one that is non-empty, and NA otherwise.If multiple non-empty annotations are found, only the first one is returned. } \description{ Extracts the license annotation from the metadata annotation of the\code{nexml} object, and returns its value. } \details{ Currently the implementation looks for \code{cc:license} and \code{dc:rights} annotations. (Note that these may be given with any prefix in the metadata so long as they expand to the same full property URIs.) } \seealso{ \code{\link[=get_metadata_values]{get_metadata_values()}} } RNeXML/man/get_metadata_values.Rd0000644000176200001440000000176513552353762016403 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_metadata.R \name{get_metadata_values} \alias{get_metadata_values} \title{Get the value(s) for metadata} \usage{ get_metadata_values(nexml, annotated = NULL, props) } \arguments{ \item{nexml}{a nexml object} \item{annotated}{the nexml component object from which to obtain metadata annotations, defaults to the nexml object itself} \item{props}{a character vector of property names for which to extract metadata annotations} } \value{ a named character vector, giving the values and names being the property names } \description{ Extracts the values from the metadata annotations for the given property or properties, and returns the result. } \details{ For matching property identifiers (i.e., URIs), prefixes in the input list as well as in the \code{annotated} object will be expanded using the namespaces of the \code{nexml} object. Names in the returned vector are mapped to the (possibly prefixed) form in the input list. } RNeXML/man/figures/0000755000176200001440000000000013614133070013534 5ustar liggesusersRNeXML/man/figures/Figure1-1.png0000644000176200001440000002326313614133070015710 0ustar liggesusersPNG  IHDR)Jh( pHYs  ~ IDATxpwn D,qMrʍs7"r\+GD 8RvA"J?=h=XAiW؂Bv#0a|O7W;|ɦD"+U"8B#8B#8B#8B#8B#8B#%z@WVVv?lϞ=~{VVVNNβeΝ;mb֖_… >m۶_~KB@fYV-"eee%%%̱cΘ1cIG VNl6{^_QQq#?>o˖-3gLdD"$ yA9x3z ,=(=(=(=(=(=(=()tmϒODD:; 5kУC%#CnQ/"GzdXjkk?N>uk-++K~ @fYV-"eee%%%qޛoi203zz/| 6 ]=$ہnZQQ.gӦM7o==}I/L%Lm45ɸqZf9qB ,Kmmmcc=>}F1>a^yE>XvzG_;@fVTTȯP(ȕ+W^DDL&Sr&9rDB}tz^STTtΜ9ѣG;w{322=H$o߾JOO=ztUkkk$y7w9{짞z?A477>}:?? woe0DdٲeF%Kzի}ݿ)ڋo1"%%%z|7|7f2|>_}( Bp8AND{3|89c=nfZnxή322222ӓ3@Nlz~\277;ljjJ<]r^ "vl6gffz<ᄏyʔ)~QBnv%?_1yx}YfuxǷoꫯz$w/&h rs7SS|%<---uP=YF@e2|>_QQQP( p8:Nӵzkzzky'x" a,āᨪ2.KDjjj C}}}CC`H$R__?iҤ\ӹiӦoIؖD2ѢE_h`å;V3&~c׿j=bt?ɑ#[Hބ񚢚K75~ #8B#8B#8B#8B#8B#8B#8Bq`XZZZw z}ee̙3g&gX,=>#xIC Vv=l6vE$;;=OJJ=ܓybt:f9}k֬I6!L ,K@UU͕+z={<Ϯ]Gʫʟ,;wjhSSɶm>s*"흝V'r3m˞=Z.d2|>_QQQP( p8:Ns:`ݺuދ/m\8p8UUUFrHMM`ohh0 "b0 6,--mԨQIؖDKoMD)khx<ZP˼yG}=(=(=(=(=(u0'GWkC-2d#'LY\}l"'Nh=`[7P[7@qG@qG@qG ,KKKKn]]]AA^~ŋsss322~$gX,<^^^lٲÇݻwΜ9_]wݕ1@v{ lVvHYYYIIIvvG[Vј0@Nlz~;d6SSS$ $On( Bp8AN~ >w\b+rP+bXׯ_D. |H$rԩ3g^}'Nlx{%(=(=(=(=(=(=(=(=(=ābiiiޭ+((;;;/^9uTכmb֖w̙3)))~nϝ;%a X@ `٬Veee]d2=ù;wL<]^t:^)**?eʔ=$ۙ3gϟCM81 /=+j=Aa/:{ܹsGYWWQ#ΰabwJګ $Ph޼yHŐ!Cozhgh ejwq`2|>_}( Bp8AN… ?ku=듐{@8*rD`0744 j9x`cccSSSvv`0 k׮M¶H$r_zm""MMq\e evwG@qG@qG@qG@qG@qG@qG@qG@qG ,KKKKn]]]AA^~إO(>q|dd\ӧd b666"H˥On͖V[[[QQQVV&"CP#/xBz$,"Iv%YFRRHz=OQQ[z@99"" 5\_R--BGwdDw 鮻N~#G|3Bw{%=]H&FBĬ@Z[[0L&F BP8`Pt

a 萎ٱC1;zTΞzpIQ9kې!Z/.C;?/2r;bfi=X,'uuu6lxammm>$l#? 䗿4GX,dAAAj8 1bDiii6l]uU"rĉhG<^[_&՚G?ڵkɉ("@2n8yOom2|>_핡P( p8 u:Nz7޽{_z7x#C#W[#z_=lD$ڪx5h=BzH+%;;{HdŊK|N<9w̜J6 JKK__jժU.>,++7'q G@qG@qG@qG@qf,?A3;e$HɆE>[Ke18QfG=Kk*rk_5.ܓMMM~{~~~ =(K78ߕ#G$//>ODDNk7p=o]w;yRD3> @ =Λ0A22֯#Āk8Bq`XZZZw{w 6,??^pzP(|gڴiGx{=nfZn޽{?Gff-2s 6h8@Nlz~ܹs"=࣏>nП9sFD:/^MѣG_ UV\y7pCEzGY`Czpǎ?_%KL0ammmɟE#sٽ{wAAAjZ&u}ZihhO^9*rDd͓&M۶mۖ-[ᶔH$r_zm""MMq\-O GqF#8B#8B#8B#8B#8B#8B#8B#8B#%zwϞ=~{VVVNNβeΝ;6Bp¼Ço۶_~4C Vv=l6vEdcǎ1cݻ5G VNl6{^_QQ!"Ϸe˖3gj8@͚5kC;v=ܣmu6ggb>ghP|mBƄ[~3g\tҥKUVUWW'aB`h OKzFGGo~}СCǎ[dIFFƘ1c,Xi&BsՐDVzKL&+**j2~ӟ.]ѣ6m:u۸Fqp8Ft^~[ߚ:uj}'5=Aiiiiii}] t=(=(=(=()$F0("?uc@99~2CFC,_แ?#1v&w\j<[&Ww"t|#1{LV}vGGǵ^[VV Vv=l6vE$7|d2k83zz肧6lpk*3zHlݺBNOk}ƯNG.sƍof՚E=#!)CD7'󛓿z 3 OMNzuE #Z_߾}{ {5\Յkh4\G6nx:Ta"\?&"5Rqddok@qF#8B#8B#8B#8B#8B#8B#8Bя%mm=ΡCb4ʡCZg1|wˡCruMy='L=ābiii?~|zz㛛&1]\oc\ӧ8p`ĈbefZn[DV\z꒒TTTdZ5G VNl6{^_QQq̙?0=:''gɒ%`Pyyuٽ'[[[#țos>`֭O=TvG>P' ,[lԨQcƌYd͛oz軮_:Y0@j91bDJJJw@edG0L>/z{3xPB8,2fdgk=ep8yRDϴ+PBgw_ $ڹs""GjW=NDd YB)Cן@>]5zPzPzPz;{-6B ~ӧO>}.!+l6ju]tmz4^W+WyMMMO @vٜx)Sh53zVf*,,0a?~wvƍiۣ^9---'eV85J>@V>`2|>_^xСCǎkhhؼyٳ5*B .GUUht\H~ҤINsӦM5ƥm۶i88`u/8 DDAw?"fϖfGk`5f|<;$]Əz#B*'G22䡇'gϊ.99Z@c@qG@qG@qG@qG@qG@qG ,KKK̙3gj2)@<#7x+=nfZnw׃'%%{vz4^WTTH{{׬Y4BP[[`< S"a_OO߰kk=gi++.~|Ϟ=g׮]ɟ#B(a1A9vL)wfJ[@!=19z;5 $۶mϭVwvvZVߟYIDAT_!zzDRg2|>_QQsz|ݺuދ/6@8*r aÆ5Jm)HD×G?R\,ZHŋ套w =(=(=(=(=(=(=(=(OyȾ}ZH'U@u|Ζ'\g8oZ9qB4z9y}G@t}f,^9rkYxҥK5Fq޿ kVٹSPVyyeˆw9s\wuVca,nfZn[Vј4G VNl6{^_QQ0Lf955pn !xEYYY.!V)S$%E)=1;/dVVVVVּynxŊɜЏj#.Pv躙z+HdBc&h='ћ&ug?YIIÛy˥JB?*ђop8}E= ,կ~[z 4F JKKKKKw_i8G@qG@qG@qG@qoH|GB>a "r?{ B$^s:% OAHq$5Uy_[rݒM@qG@qG@qG ,KKKKŋgffN:j@9s&%%s|> zn6jkL~877wΝ7c VNz< ~ʔ) BcH[? "W]uϜ93zhĉIu1B#z%ʎzٳs9rd]]]2G]eN),!CғQ7SSGPh޼yHzĉZч ?~^ pXk{uqp8F:x`cccSSSvv`0 k׮pgѻHD1=6 . S[Z=>_oAZ/=ew c6MMzĠa4J*? =(=(=(=(=(=(@X,ݺ^_YY.b֖k=D@v{ lVvHYYYIIIvvD{;z=OQ2@qH>v1C6v8ZfHcdzDbJ@ d2|5P( p8:NӬ @GUUht\"RSSc0 CuuR"/H4@qG@qG@qG@qG@qG@qG@qG@q=Eu;RIENDB`RNeXML/man/figures/unnamed-chunk-5-1.png0000644000176200001440000000764413614132601017311 0ustar liggesusersPNG  IHDRMPLTE  !!!"""###$$$%%%&&&'''((()))***+++,,,...///111222333444555666777888999:::;;;<<<===>>>@@@AAABBBCCCDDDEEEFFFHHHIIIJJJKKKMMMNNNOOOPPPQQQRRRSSSTTTUUUWWWXXXYYYZZZ[[[\\\]]]^^^```aaabbbcccdddeeefffgggiiikkklllmmmnnnooopppqqqrrrsssuuuvvvxxxyyy{{{|||}}}~~~Z[v pHYs  ~ IDATxUeC8 0E2 BxPQbHx" [i"&^b*艁lg3<߇}_?X8kߜZ.>$8</////////////////////////////////>_ftGm| CzxW͙q]Ƨ>?t==~F;ks=KԺ}w?)co!|Hg,-<,P뮬]w^*ȍ;z:75n){yp~3$A ^nM·|J:7f&^w~Om PCM*(ܙ[7o!|$P,!|/I:h ;R _)W|/&> G #Oń'AbB |1!|I>B$_L!|/&> G #OńP=Waz z Cڽd{ sʽ;੶y[{WsV9)>R7l;|WrY?ezuDζlGVz\Yٗ:ze˖g۾Ç#Uo!(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‡z5>!^ 4>y^yY[UmُuSSo͞gԻsܘm2>Mh%,[koוK"&VVjExkM{^֩lvoI,!5‹"(‹"(‹"(‹"(‹"(‹"(§'s (- [%+>=O'GxkO#5§Co!|rF>9[koj},:5 z}VsZW=Qa~5}{^L,[[{n\*nonz՞W?>$+#|H~W%=5ַ> իsXBxQExQExQExQExQExQExQExQExQExQExQExQExQExQExQojaesO۞BV;7>y^M^1!^n>W+;o̙{!| _̷JoU[r?B>9B>9B>9B>9B>9rJ]>^>,1yͭB{ec]f7 cyO#|᳌>YFG,#|r#|>9>eOq.]mtGن;{|>3 9w6s M>,I}&F3 Ν-Y-g>;wj;"3 ;w?Kv!|ix?|ߝgC8~sg#-9!+>4|>YFG,ku1c.?+nf_y!T/.#?9WVeOq2'G8g#|᳌>YFG,#|r#|>9>eOq2'G8g#|ᳬh^;`y#l^zh;gs;7D;"}{^mϽMX4?\jO\I]?z\Ʒ> ի/[Ռ{‹"(‹"(‹"(‹"(‹*jՇ(?82i3FoP[FExQExQExQExQExQExQExQExQEV6+P‡zuo<zU-kʹeG§lh+vw>e6e-[N'U)k)|>e"7"|EoD>߈)#|SF,"|#§YDFOѭBםS_Pk^E^E^E^E^E^E^TV\ѷ'/ n_\u §~Wg.m-﮿u§ޫWOTDc8N§WꕛzIv9xѝO٩OlFꕻôaFw>ekW5gU! 1^mt?%n!|@~W%=5u4V[Ճk &t/////////////////////////////////////////%(2cIENDB`RNeXML/man/figures/logo.svg0000644000176200001440000020640013552353762015234 0ustar liggesusers image/svg+xmlRNeXML/man/figures/unnamed-chunk-8-1.png0000644000176200001440000004253113614133052017307 0ustar liggesusersPNG  IHDRMPLTE  !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~]} pHYs  ~ IDATx@SW]Kފ( *jU[(Z鶭V'*3@  DHT*D$G\FO%orx{  @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) TNP79W@{urF<=kEGj4畔~1)-Dސr@ ~2iY,^MA .ρp#]ӢOs;p |Vr@#ސpV [ѹn_̏3y-ػyϓKsSPxC´ / 1A iQg&?=lʿ^+7`6崀3w!tQ CsPxSm>eH=,k?ȚxPPx=(6E<ߕ@GZ3cifP8EZ;yP$~pdyYM {-[kȜ>|S`E ؿ\ Cku OrVM28̹9w{}+-9}p>o<1 X)cg{NQtx\sPxCCs&u#񽃔lI廜!_=;#o"YsPxrSm ) }p͊~kN r|pc`:mʰ^,6 q *ki o2rU|vWW86mufF95%&/ Ű|0 DI(<)q e=~}YWQ{7P}Pa;ᒭStAP[мF:x:=ᠯ0KaݢIr“:9S\~~vп c}s[MC ߱ZKPxZƒiz~v7wK~ 6TYrE^?쳡)׍xwQoy876wKsPxR/ny~vWn 8|2Y?u3gІFKܜV6PsPx2(hôZl^iQ}"1 /W2“7tzlƨ ѻVQ6r(wZMhr3QZO͏HNiHjsta^K^8MM8#3hFWP^5/h'5 f}a\aW|Vvl#XǷURvZa W];`q&peZRq 0No|@>|"ZBҩ8@0)Y80oⵌ)~VUj aje|Vq%+/Le lD^IXw͍A;Ѫ1-0N{eNe-tz; "u8–,ƍøuXT@/Q7K|6M=4}QD, k0K n0t0y97t7@+2%ز Qc|&%ѸFת։a]+ wUFN!h:+no9[Iؒv/N;7@-2X~u//&9NXN/aV3.JMK\&FWPПo=봨d,kSƖhZ_dɀ\ np:JÑ'vOzΕY+UؒJ!QEfr>'(|n?e(| 0Q &{bsgH̊*>:]ޗ0XkTʧȈƣ;چ·zr(crA^"U&9k%pP8U괨4ee.79>?2⿑ø lce@&& W :4,71Y*@%]Kwzѿ^[b|ʵ&XUYW& o%GΟ̑JxW9b9eAT܈VLᎴxTHȧp(7nmr찈H1Fqܱ3睐g]y]qQe!-@-a_*ߥjTC5w\t"pj{E-X7{c3-83}Vz.> OZ%iQ#MyZ-M&s7&?.&KO(J%e^gjXZJ]FG+ I W23q"ZUWW_&qi`0qALd9d[,X%f96:g|"J/a*Z3{&!g;+ѥ؀i0:&;|"]TQ[Ue`k@05̍S:m&\^;J-GLm|sKLBi>,O_dw~Sgy+Pxmh]}% v#c(#I[>v7<B(fY"K*jۍ :w~v݂ZXUGTY?stN( :bHm܌9.6+ oDhav܄xa0Kã-·ARNBBWJt=A**%UX+/%L~e:DדaG7r2 cz(_ϧ/{ko ߈6ѮCJMeaԂx)+]mlag: _r]A-R''Hv:ݰh.'ch)m|%/|dckRK[{IAAgaڏid˕|'woi;F-+n VʗPqE  0ڜ6ASWz!Ehr!TP! ˤ ЊhSL8&JWa2%y ݩ^!\CC*um|P?U84gI`bzfaw]93=4A |d_OQ_(ul y㴏&zx)},u PCv;؈\:wˠ|y M&3F[V |0Fte^@1q<7mo{ɮa)bR? nɞ/<Ѣ20GWkgXLb 0cjGi}pJOp)FtX<:r0vhh-;4G O8#@t-(1햲+]“?#"744N5r),@R¼G+6QbS:c#xF{8iy53r@$F2#kl',|7,DQڍ`C|Ft)q:jʍt4> ?ڭfz,G |]䛙}9__v?H_3=MxC>Qҫ`Z~Xm4ӣo!Q?WvJ83Pt#}- ;b9j8C27( 6B ǿD~TFX1|T(ezyg9jbR,zGm2.Wd*u//Ĭ{-|X#ѡ !eΝ=偎wq[{-O]h9jXUbz k洓N#W$1[{j/7X['L\\SwM.Uʑax(-@*|$[Ʋَ6g١ԍZ, RbJWo9䈝kPG4󗛛ƬXe x;/\|%)hPb. {M_28-SGU6VL#&-GGM.=+a&aIQz6%l,>&Z1,r\TIY7FJ <ÝAg˺lYݨ=ӒdHw(y(R @Y,bz),|F3r( RČ9 I%6Kz?(LP[/X'ӿ7Y?IUn΋?GO\%Ʉ}YT`uȯ zSٚ߰y%eyZ\B9)}R b jG.U|US2*sKݑq7>#Lg'Jq4>J;@IE,ǜTkèeR_{H~\t+`2b,f2seMsb:2Kg\!3;$e:yr\ۚ1g1iv||frdYi dbibGzKNEuUqIUϜ$b=} "k\0R838͒lvRvoZJerOGG>uԙrX? )aDF8u.*..|Ǎn^m娺뉁ǿN?uǏN+_Ũ/C 5ʼnf~v˸aoYcq޸EE+aUs1_W CYUYF9@_.w`g\9ryS䊙1Z', ]4ovJ@-yh<\^ u_Ss6#N=vG#8~&FR?fk}粜e%904ʠsy !J3+-z=Em;rYĖW G=v&Qv̫[AT,`[Dҳ׌^*hDћK~qۨO;&5'ޒ/`(kOj%Ӗ=£fSo&w-z앓w =7 XcsMː%4Wo9fƚl3qIq~8޼jhwHya n~C^kWxRH}> eW]9RxUz`> \\/g's<_$^9cb= mԆ d*,C kPsY ?-sD])?{lx@!~զh&y!.̒ YlqEbjrZWߨ߼HX^3Z76Ġeh#2['}9wG'DzxI Tþѫ]:R_蜑csp}^T?Z]Ȫc$ȀV`tC0jm.<+hn]B;/Na\fjF>y^BE7 xe&"5➄yE%TbwԌT:l7M#8]yX*f@kn34ee`˺lO^"8忩,}d,ɺrWȐ>#vb(}!1;tK^-+ِ=k\Sw.꿩 13xごJ=axrN$6;T! zmDp0kg)YHd%qr Dok3*oJGI=;էlܫ2" zߩv'FMӚeJ׃VYji#AYȌK҅ ՛N%V;&<کёE`KqZt?[*{|6d_gVt ^rz7%Tb棭-܈'2BQCxn\ի #0qMGX#DNFpZ6v B7Jt AWQweyXmrbqfG FB# &UOr9KC(+xBV!WC[tY4X}3V$mX7:i+SzE 8F5HxWP7Fm"RˆUY[O[5oy?MdqK )%L_G~|xN乣T՗;*0ocҢ?Mdqm۝O7}9< 4c!X g۽;mpnpz!&}&WJ#+=>z ?x 6zT%->w`=s42p~Ǩ,a?hэ*Xs<7ku+lIrq,zE\M |VO5­ nTXV#ܬ0Id`W42bKw)b$+4a9j֞-b{>41Nvfë !m1jvd5t%vѰ%-tej{n,3tE07 c;2S=7,fnu7}k_x@V,,vx5 iyW&0rU Ro(αLm$䠀+dH?9IfXOe[U< d2OD'Y[7YpE?o+ĥS64i']V:2=c5㗗X3шqaO*OѬG3$tANte*񪓜@i0㤋#9isAΓx6 7 c;22{cnejy.{Aͪx4C6ke:dJssikY|U}S,!%qUh|wq;$T=7rb3<)^Nd輝teN!KS8-9K7Z YkȆe꤈{.>3!myxL3,S5Uݎ>IK4-lПQӭv:ImU:{Mi]"V> *:2gVk*. y$ϲ% 7m,STgգ>SptYE~mUyCrؖ2KWV8dg,MyoJva`⠄ǯ{vlM3OiO HxIhe*7MiϬF?ɝЦq?<)ZpH+C$C\Q7ܷh洧|%<)7mDppihAN߃t+ݩTt2ZF6s|>("O?rq"GO]m|6)?i洧i|&<8FfBn ^cVg=C[6*#T4TJ,67пP=4ɶ[B[YqX1wZ@Mv}THkP\ͦ˰gcv=O_q,ME[4\oXb2q|N2r?\ʓ]?qb ot MEZ63dLm8KH-Vm(in K >KE͍=2MƱ&QWCCö??`-ۻcI4}o ^g~*mS0șÒlyc>m9 kQ-}{c\M`E.Oos3'˺l۳b.ϗ:t\~-^Oo:l7Ԧyċ6I\:S#iC1(e:l7NC8Ѣ! < gml]F5:l#'e 8ޢWRF-K Hm@NG n`tNmEFd 3,Seҳe t 2C2?"/<0DT~!Z~}-2{z(!DpXV&: 1'+**sQDxC)`jLNUًd>rV N0~:z[s@gs1s1ZL-S0W?Dng~zo}Z'B'[:t,/kileO!A[fG~A;?ryluunӂ{{1g,0-SEæ5xwQ)~Y޽+}mIE{L*M9&bgz砚hBH @=Ym"dpbh_6-8ĮPOxòLņt93do{gŘo"Zp{Ƹ<}_V䣨y*  25st;#?:37Nܶ|{!L]>Y5?K8E7T92C=v2c@>I4roƬQ>rlﲜדk:!Dp/Uy"X~,>؞Ug ߱^\2z >[Pp~4Q6*}!9vٛ~|KQoޱw22B 0Zb6Y~ԧ~;nBeA^ HPGYlspc{/v^Iu؝a7 ,S6 ~}n:pdo~oO}$;9jn L=l:vٻ0Up] ^/șgR8!eT?ipfYpi6?̧in L=13$6~0g v46ͦw]Iw $.Ŗz{wrhY%+p;kev#-5P {gezODyj@ۆܖ@>CBfːY8Px-z,l=_Y'?^+dL $$u³|p:@N?,sr M^'fZG-uq^wbr|EW3=VPx"te*ڵ"_gRJZc2ɻZr?< ,j:@;>-S=ILe^kuE tj 2wq&}rr#xh@?߲i+l47>b݉*"wm=QYJ-PNk n[#FsQe޷AR_tejד(fth|VKcE`6IX6)~^}4E@:g^wx_sPΥ-S[f}U9\ 7K~N6˿В! l:2<v<ߕIv:ԉDW1c!@;βLm=f8ncA=-SV!yZ8ơ]B'X 0-˞ nܙ}u]v̊' []΍<]D,S5To>|%ۇ;bG ofO53zۮg3@ỌGp4k>l8ffG}xY;?){5s{;֭s@ỐjyS$M2MV],v>66a.8oʘ"7\N▩mz2 ^^^S_|)!2[ V-}o)Aw5,SZuaQ 447筯 ? -Knd_(se/::OzV>ɂ12± |XW Z?wO .t k-o /*W493(3ceU bp{2T,E聆;jG~{{dYwoO|e@Eז: ,x^dpn= ]8fFpXoCoT5oAU?[ہw'܍5lVuqGքO(|wN2B3RlXn>WscPnG74Ner6RW_3]Ρ6֚“j9ۇX$5nUvc\(jc(<9hڤJcE { +Ȥo]X6Xk O,mVE{<-`D/VmQ3^2^X6Fm5 OZLmVY]_kA!uO!Ad'dP671jcdPx2Ѽ^-s8Ory q7<{X.,jvſ| OM_[*[BtPx8=WY rE@ZPD{V'<$A}z8|M>yXkS7cCK$Z,x[?__?{&:AIB!=+㕗b𳀾[Do+<tiB“j2X̟Y%w]Ffwp$ZP`5)+ #|OM O9ha.y|Qn̡ M+VVZW7<Ե4-n!gt'!ĩ{ؠ #OP>eNcL'x|rlh>!4Z*w?oj9Dbi.7D“:W>^n>C+ͬM><8\gwkЬa؃1 >xmø 85~YcG(.Q {|/e#hC~ZJj?Ƞ~CIo;fו :ufrBC57U߳h]OOI]7fD=^vOMۘ6DŽ:-n7Z6{Azh~E*aǔG=;-5׆}͌57,^4k+>3dE>=՛k oh͐k+8f>nrm4|C hݚK" i掵|j oXM6]@m)VSs*h o>e3u/aulUTK@иs? t{u Y*hGvH4Z|e>bl;q r6r cF_2IDATkn oxh7źrm'A6 Cs`"P`WX!G@@) URaGyzkn oxʁX'z>PLY~xeXwfhn op c;ƖUۍjP+w 48XM ,@) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) 8.IENDB`RNeXML/man/findNextMethod.Rd0000644000176200001440000000423713552353762015322 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/S4-utils.R \name{findNextMethod} \alias{findNextMethod} \title{Finds the method that callNextMethod() should chain to} \usage{ findNextMethod(method, f = NULL, envir = topenv()) } \arguments{ \item{method}{\link[methods:MethodDefinition-class]{MethodDefinition}), the method for which to find the next method} \item{f}{\link[methods:standardGeneric-class]{standardGeneric}, the standard generic for which to find the next method. By default this will be obtained from \code{method}.} \item{envir}{the environment in which to find the method} } \value{ a \link[methods:MethodDefinition-class]{MethodDefinition} object that is the next method in the chain by inheritance } \description{ Attempts to find the "next" method in the inheritance chain. This would (ideally) be the method that \code{\link[methods:callNextMethod]{methods::callNextMethod()}} would chain to, as a result of the method \code{\link[methods:addNextMethod]{methods::addNextMethod()}} would find (and return in the \code{nextMethod} slot of the \link[methods:MethodWithNext-class]{MethodWithNext} object). Hence, in theory one shouldn't ever need this, but unfortunately \code{addNextMethod()} is broken (and errors out) if one of the classes in the signature name-clashes with an S4 class defined in another package that is loaded. } \details{ The next method will be determined by the S4 inheritance chain. However, this function will walk only the inheritance chain of those arguments in the signature that are defined in the package of the generic method from which this function was invoked (directly or indirectly). If there are no such parameters in the signature, or if there is more than one, finding the next method is handed off to \code{\link[methods:addNextMethod]{methods::addNextMethod()}}. } \note{ In theory a class name clash between packages shouldn't be a problem because class names can be namespaced, and the \link[methods:MethodDefinition-class]{MethodDefinition} object passed to \code{addNextMethod()} has all the necessary namespace information. Hopefully, at some point this gets fixed in R, and then we don't need this anymore. } RNeXML/man/reset_id_counter.Rd0000644000176200001440000000035613552353762015735 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/internal_nexml_id.R \name{reset_id_counter} \alias{reset_id_counter} \title{reset id counter} \usage{ reset_id_counter() } \description{ reset the id counter } RNeXML/man/add_basic_meta.Rd0000644000176200001440000000561713614102404015264 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/add_basic_meta.R \name{add_basic_meta} \alias{add_basic_meta} \title{Add basic metadata} \usage{ add_basic_meta( title = NULL, description = NULL, creator = Sys.getenv("USER"), pubdate = NULL, rights = "CC0", publisher = NULL, citation = NULL, nexml = new("nexml") ) } \arguments{ \item{title}{A title for the dataset} \item{description}{a description of the dataset} \item{creator}{name of the data creator. Can be a string or R person object} \item{pubdate}{publication date. Default is current date.} \item{rights}{the intellectual property rights associated with the data. The default is Creative Commons Zero (CC0) public domain declaration, compatible with all other licenses and appropriate for deposition into the Dryad or figshare repositories. CC0 is also recommended by the Panton Principles. Alternatively, any other plain text string can be added and will be provided as the content attribute to the dc:rights property.} \item{publisher}{the publisher of the dataset. Usually where a user may go to find the canonical copy of the dataset: could be a repository, journal, or academic institution.} \item{citation}{a citation associated with the data. Usually an academic journal article that indicates how the data should be cited in an academic context. Multiple citations can be included here. citation can be a plain text object, but is preferably an R \code{citation} or \code{bibentry} object (which can include multiple citations. See examples} \item{nexml}{a nexml object to which metadata should be added. A new nexml object will be created if none exists.} } \value{ an updated nexml object } \description{ adds Dublin Core metadata elements to (top-level) nexml } \details{ \code{add_basic_meta()} is just a wrapper for \code{\link{add_meta}} to make it easy to provide generic metadata without explicitly providing the namespace. For instance, \code{add_basic_meta(title="My title", description="a description")} is identical to: \code{add_meta(list(meta("dc:title", "My title"), meta("dc:description", "a description")))} Most function arguments are mapped directly to the Dublin Core terms of the same name, with the exception of \code{rights}, which by default maps to the Creative Commons namespace when using CC0 license. } \examples{ nex <- add_basic_meta(title = "My test title", description = "A description of my test", creator = "Carl Boettiger ", publisher = "unpublished data", pubdate = "2012-04-01") ## Adding citation to an R package: nexml <- add_basic_meta(citation=citation("ape")) \dontrun{ ## Use knitcitations package to add a citation by DOI: library(knitcitations) nexml <- add_basic_meta(citation = bib_metadata("10.2307/2408428")) } } \seealso{ \code{\link{add_trees}} \code{\link{add_characters}} \code{\link{add_meta}} } RNeXML/man/get_citation.Rd0000644000176200001440000000147713552353762015056 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_basic_metadata.R \name{get_citation} \alias{get_citation} \title{Get citation from metadata} \usage{ get_citation(nexml) } \arguments{ \item{nexml}{a nexml object} } \value{ the citation if the metadata provides one that is non-empty, and NA otherwise. If multiple non-empty annotations are found, only the first one is returned. } \description{ Extracts the citation annotation from the metadata annotation of the\code{nexml} object, and returns its value. } \details{ Currently the implementation looks for \code{dcterms:bibliographicCitation} annotations. (Note that these may be given with any prefix in the metadata so long as they expand to the same full property URIs.) } \seealso{ \code{\link[=get_metadata_values]{get_metadata_values()}} } RNeXML/man/get_flat_trees.Rd0000644000176200001440000000165413552353762015371 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_trees.R \name{get_flat_trees} \alias{get_flat_trees} \title{get_flat_trees} \usage{ get_flat_trees(nexml) } \arguments{ \item{nexml}{a representation of the nexml object from which the data is to be retrieved} } \value{ a multiPhylo object (list of ape::phylo objects). See details. } \description{ extract a single multiPhylo object containing all trees in the nexml } \details{ Note that this method collapses any hierarchical structure that may have been present as multiple \code{trees} nodes in the original nexml (though such a feature is rarely used). To preserve that structure, use \code{\link{get_trees}} instead. } \examples{ comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex <- nexml_read(comp_analysis) get_flat_trees(nex) } \seealso{ \code{\link{get_trees}} \code{\link{get_trees}} \code{\link{get_item}} } RNeXML/man/get_taxa_meta.Rd0000644000176200001440000000137513552353762015204 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_taxa_meta.R \name{get_taxa_meta} \alias{get_taxa_meta} \title{get_taxa_meta} \usage{ get_taxa_meta(nexml, what = "href") } \arguments{ \item{nexml}{a nexml object} \item{what}{One of href, rel, id, or xsi:type} } \value{ the list of metadata for each taxon } \description{ Retrieve metadata of all species/otus otus (operational taxonomic units) included in the nexml } \examples{ \dontrun{ data(bird.orders) birds <- add_trees(bird.orders) birds <- taxize_nexml(birds, "NCBI") RNeXML:::get_taxa_meta(birds) RNeXML:::get_taxa_meta(birds, 'rel') RNeXML:::get_taxa_meta(birds, 'id') RNeXML:::get_taxa_meta(birds, 'xsi:type') } } \seealso{ \code{\link{get_item}} } \keyword{internal} RNeXML/man/get_meta.Rd0000644000176200001440000000211613552353762014161 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_metadata.R \name{get_meta} \alias{get_meta} \title{Extracts meta objects matching properties} \usage{ get_meta(nexml, annotated = NULL, props) } \arguments{ \item{nexml}{a nexml object} \item{annotated}{the nexml component object from which to obtain metadata annotations, or a list of such objects. Defaults to the nexml object itself.} \item{props}{a character vector of property names for which to extract metadata annotations} } \value{ a named list of the matching meta objects } \description{ Extracts the metadata annotations for the given property or properties, and returns the result as a list of \code{meta} objects. } \details{ For matching property identifiers (i.e., URIs), prefixes in the input list as well as in the \code{annotated} object will be expanded using the namespaces of the \code{nexml} object. Names in the returned list are mapped to the (possibly prefixed) form in the input list. The resulting list is flat, and hence does not retain the nesting hierarchy in the object's annotation. } RNeXML/man/get_all_meta.Rd0000644000176200001440000000121613552353762015011 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_metadata.R \name{get_all_meta} \alias{get_all_meta} \title{Get flattened list of meta annotations} \usage{ get_all_meta(annotated) } \arguments{ \item{annotated}{the object from which to extract meta object annotations} } \value{ a flat list of \code{meta} objects } \description{ Collects recursively (in the case of nested meta annotations) all meta object annotations for the given object, and returns the result as a flat list. } \details{ Does not check that the input object can actually have meta annotations. An invalid slot error will be generated if it can't. } RNeXML/man/c-meta.Rd0000644000176200001440000000225513614102404013526 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/meta.R \name{c,meta-method} \alias{c,meta-method} \alias{c-meta} \alias{c,ListOfmeta-method} \alias{c-ListOfmeta} \title{Concatenate meta elements into a ListOfmeta} \usage{ \S4method{c}{meta}(x, ..., recursive = TRUE) \S4method{c}{ListOfmeta}(x, ..., recursive = TRUE) } \arguments{ \item{x, ...}{\code{meta} and \code{ListOfmeta} elements to be concatenated, see \code{\link{meta}}} \item{recursive}{logical, if 'recursive=TRUE', the function recursively descends through lists and combines their elements into a flat vector. This method does not support \code{recursive=FALSE}, use \link[base:list]{list} instead.} } \value{ a ListOfmeta object containing a flat list of meta elements. } \description{ Concatenate meta elements into a ListOfmeta Concatenate ListOfmeta elements into a flat ListOfmeta } \examples{ c(meta(content="example", property="dc:title"), meta(content="Carl", property="dc:creator")) metalist <- c(meta(content="example", property="dc:title"), meta(content="Carl", property="dc:creator")) out <- c(metalist, metalist) out <- c(metalist, meta(content="a", property="b")) } RNeXML/man/nexml_get.Rd0000644000176200001440000000464713614102404014351 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nexml_get.R \name{nexml_get} \alias{nexml_get} \alias{get_item} \title{Get the desired element from the nexml object} \usage{ nexml_get( nexml, element = c("trees", "trees_list", "flat_trees", "metadata", "otu", "taxa", "characters", "characters_list", "namespaces"), ... ) } \arguments{ \item{nexml}{a nexml object (from read_nexml)} \item{element}{the kind of object desired, see details.} \item{...}{additional arguments, if applicable to certain elements} } \value{ return type depends on the element requested. See details. } \description{ Get the desired element from the nexml object } \details{ \itemize{ \item{"tree"}{ an ape::phylo tree, if only one tree is represented. Otherwise returns a list of lists of multiphylo trees. To consistently receive the list of lists format (preserving the hierarchical nature of the nexml), use \code{trees} instead.} \item{"trees"}{ returns a list of lists of multiphylo trees, even if all trees are in the same \code{trees} node (and hence the outer list will be of length 1) or if there is only a single tree (and hence the inner list will also be of length 1. This ensures a consistent return type regardless of the number of trees present in the nexml file, and also preserves any hierarchy/grouping of trees. } \item{"flat_trees"}{ a multiPhylo object (list of ape::phylo objects) Note that this method collapses any hierarchical structure that may have been present as multiple \code{trees} nodes in the original nexml (though such a feature is rarely used). To preserve that structure, use \code{trees} instead.} \item{"metadata"}{Get metadata from the specified level (default is top/nexml level) } \item{"otu"}{ returns a named character vector containing all available metadata. names indicate \code{property} (or \code{rel} in the case of links/resourceMeta), while values indicate the \code{content} (or \code{href} for links). } \item{"taxa"}{ alias for otu } } For a slightly cleaner interface, each of these elements is also defined as an S4 method for a nexml object. So in place of \code{get_item(nexml, "tree")}, one could use \code{get_tree(nexml)}, and so forth for each element type. } \examples{ comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex <- nexml_read(comp_analysis) nexml_get(nex, "trees") nexml_get(nex, "characters_list") } \seealso{ \code{\link{get_trees}} } RNeXML/man/nexml_publish.Rd0000644000176200001440000000130013552353762015237 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nexml_publish.R \name{nexml_publish} \alias{nexml_publish} \title{publish nexml files to the web and receive a DOI} \usage{ nexml_publish(nexml, ..., repository = "figshare") } \arguments{ \item{nexml}{a nexml object (or file path)} \item{...}{additional arguments, depending on repository. See examples.} \item{repository}{destination repository} } \value{ a digital object identifier to the published data } \description{ publish nexml files to the web and receive a DOI } \examples{ \dontrun{ data(bird.orders) birds <- add_trees(bird.orders) doi <- nexml_publish(birds, visibility = "public", repository="figshare") } } RNeXML/man/flatten_multiphylo.Rd0000644000176200001440000000136713552353762016326 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_trees.R \name{flatten_multiphylo} \alias{flatten_multiphylo} \title{Flatten a multiphylo object} \usage{ flatten_multiphylo(object) } \arguments{ \item{object}{a list of multiphylo objects} } \description{ Flatten a multiphylo object } \details{ NeXML has the concept of multiple nodes, each with multiple child nodes. This maps naturally to a list of multiphylo objects. Sometimes this hierarchy conveys important structural information, so it is not discarded by default. Occasionally it is useful to flatten the structure though, hence this function. Note that this discards the original structure, and the nexml file must be parsed again to recover it. } RNeXML/man/get_taxa_meta_list.Rd0000644000176200001440000000144413552353762016234 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_taxa_meta.R \name{get_taxa_meta_list} \alias{get_taxa_meta_list} \title{get_taxa_meta_list} \usage{ get_taxa_meta_list(nexml, what = "href") } \arguments{ \item{nexml}{a nexml object} \item{what}{One of href, rel, id, or xsi:type} } \value{ the list of metadata for each taxon } \description{ Retrieve metadata of all species/otus otus (operational taxonomic units) included in the nexml } \examples{ \dontrun{ data(bird.orders) birds <- add_trees(bird.orders) birds <- taxize_nexml(birds, "NCBI") RNeXML:::get_taxa_meta_list(birds) RNeXML:::get_taxa_meta_list(birds, 'rel') RNeXML:::get_taxa_meta_list(birds, 'id') RNeXML:::get_taxa_meta_list(birds, 'xsi:type') } } \seealso{ \code{\link{get_item}} } \keyword{internal} RNeXML/DESCRIPTION0000644000176200001440000000561013614247105013032 0ustar liggesusersPackage: RNeXML Type: Package Title: Semantically Rich I/O for the 'NeXML' Format Version: 2.4.2 Authors@R: c(person("Carl", "Boettiger", role = c("cre", "aut"), email="cboettig@gmail.com", comment = c(ORCID="0000-0002-1642-628X")), person("Scott", "Chamberlain", role ="aut", comment = c(ORCID="0000-0003-1444-9135")), person("Hilmar", "Lapp", role = "aut", comment = c(ORCID="0000-0001-9107-0714")), person("Kseniia","Shumelchyk", role = "aut"), person("Rutger", "Vos", role = "aut", comment = c(ORCID="0000-0001-9254-7318"))) Description: Provides access to phyloinformatic data in 'NeXML' format. The package should add new functionality to R such as the possibility to manipulate 'NeXML' objects in more various and refined way and compatibility with 'ape' objects. URL: https://docs.ropensci.org/RNeXML, https://github.com/ropensci/RNeXML BugReports: https://github.com/ropensci/RNeXML/issues Additional_repositories: https://cboettig.github.io/drat/ License: BSD_3_clause + file LICENSE VignetteBuilder: knitr Suggests: spelling, rdflib, geiger (>= 2.0), phytools (>= 0.3.93), knitr (>= 1.5), rfigshare (>= 0.3.0), knitcitations (>= 1.0.1), testthat (>= 0.10.0), rmarkdown (>= 0.3.3), rlang, xslt, covr, taxadb Depends: R (>= 3.0.0), ape (>= 3.1), methods (>= 3.0.0) Imports: XML (>= 3.95), plyr (>= 1.8), reshape2 (>= 1.2.2), httr (>= 0.3), uuid (>= 0.1-1), dplyr (>= 0.5.0), lazyeval (>= 0.1.0), tidyr (>= 0.3.1), stringr (>= 1.0), stringi, xml2 Collate: 'S4-utils.R' 'classes.R' 'add_basic_meta.R' 'add_characters.R' 'add_meta.R' 'add_namespaces.R' 'nexmlTree.R' 'add_trees.R' 'character_classes.R' 'concatenate_nexml.R' 'constructors.R' 'deprecated.R' 'get_basic_metadata.R' 'get_characters.R' 'get_level.R' 'get_metadata.R' 'get_namespaces.R' 'get_rdf.R' 'get_taxa.R' 'get_taxa_meta.R' 'get_trees.R' 'internal_get_node_maps.R' 'internal_isEmpty.R' 'internal_name_by_id.R' 'internal_nexml_id.R' 'meta.R' 'nexml_add.R' 'nexml_get.R' 'nexml_methods.R' 'nexml_publish.R' 'nexml_read.R' 'nexml_validate.R' 'nexml_write.R' 'prefixed-uris.R' 'simmap.R' 'taxize_nexml.R' 'tbl_df.R' 'utils.R' RoxygenNote: 7.0.2 X-schema.org-applicationCategory: Data Publication X-schema.org-keywords: metadata, nexml, phylogenetics, linked-data X-schema.org-isPartOf: https://ropensci.org Language: en-US Encoding: UTF-8 NeedsCompilation: no Packaged: 2020-01-28 23:30:20 UTC; cboettig Author: Carl Boettiger [cre, aut] (), Scott Chamberlain [aut] (), Hilmar Lapp [aut] (), Kseniia Shumelchyk [aut], Rutger Vos [aut] () Maintainer: Carl Boettiger Repository: CRAN Date/Publication: 2020-01-29 09:20:05 UTC RNeXML/build/0000755000176200001440000000000013614142014012412 5ustar liggesusersRNeXML/build/vignette.rds0000644000176200001440000000051113614142014014746 0ustar liggesusersRAO0퀡K;?03L'kNjhAaM_}}/l\L@X[3BN SI""Is 9zLFaϏ1łx)~|~3z%K)fy %"JxK3\$QivFX") expect_equivalent(metavals["dcterms:modified"], "2012-04-01") ## Clean up unlink("test.xml") }) test_that("We can serialize parsed NeXML to S4 RNeXML into valid NeXML",{ ## tests are too slow for CRAN skip_on_cran() root <- xmlRoot(xmlParse(system.file("examples", "trees.xml", package="RNeXML"))) tree <- as(root, "nexml") nexml_write(tree, file="test.xml") ## validate expect_true_or_null(nexml_validate("test.xml")) ## Clean up unlink("test.xml") }) test_that("We can correctly serialize XML literals as metadata", { ## tests are too slow for CRAN skip_on_cran() nex1 <- read.nexml(system.file("examples", "phenex.xml", package="RNeXML")) m_xml1 <- get_metadata(nex1, "characters/format/states/state") %>% dplyr::filter(property == "ps:describesPhenotype") # write it out and then read it back in write.nexml(nex1, file="test.xml") expect_true_or_null(nexml_validate("test.xml")) nex2 <- read.nexml("test.xml") m_xml2 <- get_metadata(nex2, "characters/format/states/state") %>% dplyr::filter(property == "ps:describesPhenotype") # the XML literals in the form of string values should be the same testthat::expect_true(all(dplyr::arrange(m_xml1, state)[,"content"] == dplyr::arrange(m_xml2, state)[,"content"])) ## clean up unlink("test.xml") }) test_that("we can serialize NeXML with rootedge to a valid NeXML file", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "coal.xml", package = "RNeXML") nex <- read.nexml(f) write.nexml(nex, file = "test.xml") expect_true_or_null(nexml_validate("test.xml")) unlink("test.xml") }) RNeXML/tests/testthat/test_comp_analysis.R0000644000176200001440000000142413614123523020345 0ustar liggesuserscontext("Comparative analysis") test_that("We can extract tree and trait data to run fitContinuous and fitDiscrete", { skip_if_not_installed("geiger") ## tests are too slow for CRAN skip_on_cran() nexml <- read.nexml(system.file("examples", "comp_analysis.xml", package="RNeXML")) traits <- get_characters(nexml) tree <- get_trees(nexml) expect_is(tree, "phylo") }) test_that("We can serialize tree and trait data for a comparative analysis", { ## tests are too slow for CRAN skip_on_cran() skip_if_not_installed("geiger") require("geiger") data(geospiza) add_trees(geospiza$phy) nexml <- add_characters(geospiza$dat) write.nexml(nexml, file = "geospiza.xml") expect_true_or_null(nexml_validate("geospiza.xml")) unlink("geospiza.xml") }) RNeXML/tests/testthat/test_rdf.R0000644000176200001440000000334213552353762016273 0ustar liggesuserscontext("rdf") test_that("we can extract rdf-xml", { skip_if_not_installed("rdflib") skip_if_not_installed("xslt") skip_on_os("solaris") rdf <- get_rdf(system.file("examples/primates.xml", package="RNeXML")) tmp <- tempfile() # so we must write the XML out first xml2::write_xml(rdf, tmp) graph <- rdflib::rdf_parse(tmp) expect_is(graph, "rdf") rdflib::rdf_free(graph) }) test_that("we can parse nested meta with blank nodes", { skip_if_not_installed("rdflib") skip_if_not_installed("xslt") skip_on_os("solaris") f <- system.file("examples", "meta_example.xml", package="RNeXML") nex <- read.nexml(f) tmp <- tempfile() xml2::write_xml(get_rdf(f), tmp) triples <- rdflib::rdf_parse(tmp) ## Check the blank node df <- rdflib::rdf_query(triples, "SELECT ?s ?p ?o WHERE { ?s ?source . ?source ?p ?o }") testthat::expect_equal(dim(df), c(3,3)) }) test_that("we can perform sparql queries with rdf", { skip_if_not_installed("rdflib") skip_if_not_installed("xslt") # skip_on_travis() skip_on_os("solaris") rdf <- get_rdf(system.file("examples/primates.xml", package="RNeXML")) tmp <- tempfile() # so we must write the XML out first xml2::write_xml(rdf, tmp) graph <- rdflib::rdf_parse(tmp) root <- rdflib::rdf_query(graph, "SELECT ?uri WHERE { ?id . ?id ?uri }") expect_is(root, "data.frame") rdflib::rdf_free(graph) }) RNeXML/tests/testthat/test_publish.R0000644000176200001440000000421313552353762017164 0ustar liggesuserscontext("publish") if(0){ # skip publishing tests. These were all still passing at last check, but rfigshare configuration for testing is not ideal. # This loads the rOpenSci figshare sandbox credentials, so that the example # can run automatically during check and install. Unlike normal figshare accounts, # data loaded to this testing sandbox is periodically purged. library(rfigshare) status <- try(fs_auth(token = "xdBjcKOiunwjiovwkfTF2QjGhROeLMw0y0nSCSgvg3YQxdBjcKOiunwjiovwkfTF2Q", token_secret = "4mdM3pfekNGO16X4hsvZdg")) if(is(status, "try-error") || (is(status, "response") && status$status_code != 200)){ warning("Could not authenticate figshare, skipping figshare tests") } else { ## Create example file library(geiger) data(geospiza) geiger_nex <- add_trees(geospiza$phy) geiger_nex <- add_characters(geospiza$dat, geiger_nex) geiger_nex <- add_basic_meta( title = "Geospiza phylogeny with character data rendered as NeXML", creator = "Carl Boettiger", description = "This example NeXML file was created using the data originally provided in the geiger package for R to illustrate how this data can be stored, shared and distributed as NeXML.", citation = citation("geiger"), nexml = geiger_nex) test_that("We can publish to figshare", { ## Publish id <- nexml_publish(geiger_nex, visibility="public", repo="figshare") ## Download and parse publication ## Note that at present, only public files can be automatically downloaded from figshare library(rfigshare) test_nex <- nexml_read(fs_download(id)) ## Extract and compare metadata from upload and download m <- get_metadata(geiger_nex) test_m <- get_metadata(test_nex) expect_equal(m["dc:title"], test_m["dc:title"]) expect_equal(m["dc:description"], test_m["dc:description"]) ## Check that DOI resolves -- doesn't for the test account #library(httr) #page <- GET(test_m[["dc:identifier"]]) #expect_equal(page$status_code, 200) # Check that we avoid repeated metadata entries expect_equal(sum(match(names(test_m), "dc:pubdate"), na.rm=TRUE), 1) expect_equal(sum(match(names(test_m), "cc:license"), na.rm=TRUE), 1) }) } } RNeXML/tests/testthat/conversions.R0000644000176200001440000001375513552353762017042 0ustar liggesusers## Note: these tests do not run in the typical test suite process as the file name ## doesn't start with "test-" # nms <- c("S100","S1000","S10000","S10001","S10005","S10006","S10007","S10009","S10014","S10018","S10301","S1044","S10500","S10636","S1064","S1073","S10774","S1207","S13135","S1452","S938","S9981","S999") # nexml_files <- lapply(nms, function(x) content(GET(sprintf("https://raw.github.com/rvosa/supertreebase/master/data/treebase/%s.xml",x)), as="text")) # save(nexml_files, file="~/github/ropensci/RNeXML_testfiles/nexml_files.rda") load("~/github/ropensci/RNeXML_testfiles/nexml_files.rda") context("nexml files parse correctly") test_that("nexml files parse correctly", { expect_is(nexml_read(nexml_files[[1]]), "multiPhylo") expect_is(nexml_read(nexml_files[[2]]), "phylo") expect_is(nexml_read(nexml_files[[3]]), "list") expect_is(nexml_read(nexml_files[[4]]), "phylo") expect_is(nexml_read(nexml_files[[5]]), "list") expect_is(nexml_read(nexml_files[[6]]), "list") expect_is(nexml_read(nexml_files[[7]]), "phylo") expect_is(nexml_read(nexml_files[[8]]), "list") expect_is(nexml_read(nexml_files[[9]]), "list") expect_is(nexml_read(nexml_files[[10]]), "phylo") expect_is(nexml_read(nexml_files[[11]]), "list") expect_is(nexml_read(nexml_files[[12]]), "list") expect_is(nexml_read(nexml_files[[13]]), "phylo") expect_is(nexml_read(nexml_files[[14]]), "phylo") expect_is(nexml_read(nexml_files[[15]]), "phylo") expect_is(nexml_read(nexml_files[[16]]), "list") expect_is(nexml_read(nexml_files[[17]]), "list") expect_is(nexml_read(nexml_files[[18]]), "phylo") expect_is(nexml_read(nexml_files[[19]]), "phylo") expect_is(nexml_read(nexml_files[[20]]), "list") expect_is(nexml_read(nexml_files[[21]]), "phylo") expect_is(nexml_read(nexml_files[[22]]), "list") expect_is(nexml_read(nexml_files[[23]]), "multiPhylo") }) # puma <- search_treebase('"Puma"', by="taxon") # save(puma, file="~/github/ropensci/RNeXML_testfiles/puma.rda") # ursus <- search_treebase('"Ursus"', by="taxon") # save(ursus, file="~/github/ropensci/RNeXML_testfiles/ursus.rda") # quercus <- search_treebase('"Quercus"', by="taxon") # save(quercus, file="~/github/ropensci/RNeXML_testfiles/quercus.rda") load(file="~/github/ropensci/RNeXML_testfiles/puma.rda") load(file="~/github/ropensci/RNeXML_testfiles/ursus.rda") load(file="~/github/ropensci/RNeXML_testfiles/quercus.rda") context("ape files convert to class nexml correctly") test_that("ape files convert to class nexml correctly", { expect_that(as(puma[[1]], "nexml"), is_a("nexml")) expect_that(as(puma[[2]], "nexml"), is_a("nexml")) expect_that(as(puma[[3]], "nexml"), is_a("nexml")) expect_that(as(puma[[5]], "nexml"), is_a("nexml")) expect_that(as(puma[[7]], "nexml"), is_a("nexml")) expect_that(as(puma[[9]], "nexml"), is_a("nexml")) expect_that(as(puma[[11]], "nexml"), is_a("nexml")) expect_that(as(ursus[[1]], "nexml"), is_a("nexml")) expect_that(as(ursus[[2]], "nexml"), is_a("nexml")) expect_that(as(ursus[[3]], "nexml"), is_a("nexml")) expect_that(as(ursus[[5]], "nexml"), is_a("nexml")) expect_that(as(ursus[[7]], "nexml"), is_a("nexml")) expect_that(as(ursus[[9]], "nexml"), is_a("nexml")) expect_that(as(ursus[[11]], "nexml"), is_a("nexml")) expect_that(as(ursus[[13]], "nexml"), is_a("nexml")) expect_that(as(ursus[[15]], "nexml"), is_a("nexml")) expect_that(as(ursus[[18]], "nexml"), is_a("nexml")) expect_that(as(ursus[[22]], "nexml"), is_a("nexml")) expect_that(as(ursus[[27]], "nexml"), is_a("nexml")) expect_that(as(ursus[[30]], "nexml"), is_a("nexml")) expect_that(as(ursus[[33]], "nexml"), is_a("nexml")) expect_that(as(quercus[[1]], "nexml"), is_a("nexml")) expect_that(as(quercus[[2]], "nexml"), is_a("nexml")) expect_that(as(quercus[[3]], "nexml"), is_a("nexml")) expect_that(as(quercus[[5]], "nexml"), is_a("nexml")) expect_that(as(quercus[[7]], "nexml"), is_a("nexml")) expect_that(as(quercus[[9]], "nexml"), is_a("nexml")) expect_that(as(quercus[[11]], "nexml"), is_a("nexml")) expect_that(as(quercus[[20]], "nexml"), is_a("nexml")) expect_that(as(quercus[[30]], "nexml"), is_a("nexml")) expect_that(as(quercus[[40]], "nexml"), is_a("nexml")) expect_that(as(quercus[[50]], "nexml"), is_a("nexml")) expect_that(as(quercus[[70]], "nexml"), is_a("nexml")) expect_that(as(quercus[[90]], "nexml"), is_a("nexml")) expect_that(as(quercus[[92]], "nexml"), is_a("nexml")) }) context("ape files write to nexml files correctly") test_that("ape files write to nexml files correctly, set 1", { nexml_write(puma[[1]], "one.xml") nexml_write(puma[[5]], "two.xml") nexml_write(puma[[9]], "three.xml") expect_is(nexml_read("~/one.xml"), "phylo") expect_is(nexml_read("~/two.xml"), "phylo") expect_is(nexml_read("~/three.xml"), "phylo") }) test_that("ape files write to nexml files correctly, set 2", { nexml_write(ursus[[1]], "one_u.xml") nexml_write(ursus[[5]], "two_u.xml") nexml_write(ursus[[9]], "three_u.xml") nexml_write(ursus[[1]], "four_u.xml") nexml_write(ursus[[5]], "five_u.xml") nexml_write(ursus[[9]], "six_u.xml") expect_is(nexml_read("~/one_u.xml"), "phylo") expect_is(nexml_read("~/two_u.xml"), "phylo") expect_is(nexml_read("~/three_u.xml"), "phylo") expect_is(nexml_read("~/four_u.xml"), "phylo") expect_is(nexml_read("~/five_u.xml"), "phylo") expect_is(nexml_read("~/six_u.xml"), "phylo") }) test_that("ape files write to nexml files correctly, set 3", { nexml_write(quercus[[1]], "one_q.xml") nexml_write(quercus[[5]], "two_q.xml") nexml_write(quercus[[9]], "three_q.xml") nexml_write(quercus[[1]], "four_q.xml") nexml_write(quercus[[5]], "five_q.xml") nexml_write(quercus[[9]], "six_q.xml") expect_is(as(nexml_read("~/one_q.xml"), "phylo"), "phylo") expect_is(as(nexml_read("~/two_q.xml"), "phylo"), "phylo") expect_is(as(nexml_read("~/three_q.xml"), "phylo"), "phylo") expect_is(as(nexml_read("~/four_q.xml"), "phylo"), "phylo") expect_is(as(nexml_read("~/five_q.xml"), "phylo"), "phylo") expect_is(as(nexml_read("~/six_q.xml"), "phylo"), "phylo") }) RNeXML/tests/testthat/test_ape.R0000644000176200001440000000727613614136450016267 0ustar liggesuserscontext("ape") test_that("From ape::phylo to RNeXML::nexml object", { ## tests are too slow for CRAN skip_on_cran() data(bird.orders) expect_is(as(bird.orders, "nexml"), class="nexml") }) test_that("We can go from various orderings of ape::phylo to RNeXML::nexml", { ## tests are too slow for CRAN skip_on_cran() data(bird.orders) nexml <- as(bird.orders, "nexml") phy <- as(nexml, "phylo") ## Demonstrate that we now have a phylo object p <- plot(phy) expect_that(plot(phy), is_a("list")) expect_that(phy, is_a("phylo")) }) test_that("From nexml to multiPhylo", { ## tests are too slow for CRAN skip_on_cran() # part of base testing, could be replaced with higher level, but why f <- system.file("examples", "trees.xml", package="RNeXML") doc <- xmlParse(f) root <- xmlRoot(doc) nexml <- as(root, "nexml") ## parse the XML into S4 ## APE TEST: Coerce the S4 into phylo S3 object expect_warning(phy <- as(nexml, "phylo"), "Multiple trees found, Returning multiPhylo object") expect_is(phy, "multiPhylo") }) ## This unit test is really not testing ape functions but just the higher-level nexml_write function... test_that("We can serialize the various versions of the ape format", { ## tests are too slow for CRAN skip_on_cran() data(bird.orders) nexml <- as(bird.orders, "nexml") nexml_write(nexml, file = "test.xml") expect_true_or_null(nexml_validate("test.xml")) unlink("test.xml") }) test_that("We can read and write NeXML to phylo and back without edge.lengths", { ## tests are too slow for CRAN skip_on_cran() s <- "owls(((Strix_aluco,Asio_otus),Athene_noctua),Tyto_alba);" cat(s, file = "ex.tre", sep = "\n") owls <- read.tree("ex.tre") nexml_write(owls, file = "ex.xml") owls2 <- as(nexml_read("ex.xml"), "phylo") expect_equal(owls, owls2) ## FIXME what? unlink("ex.tre") unlink("ex.xml") }) test_that("Rooted trees remain rooted on conversions", { ## tests are too slow for CRAN skip_on_cran() expect_true(is.rooted(bird.orders)) expect_true(is.rooted(as(as(bird.orders, "nexml"), "phylo"))) write.nexml(bird.orders, file = "tmp.xml") expect_true(is.rooted(as(read.nexml("tmp.xml"), "phylo"))) unlink("tmp.xml") }) test_that("Unrooted trees remain unrooted on conversions", { ## tests are too slow for CRAN skip_on_cran() phy <- unroot(bird.orders) expect_false(is.rooted(phy)) expect_false(is.rooted(as(as(phy, "nexml"), "phylo"))) write.nexml(phy, file = "tmp.xml") expect_false(is.rooted(as(read.nexml("tmp.xml"), "phylo"))) unlink("tmp.xml") }) test_that("We can convert trees with only some edge lengths into ape::phylo", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "some_missing_branchlengths.xml", package="RNeXML") expect_warning(a <- as(read.nexml(f), "phylo"), "Multiple trees found, Returning multiPhylo object") # We can parse it, goodness knows what anyone will do with it. Better to hack off the branch lengths or convert to 0, but that's for the user. }) test_that("NeXML with rootedge can be converted to ape::phylo", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "coal.xml", package = "RNeXML") nex <- read.nexml(f) tr <- nex@trees[[1]]@tree[[1]] phy <- as(nex, "phylo") testthat::expect_equal(Nnode(phy) + Ntip(phy), length(tr@node) + 1) testthat::expect_equal(Nedge(phy), length(tr@edge) + 1) newick <- write.tree(phy) testthat::expect_true(startsWith(newick, "((")) testthat::expect_true(grepl('):[0-9.]+);$', newick)) }) RNeXML/tests/testthat/test_01_utils.R0000644000176200001440000001724013552353762017162 0ustar liggesuserscontext("internal utility functions") test_that("lcapply() works correctly", { l <- list(a = "foo", b = "bar", c = NULL, NULL, "baz", d = "foobar") l.ans1 <- lapply(l, function(x) x) l.ans2 <- lcapply(l, function(x) x) testthat::expect_length(l.ans1, length(l)) testthat::expect_length(l.ans2, length(l) - 2) testthat::expect_equal(names(l.ans1), names(l)) testthat::expect_equal(names(l.ans2), names(l[c(1,2,5,6)])) testthat::expect_false("c" %in% names(l.ans2)) testthat::expect_true("" %in% names(l.ans2)) testthat::expect_equal(l.ans2[names(l.ans2) == ""][[1]], "baz") }) test_that("findNextMethod() works correctly", { pkgEnv <- asNamespace("RNeXML") mdef <- selectMethod("toNeXML", c("trees", "XMLInternalElementNode"), optional = TRUE) testthat::expect_is(mdef, "MethodDefinition") mdef.next <- findNextMethod(mdef, envir = pkgEnv) testthat::expect_is(mdef.next, "MethodDefinition") testthat::expect_equal(mdef@defined, mdef.next@target) testthat::expect_equal(mdef@generic, mdef.next@generic) o.mm <- new(className(mdef@defined@.Data[1], mdef@defined@package[1])) testthat::expect_true(is(o.mm, mdef.next@defined@.Data[1])) mwn1 <- .methodWithNext(method = mdef, nextMethod = mdef.next) mwn2 <- addNextMethod(mdef, f = mdef@generic, envir = pkgEnv) testthat::expect_is(mwn1, "MethodWithNext") testthat::expect_is(mwn1@nextMethod, "MethodDefinition") testthat::expect_equal(mwn1@generic, mwn2@generic) testthat::expect_equal(mwn1@target, mwn2@target) testthat::expect_equal(mwn1@defined, mwn2@defined) testthat::expect_equal(mwn1@excluded, mwn2@excluded) testthat::expect_equal(mwn1@nextMethod@generic, mwn2@nextMethod@generic) testthat::expect_equal(mwn1@nextMethod@.Data, mwn2@nextMethod@.Data) # ignore attributes for the following two - package is in its own slot # of the signature object anyway, which will be part of the test testthat::expect_equivalent(mwn1@nextMethod@target, mwn2@nextMethod@target) testthat::expect_equivalent(mwn1@nextMethod@defined, mwn2@nextMethod@defined) }) test_that(".classForSig() works correctly", { f1 <- getGeneric("toNeXML", package = "RNeXML") f2 <- getGeneric("fromNeXML", package = "RNeXML") obj <- nexml.tree() testthat::expect_equal(.classForSig(obj, f1), class(obj)[1]) testthat::expect_equal(.classForSig(obj, f2), class(obj)[1]) obj <- XML::newXMLNode("foo") testthat::expect_equal(.classForSig(obj, f1), "XMLInternalElementNode") testthat::expect_equal(.classForSig(obj, f2), "XMLInternalElementNode") class(obj) <- c("bogus", class(obj)) testthat::expect_equal(.classForSig(obj, f1), class(obj)[2]) testthat::expect_equal(.classForSig(obj, f2), class(obj)[1]) }) test_that(".callGeneric works correctly", { tr1 <- nexml.tree(id = "tr1", node = New("ListOfnode", list(New("node", id = "n1")))) trblock <- New("trees", id = "trees1", tree = New("ListOftree", list(tr1))) xml1 <- as(trblock, "XMLInternalNode") xml2 <- .callGeneric("toNeXML", trblock, XML::newXMLNode("trees"), .package = "RNeXML") xml3 <- toNeXML(trblock, XML::newXMLNode("trees")) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml2, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml3, indent = FALSE)) nexml1 <- as(xml1, "trees") nexml2 <- .callGeneric("fromNeXML", New("trees"), xml1, .package = "RNeXML") nexml3 <- fromNeXML(New("trees"), xml1) # roundtrip back to XML, using "as" xml1.1 <- as(nexml1, "XMLInternalNode") xml1.2 <- as(nexml2, "XMLInternalNode") xml1.3 <- as(nexml3, "XMLInternalNode") testthat::expect_equal(XML::saveXML(xml1.1, indent = FALSE), XML::saveXML(xml1.2, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1.1, indent = FALSE), XML::saveXML(xml1.3, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml1.1, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml1.2, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml1.3, indent = FALSE)) # roundtrip back to XML, using .callGeneric xml1.1 <- .callGeneric("toNeXML", nexml1, XML::newXMLNode("trees"), .package = "RNeXML") xml1.2 <- .callGeneric("toNeXML", nexml2, XML::newXMLNode("trees"), .package = "RNeXML") xml1.3 <- .callGeneric("toNeXML", nexml3, XML::newXMLNode("trees"), .package = "RNeXML") testthat::expect_equal(XML::saveXML(xml1.1, indent = FALSE), XML::saveXML(xml1.2, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1.1, indent = FALSE), XML::saveXML(xml1.3, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml1.1, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml1.2, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml1.3, indent = FALSE)) # roundtrip back to XML, using toNeXML generic dispatch xml1.1 <- toNeXML(nexml1, XML::newXMLNode("trees")) xml1.2 <- toNeXML(nexml2, XML::newXMLNode("trees")) xml1.3 <- toNeXML(nexml3, XML::newXMLNode("trees")) testthat::expect_equal(XML::saveXML(xml1.1, indent = FALSE), XML::saveXML(xml1.2, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1.1, indent = FALSE), XML::saveXML(xml1.3, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml1.1, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml1.2, indent = FALSE)) testthat::expect_equal(XML::saveXML(xml1, indent = FALSE), XML::saveXML(xml1.3, indent = FALSE)) }) test_that("coalesce_() works correctly", { dta <- data.frame(col1 = rep(NA, times = 5), col2 = 1:5, col3 = letters[1:5]) dta[3:4, "col2"] <- NA dta[2:3, "col3"] <- NA last <- letters[6:10] # let's start off with some tests for the presence of the problems that # coalesce_ is trying to solve, because in their absence we won't need it # # (1) dplyr::coalesce is strict about type, and for some reason vectors # that are all NAs default to type logical testthat::expect_is(dta[, "col1"], "logical") testthat::expect_error(dplyr::coalesce(dta$col1, dta$col3, last)) testthat::expect_error(dplyr::coalesce(dta$col3, last)) # col3 is a factor # (2) dplyr::coalesce doesn't gracefully deal with NULL arguments, which # can result from referencing column names that aren't there, requiring # a conditional testing for presence of the column testthat::expect_error(dplyr::coalesce(dta$col2, dta$foo, last)) # now test that coalesce_ deals with these issues and gives correct results res <- ifelse(is.na(dta[,"col3"]), last, as.character(dta[,"col3"])) testthat::expect_is(coalesce_(dta$col1, dta$col3, last), "character") testthat::expect_false(any(is.na(coalesce_(dta$col1, dta$col3, last)))) testthat::expect_equal(coalesce_(dta$col1, dta$col3, last), res) testthat::expect_equal(coalesce_(dta$col1, dta$col3, dta$foo, last), res) testthat::expect_equal(coalesce_(dta$col1, dta$col3, NULL, last), res) testthat::expect_is(coalesce_(dta$col1, dta$col2), "integer") testthat::expect_equal(sum(is.na(coalesce_(dta$col1, dta$col2))), 2) testthat::expect_false(any(is.na(coalesce_(dta$col1, dta$col2, 1:5)))) }) RNeXML/tests/testthat/test_nexml_read.R0000644000176200001440000000227513552353762017642 0ustar liggesuserscontext("read nexml") f <- system.file("examples", "trees.xml", package = "RNeXML") url <- "https://raw.githubusercontent.com/ropensci/RNeXML/master/inst/examples/trees.xml" test_that("we can read nexml from a file path", { nex <- nexml_read(f) expect_is(nex, "nexml") expect_equal(nex@trees@names, "trees") }) test_that("we can read nexml from a url", { nex <- read.nexml(url) expect_is(nex, "nexml") expect_equal(nex@trees@names, "trees") }) test_that("we can read nexml from a character string of xml", { str <- paste0(readLines(f), collapse = "") nex <- nexml_read(str) expect_is(nex, "nexml") expect_equal(nex@trees@names, "trees") }) test_that("we can read nexml from a XMLInternalDocument object", { library("XML") x <- xmlParse(f) nex <- nexml_read(x) expect_is(nex, "nexml") expect_equal(nex@trees@names, "trees") }) test_that("we can read nexml from a XMLInternalNode object", { library("XML") x <- xmlParse(f) nex <- nexml_read(xmlRoot(x)) expect_is(nex, "nexml") expect_equal(nex@trees@names, "trees") }) test_that("alias for nexml_read works", { nex <- read.nexml(f) expect_is(nex, "nexml") expect_equal(nex@trees@names, "trees") }) RNeXML/tests/testthat/test_parsing.R0000644000176200001440000000622713614124040017150 0ustar liggesuserscontext("parsing") # More lower-level parsing tests in inheritance test_that("We can parse a NeXML file to an S4 RNeXML::tree object", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "trees.xml", package="RNeXML") doc <- xmlParse(f) root <- xmlRoot(doc) nexml <- as(root, "nexml") ## parse the XML into S4 expect_is(nexml,"nexml") }) test_that("We preserve existing namespace", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "biophylo.xml", package="RNeXML") nex <- nexml_read(f) expect_gt(length(get_namespaces(nex)), length(get_namespaces(nexml()))) ## Check that the new abbreviations are added expect_true(all(c("concept", "map") %in% names(get_namespaces(nex)))) g <- tempfile() nexml_write(nex, g) expect_true_or_null(nexml_validate(g)) nex2 <- nexml_read(g) ## check the namespaces remain there expect_gt(length(get_namespaces(nex2)), length(get_namespaces(nexml()))) ## Check that the new abbreviations are added expect_true(all(c("concept", "map") %in% names(get_namespaces(nex2)))) expect_equal(get_namespaces(nex2)["concept"], get_namespaces(nex)["concept"]) expect_equal(get_namespaces(nex2)["map"], get_namespaces(nex)["map"]) f <- system.file("examples", "phenoscape.xml", package = "RNeXML") nex <- nexml_read(f) # check that the cdao namespace didn't get clobbered expect_true("cdao" %in% names(get_namespaces(nex))) expect_equivalent(get_namespaces(nex)["cdao"], "http://www.evolutionaryontology.org/cdao/1.0/cdao.owl#") expect_true(get_namespaces(nex)["cdao"] != get_namespaces(nexml())["cdao"]) }) test_that("base namespace gets added if not present", { ## tests are too slow for CRAN skip_on_cran() doc <- xmlParse(system.file("examples", "no-base-ns.xml", package="RNeXML")) xmlroot <- xmlRoot(doc) prefixes <- names(xmlNamespaceDefinitions(doc)) expect_false(any(prefixes == "")) nex <- nexml_read(doc) expect_true(any(names(get_namespaces(nex)) == "")) expect_equal(expand_prefix("/nexml", get_namespaces(nex)), expand_prefix("/nexml", get_namespaces(nexml()))) expect_equal(expand_prefix("nexml", get_namespaces(nex)), expand_prefix("nex:nexml", get_namespaces(nex))) }) test_that("files with rootedge can be parsed and roundtripped", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "coal.xml", package = "RNeXML") nex <- read.nexml(f) tr <- nex@trees[[1]]@tree[[1]] testthat::expect_true(length(tr@rootedge@target) > 0 && nchar(tr@rootedge@target) > 0) testthat::expect_equal(sum(sapply(tr@node, slot, "id") == tr@rootedge@target), 1) xmlOut <- as(nex, "XMLInternalNode") nex2 <- read.nexml(xmlOut) tr2 <- nex2@trees[[1]]@tree[[1]] testthat::expect_true(length(tr2@rootedge@target) > 0 && nchar(tr2@rootedge@target) > 0) testthat::expect_equal(sum(sapply(tr2@node, slot, "id") == tr2@rootedge@target), 1) testthat::expect_equal(sum(sapply(tr2@node, slot, "id") == tr@rootedge@target), 1) testthat::expect_equal(saveXML(as(tr, "XMLInternalNode")), saveXML(as(tr2, "XMLInternalNode"))) }) RNeXML/tests/testthat/test_simmap.R0000644000176200001440000000202113552353762016777 0ustar liggesuserscontext("simmap") ## Make a simmap tree test_that("we can coerce an ape::phylo tree with a phytools:simmap extension into nexml", { skip_if_not_installed("phytools") require("phytools") set.seed(10) tree <- rbdtree(b = log(50), d = 0, Tmax = .5) Q <- matrix(c(-2, 1, 1, 1, -2 ,1 ,1, 1, -2), 3, 3) rownames(Q) <- colnames(Q) <- c("A", "B", "C") ## Note that state symbols must be integers! factors will be converted mtree <- sim.history(tree, Q) cols <- c("red", "blue", "green") names(cols) <- rownames(Q) nex <- simmap_to_nexml(mtree) expect_is(nex, "nexml") phy <- nexml_to_simmap(nex) orig <- plotSimmap(mtree,cols,ftype="off") roundtrip <- plotSimmap(phy,cols,ftype="off") # checks that the edge mappings are correct expect_equal(mtree$maps, phy$maps) orig <- as.integer(as.factor(mtree$states[sort(names(mtree$states))])) converted <- as.integer(phy$states[sort(names(phy$states))]) # checks that we got the states slot correct expect_equal(converted, orig) }) RNeXML/tests/testthat/geiger_test.R0000644000176200001440000000362013552353762016761 0ustar liggesuserscontext("Geiger tests (may take 15+ minutes)") has_geiger <- require(geiger) test_that("We can write caudata data to nexml", { skip_if_not(has_geiger) data(caudata) nexml_write(trees = caudata$phy, characters = caudata$dat, file="tmp.xml") expect_true_or_null(nexml_validate("tmp.xml")) unlink("tmp.xml") # cleanup }) test_that("We can write geospiza data to nexml", { skip_if_not(has_geiger) data(geospiza) nexml_write(trees = geospiza$phy, characters = geospiza$dat, file="tmp.xml") expect_true_or_null(nexml_validate("tmp.xml")) unlink("tmp.xml") # cleanup }) test_that("We can write chelonia data to nexml", { skip_if_not(has_geiger) data(chelonia) nexml_write(trees = chelonia$phy, characters = chelonia$dat, file="tmp.xml") expect_true_or_null(nexml_validate("tmp.xml")) unlink("tmp.xml") # cleanup }) test_that("We can write primates data to nexml", { skip_if_not(has_geiger) data(primates) nexml_write(trees = primates$phy, characters = primates$dat, file="tmp.xml") expect_true_or_null(nexml_validate("tmp.xml")) unlink("tmp.xml") # cleanup }) test_that("We can write whales data to nexml", { skip_if_not(has_geiger) data(whales) # taxa need to be rownames not separate column whales$dat <- whales$richness[[2]] names(whales$dat) <- whales$richness[[1]] nexml_write(trees = whales$phy, characters = whales$dat, file="tmp.xml") expect_true_or_null(nexml_validate("tmp.xml")) unlink("tmp.xml") # cleanup }) test_that("We can write amphibia multiphylo to nexml. Two of these phylogenies each have nearly 3K taxa, so this may take around 12 minutes", { # multiphylo, where two phylogenies have each nearly 3K taxa skip_if_not(has_geiger) data(amphibia) class(amphibia) <- "multiPhylo" runtime <- system.time(nexml_write(amphibia, file="tmp.xml")) # Slow! about 12 minutes expect_true_or_null(nexml_validate("tmp.xml")) unlink("tmp.xml") # cleanup }) RNeXML/tests/testthat/test_concatenate.R0000644000176200001440000001062413552353762020005 0ustar liggesuserscontext("concatenate method") test_that("we can concatenate two files with unique ids", { f1 <- system.file("examples", "trees.xml", package="RNeXML") f2 <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex1 <- read.nexml(f1) nex2 <- read.nexml(f2) expect_is(c(nex1, nex2), "nexml") }) test_that("we get an error if the files to be concatenated have non-unique ids", { f1 <- system.file("examples", "trees.xml", package="RNeXML") nex1 <- read.nexml(f1) nex2 <- read.nexml(f1) expect_error(c(nex1, nex2),"ids are not unique") }) test_that("we can concatenate meta elements", { out <- c(meta(content="example", property="dc:title"), meta(content="Carl", property="dc:creator")) expect_is(out, "ListOfmeta") expect_is(out[[1]], "meta") }) test_that("we can conatenate meta elements with empty ListOfmeta elements", { ## Doesn't trigger our method if x is not class `meta` out <- c(new("ListOfmeta"), meta(content="example", property="dc:title"), meta(content="Carl", property="dc:creator")) expect_is(out, "ListOfmeta") expect_length(out, 2) expect_true(all(sapply(out, is, "meta"))) ## in any order out <- c(meta(content="example", property="dc:title"), meta(content="Carl", property="dc:creator"), new("ListOfmeta")) expect_is(out, "ListOfmeta") expect_length(out, 2) expect_true(all(sapply(out, is, "meta"))) }) test_that("we can conatenate meta elements with ListOfmeta elements", { out <- c(meta(content="example", property="dc:title"), meta(content="Carl", property="dc:creator")) out <- c(out, meta("skos:note", "an editorial note")) expect_is(out, "ListOfmeta") expect_length(out, 3) expect_true(all(sapply(out, is, "meta"))) out <- c(meta("skos:note", "another editorial note"), out) expect_is(out, "ListOfmeta") expect_length(out, 4) expect_true(all(sapply(out, is, "meta"))) }) test_that("we can concatenate two ListOfmeta elements", { metalist <- c(meta(content="example", property="dc:title"), meta(content="Carl", property="dc:creator")) out <- c(metalist, metalist) expect_is(out, "ListOfmeta") expect_length(out, 4) expect_true(all(sapply(out, is, "meta"))) }) test_that("we can concatenate a ListOfmeta and a meta", { metalist <- c(meta(content="example", property="dc:title"), meta(content="Carl", property="dc:creator")) out <- c(metalist, meta(content="a", property="b")) expect_is(out, "ListOfmeta") expect_length(out, 3) expect_true(all(sapply(out, is, "meta"))) }) test_that("we can concatenate meta and ListOfmeta with ordinary lists", { m1 <- meta(content="example", property="dc:title") m2 <- meta(content="Carl", property="dc:creator") out <- c(meta(content="a", property="b"), list(m1, m2)) expect_is(out, "ListOfmeta") expect_length(out, 3) expect_true(all(sapply(out, is, "meta"))) out <- c(c(m1, m2), list(meta(content="a", property="b"))) expect_is(out, "ListOfmeta") expect_length(out, 3) expect_true(all(sapply(out, is, "meta"))) }) test_that("NULLs are removed when concatenating meta", { m1 <- meta(content="example", property="dc:title") m2 <- meta(content="Carl", property="dc:creator") out <- c(meta(content="a", property="b"), NULL, list(m1, m2)) expect_is(out, "ListOfmeta") expect_length(out, 3) expect_true(all(sapply(out, is, "meta"))) out <- c(c(m1, m2), NULL, list(meta(content="a", property="b"))) expect_is(out, "ListOfmeta") expect_length(out, 3) expect_true(all(sapply(out, is, "meta"))) }) test_that("must be list of lists, lists of meta, or meta when concatenating meta", { m1 <- meta(content="example", property="dc:title") m2 <- meta(content="Carl", property="dc:creator") expect_error(c(m1, "foo")) expect_error(c(c(m1, m2), "foo")) expect_error(c(m1, list("foo"))) expect_error(c(c(m1, m2), list("foo"))) expect_silent(out <- c(m1, list(list(list(m1), m2)))) expect_is(out, "ListOfmeta") expect_length(out, 3) expect_true(all(sapply(out, is, "meta"))) }) test_that("we can read in a file with existing meta and append without overwriting", { f <- system.file("examples", "biophylo.xml", package="RNeXML") nex <- nexml_read(f) g <- tempfile() nexml_write(nex, g) nex2 <- nexml_read(g) expect_gt(length(get_metadata(nex2)), length(get_metadata(nex))) }) RNeXML/tests/testthat/test_characters.R0000644000176200001440000000743013552353762017641 0ustar liggesuserscontext("character matrices") ## All tests will use this data file f <- system.file("examples", "comp_analysis.xml", package="RNeXML") test_that("we can parse XML to S4 and serialize S4 to XML for the basic character classes", { doc <- xmlParse(f) root <- xmlRoot(doc) char <- as(root[["characters"]][["format"]][["char"]], "char") out <- as(char, "XMLInternalElementNode") expect_is(char, "char") # not as dumb as it looks, at least we're checking our own method here expect_is(out, "XMLInternalElementNode") # dumb check, but provides a dot to show the code above executed successfully format <- as(root[["characters"]][["format"]], "format") out <- as(format, "XMLInternalElementNode") expect_is(format, "format") expect_is(out, "XMLInternalElementNode") matrix <- as(root[["characters"]][["matrix"]], "obsmatrix") out <- as(matrix, "XMLInternalElementNode") expect_is(matrix, "obsmatrix") expect_is(out, "XMLInternalElementNode") characters <- as(root[["characters"]], "characters") out <- as(characters, "XMLInternalElementNode") expect_is(characters, "characters") expect_is(out, "XMLInternalElementNode") }) test_that("we can actually parse NeXML files containing character data", { nex <- read.nexml(f) expect_is(nex, "nexml") }) ## Now that we tested this, store the result so we can use it in later tests nex <- read.nexml(f) ### BEGIN *DO NOT MODIFY nex OBJECT* ### ### ### test_that("we can extract character matrix with get_characters", { x <- get_characters(nex) expect_is(x, "data.frame") ## FIXME add additional and more precise expect_ checks }) test_that("we can extract a list of character matrices with get_characters_list", { x <- get_characters_list(nex) expect_is(x, "list") expect_is(x[[1]], "data.frame") ## FIXME add additional and more precise expect_ checks }) ## FIXME add_characters needs a method to add character names of states ## and then we need a test for that method test_that("we can add characters to a nexml file using a data.frame", { x <- get_characters(nex) nexml <- add_characters(x) ## Can we write it out and read it back? nexml_write(nexml, file = "chartest.xml") tmp <- nexml_read("chartest.xml") tmp_x <- get_characters(tmp) expect_is(tmp_x, "data.frame") expect_is(tmp, "nexml") unlink("chartest.xml") }) ## based on bug on 2014-03-12 65ae459523c529452adb699c3d5d118c0a207402 test_that("we can add multiple character matrices to a nexml file", { skip_if_not_installed("geiger") require(geiger) data(geospiza) data(primates) nexml <- add_characters(geospiza$dat) nexml <- add_characters(primates$dat, nexml) expect_is(nexml, "nexml") }) ### ### ### END *DO NOT MODIFY nex OBJECT* ### ### ### ### Re-read nex object before using ### ### ### test_that("add_otu can append only unmatched taxa to an existing otus block", { nex <- read.nexml(f) orig <- get_taxa(nex) x <- get_characters_list(nex) nex@otus[[1]]@otu <- new("ListOfotu", nex@otus[[1]]@otu[1:5]) # chop off some of the otu values new_taxa <- rownames(x[[1]]) nex2 <- RNeXML:::add_otu(nex, new_taxa, append=TRUE) # add them back ## should have same contents as orig... get_taxa(nex2) expect_identical(sort(orig$label), sort(get_taxa(nex2)$label)) ## Note that otu ids are not unique when we chop them off ... }) test_that("we can serialize polymorphic states", { f <- system.file("examples", "ontotrace-result.xml", package="RNeXML") nex <- read.nexml(f) states <- nex@characters[[1]]@format@states[[1]] out <- as(states, "XMLInternalNode") testthat::expect_true("polymorphic_state_set" %in% names(out)) }) RNeXML/tests/testthat/test_get_level.R0000644000176200001440000000022013552353762017456 0ustar liggesuserstestthat::context("get_level") f <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex <- read.nexml(f) get_level(nex, "meta") RNeXML/tests/testthat/treebase_test.R0000644000176200001440000000250013552353762017305 0ustar liggesusers# filename does not begin with `test` so not run by `testthat::test_dir()` # This test assumes the working directory contains all the XML files provided # here: https://github.com/rvosa/supertreebase/tree/master/data/treebase files <- system("ls *.xml", intern=TRUE) print("testing parsing only") parses <- sapply(files, function(x){ out <- try(xmlParse(x)) if(is(out, "try-error")) out <- x else { free(out) out = "success" } out }) fails <- parses[parses!="success"] works <- files[parses == "success"] writeLines(fails, "unparseable.txt") print("testing parsing only") treebase <- sapply(works, function(x){ print(x) tree <- try(nexml_read(x, "nexml")) if(is(tree, "try-error")) out = "read failed:" else { tree <- try(as(tree, "phylo")) if(is(tree, "try-error")) out = "conversion failed:" else out = "success" } rm(tree) out }) save(list=ls(), file = "RNeXML_test_results.rda") table(treebase) RNeXML/tests/testthat/test_meta.R0000644000176200001440000002327213614124004016432 0ustar liggesuserscontext("meta") data(bird.orders) test_that("We can add additional metadata", { ## tests are too slow for CRAN skip_on_cran() ## The short version using an RNeXML API nex <- add_basic_meta( title = "My test title", description = "A description of my test", creator = "Carl Boettiger ", publisher = "unpublished data", pubdate = "2012-04-01") write.nexml(nex, file = "meta_example.xml") expect_true_or_null(nexml_validate("meta_example.xml")) expect_is(nexml_read("meta_example.xml"), "nexml") unlink("meta_example.xml") # cleanup }) test_that("We can add R bibentry type metadata", { ## tests are too slow for CRAN skip_on_cran() ## The short version using an RNeXML API nex <- add_trees(bird.orders) nex <- add_basic_meta(nexml=nex, citation=citation("ape")) write.nexml(nex, file = "meta_example.xml") expect_true_or_null(nexml_validate("meta_example.xml")) expect_is(nexml_read("meta_example.xml"), "nexml") unlink("meta_example.xml") # cleanup }) test_that("Adding meta data has some basic error checking", { ## tests are too slow for CRAN skip_on_cran() testthat::expect_error(add_meta(NULL, level = "nexml")) m <- meta("foo-rel", "a test") testthat::expect_error(add_meta(list(m, "not a meta"))) testthat::expect_error(add_meta(m, level = "foo")) }) test_that("ResourceMeta maps rel to property for simplicity of API", { ## tests are too slow for CRAN skip_on_cran() m <- meta(rel = "foo-rel", href="http://example.com/") testthat::expect_is(m, "ResourceMeta") testthat::expect_error(m@property) testthat::expect_equal(slot(m, "rel"), "foo-rel") testthat::expect_equal(slot(m, "property"), "foo-rel") testthat::expect_error(m@property <- "bar-rel") testthat::expect_silent(slot(m, "property") <- "bar-rel") testthat::expect_equal(slot(m, "rel"), "bar-rel") testthat::expect_equal(slot(m, "property"), "bar-rel") }) test_that("ResourceMeta maps meta to children for simplicity of API", { ## tests are too slow for CRAN skip_on_cran() nested <- c(meta(property = "foo-prop", content = "foo"), meta(property = "bar-prop", content = "bar")) m <- meta(rel = "foo-rel", children = nested) testthat::expect_is(m, "ResourceMeta") testthat::expect_error(m@meta) testthat::expect_length(m@children, 2) testthat::expect_length(slot(m, "meta"), 2) testthat::expect_equal(slot(m, "meta"), m@children) testthat::expect_equivalent(sapply(slot(m, "meta"), slot, "content"), c("foo", "bar")) m <- new("ResourceMeta", rel = "baz-rel") # meta() returns NULL if no "content" testthat::expect_length(m@children, 0) testthat::expect_error(m@meta <- nested) testthat::expect_silent(slot(m, "meta") <- nested) testthat::expect_length(slot(m, "meta"), 2) testthat::expect_equal(slot(m, "meta"), m@children) testthat::expect_equivalent(sapply(slot(m, "meta"), slot, "content"), c("foo", "bar")) }) test_that("Citation BibEntry objects are transformed to structured metadata", { ## tests are too slow for CRAN skip_on_cran() nexml_cit <- nexml_citation(citation("RNeXML")) testthat::expect_is(nexml_cit, "list") testthat::expect_length(nexml_cit, 1) citrec <- nexml_cit[[1]] testthat::expect_is(citrec, "meta") testthat::expect_true(.hasSlot(citrec, "children")) testthat::expect_gt(length(citrec@children), 10) citxml <- as(citrec, "XMLInternalNode") testthat::expect_length(XML::xmlChildren(citxml), length(citrec@children)) testthat::expect_equal(slot(citrec, "xsi:type"), "ResourceMeta") testthat::expect_false(grepl("bibliographicCitation", slot(citrec, "rel"))) propvals <- sapply(citrec@children, function(x) if (.hasSlot(x, "property")) x@property else NULL) testthat::expect_true(any(grepl("bibliographicCitation", propvals))) }) test_that("We can add additional metadata", { ## tests are too slow for CRAN skip_on_cran() ## The short version using an RNeXML API nex <- add_trees(bird.orders) nex <- add_basic_meta(nexml = nex, citation=citation("ape")) history <- meta(property = "skos:historyNote", content = "Mapped from the bird.orders data in the ape package using RNeXML", id = "meta5144") modified <- meta(property = "prism:modificationDate", content = "2013-10-04") website <- meta(href = "http://carlboettiger.info", rel = "foaf:homepage") nex <- add_meta(list(history, modified, website), nex, namespaces = c(skos = "http://www.w3.org/2004/02/skos/core#", prism = "http://prismstandard.org/namespaces/1.2/basic/", # check and remove duplicates foaf = "http://xmlns.com/foaf/0.1/")) nexml_write(nex, file = "meta_example.xml") expect_true_or_null(nexml_validate("meta_example.xml")) expect_is(nexml_read("meta_example.xml"), "nexml") unlink("meta_example.xml") # cleanup }) test_that("We can directly add additional metadata at arbitrary level", { ## tests are too slow for CRAN skip_on_cran() nex <- add_trees(bird.orders) modified <- meta(property = "prism:modificationDate", content = "2013-10-04") # For trees block, using API function nex <- add_meta(modified, nexml = nex, level = "trees") get_metadata(nex, "trees") %>% dplyr::filter(property == "prism:modificationDate") %>% dplyr::select(content) -> tmp expect_identical(tmp[[1]], modified@content) # For trees block, accessing object hierarchy directly nex@trees[[1]]@meta <- c(modified) get_metadata(nex, "trees") %>% dplyr::filter(property == "prism:modificationDate") %>% dplyr::select(content) -> tmp expect_identical(tmp[[1]], modified@content) # For otus block, using API function nex <- add_meta(modified, nexml = nex, level = "otus") get_metadata(nex, "otus") %>% dplyr::filter(property == "prism:modificationDate") %>% dplyr::select(content) -> tmp expect_identical(tmp[[1]], modified@content) # For otus block, accessing object hierarchy directly nex@otus[[1]]@meta <- c(modified) get_metadata(nex, "otus") %>% dplyr::filter(property == "prism:modificationDate") %>% dplyr::select(content) -> tmp expect_identical(tmp[[1]], modified@content) # For characters block, using API function testthat::expect_error(add_meta(modified, nexml = nex, level = "characters")) # one needs to have called add_characters() first, as otherwise there won't # be a characters block cdata <- data.frame(trait1 = c(1, 1, 0), row.names = c("Aus bus", "Aus foo", "Aus bar")) nex <- add_characters(cdata, nexml = nex) # now this should work testthat::expect_silent(nex <- add_meta(modified, nexml = nex, level = "characters")) get_metadata(nex, "characters") %>% dplyr::filter(property == "prism:modificationDate") %>% dplyr::select(content) -> tmp expect_identical(tmp[[1]], modified@content) # For otus block, accessing object hierarchy directly nex@characters[[1]]@meta <- c(modified) get_metadata(nex, "characters") %>% dplyr::filter(property == "prism:modificationDate") %>% dplyr::select(content) -> tmp expect_identical(tmp[[1]], modified@content) }) test_that("We can directly add additional metadata using concatenation notation", { ## tests are too slow for CRAN skip_on_cran() nex <- add_trees(bird.orders) modified <- meta(property = "prism:modificationDate", content = "2013-10-04") website <- meta(href = "http://carlboettiger.info", rel = "foaf:homepage") nex@trees[[1]]@meta <- c(modified) # we can add just one element nex@trees[[1]]@meta <- c(modified,website) # or more than one element get_metadata(nex, "trees") %>% dplyr::filter(property == "prism:modificationDate") %>% dplyr::select(content) -> tmp expect_identical(tmp[[1]], modified@content) }) test_that("We can add arbitrary metadata", { ## tests are too slow for CRAN skip_on_cran() rdfa <- ' twitter github ' parsed <- xmlRoot(xmlParse(rdfa)) arbitrary_rdfa <- meta(property="eml:additionalMetadata", content="additional metadata", children = parsed) nex <- add_meta(arbitrary_rdfa, namespaces = c(foaf = "http://xmlns.com/foaf/0.1/", eml = "eml://ecoinformatics.org/eml-2.1.1", xhtml = "http://www.w3.org/1999/xhtml")) nexml_write(nex, file = "example.xml") expect_is(nexml_read("example.xml", "nexml"), "nexml") unlink("example.xml") # cleanup }) test_that("we can write numeric types of meta elements and get correct datatype", { ## tests are too slow for CRAN skip_on_cran() m <- meta(property="numericTest", content = 3.141) expect_is(m@content, "character") expect_match(m@datatype, ".*:decimal") }) test_that("we can serialize nested meta elements", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "meta_example.xml", package="RNeXML") nex <- read.nexml(f) s <- nex@meta[sapply(nex@meta, function(x) ("rel" %in% slotNames(x)) && (x@rel == "dc:source"))] out <- as(s$meta, "XMLInternalNode") out_m <- sapply(xmlChildren(out), xmlAttrs) testthat::expect_equal(dim(out_m), c(3, 3)) }) RNeXML/tests/testthat/test_02_summary.R0000644000176200001440000000436713614123316017513 0ustar liggesuserstestthat::context("summary for nexml objects") test_that("summary() doesn't error on various inputs", { ## tests are too slow for CRAN skip_on_cran() files <- list.files(path = system.file("examples", package = "RNeXML"), pattern = ".*\\.xml$", full.names = TRUE) for (f in files) { doc <- XML::xmlParse(f) docType <- XML::xmlName(XML::xmlChildren(doc)[[1]]) if (docType == "nexml") { nex <- nexml_read(f) s <- summary(nex) testthat::expect_is(s, "list") testthat::expect_equal(names(s$nblocks), c("trees", "otus", "characters")) for (elem in names(s)) { if (elem == "nmeta") { testthat::expect_is(s[[elem]], "list") testthat::expect_length(s[[elem]], 4) } else { testthat::expect_true(is.integer(s[[elem]]) || is.matrix(s[[elem]])) } } testthat::expect_output(show(nex), regexp = "NeXML") } } }) test_that("summary() gives the correct counts", { nex <- nexml_read(system.file("examples", "comp_analysis.xml", package = "RNeXML")) s <- summary(nex) testthat::expect_equivalent(s$nblocks, c(1, 1, 2)) testthat::expect_true(all(is.na(s$nstates[,1]))) testthat::expect_true(all(s$nstates[,2] == 2)) testthat::expect_equivalent(s$nmatrixrows, c(10, 10)) testthat::expect_equivalent(s$notus, c(10)) nex <- nexml_read(system.file("examples", "treebase-record.xml", package = "RNeXML")) s <- summary(nex) testthat::expect_equivalent(s$nblocks, c(1, 1, 1)) testthat::expect_equal(ncol(s$nstates), 1) testthat::expect_true(all(s$nstates[,1] == 4)) testthat::expect_equivalent(s$nnonstdstatedefs, c(0, 14)) testthat::expect_equivalent(s$nmatrixrows, c(52)) testthat::expect_equivalent(s$notus, c(52)) nex <- nexml_read(system.file("examples", "ontotrace-result.xml", package = "RNeXML")) s <- summary(nex) testthat::expect_equivalent(s$nblocks, c(1, 1, 1)) testthat::expect_equivalent(s$ncharacters, c(3)) testthat::expect_equal(ncol(s$nstates), 1) testthat::expect_true(all(s$nstates[,1] == 2)) testthat::expect_equivalent(s$nnonstdstatedefs, c(2, 0)) testthat::expect_equivalent(s$nmatrixrows, c(9)) testthat::expect_equivalent(s$nmeta$otu, c(10)) testthat::expect_equivalent(s$nmeta$char, c(3)) }) RNeXML/tests/testthat/test_inheritance.R0000644000176200001440000000754613552353762020023 0ustar liggesuserscontext("inheritance") ## FIXME ## Should include expect_that tests, rather than just running without errors. ## ADD test to show that toggling xml->s4->xml returns IDENTICAL objects, ## Add tests to check values on some nodes/attributes... test_that("we can perform simple conversions between NeXML XML and S4", { # basic example node <- newXMLNode("meta", attrs = c('xsi:type'="nex:LiteralMeta", id="dict1", property="cdao:has_tag", datatype="xsd:boolean", content="true"), suppressNamespaceWarning=TRUE) n2 <- newXMLNode("node", attrs = c(about="#n4", label="n4", id = "n4"), .children = node) # check conversions to/from NeXML s4 <- as(n2, "node") xmlfroms4 <- as(s4, "XMLInternalNode") ## expect_identical(n2, xmlfroms4) #cannot compare two external pointers expect_identical(saveXML(n2), saveXML(xmlfroms4)) }) # test_that("We can parse a complete NeXML file and toggle back and forth between XML and S4", { test_that("Parse a complete NeXML file to a single otu", { doc <- xmlParse(system.file("examples", "trees.xml", package="RNeXML")) root <- xmlRoot(doc) otu <- as(root[["otus"]][[1]], "otu") expect_that(otu, is_a("otu")) as(otu, "XMLInternalNode") }) doc <- xmlParse(system.file("examples", "trees.xml", package="RNeXML")) root <- xmlRoot(doc) test_that("Parse a complete NeXML file to trees", { trees <- as(root[["trees"]], "trees") expect_that(trees, is_a("trees")) as(trees, "XMLInternalNode") }) test_that("Parse a complete NeXML file to many otus", { otus <- as(root[["otus"]], "otus") expect_that(otus, is_a("otus")) tt <- as(otus, "XMLInternalNode") expect_that(tt, is_a("XMLInternalNode")) }) test_that("Parse a complete NeXML file to xmlinternalnode", { parsed <- as(root, "nexml") expect_that(parsed, is_a("nexml")) serialized <- as(parsed, "XMLInternalNode") expect_that(serialized, is_a("XMLInternalNode")) }) test_that("Check that values are correct in the otu class element", { otu <- as(root[["otus"]][[1]], "otu") expect_that(otu@id[[1]], equals("t1")) expect_that(otu@label[[1]], equals("species 1")) expect_that(otu@meta, is_a("list")) expect_that(otu@about, is_identical_to(character(0))) }) test_that("Check that values are correct in the trees class element", { trees <- as(root[["trees"]], "trees") expect_that(trees@tree, is_a("ListOftree")) expect_that(trees@otus[[1]], equals("tax1")) expect_that(trees@id[[1]], equals("Trees")) expect_that(trees@label[[1]], equals("TreesBlockFromXML")) expect_that(trees@meta, is_a("list")) expect_that(trees@about, is_identical_to(character(0))) }) test_that("Check that values are correct in the otus class element", { otus <- as(root[["otus"]], "otus") expect_that(otus@otu, is_a("ListOfotu")) expect_that(otus@id[[1]], equals("tax1")) expect_that(otus@label[[1]], equals("RootTaxaBlock")) expect_that(otus@meta, is_a(class=c("list","ListOfmeta"))) expect_that(otus@about, is_identical_to(character(0))) }) test_that("Checking whether an edge is a root edge is correct", { e <- nexml.edge() e.xml <- as(e, "XMLInternalNode") expect_is(e, "edge") expect_false(is(e, "rootEdge")) expect_identical(xmlName(e.xml), "edge") expect_named(xmlAttrs(e.xml), expected = c("source", "target")) e@target <- "foo" e.xml <- as(e, "XMLInternalNode") expect_true(is(e, "rootEdge")) expect_identical(xmlName(e.xml), "rootedge") expect_named(xmlAttrs(e.xml), expected = c("target")) e@source <- "bar" e.xml <- as(e, "XMLInternalNode") expect_false(is(e, "rootEdge")) expect_identical(xmlName(e.xml), "edge") expect_named(xmlAttrs(e.xml), expected = c("source", "target")) }) RNeXML/tests/testthat/test_zzz_cleanup.R0000644000176200001440000000011713552353762020061 0ustar liggesuserscontext("testthat cleanup") unlink("ex.tre") unlink("ex.xml") unlink("tmp.xml")RNeXML/tests/testthat/test_get_characters.R0000644000176200001440000000255713552353762020505 0ustar liggesuserscontext("get_characters") test_that("Getting characters", { f <- system.file("examples", "comp_analysis.xml", package="RNeXML") nex <- read.nexml(f) out <- get_characters(nex) expect_is(out, "data.frame") }) test_that("get_characters can deal with polymorphic character states", { f <- system.file("examples", "ontotrace-result.xml", package="RNeXML") nex <- read.nexml(f) m <- get_characters(nex, rownames_as_col = TRUE, otu_id = TRUE, otus_id = TRUE) expect_is(m, "data.frame") expect_gt(ncol(m), 3) expect_true(any(is.na(m[, 4]))) expect_false(all(is.na(m[, 4]))) expect_is(m[, 4], "integer") expect_is(m[, ncol(m)], "character") expect_false(any(is.na(m[, ncol(m)]))) expect_gt(max(nchar(m[, ncol(m)])), 1) }) test_that("get_characters can return state type matrix", { f <- system.file("examples", "ontotrace-result.xml", package="RNeXML") nex <- read.nexml(f) ret <- get_characters(nex, include_state_types = TRUE) expect_is(ret, "list") expect_is(ret$characters, "data.frame") expect_is(ret$state_types, "data.frame") expect_equal(dim(ret$characters), dim(ret$state_types)) expect_true(all(sapply(ret$state_types, is.factor))) expect_gt(sum(ret$state_types == "polymorphic", na.rm = TRUE), 1) expect_true(all(is.na(ret$characters) == is.na(ret$state_types))) }) RNeXML/tests/testthat/test_01_exported_util.R0000644000176200001440000000352113552353762020706 0ustar liggesuserscontext("expored utility functions") test_that("expand_prefix() works correctly", { uris <- c("license", "title") # returns unchanged if no namespaces testthat::expect_equal(expand_prefix(uris), uris) # returns unchanged if no matching namespace testthat::expect_equal(expand_prefix(uris, c(ns = "//foo/")), uris) uris2 <- paste0("foo:", uris) testthat::expect_equal(expand_prefix(uris2, c(ns = "//foo/")), uris2) # if none are prefixed and we give a base namespace, it's the same as paste0 testthat::expect_equal(expand_prefix(uris, c("//foo/")), paste0("//foo/", uris)) # should be able to handle NAs in the input uris <- c(NA, uris, NA) testthat::expect_equal(expand_prefix(uris), uris) testthat::expect_equal(expand_prefix(uris, c(ns = "//foo/")), uris) # not quite the same as paste0 if NAs are to be allowed testthat::expect_equal(expand_prefix(uris, c("//foo/")), ifelse(is.na(uris), uris, paste0("//foo/", uris))) # namespaces get expanded uris <- c("cc:license", "dc:title", "/nexml", "foo:bar", NA) nex <- new("nexml") expanded <- expand_prefix(uris, namespaces = nex@namespaces) testthat::expect_equal(expanded[1], sub("^cc:", nex@namespaces["cc"], expanded[1])) testthat::expect_equal(expanded[2], sub("^dc:", nex@namespaces["dc"], expanded[2])) testthat::expect_equal(expanded[3], paste0(nex@namespaces["nex"], uris[3])) testthat::expect_equal(expanded[4], "foo:bar") testthat::expect_length(expanded, length(uris)) testthat::expect_true(is.na(expanded[5])) # exact prefix doesn't matter so long as they expand to the same URI testthat::expect_equivalent(expand_prefix("ns1:foo", c(ns1 = "http://example.org/")), expand_prefix("ns2:foo", c(ns2 = "http://example.org/"))) }) RNeXML/tests/testthat/test_global_ids.R0000644000176200001440000000065013552353762017616 0ustar liggesuserscontext("Set global (uuid) identifiers") test_that("We can generate valid EML with uuid ids on all elements", { skip_if_not_installed("geiger") if(require("uuid")){ options(uuid = TRUE) data(geospiza) add_trees(geospiza$phy) nexml <- add_characters(geospiza$dat) write.nexml(nexml, file = "geospiza.xml") expect_true_or_null(nexml_validate("geospiza.xml")) unlink("geospiza.xml") } }) RNeXML/tests/testthat/Rplots.pdf0000644000176200001440000001724613614124634016315 0ustar liggesusers%PDF-1.4 %ρ\r 1 0 obj << /CreationDate (D:20200128213615) /ModDate (D:20200128213615) /Title (R Graphics Output) /Producer (R 3.6.2) /Creator (R) >> endobj 2 0 obj << /Type /Catalog /Pages 3 0 R >> endobj 7 0 obj << /Type /Page /Parent 3 0 R /Contents 8 0 R /Resources 4 0 R >> endobj 8 0 obj << /Length 995 /Filter /FlateDecode >> stream xVn[9Wrd $pZlp'V`IgJdE tΐ3ĝM|G( VZb$?aRR)%w1}(<Ϸ Rx;VZ%|"܈ġ0Q :cNfs R+|n.12KK0+`™#K|c*BUu \W1%^2 7M0=w҄%AU} N—휌>UHVRw &)K_op6hL(hEcQ `b>0¸г \Wq@ӑR|Aɸjy6ܰTpiGe\elP12cUNUZ>7v(q1ǤSEcyh15":RKh(28͔03܌㺊WS0h6s$8L:ÇFȌZ0|.+O0(~r%J&FȌ fӟSF32,FȌZWT\xcoM[> endobj 10 0 obj << /Length 998 /Filter /FlateDecode >> stream xVn[7߯Zuel pj]Y8+$G; %2 .l ϐÙs N!~NOTVFZ+,X9kafNGlm^II?ىO_'wcDJOQ8"& D'UZ$hiaZQMǰZeK03`G:=t"Ɣ"$kbؘJ~c:Iy:&T/v4P`^@(/휌>UHRRO/P !)K_pQT`*ER1Ҩ3#HY =h*:&h-/"H+ 5nNUgKI r}ݾ+"\-3&F訚d\1rjgL堈M2sL]44`bP:nm%0QDG*) &G50xE5f3LAgI`\3|hquZ q qզ&ئW f?3&FVg\1,W;Ff\ySqƪv\57nq;ظa[3=skk]5&!zoNsi7&5ڛvfz3NDb\/:t^9>Z~Ni~.(_yۮ-%v)1y:,>2SJrN\o7cTޠj6^zP}2H{;J{{^b9ӮNEqU[RaQKyʮz:i y.zzjU`5}5.s3H}͛2J5˨V(7{X{}߈_|[=G.{}~>H7YR@ ;m gTwq| ^pK#>Kaendstream endobj 11 0 obj << /Type /Page /Parent 3 0 R /Contents 12 0 R /Resources 4 0 R >> endobj 12 0 obj << /Length 652 /Filter /FlateDecode >> stream xV0 E(YjsEE ]\RCzCRޗx4z R O鲠ւ/r[|~.{]0«ϙak>rYFؼRr{`v8r0&CRpīY8;׆W6!$ߘ}(fGq3\4 '+'&yY\Ndk"JbGq:H3k֫`B0Z)Y ȦQRA03$3bn*2Ec#66(uI`ժ,TjBuE!%H1F, $9S$MSt΢,%('A%px*4Ѻ({Q^\Unϻ賊l]}a| ӌ`w8SVЌYޮsse(G{C8iN(Ń68-u(O̹{I,x}và-j(:z;QFq1i1N~Hَ/Q<2tkua7v #Cg߷6mdN'^vo②_ WҳL4}E<Gendstream endobj 13 0 obj << /Type /Page /Parent 3 0 R /Contents 14 0 R /Resources 4 0 R >> endobj 14 0 obj << /Length 652 /Filter /FlateDecode >> stream xV0 E(YjsEE ]\RCzCRޗx4z R O鲠ւ/r[|~.{]0«ϙak>rYFؼRr{`v8r0&CRpīY8;׆W6!$ߘ}(fGq3\4 '+'&yY\Ndk"JbGq:H3k֫`B0Z)Y ȦQRA03$3bn*2Ec#66(uI`ժ,TjBuE!%H1F, $9S$MSt΢,%('A%px*4Ѻ({Q^\Unϻ賊l]}a| ӌ`w8SVЌYޮsse(G{C8iN(Ń68-u(O̹{I,x}và-j(:z;QFq1i1N~Hَ/Q<2tkua7v #Cg߷6mdN'^vo②_ WҳL4}E<Gendstream endobj 3 0 obj << /Type /Pages /Kids [ 7 0 R 9 0 R 11 0 R 13 0 R ] /Count 4 /MediaBox [0 0 504 504] >> endobj 4 0 obj << /ProcSet [/PDF /Text] /Font <> /ExtGState << >> /ColorSpace << /sRGB 5 0 R >> >> endobj 5 0 obj [/ICCBased 6 0 R] endobj 6 0 obj << /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> stream xwTSϽ7PkhRH H.*1 J"6DTpDQ2(C"QDqpId߼y͛~kg}ֺLX Xňg` lpBF|،l *?Y"1P\8=W%Oɘ4M0J"Y2Vs,[|e92<se'9`2&ctI@o|N6(.sSdl-c(2-yH_/XZ.$&\SM07#1ؙYrfYym";8980m-m(]v^DW~ emi]P`/u}q|^R,g+\Kk)/C_|Rax8t1C^7nfzDp 柇u$/ED˦L L[B@ٹЖX!@~(* {d+} G͋љς}WL$cGD2QZ4 E@@A(q`1D `'u46ptc48.`R0) @Rt CXCP%CBH@Rf[(t CQhz#0 Zl`O828.p|O×X ?:0FBx$ !i@ڐH[EE1PL ⢖V6QP>U(j MFkt,:.FW8c1L&ӎ9ƌaX: rbl1 {{{;}#tp8_\8"Ey.,X%%Gщ1-9ҀKl.oo/O$&'=JvMޞxǥ{=Vs\x ‰N柜>ucKz=s/ol|ϝ?y ^d]ps~:;/;]7|WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~endstream endobj 15 0 obj << /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 45/minus 96/quoteleft 144/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space] >> endobj 16 0 obj << /Type /Font /Subtype /Type1 /Name /F4 /BaseFont /Helvetica-Oblique /Encoding 15 0 R >> endobj xref 0 17 0000000000 65535 f 0000000021 00000 n 0000000163 00000 n 0000004121 00000 n 0000004224 00000 n 0000004336 00000 n 0000004369 00000 n 0000000212 00000 n 0000000292 00000 n 0000001358 00000 n 0000001439 00000 n 0000002509 00000 n 0000002591 00000 n 0000003315 00000 n 0000003397 00000 n 0000007064 00000 n 0000007322 00000 n trailer << /Size 17 /Info 1 0 R /Root 2 0 R >> startxref 7428 %%EOF RNeXML/tests/testthat/test_meta_extract.R0000644000176200001440000002734213552353762020206 0ustar liggesuserscontext("extract_metadata") nex <- add_basic_meta( title = "My test title", description = "A description of my test", creator = "Carl Boettiger ", publisher = "unpublished data", pubdate = "2012-04-01", citation = citation("ape")) test_that("get_meta() and friends have some basic parameter checking", { testthat::expect_error(get_meta(nex, props = c())) testthat::expect_error(get_meta(nex, props = NULL)) testthat::expect_error(get_meta(nex, "foo", props = "foo")) }) test_that("get_meta() and friends return the correct types", { mlist <- get_meta(nex, props = "dcterms:modified") testthat::expect_is(mlist, "ListOfmeta") testthat::expect_equal(names(mlist), "dcterms:modified") mlist <- get_meta(nex, props = "foo") testthat::expect_is(mlist, "ListOfmeta") testthat::expect_length(mlist, 0) mlist <- get_meta(nex, props = c("dcterms:modified", "dc:description")) testthat::expect_is(mlist, "ListOfmeta") testthat::expect_equal(names(mlist), c("dcterms:modified", "dc:description")) testthat::expect_is(get_all_meta(nex), "ListOfmeta") citMeta <- get_meta(nex, props = "dcterms:references") testthat::expect_gt(length(citMeta), 0) testthat::expect_is(citMeta, "ListOfmeta") nested <- get_all_meta(citMeta[[1]]) testthat::expect_gt(length(nested), 0) testthat::expect_is(nested, "ListOfmeta") }) test_that("we can extract metadata using the dedicated functions", { testthat::expect_equivalent(get_citation(nex), format(citation("ape"), "text")) testthat::expect_equivalent(get_license(nex), "http://creativecommons.org/publicdomain/zero/1.0/") m <- get_metadata(nex) mlist <- get_all_meta(nex) testthat::expect_gte(length(m[,1]), 6) testthat::expect_length(m[,1], length(mlist)) mvalues <- get_metadata_values(nex, props = c("dc:creator", "dc:title", "dc:description", "dcterms:publisher", "dcterms:modified")) testthat::expect_equivalent(mvalues["dc:creator"], "Carl Boettiger ") testthat::expect_equivalent(mvalues["dc:title"], "My test title") testthat::expect_equivalent(mvalues["dc:description"], "A description of my test") testthat::expect_equivalent(mvalues["dcterms:publisher"], "unpublished data") testthat::expect_equivalent(mvalues["dcterms:modified"], "2012-04-01") summary(nex) }) test_that("we can parse literal meta nodes with literal node content", { f <- system.file("examples", "ontotrace-result.xml", package="RNeXML") nex <- read.nexml(f) out <- get_metadata(nex, level = "nexml") matches <- sum(grepl("Phenoscape Knowledgebase", out$content)) testthat::expect_true(matches > 0) # empty literal node content mlist <- get_meta(nex, props = "dc:creator") testthat::expect_is(mlist, "ListOfmeta") testthat::expect_length(mlist, 1) testthat::expect_is(mlist[[1]], "LiteralMeta") testthat::expect_is(mlist[[1]]@content, "character") testthat::expect_length(mlist[[1]]@content, 0) vals <- get_metadata_values(nex, props = "dc:creator") testthat::expect_is(vals, "character") testthat::expect_identical(names(vals), c("dc:creator")) testthat::expect_length(vals, 1) testthat::expect_is(vals[1], "character") testthat::expect_equivalent(vals[1], "") vals <- get_metadata_values(nex, props = c("dc:creator", "dc:description")) testthat::expect_is(vals, "character") testthat::expect_identical(names(vals), c("dc:creator", "dc:description")) testthat::expect_length(vals, 2) testthat::expect_is(vals["dc:creator"], "character") testthat::expect_equivalent(vals["dc:creator"], "") # test correct roundtrip doc <- as(add_meta(mlist[[1]]), "XMLInternalNode") nex1 <- as(doc, "nexml") mlist1 <- get_meta(nex1, props = "dc:creator") testthat::expect_is(mlist1, "ListOfmeta") testthat::expect_length(mlist1, 1) testthat::expect_is(mlist1[[1]]@content, "character") testthat::expect_length(mlist1[[1]]@content, 0) }) test_that("we can extract all available metadata at a specified level of the DOM", { f <- system.file("examples", "ontotrace-result.xml", package = "RNeXML") nex <- read.nexml(f) # otu metadata m.otu <- get_metadata(nex, "otus/otu") m.taxonId <- dplyr::filter(m.otu, property == "dwc:taxonID") testthat::expect_equal(nrow(m.taxonId), length(nex@otus[[1]]@otu)) testthat::expect_gt(nrow(m.otu), nrow(m.taxonId)) taxonIDs <- get_metadata_values(nex, nex@otus[[1]]@otu, "dwc:taxonID") testthat::expect_length(taxonIDs, nrow(m.taxonId)) testthat::expect_equivalent(taxonIDs, m.taxonId[,"href"]) # character metadata m.c <- get_metadata(nex, "characters/format/char") denotes <- expand_prefix(m.c[1,"property"], nex@namespaces) m.denotes <- dplyr::filter(m.c, expand_prefix(property, nex@namespaces) == denotes) testthat::expect_equal(nrow(m.c), nrow(m.denotes)) testthat::expect_equal(nrow(m.c), length(nex@characters[[1]]@format@char)) entityIDs <- get_metadata_values(nex, nex@characters[[1]]@format@char, denotes) testthat::expect_length(entityIDs, nrow(m.denotes)) testthat::expect_equivalent(entityIDs, m.denotes[,"href"]) }) test_that("we can correctly parse nested ResourceMeta annotations", { f <- system.file("examples", "meta_example.xml", package="RNeXML") nex <- read.nexml(f) meta <- get_metadata(nex) lic <- dplyr::filter(meta, property == "cc:license")$href testthat::expect_equal(lic, "http://creativecommons.org/publicdomain/zero/1.0/") # remove rows from nested meta elements (which there should be!) testthat::expect_true("meta" %in% colnames(meta)) topMeta <- meta[is.na(meta[,"meta"]),] testthat::expect_lt(nrow(topMeta), nrow(meta)) # there should be one dc:title at top level, and two if we include nested testthat::expect_gt(nrow(dplyr::filter(meta, property == "dc:title")), nrow(dplyr::filter(topMeta, property == "dc:title"))) # test that the ID referencing for self-joining is correct testthat::expect_true(all(meta[! is.na(meta[, "meta"]), "meta"] %in% meta[! is.na(meta[, "Meta"]), "Meta"])) # ResourceMetas should _either_ have an href _or_ have nested meta elements topMeta <- cbind(topMeta, nkids = sapply(nex@meta, function(x) length(x@children))) rmeta <- dplyr::filter(topMeta, xsi.type == "ResourceMeta") testthat::expect_true(all(xor(is.na(rmeta[, "href"]), rmeta[, "nkids"] == 0))) testthat::expect_gt(max(rmeta[,"nkids"]), 0) # the sum of the children should equal the number of nested meta elements testthat::expect_equal(sum(rmeta[, "nkids"]), nrow(meta) - nrow(topMeta)) }) test_that("metadata tables can be requested in simplified form", { f <- system.file("examples", "meta_example.xml", package="RNeXML") nex <- read.nexml(f) meta1 <- get_metadata(nex, simplify = FALSE) meta2 <- get_metadata(nex, simplify = TRUE) testthat::expect_equal(dplyr::filter(meta1, rel == "cc:license")$href, dplyr::filter(meta2, property == "cc:license")$href) removedCols <- c("ResourceMeta", "LiteralMeta", "rel") testthat::expect_true(all(removedCols %in% colnames(meta1))) testthat::expect_false(any(removedCols %in% colnames(meta2))) }) test_that("ID assignments are correct and complete when meta are nested", { f <- system.file("examples", "phenex.xml", package="RNeXML") nex <- read.nexml(f) m.otu <- get_metadata(nex, level = "otus/otu") # the nested meta elements are actually there testthat::expect_equal(sum(m.otu[,"property"] == "dwc:catalogNumber", na.rm = TRUE), 5) # the ID column for the containing element (here: otu) is populated in full testthat::expect_false(any(is.na(m.otu[,"otu"]))) # the IDs for the containing element are not all the same testthat::expect_gt(length(unique(m.otu[,"otu"])), 1) # expect 5 groups if we group by otu ID testthat::expect_length(tapply(m.otu[,"xsi.type"], m.otu[,"otu"], length), 5) # expect 4 rows for each otu ID testthat::expect_true(all(tapply(m.otu[,"xsi.type"], m.otu[,"otu"], length) == 4)) # expect 1 LiteralMeta and 3 ResourceMeta for each otu ID meta.grouped <- tapply(m.otu[,"xsi.type"], list(m.otu[,"otu"], m.otu[,"xsi.type"]), length) testthat::expect_true(all(meta.grouped[,"LiteralMeta"] == 1)) testthat::expect_true(all(meta.grouped[,"ResourceMeta"] == 3)) # for each otu ID, two meta are nested (have IDREF to a containing meta) meta.nested <- m.otu[!is.na(m.otu[,"meta"]),] testthat::expect_true(all(tapply(meta.nested[,"meta"], meta.nested[,"otu"], length) == 2)) # but the two nested meta for each otu have the same IDREF testthat::expect_true(all(tapply(meta.nested[,"meta"], meta.nested[,"otu"], function(x) length(unique(x))) == 1)) # the IDREFs of the nested meta match up with ID of containing meta xsi.type <- NULL # silence R check meta.cont <- dplyr::filter(m.otu, xsi.type == "ResourceMeta", is.na(m.otu[,"href"])) testthat::expect_true(all(meta.nested[,"meta"] %in% meta.cont[,"Meta"])) # they are all different testthat::expect_length(unique(meta.nested[,"meta"]), 5) testthat::expect_length(unique(meta.cont[,"Meta"]), 5) # and every containing ID is referenced by exactly one of the nested IDREFs testthat::expect_equal(sort(meta.cont[,"Meta"]), sort(unique(meta.nested[,"meta"]))) }) test_that("we can parse LiteralMeta annotations with XML literals as values", { f <- system.file("examples", "phenex.xml", package="RNeXML") nex <- read.nexml(f) # the XML annotations for state elements should have been parsed states <- nex@characters[[1]]@format@states[[1]]@state # list of state objects testthat::expect_true(all(sapply(states, function(s) length(s@meta) >= 1))) testthat::expect_setequal(sapply(states, function(s) class(s@meta[[1]])), "LiteralMeta") testthat::expect_true(all(sapply(states, function(s) length(s@meta[[1]]@content)) > 0)) testthat::expect_setequal(sapply(states, function(s) class(s@meta[[1]]@content)), "XMLString") # the correct namespace definition should have been retained testthat::expect_false(any(sapply(states, function(s) is.null(attr(s@meta[[1]]@content, "namespaces"))))) nsPrefix <- names(attr(states[[1]]@meta[[1]]@content, "namespaces")) testthat::expect_setequal(sapply(states, function(s) attr(s@meta[[1]]@content, "namespaces")), get_namespaces(nex)[nsPrefix]) # the XML literals are returned as meta content m <- get_metadata(nex, "characters/format/states/state") m_xml <- dplyr::filter(m, property == "ps:describesPhenotype") # should have one row for each state n_states <- sum(sapply(nex@characters[[1]]@format@states, function(x) length(x@state))) testthat::expect_gte(n_states, 6) # 3 characters, at least 2 states each testthat::expect_length(m_xml[,1], n_states) # they are of type LiteralMeta testthat::expect_setequal(m_xml[,"xsi.type"], "LiteralMeta") # their content is non-empty, and a string that is valid XML testthat::expect_false(any(sapply(m_xml[,"content"], is.na))) testthat::expect_true(all(sapply(m_xml[,"content"], is.character))) testthat::expect_true(all(sapply(m_xml[,"content"], nchar) > 0)) testthat::expect_true(all(sapply(m_xml[,"content"], XML::isXMLString))) }) RNeXML/tests/testthat/helper-RNeXML.R0000644000176200001440000000031613552353762017001 0ustar liggesusers#' @importFrom rlang enquo expect_true_or_null <- function(o){ val <- rlang::enquo(o) if(!is.null(o)){ testthat::expect_true(!!val) } else { testthat::expect_null(!!val) } } library("XML")RNeXML/tests/testthat/test_validate.R0000644000176200001440000000156213614124203017274 0ustar liggesuserscontext("Online validator tool") test_that("example file validates", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "trees.xml", package="RNeXML") expect_true_or_null(nexml_validate(f)) # null if we cannot perform validation, don't fail }) test_that("RNeXML-generated file validates", { ## tests are too slow for CRAN skip_on_cran() data(bird.orders) f <- nexml_write(bird.orders, file="test.xml") o <- nexml_validate(f) if(!is.null(o)){ expect_true(o) } else { expect_null(o) } unlink("test.xml") }) test_that("Validation can fail gracefully", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples/sparql.newick", package="RNeXML") testthat::expect_warning( o <- nexml_validate(f) ) if(!is.null(o)) { expect_false(o) } else { expect_null(o) } }) RNeXML/tests/testthat/test_toplevel_api.R0000644000176200001440000000441713614124667020206 0ustar liggesuserscontext("top level API") test_that("read.nexml works", { ## The short version using an RNeXML API ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "trees.xml", package="RNeXML") nex <- read.nexml(f) # check alias expect_is(nex, "nexml") }) test_that("write.nexml works (from ape::phylo)", { ## The short version using an RNeXML API ## tests are too slow for CRAN skip_on_cran() data(bird.orders) nexml_write(bird.orders, file="example.xml") write.nexml(bird.orders, file="example.xml") # check alias too ## Check that that example is valid NeXML expect_true_or_null(nexml_validate("example.xml")) expect_is(nexml_read("example.xml", "nexml"), "nexml") unlink("example.xml") # cleanup }) test_that("write.nexml can write multiple trees at once ", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "trees.xml", package="RNeXML") nex <- nexml_read(f) trees <- get_trees(nex) ## We can write a listOfmultiPhylo if the argument is named nexml_write(trees = trees, file="example.xml") expect_true_or_null(nexml_validate("example.xml")) # we can write a multiPhylo (or phylo) by attempting coercion on the first argument instead: nexml_write(trees[[1]], file="example.xml") expect_true_or_null(nexml_validate("example.xml")) unlink("example.xml") # cleanup }) test_that("We can get the right level of lists of trees ", { ## tests are too slow for CRAN skip_on_cran() f <- system.file("examples", "trees.xml", package="RNeXML") nex <- nexml_read(f) ## identical methods, Collapses length-1 lists phy <- as(nex, "phylo") ## phy2 <- get_trees(nex) phy3 <- nexml_get(nex, "trees") expect_identical(phy, phy2) expect_identical(phy3, phy2) ## Doesn't collapse the length-1 lists, returns list of multiPhylo always: phy <- as(nex, "multiPhyloList") ## phy2 <- get_trees_list(nex) phy3 <- nexml_get(nex, "trees_list") expect_identical(phy, phy2) expect_identical(phy3, phy2) ## Collapse to multiPhylo phy <- as(nex, "multiPhylo") ## phy2 <- get_trees(nex) # same because there are two trees in the same `trees` node. expect_identical(phy, phy2) phy3 <- nexml_get(nex, "flat_trees") ## FIXME SOMETHING WRONG! expect_identical(phy3, phy2) }) RNeXML/vignettes/0000755000176200001440000000000013614142014013323 5ustar liggesusersRNeXML/vignettes/sparql-unnamed-chunk-8-1.png0000644000176200001440000004253113614141224020400 0ustar liggesusersPNG  IHDRMPLTE  !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~]} pHYs  ~ IDATx@SW]Kފ( *jU[(Z鶭V'*3@  DHT*D$G\FO%orx{  @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) TNP79W@{urF<=kEGj4畔~1)-Dސr@ ~2iY,^MA .ρp#]ӢOs;p |Vr@#ސpV [ѹn_̏3y-ػyϓKsSPxC´ / 1A iQg&?=lʿ^+7`6崀3w!tQ CsPxSm>eH=,k?ȚxPPx=(6E<ߕ@GZ3cifP8EZ;yP$~pdyYM {-[kȜ>|S`E ؿ\ Cku OrVM28̹9w{}+-9}p>o<1 X)cg{NQtx\sPxCCs&u#񽃔lI廜!_=;#o"YsPxrSm ) }p͊~kN r|pc`:mʰ^,6 q *ki o2rU|vWW86mufF95%&/ Ű|0 DI(<)q e=~}YWQ{7P}Pa;ᒭStAP[мF:x:=ᠯ0KaݢIr“:9S\~~vп c}s[MC ߱ZKPxZƒiz~v7wK~ 6TYrE^?쳡)׍xwQoy876wKsPxR/ny~vWn 8|2Y?u3gІFKܜV6PsPx2(hôZl^iQ}"1 /W2“7tzlƨ ѻVQ6r(wZMhr3QZO͏HNiHjsta^K^8MM8#3hFWP^5/h'5 f}a\aW|Vvl#XǷURvZa W];`q&peZRq 0No|@>|"ZBҩ8@0)Y80oⵌ)~VUj aje|Vq%+/Le lD^IXw͍A;Ѫ1-0N{eNe-tz; "u8–,ƍøuXT@/Q7K|6M=4}QD, k0K n0t0y97t7@+2%ز Qc|&%ѸFת։a]+ wUFN!h:+no9[Iؒv/N;7@-2X~u//&9NXN/aV3.JMK\&FWPПo=봨d,kSƖhZ_dɀ\ np:JÑ'vOzΕY+UؒJ!QEfr>'(|n?e(| 0Q &{bsgH̊*>:]ޗ0XkTʧȈƣ;چ·zr(crA^"U&9k%pP8U괨4ee.79>?2⿑ø lce@&& W :4,71Y*@%]Kwzѿ^[b|ʵ&XUYW& o%GΟ̑JxW9b9eAT܈VLᎴxTHȧp(7nmr찈H1Fqܱ3睐g]y]qQe!-@-a_*ߥjTC5w\t"pj{E-X7{c3-83}Vz.> OZ%iQ#MyZ-M&s7&?.&KO(J%e^gjXZJ]FG+ I W23q"ZUWW_&qi`0qALd9d[,X%f96:g|"J/a*Z3{&!g;+ѥ؀i0:&;|"]TQ[Ue`k@05̍S:m&\^;J-GLm|sKLBi>,O_dw~Sgy+Pxmh]}% v#c(#I[>v7<B(fY"K*jۍ :w~v݂ZXUGTY?stN( :bHm܌9.6+ oDhav܄xa0Kã-·ARNBBWJt=A**%UX+/%L~e:DדaG7r2 cz(_ϧ/{ko ߈6ѮCJMeaԂx)+]mlag: _r]A-R''Hv:ݰh.'ch)m|%/|dckRK[{IAAgaڏid˕|'woi;F-+n VʗPqE  0ڜ6ASWz!Ehr!TP! ˤ ЊhSL8&JWa2%y ݩ^!\CC*um|P?U84gI`bzfaw]93=4A |d_OQ_(ul y㴏&zx)},u PCv;؈\:wˠ|y M&3F[V |0Fte^@1q<7mo{ɮa)bR? nɞ/<Ѣ20GWkgXLb 0cjGi}pJOp)FtX<:r0vhh-;4G O8#@t-(1햲+]“?#"744N5r),@R¼G+6QbS:c#xF{8iy53r@$F2#kl',|7,DQڍ`C|Ft)q:jʍt4> ?ڭfz,G |]䛙}9__v?H_3=MxC>Qҫ`Z~Xm4ӣo!Q?WvJ83Pt#}- ;b9j8C27( 6B ǿD~TFX1|T(ezyg9jbR,zGm2.Wd*u//Ĭ{-|X#ѡ !eΝ=偎wq[{-O]h9jXUbz k洓N#W$1[{j/7X['L\\SwM.Uʑax(-@*|$[Ʋَ6g١ԍZ, RbJWo9䈝kPG4󗛛ƬXe x;/\|%)hPb. {M_28-SGU6VL#&-GGM.=+a&aIQz6%l,>&Z1,r\TIY7FJ <ÝAg˺lYݨ=ӒdHw(y(R @Y,bz),|F3r( RČ9 I%6Kz?(LP[/X'ӿ7Y?IUn΋?GO\%Ʉ}YT`uȯ zSٚ߰y%eyZ\B9)}R b jG.U|US2*sKݑq7>#Lg'Jq4>J;@IE,ǜTkèeR_{H~\t+`2b,f2seMsb:2Kg\!3;$e:yr\ۚ1g1iv||frdYi dbibGzKNEuUqIUϜ$b=} "k\0R838͒lvRvoZJerOGG>uԙrX? )aDF8u.*..|Ǎn^m娺뉁ǿN?uǏN+_Ũ/C 5ʼnf~v˸aoYcq޸EE+aUs1_W CYUYF9@_.w`g\9ryS䊙1Z', ]4ovJ@-yh<\^ u_Ss6#N=vG#8~&FR?fk}粜e%904ʠsy !J3+-z=Em;rYĖW G=v&Qv̫[AT,`[Dҳ׌^*hDћK~qۨO;&5'ޒ/`(kOj%Ӗ=£fSo&w-z앓w =7 XcsMː%4Wo9fƚl3qIq~8޼jhwHya n~C^kWxRH}> eW]9RxUz`> \\/g's<_$^9cb= mԆ d*,C kPsY ?-sD])?{lx@!~զh&y!.̒ YlqEbjrZWߨ߼HX^3Z76Ġeh#2['}9wG'DzxI Tþѫ]:R_蜑csp}^T?Z]Ȫc$ȀV`tC0jm.<+hn]B;/Na\fjF>y^BE7 xe&"5➄yE%TbwԌT:l7M#8]yX*f@kn34ee`˺lO^"8忩,}d,ɺrWȐ>#vb(}!1;tK^-+ِ=k\Sw.꿩 13xごJ=axrN$6;T! zmDp0kg)YHd%qr Dok3*oJGI=;էlܫ2" zߩv'FMӚeJ׃VYji#AYȌK҅ ՛N%V;&<کёE`KqZt?[*{|6d_gVt ^rz7%Tb棭-܈'2BQCxn\ի #0qMGX#DNFpZ6v B7Jt AWQweyXmrbqfG FB# &UOr9KC(+xBV!WC[tY4X}3V$mX7:i+SzE 8F5HxWP7Fm"RˆUY[O[5oy?MdqK )%L_G~|xN乣T՗;*0ocҢ?Mdqm۝O7}9< 4c!X g۽;mpnpz!&}&WJ#+=>z ?x 6zT%->w`=s42p~Ǩ,a?hэ*Xs<7ku+lIrq,zE\M |VO5­ nTXV#ܬ0Id`W42bKw)b$+4a9j֞-b{>41Nvfë !m1jvd5t%vѰ%-tej{n,3tE07 c;2S=7,fnu7}k_x@V,,vx5 iyW&0rU Ro(αLm$䠀+dH?9IfXOe[U< d2OD'Y[7YpE?o+ĥS64i']V:2=c5㗗X3шqaO*OѬG3$tANte*񪓜@i0㤋#9isAΓx6 7 c;22{cnejy.{Aͪx4C6ke:dJssikY|U}S,!%qUh|wq;$T=7rb3<)^Nd輝teN!KS8-9K7Z YkȆe꤈{.>3!myxL3,S5Uݎ>IK4-lПQӭv:ImU:{Mi]"V> *:2gVk*. y$ϲ% 7m,STgգ>SptYE~mUyCrؖ2KWV8dg,MyoJva`⠄ǯ{vlM3OiO HxIhe*7MiϬF?ɝЦq?<)ZpH+C$C\Q7ܷh洧|%<)7mDppihAN߃t+ݩTt2ZF6s|>("O?rq"GO]m|6)?i洧i|&<8FfBn ^cVg=C[6*#T4TJ,67пP=4ɶ[B[YqX1wZ@Mv}THkP\ͦ˰gcv=O_q,ME[4\oXb2q|N2r?\ʓ]?qb ot MEZ63dLm8KH-Vm(in K >KE͍=2MƱ&QWCCö??`-ۻcI4}o ^g~*mS0șÒlyc>m9 kQ-}{c\M`E.Oos3'˺l۳b.ϗ:t\~-^Oo:l7Ԧyċ6I\:S#iC1(e:l7NC8Ѣ! < gml]F5:l#'e 8ޢWRF-K Hm@NG n`tNmEFd 3,Seҳe t 2C2?"/<0DT~!Z~}-2{z(!DpXV&: 1'+**sQDxC)`jLNUًd>rV N0~:z[s@gs1s1ZL-S0W?Dng~zo}Z'B'[:t,/kileO!A[fG~A;?ryluunӂ{{1g,0-SEæ5xwQ)~Y޽+}mIE{L*M9&bgz砚hBH @=Ym"dpbh_6-8ĮPOxòLņt93do{gŘo"Zp{Ƹ<}_V䣨y*  25st;#?:37Nܶ|{!L]>Y5?K8E7T92C=v2c@>I4roƬQ>rlﲜדk:!Dp/Uy"X~,>؞Ug ߱^\2z >[Pp~4Q6*}!9vٛ~|KQoޱw22B 0Zb6Y~ԧ~;nBeA^ HPGYlspc{/v^Iu؝a7 ,S6 ~}n:pdo~oO}$;9jn L=l:vٻ0Up] ^/șgR8!eT?ipfYpi6?̧in L=13$6~0g v46ͦw]Iw $.Ŗz{wrhY%+p;kev#-5P {gezODyj@ۆܖ@>CBfːY8Px-z,l=_Y'?^+dL $$u³|p:@N?,sr M^'fZG-uq^wbr|EW3=VPx"te*ڵ"_gRJZc2ɻZr?< ,j:@;>-S=ILe^kuE tj 2wq&}rr#xh@?߲i+l47>b݉*"wm=QYJ-PNk n[#FsQe޷AR_tejד(fth|VKcE`6IX6)~^}4E@:g^wx_sPΥ-S[f}U9\ 7K~N6˿В! l:2<v<ߕIv:ԉDW1c!@;βLm=f8ncA=-SV!yZ8ơ]B'X 0-˞ nܙ}u]v̊' []΍<]D,S5To>|%ۇ;bG ofO53zۮg3@ỌGp4k>l8ffG}xY;?){5s{;֭s@ỐjyS$M2MV],v>66a.8oʘ"7\N▩mz2 ^^^S_|)!2[ V-}o)Aw5,SZuaQ 447筯 ? -Knd_(se/::OzV>ɂ12± |XW Z?wO .t k-o /*W493(3ceU bp{2T,E聆;jG~{{dYwoO|e@Eז: ,x^dpn= ]8fFpXoCoT5oAU?[ہw'܍5lVuqGքO(|wN2B3RlXn>WscPnG74Ner6RW_3]Ρ6֚“j9ۇX$5nUvc\(jc(<9hڤJcE { +Ȥo]X6Xk O,mVE{<-`D/VmQ3^2^X6Fm5 OZLmVY]_kA!uO!Ad'dP671jcdPx2Ѽ^-s8Ory q7<{X.,jvſ| OM_[*[BtPx8=WY rE@ZPD{V'<$A}z8|M>yXkS7cCK$Z,x[?__?{&:AIB!=+㕗b𳀾[Do+<tiB“j2X̟Y%w]Ffwp$ZP`5)+ #|OM O9ha.y|Qn̡ M+VVZW7<Ե4-n!gt'!ĩ{ؠ #OP>eNcL'x|rlh>!4Z*w?oj9Dbi.7D“:W>^n>C+ͬM><8\gwkЬa؃1 >xmø 85~YcG(.Q {|/e#hC~ZJj?Ƞ~CIo;fו :ufrBC57U߳h]OOI]7fD=^vOMۘ6DŽ:-n7Z6{Azh~E*aǔG=;-5׆}͌57,^4k+>3dE>=՛k oh͐k+8f>nrm4|C hݚK" i掵|j oXM6]@m)VSs*h o>e3u/aulUTK@иs? t{u Y*hGvH4Z|e>bl;q r6r cF_2IDATkn oxh7źrm'A6 Cs`"P`WX!G@@) URaGyzkn oxʁX'z>PLY~xeXwfhn op c;ƖUۍjP+w 48XM ,@) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) @) 8.IENDB`RNeXML/vignettes/metadata.Rmd.orig0000644000176200001440000001657013614132077016527 0ustar liggesusers--- title: "Handling Metadata in RNeXML" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- ```{r compile-settings, include=FALSE} library("methods") library("knitr") knitr::opts_chunk$set(fig.path="../man/figures") opts_chunk$set(tidy = FALSE, warning = FALSE, message = FALSE, cache = FALSE, comment = NA, verbose = TRUE, eval = require("taxadb"), ) basename <- gsub(".Rmd", "", knitr:::knit_concord$get('infile')) ``` ## Writing NeXML metadata The `add_basic_meta()` function takes as input an existing `nexml` object (like the other `add_` functions, if none is provided it will create one), and at the time of this writing any of the following parameters: `title`, `description`, `creator`, `pubdate`, `rights`, `publisher`, `citation`. Other metadata elements and corresponding parameters may be added in the future. Load the packages and data: ```{r} library('RNeXML') data(bird.orders) ``` Create an `nexml` object for the phylogeny `bird.orders` and add appropriate metadata: ```{r} birds <- add_trees(bird.orders) birds <- add_basic_meta( title = "Phylogeny of the Orders of Birds From Sibley and Ahlquist", description = "This data set describes the phylogenetic relationships of the orders of birds as reported by Sibley and Ahlquist (1990). Sibley and Ahlquist inferred this phylogeny from an extensive number of DNA/DNA hybridization experiments. The ``tapestry'' reported by these two authors (more than 1000 species out of the ca. 9000 extant bird species) generated a lot of debates. The present tree is based on the relationships among orders. The branch lengths were calculated from the values of Delta T50H as found in Sibley and Ahlquist (1990, fig. 353).", citation = "Sibley, C. G. and Ahlquist, J. E. (1990) Phylogeny and classification of birds: a study in molecular evolution. New Haven: Yale University Press.", creator = "Sibley, C. G. and Ahlquist, J. E.", nexml=birds) ``` Instead of a literal string, citations can also be provided in R's `bibentry` type, which is the one in which R package citations are obtained: ```{r} birds <- add_basic_meta(citation = citation("ape"), nexml = birds) ``` ## Taxonomic identifiers RNeXML now uses `taxald` for fast look-up of taxonomic information. If a unique match is found, a metadata annotation is added to the taxon providing the unique URI to the taxonomic unit. ```{r message=FALSE, results='hide', eval=FALSE} birds <- taxize_nexml(birds, "NCBI") ``` If no perfect match is found, the user is warned to check for possible typographic errors in the taxonomic labels provided. ## Custom metadata extensions We can get a list of namespaces along with their prefixes from the `nexml` object: ```{r} prefixes <- get_namespaces(birds) prefixes["dc"] ``` We create a `meta` element containing this annotation using the `meta` function: ```{r} modified <- meta(property = "prism:modificationDate", content = "2013-10-04") ``` We can add this annotation to our existing `birds` NeXML file using the `add_meta()` function. Because we do not specify a level, it is added to the root node, referring to the NeXML file as a whole. ```{r} birds <- add_meta(modified, birds) ``` The built-in vocabularies are just the tip of the iceberg of established vocabularies. Here we add an annotation from the `skos` namespace which describes the history of where the data comes from: ```{r} history <- meta(property = "skos:historyNote", content = "Mapped from the bird.orders data in the ape package using RNeXML") ``` Because `skos` is not in the current namespace list, we add it with a url when adding this meta element. We also specify that this annotation be placed at the level of the `trees` sub-node in the NeXML file. ```{r} birds <- add_meta(history, birds, level = "trees", namespaces = c(skos = "http://www.w3.org/2004/02/skos/core#")) ``` For finer control of the level at which a `meta` element is added, we will manipulate the `nexml` R object directly using S4 sub-setting, as shown in the supplement. Much richer metadata annotation is possible. Later we illustrate how metadata annotation can be used to extend the base NeXML format to represent new forms of data while maintaining compatibility with any NeXML parser. The `RNeXML` package can be easily extended to support helper functions such as `taxize_nexml` to add additional metadata without imposing a large burden on the user. ## Reading NeXML metadata A call to the `nexml` object prints some metadata summarizing the data structure: ```{r } birds ``` We can extract all metadata pertaining to the NeXML document as a whole (annotations of the XML root node, ``) with the command ```{r} meta <- get_metadata(birds) ``` This returns a data.frame of available metadata. We can see the kinds of metadata recorded from the names: ```{r} meta ``` We can also access a table of taxonomic metadata: ```{r get_taxa} get_taxa(birds) ``` Which returns text from the otu element labels, typically used to define taxonomic names, rather than text from explicit meta elements. We can also access metadata at a specific level (or use `level=all` to extract all meta elements in a list). Here we show only the first few results: ```{r} otu_meta <- get_metadata(birds, level="otus/otu") otu_meta ``` ## Merging metadata tables We often want to combine metadata from multiple tables. For instance, in this exercise we want to include the taxonomic identifier and id value for each species returned in the character table. This helps us more precisely identify the species whose traits are described by the table. ```{r} library("RNeXML") library("dplyr") library("geiger") ``` To begin, let's generate a `NeXML` file using the tree and trait data from the `geiger` package's "primates" data: ```{r} data("primates") add_trees(primates$phy) %>% add_characters(primates$dat, ., append=TRUE) %>% taxize_nexml("itis") -> nex ``` (Note that we've used `dplyr`'s cute pipe syntax, but unfortunately our `add_` methods take the `nexml` object as the _second_ argument instead of the first, so this isn't as elegant since we need the stupid `.` to show where the piped output should go...) We now read in the three tables of interest. Note that we tell `get_characters` to give us species labels as there own column, rather than as rownames. The latter is the default only because this plays more nicely with the default format for character matrices that is expected by `geiger` and other phylogenetics packages, but is in general a silly choice for data manipulation. ```{r} otu_meta <- get_metadata(nex, "otus/otu") taxa <- get_taxa(nex) char <- get_characters(nex, rownames_as_col = TRUE) ``` We can take a peek at what the tables look like, just to orient ourselves: ```{r} otu_meta taxa head(char) ``` Now that we have nice `data.frame` objects for all our data, it's easy to join them into the desired table with a few obvious `dplyr` commands: ```{r} taxa %>% left_join(char, by = c("label" = "taxa")) %>% left_join(otu_meta, by = "otu") %>% select(otu, label, x, href) ``` Because these are all from the same otus block anyway, we haven't selected that column, but were it of interest it is also available in the taxa table. RNeXML/vignettes/intro.Rmd.orig0000644000176200001440000001304313614140545016071 0ustar liggesusers--- title: "A Brief Introduction to RNeXML" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- ```{r echo=FALSE} knitr::opts_chunk$set(fig.path="intro-") library(RNeXML) ``` Read in a `nexml` file: ```{r} f <- system.file("examples", "comp_analysis.xml", package="RNeXML") nexml <- nexml_read(f) ``` Pretty-print an overview of the components and metadata that make up the nexml object: ```{r} nexml # this is the same as show(nexml) ``` Create a summary object of various component and metadata counts (the `show()` method uses this): ```{r} summary(nexml) ``` Extract trees from nexml into the `ape::phylo` format: ```{r} tr <- get_trees(nexml) # or: as(nexml, "phylo") plot(tr) ``` Write an `ape::phylo` tree into the `nexml` format: ```{r} data(bird.orders) nexml_write(bird.orders, "test.xml", creator = "Carl Boettiger") ``` A key feature of NeXML is the ability to formally validate the construction of the data file against the standard (the lack of such a feature in nexus files had lead to inconsistencies across different software platforms, and some files that cannot be read at all). While it is difficult to make an invalid NeXML file from `RNeXML`, it never hurts to validate just to be sure: ```{r} nexml_validate("test.xml") ``` Extract metadata from the NeXML file: ```{r } birds <- nexml_read("test.xml") get_taxa(birds) get_metadata(birds) ``` -------------------------------------------- Add basic additional metadata: ```{r} nexml_write(bird.orders, file="meta_example.xml", title = "My test title", description = "A description of my test", creator = "Carl Boettiger ", publisher = "unpublished data", pubdate = "2012-04-01") ``` By default, `RNeXML` adds certain metadata, including the NCBI taxon id numbers for all named taxa. This acts a check on the spelling and definitions of the taxa as well as providing a link to additional metadata about each taxonomic unit described in the dataset. ### Advanced annotation We can also add arbitrary metadata to a NeXML tree by define `meta` objects: ```{r} modified <- meta(property = "prism:modificationDate", content = "2013-10-04") ``` Advanced use requires specifying the namespace used. Metadata follows the RDFa conventions. Here we indicate the modification date using the prism vocabulary. This namespace is included by default, as it is used for some of the basic metadata shown in the previous example. We can see from this list: ```{r} RNeXML:::nexml_namespaces ``` This next block defines a resource (link), described by the `rel` attribute as a homepage, a term in the `foaf` vocabulary. Because `foaf` is not a default namespace, we will have to provide its URL in the full definition below. ```{r} website <- meta(href = "http://carlboettiger.info", rel = "foaf:homepage") ``` Here we create a history node using the `skos` namespace. We can also add id values to any metadata element to make the element easier to reference externally: ```{r } history <- meta(property = "skos:historyNote", content = "Mapped from the bird.orders data in the ape package using RNeXML", id = "meta123") ``` For this kind of richer annotation, it is best to build up our NeXML object sequentially. First we will add `bird.orders` phylogeny to a new phylogenetic object, and then we will add the metadata elements created above to this object. Finally, we will write the object out as an XML file: ```{r} birds <- add_trees(bird.orders) birds <- add_meta(meta = list(history, modified, website), namespaces = c(skos = "http://www.w3.org/2004/02/skos/core#", foaf = "http://xmlns.com/foaf/0.1/"), nexml=birds) nexml_write(birds, file = "example.xml") ``` ### Taxonomic identifiers Add taxonomic identifier metadata to the OTU elements: ```{r eval=FALSE} nex <- add_trees(bird.orders) nex <- taxize_nexml(nex) ``` ## Working with character data NeXML also provides a standard exchange format for handling character data. The R platform is particularly popular in the context of phylogenetic comparative methods, which consider both a given phylogeny and a set of traits. NeXML provides an ideal tool for handling this metadata. ### Extracting character data We can load the library, parse the NeXML file and extract both the characters and the phylogeny. ```{r} library(RNeXML) nexml <- read.nexml(system.file("examples", "comp_analysis.xml", package="RNeXML")) traits <- get_characters(nexml) tree <- get_trees(nexml) ``` (Note that `get_characters` would return both discrete and continuous characters together in the same data.frame, but we use `get_characters_list` to get separate data.frames for the continuous `characters` block and the discrete `characters` block). We can then fire up `geiger` and fit, say, a Brownian motion model the continuous data and a Markov transition matrix to the discrete states: ```r library(geiger) fitContinuous(tree, traits[1], ncores=1) fitDiscrete(tree, traits[2], ncores=1) ``` ```{r include=FALSE} unlink("example.xml") unlink("meta_example.xml") unlink("test.xml") ``` RNeXML/vignettes/intro-unnamed-chunk-5-1.png0000644000176200001440000000764413614141243020235 0ustar liggesusersPNG  IHDRMPLTE  !!!"""###$$$%%%&&&'''((()))***+++,,,...///111222333444555666777888999:::;;;<<<===>>>@@@AAABBBCCCDDDEEEFFFHHHIIIJJJKKKMMMNNNOOOPPPQQQRRRSSSTTTUUUWWWXXXYYYZZZ[[[\\\]]]^^^```aaabbbcccdddeeefffgggiiikkklllmmmnnnooopppqqqrrrsssuuuvvvxxxyyy{{{|||}}}~~~Z[v pHYs  ~ IDATxUeC8 0E2 BxPQbHx" [i"&^b*艁lg3<߇}_?X8kߜZ.>$8</////////////////////////////////>_ftGm| CzxW͙q]Ƨ>?t==~F;ks=KԺ}w?)co!|Hg,-<,P뮬]w^*ȍ;z:75n){yp~3$A ^nM·|J:7f&^w~Om PCM*(ܙ[7o!|$P,!|/I:h ;R _)W|/&> G #Oń'AbB |1!|I>B$_L!|/&> G #OńP=Waz z Cڽd{ sʽ;੶y[{WsV9)>R7l;|WrY?ezuDζlGVz\Yٗ:ze˖g۾Ç#Uo!(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‹"(‡z5>!^ 4>y^yY[UmُuSSo͞gԻsܘm2>Mh%,[koוK"&VVjExkM{^֩lvoI,!5‹"(‹"(‹"(‹"(‹"(‹"(§'s (- [%+>=O'GxkO#5§Co!|rF>9[koj},:5 z}VsZW=Qa~5}{^L,[[{n\*nonz՞W?>$+#|H~W%=5ַ> իsXBxQExQExQExQExQExQExQExQExQExQExQExQExQExQExQojaesO۞BV;7>y^M^1!^n>W+;o̙{!| _̷JoU[r?B>9B>9B>9B>9B>9rJ]>^>,1yͭB{ec]f7 cyO#|᳌>YFG,#|r#|>9>eOq.]mtGن;{|>3 9w6s M>,I}&F3 Ν-Y-g>;wj;"3 ;w?Kv!|ix?|ߝgC8~sg#-9!+>4|>YFG,ku1c.?+nf_y!T/.#?9WVeOq2'G8g#|᳌>YFG,#|r#|>9>eOq2'G8g#|ᳬh^;`y#l^zh;gs;7D;"}{^mϽMX4?\jO\I]?z\Ʒ> ի/[Ռ{‹"(‹"(‹"(‹"(‹*jՇ(?82i3FoP[FExQExQExQExQExQExQExQExQEV6+P‡zuo<zU-kʹeG§lh+vw>e6e-[N'U)k)|>e"7"|EoD>߈)#|SF,"|#§YDFOѭBםS_Pk^E^E^E^E^E^E^TV\ѷ'/ n_\u §~Wg.m-﮿u§ޫWOTDc8N§WꕛzIv9xѝO٩OlFꕻôaFw>ekW5gU! 1^mt?%n!|@~W%=5u4V[Ճk &t/////////////////////////////////////////%(2cIENDB`RNeXML/vignettes/simmap.Rmd0000644000176200001440000001526213614141212015262 0ustar liggesusers--- title: "Extending NeXML: an example based on simmap" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette bibliography: references.bib --- ## Extending the NeXML standard through metadata annotation. Here we illustrate this process using the example of stochastic character mapping [@Huelsenbeck_2003]. A stochastic character map is simply an annotation of the branches on a phylogeny, assigning each section of each branch to a particular "state" (typically of a morphological characteristic). @Bollback_2006 provides a widely used stand-alone software implementation of this method in the software `simmap`, which modified the standard Newick tree format to express this additional information. This can break compatibility with other software, and creates a format that cannot be interpreted without additional information describing this convention. By contrast, the NeXML extension is not only backwards compatible but contains a precise and machine-readable description of what it is encoding. In this example, we illustrate how the additional information required to define a stochastic character mapping (a `simmap` mapping) in NeXML. @Revell_2012 describes the `phytools` package for R, which includes utilities for reading, manipulating, and writing `simmap` files in R. In this example, we also show how to define `RNeXML` functions that map the R representation used by Revell (an extension of the `ape` class) into the NeXML extension we have defined by using `RNeXML` functions. Since a stochastic character map simply assigns different states to parts of a branch (or edge) on the phylogenetic tree, we can create a NeXML representation by annotating the `edge` elements with appropriate `meta` elements. These elements need to describe the character state being assigned and the duration (in terms of branch-length) that the edge spends in that state (Stochastic character maps are specific to time-calibrated or ultrametric trees). NeXML already defines the `characters` element to handle discrete character traits (`nex:char`) and the states they can assume (`nex:state`). We will thus reuse the `characters` element for this purpose, referring to both the character trait and the states by the ids assigned to them in that element. (NeXML's convention of referring to everything by id permits a single canonical definition of each term, making it clear where additional annotation belongs). For each edge, we need to indicate: - That our annotation contains a stochastic character mapping reconstruction - Since many reconstructions are possible for a single edge, we give each reconstruction an id - We indicate for which character trait we are defining the reconstruction - We then indicate which states the character assumes on that edge. For each state realized on the edge, that involves stating: + the state assignment + the duration (length of time) for which the edge spends in the given state + the order in which the state changes happen (Though we could just assume state transitions are listed chronologically, NeXML suggests making all data explicit, rather than relying on the structure of the data file to convey information). Thus the annotation for an edge that switches from state `s2` to state `s1` of character `cr1` would be constructed like this: ```r m <- meta("simmap:reconstructions", children = c( meta("simmap:reconstruction", children = c( meta("simmap:char", "cr1"), meta("simmap:stateChange", children = c( meta("simmap:order", 1), meta("simmap:length", "0.2030"), meta("simmap:state", "s2"))), meta("simmap:char", "cr1"), meta("simmap:stateChange", children = c( meta("simmap:order", 2), meta("simmap:length", "0.0022"), meta("simmap:state", "s1"))) )))) ``` Of course writing out such a definition manually becomes tedious quickly. Because these are just R commands, we can easily define a function that can loop over an assignment like this for each edge, extracting the appropriate order, length and state from an existing R object such as that provided in the `phytools` package. Likewise, it is straightforward to define a function that reads this data using the `RNeXML` utilities and converts it back to the `phytools` package. The full implementation of this mapping can be seen in the `simmap_to_nexml()` and the `nexml_to_simmap()` functions provided in the `RNeXML` package. As the code indicates, the key step is simply to define the data in meta elements. In so doing, we have defined a custom namespace, `simmap`, to hold our variables. This allows us to provide a URL with more detailed descriptions of what each of these elements mean: ```r nex <- add_namespaces(c(simmap = "https://github.com/ropensci/RNeXML/tree/master/inst/simmap.md")) ``` At that URL we have posted a simple description of each term. Using this convention we can generate NeXML files containing `simmap` data, read those files into R, and convert them back into the `phytools` package format. These simple functions serve as further illustration of how `RNeXML` can be used to extend the NeXML standard. We illustrate their use briefly here, starting with loading a `nexml` object containing a `simmap` reconstruction into R: ```r f <- system.file("examples", "simmap_ex.xml", package = "RNeXML") simmap_ex <- read.nexml(f) ``` The `get_trees()` function can be used to return an `ape::phylo` tree as usual. `RNeXML` automatically detects the `simmap` reconstruction data and returns includes this in a `maps` element of the `ape::phylo` object, for use with other `phytools` functions. ```r phy <- nexml_to_simmap(simmap_ex) ``` We can then use various functions from `phytools` designed for `simmap` objects [@Revell_2012], such as the plotting function: ```r library("phytools") plotSimmap(phy) ``` ``` no colors provided. using the following legend: A B C "black" "red" "green3" ``` ![Stochastic character mapping on a phylogeny, as generated by the phytools package after parsing the simmap-extended NeXML.](simmap-Figure1-1.png) Likewise, we can convert the object back in the NeXML format and write it out to file to be read by other users. ```r nex <- simmap_to_nexml(phy) nexml_write(nex, "simmap.xml") ``` ``` [1] "simmap.xml" ``` Though other NeXML parsers (for instance, for Perl or Python) have not been written explicitly to express `simmap` data, those parsers will nonetheless be able to successfully parse this file and expose the `simmap` data to the user. RNeXML/vignettes/simmap.Rmd.orig0000644000176200001440000001564613614140575016242 0ustar liggesusers--- title: "Extending NeXML: an example based on simmap" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette bibliography: references.bib --- ```{r compile-settings, include=FALSE} library("methods") library("knitr") knitr::opts_chunk$set(fig.path="simmap-") opts_chunk$set(tidy = FALSE, warning = FALSE, message = FALSE, cache = FALSE, comment = NA, verbose = TRUE) basename <- gsub(".Rmd", "", knitr:::knit_concord$get('infile')) library("RNeXML") ``` ## Extending the NeXML standard through metadata annotation. Here we illustrate this process using the example of stochastic character mapping [@Huelsenbeck_2003]. A stochastic character map is simply an annotation of the branches on a phylogeny, assigning each section of each branch to a particular "state" (typically of a morphological characteristic). @Bollback_2006 provides a widely used stand-alone software implementation of this method in the software `simmap`, which modified the standard Newick tree format to express this additional information. This can break compatibility with other software, and creates a format that cannot be interpreted without additional information describing this convention. By contrast, the NeXML extension is not only backwards compatible but contains a precise and machine-readable description of what it is encoding. In this example, we illustrate how the additional information required to define a stochastic character mapping (a `simmap` mapping) in NeXML. @Revell_2012 describes the `phytools` package for R, which includes utilities for reading, manipulating, and writing `simmap` files in R. In this example, we also show how to define `RNeXML` functions that map the R representation used by Revell (an extension of the `ape` class) into the NeXML extension we have defined by using `RNeXML` functions. Since a stochastic character map simply assigns different states to parts of a branch (or edge) on the phylogenetic tree, we can create a NeXML representation by annotating the `edge` elements with appropriate `meta` elements. These elements need to describe the character state being assigned and the duration (in terms of branch-length) that the edge spends in that state (Stochastic character maps are specific to time-calibrated or ultrametric trees). NeXML already defines the `characters` element to handle discrete character traits (`nex:char`) and the states they can assume (`nex:state`). We will thus reuse the `characters` element for this purpose, referring to both the character trait and the states by the ids assigned to them in that element. (NeXML's convention of referring to everything by id permits a single canonical definition of each term, making it clear where additional annotation belongs). For each edge, we need to indicate: - That our annotation contains a stochastic character mapping reconstruction - Since many reconstructions are possible for a single edge, we give each reconstruction an id - We indicate for which character trait we are defining the reconstruction - We then indicate which states the character assumes on that edge. For each state realized on the edge, that involves stating: + the state assignment + the duration (length of time) for which the edge spends in the given state + the order in which the state changes happen (Though we could just assume state transitions are listed chronologically, NeXML suggests making all data explicit, rather than relying on the structure of the data file to convey information). Thus the annotation for an edge that switches from state `s2` to state `s1` of character `cr1` would be constructed like this: ```{r} m <- meta("simmap:reconstructions", children = c( meta("simmap:reconstruction", children = c( meta("simmap:char", "cr1"), meta("simmap:stateChange", children = c( meta("simmap:order", 1), meta("simmap:length", "0.2030"), meta("simmap:state", "s2"))), meta("simmap:char", "cr1"), meta("simmap:stateChange", children = c( meta("simmap:order", 2), meta("simmap:length", "0.0022"), meta("simmap:state", "s1"))) )))) ``` Of course writing out such a definition manually becomes tedious quickly. Because these are just R commands, we can easily define a function that can loop over an assignment like this for each edge, extracting the appropriate order, length and state from an existing R object such as that provided in the `phytools` package. Likewise, it is straightforward to define a function that reads this data using the `RNeXML` utilities and converts it back to the `phytools` package. The full implementation of this mapping can be seen in the `simmap_to_nexml()` and the `nexml_to_simmap()` functions provided in the `RNeXML` package. As the code indicates, the key step is simply to define the data in meta elements. In so doing, we have defined a custom namespace, `simmap`, to hold our variables. This allows us to provide a URL with more detailed descriptions of what each of these elements mean: ```{r} nex <- add_namespaces(c(simmap = "https://github.com/ropensci/RNeXML/tree/master/inst/simmap.md")) ``` At that URL we have posted a simple description of each term. Using this convention we can generate NeXML files containing `simmap` data, read those files into R, and convert them back into the `phytools` package format. These simple functions serve as further illustration of how `RNeXML` can be used to extend the NeXML standard. We illustrate their use briefly here, starting with loading a `nexml` object containing a `simmap` reconstruction into R: ```{r} f <- system.file("examples", "simmap_ex.xml", package = "RNeXML") simmap_ex <- read.nexml(f) ``` The `get_trees()` function can be used to return an `ape::phylo` tree as usual. `RNeXML` automatically detects the `simmap` reconstruction data and returns includes this in a `maps` element of the `ape::phylo` object, for use with other `phytools` functions. ```{r} phy <- nexml_to_simmap(simmap_ex) ``` We can then use various functions from `phytools` designed for `simmap` objects [@Revell_2012], such as the plotting function: ```{r Figure1, fig.cap="Stochastic character mapping on a phylogeny, as generated by the phytools package after parsing the simmap-extended NeXML."} library("phytools") plotSimmap(phy) ``` Likewise, we can convert the object back in the NeXML format and write it out to file to be read by other users. ```{r} nex <- simmap_to_nexml(phy) nexml_write(nex, "simmap.xml") ``` Though other NeXML parsers (for instance, for Perl or Python) have not been written explicitly to express `simmap` data, those parsers will nonetheless be able to successfully parse this file and expose the `simmap` data to the user. ```{r cleanup, include=FALSE} unlink("simmap.xml") ``` RNeXML/vignettes/intro.Rmd0000644000176200001440000002335613614141247015142 0ustar liggesusers--- title: "A Brief Introduction to RNeXML" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- Read in a `nexml` file: ```r f <- system.file("examples", "comp_analysis.xml", package="RNeXML") nexml <- nexml_read(f) ``` Pretty-print an overview of the components and metadata that make up the nexml object: ```r nexml # this is the same as show(nexml) ``` ``` ## A nexml object representing: ## 1 phylogenetic tree block(s), where: ## block 1 contains 1 phylogenetic tree(s) ## 2 character block(s), where: ## block 1 defines 1 continuous character(s) ## matrix 1 has 10 row(s) ## block 2 defines 1 standard/discrete character(s), with 2 states each ## and 0 polymorphic or uncertain state(s) defined ## matrix 2 has 10 row(s) ## 10 taxonomic units in 1 block(s) ## Taxa: taxon_1, taxon_2, taxon_3, taxon_4, taxon_5, taxon_6 ... ## Metadata annotations: ## 2 at top level ## 0 in block 1 at otu level ## 0 in block 1 at char level ## 0 in block 2 at char level ## 0 in block 1 at state level ## 0 in block 2 at state level ## ## Author(s): rvosa ## ## NeXML generated by Bio::Phylo::Project v.0.56 using schema version: 0.9 ## Size: 289.3 Kb ``` Create a summary object of various component and metadata counts (the `show()` method uses this): ```r summary(nexml) ``` ``` ## $nblocks ## trees otus characters ## 1 1 2 ## ## $ncharacters ## block.1 block.2 ## 1 1 ## ## $nstates ## block.1 block.2 ## Min. NA 2 ## 1st Qu. NA 2 ## Median NA 2 ## Mean NA 2 ## 3rd Qu. NA 2 ## Max. NA 2 ## ## $nnonstdstatedefs ## polymorphic uncertain ## block.1 NA NA ## block.2 0 0 ## ## $nmatrixrows ## block.1 block.2 ## 10 10 ## ## $ntrees ## block.1 ## 1 ## ## $notus ## block.1 ## 10 ## ## $nmeta ## $nmeta$nexml ## [1] 2 ## ## $nmeta$otu ## block.1 ## 0 ## ## $nmeta$char ## block.1 block.2 ## 0 0 ## ## $nmeta$state ## block.1 block.2 ## 0 0 ``` Extract trees from nexml into the `ape::phylo` format: ```r tr <- get_trees(nexml) # or: as(nexml, "phylo") plot(tr) ``` ![plot of chunk unnamed-chunk-5](intro-unnamed-chunk-5-1.png) Write an `ape::phylo` tree into the `nexml` format: ```r data(bird.orders) nexml_write(bird.orders, "test.xml", creator = "Carl Boettiger") ``` ``` ## [1] "test.xml" ``` A key feature of NeXML is the ability to formally validate the construction of the data file against the standard (the lack of such a feature in nexus files had lead to inconsistencies across different software platforms, and some files that cannot be read at all). While it is difficult to make an invalid NeXML file from `RNeXML`, it never hurts to validate just to be sure: ```r nexml_validate("test.xml") ``` ``` ## [1] TRUE ``` Extract metadata from the NeXML file: ```r birds <- nexml_read("test.xml") get_taxa(birds) ``` ``` ## otu label xsi.type otus ## 1 ou37 Struthioniformes NA os3 ## 2 ou38 Tinamiformes NA os3 ## 3 ou39 Craciformes NA os3 ## 4 ou40 Galliformes NA os3 ## 5 ou41 Anseriformes NA os3 ## 6 ou42 Turniciformes NA os3 ## 7 ou43 Piciformes NA os3 ## 8 ou44 Galbuliformes NA os3 ## 9 ou45 Bucerotiformes NA os3 ## 10 ou46 Upupiformes NA os3 ## 11 ou47 Trogoniformes NA os3 ## 12 ou48 Coraciiformes NA os3 ## 13 ou49 Coliiformes NA os3 ## 14 ou50 Cuculiformes NA os3 ## 15 ou51 Psittaciformes NA os3 ## 16 ou52 Apodiformes NA os3 ## 17 ou53 Trochiliformes NA os3 ## 18 ou54 Musophagiformes NA os3 ## 19 ou55 Strigiformes NA os3 ## 20 ou56 Columbiformes NA os3 ## 21 ou57 Gruiformes NA os3 ## 22 ou58 Ciconiiformes NA os3 ## 23 ou59 Passeriformes NA os3 ``` ```r get_metadata(birds) ``` ``` ## property datatype content xsi.type href Meta ## 1 dc:creator xsd:string Carl Boettiger LiteralMeta m278 ## 2 dcterms:modified xsd:string 2020-01-28 23:24:19 GMT LiteralMeta m279 ## 3 cc:license ResourceMeta http://creativecommons.org/publicdomain/zero/1.0/ m280 ``` -------------------------------------------- Add basic additional metadata: ```r nexml_write(bird.orders, file="meta_example.xml", title = "My test title", description = "A description of my test", creator = "Carl Boettiger ", publisher = "unpublished data", pubdate = "2012-04-01") ``` ``` ## [1] "meta_example.xml" ``` By default, `RNeXML` adds certain metadata, including the NCBI taxon id numbers for all named taxa. This acts a check on the spelling and definitions of the taxa as well as providing a link to additional metadata about each taxonomic unit described in the dataset. ### Advanced annotation We can also add arbitrary metadata to a NeXML tree by define `meta` objects: ```r modified <- meta(property = "prism:modificationDate", content = "2013-10-04") ``` Advanced use requires specifying the namespace used. Metadata follows the RDFa conventions. Here we indicate the modification date using the prism vocabulary. This namespace is included by default, as it is used for some of the basic metadata shown in the previous example. We can see from this list: ```r RNeXML:::nexml_namespaces ``` ``` ## nex xsi ## "http://www.nexml.org/2009" "http://www.w3.org/2001/XMLSchema-instance" ## xml cdao ## "http://www.w3.org/XML/1998/namespace" "http://purl.obolibrary.org/obo/" ## xsd dc ## "http://www.w3.org/2001/XMLSchema#" "http://purl.org/dc/elements/1.1/" ## dcterms prism ## "http://purl.org/dc/terms/" "http://prismstandard.org/namespaces/1.2/basic/" ## cc ncbi ## "http://creativecommons.org/ns#" "http://www.ncbi.nlm.nih.gov/taxonomy#" ## tc ## "http://rs.tdwg.org/ontology/voc/TaxonConcept#" ``` This next block defines a resource (link), described by the `rel` attribute as a homepage, a term in the `foaf` vocabulary. Because `foaf` is not a default namespace, we will have to provide its URL in the full definition below. ```r website <- meta(href = "http://carlboettiger.info", rel = "foaf:homepage") ``` Here we create a history node using the `skos` namespace. We can also add id values to any metadata element to make the element easier to reference externally: ```r history <- meta(property = "skos:historyNote", content = "Mapped from the bird.orders data in the ape package using RNeXML", id = "meta123") ``` For this kind of richer annotation, it is best to build up our NeXML object sequentially. First we will add `bird.orders` phylogeny to a new phylogenetic object, and then we will add the metadata elements created above to this object. Finally, we will write the object out as an XML file: ```r birds <- add_trees(bird.orders) birds <- add_meta(meta = list(history, modified, website), namespaces = c(skos = "http://www.w3.org/2004/02/skos/core#", foaf = "http://xmlns.com/foaf/0.1/"), nexml=birds) nexml_write(birds, file = "example.xml") ``` ``` ## [1] "example.xml" ``` ### Taxonomic identifiers Add taxonomic identifier metadata to the OTU elements: ```r nex <- add_trees(bird.orders) nex <- taxize_nexml(nex) ``` ## Working with character data NeXML also provides a standard exchange format for handling character data. The R platform is particularly popular in the context of phylogenetic comparative methods, which consider both a given phylogeny and a set of traits. NeXML provides an ideal tool for handling this metadata. ### Extracting character data We can load the library, parse the NeXML file and extract both the characters and the phylogeny. ```r library(RNeXML) nexml <- read.nexml(system.file("examples", "comp_analysis.xml", package="RNeXML")) traits <- get_characters(nexml) tree <- get_trees(nexml) ``` (Note that `get_characters` would return both discrete and continuous characters together in the same data.frame, but we use `get_characters_list` to get separate data.frames for the continuous `characters` block and the discrete `characters` block). We can then fire up `geiger` and fit, say, a Brownian motion model the continuous data and a Markov transition matrix to the discrete states: ```r library(geiger) fitContinuous(tree, traits[1], ncores=1) fitDiscrete(tree, traits[2], ncores=1) ``` RNeXML/vignettes/metadata.Rmd0000644000176200001440000026112313614125724015565 0ustar liggesusers--- title: "Handling Metadata in RNeXML" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- ## Writing NeXML metadata The `add_basic_meta()` function takes as input an existing `nexml` object (like the other `add_` functions, if none is provided it will create one), and at the time of this writing any of the following parameters: `title`, `description`, `creator`, `pubdate`, `rights`, `publisher`, `citation`. Other metadata elements and corresponding parameters may be added in the future. Load the packages and data: ```r library('RNeXML') data(bird.orders) ``` Create an `nexml` object for the phylogeny `bird.orders` and add appropriate metadata: ```r birds <- add_trees(bird.orders) birds <- add_basic_meta( title = "Phylogeny of the Orders of Birds From Sibley and Ahlquist", description = "This data set describes the phylogenetic relationships of the orders of birds as reported by Sibley and Ahlquist (1990). Sibley and Ahlquist inferred this phylogeny from an extensive number of DNA/DNA hybridization experiments. The ``tapestry'' reported by these two authors (more than 1000 species out of the ca. 9000 extant bird species) generated a lot of debates. The present tree is based on the relationships among orders. The branch lengths were calculated from the values of Delta T50H as found in Sibley and Ahlquist (1990, fig. 353).", citation = "Sibley, C. G. and Ahlquist, J. E. (1990) Phylogeny and classification of birds: a study in molecular evolution. New Haven: Yale University Press.", creator = "Sibley, C. G. and Ahlquist, J. E.", nexml=birds) ``` Instead of a literal string, citations can also be provided in R's `bibentry` type, which is the one in which R package citations are obtained: ```r birds <- add_basic_meta(citation = citation("ape"), nexml = birds) ``` ## Taxonomic identifiers RNeXML now uses `taxald` for fast look-up of taxonomic information. If a unique match is found, a metadata annotation is added to the taxon providing the unique URI to the taxonomic unit. ```r birds <- taxize_nexml(birds, "NCBI") ``` If no perfect match is found, the user is warned to check for possible typographic errors in the taxonomic labels provided. ## Custom metadata extensions We can get a list of namespaces along with their prefixes from the `nexml` object: ```r prefixes <- get_namespaces(birds) prefixes["dc"] ``` ``` dc "http://purl.org/dc/elements/1.1/" ``` We create a `meta` element containing this annotation using the `meta` function: ```r modified <- meta(property = "prism:modificationDate", content = "2013-10-04") ``` We can add this annotation to our existing `birds` NeXML file using the `add_meta()` function. Because we do not specify a level, it is added to the root node, referring to the NeXML file as a whole. ```r birds <- add_meta(modified, birds) ``` The built-in vocabularies are just the tip of the iceberg of established vocabularies. Here we add an annotation from the `skos` namespace which describes the history of where the data comes from: ```r history <- meta(property = "skos:historyNote", content = "Mapped from the bird.orders data in the ape package using RNeXML") ``` Because `skos` is not in the current namespace list, we add it with a url when adding this meta element. We also specify that this annotation be placed at the level of the `trees` sub-node in the NeXML file. ```r birds <- add_meta(history, birds, level = "trees", namespaces = c(skos = "http://www.w3.org/2004/02/skos/core#")) ``` For finer control of the level at which a `meta` element is added, we will manipulate the `nexml` R object directly using S4 sub-setting, as shown in the supplement. Much richer metadata annotation is possible. Later we illustrate how metadata annotation can be used to extend the base NeXML format to represent new forms of data while maintaining compatibility with any NeXML parser. The `RNeXML` package can be easily extended to support helper functions such as `taxize_nexml` to add additional metadata without imposing a large burden on the user. ## Reading NeXML metadata A call to the `nexml` object prints some metadata summarizing the data structure: ```r birds ``` ``` A nexml object representing: 1 phylogenetic tree block(s), where: block 1 contains 1 phylogenetic tree(s) 0 character block(s), 23 taxonomic units in 1 block(s) Taxa: Struthioniformes, Tinamiformes, Craciformes, Galliformes, Anseriformes, Turniciformes ... Metadata annotations: 18 at top level 0 in block 1 at otu level This data set describes the phylogenetic relationships of the orders of birds as reported by Sibley and Ahlquist (1990). Sibley and Ahlquist inferred this phylogeny from an extensive number of DNA/DNA hybridization experiments. The ``tapestry'' reported by these two authors (more than 1000 species out of the ca. 9000 extant bird species) generated a lot of debates. The present tree is based on the relationships among orders. The branch lengths were calculated from the values of Delta T50H as found in Sibley and Ahlquist (1990, fig. 353). Author(s): Sibley, C. G. and Ahlquist, J. E., cboettig License: http://creativecommons.org/publicdomain/zero/1.0/ NeXML generated by RNeXML using schema version: 0.9 Size: 358.3 Kb ``` We can extract all metadata pertaining to the NeXML document as a whole (annotations of the XML root node, ``) with the command ```r meta <- get_metadata(birds) ``` This returns a data.frame of available metadata. We can see the kinds of metadata recorded from the names: ```r meta ``` ``` property datatype 1 dc:title xsd:string 2 dc:creator xsd:string 3 dc:description xsd:string 4 cc:license 5 dcterms:bibliographicCitation xsd:string 6 dc:creator xsd:string 7 dcterms:references 8 prism:modificationDate xsd:string 9 prism:volume xsd:string 10 dc:publisher xsd:string 11 prism:publicationName xsd:string 12 prism:endingPage xsd:string 13 prism:startingPage xsd:string 14 prism:publicationDate xsd:string 15 dc:title xsd:string 16 dc:contributor xsd:string 17 dc:contributor xsd:string 18 dcterms:bibliographicCitation xsd:string content 1 Phylogeny of the Orders of Birds From Sibley and Ahlquist 2 Sibley, C. G. and Ahlquist, J. E. 3 This data set describes the phylogenetic relationships of the\n orders of birds as reported by Sibley and Ahlquist (1990). Sibley\n and Ahlquist inferred this phylogeny from an extensive number of\n DNA/DNA hybridization experiments. The ``tapestry'' reported by\n these two authors (more than 1000 species out of the ca. 9000\n extant bird species) generated a lot of debates.\n\n The present tree is based on the relationships among orders. The\n branch lengths were calculated from the values of Delta T50H as\n found in Sibley and Ahlquist (1990, fig. 353). 4 5 Sibley, C. G. and Ahlquist, J. E. (1990) Phylogeny and\n classification of birds: a study in molecular evolution. New\n Haven: Yale University Press. 6 cboettig 7 8 2013-10-04 9 35 10 Bioinformatics 11 Bioinformatics 12 528 13 526 14 2018 15 ape 5.0: an environment for modern phylogenetics and evolutionary analyses in {R} 16 E. Paradis 17 K. Schliep 18 Paradis E, Schliep K (2018). "ape 5.0: an environment for modern phylogenetics and evolutionary analyses in R."\n_Bioinformatics_, *35*, 526-528. xsi.type href Meta meta 1 LiteralMeta m544 2 LiteralMeta m545 3 LiteralMeta m546 4 ResourceMeta http://creativecommons.org/publicdomain/zero/1.0/ m547 5 LiteralMeta m548 6 LiteralMeta m549 7 ResourceMeta m560 8 LiteralMeta m561 9 LiteralMeta m560 10 LiteralMeta m560 11 LiteralMeta m560 12 LiteralMeta m560 13 LiteralMeta m560 14 LiteralMeta m560 15 LiteralMeta m560 16 LiteralMeta m560 17 LiteralMeta m560 18 LiteralMeta m560 ``` We can also access a table of taxonomic metadata: ```r get_taxa(birds) ``` ``` otu label xsi.type otus 1 ou362 Struthioniformes NA os8 2 ou363 Tinamiformes NA os8 3 ou364 Craciformes NA os8 4 ou365 Galliformes NA os8 5 ou366 Anseriformes NA os8 6 ou367 Turniciformes NA os8 7 ou368 Piciformes NA os8 8 ou369 Galbuliformes NA os8 9 ou370 Bucerotiformes NA os8 10 ou371 Upupiformes NA os8 11 ou372 Trogoniformes NA os8 12 ou373 Coraciiformes NA os8 13 ou374 Coliiformes NA os8 14 ou375 Cuculiformes NA os8 15 ou376 Psittaciformes NA os8 16 ou377 Apodiformes NA os8 17 ou378 Trochiliformes NA os8 18 ou379 Musophagiformes NA os8 19 ou380 Strigiformes NA os8 20 ou381 Columbiformes NA os8 21 ou382 Gruiformes NA os8 22 ou383 Ciconiiformes NA os8 23 ou384 Passeriformes NA os8 ``` Which returns text from the otu element labels, typically used to define taxonomic names, rather than text from explicit meta elements. We can also access metadata at a specific level (or use `level=all` to extract all meta elements in a list). Here we show only the first few results: ```r otu_meta <- get_metadata(birds, level="otus/otu") otu_meta ``` ``` # A tibble: 0 x 3 # … with 3 variables: otu , otus , Meta ``` ## Merging metadata tables We often want to combine metadata from multiple tables. For instance, in this exercise we want to include the taxonomic identifier and id value for each species returned in the character table. This helps us more precisely identify the species whose traits are described by the table. ```r library("RNeXML") library("dplyr") library("geiger") ``` To begin, let's generate a `NeXML` file using the tree and trait data from the `geiger` package's "primates" data: ```r data("primates") add_trees(primates$phy) %>% add_characters(primates$dat, ., append=TRUE) %>% taxize_nexml("itis") -> nex ``` (Note that we've used `dplyr`'s cute pipe syntax, but unfortunately our `add_` methods take the `nexml` object as the _second_ argument instead of the first, so this isn't as elegant since we need the stupid `.` to show where the piped output should go...) We now read in the three tables of interest. Note that we tell `get_characters` to give us species labels as there own column, rather than as rownames. The latter is the default only because this plays more nicely with the default format for character matrices that is expected by `geiger` and other phylogenetics packages, but is in general a silly choice for data manipulation. ```r otu_meta <- get_metadata(nex, "otus/otu") taxa <- get_taxa(nex) char <- get_characters(nex, rownames_as_col = TRUE) ``` We can take a peek at what the tables look like, just to orient ourselves: ```r otu_meta ``` ``` property href xsi.type otu otus 1 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572992 ResourceMeta ou385 os9 2 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572857 ResourceMeta ou386 os9 3 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572935 ResourceMeta ou387 os9 4 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572936 ResourceMeta ou388 os9 5 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945168 ResourceMeta ou389 os9 6 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945164 ResourceMeta ou390 os9 7 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572939 ResourceMeta ou391 os9 8 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572940 ResourceMeta ou392 os9 9 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572941 ResourceMeta ou393 os9 10 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572942 ResourceMeta ou394 os9 11 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944172 ResourceMeta ou395 os9 12 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572944 ResourceMeta ou396 os9 13 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949 ResourceMeta ou397 os9 14 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945149 ResourceMeta ou398 os9 15 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949 ResourceMeta ou399 os9 16 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572947 ResourceMeta ou400 os9 17 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572945 ResourceMeta ou401 os9 18 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572946 ResourceMeta ou402 os9 19 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572951 ResourceMeta ou403 os9 20 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572952 ResourceMeta ou404 os9 21 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572887 ResourceMeta ou405 os9 22 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572888 ResourceMeta ou406 os9 23 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572954 ResourceMeta ou407 os9 24 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572955 ResourceMeta ou408 os9 25 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572957 ResourceMeta ou409 os9 26 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572958 ResourceMeta ou410 os9 27 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572956 ResourceMeta ou411 os9 28 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572953 ResourceMeta ou412 os9 29 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572881 ResourceMeta ou413 os9 30 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572959 ResourceMeta ou414 os9 31 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572983 ResourceMeta ou415 os9 32 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572984 ResourceMeta ou416 os9 33 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025131 ResourceMeta ou417 os9 34 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134 ResourceMeta ou418 os9 35 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025122 ResourceMeta ou419 os9 36 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025127 ResourceMeta ou420 os9 37 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025112 ResourceMeta ou421 os9 38 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134 ResourceMeta ou422 os9 39 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025125 ResourceMeta ou423 os9 40 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025116 ResourceMeta ou424 os9 41 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025119 ResourceMeta ou425 os9 42 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025114 ResourceMeta ou426 os9 43 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025115 ResourceMeta ou427 os9 44 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572962 ResourceMeta ou428 os9 45 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025106 ResourceMeta ou429 os9 46 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572909 ResourceMeta ou430 os9 47 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944125 ResourceMeta ou431 os9 48 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572911 ResourceMeta ou432 os9 49 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572912 ResourceMeta ou433 os9 50 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572913 ResourceMeta ou434 os9 51 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944138 ResourceMeta ou435 os9 52 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572915 ResourceMeta ou436 os9 53 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572916 ResourceMeta ou437 os9 54 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572918 ResourceMeta ou438 os9 55 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944123 ResourceMeta ou439 os9 56 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572975 ResourceMeta ou440 os9 57 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944156 ResourceMeta ou441 os9 58 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572977 ResourceMeta ou442 os9 59 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572978 ResourceMeta ou443 os9 60 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572993 ResourceMeta ou444 os9 61 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572994 ResourceMeta ou445 os9 62 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572995 ResourceMeta ou446 os9 63 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572996 ResourceMeta ou447 os9 64 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572997 ResourceMeta ou448 os9 65 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572998 ResourceMeta ou449 os9 66 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572999 ResourceMeta ou450 os9 67 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573000 ResourceMeta ou451 os9 68 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573001 ResourceMeta ou452 os9 69 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573002 ResourceMeta ou453 os9 70 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573003 ResourceMeta ou454 os9 71 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944219 ResourceMeta ou455 os9 72 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573005 ResourceMeta ou456 os9 73 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573006 ResourceMeta ou457 os9 74 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573007 ResourceMeta ou458 os9 75 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573008 ResourceMeta ou459 os9 76 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573009 ResourceMeta ou460 os9 77 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573010 ResourceMeta ou461 os9 78 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945227 ResourceMeta ou462 os9 79 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573014 ResourceMeta ou463 os9 80 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944221 ResourceMeta ou464 os9 81 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573011 ResourceMeta ou465 os9 82 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572858 ResourceMeta ou466 os9 83 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572859 ResourceMeta ou467 os9 84 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572985 ResourceMeta ou468 os9 85 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572986 ResourceMeta ou469 os9 86 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=552515 ResourceMeta ou470 os9 87 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573035 ResourceMeta ou471 os9 88 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573036 ResourceMeta ou472 os9 89 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573037 ResourceMeta ou473 os9 90 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573038 ResourceMeta ou474 os9 91 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572886 ResourceMeta ou475 os9 92 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573015 ResourceMeta ou476 os9 93 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572865 ResourceMeta ou477 os9 94 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572864 ResourceMeta ou478 os9 95 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572866 ResourceMeta ou479 os9 96 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572867 ResourceMeta ou480 os9 97 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572868 ResourceMeta ou481 os9 98 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572893 ResourceMeta ou482 os9 99 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572894 ResourceMeta ou483 os9 100 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944100 ResourceMeta ou484 os9 101 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572896 ResourceMeta ou485 os9 102 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572897 ResourceMeta ou486 os9 103 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572898 ResourceMeta ou487 os9 104 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572899 ResourceMeta ou488 os9 105 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572900 ResourceMeta ou489 os9 106 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025177 ResourceMeta ou490 os9 107 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573080 ResourceMeta ou491 os9 108 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572869 ResourceMeta ou492 os9 109 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572870 ResourceMeta ou493 os9 110 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944072 ResourceMeta ou494 os9 111 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180092 ResourceMeta ou495 os9 112 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573069 ResourceMeta ou496 os9 113 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944286 ResourceMeta ou497 os9 114 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944292 ResourceMeta ou498 os9 115 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945338 ResourceMeta ou499 os9 116 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573073 ResourceMeta ou500 os9 117 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573074 ResourceMeta ou501 os9 118 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944290 ResourceMeta ou502 os9 119 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573076 ResourceMeta ou503 os9 120 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573077 ResourceMeta ou504 os9 121 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573078 ResourceMeta ou505 os9 122 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944293 ResourceMeta ou506 os9 123 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572882 ResourceMeta ou507 os9 124 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572961 ResourceMeta ou508 os9 125 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944187 ResourceMeta ou509 os9 126 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572872 ResourceMeta ou510 os9 127 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572921 ResourceMeta ou511 os9 128 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572920 ResourceMeta ou513 os9 129 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572922 ResourceMeta ou514 os9 130 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572874 ResourceMeta ou515 os9 131 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572875 ResourceMeta ou516 os9 132 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572876 ResourceMeta ou517 os9 133 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572877 ResourceMeta ou518 os9 134 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572878 ResourceMeta ou519 os9 135 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572879 ResourceMeta ou520 os9 136 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572880 ResourceMeta ou521 os9 137 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573016 ResourceMeta ou522 os9 138 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572889 ResourceMeta ou523 os9 139 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573017 ResourceMeta ou524 os9 140 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573018 ResourceMeta ou525 os9 141 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573019 ResourceMeta ou526 os9 142 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180098 ResourceMeta ou527 os9 143 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=555659 ResourceMeta ou528 os9 144 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573020 ResourceMeta ou529 os9 145 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180099 ResourceMeta ou530 os9 146 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573021 ResourceMeta ou531 os9 147 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573022 ResourceMeta ou532 os9 148 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573023 ResourceMeta ou533 os9 149 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573024 ResourceMeta ou534 os9 150 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573025 ResourceMeta ou535 os9 151 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573026 ResourceMeta ou536 os9 152 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573027 ResourceMeta ou537 os9 153 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573028 ResourceMeta ou538 os9 154 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573029 ResourceMeta ou539 os9 155 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573030 ResourceMeta ou540 os9 156 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573031 ResourceMeta ou541 os9 157 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944041 ResourceMeta ou542 os9 158 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572861 ResourceMeta ou543 os9 159 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572862 ResourceMeta ou544 os9 160 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573032 ResourceMeta ou545 os9 161 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944263 ResourceMeta ou546 os9 162 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573040 ResourceMeta ou547 os9 163 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572890 ResourceMeta ou548 os9 164 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572891 ResourceMeta ou549 os9 165 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572902 ResourceMeta ou550 os9 166 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572903 ResourceMeta ou551 os9 Meta 1 m563 2 m564 3 m565 4 m566 5 m567 6 m568 7 m569 8 m570 9 m571 10 m572 11 m573 12 m574 13 m575 14 m576 15 m577 16 m578 17 m579 18 m580 19 m581 20 m582 21 m583 22 m584 23 m585 24 m586 25 m587 26 m588 27 m589 28 m590 29 m591 30 m592 31 m593 32 m594 33 m595 34 m596 35 m597 36 m598 37 m599 38 m600 39 m601 40 m602 41 m603 42 m604 43 m605 44 m606 45 m607 46 m608 47 m609 48 m610 49 m611 50 m612 51 m613 52 m614 53 m615 54 m616 55 m617 56 m618 57 m619 58 m620 59 m621 60 m622 61 m623 62 m624 63 m625 64 m626 65 m627 66 m628 67 m629 68 m630 69 m631 70 m632 71 m633 72 m634 73 m635 74 m636 75 m637 76 m638 77 m639 78 m640 79 m641 80 m642 81 m643 82 m644 83 m645 84 m646 85 m647 86 m648 87 m649 88 m650 89 m651 90 m652 91 m653 92 m654 93 m655 94 m656 95 m657 96 m658 97 m659 98 m660 99 m661 100 m662 101 m663 102 m664 103 m665 104 m666 105 m667 106 m668 107 m669 108 m670 109 m671 110 m672 111 m673 112 m674 113 m675 114 m676 115 m677 116 m678 117 m679 118 m680 119 m681 120 m682 121 m683 122 m684 123 m685 124 m686 125 m687 126 m688 127 m689 128 m690 129 m691 130 m692 131 m693 132 m694 133 m695 134 m696 135 m697 136 m698 137 m699 138 m700 139 m701 140 m702 141 m703 142 m704 143 m705 144 m706 145 m707 146 m708 147 m709 148 m710 149 m711 150 m712 151 m713 152 m714 153 m715 154 m716 155 m717 156 m718 157 m719 158 m720 159 m721 160 m722 161 m723 162 m724 163 m725 164 m726 165 m727 166 m728 [ reached 'max' / getOption("max.print") -- omitted 66 rows ] ``` ```r taxa ``` ``` otu label xsi.type otus 1 ou385 Allenopithecus_nigroviridis NA os9 2 ou386 Allocebus_trichotis NA os9 3 ou387 Alouatta_belzebul NA os9 4 ou388 Alouatta_caraya NA os9 5 ou389 Alouatta_coibensis NA os9 6 ou390 Alouatta_fusca NA os9 7 ou391 Alouatta_palliata NA os9 8 ou392 Alouatta_pigra NA os9 9 ou393 Alouatta_sara NA os9 10 ou394 Alouatta_seniculus NA os9 11 ou395 Aotus_azarai NA os9 12 ou396 Aotus_brumbacki NA os9 13 ou397 Aotus_hershkovitzi NA os9 14 ou398 Aotus_infulatus NA os9 15 ou399 Aotus_lemurinus NA os9 16 ou400 Aotus_miconax NA os9 17 ou401 Aotus_nancymaae NA os9 18 ou402 Aotus_nigriceps NA os9 19 ou403 Aotus_trivirgatus NA os9 20 ou404 Aotus_vociferans NA os9 21 ou405 Arctocebus_aureus NA os9 22 ou406 Arctocebus_calabarensis NA os9 23 ou407 Ateles_belzebuth NA os9 24 ou408 Ateles_chamek NA os9 25 ou409 Ateles_fusciceps NA os9 26 ou410 Ateles_geoffroyi NA os9 27 ou411 Ateles_marginatus NA os9 28 ou412 Ateles_paniscus NA os9 29 ou413 Avahi_laniger NA os9 30 ou414 Brachyteles_arachnoides NA os9 31 ou415 Cacajao_calvus NA os9 32 ou416 Cacajao_melanocephalus NA os9 33 ou417 Callicebus_brunneus NA os9 34 ou418 Callicebus_caligatus NA os9 35 ou419 Callicebus_cinerascens NA os9 36 ou420 Callicebus_cupreus NA os9 37 ou421 Callicebus_donacophilus NA os9 38 ou422 Callicebus_dubius NA os9 39 ou423 Callicebus_hoffmannsi NA os9 40 ou424 Callicebus_modestus NA os9 41 ou425 Callicebus_moloch NA os9 42 ou426 Callicebus_oenanthe NA os9 43 ou427 Callicebus_olallae NA os9 44 ou428 Callicebus_personatus NA os9 45 ou429 Callicebus_torquatus NA os9 46 ou430 Callimico_goeldii NA os9 47 ou431 Callithrix_argentata NA os9 48 ou432 Callithrix_aurita NA os9 49 ou433 Callithrix_flaviceps NA os9 50 ou434 Callithrix_geoffroyi NA os9 51 ou435 Callithrix_humeralifera NA os9 52 ou436 Callithrix_jacchus NA os9 53 ou437 Callithrix_kuhlii NA os9 54 ou438 Callithrix_penicillata NA os9 55 ou439 Callithrix_pygmaea NA os9 56 ou440 Cebus_albifrons NA os9 57 ou441 Cebus_apella NA os9 58 ou442 Cebus_capucinus NA os9 59 ou443 Cebus_olivaceus NA os9 60 ou444 Cercocebus_agilis NA os9 61 ou445 Cercocebus_galeritus NA os9 62 ou446 Cercocebus_torquatus NA os9 63 ou447 Cercopithecus_ascanius NA os9 64 ou448 Cercopithecus_campbelli NA os9 65 ou449 Cercopithecus_cephus NA os9 66 ou450 Cercopithecus_diana NA os9 67 ou451 Cercopithecus_dryas NA os9 68 ou452 Cercopithecus_erythrogaster NA os9 69 ou453 Cercopithecus_erythrotis NA os9 70 ou454 Cercopithecus_hamlyni NA os9 71 ou455 Cercopithecus_lhoesti NA os9 72 ou456 Cercopithecus_mitis NA os9 73 ou457 Cercopithecus_mona NA os9 74 ou458 Cercopithecus_neglectus NA os9 75 ou459 Cercopithecus_nictitans NA os9 76 ou460 Cercopithecus_petaurista NA os9 77 ou461 Cercopithecus_pogonias NA os9 78 ou462 Cercopithecus_preussi NA os9 79 ou463 Cercopithecus_sclateri NA os9 80 ou464 Cercopithecus_solatus NA os9 81 ou465 Cercopithecus_wolfi NA os9 82 ou466 Cheirogaleus_major NA os9 83 ou467 Cheirogaleus_medius NA os9 84 ou468 Chiropotes_albinasus NA os9 85 ou469 Chiropotes_satanas NA os9 86 ou470 Chlorocebus_aethiops NA os9 87 ou471 Colobus_angolensis NA os9 88 ou472 Colobus_guereza NA os9 89 ou473 Colobus_polykomos NA os9 90 ou474 Colobus_satanas NA os9 91 ou475 Daubentonia_madagascariensis NA os9 92 ou476 Erythrocebus_patas NA os9 93 ou477 Eulemur_coronatus NA os9 94 ou478 Eulemur_fulvus NA os9 95 ou479 Eulemur_macaco NA os9 96 ou480 Eulemur_mongoz NA os9 97 ou481 Eulemur_rubriventer NA os9 98 ou482 Euoticus_elegantulus NA os9 99 ou483 Euoticus_pallidus NA os9 100 ou484 Galago_alleni NA os9 101 ou485 Galago_gallarum NA os9 102 ou486 Galago_matschiei NA os9 103 ou487 Galago_moholi NA os9 104 ou488 Galago_senegalensis NA os9 105 ou489 Galagoides_demidoff NA os9 106 ou490 Galagoides_zanzibaricus NA os9 107 ou491 Gorilla_gorilla NA os9 108 ou492 Hapalemur_aureus NA os9 109 ou493 Hapalemur_griseus NA os9 110 ou494 Hapalemur_simus NA os9 111 ou495 Homo_sapiens NA os9 112 ou496 Hylobates_agilis NA os9 113 ou497 Hylobates_concolor NA os9 114 ou498 Hylobates_gabriellae NA os9 115 ou499 Hylobates_hoolock NA os9 116 ou500 Hylobates_klossii NA os9 117 ou501 Hylobates_lar NA os9 118 ou502 Hylobates_leucogenys NA os9 119 ou503 Hylobates_moloch NA os9 120 ou504 Hylobates_muelleri NA os9 121 ou505 Hylobates_pileatus NA os9 122 ou506 Hylobates_syndactylus NA os9 123 ou507 Indri_indri NA os9 124 ou508 Lagothrix_flavicauda NA os9 125 ou509 Lagothrix_lagotricha NA os9 126 ou510 Lemur_catta NA os9 127 ou511 Leontopithecus_caissara NA os9 128 ou512 Leontopithecus_chrysomela NA os9 129 ou513 Leontopithecus_chrysopygus NA os9 130 ou514 Leontopithecus_rosalia NA os9 131 ou515 Lepilemur_dorsalis NA os9 132 ou516 Lepilemur_edwardsi NA os9 133 ou517 Lepilemur_leucopus NA os9 134 ou518 Lepilemur_microdon NA os9 135 ou519 Lepilemur_mustelinus NA os9 136 ou520 Lepilemur_ruficaudatus NA os9 137 ou521 Lepilemur_septentrionalis NA os9 138 ou522 Lophocebus_albigena NA os9 139 ou523 Loris_tardigradus NA os9 140 ou524 Macaca_arctoides NA os9 141 ou525 Macaca_assamensis NA os9 142 ou526 Macaca_cyclopis NA os9 143 ou527 Macaca_fascicularis NA os9 144 ou528 Macaca_fuscata NA os9 145 ou529 Macaca_maura NA os9 146 ou530 Macaca_mulatta NA os9 147 ou531 Macaca_nemestrina NA os9 148 ou532 Macaca_nigra NA os9 149 ou533 Macaca_ochreata NA os9 150 ou534 Macaca_radiata NA os9 151 ou535 Macaca_silenus NA os9 152 ou536 Macaca_sinica NA os9 153 ou537 Macaca_sylvanus NA os9 154 ou538 Macaca_thibetana NA os9 155 ou539 Macaca_tonkeana NA os9 156 ou540 Mandrillus_leucophaeus NA os9 157 ou541 Mandrillus_sphinx NA os9 158 ou542 Microcebus_coquereli NA os9 159 ou543 Microcebus_murinus NA os9 160 ou544 Microcebus_rufus NA os9 161 ou545 Miopithecus_talapoin NA os9 162 ou546 Nasalis_concolor NA os9 163 ou547 Nasalis_larvatus NA os9 164 ou548 Nycticebus_coucang NA os9 165 ou549 Nycticebus_pygmaeus NA os9 166 ou550 Otolemur_crassicaudatus NA os9 167 ou551 Otolemur_garnettii NA os9 168 ou552 Pan_paniscus NA os9 169 ou553 Pan_troglodytes NA os9 170 ou554 Papio_hamadryas NA os9 171 ou555 Perodicticus_potto NA os9 172 ou556 Phaner_furcifer NA os9 173 ou557 Pithecia_aequatorialis NA os9 174 ou558 Pithecia_albicans NA os9 175 ou559 Pithecia_irrorata NA os9 176 ou560 Pithecia_monachus NA os9 177 ou561 Pithecia_pithecia NA os9 178 ou562 Pongo_pygmaeus NA os9 179 ou563 Presbytis_comata NA os9 180 ou564 Presbytis_femoralis NA os9 181 ou565 Presbytis_frontata NA os9 182 ou566 Presbytis_hosei NA os9 183 ou567 Presbytis_melalophos NA os9 184 ou568 Presbytis_potenziani NA os9 185 ou569 Presbytis_rubicunda NA os9 186 ou570 Presbytis_thomasi NA os9 187 ou571 Procolobus_badius NA os9 188 ou572 Procolobus_pennantii NA os9 189 ou573 Procolobus_preussi NA os9 190 ou574 Procolobus_rufomitratus NA os9 191 ou575 Procolobus_verus NA os9 192 ou576 Propithecus_diadema NA os9 193 ou577 Propithecus_tattersalli NA os9 194 ou578 Propithecus_verreauxi NA os9 195 ou579 Pygathrix_avunculus NA os9 196 ou580 Pygathrix_bieti NA os9 197 ou581 Pygathrix_brelichi NA os9 198 ou582 Pygathrix_nemaeus NA os9 199 ou583 Pygathrix_roxellana NA os9 200 ou584 Saguinus_bicolor NA os9 201 ou585 Saguinus_fuscicollis NA os9 202 ou586 Saguinus_geoffroyi NA os9 203 ou587 Saguinus_imperator NA os9 204 ou588 Saguinus_inustus NA os9 205 ou589 Saguinus_labiatus NA os9 206 ou590 Saguinus_leucopus NA os9 207 ou591 Saguinus_midas NA os9 208 ou592 Saguinus_mystax NA os9 209 ou593 Saguinus_nigricollis NA os9 210 ou594 Saguinus_oedipus NA os9 211 ou595 Saguinus_tripartitus NA os9 212 ou596 Saimiri_boliviensis NA os9 213 ou597 Saimiri_oerstedii NA os9 214 ou598 Saimiri_sciureus NA os9 215 ou599 Saimiri_ustus NA os9 216 ou600 Saimiri_vanzolinii NA os9 217 ou601 Semnopithecus_entellus NA os9 218 ou602 Tarsius_bancanus NA os9 219 ou603 Tarsius_dianae NA os9 220 ou604 Tarsius_pumilus NA os9 221 ou605 Tarsius_spectrum NA os9 222 ou606 Tarsius_syrichta NA os9 223 ou607 Theropithecus_gelada NA os9 224 ou608 Trachypithecus_auratus NA os9 225 ou609 Trachypithecus_cristatus NA os9 226 ou610 Trachypithecus_francoisi NA os9 227 ou611 Trachypithecus_geei NA os9 228 ou612 Trachypithecus_johnii NA os9 229 ou613 Trachypithecus_obscurus NA os9 230 ou614 Trachypithecus_phayrei NA os9 231 ou615 Trachypithecus_pileatus NA os9 232 ou616 Trachypithecus_vetulus NA os9 233 ou617 Varecia_variegata NA os9 ``` ```r head(char) ``` ``` taxa x 1 Allenopithecus_nigroviridis 8.465900 2 Allocebus_trichotis 4.368181 3 Alouatta_belzebul 8.729074 4 Alouatta_caraya 8.628735 5 Alouatta_coibensis 8.764053 6 Alouatta_fusca 8.554489 ``` Now that we have nice `data.frame` objects for all our data, it's easy to join them into the desired table with a few obvious `dplyr` commands: ```r taxa %>% left_join(char, by = c("label" = "taxa")) %>% left_join(otu_meta, by = "otu") %>% select(otu, label, x, href) ``` ``` otu label x 1 ou385 Allenopithecus_nigroviridis 8.465900 2 ou386 Allocebus_trichotis 4.368181 3 ou387 Alouatta_belzebul 8.729074 4 ou388 Alouatta_caraya 8.628735 5 ou389 Alouatta_coibensis 8.764053 6 ou390 Alouatta_fusca 8.554489 7 ou391 Alouatta_palliata 8.791790 8 ou392 Alouatta_pigra 8.881836 9 ou393 Alouatta_sara 8.796339 10 ou394 Alouatta_seniculus 8.767173 11 ou395 Aotus_azarai 7.127694 12 ou396 Aotus_brumbacki 6.401917 13 ou397 Aotus_hershkovitzi 6.684612 14 ou398 Aotus_infulatus 7.122867 15 ou399 Aotus_lemurinus 6.781058 16 ou400 Aotus_miconax 6.684612 17 ou401 Aotus_nancymaae 6.678342 18 ou402 Aotus_nigriceps 6.966024 19 ou403 Aotus_trivirgatus 6.815640 20 ou404 Aotus_vociferans 6.771936 21 ou405 Arctocebus_aureus 5.459586 22 ou406 Arctocebus_calabarensis 5.552960 23 ou407 Ateles_belzebuth 8.812843 24 ou408 Ateles_chamek 8.872067 25 ou409 Ateles_fusciceps 9.112728 26 ou410 Ateles_geoffroyi 8.937218 27 ou411 Ateles_marginatus 8.738735 28 ou412 Ateles_paniscus 9.072227 29 ou413 Avahi_laniger 6.927558 30 ou414 Brachyteles_arachnoides 9.268609 31 ou415 Cacajao_calvus 8.137396 32 ou416 Cacajao_melanocephalus 8.051978 33 ou417 Callicebus_brunneus 6.747587 34 ou418 Callicebus_caligatus 6.899723 35 ou419 Callicebus_cinerascens 6.899723 36 ou420 Callicebus_cupreus 7.021084 37 ou421 Callicebus_donacophilus 6.801283 38 ou422 Callicebus_dubius 6.899723 39 ou423 Callicebus_hoffmannsi 6.975414 40 ou424 Callicebus_modestus 6.899723 41 ou425 Callicebus_moloch 6.872128 42 ou426 Callicebus_oenanthe 6.899723 43 ou427 Callicebus_olallae 6.899723 44 ou428 Callicebus_personatus 7.237059 45 ou429 Callicebus_torquatus 7.106606 46 ou430 Callimico_goeldii 6.324359 47 ou431 Callithrix_argentata 5.910797 48 ou432 Callithrix_aurita 5.961005 49 ou433 Callithrix_flaviceps 5.926926 50 ou434 Callithrix_geoffroyi 5.834811 51 ou435 Callithrix_humeralifera 5.926926 52 ou436 Callithrix_jacchus 5.673323 53 ou437 Callithrix_kuhlii 5.926926 54 ou438 Callithrix_penicillata 5.828946 55 ou439 Callithrix_pygmaea 4.828314 56 ou440 Cebus_albifrons 7.832014 57 ou441 Cebus_apella 7.922986 58 ou442 Cebus_capucinus 8.009695 59 ou443 Cebus_olivaceus 7.937375 60 ou444 Cercocebus_agilis 8.870663 61 ou445 Cercocebus_galeritus 8.865029 62 ou446 Cercocebus_torquatus 8.894259 63 ou447 Cercopithecus_ascanius 8.171882 64 ou448 Cercopithecus_campbelli 8.199739 65 ou449 Cercopithecus_cephus 8.143227 66 ou450 Cercopithecus_diana 8.382518 67 ou451 Cercopithecus_dryas 7.930206 68 ou452 Cercopithecus_erythrogaster 8.143227 69 ou453 Cercopithecus_erythrotis 8.086410 70 ou454 Cercopithecus_hamlyni 8.438150 71 ou455 Cercopithecus_lhoesti 8.579229 72 ou456 Cercopithecus_mitis 8.525161 73 ou457 Cercopithecus_mona 8.289037 74 ou458 Cercopithecus_neglectus 8.579229 75 ou459 Cercopithecus_nictitans 8.567886 76 ou460 Cercopithecus_petaurista 8.083329 77 ou461 Cercopithecus_pogonias 8.183118 78 ou462 Cercopithecus_preussi 8.544808 79 ou463 Cercopithecus_sclateri 8.029433 80 ou464 Cercopithecus_solatus 8.567886 81 ou465 Cercopithecus_wolfi 8.089482 82 ou466 Cheirogaleus_major 6.104793 83 ou467 Cheirogaleus_medius 5.283204 84 ou468 Chiropotes_albinasus 7.937375 85 ou469 Chiropotes_satanas 7.996317 86 ou470 Chlorocebus_aethiops 8.301522 87 ou471 Colobus_angolensis 9.103868 88 ou472 Colobus_guereza 9.210340 89 ou473 Colobus_polykomos 9.060680 90 ou474 Colobus_satanas 9.121509 91 ou475 Daubentonia_madagascariensis 7.919356 92 ou476 Erythrocebus_patas 8.988446 93 ou477 Eulemur_coronatus 7.438384 94 ou478 Eulemur_fulvus 7.779049 95 ou479 Eulemur_macaco 7.816014 96 ou480 Eulemur_mongoz 7.478735 97 ou481 Eulemur_rubriventer 7.620705 98 ou482 Euoticus_elegantulus 5.690359 99 ou483 Euoticus_pallidus 5.627621 100 ou484 Galago_alleni 5.521461 101 ou485 Galago_gallarum 5.365976 102 ou486 Galago_matschiei 5.267858 103 ou487 Galago_moholi 5.375278 104 ou488 Galago_senegalensis 5.594711 105 ou489 Galagoides_demidoff 4.206184 106 ou490 Galagoides_zanzibaricus 4.997212 107 ou491 Gorilla_gorilla 11.643954 108 ou492 Hapalemur_aureus 7.358831 109 ou493 Hapalemur_griseus 6.862758 110 ou494 Hapalemur_simus 7.620705 111 ou495 Homo_sapiens 10.980195 112 ou496 Hylobates_agilis 8.675905 113 ou497 Hylobates_concolor 8.768730 114 ou498 Hylobates_gabriellae 9.047821 115 ou499 Hylobates_hoolock 8.809863 116 ou500 Hylobates_klossii 8.674197 117 ou501 Hylobates_lar 8.635865 118 ou502 Hylobates_leucogenys 8.898366 119 ou503 Hylobates_moloch 8.677610 120 ou504 Hylobates_muelleri 8.687779 121 ou505 Hylobates_pileatus 8.630522 122 ou506 Hylobates_syndactylus 9.296518 123 ou507 Indri_indri 9.065315 124 ou508 Lagothrix_flavicauda 9.020390 125 ou509 Lagothrix_lagotricha 8.743532 126 ou510 Lemur_catta 7.878534 127 ou511 Leontopithecus_caissara 6.405228 128 ou512 Leontopithecus_chrysomela 6.352629 129 ou513 Leontopithecus_chrysopygus 6.486161 130 ou514 Leontopithecus_rosalia 6.385194 131 ou515 Lepilemur_dorsalis 6.232448 132 ou516 Lepilemur_edwardsi 6.711740 133 ou517 Lepilemur_leucopus 6.396930 134 ou518 Lepilemur_microdon 6.863803 135 ou519 Lepilemur_mustelinus 6.508769 136 ou520 Lepilemur_ruficaudatus 6.637258 137 ou521 Lepilemur_septentrionalis 6.638568 138 ou522 Lophocebus_albigena 8.903815 139 ou523 Loris_tardigradus 5.517453 140 ou524 Macaca_arctoides 9.148465 141 ou525 Macaca_assamensis 9.054855 142 ou526 Macaca_cyclopis 8.658693 143 ou527 Macaca_fascicularis 8.431635 144 ou528 Macaca_fuscata 9.220291 145 ou529 Macaca_maura 8.894259 146 ou530 Macaca_mulatta 8.771835 147 ou531 Macaca_nemestrina 8.970813 148 ou532 Macaca_nigra 8.906529 149 ou533 Macaca_ochreata 7.919356 150 ou534 Macaca_radiata 8.517193 151 ou535 Macaca_silenus 8.699515 152 ou536 Macaca_sinica 8.446771 153 ou537 Macaca_sylvanus 9.350102 154 ou538 Macaca_thibetana 9.268609 155 ou539 Macaca_tonkeana 9.220291 156 ou540 Mandrillus_leucophaeus 9.560997 157 ou541 Mandrillus_sphinx 9.729134 158 ou542 Microcebus_coquereli 5.793014 159 ou543 Microcebus_murinus 4.198705 160 ou544 Microcebus_rufus 3.881564 161 ou545 Miopithecus_talapoin 7.130899 162 ou546 Nasalis_concolor 8.979354 163 ou547 Nasalis_larvatus 9.417355 164 ou548 Nycticebus_coucang 6.878326 165 ou549 Nycticebus_pygmaeus 5.840642 166 ou550 Otolemur_crassicaudatus 7.130899 167 ou551 Otolemur_garnettii 6.701960 168 ou552 Pan_paniscus 10.468801 169 ou553 Pan_troglodytes 10.716638 170 ou554 Papio_hamadryas 9.735069 171 ou555 Perodicticus_potto 6.984716 172 ou556 Phaner_furcifer 6.016157 173 ou557 Pithecia_aequatorialis 7.774856 174 ou558 Pithecia_albicans 7.937375 175 ou559 Pithecia_irrorata 7.749322 176 ou560 Pithecia_monachus 7.654443 177 ou561 Pithecia_pithecia 7.420579 178 ou562 Pongo_pygmaeus 10.860920 179 ou563 Presbytis_comata 9.039552 180 ou564 Presbytis_femoralis 8.797851 181 ou565 Presbytis_frontata 8.853665 182 ou566 Presbytis_hosei 8.725832 183 ou567 Presbytis_melalophos 8.748305 184 ou568 Presbytis_potenziani 8.774931 185 ou569 Presbytis_rubicunda 8.773385 186 ou570 Presbytis_thomasi 8.765615 187 ou571 Procolobus_badius 8.808369 188 ou572 Procolobus_pennantii 9.122601 189 ou573 Procolobus_preussi 9.094930 190 ou574 Procolobus_rufomitratus 8.995909 191 ou575 Procolobus_verus 8.289037 192 ou576 Propithecus_diadema 8.794825 193 ou577 Propithecus_tattersalli 8.171882 194 ou578 Propithecus_verreauxi 8.202482 195 ou579 Pygathrix_avunculus 9.164296 196 ou580 Pygathrix_bieti 9.118225 197 ou581 Pygathrix_brelichi 9.305651 198 ou582 Pygathrix_nemaeus 9.417355 199 ou583 Pygathrix_roxellana 9.510445 200 ou584 Saguinus_bicolor 6.142037 201 ou585 Saguinus_fuscicollis 5.976351 202 ou586 Saguinus_geoffroyi 6.200509 203 ou587 Saguinus_imperator 6.016157 204 ou588 Saguinus_inustus 6.688355 205 ou589 Saguinus_labiatus 6.234411 206 ou590 Saguinus_leucopus 6.124683 207 ou591 Saguinus_midas 6.293419 208 ou592 Saguinus_mystax 6.326149 209 ou593 Saguinus_nigricollis 6.109248 210 ou594 Saguinus_oedipus 6.139885 211 ou595 Saguinus_tripartitus 5.953243 212 ou596 Saimiri_boliviensis 6.690842 213 ou597 Saimiri_oerstedii 6.570883 214 ou598 Saimiri_sciureus 6.620073 215 ou599 Saimiri_ustus 6.791221 216 ou600 Saimiri_vanzolinii 6.664409 217 ou601 Semnopithecus_entellus 9.441452 218 ou602 Tarsius_bancanus 4.736198 219 ou603 Tarsius_dianae 4.709530 220 ou604 Tarsius_pumilus 4.808111 221 ou605 Tarsius_spectrum 5.111988 222 ou606 Tarsius_syrichta 4.753590 223 ou607 Theropithecus_gelada 9.680344 224 ou608 Trachypithecus_auratus 9.181941 225 ou609 Trachypithecus_cristatus 8.872067 226 ou610 Trachypithecus_francoisi 9.008224 227 ou611 Trachypithecus_geei 9.031214 228 ou612 Trachypithecus_johnii 9.268609 229 ou613 Trachypithecus_obscurus 8.870663 230 ou614 Trachypithecus_phayrei 8.948976 231 ou615 Trachypithecus_pileatus 9.323669 232 ou616 Trachypithecus_vetulus 8.969542 233 ou617 Varecia_variegata 8.261010 href 1 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572992 2 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572857 3 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572935 4 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572936 5 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945168 6 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945164 7 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572939 8 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572940 9 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572941 10 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572942 11 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944172 12 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572944 13 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949 14 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945149 15 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949 16 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572947 17 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572945 18 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572946 19 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572951 20 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572952 21 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572887 22 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572888 23 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572954 24 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572955 25 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572957 26 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572958 27 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572956 28 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572953 29 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572881 30 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572959 31 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572983 32 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572984 33 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025131 34 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134 35 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025122 36 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025127 37 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025112 38 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134 39 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025125 40 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025116 41 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025119 42 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025114 43 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025115 44 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572962 45 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025106 46 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572909 47 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944125 48 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572911 49 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572912 50 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572913 51 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944138 52 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572915 53 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572916 54 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572918 55 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944123 56 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572975 57 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944156 58 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572977 59 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572978 60 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572993 61 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572994 62 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572995 63 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572996 64 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572997 65 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572998 66 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572999 67 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573000 68 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573001 69 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573002 70 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573003 71 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944219 72 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573005 73 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573006 74 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573007 75 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573008 76 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573009 77 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573010 78 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945227 79 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573014 80 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944221 81 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573011 82 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572858 83 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572859 84 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572985 85 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572986 86 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=552515 87 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573035 88 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573036 89 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573037 90 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573038 91 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572886 92 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573015 93 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572865 94 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572864 95 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572866 96 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572867 97 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572868 98 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572893 99 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572894 100 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944100 101 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572896 102 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572897 103 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572898 104 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572899 105 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572900 106 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025177 107 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573080 108 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572869 109 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572870 110 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944072 111 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180092 112 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573069 113 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944286 114 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944292 115 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945338 116 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573073 117 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573074 118 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944290 119 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573076 120 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573077 121 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573078 122 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944293 123 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572882 124 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572961 125 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944187 126 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572872 127 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572921 128 129 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572920 130 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572922 131 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572874 132 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572875 133 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572876 134 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572877 135 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572878 136 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572879 137 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572880 138 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573016 139 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572889 140 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573017 141 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573018 142 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573019 143 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180098 144 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=555659 145 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573020 146 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180099 147 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573021 148 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573022 149 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573023 150 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573024 151 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573025 152 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573026 153 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573027 154 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573028 155 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573029 156 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573030 157 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573031 158 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944041 159 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572861 160 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572862 161 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573032 162 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944263 163 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573040 164 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572890 165 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572891 166 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572902 167 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572903 168 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573081 169 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573082 170 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573033 171 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572892 172 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572863 173 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572987 174 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572988 175 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572989 176 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572990 177 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572991 178 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573083 179 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573041 180 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573042 181 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573043 182 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573044 183 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573045 184 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573046 185 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573047 186 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573048 187 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944230 188 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944235 189 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944238 190 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944239 191 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573053 192 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572883 193 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572884 194 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572885 195 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944258 196 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944259 197 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944260 198 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573057 199 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945308 200 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572923 201 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=998616 202 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572925 203 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572926 204 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572927 205 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572928 206 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572929 207 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572930 208 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572931 209 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=998617 210 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572933 211 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025098 212 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572979 213 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572980 214 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180095 215 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572981 216 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572982 217 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573059 218 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945103 219 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944117 220 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572906 221 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944115 222 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945107 223 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573034 224 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573060 225 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573061 226 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573062 227 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573063 228 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944270 229 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573065 230 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573066 231 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573067 232 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944269 233 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572873 ``` Because these are all from the same otus block anyway, we haven't selected that column, but were it of interest it is also available in the taxa table. RNeXML/vignettes/references.bib0000644000176200001440000002755313552353762016155 0ustar liggesusers@Misc{W3C_2014, url = {http://www.w3.org/TR/rdf-sparql-query/}, title = {SPARQL Query Language for RDF}, journal = {W3C}, howpublished = {\url{http://www.w3.org/TR/rdf-sparql-query/}}, author = {Eric Prud'hommeaux}, archived = {http://greycite.knowledgeblog.org/?uri=http%3A%2F%2Fwww.w3.org%2FTR%2Frdf-sparql-query%2F}, year = {2014}, } @article{Parr2011, abstract = {The accelerating growth of data and knowledge in evolutionary biology is indisputable. Despite this rapid progress, information remains scattered, poorly documented and in formats that impede discovery and integration. A grand challenge is the creation of a linked system of all evolutionary data, information and knowledge organized around Darwin's ever-growing Tree of Life. Such a system, accommodating topological disagreement where necessary, would consolidate taxon names, phenotypic and geographical distributional data across clades, and serve as an integrated community resource. The field of evolutionary informatics, reviewed here for the first time, has matured into a robust discipline that is developing the conceptual, infrastructure and community frameworks for meeting this grand challenge.}, author = {Parr, Cynthia S and Guralnick, Robert and Cellinese, Nico and Page, Roderic D M}, doi = {10.1016/j.tree.2011.11.001}, file = {:home/cboettig/Documents/Mendeley/Trends in ecology \& evolution/2011/Parr et al. - 2011 - Trends in ecology \& evolution.pdf:pdf}, issn = {0169-5347}, journal = {Trends in ecology \& evolution}, mendeley-groups = {Evolutionary Theory/Phylogenetic Methods}, month = dec, number = {2}, pages = {94--103}, pmid = {22154516}, publisher = {Elsevier Ltd}, title = {{Evolutionary informatics: unifying knowledge about the diversity of life.}}, url = {http://www.ncbi.nlm.nih.gov/pubmed/22154516}, volume = {27}, year = {2011} } @Article{Revell_2012, title = {phytools: An R package for phylogenetic comparative biology (and other things).}, author = {Liam J. Revell}, journal = {Methods in Ecology and Evolution}, year = {2012}, volume = {3}, pages = {217-223}, } @Book{Xie_2013, title = {Dynamic Documents with {R} and knitr}, author = {Yihui Xie}, publisher = {Chapman and Hall/CRC}, address = {Boca Raton, Florida}, year = {2013}, note = {ISBN 978-1482203530}, url = {http://yihui.name/knitr/}, } @Article{Vos_2012, doi = {10.1093/sysbio/sys025}, url = {http://dx.doi.org/10.1093/sysbio/sys025}, year = {2012}, month = {Feb}, publisher = {Oxford University Press (OUP)}, volume = {61}, number = {4}, pages = {675-689}, author = {R. A. Vos and J. P. Balhoff and J. A. Caravas and M. T. Holder and H. Lapp and W. P. Maddison and P. E. Midford and A. Priyam and J. Sukumaran and X. Xia and A. Stoltzfus}, title = {NeXML: Rich, Extensible, and Verifiable Representation of Comparative Data and Metadata}, journal = {Systematic Biology}, } @Article{Harmon_2008, title = {GEIGER: investigating evolutionary radiations}, author = {LJ Harmon and JT Weir and CD Brock and RE Glor and W Challenger}, journal = {Bioinformatics}, year = {2008}, volume = {24}, pages = {129-131}, } @Article{Rausher_2010, doi = {10.1111/j.1558-5646.2009.00940.x}, url = {http://dx.doi.org/10.1111/j.1558-5646.2009.00940.x}, year = {2010}, month = {Mar}, publisher = {Wiley-Blackwell}, volume = {64}, number = {3}, pages = {603-604}, author = {Mark D. Rausher and Mark A. McPeek and Allen J. Moore and Loren Rieseberg and Michael C. Whitlock}, title = {Data Archiving}, journal = {Evolution}, } @Article{Boettiger_2012, doi = {10.1111/j.2041-210x.2012.00247.x}, url = {http://dx.doi.org/10.1111/j.2041-210x.2012.00247.x}, year = {2012}, month = {Oct}, publisher = {Wiley-Blackwell}, volume = {3}, number = {6}, pages = {1060-1066}, author = {Carl Boettiger and Duncan {Temple Lang}}, editor = {Luke Harmon}, title = {Treebase: an R package for discovery, access and manipulation of online phylogenies}, journal = {Methods Ecol Evol}, } @Manual{R, title = {R: A Language and Environment for Statistical Computing}, author = {{R Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {2014}, url = {http://www.R-project.org/}, } @Manual{phylobase, title = {phylobase: Base package for phylogenetic structures and comparative data}, author = {{NESCENT R Hackathon Team}}, year = {2014}, note = {R package version 0.6.8}, url = {http://CRAN.R-project.org/package=phylobase}, } @Article{Tenopir_2011, doi = {10.1371/journal.pone.0021101}, url = {http://dx.doi.org/10.1371/journal.pone.0021101}, year = {2011}, month = {Jun}, publisher = {Public Library of Science (PLoS)}, volume = {6}, number = {6}, pages = {e21101}, author = {Carol Tenopir and Suzie Allard and Kimberly Douglass and Arsev Umur Aydinoglu and Lei Wu and Eleanor Read and Maribeth Manoff and Mike Frame}, editor = {Cameron Neylon}, title = {Data Sharing by Scientists: Practices and Perceptions}, journal = {PLoS ONE}, } @Manual{Boettiger_2014, title = {knitcitations: Citations for knitr markdown files}, author = {Carl Boettiger}, note = {R package version 1.0-1}, url = {https://github.com/cboettig/knitcitations}, year = {2014}, } @InCollection{Hartig_2012, doi = {10.1007/978-3-642-31753-8_56}, url = {http://dx.doi.org/10.1007/978-3-642-31753-8_56}, year = {2012}, publisher = {Springer Science + Business Media}, pages = {506-507}, author = {Olaf Hartig}, title = {An Introduction to SPARQL and Queries over Linked Data}, booktitle = {Web Engineering}, } @Article{Chamberlain_2013, doi = {10.12688/f1000research.2-191.v2}, url = {http://dx.doi.org/10.12688/f1000research.2-191.v2}, year = {2013}, month = {Oct}, publisher = {F1000 Research, Ltd.}, author = {Scott A. Chamberlain and Eduard Sz{\"o}cs}, title = {taxize: taxonomic search and retrieval in R}, journal = {F1000Research}, } @Article{Drew_2013, doi = {10.1371/journal.pbio.1001636}, url = {http://dx.doi.org/10.1371/journal.pbio.1001636}, year = {2013}, month = {Sep}, publisher = {Public Library of Science (PLoS)}, volume = {11}, number = {9}, pages = {e1001636}, author = {Bryan T. Drew and Romina Gazis and Patricia Cabezas and Kristen S. Swithers and Jiabin Deng and Roseana Rodriguez and Laura A. Katz and Keith A. Crandall and David S. Hibbett and Douglas E. Soltis}, title = {Lost Branches on the Tree of Life}, journal = {PLoS Biol}, } @Article{Bollback_2006, doi = {10.1186/1471-2105-7-88}, url = {http://dx.doi.org/10.1186/1471-2105-7-88}, year = {2006}, publisher = {Springer Science + Business Media}, volume = {7}, number = {1}, pages = {88}, author = {JonathanP Bollback}, journal = {BMC Bioinformatics}, } @Article{Cranston_2014, doi = {10.1371/currents.tol.bf01eff4a6b60ca4825c69293dc59645}, url = {http://dx.doi.org/10.1371/currents.tol.bf01eff4a6b60ca4825c69293dc59645}, year = {2014}, publisher = {Public Library of Science (PLoS)}, author = {Karen Cranston and Luke J. Harmon and Maureen A. O'Leary and Curtis Lisle}, title = {Best Practices for Data Sharing in Phylogenetic Research}, journal = {PLoS Curr}, } @Article{Huelsenbeck_2003, doi = {10.1080/10635150390192780}, url = {http://dx.doi.org/10.1080/10635150390192780}, year = {2003}, month = {Apr}, publisher = {Oxford University Press (OUP)}, volume = {52}, number = {2}, pages = {131-158}, author = {John P. Huelsenbeck and Rasmus Nielsen and Jonathan P. Bollback}, title = {Stochastic Mapping of Morphological Characters}, journal = {Systematic Biology}, } @Article{Stoltzfus_2012, doi = {10.1186/1756-0500-5-574}, url = {http://dx.doi.org/10.1186/1756-0500-5-574}, year = {2012}, publisher = {Springer Science + Business Media}, volume = {5}, number = {1}, pages = {574}, author = {Arlin Stoltzfus and Brian O'Meara and Jamie Whitacre and Ross Mounce and Emily L Gillespie and Sudhir Kumar and Dan F Rosauer and Rutger A Vos}, title = {Sharing and re-use of phylogenetic trees (and associated data) to facilitate synthesis}, journal = {BMC Research Notes}, } @Article{Stodden_2014, doi = {10.2139/ssrn.1550193}, url = {http://dx.doi.org/10.2139/ssrn.1550193}, publisher = {Social Science Electronic Publishing}, author = {Victoria Stodden}, title = {The Scientific Method in Practice: Reproducibility in the Computational Sciences}, journal = {SSRN Journal}, year = {2014}, } @Article{Paradis_2004, title = {{APE}: analyses of phylogenetics and evolution in {R} language}, author = {E. Paradis and J. Claude and K. Strimmer}, journal = {Bioinformatics}, year = {2004}, volume = {20}, pages = {289-290}, } @Misc{taskview, url = {http://cran.r-project.org/web/views/Phylogenetics.html}, author = {Brian O'Meara}, title = {CRAN Task View: Phylogenetics, Especially Comparative Methods}, howpublished = {\url{http://cran.r-project.org/web/views/Phylogenetics.html}}, archived = {http://greycite.knowledgeblog.org/?uri=http%3A%2F%2Fcran.r-project.org%2Fweb%2Fviews%2FPhylogenetics.html}, year = {2014}, } @ARTICLE{Maddison_1997, title = "{NEXUS}: an extensible file format for systematic information", author = "Maddison, D and Swofford, D and Maddison, W", journal = "Syst. Biol.", volume = 46, number = 4, pages = "590--621", month = dec, year = 1997, url = "http://www.ncbi.nlm.nih.gov/pubmed/11975335", keywords = "data standard", issn = "1063-5157", pmid = "11975335" } @INCOLLECTION{Piel_2002, title = "{TreeBASE}: a database of phylogenetic information", booktitle = "The Interoperable ``Catalog of Life''", author = "Piel, W H and Donoghue, M J and Sanderson, Michael J", editor = "Shimura, J and Wilson, K L and Gordon, D", abstract = "Phylogenetic systematics brings added value to the species lists and taxonomic inventories that form the groundwork of our understanding of biodiversity. But this added value is lost without a central database to store what we know about historical patterns and evolutionary relationships. TreeBASE was developed to harness this information and to provide a tool to study the evolution of biodiversity. Access to phylogenetic trees, and to the data underlying them, is needed for a wide variety of purposes, including comparative studies of morphological and molecular evolution, biogeography, coevolution, and studies of congruence of results based on different sources of evidence. Such data are also needed to monitor progress in phylogenetic research, to test new methods of analysis, and to address immediate practical problems in conservation of biodiversity. TreeBASE stores published phylogenetic trees, character and molecular data matrices, bibliographic information, and some details on taxa, characters, algorithms used, and analyses performed. The database is designed to be explored interactively and to allow retrieval and recombination of trees and data from different studies. TreeBASE therefore provides a means of assessing and synthesizing knowledge of phylogenetic information and biodiversity. The URL is: http://phylogeny.harvard.edu/treebase.", publisher = "National Institute for Environmental Studies", number = 171, pages = "41--47", series = "Research Report", year = 2002, url = "http://donoghuelab.yale.edu/sites/default/files/124_piel_shimura02.pdf", address = "Tsukuba, Japan" } @Manual{XML, title = {XML: Tools for parsing and generating XML within R and S-Plus.}, author = {Duncan Temple Lang}, year = {2013}, note = {R package version 3.98-1.1}, url = {http://CRAN.R-project.org/package=XML}, } RNeXML/vignettes/simmap-Figure1-1.png0000644000176200001440000002326313614141212016762 0ustar liggesusersPNG  IHDR)Jh( pHYs  ~ IDATxpwn D,qMrʍs7"r\+GD 8RvA"J?=h=XAiW؂Bv#0a|O7W;|ɦD"+U"8B#8B#8B#8B#8B#8B#%z@WVVv?lϞ=~{VVVNNβeΝ;mb֖_… >m۶_~KB@fYV-"eee%%%̱cΘ1cIG VNl6{^_QQq#?>o˖-3gLdD"$ yA9x3z ,=(=(=(=(=(=(=()tmϒODD:; 5kУC%#CnQ/"GzdXjkk?N>uk-++K~ @fYV-"eee%%%qޛoi203zz/| 6 ]=$ہnZQQ.gӦM7o==}I/L%Lm45ɸqZf9qB ,Kmmmcc=>}F1>a^yE>XvzG_;@fVTTȯP(ȕ+W^DDL&Sr&9rDB}tz^STTtΜ9ѣG;w{322=H$o߾JOO=ztUkkk$y7w9{짞z?A477>}:?? woe0DdٲeF%Kzի}ݿ)ڋo1"%%%z|7|7f2|>_}( Bp8AND{3|89c=nfZnxή322222ӓ3@Nlz~\277;ljjJ<]r^ "vl6gffz<ᄏyʔ)~QBnv%?_1yx}YfuxǷoꫯz$w/&h rs7SS|%<---uP=YF@e2|>_QQQP( p8:Nӵzkzzky'x" a,āᨪ2.KDjjj C}}}CC`H$R__?iҤ\ӹiӦoIؖD2ѢE_h`å;V3&~c׿j=bt?ɑ#[Hބ񚢚K75~ #8B#8B#8B#8B#8B#8B#8Bq`XZZZw z}ee̙3g&gX,=>#xIC Vv=l6vE$;;=OJJ=ܓybt:f9}k֬I6!L ,K@UU͕+z={<Ϯ]Gʫʟ,;wjhSSɶm>s*"흝V'r3m˞=Z.d2|>_QQQP( p8:Ns:`ݺuދ/m\8p8UUUFrHMM`ohh0 "b0 6,--mԨQIؖDKoMD)khx<ZP˼yG}=(=(=(=(=(u0'GWkC-2d#'LY\}l"'Nh=`[7P[7@qG@qG@qG ,KKKKn]]]AA^~ŋsss322~$gX,<^^^lٲÇݻwΜ9_]wݕ1@v{ lVvHYYYIIIvvG[Vј0@Nlz~;d6SSS$ $On( Bp8AN~ >w\b+rP+bXׯ_D. |H$rԩ3g^}'Nlx{%(=(=(=(=(=(=(=(=(=ābiiiޭ+((;;;/^9uTכmb֖w̙3)))~nϝ;%a X@ `٬Veee]d2=ù;wL<]^t:^)**?eʔ=$ۙ3gϟCM81 /=+j=Aa/:{ܹsGYWWQ#ΰabwJګ $Ph޼yHŐ!Cozhgh ejwq`2|>_}( Bp8AN… ?ku=듐{@8*rD`0744 j9x`cccSSSvv`0 k׮M¶H$r_zm""MMq\e evwG@qG@qG@qG@qG@qG@qG@qG@qG ,KKKKn]]]AA^~إO(>q|dd\ӧd b666"H˥On͖V[[[QQQVV&"CP#/xBz$,"Iv%YFRRHz=OQQ[z@99"" 5\_R--BGwdDw 鮻N~#G|3Bw{%=]H&FBĬ@Z[[0L&F BP8`Pt

a 萎ٱC1;zTΞzpIQ9kې!Z/.C;?/2r;bfi=X,'uuu6lxammm>$l#? 䗿4GX,dAAAj8 1bDiii6l]uU"rĉhG<^[_&՚G?ڵkɉ("@2n8yOom2|>_핡P( p8 u:Nz7޽{_z7x#C#W[#z_=lD$ڪx5h=BzH+%;;{HdŊK|N<9w̜J6 JKK__jժU.>,++7'q G@qG@qG@qG@qf,?A3;e$HɆE>[Ke18QfG=Kk*rk_5.ܓMMM~{~~~ =(K78ߕ#G$//>ODDNk7p=o]w;yRD3> @ =Λ0A22֯#Āk8Bq`XZZZw{w 6,??^pzP(|gڴiGx{=nfZn޽{?Gff-2s 6h8@Nlz~ܹs"=࣏>nП9sFD:/^MѣG_ UV\y7pCEzGY`Czpǎ?_%KL0ammmɟE#sٽ{wAAAjZ&u}ZihhO^9*rDd͓&M۶mۖ-[ᶔH$r_zm""MMq\-O GqF#8B#8B#8B#8B#8B#8B#8B#8B#%zwϞ=~{VVVNNβeΝ;6Bp¼Ço۶_~4C Vv=l6vEdcǎ1cݻ5G VNl6{^_QQ!"Ϸe˖3gj8@͚5kC;v=ܣmu6ggb>ghP|mBƄ[~3g\tҥKUVUWW'aB`h OKzFGGo~}СCǎ[dIFFƘ1c,Xi&BsՐDVzKL&+**j2~ӟ.]ѣ6m:u۸Fqp8Ft^~[ߚ:uj}'5=Aiiiiii}] t=(=(=(=()$F0("?uc@99~2CFC,_แ?#1v&w\j<[&Ww"t|#1{LV}vGGǵ^[VV Vv=l6vE$7|d2k83zz肧6lpk*3zHlݺBNOk}ƯNG.sƍof՚E=#!)CD7'󛓿z 3 OMNzuE #Z_߾}{ {5\Յkh4\G6nx:Ta"\?&"5Rqddok@qF#8B#8B#8B#8B#8B#8B#8Bя%mm=ΡCb4ʡCZg1|wˡCruMy='L=ābiii?~|zz㛛&1]\oc\ӧ8p`ĈbefZn[DV\z꒒TTTdZ5G VNl6{^_QQq̙?0=:''gɒ%`Pyyuٽ'[[[#țos>`֭O=TvG>P' ,[lԨQcƌYd͛oz軮_:Y0@j91bDJJJw@edG0L>/z{3xPB8,2fdgk=ep8yRDϴ+PBgw_ $ڹs""GjW=NDd YB)Cן@>]5zPzPzPz;{-6B ~ӧO>}.!+l6ju]tmz4^W+WyMMMO @vٜx)Sh53zVf*,,0a?~wvƍiۣ^9---'eV85J>@V>`2|>_^xСCǎkhhؼyٳ5*B .GUUht\H~ҤINsӦM5ƥm۶i88`u/8 DDAw?"fϖfGk`5f|<;$]Əz#B*'G22䡇'gϊ.99Z@c@qG@qG@qG@qG@qG@qG ,KKK̙3gj2)@<#7x+=nfZnw׃'%%{vz4^WTTH{{׬Y4BP[[`< S"a_OO߰kk=gi++.~|Ϟ=g׮]ɟ#B(a1A9vL)wfJ[@!=19z;5 $۶mϭVwvvZVߟYIDAT_!zzDRg2|>_QQsz|ݺuދ/6@8*r aÆ5Jm)HD×G?R\,ZHŋ套w =(=(=(=(=(=(=(=(OyȾ}ZH'U@u|Ζ'\g8oZ9qB4z9y}G@t}f,^9rkYxҥK5Fq޿ kVٹSPVyyeˆw9s\wuVca,nfZn[Vј4G VNl6{^_QQ0Lf955pn !xEYYY.!V)S$%E)=1;/dVVVVVּynxŊɜЏj#.Pv躙z+HdBc&h='ћ&ug?YIIÛy˥JB?*ђop8}E= ,կ~[z 4F JKKKKKw_i8G@qG@qG@qG@qoH|GB>a "r?{ B$^s:% OAHq$5Uy_[rݒM@qG@qG@qG ,KKKKŋgffN:j@9s&%%s|> zn6jkL~877wΝ7c VNz< ~ʔ) BcH[? "W]uϜ93zhĉIu1B#z%ʎzٳs9rd]]]2G]eN),!CғQ7SSGPh޼yHzĉZч ?~^ pXk{uqp8F:x`cccSSSvv`0 k׮pgѻHD1=6 . S[Z=>_oAZ/=ew c6MMzĠa4J*? =(=(=(=(=(=(@X,ݺ^_YY.b֖k=D@v{ lVvHYYYIIIvvD{;z=OQ2@qH>v1C6v8ZfHcdzDbJ@ d2|5P( p8:NӬ @GUUht\"RSSc0 CuuR"/H4@qG@qG@qG@qG@qG@qG@qG@q=Eu;RIENDB`RNeXML/vignettes/sparql.Rmd.orig0000644000176200001440000001371513614140536016246 0ustar liggesusers--- title: "SPARQL with RNeXML" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- ```{r supplement-compile-settings, include=FALSE} library("methods") library("knitr") knitr::opts_chunk$set(fig.path="sparql-") opts_chunk$set(tidy = FALSE, warning = FALSE, message = FALSE, cache = FALSE, comment = NA, verbose = TRUE, eval = require(rdflib)) ``` ```{r include=FALSE} library("RNeXML") ``` ## SPARQL Queries Rich, semantically meaningful metadata lies at the heart of the NeXML standard. R provides a rich environment to unlock this information. While our previous examples have relied on the user knowing exactly what metadata they intend to extract (title, publication date, citation information, and so forth), _semantic_ metadata has meaning that a computer can make use of, allowing us to make much more conceptually rich queries than those simple examples. The SPARQL query language is a powerful way to make use of such semantic information in making complex queries. While users should consult a formal introduction to SPARQL for further background, here we illustrate how SPARQL can be used in combination with R functions in ways that would be much more tedious to assemble with only traditional/non-semantic queries. The SPARQL query language is provided for the R environment through the `rrdf` package [@Willighagen_2014], so we start by loading that package. We will also make use of functions from `phytools` and `RNeXML`. ```{r} library("rdflib") library("xml2") library("phytools") library("RNeXML") ``` We read in an example file that contains semantic metadata annotations describing the taxonomic units (OTUs) used in the tree. ```{r} nexml <- nexml_read(system.file("examples/primates.xml", package="RNeXML")) ``` In particular, this example declares the taxon rank, NCBI identifier and parent taxon for each OTU, such as: ```xml ``` In this example, we will construct a cladogram by using this information to identify the taxonomic rank of each OTU, and its shared parent taxonomic rank. (If this example looks complex, try writing down the steps to do this without the aid of the SPARQL queries). These examples show the manipulation of semantic triples, Unique Resource Identifiers (URIs) and use of the SPARQL "Join" operator. Note that this example can be run using `demo("sparql", "RNeXML")` to see the code displayed in the R terminal and to avoid character errors that can occur in having to copy and paste from PDF files. We begin by extracting the RDF graph from the NeXML, ```{r} rdf <- get_rdf(system.file("examples/primates.xml", package="RNeXML")) tmp <- tempfile() # so we must write the XML out first xml2::write_xml(rdf, tmp) graph <- rdf_parse(tmp) ``` We then fetch the NCBI URI for the taxon that has rank 'Order', i.e. the root of the primates phylogeny. The dot operator `.` between clauses implies a join, in this case ```{r} root <- rdf_query(graph, "SELECT ?uri WHERE { ?id . ?id ?uri }") ``` This makes use of the SPARQL query language provided by the `rrdf` package. We will also define some helper functions that use SPARQL queries. Here we define a function to get the name ```{r} get_name <- function(id) { max <- length(nexml@otus[[1]]@otu) for(i in 1:max) { if ( nexml@otus[[1]]@otu[[i]]@id == id ) { label <- nexml@otus[[1]]@otu[[i]]@label label <- gsub(" ","_",label) return(label) } } } ``` Next, we define a recursive function to build a newick tree from the taxonomic rank information. ```{r} recurse <- function(node){ # fetch the taxonomic rank and id string rank_query <- paste0( "SELECT ?rank ?id WHERE { ?id <",node,"> . ?id ?rank }") result <- rdf_query(graph, rank_query) # get the local ID, strip URI part id <- result$id id <- gsub("^.+#", "", id, perl = TRUE) # if rank is terminal, return the name if (result$rank == "http://rs.tdwg.org/ontology/voc/TaxonRank#Species") { return(get_name(id)) } # recurse deeper else { child_query <- paste0( "SELECT ?uri WHERE { ?id <",node,"> . ?id ?uri }") children <- rdf_query(graph, child_query) return(paste("(", paste(sapply(children$uri, recurse), sep = ",", collapse = "," ), ")", get_name(id), # label interior nodes sep = "", collapse = "")) } } ``` With these functions in place, it is straight forward to build the tree from the semantic RDFa data and then visualize it ```{r} newick <- paste(recurse(root), ";", sep = "", collapse = "") tree <- read.newick(text = newick) collapsed <- collapse.singles(tree) plot(collapsed, type='cladogram', show.tip.label=FALSE, show.node.label=TRUE, cex=0.75, edge.color='grey60', label.offset=-9) ``` RNeXML/vignettes/S4.Rmd0000644000176200001440000001257413614125024014270 0ustar liggesusers--- title: "The nexml S4 Object" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- ## Understanding the `nexml` S4 object The `RNeXML` package provides many convenient functions to add and extract information from `nexml` objects in the R environment without requiring the reader to understand the details of the NeXML data structure and making it less likely that a user will generate invalid NeXML syntax that could not be read by other parsers. The `nexml` object we have been using in all of the examples is built on R's S4 mechanism. Advanced users may sometimes prefer to interact with the data structure more directly using R's S4 class mechanism and subsetting methods. Many R users are more familiar with the S3 class mechanism (such as in the `ape` package phylo objects) rather than the S4 class mechanism used in phylogenetics packages such as `ouch` and `phylobase`. The `phylobase` vignette provides an excellent introduction to these data structures. Users already familiar with subsetting lists and other S3 objects in R are likely familiar with the use of the `$` operator, such as `phy$edge`. S4 objects simply use an `@` operator instead (but cannot be subset using numeric arguments such as `phy[[1]]` or named arguments such as phy[["edge"]]). The `nexml` object is an S4 object, as are all of its components (slots). Its hierarchical structure corresponds exactly with the XML tree of a NeXML file, with the single exception that both XML attributes and children are represented as slots. S4 objects have constructor functions to initialize them. We create a new `nexml` object with the command: ```r nex <- new("nexml") ``` We can see a list of slots contained in this object with ```r slotNames(nex) ``` ``` [1] "version" "generator" "xsi:schemaLocation" "namespaces" "otus" [6] "trees" "characters" "meta" "about" "xsi:type" ``` Some of these slots have already been populated for us, for instance, the schema version and default namespaces: ```r nex@version ``` ``` [1] "0.9" ``` ```r nex@namespaces ``` ``` nex xsi "http://www.nexml.org/2009" "http://www.w3.org/2001/XMLSchema-instance" xml cdao "http://www.w3.org/XML/1998/namespace" "http://purl.obolibrary.org/obo/" xsd dc "http://www.w3.org/2001/XMLSchema#" "http://purl.org/dc/elements/1.1/" dcterms prism "http://purl.org/dc/terms/" "http://prismstandard.org/namespaces/1.2/basic/" cc ncbi "http://creativecommons.org/ns#" "http://www.ncbi.nlm.nih.gov/taxonomy#" tc "http://rs.tdwg.org/ontology/voc/TaxonConcept#" "http://www.nexml.org/2009" ``` Recognize that `nex@namespaces` serves the same role as `get_namespaces` function, but provides direct access to the slot data. For instance, with this syntax we could also overwrite the existing namespaces with `nex@namespaces <- NULL`. Changing the namespace in this way is not advised. Some slots can contain multiple elements of the same type, such as `trees`, `characters`, and `otus`. For instance, we see that ```r class(nex@characters) ``` ``` [1] "ListOfcharacters" attr(,"package") [1] "RNeXML" ``` is an object of class `ListOfcharacters`, and is currently empty, ```r length(nex@characters) ``` ``` [1] 0 ``` In order to assign an object to a slot, it must match the class definition of the slot. We can create a new element of any given class with the `new` function, ```r nex@characters <- new("ListOfcharacters", list(new("characters"))) ``` and now we have a length-1 list of character matrices, ```r length(nex@characters) ``` ``` [1] 1 ``` and we access the first character matrix using the list notation, `[[1]]`. Here we check the class is a `characters` object. ```r class(nex@characters[[1]]) ``` ``` [1] "characters" attr(,"package") [1] "RNeXML" ``` Direct subsetting has two primary use cases: (a) useful in looking up (and possibly editing) a specific value of an element, or (b) when adding metadata annotations to specific elements. Consider the example file ```r f <- system.file("examples", "trees.xml", package="RNeXML") nex <- nexml_read(f) ``` We can look up the species label of the first `otu` in the first `otus` block: ```r nex@otus[[1]]@otu[[1]]@label ``` ``` label "species 1" ``` We can add metadata to this particular OTU using this subsetting format ```r nex@otus[[1]]@otu[[1]]@meta <- c(meta("skos:note", "This species was incorrectly identified"), nex@otus[[1]]@otu[[1]]@meta) ``` Here we use the `c` operator to append this element to any existing meta annotations to this otu. RNeXML/vignettes/sparql.Rmd0000644000176200001440000001330313614141224015273 0ustar liggesusers--- title: "SPARQL with RNeXML" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- ## SPARQL Queries Rich, semantically meaningful metadata lies at the heart of the NeXML standard. R provides a rich environment to unlock this information. While our previous examples have relied on the user knowing exactly what metadata they intend to extract (title, publication date, citation information, and so forth), _semantic_ metadata has meaning that a computer can make use of, allowing us to make much more conceptually rich queries than those simple examples. The SPARQL query language is a powerful way to make use of such semantic information in making complex queries. While users should consult a formal introduction to SPARQL for further background, here we illustrate how SPARQL can be used in combination with R functions in ways that would be much more tedious to assemble with only traditional/non-semantic queries. The SPARQL query language is provided for the R environment through the `rrdf` package [@Willighagen_2014], so we start by loading that package. We will also make use of functions from `phytools` and `RNeXML`. ```r library("rdflib") library("xml2") library("phytools") library("RNeXML") ``` We read in an example file that contains semantic metadata annotations describing the taxonomic units (OTUs) used in the tree. ```r nexml <- nexml_read(system.file("examples/primates.xml", package="RNeXML")) ``` In particular, this example declares the taxon rank, NCBI identifier and parent taxon for each OTU, such as: ```xml ``` In this example, we will construct a cladogram by using this information to identify the taxonomic rank of each OTU, and its shared parent taxonomic rank. (If this example looks complex, try writing down the steps to do this without the aid of the SPARQL queries). These examples show the manipulation of semantic triples, Unique Resource Identifiers (URIs) and use of the SPARQL "Join" operator. Note that this example can be run using `demo("sparql", "RNeXML")` to see the code displayed in the R terminal and to avoid character errors that can occur in having to copy and paste from PDF files. We begin by extracting the RDF graph from the NeXML, ```r rdf <- get_rdf(system.file("examples/primates.xml", package="RNeXML")) tmp <- tempfile() # so we must write the XML out first xml2::write_xml(rdf, tmp) graph <- rdf_parse(tmp) ``` We then fetch the NCBI URI for the taxon that has rank 'Order', i.e. the root of the primates phylogeny. The dot operator `.` between clauses implies a join, in this case ```r root <- rdf_query(graph, "SELECT ?uri WHERE { ?id . ?id ?uri }") ``` This makes use of the SPARQL query language provided by the `rrdf` package. We will also define some helper functions that use SPARQL queries. Here we define a function to get the name ```r get_name <- function(id) { max <- length(nexml@otus[[1]]@otu) for(i in 1:max) { if ( nexml@otus[[1]]@otu[[i]]@id == id ) { label <- nexml@otus[[1]]@otu[[i]]@label label <- gsub(" ","_",label) return(label) } } } ``` Next, we define a recursive function to build a newick tree from the taxonomic rank information. ```r recurse <- function(node){ # fetch the taxonomic rank and id string rank_query <- paste0( "SELECT ?rank ?id WHERE { ?id <",node,"> . ?id ?rank }") result <- rdf_query(graph, rank_query) # get the local ID, strip URI part id <- result$id id <- gsub("^.+#", "", id, perl = TRUE) # if rank is terminal, return the name if (result$rank == "http://rs.tdwg.org/ontology/voc/TaxonRank#Species") { return(get_name(id)) } # recurse deeper else { child_query <- paste0( "SELECT ?uri WHERE { ?id <",node,"> . ?id ?uri }") children <- rdf_query(graph, child_query) return(paste("(", paste(sapply(children$uri, recurse), sep = ",", collapse = "," ), ")", get_name(id), # label interior nodes sep = "", collapse = "")) } } ``` With these functions in place, it is straight forward to build the tree from the semantic RDFa data and then visualize it ```r newick <- paste(recurse(root), ";", sep = "", collapse = "") tree <- read.newick(text = newick) collapsed <- collapse.singles(tree) plot(collapsed, type='cladogram', show.tip.label=FALSE, show.node.label=TRUE, cex=0.75, edge.color='grey60', label.offset=-9) ``` ![plot of chunk unnamed-chunk-8](sparql-unnamed-chunk-8-1.png) RNeXML/vignettes/S4.Rmd.orig0000644000176200001440000001006313552353762015233 0ustar liggesusers--- title: "The nexml S4 Object" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- ```{r supplement-compile-settings, include=FALSE} library("methods") library("knitr") opts_chunk$set(tidy = FALSE, warning = FALSE, message = FALSE, cache = FALSE, comment = NA, verbose = TRUE) basename <- 'S4' ``` ```{r include=FALSE} library("RNeXML") ``` ## Understanding the `nexml` S4 object The `RNeXML` package provides many convenient functions to add and extract information from `nexml` objects in the R environment without requiring the reader to understand the details of the NeXML data structure and making it less likely that a user will generate invalid NeXML syntax that could not be read by other parsers. The `nexml` object we have been using in all of the examples is built on R's S4 mechanism. Advanced users may sometimes prefer to interact with the data structure more directly using R's S4 class mechanism and subsetting methods. Many R users are more familiar with the S3 class mechanism (such as in the `ape` package phylo objects) rather than the S4 class mechanism used in phylogenetics packages such as `ouch` and `phylobase`. The `phylobase` vignette provides an excellent introduction to these data structures. Users already familiar with subsetting lists and other S3 objects in R are likely familiar with the use of the `$` operator, such as `phy$edge`. S4 objects simply use an `@` operator instead (but cannot be subset using numeric arguments such as `phy[[1]]` or named arguments such as phy[["edge"]]). The `nexml` object is an S4 object, as are all of its components (slots). Its hierarchical structure corresponds exactly with the XML tree of a NeXML file, with the single exception that both XML attributes and children are represented as slots. S4 objects have constructor functions to initialize them. We create a new `nexml` object with the command: ```{r} nex <- new("nexml") ``` We can see a list of slots contained in this object with ```{r} slotNames(nex) ``` Some of these slots have already been populated for us, for instance, the schema version and default namespaces: ```{r} nex@version nex@namespaces ``` Recognize that `nex@namespaces` serves the same role as `get_namespaces` function, but provides direct access to the slot data. For instance, with this syntax we could also overwrite the existing namespaces with `nex@namespaces <- NULL`. Changing the namespace in this way is not advised. Some slots can contain multiple elements of the same type, such as `trees`, `characters`, and `otus`. For instance, we see that ```{r} class(nex@characters) ``` is an object of class `ListOfcharacters`, and is currently empty, ```{r} length(nex@characters) ``` In order to assign an object to a slot, it must match the class definition of the slot. We can create a new element of any given class with the `new` function, ```{r} nex@characters <- new("ListOfcharacters", list(new("characters"))) ``` and now we have a length-1 list of character matrices, ```{r} length(nex@characters) ``` and we access the first character matrix using the list notation, `[[1]]`. Here we check the class is a `characters` object. ```{r} class(nex@characters[[1]]) ``` Direct subsetting has two primary use cases: (a) useful in looking up (and possibly editing) a specific value of an element, or (b) when adding metadata annotations to specific elements. Consider the example file ```{r} f <- system.file("examples", "trees.xml", package="RNeXML") nex <- nexml_read(f) ``` We can look up the species label of the first `otu` in the first `otus` block: ```{r} nex@otus[[1]]@otu[[1]]@label ``` We can add metadata to this particular OTU using this subsetting format ```{r} nex@otus[[1]]@otu[[1]]@meta <- c(meta("skos:note", "This species was incorrectly identified"), nex@otus[[1]]@otu[[1]]@meta) ``` Here we use the `c` operator to append this element to any existing meta annotations to this otu. RNeXML/R/0000755000176200001440000000000013614102250011512 5ustar liggesusersRNeXML/R/classes.R0000644000176200001440000006375713552353762013335 0ustar liggesusers setGeneric("fromNeXML", function(obj, from) standardGeneric("fromNeXML")) setGeneric("toNeXML", valueClass="XMLInternalElementNode", function(object, parent) standardGeneric("toNeXML")) # Rather verbose methods definitions manually reading and writing each class... # Rather than just slot matching names, we explicitly map each attribute... ############################## setClass("Base", slots = c('xsi:type' = "character")) setMethod("toNeXML", signature("Base", "XMLInternalElementNode"), function(object, parent){ type <- slot(object, "xsi:type") if(length(type) > 0){ #if(is.na(pmatch("nex:", type))) # nex or relevant namespace should come from default anyway # type <- paste0("nex:", type) addAttributes(parent, "xsi:type" = type, suppressNamespaceWarning=TRUE) # We always define xsi namespace in the header... } parent }) setMethod("fromNeXML", signature("Base", "XMLInternalElementNode"), function(obj, from){ if(!is.null(xmlAttrs(from))){ if(!is.na(xmlAttrs(from)["type"])) ## FIXME use [["type"]] or ["type"] slot(obj, "xsi:type") <- as.character(xmlAttrs(from)["type"]) if(!is.na(xmlAttrs(from)["xsi:type"])) ## Shouldn't be necessary but seems to be for first test in test_inheritance.R... slot(obj, "xsi:type") <- as.character(xmlAttrs(from)["xsi:type"]) } obj } ) ######################### setClass("meta", slots = c(children = "list"), contains = "Base") setAs("XMLInternalNode", "meta", function(from){ type <- xmlAttrs(from)["type"] if(is.na(type)) ## FIXME This is CRUDE type <- xmlAttrs(from)["xsi:type"] if(is.na(type)) # if still not defined... type = "meta" else type <- sub(".*:", "", type)[1] ## FIXME This is CRUDE fromNeXML(New(type), from) }) ######################### setClass("LiteralMeta", slots = c(id = "character", property = "character", datatype = "character", content = "character"), contains="meta") setMethod("fromNeXML", signature("LiteralMeta", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() literalContent <- xmlValue(from) if (literalContent != "") obj@content <- literalContent attrs <- xmlAttrs(from) obj@property <- attrs[["property"]] if(!is.na(attrs["datatype"])) obj@datatype <- attrs[["datatype"]] if(is.na(attrs["content"])) { kids <- xmlChildren(from) if (length(kids) == 1 && names(kids) != "text") { cnt <- saveXML(kids[[1]], indent = FALSE) # need to capture the XML namespaces for later serialization nsList <- xmlNamespace(kids[[1]]) attr(cnt, "namespaces") <- nsList if (length(nsList) > 0) # now that namespaces are captured, their declarations # are redundant and can get in the way at the string level cnt <- gsub(" xmlns:[A-Za-z0-9=]*\"[^\"]+\"", "", cnt) obj@content <- xml(cnt) } } else obj@content <- attrs[["content"]] if(!is.na(attrs["id"])) obj@id <- attrs[["id"]] obj } ) setMethod("toNeXML", signature("LiteralMeta", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() cnt <- object@content if (length(cnt) > 0 && class(cnt) == "XMLString") { # need to add back in the namespace definitions used by the # XML value to avoid a stream of warnings, even if this will # probably be redundant with the doc root parseXMLAndAdd(cnt, parent = parent, nsDefs = attr(cnt, "namespaces")) cnt <- character(0) } attrs <- c(id = unname(object@id), property = unname(object@property), # required datatype = unname(object@datatype), # optional content = unname(cnt)) # required attrs <- plyr::compact(attrs) addAttributes(parent, .attrs = attrs) }) setAs("XMLInternalElementNode", "LiteralMeta", function(from) fromNeXML(New("LiteralMeta"), from)) setAs("LiteralMeta", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("meta"))) setAs("LiteralMeta", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("meta"))) ############################################## setClass("ResourceMeta", slots = c(id = "character", rel = "character", href = "character"), contains="meta") setMethod("fromNeXML", signature("ResourceMeta", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() attrs <- xmlAttrs(from) if(!is.na(attrs["href"])) obj@href <- attrs[["href"]] if(!is.na(attrs["id"])) obj@id <- attrs[["id"]] if(!is.na(attrs[["rel"]])) obj@rel <- attrs[["rel"]] kids <- xmlChildren(from) if(length(kids) > 0) obj@children <- lapply(kids[names(kids) == "meta"], as, "meta") obj } ) setMethod("toNeXML", signature("ResourceMeta", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() attrs <- c(id = unname(object@id), href = unname(object@href), rel = unname(object@rel)) attrs <- plyr::compact(attrs) addAttributes(parent, .attrs = attrs) if (length(object@children) > 0) addChildren(parent, kids = lcapply(object@children, as, "XMLInternalNode")) parent }) setAs("XMLInternalElementNode", "ResourceMeta", function(from) fromNeXML(New("ResourceMeta"), from)) setAs("ResourceMeta", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("meta"))) setAs("ResourceMeta", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("meta"))) ############################################## setClass("ListOfmeta", slots = c(names="character"), contains = "list", validity = function(object) if(!all(sapply(object, is, "meta"))) "not all elements are meta objects" else TRUE ) ############################################### #' Class of objects that have metadata as lists of meta elements #' #' @slot meta list of `meta` objects #' @slot about for RDF extraction, the identifier for the resource that this #' object is about setClass("Annotated", slots = c(meta = "ListOfmeta", about = "character"), contains = "Base") setMethod("fromNeXML", signature("Annotated", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() kids <- xmlChildren(from) if(length(kids) > 0) obj@meta <- New("ListOfmeta", lapply(kids[names(kids) == "meta"], as, "meta")) if(!is.null(xmlAttrs(from))) if(!is.na(xmlAttrs(from)["about"])) obj@about <- xmlAttrs(from)["about"] obj }) setMethod("toNeXML", signature("Annotated", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addChildren(parent, kids = lcapply(object@meta, as, "XMLInternalNode")) if(length(object@about) > 0) addAttributes(parent, "about" = object@about) parent }) ###################################################### setClass("Labelled", slots = c(label = "character"), contains = "Annotated") setMethod("fromNeXML", signature("Labelled", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() if(!is.na(xmlAttrs(from)["label"])) obj@label <- xmlAttrs(from)["label"] obj } ) setMethod("toNeXML", signature("Labelled", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() if(length(object@label) > 0) addAttributes(parent, "label" = object@label) parent }) ############################## setClass("IDTagged", slots = c(id = "character"), contains = "Labelled") setMethod("fromNeXML", signature("IDTagged", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() if(!is.na(xmlAttrs(from)["id"])) obj@id <- as.character(xmlAttrs(from)["id"]) obj } ) setMethod("toNeXML", signature("IDTagged", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() if(length(object@id) > 0) addAttributes(parent, "id" = object@id) parent }) ############################## setClass("OptionalTaxonLinked", slots = c(otu = "character"), contains = "IDTagged") setMethod("fromNeXML", signature("OptionalTaxonLinked", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() if(!is.na(xmlAttrs(from)["otu"])) obj@otu <- as.character(xmlAttrs(from)["otu"]) obj } ) setMethod("toNeXML", signature("OptionalTaxonLinked", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() if(length(object@otu) > 0) addAttributes(parent, "otu" = object@otu) parent }) ############################## setClass("TaxaLinked", slots = c(otus = "character"), contains = "IDTagged") setMethod("fromNeXML", signature("TaxaLinked", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() if(!is.na(xmlAttrs(from)["otus"])) obj@otus <- as.character(xmlAttrs(from)["otus"]) obj } ) setMethod("toNeXML", signature("TaxaLinked", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() if(length(object@otus) > 0) addAttributes(parent, "otus" = object@otus) parent }) ############################## Really AbstractNode setClass("node", slots = c(root = "logical"), contains = "OptionalTaxonLinked") setMethod("fromNeXML", signature("node", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() if(!is.na(xmlAttrs(from)["root"])) obj@root <- as.logical(xmlAttrs(from)["root"]) obj } ) setMethod("toNeXML", signature("node", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() if(length(object@root) > 0) addAttributes(parent, "root" = tolower(object@root)) parent }) setAs("node", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("node"))) setAs("node", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("node"))) setAs("XMLInternalElementNode", "node", function(from) fromNeXML(nexml.node(), from)) ################################ Really AbstractEdge setClass("edge", slots = c(source = "character", target = "character", length = "numeric"), contains="IDTagged") setMethod("fromNeXML", signature("edge", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() attrs <- xmlAttrs(from) if (!is.na(attrs["source"])) obj@source <- attrs["source"] obj@target <- attrs["target"] if(!is.na(attrs["length"])) obj@length <- as.numeric(attrs["length"]) obj } ) setMethod("toNeXML", signature("edge", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() if(is(object, "rootEdge")) xmlName(parent) <- "rootedge" else addAttributes(parent, "source" = object@source) addAttributes(parent, "target" = object@target) if(length(object@length) > 0) addAttributes(parent, "length" = object@length) parent }) setAs("edge", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("edge"))) setAs("edge", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("edge"))) setAs("XMLInternalElementNode", "edge", function(from) fromNeXML(nexml.edge(), from)) # virtual class, allows asking is(edge, "rootEdge") to determine whether # a given edge object is a root edge or not setClass("rootEdge") # creates a virtual class setIs("edge", "rootEdge", test = function(Object) { length(Object@target) > 0 && length(Object@source) == 0 }, replace = function(Object, value) { stop("rootEdge is virtual, cannot replace") }) ################################ alternatively called "Taxon" by the schema setClass("otu", contains = "IDTagged") setMethod("fromNeXML", signature("otu", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() obj }) setMethod("toNeXML", signature("otu", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() parent }) setAs("otu", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("otu"))) setAs("otu", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("otu"))) setAs("XMLInternalElementNode", "otu", function(from) fromNeXML(nexml.otu(), from)) ################################ alternatively called Taxa by the schema setClass("ListOfotu", slots = c(names="character"), contains = "list", validity = function(object) if(!all(sapply(object, is, "otu"))) "not all elements are otu objects" else TRUE) ############################### setClass("otus", slots = c(otu = "ListOfotu", names="character"), contains = "IDTagged") setMethod("fromNeXML", signature("otus", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() kids <- xmlChildren(from) if(length(kids) > 0) obj@otu <- New("ListOfotu", lapply(kids[names(kids) == "otu"], as, "otu")) obj }) setMethod("toNeXML", signature("otus", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addChildren(parent, kids = lcapply(object@otu, as, "XMLInternalNode")) parent }) setAs("otus", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("otus"))) setAs("otus", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("otus"))) setAs("XMLInternalElementNode", "otus", function(from) fromNeXML(nexml.otus(), from)) ################################ setClass("ListOfedge", slots = c(names="character"), contains = "list", validity = function(object) if(!all(sapply(object, is, "edge"))) "not all elements are edge objects" else TRUE) setClass("ListOfnode", slots = c(names="character"), contains = "list", validity = function(object) if(!all(sapply(object, is, "node"))) "not all elements are node objects" else TRUE) ################################## actually AbstractTree setClass("tree", slots = c(node = "ListOfnode", edge = "ListOfedge", rootedge = "edge"), contains = "IDTagged") setMethod("fromNeXML", signature("tree", "XMLInternalElementNode"), function(obj, from){ .cacheNextMethod() obj <- callNextMethod() kids <- xmlChildren(from) obj@node <- New("ListOfnode", lapply(kids[names(kids) == "node"], as, "node")) obj@edge <- New("ListOfedge", lapply(kids[names(kids) == "edge"], as, "edge")) rootEdge <- kids[names(kids) == "rootedge"] if (length(rootEdge) > 0) obj@rootedge <- as(rootEdge[[1]], "edge") obj }) setMethod("toNeXML", signature("tree", "XMLInternalElementNode"), function(object, parent){ .cacheNextMethod() parent <- callNextMethod() addChildren(parent, kids = lcapply(object@node, as, "XMLInternalNode")) addChildren(parent, kids = lcapply(object@edge, as, "XMLInternalNode")) if (is(object@rootedge, "rootEdge")) addChildren(parent, as(object@rootedge, "XMLInternalNode")) parent }) setAs("tree", "XMLInternalNode", function(from) .callGeneric("toNeXML", from, newXMLNode("tree"))) setAs("tree", "XMLInternalElementNode", function(from) .callGeneric("toNeXML", from, newXMLNode("tree"))) setAs("XMLInternalElementNode", "tree", function(from) .callGeneric("fromNeXML", nexml.tree(), from)) ################################################ setClass("ListOftree", slots = c(names="character"), contains = "list") # validity can contain tree or network nodes? setClass("trees", slots = c(tree = "ListOftree"), # Can contain networks... contains = "TaxaLinked") setMethod("fromNeXML", signature("trees", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() kids <- xmlChildren(from) obj@tree <- New("ListOftree", lapply(kids[names(kids) == "tree"], as, "tree")) obj }) setMethod("toNeXML", signature("trees", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addChildren(parent, kids = lapply(object@tree, as, "XMLInternalNode")) # addChildren(parent, kids = object@network) parent }) setAs("trees", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("trees"))) setAs("trees", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("trees"))) setAs("XMLInternalElementNode", "trees", function(from) fromNeXML(nexml.trees(), from)) #################################################### setClass("ListOfotus", slots = c(names="character"), contains = "list") setClass("ListOftrees", slots = c(names="character"), contains = "list") setClass("ListOfcharacters", slots = c(names="character"), contains = "list") #################################################### nexml_namespaces <- c("nex" = "http://www.nexml.org/2009", "xsi" = "http://www.w3.org/2001/XMLSchema-instance", "xml" = "http://www.w3.org/XML/1998/namespace", "cdao" = "http://purl.obolibrary.org/obo/", "xsd" = "http://www.w3.org/2001/XMLSchema#", "dc" = "http://purl.org/dc/elements/1.1/", "dcterms" = "http://purl.org/dc/terms/", "prism" = "http://prismstandard.org/namespaces/1.2/basic/", "cc" = "http://creativecommons.org/ns#", "ncbi" = "http://www.ncbi.nlm.nih.gov/taxonomy#", "tc" = "http://rs.tdwg.org/ontology/voc/TaxonConcept#") #' Class representing a NeXML document #' #' The `nexml` class represents a NeXML document, and is the top of the #' class hierarchy defined in this package, corresponding to the root node #' of the corresponding XML document. #' #' Normally objects of this type are created by the package as a result of #' reading a NeXML file, or of converting from another type, such as #' `ape::phylo`. Also, interacting directly with the slots of the class is #' normally not necessary. Instead, use the `get_XXX()` and `add_XXX()` #' functions in the API. #' @slot trees list, corresponding to the list of `` elements in #' NeXML. Elements will be of class `trees`. #' @slot characters list, corresponding to the list of `` #' elements in NeXML. Elements will be of class `characters`. #' @slot otus list, corresponding to the list of `` elements in NeXML. #' Elements will be of class `otus`. #' @slot about inherited, see [Annotated][Annotated-class] #' @slot meta inherited, see [Annotated][Annotated-class] #' @slot xsi:type for internal use #' @slot version NeXML schema version, do not change #' @slot generator name of software generating the XML #' @slot xsi:schemaLocation for internal use, do not change #' @slot namespaces named character vector giving the XML namespaces #' @seealso [read.nexml()] #' @examples #' nex <- nexml() # a nexml object with no further content #' nex <- new("nexml") # accomplishes the same thing #' nex@generator #' length(nex@trees) #' #' data(bird.orders) #' nex <- as(bird.orders, "nexml") #' summary(nex) #' length(nex@trees) #' @export nexml #' @exportClass nexml nexml <- setClass("nexml", slots = c(version = "character", generator = "character", "xsi:schemaLocation" = "character", # part of base? namespaces = "character", # part of base? otus = "ListOfotus", trees = "ListOftrees", characters="ListOfcharacters"), prototype = prototype(version = "0.9", generator = "RNeXML", "xsi:schemaLocation" = "http://www.nexml.org/2009/nexml.xsd", namespaces = c(nexml_namespaces, "http://www.nexml.org/2009")), contains = "Annotated") setMethod("fromNeXML", signature("nexml", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() # handle attributes attrs <- xmlAttrs(from) obj@version <- attrs["version"] # required attribute if(!is.na(attrs["generator"])) # optional attribute obj@generator <- attrs["generator"] if(!is.na(attrs["xsi:schemaLocation"])) slot(obj, "xsi:schemaLocation") <- attrs["xsi:schemaLocation"] if(!is.na(attrs["schemaLocation"])) slot(obj, "xsi:schemaLocation") <- attrs["schemaLocation"] if(!is.na(attrs["xsi:type"])) slot(obj, "xsi:type") <- attrs["xsi:type"] if(!is.na(attrs["type"])) slot(obj, "xsi:type") <- attrs["type"] if(!is.na(attrs["about"])) obj@about <- attrs["about"] ns_defs <- xmlNamespaceDefinitions(from) ns <- sapply(ns_defs, `[[`, "uri") obj <- add_namespaces(ns, obj) # add our own namespaces, which will skip already present prefixes; # also add a base namespace if there isn't one already ourNS <- nexml_namespaces; if (! any(names(obj@namespaces) == "")) ourNS <- c(ourNS, unname(nexml_namespaces["nex"])) obj <- add_namespaces(ourNS, nexml = obj) # Handle children kids <- xmlChildren(from) # at least 1 OTU block is required obj@otus <- New("ListOfotus", lapply(kids[names(kids) == "otus"], as, "otus")) if("characters" %in% names(kids)) obj@characters <- New("ListOfcharacters", lapply(kids[names(kids) == "characters"], as, "characters")) if("trees" %in% names(kids)) obj@trees <- New("ListOftrees", lapply(kids[names(kids) == "trees"], as, "trees")) obj }) setMethod("toNeXML", signature("nexml", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addAttributes(parent, "version" = object@version) if(length(object@generator)>0) addAttributes(parent, "generator" = object@generator) # Coercion of object to XML happens automatically addChildren(parent, kids = object@otus) # a list of "otus" objects addChildren(parent, kids = object@trees) # a list of "trees" objects addChildren(parent, kids = object@characters) # a list of "characters" objects parent }) ## NOTE: The root nexml element must have it's namespace setAs("nexml", "XMLInternalNode", function(from) suppressWarnings(toNeXML(from, newXMLNode("nex:nexml", namespaceDefinitions = from@namespaces)))) setAs("nexml", "XMLInternalElementNode", function(from) suppressWarnings(toNeXML(from, newXMLNode("nex:nexml", namespaceDefinitions = from@namespaces)))) setAs("XMLInternalElementNode", "nexml", function(from) fromNeXML(nexml(namespaces = character(0)), from)) ####################################################### RNeXML/R/simmap.R0000644000176200001440000001475213552353762013155 0ustar liggesusers# simmap.R # if(!is.null(phy$maps)) ## FIXME write the characters/states block (but not matrix block) as well. ## FIXME support writing multiphylos, list of multiphylos to nexml #' Convert phylo with attached simmap to nexml object #' #' @param phy a phylo object containing simmap `phy$maps` element, #' from the phytools package #' @param state_ids a named character vector giving the state #' names corresponding to the ids used to refer to each state #' in nexml. If null ids will be generated and states taken from #' the phy$states names. #' @return a nexml representation of the simmap #' @export #' @import XML #' @examples #' simmap_ex <- read.nexml(system.file("examples","simmap_ex.xml", package="RNeXML")) #' phy <- nexml_to_simmap(simmap_ex) #' nex <- simmap_to_nexml(phy) simmap_to_nexml <- function(phy, state_ids = NULL){ ## Hack to deal with S3 class issues when coercing to S4 #if("simmap" %in% class(phy)) class(phy) <- "phylo" ## Create the NeXML object nexml <- as(phy, "nexml") if(!is.null(phy$states)){ nexml <- add_characters(data.frame(states = as.integer(as.factor(phy$states))), nexml) ## FIXME doesn't have states chars_ids <- get_state_maps(nexml)[[1]] char_id <- names(chars_ids) state_ids <- reverse_map(chars_ids[[1]]) # can assume no other states added yet since works on a phy, not nexml } if(!is.null(phy$maps)) nexml <- simmap_edge_annotations(maps = phy$maps, nexml = nexml, state_ids = state_ids, char_id = char_id) nexml } simmap_edge_annotations <- function(maps, nexml, state_ids = NULL, char_id = "simmapped_trait"){ ## if state ids are not given if(is.null(state_ids)){ state_ids <- levels(as.factor(names(unlist(maps)))) names(state_ids) <- state_ids } # Loop over all edges, adding the simmap annotation to each: for(i in 1:length(nexml@trees[[1]]@tree[[1]]@edge)){ ## FIXME check to assure this is always the correct order?? ## Read the mapping of the current edge edge_map <- maps[[i]] ## Generate the list of XML "stateChange" nodes mapping <- lapply(1:length(edge_map), function(j){ ## A node has an id, a length and a state meta(rel = "simmap:stateChange", children = list(meta(property = "simmap:order", content = j), meta(property = "simmap:length", content = edge_map[[j]]), meta(property = "simmap:state", content = state_ids[[names(edge_map[j])]] ) ) ) }) reconstruction <-meta(rel = "simmap:reconstruction", children =c(list(meta(property="simmap:char", content = char_id)), mapping)) ## Insert the reconstructions into a element in each nexml edge nexml@trees[[1]]@tree[[1]]@edge[[i]]@meta <- c(meta(type = "ResourceMeta", rel = "simmap:reconstructions", children = list(reconstruction))) } ## Return the entire nexml object nexml <- add_namespaces(c(simmap = "https://github.com/ropensci/RNeXML/tree/master/inst/simmap.md"), nexml) nexml } ## Returns list of multiPhylo ... #' Convert nexml object with simmap to phylo #' #' @param nexml a nexml object #' @return a simmap object (phylo object with a `$maps` element #' for use in phytools functions). #' @export #' @describeIn simmap_to_nexml Convert nexml object with simmap to phylo nexml_to_simmap <- function(nexml){ ## Get the statemap, if available characters <- get_characters(nexml) ## loop over trees blocks out <- lapply(nexml@trees, function(trees){ phys <- lapply(trees@tree, tree_to_simmap, get_otu_maps(nexml)[[trees@otus]], get_state_maps(nexml)[[1]][[1]] ) phys <- lapply(phys, characters_to_simmap, characters) names(phys) <- NULL class(phys) <- "multiPhylo" phys }) if(length(out) == 1){ if(length(out[[1]]) > 1){ flatten_multiphylo(out) } else { out[[1]][[1]] } } } characters_to_simmap <- function(phy, characters){ out <- as.character(characters[[1]]) # coerce factor to string names(out) <- rownames(characters) phy$states <- out phy } # given the nexml tree: tree_to_simmap <- function(tree, otus, state_maps = NULL){ maps <- lapply(tree@edge, function(edge){ reconstructions <- sapply(edge@meta, function(x) .hasSlot(x, "rel") && x@rel == "simmap:reconstructions") if(any(reconstructions)) reconstruction <- edge@meta[[which(reconstructions)]]@children else { # handle exceptions warning("no simmap data found") return(toPhylo(tree, otus)) ## no simmap found } # lapply(reconstruction, function(reconstruction){ # for each reconstruction stateChange <- sapply(reconstruction[[1]]@children, function(x) .hasSlot(x, "rel") && x@rel == "simmap:stateChange") values <- sapply(reconstruction[[1]]@children[which(stateChange)], function(stateChange){ # phytools only supports one reconstruction of one character per phy object property <- sapply(stateChange@children, function(x) x@property) names(stateChange@children) <- property # clean labels sapply(stateChange@children, function(x) x@content) }) out <- as.numeric(values["simmap:length", ]) ordering <- as.numeric(values["simmap:order",]) if(!is.null(state_maps)) states <- state_maps[values["simmap:state", ]] else states <- values["simmap:state", ] names(out) <- states out <- out[ordering] # sort according to explicit order out # }) }) names(maps) <- NULL phy <- toPhylo(tree, otus) phy$maps <- maps ## create the rest of the maps elements ## Return phylo object phy } ## Extend directly with XML representation instead of S4 #setClass("simmap:reconstructions", # slots = c(reconstruction = "ListOfreconstruction")) #setClass("ListOfreconstruction", contains = "list") #setClass("simmap:stateChange", contains = "IDTagged") # RNeXML/R/taxize_nexml.R0000644000176200001440000000351213614102250014345 0ustar liggesusers #' taxize nexml #' #' Check taxonomic names against the specified service and #' add appropriate semantic metadata to the nexml OTU unit #' containing the corresponding identifier. #' @param nexml a nexml object #' @param type the name of the identifier to use #' @param warnings should we show warning messages if no match can be found? #' @param ... additional arguments to `[taxadb::get_ids()]` #' @export #' @examples \dontrun{ #' data(bird.orders) #' birds <- add_trees(bird.orders) #' birds <- taxize_nexml(birds, "NCBI") #' } # @importFrom taxize get_uid taxize_nexml <- function(nexml, type = c("ncbi", "itis", "col", "tpl", "gbif", "wd"), warnings = TRUE, ...){ ## Soft dependency on taxadb if (!requireNamespace("taxadb", quietly = TRUE)) { stop("taxadb package required to convert look up taxonomic ids", call. = FALSE) } get_ids <- getExportedValue("taxadb", "get_ids") type <- tolower(type) type <- match.arg(type) for(j in 1:length(nexml@otus)){ # Resolve all ids at once labels <- unname(vapply(nexml@otus[[j]]@otu, slot, character(1L), "label")) clean_labels <- gsub("_", " ", labels) taxa_ids <- get_ids(clean_labels, type, format = "uri", ...) for(i in 1:length(taxa_ids)){ id <- taxa_ids[[i]] if(is.na(id) & warnings) warning(paste("ID for otu", nexml@otus[[j]]@otu[[i]]@label, "not found. Consider checking the spelling or alternate classification")) else nexml@otus[[j]]@otu[[i]]@meta <- c(nexml@otus[[j]]@otu[[i]]@meta, meta(href = taxa_ids[[i]], rel = "tc:toTaxon")) } } nexml } RNeXML/R/character_classes.R0000644000176200001440000003777013552353762015345 0ustar liggesusers#' @include classes.R #################################################### setClass("char", slots = c(states = "character"), contains = "IDTagged") setMethod("fromNeXML", signature("char", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() if(!is.na(xmlAttrs(from)["states"])) obj@states <- xmlAttrs(from)["states"] obj }) setMethod("toNeXML", signature("char", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() if(length(object@states) > 0) addAttributes(parent, "states" = object@states) parent }) setAs("char", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("char"))) setAs("char", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("char"))) setAs("XMLInternalElementNode", "char", function(from) fromNeXML(nexml.char(), from)) ############################################### setClass("ListOfrow", slots = c(names="character"), contains="list") setClass("obsmatrix", slots = c(row="ListOfrow"), contains = "Annotated") setMethod("fromNeXML", signature("obsmatrix", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() kids <- xmlChildren(from) if(length(kids) > 0) obj@row <- New("ListOfrow", lapply(kids[names(kids) == "row"], as, "row")) obj }) setMethod("toNeXML", signature("obsmatrix", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addChildren(parent, kids = lcapply(object@row, as, "XMLInternalNode")) parent }) setAs("obsmatrix", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("matrix"))) setAs("obsmatrix", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("matrix"))) setAs("XMLInternalElementNode", "obsmatrix", function(from) fromNeXML(nexml.matrix(), from)) ###################################################### setClass("ListOfcell", slots = c(names="character"), contains="list") setClass("ListOfseq", slots = c(names="character"), contains="list") setClass("row", slots = c(cell = "ListOfcell", seq = "ListOfseq"), contains = "OptionalTaxonLinked") setMethod("fromNeXML", signature("row", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() kids <- xmlChildren(from) if(length(kids) > 0){ if("cell" %in% names(kids)) obj@cell <- New("ListOfcell", lapply(kids[names(kids) == "cell"], as, "cell")) if("seq" %in% names(kids)) obj@seq <- New("ListOfseq", lapply(kids[names(kids) == "seq"], as, "seq")) } obj }) setMethod("toNeXML", signature("row", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addChildren(parent, kids = lcapply(object@cell, as, "XMLInternalNode")) addChildren(parent, kids = lcapply(object@seq, as, "XMLInternalNode")) parent }) setAs("row", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("row"))) setAs("row", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("row"))) setAs("XMLInternalElementNode", "row", function(from) fromNeXML(nexml.row(), from)) ####################################################### setClass("ListOfstate", slots = c(names="character"), contains="list") setClass("ListOfpolymorphic_state_set", slots = c(names="character"), contains="list") setClass("ListOfuncertain_state_set", slots = c(names="character"), contains="list") setClass("states", slots = c(state="ListOfstate", polymorphic_state_set="ListOfpolymorphic_state_set", uncertain_state_set="ListOfuncertain_state_set"), contains = "IDTagged") setMethod("fromNeXML", signature("states", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() kids <- xmlChildren(from) if(length(kids) > 0){ obj@state <- New("ListOfstate", lapply(kids[names(kids) == "state"], as, "state")) obj@polymorphic_state_set <- New("ListOfpolymorphic_state_set", lapply(kids[names(kids) == "polymorphic_state_set"], as, "polymorphic_state_set")) obj@uncertain_state_set <- New("ListOfuncertain_state_set", lapply(kids[names(kids) == "uncertain_state_set"], as, "uncertain_state_set")) } obj }) setMethod("toNeXML", signature("states", "XMLInternalElementNode"), function(object, parent){ suppressWarnings({ # avoid arcane XML warning message parent <- callNextMethod() addChildren(parent, kids = lcapply(object@state, as, "XMLInternalNode")) addChildren(parent, kids = lcapply(object@uncertain_state_set, as, "XMLInternalNode")) addChildren(parent, kids = lcapply(object@polymorphic_state_set, as, "XMLInternalNode")) }) parent }) setAs("states", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("states"))) setAs("states", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("states"))) setAs("XMLInternalElementNode", "states", function(from) fromNeXML(nexml.states(), from)) ####################################################### ## technically symbol is positive integer http://nexml.org/doc/schema-1/characters/standard/#StandardToken setClass("state", slots = c(symbol = "integer"), contains = "IDTagged") setMethod("fromNeXML", signature("state", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() obj@symbol <- as.integer(xmlAttrs(from)["symbol"]) obj }) setMethod("toNeXML", signature("state", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addAttributes(parent, "symbol" = object@symbol) parent }) setAs("state", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("state"))) setAs("state", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("state"))) setAs("XMLInternalElementNode", "state", function(from) suppressWarnings(fromNeXML(nexml.state(), from))) ################################################ ## a symbol for an uncertain stat is a character string setClass("uncertain_state", slots = c(symbol = "character"), contains = "IDTagged") setMethod("fromNeXML", signature("uncertain_state", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() obj@symbol <- xmlAttrs(from)["symbol"] obj }) setMethod("toNeXML", signature("uncertain_state", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addAttributes(parent, "symbol" = object@symbol) parent }) setAs("uncertain_state", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("uncertain_state"))) setAs("uncertain_state", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("uncertain_state"))) setAs("XMLInternalElementNode", "uncertain_state", function(from) suppressWarnings(fromNeXML(nexml.uncertain_state(), from))) ################################################ setClass("ListOfmember", slots = c(names="character"), contains="list") setClass("uncertain_state_set", slots = c(member = "ListOfmember"), contains="uncertain_state") setMethod("fromNeXML", signature("uncertain_state_set", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() kids <- xmlChildren(from) if(length(kids) > 0) obj@member <- New("ListOfmember", lapply(kids[names(kids) == "member"], as, "member")) obj }) setMethod("toNeXML", signature("uncertain_state_set", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addChildren(parent, kids = lcapply(object@member, as, "XMLInternalNode")) parent }) setAs("uncertain_state_set", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("uncertain_state_set"))) setAs("uncertain_state_set", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("uncertain_state_set"))) setAs("XMLInternalElementNode", "uncertain_state_set", function(from) fromNeXML(nexml.uncertain_states(), from)) ################################################ setClass("polymorphic_state_set", contains="uncertain_state_set") setMethod("fromNeXML", signature("polymorphic_state_set", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() kids <- xmlChildren(from) if(length(kids) > 0) obj@member <- New("ListOfmember", lapply(kids[names(kids) == "member"], as, "member")) obj }) setMethod("toNeXML", signature("polymorphic_state_set", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addChildren(parent, kids = lcapply(object@member, as, "XMLInternalNode")) parent }) setAs("polymorphic_state_set", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("polymorphic_state_set"))) setAs("polymorphic_state_set", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("polymorphic_state_set"))) setAs("XMLInternalElementNode", "polymorphic_state_set", function(from) fromNeXML(nexml.polymorphic_states(), from)) ##################### setClass("cell", slots = c(char="character", state= "character"), contains="Base") setMethod("fromNeXML", signature("cell", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() obj@char <- xmlAttrs(from)["char"] obj@state <- xmlAttrs(from)["state"] obj }) setMethod("toNeXML", signature("cell", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addAttributes(parent, "char" = object@char) addAttributes(parent, "state" = object@state) parent }) setAs("cell", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("cell"))) setAs("cell", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("cell"))) setAs("XMLInternalElementNode", "cell", function(from) fromNeXML(nexml.cell(), from)) ######################### setClass("member", slots = c(state="character"), contains="Base") setMethod("fromNeXML", signature("member", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() obj@state <- xmlAttrs(from)["state"] obj }) setMethod("toNeXML", signature("member", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addAttributes(parent, "state" = object@state) parent }) setAs("member", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("member"))) setAs("member", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("member"))) setAs("XMLInternalElementNode", "member", function(from) fromNeXML(nexml.member(), from)) ######################## setClass("seq", slots = c(seq = "character"), contains="Base") setMethod("fromNeXML", signature("seq", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() obj@seq <- xmlValue(from) obj } ) setMethod("toNeXML", signature("seq", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() addChildren(parent, object@seq) parent }) setAs("seq", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("seq"))) setAs("seq", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("seq"))) setAs("XMLInternalElementNode", "seq", function(from) fromNeXML(nexml.seq(), from)) ######################################### setClass("ListOfchar", slots = c(names="character"), contains="list") setClass("ListOfstates", slots = c(names="character"), contains="list") setClass("format", slots = c(states = "ListOfstates", ## FIXME Should be ListOfstates char = "ListOfchar"), contains = "Annotated") setMethod("fromNeXML", signature("format", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() kids <- xmlChildren(from) if(length(kids) > 0){ if("char" %in% names(kids)) obj@char <- New("ListOfchar", lapply(kids[names(kids) == "char"], as, "char")) if("states" %in% names(kids)) obj@states <- New("ListOfstates", lapply(kids[names(kids) == "states"], as, "states")) } obj }) setMethod("toNeXML", signature("format", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() if(!isEmpty(object@char)) addChildren(parent, kids = lcapply(object@char, as, "XMLInternalNode")) if(length(object@states) > 0) addChildren(parent, kids = lcapply(object@states, as, "XMLInternalNode")) parent }) setAs("format", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("format"))) setAs("format", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("format"))) setAs("XMLInternalElementNode", "format", function(from) fromNeXML(nexml.format(), from)) #################################################### setClass("characters", slots = c(format = "format", matrix = "obsmatrix"), contains = "TaxaLinked") setMethod("fromNeXML", signature("characters", "XMLInternalElementNode"), function(obj, from){ obj <- callNextMethod() obj@format <- as(from[["format"]], "format") obj@matrix <- as(from[["matrix"]], "obsmatrix") obj }) setMethod("toNeXML", signature("characters", "XMLInternalElementNode"), function(object, parent){ parent <- callNextMethod() parent <- addChildren(parent, as(object@format, "XMLInternalNode")) parent <- addChildren(parent, as(object@matrix, "XMLInternalNode")) parent }) setAs("characters", "XMLInternalNode", function(from) toNeXML(from, newXMLNode("characters"))) setAs("characters", "XMLInternalElementNode", function(from) toNeXML(from, newXMLNode("characters"))) setAs("XMLInternalElementNode", "characters", function(from) fromNeXML(nexml.characters(), from)) RNeXML/R/add_trees.R0000644000176200001440000001006113552353762013606 0ustar liggesusers#' @include nexmlTree.R NULL #' add_trees #' #' add_trees #' @param phy a phylo object, multiPhylo object, or list of #' multiPhylo to be added to the nexml #' @param nexml a nexml object to which we should append this phylo. #' By default, a new nexml object will be created. #' @param append_to_existing_otus logical, indicating if we should #' make a new OTU block (default) or append to the existing one. #' @return a nexml object containing the phy in nexml format. #' @export #' @examples #' library("geiger") #' data(geospiza) #' geiger_nex <- add_trees(geospiza$phy) add_trees <- function(phy, nexml=new("nexml"), append_to_existing_otus=FALSE){ nexml <- as(nexml, "nexml") phy <- standardize_phylo_list(phy) ## handle multiPhlyo cases new_taxa <- unlist(sapply(phy, function(y) sapply(y, function(z) z$tip.label))) nexml <- add_otu(nexml, new_taxa, append=append_to_existing_otus) otus_id <- nexml@otus[[length(nexml@otus)]]@id nexml <- add_trees_block(nexml, phy, otus_id) nexml } ##################### phylo -> nexml ############### setAs("phylo", "nexml", function(from){ add_trees(from) }) setAs("multiPhylo", "nexml", function(from){ add_trees(from) }) standardize_phylo_list <- function(phy){ if(is(phy, "list") && (is(phy[[1]], "list") || is(phy[[1]], "multiPhylo")) && is(phy[[1]][[1]], "phylo")){ phy } else if(is(phy, "multiPhylo") || (is(phy, "list") && is(phy[[1]], "phylo"))) { list(phy) } else if(is(phy, "phylo")) { phy <- list(phy) class(phy) <- "multiPhylo" list(phy) } else { # desperate phy <- list(as(phy, "phylo")) class(phy) <- "multiPhylo" list(phy) } } add_trees_block <- function(nexml, phy, otus_id){ phy <- standardize_phylo_list(phy) ## all trees will use the same otu_map <- reverse_map(get_otu_maps(nexml))[[otus_id]] trees <- lapply(phy, function(trs){ tree_id <- nexml_id("ts") nexml.trees( id = tree_id, about = paste0("#", tree_id), otus = otus_id, tree = New("ListOftree", lapply(trs, function(tr) fromPhylo(tr, otu_map))) ) }) ## Append to any existing trees nodes nexml@trees <- New("ListOftrees", c(nexml@trees, trees)) nexml } # Main routine to generate NeXML from ape:phylo fromPhylo <- function(phy, otu_map){ node_ids <- sapply(unique(as.numeric(phy$edge)), function(i) nexml_id("n")) names(node_ids) <- as.character(unique(as.numeric(phy$edge))) ## Generate the "ListOfedge" made of "edge" objects edges <- lapply(1:dim(phy$edge)[1], function(i){ edge_id <- nexml_id("e") source <- node_ids[as.character(phy$edge[i,1])] target <- node_ids[as.character(phy$edge[i,2])] e <- nexml.edge( source = source, target = target, id = edge_id, about = paste0("#", edge_id)) if(!is.null(phy$edge.length)) e@length <- as.numeric(phy$edge.length[i]) e } ) edges <- New("ListOfedge", edges) ## Generate the ListOfnode made of "node" objects ## In doing so, generate otu_id numbers for tip nodes nodes <- lapply(unique(as.numeric(phy$edge)), function(i){ node_id <- node_ids[as.character(i)] if(is.na(phy$tip.label[i])) nexml.node(id = node_id, about = paste0("#", node_id)) else if(is.character(phy$tip.label[i])){ otu_id <- otu_map[phy$tip.label[i]] nexml.node( id = node_id, about = paste0("#", node_id), otu = otu_id) } }) ## FIXME how about naming non-tip labels? nodes <- New("ListOfnode", nodes) ## Create the "tree" S4 object tree_id <- nexml_id("tree") tree <- nexml.tree( node = nodes, edge = edges, 'xsi:type' = 'FloatTree', id = tree_id, about = paste0("#", tree_id)) } RNeXML/R/nexml_methods.R0000644000176200001440000002424213552353762014530 0ustar liggesusers #setMethod("head", signature("nexml"), function(x, n=6L, ...){ # write.nexml(x, "tmp123.xml") # txt <- readLines("tmp123.xml", n=n) # unlink("tmp123.xml") # cat(txt, "\n") #}) #setMethod("tail", signature("nexml"), function(x, n=6L, ...){ # write.nexml(x, "tmp123.xml") # txt <- readLines("tmp123.xml", n=-n) # unlink("tmp123.xml") # cat(txt, "\n") #}) setMethod("show", signature("nexml"), function(object){ s <- summary(object) tr_block_counts <- "" if (s$nblocks["trees"] > 0) { tr_block_counts <- paste0(sapply(1:s$nblocks["trees"], function(i) paste("\t block", i, "contains", s$ntrees[i], "phylogenetic tree(s)")), collapse = "\n") tr_block_counts <- paste0("where:\n", tr_block_counts) } m_block_counts <- "" if (s$nblocks["characters"] > 0) { m_block_counts <- paste0( sapply(1:s$nblocks["characters"], function(i) { p1 <- paste("\t block", i, "defines", s$ncharacters[i]) if (endsWith(object@characters[[i]]@`xsi:type`, "ContinuousCells")) p1 <- paste(p1, "continuous character(s)") else { p1 <- paste(p1, "standard/discrete character(s),") if (is.na(s$nstates[1, i])) p1 <- paste(p1, "no state definitions") else { p1 <- paste(p1, "with") if (s$nstates["Min.", i] == s$nstates["Max.", i]) p1 <- paste(p1, s$nstates["Max.", i], "states each") else p1 <- paste(p1, s$nstates["Min.", i], "to", s$nstates["Max.", i], "states") p1 <- paste(p1, "\n\t and ", sum(s$nnonstdstatedefs[i,]), "polymorphic or uncertain state(s) defined") } } paste(p1, "\n\t matrix", i, "has", s$nmatrixrows[i], "row(s)") }), collapse = "\n") m_block_counts <- paste0("where:\n", m_block_counts) } cat(paste("A nexml object representing:\n", "\t", s$nblocks["trees"], "phylogenetic tree block(s),", tr_block_counts, "\n", "\t", s$nblocks["characters"], "character block(s),", m_block_counts, "\n", "\t", sum(s$notus), "taxonomic units in", s$nblocks["otus"], "block(s)", "\n Taxa:\t", paste(head(get_taxa(object)$label), collapse = ", "), "...")) cat("\n Metadata annotations:", paste0("\n\t", s$nmeta$nexml, " at top level"), sapply(names(s$nmeta)[-1], function(el) if (length(s$nmeta[[el]]) == 0) "" else paste0("\n\t", sapply(1:length(s$nmeta[[el]]), function(i) paste(s$nmeta[[el]][i], "in block", i)), " at ", el, " level", collapse = ""))) # description if provided descr <- get_metadata_values(object, props = "dc:description") if (all(!is.null(descr)) && any(nchar(descr) > 0)) cat("\n\n", paste(descr, collapse = "\n"), sep = "") # authors if provided creator <- get_metadata_values(object, props = "dc:creator") if (all(!is.null(creator)) && any(nchar(creator) > 0)) cat("\n\nAuthor(s):", paste(creator, collapse = ", ")) # license if provided lic <- get_license(object) if (! is.na(lic)) cat("\n\nLicense:", lic) cat("\n\nNeXML generated by", object@generator, "using", "schema version:", object@version, "\nSize:", capture.output(print(object.size(object), units="auto")), "\n") }) # FIXME: consider showing author/title/citation information if available? #' Summary method for nexml objects #' #' Generates a list of various counts of the major elements that comprise a #' [nexml][nexml-class] object, such as number of different kinds of blocks, #' characters, states, OTUs (taxa), etc. #' #' The [show][methods::show] method uses this summary for pretty-printing a #' summary of the NeXML object, but it can be used on its own as well, in #' particular for quick inspection of key properties of a NeXML file. #' @param object the [nexml][nexml-class] object #' @return A list with the following elements: #' - `nblocks` the number of trees, otus, and characters blocks #' - `ncharacters` the number of characters in each characters block #' - `nstates` summary statistics of the number of character states per state set #' defined for each characters block #' - `nnonstdstatedefs` the number of polymorphic and uncertain states defined #' for each character block #' - `nmatrixrows` the number of rows in the matrix for each character block #' - `ntrees` the number of trees contained in each trees block #' - `notus` the number of OTUs defined in each OTUs block #' - `nmeta` a list of the number of the number of metadata annotations at #' several levels, specifically: #' * `nexml` at the top (nexml) level #' * `otu` at the OTU level, for each OTUs block #' * `char` at the character level, for each characters block #' * `state` at the character state level, for each characters block #' @examples #' nex <- nexml_read(system.file("examples", "comp_analysis.xml", package = "RNeXML")) #' s <- summary(nex) #' # number of major blocks: #' s$nblocks #' #' # each characters block defines 1 character: #' s$ncharacters #' #' # summary stats of states per character (for morphological matrices there is #' # typically one state set per character) #' s$nstates # note that first block is of continuous type, so no stats there #' #' # pretty-printed summary: #' nex # this is the same as show(nex) #' @aliases summary.nexml #' @export setMethod("summary", signature("nexml"), function(object){ # number of blocks of trees, OTUs, characters s <- list( nblocks = c(trees = length(object@trees), otus = length(object@otus), characters = length(object@characters)) ) # number of characters per character block nc <- sapply(object@characters, function(bl) length(bl@format@char)) if (length(nc) > 0) names(nc) <- paste0("block.", seq(1, length(object@characters))) else nc <- as.integer(nc) s$ncharacters <- nc # number of states per character ns <- sapply(object@characters, function(bl) { if (length(bl@format@states) == 0) { bogusSumm <- summary(c(0)) NAs <- rep(NA, times = length(bogusSumm)) names(NAs) <- names(bogusSumm) NAs } else summary(sapply(bl@format@states, function(x) length(x@state))) }) if (length(dim(ns)) >= 2) colnames(ns) <- paste0("block.", seq(1, length(object@characters))) else ns <- as.integer(ns) s$nstates <- ns # number of state sets with polymorphic and uncertain states # (Note that morphological matrices typically define 1 state set for each # character, but molecular matrices will usually only define 1 state set. # Hence, the number of state sets may or may not say something about the # number of characters.) nsp <- sapply(object@characters, function(bl) if (length(bl@format@states) == 0) NA else sapply(bl@format@states, function(x) length(x@polymorphic_state_set))) if (length(dim(nsp)) > 0) nsp <- apply(nsp, 2, function(x) sum(x > 0)) nsu <- sapply(object@characters, function(bl) if (length(bl@format@states) == 0) NA else sapply(bl@format@states, function(x) length(x@uncertain_state_set))) if (length(dim(nsu)) > 0) nsu <- apply(nsu, 2, function(x) sum(x > 0)) s$nnonstdstatedefs <- matrix(c(nsp, nsu), ncol = 2, nrow = length(nsp), byrow = FALSE) colnames(s$nnonstdstatedefs) <- c("polymorphic", "uncertain") if (length(s$nnonstdstatedefs[, 1]) > 0) row.names(s$nnonstdstatedefs) <- paste0("block.", seq(1, length(object@characters))) # number of rows per matrix nr <- sapply(object@characters, function(bl) length(bl@matrix@row)) if (length(nr) > 0) names(nr) <- paste0("block.", seq(1, length(object@characters))) else nr <- as.integer(nr) s$nmatrixrows <- nr # number of trees per trees block nt <- sapply(object@trees, function(bl) length(bl@tree)) if (length(nt) > 0) names(nt) <- paste0("block.", seq(1, length(object@trees))) else nt <- as.integer(nt) s$ntrees <- nt # number of OTUs per OTUs block ntaxa <- sapply(object@otus, function(bl) length(bl@otu)) if (length(ntaxa) > 0) names(ntaxa) <- paste0("block.", seq(1, length(object@otus))) else ntaxa <- as.integer(ntaxa) s$notus <- ntaxa # number of metadata annotations nmeta <- list( nexml = length(get_all_meta(object)), otu = sapply(object@otus, function(bl) sum(sapply(bl@otu, function(x) length(get_all_meta(x))))), char = sapply(object@characters, function(bl) sum(sapply(bl@format@char, function(x) length(get_all_meta(x))))), state = sapply(object@characters, function(bl) if (length(bl@format@states) == 0) 0 else sum(unlist( sapply(bl@format@states, function(st) sapply(st@state, function(x) length(get_all_meta(x))))))) ) for (elem in names(nmeta)[-1]) { if (length(nmeta[[elem]]) > 0) { if (elem %in% c("char", "state")) bltype <- "characters" else bltype <- "otus" names(nmeta[[elem]]) <- paste0("block.", seq(1, length(slot(object, bltype)))) } else { nmeta[[elem]] <- as.integer(nmeta[[elem]]) } } s$nmeta <- nmeta s }) RNeXML/R/utils.R0000644000176200001440000000330013552353762013012 0ustar liggesusers## utility functions, presumably used mostly or entirely internally #' Compact list then lapply #' #' Compacts the list (i.e., removes NULL objects), then calls [`lapply()`][base::lapply()] #' on the result with the remaining parameters. #' @param X the list object #' @param ... remaining arguments to `lapply()` #' @importFrom plyr compact lcapply <- function(X, ...) { X <- plyr::compact(X) lapply(X, ...) } #' Front-end to dplyr::coalesce to deal with NULL vectors #' #' Replaces any NULL argument with a vector of `NA`, and casts every vector #' to the same type as the last vector. After that, calls [dplyr::coalesce()]. #' @param ... the vectors to coalesce on NA #' @return a vector of the same type and length as the last argument #' @seealso [dplyr::coalesce()] #' @importFrom dplyr coalesce coalesce_ <- function(...) { idvecs <- list(...) idvecs <- lapply(idvecs, function(v, template) { if (is.null(v)) as(rep(NA, times=length(template)), typeof(template)) else as(v, typeof(template)) }, template = idvecs[[length(idvecs)]]) dplyr::coalesce(!!!idvecs) } #' Treats zero-length character vectors as empty strings #' #' If the argument is a zero-length character vector (character(0)), returns #' an empty string (which is a character vector of length 1). Otherwise passes #' through the argument. #' @param x the object to be tested for zero-length character vector #' @return an empty string if `x` is a character vector of length zero, and `x` #' otherwise charzero_as_empty <- function(x) { if (is.character(x) && length(x) == 0) "" else x }RNeXML/R/deprecated.R0000644000176200001440000001155513552353762013765 0ustar liggesusers## Some of these methods are still in use by simmap and various add_ functions. ## Ideally all would be replaced by the equivalent get_level() version ## Conversions between matrix and characters node #' Extract the character matrix #' #' @param nexml nexml object (e.g. from read.nexml) #' @param rownames_as_col option to return character matrix rownames #' (with taxon ids) as it's own column in the data.frame. Default is FALSE #' for compatibility with geiger and similar packages. #' @return the list of taxa #' @examples #' comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") #' nex <- nexml_read(comp_analysis) #' get_characters_list(nex) #' @export get_characters_list <- function(nexml, rownames_as_col=FALSE){ # extract mapping between otus and taxon ids maps <- get_otu_maps(nexml) # loop over all character matrices out <- lapply(nexml@characters, function(characters){ # Make numeric data class numeric, discrete data class discrete type <- slot(characters, 'xsi:type') # check without namespace? if (grepl("ContinuousCells", type)) { dat <- extract_character_matrix(characters@matrix) dat <- otu_to_label(dat, maps[[characters@otus]]) dat <- character_to_label(dat, characters@format) for(i in length(dat)) ## FIXME something more elegant, no? dat[[i]] <- as.numeric(dat[[i]]) } else if (grepl("StandardCells", type)) { dat <- extract_character_matrix(characters@matrix) dat <- state_to_symbol(dat, characters@format) dat <- otu_to_label(dat, maps[[characters@otus]]) dat <- character_to_label(dat, characters@format) for(i in length(dat)) dat[[i]] <- factor(dat[[i]]) } else { dat <- NULL } if(rownames_as_col){ dat <- cbind(taxa = rownames(dat), dat) rownames(dat) <- NULL } dat }) # name the character matrices by their labels, # if available, otherwise, by id. names(out) <- name_by_id_or_label(nexml@characters) out } # for lists only # identical_rownames <- function(x) all(sapply(lapply(x, rownames), identical, rownames(x[[1]]))) #### Subroutines (not exported) ########### ### The subroutines of "get_characters_list# function ## Fixme these could be adapted to use the get_*_maps functions otu_to_label <- function(dat, otu_map){ rownames(dat) <- otu_map[rownames(dat)] dat } character_to_label <- function(dat, format){ ## Compute the mapping map <- map_chars_to_label(format) ## replace colnames with matching labels colnames(dat) <- map[colnames(dat)] dat } state_to_symbol <- function(dat, format){ if(!isEmpty(format@states)){ map_by_char <- map_state_to_symbol(format) for(n in names(dat)){ symbol <- map_by_char[[n]] dat[[n]] <- symbol[dat[[n]]] } dat } else { dat ## Nothing to do if we don't have a states list } } ### Subroutine for characters_to_label, ### Also subroutine for get_char_map . map_chars_to_label <- function(format){ map <- sapply(format@char, function(char){ if(length(char@label) > 0) label <- char@label else label <- char@id c(char@id, label) }) out <- map[2,] names(out) <- map[1,] out } # Subroutine of the get_state_maps and state_to_symbol functions # # For each character, find the matching `states` set. # For that set, map each state id to the state symbol map_state_to_symbol <- function(format){ # loop over characters map <- lapply(format@char, function(char){ # name the list with elements as `states` sets by their ids states <- format@states ids <- sapply(states, function(states) states@id) names(states) <- ids # Get the relevant states set matching the current character map_states_to_symbols( states[[char@states]] ) }) names(map) <- name_by_id(format@char) map } ## Subroutine of the map_state_to_symbol function above map_states_to_symbols <- function(states){ map <- sapply(states@state, function(state){ if(length(state@symbol) > 0) symbol <- state@symbol else symbol <- state@id c(state@id, symbol) }) out <- map[2, ] names(out) <- map[1, ] out } #' @import reshape2 extract_character_matrix <- function(matrix){ otu <- sapply(matrix@row, function(row) row@otu) # charnames <- unname(sapply(matrix@row[[1]]@cell, function(cell) cell@char)) names(matrix@row) <- otu mat <- lapply(matrix@row, function(row){ names(row@cell) <- unname(sapply(row@cell, function(b) b@char)) # names(row@cell) <- charnames lapply(row@cell, function(cell) cell@state) }) mat <- melt(mat) colnames(mat) <- c("state", "character", "otu") mat <- dcast(mat, otu ~ character, value.var = "state") # Move otus into rownames and drop the column rownames(mat) <- mat[["otu"]] # mat <- mat[-1] mat } RNeXML/R/get_trees.R0000644000176200001440000002015613552353762013643 0ustar liggesusers#' @include nexmlTree.R NULL #' extract all phylogenetic trees in ape format #' #' extract all phylogenetic trees in ape format #' @param nexml a representation of the nexml object from #' which the data is to be retrieved #' @return returns a list of lists of multiphylo trees, even if all trees #' are in the same `trees` node (and hence the outer list will be of length #' 1) or if there is only a single tree (and hence the inner list will also #' be of length 1. This ensures a consistent return type regardless of #' the number of trees present in the nexml file, and also preserves any #' grouping of trees. #' @export #' @examples #' comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") #' nex <- nexml_read(comp_analysis) #' get_trees_list(nex) #' @seealso \code{\link{get_trees}} \code{\link{get_flat_trees}} \code{\link{get_item}} get_trees_list <- function(nexml) as(nexml, "multiPhyloList") #' extract a phylogenetic tree from the nexml #' #' extract a phylogenetic tree from the nexml #' @param nexml a representation of the nexml object from #' which the data is to be retrieved #' @return an ape::phylo tree, if only one tree is represented. #' Otherwise returns a list of lists of multiphylo trees. #' To consistently receive the list of lists format (preserving #' the hierarchical nature of the nexml), use \code{\link{get_trees_list}} instead. #' @export #' @seealso \code{\link{get_trees}} \code{\link{get_flat_trees}} \code{\link{get_item}} #' @examples #' comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") #' nex <- nexml_read(comp_analysis) #' get_trees(nex) get_trees <- function(nexml) as(nexml, "phylo") #' get_flat_trees #' #' extract a single multiPhylo object containing all trees in the nexml #' @details Note that this method collapses any hierarchical structure that may have been present as multiple `trees` nodes in the original nexml (though such a feature is rarely used). To preserve that structure, use \code{\link{get_trees}} instead. #' @return a multiPhylo object (list of ape::phylo objects). See details. #' @param nexml a representation of the nexml object from which the data is to be retrieved #' @export #' @seealso \code{\link{get_trees}} \code{\link{get_trees}} \code{\link{get_item}} #' @examples #' comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") #' nex <- nexml_read(comp_analysis) #' get_flat_trees(nex) get_flat_trees <- function(nexml) flatten_multiphylo(get_trees_list(nexml)) ####### Coercion methods ######### setAs("nexml", "multiPhyloList", function(from){ map <- get_otu_maps(from) unname(lapply(from@trees, function(X){ out <- unname(lapply(X@tree, toPhylo, map[[X@otus]])) class(out) <- "multiPhylo" out })) }) # Always collapses all trees nodes into a multiphylo setAs("nexml", "multiPhylo", function(from){ map <- get_otu_maps(from) out <- unname(lapply(from@trees, function(X){ out <- unname(lapply(X@tree, toPhylo, map[[X@otus]])) class(out) <- "multiPhylo" out })) flatten_multiphylo(out) }) #' Flatten a multiphylo object #' #' @details NeXML has the concept of multiple nodes, each with multiple child nodes. #' This maps naturally to a list of multiphylo objects. Sometimes #' this hierarchy conveys important structural information, so it is not discarded by default. #' Occasionally it is useful to flatten the structure though, hence this function. Note that this #' discards the original structure, and the nexml file must be parsed again to recover it. #' @param object a list of multiphylo objects #' @export flatten_multiphylo <- function(object){ out <- unlist(object, FALSE, FALSE) class(out) <- "multiPhylo" out } setAs("nexml", "phylo", function(from){ if(length(from@trees[[1]]@tree) == 1){ maps <- get_otu_maps(from) otus_id <- from@trees[[1]]@otus out <- toPhylo(from@trees[[1]]@tree[[1]], maps[[otus_id]]) } else { warning("Multiple trees found, Returning multiPhylo object") out <- as(from, "multiPhylo") } if(length(out) == 1) out <- flatten_multiphylo(out) out }) ########### Main internal function for converting nexml to phylo ######## #' nexml to phylo #' #' nexml to phylo coercion #' @param tree an nexml tree element #' @param otus a character string of taxonomic labels, named by the otu ids. #' e.g. (from get_otu_maps for the otus set matching the relevant trees node. #' @return phylo object. If a "reconstructions" annotation is found on the #' edges, return simmap maps slot as well. #' @importFrom plyr arrange toPhylo <- function(tree, otus){ otu <- NULL # Avoid CRAN NOTE as per http://stackoverflow.com/questions/8096313/no-visible-binding-for-global-variable-note-in-r-cmd-check ## Extract the nodes list nodes <- sapply(unname(tree@node), function(x) c(node = unname(x@id), otu = missing_as_na(x@otu))) # conversion (nor ape?) can't handle rootedge, to if there is one, add source if (is(tree@rootedge, "rootEdge")) { rootEdge <- tree@rootedge rootEdge@source <- nexml_id(prefix = "rn") newroot <- c(node = rootEdge@source, otu = NA) nodes <- cbind(unname(newroot), nodes) } else rootEdge <- NULL # If any edges have lengths, use this routine if(any(sapply(tree@edge, function(x) length(x@length) > 0))) edges <- sapply(unname(tree@edge), function(x) c(source = unname(x@source), target = unname(x@target), length = if(identical(x@length, numeric(0))) NA else unname(x@length), id = unname(x@id))) else # no edge lengths, use this routine edges <- sapply(unname(tree@edge), function(x) c(source = unname(x@source), target = unname(x@target), id = unname(x@id))) # conversion (nor ape?) can't handle rootedge, to if there is one, add it if (! is.null(rootEdge)) { edges <- cbind(c(source = unname(rootEdge@source), target = unname(rootEdge@target), length = unname(rootEdge@length), id = unname(rootEdge@id)), edges) } nodes <- data.frame(t(nodes), stringsAsFactors=FALSE) names(nodes) <- c("node", "otu") ## Identifies tip.label based on being named with OTUs while others are NULL ## FIXME Should instead decide that these are tips based on the edge labels? nodes <- cbind(plyr::arrange(nodes, otu), id = 1:dim(nodes)[1]) # Also warns because arrange isn't quoting the column name. ## NB: these ids are the ape:id numbers by which nodes are identified in ape::phylo ## Arbitrary ids are not supported - ape expecs the numbers 1:n, starting with tips. ## nodes$node lists tip taxa first (see arrange fn above), since ## APE expects nodes numbered 1:n_tips to be to correspond to tips. source_nodes <- match(edges["source",], nodes$node) target_nodes <- match(edges["target",], nodes$node) ## Define elements of a phylo class object ## #--------------------------------------------# ## define edge matrix edge <- unname(cbind(source_nodes, target_nodes)) if("length" %in% rownames(edges)) edge.length <- as.numeric(edges["length",]) else edge.length <- NULL ## define tip labels tip_otus <- as.character(na.omit(nodes$otu)) tip.label <- otus[tip_otus] # Count internal nodes Nnode <- max(edge) - length(tip.label) # assemble the phylo object, assign class and return. phy = list(edge=edge, tip.label = unname(tip.label), Nnode = Nnode) if(!is.null(edge.length)) phy$edge.length = edge.length # optional fields class(phy) = "phylo" ## Check for simmap phy } ## Helper function missing_as_na <- function(x){ if(length(x) == 0) NA else unname(x) } RNeXML/R/concatenate_nexml.R0000644000176200001440000000352113552353762015346 0ustar liggesusers #' Concatenate nexml files #' #' Concatenate nexml files #' @param x,... nexml objects to be concatenated, e.g. from #' \code{\link{write.nexml}} or \code{\link{read.nexml}}. #' Must have unique ids on all elements #' @param recursive logical. If 'recursive = TRUE', the function recursively #' descends through lists (and pairlists) combining all their #' elements into a vector. (Not implemented). #' @return a concatenated nexml file #' @examples #' \dontrun{ #' f1 <- system.file("examples", "trees.xml", package="RNeXML") #' f2 <- system.file("examples", "comp_analysis.xml", package="RNeXML") #' nex1 <- read.nexml(f1) #' nex2 <- read.nexml(f2) #' nex <- c(nex1, nex2) #' } setMethod("c", signature("nexml"), function(x, ..., recursive = FALSE){ elements = list(x, ...) nexml <- new("nexml") ## Check that ids are unique if(!do.call(unique_ids,elements)) stop("ids are not unique across nexml files. Consider regenerating ids") else { nexml@otus <- New("ListOfotus", unlist(lapply(elements, function(n) n@otus), recursive=FALSE)) nexml@characters <- New("ListOfcharacters", unlist(lapply(elements, function(n) n@characters), recursive=FALSE)) nexml@trees <- New("ListOftrees", unlist(lapply(elements, function(n) n@trees), recursive=FALSE)) } nexml }) get_ids <- function(nexml){ doc <- xmlDoc(as(nexml, "XMLInternalNode")) out <- unname(xpathSApply(doc, "//@id")) free(doc) out } unique_ids <- function(...){ set <- list(...) counts <- table(unlist(lapply(set, get_ids))) !any(counts > 1) } RNeXML/R/get_level.R0000644000176200001440000001222513552353762013626 0ustar liggesusers ## Should be all element names (unless they are also attribute names!), since we only want attribute names ## (alternately we should define to only grab possible attribute names..) SKIP = c("meta", "children", "member", "row", "cell", "seq", "matrix", "format", "names") #' get_level #' #' get a data.frame of attribute values of a given node #' #' @param nex a nexml object #' @param level a character vector indicating the class of node, see details #' #' @return Returns the attributes of specified class of nodes as a data.frame #' #' @details level should be a character vector giving the path to the specified node #' group. For instance, `otus`, `characters`, and `trees` are top-level blocks (e.g. #' child nodes of the root nexml block), and can be specified directly. To get metadata #' for all "char" elements from all characters blocks, you must specify that `char` nodes #' are child nodes to `character` nodes: e.g. `get_level(nex, "characters/char")`, #' or similarly for states: `get_level(nex, characters/states)`. #' #' The return object is a data frame whose columns are the attribute names of the elements #' specified. The column names match the attribute names except for "id" attribute, for which the column #' is renamed using the node itself. (Thus would be rendered in a data.frame with column #' called "otus" instead of "id"). Additional columns are #' added for each parent element in the path; e.g. get_level(nex, "otus/otu") would include a column #' named "otus" with the id of each otus block. Even though the method always returns the data frame #' for all matching nodes in all blocks, these ids let you see which otu values came from which #' otus block. This is identical to the function call `get_taxa()`. #' Similarly, `get_level(nex, "otus/otu/meta")` would return additional columns 'otus' and #' also a column, 'otu', with the otu parent ids of each metadata block. (This is identical to a #' function call to `get_metadata`). This makes it easier to join data.frames as well, see examples #' #' @export #' @importFrom dplyr select get_level <- function(nex, level){ lvl <- strsplit(level, "/")[[1]] out <- recursion(1, lvl)(nex) %>% dplyr::select_(quote(-nexml)) ## drop columns that are all-na? # all_na <- sapply(out, function(x) all(is.na(x))) # out <- out[!all_na] out } ## Trick to apply nodelist_to_df iteratively closure <- function(level, fun) function(node) nodelist_to_df(node, level, fun) recursion <- function(i, level){ if(i < length(level)) closure(level[i], recursion(i+1, level)) else closure(level[i], attributes_to_row) } ## Assumes slot(node, element) is a list #' @importFrom lazyeval interp #' @importFrom dplyr bind_rows coalesce mutate mutate_ %>% #' @importFrom uuid UUIDgenerate nodelist_to_df <- function(node, element, fn, nodeId=NA){ dots <- setNames( list(lazyeval::interp(~x, x = if (is.na(nodeId)) node_id(node) else nodeId)), idRefColName(node)) nodelist <- slot(node, element) if(is.list(nodelist)){ ## node has a list of elements out <- suppressWarnings(lapply(nodelist, fn)) %>% dplyr::bind_rows() if (length(nodelist) > 0 && all(sapply(nodelist, is, "meta"))) { # meta elements may have nested meta elements, retrieve these here too ids <- sapply(nodelist, function(n) if (length(n@children) > 0) uuid::UUIDgenerate() else NA) if (length(ids) > 0 && any(!is.na(ids))) { mout <- dplyr::mutate(out, "Meta" = coalesce_(out$LiteralMeta, out$ResourceMeta, ids)) nested <- mapply(function(n, id) nodelist_to_df(n, "children", fn, id), n = nodelist, id = mout[,"Meta"]) if (is.null(names(nested))) nested <- as.data.frame(nested[,1]) out <- dplyr::bind_rows(mout, nested) } } dplyr::mutate_(out, .dots = dots) -> out } else { ## handle case when node has only one element fn(nodelist) %>% dplyr::mutate_(.dots = dots) } } node_id <- function(node){ if("id" %in% slotNames(node)) slot(node, "id") else "root" } idRefColName <- function(node){ clname <- class(node) super <- names(getClass(clname)@contains) # meta elements can be nested, avoid clobbering the ID column with the IDREF if (length(super) > 0 && (super[1] == "meta")) super[1] else clname } attributes_to_row <- function(node){ who <- slotNames(node) ## Avoid things that are not attributes: types <- getSlots(class(node)) # actual slot values may be derived types who <- who[ types %in% c("character", "integer", "numeric", "logical") ] # the "about" attribute is only needed for RDF extraction who <- who[!(who %in% c("names","about"))] ## Extract attributes, use NAs for numeric(0) / character(0) values tmp <- sapply(who, function(x) slot(node, x)) tmp[sapply(tmp,length) < 1] <- NA ## Coerce into a row of a data.frame & rename id column to match class out <- data.frame(as.list(tmp), stringsAsFactors=FALSE) if("id" %in% who) out <- dplyr::rename_(out, .dots = setNames("id", class(node))) out } RNeXML/R/add_basic_meta.R0000644000176200001440000001070713552353762014562 0ustar liggesusers#' Add basic metadata #' #' adds Dublin Core metadata elements to (top-level) nexml #' @param title A title for the dataset #' @param description a description of the dataset #' @param creator name of the data creator. Can be a string or R person object #' @param pubdate publication date. Default is current date. #' @param rights the intellectual property rights associated with the data. #' The default is Creative Commons Zero (CC0) public domain declaration, #' compatible with all other licenses and appropriate for deposition #' into the Dryad or figshare repositories. CC0 is also recommended by the Panton Principles. #' Alternatively, any other plain text string can be added and will be provided as the content #' attribute to the dc:rights property. #' @param publisher the publisher of the dataset. Usually where a user may go to find the canonical #' copy of the dataset: could be a repository, journal, or academic institution. #' @param citation a citation associated with the data. Usually an academic journal #' article that indicates how the data should be cited in an academic context. Multiple citations #' can be included here. #' citation can be a plain text object, but is preferably an R `citation` or `bibentry` object (which #' can include multiple citations. See examples #' @param nexml a nexml object to which metadata should be added. A new #' nexml object will be created if none exists. #' @return an updated nexml object #' @details \code{add_basic_meta()} is just a wrapper for \code{\link{add_meta}} to make it easy to #' provide generic metadata without explicitly providing the namespace. For instance, #' \code{add_basic_meta(title="My title", description="a description")} is identical to: #' \code{add_meta(list(meta("dc:title", "My title"), meta("dc:description", "a description")))} #' Most function arguments are mapped directly to the Dublin Core terms #' of the same name, with the exception of `rights`, which by default maps #' to the Creative Commons namespace when using CC0 license. #' #' @seealso \code{\link{add_trees}} \code{\link{add_characters}} \code{\link{add_meta}} #' @export #' @importFrom stats na.omit #' @importFrom utils capture.output head object.size #' @examples #' nex <- add_basic_meta(title = "My test title", #' description = "A description of my test", #' creator = "Carl Boettiger ", #' publisher = "unpublished data", #' pubdate = "2012-04-01") #' #' ## Adding citation to an R package: #' nexml <- add_basic_meta(citation=citation("ape")) #' \dontrun{ #' ## Use knitcitations package to add a citation by DOI: #' library(knitcitations) #' nexml <- add_basic_meta(citation = bib_metadata("10.2307/2408428")) #' } #' @include classes.R add_basic_meta <- function(title = NULL, description = NULL, creator = Sys.getenv("USER"), pubdate = NULL, rights = "CC0", publisher = NULL, citation = NULL, nexml = new("nexml") ){ if(!is.null(title)) nexml <- add_meta(meta("dc:title", title), nexml) if(!is.null(creator) || creator == "") { creators <- get_metadata_values(nexml, props = c("dc:creator")) if (! (creator %in% creators)) nexml <- add_meta(meta("dc:creator", format(creator)), nexml) } if(!is.null(pubdate)) nexml <- add_meta(meta("dcterms:modified", format(pubdate, tz = "GMT", usetz = TRUE)), nexml) if(!is.null(description)) nexml <- add_meta(meta("dc:description", description), nexml) if (!is.null(publisher)) nexml <- add_meta(meta("dcterms:publisher", publisher), nexml) if(!is.null(rights)){ if(is.na(get_license(nexml))) { if(rights == "CC0") nexml <- add_meta(meta(rel="cc:license", href="http://creativecommons.org/publicdomain/zero/1.0/"), nexml) else nexml <- add_meta(meta("dc:rights", rights), nexml) } } if(!is.null(citation)) { if(is(citation, "BibEntry")) class(citation) = "bibentry" if(is(citation, "bibentry")) nexml <- add_meta(nexml_citation(citation), nexml) else nexml <- add_meta(meta("dcterms:bibliographicCitation", citation), nexml) } nexml } RNeXML/R/constructors.R0000644000176200001440000000564613552353762014441 0ustar liggesusers#' new with namespaced class name #' #' Convenience function for [methods::new()] that ensures that the provided #' class name is namespaced with a package name. #' #' If the provided class name is not already namespaced (see #' [methods::packageSlot()]), it will be namespaced with this package. This #' mechanism is used by `new()` to disambiguate if the class name clashes #' with a class defined in another package. #' @note This may not completely eliminate messages on standard error about #' classes with the same name having been found in different packages. If #' they appear, they will most likely have come from the call to the #' [methods::initialize()] generic that `new()` issues at the end. #' @param Class the name of the S4 class to be instantiated #' @param ... additional parameters for [methods::new()] #' @importFrom methods new className packageSlot New <- function(Class, ...) { if (is.null(packageSlot(Class))) Class <- className(Class, "RNeXML") methods::new(Class, ...) } #' Constructor for the respective class #' #' Creates an instance of the class corresponding to the respective NeXML #' element, and initializes its slots with the provided parameters, if any. #' #' Usually, users won't need to invoke this directly. #' @param ... optionally, parameters passed on to [`new()`][methods::new()] #' @rdname constructors #' @export nexml.tree <- function(...) New("tree", ...) #' @rdname constructors #' @export nexml.trees <- function(...) New("trees", ...) #' @rdname constructors #' @export nexml.node <- function(...) New("node", ...) #' @rdname constructors #' @export nexml.edge <- function(...) New("edge", ...) #' @rdname constructors #' @export nexml.otu <- function(...) New("otu", ...) #' @rdname constructors #' @export nexml.otus <- function(...) New("otus", ...) #' @rdname constructors #' @export nexml.char <- function(...) New("char", ...) #' @rdname constructors #' @export nexml.characters <- function(...) New("characters", ...) #' @rdname constructors #' @export nexml.format <- function(...) New("format", ...) #' @rdname constructors #' @export nexml.state <- function(...) New("state", ...) #' @rdname constructors #' @export nexml.uncertain_state <- function(...) New("uncertain_state", ...) #' @rdname constructors #' @export nexml.states <- function(...) New("states", ...) #' @rdname constructors #' @export nexml.uncertain_states <- function(...) New("uncertain_state_set", ...) #' @rdname constructors #' @export nexml.polymorphic_states <- function(...) New("polymorphic_state_set", ...) #' @rdname constructors #' @export nexml.member <- function(...) New("member", ...) #' @rdname constructors #' @export nexml.matrix <- function(...) New("obsmatrix", ...) #' @rdname constructors #' @export nexml.row <- function(...) New("row", ...) #' @rdname constructors #' @export nexml.seq <- function(...) New("seq", ...) #' @rdname constructors #' @export nexml.cell <- function(...) New("cell", ...) RNeXML/R/internal_name_by_id.R0000644000176200001440000000050413552353762015637 0ustar liggesusers ## Helper functions name_by_id <- function(x) unname(sapply(x, function(i) if(length(i@id)>0) i@id else NULL)) name_by_id_or_label <- function(x) unname(sapply(x, function(i) if(length(i@label)>0) i@label else i@id)) get_by_id <- function(x, id){ ids <- sapply(x, function(i) i@id) m <- match(id, ids) x[[m]] } RNeXML/R/get_taxa.R0000644000176200001440000000216613552353762013457 0ustar liggesusers #' get_taxa #' #' Retrieve names of all species/otus otus (operational taxonomic units) included in the nexml #' @aliases get_taxa get_otu #' @param nexml a nexml object #' @return the list of taxa #' @export get_taxa get_otu #' @examples #' comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") #' nex <- nexml_read(comp_analysis) #' get_taxa(nex) #' @seealso \code{\link{get_item}} get_taxa <- function(nexml){ get_level(nexml, "otus/otu") } get_otu <- get_taxa #' get_taxa_list #' #' Retrieve names of all species/otus otus (operational taxonomic units) included in the nexml #' @aliases get_taxa_list get_otus_list #' @param nexml a nexml object #' @return the list of taxa #' @export get_taxa_list get_otus_list #' @seealso \code{\link{get_item}} get_taxa_list <- function(nexml){ out <- lapply(nexml@otus, function(otus){ out <- sapply(otus@otu, function(otu) otu@label) names(out) <- name_by_id(otus@otu) out }) names(out) <- name_by_id(nexml@otus) out } get_otus_list <- get_taxa_list RNeXML/R/tbl_df.R0000644000176200001440000000005413552353762013107 0ustar liggesusers`$.tbl_df` <- function(x, i) .subset2(x, i) RNeXML/R/nexml_add.R0000644000176200001440000000227013552353762013612 0ustar liggesusers #' add elements to a new or existing nexml object #' #' add elements to a new or existing nexml object #' @param x the object to be added #' @param nexml an existing nexml object onto which the object should be appended #' @param type the type of object being provided. #' @param ... additional optional arguments to the add functions #' #' @return a nexml object with the additional data #' @seealso \code{\link{add_trees}} \code{\link{add_characters}} \code{\link{add_meta}} \code{\link{add_namespaces}} #' @export #' @examples #' library("geiger") #' data(geospiza) #' geiger_nex <- nexml_add(geospiza$phy, type="trees") #' geiger_nex <- nexml_add(geospiza$dat, nexml = geiger_nex, type="characters") nexml_add <- function(x, nexml = new("nexml"), type = c("trees", "characters", "meta", "namespaces"), ...){ switch(type, "trees" = add_trees(x, nexml, ...), "characters" = add_characters(x, nexml, ...), "metadata" = add_meta(x, nexml, ...), "namespaces" = add_namespaces(x, nexml, ...)) } RNeXML/R/get_rdf.R0000644000176200001440000000166113552353762013274 0ustar liggesusers#' Extract rdf-xml from a NeXML file #' #' Extract rdf-xml from a NeXML file #' @param file the name of a nexml file, or otherwise a nexml object. #' @return an RDF-XML object (XMLInternalDocument). This can be manipulated with #' tools from the XML R package, or converted into a triplestore for use with #' SPARQL queries from the rdflib R package. #' @export #' @import httr XML #' @importFrom xml2 read_xml get_rdf <- function(file){ ## Soft dependency on xslt if (!requireNamespace("xslt", quietly = TRUE)) { stop("xslt package required to convert to rdf", call. = FALSE) } xml_xslt <- getExportedValue("xslt", "xml_xslt") if(is(file, "nexml")){ who <- tempfile() nexml_write(x=file, file=who) file <- who } to_rdf <- system.file("examples", "RDFa2RDFXML.xsl", package="RNeXML") rdf <- rdf <- xml_xslt(xml2::read_xml(file), xml2::read_xml(to_rdf)) rdf } RNeXML/R/nexml_publish.R0000644000176200001440000001040313552353762014525 0ustar liggesusers #' publish nexml files to the web and receive a DOI #' #' publish nexml files to the web and receive a DOI #' @param nexml a nexml object (or file path) #' @param ... additional arguments, depending on repository. See examples. #' @param repository destination repository #' @return a digital object identifier to the published data #' @export #' @examples \dontrun{ #' data(bird.orders) #' birds <- add_trees(bird.orders) #' doi <- nexml_publish(birds, visibility = "public", repository="figshare") #' } nexml_publish <- function(nexml, ..., repository="figshare"){ repository = match.arg(repository) switch(repository, figshare = nexml_figshare(nexml, ...)) } #' publish nexml to figshare #' #' publish nexml to figshare #' @param nexml a nexml object (or file path to a nexml file) #' @param file The filename desired for the object, if nexml is not already a file. #' if the first argument is already a path, this value is ignored. #' @param categories The figshare categories, must match available set. see \code{fs_add_categories} #' @param tags Any keyword tags you want to add to the data. #' @param visibility whether the results should be published (public), or kept private, #' or kept as a draft for further editing before publication. (New versions can be updated, #' but any former versions that was once made public will always be archived and cannot be removed). #' @param id an existing figshare id (e.g. from fs_create), to which this file can be appended. #' @param ... additional arguments #' @return the figshare id of the object #' @export #' @examples \dontrun{ #' data(bird.orders) #' birds <- add_trees(bird.orders) #' doi <- nexml_figshare(birds, visibility = "public", repository="figshare") #' } nexml_figshare <- function(nexml, file = "nexml.xml", categories = "Evolutionary Biology", tags = list("phylogeny", "NeXML"), visibility = c("public", "private", "draft"), id = NULL, ...){ visibility = match.arg(visibility) # success <- require(rfigshare) # if(!success){ # message("rfigshare package not found. Attempting to install") # install.packages("rfigshare") # success <- require(rfigshare) # if(!success) # stop("The rfigshare package must be installed to publish data to figshare") # } # handle nexml as a file path or as an object if(!is(nexml, "nexml")){ if(file.exists(nexml)){ file <- nexml nexml <- nexml_read(nexml) } # else warning? } m <- get_metadata(nexml) if(is.null(id)){ id <- rfigshare::fs_create(title = m[["dc:title"]], description = m[["dc:description"]], type = "dataset") } doi <- paste("http://doi.org/10.6084/m9.figshare", id, sep=".") rfigshare::fs_add_authors(id, authors = m[["dc:creator"]]) rfigshare::fs_add_categories(id, categories) rfigshare::fs_add_tags(id, tags) # Use object DOI instead of figshare id when available? # Construct DOI from figshare id? nexml <- add_meta(meta("dc:identifier", doi), nexml) nexml_write(nexml, file) rfigshare::fs_upload(id, file) if (visibility == "private"){ rfigshare::fs_make_private(id) message(paste("Your data has been uploaded to figshare privately. You may make further edits and publish the data from the online control panel at figshare.com or by using the rfigshare package and the article_id:", id, ". Your doi has been reserved but will not resolve until the article is made public.")) } else if (visibility == "public"){ rfigshare::fs_make_public(id) message(paste("Your data is published and now accessible at", doi)) } else { message(paste("Your data has been uploaded to figshare as a draft. You may make further edits and publish the data from the online control panel at figshare.com or by using the rfigshare package and the article_id:", id, " Your doi has been reserved but will not resolve until the article is made public.")) } # FIXME consider not returning the DOI as a link. # Consider returning just the Figshare id # id } RNeXML/R/add_meta.R0000644000176200001440000000553013552353762013417 0ustar liggesusers#' Add metadata to a nexml file #' #' @param meta a meta S4 object, e.g. ouput of the function \code{\link{meta}}, or a list of these meta objects #' @param nexml (S4) object #' @param level the level at which the metadata annotation should be added. #' @param namespaces named character string for any additional namespaces that should be defined. #' @param i for otus, trees, characters: if there are multiple such blocks, which one should be annotated? Default is first/only block. #' @param at_id the id of the element to be annotated. Optional, advanced use only. #' @seealso \code{\link{meta}} \code{\link{add_trees}} \code{\link{add_characters}} \code{\link{add_basic_meta}} #' @return the updated nexml object #' @examples #' ## Create a new nexml object with a single metadata element: #' modified <- meta(property = "prism:modificationDate", content = "2013-10-04") #' nex <- add_meta(modified) # Note: 'prism' is defined in nexml_namespaces by default. #' #' ## Write multiple metadata elements, including a new namespace: #' website <- meta(href = "http://carlboettiger.info", #' rel = "foaf:homepage") # meta can be link-style metadata #' nex <- add_meta(list(modified, website), #' namespaces = c(foaf = "http://xmlns.com/foaf/0.1/")) #' #' ## Append more metadata, and specify a level: #' history <- meta(property = "skos:historyNote", #' content = "Mapped from the bird.orders data in the ape package using RNeXML") #' data(bird.orders) #' nex <- add_trees(bird.orders) # need to have created a trees block first #' nex <- add_meta(history, #' nexml = nex, #' level = "trees", #' namespaces = c(skos = "http://www.w3.org/2004/02/skos/core#")) #' #' @export add_meta #' @include classes.R #' add_meta <- function(meta, nexml=new("nexml"), level=c("nexml", "otus", "trees", "characters"), namespaces = NULL, i = 1, at_id = NULL){ level <- match.arg(level) if (is.null(meta)) stop("meta object to add is null, with no default") if(!is.list(meta)) meta <- list(meta) if(!all(sapply(meta, is, "meta"))) stop("All elements in list must be of class 'meta' or a subclass") if(!is.null(at_id)){ stop("function does not yet handle at_id assignments") # case not written yet } else if(level =="nexml"){ nexml@meta <- c(nexml@meta, meta) } else if(level =="otus"){ nexml@otus[[i]]@meta <- c(nexml@otus[[i]]@meta, meta) } else if(level == "trees"){ nexml@trees[[i]]@meta <- c(nexml@trees[[i]]@meta, meta) } else if(level == "characters"){ nexml@characters[[i]]@meta <- c(nexml@characters[[i]]@meta, meta) } ## append additional namespaces nexml <- add_namespaces(namespaces, nexml) nexml } RNeXML/R/internal_nexml_id.R0000644000176200001440000000155013552353762015352 0ustar liggesusers nexml_env = new.env(hash=TRUE) # If no prefix is given, will use a UUID # Generates an id number by appending a counter to the prefix # Will keep track of the counter for each prefix for that session. #' @import uuid nexml_id <- function(prefix = "", use_uuid = getOption("uuid", FALSE)){ if(use_uuid){ uid <- paste0("uuid-", UUIDgenerate()) } else { if((prefix %in% ls(envir=nexml_env))) id_counter <- get(prefix, envir=nexml_env) else { assign(prefix, 1, envir=nexml_env) id_counter <- 1 } uid <- paste0(prefix, id_counter) id_counter <- id_counter + 1 assign(prefix, id_counter, envir=nexml_env) } uid } #' reset id counter #' #' reset the id counter #' @export reset_id_counter <- function(){ rm(list=ls(envir=nexml_env), envir=nexml_env) } # use an environment to store counter RNeXML/R/get_characters.R0000644000176200001440000001776413552353762014653 0ustar liggesusers#' Get character data.frame from nexml #' #' @param nex a nexml object #' @param rownames_as_col option to return character matrix rownames (with taxon ids) as it's own column in the #' data.frame. Default is FALSE for compatibility with geiger and similar packages. #' @param otu_id logical, default FALSE. return a column with the #' otu id (for joining with otu metadata, etc) #' @param otus_id logical, default FALSE. return a column with the #' otus block id (for joining with otu metadata, etc) #' @param include_state_types logical, default FALSE. whether to also return a #' matrix of state types (with values standard, polymorphic, and uncertain) #' @return the character matrix as a data.frame, or if `include_state_types` is #' TRUE a list of two elements, `characters` as the character matrix, and #' `state_types` as a matrix of state types. Both matrices will be in the same #' ordering of rows and columns. #' @details RNeXML will attempt to return the matrix using the NeXML taxon (otu) labels to name the rows #' and the NeXML char labels to name the traits (columns). If these are unavailable or not unique, the NeXML #' id values for the otus or traits will be used instead. #' @importFrom tidyr spread #' @importFrom dplyr left_join select_ matches #' @importFrom stringr str_replace #' @importFrom stats setNames #' @export #' @examples #' \dontrun{ #' # A simple example with a discrete and a continous trait #' f <- system.file("examples", "comp_analysis.xml", package="RNeXML") #' nex <- read.nexml(f) #' get_characters(nex) #' #' # A more complex example -- currently ignores sequence-type characters #' f <- system.file("examples", "characters.xml", package="RNeXML") #' nex <- read.nexml(f) #' get_characters(nex) #' #' # if polymorphic or uncertain states need special treatment, request state #' # types to be returned as well: #' f <- system.file("examples", "ontotrace-result.xml", package="RNeXML") #' nex <- read.nexml(f) #' res <- get_characters(nex, include_state_types = TRUE) #' row.has.p <- apply(res$state_types, 1, #' function(x) any(x == "polymorphic", na.rm = TRUE)) #' col.has.p <- apply(res$state_types, 2, #' function(x) any(x == "polymorphic", na.rm = TRUE)) #' res$characters[row.has.p, col.has.p, drop=FALSE] # polymorphic rows and cols #' res$characters[!row.has.p, drop=FALSE] # drop taxa with polymorphic states #' # replace polymorphic state symbols in matrix with '?' #' m1 <- mapply(function(s, s.t) ifelse(s.t == "standard", s, "?"), #' res$characters, res$state_types) #' row.names(m1) <- row.names(res$characters) #' m1 #' } get_characters <- function(nex, rownames_as_col=FALSE, otu_id=FALSE, otus_id=FALSE, include_state_types=FALSE) { drop = lazyeval::interp(~-dplyr::matches(x), x = "about|xsi.type|format") otus <- get_level(nex, "otus/otu") %>% dplyr::select_(drop) %>% optional_labels(id_col = "otu") char <- get_level(nex, "characters/format/char") %>% dplyr::select_(drop) %>% optional_labels(id_col = "char") ## Rows have otu information rows <- get_level(nex, "characters/matrix/row") %>% dplyr::select_(.dots = c("otu", "row")) cellLevel <- get_level(nex, "characters/matrix/row/cell") cells <- cellLevel %>% dplyr::select_(.dots = c("char", "state", "row")) %>% dplyr::left_join(rows, by = "row") characters <- get_level(nex, "characters") ## States, not including polymorphic or uncertain states states <- get_level(nex, "characters/format/states/state") %>% dplyr::mutate(state.type = "standard") ## Include polymorphic and uncertain states. polymorph <- get_level(nex, "characters/format/states/polymorphic_state_set") uncertain <- get_level(nex, "characters/format/states/uncertain_state_set") if(dim(polymorph)[1] > 0) { ## For the result to work correctly for joining, the ID column needs to ## be uniformly named "state". polymorph <- polymorph %>% dplyr::mutate(state.type = "polymorphic") %>% dplyr::rename(state = "polymorphic_state_set") # StandardStates have integer symbols, but polymorphic state sets typically # do not. If states are DNA, then states will already be character type, and # then changing to character should presumably have no effect. states <- states %>% dplyr::mutate_at(c("symbol"), as.character) %>% dplyr::bind_rows(polymorph) } if(dim(uncertain)[1] > 0) { ## Same issue for uncertain states. uncertain <- uncertain %>% dplyr::mutate(state.type = "uncertain") %>% dplyr::rename(state = "uncertain_state_set") states <- states %>% dplyr::mutate_at(c("symbol"), as.character) %>% dplyr::bind_rows(uncertain) } states <- dplyr::select_(states, drop) if(dim(states)[1] > 0) cells <- cells %>% dplyr::left_join(states, by = c("state")) %>% dplyr::select_(.dots = c("char", "symbol", "otu", "state", "state.type")) ## Join the matrices. Note that we select unique column names after each join to avoid collisions cells <- cells %>% dplyr::left_join(char, by = c("char")) %>% dplyr::rename_(.dots = c("trait" = "label")) %>% dplyr::left_join(otus, by = c("otu")) %>% dplyr::rename_(.dots = c("taxa" = "label")) # character state matrix with symbols: cells %>% na_symbol_to_state() %>% dplyr::select_(.dots = c("taxa", "symbol", "trait", "otu", "otus")) %>% tidyr::spread("trait", "symbol") -> out # state type matrix if(dim(states)[1] == 0) { # this can be the case for example for continuous states cells <- dplyr::mutate(cells, state.type = "standard") } cells %>% dplyr::select_(.dots = c("taxa", "state.type", "trait", "otu", "otus")) %>% dplyr::mutate_at("state.type", as.factor) %>% tidyr::spread("trait", "state.type") -> state_types ## Identify the class of each column and reset it appropriately cellclass <- function(x){ x %>% stringr::str_replace(".*ContinuousCells", "numeric") %>% stringr::str_replace(".*StandardCells", "integer") } type <- cellLevel %>% dplyr::select_(drop) %>% dplyr::left_join(characters, by = "characters") %>% dplyr::select_(.dots = c( "xsi.type", "char", "characters")) %>% dplyr::left_join(char, by = c("char")) %>% dplyr::select_(.dots = c("label", "xsi.type")) %>% dplyr::distinct() %>% dplyr::mutate_(.dots = setNames(list(~cellclass(xsi.type)), "class")) for(i in 1:dim(type)[1]) { if (all(state_types[[type$label[i]]] == "standard", na.rm = TRUE)) { class(out[[type$label[i]]]) <- type$class[i] } } ## drop unwanted columns if requested (default) if(!otu_id){ out <- dplyr::select_(out, quote(-otu)) if (include_state_types) state_types <- dplyr::select_(state_types, quote(-otu)) } if(!otus_id){ out <- dplyr::select_(out, quote(-otus)) if (include_state_types) state_types <- dplyr::select_(state_types, quote(-otus)) } if(!rownames_as_col){ taxa <- out$taxa out <- as.data.frame(dplyr::select_(out, quote(-taxa))) rownames(out) <- taxa if (include_state_types) { state_types <- as.data.frame(dplyr::select_(state_types, quote(-taxa))) rownames(state_types) <- taxa } } if (include_state_types) { out <- list(characters = out, state_types = state_types) } out } ## If 'label' column is missing, create it from 'id' column ## if label exists but has missing or non-unique values, also use ids instead optional_labels <- function(df, id_col = "id"){ who <- names(df) if(! "label" %in% who) df$label <- df[[id_col]] if(length(unique(df$label)) < length(df$label)) df$label <- df[[id_col]] df } ## Continuous traits have the values in "state" column, whereas ## for discrete states we return the value of the "symbol" column na_symbol_to_state <- function(df){ if(is.null(df$symbol)) df$symbol <- NA df$symbol[is.na(df$symbol)] <- suppressWarnings(as.numeric(df$state[is.na(df$symbol)])) df } RNeXML/R/add_namespaces.R0000644000176200001440000000443013552353762014606 0ustar liggesusers #' Add namespaces #' #' Add namespaces and their prefixes as a named vector of URIs, with the #' names being the prefixes. Namespaces have most relevance for meta objects' #' `rel` and `property`, and for embedded XML literals. #' #' The implementation attempts to avoid duplication, currently using the #' prefix. I.e., namespaces with prefixes already defined will not get added. #' Namespaces needed by the NeXML format, and for commonly used metadata #' terms, are already included by default, see [get_namespaces()]. #' @note Often a user won't call this directly, but instead provide the #' namespace(s) through [add_meta()]. #' @param namespaces a named character vector of namespaces #' @param nexml a nexml object. will create a new one if none is given. #' @return a nexml object with updated namespaces #' @examples #' ## Write multiple metadata elements, including a new namespace: #' website <- meta(href = "http://carlboettiger.info", #' rel = "foaf:homepage") # meta can be link-style metadata #' modified <- meta(property = "prism:modificationDate", #' content = "2013-10-04") #' nex <- add_meta(list(modified, website), #' namespaces = c(foaf = "http://xmlns.com/foaf/0.1/")) #' # prism prefix already included by default #' #' ## Add namespace "by hand" before adding meta: #' nex <- add_namespaces(c(skos = "http://www.w3.org/2004/02/skos/core#"), #' nexml = nex) #' history <- meta(property = "skos:historyNote", #' content = "Mapped from the bird.orders data in the ape package using RNeXML") #' nex <- add_meta(history, nexml = nex) #' #' @seealso [meta()] [add_meta()] [get_namespaces()] #' @export add_namespaces <- function(namespaces, nexml = new("nexml")){ if(!is.null(namespaces)){ ## check for duplicated abbreviation, not for duplicated URI. OKAY to have multiple abbrs for same URI... ## FIXME Make sure that cases where abbreviation match actually match the URI as well notdups <- match(names(namespaces), names(nexml@namespaces)) notdups <- sapply(notdups, is.na) if(all(notdups)) # all are unique nexml@namespaces <- c(nexml@namespaces, namespaces) else { nexml@namespaces <- c(nexml@namespaces, namespaces[notdups]) } } nexml } RNeXML/R/nexml_get.R0000644000176200001440000000622213552353762013642 0ustar liggesusers#' Get the desired element from the nexml object #' #' Get the desired element from the nexml object #' @aliases nexml_get get_item #' @param nexml a nexml object (from read_nexml) #' @param element the kind of object desired, see details. #' @param ... additional arguments, if applicable to certain elements #' @details #' #' \itemize{ #' \item{"tree"}{ an ape::phylo tree, if only one tree is represented. Otherwise returns a list of lists of multiphylo trees. To consistently receive the list of lists format (preserving the hierarchical nature of the nexml), use \code{trees} instead.} #' \item{"trees"}{ returns a list of lists of multiphylo trees, even if all trees are in the same `trees` node (and hence the outer list will be of length 1) or if there is only a single tree (and hence the inner list will also be of length 1. This ensures a consistent return type regardless of the number of trees present in the nexml file, and also preserves any hierarchy/grouping of trees. } #' \item{"flat_trees"}{ a multiPhylo object (list of ape::phylo objects) Note that this method collapses any hierarchical structure that may have been present as multiple `trees` nodes in the original nexml (though such a feature is rarely used). To preserve that structure, use `trees` instead.} #' \item{"metadata"}{Get metadata from the specified level (default is top/nexml level) } #' \item{"otu"}{ returns a named character vector containing all available metadata. names indicate \code{property} (or \code{rel} in the case of links/resourceMeta), while values indicate the \code{content} (or \code{href} for links). } #' \item{"taxa"}{ alias for otu } #' } #' For a slightly cleaner interface, each of these elements is also defined as an S4 method #' for a nexml object. So in place of `get_item(nexml, "tree")`, one could use `get_tree(nexml)`, #' and so forth for each element type. #' @return return type depends on the element requested. See details. #' @export #' @seealso \code{\link{get_trees}} #' @include classes.R #' @examples #' comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") #' nex <- nexml_read(comp_analysis) #' nexml_get(nex, "trees") #' nexml_get(nex, "characters_list") nexml_get <- function(nexml, element = c("trees", "trees_list", "flat_trees", "metadata", "otu", "taxa", "characters", "characters_list", "namespaces"), ...){ element <- match.arg(element) switch(element, trees = get_trees(nexml), # will warn if more than one tree is available trees_list = get_trees_list(nexml), flat_trees = get_flat_trees(nexml), metadata = get_metadata(nexml, ...), otu = get_taxa(nexml), taxa = get_taxa(nexml), characters = get_characters(nexml), characters_list = get_characters_list(nexml), namespaces = get_namespaces(nexml)) } get_item <- nexml_get RNeXML/R/internal_isEmpty.R0000644000176200001440000000117413552353762015207 0ustar liggesusers isEmpty <- function (obj) { if (!isS4(obj)) { if (length(obj) > 0) FALSE else TRUE } else { if (identical(obj, new(class(obj)[1]))) out <- TRUE else { empty <- sapply(slotNames(obj), function(s) { if (isS4(slot(obj, s))) isEmpty(slot(obj, s)) else { if (length(slot(obj, s)) == 0) TRUE else if (length(slot(obj, s)) > 0) FALSE } }) out <- !any(!empty) } out } } RNeXML/R/get_metadata.R0000644000176200001440000001524613552353762014305 0ustar liggesusers ## FIXME might want to define this for sub-nodes. e.g. so we can get all metadata on "nodes" in tree2... #' get_metadata #' #' get_metadata #' @param nexml a nexml object #' @param level the name of the level of element desired, see details #' @param simplify logical, see Details #' @return the requested metadata as a data.frame. Additional columns #' indicate the parent element of the return value. #' @details 'level' should be either the name of a child element of a NeXML document #' (e.g. "otu", "characters"), or a path to the desired element, e.g. 'trees/tree' #' will return the metadata for all phylogenies in all trees blocks. #' #' If a metadata element has other metadata elements nested within it, the #' nested metadata are returned as well. A column "Meta" will contain the #' IDs consolidated from the type-specific LiteralMeta and ResourceMeta #' columns, and IDs are generated for meta elements that have nested elements #' but do not have an ID ("blank nodes"). A column "meta" contains the #' IDs of the parent meta elements for nested ones. This means that the #' resulting table can be self-joined on those columns. #' #' If `simplify` is `FALSE`, the type-specific "LiteralMeta" and "ResourceMeta" #' columns will be retained even if a consolidated "Meta" column is present. #' Otherwise, only the consolidated column will be included in the result. #' Also, if `simplify` is `TRUE` the values for "property" (LiteralMeta) and #' "rel" (ResourceMeta) will be consolidated to "property", and "rel" will be #' removed from the result. #' #' @import XML #' @examples \dontrun{ #' comp_analysis <- system.file("examples", "primates.xml", package="RNeXML") #' nex <- nexml_read(comp_analysis) #' get_metadata(nex) #' get_metadata(nex, "otus/otu") #' } #' @export get_metadata <- function(nexml, level = "nexml", simplify = TRUE){ # level = c("nexml", "otus", "trees", "characters", # "otus/otu", "trees/tree", "characters/format", "characters/matrix", # "characters/format/states") # level <- match.arg(level) ## Handle deprecated formats if(level =="otu") level <- "otus/otu" if(level =="tree") level <- "trees/tree" if(level == "nexml") level <- "meta" else level <- paste(level, "meta", sep="/") out <- get_level(nexml, level) if (simplify) { cnames = colnames(out) if (! ("Meta" %in% cnames)) { out <- dplyr::mutate(out, "Meta" = coalesce_(out$LiteralMeta, out$ResourceMeta, as.character(rep(NA, times=nrow(out))))) } out <- dplyr::mutate(out, LiteralMeta = NULL, ResourceMeta = NULL) if (all(c("rel","property") %in% cnames)) out <- dplyr::mutate(out, property = dplyr::if_else(is.na(out$property), out$rel, out$property), rel = NULL) else if ("rel" %in% cnames) out <- dplyr::rename(out, property = "rel") } out } #' Get the value(s) for metadata #' #' Extracts the values from the metadata annotations for the given property #' or properties, and returns the result. #' #' For matching property identifiers (i.e., URIs), prefixes in the input list #' as well as in the `annotated` object will be expanded using the namespaces #' of the `nexml` object. Names in the returned vector are mapped to the #' (possibly prefixed) form in the input list. #' @param nexml a nexml object #' @param annotated the nexml component object from which to obtain metadata #' annotations, defaults to the nexml object itself #' @param props a character vector of property names for which to extract #' metadata annotations #' @return a named character vector, giving the values and names being the #' property names #' @export get_metadata_values <- function(nexml, annotated = NULL, props){ metaList <- get_meta(nexml, annotated = annotated, props = props) if (length(metaList) > 0) { sapply(metaList, function(m) if (is(m, "LiteralMeta")) charzero_as_empty(m@content) else m@href) } else c() } #' Extracts meta objects matching properties #' #' Extracts the metadata annotations for the given property or properties, #' and returns the result as a list of `meta` objects. #' #' For matching property identifiers (i.e., URIs), prefixes in the input list #' as well as in the `annotated` object will be expanded using the namespaces #' of the `nexml` object. Names in the returned list are mapped to the #' (possibly prefixed) form in the input list. The resulting list is flat, #' and hence does not retain the nesting hierarchy in the object's annotation. #' @param nexml a nexml object #' @param annotated the nexml component object from which to obtain metadata #' annotations, or a list of such objects. Defaults to the nexml object itself. #' @param props a character vector of property names for which to extract #' metadata annotations #' @return a named list of the matching meta objects #' @export get_meta <- function(nexml, annotated = NULL, props){ if (is.null(annotated)) annotated <- nexml if (is.null(props) || length(props) == 0) stop("Parameter 'props' must be a non-empty vector") uris <- expand_prefix(props, nexml@namespaces) if (is(annotated, "Annotated")) metaList <- get_all_meta(annotated) else if (is(annotated, "list")) metaList <- unlist(lapply(annotated, get_all_meta)) else stop("'annotated' must be either an instance of 'Annotated', or a list") metaProps <- expand_prefix(sapply(metaList, slot, "property"), nexml@namespaces) isMatch <- metaProps %in% uris if (any(isMatch)) { values <- metaList[isMatch] mapToURIs <- match(metaProps, uris) names(values) <- props[mapToURIs[! is.na(mapToURIs)]] New("ListOfmeta", values) } else New("ListOfmeta") } #' Get flattened list of meta annotations #' #' Collects recursively (in the case of nested meta annotations) all meta #' object annotations for the given object, and returns the result as a flat #' list. #' #' Does not check that the input object can actually have meta annotations. #' An invalid slot error will be generated if it can't. #' @param annotated the object from which to extract meta object annotations #' @return a flat list of `meta` objects #' @export get_all_meta <- function(annotated) { metaList <- slot(annotated, "meta") if (length(metaList) > 0) { containsNested <- sapply(metaList, is, "ResourceMeta") if (any(containsNested)) { nested <- lapply(metaList[containsNested], get_all_meta) if (length(nested) > 0) metaList <- c(metaList, nested) } } metaList } RNeXML/R/add_characters.R0000644000176200001440000002161313552353762014610 0ustar liggesusers#################### Write character matices into S4 ##################### #' Add character data to a nexml object #' #' @param x character data, in which character traits labels are column names #' and taxon labels are row names. x can be in matrix or data.frame #' format. #' @param nexml a nexml object, if appending character table to an existing #' nexml object. If omitted will initiate a new nexml object. #' @param append_to_existing_otus logical. If TRUE, will add any new taxa #' (taxa not matching any existing otus block) to the existing (first) #' otus block. Otherwise (default), a new otus block is created, even #' though it may contain duplicate taxa to those already present. While #' FALSE is the safe option, TRUE may be appropriate when building nexml #' files from scratch with both characters and trees. #' @include classes.R #' @examples #' library("geiger") #' data(geospiza) #' geiger_nex <- add_characters(geospiza$dat) #' @export add_characters <- function(x, nexml = new("nexml"), append_to_existing_otus=FALSE){ # FIXME does it make sense to take a phylo object here as an option? # If so, perhaps don't call the argument 'nexml'. # If not, then we don't really need this conversion. (maybe a type-check instead). nexml <- as(nexml, "nexml") ## Check types & row names ## x <- format_characters(x) j <- length(nexml@characters) ## add after any existing character matrices nexml <- add_character_nodes(nexml, x) for(i in 1:length(x)){ new_taxa <- rownames(x[[i]]) nexml <- add_otu(nexml, new_taxa, append=append_to_existing_otus) ## Add the otus id to the characters node otus_id <- nexml@otus[[length(nexml@otus)]]@id nexml@characters[[i+j]]@otus <- get_by_id(nexml@otus, otus_id)@id nexml <- add_char(nexml, x, i, j) nexml <- add_states(nexml, x, i, j) } for(i in 1:length(x)){ nexml <- add_rows(nexml, x, i, j) } nexml } add_character_nodes <- function(nexml, x){ n <- length(x) cs_list <- lapply(1:n, function(i){ uid <- nexml_id("cs") characters <- nexml.characters( id = uid, about = paste0("#", uid)) if(class(x[[i]][[1]]) == "numeric") ## Should be numeric but not integer! type <- "ContinuousCells" else ## Should be integer! type <- "StandardCells" slot(characters, "xsi:type") <- type characters }) cs_list <- c(nexml@characters, cs_list) nexml@characters <- New("ListOfcharacters", cs_list) nexml } otu_list <- function(to_add, prefix="ou"){ lapply(to_add, function(label){ uid <- nexml_id(prefix) nexml.otu(label=label, id =uid, about = paste0("#", uid)) }) } add_otu <- function(nexml, new_taxa, append=FALSE){ current_taxa <- get_taxa_list(nexml) if(length(current_taxa) == 0) { # No otus exist, create a new node otus <- new_otus_block(nexml, new_taxa) nexml@otus <- New("ListOfotus", c(nexml@otus, otus)) } else { otu_pos <- lapply(current_taxa, function(current) match(new_taxa, current)) if(any(is.na(unlist(otu_pos)))){ # We have missing taxa if(append){ ## append to otus block `otus_id` ## otus_id <- 1 # position that matches the id string to_add <- new_taxa[sapply(otu_pos, is.na)] nexml@otus[[otus_id]]@otu <- New("ListOfotu", c(nexml@otus[[otus_id]]@otu, otu_list(to_add, "ou_char"))) ## FIXME hack to make sure new ids are 'unique', } else { ## Alternatively, do not append ## otus <- new_otus_block(nexml, new_taxa) nexml@otus <- New("ListOfotus", c(nexml@otus, otus)) } } # else # all taxa matched, so we're all set } nexml } new_otus_block <- function(nexml, to_add){ id <- nexml_id("os") New("ListOfotus", list(nexml.otus( id = id, about = paste0("#", id), otu = New("ListOfotu", otu_list(to_add)) ))) } # Turns char names into char nodes add_char <- function(nexml, x, i = 1, j = 0){ char_labels <- colnames(x[[i]]) char_list <- lapply(char_labels, function(lab){ id <- nexml_id("cr") char <- nexml.char( id = id, about = paste0("#", id), label = lab) }) nexml@characters[[i+j]]@format@char <- New("ListOfchar", char_list) nexml } add_states <- function(nexml, x, i = 1, J = 0){ # don't ctreate a states node if data is numeric if(all(sapply(x[[i]], is.numeric))) nexml else { nchars <- length(x[[i]]) char <- nexml@characters[[i+J]]@format@char states_list <- lapply(1:nchars, function(j){ lab <- char[[j]]@label lvls <- levels(x[[i]][[lab]]) id <- nexml_id("ss") states <- nexml.states( id = id, about = paste0("#", id), state = New("ListOfstate", lapply(lvls, function(lvl){ nexml.state( id=nexml_id("s"), symbol = as.integer(as.factor(lvl))) })) ) }) nexml@characters[[i+J]]@format@states <- New("ListOfstates", states_list) # Add the states's id to char for(j in 1:nchars) nexml@characters[[i+J]]@format@char[[j]]@states <- states_list[[j]]@id nexml } nexml } ## Assumes that otu ids have already been added to the nexml add_rows <- function(nexml, x, i = 1, j = 0){ X <- x[[i]] taxa <- rownames(X) char_labels <- colnames(X) ## get the relevant characters block and otus block cs <- nexml@characters[[i+j]]@id os <- nexml@characters[[i+j]]@otus otu_map <- get_otu_maps(nexml)[[os]] char_map <- get_char_maps(nexml)[[cs]] state_map <- get_state_maps(nexml)[[cs]] reverse_otu_map <- reverse_map(otu_map) reverse_char_map <- reverse_map(char_map) reverse_state_map <- reverse_map(state_map) mat <- nexml.matrix( row = New("ListOfrow", lapply(taxa, function(taxon){ id = nexml_id("rw") nexml.row( id = id, about = paste0("#", id), label = taxon, otu = reverse_otu_map[taxon], cell = New("ListOfcell", lapply(char_labels, function(char){ state <- X[taxon,char] # unmapped char_id <- reverse_char_map[[char]] if(!is.null(state_map)) state <- reverse_state_map[[char_id]][state] nexml.cell( char = char_id, state = as.character(state)) })) ) })) ) nexml@characters[[i+j]]@matrix <- mat nexml } ## divide matrix into discrete and continuous trait matrices, if necessary ## then write each as separate nodes: ## x should now be a list of data.frames of common type format_characters <- function(x){ if(is(x, "numeric")) x <- as.data.frame(x) ## Actually useful conversions ## ## Matrices are either all-numeric or all-character class, so no risk of mixed discrete and continous states. if(is(x, "matrix")){ x <- list(as.data.frame(x)) ## Data.frames can mix discrete and continous states, so we need to seperate them } else if(is(x, "data.frame") && dim(x)[2] > 1) { x <- split_by_class(x) } else if(is(x, "data.frame") && dim(x)[2] == 1) { x <- list(x) #### Ugh, this next bit isn't pretty. Maybe we should just hope lists are formatted correctly, e.g. come from get_character_list. ## If we're getting a list with matrices, coerce them into data.frames and hope for the best. ## If the list has data.frames, check that each one has consistent class type. ## Otherwise, panic. } else if(is(x, "list")) { for(i in 1:length(x)){ if(is(x[[i]], "matrix")) x[[i]] <- as.data.frame(x[[i]]) ## A list of matrices we can make into a list of data.frames... } ## Someone didn't even try to read the documentation... } else { stop("x must be a named numeric, matrix, data.frame, or list thereof") } ## Let's just hope folks read the documentation and have ## row names as taxa and column names as be character traits. ## Kinda hard to check that for sure? ## return the updated object: a list of data.frames x } ## Helper function for the above, contains the primary functionality # divide a data.frame into a list of data.frames, in which each has only a unique column class split_by_class <- function(x){ col.classes <- sapply(x, class) if (any(col.classes == "numeric")) { ## split into numerics and non-numerics cts <- unname(which(col.classes=="numeric")) discrete <- unname(which(col.classes!="numeric")) x <- list(x[cts], x[discrete]) } else x <- list(x) x } RNeXML/R/nexml_validate.R0000644000176200001440000000430213552353762014651 0ustar liggesusers#ONLINE_VALIDATOR <- "http://162.13.187.155/nexml/phylows/validator" #CANONICAL_SCHEMA <- "http://162.13.187.155/nexml/xsd/nexml.xsd" ONLINE_VALIDATOR <- "http://www.nexml.org/nexml/phylows/validator" CANONICAL_SCHEMA <- "http://www.nexml.org/2009/nexml.xsd" #' validate nexml using the online validator tool #' @param file path to the nexml file to validate #' @param schema URL of schema (for fallback method only, set by default). #' @details Requires an internet connection. see http://www.nexml.org/nexml/phylows/validator for more information in debugging invalid files #' @return TRUE if the file is valid, FALSE or error message otherwise #' @export #' @import httr XML #' @examples \dontrun{ #' data(bird.orders) #' birds <- nexml_write(bird.orders, "birds_orders.xml") #' nexml_validate("birds_orders.xml") #' unlink("birds_orders.xml") # delete file to clean up #' } nexml_validate <- function(file, schema=CANONICAL_SCHEMA){ a = POST(ONLINE_VALIDATOR, body=list(file = upload_file(file))) if(a$status_code %in% c(200,201)){ TRUE } else if(a$status_code == 504){ warning("Online validator timed out, trying schema-only validation.") nexml_schema_validate(file, schema=schema) } else if(a$status_code == 400){ warning(paste("Validation failed, error messages:", xpathSApply(htmlParse(content(a, "text")), "//li[contains(@class, 'error') or contains(@class, 'fatal')]", xmlValue) )) FALSE } else { warning(paste("Unable to reach validator. status code:", a$status_code, ". Message:\n\n", content(a, "text"))) NULL } } nexml_schema_validate <- function(file, schema=CANONICAL_SCHEMA){ a = GET(schema) if(a$status_code == 200){ if(is.null(xmlSchemaParse(schema))){ warning(paste("Schema not accessible at", schema)) NULL } else { result <- xmlSchemaValidate(schema, file) if(length(result$errors) == 0){ TRUE } else { warning(paste(result$errors)) FALSE } } } else { warning("Unable to obtain schema, couldn't validate") NULL } } #xmlSchemaValidate(xmlSchemaParse(content(a, "text"), asText=TRUE), file) # fails to get other remote resources RNeXML/R/nexmlTree.R0000644000176200001440000000451713552353762013630 0ustar liggesuserssetClass("phyloS4", slots = c(edge = "matrix", Nnode = "integer", tip.label = "character", edge.length = "numeric")) setOldClass("phylo", S4Class="phyloS4") ## multiPhylo and multiPhyloList are used in other files, but perhaps it is ## best to keep the definitions all here setOldClass("multiPhylo") setOldClass("multiPhyloList") setClass("nexmlTree", slots = c(nexml = "nexml"), contains="phylo") setMethod("show", "nexmlTree", function(object) print.phylo(object)) # callNextMethod(object) ## callNextMethod might have been an option, but it looks for 'show' method, not print method?? ## constructor function nexmlTree <- function(object){ if(is(object, "nexml")){ phylo <- as(object, "phylo") } new("nexmlTree", nexml = object, phylo) } ## Coercions between classes setAs("XMLInternalElementNode", "nexmlTree", function(from) nexmlTree(as(from, "nexml"))) setAs("nexmlTree", "XMLInternalElementNode", function(from) as(from@nexml, "XMLInternalElementNode")) setAs("XMLInternalNode", "nexmlTree", function(from) nexmlTree(as(from, "nexml"))) setAs("nexmlTree", "XMLInternalNode", function(from) as(from@nexml, "XMLInternalNode")) setAs("phylo", "nexmlTree", function(from) nexmlTree(as(from, "nexml"))) setAs("nexmlTree", "phylo", function(from) as(from@nexml, "phylo")) setAs("nexml", "nexmlTree", function(from) nexmlTree(from)) setAs("nexmlTree", "nexml", function(from) from@nexml) ### Testing # a <- new("phylo", bird.orders) # expect_is(a, "phylo") # a # plot(a) # # b <- new("nexmlTree", bird.orders, nexml = as(bird.orders, "nexml")) # expect_is(b, "phylo") # b # plot(b) # # Some ape functions don't check class properly. i.e. class(b) == "phylo" is FALSE, but is(b, "phylo") is TRUE. # Don't really need these, but here they are mapping between S3 and S4 setAs("phyloS4", "phylo", function(from){ out <- list(edge = from@edge, Nnode = from@Nnode, tip.label = from@tip.label, edge.length = from@edge.length) class(out) <- "phylo" out }) setAs("phylo", "phyloS4", function(from) new("phyloS4", edge = from$edge, Nnode = from$Nnode, tip.label = from$tip.label, edge.length = from$edge.length)) RNeXML/R/get_namespaces.R0000644000176200001440000000073713552353762014643 0ustar liggesusers #' get namespaces #' #' get namespaces #' @param nexml a nexml object #' @return a named character vector providing the URLs defining each #' of the namespaces used in the nexml file. Names correspond to #' the prefix abbreviations of the namespaces. #' @examples #' comp_analysis <- system.file("examples", "comp_analysis.xml", package="RNeXML") #' nex <- nexml_read(comp_analysis) #' get_namespaces(nex) #' @export get_namespaces <- function(nexml){ nexml@namespaces } RNeXML/R/meta.R0000644000176200001440000002047413552353762012613 0ustar liggesusers## Utilities for adding additional metadata #' @name nexml.meta_ #' @aliases nexml.meta_ #' @seealso [nexml.meta()][meta()] for documentation of `nexml.meta()` #' @rdname constructors NULL #' Constructor function for metadata nodes #' #' @param property specify the ontological definition together with it's namespace, e.g. dc:title #' @param content content of the metadata field #' @param rel Ontological definition of the reference provided in href #' @param href A link to some reference #' @param datatype optional RDFa field #' @param id optional id element (otherwise id will be automatically generated). #' @param type optional xsi:type. If not given, will use either "LiteralMeta" or "ResourceMeta" as #' determined by the presence of either a property or a href value. #' @param children Optional element containing any valid XML block (XMLInternalElementNode class, see the XML package for details). #' @details User must either provide property+content or rel+href. Mixing these will result in potential garbage. #' The datatype attribute will be detected automatically from the class of the content argument. Maps from R class #' to schema datatypes are as follows: #' character - xs:string, #' Date - xs:date, #' integer - xs:integer, #' numeric - xs:decimal, #' logical - xs:boolean #' #' @examples #' meta(content="example", property="dc:title") #' @export #' @seealso \code{\link{nexml_write}} #' @aliases nexml.meta #' @include classes.R #' @importFrom plyr compact meta <- function(property = NULL, content = NULL, rel = NULL, href = NULL, datatype = NULL, id = NULL, type = NULL, children = list()){ # if datatype isn't provided, try to infer it from content if (is.null(datatype) && !is.null(content)) { if(is.logical(content)) datatype <- "xsd:boolean" else if(is(content, "Date")) datatype <- "xsd:date" else if(is.numeric(content)) datatype <- "xsd:decimal" else if(is.character(content) && length(content) > 0) datatype <- "xsd:string" else if(is.integer(content)) "xsd:integer" } # the content text must be written as a string if (length(content) > 0) content <- as.character(content) if(length(id) == 0) id <- nexml_id("m") if(is(children, "XMLAbstractNode") || is(children, "XMLInternalNode")) children <- list(children) # if type is not provided, try to determine it from the parameters if (is.null(type)) { if (length(rel) > 0) type <- "ResourceMeta" else if (length(href) > 0 || (length(children) > 0 && all(sapply(children, is, "meta")))) { type <- "ResourceMeta" rel <- property property <- NULL } else if (length(property) > 0) type <- "LiteralMeta" } # if null is provided for value, don't create any object if (length(children) == 0 && ((is.null(content) && type == "LiteralMeta") || (is.null(href) && type == "ResourceMeta"))) NULL else { # determine the meta class to instantiate clname <- type if (is.null(type)) { clname <- "meta" # we have to default to some xsi:type that makes sense type <- "LiteralMeta" } # create the meta instance args <- plyr::compact(list(property = property, content = content, datatype = datatype, rel = rel, href = href, id = id, 'xsi:type' = type, children = children)) do.call(New, c(clname, args)) } } nexml.meta <- meta ## Common helper functions #' @importFrom plyr compact nexml_citation <- function(obj){ if(is(obj, "BibEntry")) class(obj) <- "bibentry" if(is(obj, "bibentry")){ out <- lapply(obj, function(obj){ if(length(grep("--", obj$pages)) > 0){ pgs <- strsplit(obj$pages, "--")[[1]] start_page <- pgs[[1]] end_page <- if(length(pgs)>1) pgs[[2]] else " " } else if(length(grep("-", obj$pages)) > 0){ pgs <- strsplit(obj$pages, "-")[[1]] start_page <- pgs[[1]] end_page <- if(length(pgs)>1) pgs[[2]] else " " } else { start_page <- NULL end_page <- NULL } list_of_metadata_nodes <- plyr::compact(c(list( meta(content=obj$volume, property="prism:volume"), meta(content=obj$journal, property="dc:publisher"), meta(content=obj$journal, property="prism:publicationName"), meta(content = end_page, property="prism:endingPage"), meta(content=start_page, property="prism:startingPage"), meta(content=obj$year, property="prism:publicationDate"), meta(content=obj$title, property="dc:title")), lapply(obj$author, function(x){ meta(content = format(x, c("given", "family")), property="dc:contributor") }), meta(content=format(obj, "text"), property="dcterms:bibliographicCitation") )) citation_elements = New("ListOfmeta", list_of_metadata_nodes) meta(rel = "dcterms:references", children = citation_elements) }) out } } #' Concatenate meta elements into a ListOfmeta #' #' Concatenate meta elements into a ListOfmeta #' @param x,... `meta` and `ListOfmeta` elements to be concatenated, see \code{\link{meta}} #' @param recursive logical, if 'recursive=TRUE', the function recursively #' descends through lists and combines their elements into a flat vector. #' This method does not support `recursive=FALSE`, use [list][base::list()] #' instead. #' @return a ListOfmeta object containing a flat list of meta elements. #' @examples #' c(meta(content="example", property="dc:title"), #' meta(content="Carl", property="dc:creator")) #' @rdname c-meta #' @aliases c-meta #' @include classes.R #' @importFrom plyr compact setMethod("c", signature("meta"), function(x, ..., recursive = TRUE){ elements <- list(x, ...) if (identical(recursive, FALSE)) stop("Use list() to concatenate 'meta' and 'ListOfmeta' non-recursively") new("ListOfmeta", unlist(elements)) }) #' Concatenate ListOfmeta elements into a ListOfmeta #' #' Concatenate ListOfmeta elements into a flat ListOfmeta #' @inheritParams c-meta #' @examples #' metalist <- c(meta(content="example", property="dc:title"), #' meta(content="Carl", property="dc:creator")) #' out <- c(metalist, metalist) #' out <- c(metalist, meta(content="a", property="b")) #' @rdname c-meta #' @aliases c-ListOfmeta #' @importFrom plyr compact setMethod("c", signature("ListOfmeta"), function(x, ..., recursive = TRUE){ elements <- list(x, ...) if (identical(recursive, FALSE)) stop("Use list() to concatenate 'meta' and 'ListOfmeta' non-recursively") new("ListOfmeta", plyr::compact(unlist(elements))) }) setGeneric("slot") setGeneric("slot<-") #' Access or set slot of S4 object #' #' See [methods::slot()]. This version allows using "property" consistently #' for both LiteralMeta and ResourceMeta (which internally uses "rel" because #' RDFa does), which is easier to program. It also allows using "meta" #' as an alias for "children" for ResourceMeta, to be consistent with the #' corresponding slot for instances of `Annotated`. #' @param object the object #' @param name name of the slot #' @aliases slot-ResourceMeta #' @seealso [methods::slot()] #' @export setMethod("slot", signature("ResourceMeta", "ANY"), function(object, name) { if (name == "property") object@rel else if (name == "meta") object@children else callNextMethod() }) #' @param value the new value #' @rdname slot-ResourceMeta-method #' @export setMethod("slot<-", signature("ResourceMeta", "ANY"), function(object, name, value) { if (name == "property") object@rel <- value else if (name == "meta") object@children <- value else object <- callNextMethod() object }) RNeXML/R/nexml_write.R0000644000176200001440000000731113614102320014172 0ustar liggesusers#' Write nexml files #' #' @param x a nexml object, or any phylogeny object (e.g. phylo, phylo4) #' that can be coerced into one. Can also be omitted, in which case a new #' nexml object will be constructed with the additional parameters specified. #' @param file the name of the file to write out #' @param trees phylogenetic trees to add to the nexml file (if not already given in x) #' see \code{\link{add_trees}} for details. #' @param characters additional characters #' @param meta A meta element or list of meta elements, see \code{\link{add_meta}} #' @param ... additional arguments to add__basic_meta, such as the title. See \code{\link{add_basic_meta}}. #' @return Writes out a nexml file #' @import ape #' @import XML #' @import methods #' @aliases nexml_write write.nexml #' @export nexml_write write.nexml #' @seealso \code{\link{add_trees}} \code{\link{add_characters}} \code{\link{add_meta}} \code{\link{nexml_read}} #' @examples #' ## Write an ape tree to nexml, analgous to write.nexus: #' library(ape); data(bird.orders) #' ex <- tempfile(fileext=".xml") #' write.nexml(bird.orders, file=ex) #' #' \dontrun{ # takes > 5s #' ## Assemble a nexml section by section and then write to file: #' library(geiger) #' data(geospiza) #' nexml <- add_trees(geospiza$phy) # creates new nexml #' nexml <- add_characters(geospiza$dat, nexml = nexml) # pass the nexml obj to append character data #' nexml <- add_basic_meta(title="my title", creator = "Carl Boettiger", nexml = nexml) #' nexml <- add_meta(meta("prism:modificationDate", format(Sys.Date())), nexml = nexml) #' #' ex <- tempfile(fileext=".xml") #' write.nexml(nexml, file=ex) #' #' ## As above, but in one call (except for add_meta() call). #' write.nexml(trees = geospiza$phy, #' characters = geospiza$dat, #' title = "My title", #' creator = "Carl Boettiger", #' file = ex) #' #' ## Mix and match: identical to the section by section: #' nexml <- add_meta(meta("prism:modificationDate", format(Sys.Date()))) #' write.nexml(x = nexml, #' trees = geospiza$phy, #' characters = geospiza$dat, #' title = "My title", #' creator = "Carl Boettiger", #' file = ex) #' #' } nexml_write <- function(x = nexml(), file = NULL, trees = NULL, characters = NULL, meta = NULL, ...){ nexml <- as(x, "nexml") if(!is.null(trees)) nexml <- add_trees(trees, nexml = nexml) if(!is.null(characters)) nexml <- add_characters(characters, nexml = nexml) if(!is.null(meta)) nexml <- add_meta(meta, nexml = nexml) argList <- list(..., nexml = nexml) # set last modification time upon writing, if not set already if (is.null(argList$pubdate)) argList$pubdate <- Sys.time() nexml <- do.call(add_basic_meta, argList) out <- as(nexml, "XMLInternalNode") saveXML(out, file = file) } write.nexml <- nexml_write ############## Promotion methods ######## ## FIXME -- Coercion is not the way to go about any of this ## want generator methods that can handle id creation better # consider: # setMethod("promote", # signature("tree", "character"), # function(object, target_type) setAs("tree", "nexml", function(from){ trees = as(from, "trees") otus = as(from, "otus") otus@id = "tax1" #UUIDgenerate() trees@id = "Trees" #UUIDgenerate() trees@otus = otus@id nexml( trees = New("ListOftrees", list(trees)), otus = otus) }) setAs("ListOfnode", "otus", function(from) nexml.otus(otu = from)) setAs("tree", "trees", function(from) nexml.trees(tree = New("ListOftree", list(from)))) RNeXML/R/internal_get_node_maps.R0000644000176200001440000000270413552353762016361 0ustar liggesusers# get otus map # # @param nexml nexml object # @return a list showing the mapping between (internal) otu identifiers and labels (taxonomic names). List is named by the id of the otus block. # @details largely for internal use get_otu_maps <- function(nexml){ otus <- as.list(nexml@otus) names(otus) <- name_by_id(otus) otu_maps <- lapply(otus, function(otus){ # loop over all otus nodes taxon <- sapply(otus@otu, function(otu){ # loop over each otu in the otus set if(length(otu@label) > 0) label <- otu@label else label <- otu@id c(otu@id, label) }) out <- taxon[2, ] #label names(out) <- taxon[1, ] #id out }) otu_maps } get_char_maps <- function(nexml){ map <- lapply(nexml@characters, function(characters) map_chars_to_label(characters@format)) names(map) <- name_by_id(nexml@characters) map } get_state_maps <- function(nexml){ map <- lapply(nexml@characters, function(characters){ if(!isEmpty(characters@format@states)) map_state_to_symbol(characters@format) else NULL }) names(map) <- name_by_id(nexml@characters) map } reverse_map <- function(map){ out <- NULL if(is.list(map)){ out <- lapply(map, function(x){ out <- names(x) names(out) <- x out}) } else if(is.character(map)) { out <- names(map) names(out) <- map out } out } RNeXML/R/get_taxa_meta.R0000644000176200001440000000363413552353762014466 0ustar liggesusers### TODO: how to deal with missing meta slot elements??? ### Right now the functions break when an otu doesn't have meta slot #' get_taxa_meta #' #' Retrieve metadata of all species/otus otus (operational taxonomic units) included in the nexml #' @param nexml a nexml object #' @param what One of href, rel, id, or xsi:type #' @return the list of metadata for each taxon #' @seealso \code{\link{get_item}} #' @keywords internal #' @examples #' \dontrun{ #' data(bird.orders) #' birds <- add_trees(bird.orders) #' birds <- taxize_nexml(birds, "NCBI") #' RNeXML:::get_taxa_meta(birds) #' RNeXML:::get_taxa_meta(birds, 'rel') #' RNeXML:::get_taxa_meta(birds, 'id') #' RNeXML:::get_taxa_meta(birds, 'xsi:type') #' } get_taxa_meta <- function(nexml, what='href'){ out <- lapply(nexml@otus, function(otus) # sapply(otus@otu, function(otu) slot(otu@meta, what))) sapply(otus@otu, function(otu) slot(otu@meta[[1]], what))) unname(unlist(out, recursive = FALSE)) } get_otu_meta <- get_taxa_meta #' get_taxa_meta_list #' #' Retrieve metadata of all species/otus otus (operational taxonomic units) included in the nexml #' @param nexml a nexml object #' @param what One of href, rel, id, or xsi:type #' @return the list of metadata for each taxon #' @seealso \code{\link{get_item}} #' @keywords internal #' @examples \dontrun{ #' data(bird.orders) #' birds <- add_trees(bird.orders) #' birds <- taxize_nexml(birds, "NCBI") #' RNeXML:::get_taxa_meta_list(birds) #' RNeXML:::get_taxa_meta_list(birds, 'rel') #' RNeXML:::get_taxa_meta_list(birds, 'id') #' RNeXML:::get_taxa_meta_list(birds, 'xsi:type') #' } get_taxa_meta_list <- function(nexml, what='href'){ out <- lapply(nexml@otus, function(otus){ out <- sapply(otus@otu, function(otu) slot(otu@meta[[1]], what)) names(out) <- name_by_id(otus@otu) out }) names(out) <- name_by_id(nexml@otus) out } get_otu_meta_list <- get_taxa_meta_list RNeXML/R/get_basic_metadata.R0000644000176200001440000000316613552353762015444 0ustar liggesusers#' Get citation from metadata #' #' Extracts the citation annotation from the metadata annotation of the`nexml` #' object, and returns its value. #' #' Currently the implementation looks for `dcterms:bibliographicCitation` #' annotations. (Note that these may be given with any prefix in the metadata #' so long as they expand to the same full property URIs.) #' @seealso [get_metadata_values()] #' @param nexml a nexml object #' @return the citation if the metadata provides one that is non-empty, and #' NA otherwise. If multiple non-empty annotations are found, only the first #' one is returned. #' @export get_citation <- function(nexml){ cit <- get_metadata_values(nexml, props = c("dcterms:bibliographicCitation")) if (length(cit) > 0) { # remove empty values cit[sapply(cit, length) > 0][1] } else NA } #' Get license from metadata #' #' Extracts the license annotation from the metadata annotation of the`nexml` #' object, and returns its value. #' #' Currently the implementation looks for `cc:license` and `dc:rights` #' annotations. (Note that these may be given with any prefix in the metadata #' so long as they expand to the same full property URIs.) #' @seealso [get_metadata_values()] #' @param nexml a nexml object #' @return the license if the metadata asserts one that is non-empty, and #' NA otherwise.If multiple non-empty annotations are found, only the first #' one is returned. #' @export get_license <- function(nexml){ lic <- get_metadata_values(nexml, props = c("dc:rights", "cc:license")) if (length(lic) > 0) { # remove empty values lic[sapply(lic, length) > 0][1] } else NA } RNeXML/R/nexml_read.R0000644000176200001440000000347313552353762014003 0ustar liggesusers#' Read NeXML files into various R formats #' #' @param x Path to the file to be read in. Or an \code{\link[XML]{XMLInternalDocument-class}} #' or \code{\link[XML]{XMLInternalNode-class}} #' @param ... Further arguments passed on to \code{\link[XML]{xmlParse}} #' @import XML #' @import httr #' @aliases nexml_read read.nexml #' @export nexml_read read.nexml #' @examples #' # file #' f <- system.file("examples", "trees.xml", package="RNeXML") #' nexml_read(f) #' \dontrun{ # may take > 5 s #' # url #' url <- "https://raw.githubusercontent.com/ropensci/RNeXML/master/inst/examples/trees.xml" #' nexml_read(url) #' # character string of XML #' str <- paste0(readLines(f), collapse = "") #' nexml_read(str) #' # XMLInternalDocument #' library("httr") #' library("XML") #' x <- xmlParse(content(GET(url))) #' nexml_read(x) #' # XMLInternalNode #' nexml_read(xmlRoot(x)) #' } nexml_read <- function(x, ...) { UseMethod("nexml_read") } #' @export #' @rdname nexml_read nexml_read.character <- function(x, ...) { if (!any(grepl("^https?://", x), XML::isXMLString(x), file.exists(x))) { stop("character input must be a URL, xml string or file path", call. = FALSE) } # handle remote paths using httr::GET if (grepl("^https?://", x)) { tmp <- GET(x) stop_for_status(tmp) x <- content(tmp, as = "text") } doc <- xmlParse(x, ...) output <- as(xmlRoot(doc), "nexml") free(doc) # explicitly free the pointers after conversion into S4 return(output) } #' @export #' @rdname nexml_read nexml_read.XMLInternalDocument <- function(x, ...) { as(xmlRoot(x), "nexml") } #' @export #' @rdname nexml_read nexml_read.XMLInternalNode <- function(x, ...) { as(x, "nexml") } setAs("XMLInternalNode", "phylo", function(from) as(as(from, "nexml"), "phylo") ) read.nexml <- nexml_read RNeXML/R/S4-utils.R0000644000176200001440000002220613552353762013304 0ustar liggesusers## utilities to better deal with S4 classes and generics #' Finds the method that callNextMethod() should chain to #' #' Attempts to find the "next" method in the inheritance chain. This would #' (ideally) be the method that [methods::callNextMethod()] would chain to, #' as a result of the method [methods::addNextMethod()] would find (and return #' in the `nextMethod` slot of the [MethodWithNext][methods::MethodWithNext-class] #' object). Hence, in theory one shouldn't ever need this, but unfortunately #' `addNextMethod()` is broken (and errors out) if one of the classes in the #' signature name-clashes with an S4 class defined in another package that is #' loaded. #' #' The next method will be determined by the S4 inheritance chain. However, #' this function will walk only the inheritance chain of those arguments in #' the signature that are defined in the package of the generic method from #' which this function was invoked (directly or indirectly). If there are #' no such parameters in the signature, or if there is more than one, #' finding the next method is handed off to [methods::addNextMethod()]. #' @note In theory a class name clash between packages shouldn't be a problem #' because class names can be namespaced, and the [MethodDefinition][methods::MethodDefinition-class] #' object passed to `addNextMethod()` has all the necessary namespace #' information. Hopefully, at some point this gets fixed in R, and then we #' don't need this anymore. #' @param method [MethodDefinition][methods::MethodDefinition-class]), the method for which to find #' the next method #' @param f [standardGeneric][methods::standardGeneric-class], the standard generic for which to find #' the next method. By default this will be obtained from `method`. #' @param envir the environment in which to find the method #' @return a [MethodDefinition][methods::MethodDefinition-class] object that is the next method in the #' chain by inheritance #' @importFrom methods getClassDef selectMethod addNextMethod #' @importFrom utils packageName findNextMethod <- function(method, f = NULL, envir = topenv()) { if (is(method, "MethodWithNext")) method@nextMethod else { if (is.null(f)) f <- method@generic sigDefined <- method@defined nextMethod <- NULL ourPkg <- packageName(env = envir) if (is.null(ourPkg)) { warning("failed to determine package where findNextMethod() was called") ourPkg <- "RNeXML" } isOurs <- sigDefined@package == ourPkg if (sum(isOurs) == 1) { clnames <- mapply(className, sigDefined@.Data, sigDefined@package, SIMPLIFY = FALSE) names(clnames) <- sigDefined@names ourClass <- clnames[isOurs][[1]] super <- getClassDef(ourClass)@contains for (clExt in super) { superClassName <- className(clExt@superClass, clExt@package) sig <- clnames sig[[sigDefined@names[isOurs]]] <- superClassName nextMethod <- selectMethod(f, signature = sig, optional = TRUE) if (! is.null(nextMethod)) { nextMethod@target <- method@defined break } } } if (is.null(nextMethod)) { method <- addNextMethod(method, f, envir = envir) nextMethod <- method@nextMethod } nextMethod } } #' Saves the next method in the method meta data #' #' Promotes the given method definition to an instance of #' [MethodWithNext][methods::MethodWithNext-class], thereby recording the next #' method in the `nextMethod` slot. #' @note `MethodWithNext` objects are normally returned by #' [methods::addNextMethod()], but a constructor function for the class #' seems missing (or is undocumented?). This provides one. #' @param method the [MethodDefinition][methods::MethodDefinition-class] object to promote #' @param nextMethod the [MethodDefinition][methods::MethodDefinition-class] #' object to record as the next method #' @param .cache whether to cache the promoted method definition object #' (using [methods::cacheMethod()]) #' @return an instance of [MethodWithNext][methods::MethodWithNext-class], #' which has the next method in the `nextMethod` slot #' @importFrom methods getGeneric cacheMethod #' @importClassesFrom methods MethodWithNext .methodWithNext <- function(method, nextMethod, .cache = FALSE) { methodWithNext <- new("MethodWithNext", method, nextMethod = nextMethod, excluded = list(.sigLabel(method@defined))) if (.cache) { cacheMethod(method@generic, method@target, methodWithNext, fdef = getGeneric(method@generic), inherited = TRUE) } methodWithNext } #' Create a label for a method signature #' #' Creates a label for a signature mirroring the result of `.sigLabel()` #' in the `methods` package, which unfortunately does not export the function. #' This is needed, for example, for the `excluded` slot in the #' [MethodWithNext][methods::MethodWithNext-class] class. #' @param signature the signature for which to create a label, as a vector #' or list of strings, or as an instance of [signature][methods::signature-class]. #' @return a character string .sigLabel <- function(signature) { if (is(signature, "signature")) signature <- signature@.Data paste(signature, collapse = "#") } #' Caches next method in the calling environment #' #' If the calling environment does not have the next method to be invoked #' in the inheritance chain cached yet, this will find the next method #' (using [findNextMethod()]), and cache it in the calling environment such #' that a subsequent call to [methods::callNextMethod()] will find and use #' it. #' #' As per the description, what this function does would normally already #' be done by invoking [methods::callNextMethod()], so in theory this should #' be entirely redundant at best. However, [methods::addNextMethod()], which #' is invoked by `callNextMethod()` if a next method isn't cached yet, is #' broken (errors out) if one of the classes in the signature name-clashes #' with a class defined in another package. Calling this function prior to #' `callNextMethod()` is meant to work around that. .cacheNextMethod <- function() { callEnv <- parent.frame(1L) nextMethod <- callEnv$.nextMethod if (is.null(nextMethod)) { parent <- sys.parent(1) methodFun <- sys.function(parent) if (! is(methodFun, "MethodDefinition")) stop(".cacheNextMethod() not invoked from class method") method <- callEnv$.Method if (is.null(method)) method <- methodFun f <- callEnv$.Generic if (is.null(f)) f <- method@generic nextMethod <- findNextMethod(method, f = f, envir = callEnv) if (is.null(nextMethod)) stop("No next method available") assign(".nextMethod", nextMethod, envir = callEnv) assign(".Generic", f, envir = callEnv) if (is.null(callEnv$.Method)) { assign(".Method", .methodWithNext(method = method, nextMethod = nextMethod), method, envir = callEnv) } } } #' Calls the given generic with the given arguments #' #' Calls the given generic with the given arguments, using the method #' whose signature matches the arguments. #' #' Uses [methods::selectMethod()] to find the matching method. In theory, #' this is at best wholly redundant with what standard S4 generics already #' do by themselves. However, the generics dispatch for S4 seems (at least #' currently) broken at least if the first argument in the signature is #' a class that name-clashes with a class defined in another package. In #' that case, whether the standard dispatch works correctly or not can depend #' on [search order][base::search()], and can change within a session #' depending on the order in which packages are loaded. #' @param f the generic, as a character string or a [standardGeneric][methods::standardGeneric-class] #' object #' @param ... the arguments (named and/or unnamed) with which to call the #' matching method #' @param .package the package name for finding the generic (if `f` is a character #' string); by default the package is determined from the calling environment #' @return the value returned by the method #' @importFrom methods getGeneric selectMethod #' @importFrom utils packageName .callGeneric <- function(f, ..., .package = NULL) { if (is.null(.package)) { .package <- packageName() if (is.null(.package)) { warning("failed to determine package where .callGeneric() was called") .package <- "RNeXML" } } where <- asNamespace(.package) if (!is(f, "standardGeneric")) f <- getGeneric(f, where = where) .Args <- list(...) sigArgs <- .Args[seq_along(f@signature)] sigClasses <- sapply(sigArgs, .classForSig, f) method <- selectMethod(f, sigClasses) method(...) } .classForSig <- function(sigArg, f = NULL) { clname <- class(sigArg) # multiple classes? if (length(clname) > 1) { # if the generic has a value class, try and match it if ((! is.null(f)) && length(f@valueClass) > 0) { isValueClass <- clname == f@valueClass if (any(isValueClass)) clname <- clname[isValueClass] } # if none match, or if there's no value class, take the first one } clname[1] } RNeXML/R/prefixed-uris.R0000644000176200001440000000603213552353762014445 0ustar liggesusers## code for better dealing with namespace-prefixed strings (generally URIs) #' Expand namespace-prefixed string #' #' Substitutes the namespace prefix in the input vector of strings with #' the corresponding namespaces. #' #' Namespace prefixes are expected to be separated by one or more semicolons. #' Prefixes that cannot be matched to the vector of namespaces will be left #' as is. For strings that do not have a namespace prefix, the vector of #' namespaces can contain a base namespace, identified as not having a name, #' with which these strings will be expanded. #' @param x a character vector of potentially namespace-prefixed strings #' @param namespaces a named vector of namespaces, with namespace prefixes #' being the names. A "base" namespace with an empty name can be included. #' If not provided, or if empty, the input vector is returned as is. #' @return a character vector, of the same length as the input vector #' @examples #' uris <- c("cc:license", "dc:title") #' ns <- c(dc = "http://purl.org/dc/elements/1.1/", #' dcterms = "http://purl.org/dc/terms/", #' dct = "http://purl.org/dc/terms/", #' cc = "http://creativecommons.org/ns#") #' # expansion is vectorized #' expand_prefix(uris, ns) #' #' # strings with non-matching or no prefix are left as is #' uris <- c(uris, "my:title", "title") #' expand_prefix(uris, ns) #' #' # NAs in the input list become NA in the output #' uris <- c(uris, NA) #' expand_prefix(uris, ns) #' #' # can include a "base" (unnamed) namespace for expanding unprefixed strings #' ns <- c(ns, "//local/") #' xuris <- expand_prefix(uris, ns) #' xuris #' xuris[uris == "title"] == paste0("//local/", uris[uris == "title"]) #' #' # different prefixes may expand to the same result #' expand_prefix("dcterms:modified", ns) == expand_prefix("dct:modified", ns) #' #' # or they may result in different expansions #' expand_prefix("dc:title", ns) != expand_prefix("dcterms:title", ns) #' @export #' @importFrom stringi stri_match_first_regex stri_replace_first_regex expand_prefix <- function(x, namespaces = NULL) { if (is.null(namespaces) || length(namespaces) == 0) x else { nsNames <- names(namespaces) if (is.null(nsNames)) # single non-named element (or all elements unnamed) isBase <- rep(TRUE, length(namespaces)) else isBase <- nsNames == "" # We're being clever here: if the prefix pattern doesn't match, we assign # the pattern for matching at the beginning of the string, and to have that # matched as all other namespaces we'll make it the name of the base # namespace, using an empty string for expansion if none was provided. if (any(isBase)) names(namespaces)[isBase] <- "^" else namespaces <- c(namespaces, "^" = "") prefixes <- stringi::stri_match_first_regex(x, "^([^:]*):", cg_missing = "^") ns <- namespaces[match(prefixes[,2], names(namespaces))] if (all(is.na(ns))) x else { expanded <- stringi::stri_replace_first_regex(x, prefixes[,1], ns) ifelse(is.na(expanded), x, expanded) } } } RNeXML/NEWS.md0000644000176200001440000001177513614140164012430 0ustar liggesusersNEWS ==== For more fine-grained list of changes or to report a bug, consult * [The issues log](https://github.com/ropensci/RNeXML/issues) * [The commit log](https://github.com/ropensci/RNeXML/commits/master) v2.4.2 ------ - This update fixes a minor bug in a unit test which was introduced by a recent change to the geiger package. v2.4.0 ------ - Makes various tests more robust, and uses symbolic address for nexml.org (#238) - Provides a real `summary()` and improved pretty-print (#237) - Makes `character(0)` metadata value behave as empty string (#236) - Fixes detection of having to split matrix by class (#235) - Switch over to Additional_repositories for CRAN (#229) - Do not add `ter` namespace by default. (#227) - Replace taxize with taxald (#226) - Fixes how metadata arguments are passed on to `add_basic_meta()` (#220) - Fixes CDAO namespace definition [#219] - Enables handling of files with `rootedge` [218] v2.3.0 ------- This release addresses several aspects improving the handling of metadata: - `add_meta()` now works for trees and characters (#213, PR #217) - Handles nested meta elements properly (#196, PR #197) Misc fixes: - enable handling of `rootEdge` (#207, PR #218) - Replaces taxize backend with faster alternative `taxadb` method. (#224, PR #226). This remains only a suggested package and has much lighter dependencies as well. - add hex v2.2.0 ------ - Fixes various (previously broken) aspects of handling polymorphic and uncertain states for discrete (non-molecular) and continuous characters, including obtaining a character matrix (#174), ensuring proper column types (#188), and serializing to NeXML (#192). - Adds the optional ability to, in addition to the character matrix, obtain a concordant formatted matrix of state types (standard, polymorphic, uncertain). - Fixes loss of certain literal-valued metadata when serializing to NeXML. #193 - Drops package phylobase as dependency. (Also removes circular dependency chain, because phylobase depends on RNeXML.) v2.1.2 ------ - Fix failing checks on CRAN that require a network connection v2.1.1 ------ - avoid rdf-based tests on solaris architecture, where suggested package rdflib is not available. (CRAN request.) v2.1.0 2018-05-05 ------ - `taxize` as Suggests only - drop `rrdf` in favor of `rdflib` - drop `Sxslt` in favor of `xslt` v2.0.8 2017-11-17 ------ - patch for compatibility with upcoming release of `testthat` v2.0.7 2016-06-28 ------ - Bugfixes following release of new dplyr and new tidyr dependencies v2.0.6 2016-03-07 ------ - Migrate Additional_repositories to new address for OmegaHat project. v2.0.5 2015-12-31 ------- - `get_metadata()`, `get_taxa()` now return much richer `data.frames` instead of named vectors. This is potentially a non-backwards compatible change if scripts use the output of these functions as lists (#129). See updated metadata vignette. This introduces new dependencies `dplyr` and `lazyeval`. - more robust `nexml_read()` method for URLs, (#123) - Avoid assuming the namespace prefix `nex` for nexml elements (#51, #124, #126). Includes a fix server-side on the NeXML validator as well. - `nexml_validate()` points to the new validator. (#126) v2.0.4 2015-10-14 ------- - Fix compatibility issue with recent phytools release. v2.0.3 2015-05-27 ------ - Upgrade tests to be compatible with newest testthat (0.10.0), bumps testthat dependency version up (#119) thanks @hadley v2.0.2 2015-05-01 ------ - Add four new vignettes describing the use of various advanced features in the package: the use of SPARQL queries, advanced use of metadata features, an example of how to extend NeXML with simmap data as the use case, and documentation on the central S4 data structure used in the package. - Implements the use of Title Case in the package title, as requested (on several occasions) by the CRAN maintainers. v2.0.1 2014-12-26 ------- - Update DESCRIPTION to provide a standard `install.packages()` compatible repository for `rrdf`, as per request from the CRAN team. v2.0.0 2014-12-06 --------- * add URL and BugReports to Description. [#103](https://github.com/ropensci/RNeXML/issues/103) * for consistency with other `add_` methods, the `nexml` object is now the _last_, not the _first_, argument to `add_basic_meta`. As this changes the function API, it could break code that does not explicitly name the arguments, so we release this as 2.0.0 v1.1.3 2014-08-06 ------ Minor bugfix * Fixes typo that caused validator to fail when nexml.org couldn't be reached v1.1.2 2014-07-19 ------- Less aggressive unit-tests * nexml_validate now returns NULL if the validation cannot be performed. Unit tests now consider either TRUE or NULL as acceptable. * Just skips the uuid unit test if uuid package is not available * Documented versioning practice in NEWS * Unit tests relying on the Figshare API are not run (without failing) if authentication to figshare server fails * Documentation updated to include examples for all functions v1.1-0 2014-07-18 ------ Initial Release RNeXML/MD50000644000176200001440000002516013614247105011636 0ustar liggesusers16a92b194fcd0f7afe12ca8d26718179 *DESCRIPTION 15d87f8d4ecfd954c8dd3fc2b69a0cbb *LICENSE d3ca4a4a30db107bf214546993da18b0 *NAMESPACE 6b2a9a5f5e91c9c5a8a1e3dfccd48163 *NEWS.md fc64572d16aa8abed873a2d06d5f9202 *R/S4-utils.R 617ee40ffc60e9773ab6cb577795d5a3 *R/add_basic_meta.R 60cae3f3a6b6937333174e993c62dc1e *R/add_characters.R d45bee5d6216eb5a58ace2ac03a01605 *R/add_meta.R e10b80d1ed8c771a42e7142c5030e0a7 *R/add_namespaces.R e88f65f542b867f96d11974c08b5cb78 *R/add_trees.R 203cc0d072014189f2d58bbd98f2c04b *R/character_classes.R dd365556d442022b36d9a35d3575c711 *R/classes.R 3e199e16f9eb274d90a57f5a8d0ba60d *R/concatenate_nexml.R 503aa392f7d16d171dd19675c15ab885 *R/constructors.R 7bd3c9c98ffe79c342f9c367137050f5 *R/deprecated.R 37f947cba89f7ff4fe149812311d314c *R/get_basic_metadata.R 5bfd7fb03547cc2498c2a833a7f42fe2 *R/get_characters.R efc637eb7a8dfd9de7c34538da504bcc *R/get_level.R 3a09a62a89a6c334e524c6d903eba569 *R/get_metadata.R fe892d1d2be5fff56f37b24e89515f87 *R/get_namespaces.R 5c60213dbcbeba1b92fade2c9ec764a8 *R/get_rdf.R c4aa799bc0ba7b7a23bd7a0a32409209 *R/get_taxa.R 3a890d1b39f18a08b0f4c7d94fe0d57b *R/get_taxa_meta.R f83d67409ee5bd128a9f820d4926a732 *R/get_trees.R f8c0a9c2cec4bcbde80170ee767eba13 *R/internal_get_node_maps.R 2c2f1c91251d019f03d99e61c62c42cd *R/internal_isEmpty.R 3372a2273979f5336464963d70fb710c *R/internal_name_by_id.R 88264b69fef8bccbdcb1619f7d8c80cf *R/internal_nexml_id.R 5b3852711d343ece90abcb89d741cf52 *R/meta.R 9af2c8f6d55664ea89e6bf50ab04939d *R/nexmlTree.R 8e1b70f3620578164ee69c83abaae05d *R/nexml_add.R ea22b74789949c0aee569e7723171457 *R/nexml_get.R d615f93e38824b4b99547f9980201e7f *R/nexml_methods.R fb4f7834f086d1463b4b2ea12b895d5e *R/nexml_publish.R e55ca62202b4a3ea46b584fc3e8f2a6b *R/nexml_read.R 226d8c580a9651bbf87fd6a87e4f8862 *R/nexml_validate.R 2b511d5e0fd3f0a3e84b3d87dd589dbb *R/nexml_write.R 3320451ddd2d28c9103af5791aedd8df *R/prefixed-uris.R ae53887b412b4be1430e633ef1163955 *R/simmap.R 42e2a9d1b08a80b4b88b06eae430d616 *R/taxize_nexml.R 78ad6d9378c8d09f85d70b4f62b176b6 *R/tbl_df.R f4b6cb1ca6b9aa652acfa20fd45c64bf *R/utils.R 26bdb592ba52c26c5c72e2b7fa0103cc *README.md cc3ba87223fefdf73f1e3b6c23358061 *build/vignette.rds 84b45265f4efcfb698335957ec44d7ba *inst/CITATION 5b93ca7d234652c67049c98c84a77f1b *inst/WORDLIST 53d9a35d9cd319712e03e7fbb708fa4e *inst/doc/S4.Rmd 97ac6eddb6197d775ee8cc808a39c9d4 *inst/doc/S4.html a45d97dd85139a23e964a1e1de851a1b *inst/doc/intro.Rmd 2409b231751f0902780b1089d0a17862 *inst/doc/intro.html 45a7fb53f35659f31c048687f98b3c1f *inst/doc/metadata.Rmd 985d4bb923a8c2eab7b84943b7415a02 *inst/doc/metadata.html 056d24b223b46fc0684d0700ef60b898 *inst/doc/simmap.Rmd 14192c0ede197123307d3630e31266b7 *inst/doc/simmap.html a30cf610a0caaa9c55570375365a50cf *inst/doc/sparql.Rmd 83961633992319ff8eb593f18788f792 *inst/doc/sparql.html 2de44d2898c22479b8a449767f1ab627 *inst/examples/RDFa2RDFXML.xsl 64a60bc7b825e88ba931e1da5fd08e28 *inst/examples/biophylo.xml 41cf6116441773694f8f32b88900d346 *inst/examples/characters.xml d7ecc1b0b356c2aba5088f5503375010 *inst/examples/coal.xml 7cfba1e69724dd93fe4a07525e419ed4 *inst/examples/comp_analysis.xml 835c4ec3a29a2a08be861f44d445fab5 *inst/examples/gardiner_1984.xml d3a3d2519dcc6fe7b5399061db69f1d9 *inst/examples/geospiza.xml d0424d36f03ded1c6d36218018263a73 *inst/examples/jsonld-ex.R 84cf7d2d949b6a36df18bec31d4c8917 *inst/examples/mbank_X962_11-22-2013_1534.nex dcd3fe12a4ec3d330d89f34ed10dbaf5 *inst/examples/merge_data.Rmd 3b7704edc024518cb054fd73f1f2f9b6 *inst/examples/merge_data.md 98f7f49c77806d45800bd85ef6e6f65f *inst/examples/meta_example.xml 12d5ea02edb324a2efc824b4cdec8ed8 *inst/examples/meta_taxa.xml 34b804a9a1187689fe223be6498dcd26 *inst/examples/missing_some_branchlengths.xml 2fc3d9aca072a9964a95de8a8d7e6d53 *inst/examples/multitrees.xml e34f32b1c48ae0acd8bfab2f09971945 *inst/examples/ncbii.xml c44cb44ff958011b0dcdb4d575139e95 *inst/examples/no-base-ns.xml fb1edb923697675d5282d9d181fcfcd3 *inst/examples/ontotrace-result.xml bc5d6400426d4b843a9006e382bf6107 *inst/examples/phenex.xml 200927eaf3dc24fd97bd607277693992 *inst/examples/phenoscape.xml cb142aadc75b48b696ccf6d42637ff72 *inst/examples/primates.xml 1f52dfb1306c9ed696d14f805e95a498 *inst/examples/primates_from_R.xml 065eae0c3189850bcff9d838b5041f90 *inst/examples/primates_meta.xml a64c177eae6be033dd8712e6d693b2ea *inst/examples/primates_meta_xslt.xml 8a8e3e961583a94cec32852e9b4d36e8 *inst/examples/simmap.nex 327200ae849ba639f267e42d04932aa0 *inst/examples/simmap.xml 890f740a1b4757e839857fc7417cd957 *inst/examples/simmap_ex.xml d1740a7345534477c40477f0fc776ad7 *inst/examples/some_missing_branchlengths.xml e49283485e7dec7c98f77c54cf6406bd *inst/examples/sparql.newick f4744af232f0e5087b78f0002cc38e1d *inst/examples/taxa.xml 9e0f346fbf1ef7dcd87a3406b98e7aeb *inst/examples/treebase-record.xml 74361320b5d4bc935ea9d09a35463708 *inst/examples/trees.xml 797825bdfed94f7c25aff9b96cbe7c09 *inst/simmap.md 0a5770e137c21faf757227701e64ce44 *man/Annotated-class.Rd fe625e9a1df46abc18a8a6c828da8ea7 *man/New.Rd 075b4e06a9f9870eb384905adc088b69 *man/add_basic_meta.Rd d8dce73bf43efc048b5b58784ef2a344 *man/add_characters.Rd ae1683091ec897a6081b1c3544454693 *man/add_meta.Rd ac241a8c471c471f9a75a186fcd5be9c *man/add_namespaces.Rd 5865e8608f695a9940ba446288854191 *man/add_trees.Rd 532233e4d70cfbe7bf46aacedfc37ffa *man/c-meta.Rd af8fd9c592961f5c347e5bb76517aee4 *man/c-nexml-method.Rd 073c5a4efa3439f9d5f97f33907a662a *man/charzero_as_empty.Rd a077e4820b3c1fc2acc8140f76816986 *man/coalesce_.Rd 5e89d73d8f6f29f11b30e7407393c8a5 *man/constructors.Rd d9fb8add43d81022f3e3bac75a6d1e99 *man/dot-callGeneric.Rd e1210d83531da37a56eef78191adfbd5 *man/dot-methodWithNext.Rd 0610d2bef9e1ba3bb6ccf950086e903e *man/dot-sigLabel.Rd 5933d8fbe23bf032e4f1f5833a9a1bfc *man/expand_prefix.Rd a208c0e85e8f757aa4874a46605399c2 *man/figures/Figure1-1.png 137d3ca84d14b53bd115dc20fc543e32 *man/figures/logo.svg 1094ac0f795bcfad18b3a471460394e1 *man/figures/unnamed-chunk-5-1.png c6c9401b08aed0ae9428fe3942744a29 *man/figures/unnamed-chunk-8-1.png 3f0a5106de00eddd401a7ab97addde7f *man/findNextMethod.Rd 6ff4e3c9e72dd2330ff22b16cb4b5630 *man/flatten_multiphylo.Rd 0b14b4b9bed1b3a5a7fd8c596da679c3 *man/get_all_meta.Rd 6e9da9c9841c59d476b5ff5b015dc31c *man/get_characters.Rd e8bcab7830ffd851c905fa4474894f08 *man/get_characters_list.Rd 904567ecb69ea6bb72f5ef8de2f3ef82 *man/get_citation.Rd 3be91ae7fdf68b0eb819a6ac22b4d1f3 *man/get_flat_trees.Rd 2b606bb1e75f32d2505524eaf51e9d81 *man/get_level.Rd 63e2be2a2c09440d4310ab09d0cd61c1 *man/get_license.Rd dea904ce3dc0f951c39cb30d9e3ca376 *man/get_meta.Rd 74ddd6cf2724ac9d8ba2aba808bec9c2 *man/get_metadata.Rd c5860558cfb0e6e4a2fdcbbbb8c58185 *man/get_metadata_values.Rd df8332644e7abb5fcbb6e261aa8b2247 *man/get_namespaces.Rd 6c6a8a4e86e25aed987835cf9b3c0e9e *man/get_rdf.Rd 12e87d31ebbd3a50f1eb64cdf88da439 *man/get_taxa.Rd 6d3a3f839ac29a84d1e8146e2de408ca *man/get_taxa_list.Rd d53768ca7af1e9cf79521ab3a1bdd555 *man/get_taxa_meta.Rd 832cc9bfe3076f0ad06aaa1f5daba579 *man/get_taxa_meta_list.Rd d34d7007838a8485f05e4820efebd8e3 *man/get_trees.Rd a8605de7830699223d3b198968bf983f *man/get_trees_list.Rd 1df8dbb813f82b90f64e26cf80fc655e *man/lcapply.Rd 3eaae0d31d632fe44941ae3b2757a1b6 *man/meta.Rd 0c6be2c8374ecf0e6b95feb19f1e7366 *man/nexml-class.Rd a9ef0ac034e1b7e94fc1eedc9f319e3e *man/nexml_add.Rd e31ce2ecf494fb019749f5fbae9bc0bf *man/nexml_figshare.Rd 8870b15dc364067f1d46389e8abf312c *man/nexml_get.Rd 047f7282c78133f948b4c507316bf040 *man/nexml_publish.Rd dfb35fa6a865cef5f5903c13134e1833 *man/nexml_read.Rd 006dec7bb0b1700d3f93f23c3f029667 *man/nexml_validate.Rd 744fdbd499c02480061d87d9f1b84d2c *man/nexml_write.Rd 24a6d3057367c0a59b27575ee62d765e *man/reset_id_counter.Rd e4cf31381c41154938347538abaecd4f *man/simmap_to_nexml.Rd 9f640a0fad1c4b17e9315ad4c570f86a *man/slot-ResourceMeta-method.Rd bab3c0fc4210c564ef995edaf2912c5f *man/summary-nexml-method.Rd b6aa85b700234cd7f7bdeb6a387e4676 *man/taxize_nexml.Rd 48237ccd63c622e45f6ce13edbd3d9b3 *man/toPhylo.Rd 78a7f421feb7208c58c9197ba4eb5edb *tests/spelling.R bbde9fbfa538d3160fff44967d1fb0dd *tests/test-all.R 853b41159e31e64a801403e3142ec108 *tests/testthat/Rplots.pdf c64d6a3a0af9b631471c129a0957e626 *tests/testthat/conversions.R 6f68db3a881fdbb5e0dfd5a68c165f8d *tests/testthat/geiger_test.R 47bde26b1620dc77e8309d4246102c8e *tests/testthat/helper-RNeXML.R 0a11f0ca45c7d531e3e3631ee8a9ca1a *tests/testthat/test_01_exported_util.R de18548eae79e2afd9d06ee942c76b61 *tests/testthat/test_01_utils.R 831365b04f052e195e869edb3dd4e9bf *tests/testthat/test_02_summary.R d2a1f07f597acaf42f5d159747bd6175 *tests/testthat/test_ape.R 11363dfa842ebea09a74ad972a8b6e12 *tests/testthat/test_characters.R 263e5f67115c9185cadb84f655cce355 *tests/testthat/test_comp_analysis.R 912cd2a406a1cf5ec32d7ae64567bf4d *tests/testthat/test_concatenate.R 869bedaafcacaf1665808577d981f44e *tests/testthat/test_get_characters.R 74cd1774ba8b63c324af7e1d2f1fb7cb *tests/testthat/test_get_level.R c552f8a1eac2604fc118dbf3a6ba9bc5 *tests/testthat/test_global_ids.R f74954c631e30db81f43d1c4aca25670 *tests/testthat/test_inheritance.R 9ca26158864d37a871ec458a20d5c580 *tests/testthat/test_meta.R 91506160b07baf682960acd6b39a8b88 *tests/testthat/test_meta_extract.R 7684db6b377f74feb2727fa4142da105 *tests/testthat/test_nexml_read.R 3148883e90a8457206327608f0130558 *tests/testthat/test_parsing.R 16a017f64abb2539015e3dd6d37a57b6 *tests/testthat/test_publish.R 38d05dfd3dee48407aff15accb64a61f *tests/testthat/test_rdf.R 7ac2bde0b09984331f3be8ba0880ae20 *tests/testthat/test_serializing.R 60c4420afc7cbad033450d6afd491380 *tests/testthat/test_simmap.R a23720acf55ac1c40b1e6327305edf03 *tests/testthat/test_taxonomy.R 2938810c76b36cc315e119cf8a54dc6e *tests/testthat/test_toplevel_api.R ea863bc40c64f9a3606aeadcdb0be16a *tests/testthat/test_validate.R 93b877128746110a1a6b0bc73759a572 *tests/testthat/test_zzz_cleanup.R 24a4d4a46c84bf205bdd7407791f15f9 *tests/testthat/treebase_test.R 22c1fab7bc4d85b90706311e1656c0f8 *tools/README-unnamed-chunk-5-1.png 53d9a35d9cd319712e03e7fbb708fa4e *vignettes/S4.Rmd 938a804e872172b667fb6ad0924312c0 *vignettes/S4.Rmd.orig 1094ac0f795bcfad18b3a471460394e1 *vignettes/intro-unnamed-chunk-5-1.png a45d97dd85139a23e964a1e1de851a1b *vignettes/intro.Rmd f51161666df1b6c2c17656dcd0403f09 *vignettes/intro.Rmd.orig 45a7fb53f35659f31c048687f98b3c1f *vignettes/metadata.Rmd d3f072c99f1c4b825691fdbffd618640 *vignettes/metadata.Rmd.orig 70e3f1824013e209654f96e819ceba0a *vignettes/references.bib a208c0e85e8f757aa4874a46605399c2 *vignettes/simmap-Figure1-1.png 056d24b223b46fc0684d0700ef60b898 *vignettes/simmap.Rmd 7434be591f5536819058bb821e2067a4 *vignettes/simmap.Rmd.orig c6c9401b08aed0ae9428fe3942744a29 *vignettes/sparql-unnamed-chunk-8-1.png a30cf610a0caaa9c55570375365a50cf *vignettes/sparql.Rmd 8c917e0baeb89731790fa8a130f35cae *vignettes/sparql.Rmd.orig RNeXML/inst/0000755000176200001440000000000013614142014012270 5ustar liggesusersRNeXML/inst/examples/0000755000176200001440000000000013552353762014125 5ustar liggesusersRNeXML/inst/examples/meta_example.xml0000644000176200001440000001461413552353762017316 0ustar liggesusers https://doi.org/10.1643/CI-08-076 Lucinda, P. H. F. and R. P. Vari. 2009. New Steindachnerina species (Teleostei: Characiformes: Curimatidae) from the Rio Tocantins basin. Copeia, 2009(1):142-147 Lucinda and Vari (2009) RNeXML/inst/examples/multitrees.xml0000644000176200001440000001466313552353762017056 0ustar liggesusers RNeXML/inst/examples/primates.xml0000644000176200001440000057727613552353762016523 0ustar liggesusers RNeXML/inst/examples/missing_some_branchlengths.xml0000644000176200001440000016563313552353762022263 0ustar liggesusers RNeXML/inst/examples/treebase-record.xml0000644000176200001440000055017513552353762017732 0ustar liggesusers AGTTCTGAAACGGGTTGTAGCTGGCCTTA-----CGAGGCATGTGCACGCCCTGCTCATCCACTCT-ACACCTGTGCACCATCTGTAGGTCGGTTTGGGTTCGGATGCTTCGCGGCGTTCGGGCTCGGGCCTTCCTATGTACT-TCACACACGCTTTAGTAT-CAGAATGTAATTGCGA----TAAAACGCACCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATCATCAACCCATATGTCCTTGTGTCG--GATGGGCTTGGA-TTTGGAGGCTTATGCCGGCCCTC-GTC--GGTCGGCTCCTCTTGAATGCATTAGCTCGATTCCTTGCGGATCGGCTCCCGGTGTGATAATTGTCTACGCCGTGACCGT-GAAGC----GTTTGGCGAGCTTCGAACCGTCCTATGGACAAACTTATATCTTGACATCTGACCTCCGAGGTGCGTGTCAAAATCAAGACGACGTTGCCCTCCATTAACAGCAGTCGTGACTTGTTAGCCCTACAACGCGACACTCTCTGTGCATCAACTCGTCGAGAACTCTGACCAGACGTTCTGCATTGATAACGAGGCATTATATGATATATGCTTCAGAACCCTCAAGCTCACTACACCAACTTATGGTGACCTTAACCACCTTGTATCGATTGTCATGTCCGGTATCACGACTTGCTTGCGTTTCCCTGGTCAGCTGAATTCTGACTTGCGGAAGTTGGCTGTCAACATGGGTAATGCTTTCCTTCAGACTGGCCTAGATGCGTT-TTTCTCATTCGATGTTTTCTTTTGCAGTTCCCTTCCCTCGTCTTCATTTCTTCATGACCGGCTTCGCGCCTTTGACCGCTCGGGGTAGCCAGCAATACCGCGCGGTCACCGTCCCTGAGCTGACGCAGCAAATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCAGGCATGGCCGCTACCTCACTGTAGGTGTTAATGTTTCTTCT----GTGTTCCG-------TCATCTGAAACCTGTTCCATAGGTTGCTGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTAA-GTTCTCACTT-GATTCCTTGTGATATAACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCC?TATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTAA-GTTCTCACTT-GATTCCTTGTGATATAACACTTATGATTGACTGTTAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGATCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGATCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTAA-GTTCTCACTT-GATTCCTTGTGATATAACACTTATGATTGACTGTTAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGATCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGATATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGC?AGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGA?AACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GACGCCTTGTGACATGACACTTATCATTGACTGTTAAAAAAT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATATGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGC?CTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCA?CAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGC?CTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCAT?TCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTAA-GTTCTCACTT-GATTCCTTGTGATATAACACTTATGATTGACTGTTAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTAC?TTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGATCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAATGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTCAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCTTATTACG-GAGTGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAATGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATAACACTTATGATTGACTGTTAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTACAGAAAAGGGTTGTCGCTGGCCTCAAAATTCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCGGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGCGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCCACGGGACAATTCAATATGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTCAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGA?AAGGGTTGTCGCTGGCCTCAAAATTCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGCGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGCGGTCGTTGAAGCCTCAGTTGGGAGAGCT-ATAATCGTCCCCCACGGGACAAT-GAATTTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTCAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAATGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCGGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCACATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCTGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTGTATGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGTTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGCTCATGCCGGTCCCC-ATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGATATTTGCTTCCGGACACTGAAGCTGACGACACCCACATATGGCGATCTGAACCACCTCATTTCCATTGTCATGTCCGGCATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGACCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTTTCACTT-GATTCCTTGTGATATGGCACTTATGATTGACTGTTGAAATTC-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTATCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCGAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCCTATCACG-GAGCGTATCAATCTGATCTATTTGTT?C?TTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATA-GACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATGCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAACAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCT--TTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATGCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTT?TTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAACAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGG?TGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCT--TTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATT--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATGCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTATATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGTTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCTGC AGTTCAGAAATGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATC?GGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCA?CAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGC?CTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTC?CCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTAC?TTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATAACACTTATGATTGACTGTTAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGC?CTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATAACACTTATGATTGACTGTTAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGATATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGCG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCTTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATGCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC AGTTCAGAAATGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCGGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGATCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATCTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTAA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAATGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCGGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATCTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCACATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCCTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTACAGAAATGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCGGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCTCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCGCTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCTTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATTCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGACGTGCACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGCGGTCGTTGAAGCCTCAGTCGGGAGAGCTCATAATCGTCCCTTC-GGGACAATCGAATATTACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTTTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATCTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCCTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATCGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTTTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATCTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCCTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATTCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCGGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATCGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGACGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGCGGTCGTTGAAGCCTCGGTCGGGAGAGCTTATAATCGTCCCTTC-GGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CGTTTCAAATGTTACGTTGGAGAAAATC--TGACGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTTTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATCTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCCTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATC?GGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATAGTCCCCCACGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CGTTTCACATGTCACGTTGGAGAAAATC--TGA?GACCGTTGATC?T-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTAAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCCTATTACG-GAGCGTACCAATCTGATCTATTTGTTAC?TTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATAGTCCCCTCCGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CATTTCACATGTCACGTTGGATAAAATC--TGATGACCGTTGATCAT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAA?GAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACATTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCCTATTACG-GAGCGTACCAATCTGATCTATTTGTTACATTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTCGCTGGCCTCAAAATTCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCGGGTCCCTCGCGGGGTCGGGTTCTGCGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACATCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTTGGGCGAGCTCACAATAGTCCCCTACGGGACAATTCAATCTGACATCTGACCTCCGAGGTCTGTG-CATTTCACATGTCACGTTGGATAAAATC--TGATGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCATCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAACCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGCTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGAAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGATATGACACTTATGATTGACTGTTGAAATTT-TAGTCCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTC?GACCCCCGGCATGGGCGATACCTGACCGTATGCGGCTCCCCCTATTACG-GAGCGTACCAATCTGATCTATTTGTTACGTTTTTCATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GA?GCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTATATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGATATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGCG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATGCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGATATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGACAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATGCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACAAGAGCGTACCAATCTGAAGTATCTGTTGCCTATTATAAAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGATATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GACGCCTTGTGACATGACACTTATCATTGACTGTTAAAAAAT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGATATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GACGCCTTGTGACATGACACTTATCATTGACTGTTAAAAAAT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGTTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCTGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGATATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATGCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACTGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTATATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGATATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GACGCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC AGTACAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGATATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGA?AACGAGGCACTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGATCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGTTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATTCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCTGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GACGCCTTGTGACATGACACTTATCATTGACTGTTAAAAAAT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATGCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCT--TTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GACGCCTTGTGACATGACACTTATCATTGACTGTTAAAAAAT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GACGCCTTGTGACATGACACTTATCATTGACTGTTAAAAAAT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGACTTTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATT--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGACAACGAGGCCTTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGACCTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGCTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GATGCCTTGTGACATGACACTTATCATTGACTGTTAAAAATT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC AGTTCAGAAAAGGGTTGTAGCTGGCCTCAAA-TCCGGGGCATGTGCACACCCTGCTCATCCACTCTCACACCTGTGCACTTTCTGTAGGTCGGTTCGGGATCTGGTCCCTCGCGGGGTCGGGTTCTGTGCCTTCCTATGTACAATCACAAACGCTTCAGTATTCAGAATGTCATTGCGATAATTAAAACGCATCTTATACAACTTTCAGCAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTCCTTGGTATTCCGAGGAGCATGCCTGTTTGAGTGTCATGGAATTCTCAACCCACACGTCCTTGTGATGTGGACGGGCTTGGATATTGGAGGTTTCTGCCGGCCCCCCATTCGGGTCGGCTCCTCTGGAATGCATTAGCTCCATCCCTTGCGGATCGGCTCTCGGTGTGATAATTGTCTACGCCGTGGTCGTTGAAGCCTCAGTCGGGCGAGCTTATAATCGTCCCCTCCGGGACAATCGAATATGACATCTGACCTCCGAGGTCTGTG-CATTTCAAATGTCACGTTGGAGAAAATC--TGACGACCGTTGATCGT-AGCCCTACAACGCAACCCTCTCCGTGCACCAACTGGTCGAGAACTCTGATGAGACTTTCTGCATTGATAACGAGGCATTGTACGACATTTGCTTCCGGACACTGAAGCTGACGACACCGACATACGGCGA?CTGAATCACCTCATTTCCATCGTCATGTCCGGTATTACAACTTGTTTGCGTTTCCCTGGTCAGTTGAACTCCGATCTCCGGAAGTTGGCTGTCAACATGGGTGA-GTTCTCACTT-GA??CCTTGTGACATGACACTTATCATTGACTGTTAAAAAAT-TAGTTCCCTTCCCCCGTCTCCACTTCTTCATGACCGGTTTCGCGCCCTTGACTGCGCGCGGCAGCCAGCAGTACCGTGCTGTCACTGTACCCGAGCTGACTCAACAGATGTTCGATGCCAAGAACATGATGGCTGCGTCCGACCCCCGGCATGGCCGATACCTCACTGTATGCAACATCC--TAGCACA-GAGCGTACCAATCTGATGTATCTGTTGCCTATTTTATAGGTTGCCGC RNeXML/inst/examples/sparql.newick0000644000176200001440000001177213552353762016641 0ustar liggesusers(((((Avahi_laniger)Avahi,(Propithecus_verreauxi,Propithecus_tattersalli,Propithecus_diadema)Propithecus,(Indri_indri)Indri)Indriidae,((Varecia_variegata)Varecia,(Prolemur_simus)Prolemur,(Hapalemur_griseus,Hapalemur_aureus)Hapalemur,(Eulemur_rubriventer,Eulemur_mongoz,Eulemur_macaco,Eulemur_fulvus,Eulemur_coronatus)Eulemur,(Lemur_catta)Lemur)Lemuridae,((Lepilemur_septentrionalis,Lepilemur_ruficaudatus,Lepilemur_mustelinus,Lepilemur_leucopus,Lepilemur_edwardsi,Lepilemur_dorsalis)Lepilemur)Lepilemuridae,((Cheirogaleus_medius,Cheirogaleus_major)Cheirogaleus,(Allocebus_trichotis)Allocebus,(Phaner_furcifer)Phaner,(Mirza_coquereli)Mirza,(Microcebus_rufus,Microcebus_murinus)Microcebus)Cheirogaleidae)Lemuriformes,(((Nycticebus_pygmaeus,Nycticebus_coucang)Nycticebus,(Loris_tardigradus)Loris,(Perodicticus_potto)Perodicticus,(Arctocebus_calabarensis)Arctocebus)Lorisidae,((Daubentonia_madagascariensis)Daubentonia)Daubentoniidae)Chiromyiformes,(((Otolemur_garnettii,Otolemur_crassicaudatus)Otolemur,(Euoticus_elegantulus)Euoticus,(Galagoides_zanzibaricus,Galagoides_demidovii)Galagoides,(Galago_senegalensis,Galago_moholi,Galago_matschiei,Galago_gallarum,Galago_alleni)Galago)Galagidae)Lorisiformes)Strepsirrhini,((((Tarsius_syrichta,Tarsius_tarsier,Tarsius_bancanus)Tarsius)Tarsiidae)Tarsiiformes,((((((Pongo_pygmaeus)Pongo)Ponginae,((Homo_sapiens)Homo,(Pan_troglodytes,Pan_paniscus)Pan,(Gorilla_gorilla)Gorilla)Homininae)Hominidae,((Hylobates_pileatus,Hylobates_muelleri,Hylobates_moloch,Hylobates_lar,Hylobates_klossii,Hylobates_agilis)Hylobates,(Nomascus_leucogenys,Nomascus_gabriellae,Nomascus_concolor)Nomascus,(Hoolock_hoolock)Hoolock,(Hylobates_syndactylus)Symphalangus)Hylobatidae)Hominoidea,((((Rhinopithecus_roxellana,Rhinopithecus_brelichi,Rhinopithecus_bieti,Rhinopithecus_avunculus)Rhinopithecus,(Simias_concolor)Simias,(Presbytis_rubicunda,Presbytis_potenziani,Presbytis_melalophos,Presbytis_frontata,Presbytis_comata)Presbytis,(Colobus_satanas,Colobus_polykomos,Colobus_guereza,Colobus_angolensis)Colobus,(Nasalis_larvatus)Nasalis,(Procolobus_verus)Procolobus,(Pygathrix_nemaeus)Pygathrix,(Semnopithecus_entellus)Semnopithecus,(Trachypithecus_vetulus,Trachypithecus_johnii,Trachypithecus_francoisi,Trachypithecus_auratus,Trachypithecus_pileatus,Trachypithecus_obscurus,Trachypithecus_phayrei,Trachypithecus_cristatus,Trachypithecus_geei)Trachypithecus,(Piliocolobus_badius)Piliocolobus)Colobinae,((Lophocebus_albigena)Lophocebus,(Theropithecus_gelada)Theropithecus,(Allenopithecus_nigroviridis)Allenopithecus,(Mandrillus_sphinx,Mandrillus_leucophaeus)Mandrillus,(Papio_hamadryas)Papio,(Erythrocebus_patas)Erythrocebus,(Macaca_radiata,Macaca_sylvanus,Macaca_ochreata,Macaca_thibetana,Macaca_fuscata,Macaca_mulatta,Macaca_silenus,Macaca_arctoides,Macaca_nemestrina,Macaca_fascicularis,Macaca_tonkeana,Macaca_assamensis,Macaca_sinica,Macaca_cyclopis,Macaca_maura,Macaca_nigra)Macaca,(Chlorocebus_aethiops)Chlorocebus,(Cercopithecus_petaurista,Cercopithecus_cephus,Cercopithecus_diana,Cercopithecus_solatus,Cercopithecus_dryas,Cercopithecus_mona,Cercopithecus_preussi,Cercopithecus_hamlyni,Cercopithecus_lhoesti,Cercopithecus_wolfi,Cercopithecus_nictitans,Cercopithecus_erythrotis,Cercopithecus_erythrogaster,Cercopithecus_ascanius,Cercopithecus_campbelli,Cercopithecus_pogonias,Cercopithecus_mitis,Cercopithecus_neglectus)Cercopithecus,(Miopithecus_talapoin)Miopithecus,(Cercocebus_torquatus,Cercocebus_galeritus)Cercocebus)Cercopithecinae)Cercopithecidae)Cercopithecoidea)Catarrhini,((((Alouatta_seniculus,Alouatta_pigra,Alouatta_palliata,Alouatta_guariba,Alouatta_caraya,Alouatta_belzebul)Alouatta)Alouattinae,((Ateles_paniscus,Ateles_geoffroyi,Ateles_fusciceps,Ateles_chamek,Ateles_belzebuth)Ateles,(Lagothrix_lagotricha)Lagothrix,(Brachyteles_arachnoides)Brachyteles)Atelinae)Atelidae,(((Callimico_goeldii)Callimico,(Callithrix_flaviceps,Callithrix_jacchus,Callithrix_argentata,Callithrix_penicillata,Callithrix_aurita,Callithrix_geoffroyi,Callithrix_pygmaea,Callithrix_humeralifera,Callithrix_kuhlii)Callithrix,(Saguinus_fuscicollis,Saguinus_oedipus,Saguinus_labiatus,Saguinus_imperator,Saguinus_leucopus,Saguinus_nigricollis,Saguinus_tripartitus,Saguinus_geoffroyi,Saguinus_mystax,Saguinus_bicolor,Saguinus_midas,Saguinus_inustus)Saguinus,(Leontopithecus_rosalia,Leontopithecus_chrysopygus,Leontopithecus_chrysomelas)Leontopithecus)Callitrichinae,((Saimiri_ustus,Saimiri_sciureus,Saimiri_oerstedii,Saimiri_boliviensis)Saimiri)Saimiriinae,((Cebus_olivaceus,Cebus_capucinus,Cebus_apella,Cebus_albifrons)Cebus)Cebinae)Cebidae,((Aotus_lemurinus,Aotus_azarae,Aotus_trivirgatus,Aotus_nigriceps,Aotus_infulatus,Aotus_nancymaae,Aotus_brumbacki,Aotus_vociferans)Aotus)Aotidae,(((Cacajao_melanocephalus,Cacajao_calvus)Cacajao,(Pithecia_pithecia,Pithecia_monachus,Pithecia_irrorata)Pithecia,(Chiropotes_satanas,Chiropotes_albinasus)Chiropotes)Pitheciinae,((Callicebus_donacophilus,Callicebus_personatus,Callicebus_cupreus,Callicebus_hoffmannsi,Callicebus_caligatus,Callicebus_torquatus,Callicebus_moloch,Callicebus_brunneus)Callicebus)Callicebinae)Pitheciidae)Platyrrhini)Simiiformes)Haplorrhini)Primates; RNeXML/inst/examples/merge_data.Rmd0000644000176200001440000000334613552353762016667 0ustar liggesusers--- output: md_document: variant: markdown_github --- ```{r} library("RNeXML") library("dplyr") library("geiger") knitr::opts_chunk$set(message = FALSE, warning=FALSE, comment = NA) ``` Let's generate a `NeXML` file using the tree and trait data from the `geiger` package's "primates" data: ```{r} data("primates") add_trees(primates$phy) %>% add_characters(primates$dat, ., append=TRUE) %>% taxize_nexml() -> nex ``` (Note that we've used `dplyr`'s cute pipe syntax, but unfortunately our `add_` methods take the `nexml` object as the _second_ argument instead of the first, so this isn't as elegant since we need the stupid `.` to show where the piped output should go...) We now read in the three tables of interest. Note that we tell `get_characters` to give us species labels as there own column, rather than as rownames. The latter is the default only because this plays more nicely with the default format for character matrices that is expected by `geiger` and other phylogenetics packages, but is in general a silly choice for data manipulation. ```{r} otu_meta <- get_metadata(nex, "otus/otu") taxa <- get_taxa(nex) char <- get_characters(nex, rownames_as_col = TRUE) ``` We can take a peek at what the tables look like, just to orient ourselves: ```{r} otu_meta taxa head(char) ``` Now that we have nice `data.frame` objects for all our data, it's easy to join them into the desired table with a few obvious `dplyr` commands: ```{r} taxa %>% left_join(char, by = c("label" = "taxa")) %>% left_join(otu_meta, by = c("id" = "otu")) %>% select(id, label, x, href) ``` Because these are all from the same otus block anyway, we haven't selected that column, but were it of interest it is also available in the taxa table. RNeXML/inst/examples/gardiner_1984.xml0000644000176200001440000000546113552353762017135 0ustar liggesusers PSPUB:0000103 Gardiner, B. G. (1984). The relationships of the palaeoniscid fishes, a review based on new specimens of Mimia and Moythomasia from the Upper Devonian of Western Australia. Bulletin of the British Museum of Natural History, Geology, 37, 173–428. RNeXML/inst/examples/simmap_ex.xml0000644000176200001440000017104213552353762016636 0ustar liggesusers RNeXML/inst/examples/primates_from_R.xml0000644000176200001440000055234713552353762020017 0ustar liggesusers RNeXML/inst/examples/meta_taxa.xml0000644000176200001440000000406713552353762016621 0ustar liggesusers RNeXML/inst/examples/primates_meta_xslt.xml0000644000176200001440000056432613552353762020573 0ustar liggesusers rvosa 2014-07-03T23:43:34 rutger.vos 2014-07-04T12:39:57 RNeXML/inst/examples/comp_analysis.xml0000644000176200001440000001371113552353762017513 0ustar liggesusers RNeXML/inst/examples/merge_data.md0000644000176200001440000001641013552353762016541 0ustar liggesusers``` r library("RNeXML") ``` ## Loading required package: ape ``` r library("dplyr") ``` ## ## Attaching package: 'dplyr' ## ## The following objects are masked from 'package:stats': ## ## filter, lag ## ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union ``` r library("geiger") knitr::opts_chunk$set(message = FALSE, comment = NA) ``` Let's generate a `NeXML` file using the tree and trait data from the `geiger` package's "primates" data: ``` r data("primates") add_trees(primates$phy) %>% add_characters(primates$dat, ., append=TRUE) %>% taxize_nexml() -> nex ``` Warning in taxize_nexml(.): ID for otu Alouatta_coibensis not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Aotus_hershkovitzi not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Aotus_miconax not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Callicebus_cinerascens not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Callicebus_dubius not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Callicebus_modestus not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Callicebus_oenanthe not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Callicebus_olallae not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Euoticus_pallidus not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Lagothrix_flavicauda not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Leontopithecus_caissara not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Leontopithecus_chrysomela not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Pithecia_aequatorialis not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Pithecia_albicans not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Procolobus_pennantii not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Procolobus_preussi not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Procolobus_rufomitratus not found. Consider checking the spelling or alternate classification Warning in taxize_nexml(.): ID for otu Tarsius_pumilus not found. Consider checking the spelling or alternate classification (Note that we've used `dplyr`'s cute pipe syntax, but unfortunately our `add_` methods take the `nexml` object as the *second* argument instead of the first, so this isn't as elegant since we need the stupid `.` to show where the piped output should go...) We now read in the three tables of interest. Note that we tell `get_characters` to give us species labels as there own column, rather than as rownames. The latter is the default only because this plays more nicely with the default format for character matrices that is expected by `geiger` and other phylogenetics packages, but is in general a silly choice for data manipulation. ``` r otu_meta <- get_metadata(nex, "otus/otu") taxa <- get_taxa(nex) char <- get_characters(nex, rownames_as_col = TRUE) ``` We can take a peek at what the tables look like, just to orient ourselves: ``` r otu_meta ``` Source: local data frame [215 x 9] id property datatype content xsi.type rel (chr) (lgl) (lgl) (lgl) (chr) (chr) 1 m1 NA NA NA ResourceMeta tc:toTaxon 2 m2 NA NA NA ResourceMeta tc:toTaxon 3 m3 NA NA NA ResourceMeta tc:toTaxon 4 m4 NA NA NA ResourceMeta tc:toTaxon 5 m5 NA NA NA ResourceMeta tc:toTaxon 6 m6 NA NA NA ResourceMeta tc:toTaxon 7 m7 NA NA NA ResourceMeta tc:toTaxon 8 m8 NA NA NA ResourceMeta tc:toTaxon 9 m9 NA NA NA ResourceMeta tc:toTaxon 10 m10 NA NA NA ResourceMeta tc:toTaxon .. ... ... ... ... ... ... Variables not shown: href (chr), otu (chr), otus (chr) ``` r taxa ``` Source: local data frame [233 x 5] id label about xsi.type otus (chr) (chr) (chr) (lgl) (chr) 1 ou1 Allenopithecus_nigroviridis #ou1 NA os1 2 ou2 Allocebus_trichotis #ou2 NA os1 3 ou3 Alouatta_belzebul #ou3 NA os1 4 ou4 Alouatta_caraya #ou4 NA os1 5 ou5 Alouatta_coibensis #ou5 NA os1 6 ou6 Alouatta_fusca #ou6 NA os1 7 ou7 Alouatta_palliata #ou7 NA os1 8 ou8 Alouatta_pigra #ou8 NA os1 9 ou9 Alouatta_sara #ou9 NA os1 10 ou10 Alouatta_seniculus #ou10 NA os1 .. ... ... ... ... ... ``` r head(char) ``` taxa x 1 Allenopithecus_nigroviridis 8.465900 2 Alouatta_seniculus 8.767173 3 Galago_alleni 5.521461 4 Galago_gallarum 5.365976 5 Galago_matschiei 5.267858 6 Galago_moholi 5.375278 Now that we have nice `data.frame` objects for all our data, it's easy to join them into the desired table with a few obvious `dplyr` commands: ``` r taxa %>% left_join(char, by = c("label" = "taxa")) %>% left_join(otu_meta, by = c("id" = "otu")) %>% select(id, label, x, href) ``` Warning in left_join_impl(x, y, by$x, by$y): joining factor and character vector, coercing into character vector Source: local data frame [233 x 4] id label x (chr) (chr) (dbl) 1 ou1 Allenopithecus_nigroviridis 8.465900 2 ou2 Allocebus_trichotis 4.368181 3 ou3 Alouatta_belzebul 8.729074 4 ou4 Alouatta_caraya 8.628735 5 ou5 Alouatta_coibensis 8.764053 6 ou6 Alouatta_fusca 8.554489 7 ou7 Alouatta_palliata 8.791790 8 ou8 Alouatta_pigra 8.881836 9 ou9 Alouatta_sara 8.796339 10 ou10 Alouatta_seniculus 8.767173 .. ... ... ... Variables not shown: href (chr) Because these are all from the same otus block anyway, we haven't selected that column, but were it of interest it is also available in the taxa table. RNeXML/inst/examples/jsonld-ex.R0000644000176200001440000000131513552353762016153 0ustar liggesuserslibrary(xslt) library(xml2) library(jsonld) library(rdflib) library(magrittr) ## Apply stylesheet to map NeXML RDFa -> RDF ## Does not map the full NeXML data download.file("https://raw.githubusercontent.com/ropensci/RNeXML/master/inst/examples/RDFa2RDFXML.xsl", "toRDF.xsl") download.file("https://raw.githubusercontent.com/ropensci/RNeXML/master/inst/examples/multitrees.xml", "example.xml") rdf <- xslt::xml_xslt(read_xml("example.xml"), read_xml("toRDF.xsl")) ## Save RDF to file write_xml(rdf, "rdf.xml") rdf_parse("rdf.xml") ## JSON-LD RDF parser only speaks nquads, so use rdflib to convert: rdflib::rdf_serialize(rdf_parse("rdf.xml"), "example.nquads", "nquads") jsonld::jsonld_from_rdf("example.nquads") RNeXML/inst/examples/no-base-ns.xml0000644000176200001440000000133213552353762016610 0ustar liggesusers RNeXML/inst/examples/biophylo.xml0000644000176200001440000000211313552353762016471 0ustar liggesusers RNeXML/inst/examples/simmap.nex0000644000176200001440000001200013552353762016120 0ustar liggesusers(((((((((t1:{C,0.029712},t2:{C,0.029712}):{C,0.081255},t3:{C,0.110967}):{C,0.082038},t4:{C,0.193005}):{C,0.0653},(t5:{C,0.227507},(t6:{B,0.114204},((t7:{B,0.022164},t8:{B,0.022164}):{B,0.078416},t9:{B,0.10058}):{B,0.013624}):{B,0.0492202:A,0.05548486:C,0.00859794}):{C,0.030798}):{C,0.022745},(t10:{C,0.036822},t11:{C,0.036822}):{C,0.244228}):{C,0.301951},((t12:{B,0.13643},(t13:{B,0.066417},t14:{B,0.066417}):{B,0.070013}):{B,0.313489},(((t15:{A,0.01105711:B,0.08633207:C,0.08392283},(t16:{C,0.040903},t17:{C,0.040903}):{C,0.140409}):{C,0.047569},t18:{C,0.228881}):{C,0.024976},t19:{C,0.253857}):{C,0.15615481:B,0.03990719}):{B,0.06598734:C,0.06709466}):{C,0.142307},(((((t20:{C,0.061614},((t21:{C,0.012292},t22:{C,0.012292}):{C,0.004394},t23:{C,0.016686}):{C,0.044928}):{C,0.18261292:B,0.15110308},(t24:{C,0.14691033:B,0.13659467},((t25:{C,0.047565},t26:{C,0.047565}):{C,0.03623597:B,0.12757203},(t27:{B,0.054112},t28:{B,0.054112}):{B,0.09377572:C,0.04499636:B,0.01848892}):{B,0.072132}):{B,0.111825}):{B,0.003716},((((t29:{B,0.018011},t30:{B,0.018011}):{B,0.161776},t31:{B,0.179787}):{B,0.031075},t32:{C,0.09395762:B,0.11690438}):{B,0.008284},((t33:{A,0.04511},(t34:{A,0.025024},t35:{A,0.025024}):{A,0.020086}):{A,0.022372},t36:{A,0.067482}):{A,0.0220329:B,0.1296311}):{B,0.1799}):{B,0.066447},(((t37:{A,0.01881787:B,0.11542713},(t38:{C,0.058193},t39:{C,0.058193}):{C,0.0452913:B,0.0307607}):{B,0.11923},((t40:{B,0.029424},t41:{B,0.029424}):{B,0.064453},(t42:{B,0.088798},(t43:{B,0.006835},t44:{B,0.006835}):{B,0.081963}):{B,0.005079}):{B,0.159598}):{B,0.201775},(t45:{A,0.27169364:B,0.01218236},(t46:{B,0.054755},t47:{B,0.054755}):{B,0.01137782:C,0.00527465:B,0.21246852}):{B,0.171374}):{B,0.010243}):{B,0.082374},((t48:{A,0.014428},t49:{A,0.014428}):{A,0.06602405:B,0.00717595},(t50:{B,0.079839},(t51:{B,0.063663},t52:{B,0.063663}):{B,0.016176}):{B,0.007789}):{B,0.460239}):{B,0.13318855:C,0.04425245}):{C,0.093657},(t53:{B,0.190817},t54:{B,0.190817}):{B,0.12304625:A,0.15363605:B,0.30567886:C,0.04578684}):{C,0.181035},(((t55:{A,0.25796546:C,0.13217354},t56:{C,0.390139}):{C,0.141789},((t57:{B,0.287908},t58:{B,0.287908}):{B,0.13331858:C,0.05888842},((t59:{A,0.001281},t60:{A,0.001281}):{A,0.1619706:B,0.00648471:A,0.00343325:B,0.1447788:C,0.08548364},(((t61:{A,0.170246},((t62:{A,0.048774},t63:{A,0.048774}):{A,0.063415},t64:{C,0.08672847:A,0.02546053}):{A,0.058057}):{A,0.0120117:C,0.0881293},t65:{C,0.270387}):{C,0.03781934:B,0.06603066},t66:{A,0.36636122:B,0.00787578}):{B,0.0168208:C,0.0123742}):{C,0.076683}):{C,0.051813}):{C,0.302289},(((((t67:{C,0.198747},t68:{C,0.198747}):{C,0.084922},((t69:{C,0.050633},t70:{C,0.050633}):{C,0.204302},(t71:{C,0.234648},(t72:{B,0.03930386:A,0.13807972:C,0.01655742},(t73:{B,0.01176706:C,0.04577094},(t74:{C,0.039504},t75:{C,0.039504}):{C,0.018034}):{C,0.136403}):{C,0.040707}):{C,0.020287}):{C,0.028734}):{C,0.096779},((((((t76:{C,0.067239},t77:{C,0.067239}):{C,0.040487},(t78:{C,0.080094},t79:{C,0.080094}):{C,0.027632}):{C,0.050747},(t80:{B,0.022775},t81:{B,0.022775}):{B,0.08754141:C,0.04815659}):{C,0.103693},(t82:{A,0.07025162:C,0.11523038},t83:{B,0.10137623:C,0.08410577}):{C,0.076684}):{C,0.04376},(t84:{C,0.022435},t85:{C,0.022435}):{C,0.283491}):{C,0.018402},t86:{C,0.324328}):{C,0.05612}):{C,0.066885},(t87:{C,0.09773},t88:{A,0.07109598:B,0.01773404:C,0.00889998}):{C,0.349603}):{C,0.374617},((((((((t89:{B,0.011431},t90:{B,0.011431}):{B,0.03600887:C,0.10503713},t91:{C,0.152477}):{C,0.034806},t92:{C,0.187283}):{C,0.105663},(t93:{B,0.002354},t94:{B,0.002354}):{B,0.05707722:C,0.23351478}):{C,0.111032},((((t95:{B,0.163727},(t96:{B,0.011349},t97:{B,0.011349}):{B,0.152378}):{B,0.18617},t98:{C,0.0114988:B,0.02800592:A,0.06698869:B,0.24340359}):{B,0.014207},(t99:{A,0.042468},t100:{A,0.042468}):{A,0.0244259:B,0.2972101}):{B,0.01022913:C,0.00892587},(t101:{C,0.105583},(t102:{C,0.064286},t103:{C,0.064286}):{C,0.041297}):{C,0.277676}):{C,0.020719}):{C,0.162541},t104:{B,0.06026646:C,0.24619528:A,0.16340273:C,0.09665452}):{C,0.069693},((t105:{A,0.004823},t106:{A,0.004823}):{A,0.28578406:B,0.26749494},(((t107:{A,0.04327952:C,0.01568848},t108:{C,0.058968}):{C,0.012749},t109:{C,0.071717}):{C,0.12764508:B,0.00874292},t110:{B,0.16660987:A,0.01515606:B,0.02633907}):{B,0.349997}):{B,0.07722562:C,0.00088438}):{C,0.032159},(((t111:{B,0.08549674:A,0.06290487:C,0.16231239},t112:{C,0.310714}):{C,0.2969},(((t113:{B,0.14396234:C,0.17738666},t114:{B,0.22907891:C,0.09227009}):{C,0.12059},((t115:{B,0.122887},t116:{B,0.122887}):{B,0.18466489:C,0.00874111},(t117:{C,0.10759561:B,0.14599639},(t118:{A,0.1120285:B,0.0591345},t119:{B,0.171163}):{B,0.082429}):{B,0.00630766:C,0.05639334}):{C,0.125646}):{C,0.066612},(t120:{A,0.056834},t121:{A,0.056834}):{A,0.22197082:C,0.22974618}):{C,0.099063}):{C,0.027002},((((t122:{C,0.00932159:A,0.01515441},t123:{A,0.024476}):{A,0.16301338:B,0.00777762},t124:{C,0.05317007:B,0.14209693}):{B,0.014201},t125:{B,0.209468}):{B,0.09836283:C,0.12362417},((t126:{C,0.042169},t127:{C,0.042169}):{C,0.050774},(t128:{C,0.03018},t129:{C,0.03018}):{C,0.062763}):{C,0.338512}):{C,0.203161}):{C,0.033755}):{C,0.153579}):{C,0.012267}):{C,0.165783}); RNeXML/inst/examples/RDFa2RDFXML.xsl0000644000176200001440000007647613552353762016454 0ustar liggesusers RNeXML/inst/examples/ontotrace-result.xml0000644000176200001440000001636713552353762020176 0ustar liggesusers Generated from the Phenoscape Knowledgebase on 2015-10-21 by Ontotrace query: * taxa: <http://purl.obolibrary.org/obo/VTO_0036217> * entities: <http://purl.obolibrary.org/obo/BFO_0000050> some <http://purl.obolibrary.org/obo/UBERON_0008897> RNeXML/inst/examples/phenex.xml0000644000176200001440000004371513552353762016150 0ustar liggesusers Excerpt of Phenex-annotated character matrix, created for software testing purposes Hilmar Lapp 298161 285663 220199 251450 301960 RNeXML/inst/examples/coal.xml0000644000176200001440000000401313552353762015563 0ustar liggesusers RNeXML/inst/examples/primates_meta.xml0000644000176200001440000025055613552353762017516 0ustar liggesusers RNeXML/inst/examples/some_missing_branchlengths.xml0000644000176200001440000001226013552353762022246 0ustar liggesusers RNeXML/inst/examples/trees.xml0000644000176200001440000001234013552353762015771 0ustar liggesusers RNeXML/inst/examples/characters.xml0000644000176200001440000005654113552353762017001 0ustar liggesusers 0101 0101 0101 0101 0101 A C G C T C G C A T C G C A T C A C G C T C G C A T C G C A T C A C G C T C G C A T C G C A T C ACGCUCGCAUCGCAUC ACGCUCGCAUCGCAUC ACGCUCGCAUCGCAUC -1.545414144070023 -2.3905621575431044 -2.9610221833467265 0.7868662069161243 0.22968509237534918 -1.6259836379710066 3.649352410850134 1.778885099660406 -1.2580877968480846 0.22335354995610862 -1.5798979984134964 2.9548251411133157 1.522005675256233 -0.8642016921755289 -0.938129801832388 2.7436692306788086 -0.7151148143399818 4.592207937774776 -0.6898841440534845 0.5769509574453064 3.1060827493657683 -1.0453787389160105 2.67416332763427 -1.4045634106692808 0.019890469925520196 1 2 2 2 3 4 2 3 4 1 RNeXML/inst/examples/taxa.xml0000644000176200001440000000613213552353762015606 0ustar liggesusers RNeXML/inst/examples/simmap.xml0000644000176200001440000002475513552353762016152 0ustar liggesusers t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 t63 t64 t65 t66 t67 t68 t69 t70 t71 t72 t73 t74 t75 t76 t77 t78 t79 t80 t81 t82 t83 t84 t85 t86 t87 t88 t89 t90 t91 t92 t93 t94 t95 t96 t97 t98 t99 t100 t101 t102 t103 t104 t105 t106 t107 t108 t109 t110 t111 t112 t113 t114 t115 t116 t117 t118 t119 t120 t121 t122 t123 t124 t125 t126 t127 t128 t129 (((((((((1:0.029712,2:0.029712):0.081255,3:0.110967):0.082038,4:0.193005):0.0653,(5:0.227507,(6:0.114204,((7:0.022164,8:0.022164):0.078416,9:0.10058):0.013624):0.113303):0.030798):0.022745,(10:0.036822,11:0.036822):0.244228):0.301951,((12:0.13643,(13:0.066417,14:0.066417):0.070013):0.313489,(((15:0.181312,(16:0.040903,17:0.040903):0.140409):0.047569,18:0.228881):0.024976,19:0.253857):0.196062):0.133082):0.142307,(((((20:0.061614,((21:0.012292,22:0.012292):0.004394,23:0.016686):0.044928):0.333716,(24:0.283505,((25:0.047565,26:0.047565):0.163808,(27:0.054112,28:0.054112):0.157261):0.072132):0.111825):0.003716,((((29:0.018011,30:0.018011):0.161776,31:0.179787):0.031075,32:0.210862):0.008284,((33:0.04511,(34:0.025024,35:0.025024):0.020086):0.022372,36:0.067482):0.151664):0.1799):0.066447,(((37:0.134245,(38:0.058193,39:0.058193):0.076052):0.11923,((40:0.029424,41:0.029424):0.064453,(42:0.088798,(43:0.006835,44:0.006835):0.081963):0.005079):0.159598):0.201775,(45:0.283876,(46:0.054755,47:0.054755):0.229121):0.171374):0.010243):0.082374,((48:0.014428,49:0.014428):0.0732,(50:0.079839,(51:0.063663,52:0.063663):0.016176):0.007789):0.460239):0.177441):0.093657,(53:0.190817,54:0.190817):0.628148):0.181035,(((55:0.390139,56:0.390139):0.141789,((57:0.287908,58:0.287908):0.192207,((59:0.001281,60:0.001281):0.402151,(((61:0.170246,((62:0.048774,63:0.048774):0.063415,64:0.112189):0.058057):0.100141,65:0.270387):0.10385,66:0.374237):0.029195):0.076683):0.051813):0.302289,(((((67:0.198747,68:0.198747):0.084922,((69:0.050633,70:0.050633):0.204302,(71:0.234648,(72:0.193941,(73:0.057538,(74:0.039504,75:0.039504):0.018034):0.136403):0.040707):0.020287):0.028734):0.096779,((((((76:0.067239,77:0.067239):0.040487,(78:0.080094,79:0.080094):0.027632):0.050747,(80:0.022775,81:0.022775):0.135698):0.103693,(82:0.185482,83:0.185482):0.076684):0.04376,(84:0.022435,85:0.022435):0.283491):0.018402,86:0.324328):0.05612):0.066885,(87:0.09773,88:0.09773):0.349603):0.374617,((((((((89:0.011431,90:0.011431):0.141046,91:0.152477):0.034806,92:0.187283):0.105663,(93:0.002354,94:0.002354):0.290592):0.111032,((((95:0.163727,(96:0.011349,97:0.011349):0.152378):0.18617,98:0.349897):0.014207,(99:0.042468,100:0.042468):0.321636):0.019155,(101:0.105583,(102:0.064286,103:0.064286):0.041297):0.277676):0.020719):0.162541,104:0.566519):0.069693,((105:0.004823,106:0.004823):0.553279,(((107:0.058968,108:0.058968):0.012749,109:0.071717):0.136388,110:0.208105):0.349997):0.07811):0.032159,(((111:0.310714,112:0.310714):0.2969,(((113:0.321349,114:0.321349):0.12059,((115:0.122887,116:0.122887):0.193406,(117:0.253592,(118:0.171163,119:0.171163):0.082429):0.062701):0.125646):0.066612,(120:0.056834,121:0.056834):0.451717):0.099063):0.027002,((((122:0.024476,123:0.024476):0.170791,124:0.195267):0.014201,125:0.209468):0.221987,((126:0.042169,127:0.042169):0.050774,(128:0.03018,129:0.03018):0.062763):0.338512):0.203161):0.033755):0.153579):0.012267):0.165783) RNeXML/inst/examples/ncbii.xml0000644000176200001440000002030013552353762015726 0ustar liggesusers RNeXML/inst/examples/phenoscape.xml0000644000176200001440000000370513552353762017001 0ustar liggesusers RNeXML/inst/examples/mbank_X962_11-22-2013_1534.nex0000644000176200001440000005134513552353762020252 0ustar liggesusers#NEXUS BEGIN TAXA; DIMENSIONS NTAX=27; TAXLABELS 'Sargocentron vexillarium' 'Beryx decadactylus' 'Polymixia berndti' 'Lateolabrax japonicus' 'Mioplosus labricoides' 'Priscacara serrata' 'Priscacara liops' 'Roccus saxatilis' 'Roccus chrysops' 'Morone americana' 'Morone mississippiensis' 'Dicentrarchus labrax' 'Lates mariae' 'Lates calcarifer' 'Siniperica' 'Centropomus parallelus' 'Centropomus undecimalis' 'Mycteroperca tigris' 'Serranus subligarius' 'Macquaria australasica' 'Percichthys trucha' 'Lepomis macrochirus' 'Micropterus dolomieu' 'Perca flavescens' 'Stizostedion vitreum' 'Pseudaphritis urvillii' 'Niphon' ; ENDBLOCK; BEGIN CHARACTERS; DIMENSIONS NCHAR=77; FORMAT DATATYPE=STANDARD MISSING=? GAP=- SYMBOLS="0123"; CHARLABELS [1] 'Vomer, shape of tooth patch' [2] 'Orbitosphenoid' [3] 'Pterotic, enclosure of lateral line canal' [4] 'Frontals, midline suture' [5] 'Frontoparietal crests' [6] 'Frontoparietal crests, sensory pore on dorsal margin' [7] 'Supraoccipital crest, shape' [8] 'Supraoccipital crest, horizontal shelf projecting laterally at mid-height' [9] 'Supraoccipital crest, shape of dorsal margin' [10] 'Sphenotic, horizontal shelf' [11] 'Mesethmoid, anterolaterally facing projection' [12] 'Lateral ethmoid-lacrimal articulation, orientation' [13] 'Lacrimal, shape' [14] 'Lacrimal, serration on ventral margin' [15] 'Non-lacrimal suborbital bones, ventral margins' [16] 'Subocular shelf present on third infraorbital' [17] 'Subocular shelf, shape' [18] 'Subocular shelf, anterior extension' [19] 'Post-temporal, ornamentation of posterior margin' [20] 'Post-temporal, depression on medial face' [21] 'Epiotic, strong posterior projection' [22] 'Symplectic, shape' [23] 'Metapterygoid lamina' [24] 'Exoccipital, articular facet shape' [25] 'Ethmovomerine region, number of facets for articulation with palatine' [26] 'Premaxilla, articular and ascending processes' [27] 'Premaxilla, lateral ridge running dorsoventrally on articular process' [28] 'Premaxilla, shape of dorsal crest' [29] 'Premaxilla, maxillary shelf or groove on external surface' [30] 'Supramaxillary bones' [31] 'Dentary teeth morphology' [32] 'Basihyal dentition' [33] 'Ceratohyal foramen' [34] 'Ceratohyal foramen development' [35] 'Opercular spine count' [36] 'Urohyal, posterior margin' [37] 'Shape of articular process of urohyal' [38] 'Morphology of ventral surface of urohyal' [39] 'Spine of urohyal shape' [40] 'Preoperculum, noteworthy spine on posterior margin of corner' [41] 'Preopercule, ornamentation of the ventral border of the horizontal limb' [42] 'Interopercle, ornamentation of margin' [43] 'Subopercle, ornamentation of margin' [44] 'Preopercle, enclosure of sensory canal on ascending limb' [45] 'Preopercle, enclosure of sensory canal on horizontal limb' [46] 'Precaudal vertebrae, number' [47] 'Second neural spine, expansion' [48] 'Fourth neural spine, articulation with dorsal pterygiophores' [49] 'Posterior abdominal haemal arches' [50] 'First haemal spine, configuration' [51] 'First haemal spine, transverse expansion' [52] 'First haemal spine, anterior face' [53] 'Uroneural pair, number' [54] 'Epural count' [55] 'Hypurals, fusion' [56] 'Hypurapophysis' [57] 'Length of spinous dorsal fin' [58] 'Supraneural bones, number' [59] 'Supernumerary dorsal fin spines' [60] 'Caudal fin ray count' [61] 'Caudal fin shape' [62] 'Caudal fin, spur on posteriormost procurrent ray' [63] 'Ray preceeding spur shortened' [64] 'Anal pterygiophores, number anterior to first haemal spine' [65] 'Anal fin spine count' [66] 'First anal pterygiophore, associated anal spines' [67] 'Proximal radial of the first anal fin pterygiophore, anteromedial ridge' [68] 'Radial attachment to scapulocoracoid' [69] 'Cleithrum, ornamentation on posterior margin' [70] 'Cleithrum, ventral expansion on posterior plate' [71] 'Pelvic bones, post-pelvic process' [72] 'Pelvic bones, shape of post-pelvic process' [73] 'Pelvic bones, accessory sub-pelvic keel' [74] 'Pattern of posterior scalelet distribution' [75] 'Scales, resorption of old ctenii' [76] 'Lateral line, auxiliary row of lateral line scales above/below the main row' [77] 'Lateral line, expansion onto posterior margin of caudal fin' ; STATELABELS 1 'Trapezoidal to ovate' 'Narrow, v-shaped tooth patch' 'Vomerine teeth reduced to a few large teeth' , 2 'Present' 'Absent' , 3 'absent or incomplete' 'complete' , 4 'joined along entire midline' 'separated by supraoccipital crest' , 5 'absent' 'present' , 6 'absent' 'present' , 7 'long and low' 'height and length roughly equal' , 8 'present' 'absent' , 9 'blade-like' 'significantly expanded laterally' , 10 'absent' 'present' , 11 'absent' 'present' , 12 'entirely or primarily in the horizontal plane' 'primarily in the vertical plane' , 13 'rectangular' 'square' , 14 'present' 'absent' , 15 'serrate' 'smooth' , 16 'present' 'absent' , 17 'quadrangular' 'ovate' , 18 'present' 'absent' , 19 'Denticulate' 'Smooth' , 20 'Absent' 'Present, connection site of post-temporal with tunica externa' , 21 'Absent' 'Present' , 22 'straight or slightly tapered' 'with sharp anterior bend' , 23 'Broad and well-developed' 'reduced to a notch and a ridge' , 24 'Ovate' 'Bean-shaped' , 25 'one' 'two' , 26 'indistinct' 'separate along entire margine' , 27 'absent' 'present' , 28 'flat to convex' 'triangular' , 29 'present' 'absent' , 30 'present' 'absent' , 31 'villiform' 'caniniform' , 32 'absent' 'present' , 33 'present' 'absent' , 34 'complete' 'incomplete, partial loss of upper strut' , 35 '0/1' '2' '3' , 36 'concave or flat' 'convex' , 37 'strut-like, cylindrical' 'flattened laterally into a blade-like structure' , 38 'v-shaped channel or incomplete tube' 'flate and perpendicular to the dorsoventral axis, or convex' , 39 'fused to form single spine' 'spine bifurcate' , 40 'absent' 'present' , 41 'serrate' 'large, triangular spines' 'smooth' , 42 'serrate' 'smooth' , 43 'serrate' 'smooth' , 44 'contained in open "gutter"' 'partially enclosed' , 45 'contained in open channel' 'partially enclosed' , 46 '10-12' '14 or more' , 47 'does not contact first neural spine' 'partial articulation between first and second neural spines' 'second spine contacts first along entire border' , 48 'without specialized groove' 'with groove for insertion of third dorsal pterygiophore' , 49 'bridged ventrally' 'open' , 50 'first haemal spine fused to parapophyses' 'partial fusion only' , 51 'absent, transverse processes directed ventrally or ventromedially' 'present, transverse processes directed ventrolaterally, forming a wing-shaped projection' , 52 'flat or slightly folded anteriorly' 'forming a sharp, anteromedially-directed groove' , 53 'two' 'one' , 54 'three' 'two' , 55 'absent' 'present between hypurals three and four' , 56 'absent' 'present' , 57 'shorter than soft-rayed dorsal fin' 'longer than or subequal in length to soft-rayed dorsal fin' , 58 'three' 'two' 'one' , 59 'present, two or more spines attach to first pterygiophore' 'absent, one spine in serial correspondence only' , 60 '17 or more' '15' 'State 2' , 61 'deeply forked' 'shallowly forked' 'straight to slightly convex' , 62 'absent' 'present' , 63 'ray not shortened' 'ray shortened' , 64 'one' 'two' 'three or more' , 65 'four' 'three' 'two' , 66 'two' 'one' , 67 'wide' 'narrow' , 68 'radials i-iii insert on scapula, iv in the interspace between scapula and coracoid' 'i-ii insert on scapula, iii inserts in interspace, iv inserts on coracoid' , 69 'denticulate' 'smooth' , 70 'absent' 'present' , 71 'absent' 'present' , 72 'spearhead or knob-shaped' 'short, massive expansion' , 73 'present' 'absent' , 74 'imbricate, cycloid, or pseudoctenoid' 'ordered, columnar distribution' , 75 'absent to slight' 'strong' 'complete' , 76 'absent' 'present' , 77 'absent or nearly so' 'significant (>1/3 of caudal fin depth)' , ; MATRIX 'Sargocentron vexillarium' 00000?00000000000000000000010000000000010000001000000001101000000000010?00000 'Beryx decadactylus' 00000??00000000001??000?00001000000000?000000010?00?000?001000010??0?00??0000 'Polymixia berndti' 00000?00000000000000000?00000001000000?00000000000000001000000000000100?00000 'Lateolabrax japonicus' 01011000111101100100100111100000011110111110011011000001101111101000011001201 'Mioplosus labricoides' 1?111?0011?????0??0?1?0?1110100?0011?0?01??00010?1??00011011111020?0?1???0001 'Priscacara serrata' 1?011?1?100?00?00?0?10??0111010?0010101011100000??0?00011001111010100110112?? 'Priscacara liops' 1?011?1?100????0????10??0111010?001?101001100000??0?00011001111010100110112?? 'Roccus saxatilis' 11011011100100100100100001110101011110100110000000000001100111101010011011211 'Roccus chrysops' 11011001100100100100100001110101011110100110000000000001100111101010011011211 'Morone americana' 11011011100100100100100001110101011100100000000000000001100111101010011011211 'Morone mississippiensis' 11011011100100100100100001110101011100100000000000000001100111101010011011211 'Dicentrarchus labrax' 01011001100100100100100001100101011000101110000000000001100101101010010?11211 'Lates mariae' 01111100111100101101111111100000000110111111101101000101101111101000011100011 'Lates calcarifer' 011111001111001011??111111100000001?1111111110110100010110112110100001??000?1 'Siniperica' 01100?00110001101101110111100000000????11111101100010011100011101010111010000 'Centropomus parallelus' 11001000100000000100000000000000000001100110002000000001100101101000101100001 'Centropomus undecimalis' 11001000100000000100000000000000000001100110002000000001100101101000101100001 'Mycteroperca tigris' 110010000000001010100000111110101?2001002111002000001011100210001001100?00100 'Serranus subligarius' 110110000000011010000000011111101?2011000110001000001011100110001000101000100 'Macquaria australasica' 11001010000000101000000010011000010010000001001011110001100111111001010?00000 'Percichthys trucha' 01000?10000000101000001?10001000010010000000001001110001101111111001100?00000 'Lepomis macrochirus' 0101101100001111??10000000011100000010002111100011110001101110011010100?00000 'Micropterus dolomieu' 0100100000000111??10000001011000000010002111100011110001100110011010100?00000 'Perca flavescens' 11000?1010000111??00000011011100010010000000111011001001111210002111011001200 'Stizostedion vitreum' 21000?0000000111??00100111011110010011001000111011001001111210012111111001201 'Pseudaphritis urvillii' 11010?000???0111??10000??10111001?0000000000?10110001?010212?001211111???1200 'Niphon' ??1?0?0?010?0011???00?00??0?????00?01001?????1???00?1001110?100?10??1010?1200 ; ENDBLOCK; BEGIN NOTES; [Character comments] TEXT CHARACTER=12 TEXT='Waldman, 1986'; TEXT CHARACTER=17 TEXT='Carpenter and Johnson, 2002'; TEXT CHARACTER=18 TEXT='Carpenter and Johnson, 2002'; TEXT CHARACTER=20 TEXT='Otero, 2004'; TEXT CHARACTER=21 TEXT='Otero, 2004'; TEXT CHARACTER=23 TEXT='Otero, 2004'; TEXT CHARACTER=24 TEXT='Otero, 2004'; TEXT CHARACTER=26 TEXT='Modified from Day, 2002'; TEXT CHARACTER=27 TEXT='Otero, 2004'; TEXT CHARACTER=28 TEXT='Day, 2002'; TEXT CHARACTER=40 TEXT='Otero, 2004'; TEXT CHARACTER=48 TEXT='Waldman, 1986'; TEXT CHARACTER=49 TEXT='Chang, 1988'; TEXT CHARACTER=50 TEXT='Otero, 2004'; TEXT CHARACTER=51 TEXT='Chang, 1988'; TEXT CHARACTER=52 TEXT='Chang, 1988'; TEXT CHARACTER=53 TEXT='Otero, 2004'; TEXT CHARACTER=54 TEXT='Otero, 2004'; TEXT CHARACTER=55 TEXT='Otero, 2004'; TEXT CHARACTER=62 TEXT='Johnson, 1975'; TEXT CHARACTER=63 TEXT='Johnson, 1975'; TEXT CHARACTER=64 TEXT='Chang, 1988'; TEXT CHARACTER=67 TEXT='Chang, 1988'; TEXT CHARACTER=68 TEXT='Johnson, 1975'; TEXT CHARACTER=69 TEXT='Otero, 2004'; TEXT CHARACTER=70 TEXT='Otero, 2004'; TEXT CHARACTER=72 TEXT='modified from Otero, 2004'; TEXT CHARACTER=74 TEXT='McCully, 1963'; TEXT CHARACTER=75 TEXT='McCully, 1962'; [Attribute comments] ENDBLOCK; BEGIN MACCLADE; Version 4.0 84 ; LastModified -973521234 ; FileSettings editor 0 0 1 1 ; Singles 000 ; Editor 0001100111111110010001001 1 24 Geneva 9 100 1 all ; EditorPosition 46 48 691 963 ; TreeWindowPosition 46 6 699 974 ; ListWindow Characters closed Geneva 9 46 48 689 974 000 ; ListWindow Taxa closed Geneva 9 50 10 145 490 100000 ; ListWindow Trees closed Geneva 9 50 10 276 490 ; ListWindow TypeSets closed Geneva 9 50 10 276 490 ; ListWindow WtSets closed Geneva 9 50 10 276 490 ; ListWindow ExSets closed Geneva 9 50 10 276 490 ; ListWindow CharSets closed Geneva 9 50 10 276 490 ; ListWindow TaxSets closed Geneva 9 50 10 276 490 ; ListWindow CharPartitions closed Geneva 9 50 10 276 490 ; ListWindow CharPartNames closed Geneva 9 50 10 276 490 ; ListWindow WtSets closed Geneva 9 50 10 276 490 ; ChartWindowPosition 52 30 686 964 ; StateNamesSymbols closed Geneva 9 10 50 30 148 220 ; WindowOrder Data ; OtherSymbols & / 00 ? - ; Correlation 0 0 1000 0 0 10011010 ; Salmo 00000001 ; EditorFile 2 ; ExportHTML _ MOSS 100 110000 ; PrettyPrint 10 ; EditorToolsPosition 579 88 115 165 ; TreeWindowProgram 10 ; TreeWindow 0000 ; Continuous 0 3 1 ; Calculations 0000001 ; SummaryMode 0 0 0 ; Charts Geneva 9 ( normal ) 0010 ; NexusOptions 0 0 50 001011011 ; TipLabel 1 ; TreeFont Geneva 9 ( normal ) ; TreeShape 1.0 1.0 0100 ; TraceLabels 0101 ; ChartColors 0 0 65535 9 0 1 ; ChartBiggestSpot 1 ; ChartPercent 10 ; ChartBarWidth 10 1 ; ChartVerticalAxis 10101 ; ChartMinMax 0 ; TraceAllChangesDisplay 1 1 ; BarsOnBranchesDisplay 0 0 60000 10000 10000 10000 10000 60000 65000 65000 65000 6 1 0000101 ; ContinuousBranchLabels 0 ; AllStatesBranchLabels 1 ; IndexNotation 2 1 ; PrintTree 10.00 2 2 2 2 2 2 2 2 2 2 2 Geneva 9 ( normal ) Geneva 10 ( normal ) Geneva 9 ( normal ) Geneva 9 ( normal ) Geneva 9 ( bold ) Geneva 9 ( normal ) Geneva 9 ( normal ) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 256 -39 4 -40 0 1 2 1 8 0 0 0 2 1000111000000000000100000111000 ; MatchChar 00 . ; EntryInterpretation 01 ; ColorOptions 00 ; TreeTools 0 5 4 0 10 4 0 00100111111101110 ; EditorTools 0 0 0 1000 0 0 6 3 0 100000101110001 ; PairAlign 2 2 3 2 1 1 2 1 3 1010 ; BothTools 1 ; ENDBLOCK; BEGIN MESQUITE; MESQUITESCRIPTVERSION 2 ; TITLE AUTO; tell ProjectCoordinator ; getEmployee #mesquite.minimal.ManageTaxa.ManageTaxa ; tell It ; setID 0 8120504986075687201 ; tell It ; setDefaultOrder 0 1 2 3 6 4 5 7 8 9 10 11 12 27 13 14 15 20 22 16 17 23 24 18 19 25 26 ; attachments ; endTell ; endTell ; getEmployee #mesquite.charMatrices.ManageCharacters.ManageCharacters ; tell It ; setID 0 5510595068374379090 ; tell It ; setDefaultOrder 0 1 2 3 4 5 6 7 9 8 10 11 12 13 14 15 16 17 18 19 20 22 30 47 28 23 24 25 26 29 21 27 31 32 34 35 36 37 38 41 42 43 44 45 46 48 49 50 76 54 77 78 55 56 57 82 52 51 53 58 59 60 61 75 62 81 79 65 66 67 68 69 70 71 72 73 74 ; attachments ; endTell ; checksumv 0 2 1698488223 null ; endTell ; getWindow ; tell It ; suppress ; setResourcesState false false 100 ; setPopoutState 400 ; setExplanationSize 0 ; setAnnotationSize 0 ; setFontIncAnnot 0 ; setFontIncExp 0 ; setSize 1489 858 ; setLocation 96 36 ; setFont SanSerif ; setFontSize 10 ; getToolPalette ; tell It ; endTell ; desuppress ; endTell ; getEmployee #mesquite.minimal.ManageTaxa.ManageTaxa ; tell It ; showTaxa #8120504986075687201 #mesquite.lists.TaxonList.TaxonList ; tell It ; setTaxa #8120504986075687201 ; getWindow ; tell It ; newAssistant #mesquite.lists.DefaultTaxaOrder.DefaultTaxaOrder ; newAssistant #mesquite.lists.TaxonListCurrPartition.TaxonListCurrPartition ; setExplanationSize 30 ; setAnnotationSize 20 ; setFontIncAnnot 0 ; setFontIncExp 0 ; setSize 1389 791 ; setLocation 96 36 ; setFont SanSerif ; setFontSize 10 ; getToolPalette ; tell It ; endTell ; endTell ; showWindow ; getEmployee #mesquite.lists.ColorTaxon.ColorTaxon ; tell It ; setColor Red ; removeColor off ; endTell ; getEmployee #mesquite.lists.TaxonListAnnotPanel.TaxonListAnnotPanel ; tell It ; togglePanel off ; endTell ; endTell ; endTell ; getEmployee #mesquite.charMatrices.BasicDataWindowCoord.BasicDataWindowCoord ; tell It ; showDataWindow #5510595068374379090 #mesquite.charMatrices.BasicDataWindowMaker.BasicDataWindowMaker ; tell It ; getWindow ; tell It ; setExplanationSize 30 ; setAnnotationSize 20 ; setFontIncAnnot 0 ; setFontIncExp 0 ; setSize 1389 791 ; setLocation 96 36 ; setFont SanSerif ; setFontSize 10 ; getToolPalette ; tell It ; setTool mesquite.charMatrices.BasicDataWindowMaker.BasicDataWindow.ibeam ; endTell ; setActive ; setTool mesquite.charMatrices.BasicDataWindowMaker.BasicDataWindow.ibeam ; colorCells #mesquite.charMatrices.ColorByState.ColorByState ; colorRowNames #mesquite.charMatrices.TaxonGroupColor.TaxonGroupColor ; colorColumnNames #mesquite.charMatrices.CharGroupColor.CharGroupColor ; colorText #mesquite.charMatrices.NoColor.NoColor ; setBackground White ; toggleShowNames on ; toggleShowTaxonNames on ; toggleTight off ; toggleThinRows off ; toggleShowChanges on ; toggleSeparateLines off ; toggleShowStates on ; toggleAutoWCharNames on ; toggleShowDefaultCharNames off ; toggleConstrainCW on ; setColumnWidth 16 ; toggleBirdsEye off ; toggleAllowAutosize on ; toggleColorsPanel off ; toggleDiagonal on ; setDiagonalHeight 80 ; toggleLinkedScrolling on ; toggleScrollLinkedTables off ; endTell ; showWindow ; getEmployee #mesquite.charMatrices.ColorCells.ColorCells ; tell It ; setColor Red ; removeColor off ; endTell ; getEmployee #mesquite.categ.StateNamesStrip.StateNamesStrip ; tell It ; showStrip off ; endTell ; getEmployee #mesquite.charMatrices.AnnotPanel.AnnotPanel ; tell It ; togglePanel off ; endTell ; getEmployee #mesquite.charMatrices.CharReferenceStrip.CharReferenceStrip ; tell It ; showStrip off ; endTell ; getEmployee #mesquite.charMatrices.QuickKeySelector.QuickKeySelector ; tell It ; autotabOff ; endTell ; getEmployee #mesquite.categ.SmallStateNamesEditor.SmallStateNamesEditor ; tell It ; panelOpen true ; endTell ; endTell ; endTell ; getEmployee #mesquite.charMatrices.ManageCharacters.ManageCharacters ; tell It ; showCharacters #5510595068374379090 #mesquite.lists.CharacterList.CharacterList ; tell It ; setData 0 ; getWindow ; tell It ; newAssistant #mesquite.lists.DefaultCharOrder.DefaultCharOrder ; newAssistant #mesquite.lists.CharListInclusion.CharListInclusion ; newAssistant #mesquite.lists.CharListPartition.CharListPartition ; newAssistant #mesquite.stochchar.CharListProbModels.CharListProbModels ; setExplanationSize 30 ; setAnnotationSize 20 ; setFontIncAnnot 0 ; setFontIncExp 0 ; setSize 1389 791 ; setLocation 96 36 ; setFont SanSerif ; setFontSize 10 ; getToolPalette ; tell It ; setTool mesquite.lists.CharacterList.CharacterListWindow.ibeam ; endTell ; endTell ; showWindow ; getEmployee #mesquite.lists.CharListAnnotPanel.CharListAnnotPanel ; tell It ; togglePanel off ; endTell ; endTell ; endTell ; endTell ; ENDBLOCK; BEGIN MESQUITECHARMODELS; ProbModelSet * UNTITLED = Mk1 (est.) : 1 - 77 ; ENDBLOCK; BEGIN PAUP; outgroup Sargocentron_vexillarium ; outgroup Polymixia_berndti ; outgroup Beryx_decadactylus ; ENDBLOCK; BEGIN TREES; Title Trees from "WhitlockMatrix" ; LINK Taxa = Taxa ; TRANSLATE 1 Sargocentron_vexillarium , 2 Beryx_decadactylus , 3 Polymixia_berndti , 4 Lateolabrax_japonicus , 5 Mioplosus_labricoides , 6 Priscacara_serrata , 7 Priscacara_liops , 8 Roccus_saxatilis , 9 Roccus_chrysops , 10 Morone_americana , 11 Morone_mississippiensis , 12 Dicentrarchus_labrax , 13 Lates_mariae , 14 Lates_calcarifer , 15 Siniperca , 16 Centropomus_parallelus , 17 Centropomus_undecimalis , 18 Mycteroperca_tigris , 19 Serranus_subligarius , 20 Macquaria_australasica , 21 Percichthys_trucha , 22 Lepomis_macrochirus , 23 Micropterus_dolomieu , 24 Perca_flavescens , 25 Stizostedion_vitreum , 26 Pseudaphritis_urvillii , 27 Niphon ; TREE UNTITLED+ = (1 , (2 , 3) , ((((((6 , ((8 , 9 , (11 , 10)) , 7)) , 12) , ((5 , 4) , (15 , 13))) , (17 , 16)) , (18 , 19) , (22 , 23)) , (21 , ((25 , 24) , 20)))) ; ENDBLOCK; RNeXML/inst/examples/geospiza.xml0000644000176200001440000001536413552353762016501 0ustar liggesusers RNeXML/inst/doc/0000755000176200001440000000000013614142014013035 5ustar liggesusersRNeXML/inst/doc/S4.html0000644000176200001440000004231413614142013014214 0ustar liggesusers The nexml S4 Object

The nexml S4 Object

Carl Boettiger

Scott Chamberlain

Rutger Vos

Hilmar Lapp

Understanding the nexml S4 object

The RNeXML package provides many convenient functions to add and extract information from nexml objects in the R environment without requiring the reader to understand the details of the NeXML data structure and making it less likely that a user will generate invalid NeXML syntax that could not be read by other parsers. The nexml object we have been using in all of the examples is built on R’s S4 mechanism. Advanced users may sometimes prefer to interact with the data structure more directly using R’s S4 class mechanism and subsetting methods. Many R users are more familiar with the S3 class mechanism (such as in the ape package phylo objects) rather than the S4 class mechanism used in phylogenetics packages such as ouch and phylobase. The phylobase vignette provides an excellent introduction to these data structures. Users already familiar with subsetting lists and other S3 objects in R are likely familiar with the use of the $ operator, such as phy$edge. S4 objects simply use an @ operator instead (but cannot be subset using numeric arguments such as phy[[1]] or named arguments such as phy[[“edge”]]).

The nexml object is an S4 object, as are all of its components (slots). Its hierarchical structure corresponds exactly with the XML tree of a NeXML file, with the single exception that both XML attributes and children are represented as slots.
S4 objects have constructor functions to initialize them. We create a new nexml object with the command:

We can see a list of slots contained in this object with

 [1] "version"            "generator"          "xsi:schemaLocation" "namespaces"         "otus"              
 [6] "trees"              "characters"         "meta"               "about"              "xsi:type"          

Some of these slots have already been populated for us, for instance, the schema version and default namespaces:

[1] "0.9"
                                             nex                                              xsi 
                     "http://www.nexml.org/2009"      "http://www.w3.org/2001/XMLSchema-instance" 
                                             xml                                             cdao 
          "http://www.w3.org/XML/1998/namespace"                "http://purl.obolibrary.org/obo/" 
                                             xsd                                               dc 
             "http://www.w3.org/2001/XMLSchema#"               "http://purl.org/dc/elements/1.1/" 
                                         dcterms                                            prism 
                     "http://purl.org/dc/terms/" "http://prismstandard.org/namespaces/1.2/basic/" 
                                              cc                                             ncbi 
                "http://creativecommons.org/ns#"          "http://www.ncbi.nlm.nih.gov/taxonomy#" 
                                              tc                                                  
 "http://rs.tdwg.org/ontology/voc/TaxonConcept#"                      "http://www.nexml.org/2009" 

Recognize that nex@namespaces serves the same role as get_namespaces function, but provides direct access to the slot data. For instance, with this syntax we could also overwrite the existing namespaces with nex@namespaces <- NULL. Changing the namespace in this way is not advised.

Some slots can contain multiple elements of the same type, such as trees, characters, and otus. For instance, we see that

[1] "ListOfcharacters"
attr(,"package")
[1] "RNeXML"

is an object of class ListOfcharacters, and is currently empty,

[1] 0

In order to assign an object to a slot, it must match the class definition of the slot. We can create a new element of any given class with the new function,

and now we have a length-1 list of character matrices,

[1] 1

and we access the first character matrix using the list notation, [[1]]. Here we check the class is a characters object.

[1] "characters"
attr(,"package")
[1] "RNeXML"

Direct subsetting has two primary use cases: (a) useful in looking up (and possibly editing) a specific value of an element, or (b) when adding metadata annotations to specific elements. Consider the example file

We can look up the species label of the first otu in the first otus block:

      label 
"species 1" 

We can add metadata to this particular OTU using this subsetting format

Here we use the c operator to append this element to any existing meta annotations to this otu.

RNeXML/inst/doc/intro.html0000644000176200001440000007426613614142013015074 0ustar liggesusers A Brief Introduction to RNeXML

A Brief Introduction to RNeXML

Carl Boettiger

Scott Chamberlain

Rutger Vos

Hilmar Lapp

Read in a nexml file:

Pretty-print an overview of the components and metadata that make up the nexml object:

## A nexml object representing:
##       1 phylogenetic tree block(s), where:
##     block 1 contains 1 phylogenetic tree(s) 
##       2 character block(s), where:
##     block 1 defines 1 continuous character(s) 
##     matrix 1 has 10 row(s)
##     block 2 defines 1 standard/discrete character(s), with 2 states each 
##      and  0 polymorphic or uncertain state(s) defined 
##     matrix 2 has 10 row(s) 
##       10 taxonomic units in 1 block(s) 
##   Taxa:   taxon_1, taxon_2, taxon_3, taxon_4, taxon_5, taxon_6 ...
##   Metadata annotations: 
##  2 at top level 
##  0 in block 1 at otu level 
##  0 in block 1 at char level
##  0 in block 2 at char level 
##  0 in block 1 at state level
##  0 in block 2 at state level
## 
## Author(s): rvosa
## 
## NeXML generated by Bio::Phylo::Project v.0.56 using schema version: 0.9 
## Size: 289.3 Kb

Create a summary object of various component and metadata counts (the show() method uses this):

## $nblocks
##      trees       otus characters 
##          1          1          2 
## 
## $ncharacters
## block.1 block.2 
##       1       1 
## 
## $nstates
##         block.1 block.2
## Min.         NA       2
## 1st Qu.      NA       2
## Median       NA       2
## Mean         NA       2
## 3rd Qu.      NA       2
## Max.         NA       2
## 
## $nnonstdstatedefs
##         polymorphic uncertain
## block.1          NA        NA
## block.2           0         0
## 
## $nmatrixrows
## block.1 block.2 
##      10      10 
## 
## $ntrees
## block.1 
##       1 
## 
## $notus
## block.1 
##      10 
## 
## $nmeta
## $nmeta$nexml
## [1] 2
## 
## $nmeta$otu
## block.1 
##       0 
## 
## $nmeta$char
## block.1 block.2 
##       0       0 
## 
## $nmeta$state
## block.1 block.2 
##       0       0

Extract trees from nexml into the ape::phylo format:

plot of chunk unnamed-chunk-5

plot of chunk unnamed-chunk-5

Write an ape::phylo tree into the nexml format:

## [1] "test.xml"

A key feature of NeXML is the ability to formally validate the construction of the data file against the standard (the lack of such a feature in nexus files had lead to inconsistencies across different software platforms, and some files that cannot be read at all). While it is difficult to make an invalid NeXML file from RNeXML, it never hurts to validate just to be sure:

## [1] TRUE

Extract metadata from the NeXML file:

##     otu            label xsi.type otus
## 1  ou37 Struthioniformes       NA  os3
## 2  ou38     Tinamiformes       NA  os3
## 3  ou39      Craciformes       NA  os3
## 4  ou40      Galliformes       NA  os3
## 5  ou41     Anseriformes       NA  os3
## 6  ou42    Turniciformes       NA  os3
## 7  ou43       Piciformes       NA  os3
## 8  ou44    Galbuliformes       NA  os3
## 9  ou45   Bucerotiformes       NA  os3
## 10 ou46      Upupiformes       NA  os3
## 11 ou47    Trogoniformes       NA  os3
## 12 ou48    Coraciiformes       NA  os3
## 13 ou49      Coliiformes       NA  os3
## 14 ou50     Cuculiformes       NA  os3
## 15 ou51   Psittaciformes       NA  os3
## 16 ou52      Apodiformes       NA  os3
## 17 ou53   Trochiliformes       NA  os3
## 18 ou54  Musophagiformes       NA  os3
## 19 ou55     Strigiformes       NA  os3
## 20 ou56    Columbiformes       NA  os3
## 21 ou57       Gruiformes       NA  os3
## 22 ou58    Ciconiiformes       NA  os3
## 23 ou59    Passeriformes       NA  os3
##           property   datatype                 content     xsi.type                                              href Meta
## 1       dc:creator xsd:string          Carl Boettiger  LiteralMeta                                              <NA> m278
## 2 dcterms:modified xsd:string 2020-01-28 23:24:19 GMT  LiteralMeta                                              <NA> m279
## 3       cc:license       <NA>                    <NA> ResourceMeta http://creativecommons.org/publicdomain/zero/1.0/ m280

Add basic additional metadata:

## [1] "meta_example.xml"

By default, RNeXML adds certain metadata, including the NCBI taxon id numbers for all named taxa. This acts a check on the spelling and definitions of the taxa as well as providing a link to additional metadata about each taxonomic unit described in the dataset.

Advanced annotation

We can also add arbitrary metadata to a NeXML tree by define meta objects:

Advanced use requires specifying the namespace used. Metadata follows the RDFa conventions. Here we indicate the modification date using the prism vocabulary. This namespace is included by default, as it is used for some of the basic metadata shown in the previous example. We can see from this list:

##                                              nex                                              xsi 
##                      "http://www.nexml.org/2009"      "http://www.w3.org/2001/XMLSchema-instance" 
##                                              xml                                             cdao 
##           "http://www.w3.org/XML/1998/namespace"                "http://purl.obolibrary.org/obo/" 
##                                              xsd                                               dc 
##              "http://www.w3.org/2001/XMLSchema#"               "http://purl.org/dc/elements/1.1/" 
##                                          dcterms                                            prism 
##                      "http://purl.org/dc/terms/" "http://prismstandard.org/namespaces/1.2/basic/" 
##                                               cc                                             ncbi 
##                 "http://creativecommons.org/ns#"          "http://www.ncbi.nlm.nih.gov/taxonomy#" 
##                                               tc 
##  "http://rs.tdwg.org/ontology/voc/TaxonConcept#"

This next block defines a resource (link), described by the rel attribute as a homepage, a term in the foaf vocabulary. Because foaf is not a default namespace, we will have to provide its URL in the full definition below.

Here we create a history node using the skos namespace. We can also add id values to any metadata element to make the element easier to reference externally:

For this kind of richer annotation, it is best to build up our NeXML object sequentially. First we will add bird.orders phylogeny to a new phylogenetic object, and then we will add the metadata elements created above to this object. Finally, we will write the object out as an XML file:

## [1] "example.xml"

Taxonomic identifiers

Add taxonomic identifier metadata to the OTU elements:

Working with character data

NeXML also provides a standard exchange format for handling character data. The R platform is particularly popular in the context of phylogenetic comparative methods, which consider both a given phylogeny and a set of traits. NeXML provides an ideal tool for handling this metadata.

Extracting character data

We can load the library, parse the NeXML file and extract both the characters and the phylogeny.

(Note that get_characters would return both discrete and continuous characters together in the same data.frame, but we use get_characters_list to get separate data.frames for the continuous characters block and the discrete characters block).

We can then fire up geiger and fit, say, a Brownian motion model the continuous data and a Markov transition matrix to the discrete states:

RNeXML/inst/doc/simmap.Rmd0000644000176200001440000001526213614141212014774 0ustar liggesusers--- title: "Extending NeXML: an example based on simmap" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette bibliography: references.bib --- ## Extending the NeXML standard through metadata annotation. Here we illustrate this process using the example of stochastic character mapping [@Huelsenbeck_2003]. A stochastic character map is simply an annotation of the branches on a phylogeny, assigning each section of each branch to a particular "state" (typically of a morphological characteristic). @Bollback_2006 provides a widely used stand-alone software implementation of this method in the software `simmap`, which modified the standard Newick tree format to express this additional information. This can break compatibility with other software, and creates a format that cannot be interpreted without additional information describing this convention. By contrast, the NeXML extension is not only backwards compatible but contains a precise and machine-readable description of what it is encoding. In this example, we illustrate how the additional information required to define a stochastic character mapping (a `simmap` mapping) in NeXML. @Revell_2012 describes the `phytools` package for R, which includes utilities for reading, manipulating, and writing `simmap` files in R. In this example, we also show how to define `RNeXML` functions that map the R representation used by Revell (an extension of the `ape` class) into the NeXML extension we have defined by using `RNeXML` functions. Since a stochastic character map simply assigns different states to parts of a branch (or edge) on the phylogenetic tree, we can create a NeXML representation by annotating the `edge` elements with appropriate `meta` elements. These elements need to describe the character state being assigned and the duration (in terms of branch-length) that the edge spends in that state (Stochastic character maps are specific to time-calibrated or ultrametric trees). NeXML already defines the `characters` element to handle discrete character traits (`nex:char`) and the states they can assume (`nex:state`). We will thus reuse the `characters` element for this purpose, referring to both the character trait and the states by the ids assigned to them in that element. (NeXML's convention of referring to everything by id permits a single canonical definition of each term, making it clear where additional annotation belongs). For each edge, we need to indicate: - That our annotation contains a stochastic character mapping reconstruction - Since many reconstructions are possible for a single edge, we give each reconstruction an id - We indicate for which character trait we are defining the reconstruction - We then indicate which states the character assumes on that edge. For each state realized on the edge, that involves stating: + the state assignment + the duration (length of time) for which the edge spends in the given state + the order in which the state changes happen (Though we could just assume state transitions are listed chronologically, NeXML suggests making all data explicit, rather than relying on the structure of the data file to convey information). Thus the annotation for an edge that switches from state `s2` to state `s1` of character `cr1` would be constructed like this: ```r m <- meta("simmap:reconstructions", children = c( meta("simmap:reconstruction", children = c( meta("simmap:char", "cr1"), meta("simmap:stateChange", children = c( meta("simmap:order", 1), meta("simmap:length", "0.2030"), meta("simmap:state", "s2"))), meta("simmap:char", "cr1"), meta("simmap:stateChange", children = c( meta("simmap:order", 2), meta("simmap:length", "0.0022"), meta("simmap:state", "s1"))) )))) ``` Of course writing out such a definition manually becomes tedious quickly. Because these are just R commands, we can easily define a function that can loop over an assignment like this for each edge, extracting the appropriate order, length and state from an existing R object such as that provided in the `phytools` package. Likewise, it is straightforward to define a function that reads this data using the `RNeXML` utilities and converts it back to the `phytools` package. The full implementation of this mapping can be seen in the `simmap_to_nexml()` and the `nexml_to_simmap()` functions provided in the `RNeXML` package. As the code indicates, the key step is simply to define the data in meta elements. In so doing, we have defined a custom namespace, `simmap`, to hold our variables. This allows us to provide a URL with more detailed descriptions of what each of these elements mean: ```r nex <- add_namespaces(c(simmap = "https://github.com/ropensci/RNeXML/tree/master/inst/simmap.md")) ``` At that URL we have posted a simple description of each term. Using this convention we can generate NeXML files containing `simmap` data, read those files into R, and convert them back into the `phytools` package format. These simple functions serve as further illustration of how `RNeXML` can be used to extend the NeXML standard. We illustrate their use briefly here, starting with loading a `nexml` object containing a `simmap` reconstruction into R: ```r f <- system.file("examples", "simmap_ex.xml", package = "RNeXML") simmap_ex <- read.nexml(f) ``` The `get_trees()` function can be used to return an `ape::phylo` tree as usual. `RNeXML` automatically detects the `simmap` reconstruction data and returns includes this in a `maps` element of the `ape::phylo` object, for use with other `phytools` functions. ```r phy <- nexml_to_simmap(simmap_ex) ``` We can then use various functions from `phytools` designed for `simmap` objects [@Revell_2012], such as the plotting function: ```r library("phytools") plotSimmap(phy) ``` ``` no colors provided. using the following legend: A B C "black" "red" "green3" ``` ![Stochastic character mapping on a phylogeny, as generated by the phytools package after parsing the simmap-extended NeXML.](simmap-Figure1-1.png) Likewise, we can convert the object back in the NeXML format and write it out to file to be read by other users. ```r nex <- simmap_to_nexml(phy) nexml_write(nex, "simmap.xml") ``` ``` [1] "simmap.xml" ``` Though other NeXML parsers (for instance, for Perl or Python) have not been written explicitly to express `simmap` data, those parsers will nonetheless be able to successfully parse this file and expose the `simmap` data to the user. RNeXML/inst/doc/intro.Rmd0000644000176200001440000002335613614141247014654 0ustar liggesusers--- title: "A Brief Introduction to RNeXML" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- Read in a `nexml` file: ```r f <- system.file("examples", "comp_analysis.xml", package="RNeXML") nexml <- nexml_read(f) ``` Pretty-print an overview of the components and metadata that make up the nexml object: ```r nexml # this is the same as show(nexml) ``` ``` ## A nexml object representing: ## 1 phylogenetic tree block(s), where: ## block 1 contains 1 phylogenetic tree(s) ## 2 character block(s), where: ## block 1 defines 1 continuous character(s) ## matrix 1 has 10 row(s) ## block 2 defines 1 standard/discrete character(s), with 2 states each ## and 0 polymorphic or uncertain state(s) defined ## matrix 2 has 10 row(s) ## 10 taxonomic units in 1 block(s) ## Taxa: taxon_1, taxon_2, taxon_3, taxon_4, taxon_5, taxon_6 ... ## Metadata annotations: ## 2 at top level ## 0 in block 1 at otu level ## 0 in block 1 at char level ## 0 in block 2 at char level ## 0 in block 1 at state level ## 0 in block 2 at state level ## ## Author(s): rvosa ## ## NeXML generated by Bio::Phylo::Project v.0.56 using schema version: 0.9 ## Size: 289.3 Kb ``` Create a summary object of various component and metadata counts (the `show()` method uses this): ```r summary(nexml) ``` ``` ## $nblocks ## trees otus characters ## 1 1 2 ## ## $ncharacters ## block.1 block.2 ## 1 1 ## ## $nstates ## block.1 block.2 ## Min. NA 2 ## 1st Qu. NA 2 ## Median NA 2 ## Mean NA 2 ## 3rd Qu. NA 2 ## Max. NA 2 ## ## $nnonstdstatedefs ## polymorphic uncertain ## block.1 NA NA ## block.2 0 0 ## ## $nmatrixrows ## block.1 block.2 ## 10 10 ## ## $ntrees ## block.1 ## 1 ## ## $notus ## block.1 ## 10 ## ## $nmeta ## $nmeta$nexml ## [1] 2 ## ## $nmeta$otu ## block.1 ## 0 ## ## $nmeta$char ## block.1 block.2 ## 0 0 ## ## $nmeta$state ## block.1 block.2 ## 0 0 ``` Extract trees from nexml into the `ape::phylo` format: ```r tr <- get_trees(nexml) # or: as(nexml, "phylo") plot(tr) ``` ![plot of chunk unnamed-chunk-5](intro-unnamed-chunk-5-1.png) Write an `ape::phylo` tree into the `nexml` format: ```r data(bird.orders) nexml_write(bird.orders, "test.xml", creator = "Carl Boettiger") ``` ``` ## [1] "test.xml" ``` A key feature of NeXML is the ability to formally validate the construction of the data file against the standard (the lack of such a feature in nexus files had lead to inconsistencies across different software platforms, and some files that cannot be read at all). While it is difficult to make an invalid NeXML file from `RNeXML`, it never hurts to validate just to be sure: ```r nexml_validate("test.xml") ``` ``` ## [1] TRUE ``` Extract metadata from the NeXML file: ```r birds <- nexml_read("test.xml") get_taxa(birds) ``` ``` ## otu label xsi.type otus ## 1 ou37 Struthioniformes NA os3 ## 2 ou38 Tinamiformes NA os3 ## 3 ou39 Craciformes NA os3 ## 4 ou40 Galliformes NA os3 ## 5 ou41 Anseriformes NA os3 ## 6 ou42 Turniciformes NA os3 ## 7 ou43 Piciformes NA os3 ## 8 ou44 Galbuliformes NA os3 ## 9 ou45 Bucerotiformes NA os3 ## 10 ou46 Upupiformes NA os3 ## 11 ou47 Trogoniformes NA os3 ## 12 ou48 Coraciiformes NA os3 ## 13 ou49 Coliiformes NA os3 ## 14 ou50 Cuculiformes NA os3 ## 15 ou51 Psittaciformes NA os3 ## 16 ou52 Apodiformes NA os3 ## 17 ou53 Trochiliformes NA os3 ## 18 ou54 Musophagiformes NA os3 ## 19 ou55 Strigiformes NA os3 ## 20 ou56 Columbiformes NA os3 ## 21 ou57 Gruiformes NA os3 ## 22 ou58 Ciconiiformes NA os3 ## 23 ou59 Passeriformes NA os3 ``` ```r get_metadata(birds) ``` ``` ## property datatype content xsi.type href Meta ## 1 dc:creator xsd:string Carl Boettiger LiteralMeta m278 ## 2 dcterms:modified xsd:string 2020-01-28 23:24:19 GMT LiteralMeta m279 ## 3 cc:license ResourceMeta http://creativecommons.org/publicdomain/zero/1.0/ m280 ``` -------------------------------------------- Add basic additional metadata: ```r nexml_write(bird.orders, file="meta_example.xml", title = "My test title", description = "A description of my test", creator = "Carl Boettiger ", publisher = "unpublished data", pubdate = "2012-04-01") ``` ``` ## [1] "meta_example.xml" ``` By default, `RNeXML` adds certain metadata, including the NCBI taxon id numbers for all named taxa. This acts a check on the spelling and definitions of the taxa as well as providing a link to additional metadata about each taxonomic unit described in the dataset. ### Advanced annotation We can also add arbitrary metadata to a NeXML tree by define `meta` objects: ```r modified <- meta(property = "prism:modificationDate", content = "2013-10-04") ``` Advanced use requires specifying the namespace used. Metadata follows the RDFa conventions. Here we indicate the modification date using the prism vocabulary. This namespace is included by default, as it is used for some of the basic metadata shown in the previous example. We can see from this list: ```r RNeXML:::nexml_namespaces ``` ``` ## nex xsi ## "http://www.nexml.org/2009" "http://www.w3.org/2001/XMLSchema-instance" ## xml cdao ## "http://www.w3.org/XML/1998/namespace" "http://purl.obolibrary.org/obo/" ## xsd dc ## "http://www.w3.org/2001/XMLSchema#" "http://purl.org/dc/elements/1.1/" ## dcterms prism ## "http://purl.org/dc/terms/" "http://prismstandard.org/namespaces/1.2/basic/" ## cc ncbi ## "http://creativecommons.org/ns#" "http://www.ncbi.nlm.nih.gov/taxonomy#" ## tc ## "http://rs.tdwg.org/ontology/voc/TaxonConcept#" ``` This next block defines a resource (link), described by the `rel` attribute as a homepage, a term in the `foaf` vocabulary. Because `foaf` is not a default namespace, we will have to provide its URL in the full definition below. ```r website <- meta(href = "http://carlboettiger.info", rel = "foaf:homepage") ``` Here we create a history node using the `skos` namespace. We can also add id values to any metadata element to make the element easier to reference externally: ```r history <- meta(property = "skos:historyNote", content = "Mapped from the bird.orders data in the ape package using RNeXML", id = "meta123") ``` For this kind of richer annotation, it is best to build up our NeXML object sequentially. First we will add `bird.orders` phylogeny to a new phylogenetic object, and then we will add the metadata elements created above to this object. Finally, we will write the object out as an XML file: ```r birds <- add_trees(bird.orders) birds <- add_meta(meta = list(history, modified, website), namespaces = c(skos = "http://www.w3.org/2004/02/skos/core#", foaf = "http://xmlns.com/foaf/0.1/"), nexml=birds) nexml_write(birds, file = "example.xml") ``` ``` ## [1] "example.xml" ``` ### Taxonomic identifiers Add taxonomic identifier metadata to the OTU elements: ```r nex <- add_trees(bird.orders) nex <- taxize_nexml(nex) ``` ## Working with character data NeXML also provides a standard exchange format for handling character data. The R platform is particularly popular in the context of phylogenetic comparative methods, which consider both a given phylogeny and a set of traits. NeXML provides an ideal tool for handling this metadata. ### Extracting character data We can load the library, parse the NeXML file and extract both the characters and the phylogeny. ```r library(RNeXML) nexml <- read.nexml(system.file("examples", "comp_analysis.xml", package="RNeXML")) traits <- get_characters(nexml) tree <- get_trees(nexml) ``` (Note that `get_characters` would return both discrete and continuous characters together in the same data.frame, but we use `get_characters_list` to get separate data.frames for the continuous `characters` block and the discrete `characters` block). We can then fire up `geiger` and fit, say, a Brownian motion model the continuous data and a Markov transition matrix to the discrete states: ```r library(geiger) fitContinuous(tree, traits[1], ncores=1) fitDiscrete(tree, traits[2], ncores=1) ``` RNeXML/inst/doc/metadata.Rmd0000644000176200001440000026112313614125724015277 0ustar liggesusers--- title: "Handling Metadata in RNeXML" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- ## Writing NeXML metadata The `add_basic_meta()` function takes as input an existing `nexml` object (like the other `add_` functions, if none is provided it will create one), and at the time of this writing any of the following parameters: `title`, `description`, `creator`, `pubdate`, `rights`, `publisher`, `citation`. Other metadata elements and corresponding parameters may be added in the future. Load the packages and data: ```r library('RNeXML') data(bird.orders) ``` Create an `nexml` object for the phylogeny `bird.orders` and add appropriate metadata: ```r birds <- add_trees(bird.orders) birds <- add_basic_meta( title = "Phylogeny of the Orders of Birds From Sibley and Ahlquist", description = "This data set describes the phylogenetic relationships of the orders of birds as reported by Sibley and Ahlquist (1990). Sibley and Ahlquist inferred this phylogeny from an extensive number of DNA/DNA hybridization experiments. The ``tapestry'' reported by these two authors (more than 1000 species out of the ca. 9000 extant bird species) generated a lot of debates. The present tree is based on the relationships among orders. The branch lengths were calculated from the values of Delta T50H as found in Sibley and Ahlquist (1990, fig. 353).", citation = "Sibley, C. G. and Ahlquist, J. E. (1990) Phylogeny and classification of birds: a study in molecular evolution. New Haven: Yale University Press.", creator = "Sibley, C. G. and Ahlquist, J. E.", nexml=birds) ``` Instead of a literal string, citations can also be provided in R's `bibentry` type, which is the one in which R package citations are obtained: ```r birds <- add_basic_meta(citation = citation("ape"), nexml = birds) ``` ## Taxonomic identifiers RNeXML now uses `taxald` for fast look-up of taxonomic information. If a unique match is found, a metadata annotation is added to the taxon providing the unique URI to the taxonomic unit. ```r birds <- taxize_nexml(birds, "NCBI") ``` If no perfect match is found, the user is warned to check for possible typographic errors in the taxonomic labels provided. ## Custom metadata extensions We can get a list of namespaces along with their prefixes from the `nexml` object: ```r prefixes <- get_namespaces(birds) prefixes["dc"] ``` ``` dc "http://purl.org/dc/elements/1.1/" ``` We create a `meta` element containing this annotation using the `meta` function: ```r modified <- meta(property = "prism:modificationDate", content = "2013-10-04") ``` We can add this annotation to our existing `birds` NeXML file using the `add_meta()` function. Because we do not specify a level, it is added to the root node, referring to the NeXML file as a whole. ```r birds <- add_meta(modified, birds) ``` The built-in vocabularies are just the tip of the iceberg of established vocabularies. Here we add an annotation from the `skos` namespace which describes the history of where the data comes from: ```r history <- meta(property = "skos:historyNote", content = "Mapped from the bird.orders data in the ape package using RNeXML") ``` Because `skos` is not in the current namespace list, we add it with a url when adding this meta element. We also specify that this annotation be placed at the level of the `trees` sub-node in the NeXML file. ```r birds <- add_meta(history, birds, level = "trees", namespaces = c(skos = "http://www.w3.org/2004/02/skos/core#")) ``` For finer control of the level at which a `meta` element is added, we will manipulate the `nexml` R object directly using S4 sub-setting, as shown in the supplement. Much richer metadata annotation is possible. Later we illustrate how metadata annotation can be used to extend the base NeXML format to represent new forms of data while maintaining compatibility with any NeXML parser. The `RNeXML` package can be easily extended to support helper functions such as `taxize_nexml` to add additional metadata without imposing a large burden on the user. ## Reading NeXML metadata A call to the `nexml` object prints some metadata summarizing the data structure: ```r birds ``` ``` A nexml object representing: 1 phylogenetic tree block(s), where: block 1 contains 1 phylogenetic tree(s) 0 character block(s), 23 taxonomic units in 1 block(s) Taxa: Struthioniformes, Tinamiformes, Craciformes, Galliformes, Anseriformes, Turniciformes ... Metadata annotations: 18 at top level 0 in block 1 at otu level This data set describes the phylogenetic relationships of the orders of birds as reported by Sibley and Ahlquist (1990). Sibley and Ahlquist inferred this phylogeny from an extensive number of DNA/DNA hybridization experiments. The ``tapestry'' reported by these two authors (more than 1000 species out of the ca. 9000 extant bird species) generated a lot of debates. The present tree is based on the relationships among orders. The branch lengths were calculated from the values of Delta T50H as found in Sibley and Ahlquist (1990, fig. 353). Author(s): Sibley, C. G. and Ahlquist, J. E., cboettig License: http://creativecommons.org/publicdomain/zero/1.0/ NeXML generated by RNeXML using schema version: 0.9 Size: 358.3 Kb ``` We can extract all metadata pertaining to the NeXML document as a whole (annotations of the XML root node, ``) with the command ```r meta <- get_metadata(birds) ``` This returns a data.frame of available metadata. We can see the kinds of metadata recorded from the names: ```r meta ``` ``` property datatype 1 dc:title xsd:string 2 dc:creator xsd:string 3 dc:description xsd:string 4 cc:license 5 dcterms:bibliographicCitation xsd:string 6 dc:creator xsd:string 7 dcterms:references 8 prism:modificationDate xsd:string 9 prism:volume xsd:string 10 dc:publisher xsd:string 11 prism:publicationName xsd:string 12 prism:endingPage xsd:string 13 prism:startingPage xsd:string 14 prism:publicationDate xsd:string 15 dc:title xsd:string 16 dc:contributor xsd:string 17 dc:contributor xsd:string 18 dcterms:bibliographicCitation xsd:string content 1 Phylogeny of the Orders of Birds From Sibley and Ahlquist 2 Sibley, C. G. and Ahlquist, J. E. 3 This data set describes the phylogenetic relationships of the\n orders of birds as reported by Sibley and Ahlquist (1990). Sibley\n and Ahlquist inferred this phylogeny from an extensive number of\n DNA/DNA hybridization experiments. The ``tapestry'' reported by\n these two authors (more than 1000 species out of the ca. 9000\n extant bird species) generated a lot of debates.\n\n The present tree is based on the relationships among orders. The\n branch lengths were calculated from the values of Delta T50H as\n found in Sibley and Ahlquist (1990, fig. 353). 4 5 Sibley, C. G. and Ahlquist, J. E. (1990) Phylogeny and\n classification of birds: a study in molecular evolution. New\n Haven: Yale University Press. 6 cboettig 7 8 2013-10-04 9 35 10 Bioinformatics 11 Bioinformatics 12 528 13 526 14 2018 15 ape 5.0: an environment for modern phylogenetics and evolutionary analyses in {R} 16 E. Paradis 17 K. Schliep 18 Paradis E, Schliep K (2018). "ape 5.0: an environment for modern phylogenetics and evolutionary analyses in R."\n_Bioinformatics_, *35*, 526-528. xsi.type href Meta meta 1 LiteralMeta m544 2 LiteralMeta m545 3 LiteralMeta m546 4 ResourceMeta http://creativecommons.org/publicdomain/zero/1.0/ m547 5 LiteralMeta m548 6 LiteralMeta m549 7 ResourceMeta m560 8 LiteralMeta m561 9 LiteralMeta m560 10 LiteralMeta m560 11 LiteralMeta m560 12 LiteralMeta m560 13 LiteralMeta m560 14 LiteralMeta m560 15 LiteralMeta m560 16 LiteralMeta m560 17 LiteralMeta m560 18 LiteralMeta m560 ``` We can also access a table of taxonomic metadata: ```r get_taxa(birds) ``` ``` otu label xsi.type otus 1 ou362 Struthioniformes NA os8 2 ou363 Tinamiformes NA os8 3 ou364 Craciformes NA os8 4 ou365 Galliformes NA os8 5 ou366 Anseriformes NA os8 6 ou367 Turniciformes NA os8 7 ou368 Piciformes NA os8 8 ou369 Galbuliformes NA os8 9 ou370 Bucerotiformes NA os8 10 ou371 Upupiformes NA os8 11 ou372 Trogoniformes NA os8 12 ou373 Coraciiformes NA os8 13 ou374 Coliiformes NA os8 14 ou375 Cuculiformes NA os8 15 ou376 Psittaciformes NA os8 16 ou377 Apodiformes NA os8 17 ou378 Trochiliformes NA os8 18 ou379 Musophagiformes NA os8 19 ou380 Strigiformes NA os8 20 ou381 Columbiformes NA os8 21 ou382 Gruiformes NA os8 22 ou383 Ciconiiformes NA os8 23 ou384 Passeriformes NA os8 ``` Which returns text from the otu element labels, typically used to define taxonomic names, rather than text from explicit meta elements. We can also access metadata at a specific level (or use `level=all` to extract all meta elements in a list). Here we show only the first few results: ```r otu_meta <- get_metadata(birds, level="otus/otu") otu_meta ``` ``` # A tibble: 0 x 3 # … with 3 variables: otu , otus , Meta ``` ## Merging metadata tables We often want to combine metadata from multiple tables. For instance, in this exercise we want to include the taxonomic identifier and id value for each species returned in the character table. This helps us more precisely identify the species whose traits are described by the table. ```r library("RNeXML") library("dplyr") library("geiger") ``` To begin, let's generate a `NeXML` file using the tree and trait data from the `geiger` package's "primates" data: ```r data("primates") add_trees(primates$phy) %>% add_characters(primates$dat, ., append=TRUE) %>% taxize_nexml("itis") -> nex ``` (Note that we've used `dplyr`'s cute pipe syntax, but unfortunately our `add_` methods take the `nexml` object as the _second_ argument instead of the first, so this isn't as elegant since we need the stupid `.` to show where the piped output should go...) We now read in the three tables of interest. Note that we tell `get_characters` to give us species labels as there own column, rather than as rownames. The latter is the default only because this plays more nicely with the default format for character matrices that is expected by `geiger` and other phylogenetics packages, but is in general a silly choice for data manipulation. ```r otu_meta <- get_metadata(nex, "otus/otu") taxa <- get_taxa(nex) char <- get_characters(nex, rownames_as_col = TRUE) ``` We can take a peek at what the tables look like, just to orient ourselves: ```r otu_meta ``` ``` property href xsi.type otu otus 1 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572992 ResourceMeta ou385 os9 2 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572857 ResourceMeta ou386 os9 3 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572935 ResourceMeta ou387 os9 4 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572936 ResourceMeta ou388 os9 5 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945168 ResourceMeta ou389 os9 6 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945164 ResourceMeta ou390 os9 7 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572939 ResourceMeta ou391 os9 8 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572940 ResourceMeta ou392 os9 9 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572941 ResourceMeta ou393 os9 10 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572942 ResourceMeta ou394 os9 11 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944172 ResourceMeta ou395 os9 12 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572944 ResourceMeta ou396 os9 13 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949 ResourceMeta ou397 os9 14 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945149 ResourceMeta ou398 os9 15 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949 ResourceMeta ou399 os9 16 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572947 ResourceMeta ou400 os9 17 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572945 ResourceMeta ou401 os9 18 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572946 ResourceMeta ou402 os9 19 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572951 ResourceMeta ou403 os9 20 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572952 ResourceMeta ou404 os9 21 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572887 ResourceMeta ou405 os9 22 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572888 ResourceMeta ou406 os9 23 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572954 ResourceMeta ou407 os9 24 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572955 ResourceMeta ou408 os9 25 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572957 ResourceMeta ou409 os9 26 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572958 ResourceMeta ou410 os9 27 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572956 ResourceMeta ou411 os9 28 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572953 ResourceMeta ou412 os9 29 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572881 ResourceMeta ou413 os9 30 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572959 ResourceMeta ou414 os9 31 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572983 ResourceMeta ou415 os9 32 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572984 ResourceMeta ou416 os9 33 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025131 ResourceMeta ou417 os9 34 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134 ResourceMeta ou418 os9 35 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025122 ResourceMeta ou419 os9 36 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025127 ResourceMeta ou420 os9 37 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025112 ResourceMeta ou421 os9 38 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134 ResourceMeta ou422 os9 39 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025125 ResourceMeta ou423 os9 40 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025116 ResourceMeta ou424 os9 41 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025119 ResourceMeta ou425 os9 42 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025114 ResourceMeta ou426 os9 43 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025115 ResourceMeta ou427 os9 44 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572962 ResourceMeta ou428 os9 45 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025106 ResourceMeta ou429 os9 46 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572909 ResourceMeta ou430 os9 47 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944125 ResourceMeta ou431 os9 48 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572911 ResourceMeta ou432 os9 49 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572912 ResourceMeta ou433 os9 50 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572913 ResourceMeta ou434 os9 51 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944138 ResourceMeta ou435 os9 52 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572915 ResourceMeta ou436 os9 53 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572916 ResourceMeta ou437 os9 54 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572918 ResourceMeta ou438 os9 55 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944123 ResourceMeta ou439 os9 56 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572975 ResourceMeta ou440 os9 57 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944156 ResourceMeta ou441 os9 58 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572977 ResourceMeta ou442 os9 59 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572978 ResourceMeta ou443 os9 60 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572993 ResourceMeta ou444 os9 61 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572994 ResourceMeta ou445 os9 62 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572995 ResourceMeta ou446 os9 63 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572996 ResourceMeta ou447 os9 64 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572997 ResourceMeta ou448 os9 65 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572998 ResourceMeta ou449 os9 66 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572999 ResourceMeta ou450 os9 67 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573000 ResourceMeta ou451 os9 68 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573001 ResourceMeta ou452 os9 69 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573002 ResourceMeta ou453 os9 70 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573003 ResourceMeta ou454 os9 71 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944219 ResourceMeta ou455 os9 72 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573005 ResourceMeta ou456 os9 73 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573006 ResourceMeta ou457 os9 74 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573007 ResourceMeta ou458 os9 75 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573008 ResourceMeta ou459 os9 76 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573009 ResourceMeta ou460 os9 77 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573010 ResourceMeta ou461 os9 78 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945227 ResourceMeta ou462 os9 79 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573014 ResourceMeta ou463 os9 80 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944221 ResourceMeta ou464 os9 81 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573011 ResourceMeta ou465 os9 82 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572858 ResourceMeta ou466 os9 83 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572859 ResourceMeta ou467 os9 84 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572985 ResourceMeta ou468 os9 85 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572986 ResourceMeta ou469 os9 86 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=552515 ResourceMeta ou470 os9 87 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573035 ResourceMeta ou471 os9 88 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573036 ResourceMeta ou472 os9 89 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573037 ResourceMeta ou473 os9 90 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573038 ResourceMeta ou474 os9 91 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572886 ResourceMeta ou475 os9 92 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573015 ResourceMeta ou476 os9 93 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572865 ResourceMeta ou477 os9 94 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572864 ResourceMeta ou478 os9 95 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572866 ResourceMeta ou479 os9 96 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572867 ResourceMeta ou480 os9 97 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572868 ResourceMeta ou481 os9 98 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572893 ResourceMeta ou482 os9 99 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572894 ResourceMeta ou483 os9 100 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944100 ResourceMeta ou484 os9 101 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572896 ResourceMeta ou485 os9 102 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572897 ResourceMeta ou486 os9 103 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572898 ResourceMeta ou487 os9 104 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572899 ResourceMeta ou488 os9 105 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572900 ResourceMeta ou489 os9 106 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025177 ResourceMeta ou490 os9 107 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573080 ResourceMeta ou491 os9 108 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572869 ResourceMeta ou492 os9 109 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572870 ResourceMeta ou493 os9 110 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944072 ResourceMeta ou494 os9 111 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180092 ResourceMeta ou495 os9 112 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573069 ResourceMeta ou496 os9 113 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944286 ResourceMeta ou497 os9 114 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944292 ResourceMeta ou498 os9 115 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945338 ResourceMeta ou499 os9 116 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573073 ResourceMeta ou500 os9 117 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573074 ResourceMeta ou501 os9 118 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944290 ResourceMeta ou502 os9 119 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573076 ResourceMeta ou503 os9 120 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573077 ResourceMeta ou504 os9 121 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573078 ResourceMeta ou505 os9 122 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944293 ResourceMeta ou506 os9 123 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572882 ResourceMeta ou507 os9 124 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572961 ResourceMeta ou508 os9 125 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944187 ResourceMeta ou509 os9 126 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572872 ResourceMeta ou510 os9 127 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572921 ResourceMeta ou511 os9 128 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572920 ResourceMeta ou513 os9 129 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572922 ResourceMeta ou514 os9 130 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572874 ResourceMeta ou515 os9 131 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572875 ResourceMeta ou516 os9 132 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572876 ResourceMeta ou517 os9 133 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572877 ResourceMeta ou518 os9 134 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572878 ResourceMeta ou519 os9 135 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572879 ResourceMeta ou520 os9 136 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572880 ResourceMeta ou521 os9 137 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573016 ResourceMeta ou522 os9 138 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572889 ResourceMeta ou523 os9 139 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573017 ResourceMeta ou524 os9 140 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573018 ResourceMeta ou525 os9 141 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573019 ResourceMeta ou526 os9 142 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180098 ResourceMeta ou527 os9 143 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=555659 ResourceMeta ou528 os9 144 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573020 ResourceMeta ou529 os9 145 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180099 ResourceMeta ou530 os9 146 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573021 ResourceMeta ou531 os9 147 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573022 ResourceMeta ou532 os9 148 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573023 ResourceMeta ou533 os9 149 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573024 ResourceMeta ou534 os9 150 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573025 ResourceMeta ou535 os9 151 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573026 ResourceMeta ou536 os9 152 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573027 ResourceMeta ou537 os9 153 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573028 ResourceMeta ou538 os9 154 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573029 ResourceMeta ou539 os9 155 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573030 ResourceMeta ou540 os9 156 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573031 ResourceMeta ou541 os9 157 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944041 ResourceMeta ou542 os9 158 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572861 ResourceMeta ou543 os9 159 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572862 ResourceMeta ou544 os9 160 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573032 ResourceMeta ou545 os9 161 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944263 ResourceMeta ou546 os9 162 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573040 ResourceMeta ou547 os9 163 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572890 ResourceMeta ou548 os9 164 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572891 ResourceMeta ou549 os9 165 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572902 ResourceMeta ou550 os9 166 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572903 ResourceMeta ou551 os9 Meta 1 m563 2 m564 3 m565 4 m566 5 m567 6 m568 7 m569 8 m570 9 m571 10 m572 11 m573 12 m574 13 m575 14 m576 15 m577 16 m578 17 m579 18 m580 19 m581 20 m582 21 m583 22 m584 23 m585 24 m586 25 m587 26 m588 27 m589 28 m590 29 m591 30 m592 31 m593 32 m594 33 m595 34 m596 35 m597 36 m598 37 m599 38 m600 39 m601 40 m602 41 m603 42 m604 43 m605 44 m606 45 m607 46 m608 47 m609 48 m610 49 m611 50 m612 51 m613 52 m614 53 m615 54 m616 55 m617 56 m618 57 m619 58 m620 59 m621 60 m622 61 m623 62 m624 63 m625 64 m626 65 m627 66 m628 67 m629 68 m630 69 m631 70 m632 71 m633 72 m634 73 m635 74 m636 75 m637 76 m638 77 m639 78 m640 79 m641 80 m642 81 m643 82 m644 83 m645 84 m646 85 m647 86 m648 87 m649 88 m650 89 m651 90 m652 91 m653 92 m654 93 m655 94 m656 95 m657 96 m658 97 m659 98 m660 99 m661 100 m662 101 m663 102 m664 103 m665 104 m666 105 m667 106 m668 107 m669 108 m670 109 m671 110 m672 111 m673 112 m674 113 m675 114 m676 115 m677 116 m678 117 m679 118 m680 119 m681 120 m682 121 m683 122 m684 123 m685 124 m686 125 m687 126 m688 127 m689 128 m690 129 m691 130 m692 131 m693 132 m694 133 m695 134 m696 135 m697 136 m698 137 m699 138 m700 139 m701 140 m702 141 m703 142 m704 143 m705 144 m706 145 m707 146 m708 147 m709 148 m710 149 m711 150 m712 151 m713 152 m714 153 m715 154 m716 155 m717 156 m718 157 m719 158 m720 159 m721 160 m722 161 m723 162 m724 163 m725 164 m726 165 m727 166 m728 [ reached 'max' / getOption("max.print") -- omitted 66 rows ] ``` ```r taxa ``` ``` otu label xsi.type otus 1 ou385 Allenopithecus_nigroviridis NA os9 2 ou386 Allocebus_trichotis NA os9 3 ou387 Alouatta_belzebul NA os9 4 ou388 Alouatta_caraya NA os9 5 ou389 Alouatta_coibensis NA os9 6 ou390 Alouatta_fusca NA os9 7 ou391 Alouatta_palliata NA os9 8 ou392 Alouatta_pigra NA os9 9 ou393 Alouatta_sara NA os9 10 ou394 Alouatta_seniculus NA os9 11 ou395 Aotus_azarai NA os9 12 ou396 Aotus_brumbacki NA os9 13 ou397 Aotus_hershkovitzi NA os9 14 ou398 Aotus_infulatus NA os9 15 ou399 Aotus_lemurinus NA os9 16 ou400 Aotus_miconax NA os9 17 ou401 Aotus_nancymaae NA os9 18 ou402 Aotus_nigriceps NA os9 19 ou403 Aotus_trivirgatus NA os9 20 ou404 Aotus_vociferans NA os9 21 ou405 Arctocebus_aureus NA os9 22 ou406 Arctocebus_calabarensis NA os9 23 ou407 Ateles_belzebuth NA os9 24 ou408 Ateles_chamek NA os9 25 ou409 Ateles_fusciceps NA os9 26 ou410 Ateles_geoffroyi NA os9 27 ou411 Ateles_marginatus NA os9 28 ou412 Ateles_paniscus NA os9 29 ou413 Avahi_laniger NA os9 30 ou414 Brachyteles_arachnoides NA os9 31 ou415 Cacajao_calvus NA os9 32 ou416 Cacajao_melanocephalus NA os9 33 ou417 Callicebus_brunneus NA os9 34 ou418 Callicebus_caligatus NA os9 35 ou419 Callicebus_cinerascens NA os9 36 ou420 Callicebus_cupreus NA os9 37 ou421 Callicebus_donacophilus NA os9 38 ou422 Callicebus_dubius NA os9 39 ou423 Callicebus_hoffmannsi NA os9 40 ou424 Callicebus_modestus NA os9 41 ou425 Callicebus_moloch NA os9 42 ou426 Callicebus_oenanthe NA os9 43 ou427 Callicebus_olallae NA os9 44 ou428 Callicebus_personatus NA os9 45 ou429 Callicebus_torquatus NA os9 46 ou430 Callimico_goeldii NA os9 47 ou431 Callithrix_argentata NA os9 48 ou432 Callithrix_aurita NA os9 49 ou433 Callithrix_flaviceps NA os9 50 ou434 Callithrix_geoffroyi NA os9 51 ou435 Callithrix_humeralifera NA os9 52 ou436 Callithrix_jacchus NA os9 53 ou437 Callithrix_kuhlii NA os9 54 ou438 Callithrix_penicillata NA os9 55 ou439 Callithrix_pygmaea NA os9 56 ou440 Cebus_albifrons NA os9 57 ou441 Cebus_apella NA os9 58 ou442 Cebus_capucinus NA os9 59 ou443 Cebus_olivaceus NA os9 60 ou444 Cercocebus_agilis NA os9 61 ou445 Cercocebus_galeritus NA os9 62 ou446 Cercocebus_torquatus NA os9 63 ou447 Cercopithecus_ascanius NA os9 64 ou448 Cercopithecus_campbelli NA os9 65 ou449 Cercopithecus_cephus NA os9 66 ou450 Cercopithecus_diana NA os9 67 ou451 Cercopithecus_dryas NA os9 68 ou452 Cercopithecus_erythrogaster NA os9 69 ou453 Cercopithecus_erythrotis NA os9 70 ou454 Cercopithecus_hamlyni NA os9 71 ou455 Cercopithecus_lhoesti NA os9 72 ou456 Cercopithecus_mitis NA os9 73 ou457 Cercopithecus_mona NA os9 74 ou458 Cercopithecus_neglectus NA os9 75 ou459 Cercopithecus_nictitans NA os9 76 ou460 Cercopithecus_petaurista NA os9 77 ou461 Cercopithecus_pogonias NA os9 78 ou462 Cercopithecus_preussi NA os9 79 ou463 Cercopithecus_sclateri NA os9 80 ou464 Cercopithecus_solatus NA os9 81 ou465 Cercopithecus_wolfi NA os9 82 ou466 Cheirogaleus_major NA os9 83 ou467 Cheirogaleus_medius NA os9 84 ou468 Chiropotes_albinasus NA os9 85 ou469 Chiropotes_satanas NA os9 86 ou470 Chlorocebus_aethiops NA os9 87 ou471 Colobus_angolensis NA os9 88 ou472 Colobus_guereza NA os9 89 ou473 Colobus_polykomos NA os9 90 ou474 Colobus_satanas NA os9 91 ou475 Daubentonia_madagascariensis NA os9 92 ou476 Erythrocebus_patas NA os9 93 ou477 Eulemur_coronatus NA os9 94 ou478 Eulemur_fulvus NA os9 95 ou479 Eulemur_macaco NA os9 96 ou480 Eulemur_mongoz NA os9 97 ou481 Eulemur_rubriventer NA os9 98 ou482 Euoticus_elegantulus NA os9 99 ou483 Euoticus_pallidus NA os9 100 ou484 Galago_alleni NA os9 101 ou485 Galago_gallarum NA os9 102 ou486 Galago_matschiei NA os9 103 ou487 Galago_moholi NA os9 104 ou488 Galago_senegalensis NA os9 105 ou489 Galagoides_demidoff NA os9 106 ou490 Galagoides_zanzibaricus NA os9 107 ou491 Gorilla_gorilla NA os9 108 ou492 Hapalemur_aureus NA os9 109 ou493 Hapalemur_griseus NA os9 110 ou494 Hapalemur_simus NA os9 111 ou495 Homo_sapiens NA os9 112 ou496 Hylobates_agilis NA os9 113 ou497 Hylobates_concolor NA os9 114 ou498 Hylobates_gabriellae NA os9 115 ou499 Hylobates_hoolock NA os9 116 ou500 Hylobates_klossii NA os9 117 ou501 Hylobates_lar NA os9 118 ou502 Hylobates_leucogenys NA os9 119 ou503 Hylobates_moloch NA os9 120 ou504 Hylobates_muelleri NA os9 121 ou505 Hylobates_pileatus NA os9 122 ou506 Hylobates_syndactylus NA os9 123 ou507 Indri_indri NA os9 124 ou508 Lagothrix_flavicauda NA os9 125 ou509 Lagothrix_lagotricha NA os9 126 ou510 Lemur_catta NA os9 127 ou511 Leontopithecus_caissara NA os9 128 ou512 Leontopithecus_chrysomela NA os9 129 ou513 Leontopithecus_chrysopygus NA os9 130 ou514 Leontopithecus_rosalia NA os9 131 ou515 Lepilemur_dorsalis NA os9 132 ou516 Lepilemur_edwardsi NA os9 133 ou517 Lepilemur_leucopus NA os9 134 ou518 Lepilemur_microdon NA os9 135 ou519 Lepilemur_mustelinus NA os9 136 ou520 Lepilemur_ruficaudatus NA os9 137 ou521 Lepilemur_septentrionalis NA os9 138 ou522 Lophocebus_albigena NA os9 139 ou523 Loris_tardigradus NA os9 140 ou524 Macaca_arctoides NA os9 141 ou525 Macaca_assamensis NA os9 142 ou526 Macaca_cyclopis NA os9 143 ou527 Macaca_fascicularis NA os9 144 ou528 Macaca_fuscata NA os9 145 ou529 Macaca_maura NA os9 146 ou530 Macaca_mulatta NA os9 147 ou531 Macaca_nemestrina NA os9 148 ou532 Macaca_nigra NA os9 149 ou533 Macaca_ochreata NA os9 150 ou534 Macaca_radiata NA os9 151 ou535 Macaca_silenus NA os9 152 ou536 Macaca_sinica NA os9 153 ou537 Macaca_sylvanus NA os9 154 ou538 Macaca_thibetana NA os9 155 ou539 Macaca_tonkeana NA os9 156 ou540 Mandrillus_leucophaeus NA os9 157 ou541 Mandrillus_sphinx NA os9 158 ou542 Microcebus_coquereli NA os9 159 ou543 Microcebus_murinus NA os9 160 ou544 Microcebus_rufus NA os9 161 ou545 Miopithecus_talapoin NA os9 162 ou546 Nasalis_concolor NA os9 163 ou547 Nasalis_larvatus NA os9 164 ou548 Nycticebus_coucang NA os9 165 ou549 Nycticebus_pygmaeus NA os9 166 ou550 Otolemur_crassicaudatus NA os9 167 ou551 Otolemur_garnettii NA os9 168 ou552 Pan_paniscus NA os9 169 ou553 Pan_troglodytes NA os9 170 ou554 Papio_hamadryas NA os9 171 ou555 Perodicticus_potto NA os9 172 ou556 Phaner_furcifer NA os9 173 ou557 Pithecia_aequatorialis NA os9 174 ou558 Pithecia_albicans NA os9 175 ou559 Pithecia_irrorata NA os9 176 ou560 Pithecia_monachus NA os9 177 ou561 Pithecia_pithecia NA os9 178 ou562 Pongo_pygmaeus NA os9 179 ou563 Presbytis_comata NA os9 180 ou564 Presbytis_femoralis NA os9 181 ou565 Presbytis_frontata NA os9 182 ou566 Presbytis_hosei NA os9 183 ou567 Presbytis_melalophos NA os9 184 ou568 Presbytis_potenziani NA os9 185 ou569 Presbytis_rubicunda NA os9 186 ou570 Presbytis_thomasi NA os9 187 ou571 Procolobus_badius NA os9 188 ou572 Procolobus_pennantii NA os9 189 ou573 Procolobus_preussi NA os9 190 ou574 Procolobus_rufomitratus NA os9 191 ou575 Procolobus_verus NA os9 192 ou576 Propithecus_diadema NA os9 193 ou577 Propithecus_tattersalli NA os9 194 ou578 Propithecus_verreauxi NA os9 195 ou579 Pygathrix_avunculus NA os9 196 ou580 Pygathrix_bieti NA os9 197 ou581 Pygathrix_brelichi NA os9 198 ou582 Pygathrix_nemaeus NA os9 199 ou583 Pygathrix_roxellana NA os9 200 ou584 Saguinus_bicolor NA os9 201 ou585 Saguinus_fuscicollis NA os9 202 ou586 Saguinus_geoffroyi NA os9 203 ou587 Saguinus_imperator NA os9 204 ou588 Saguinus_inustus NA os9 205 ou589 Saguinus_labiatus NA os9 206 ou590 Saguinus_leucopus NA os9 207 ou591 Saguinus_midas NA os9 208 ou592 Saguinus_mystax NA os9 209 ou593 Saguinus_nigricollis NA os9 210 ou594 Saguinus_oedipus NA os9 211 ou595 Saguinus_tripartitus NA os9 212 ou596 Saimiri_boliviensis NA os9 213 ou597 Saimiri_oerstedii NA os9 214 ou598 Saimiri_sciureus NA os9 215 ou599 Saimiri_ustus NA os9 216 ou600 Saimiri_vanzolinii NA os9 217 ou601 Semnopithecus_entellus NA os9 218 ou602 Tarsius_bancanus NA os9 219 ou603 Tarsius_dianae NA os9 220 ou604 Tarsius_pumilus NA os9 221 ou605 Tarsius_spectrum NA os9 222 ou606 Tarsius_syrichta NA os9 223 ou607 Theropithecus_gelada NA os9 224 ou608 Trachypithecus_auratus NA os9 225 ou609 Trachypithecus_cristatus NA os9 226 ou610 Trachypithecus_francoisi NA os9 227 ou611 Trachypithecus_geei NA os9 228 ou612 Trachypithecus_johnii NA os9 229 ou613 Trachypithecus_obscurus NA os9 230 ou614 Trachypithecus_phayrei NA os9 231 ou615 Trachypithecus_pileatus NA os9 232 ou616 Trachypithecus_vetulus NA os9 233 ou617 Varecia_variegata NA os9 ``` ```r head(char) ``` ``` taxa x 1 Allenopithecus_nigroviridis 8.465900 2 Allocebus_trichotis 4.368181 3 Alouatta_belzebul 8.729074 4 Alouatta_caraya 8.628735 5 Alouatta_coibensis 8.764053 6 Alouatta_fusca 8.554489 ``` Now that we have nice `data.frame` objects for all our data, it's easy to join them into the desired table with a few obvious `dplyr` commands: ```r taxa %>% left_join(char, by = c("label" = "taxa")) %>% left_join(otu_meta, by = "otu") %>% select(otu, label, x, href) ``` ``` otu label x 1 ou385 Allenopithecus_nigroviridis 8.465900 2 ou386 Allocebus_trichotis 4.368181 3 ou387 Alouatta_belzebul 8.729074 4 ou388 Alouatta_caraya 8.628735 5 ou389 Alouatta_coibensis 8.764053 6 ou390 Alouatta_fusca 8.554489 7 ou391 Alouatta_palliata 8.791790 8 ou392 Alouatta_pigra 8.881836 9 ou393 Alouatta_sara 8.796339 10 ou394 Alouatta_seniculus 8.767173 11 ou395 Aotus_azarai 7.127694 12 ou396 Aotus_brumbacki 6.401917 13 ou397 Aotus_hershkovitzi 6.684612 14 ou398 Aotus_infulatus 7.122867 15 ou399 Aotus_lemurinus 6.781058 16 ou400 Aotus_miconax 6.684612 17 ou401 Aotus_nancymaae 6.678342 18 ou402 Aotus_nigriceps 6.966024 19 ou403 Aotus_trivirgatus 6.815640 20 ou404 Aotus_vociferans 6.771936 21 ou405 Arctocebus_aureus 5.459586 22 ou406 Arctocebus_calabarensis 5.552960 23 ou407 Ateles_belzebuth 8.812843 24 ou408 Ateles_chamek 8.872067 25 ou409 Ateles_fusciceps 9.112728 26 ou410 Ateles_geoffroyi 8.937218 27 ou411 Ateles_marginatus 8.738735 28 ou412 Ateles_paniscus 9.072227 29 ou413 Avahi_laniger 6.927558 30 ou414 Brachyteles_arachnoides 9.268609 31 ou415 Cacajao_calvus 8.137396 32 ou416 Cacajao_melanocephalus 8.051978 33 ou417 Callicebus_brunneus 6.747587 34 ou418 Callicebus_caligatus 6.899723 35 ou419 Callicebus_cinerascens 6.899723 36 ou420 Callicebus_cupreus 7.021084 37 ou421 Callicebus_donacophilus 6.801283 38 ou422 Callicebus_dubius 6.899723 39 ou423 Callicebus_hoffmannsi 6.975414 40 ou424 Callicebus_modestus 6.899723 41 ou425 Callicebus_moloch 6.872128 42 ou426 Callicebus_oenanthe 6.899723 43 ou427 Callicebus_olallae 6.899723 44 ou428 Callicebus_personatus 7.237059 45 ou429 Callicebus_torquatus 7.106606 46 ou430 Callimico_goeldii 6.324359 47 ou431 Callithrix_argentata 5.910797 48 ou432 Callithrix_aurita 5.961005 49 ou433 Callithrix_flaviceps 5.926926 50 ou434 Callithrix_geoffroyi 5.834811 51 ou435 Callithrix_humeralifera 5.926926 52 ou436 Callithrix_jacchus 5.673323 53 ou437 Callithrix_kuhlii 5.926926 54 ou438 Callithrix_penicillata 5.828946 55 ou439 Callithrix_pygmaea 4.828314 56 ou440 Cebus_albifrons 7.832014 57 ou441 Cebus_apella 7.922986 58 ou442 Cebus_capucinus 8.009695 59 ou443 Cebus_olivaceus 7.937375 60 ou444 Cercocebus_agilis 8.870663 61 ou445 Cercocebus_galeritus 8.865029 62 ou446 Cercocebus_torquatus 8.894259 63 ou447 Cercopithecus_ascanius 8.171882 64 ou448 Cercopithecus_campbelli 8.199739 65 ou449 Cercopithecus_cephus 8.143227 66 ou450 Cercopithecus_diana 8.382518 67 ou451 Cercopithecus_dryas 7.930206 68 ou452 Cercopithecus_erythrogaster 8.143227 69 ou453 Cercopithecus_erythrotis 8.086410 70 ou454 Cercopithecus_hamlyni 8.438150 71 ou455 Cercopithecus_lhoesti 8.579229 72 ou456 Cercopithecus_mitis 8.525161 73 ou457 Cercopithecus_mona 8.289037 74 ou458 Cercopithecus_neglectus 8.579229 75 ou459 Cercopithecus_nictitans 8.567886 76 ou460 Cercopithecus_petaurista 8.083329 77 ou461 Cercopithecus_pogonias 8.183118 78 ou462 Cercopithecus_preussi 8.544808 79 ou463 Cercopithecus_sclateri 8.029433 80 ou464 Cercopithecus_solatus 8.567886 81 ou465 Cercopithecus_wolfi 8.089482 82 ou466 Cheirogaleus_major 6.104793 83 ou467 Cheirogaleus_medius 5.283204 84 ou468 Chiropotes_albinasus 7.937375 85 ou469 Chiropotes_satanas 7.996317 86 ou470 Chlorocebus_aethiops 8.301522 87 ou471 Colobus_angolensis 9.103868 88 ou472 Colobus_guereza 9.210340 89 ou473 Colobus_polykomos 9.060680 90 ou474 Colobus_satanas 9.121509 91 ou475 Daubentonia_madagascariensis 7.919356 92 ou476 Erythrocebus_patas 8.988446 93 ou477 Eulemur_coronatus 7.438384 94 ou478 Eulemur_fulvus 7.779049 95 ou479 Eulemur_macaco 7.816014 96 ou480 Eulemur_mongoz 7.478735 97 ou481 Eulemur_rubriventer 7.620705 98 ou482 Euoticus_elegantulus 5.690359 99 ou483 Euoticus_pallidus 5.627621 100 ou484 Galago_alleni 5.521461 101 ou485 Galago_gallarum 5.365976 102 ou486 Galago_matschiei 5.267858 103 ou487 Galago_moholi 5.375278 104 ou488 Galago_senegalensis 5.594711 105 ou489 Galagoides_demidoff 4.206184 106 ou490 Galagoides_zanzibaricus 4.997212 107 ou491 Gorilla_gorilla 11.643954 108 ou492 Hapalemur_aureus 7.358831 109 ou493 Hapalemur_griseus 6.862758 110 ou494 Hapalemur_simus 7.620705 111 ou495 Homo_sapiens 10.980195 112 ou496 Hylobates_agilis 8.675905 113 ou497 Hylobates_concolor 8.768730 114 ou498 Hylobates_gabriellae 9.047821 115 ou499 Hylobates_hoolock 8.809863 116 ou500 Hylobates_klossii 8.674197 117 ou501 Hylobates_lar 8.635865 118 ou502 Hylobates_leucogenys 8.898366 119 ou503 Hylobates_moloch 8.677610 120 ou504 Hylobates_muelleri 8.687779 121 ou505 Hylobates_pileatus 8.630522 122 ou506 Hylobates_syndactylus 9.296518 123 ou507 Indri_indri 9.065315 124 ou508 Lagothrix_flavicauda 9.020390 125 ou509 Lagothrix_lagotricha 8.743532 126 ou510 Lemur_catta 7.878534 127 ou511 Leontopithecus_caissara 6.405228 128 ou512 Leontopithecus_chrysomela 6.352629 129 ou513 Leontopithecus_chrysopygus 6.486161 130 ou514 Leontopithecus_rosalia 6.385194 131 ou515 Lepilemur_dorsalis 6.232448 132 ou516 Lepilemur_edwardsi 6.711740 133 ou517 Lepilemur_leucopus 6.396930 134 ou518 Lepilemur_microdon 6.863803 135 ou519 Lepilemur_mustelinus 6.508769 136 ou520 Lepilemur_ruficaudatus 6.637258 137 ou521 Lepilemur_septentrionalis 6.638568 138 ou522 Lophocebus_albigena 8.903815 139 ou523 Loris_tardigradus 5.517453 140 ou524 Macaca_arctoides 9.148465 141 ou525 Macaca_assamensis 9.054855 142 ou526 Macaca_cyclopis 8.658693 143 ou527 Macaca_fascicularis 8.431635 144 ou528 Macaca_fuscata 9.220291 145 ou529 Macaca_maura 8.894259 146 ou530 Macaca_mulatta 8.771835 147 ou531 Macaca_nemestrina 8.970813 148 ou532 Macaca_nigra 8.906529 149 ou533 Macaca_ochreata 7.919356 150 ou534 Macaca_radiata 8.517193 151 ou535 Macaca_silenus 8.699515 152 ou536 Macaca_sinica 8.446771 153 ou537 Macaca_sylvanus 9.350102 154 ou538 Macaca_thibetana 9.268609 155 ou539 Macaca_tonkeana 9.220291 156 ou540 Mandrillus_leucophaeus 9.560997 157 ou541 Mandrillus_sphinx 9.729134 158 ou542 Microcebus_coquereli 5.793014 159 ou543 Microcebus_murinus 4.198705 160 ou544 Microcebus_rufus 3.881564 161 ou545 Miopithecus_talapoin 7.130899 162 ou546 Nasalis_concolor 8.979354 163 ou547 Nasalis_larvatus 9.417355 164 ou548 Nycticebus_coucang 6.878326 165 ou549 Nycticebus_pygmaeus 5.840642 166 ou550 Otolemur_crassicaudatus 7.130899 167 ou551 Otolemur_garnettii 6.701960 168 ou552 Pan_paniscus 10.468801 169 ou553 Pan_troglodytes 10.716638 170 ou554 Papio_hamadryas 9.735069 171 ou555 Perodicticus_potto 6.984716 172 ou556 Phaner_furcifer 6.016157 173 ou557 Pithecia_aequatorialis 7.774856 174 ou558 Pithecia_albicans 7.937375 175 ou559 Pithecia_irrorata 7.749322 176 ou560 Pithecia_monachus 7.654443 177 ou561 Pithecia_pithecia 7.420579 178 ou562 Pongo_pygmaeus 10.860920 179 ou563 Presbytis_comata 9.039552 180 ou564 Presbytis_femoralis 8.797851 181 ou565 Presbytis_frontata 8.853665 182 ou566 Presbytis_hosei 8.725832 183 ou567 Presbytis_melalophos 8.748305 184 ou568 Presbytis_potenziani 8.774931 185 ou569 Presbytis_rubicunda 8.773385 186 ou570 Presbytis_thomasi 8.765615 187 ou571 Procolobus_badius 8.808369 188 ou572 Procolobus_pennantii 9.122601 189 ou573 Procolobus_preussi 9.094930 190 ou574 Procolobus_rufomitratus 8.995909 191 ou575 Procolobus_verus 8.289037 192 ou576 Propithecus_diadema 8.794825 193 ou577 Propithecus_tattersalli 8.171882 194 ou578 Propithecus_verreauxi 8.202482 195 ou579 Pygathrix_avunculus 9.164296 196 ou580 Pygathrix_bieti 9.118225 197 ou581 Pygathrix_brelichi 9.305651 198 ou582 Pygathrix_nemaeus 9.417355 199 ou583 Pygathrix_roxellana 9.510445 200 ou584 Saguinus_bicolor 6.142037 201 ou585 Saguinus_fuscicollis 5.976351 202 ou586 Saguinus_geoffroyi 6.200509 203 ou587 Saguinus_imperator 6.016157 204 ou588 Saguinus_inustus 6.688355 205 ou589 Saguinus_labiatus 6.234411 206 ou590 Saguinus_leucopus 6.124683 207 ou591 Saguinus_midas 6.293419 208 ou592 Saguinus_mystax 6.326149 209 ou593 Saguinus_nigricollis 6.109248 210 ou594 Saguinus_oedipus 6.139885 211 ou595 Saguinus_tripartitus 5.953243 212 ou596 Saimiri_boliviensis 6.690842 213 ou597 Saimiri_oerstedii 6.570883 214 ou598 Saimiri_sciureus 6.620073 215 ou599 Saimiri_ustus 6.791221 216 ou600 Saimiri_vanzolinii 6.664409 217 ou601 Semnopithecus_entellus 9.441452 218 ou602 Tarsius_bancanus 4.736198 219 ou603 Tarsius_dianae 4.709530 220 ou604 Tarsius_pumilus 4.808111 221 ou605 Tarsius_spectrum 5.111988 222 ou606 Tarsius_syrichta 4.753590 223 ou607 Theropithecus_gelada 9.680344 224 ou608 Trachypithecus_auratus 9.181941 225 ou609 Trachypithecus_cristatus 8.872067 226 ou610 Trachypithecus_francoisi 9.008224 227 ou611 Trachypithecus_geei 9.031214 228 ou612 Trachypithecus_johnii 9.268609 229 ou613 Trachypithecus_obscurus 8.870663 230 ou614 Trachypithecus_phayrei 8.948976 231 ou615 Trachypithecus_pileatus 9.323669 232 ou616 Trachypithecus_vetulus 8.969542 233 ou617 Varecia_variegata 8.261010 href 1 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572992 2 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572857 3 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572935 4 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572936 5 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945168 6 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945164 7 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572939 8 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572940 9 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572941 10 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572942 11 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944172 12 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572944 13 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949 14 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945149 15 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949 16 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572947 17 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572945 18 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572946 19 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572951 20 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572952 21 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572887 22 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572888 23 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572954 24 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572955 25 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572957 26 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572958 27 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572956 28 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572953 29 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572881 30 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572959 31 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572983 32 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572984 33 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025131 34 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134 35 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025122 36 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025127 37 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025112 38 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134 39 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025125 40 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025116 41 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025119 42 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025114 43 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025115 44 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572962 45 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025106 46 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572909 47 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944125 48 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572911 49 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572912 50 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572913 51 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944138 52 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572915 53 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572916 54 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572918 55 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944123 56 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572975 57 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944156 58 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572977 59 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572978 60 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572993 61 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572994 62 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572995 63 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572996 64 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572997 65 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572998 66 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572999 67 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573000 68 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573001 69 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573002 70 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573003 71 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944219 72 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573005 73 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573006 74 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573007 75 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573008 76 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573009 77 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573010 78 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945227 79 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573014 80 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944221 81 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573011 82 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572858 83 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572859 84 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572985 85 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572986 86 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=552515 87 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573035 88 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573036 89 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573037 90 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573038 91 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572886 92 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573015 93 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572865 94 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572864 95 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572866 96 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572867 97 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572868 98 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572893 99 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572894 100 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944100 101 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572896 102 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572897 103 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572898 104 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572899 105 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572900 106 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025177 107 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573080 108 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572869 109 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572870 110 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944072 111 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180092 112 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573069 113 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944286 114 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944292 115 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945338 116 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573073 117 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573074 118 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944290 119 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573076 120 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573077 121 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573078 122 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944293 123 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572882 124 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572961 125 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944187 126 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572872 127 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572921 128 129 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572920 130 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572922 131 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572874 132 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572875 133 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572876 134 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572877 135 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572878 136 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572879 137 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572880 138 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573016 139 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572889 140 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573017 141 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573018 142 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573019 143 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180098 144 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=555659 145 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573020 146 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180099 147 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573021 148 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573022 149 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573023 150 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573024 151 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573025 152 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573026 153 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573027 154 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573028 155 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573029 156 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573030 157 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573031 158 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944041 159 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572861 160 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572862 161 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573032 162 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944263 163 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573040 164 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572890 165 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572891 166 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572902 167 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572903 168 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573081 169 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573082 170 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573033 171 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572892 172 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572863 173 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572987 174 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572988 175 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572989 176 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572990 177 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572991 178 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573083 179 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573041 180 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573042 181 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573043 182 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573044 183 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573045 184 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573046 185 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573047 186 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573048 187 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944230 188 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944235 189 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944238 190 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944239 191 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573053 192 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572883 193 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572884 194 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572885 195 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944258 196 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944259 197 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944260 198 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573057 199 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945308 200 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572923 201 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=998616 202 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572925 203 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572926 204 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572927 205 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572928 206 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572929 207 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572930 208 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572931 209 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=998617 210 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572933 211 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025098 212 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572979 213 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572980 214 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180095 215 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572981 216 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572982 217 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573059 218 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945103 219 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944117 220 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572906 221 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944115 222 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945107 223 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573034 224 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573060 225 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573061 226 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573062 227 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573063 228 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944270 229 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573065 230 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573066 231 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573067 232 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944269 233 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572873 ``` Because these are all from the same otus block anyway, we haven't selected that column, but were it of interest it is also available in the taxa table. RNeXML/inst/doc/sparql.html0000644000176200001440000013636213614142014015240 0ustar liggesusers SPARQL with RNeXML

SPARQL with RNeXML

Carl Boettiger

Scott Chamberlain

Rutger Vos

Hilmar Lapp

SPARQL Queries

Rich, semantically meaningful metadata lies at the heart of the NeXML standard. R provides a rich environment to unlock this information. While our previous examples have relied on the user knowing exactly what metadata they intend to extract (title, publication date, citation information, and so forth), semantic metadata has meaning that a computer can make use of, allowing us to make much more conceptually rich queries than those simple examples. The SPARQL query language is a powerful way to make use of such semantic information in making complex queries.

While users should consult a formal introduction to SPARQL for further background, here we illustrate how SPARQL can be used in combination with R functions in ways that would be much more tedious to assemble with only traditional/non-semantic queries. The SPARQL query language is provided for the R environment through the rrdf package [@Willighagen_2014], so we start by loading that package. We will also make use of functions from phytools and RNeXML.

We read in an example file that contains semantic metadata annotations describing the taxonomic units (OTUs) used in the tree.

In particular, this example declares the taxon rank, NCBI identifier and parent taxon for each OTU, such as:

In this example, we will construct a cladogram by using this information to identify the taxonomic rank of each OTU, and its shared parent taxonomic rank. (If this example looks complex, try writing down the steps to do this without the aid of the SPARQL queries). These examples show the manipulation of semantic triples, Unique Resource Identifiers (URIs) and use of the SPARQL “Join” operator.

Note that this example can be run using demo("sparql", "RNeXML") to see the code displayed in the R terminal and to avoid character errors that can occur in having to copy and paste from PDF files.

We begin by extracting the RDF graph from the NeXML,

We then fetch the NCBI URI for the taxon that has rank ‘Order’, i.e. the root of the primates phylogeny. The dot operator . between clauses implies a join, in this case

This makes use of the SPARQL query language provided by the rrdf package. We will also define some helper functions that use SPARQL queries. Here we define a function to get the name

Next, we define a recursive function to build a newick tree from the taxonomic rank information.

With these functions in place, it is straight forward to build the tree from the semantic RDFa data and then visualize it

plot of chunk unnamed-chunk-8

plot of chunk unnamed-chunk-8

RNeXML/inst/doc/simmap.html0000644000176200001440000010123413614142014015212 0ustar liggesusers Extending NeXML: an example based on simmap

Extending NeXML: an example based on simmap

Carl Boettiger

Scott Chamberlain

Rutger Vos

Hilmar Lapp

Extending the NeXML standard through metadata annotation.

Here we illustrate this process using the example of stochastic character mapping (Huelsenbeck, Nielsen, and Bollback 2003). A stochastic character map is simply an annotation of the branches on a phylogeny, assigning each section of each branch to a particular “state” (typically of a morphological characteristic).

Bollback (2006) provides a widely used stand-alone software implementation of this method in the software simmap, which modified the standard Newick tree format to express this additional information. This can break compatibility with other software, and creates a format that cannot be interpreted without additional information describing this convention. By contrast, the NeXML extension is not only backwards compatible but contains a precise and machine-readable description of what it is encoding.

In this example, we illustrate how the additional information required to define a stochastic character mapping (a simmap mapping) in NeXML.

Revell (2012) describes the phytools package for R, which includes utilities for reading, manipulating, and writing simmap files in R. In this example, we also show how to define RNeXML functions that map the R representation used by Revell (an extension of the ape class) into the NeXML extension we have defined by using RNeXML functions.

Since a stochastic character map simply assigns different states to parts of a branch (or edge) on the phylogenetic tree, we can create a NeXML representation by annotating the edge elements with appropriate meta elements. These elements need to describe the character state being assigned and the duration (in terms of branch-length) that the edge spends in that state (Stochastic character maps are specific to time-calibrated or ultrametric trees).

NeXML already defines the characters element to handle discrete character traits (nex:char) and the states they can assume (nex:state). We will thus reuse the characters element for this purpose, referring to both the character trait and the states by the ids assigned to them in that element. (NeXML’s convention of referring to everything by id permits a single canonical definition of each term, making it clear where additional annotation belongs). For each edge, we need to indicate:

  • That our annotation contains a stochastic character mapping reconstruction
  • Since many reconstructions are possible for a single edge, we give each reconstruction an id
  • We indicate for which character trait we are defining the reconstruction
  • We then indicate which states the character assumes on that edge. For each state realized on the edge, that involves stating:
    • the state assignment
    • the duration (length of time) for which the edge spends in the given state
    • the order in which the state changes happen (Though we could just assume state transitions are listed chronologically, NeXML suggests making all data explicit, rather than relying on the structure of the data file to convey information).

Thus the annotation for an edge that switches from state s2 to state s1 of character cr1 would be constructed like this:

Of course writing out such a definition manually becomes tedious quickly. Because these are just R commands, we can easily define a function that can loop over an assignment like this for each edge, extracting the appropriate order, length and state from an existing R object such as that provided in the phytools package.
Likewise, it is straightforward to define a function that reads this data using the RNeXML utilities and converts it back to the phytools package. The full implementation of this mapping can be seen in the simmap_to_nexml() and the nexml_to_simmap() functions provided in the RNeXML package.

As the code indicates, the key step is simply to define the data in meta elements. In so doing, we have defined a custom namespace, simmap, to hold our variables. This allows us to provide a URL with more detailed descriptions of what each of these elements mean:

At that URL we have posted a simple description of each term.

Using this convention we can generate NeXML files containing simmap data, read those files into R, and convert them back into the phytools package format. These simple functions serve as further illustration of how RNeXML can be used to extend the NeXML standard. We illustrate their use briefly here, starting with loading a nexml object containing a simmap reconstruction into R:

The get_trees() function can be used to return an ape::phylo tree as usual. RNeXML automatically detects the simmap reconstruction data and returns includes this in a maps element of the ape::phylo object, for use with other phytools functions.

We can then use various functions from phytools designed for simmap objects (Revell 2012), such as the plotting function:

no colors provided. using the following legend:
       A        B        C 
 "black"    "red" "green3" 
Stochastic character mapping on a phylogeny, as generated by the phytools package after parsing the simmap-extended NeXML.

Stochastic character mapping on a phylogeny, as generated by the phytools package after parsing the simmap-extended NeXML.

Likewise, we can convert the object back in the NeXML format and write it out to file to be read by other users.

[1] "simmap.xml"

Though other NeXML parsers (for instance, for Perl or Python) have not been written explicitly to express simmap data, those parsers will nonetheless be able to successfully parse this file and expose the simmap data to the user.

Bollback, JonathanP. 2006. BMC Bioinformatics 7 (1). Springer Science + Business Media: 88. https://doi.org/10.1186/1471-2105-7-88.

Huelsenbeck, John P., Rasmus Nielsen, and Jonathan P. Bollback. 2003. “Stochastic Mapping of Morphological Characters.” Systematic Biology 52 (2). Oxford University Press (OUP): 131–58. https://doi.org/10.1080/10635150390192780.

Revell, Liam J. 2012. “Phytools: An R Package for Phylogenetic Comparative Biology (and Other Things).” Methods in Ecology and Evolution 3: 217–23.

RNeXML/inst/doc/S4.Rmd0000644000176200001440000001257413614125024014002 0ustar liggesusers--- title: "The nexml S4 Object" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- ## Understanding the `nexml` S4 object The `RNeXML` package provides many convenient functions to add and extract information from `nexml` objects in the R environment without requiring the reader to understand the details of the NeXML data structure and making it less likely that a user will generate invalid NeXML syntax that could not be read by other parsers. The `nexml` object we have been using in all of the examples is built on R's S4 mechanism. Advanced users may sometimes prefer to interact with the data structure more directly using R's S4 class mechanism and subsetting methods. Many R users are more familiar with the S3 class mechanism (such as in the `ape` package phylo objects) rather than the S4 class mechanism used in phylogenetics packages such as `ouch` and `phylobase`. The `phylobase` vignette provides an excellent introduction to these data structures. Users already familiar with subsetting lists and other S3 objects in R are likely familiar with the use of the `$` operator, such as `phy$edge`. S4 objects simply use an `@` operator instead (but cannot be subset using numeric arguments such as `phy[[1]]` or named arguments such as phy[["edge"]]). The `nexml` object is an S4 object, as are all of its components (slots). Its hierarchical structure corresponds exactly with the XML tree of a NeXML file, with the single exception that both XML attributes and children are represented as slots. S4 objects have constructor functions to initialize them. We create a new `nexml` object with the command: ```r nex <- new("nexml") ``` We can see a list of slots contained in this object with ```r slotNames(nex) ``` ``` [1] "version" "generator" "xsi:schemaLocation" "namespaces" "otus" [6] "trees" "characters" "meta" "about" "xsi:type" ``` Some of these slots have already been populated for us, for instance, the schema version and default namespaces: ```r nex@version ``` ``` [1] "0.9" ``` ```r nex@namespaces ``` ``` nex xsi "http://www.nexml.org/2009" "http://www.w3.org/2001/XMLSchema-instance" xml cdao "http://www.w3.org/XML/1998/namespace" "http://purl.obolibrary.org/obo/" xsd dc "http://www.w3.org/2001/XMLSchema#" "http://purl.org/dc/elements/1.1/" dcterms prism "http://purl.org/dc/terms/" "http://prismstandard.org/namespaces/1.2/basic/" cc ncbi "http://creativecommons.org/ns#" "http://www.ncbi.nlm.nih.gov/taxonomy#" tc "http://rs.tdwg.org/ontology/voc/TaxonConcept#" "http://www.nexml.org/2009" ``` Recognize that `nex@namespaces` serves the same role as `get_namespaces` function, but provides direct access to the slot data. For instance, with this syntax we could also overwrite the existing namespaces with `nex@namespaces <- NULL`. Changing the namespace in this way is not advised. Some slots can contain multiple elements of the same type, such as `trees`, `characters`, and `otus`. For instance, we see that ```r class(nex@characters) ``` ``` [1] "ListOfcharacters" attr(,"package") [1] "RNeXML" ``` is an object of class `ListOfcharacters`, and is currently empty, ```r length(nex@characters) ``` ``` [1] 0 ``` In order to assign an object to a slot, it must match the class definition of the slot. We can create a new element of any given class with the `new` function, ```r nex@characters <- new("ListOfcharacters", list(new("characters"))) ``` and now we have a length-1 list of character matrices, ```r length(nex@characters) ``` ``` [1] 1 ``` and we access the first character matrix using the list notation, `[[1]]`. Here we check the class is a `characters` object. ```r class(nex@characters[[1]]) ``` ``` [1] "characters" attr(,"package") [1] "RNeXML" ``` Direct subsetting has two primary use cases: (a) useful in looking up (and possibly editing) a specific value of an element, or (b) when adding metadata annotations to specific elements. Consider the example file ```r f <- system.file("examples", "trees.xml", package="RNeXML") nex <- nexml_read(f) ``` We can look up the species label of the first `otu` in the first `otus` block: ```r nex@otus[[1]]@otu[[1]]@label ``` ``` label "species 1" ``` We can add metadata to this particular OTU using this subsetting format ```r nex@otus[[1]]@otu[[1]]@meta <- c(meta("skos:note", "This species was incorrectly identified"), nex@otus[[1]]@otu[[1]]@meta) ``` Here we use the `c` operator to append this element to any existing meta annotations to this otu. RNeXML/inst/doc/sparql.Rmd0000644000176200001440000001330313614141224015005 0ustar liggesusers--- title: "SPARQL with RNeXML" author: - Carl Boettiger - Scott Chamberlain - Rutger Vos - Hilmar Lapp output: html_vignette --- ## SPARQL Queries Rich, semantically meaningful metadata lies at the heart of the NeXML standard. R provides a rich environment to unlock this information. While our previous examples have relied on the user knowing exactly what metadata they intend to extract (title, publication date, citation information, and so forth), _semantic_ metadata has meaning that a computer can make use of, allowing us to make much more conceptually rich queries than those simple examples. The SPARQL query language is a powerful way to make use of such semantic information in making complex queries. While users should consult a formal introduction to SPARQL for further background, here we illustrate how SPARQL can be used in combination with R functions in ways that would be much more tedious to assemble with only traditional/non-semantic queries. The SPARQL query language is provided for the R environment through the `rrdf` package [@Willighagen_2014], so we start by loading that package. We will also make use of functions from `phytools` and `RNeXML`. ```r library("rdflib") library("xml2") library("phytools") library("RNeXML") ``` We read in an example file that contains semantic metadata annotations describing the taxonomic units (OTUs) used in the tree. ```r nexml <- nexml_read(system.file("examples/primates.xml", package="RNeXML")) ``` In particular, this example declares the taxon rank, NCBI identifier and parent taxon for each OTU, such as: ```xml ``` In this example, we will construct a cladogram by using this information to identify the taxonomic rank of each OTU, and its shared parent taxonomic rank. (If this example looks complex, try writing down the steps to do this without the aid of the SPARQL queries). These examples show the manipulation of semantic triples, Unique Resource Identifiers (URIs) and use of the SPARQL "Join" operator. Note that this example can be run using `demo("sparql", "RNeXML")` to see the code displayed in the R terminal and to avoid character errors that can occur in having to copy and paste from PDF files. We begin by extracting the RDF graph from the NeXML, ```r rdf <- get_rdf(system.file("examples/primates.xml", package="RNeXML")) tmp <- tempfile() # so we must write the XML out first xml2::write_xml(rdf, tmp) graph <- rdf_parse(tmp) ``` We then fetch the NCBI URI for the taxon that has rank 'Order', i.e. the root of the primates phylogeny. The dot operator `.` between clauses implies a join, in this case ```r root <- rdf_query(graph, "SELECT ?uri WHERE { ?id . ?id ?uri }") ``` This makes use of the SPARQL query language provided by the `rrdf` package. We will also define some helper functions that use SPARQL queries. Here we define a function to get the name ```r get_name <- function(id) { max <- length(nexml@otus[[1]]@otu) for(i in 1:max) { if ( nexml@otus[[1]]@otu[[i]]@id == id ) { label <- nexml@otus[[1]]@otu[[i]]@label label <- gsub(" ","_",label) return(label) } } } ``` Next, we define a recursive function to build a newick tree from the taxonomic rank information. ```r recurse <- function(node){ # fetch the taxonomic rank and id string rank_query <- paste0( "SELECT ?rank ?id WHERE { ?id <",node,"> . ?id ?rank }") result <- rdf_query(graph, rank_query) # get the local ID, strip URI part id <- result$id id <- gsub("^.+#", "", id, perl = TRUE) # if rank is terminal, return the name if (result$rank == "http://rs.tdwg.org/ontology/voc/TaxonRank#Species") { return(get_name(id)) } # recurse deeper else { child_query <- paste0( "SELECT ?uri WHERE { ?id <",node,"> . ?id ?uri }") children <- rdf_query(graph, child_query) return(paste("(", paste(sapply(children$uri, recurse), sep = ",", collapse = "," ), ")", get_name(id), # label interior nodes sep = "", collapse = "")) } } ``` With these functions in place, it is straight forward to build the tree from the semantic RDFa data and then visualize it ```r newick <- paste(recurse(root), ";", sep = "", collapse = "") tree <- read.newick(text = newick) collapsed <- collapse.singles(tree) plot(collapsed, type='cladogram', show.tip.label=FALSE, show.node.label=TRUE, cex=0.75, edge.color='grey60', label.offset=-9) ``` ![plot of chunk unnamed-chunk-8](sparql-unnamed-chunk-8-1.png) RNeXML/inst/doc/metadata.html0000644000176200001440000032672313614142013015517 0ustar liggesusers Handling Metadata in RNeXML

Handling Metadata in RNeXML

Carl Boettiger

Scott Chamberlain

Rutger Vos

Hilmar Lapp

Writing NeXML metadata

The add_basic_meta() function takes as input an existing nexml object (like the other add_ functions, if none is provided it will create one), and at the time of this writing any of the following parameters: title, description, creator, pubdate, rights, publisher, citation. Other metadata elements and corresponding parameters may be added in the future.

Load the packages and data:

Create an nexml object for the phylogeny bird.orders and add appropriate metadata:

Instead of a literal string, citations can also be provided in R’s bibentry type, which is the one in which R package citations are obtained:

Taxonomic identifiers

RNeXML now uses taxald for fast look-up of taxonomic information. If a unique match is found, a metadata annotation is added to the taxon providing the unique URI to the taxonomic unit.

If no perfect match is found, the user is warned to check for possible typographic errors in the taxonomic labels provided.

Custom metadata extensions

We can get a list of namespaces along with their prefixes from the nexml object:

                                dc 
"http://purl.org/dc/elements/1.1/" 

We create a meta element containing this annotation using the meta function:

We can add this annotation to our existing birds NeXML file using the add_meta() function. Because we do not specify a level, it is added to the root node, referring to the NeXML file as a whole.

The built-in vocabularies are just the tip of the iceberg of established vocabularies. Here we add an annotation from the skos namespace which describes the history of where the data comes from:

Because skos is not in the current namespace list, we add it with a url when adding this meta element. We also specify that this annotation be placed at the level of the trees sub-node in the NeXML file.

For finer control of the level at which a meta element is added, we will manipulate the nexml R object directly using S4 sub-setting, as shown in the supplement.

Much richer metadata annotation is possible. Later we illustrate how metadata annotation can be used to extend the base NeXML format to represent new forms of data while maintaining compatibility with any NeXML parser. The RNeXML package can be easily extended to support helper functions such as taxize_nexml to add additional metadata without imposing a large burden on the user.

Reading NeXML metadata

A call to the nexml object prints some metadata summarizing the data structure:

A nexml object representing:
     1 phylogenetic tree block(s), where:
       block 1 contains 1 phylogenetic tree(s) 
     0 character block(s),  
     23 taxonomic units in 1 block(s) 
  Taxa:  Struthioniformes, Tinamiformes, Craciformes, Galliformes, Anseriformes, Turniciformes ...
  Metadata annotations: 
    18 at top level 
    0 in block 1 at otu level  

This data set describes the phylogenetic relationships of the
     orders of birds as reported by Sibley and Ahlquist (1990). Sibley
     and Ahlquist inferred this phylogeny from an extensive number of
     DNA/DNA hybridization experiments. The ``tapestry'' reported by
     these two authors (more than 1000 species out of the ca. 9000
     extant bird species) generated a lot of debates.

     The present tree is based on the relationships among orders. The
     branch lengths were calculated from the values of Delta T50H as
     found in Sibley and Ahlquist (1990, fig. 353).

Author(s): Sibley, C. G. and Ahlquist, J. E., cboettig

License: http://creativecommons.org/publicdomain/zero/1.0/

NeXML generated by RNeXML using schema version: 0.9 
Size: 358.3 Kb 

We can extract all metadata pertaining to the NeXML document as a whole (annotations of the XML root node, <nexml>) with the command

This returns a data.frame of available metadata. We can see the kinds of metadata recorded from the names:

                        property   datatype
1                       dc:title xsd:string
2                     dc:creator xsd:string
3                 dc:description xsd:string
4                     cc:license       <NA>
5  dcterms:bibliographicCitation xsd:string
6                     dc:creator xsd:string
7             dcterms:references       <NA>
8         prism:modificationDate xsd:string
9                   prism:volume xsd:string
10                  dc:publisher xsd:string
11         prism:publicationName xsd:string
12              prism:endingPage xsd:string
13            prism:startingPage xsd:string
14         prism:publicationDate xsd:string
15                      dc:title xsd:string
16                dc:contributor xsd:string
17                dc:contributor xsd:string
18 dcterms:bibliographicCitation xsd:string
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             content
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Phylogeny of the Orders of Birds From Sibley and Ahlquist
2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Sibley, C. G. and Ahlquist, J. E.
3  This data set describes the phylogenetic relationships of the\n     orders of birds as reported by Sibley and Ahlquist (1990). Sibley\n     and Ahlquist inferred this phylogeny from an extensive number of\n     DNA/DNA hybridization experiments. The ``tapestry'' reported by\n     these two authors (more than 1000 species out of the ca. 9000\n     extant bird species) generated a lot of debates.\n\n     The present tree is based on the relationships among orders. The\n     branch lengths were calculated from the values of Delta T50H as\n     found in Sibley and Ahlquist (1990, fig. 353).
4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               <NA>
5                                                                                                                                                                                                                                                                                                                                                                                                                                                      Sibley, C. G. and Ahlquist, J. E. (1990) Phylogeny and\n     classification of birds: a study in molecular evolution. New\n     Haven: Yale University Press.
6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           cboettig
7                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               <NA>
8                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         2013-10-04
9                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 35
10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Bioinformatics
11                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Bioinformatics
12                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               528
13                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               526
14                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              2018
15                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ape 5.0: an environment for modern phylogenetics and evolutionary analyses in {R}
16                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        E. Paradis
17                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        K. Schliep
18                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Paradis E, Schliep K (2018). "ape 5.0: an environment for modern phylogenetics and evolutionary analyses in R."\n_Bioinformatics_, *35*, 526-528.
       xsi.type                                              href Meta meta
1   LiteralMeta                                              <NA> m544 <NA>
2   LiteralMeta                                              <NA> m545 <NA>
3   LiteralMeta                                              <NA> m546 <NA>
4  ResourceMeta http://creativecommons.org/publicdomain/zero/1.0/ m547 <NA>
5   LiteralMeta                                              <NA> m548 <NA>
6   LiteralMeta                                              <NA> m549 <NA>
7  ResourceMeta                                              <NA> m560 <NA>
8   LiteralMeta                                              <NA> m561 <NA>
9   LiteralMeta                                              <NA> <NA> m560
10  LiteralMeta                                              <NA> <NA> m560
11  LiteralMeta                                              <NA> <NA> m560
12  LiteralMeta                                              <NA> <NA> m560
13  LiteralMeta                                              <NA> <NA> m560
14  LiteralMeta                                              <NA> <NA> m560
15  LiteralMeta                                              <NA> <NA> m560
16  LiteralMeta                                              <NA> <NA> m560
17  LiteralMeta                                              <NA> <NA> m560
18  LiteralMeta                                              <NA> <NA> m560

We can also access a table of taxonomic metadata:

     otu            label xsi.type otus
1  ou362 Struthioniformes       NA  os8
2  ou363     Tinamiformes       NA  os8
3  ou364      Craciformes       NA  os8
4  ou365      Galliformes       NA  os8
5  ou366     Anseriformes       NA  os8
6  ou367    Turniciformes       NA  os8
7  ou368       Piciformes       NA  os8
8  ou369    Galbuliformes       NA  os8
9  ou370   Bucerotiformes       NA  os8
10 ou371      Upupiformes       NA  os8
11 ou372    Trogoniformes       NA  os8
12 ou373    Coraciiformes       NA  os8
13 ou374      Coliiformes       NA  os8
14 ou375     Cuculiformes       NA  os8
15 ou376   Psittaciformes       NA  os8
16 ou377      Apodiformes       NA  os8
17 ou378   Trochiliformes       NA  os8
18 ou379  Musophagiformes       NA  os8
19 ou380     Strigiformes       NA  os8
20 ou381    Columbiformes       NA  os8
21 ou382       Gruiformes       NA  os8
22 ou383    Ciconiiformes       NA  os8
23 ou384    Passeriformes       NA  os8

Which returns text from the otu element labels, typically used to define taxonomic names, rather than text from explicit meta elements.

We can also access metadata at a specific level (or use level=all to extract all meta elements in a list). Here we show only the first few results:

# A tibble: 0 x 3
# … with 3 variables: otu <chr>, otus <chr>, Meta <chr>

Merging metadata tables

We often want to combine metadata from multiple tables. For instance, in this exercise we want to include the taxonomic identifier and id value for each species returned in the character table. This helps us more precisely identify the species whose traits are described by the table.

To begin, let’s generate a NeXML file using the tree and trait data from the geiger package’s “primates” data:

(Note that we’ve used dplyr’s cute pipe syntax, but unfortunately our add_ methods take the nexml object as the second argument instead of the first, so this isn’t as elegant since we need the stupid . to show where the piped output should go…)

We now read in the three tables of interest. Note that we tell get_characters to give us species labels as there own column, rather than as rownames. The latter is the default only because this plays more nicely with the default format for character matrices that is expected by geiger and other phylogenetics packages, but is in general a silly choice for data manipulation.

We can take a peek at what the tables look like, just to orient ourselves:

      property                                                                                  href     xsi.type   otu otus
1   tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572992 ResourceMeta ou385  os9
2   tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572857 ResourceMeta ou386  os9
3   tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572935 ResourceMeta ou387  os9
4   tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572936 ResourceMeta ou388  os9
5   tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945168 ResourceMeta ou389  os9
6   tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945164 ResourceMeta ou390  os9
7   tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572939 ResourceMeta ou391  os9
8   tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572940 ResourceMeta ou392  os9
9   tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572941 ResourceMeta ou393  os9
10  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572942 ResourceMeta ou394  os9
11  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944172 ResourceMeta ou395  os9
12  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572944 ResourceMeta ou396  os9
13  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949 ResourceMeta ou397  os9
14  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945149 ResourceMeta ou398  os9
15  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949 ResourceMeta ou399  os9
16  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572947 ResourceMeta ou400  os9
17  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572945 ResourceMeta ou401  os9
18  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572946 ResourceMeta ou402  os9
19  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572951 ResourceMeta ou403  os9
20  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572952 ResourceMeta ou404  os9
21  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572887 ResourceMeta ou405  os9
22  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572888 ResourceMeta ou406  os9
23  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572954 ResourceMeta ou407  os9
24  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572955 ResourceMeta ou408  os9
25  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572957 ResourceMeta ou409  os9
26  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572958 ResourceMeta ou410  os9
27  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572956 ResourceMeta ou411  os9
28  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572953 ResourceMeta ou412  os9
29  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572881 ResourceMeta ou413  os9
30  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572959 ResourceMeta ou414  os9
31  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572983 ResourceMeta ou415  os9
32  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572984 ResourceMeta ou416  os9
33  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025131 ResourceMeta ou417  os9
34  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134 ResourceMeta ou418  os9
35  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025122 ResourceMeta ou419  os9
36  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025127 ResourceMeta ou420  os9
37  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025112 ResourceMeta ou421  os9
38  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134 ResourceMeta ou422  os9
39  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025125 ResourceMeta ou423  os9
40  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025116 ResourceMeta ou424  os9
41  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025119 ResourceMeta ou425  os9
42  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025114 ResourceMeta ou426  os9
43  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025115 ResourceMeta ou427  os9
44  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572962 ResourceMeta ou428  os9
45  tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025106 ResourceMeta ou429  os9
46  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572909 ResourceMeta ou430  os9
47  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944125 ResourceMeta ou431  os9
48  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572911 ResourceMeta ou432  os9
49  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572912 ResourceMeta ou433  os9
50  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572913 ResourceMeta ou434  os9
51  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944138 ResourceMeta ou435  os9
52  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572915 ResourceMeta ou436  os9
53  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572916 ResourceMeta ou437  os9
54  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572918 ResourceMeta ou438  os9
55  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944123 ResourceMeta ou439  os9
56  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572975 ResourceMeta ou440  os9
57  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944156 ResourceMeta ou441  os9
58  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572977 ResourceMeta ou442  os9
59  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572978 ResourceMeta ou443  os9
60  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572993 ResourceMeta ou444  os9
61  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572994 ResourceMeta ou445  os9
62  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572995 ResourceMeta ou446  os9
63  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572996 ResourceMeta ou447  os9
64  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572997 ResourceMeta ou448  os9
65  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572998 ResourceMeta ou449  os9
66  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572999 ResourceMeta ou450  os9
67  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573000 ResourceMeta ou451  os9
68  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573001 ResourceMeta ou452  os9
69  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573002 ResourceMeta ou453  os9
70  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573003 ResourceMeta ou454  os9
71  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944219 ResourceMeta ou455  os9
72  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573005 ResourceMeta ou456  os9
73  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573006 ResourceMeta ou457  os9
74  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573007 ResourceMeta ou458  os9
75  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573008 ResourceMeta ou459  os9
76  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573009 ResourceMeta ou460  os9
77  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573010 ResourceMeta ou461  os9
78  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945227 ResourceMeta ou462  os9
79  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573014 ResourceMeta ou463  os9
80  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944221 ResourceMeta ou464  os9
81  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573011 ResourceMeta ou465  os9
82  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572858 ResourceMeta ou466  os9
83  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572859 ResourceMeta ou467  os9
84  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572985 ResourceMeta ou468  os9
85  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572986 ResourceMeta ou469  os9
86  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=552515 ResourceMeta ou470  os9
87  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573035 ResourceMeta ou471  os9
88  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573036 ResourceMeta ou472  os9
89  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573037 ResourceMeta ou473  os9
90  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573038 ResourceMeta ou474  os9
91  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572886 ResourceMeta ou475  os9
92  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573015 ResourceMeta ou476  os9
93  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572865 ResourceMeta ou477  os9
94  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572864 ResourceMeta ou478  os9
95  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572866 ResourceMeta ou479  os9
96  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572867 ResourceMeta ou480  os9
97  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572868 ResourceMeta ou481  os9
98  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572893 ResourceMeta ou482  os9
99  tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572894 ResourceMeta ou483  os9
100 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944100 ResourceMeta ou484  os9
101 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572896 ResourceMeta ou485  os9
102 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572897 ResourceMeta ou486  os9
103 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572898 ResourceMeta ou487  os9
104 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572899 ResourceMeta ou488  os9
105 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572900 ResourceMeta ou489  os9
106 tc:toTaxon http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025177 ResourceMeta ou490  os9
107 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573080 ResourceMeta ou491  os9
108 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572869 ResourceMeta ou492  os9
109 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572870 ResourceMeta ou493  os9
110 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944072 ResourceMeta ou494  os9
111 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180092 ResourceMeta ou495  os9
112 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573069 ResourceMeta ou496  os9
113 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944286 ResourceMeta ou497  os9
114 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944292 ResourceMeta ou498  os9
115 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945338 ResourceMeta ou499  os9
116 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573073 ResourceMeta ou500  os9
117 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573074 ResourceMeta ou501  os9
118 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944290 ResourceMeta ou502  os9
119 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573076 ResourceMeta ou503  os9
120 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573077 ResourceMeta ou504  os9
121 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573078 ResourceMeta ou505  os9
122 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944293 ResourceMeta ou506  os9
123 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572882 ResourceMeta ou507  os9
124 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572961 ResourceMeta ou508  os9
125 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944187 ResourceMeta ou509  os9
126 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572872 ResourceMeta ou510  os9
127 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572921 ResourceMeta ou511  os9
128 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572920 ResourceMeta ou513  os9
129 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572922 ResourceMeta ou514  os9
130 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572874 ResourceMeta ou515  os9
131 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572875 ResourceMeta ou516  os9
132 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572876 ResourceMeta ou517  os9
133 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572877 ResourceMeta ou518  os9
134 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572878 ResourceMeta ou519  os9
135 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572879 ResourceMeta ou520  os9
136 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572880 ResourceMeta ou521  os9
137 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573016 ResourceMeta ou522  os9
138 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572889 ResourceMeta ou523  os9
139 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573017 ResourceMeta ou524  os9
140 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573018 ResourceMeta ou525  os9
141 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573019 ResourceMeta ou526  os9
142 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180098 ResourceMeta ou527  os9
143 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=555659 ResourceMeta ou528  os9
144 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573020 ResourceMeta ou529  os9
145 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180099 ResourceMeta ou530  os9
146 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573021 ResourceMeta ou531  os9
147 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573022 ResourceMeta ou532  os9
148 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573023 ResourceMeta ou533  os9
149 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573024 ResourceMeta ou534  os9
150 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573025 ResourceMeta ou535  os9
151 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573026 ResourceMeta ou536  os9
152 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573027 ResourceMeta ou537  os9
153 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573028 ResourceMeta ou538  os9
154 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573029 ResourceMeta ou539  os9
155 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573030 ResourceMeta ou540  os9
156 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573031 ResourceMeta ou541  os9
157 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944041 ResourceMeta ou542  os9
158 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572861 ResourceMeta ou543  os9
159 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572862 ResourceMeta ou544  os9
160 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573032 ResourceMeta ou545  os9
161 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944263 ResourceMeta ou546  os9
162 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573040 ResourceMeta ou547  os9
163 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572890 ResourceMeta ou548  os9
164 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572891 ResourceMeta ou549  os9
165 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572902 ResourceMeta ou550  os9
166 tc:toTaxon  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572903 ResourceMeta ou551  os9
    Meta
1   m563
2   m564
3   m565
4   m566
5   m567
6   m568
7   m569
8   m570
9   m571
10  m572
11  m573
12  m574
13  m575
14  m576
15  m577
16  m578
17  m579
18  m580
19  m581
20  m582
21  m583
22  m584
23  m585
24  m586
25  m587
26  m588
27  m589
28  m590
29  m591
30  m592
31  m593
32  m594
33  m595
34  m596
35  m597
36  m598
37  m599
38  m600
39  m601
40  m602
41  m603
42  m604
43  m605
44  m606
45  m607
46  m608
47  m609
48  m610
49  m611
50  m612
51  m613
52  m614
53  m615
54  m616
55  m617
56  m618
57  m619
58  m620
59  m621
60  m622
61  m623
62  m624
63  m625
64  m626
65  m627
66  m628
67  m629
68  m630
69  m631
70  m632
71  m633
72  m634
73  m635
74  m636
75  m637
76  m638
77  m639
78  m640
79  m641
80  m642
81  m643
82  m644
83  m645
84  m646
85  m647
86  m648
87  m649
88  m650
89  m651
90  m652
91  m653
92  m654
93  m655
94  m656
95  m657
96  m658
97  m659
98  m660
99  m661
100 m662
101 m663
102 m664
103 m665
104 m666
105 m667
106 m668
107 m669
108 m670
109 m671
110 m672
111 m673
112 m674
113 m675
114 m676
115 m677
116 m678
117 m679
118 m680
119 m681
120 m682
121 m683
122 m684
123 m685
124 m686
125 m687
126 m688
127 m689
128 m690
129 m691
130 m692
131 m693
132 m694
133 m695
134 m696
135 m697
136 m698
137 m699
138 m700
139 m701
140 m702
141 m703
142 m704
143 m705
144 m706
145 m707
146 m708
147 m709
148 m710
149 m711
150 m712
151 m713
152 m714
153 m715
154 m716
155 m717
156 m718
157 m719
158 m720
159 m721
160 m722
161 m723
162 m724
163 m725
164 m726
165 m727
166 m728
 [ reached 'max' / getOption("max.print") -- omitted 66 rows ]
      otu                        label xsi.type otus
1   ou385  Allenopithecus_nigroviridis       NA  os9
2   ou386          Allocebus_trichotis       NA  os9
3   ou387            Alouatta_belzebul       NA  os9
4   ou388              Alouatta_caraya       NA  os9
5   ou389           Alouatta_coibensis       NA  os9
6   ou390               Alouatta_fusca       NA  os9
7   ou391            Alouatta_palliata       NA  os9
8   ou392               Alouatta_pigra       NA  os9
9   ou393                Alouatta_sara       NA  os9
10  ou394           Alouatta_seniculus       NA  os9
11  ou395                 Aotus_azarai       NA  os9
12  ou396              Aotus_brumbacki       NA  os9
13  ou397           Aotus_hershkovitzi       NA  os9
14  ou398              Aotus_infulatus       NA  os9
15  ou399              Aotus_lemurinus       NA  os9
16  ou400                Aotus_miconax       NA  os9
17  ou401              Aotus_nancymaae       NA  os9
18  ou402              Aotus_nigriceps       NA  os9
19  ou403            Aotus_trivirgatus       NA  os9
20  ou404             Aotus_vociferans       NA  os9
21  ou405            Arctocebus_aureus       NA  os9
22  ou406      Arctocebus_calabarensis       NA  os9
23  ou407             Ateles_belzebuth       NA  os9
24  ou408                Ateles_chamek       NA  os9
25  ou409             Ateles_fusciceps       NA  os9
26  ou410             Ateles_geoffroyi       NA  os9
27  ou411            Ateles_marginatus       NA  os9
28  ou412              Ateles_paniscus       NA  os9
29  ou413                Avahi_laniger       NA  os9
30  ou414      Brachyteles_arachnoides       NA  os9
31  ou415               Cacajao_calvus       NA  os9
32  ou416       Cacajao_melanocephalus       NA  os9
33  ou417          Callicebus_brunneus       NA  os9
34  ou418         Callicebus_caligatus       NA  os9
35  ou419       Callicebus_cinerascens       NA  os9
36  ou420           Callicebus_cupreus       NA  os9
37  ou421      Callicebus_donacophilus       NA  os9
38  ou422            Callicebus_dubius       NA  os9
39  ou423        Callicebus_hoffmannsi       NA  os9
40  ou424          Callicebus_modestus       NA  os9
41  ou425            Callicebus_moloch       NA  os9
42  ou426          Callicebus_oenanthe       NA  os9
43  ou427           Callicebus_olallae       NA  os9
44  ou428        Callicebus_personatus       NA  os9
45  ou429         Callicebus_torquatus       NA  os9
46  ou430            Callimico_goeldii       NA  os9
47  ou431         Callithrix_argentata       NA  os9
48  ou432            Callithrix_aurita       NA  os9
49  ou433         Callithrix_flaviceps       NA  os9
50  ou434         Callithrix_geoffroyi       NA  os9
51  ou435      Callithrix_humeralifera       NA  os9
52  ou436           Callithrix_jacchus       NA  os9
53  ou437            Callithrix_kuhlii       NA  os9
54  ou438       Callithrix_penicillata       NA  os9
55  ou439           Callithrix_pygmaea       NA  os9
56  ou440              Cebus_albifrons       NA  os9
57  ou441                 Cebus_apella       NA  os9
58  ou442              Cebus_capucinus       NA  os9
59  ou443              Cebus_olivaceus       NA  os9
60  ou444            Cercocebus_agilis       NA  os9
61  ou445         Cercocebus_galeritus       NA  os9
62  ou446         Cercocebus_torquatus       NA  os9
63  ou447       Cercopithecus_ascanius       NA  os9
64  ou448      Cercopithecus_campbelli       NA  os9
65  ou449         Cercopithecus_cephus       NA  os9
66  ou450          Cercopithecus_diana       NA  os9
67  ou451          Cercopithecus_dryas       NA  os9
68  ou452  Cercopithecus_erythrogaster       NA  os9
69  ou453     Cercopithecus_erythrotis       NA  os9
70  ou454        Cercopithecus_hamlyni       NA  os9
71  ou455        Cercopithecus_lhoesti       NA  os9
72  ou456          Cercopithecus_mitis       NA  os9
73  ou457           Cercopithecus_mona       NA  os9
74  ou458      Cercopithecus_neglectus       NA  os9
75  ou459      Cercopithecus_nictitans       NA  os9
76  ou460     Cercopithecus_petaurista       NA  os9
77  ou461       Cercopithecus_pogonias       NA  os9
78  ou462        Cercopithecus_preussi       NA  os9
79  ou463       Cercopithecus_sclateri       NA  os9
80  ou464        Cercopithecus_solatus       NA  os9
81  ou465          Cercopithecus_wolfi       NA  os9
82  ou466           Cheirogaleus_major       NA  os9
83  ou467          Cheirogaleus_medius       NA  os9
84  ou468         Chiropotes_albinasus       NA  os9
85  ou469           Chiropotes_satanas       NA  os9
86  ou470         Chlorocebus_aethiops       NA  os9
87  ou471           Colobus_angolensis       NA  os9
88  ou472              Colobus_guereza       NA  os9
89  ou473            Colobus_polykomos       NA  os9
90  ou474              Colobus_satanas       NA  os9
91  ou475 Daubentonia_madagascariensis       NA  os9
92  ou476           Erythrocebus_patas       NA  os9
93  ou477            Eulemur_coronatus       NA  os9
94  ou478               Eulemur_fulvus       NA  os9
95  ou479               Eulemur_macaco       NA  os9
96  ou480               Eulemur_mongoz       NA  os9
97  ou481          Eulemur_rubriventer       NA  os9
98  ou482         Euoticus_elegantulus       NA  os9
99  ou483            Euoticus_pallidus       NA  os9
100 ou484                Galago_alleni       NA  os9
101 ou485              Galago_gallarum       NA  os9
102 ou486             Galago_matschiei       NA  os9
103 ou487                Galago_moholi       NA  os9
104 ou488          Galago_senegalensis       NA  os9
105 ou489          Galagoides_demidoff       NA  os9
106 ou490      Galagoides_zanzibaricus       NA  os9
107 ou491              Gorilla_gorilla       NA  os9
108 ou492             Hapalemur_aureus       NA  os9
109 ou493            Hapalemur_griseus       NA  os9
110 ou494              Hapalemur_simus       NA  os9
111 ou495                 Homo_sapiens       NA  os9
112 ou496             Hylobates_agilis       NA  os9
113 ou497           Hylobates_concolor       NA  os9
114 ou498         Hylobates_gabriellae       NA  os9
115 ou499            Hylobates_hoolock       NA  os9
116 ou500            Hylobates_klossii       NA  os9
117 ou501                Hylobates_lar       NA  os9
118 ou502         Hylobates_leucogenys       NA  os9
119 ou503             Hylobates_moloch       NA  os9
120 ou504           Hylobates_muelleri       NA  os9
121 ou505           Hylobates_pileatus       NA  os9
122 ou506        Hylobates_syndactylus       NA  os9
123 ou507                  Indri_indri       NA  os9
124 ou508         Lagothrix_flavicauda       NA  os9
125 ou509         Lagothrix_lagotricha       NA  os9
126 ou510                  Lemur_catta       NA  os9
127 ou511      Leontopithecus_caissara       NA  os9
128 ou512    Leontopithecus_chrysomela       NA  os9
129 ou513   Leontopithecus_chrysopygus       NA  os9
130 ou514       Leontopithecus_rosalia       NA  os9
131 ou515           Lepilemur_dorsalis       NA  os9
132 ou516           Lepilemur_edwardsi       NA  os9
133 ou517           Lepilemur_leucopus       NA  os9
134 ou518           Lepilemur_microdon       NA  os9
135 ou519         Lepilemur_mustelinus       NA  os9
136 ou520       Lepilemur_ruficaudatus       NA  os9
137 ou521    Lepilemur_septentrionalis       NA  os9
138 ou522          Lophocebus_albigena       NA  os9
139 ou523            Loris_tardigradus       NA  os9
140 ou524             Macaca_arctoides       NA  os9
141 ou525            Macaca_assamensis       NA  os9
142 ou526              Macaca_cyclopis       NA  os9
143 ou527          Macaca_fascicularis       NA  os9
144 ou528               Macaca_fuscata       NA  os9
145 ou529                 Macaca_maura       NA  os9
146 ou530               Macaca_mulatta       NA  os9
147 ou531            Macaca_nemestrina       NA  os9
148 ou532                 Macaca_nigra       NA  os9
149 ou533              Macaca_ochreata       NA  os9
150 ou534               Macaca_radiata       NA  os9
151 ou535               Macaca_silenus       NA  os9
152 ou536                Macaca_sinica       NA  os9
153 ou537              Macaca_sylvanus       NA  os9
154 ou538             Macaca_thibetana       NA  os9
155 ou539              Macaca_tonkeana       NA  os9
156 ou540       Mandrillus_leucophaeus       NA  os9
157 ou541            Mandrillus_sphinx       NA  os9
158 ou542         Microcebus_coquereli       NA  os9
159 ou543           Microcebus_murinus       NA  os9
160 ou544             Microcebus_rufus       NA  os9
161 ou545         Miopithecus_talapoin       NA  os9
162 ou546             Nasalis_concolor       NA  os9
163 ou547             Nasalis_larvatus       NA  os9
164 ou548           Nycticebus_coucang       NA  os9
165 ou549          Nycticebus_pygmaeus       NA  os9
166 ou550      Otolemur_crassicaudatus       NA  os9
167 ou551           Otolemur_garnettii       NA  os9
168 ou552                 Pan_paniscus       NA  os9
169 ou553              Pan_troglodytes       NA  os9
170 ou554              Papio_hamadryas       NA  os9
171 ou555           Perodicticus_potto       NA  os9
172 ou556              Phaner_furcifer       NA  os9
173 ou557       Pithecia_aequatorialis       NA  os9
174 ou558            Pithecia_albicans       NA  os9
175 ou559            Pithecia_irrorata       NA  os9
176 ou560            Pithecia_monachus       NA  os9
177 ou561            Pithecia_pithecia       NA  os9
178 ou562               Pongo_pygmaeus       NA  os9
179 ou563             Presbytis_comata       NA  os9
180 ou564          Presbytis_femoralis       NA  os9
181 ou565           Presbytis_frontata       NA  os9
182 ou566              Presbytis_hosei       NA  os9
183 ou567         Presbytis_melalophos       NA  os9
184 ou568         Presbytis_potenziani       NA  os9
185 ou569          Presbytis_rubicunda       NA  os9
186 ou570            Presbytis_thomasi       NA  os9
187 ou571            Procolobus_badius       NA  os9
188 ou572         Procolobus_pennantii       NA  os9
189 ou573           Procolobus_preussi       NA  os9
190 ou574      Procolobus_rufomitratus       NA  os9
191 ou575             Procolobus_verus       NA  os9
192 ou576          Propithecus_diadema       NA  os9
193 ou577      Propithecus_tattersalli       NA  os9
194 ou578        Propithecus_verreauxi       NA  os9
195 ou579          Pygathrix_avunculus       NA  os9
196 ou580              Pygathrix_bieti       NA  os9
197 ou581           Pygathrix_brelichi       NA  os9
198 ou582            Pygathrix_nemaeus       NA  os9
199 ou583          Pygathrix_roxellana       NA  os9
200 ou584             Saguinus_bicolor       NA  os9
201 ou585         Saguinus_fuscicollis       NA  os9
202 ou586           Saguinus_geoffroyi       NA  os9
203 ou587           Saguinus_imperator       NA  os9
204 ou588             Saguinus_inustus       NA  os9
205 ou589            Saguinus_labiatus       NA  os9
206 ou590            Saguinus_leucopus       NA  os9
207 ou591               Saguinus_midas       NA  os9
208 ou592              Saguinus_mystax       NA  os9
209 ou593         Saguinus_nigricollis       NA  os9
210 ou594             Saguinus_oedipus       NA  os9
211 ou595         Saguinus_tripartitus       NA  os9
212 ou596          Saimiri_boliviensis       NA  os9
213 ou597            Saimiri_oerstedii       NA  os9
214 ou598             Saimiri_sciureus       NA  os9
215 ou599                Saimiri_ustus       NA  os9
216 ou600           Saimiri_vanzolinii       NA  os9
217 ou601       Semnopithecus_entellus       NA  os9
218 ou602             Tarsius_bancanus       NA  os9
219 ou603               Tarsius_dianae       NA  os9
220 ou604              Tarsius_pumilus       NA  os9
221 ou605             Tarsius_spectrum       NA  os9
222 ou606             Tarsius_syrichta       NA  os9
223 ou607         Theropithecus_gelada       NA  os9
224 ou608       Trachypithecus_auratus       NA  os9
225 ou609     Trachypithecus_cristatus       NA  os9
226 ou610     Trachypithecus_francoisi       NA  os9
227 ou611          Trachypithecus_geei       NA  os9
228 ou612        Trachypithecus_johnii       NA  os9
229 ou613      Trachypithecus_obscurus       NA  os9
230 ou614       Trachypithecus_phayrei       NA  os9
231 ou615      Trachypithecus_pileatus       NA  os9
232 ou616       Trachypithecus_vetulus       NA  os9
233 ou617            Varecia_variegata       NA  os9
                         taxa        x
1 Allenopithecus_nigroviridis 8.465900
2         Allocebus_trichotis 4.368181
3           Alouatta_belzebul 8.729074
4             Alouatta_caraya 8.628735
5          Alouatta_coibensis 8.764053
6              Alouatta_fusca 8.554489

Now that we have nice data.frame objects for all our data, it’s easy to join them into the desired table with a few obvious dplyr commands:

      otu                        label         x
1   ou385  Allenopithecus_nigroviridis  8.465900
2   ou386          Allocebus_trichotis  4.368181
3   ou387            Alouatta_belzebul  8.729074
4   ou388              Alouatta_caraya  8.628735
5   ou389           Alouatta_coibensis  8.764053
6   ou390               Alouatta_fusca  8.554489
7   ou391            Alouatta_palliata  8.791790
8   ou392               Alouatta_pigra  8.881836
9   ou393                Alouatta_sara  8.796339
10  ou394           Alouatta_seniculus  8.767173
11  ou395                 Aotus_azarai  7.127694
12  ou396              Aotus_brumbacki  6.401917
13  ou397           Aotus_hershkovitzi  6.684612
14  ou398              Aotus_infulatus  7.122867
15  ou399              Aotus_lemurinus  6.781058
16  ou400                Aotus_miconax  6.684612
17  ou401              Aotus_nancymaae  6.678342
18  ou402              Aotus_nigriceps  6.966024
19  ou403            Aotus_trivirgatus  6.815640
20  ou404             Aotus_vociferans  6.771936
21  ou405            Arctocebus_aureus  5.459586
22  ou406      Arctocebus_calabarensis  5.552960
23  ou407             Ateles_belzebuth  8.812843
24  ou408                Ateles_chamek  8.872067
25  ou409             Ateles_fusciceps  9.112728
26  ou410             Ateles_geoffroyi  8.937218
27  ou411            Ateles_marginatus  8.738735
28  ou412              Ateles_paniscus  9.072227
29  ou413                Avahi_laniger  6.927558
30  ou414      Brachyteles_arachnoides  9.268609
31  ou415               Cacajao_calvus  8.137396
32  ou416       Cacajao_melanocephalus  8.051978
33  ou417          Callicebus_brunneus  6.747587
34  ou418         Callicebus_caligatus  6.899723
35  ou419       Callicebus_cinerascens  6.899723
36  ou420           Callicebus_cupreus  7.021084
37  ou421      Callicebus_donacophilus  6.801283
38  ou422            Callicebus_dubius  6.899723
39  ou423        Callicebus_hoffmannsi  6.975414
40  ou424          Callicebus_modestus  6.899723
41  ou425            Callicebus_moloch  6.872128
42  ou426          Callicebus_oenanthe  6.899723
43  ou427           Callicebus_olallae  6.899723
44  ou428        Callicebus_personatus  7.237059
45  ou429         Callicebus_torquatus  7.106606
46  ou430            Callimico_goeldii  6.324359
47  ou431         Callithrix_argentata  5.910797
48  ou432            Callithrix_aurita  5.961005
49  ou433         Callithrix_flaviceps  5.926926
50  ou434         Callithrix_geoffroyi  5.834811
51  ou435      Callithrix_humeralifera  5.926926
52  ou436           Callithrix_jacchus  5.673323
53  ou437            Callithrix_kuhlii  5.926926
54  ou438       Callithrix_penicillata  5.828946
55  ou439           Callithrix_pygmaea  4.828314
56  ou440              Cebus_albifrons  7.832014
57  ou441                 Cebus_apella  7.922986
58  ou442              Cebus_capucinus  8.009695
59  ou443              Cebus_olivaceus  7.937375
60  ou444            Cercocebus_agilis  8.870663
61  ou445         Cercocebus_galeritus  8.865029
62  ou446         Cercocebus_torquatus  8.894259
63  ou447       Cercopithecus_ascanius  8.171882
64  ou448      Cercopithecus_campbelli  8.199739
65  ou449         Cercopithecus_cephus  8.143227
66  ou450          Cercopithecus_diana  8.382518
67  ou451          Cercopithecus_dryas  7.930206
68  ou452  Cercopithecus_erythrogaster  8.143227
69  ou453     Cercopithecus_erythrotis  8.086410
70  ou454        Cercopithecus_hamlyni  8.438150
71  ou455        Cercopithecus_lhoesti  8.579229
72  ou456          Cercopithecus_mitis  8.525161
73  ou457           Cercopithecus_mona  8.289037
74  ou458      Cercopithecus_neglectus  8.579229
75  ou459      Cercopithecus_nictitans  8.567886
76  ou460     Cercopithecus_petaurista  8.083329
77  ou461       Cercopithecus_pogonias  8.183118
78  ou462        Cercopithecus_preussi  8.544808
79  ou463       Cercopithecus_sclateri  8.029433
80  ou464        Cercopithecus_solatus  8.567886
81  ou465          Cercopithecus_wolfi  8.089482
82  ou466           Cheirogaleus_major  6.104793
83  ou467          Cheirogaleus_medius  5.283204
84  ou468         Chiropotes_albinasus  7.937375
85  ou469           Chiropotes_satanas  7.996317
86  ou470         Chlorocebus_aethiops  8.301522
87  ou471           Colobus_angolensis  9.103868
88  ou472              Colobus_guereza  9.210340
89  ou473            Colobus_polykomos  9.060680
90  ou474              Colobus_satanas  9.121509
91  ou475 Daubentonia_madagascariensis  7.919356
92  ou476           Erythrocebus_patas  8.988446
93  ou477            Eulemur_coronatus  7.438384
94  ou478               Eulemur_fulvus  7.779049
95  ou479               Eulemur_macaco  7.816014
96  ou480               Eulemur_mongoz  7.478735
97  ou481          Eulemur_rubriventer  7.620705
98  ou482         Euoticus_elegantulus  5.690359
99  ou483            Euoticus_pallidus  5.627621
100 ou484                Galago_alleni  5.521461
101 ou485              Galago_gallarum  5.365976
102 ou486             Galago_matschiei  5.267858
103 ou487                Galago_moholi  5.375278
104 ou488          Galago_senegalensis  5.594711
105 ou489          Galagoides_demidoff  4.206184
106 ou490      Galagoides_zanzibaricus  4.997212
107 ou491              Gorilla_gorilla 11.643954
108 ou492             Hapalemur_aureus  7.358831
109 ou493            Hapalemur_griseus  6.862758
110 ou494              Hapalemur_simus  7.620705
111 ou495                 Homo_sapiens 10.980195
112 ou496             Hylobates_agilis  8.675905
113 ou497           Hylobates_concolor  8.768730
114 ou498         Hylobates_gabriellae  9.047821
115 ou499            Hylobates_hoolock  8.809863
116 ou500            Hylobates_klossii  8.674197
117 ou501                Hylobates_lar  8.635865
118 ou502         Hylobates_leucogenys  8.898366
119 ou503             Hylobates_moloch  8.677610
120 ou504           Hylobates_muelleri  8.687779
121 ou505           Hylobates_pileatus  8.630522
122 ou506        Hylobates_syndactylus  9.296518
123 ou507                  Indri_indri  9.065315
124 ou508         Lagothrix_flavicauda  9.020390
125 ou509         Lagothrix_lagotricha  8.743532
126 ou510                  Lemur_catta  7.878534
127 ou511      Leontopithecus_caissara  6.405228
128 ou512    Leontopithecus_chrysomela  6.352629
129 ou513   Leontopithecus_chrysopygus  6.486161
130 ou514       Leontopithecus_rosalia  6.385194
131 ou515           Lepilemur_dorsalis  6.232448
132 ou516           Lepilemur_edwardsi  6.711740
133 ou517           Lepilemur_leucopus  6.396930
134 ou518           Lepilemur_microdon  6.863803
135 ou519         Lepilemur_mustelinus  6.508769
136 ou520       Lepilemur_ruficaudatus  6.637258
137 ou521    Lepilemur_septentrionalis  6.638568
138 ou522          Lophocebus_albigena  8.903815
139 ou523            Loris_tardigradus  5.517453
140 ou524             Macaca_arctoides  9.148465
141 ou525            Macaca_assamensis  9.054855
142 ou526              Macaca_cyclopis  8.658693
143 ou527          Macaca_fascicularis  8.431635
144 ou528               Macaca_fuscata  9.220291
145 ou529                 Macaca_maura  8.894259
146 ou530               Macaca_mulatta  8.771835
147 ou531            Macaca_nemestrina  8.970813
148 ou532                 Macaca_nigra  8.906529
149 ou533              Macaca_ochreata  7.919356
150 ou534               Macaca_radiata  8.517193
151 ou535               Macaca_silenus  8.699515
152 ou536                Macaca_sinica  8.446771
153 ou537              Macaca_sylvanus  9.350102
154 ou538             Macaca_thibetana  9.268609
155 ou539              Macaca_tonkeana  9.220291
156 ou540       Mandrillus_leucophaeus  9.560997
157 ou541            Mandrillus_sphinx  9.729134
158 ou542         Microcebus_coquereli  5.793014
159 ou543           Microcebus_murinus  4.198705
160 ou544             Microcebus_rufus  3.881564
161 ou545         Miopithecus_talapoin  7.130899
162 ou546             Nasalis_concolor  8.979354
163 ou547             Nasalis_larvatus  9.417355
164 ou548           Nycticebus_coucang  6.878326
165 ou549          Nycticebus_pygmaeus  5.840642
166 ou550      Otolemur_crassicaudatus  7.130899
167 ou551           Otolemur_garnettii  6.701960
168 ou552                 Pan_paniscus 10.468801
169 ou553              Pan_troglodytes 10.716638
170 ou554              Papio_hamadryas  9.735069
171 ou555           Perodicticus_potto  6.984716
172 ou556              Phaner_furcifer  6.016157
173 ou557       Pithecia_aequatorialis  7.774856
174 ou558            Pithecia_albicans  7.937375
175 ou559            Pithecia_irrorata  7.749322
176 ou560            Pithecia_monachus  7.654443
177 ou561            Pithecia_pithecia  7.420579
178 ou562               Pongo_pygmaeus 10.860920
179 ou563             Presbytis_comata  9.039552
180 ou564          Presbytis_femoralis  8.797851
181 ou565           Presbytis_frontata  8.853665
182 ou566              Presbytis_hosei  8.725832
183 ou567         Presbytis_melalophos  8.748305
184 ou568         Presbytis_potenziani  8.774931
185 ou569          Presbytis_rubicunda  8.773385
186 ou570            Presbytis_thomasi  8.765615
187 ou571            Procolobus_badius  8.808369
188 ou572         Procolobus_pennantii  9.122601
189 ou573           Procolobus_preussi  9.094930
190 ou574      Procolobus_rufomitratus  8.995909
191 ou575             Procolobus_verus  8.289037
192 ou576          Propithecus_diadema  8.794825
193 ou577      Propithecus_tattersalli  8.171882
194 ou578        Propithecus_verreauxi  8.202482
195 ou579          Pygathrix_avunculus  9.164296
196 ou580              Pygathrix_bieti  9.118225
197 ou581           Pygathrix_brelichi  9.305651
198 ou582            Pygathrix_nemaeus  9.417355
199 ou583          Pygathrix_roxellana  9.510445
200 ou584             Saguinus_bicolor  6.142037
201 ou585         Saguinus_fuscicollis  5.976351
202 ou586           Saguinus_geoffroyi  6.200509
203 ou587           Saguinus_imperator  6.016157
204 ou588             Saguinus_inustus  6.688355
205 ou589            Saguinus_labiatus  6.234411
206 ou590            Saguinus_leucopus  6.124683
207 ou591               Saguinus_midas  6.293419
208 ou592              Saguinus_mystax  6.326149
209 ou593         Saguinus_nigricollis  6.109248
210 ou594             Saguinus_oedipus  6.139885
211 ou595         Saguinus_tripartitus  5.953243
212 ou596          Saimiri_boliviensis  6.690842
213 ou597            Saimiri_oerstedii  6.570883
214 ou598             Saimiri_sciureus  6.620073
215 ou599                Saimiri_ustus  6.791221
216 ou600           Saimiri_vanzolinii  6.664409
217 ou601       Semnopithecus_entellus  9.441452
218 ou602             Tarsius_bancanus  4.736198
219 ou603               Tarsius_dianae  4.709530
220 ou604              Tarsius_pumilus  4.808111
221 ou605             Tarsius_spectrum  5.111988
222 ou606             Tarsius_syrichta  4.753590
223 ou607         Theropithecus_gelada  9.680344
224 ou608       Trachypithecus_auratus  9.181941
225 ou609     Trachypithecus_cristatus  8.872067
226 ou610     Trachypithecus_francoisi  9.008224
227 ou611          Trachypithecus_geei  9.031214
228 ou612        Trachypithecus_johnii  9.268609
229 ou613      Trachypithecus_obscurus  8.870663
230 ou614       Trachypithecus_phayrei  8.948976
231 ou615      Trachypithecus_pileatus  9.323669
232 ou616       Trachypithecus_vetulus  8.969542
233 ou617            Varecia_variegata  8.261010
                                                                                     href
1    http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572992
2    http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572857
3    http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572935
4    http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572936
5    http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945168
6    http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945164
7    http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572939
8    http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572940
9    http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572941
10   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572942
11   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944172
12   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572944
13   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949
14   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945149
15   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572949
16   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572947
17   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572945
18   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572946
19   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572951
20   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572952
21   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572887
22   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572888
23   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572954
24   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572955
25   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572957
26   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572958
27   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572956
28   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572953
29   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572881
30   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572959
31   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572983
32   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572984
33  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025131
34  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134
35  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025122
36  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025127
37  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025112
38  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025134
39  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025125
40  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025116
41  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025119
42  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025114
43  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025115
44   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572962
45  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025106
46   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572909
47   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944125
48   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572911
49   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572912
50   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572913
51   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944138
52   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572915
53   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572916
54   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572918
55   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944123
56   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572975
57   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944156
58   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572977
59   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572978
60   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572993
61   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572994
62   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572995
63   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572996
64   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572997
65   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572998
66   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572999
67   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573000
68   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573001
69   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573002
70   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573003
71   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944219
72   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573005
73   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573006
74   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573007
75   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573008
76   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573009
77   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573010
78   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945227
79   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573014
80   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944221
81   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573011
82   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572858
83   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572859
84   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572985
85   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572986
86   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=552515
87   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573035
88   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573036
89   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573037
90   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573038
91   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572886
92   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573015
93   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572865
94   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572864
95   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572866
96   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572867
97   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572868
98   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572893
99   http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572894
100  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944100
101  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572896
102  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572897
103  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572898
104  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572899
105  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572900
106 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025177
107  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573080
108  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572869
109  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572870
110  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944072
111  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180092
112  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573069
113  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944286
114  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944292
115  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945338
116  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573073
117  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573074
118  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944290
119  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573076
120  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573077
121  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573078
122  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944293
123  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572882
124  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572961
125  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944187
126  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572872
127  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572921
128                                                                                  <NA>
129  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572920
130  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572922
131  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572874
132  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572875
133  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572876
134  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572877
135  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572878
136  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572879
137  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572880
138  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573016
139  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572889
140  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573017
141  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573018
142  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573019
143  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180098
144  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=555659
145  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573020
146  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180099
147  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573021
148  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573022
149  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573023
150  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573024
151  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573025
152  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573026
153  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573027
154  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573028
155  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573029
156  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573030
157  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573031
158  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944041
159  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572861
160  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572862
161  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573032
162  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944263
163  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573040
164  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572890
165  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572891
166  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572902
167  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572903
168  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573081
169  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573082
170  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573033
171  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572892
172  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572863
173  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572987
174  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572988
175  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572989
176  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572990
177  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572991
178  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573083
179  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573041
180  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573042
181  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573043
182  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573044
183  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573045
184  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573046
185  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573047
186  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573048
187  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944230
188  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944235
189  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944238
190  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944239
191  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573053
192  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572883
193  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572884
194  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572885
195  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944258
196  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944259
197  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944260
198  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573057
199  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945308
200  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572923
201  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=998616
202  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572925
203  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572926
204  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572927
205  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572928
206  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572929
207  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572930
208  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572931
209  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=998617
210  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572933
211 http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=1025098
212  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572979
213  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572980
214  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180095
215  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572981
216  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572982
217  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573059
218  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945103
219  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944117
220  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572906
221  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944115
222  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=945107
223  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573034
224  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573060
225  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573061
226  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573062
227  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573063
228  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944270
229  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573065
230  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573066
231  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=573067
232  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944269
233  http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=572873

Because these are all from the same otus block anyway, we haven’t selected that column, but were it of interest it is also available in the taxa table.

RNeXML/inst/CITATION0000644000176200001440000000110513552353762013441 0ustar liggesusersbibentry(bibtype = "Article", header = "To cite RNeXML in publications, please use:", title = "{RNeXML}: {A} Package for Reading and Writing Richly Annotated Phylogenetic, Character, and Trait Data in {R}", journal = "Methods in Ecology and Evolution", author = c( person("Carl", "Boettiger"), person("Scott", "Chamberlain"), person("Rutger", "Vos"), person("Hilmar", "Lapp")), year = 2016, volume = 7, pages = "352--357", doi = "10.1111/2041-210X.12469") RNeXML/inst/simmap.md0000644000176200001440000000333413552353762014122 0ustar liggesusers## simmap NeXML definitions - Author: Carl Boettiger - Initial version: 2014-03-21 Definitions of the `simmap` namespace, as defined for the use in `RNeXML`. The prefix `nex:` refers to the [NeXML schema](http://www.nexml.org/2009). term | definition ------------------- | ------------- `simmap:reconstructions` | A container of one or more stochastic character map reconstructions, as a `meta` child of a the `nex:edge` element to which the contained stochastic character map reconstructions are being assigned. `simmap:reconstruction` | A single stochastic character map reconstruction for a given `nex:edge`. Normally nested within a `simmap:reconstructions` element. `simmap:char` | The id of a character trait, as defined by the `nex:char` element with this value as its `id`. This is a property of a `simmap:reconstruction`. `simmap:stateChange` | A character state assignment to the given `nex:edge` during a specified interval, as a property of a `simmap:reconstruction`. Must have children `simmap:order`, `simmap:length`, and `simmap:state`. `simmap:order` | The chronological order (from the root) in which the state is assigned to the edge. An edge that does not change states still has `simmap:order` 1. This is a property of a `simmap:stateChange`. `simmap:length` | The duration for which the edge occupies the assigned state, in the same units as the `nex:length` attribute defined on the `nex:edge` being annotated. This is a property of a `simmap:stateChange`. `simmap:state` | The id of a `nex:state` of the `nex:char` identified by the `simmap:char` property of the `simmap:reconstruction`. This is a property of a `simmap:stateChange`. RNeXML/inst/WORDLIST0000644000176200001440000000115513552353762013503 0ustar liggesusersal arXiv bugfix Bugfixes BugReports callNextMethod cladogram codecov datatypes doi DOI dplyr et figshare Figshare fs geiger href http io lapply ListOfmeta LiteralMeta MEE MethodDefinition MethodWithNext multiphylo multiPhylo namespaced newick Newick nex nexml NeXML NeXML's OmegaHat os otu OTU otus OTUs ouput Panton parsers phy phylo phylobase phylogenies phyloinformatic phylows phytools rdf RDF RDFa rdflib resourceMeta ResourceMeta Revell ropensci simmap solaris SPARQL standardGeneric taxadb taxize testthat tidyr triplestore ultrametric URI URIs uuid validator www XMLInternalDocument XMLInternalElementNode xs xsi