Skip to content

Setting up Ymap locally

Vladimir Gritsenko edited this page Dec 10, 2016 · 25 revisions

Ymap should work on any *nix environment. It may work on Windows, though it was not tested. The biggest problem seems to be samtools (which is not officially supported for Windows), but that perhaps can be solved with Cygwin.

  1. Install and set up Apache. Run Apache with the basic configuration to make sure it works with http://localhost/. (On Mac, steps 1-3 are documented here for Yosemite and here for previous versions.)
  2. Set up the PHP plugin for Apache. Test it with (for example) the phpinfo() call. Also install php-GD.
  3. In httpd.conf set the DocumentRoot and Directory settings to point to Ymap’s directory (or otherwise point to Ymap's folder, for example with virtual hosts).
  4. In php.ini, set the date.timezone, otherwise there will be a lot of junk errors regarding it in Apache’s error log.
  5. In Ymap’s directory, create a ‘users’ directory.
  6. Add your own user to the _www group with the command: ‘sudo dseditgroup -o edit -a your_username -t user _www’ (if you're installing on Linux, the httpd group may be 'www-data' or even something else).
  7. Set the group of ‘users’ to _www (or whatever group Apache uses) with the command: ‘chown :_www users’.
  8. Add write permissions for the group with the command: ‘chmod g+w users’.
  9. Optional - within 'users' there may be a special user, 'default', the data in which is shared among all other users. This is useful, for example, in setting up reference genomes for all system users. If you use this option, make sure it has the same permissions as the the 'users' parent folder.
  10. Install the following software. Note that later you will need to reference them in the scripts (see the following point), so you may want to install them into a single directory (especially if you don't have root on the machine). Versions are important - other versions may have slightly different behavior that will fail at runtime.
  11. bowtie2 - 2.1.0
  12. samtools - 1.3.1 (the linked file is a source distribution, needs to be compiled)
  13. JDK - 7 (for GATK) and 6 (for FastQC and Picard tools)
  14. FastQC - 0.10.1 (downloads for Mac, for Windows/Linux) 1. On Mac: note that the executable itself is under the /Contents/Resources/Java directory. 2. On Mac: version 0.10.1 doesn’t have execute permissions on the fastqc executable, so make sure to chmod +x it.
  15. GATK - 2.8 - needs to be built from source (as old binaries are not available). Get the repo from github, check out the 2.8 tag ('git checkout 2.8'), install ant, go to the GATK directory in the terminal, and run 'ant clean dist'.
  16. Picard tools - 1.105 - needs to be built from source, AND requires Java 6. The same protocol as with GATK - clone the repo, checkout tag 1.105. In the Picard directory, run (make sure to substitute 1.6 JDK folder with the appropriate folder on your machine): 'ant -Djava6.home=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home -lib lib/ant package-commands'
  17. Seqtk - version hash 08b3625 - run ‘make’ in the source code directory.
  18. Python - 2.7. It is recommended to use a local Python installation, as Ymap requires numpy 1.8.0 (see below), which may clash with the system installation of Python. You can get the source code, and compile it locally (without running 'make install').
  19. Numpy - 1.8.0. Can be installed with pip: 'python -m pip install numpy==1.8.0'. Make sure to run the correct Python executable (if you decided to use a local Python installation in the previous step).
  20. PyPy - 2.5 (though later versions that implement Python 2.7 should work, too) - optional, will considerably speed up most Python scripts.
  21. Matlab - 2016a for optimal graphic output, earlier versions should work as well but might fail to generate good figures for genomes with high number of chromosomes (more then 14). An issue was observed on Mac where Apache required write permissions to /Users/user_that_runs_ymap/.matlab, so you may need to run 'chmod -R a+w' on it (or otherwise give Apache access).
  22. Make sure that all of the above executables can actually be executed by Apache. One way of doing this is to recursively set a+rx on the application folders (if you installed everything into a single folder, you can just run 'chmod -R a+rx path/to/software'). Apart from FastQC, PyPy was also known to exhibit permission issues on Mac.
  23. Create local_installed_programs.sh to point to the above software and add running privileges (chmod +x).
  24. Create config.sh for configuring Ymap and also give it running privileges.
  25. Install a reference genome - for example, the latest version of Candida albicans, Assembly 21.
  26. Reference genomes should only contain one haplotype. While you can upload a FASTA with both haplotypes (as is the case with Assembly 22), make sure to deselect one of the haplotypes during the installation process.
  27. Deselect the mtDNA from the chromosomes to process (and other chromosomes of length <= 50,000), otherwise it will cause errors down the line.

Browse to http://localhost/index.php to use Ymap.