rsalor 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rsalor-1.0.0/LICENCE +21 -0
- rsalor-1.0.0/MANIFEST.in +20 -0
- rsalor-1.0.0/PKG-INFO +104 -0
- rsalor-1.0.0/README.md +85 -0
- rsalor-1.0.0/rsalor/__init__.py +1 -0
- rsalor-1.0.0/rsalor/msa.py +810 -0
- rsalor-1.0.0/rsalor/rsa/__init__.py +4 -0
- rsalor-1.0.0/rsalor/rsa/rsa_biopython.py +98 -0
- rsalor-1.0.0/rsalor/rsa/rsa_dssp.py +161 -0
- rsalor-1.0.0/rsalor/rsa/rsa_music.py +169 -0
- rsalor-1.0.0/rsalor/rsa/rsa_solver.py +117 -0
- rsalor-1.0.0/rsalor/sequence/__init__.py +5 -0
- rsalor-1.0.0/rsalor/sequence/amino_acid.py +256 -0
- rsalor-1.0.0/rsalor/sequence/fasta_reader.py +128 -0
- rsalor-1.0.0/rsalor/sequence/mutation.py +44 -0
- rsalor-1.0.0/rsalor/sequence/pairwise_alignment.py +267 -0
- rsalor-1.0.0/rsalor/sequence/sequence.py +135 -0
- rsalor-1.0.0/rsalor/structure/__init__.py +2 -0
- rsalor-1.0.0/rsalor/structure/residue.py +34 -0
- rsalor-1.0.0/rsalor/structure/structure.py +159 -0
- rsalor-1.0.0/rsalor/utils/CSV.py +483 -0
- rsalor-1.0.0/rsalor/utils/__init__.py +4 -0
- rsalor-1.0.0/rsalor/utils/ali_to_fasta.py +67 -0
- rsalor-1.0.0/rsalor/utils/logger.py +77 -0
- rsalor-1.0.0/rsalor/utils/utils.py +92 -0
- rsalor-1.0.0/rsalor/weights/__init__.py +1 -0
- rsalor-1.0.0/rsalor/weights/computeWeightsBackend.cpp +61 -0
- rsalor-1.0.0/rsalor/weights/compute_weights.py +131 -0
- rsalor-1.0.0/rsalor/weights/msa.cpp +200 -0
- rsalor-1.0.0/rsalor.egg-info/SOURCES.txt +29 -0
- rsalor-1.0.0/setup.cfg +4 -0
- rsalor-1.0.0/setup.py +56 -0
rsalor-1.0.0/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c), 2024, Matsvei Tsishyn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
rsalor-1.0.0/MANIFEST.in
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Include files required for building C++ extension
|
|
2
|
+
include rsalor/weights/include *.h
|
|
3
|
+
include rsalor/weights *.cpp
|
|
4
|
+
|
|
5
|
+
# Exclude files and directories that should not be in the package
|
|
6
|
+
exclude fig/*
|
|
7
|
+
exclude src/*
|
|
8
|
+
exclude tmp/*
|
|
9
|
+
exclude 0_*
|
|
10
|
+
exclude conda-env.yml
|
|
11
|
+
exclude test_data/*
|
|
12
|
+
global-exclude *.py[cod]
|
|
13
|
+
global-exclude __pycache__/*
|
|
14
|
+
global-exclude *.so
|
|
15
|
+
global-exclude *.a
|
|
16
|
+
global-exclude *.o
|
|
17
|
+
|
|
18
|
+
# Exclude build artifacts
|
|
19
|
+
global-exclude build/*
|
|
20
|
+
global-exclude *.egg-info/*
|
rsalor-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: rsalor
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Combine structural (Relative Solvent Accessibility) and Evolutionary (Log Odd Ratio from MSA) data to evaluate missence mutations in proteins.
|
|
5
|
+
Home-page: https://github.com/3BioCompBio/RSALOR
|
|
6
|
+
Author: Matsvei Tsishyn
|
|
7
|
+
Author-email: matsvei.tsishyn@protonmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: C++
|
|
10
|
+
Classifier: Programming Language :: C
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENCE
|
|
17
|
+
Requires-Dist: numpy
|
|
18
|
+
Requires-Dist: biopython>=1.75
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# RSALOR
|
|
22
|
+
|
|
23
|
+
`rsalor` is a Python package that computes the `RSA*LOR` score for each missence mutation in a protein. It combines multiple computational steps into a fast and user-friendly tool.
|
|
24
|
+
|
|
25
|
+
**Please cite**:
|
|
26
|
+
Hermans Pauline, Tsishyn Matsvei, Schwersensky Martin, Rooman Marianne and Pucci Fabrizio (2024). Exploring evolution to enhance mutational stability prediction. [bioRxiv](https://www.biorxiv.org/content/10.1101/2024.05.28.596203v2.abstract).
|
|
27
|
+
|
|
28
|
+
## Installation and Usage
|
|
29
|
+
|
|
30
|
+
Installation with `pip`:
|
|
31
|
+
```bash
|
|
32
|
+
pip install rsalor
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Make sure the first sequence in your MSA file is the target sequence to mutate.
|
|
36
|
+
```python
|
|
37
|
+
# Import
|
|
38
|
+
from rsalor import MSA
|
|
39
|
+
|
|
40
|
+
# Initialize MSA
|
|
41
|
+
msa_path = "./test_data/6acv_A_29-94.fasta"
|
|
42
|
+
pdb_path = "./test_data/6acv_A_29-94.pdb"
|
|
43
|
+
chain = "A"
|
|
44
|
+
msa = MSA(msa_path, pdb_path, chain, num_threads=8, verbose=True)
|
|
45
|
+
|
|
46
|
+
# You can ignore structure and RSA by omitting the pdb_path argument
|
|
47
|
+
#msa = MSA(msa_path, num_threads=8, verbose=True)
|
|
48
|
+
|
|
49
|
+
# Get LOR and other scores for all mutations
|
|
50
|
+
scores = msa.get_scores() # [{'mutation_fasta': 'S1A', 'mutation_pdb': 'SA1A', 'RSA': 61.54, 'LOR': 5.05, ...}, ...]
|
|
51
|
+
|
|
52
|
+
# Or directly save scores to a CSV file
|
|
53
|
+
msa.save_scores("./test_data/6acv_A_29-94_scores.csv", sep=";")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Requirements
|
|
57
|
+
|
|
58
|
+
- Python 3.9 or later
|
|
59
|
+
- Python packages `numpy` ans `biopython` (version 1.75 or later)
|
|
60
|
+
- A C++ compiler that supports C++11 (such as GCC)
|
|
61
|
+
- Optionally, OpenMP for multithreading support
|
|
62
|
+
|
|
63
|
+
An example of a working `conda` environment is provided in `./conda-env.yml`.
|
|
64
|
+
|
|
65
|
+
## Short description
|
|
66
|
+
|
|
67
|
+
The `rsalor` package combines structural data (Relative Solvent Accessibility, RSA) and evolutionary data (Log Odd Ratio, LOR from MSA) to evaluate missense mutations in proteins.
|
|
68
|
+
|
|
69
|
+
It parses a Multiple Sequence Alignment (MSA), removes redundant sequences, and assigns a weight to each sequence based on sequence identity clustering. The package then computes the weighted Log Odd Ratio (LOR) and Log Ratio (LR) for each single missense mutation. Additionally, it calculates the Relative Solvent Accessibility (RSA) for each residue and combines the LOR/LR and RSA scores, as described in the reference paper. The package resolves discrepancies between the MSA's target sequence and the protein structure (e.g., missing residues in structure) by aligning the PDB structure with the MSA target sequence.
|
|
70
|
+
|
|
71
|
+
## Additional arguments
|
|
72
|
+
|
|
73
|
+
- **`msa_path`** (`str`): Path to MSA `.fasta` file
|
|
74
|
+
- **`pdb_path`** (`Union[None, str]=None`, optional): Path to the PDB `.pdb` file. Leave empty to ignore structure and RSA calculation.
|
|
75
|
+
- **`chain`** (`Union[None, str]=None`, optional): Chain of the PDB to consider.
|
|
76
|
+
- **`rsa_solver`** (`'biopython'/'DSSP'/'MuSiC'`, default `biopython`): Solver used to compute RSA. DSSP or MuSiC requires the corresponding software to be installed.
|
|
77
|
+
- **`rsa_solver_path`** (`Union[None, str]=None`, optional): Path to the DSSP/MuSiC executable. Leave empty if the software is in the system `PATH`.
|
|
78
|
+
- **`rsa_cache_path`** (`Union[None, str]=None`, optional): Path to read/write the RSA values. If empty, no file will be generated.
|
|
79
|
+
- **`theta_regularization`** (`float=0.1`): Regularization term for LOR/LR at the frequency level.
|
|
80
|
+
- **`n_regularization`** (`float=0.0`): Regularization term for LOR/LR at the counts level.
|
|
81
|
+
- **`count_target_sequence`** (`bool=True`): Whether to include the target (first) sequence of the MSA in the frequencies.
|
|
82
|
+
- **`remove_redundant_sequences`** (`bool=True`): Whether to remove redundant sequences from the MSA. This speeds up the process for deep MSAs.
|
|
83
|
+
- **`use_weights`** (`bool=True`): Whether to compute sequence weights. Set to `False` to set all weights to 1, which may result in faster (for ver deep MSAs) but less relevant scores.
|
|
84
|
+
- **`seqid`** (`float=0.80`): The sequence identity threshold to consider two sequences as similar for weight evaluation.
|
|
85
|
+
- **`num_threads`** (`int=1`): The number of threads (CPUs) to use for weights evaluation in the C++ backend.
|
|
86
|
+
- **`weights_cache_path`** (`Union[None, str]=None`, optional): Path to read/write weights for each sequence in the MSA. If empty, no file will be generated.
|
|
87
|
+
- **`trimmed_msa_path`** (`Union[None, str]=None`, optional): Path to save the trimmed (removed positions that are gaps in the target sequence) and non-redundent sequences MSA file. Leave empty to ignore.
|
|
88
|
+
- **`allow_msa_overwrite`** (`bool=False`): Whether to allow overwriting the original MSA file with the trimmed and non-redundant MSA file `trimmed_msa_path`.
|
|
89
|
+
- **`verbose`** (`bool=False`): Log execution steps.
|
|
90
|
+
- **`disable_warnings`** (`bool=False`) Disable logging for warnings.
|
|
91
|
+
- **`name`** (`Union[None, str]=None`, optional): Name of the MSA object instance (for logging).
|
|
92
|
+
|
|
93
|
+
## Compile from source
|
|
94
|
+
|
|
95
|
+
For performance reasons, `rsalor` uses a C++ backend to weight sequences in the MSA. The C++ code needs to be compiled to use it directly from source. To compile the code, follow these steps:
|
|
96
|
+
```bash
|
|
97
|
+
git clone https://github.com/3BioCompBio/RSALOR # Clone the repository
|
|
98
|
+
cd RSALOR/rsalor/weights/ # Navigate to the C++ code directory
|
|
99
|
+
mkdir build # Create a build directory
|
|
100
|
+
cd build # Enter the build directory
|
|
101
|
+
cmake .. # Generate make files
|
|
102
|
+
make # Compile the C++ code
|
|
103
|
+
mv ./lib_computeWeightsBackend* ../ # Move the compiled file to the correct directory
|
|
104
|
+
```
|
rsalor-1.0.0/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
# RSALOR
|
|
3
|
+
|
|
4
|
+
`rsalor` is a Python package that computes the `RSA*LOR` score for each missence mutation in a protein. It combines multiple computational steps into a fast and user-friendly tool.
|
|
5
|
+
|
|
6
|
+
**Please cite**:
|
|
7
|
+
Hermans Pauline, Tsishyn Matsvei, Schwersensky Martin, Rooman Marianne and Pucci Fabrizio (2024). Exploring evolution to enhance mutational stability prediction. [bioRxiv](https://www.biorxiv.org/content/10.1101/2024.05.28.596203v2.abstract).
|
|
8
|
+
|
|
9
|
+
## Installation and Usage
|
|
10
|
+
|
|
11
|
+
Installation with `pip`:
|
|
12
|
+
```bash
|
|
13
|
+
pip install rsalor
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Make sure the first sequence in your MSA file is the target sequence to mutate.
|
|
17
|
+
```python
|
|
18
|
+
# Import
|
|
19
|
+
from rsalor import MSA
|
|
20
|
+
|
|
21
|
+
# Initialize MSA
|
|
22
|
+
msa_path = "./test_data/6acv_A_29-94.fasta"
|
|
23
|
+
pdb_path = "./test_data/6acv_A_29-94.pdb"
|
|
24
|
+
chain = "A"
|
|
25
|
+
msa = MSA(msa_path, pdb_path, chain, num_threads=8, verbose=True)
|
|
26
|
+
|
|
27
|
+
# You can ignore structure and RSA by omitting the pdb_path argument
|
|
28
|
+
#msa = MSA(msa_path, num_threads=8, verbose=True)
|
|
29
|
+
|
|
30
|
+
# Get LOR and other scores for all mutations
|
|
31
|
+
scores = msa.get_scores() # [{'mutation_fasta': 'S1A', 'mutation_pdb': 'SA1A', 'RSA': 61.54, 'LOR': 5.05, ...}, ...]
|
|
32
|
+
|
|
33
|
+
# Or directly save scores to a CSV file
|
|
34
|
+
msa.save_scores("./test_data/6acv_A_29-94_scores.csv", sep=";")
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Requirements
|
|
38
|
+
|
|
39
|
+
- Python 3.9 or later
|
|
40
|
+
- Python packages `numpy` ans `biopython` (version 1.75 or later)
|
|
41
|
+
- A C++ compiler that supports C++11 (such as GCC)
|
|
42
|
+
- Optionally, OpenMP for multithreading support
|
|
43
|
+
|
|
44
|
+
An example of a working `conda` environment is provided in `./conda-env.yml`.
|
|
45
|
+
|
|
46
|
+
## Short description
|
|
47
|
+
|
|
48
|
+
The `rsalor` package combines structural data (Relative Solvent Accessibility, RSA) and evolutionary data (Log Odd Ratio, LOR from MSA) to evaluate missense mutations in proteins.
|
|
49
|
+
|
|
50
|
+
It parses a Multiple Sequence Alignment (MSA), removes redundant sequences, and assigns a weight to each sequence based on sequence identity clustering. The package then computes the weighted Log Odd Ratio (LOR) and Log Ratio (LR) for each single missense mutation. Additionally, it calculates the Relative Solvent Accessibility (RSA) for each residue and combines the LOR/LR and RSA scores, as described in the reference paper. The package resolves discrepancies between the MSA's target sequence and the protein structure (e.g., missing residues in structure) by aligning the PDB structure with the MSA target sequence.
|
|
51
|
+
|
|
52
|
+
## Additional arguments
|
|
53
|
+
|
|
54
|
+
- **`msa_path`** (`str`): Path to MSA `.fasta` file
|
|
55
|
+
- **`pdb_path`** (`Union[None, str]=None`, optional): Path to the PDB `.pdb` file. Leave empty to ignore structure and RSA calculation.
|
|
56
|
+
- **`chain`** (`Union[None, str]=None`, optional): Chain of the PDB to consider.
|
|
57
|
+
- **`rsa_solver`** (`'biopython'/'DSSP'/'MuSiC'`, default `biopython`): Solver used to compute RSA. DSSP or MuSiC requires the corresponding software to be installed.
|
|
58
|
+
- **`rsa_solver_path`** (`Union[None, str]=None`, optional): Path to the DSSP/MuSiC executable. Leave empty if the software is in the system `PATH`.
|
|
59
|
+
- **`rsa_cache_path`** (`Union[None, str]=None`, optional): Path to read/write the RSA values. If empty, no file will be generated.
|
|
60
|
+
- **`theta_regularization`** (`float=0.1`): Regularization term for LOR/LR at the frequency level.
|
|
61
|
+
- **`n_regularization`** (`float=0.0`): Regularization term for LOR/LR at the counts level.
|
|
62
|
+
- **`count_target_sequence`** (`bool=True`): Whether to include the target (first) sequence of the MSA in the frequencies.
|
|
63
|
+
- **`remove_redundant_sequences`** (`bool=True`): Whether to remove redundant sequences from the MSA. This speeds up the process for deep MSAs.
|
|
64
|
+
- **`use_weights`** (`bool=True`): Whether to compute sequence weights. Set to `False` to set all weights to 1, which may result in faster (for ver deep MSAs) but less relevant scores.
|
|
65
|
+
- **`seqid`** (`float=0.80`): The sequence identity threshold to consider two sequences as similar for weight evaluation.
|
|
66
|
+
- **`num_threads`** (`int=1`): The number of threads (CPUs) to use for weights evaluation in the C++ backend.
|
|
67
|
+
- **`weights_cache_path`** (`Union[None, str]=None`, optional): Path to read/write weights for each sequence in the MSA. If empty, no file will be generated.
|
|
68
|
+
- **`trimmed_msa_path`** (`Union[None, str]=None`, optional): Path to save the trimmed (removed positions that are gaps in the target sequence) and non-redundent sequences MSA file. Leave empty to ignore.
|
|
69
|
+
- **`allow_msa_overwrite`** (`bool=False`): Whether to allow overwriting the original MSA file with the trimmed and non-redundant MSA file `trimmed_msa_path`.
|
|
70
|
+
- **`verbose`** (`bool=False`): Log execution steps.
|
|
71
|
+
- **`disable_warnings`** (`bool=False`) Disable logging for warnings.
|
|
72
|
+
- **`name`** (`Union[None, str]=None`, optional): Name of the MSA object instance (for logging).
|
|
73
|
+
|
|
74
|
+
## Compile from source
|
|
75
|
+
|
|
76
|
+
For performance reasons, `rsalor` uses a C++ backend to weight sequences in the MSA. The C++ code needs to be compiled to use it directly from source. To compile the code, follow these steps:
|
|
77
|
+
```bash
|
|
78
|
+
git clone https://github.com/3BioCompBio/RSALOR # Clone the repository
|
|
79
|
+
cd RSALOR/rsalor/weights/ # Navigate to the C++ code directory
|
|
80
|
+
mkdir build # Create a build directory
|
|
81
|
+
cd build # Enter the build directory
|
|
82
|
+
cmake .. # Generate make files
|
|
83
|
+
make # Compile the C++ code
|
|
84
|
+
mv ./lib_computeWeightsBackend* ../ # Move the compiled file to the correct directory
|
|
85
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from rsalor.msa import MSA
|