Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
backtranslate
Commits
2babd6b0
Unverified
Commit
2babd6b0
authored
Nov 21, 2021
by
Jeroen F.J. Laros
Browse files
GitHub workflows, RTD patch.
parent
e9e97100
Changes
9
Hide whitespace changes
Inline
Side-by-side
.github/workflows/python-package.yml
0 → 100644
View file @
2babd6b0
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
docs/conf.py
View file @
2babd6b0
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'
docs/requirements.txt
0 → 100644
View file @
2babd6b0
docutils==0.17.1
sphinx-argparse
sphinx-autodoc-typehints
mutalyzer_backtranslate/__init__.py
View file @
2babd6b0
...
...
@@ -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
)):
...
...
mutalyzer_backtranslate/backtranslate.py
View file @
2babd6b0
...
...
@@ -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
))
...
...
mutalyzer_backtranslate/cli.py
View file @
2babd6b0
...
...
@@ -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
)
mutalyzer_backtranslate/util.py
View file @
2babd6b0
...
...
@@ -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'
,
'*'
)])
...
...
setup.cfg
View file @
2babd6b0
[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.ini
deleted
100644 → 0
View file @
e9e97100
[tox]
envlist
=
py35, py36
[testenv]
commands
=
py.test
whitelist_externals
=
py.test
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment