
## Install dependencies
MIDAS is a command-line tool that runs on Unix or Mac OSX

The following Python modules should be pre-installed on your system
(tested version numbers are indicated in parenthesis):

* Numpy (>=1.7.0)
* BioPython (>=1.6.2)
* Pysam (>=0.8.1)
* Pandas (>=0.17.1)

The dependencies can be installed by running the setup.py script:  
`python MIDAS/setup.py install` or  
`sudo python MIDAS/setup.py install` to install as a superuser, or  
`python MIDAS/setup.py install --user` to install locally  

If you have pip installed, you can install these dependencies by running the following command:
`pip install -U numpy biopython pysam pandas` or  
`sudo pip install -U numpy biopython pysam pandas` to install as a superuser, or  
`pip install --user numpy biopython pysam pandas` to install locally  


## Update your environmental variables
This will enable you to run MIDAS scripts:  
`export PYTHONPATH=$PYTHONPATH:/path/to/MIDAS`  
`export PATH=$PATH:/path/to/MIDAS/scripts` 

Be sure to replace '/path/to' with the appropriate path on your system  
Add these commands to your .bash_profile to avoid entering the commands in the future

## Download the reference database
Download the MIDAS reference database of marker genes, pangenomes, and representative genomes:
`python MIDAS/scripts/download_ref_db.py`
This may take several minutes to several hours, depending on your internet speed. The entire database requires ~35 GB of free space to install, once installed it takes about ~17G of free space.  

## Testing
You should be able to enter these commands into your terminal without getting an error:  
`run_midas.py -h`

For more complete testing, run:   
`cd /path/to/MIDAS`
`python test/test_midas.py -f`

Be sure to replace '/path/to' with the appropriate path on your system.

## Updating MIDAS
Move to installation directory, pull the latest version, and install:  
`cd MIDAS`  
`git pull`  
`python setup.py install`


