View on GitHub

parameters darwin sketch

for phyloJIVE

 
Download this project as a .zip fil Download this project as a tar.gz file
  1. parameters
    1. params for the phylogeny explorer web application
      1. ... tree and characters
    2. ... template for simple name based data-sources
      1. .. alternative functions
      2. GUID's (LSIDs)

params for the phylogeny explorer web application

          
width: 550   in pixels
height:800         in pixels
alignName:true
true or false? are names aligned  or adjacent to tips
lateralise:false
true or false? sort the tree by clade branch length
levelsToShow:5 how deep to show?
Clades deeper than this are collapsed to a small triangle that can be expanded on demand.
branchMultiplier:1 multiplier for branches.
Useful for very small or very big branch lengths.
firstCharacter: 'moisture' The name of the first character/trait that will appear by default on the tree. The name must also be in the charJSON.
Node: {
            height: 40,
            width: 20,
            type: 'circle',
            dim: 5,
            color: '#aaa',
            overridable: true,
            align: 'left'
        }
configurable attributes of clades (tree nodes)
        Canvas: {
            background: {
                color: '#EEF2F7'
            }
configurable attributes of the web application Canvas
  Edge: {
            type: 'line',
            color: '#000',
            overridable: true,
            lineWidth: 2
        }
configurable attributes of the lines that make up the phylogenetic tree visualisation
                                         

... tree and characters


tree : 'a newick formatted phylogeny'
A newick formatted tree.
Enclosed in single quotes with no "special characters" (double quotes and such like unless they are escaped. 
... other tree formats are possible but not yet
character: charJSONcharacters
see about charJSON

... template for simple name based data-sources

It may look daunting but the tmpl  variable provides a simple way to include data resouces which provide taxon name based searches.

There is no standard form of call for the biodiversity web services. This template is suited for those that return results that can be displayed without parsing by browsers.

Some biodiversity web services return json and xml, in which case, the result needs to be parsed before it can be displayed.  The functions presentClade, onPresentClade, and Tips can be respecified to achieve this.  The getting started with phyloJIVE lists some examples.

It is essentially a html table that is expanded as required to add the taxon names.

tmpl :
the name of the template
'<table style="border: none"><tbody><tr><th></th><th>links</th><th> </th><th> </th><th> </th><th> </th></tr>' +
            '<% _.each(nodeList , function( value ) {' +
the header row
         '<td><a href="http://THE_First_Resource/<%= value.name %>" title="<%= value.name %> some descriptive text for the tool tip" rel="<%= value.rel %>" class="thumbImage1"><%= value.name %></a></td>' +

link to the resource in  first column which includes the name of the taxon
                '<td><a href="http://Another_Resource/<%= value.name %>" title="about <%= value.name%> some descriptive text for the tool tip" rel="<%= value.rel %>" class="thumbImage1"><id="thumb1"><div class="forward"></div> </id="thumb1"></a></td>' +
 
a resource  which requires a full name. link is shown as an icon
'<td><a href="http://Another_Resource/<%= value.genus %>+<%= value.species %>" title="some descriptive text for the tool tip on <%= value.name %>" rel="<%= value.rel %>" class="thumbImage1"><id="thumb1"><div class="forward"></div> </id="thumb1"></a>' +
               
a resource which requires a genus and species separately. link is shown as an icon
'%></tbody></table></div>'
closing


Here is an example which includes links to

            tmpl :  '<table style="border: none"><tbody><tr><th></th><th>links</th><th> </th><th> </th><th> </th><th> </th></tr>' +
            '<% _.each(nodeList , function( value ) {' +
            ' %> <tr>'+
                '<td><a href="http://www.environment.gov.au/biodiversity/abrs/online-resources/fauna/afd/taxa/<%= value.name %>" title="<%= value.name %> in the AFD" rel="<%= value.rel %>" class="thumbImage1"><%= value.name %></a></td>' +
                   '<td><a href="http://bie.ala.org.au/species/<%= value.name %>" title="about <%= value.name %> ALA species page " rel="<%= value.rel %>" class="thumbImage1"><id="thumb1"><div class="forward"></div> </id="thumb1"></a></td>' +
                '<td><a href="http://biodiversity.org.au/name/<%= value.name %>" title="about <%= value.name %> in NSL nomenclator " rel="<%= value.rel %>" class="thumbImage1"><id="thumb1"><div class="forward"></div> </id="thumb1"></a></td>' +
                '<td><a href="http://www.discoverlife.org/mp/20q?search=<%= value.name %>+<%= value.species %>" title="images and info from Discover Life on <%= value.name %>" rel="<%= value.rel %>" class="thumbImage1"><id="thumb1"><div class="forward"></div> </id="thumb1"></a>' +
                '<td><a href="http://biocache.ala.org.au/ws/density/map?q=<%= value.name %>" title="<%= value.name %> Aus density Map (if sufficient samples)" rel="<%= value.rel %>" class="thumbImage1"><id="thumb1"><div class="forward"></div></id="thumb1"></a></td></td>' +
                '<td><a href="http://eol.org/search/show?q=<%= value.name %>&amp;type[]=taxon_concept&amp;type[]=image&amp;commit=Filter" title="images of <%= value.name %> in EOL" rel="<%= value.rel %>" class="thumbImage1"><id="thumb1"><div class="forward"></div> </id="thumb1"></a></td></tr> <% }); ' +
            '%></tbody></table></div>'  

.. alternative functions

Alternative functions which  define actions on hover and click on nodes and clades

 presentClade to replace  underscores with spaces in taxon names


       presentClade: function (clade) {
              var tmpl = st.config.tmpl,
                nodeList = [],
                node, html, split;
                for (var i = 0; ((i < clade.length) & (i < 30)); i++) {
                  node = {}
                  node.name = clade [ i ].name;
                  node.plus = clade [ i ].name.replace(/\s+/g,'+');
                  split = node.name.split( /\s+/ );
                  if ( split.length > 1 ){
                    node.genus = split [ 0 ];
                    node.species = split [ 1 ];             
                  } else {
                    node.species = split [ 0 ];
                  }
                  node.rel = node.species + '' + i;
                  node.index = i;
                  nodeList.push ( node );           
                }
              if ( tmpl ) {
                tmpl = _.template ( tmpl );
                html = tmpl ( {nodeList: nodeList});
              } else {
               
              }
              return html;

            }, //presentClade


GUID's (LSIDs)

An example where GUIDs are used (Hornworts plus LSIDs). Taxon names are looked up with a nomenclator then  translated to the equivalent LSID.

Strictly speaking any GUID's should be supplied with the phylogeny Or the creator of the phylogeny should explicitly state that they are using the  taxon concepts as recorded in a particular source at a particular time. However, such perfection is rarely attainable. This template is provided as a proof of concept.