Skip to content

Commit

Permalink
update documentation, import fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandra-valeanu committed Dec 7, 2023
1 parent d026661 commit 03202f1
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 46 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,25 @@ Alexandra Valeanu and Jitao David Zhang with the input and help of many colleagu

Here are few ways to install **kinex**

### From Conda

1. Create and activate your conda environment

```
conda create --name kinex
conda activate kinex
```

2. Install kinex package

```
conda install -c bioconda kinex
```


### From source

1. Create and activate a python 3.11 conda venv:
1. Create and activate a python 3.11 conda environment

```
conda create --name kinex
Expand Down
21 changes: 12 additions & 9 deletions docs/chapters/features/comparison.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Drug comparison
Compare multiple experiments with each other
--------------------------------------------

3. Specify the path to the tables
3. Specify the path to your enrichment tables

.. code:: python
Expand All @@ -26,7 +26,7 @@ Compare multiple experiments with each other
.. note::

The directory should have multiple ``.csv`` files that contain enrichment analysis results from kinex
The directory should have multiple ``.csv`` files that contain enrichment analysis result tables from kinex

.. code::
Expand Down Expand Up @@ -56,14 +56,19 @@ Compare multiple experiments with each other
:file: ../../figures/comparison_multiple_drugs.html


6. You can optionally :ref:`save the plot in a desired format<Save the plot in a desired format>`
.. note::

You can update your figure (marker point, axis, legend, etc.) using Plotly’s functions:
`https://plotly.com/python/creating-and-updating-figures <https://plotly.com/python/creating-and-updating-figures>`_

Compare an experiment to the one existing database of drugs
-----------------------------------------------------------

3. Read the table with enrichment analysis results
6. You can optionally :ref:`save the plot in a desired format<Save the plot in a desired format>`


Compare an experiment to the existing collection of drug profiles
-----------------------------------------------------------------

3. Read the enrichment analysis result table

.. code:: python
Expand Down Expand Up @@ -98,7 +103,7 @@ Compare an experiment to the one existing database of drugs
.. note::

Supported methods are UMAP, MDS and t-SNE
Supported methods are ``UMAP``, ``MDS``, and ``t-SNE``


5. Show the graph
Expand All @@ -119,8 +124,6 @@ Compare an experiment to the one existing database of drugs
:file: ../../figures/comparison_input.html




Save the plot in a desired format
---------------------------------

Expand Down
42 changes: 31 additions & 11 deletions docs/chapters/features/enrichment.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Kinases inference
=================
Kinases inference analysis
==========================

1. Read your input sequences file. Make sure to have on first column the sequences and on second column the log2 transformed Fold Change.
1. Read your input file

.. note::

Make sure to have the phospho-sequences on the first column and the log2 transformed Fold Change on the second column.

.. code:: python
Expand All @@ -17,7 +21,16 @@ Kinases inference
[464 rows x 2 columns]
pandas.DataFrame
2. Run enrichment analysis with your input phospho-sequences.
.. note::

Data: CK2 catalytic sub-units knockdown


2. Run enrichment analysis with your input phospho-sequences

.. note::

Supported methods are ``min``, ``max``, ``avg``, ``all``

.. code:: python
Expand All @@ -28,7 +41,7 @@ Kinases inference
Total number of unregulated phospho-sequences is: 309
enrichment.Enrichment
3. Access the total number of upregulated, downregulated and unregulated phospho-sequences.
3. Access the total number of up-regulated, down-regulated, and un-regulated phospho-sequences

.. code:: python
Expand All @@ -42,15 +55,15 @@ Kinases inference
309
int
4. Check the sites that were marked as failed.
4. Check the sites that were marked as failed

.. code:: python
>>> enrich.failed_sites
['EKIGEGTyGVVYKGR', 'KPSIVTKyVESDDEK', 'LGQRIYQyIQSRFYR', 'INPGYDDyADSDEDQ', 'ADNDITPyLVSRFYR', 'RGEPNVSyICSRYYR']
list
5. Check the regulation of each sequence and top 15 kinases most likely to target each sequence
5. Check the regulation of each phospho-sequence, and get the top 15 kinases most likely to target each phospho-sequence

.. code:: python
Expand All @@ -65,7 +78,7 @@ Kinases inference
[464 rows x 4 columns]
pandas.DataFrame
6. Show enrichment table.
6. Show enrichment table

.. code:: python
Expand All @@ -82,8 +95,12 @@ Kinases inference
[303 rows x 19 columns]
pandas.DataFrame
7. Vulcano plot of enrichment vs p-value. Kinases are represented with colours corresponding to their class.
7. Vulcano plot of Enrichment Odds Ratio (EOR) and p-value

.. note::

Kinases are represented with colours corresponding to their class.

.. code:: python
>>> fig = enrich.plot(use_adjusted_pval=False)
Expand All @@ -95,11 +112,14 @@ Kinases inference

.. note::

Data: CK2 catalytic sub-units knockdown
You can update your figure (marker point, axis, legend, etc.) using Plotly’s functions:
`https://plotly.com/python/creating-and-updating-figures <https://plotly.com/python/creating-and-updating-figures>`_





8. Save the figure in a desired format.
8. Save the figure in a desired format


- ``.html``
Expand Down
14 changes: 7 additions & 7 deletions docs/chapters/features/scoring.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Get scores for a sequence
=========================
Get scores for a phospho-sequence
=================================

1. Score a given sequence and store the results.
1. Score a given phospho-sequence and store the results

.. code:: python
Expand All @@ -11,11 +11,11 @@ Get scores for a sequence
.. note::

The supported format for a sequence\
The supported format for a phospho-sequence\
- ``asterisk``: F_KQKAS*QSPQK
- ``(ph)``: FKQKAS(ph)QSPQK

2. Rank the kinases, for a given sequence, based on their percentile score.
2. Rank the kinases for a given phospho-sequence based on their percentile score

.. code:: python
Expand Down Expand Up @@ -54,15 +54,15 @@ Get scores for a sequence
MNK2 8.275760 3.048892 97.455
pandas.DataFrame
4. Get median percentile.
4. Get median percentile (median score of kinases for a given phospho-sequence)

.. code:: python
>>> res.median_percentile
63.493
numpy.float64
5. Get promiscuity index. By default, the limit is the 90th percentile.
5. Get promiscuity index (the number of kinases scoring above the ``90th`` percentile)

.. code:: python
Expand Down
21 changes: 19 additions & 2 deletions docs/chapters/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,35 @@ Requirements
.. pip install kinex
Installation from Conda
------------------------

1. Create and activate your conda environment

.. code:: bash
conda create --name kinex
conda activate kinex
2. Install kinex package

.. code:: bash
conda install -c bioconda kinex
Installation from Source
------------------------

1. Create and activate a python 3.11 conda venv:
1. Create and activate a python 3.11 conda environment

.. code:: bash
conda create --name kinex
conda activate kinex
conda install python=3.11
2. Download the package:
2. Download the package

.. code:: bash
Expand Down
15 changes: 3 additions & 12 deletions docs/chapters/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,13 @@ Import package and initialise data object

You can optionally save the scoring matrix locally for future uses.

.. code:: bash
>>> ### Download scoring matrix of 82k pre-scored sites
>>> !mkdir scoring_matrix
>>> !wget https://zenodo.org/records/10201142/files/kinex_scoring_matrix_82k_sorted.csv.gzip?download=1 -O scoring_matrix/kinex_scoring_matrix_82k_sorted.csv.gzip
>>> !mv scoring_matrix/kinex_scoring_matrix_82k_sorted.csv.gzip scoring_matrix/kinex_scoring_matrix_82k_sorted.csv.gz
>>> !gunzip scoring_matrix/kinex_scoring_matrix_82k_sorted.csv.gz
.. code:: python
>>> ### Read the scoring matrix from file
>>> scoring_matrix = pd.read_csv("scoring_matrix/scoring_matrix_82k_sorted.csv")
>>> scoring_matrix.to_csv("path/to/scoring_matrix.csv")
Or just download using the `link <https://zenodo.org/records/10201142/files/kinex_scoring_matrix_82k_sorted.csv.gzip?download=1>`_
Or just download using the link: `https://zenodo.org/records/10201142/files/kinex_scoring_matrix_82k_sorted.csv.gzip?download=1 <https://zenodo.org/records/10201142/files/kinex_scoring_matrix_82k_sorted.csv.gzip?download=1>`_

3. Create a kinex object.
3. Create a kinex object

.. code:: python
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project = 'Kinex'
copyright = '2023, Alexandra Valeanu and Jitao David Zhang'
author = 'Alexandra Valeanu and Jitao David Zhang'
release = '1.0.1'
release = '1.0.2'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
7 changes: 6 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
Welcome to Kinex's documentation!
=================================

This documentation includes the information about installation and usage of the package
Kinex is a workflow implemented in a Python package with the same name. Kinex infers causal kinases from phosphoproteomics data.

If you use Kinex, please cite Valeanu et. al, 2023, bioRxiv, doi: `https://doi.org/10.1101/2023.11.23.568445 <https://doi.org/10.1101/2023.11.23.568445>`_.

This documentation includes the information about installation and usage of the package.


.. toctree::
:maxdepth: 3
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="kinex",
version="1.0.1",
version="1.0.2",
description="A python package to compute kinase scoring and enrichment",
packages=["kinex", "kinex.data", "kinex.tests", "kinex.tests.data"],
package_dir={"kinex": "src",
Expand Down
3 changes: 2 additions & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from kinex.kinex import Kinex
from kinex.kinex import Kinex
from kinex.comparison import Comparison

0 comments on commit 03202f1

Please sign in to comment.