Skip to content

Commit

Permalink
[CI] Add tests.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao committed Sep 18, 2017
1 parent caa67a0 commit b73c275
Show file tree
Hide file tree
Showing 9 changed files with 1,170 additions and 1,090 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ install:

# command to run tests
script:
- for VERSION in $PYTHON_VERSIONS ; do source activate $VERSION ; done
- for VERSION in $PYTHON_VERSIONS ; do source activate $VERSION ; py.test tests.py ; done

sudo: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ A `.report.txt` file will also be generated that contains a summary of
number of people affected by over-expanded TREDs as well as population allele
frequency.

To better understand the uncertainties in the prediction, one call plot the
To better understand the uncertainties in the prediction, we can plot the
likelihood surface based on the model. Using the same example as above at the
Huntington disease case, we can run a command on the JSON output, with option
`--tred HD` to specify the locus.
Expand Down
23 changes: 23 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-


def test_tred():
""" Run tred.py on sample CSV file and generate TSV file with the genotype
"""
from tredparse.tred import main
main(["tests/samples.csv", "--workdir", "work"])


def test_tredreport():
""" Highlight the potential risk individuals
"""
from tredparse.tredreport import main
main(["work/t001.json", "work/t002.json", "--tsv", "work.tsv"])


def test_tredplot():
""" Plot the likelihood surface based on the model
"""
from tredparse.tredplot import likelihood
likelihood(["work/t001.json", "--tred", "HD"])
Loading

0 comments on commit b73c275

Please sign in to comment.