<commit_before>genome-designer-v2
==================

Second generation of Genome Designer

## Dependencies

* Postgresql 9.3 (only this version has been tested)
* R (for Picard)
* Python deps: See requirements.txt / instructions below

## Installation

### Python environment

We recommend using [virtualenv](http://pypi.python.org/pypi/virtualenv) for
creating and managing a sandbox python environment. This strategy makes it easy
to stay up with requirements. Our requirements are listed in `requirements.txt`.
Follow the instructions below to setup your virtualenv and install the required
packages.

#### Setting up a virtual python environment

1. Install [virtualenv](http://www.virtualenv.org/en/latest/index.html) if you don't have it yet. (You may want to install [pip](http://pypi.python.org/pypi/pip/) first.)

2. Create a new virtual environment for this project. This virtual environment isn't part of the project so just put it somewhere on your machine.  I keep all of my virtual environments in the directory ~/pyenvs/.

        $ virtualenv ~/pyenvs/genome-designer-env

    If you want to use a version of python different from the OS default you can specify the python binary with the '-p' option:

        $ virtualenv -p /usr/local/bin/python2.7 ~/pyenvs/genome-designer-env

3. Activate the environment in the shell. This will use `python` and other binaries like `pip` that are located your pyenv. You should do this whenever running any python/django scripts.

        $ source ~/pyenvs/genome-designer-env/bin/activate .

4. Install the dependencies in your virtual environment. We've exported the requirements in the requirements.txt file. In theory, these should all be installable with the single command:

        $ pip install -r requirements.txt

However, in reality, this doesn't seem to work perfectly. In particular, it may
be necessary to install specific packages first.

NOTE: Watch changes to requirements.txt and re-run the install command when
collaborators add new dependencies.

### Git Submodules

We currently submodule `jbrowse` and perhaps will do so with other tools in the
future. Specifically, we have submoduled a forked copy of `jbrowse` at a
specific commit. To checkout the appropriate submodule states, run:

    $ git submodule update --init --recursive
<commit_msg>Update README.md regarding vcf/cparse.c error<commit_after>genome-designer-v2
==================

Second generation of Genome Designer

## Dependencies

* Postgresql 9.3 (only this version has been tested)
* R (for Picard)
* Python deps: See requirements.txt / instructions below

## Installation

### Python environment

We recommend using [virtualenv](http://pypi.python.org/pypi/virtualenv) for
creating and managing a sandbox python environment. This strategy makes it easy
to stay up with requirements. Our requirements are listed in `requirements.txt`.
Follow the instructions below to setup your virtualenv and install the required
packages.

#### Setting up a virtual python environment

1. Install [virtualenv](http://www.virtualenv.org/en/latest/index.html) if you don't have it yet. (You may want to install [pip](http://pypi.python.org/pypi/pip/) first.)

2. Create a new virtual environment for this project. This virtual environment isn't part of the project so just put it somewhere on your machine.  I keep all of my virtual environments in the directory ~/pyenvs/.

        $ virtualenv ~/pyenvs/genome-designer-env

    If you want to use a version of python different from the OS default you can specify the python binary with the '-p' option:

        $ virtualenv -p /usr/local/bin/python2.7 ~/pyenvs/genome-designer-env

3. Activate the environment in the shell. This will use `python` and other binaries like `pip` that are located your pyenv. You should do this whenever running any python/django scripts.

        $ source ~/pyenvs/genome-designer-env/bin/activate .

4. Install the dependencies in your virtual environment. We've exported the requirements in the requirements.txt file. In theory, these should all be installable with the single command:

        $ pip install -r requirements.txt

However, in reality, this doesn't seem to work perfectly. In particular, it may
be necessary to install specific packages first.

NOTE: Watch changes to requirements.txt and re-run the install command when
collaborators add new dependencies

#### Troubleshooting

The environment setup process is not perfect, specifically with respet to
particular packages. Here are some helpful hints:

* For numpy, you may have to explicitly call

        pip install numpy

    as BioPython may complain that numpy is not installed when trying to run the
    full install from requirements.txt. For some reason the deps aren't wired up
    correctly.

* If pyvcf fails to install due to:

        error: can't copy 'vcf/cparse.c': doesn't exist or not a regular file"

    try manually navigating to `/path/to/venv/build/pyvcf/vcf` and runnning

            cython cparse.pyx

    which should generate the missing file.


### Git Submodules

We currently submodule `jbrowse` and perhaps will do so with other tools in the
future. Specifically, we have submoduled a forked copy of `jbrowse` at a
specific commit. To checkout the appropriate submodule states, run:

    $ git submodule update --init --recursive

{'fraction_non_alphanumeric': 0.07369996258885148, 'fraction_numerical': 0.003367003367003367, 'mean_word_length': 3.9100091827364554, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1578934', 'n_tokens_mistral': 1450, 'n_tokens_neox': 1367, 'n_words': 686}