Setup guide for OpenGenomics tools
----------------------------------

1.  You need Python 2.3 or higher.  Most Unix-based systems (including
    Mac OS X) have this already.  If you don't, get it from python.org.

2.  You need MySQL 4 or higher.  Get it from http://mysql.com/.
    Make sure your MySQL server is running.

3.  You need the mysql-python package (MySQL support for Python).
    Get it from http://sourceforge.net/projects/mysql-python .
    To install it, first unpack the archive, then run the command
    "python setup.py install" in the newly unpacked directory.

4.  You need mxTextTools.  Download the eGenix MX BASE package at
    http://www.egenix.com/files/python/eGenix-mx-Extensions.html .
    To install it, first unpack the archive, then run the command
    "python setup.py install" in the newly unpacked directory.

5.  You need BioPython.  Download it at http://biopython.org/.
    Unpack the archive, but don't run the installation command yet.
    In BioPython, up to at least version 1.42, there is an
    incompatibility with newer versions of the mysql-python package.
    To fix it, open the file BioSQL/DBUtils.py in a text editor and
    find the first line that says:

    def last_id(self, cursor, table):

    Immediately after this line insert the following two lines:

        if not hasattr(cursor, 'insert_id'):
            return cursor.connection.insert_id()

    Make sure the first line ("if not...") starts at the same
    indentation as the line that was at that spot before you
    inserted anything.  After you have fixed this, run the command
    "python setup.py install" as usual.

6.  Create a directory to store your genome files.  You have two
    choices for this directory:

        /var/cache/genomes
        /Library/Caches/Genomes

    It doesn't matter which one you use as long as one of them
    exists.  Create one of these directories.

7.  To download a genome from NCBI, use the "getgenome" script and
    supply the genus and species names.  For example:

        ./getgenome Drosophila melanogaster

8.  To load a genome into your database, use the "convert" script
    with a genus and species name.  This must be an organism you
    previously downloaded.

        ./convert Drosophila melanogaster

    This should leave you with a populated MySQL database named
    Drosophila_melanogaster, as well as several *.asc files in
    your cache directory containing the raw nucleotide sequence.

9.  The data is now in a form ready to be scanned by the Web scripts.
