-
Notifications
You must be signed in to change notification settings - Fork 0
PhyloSoC:phyexport
phyexport.pl - Export PhyloDB data to common tree file formats.
This documentation refers to phyexport version 1.0.
USAGE: phyexport.pl REQUIRED ARGUMENTS: --dsn # The DSN string the database to connect to # Must conform to: # 'DBI:mysql:database=biosql;host=localhost' --dbuser # User name to connect with --dbpass # Password to connect with --outfile # Full path to output file that will be created. ALTERNATIVE TO --dsn: --driver # DB Driver "mysql", "Pg" "Oracle" --dbname # Name of database to use --host # Host to connect with (ie. localhost) ADDITIONAL OPTIONS: --format # "newick", "nexus" (default "newick") --tree # Name of the tree to export --parent-node # Node to serve as root for a subtree export --help # Print this help message --quiet # Run the program in quiet mode. --db-node-id # Preserve DB node names in export
Export a tree stored in a PhyloDB database to a specified output format. Currently nexus, newick, lintree and New Hampshire Extended formats are supported. However; only the basic tree is currently supported. Branch data are not exported.
- -d, --dsn : The DSN of the database to connect to; default is the value in the environment variable DBI_DSN. If DBI_DSN has not been defined and the string is not passed to the command line, the dsn will be constructed from --driver, --dbname, --host
- -u, --dbuser : The user name to connect with; default is the value in the environment variable DBI_USER.
- -p, --dbpass : The password to connect with; default is the value in the environment variable DBI_PASSWORD. If this is not provided at the command line the user is prompted.
- -o, --outfile : The full path of the output file that will be created.
An alternative to passing the full dsn at the command line is to provide the components separately.
- --host : The database host to connect to; default is localhost.
- --dbname : The database name to connect to; default is biosql.
- --driver : The database driver to connect with; default is mysql. Options other then mysql are currently not supported.
- -f, --format : Format of the export file. Accepted file format options are:
- --parent-node : Node id to serve as the root for a subtree export. Currenly not supported
- --db-node-id : Preserve database node ids when exporting the tree. For nodes that have existing labels in the label field, the node_id from the database will be indicated in parentesis.
- -h, --help : Print the help message.
- -q, --quiet : Print the program in quiet mode. No output will be printed to STDOUT and the user will not be prompted for intput.
- --version : Show the program version.
- --usage : Show program usage statement.
- --help : Show a short help message.
- --man : Show the full program manual.
Export a single tree
The following example would export the single tree named Cornus in the biosql database to the nexus formatted outfile cornus.nex.
phyexport.pl -d 'DBI:mysql:database=biosql;host=localhost' -u UserName -p password -t cornus -o cornus.nex -f nexIf you have identified the dsn, username, and password in your environment this is simplified to.
phyexport.pl -t cornus -o cornus.nex -f nexExporting the same tree in newick format would be
phyexport.pl -t cornus -o cornus.newick -f newExporting in the New Hampshire extended foramt
phyexport.pl -t cornus -o cornus.nhx -f nhx
The known error messages below are followed by possible descriptions of the error and possible solutions.
Many of the options passed at the command line can be set as options in the user's environment.
- DBI_USER : User name to connect to the database.
- DBI_PASSWORD : Password for the database connection
- DBI_DSN : DSN for database connection.
export DBI_USER=yourname export DBI_PASS=yourpassword export DBI_DSN='DBI:mysql:database=biosql;host-localhost'
The phyinit program is dependent on the following PERL modules:
- DBI - http://dbi.perl.org : The PERL Database Interface (DBI) module allows for connections to multiple databases.
- DBD:MySQL - http://search.cpan.org/~capttofu/DBD-mysql-4.005/lib/DBD/mysql.pm : MySQL database driver for DBI module.
- DBD:Pg - http://search.cpan.org/~rudy/DBD-Pg-1.32/Pg.pm : PostgreSQL database driver for the DBI module.
- Getopt::Long - http://perldoc.perl.org/Getopt/Long.html : The Getopt module allows for the passing of command line options to perl scripts.
Known Limitations:
- Currently only stable with the MySQL Database driver.
- DSN string must currently be in the form: DBI:mysql:database=biosql;host=localhost
The program phyinit.pl is a component of a package of comand line programs for PhyloDB management. Additional programs include:
- phyinit.pl : Initialize a PhyloDB database.
- phyimport.pl : Import common phylogenetic file formats.
- phyopt.pl : Compute optimization values for a PhyloDB database.
- phyqry.pl : Return a standard report of information for a given tree.
- phymod.pl : Modify an existing phylogenetic database by deleting, adding or copying branches.
This program may be used, distributed or modified under the same terms as Perl itself. Please consult the Perl Artistic License (http://www.perl.com/pub/a/language/misc/Artistic.html) for the terms under which you may use, modify, or distribute this script.
THIS SOFTWARE COMES AS IS, WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. USE AT YOUR OWN RISK.
James C. Estill
Hilmar Lapp <hlapp></hlapp>
William Piel <william.piel></william.piel>
Started: 06/18/2007
Updated: 08/19/2007