Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement scoring matrix downloading process #5

Merged
merged 5 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions =0.12.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Collecting esbonio
Downloading esbonio-0.16.5-py3-none-any.whl.metadata (4.7 kB)
Collecting sphinx (from esbonio)
Downloading sphinx-8.1.3-py3-none-any.whl.metadata (6.4 kB)
Requirement already satisfied: platformdirs in /home/clony/v/lib/python3.12/site-packages (from esbonio) (4.3.6)
Collecting pygls<2,>=1.1.0 (from esbonio)
Downloading pygls-1.3.1-py3-none-any.whl.metadata (4.7 kB)
clonder marked this conversation as resolved.
Show resolved Hide resolved
Collecting pyspellchecker (from esbonio)
Downloading pyspellchecker-0.8.1-py3-none-any.whl.metadata (9.4 kB)
Collecting cattrs>=23.1.2 (from pygls<2,>=1.1.0->esbonio)
Downloading cattrs-24.1.2-py3-none-any.whl.metadata (8.4 kB)
Collecting lsprotocol==2023.0.1 (from pygls<2,>=1.1.0->esbonio)
Downloading lsprotocol-2023.0.1-py3-none-any.whl.metadata (2.2 kB)
Requirement already satisfied: attrs>=21.3.0 in /home/clony/v/lib/python3.12/site-packages (from lsprotocol==2023.0.1->pygls<2,>=1.1.0->esbonio) (24.2.0)
Collecting sphinxcontrib-applehelp>=1.0.7 (from sphinx->esbonio)
Downloading sphinxcontrib_applehelp-2.0.0-py3-none-any.whl.metadata (2.3 kB)
Collecting sphinxcontrib-devhelp>=1.0.6 (from sphinx->esbonio)
Downloading sphinxcontrib_devhelp-2.0.0-py3-none-any.whl.metadata (2.3 kB)
Collecting sphinxcontrib-htmlhelp>=2.0.6 (from sphinx->esbonio)
Downloading sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl.metadata (2.3 kB)
Collecting sphinxcontrib-jsmath>=1.0.1 (from sphinx->esbonio)
Downloading sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting sphinxcontrib-qthelp>=1.0.6 (from sphinx->esbonio)
Downloading sphinxcontrib_qthelp-2.0.0-py3-none-any.whl.metadata (2.3 kB)
Collecting sphinxcontrib-serializinghtml>=1.1.9 (from sphinx->esbonio)
Downloading sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl.metadata (2.4 kB)
Requirement already satisfied: Jinja2>=3.1 in /home/clony/v/lib/python3.12/site-packages (from sphinx->esbonio) (3.1.4)
Requirement already satisfied: Pygments>=2.17 in /home/clony/v/lib/python3.12/site-packages (from sphinx->esbonio) (2.18.0)
Collecting docutils<0.22,>=0.20 (from sphinx->esbonio)
Downloading docutils-0.21.2-py3-none-any.whl.metadata (2.8 kB)
Collecting snowballstemmer>=2.2 (from sphinx->esbonio)
Downloading snowballstemmer-2.2.0-py2.py3-none-any.whl.metadata (6.5 kB)
Requirement already satisfied: babel>=2.13 in /home/clony/v/lib/python3.12/site-packages (from sphinx->esbonio) (2.16.0)
Collecting alabaster>=0.7.14 (from sphinx->esbonio)
Downloading alabaster-1.0.0-py3-none-any.whl.metadata (2.8 kB)
Collecting imagesize>=1.3 (from sphinx->esbonio)
Downloading imagesize-1.4.1-py2.py3-none-any.whl.metadata (1.5 kB)
Requirement already satisfied: requests>=2.30.0 in /home/clony/v/lib/python3.12/site-packages (from sphinx->esbonio) (2.32.3)
Requirement already satisfied: packaging>=23.0 in /home/clony/v/lib/python3.12/site-packages (from sphinx->esbonio) (24.1)
Requirement already satisfied: MarkupSafe>=2.0 in /home/clony/v/lib/python3.12/site-packages (from Jinja2>=3.1->sphinx->esbonio) (3.0.2)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/clony/v/lib/python3.12/site-packages (from requests>=2.30.0->sphinx->esbonio) (3.4.0)
Requirement already satisfied: idna<4,>=2.5 in /home/clony/v/lib/python3.12/site-packages (from requests>=2.30.0->sphinx->esbonio) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/clony/v/lib/python3.12/site-packages (from requests>=2.30.0->sphinx->esbonio) (2.2.3)
Requirement already satisfied: certifi>=2017.4.17 in /home/clony/v/lib/python3.12/site-packages (from requests>=2.30.0->sphinx->esbonio) (2024.8.30)
Downloading esbonio-0.16.5-py3-none-any.whl (170 kB)
Downloading pygls-1.3.1-py3-none-any.whl (56 kB)
Downloading lsprotocol-2023.0.1-py3-none-any.whl (70 kB)
Downloading pyspellchecker-0.8.1-py3-none-any.whl (6.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.8/6.8 MB 41.7 MB/s eta 0:00:00
Downloading sphinx-8.1.3-py3-none-any.whl (3.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.5/3.5 MB 56.8 MB/s eta 0:00:00
Downloading alabaster-1.0.0-py3-none-any.whl (13 kB)
Downloading cattrs-24.1.2-py3-none-any.whl (66 kB)
Downloading docutils-0.21.2-py3-none-any.whl (587 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 587.4/587.4 kB 29.4 MB/s eta 0:00:00
Downloading imagesize-1.4.1-py2.py3-none-any.whl (8.8 kB)
Downloading snowballstemmer-2.2.0-py2.py3-none-any.whl (93 kB)
Downloading sphinxcontrib_applehelp-2.0.0-py3-none-any.whl (119 kB)
Downloading sphinxcontrib_devhelp-2.0.0-py3-none-any.whl (82 kB)
Downloading sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl (98 kB)
Downloading sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl (5.1 kB)
Downloading sphinxcontrib_qthelp-2.0.0-py3-none-any.whl (88 kB)
Downloading sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl (92 kB)
Installing collected packages: snowballstemmer, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, sphinxcontrib-devhelp, sphinxcontrib-applehelp, pyspellchecker, imagesize, docutils, cattrs, alabaster, sphinx, lsprotocol, pygls, esbonio
Successfully installed alabaster-1.0.0 cattrs-24.1.2 docutils-0.21.2 esbonio-0.16.5 imagesize-1.4.1 lsprotocol-2023.0.1 pygls-1.3.1 pyspellchecker-0.8.1 snowballstemmer-2.2.0 sphinx-8.1.3 sphinxcontrib-applehelp-2.0.0 sphinxcontrib-devhelp-2.0.0 sphinxcontrib-htmlhelp-2.1.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-2.0.0 sphinxcontrib-serializinghtml-2.0.0
49 changes: 25 additions & 24 deletions docs/chapters/features/usage.rst
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
Import package and initialise Kinex
Import Package and Initialize Kinex
===================================

1. Import kinex
1. **Import Kinex**

.. code:: python

from kinex import Kinex
from kinex import Kinex

2. Read the scoring matrix
2. **Create a Kinex Object**

- With Predefined Matrices:

It will look in the resources to find the matrices. If it doesn't find them, it will download them and save them for future use.

.. code:: python

scoring_matrix_ser_thr = pd.read_csv("https://zenodo.org/records/13964893/files/scoring_matrix_ser_thr_82k_sorted.csv.gz?download=1", compression="gzip")
scoring_matrix_tyr = pd.read_csv("https://zenodo.org/records/13964893/files/scoring_matrix_tyr_7k_sorted.csv.gz?download=1", compression="gzip")
scoring_matrix_ser_thr
kinex = Kinex()

- With Your Custom Matrices:

.. code:: python

AAK1 ACVR2A ... YSK4 ZAK
0 -11.147481 -6.325340 ... -6.723077 -7.402360
1 -10.421859 -6.178601 ... -6.343452 -7.373478
... ... ... ...
82753 8.074270 7.289390 ... 4.525527 4.837377
82754 8.623180 7.871226 ... 4.869195 5.062391
scoring_matrix_ser_thr = pd.read_csv("path/to/scoring_matrix_ser_thr.csv")
scoring_matrix_tyr = pd.read_csv("path/to/scoring_matrix_tyr.csv")

[82755 rows x 303 columns]
kinex = Kinex(scoring_matrix_ser_thr, scoring_matrix_tyr)

.. note::

You can optionally save the scoring matrix locally for faster use in the future.
The matrix looks like this:

.. code:: python

scoring_matrix_ser_thr.to_csv("scoring_matrix_ser_thr.csv")
scoring_matrix_tyr.to_csv("scoring_matrix_tyr.csv")
AAK1 ACVR2A ... YSK4 ZAK
0 -11.147481 -6.325340 ... -6.723077 -7.402360
1 -10.421859 -6.178601 ... -6.343452 -7.373478
... ... ... ...
82753 8.074270 7.289390 ... 4.525527 4.837377
82754 8.623180 7.871226 ... 4.869195 5.062391

Or just download using the links:
`https://zenodo.org/records/13964893/files/scoring_matrix_ser_thr_82k_sorted.csv.gz?download=1 <https://zenodo.org/records/13964893/files/scoring_matrix_ser_thr_82k_sorted.csv.gz?download=1>`_
`https://zenodo.org/records/13964893/files/scoring_matrix_tyr_7k_sorted.csv.gz?download=1 <https://zenodo.org/records/13964893/files/scoring_matrix_tyr_7k_sorted.csv.gz?download=1>`_

3. Create a kinex object
.. note::

.. code:: python
Predefined matrices can be found here:

kinex = Kinex(scoring_matrix_ser_thr, scoring_matrix_tyr)
- `Scoring Matrix for Serine/Threonine <https://zenodo.org/records/13964893/files/scoring_matrix_ser_thr_82k_sorted.csv.gz?download=1>`_
- `Scoring Matrix for Tyrosine <https://zenodo.org/records/13964893/files/scoring_matrix_tyr_7k_sorted.csv.gz?download=1>`_