# PSSMGen

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3635712.svg)](https://doi.org/10.5281/zenodo.3635712)

Generates consistent PSSM and/or PDB files for protein-protein complexes

## Install

1. Make sure BLAST is installed and its database is available on your machine. Otherwise, install BLAST and download its databases by following the [BLAST guide](https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=BlastDocs&DOC_TYPE=Download).
2. Install the PSSMgen by `pip install PSSMGen`.

## Quick Example
`PSSMGen` is geared toward computing the pssm files for all models of a particular protein-protein complex. This tool assumes your files have following structure:

```
 caseID
 |_ pdb
 |_ fasta
 |_ pssm_raw
 |_ pssm
 |_ pdb_raw
```

`caseID` is the ID of protein-protein complex, e.g. PDB ID [1AK4](https://www.rcsb.org/structure/1ak4) or CAPRI target ID [T161](https://www.ebi.ac.uk/pdbe/complex-pred/capri/round/48/). Only the `pdb` dir must exist at run time, and it must contain the PDB files of the models generated by [HADDOCK](http://www.bonvinlab.org/software/haddock2.2/). Based on these PDB files, the code will extract protein sequences and generate the [FASTA](https://en.wikipedia.org/wiki/FASTA_format) files (stored in the `fasta` subdir). It will then use the BLAST tool `psiblast` to compute PSSM (stored in `pssm_raw` subdir). Finally the sequences from PSSM files and PDB files will be aligned and then the consistent PSSM files and/or PDB files will generated. The consistent PSSM files are stored in `pssm` subdir. If applicable, the consistent PDB files are stored in `pdb` subdir, while the original non-consistent PDB files are moved to `pdb_raw` subdir. You can then use PDB files from `pdb` and PSSM files from `pssm` for further analysis.

Here is an example for complex `1AK4`:

```python
from pssmgen import PSSM

gen = PSSM('1AK4')

# set psiblast executable, database and other psiblast parameters
gen.configure(blast='/home/software/blast/bin/psiblast',
            database='/data/DBs/blast_dbs/nr_v20180204/nr')

# generates FASTA files
# ignore this step when using customed FASTA files
gen.get_fasta()

# generates PSSM
gen.get_pssm()

# map PSSM and PDB to get consisitent files
gen.map_pssm()
```

**If you want to use customed FASTA files, you can ignore the above step `gen.get_fasta()` and mannualy create the `fasta` folder and put customed FASTA files there.**

Run the tool on computer cluster since the calculation of the PSSM files might take miniutes to hours.