curl
curl
is a handy command line tool for interacting
with websites. You can send the data from a web-form back to
the server from curl
, if you know the
parameters. The easiest way to use this to send data to
phylomatic is first to create a text file (e.g.,
phylomatic.dat
) with the parameter data:
storedtree=R20120829&informat=newick&method=phylomatic& taxaformat=slashpath&outformat=newick& taxa=acanthaceae%2Fbravaisia%2Fbravaisia_sp1%0D acanthaceae%2Fsuessenguthia%2Fsuessenguthia_sp1%0D ... %0D
Note that there should be no line-breaks in your input file. The
whole thing should be one long string of text. The
%2F
and %0D
symbols are URL-encoded
slashes and newline characters, respectively. Then just send
the data to the server with:
$ curl -d @phylomatic.dat http://phylodiversity.net/phylomatic/pmws > output.new
(The > output.new
redirects the output to a
file)
If you have more than about 5,000 taxa, a job on this server will take too long and the gateway will timeout. A limit of 5,000 taxa has now been placed on a taxa file. You have two alternatives:
$ echo "informat=newick&storedtree=R20120829&method=phylomatic&taxauri=http://phylodiversity.net/phylomatic/eg/taxa_sample&outformat=newick&local=1" | path/to/pmws > out.new
(Note the local=1 switch!)
(2017-03-30) It seems people are needing to process more and more taxa, and the online phylomatic is insufficient for many users. Here is a more detailed HOWTO for running phylomatic locally on Windows. Please note, this solution is an ugly kludge (the software is written to work in a UNIX web-service framework, not a Windows desktop!), but it seems to work
informat=newick&storedtree=R20120829&method=phylomatic &taxauri=http://phylodiversity.net/phylomatic/eg/taxa_sample &outformat=newick&local=1&clean=trueThere should be no breaks in the string (unlike the example above). What this command does is pass the same arguments from the phylomatic web form to the program, so see that page if you are unsure of the meaning of the arguments.
TYPE command.txt | gawk -f pmwsYou will see some errors (“Can’t recognize…”, etc.), but you should see a Newick tree appear at the bottom. Success!
TYPE command.txt | gawk -f pmws > mytree.newHit Enter, and go have a cup of tea (or many!). Large taxa lists will take an hour or more to run. Hope this works for you.