Unverified Commit 2babd6b0 authored by Jeroen F.J. Laros's avatar Jeroen F.J. Laros
Browse files

GitHub workflows, RTD patch.

parent e9e97100
name: build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install flake8 pytest fake_open .
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
from subprocess import call
call('pip install ..', shell=True)
from mutalyzer_backtranslate import _get_metadata
......@@ -11,5 +7,5 @@ project = _get_metadata('Name')
release = _get_metadata('Version')
autoclass_content = 'both'
extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.autodoc', 'sphinx_autodoc_typehints', 'sphinxarg.ext']
master_doc = 'index'
docutils==0.17.1
sphinx-argparse
sphinx-autodoc-typehints
......@@ -4,7 +4,7 @@ from .backtranslate import BackTranslate
def _get_metadata(name):
pkg = get_distribution(__package__)
pkg = get_distribution('mutalyzer_backtranslate')
for line in pkg.get_metadata_lines(pkg.PKG_INFO):
if line.startswith('{}: '.format(name)):
......
......@@ -113,8 +113,9 @@ class BackTranslate(object):
substitutions_with_dna = self.with_dna(
codon, sample_amino_acid)
if (substitutions_with_dna and not
cmp_subst(substitutions_without_dna,
substitutions_with_dna) and
cmp_subst(
substitutions_without_dna,
substitutions_with_dna) and
reference_amino_acid != sample_amino_acid):
substitutions.add(
(reference_amino_acid, sample_amino_acid))
......
......@@ -78,8 +78,9 @@ def find_stops(input_handle, output_handle, offset, compact):
output_handle.write('{}\t{}\t{}\n'.format(
offset + (index * 3) + position,
list(stop_positions[position])[0][0],
','.join(map(lambda x: x[1],
sorted(stop_positions[position])))))
','.join(map(
lambda x: x[1],
sorted(stop_positions[position])))))
def main():
......@@ -137,7 +138,7 @@ def main():
try:
args.func(
**dict((k, v) for k, v in vars(args).items() if k not in
('func', 'subcommand')))
**dict((k, v) for k, v in vars(args).items() if k not in (
'func', 'subcommand')))
except IOError as error:
parser.error(error)
......@@ -6,7 +6,8 @@ def _three_to_one():
:returns dict: Three letter to one letter amino acids table.
"""
return dict(list(map(lambda x: (str(x[0]), str(x[1])),
return dict(list(map(
lambda x: (str(x[0]), str(x[1])),
IUPACData.protein_letters_3to1_extended.items())) + [('Ter', '*')])
......
[metadata]
name = mutalyzer_backtranslate
version = 0.1.3
version = 0.1.4
description = Functions for reverse translation.
long_description = file: README.rst
author = LUMC, Jeroen F.J. Laros
......@@ -20,12 +20,23 @@ classifiers =
[options]
packages = find:
install_requires =
biopython==1.76
python-Levenshtein==0.12.0
biopython>=1.76
python-Levenshtein>=0.12.0
tests_require =
fake-open==0.0.1
pytest==4.0.1
fake-open>=0.0.1
pytest-cov>=2.10.0
pytest-pep8>=1.0.6
pytest>=4.0.1
[options.entry_points]
console_scripts =
backtranslate = mutalyzer_backtranslate.cli:main
[tool:pytest]
pep8ignore = docs/conf.py ALL
[coverage:report]
exclude_lines = def main()
[coverage:run]
source = mutalyzer_backtranslate
[tox]
envlist = py35, py36
[testenv]
commands = py.test
whitelist_externals = py.test
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment