Carrot root and DNA VCRU Bioinformatics USDA ARS Vegetable Crops Research Unit

This page was last updated on Monday, 05-Mar-2018 17:20:22 CST

Installation notes for Stacks version 1.12

Home Page

Prerequisites

See instructions

Installation v2.x

  1. $ ver="2.0Beta8c"
  2. $ cd /programinstallers/nas/
  3. $ wget -N http://catchenlab.life.illinois.edu/stacks/source/stacks-$ver.tar.gz
  4. $ cd /programinstallers/
  5. $ tar -zxvf nas/stacks-$ver.tar.gz
  6. $ sudo mkdir /usr/local/bin/stacks
  7. Put this in the default PATH
    $ sudo nano /etc/profile

    PATH="$PATH:/usr/local/bin/stacks"
  8. $ cd stacks-$ver
  9. $ ./configure --prefix=/usr/local/bin/stacks

    checking for functional regular expressions... configure: error: Regular expressions are not functional, you need g++ 4.9.0 or greater.
  10. If needed, update the version of g++ to 4.9 (reference) with the following:
    1. $ g++ -std=gnu++11 -v

      gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4)
    2. $ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    3. $ sudo apt-get update
    4. $ sudo apt-get install gcc-4.9 g++-4.9
    5. $ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
  11. $ make
  12. $ sudo make install
  13. Stop here for command line install

Installation v1.x

  1. $ ver="1.12"
  2. $ cd /programinstallers/
  3. $ wget -N http://creskolab.uoregon.edu/stacks/source/stacks-${ver}.tar.gz
  4. $ tar -zxvf stacks-${ver}.tar.gz
  5. $ cd stacks-${ver}
  6. $ ./configure
  7. A patch file to allow an alpha parameter of 0.5 stacks.patch
    $ cd src && patch < /stacks.patch && cd -
  8. $ make
  9. $ sudo make install
    This installs to /usr/local/bin/ the following programs:
    ustacks pstacks estacks cstacks sstacks hstacks process_radtags process_shortreads kmer_filter clone_filter genotypes populations phasedstacks denovo_map.pl ref_map.pl export_sql.pl index_radtags.pl load_radtags.pl sort_read_pairs.pl exec_velvet.pl load_sequences.pl stacks_export_notify.pl
  10. Stop here for command line install
    $ cd /programinstallers; rm stacks-${ver} -rf
     
  11. $ cd /usr/local/share/stacks/sql/
  12. $ sudo cp mysql.cnf.dist mysql.cnf
  13. $ sudo chmod 666 mysql.cnf
  14. $ nano mysql.cnf
    [client]
    user=stacks
    password=secretpassword
    host=localhost
    port=3306
  15. $ mysql -h localhost -u root -p
  16. mysql> CREATE USER 'stacks'@'localhost' IDENTIFIED BY 'secretpassword';
    Query OK, 0 rows affected (0.00 sec)
  17. mysql> quit
  18. $ sudo nano /etc/httpd/conf/httpd.conf
    Add to the end of the file
    <Directory "/usr/local/share/stacks/php">
            Order deny,allow
            Deny from all
            Allow from all
    </Directory>
    
    Alias /stacks "/usr/local/share/stacks/php"
  19. $ cd /usr/local/share/stacks/php
  20. $ sudo cp -p constants.php.dist constants.php
  21. $ sudo chmod 666 constants.php
  22. $ nano constants.php
    $db_user     = "stacks";
    $db_pass     = "secretpassword";
    $db_host     = "localhost";
  23. $ sudo nano /usr/local/bin/stacks_export_notify.pl
    my $smtp_host     = "smtp.doit.wisc.edu";
    my $from          = "email\@wisc.edu";
  24. $ sudo chown apache:wheel /usr/local/share/stacks/php/export
  25. selinux stuff
    $ sudo chcon -u system_u -t httpd_sys_content_t /usr/local/share/stacks
  26. $ sudo chcon -R -u system_u -t httpd_sys_content_t /usr/local/share/stacks/sql
  27. $ sudo chcon -R -u system_u -t httpd_sys_content_t /usr/local/share/stacks/php
  28. $ sudo chcon -R -u system_u -t httpd_sys_script_exec_t /usr/local/share/stacks/php/*.php
  29. Prerequisites
    $ sudo yum install php-pear
  30. $ sudo pear install MDB2
  31. $ sudo pear install pear/MDB2#mysql
  32. Stacks version 0.9995, patch because indexing is failing due to not finding login information in ~/.my/cnf
    $ sudo nano /usr/local/bin/index_radtags.pl
    Line 570
        $sth->{'dbh'} = DBI->connect("DBI:mysql:$db", "stacks", "secretpassword")
            or die("Unable to connect to the $db MySQL Database!\n" . $DBI::errstr);
    #    $sth->{'dbh'} = DBI->connect("DBI:mysql:$db:mysql_read_default_file=$cnf")
    #	or die("Unable to connect to the $db MySQL Database!\n" . $DBI::errstr);
  33. Cleanup
    $ cd /programinstallers; rm stacks-${ver} -rf