Tuesday, June 12, 2007

Week 3 Update Email

I am currently out of town for some wheat related work, below is the email update I sent out.

Week 3 project update: Command Line Topological Query Application for BioSQL

Last week I:
  • Made changes to MySQL phylo tables in the biosql-phylodb-mysql.sql (http://phylosoc2007jestill.googlecode.com/svn/trunk/sql/biosql-phylodb-mysql.sql) to get foreign keys working and to include recent changes in the biosql schema
  • Updated PhyInit.pl to include these schema changes
  • Completed a version of PhyImport that uses the TreeIO module of bioperl to import tree nodes and edges
  • Generated random trees to serve as test import trees for PhyImport
This week I will:
  • Figure out problems I am having importing NEXUS trees with PhyImport (something to do with my bioperl installation)
  • Add node and edge attribute information to PhyImport
  • Add tree root information to PhyImport
  • Begin PhyExport for whole tree export

Friday, June 8, 2007

PhyImport: Bio::TreeIO and Nexus problems

I was able to get nodes and edges loaded into the database for the example newick file using Bio::TreeIO. This is working for newick and New Hampshire extended files. However, I can't find a nexus file that Bio::TreeIO can seem to handle. :(. Perhaps this is due to the general chaos surrounding the NEXUS "standard", but I would like to get the import working for nearly all NEXUS files.

Maybe I should switch to the Bio::Phylo object, but I wanted to use the object model that was most tightly integrated with bioperl. I am trying to see if I can generate at least one "nexus" file that I can parse.

Since I can not even convert from a newick file to nexus, I seem to be having trouble with my installation of bioperl similar to a recent discussion: (http://portal.open-bio.org/pipermail/bioperl-l/2007-February/024829.html).

Thursday, June 7, 2007

PhyImport: Test Newick Format Tree



I added a randomly generated tree to the code repository. This is a simple newick format tree with 26 leaf nodes. The image links to the *.tre file.
The file is randtree_26.tre.

This will serve as a test file for the development of PhyImport.

The tree was generate using RandTree.pl. I have been having trouble with the NEXUS file I originally wanted to use.

I have stopped trying to get parseTreeePG.pl to work with the MySQL schema. I have moved on to using the Bio::TreeI object as I originally proposed. Since the tree above was generated with Bio::Tree::RandomFactory it works with Bio::TreeI.

PhyImport: Can't defer foreign keys in MySQL

The use of InnoDB with foreign keys now causes the following error in the parseTrees program:

DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails at ./parseTreesPG.pl line 710.

This is not a problem in PG because foreign key checks are deferrable. Since foreigns keys are not deferrable in MySQL I am temporarily turning off FK checks in the PERL code:
$dbh->do("SET FOREIGN_KEY_CHECKS=0");
#UPDATE tree TABLE HERE
$dbh->do("SET FOREIGN_KEY_CHECKS=1");
to deal with this in MySQL.


This solves this problem, but now I am still getting problems with commit:
commit ineffective with AutoCommit enabled at ./parseTreesPG.pl line 316.
Commmit ineffective while AutoCommit is on at ./parseTreesPG.pl line 316.
DBD::mysql::db commit failed: Commmit ineffective while AutoCommit is on at ./parseTreesPG.pl line 316.


I therefore added a check to see if AutoCommit was on before attempint $dbh->commit:

unless ($dbh->{AutoCommit}) {
$dbh->commit;
}
I am now trying to see if this will fix the problem without introducing new errors.

MySQL Schema Changes, Blog comments enabled

I've made changes to the MySQL schema to fit the changes made by H. Lapp to the Postgres version of the PhyloDB extensions. Since MySQL does not support booleans I used ENUM:
is_rooted ENUM ('FALSE', 'TRUE') DEFAULT 'TRUE'
in the tree table.

Comments are now enabled in the blog, I did not know that they were turned off.