Showing posts with label PhyImport. Show all posts
Showing posts with label PhyImport. Show all posts
Wednesday, June 20, 2007
PhyImport Bug: Child and parent switched
I just realized that the child and parent ids were getting switched in the edge table using the phyimport program. I did not realize this until I tried to extract trees back out of the database..silly mistake.
Monday, June 18, 2007
Bio::Phylo
I have installed Bio::Phylo from CPAN. I will first try to get phyimport.pl up and running using the Bio::Phylo object model for nodes. If this works without too much trouble, I will use Bio::Phylo for PhyExport as well. This should allow more of the information related to the tree to be added to the database and exported to output files.
Bio::Phylo documentation.
Update:
I am getting the following error when trying to parse a NEXUS file
"Inappropirate ioctl for device"
I don't know what is going on with that. If I don't get this working quickly I will abandon Bio::Phylo.
Bio::Phylo documentation.
Update:
I am getting the following error when trying to parse a NEXUS file
"Inappropirate ioctl for device"
I don't know what is going on with that. If I don't get this working quickly I will abandon Bio::Phylo.
PhyImport: Added root node info to tree table
I have added the root node to the tree table. This was not to hard to do using the Tree object in bioperl.
I tried to get the parse_dsn subfucntion from DBI to work, but it is not parsing the dsn correctly, and I need to move forward on other aspects of the project. For now, only a specific dsn string will be properly parsed by PhyImport.
I have changed the name of programs to lowercase.
I am considering switching to using R. Vos's Bio::Phylo. It seems like a richer object model for phylogenies.
I am setting PhyImport aside for now to work on PhyExport but I will come back to it later.
I tried to get the parse_dsn subfucntion from DBI to work, but it is not parsing the dsn correctly, and I need to move forward on other aspects of the project. For now, only a specific dsn string will be properly parsed by PhyImport.
I have changed the name of programs to lowercase.
I am considering switching to using R. Vos's Bio::Phylo. It seems like a richer object model for phylogenies.
I am setting PhyImport aside for now to work on PhyExport but I will come back to it later.
Friday, June 15, 2007
PhyImport: Trying to fix import of NEXUS file
It seems like the trouble I am having with nexus file parsing has something to do with the installation of bioperl I was using. Running PhyImport.pl with the bioperl-live has fixed the problem.
Note to self:
To see what version of bioperl is being used, I need to do the following from the command line:
Note to self:
To see what version of bioperl is being used, I need to do the following from the command line:
$ perl -MBio::Perl -le 'print Bio::Perl->VERSION;'
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).
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:
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:
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");to deal with this in MySQL.
#UPDATE tree TABLE HERE
$dbh->do("SET FOREIGN_KEY_CHECKS=1");
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:
I am now trying to see if this will fix the problem without introducing new errors.
unless ($dbh->{AutoCommit}) {
$dbh->commit;
}
Wednesday, June 6, 2007
Transaction Support in MySQL
I am working with the parseTreesPG.pl script to make it work with MySQL and I am having trouble with transaction support. The use of
It looks like transaction support for MySQL has been around for a few years, but I have never worked with transactions before so this is new for me.
I am working through the Requirements for Transaction Support in MySQL to see where the trouble is.
It looks like I will need to make sure that MySQL is creating InnoDB tables by modifying the PhyInit.pl script CREATE TABLE syntax to specify the table type as INNODB, this would be something like:
$dbh->commit();is currently causing fatal errors with the message
commit ineffective with AutoCommit enabled at ./parseTreesPG.pl line 736According to the documentation, this error message occurs when AutoCommit is off, or when transactions are not supported by the system you are using.
It looks like transaction support for MySQL has been around for a few years, but I have never worked with transactions before so this is new for me.
I am working through the Requirements for Transaction Support in MySQL to see where the trouble is.
- The version of MySQL I am using (4.0.18-standard) should support transactions
- The version of DBD:MySQL I am using supports transactions
- ISAM and MyISAM tables in MySQL do NOT support transaction support.
- The tables that do support transaction support are: BDB, InnoDB and Gemini.
It looks like I will need to make sure that MySQL is creating InnoDB tables by modifying the PhyInit.pl script CREATE TABLE syntax to specify the table type as INNODB, this would be something like:
CREATE TABLE tree (
tree_id INTEGER NOT NULL auto_increment,
name VARCHAR(32) NOT NULL,
identifier VARCHAR(16),
node_id INTEGER NOT NULL
, PRIMARY KEY (tree_id)
, UNIQUE (name)
,
)TYPE=INNODB;
Labels:
parseTreesPG.pl,
PhyImport,
PhyInit,
phylosoc2007
Subscribe to:
Posts (Atom)