Skip to content

Commit

Permalink
Merge pull request #90 from TRON-Bioinformatics/develop
Browse files Browse the repository at this point in the history
Release v2.0.0
  • Loading branch information
priesgo authored Jan 16, 2023
2 parents 417a467 + 9a55f64 commit 83a4469
Show file tree
Hide file tree
Showing 95 changed files with 1,917 additions and 1,000 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
2. Click on '...'
3. Scroll down to '...'
4. See error

**Expected behavior**
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Documentation
on: [push]
jobs:
run:
runs-on: ubuntu-20.04
env:
OS: ubuntu-20.04
PYTHON: '3.8'

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel coverage
pip install -r docs/requirements.txt
- name: Build documentation
run: |
cd docs; make clean html
21 changes: 13 additions & 8 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Unit tests

on: [push]

jobs:
test:
run:
runs-on: ubuntu-20.04
env:
OS: ubuntu-20.04
PYTHON: '3.8'

# Service containers to run with `container-job`
services:
Expand All @@ -21,15 +22,16 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build, install and run unit tests
pip install setuptools wheel coverage
- name: Generate Report
env:
# The hostname used to communicate with the PostgreSQL service container
POSTGRES_HOST: localhost
Expand All @@ -44,4 +46,7 @@ jobs:
python setup.py bdist_wheel
pip install numpy==1.21.0
pip install dist/covigator*.whl
python -m unittest discover covigator.tests.unit_tests
coverage run -m unittest discover covigator.tests.unit_tests
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@

[![PyPI version](https://badge.fury.io/py/covigator.svg)](https://badge.fury.io/py/covigator)
[![Run unit tests](https://github.com/TRON-Bioinformatics/covigator/actions/workflows/unit_tests.yml/badge.svg?branch=main)](https://github.com/TRON-Bioinformatics/covigator/actions/workflows/unit_tests.yml)
[![codecov](https://codecov.io/gh/TRON-Bioinformatics/covigator/branch/main/graph/badge.svg?token=J5Q8UV65PD)](https://codecov.io/gh/TRON-Bioinformatics/covigator)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d6735b902b7b42e0a7cd423cebff69d2)](https://www.codacy.com/gh/TRON-Bioinformatics/covigator/dashboard?utm_source=github.com&utm_medium=referral&utm_content=TRON-Bioinformatics/covigator&utm_campaign=Badge_Grade)
[![Powered by Dash](https://img.shields.io/badge/powered%20by-Dash-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://dash.plotly.com/)
[![License](https://img.shields.io/badge/license-MIT-green)](https://opensource.org/licenses/MIT)
[![Documentation Status](https://readthedocs.org/projects/covigator/badge/?version=latest)](https://covigator.readthedocs.io/en/latest/?badge=latest)

![CoVigator art](covigator/dashboard/assets/wordcloud.png)

**CoVigator dashboard**: [https://covigator.tron-mainz.de](https://covigator.tron-mainz.de)

**CoVigator documentation**: [https://covigator.readthedocs.io/](https://covigator.readthedocs.io)
Expand Down Expand Up @@ -69,5 +73,5 @@ The project was kindly supported by
## How to cite

* Schrörs, B., Riesgo-Ferreiro, P., Sorn, P., Gudimella, R., Bukur, T., Rösler, T., Löwer, M., & Sahin, U. (2021).
Large-scale analysis of SARS-CoV-2 spike-glycoprotein mutants demonstrates the need for continuous screening of virus
isolates. PLOS ONE, 16(9), e0249254. [10.1371/journal.pone.0249254](https://doi.org/10.1371/journal.pone.0249254)
Large-scale analysis of SARS-CoV-2 spike-glycoprotein mutants demonstrates the need for continuous screening of virus
isolates. PLOS ONE, 16(9), e0249254. [10.1371/journal.pone.0249254](https://doi.org/10.1371/journal.pone.0249254)
Empty file added codecov.yml
Empty file.
4 changes: 2 additions & 2 deletions covigator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION = "v1.1.0"
ANALYSIS_PIPELINE_VERSION = "v0.14.0"
VERSION = "v2.0.0"
ANALYSIS_PIPELINE_VERSION = "v0.15.0"

MISSENSE_VARIANT = "missense_variant"
SYNONYMOUS_VARIANT = "synonymous_variant"
Expand Down
27 changes: 15 additions & 12 deletions covigator/accessor/abstract_accessor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import date, datetime
from datetime import date
from typing import Union
import requests
from covigator.misc.country_parser import CountryParser
Expand All @@ -7,13 +7,21 @@
from covigator.exceptions import CovigatorExcludedSampleTooEarlyDateException
from covigator.misc import backoff_retrier

NUMBER_RETRIES = 5
NUMBER_RETRIES = -1


class SampleCovid19:
pass


def _parse_abstract(value, _type):
try:
value = _type(value)
except (ValueError, TypeError):
value = None
return value


class AbstractAccessor:

def __init__(self):
Expand All @@ -33,15 +41,10 @@ def _parse_country(self, sample: Union[SampleEna, SampleCovid19]):
sample.continent_alpha_2 = parsed_country.continent_alpha_2
sample.continent = parsed_country.continent

def _parse_dates(self, sample: Union[SampleEna, SampleCovid19]):
sample.collection_date = self._parse_abstract(sample.collection_date, date.fromisoformat)
sample.first_created = self._parse_abstract(sample.first_created, date.fromisoformat)

@staticmethod
def _parse_dates(sample: Union[SampleEna, SampleCovid19]):
sample.collection_date = _parse_abstract(sample.collection_date, date.fromisoformat)
sample.first_created = _parse_abstract(sample.first_created, date.fromisoformat)
if sample.collection_date is not None and sample.collection_date < MINIMUM_DATE:
raise CovigatorExcludedSampleTooEarlyDateException

def _parse_abstract(self, value, type):
try:
value = type(value)
except (ValueError, TypeError):
value = None
return value
Loading

0 comments on commit 83a4469

Please sign in to comment.