Commit e67942ad authored by Nicolas  MAILLET's avatar Nicolas MAILLET
Browse files

Correct block-code

parent 6d52637c
......@@ -6,11 +6,15 @@ User Guide
Overview
========
You can run **Rapide Peptide Generator** using the standalone called::
You can run **Rapide Peptide Generator** using the standalone called:
.. code-block:: none
rpg
You can obtain help by using::
You can obtain help by using:
.. code-block:: none
rpg --help
......@@ -21,18 +25,24 @@ Installation
From pip
--------
The suggested way of installing the latest **RPG** version is through **pip**::
The suggested way of installing the latest **RPG** version is through **pip**:
.. code-block:: none
pip install rpg
Then you can use::
Then you can use:
.. code-block:: none
rpg --help
From source code
----------------
**RPG** is coded in Python. To manually install it from sources, get the source and install **RPG** using:::
**RPG** is coded in Python. To manually install it from sources, get the source and install **RPG** using:
.. code-block:: none
git clone https://gitlab.pasteur.fr/nmaillet/rpg/
cd rpg
......@@ -43,15 +53,21 @@ Using without installing
You can download source code in Pasteur's **Gitlab**: https://gitlab.pasteur.fr/nmaillet/rpg/.
In order to directly run **RPG** from sources, you need to uncomment line 42 of ``rpg/RapidePeptideGenerator.py``. Modify::
In order to directly run **RPG** from sources, you need to uncomment line 42 of ``rpg/RapidePeptideGenerator.py``. Modify:
.. code-block:: python
#from context import rpg
To::
To:
.. code-block:: python
from context import rpg
Then, from main **RPG** directory, use::
Then, from main **RPG** directory, use:
.. code-block:: none
python3 rpg/RapidPeptidesGenerator.py --help
......@@ -66,14 +82,18 @@ Here are classical ways to use **RPG**.
Getting help
------------
To access build-in help, use::
To access build-in help, use:
.. code-block:: none
rpg --help
Listing enzymes
---------------
To list all available enzymes, use::
To list all available enzymes, use:
.. code-block:: none
rpg -l
......@@ -87,28 +107,36 @@ There is two digestion modes in **RPG**. In sequential mode, each protein will b
Sequential digestion of one sequence
""""""""""""""""""""""""""""""""""""
To perform sequential digestion of the sequence "QWSDORESDF" with enzymes 2 and 5 and store results in `output_file.fasta`, use::
To perform sequential digestion of the sequence "QWSDORESDF" with enzymes 2 and 5 and store results in `output_file.fasta`, use:
.. code-block:: none
rpg -i QWSDORESDF -o output_file.fasta -e 2 -e 5
Sequential digestion of a (multi)fasta file
"""""""""""""""""""""""""""""""""""""""""""
To perform sequential digestion of `input_file.fasta` with enzymes 2 and 5 and store results in `output_file.fasta`, use::
To perform sequential digestion of `input_file.fasta` with enzymes 2 and 5 and store results in `output_file.fasta`, use:
.. code-block:: none
rpg -i input_file.fasta -o output_file.fasta -e 2 -e 5
Concurrent digestion of a (multi)fasta file
"""""""""""""""""""""""""""""""""""""""""""
To perform concurrent digestion of `input_file.fasta` with enzymes 2 and 5 and store results in `output_file.fasta`, use::
To perform concurrent digestion of `input_file.fasta` with enzymes 2 and 5 and store results in `output_file.fasta`, use:
.. code-block:: none
rpg -i input_file.fasta -o output_file.fasta -e 2 -e 5 -d c
Adding a new enzyme
-------------------
To add a new enzyme, use::
To add a new enzyme, use:
.. code-block:: none
rpg -a
......@@ -156,7 +184,9 @@ There is two digestion modes in **RPG**. In 'sequential' mode, each protein will
In concurrent mode, all enzymes are present at the same time during digestion and exposure time is supposed to be infinite, i.e. all possible cleavages **will** occur (there is no miscleavage). In this mode, the cleavage of a first enzyme can make available the cleavage site of another enzyme.
Let's define two enzymes. The first is called 'afterP' (id 28) and cleaves after P. The second is called 'afterK' (id 29) and cleaves after K if there is no P just before. Digesting 'PKPKPKPK' using those two enzymes in sequential mode gives the following result::
Let's define two enzymes. The first is called 'afterP' (id 28) and cleaves after P. The second is called 'afterK' (id 29) and cleaves after K if there is no P just before. Digesting 'PKPKPKPK' using those two enzymes in sequential mode gives the following result:
.. code-block:: none
$ rpg -i PKPKPKPK -e 28 -e 29
>Input_0_afterP_1_1_115.13198_5.54
......@@ -174,7 +204,9 @@ Let's define two enzymes. The first is called 'afterP' (id 28) and cleaves after
'afterP' cleaves like expected and 'afterK' is not able to cleave anything.
Digesting 'PKPKPKPK' using those two enzymes in concurrent mode gives the following result::
Digesting 'PKPKPKPK' using those two enzymes in concurrent mode gives the following result:
.. code-block:: none
$ rpg -i PKPKPKPK -e 28 -e 29 -d c
>Input_0_afterP-afterK_1_1_115.13198_5.54
......@@ -206,7 +238,9 @@ Miscleavage
Sometimes, an enzyme does not cleave at a given position even if requirements are fulfilled. This event is called miscleavage and can have biological, chemical or physical origins. To take into account this behavior in **RPG**, one can assign a miscleavage value to an enzyme, expressed as a **percentage**.
For example, using::
For example, using:
.. code-block:: none
rpg -i QWSDORESDF -e 1 -e 2 -e 3 -m 1.4 -m 2.6
......@@ -241,7 +275,9 @@ Peptide molecular weight approximation is computed as the addition of average is
Isoelectric point is computed by solving Henderson–Hasselbalch equation using binary search. It is based on Lukasz P. Kozlowski works (http://isoelectric.org/index.html).
The default output is in multi fasta format. The header then summarize all those informations. For example, on the following fasta result::
The default output is in multi fasta format. The header then summarize all those informations. For example, on the following fasta result:
.. code-block:: none
>Input_0_Asp-N_3_3_419.43738_5.54
QWS
......@@ -268,7 +304,9 @@ Verbosity
Verbosity can be increased or decreased in the shell. Output file is not affected by **-v** or **-q** options.
With default level (no **-v** nor **-q** option), output is, as explain in :ref:`formats`::
With default level (no **-v** nor **-q** option), output is, as explain in :ref:`formats`:
.. code-block:: none
$ rpg -i QWSDORESDF -e 1
>Input_0_Asp-N_3_3_419.43738_5.54
......@@ -278,7 +316,9 @@ With default level (no **-v** nor **-q** option), output is, as explain in :ref:
>Input_2_Asp-N_10_2_280.28048_3.6
DF
Increasing verbosity by one, i.e. using **-v**, leads to add informations about used options. For example::
Increasing verbosity by one, i.e. using **-v**, leads to add informations about used options. For example:
.. code-block:: none
$ rpg -i QWSDORESDF -e 1 -v
Warning: File 'peptides.fasta' already exit!
......@@ -296,7 +336,9 @@ Increasing verbosity by one, i.e. using **-v**, leads to add informations about
>Input_2_Asp-N_10_2_280.28048_3.6
DF
Increasing verbosity by two, i.e. using **-vv**, leads to also add statistics about each digested proteins. For example::
Increasing verbosity by two, i.e. using **-vv**, leads to also add statistics about each digested proteins. For example:
.. code-block:: none
$ rpg -i QWSDORESDF -e 1 -vv
Warning: File 'peptides.fasta' already exit!
......@@ -323,7 +365,9 @@ Increasing verbosity by two, i.e. using **-vv**, leads to also add statistics ab
>Input_2_Asp-N_10_2_280.28048_3.6
DF
Decreasing verbosity, i.e. using **-q** option, remove all informations except errors. For example::
Decreasing verbosity, i.e. using **-q** option, remove all informations except errors. For example:
.. code-block:: none
$ rpg -i QWSDORESDF -e 1 -q
Warning: File 'peptides.fasta' already exit!
......@@ -338,11 +382,15 @@ Creating a new enzyme
Option **-a, --addenzyme** let the user to define new enzymes. An enzyme contains one or several rules and exceptions.
On the following, nomenclature of `Schechter and Berger <https://www.ncbi.nlm.nih.gov/pubmed/6035483>`_ is used. According to it, amino acids before the cleavage site are designated as `P1`, `P2`, `P3`, etc in the N-terminal direction, and as `P1'`, `P2'`, `P3'`, etc in the C-terminal direction. For example, with cleavage site represented as '|'::
On the following, nomenclature of `Schechter and Berger <https://www.ncbi.nlm.nih.gov/pubmed/6035483>`_ is used. According to it, amino acids before the cleavage site are designated as `P1`, `P2`, `P3`, etc in the N-terminal direction, and as `P1'`, `P2'`, `P3'`, etc in the C-terminal direction. For example, with cleavage site represented as '|':
.. code-block:: none
...P3-P2-P1-|-P1'-P2'-P3'...
In **RPG**, this nomenclature is represented as::
In **RPG**, this nomenclature is represented as:
.. code-block:: none
...(P3)(P2)(P1)(,)(P1')(P2')(P3')...
......@@ -352,20 +400,28 @@ Definition of rules
A rule specify which amino acid is targeted by the enzyme, the cleavage position (i.e. **before** or **after** the targeted amino acid) and optionally the surrounding context. Each amino acid must be surrounded by parenthesis, i.e. '**(**' and '**)**' and the cleavage position is symbolized by a comma, i.e. '**,**'. The comma must always be directly before or after a parenthesis.
For example, to define a cleavage occurring **before** A, one must input::
For example, to define a cleavage occurring **before** A, one must input:
.. code-block:: none
(,A)
To define a cleavage occurring **after** B, one must input::
To define a cleavage occurring **after** B, one must input:
.. code-block:: none
(B,)
The context is specified by adding other amino acids, before or after the targeted one. For example, to define a cleavage occurring **before** A (position `P1'`) preceded by B in position `P1`, C in position `P3` and followed by D in position `P2'`, one must input::
The context is specified by adding other amino acids, before or after the targeted one. For example, to define a cleavage occurring **before** A (position `P1'`) preceded by B in position `P1`, C in position `P3` and followed by D in position `P2'`, one must input:
.. code-block:: none
(C)()(B)(,A)(D)
Note that this enzyme will only cleave if it finds the motif C*BAD, where * is **one** amino acid, no matter which one.
It will **not** cleave BAD, nor C*BA, BA, AD, etc. For example::
It will **not** cleave BAD, nor C*BA, BA, AD, etc. For example:
.. code-block:: none
$ rpg -a
Name of the new enzyme?
......@@ -390,12 +446,16 @@ It will **not** cleave BAD, nor C*BA, BA, AD, etc. For example::
FAD
To make this enzyme always cleaves, for example, before A (`P1'`) followed by D in `P2'`, on top of the previous rule, one has to defined two rules in **RPG**::
To make this enzyme always cleaves, for example, before A (`P1'`) followed by D in `P2'`, on top of the previous rule, one has to defined two rules in **RPG**:
.. code-block:: none
(,A)(D)
(C)()(B)(,A)(D)
Not that this enzyme will **not** cleave BAD, has it is specified that it will cleave before A preceded by B in `P1` **if there is C in `P3`**. Identically, it will **not** cleave C*BA*, has D is require in `P2'` for the second rule::
Not that this enzyme will **not** cleave BAD, has it is specified that it will cleave before A preceded by B in `P1` **if there is C in `P3`**. Identically, it will **not** cleave C*BA*, has D is require in `P2'` for the second rule:
.. code-block:: none
$rpg -a
Name of the new enzyme?
......@@ -429,30 +489,40 @@ Not that this enzyme will **not** cleave BAD, has it is specified that it will c
>Input_0_rpg_example_userguide_0_3_204.18268_3.6
BAD
The order of inputted rules is not relevant. This enzyme::
The order of inputted rules is not relevant. This enzyme:
.. code-block:: none
(,A)(D)
(C)()(B)(,A)(D)
and this second one::
and this second one:
.. code-block:: none
(C)()(B)(,A)(D)
(,A)(D)
are identical.
It is possible to define none related cleavage rules for the same enzyme, for example::
It is possible to define none related cleavage rules for the same enzyme, for example:
.. code-block:: none
(P)(W,)(E)(T)
(G,)(G)
This enzyme will cleave after G (position `P1`) followed by G in `P1'` and also after W (`P1`) preceded by P in `P2` and followed by E in `P1'` and T in `P2'`.
Note that each rule must concerned only **one** cleavage site. It is not possible to input rule like::
Note that each rule must concerned only **one** cleavage site. It is not possible to input rule like:
.. code-block:: none
(A,)(B,)
This would define an enzyme cleaving after A in `P1` followed by B in `P1'` but also cleaving after B in `P1` preceded by A in `P2`. The proper way to input this is by using two separate rules::
This would define an enzyme cleaving after A in `P1` followed by B in `P1'` but also cleaving after B in `P1` preceded by A in `P2`. The proper way to input this is by using two separate rules:
.. code-block:: none
(A,)(B)
(A)(B,)
......@@ -465,15 +535,21 @@ Definition of exceptions
An exception specify when a cleavage should **not** occurs. **Exceptions must always be linked to a rule**.
For example, to define a cleavage occurring **before** A (`P1'`), one must input::
For example, to define a cleavage occurring **before** A (`P1'`), one must input:
.. code-block:: none
(,A)
Exceptions can then be inputted, for example a cleavage occurs before A(`P1'`), except when P is in (`P2'`) is defined by adding this exception::
Exceptions can then be inputted, for example a cleavage occurs before A(`P1'`), except when P is in (`P2'`) is defined by adding this exception:
.. code-block:: none
(,A)(P)
This enzyme will always cleave before A when not followed by P::
This enzyme will always cleave before A when not followed by P:
.. code-block:: none
rpg -a
Name of the new enzyme?
......@@ -501,11 +577,15 @@ This enzyme will always cleave before A when not followed by P::
>Input_0_rpg_example_userguide_0_6_604.67828_3.6
CWBAPE
It is possible to input complex exceptions. For the previous enzyme, we can add the following exception::
It is possible to input complex exceptions. For the previous enzyme, we can add the following exception:
.. code-block:: none
(G)(T)()(,A)()(F)
This enzyme will always cleave before A when not followed by P or preceded by G in `P3`, T in `P2` and F in `P3'` **at the same time**::
This enzyme will always cleave before A when not followed by P or preceded by G in `P3`, T in `P2` and F in `P3'` **at the same time**:
.. code-block:: none
rpg -a
Name of the new enzyme?
......@@ -547,11 +627,15 @@ This enzyme will always cleave before A when not followed by P or preceded by G
>Input_1_rpg_example_userguide_6_3_315.32628_3.6
APE
It is important to understand that an exception should always be linked to a rule. If one inputs this rule::
It is important to understand that an exception should always be linked to a rule. If one inputs this rule:
.. code-block:: none
(A,)
followed by this exception::
followed by this exception:
.. code-block:: none
(B,)(C)
......@@ -566,20 +650,28 @@ Easily writing complex enzymes
To make enzyme creation easier to use, two tricks are available.
The first one simplify the definition of enzymes cleaving **before** and **after** a given amino acid. Defining an enzyme cleaving, for example, before **and** after A, can be done with two rules::
The first one simplify the definition of enzymes cleaving **before** and **after** a given amino acid. Defining an enzyme cleaving, for example, before **and** after A, can be done with two rules:
.. code-block:: none
(,A)
(A,)
or simply using::
or simply using:
.. code-block:: none
(,A,)
The second tricks is the use of the keyword `or`. This allows multiple possibilities for on position. For example::
The second tricks is the use of the keyword `or`. This allows multiple possibilities for on position. For example:
.. code-block:: none
(,A or B)
is equivalent to::
is equivalent to:
.. code-block:: none
(,A)
(,B)
......@@ -588,7 +680,9 @@ is equivalent to::
Those two tricks help one complex enzymes. For example, :ref:`peps13` preferentially cleaves around F or L, sometimes before, sometimes after, depending on the context. More specifically, it will not cleave before F or L in `P1'` followed by P in `P2'`. It will not cleave before F or L in `P1'` preceded by R in `P1` or P in `P2` or H/K/R in `P3`. It will not cleave after F or L in `P1` followed by P in `P2'`. And it will not cleave after F or L in `P1` preceded by P in `P2` or H/K/R in `P3`.
It can be defined either by::
It can be defined either by:
.. code-block:: none
cleaving rules:
......@@ -622,7 +716,9 @@ It can be defined either by::
(K)()(L,)
(R)()(L,)
or, in a condensed way::
or, in a condensed way:
.. code-block:: none
cleaving rule:
......@@ -653,11 +749,15 @@ Deleting user-defined enzymes
All user-defined enzymes are stored in ``~/rpg_user.py``. This file is automatically generated by **RPG** en written in **Python**.
Each enzyme definition starts with::
Each enzyme definition starts with:
.. code-block:: python
# User-defined enzyme <name of the enzyme>
and finishes with::
and finishes with:
.. code-block:: python
CPT_ENZ += 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment