Commit 476478c5 authored by Fabrice  ALLAIN's avatar Fabrice ALLAIN
Browse files

Added coverage report in generated ci files

parent 6ee017a8
......@@ -36,6 +36,7 @@ wheels/
*.egg-info/
.installed.cfg
*.egg
*.pytest_cache/
# PyInstaller
################################################################################# Usually these files are written by a python script from a template
......
......@@ -8,6 +8,7 @@ services:
stages:
- build
- test
- coverage
- cleanup
build:
......@@ -18,19 +19,49 @@ build:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME" .
- docker push "$CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME"
coverage:
stage: coverage
image: registry-gitlab.pasteur.fr/bis-aria/ariaec:master
script:
- pytest --cov=aria
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
artifacts:
paths:
- htmlcov/
coverage:
stage: coverage
script:
- nosetests -c .noserc -q --cover-html-dir=build --cover-html
- coverage report -m
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
artifacts:
paths:
- build
pages:
image: registry-gitlab.pasteur.fr/bis-aria/ariaec:master
dependencies:
- coverage
script:
- cd ${CI_PROJECT_DIR}/docs/
- make html
- cd ${CI_PROJECT_DIR}
- mv ${CI_PROJECT_DIR}/docs/_build/html/ public
- mv htmlcov public/
artifacts:
paths:
- public
only:
- master
pytest:
image: registry-gitlab.pasteur.fr/bis-aria/ariaec:master
stage: test
script:
- pytest -sx --doctest-modules --doctest-ignore-import-errors --cov=aria
# unittest:
# image: registry-gitlab.pasteur.fr/bis-aria/ariaec:master
# stage: test
......
......@@ -4,7 +4,7 @@ MAINTAINER Fabrice Allain <fabrice.allain@pasteur.fr>
RUN yum install -y epel-release
RUN yum install -y python2-pip python-devel gcc make
RUN pip install --upgrade pip ; pip install --upgrade setuptools; pip install sphinx; pip install numpy; pip install matplotlib
RUN pip install --upgrade pip ; pip install --upgrade setuptools; pip install sphinx; pip install numpy; pip install matplotlib; pip install coverage;
RUN mkdir build-aria
ADD aria /build-aria/aria
......
Version: 0.2.3
Version: 0.0.17
de Novo Ambiguous Restraints for Iterative Assignment
=====================================================
**A pipeline for automated de novo contact map assignment**
|Pipeline status| |Coverage report|
``ariaec`` is a Python_ library that provides *de novo* structure prediction
based on ARIA_ pipeline and evolutionary restraints inferred from co-evolution.
The package add several command line interfaces aside the usual ARIA commands in
order to convert data, setup an ARIA project with evolutionary restraints,
analyze contact maps or protein structures and generate statistics from a culled
list of PDB files. An exhaustive list of the commands is available in the
section
``nbsphinx`` is a Sphinx_ extension that provides a source parser for
``*.ipynb`` files.
Custom Sphinx directives are used to show `Jupyter `_ code cells (and of
course their results) in both HTML and LaTeX output.
Un-evaluated notebooks -- i.e. notebooks without stored output cells -- will be
automatically executed during the Sphinx build process.
Quick Start:
------------
#. Be sure to check if ``pip`` (>= 9.0), ``setuptools`` (>= 18.0), ``numpy``
(>= 1.11) and ``matplotlib`` are actually instaled in your personnal python
installation or virtual environment.
#. Download the ``zip`` or ``tar`` version at https://gitlab.pasteur.fr/bis-aria/ariaec
#. Edit your ``index.rst`` and add the names of your ``*.ipynb`` files
to the ``toctree``.
#. Run Sphinx!
Online documentation (and example of use):
http://nbsphinx.readthedocs.io/
Source code repository (and issue tracker):
https://github.com/spatialaudio/nbsphinx/
License:
--------
.. MIT -- see the file ``LICENSE`` for details.
.. Hyperlinks
.. _ARIA: http://aria.pasteur.fr
.. _Python: https://www.python.org
.. _Sphinx: http://sphinx-doc.org/
.. _Jupyter Notebook: http://jupyter.org/
......@@ -4,7 +4,7 @@ FROM: centos:centos7
%labels
maintainer Fabrice Allain <fabrice.allain@pasteur.fr>
package.name ariaec
package.version 0.2.3
package.version 0.1.0
package.homepage https://gitlab.pasteur.fr/bis-aria/ariaec
%post
......
......@@ -42,27 +42,6 @@ import subprocess
import pkg_resources as pkgr
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.2
"""
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
error = subprocess.CalledProcessError(retcode, cmd)
error.output = output
raise error
return output
class PartlyUsedNodesFinder:
def __init__(self, queue, exclude_list=None):
if exclude_list is None:
......@@ -72,7 +51,7 @@ class PartlyUsedNodesFinder:
def find(self):
# Retrieve qstat -f result and split in lines
qstat_array = check_output(['qstat', '-f']).split('\n')[:-1]
qstat_array = subprocess.check_output(['qstat', '-f']).split('\n')[:-1]
# Filter results for the appropiate queue
qstat_array = filter(lambda x: self.queue in x, qstat_array)
# split qstat -f row into columns
......
......@@ -41,7 +41,6 @@ from .Topology import Topology, BaseResidueSettings, BaseResidue, \
# TODO [FALLAIN] works with py3 ?
from ccp.general.Io import getChemComp
from memops.api import Implementation
# TODO [FALLAIN] lines below not used if installation done with setuptools
......
......@@ -18,7 +18,7 @@ def AminoAcid(input):
the 3-letter-code as element 1 and the name as element 2.
all returned 1- and 3-letter codes are uppercase, the name
is lowercase.
if the input is not a common amino acid, the elements 0 and 1 will be
if the input is not a common amino acid, the elements 0 and 1 will be empty
Parameters
----------
......
......@@ -5,14 +5,19 @@ Created on 9/16/16
@author: fallain
"""
import pytest
from aria.core.legacy.AminoAcid import AminoAcid
from core.legacy.AminoAcid import AminoAcid
@pytest.fixture()
def amino_acid_2l3l():
return ((),())
@pytest.fixture(scope="module", params=[
'A', 'ALA', 'R', 'ARG', 'N', 'ASN', 'D', 'ASP', 'C', 'CYS', 'Q', 'GLN', 'E',
'GLU', 'G', 'GLY', 'H', 'HIS', 'I', 'ILE', 'L', 'LEU', 'K', 'LYS', 'M',
'MET', 'F', 'PHE', 'P', 'PRO', 'S', 'SER', 'T', 'THR', 'W', 'TRP', 'Y',
'TYR', 'V', 'VAL'])
def amino_acid_2l3l(request):
yield request.param
def test_convert_amino_acid(amino_acid_2l3l):
pass
\ No newline at end of file
aa = AminoAcid(amino_acid_2l3l)
assert len(aa) == 3
assert aa[0]
......@@ -21,36 +21,27 @@
#
"""
Fortran-style formatted input/output
Fortran-style formatted input/output
This module provides two classes that aid in reading and writing
Fortran-formatted text files.
This module provides two classes that aid in reading and writing
Fortran-formatted text files.
Examples::
:Example:
Input::
>>>s = ' 59999'
>>>format = FortranFormat('2I4')
>>>line = FortranLine(s, format)
>>>print(line[0])
>>>print(line[1])
>>> s = ' 59999'
>>> format = FortranFormat('2I4')
>>> line = FortranLine(s, format)
>>> print(line[0])
5
>>> print(line[1])
9999
prints::
>>> format = FortranFormat('2D15.5')
>>> line = FortranLine([3.1415926, 2.71828], format)
>>> print(str(line))
3.14159D+00 2.71828D+00
>>>5
>>>9999
Output::
>>>format = FortranFormat('2D15.5')
>>>line = FortranLine([3.1415926, 2.71828], format)
>>>print(str(line))
prints::
'3.14159D+00 2.71828D+00'
"""
import string
......
......@@ -6,50 +6,55 @@
#
"""
Parsing and writing of Protein Data Bank (PDB) files
This module provides classes that represent PDB (Protein Data Bank)
files and configurations contained in PDB files. It provides access to
PDB files on two levels: low-level (line by line) and high-level
(chains, residues, and atoms).
Caution: The PDB file format has been heavily abused, and it is
probably impossible to write code that can deal with all variants
correctly. This modules tries to read the widest possible range of PDB
files, but gives priority to a correct interpretation of the PDB
format as defined by the Brookhaven National Laboratory.
A special problem are atom names. The PDB file format specifies that
the first two letters contain the right-justified chemical element
name. A later modification allowed the initial space in hydrogen names
to be replaced by a digit. Many programs ignore all this and treat the
name as an arbitrary left-justified four-character name. This makes it
difficult to extract the chemical element accurately; most programs
write the '"CA"' for C_alpha in such a way that it actually stands for
a calcium atom. For this reason a special element field has been added
later, but only few files use it. In the absence of an element field,
the code in this module attempts to guess the element using all information
available.
The low-level routines in this module do not try to deal with the atom
name problem; they return and expect four-character atom names
including spaces in the correct positions. The high-level routines use
atom names without leading or trailing spaces, but provide and use the
element field whenever possible. For output, they use the element
field to place the atom name correctly, and for input, they construct
the element field content from the atom name if no explicit element
field is found in the file.
Except where indicated, numerical values use the same units and
conventions as specified in the PDB format description.
Example::
>>>conf = Structure('example.pdb')
>>>print(conf)
>>>for residue in conf.residues:
>>> for atom in residue:
>>> print(atom)
Parsing and writing of Protein Data Bank (PDB) files
This module provides classes that represent PDB (Protein Data Bank)
files and configurations contained in PDB files. It provides access to
PDB files on two levels: low-level (line by line) and high-level
(chains, residues, and atoms).
Caution: The PDB file format has been heavily abused, and it is
probably impossible to write code that can deal with all variants
correctly. This modules tries to read the widest possible range of PDB
files, but gives priority to a correct interpretation of the PDB
format as defined by the Brookhaven National Laboratory.
A special problem are atom names. The PDB file format specifies that
the first two letters contain the right-justified chemical element
name. A later modification allowed the initial space in hydrogen names
to be replaced by a digit. Many programs ignore all this and treat the
name as an arbitrary left-justified four-character name. This makes it
difficult to extract the chemical element accurately; most programs
write the '"CA"' for C_alpha in such a way that it actually stands for
a calcium atom. For this reason a special element field has been added
later, but only few files use it. In the absence of an element field,
the code in this module attempts to guess the element using all information
available.
The low-level routines in this module do not try to deal with the atom
name problem; they return and expect four-character atom names
including spaces in the correct positions. The high-level routines use
atom names without leading or trailing spaces, but provide and use the
element field whenever possible. For output, they use the element
field to place the atom name correctly, and for input, they construct
the element field content from the atom name if no explicit element
field is found in the file.
Except where indicated, numerical values use the same units and
conventions as specified in the PDB format description.
:Example:
>>> conf = Structure('examples/werner/result/hrdc_10_water.pdb')
>>> print(conf)
Structure('examples/werner/result/hrdc_10_water.pdb'):
Peptide chain of length 91
<BLANKLINE>
>>> for residue in conf.residues:
... for atom in residue:
... pass
>>> print(atom)
Atom OT2 at [7.831 6.168 6.392]
@undocumented: atom_format
@undocumented: anisou_format
......
......@@ -37,7 +37,8 @@ extensions = [
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon'
'sphinx.ext.napoleon',
'sphinx.ext.nbsphinx'
]
# Add any paths that contain templates here, relative to this directory.
......@@ -53,20 +54,22 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'ARIA'
copyright = u'2017, Benjamin Bardiaux, Michael Habeck, Therese Malliavin,' \
u' Wolfgang Rieping, and Michael Nilges'
project = u'ARIAEC'
import time
author = u'Benjamin Bardiaux, Michael Habeck, Therese Malliavin, ' \
u'Wolfgang Rieping, and Michael Nilges'
copyright = u'{}, {}'.format(
time.strftime("%Y"), author)
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'2'
import setup
version = setup.get_version()
# The full version, including alpha/beta/rc tags.
release = u'4'
release = setup.get_version()
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......@@ -78,7 +81,7 @@ language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
......
.. _contents:
Sphinx documentation contents
=============================
.. toctree::
:maxdepth: 2
installation
tutorial
modules
copyright
Indices and tables
==================
.. only:: builder_html
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
* :ref:`glossary`
.. only:: not builder_html
* :ref:`modindex`
* :ref:`glossary`
\ No newline at end of file
......@@ -3,13 +3,19 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to ARIAEC's documentation!
==================================
.. include:: ../README.rst
.. toctree::
:maxdepth: 2
:caption: Contents:
:maxdepth: 1
:caption: Contents
introduction
changelog
installation
tutorial
examples/index
api
Indices and tables
......
......@@ -5,3 +5,9 @@
universal=1
[egg_info]
# tag_build = .dev
[aliases]
test=pytest
[tool:pytest]
log_print=no
log_cli=no
log_level=info
\ No newline at end of file
......@@ -192,8 +192,10 @@ def setup_package():
setup_requires=[
# Setuptools 18.0 properly handles Cython extensions.
'setuptools>=18.0',
'cython'
'cython',
'pytest-runner'
],
tests_requires=['pytest', 'pytest-cov'],
# Project uses reStructuredText, so ensure that the docutils get
# installed or upgraded on the target machine
install_requires=[
......@@ -219,6 +221,7 @@ def setup_package():
'tqdm',
'hdbscan',
'conkit',
'nbsphinx',
# 'scikit-bio' Doesn't works with python 2.7. Only 3.4 +
],
entry_points={
......
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