Skip to content

Commit

Permalink
Klifs (#58)
Browse files Browse the repository at this point in the history
* simplified DICT_POCKET_KLIFS_REGIONS, have added notion of contiguous KLIFS regions after reviewing structurally alignments manually and updated iterate_klifs_alignment function accordingly; started movign KLIFSPocket dataclass into klifs module

* adjusted KLIFS pocket notebook to adapt to klifs module changes

* adjusted KLIFS pocket notebook to adapt to klifs module changes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* flake8 fix for unused import

* added initial find_start_or_end_recursively function

* added initial kinase Pydantic schema

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* latest kinase Pydantic schema

Resolved conflicts from pre-commit.ci

* added csv files to data and updated database notebook

* caching latest klifs pocket notebook

* refactored model schema so that each database module has its own BaseModel that is included in Kinase object

* klifs

* updated KinaseInfo to use more general search term in lieu of kinase name; then converted search in database notebook to UniProt ID instead of HGNC gene name

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* completed intial version of kinase_schema to allow for harmonization of databases and Pydantic model generation; updated databases notebook and source files in data dir

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed F401 and F722 errors in kinase_schema

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* completed intial version of kinase_schema to allow for harmonization of databases and Pydantic model generation; updated databases notebook and source files in data dir

rebased kinase schema

* used Kincore2UniProtAligner from aligment module in kincore module

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* reverting to previous changes lost in rebase

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed E266 flake8 error

* started adding b.l alignment

* added get_repo_root util lost after last rebase

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added validation to fix incorrect KLIFS pocket for ADCK3

* used Self instead of self for ADCK3 KLIFS pocket validation fix

* final commit before moving all functions to KLIFSPocket class

* interim commit of klifs_pocket notebook while debugging bl alignment algorithm

* added SO link to ADCK3 validator for future reference

* added matplotlib_venn in dependencies

* added validation correction for LRRK2 and CAMKK1 KLIFS pockets

* finalized alignment algorithm for b.l, multi-matching post-concatenation, and all other remaining partial alignments

* final notebook including partial alignment issues

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed extraneous dev code from klifs_pocket notebook

* removed TODO from completed KLIFS tasks

* added biopython to devtools test env for CI

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* deleted unnecessary commented out code

* removed commented out code now integrated into return_idx_of_alignment_match

* added generate_alignment to KLIFSPocket and added to pre-init

* added bool_offset and KLIFS2UniProt to KinaseInfo BaseModel along with a generator validation function for the latter

* updated KLIFS pocket notebook for latest kinase schema including KLIFS2UniProt dict

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jessicaw9910 and pre-commit-ci[bot] authored Oct 16, 2024
1 parent 59501fa commit 67e2730
Show file tree
Hide file tree
Showing 15 changed files with 4,925 additions and 2,093 deletions.
518 changes: 518 additions & 0 deletions data/kinhub.csv

Large diffs are not rendered by default.

518 changes: 518 additions & 0 deletions data/kinhub_klifs.csv

Large diffs are not rendered by default.

1,182 changes: 1,182 additions & 0 deletions data/kinhub_pfam.csv

Large diffs are not rendered by default.

518 changes: 518 additions & 0 deletions data/kinhub_uniprot.csv

Large diffs are not rendered by default.

518 changes: 518 additions & 0 deletions data/kinhub_uniprot_merge.csv

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ dependencies:
- requests-cache
- beautifulsoup4
- numpy
- biopython
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from dataclasses import dataclass

from Bio import Align


@dataclass
class CustomAligner:
mode: str = "local"
"""str: Alignment mode. Default is "local"."""
substitution_matrix: str = "BLOSUM62"
"""str: Substitution matrix. Default is BLOSUM62."""
gap_score: int = -5
"""int: Gap score. Default is -5."""
extend_gap_score: int = -1
"""int: Gap extension score. Default is -1."""

def __post_init__(self):
self.aligner = Align.PairwiseAligner()
self.aligner.mode = self.mode
self.aligner.substitution_matrix = Align.substitution_matrices.load(
self.substitution_matrix
)
self.aligner.open_gap_score = self.gap_score
self.aligner.extend_gap_score = self.extend_gap_score

def align(self, seq1: str, seq2: str) -> Align.MultipleSeqAlignment:
return self.aligner.align(seq1, seq2)


@dataclass
class BL2UniProtAligner(CustomAligner):
mode: str = "global"
"""str: Alignment mode. Default is "global."""

def __post_init__(self):
super().__post_init__()


@dataclass
class Kincore2UniProtAligner(CustomAligner):
mode: str = "local"
"""str: Alignment mode. Default is "local."""

def __post_init__(self):
super().__post_init__()
Loading

0 comments on commit 67e2730

Please sign in to comment.