Sending
Phylomatic will accept either POST or GET, and one of the output format options is XML. So you can now use Phylomatic as a web service. The format of the GET string is:http://phylodiversity.net/phylomatic/pm/phylomatic.cgi?format=xml&bl=0&tree=****where format is `new’ or `xml’; bl is 0 or 1 to set the branch lengths; and **** is the URL-encoded taxa block (`/’ is %2F ; RETURN is %0D%0A). For example:
http://phylodiversity.net/phylomatic/pm/phylomatic.cgi?format=xml&tree=annonaceae%2Fannona%2FAnnona_cherimola%0D%0Aannonaceae%2Fannona%2FAnnona_muricataFor large input lists, use a POST, since you may run up against a maximum URL length limitation.
Both wget and curl are excellent unix tools for retrieving data via HTTP. E.g.,
curl "http://www.phylodiversity.net/phylomatic/pm/phylomatic.cgi?format=xml&tree=annonaceae%2Fannona%2FAnnona_cherimola%0D%0Aannonaceae%2Fannona%2FAnnona_muricata" > phylomatic_output.xml
Parsing the returned data
You can call plain text with the `format=new’ option. The XML is returned according to an evolving model for coding phylogeny metadata. The schema (in RELAX NG Compact form) is here; it contains (minimal) comments. A template is also available.
Script on!