Friday, May 8, 2009
Multiple Image Scrolling
Monday, May 4, 2009
UBIO Common Name Search...
- Layout (rectangular, circular, diagonal, unrooted)
- Node (images and other annotations)
- Label (unique, clade, show all, common name search)
- Performance (anti-aliasing, animation)
- Zoom
- Font
- Style (size, scaling, angles)
- Structure (sorting, flipping, branch lengths, etc.)
Sunday, May 3, 2009
UBIO Bugs
Thursday, April 30, 2009
NBII Image Search
When I get the response, I search for the term "Total images", since it indicates that I'm about to reach the place in the html where the images are listed. From then on, when I get to a line that contains "xt "Xthumbnail", since that indicates that I've gone past the section with the images I want.
Monday, April 27, 2009
Posting to a .php site
form action="search_results.php" method="post" enctype="application/x-www-form-urlencoded" name="frmSearch"
Anyone know about this and have suggestions for how I go about posting a search term to this form? Thanks!
Friday, April 24, 2009
Displaying Images (2)
Wednesday, April 22, 2009
Displaying Images (1)
Monday, April 20, 2009
Downloading and Storing Images
Harvesting Images
Saturday, April 18, 2009
Pre-Parsing Label Names
Monday, April 13, 2009
Schedule Update
- Pre-parse newick tree files to replace the given number-encoding with the appropriate scientific names, before sending the tree string to the regular PhyloWidget parser
- Retrieve images from Morphbank as MIME attachments, based on searches by scientific name, and cache the images locally
- Incorporate a thumbnail version of the each image into the PhyloWidget tree display at its corresponding node, according to the diagram posted previously. (If time, allow multiple images per node and create arrows so that the user can scroll through the thumbnails for each.)
After this deadline, I plan to return to the current bug in my common name search to complete that portion of the code. I will also look at the way that PhyloWidget draws the trees with the alternative layouts, to determine how best to incorporate the images in those cases. Finally, I will consider the various ways to save a user's work and reload a saved file for later use and work on implementing that feature.
Sunday, April 12, 2009
Health and Interfaces
Thursday, April 2, 2009
Up and Running
Sunday, March 22, 2009
"Technical Difficulties"
But for the meantime, if it appears that I am not making due progress, this is why. I hope to have this resolved quite shortly, but since I have no idea what the problem is, all I can do is wait and see.
Friday, March 20, 2009
Common Name Search Begins
after text string "Scientific Match" search for "a href ='" string
save the next text till "'" as a link string
save a substring of the text after the next > and before <
compare that to the search term.
If it's a match
follow the saved link
on the resulting page:
Find the text "name = 'Common name'"
After that point, find "namebankID"
Save a substring of the text after the next > and before <
return the substring as the common name
Else
repeat by searching for next "a href = '" string
Stop when you've reached ".
Return either the search term or a null string as the common name.
Friday, March 13, 2009
Wednesday, March 4, 2009
Algorithm Details
Below is the section on Algorithm Details from my newly updated Design Document. Once the entire document is posted on the DMD Senior Projects website, I will provide a link to it. For now, this is the part I've been working the hardest on lately, and it will outline my plan for the rest of the project, so I think it's worth posting about.
I have chosen to build on the existing PhyloWidget program. This will allow me to focus on combining images with trees and incorporating common names of organisms, without having to recreate a significant amount of code. I will take advantage of PhyloWidgetʼs existing interface, tree rendering process, Newick parser, and many other features. Modifications and additions will serve the purpose of adding content fit for students and adapting the interface to be better suited for their needs.
The program begins by asking the user to input either a newick format tree, a taxonomic name, or a common name of an organism (or multiple organisms). The programʼs overall algorithm is as follows:
1) Search www.ubio.org for the taxonomic name or common name, whichever was not given
2) Search TreeBase by taxonomic name for relevant trees, prune them, and import them into PhyloWidget
3) Search online images databases such as www.morphbank.com for images of the organisms
4) Display those images alongside the leaf labels containing both the common and taxonomic names
Inputs that do not yield a tree will return a dialogue box to the user asking for more or different information. Image searches that do not yield any images will either be symbolized by a standard replacement image or will be drawn without any images.
3.1.1 Scientific and Common Name Search
I will interact with the website www.ubio.org, which searches based on keywords and can return the common or taxonomic name of an organism along with other related information. If the user inputs a common name, that name will become
the search term, and the desired result will be the taxonomic name. The reverse is true if the user inputs a taxonomic name or imports a tree which contains taxonomic names as the node labels.
I hope to extend the functionality of this component to allow users to search for multiple organisms at once.
3.1.2 TreeBase Search/Prune
Using the taxonomic name from the ubio search, I will search the TreeBase database for phylogenetic trees containing the desired organism(s). I will determine which of the resulting trees is the best one to display and load that into PhyloWidget. Often, the tree will have more nodes than is suitable to display in an educational program to avoid overwhelming the user. I will prune the tree before displaying it and only search for images and common names for organisms contained in the pruned tree.
3.1.3 Image Search
Using the taxonomic name, I will search a series of image databases including Morphbank to find images of each organism in the tree. In the case that many images are found, I will display the first and allow the user to view the additional
images and change which one is displayed on the tree. Also at this time the common name search is repeated, using UBIO to find the common names for all of the organisms in the downloaded tree.
3.1.4 Image Integration
The image and common name will be displayed on the tree leaf nodes alongside the taxonomic name from TreeBase. The user will have the full range of control options available for manipulating the treeʼs display parameters that is already part of PhyloWidget. In addition, the user will be able to control selecting the displayed image for each node, if more than one image is available. Finally, the user will specify whether the taxonomic name or the common name is displayed more prominently.
Tuesday, March 3, 2009
Alpha Preparation
I spoke with Val to outline the four specific tasks I’ll need to complete in order to allow the user to input an organism’s name and end up with a tree complete with images and both the common and scientific names for each organism. I divided up the major coding tasks and estimated how long it would take me to do each and which order it would make the most sense, and I used that information to revise my Gantt chart.
I’ve spent the rest of this week revising and updating my design document to reflect what I’ve accomplished and my goals for the rest of the semester.
I also contacted Anne Olsen at The National Biological Information Infrastructure (NBII) to ask about how to search the NBII image database, at the recommendation of Greg Riccardi from Morphbank.
I'll be meeting with Joe on Thursday morning and Val on Thursday afternoon to review my progress and updated design document.
Monday, March 2, 2009
Revised Gantt Chart
Tuesday, February 24, 2009
Learning to SVN
Monday, February 23, 2009
URL Interactions
Thursday, February 19, 2009
Label Name Interception
The parser reads in the newick strings, and it is found in org.phylowidget.tree.TreeIO.java
public static RootedTree parseNewickString(RootedTree tree, String s)
parses through all the notation, handles determining the different levels of the tree and the parent-child relationships.
When it's created a string of text it considers the label, it calls:
PhyloNode curNode = newNode(tree, curLabel, nhx, poorMans);
static PhyloNode newNode(RootedTree t, String s, boolean useNhx, boolean poorMan)
...deals with NHX annotation stuff, then...
s = parseNexusLabel(s);
(removes single quotes and replaces underscores with spaces)
t.addVertex(v);
t.setLabel(v, s);
(self explanatory)
So that was pretty exciting, because it allowed me to understand how labels are created and stored in tree nodes, which will be useful since I plan to be able to intercept those labels before render time and change them. In practice, the idea is to display common names in place of scientific names for the organisms in the tree.
Then I went on to find the renderer. The class LabelRender is found inside NodeRenderer.java. In the method render(), we have
canvas.text(tree.getLabel(n), offX - curTextSize / 3 - s, offY - s - curTextSize / 3);
n is a PhyloNode and tree is a RootedTree so getLabel(vertex) is in RootedTree.java
that calls
vertex.getLabel() which is in PhyloNode.java (extends CachedVertex which extends DefaultVertex)
It is at this point that I intercept the label and change the return value so that the rendered label name is different than the stored one. I created a wrapper class for HashMap called NameLookup, which for testing purposes just stores mappings from each capital letter of the alphabet to the corresponding number, from 1 to 26.
I created a NameLookup object called map in
PhyloNode.java and updated the getLabel() method to look up the value in the map and return the resulting string (in this case a number). Any label that is mapped to null in the NameLookup map is changed to the string "Hi Val". The replacement label string gets passed along all the way back to the render.
For the tree:((A,B),(C,D),(E,F,G,H,'*'),I,J); we end up with the following image