Uploading trees to the server

Trees can be uploaded by HTTP multipart/form-data POST to the /parseTree service. (See this page for how to deploy the server.)

  • Request parameters
    • newickData: the newick string
    • name: (optional) The name of the tree
  • Response
    • The service will immediately return an HTTP 202 Accepted, with the URL to view the tree in a Location header, and also in the body.
    • Large trees may take several minutes to import.)
    • If exactly the same newick string has already been uploaded, the URL for the existing tree is returned.

In the following example, curl is used to upload a tree. These assumptions are made:

  • An instance of phyloviewer running on a tomcat server with a root at http://example.com/
  • A file named tree.nwk containing a newick string

curl -i -F "newickData=@tree.nwk" -F "name=NCBIvertebrates" http://example.com/parseTree

Alternatively, the tree can be described with a Newick string

curl -X POST -F "newickData=((((((Acer_mono:30.8,((Acer_crataegifolium:8.8,Acer_pensylvanicum:8.8):6.3,(Acer_rufinerve:2.3,Acer_tschonoskii:2.3):12.8):15.7):6.8,Acer_saccharum:37.6):1.6,((Acer_palmatum:3.6,Acer_sieboldianum:3.6):8.1,Acer_circinatum:11.7):27.5):1.1,((Acer_carpinifolium:24.8,Acer_spicatum:24.8):13,Acer_nipponicum:37.8):2.5):2.9,(Acer_distylum:28.7,(Acer_rubrum:2.7,Acer_saccharinum:2.7):26):14.5):2.1,Acer_glabrum:45.3);" -F "name=Acer" http://portnoy.iplantcollaborative.org/parseTree