Creating the Meta4 Amazon Machine Image (AMI)

The Meta4 AMI (ami-46687f32) was set up very quickly from a basic Ubuntu Server 12.04.1 LTS amazon image.  If you intend to simply use the Meta4 AMI, then you don't need to read this document; this is just a record of how the AMI was set up, in case you wish to replicate the process elsewhere.

If you're not sure how to work with Amazon, try the links here and here.

1. Setting up the Linux environment

The Ubuntu Server 12.04.1 LTS initial log-in is "ubuntu".  When logged in as "ubuntu":

# act as the root user
sudo -i

# update the install repos
apt-get update

# install apache web-server
apt-get install apache2

# install PHP and a range of libraries
apt-get install php5 libapache2-mod-php5 php5-ps php5-mysql php5-imagick php5-mysql php5-dev

# install MySQL
apt-get install mysql-server #enter password

# install Perl libraries
apt-get install libbio-graphics-perl bioperl bioperl-run libsoap-lite-perl 
apt-get install libio-string-perl libdbi-perl libdbd-mysql-perl libhtml-table-perl

# install git
apt-get install git

# restart the apache server
/etc/init.d/apache2 restart

So the Linux environment is now set up.

2. Setting up the simple Meta4 example

We can now get on with setting up the basic Meta4 example:

# first off clone the latest code
git clone

# create a MySQL database.  Use the password you set previously
mysqladmin -u root -p create meta4

# enter the MySQL client
mysql -u root -p

        # within MySQL
        # create read and write accounts
        grant all on meta4.* to 'writeaccount'@'localhost' identified by 'writepass';
        grant select on meta4.* to 'readaccount'@'localhost' identified by 'readpass';

# create the database structure
mysql -u root -p meta4 < meta4/sql/meta4.mysql.sql

# edit meta4/scripts/
# should be fairly obvious - need to enter the write account details

# cycle through the example data in this order
perl meta4/scripts/ --name 'An example sample' \
                                  --desc 'Meta4 example sample'

perl meta4/scripts/ --sample_id 1 \
                                    --assembly_params meta4/examples/assembly_parameters.txt \
                                    --desc 'SOAPdenovo assembly'

perl meta4/scripts/ --assembly_id 1 \
                                  --file meta4/examples/contigs.fasta

perl meta4/scripts/ --assembly_id 1 \
                                       --gff meta4/examples/predictions.gff \
                                       --nucfile meta4/examples/nucs_out.fasta \
                                       --profile meta4/examples/prots_out.fasta

perl meta4/scripts/ --name Pfam-A \
                                    --version 26.0 \
                                    --file Pfam-A.hmm \
                                    --desc 'Pfam-A version 26.0'

perl meta4/scripts/ --domain_db_id 1 \
                                   --file meta4/examples/domains_hit.txt

perl meta4/scripts/ --domain_db_id 1 \
                                    --assembly_id 1 \
                                    --file meta4/examples/pfam_scan.out

# copy the web-scripts over to cgi-bin
# make sure they are executable by the apache user
sudo cp meta4/cgi_scripts/* /usr/lib/cgi-bin/

# edit the web
# this needs to be readable and executable by the apache user
# put only the read account details in here.
# edit the CSS if you must...
sudo vi /usr/lib/cgi-bin/

Navigate to http://yourserver/cgi-bin/meta4.cgi


Questions and comments to: