-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added bio checks module * Added bio checks and logic check * Added kwargs to the add rule method
- Loading branch information
Showing
8 changed files
with
71 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
amino_acid,3_letter_code,1_letter_code | ||
alanine,ala,A | ||
arginine,arg,R | ||
asparagine,asn,N | ||
aspartic acid,asp,D | ||
asparagine or aspartic acid,asx,B | ||
cysteine,cys,C | ||
glutamic acid,glu,E | ||
glutamine,gln,Q | ||
glutamine or glutamic acid,glx,Z | ||
glycine,gly,G | ||
histidine,his,H | ||
isoleucine,ile,I | ||
leucine,leu,L | ||
lysine,lys,K | ||
methionine,met,M | ||
phenylalanine,phe,F | ||
proline,pro,P | ||
serine,ser,S | ||
threonine,thr,T | ||
tryptophan,trp,W | ||
tyrosine,tyr,Y | ||
valine,val,V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from .. import Check | ||
import pandas as pd | ||
from pathlib import Path | ||
|
||
|
||
class BioChecks: | ||
def __init__(self, check: Check): | ||
self._check = check | ||
try: | ||
parent_path = Path(__file__).parent | ||
self._aminoacids = pd.read_csv(parent_path / "amino_acids.csv") | ||
except Exception: | ||
raise Exception("Unable to load aminoacid definitions") | ||
|
||
def is_dna(self, column: str): | ||
"""Validates that a sequence contains only valid nucleotide bases of DNA strand""" | ||
self._check.has_pattern(column, r"^[GTCA]*$") | ||
return self._check | ||
|
||
def is_protein(self, column: str): | ||
"""Verifies that country codes are valid against the ISO standard 3166""" | ||
self._check.has_pattern( | ||
column, rf"^[{''.join(self._aminoacids['1_letter_code'].tolist())}]*$" | ||
) | ||
return self._check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from .. import Check | ||
from typing import Dict | ||
|
||
|
||
class LogicCheck: | ||
"""Performs logical inference on evaluated checks""" | ||
|
||
def __init__(self, checks: Dict[str, Check] = {}): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "cuallee" | ||
version = "0.12.1" | ||
version = "0.12.2" | ||
authors = [ | ||
{ name="Herminio Vazquez", email="[email protected]"}, | ||
{ name="Virginie Grosboillot", email="[email protected]" } | ||
|
@@ -78,4 +78,5 @@ ignore = ["E731"] | |
|
||
[project.urls] | ||
"Homepage" = "https://github.com/canimus/cuallee" | ||
"Bug Tracker" = "https://github.com/canimus/cuallee" | ||
"Bug Tracker" = "https://github.com/canimus/cuallee" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[metadata] | ||
name = cuallee | ||
version = 0.12.1 | ||
version = 0.12.2 | ||
[options] | ||
packages = find: | ||
packages = find: | ||
include_package_data = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters