Skip to content

Commit

Permalink
fasttree building
Browse files Browse the repository at this point in the history
  • Loading branch information
joelb123 committed Jun 1, 2017
1 parent f062919 commit 7d81eca
Show file tree
Hide file tree
Showing 14 changed files with 243 additions and 143 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ Changelog

.. snip
- Setuptools >30 is now required, due to moving many things into setup.cfg.

- FastTree source now included in distribution; FastTree binary will be built
and put in virtual environment under name ``FastTree-lorax``.

- License is now 3-clause BSD (was 4-clause BSD).

- ``config_value`` command is now simply ``config``.

0.93.2
Expand Down
21 changes: 0 additions & 21 deletions INSTALL.anaconda

This file was deleted.

27 changes: 27 additions & 0 deletions INSTALL.anaconda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
lorax was tested under Anaconda Python 3.6.

lorax requires some packages that are in the bioconda channel, so before
installing lorax, the following channels must be added:

conda config --add channels conda-forge
conda config --add channels defaults
conda config --add channels r
conda config --add channels bioconda

After the channels are configured, the following dependencies should be
added. I prefer adding them to the root installation, but you may prefer
to add them to the virtual environment to be constructed later:

conda install biopython redis redis-py hmmer gcc libgcc raxml

Next, it is highly recommended that you create a virtual environment for
lorax to run in. lorax depends on a version of setuptools that is
currently much higher than the version required by anaconda, so you may
break other packages if you install lorax in a shared environment:

conda create --name loraxenv biopython click croniter flask \
gcc libgcc raxml redis redis-py itsdangerous jinja2 markupsafe \
python-dateutil rq six werkzeug

After installing these packages then, "pip install lorax" should get the
remaining packages directly from pypi.
File renamed without changes.
41 changes: 21 additions & 20 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@ Copyright (c) 2017, The National Center for Genome Resources

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by The National Center for Genome Resources.
4. Neither the name of NCGR nor the names of its contributors may be used
to endorse or promote products derived from this software without specific

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of NCGR nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.

This software is provided by NCGR "as is" and any express or implied
warranties, including, but not limited to, the implied warranties of
merchantability and fitness for a particular purpose are disclaimed.
In no event shall NCGR be liable for any direct, indirect, incidental,
special, exemplary, or consequential damages (including, but not limited
to, procurement of substitute goods or services; loss of use, data, or
profits; or business interruption) however caused and on any theory of
liability, whether in contract, strict liability, or tort (including
negligence or otherwise) arising in any way out of the use of this software,
even if advised of the possibility of such damage.
THIS SOFTWARE IS PROVIDED BY NCGR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL NCGR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
include *.txt
include INSTALL.*
recursive-include lorax/instance *
recursive-include lorax/test *
recursive-include lorax/static *
recursive-include lorax/templates *
recursive-include lorax/fasttree *
prune lorax/test/data
prune lorax/test/logs
23 changes: 15 additions & 8 deletions lorax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io
import json
import os
import platform
import shutil
import subprocess
from collections import OrderedDict # python 3.1
Expand Down Expand Up @@ -219,19 +220,25 @@ def run_subprocess_with_status(out_path,
:param status_path: Path to status log file
:return: Return code of subprocess
"""
environ = os.environ.copy()
#
# Modify the environment to select the number of threads, if requested.
#
environ = os.environ.copy()
if app.config['THREADS'] > 0:
environ['OMP_NUM_THREADS'] = str(app.config['THREADS'])
with out_path.open(mode='wb') as out_fh:
with err_path.open(mode='wt') as err_fh:
status = subprocess.run(cmdlist,
stdout=out_fh,
stderr=err_fh,
cwd=str(cwd),
env=environ)
#
# Export DYLD_LIBRARY_PATH so that FastTree-lorax will run
# on MacOSX.
#
#if platform.system == 'Darwin':
# environ['DYLDLIBRARY_PATH'] = str(Path(sys.prefix).resolve() /'lib')
#with out_path.open(mode='wb') as out_fh:
# with err_path.open(mode='wt') as err_fh:
# status = subprocess.run(cmdlist,
# stdout=out_fh,
# stderr=err_fh,
# cwd=str(cwd),
# env=environ)
write_status(status_path, status.returncode)
if post_process is not None:
post_process(out_path,
Expand Down
11 changes: 11 additions & 0 deletions lorax/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,17 @@ def config(var, value, vartype, verbose):
file=config_fh) # noqa



@cli.command()
def delete_config():
"""Deletes the config file."""
config_file_path = Path(current_app.instance_path) / current_app.config[
'SETTINGS']
if config_file_path.exists():
print('Deleting config file %s.' %(str(config_file_path)))
config_file_path.unlink()


@cli.command()
def test_logging():
"""Test logging at the different levels.
Expand Down
2 changes: 1 addition & 1 deletion lorax/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class BaseConfig(object):
"DNA": ["-d"]
}
}
FASTTREE_EXE = 'FastTree'
FASTTREE_EXE = 'FastTree-lorax'
RAXML_EXE = 'raxmlHPC'
#
# Logging formatter. Fields that are defined are:
Expand Down
2 changes: 1 addition & 1 deletion lorax/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# coding: utf-8
version = '0.93.3'
version = '0.93.5'
5 changes: 3 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# requirements.in
Flask_RQ2
packaging
setuptools>30.3.0
Flask_RQ2[cli]
biopython
rq-dashboard
gunicorn
22 changes: 12 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
#
# pip-compile --output-file requirements.txt requirements.in
#
appdirs==1.4.3 # via setuptools
arrow==0.10.0 # via rq-dashboard
biopython==1.68
click==6.7 # via flask, rq
croniter==0.3.16 # via rq-scheduler
flask-rq2==17.0
flask==0.12.1 # via flask-rq2, rq-dashboard
gunicorn==19.7.1
biopython==1.69
click==6.7 # via flask, flask-cli, rq
croniter==0.3.17 # via rq-scheduler
flask-cli==0.4.0 # via flask-rq2
flask-rq2[cli]==17.0
flask==0.12.2 # via flask-cli, flask-rq2, rq-dashboard
itsdangerous==0.24 # via flask
jinja2==2.9.6 # via flask
markupsafe==0.23 # via jinja2 --edited for version
markupsafe==1.0 # via jinja2
packaging==16.8
python-dateutil==2.6.0 # via arrow, croniter
redis # via rq, rq-dashboard --edited to allow 3.2.0
redis==2.10.5 # via rq, rq-dashboard
rq-dashboard==0.3.7
rq-scheduler==0.7.0 # via flask-rq2
rq==0.6.0 # via flask-rq2, rq-dashboard, rq-scheduler
six==1.10.0 # via python-dateutil
werkzeug==0.12.1 # via flask
six==1.10.0 # via python-dateutil, setuptools
werkzeug==0.12.2 # via flask
69 changes: 67 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,73 @@
[metadata]
description-file = README.rst
name = lorax
provides = lorax
version = attr:lorax.version.version
url = http://github.com/ncgr/lorax
description = Server for phylogenetic tree generation and extension
author = Joel Berendzen
author_email = [email protected]
maintainer = Joel Berendzen
maintainer_email = [email protected]
long_description = file:README.rst
description-file =
README.rst
CHANGELOG.rst
keywords =
science
biology
bioinformatics
genomics
phylogeny
genes
gene families
multiple sequence alignment
phylogenetic trees
license = BSD 3-Clause License
license_file = LICENSE.txt
platforms = any
classifiers =
Development Status :: 4 - Beta,
Environment :: Console,
Framework :: Flask,
Intended Audience :: Science/Research,
License :: OSI Approved :: BSD License,
Operating System :: OS Independent,
Programming Language :: Python :: 3.4,
Programming Language :: Python :: 3.5,
Programming Language :: Python :: 3.6,
Topic :: Scientific/Engineering :: Bio-Informatics

[bdist-wheel]
[options]
zip_safe = False
include_package_data = True
packages = lorax
install_requires =
Flask-RQ2[cli]
biopython
rq_dashboard

[options.package_data]
* =
*.txt
*.rst
*.html
*.c
*.faa
*.hmm
*.sh
*.css
*.js
favicon.ico

[options.packages.find]
exclude =
lorax.test.data
lorax.test.logs

[bdist_wheel]
universal = 0

[wheel]
universal = 0


Loading

0 comments on commit 7d81eca

Please sign in to comment.