Commit 72885050 by Vinh-Son PHO

README.md updates

parent a0e434f5
......@@ -10,7 +10,7 @@ This Newick tree can be easily displayed using iTOL (or other tree visualisation
Make sure that you have downloaded our conservation predictor, it should be in "PLMView/src/cons_models/Mulan/MODEL_NAME.pt".
Python libraries : NumPy, Cython, SciPy, PyTorch, Transformers, ete3.
To be able to use CUDA acceleration (for both `PLMV_embed` and `PLMV_compare_cuda`), make sure that PyTorch is installed correctly with CUDA and that you use the python interpreter assiociated with that pytorch installation.
To test wether CUDA can be used for parallelized alignment, try importing ``` alignment_cuda``` in python.
To test wether CUDA can be used for parallelized alignment, try importing ```aligner.alignment_cuda``` in python.
## Installation
To install, go to the `src` directory and run :
......@@ -26,9 +26,25 @@ export PATH=$PATH:/path/to/PLMView/scripts
to your .bashrc file to call the following scripts globally.
## Simplified pipeline
Bash script to run PLMView to build the functional tree starting from sequences and to compute explanations are provided in `scripts`. Feel free to change the different constants in those scripts.
Bash script to run PLMView to build the functional tree starting from sequences and to compute explanations are provided in `scripts`.
Feel free to change the different constants in those scripts.
We highly recommend, running `PLMV_run.sh` with carefully selected `min_seq_id` and `coverage`, used for automatic anchor selection using `mmseqs easy-cluster`, based on your dataset. Optimal values may depends on factors such as variability withing sequence, multi or single domain dataset, etc...
Build functional tree from `input_fasta`, result tree is stored in `working_dir/out/out_tree_<base_name>`:
```console
PLMV_run.sh <input_fasta> <working_dir> [min_seq_id=0.6] [coverage=0.5]
```
Given `<basename>` explain splits at `[nodes]`. `<seq-of-interest>`, are used explecitly used for explanation:
```console
PLMV_explain.sh <basename> <seq-of-interest> <work-dir> [nodes]
```
Given `<basename>` explain splits containing `<refnode>` at `[nodes]`. Explanations are centered around `<refnode>`. `<seq-of-interest>`, are used explecitly used for explanation:
```console
PLMV_explain_1vsall.sh <basename> <seq-of-interest> <work-dir> <refnode> [nodes]
```
We highly recommend running `PLMV_run.sh` with carefully selected `min_seq_id` and `coverage`, used for automatic anchor selection using `mmseqs easy-cluster`, based on your dataset. Optimal values may depends on factors such as variability withing sequence, multi or single domain dataset, etc...
We also recommend, using no more than a few thousand anchors, for computational effectiveness.
......@@ -66,11 +82,23 @@ python PLMView/src/PLMV_compare.py --anchors-dir anchors --sequences-dir new_seq
python PLMView/src/PLMV_infer.py --repr-space new_out_comp --tree-path out_tree/cluster_tree.pkl --out-dir out --prefix inferred_leaves
```
7. Given a Fasta alignment, you can generate scores "explaining" the importance of each position in the overall classification of the sequences contained in said alignment. Generating scores for the left and right branches in a tree can be really helpful when looking at which positions are important for the split.
```console
python PLMView/src/PLMV_explain.py --anchors-dir anchors --sequences-dir sequences --repr-space out_comp --out-dir out_explain --prefix scores --alignment-file alignment.fasta --tree out_tree/tree.pkl --node ROOT
```
8. The scores obtained in 7. are more interpretable when we substract the right branch's score to the left's. This new score highlight what differentiate the 2 branches at a given node.
```console
python PLMView/src/PLMV_viz_explain.py --explain-dir out_explain --out-dir out_explain_viz --sampled-MSA alignment.fasta --tree out_tree/tree.nhx
```
9. Previous scores can be plotted as a sequence logo, along conservation for a more visual and interpretable output.
```console
python PLMView/src/PLMV_Logo_scaled.py --viz-dir out_explain_viz --sampled-MSA alignment.fasta --tree out_tree/tree.nhx --out-dir out_logo
```
10. Step 7. 8. and 9. are useful if, given a family, you are interested into the inner functional differences. However if you want to understand what makes a subfamily functionally different from the others, you can use `python <script-basename>_1vsall.py ` with `<refnode>` being your subfamily of interest. and `<script-basename>` the corresponding script from step 7. 8. or 9.
## Remarks
To use `PLMV_explain.py` and `PLMV_infer.py`, if your tree is too large try setting `sys.setrecursionlimit()` to 10000.
......
Markdown is supported
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