protein-cluster-conformers


Nameprotein-cluster-conformers JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/PDBeurope/protein-cluster-conformers
SummaryClusters conformations of monomeric protein
upload_time2023-07-11 20:19:03
maintainer
docs_urlNone
authorJoseph I. J. Ellaway
requires_python>=3.10
license
keywords cluster monomeric superpose linear algebra distance
VCS
bugtrack_url
requirements argparse gemmi matplotlib numpy pandas pillow requests seaborn scipy scikit-learn
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Monomeric protein conformational state clustering

These scripts can be used to cluster a parsed set of monomeric protein chains via a global conformational change metric based on CA distances. Once the peptide chains destined for clustering have been specified, a pairwise CA distance matrix for each chain is produced. Distance difference matrices are then generated, again, pairwise but between CA distance matrices here. Therefore, for `N` unique peptide chains, `N` CA distance matrices and `N^2` distance difference matrices are generated.

Additional scripts are provided to cluster the chains based on distance-based scores calculated from all pairwise distance difference matricies, as well as scripts to produce dendrograms of the clustering results, swarm plots of the scores, and heatmaps for each distance difference matrix.

Example input data is provided in the `benchmark_data/examples` folder, including scripts to download and save data from the [PDBe-KB's benchmark conformational state dataset](http://ftp.ebi.ac.uk/pub/databases/pdbe-kb/benchmarking/distinct-monomer-conformers/). Example scripts are included in `examples`, which run complete executions of the entire pipeline for a selection of structures from several difference UniProt accessions.

For intructions on importing `protein-cluster-conformers` into your own Python code, refer to `/tutorials/instructions.ipynb`.

**Dependencies**:

`protein-cluster-conformers` requires >=Python3.10 to run. Initialise virtual environment and install dependencies with:

```shell
$ cd contact_map_difference
$ python3.10 -m venv cluster_venv
$ source cluster_venv/bin/activate
$ python -m pip install -r requirements.txt
```

_____

## CLI: Clustering structures

To cluster a set of protein structures, run the `find_clusters.py` script:

```shell
$ python find_conformers.py [-h] [-v] -u UNIPROT -m MMCIF [MMCIF ...]
							[-s PATH_CLUSTERS] -c PATH_CA [-d PATH_DD]
                          	[-g PATH_DENDROGRAM [PATH_DENDROGRAM ...]]
                          	[-w PATH_SWARM [PATH_SWARM ...]] [-o PATH_HISTOGRAM]
                          	[-a PATH_ALPHA_FOLD]
```

The following parameters can be parsed:

```shell
required arguments:
  -u UNIPROT, --uniprot UNIPROT
                        UniProt accession
  -m MMCIF [MMCIF ...], --mmcif MMCIF [MMCIF ...]
                        Enter list of paths to mmCIFs that overlap a given UniProt segment
optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Increase verbosity
  -s PATH_CLUSTERS, --path_clusters PATH_CLUSTERS
                        Path to save clustering results
  -c PATH_CA, --path_ca PATH_CA
                        Path to save CA distance matrices
  -d PATH_DD, --path_dd PATH_DD
                        Path to save distance difference matrices
  -g PATH_DENDROGRAM [PATH_DENDROGRAM ...], --path_dendrogram PATH_DENDROGRAM [PATH_DENDROGRAM ...]
                        Path to save dendrogram of clustering results
  -w PATH_SWARM [PATH_SWARM ...], --path_swarm PATH_SWARM [PATH_SWARM ...]
                        Path to save swarm plot of scores
  -o PATH_HISTOGRAM, --path_histogram PATH_HISTOGRAM
                        Path to save histograms of distance difference maps
  -a PATH_ALPHA_FOLD, --path_alpha_fold PATH_ALPHA_FOLD
                        Path to save AlphaFold Database structure

```

---

### **Run instructions**

#### Option 1) Cluster only

To only cluster a set of monomeric protein structures that share part or all of the same UniProt sequence, run:

``` shell
$ python find_clusters.py -u "A12345" \
    -m /path/to/structure_1.cif [chains] \
    -m /path/to/structure_2.cif [chains] \
    ... \
    -m /path/to/structure_N.cif [chains] \
    -s /path/to/save/clustering/results/
```

The paths to each structure are parsed using the `-m` flag.

Chain IDs (only `struct_asym_id` is currently recognised) should be given as space-delimited arguments after the path. Parse in multiple structures using consecutive  `-m` flags. The UniProt accession must be parsed using the `-u` flag.

**Example**: O34926

```shell
$ python find_conformers.py -u "O34926" \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \
    -s benchmark_data/examples/O34926/O34926_cluster_results/
```

By default, the pipeline only clusters the parsed mmCIFs (and specified chains), saving clustering results to a CSV file in `-s` specified directory.

----

#### Option 2) Save matrices only

To save the matrices produced in the pipeline, simply specify the path in which to save them using the `-c` flag for CA distance matrices and the `-d` flag for CA distance difference matrices:

```shell
$ python find_clusters.py -u "A12345" \
    -m /path/to/structure_1.cif [chains] \
    -m ... \
    -s /path/to/save/cluster_results.csv \
    -c /path/to/save/CA/distance/matices \
    -d /path/to/save/distance/difference/matrices/
```

These flags are mutually exclusive, meaning either or both can be used at the same time.

**Example**: O34926

```shell
$ python find_clusters.py -u "O34926" \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \
    -c benchmark_data/examples/O34926_CA_distances \
    -d benchmark_data/examples/O34926_distance_differences/
```

---

#### Option 3) Render distance difference maps only

2D histograms (heatmaps) can be rendered and saved for each CA distance difference matrix by specifying the save directory using the `-o` flag:

```shell
$ python find_clusters.py -u "A12345" \
    -m /path/to/structure_1.cif [chains] \
    -m ... \
    -o /path/to/save/distance/difference/2D/histograms/
```

To save the histogram in the default directory (`test/ouputs/dd_histograms`), simply parse the `-o` flag without a path.

The resulting plots are saved in PNG format (to save render time). E.g:

<img src="./benchmark_data/figures/A6UVT1_6hac_A_to_6hae_K.png" alt="Distance difference map of 6hac chain A to 6hae chain K" height="350"/>

<br>

**Example**: O34926

```shell
$ python run_find_clusters.py -u "O34926" \
	-m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \
    -o ./benchmark_data/examples/O34926/O34926_distance_difference_maps/
```

---

#### Option 4) Render dendrogram only

From the clustering results, a dendrogram can be rendered to show the relationships between all clustered chains. To save a dendrogram of the hierarchical clustering results, run:

```shell
$ python run_find_clusters.py -u "A12345" \
    -m /path/to/structure_1.cif [chains] \
    -m ... \
    -g /path/to/save/dendrogram/ [png svg]
```

where either a `png` or `svg` file type is saved. E.g.

<img src="./benchmark_data/figures/P14902_agglomerative_dendrogram.png" alt="Dendrogram of clustered UniProt:P14902 chains, via UPGMA agglomerative clustering" height="350"/>

<br>

**Example**: O34926

```shell
$ python run_find_clusters.py -u "O34926" \
	-m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \
    -g benchmark_data/examples/O34926/O34926_cluster_results/ png svg
```

---

#### Option 5) Render swarm plot

The scores generated between pairwise structure comparisons can be plotted as a swarm plot by parsing the `-w` flag:

```shell
$ python run_find_clusters.py -u "A12345" \
    -m /path/to/structure_1.cif [chains] \
    -m ... \
    -w /path/to/save/swarm_plot/ [png svg]
```

Like rendering the dendrogram, the swarm plot can either be saved as `png`,  `svg` or both. E.g.

<img src="./benchmark_data/figures/P15291_swarm_plot.png" alt="Swarm plot of distance-based scores for chains in the UniProt:P15291 clusters" height="350"/>

<br>

**Example**: O34926

```shell
$ python find_clusters.py -u "O34926" \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \
    -w benchmark_data/examples/O34926/O34926_cluster_results/ png svg
```

------

#### Option 6) Include AlphaFold Database structure(s)

By parsing in the `-a` flag,  the script will attempt to download and cluster the pre-generated AlphaFold structure, stored on the [AlphaFold Database](https://alphafold.ebi.ac.uk/). You do not need to have downloaded the predicted AlphaFold structure already but must be connected to the internet. The structure will be saved

```shell
$ python find_clusters.py -u "A12345" \
		-m /path/to/structure_1.cif [chains] \
    -m ... \
    -a
```

**Example**: O34926

```shell
$ python find_clusters.py -u "O34926" \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \
    -a
```

------

#### **Option 7) Run all**

**Example #1:** O34926

```shell
$ python find_conformers.py -u "O34926" \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \
    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \
    -c benchmark_data/examples/O34926/O34926_ca_distances/ \
    -d benchmark_data/examples/O34926/O34926_distance_differences/ \
    -s benchmark_data/examples/O34926/O34926_cluster_results/ \
    -o benchmark_data/examples/O34926/O34926_distance_difference_maps/ \
    -g benchmark_data/examples/O34926/O34926_cluster_results/ png svg
    -a
```

or use the `run_O34926.sh` script.

``` shell
$ ./run_O34926.sh
```

**Example #2:** P15291

``` shell
python3 run_find_conformers.py -u "P15291" \
    -m benchmark_data/examples/P15291/P15291_updated_mmcif/2fy7_updated.cif A \
    -m benchmark_data/examples/P15291/P15291_updated_mmcif/2fya_updated.cif A \
    -m benchmark_data/examples/P15291/P15291_updated_mmcif/2fyb_updated.cif A \
    -m benchmark_data/examples/P15291/P15291_updated_mmcif/6fwu_updated.cif A B \
    -m benchmark_data/examples/P15291/P15291_updated_mmcif/2fyc_updated.cif A B \
    -m benchmark_data/examples/P15291/P15291_updated_mmcif/2fyd_updated.cif A B \
    -c benchmark_data/examples/P15291/P15291_ca_distances/ \
    -d benchmark_data/examples/P15291/P15291_distance_differences/ \
    -s benchmark_data/examples/P15291/P15291_cluster_results/ \
    -o benchmark_data/examples/P15291/P15291_distance_difference_maps/ \
    -g benchmark_data/examples/P15291/P15291_cluster_results/ png svg
    -w benchmark_data/examples/P15291/P15291_cluster_results/ png svg
    -a
```

or execute the `run_P15291.sh` script.

```shell
$ ./run_P15291.sh
```

When imported into Orc, the arguments required to execute the clustering process correctly will be parsed into the class instance and related methods as lists generated from the preceding functions called by the existing `protein-superpose` pipeline.

---

### Run on benchmark dataset

The scripts above are called by the `run_benchmark.py` wrapper. To generate conformational clustering results for the included benchmark dataset, run:

``` shell
$ python cluster_benchmark.py
```

This will call the `run_benchmark(...)` functions included in `ca_distance.py`, `distance_difference.py`, `cluster.py`, `plot_distance_difference.py`, `plot_dendrogram.py` and `plot_swarm_plot.py`. No arguments need parsing into the script.

Results will be saved in the `./benchmark_data/` folder.

------

## Contributing

Install developer dependencies:

```shell
pip install -r dev-requirements.txt
```

To run unit tests on the package, the Pytest framework is recommented and can be performed with:

```shell
pytest --cov=cluster_conformers --cov-report=html -v
```

The following dependencies will be required:

- `pytest-cov`
- `pytest-forked`
- `purest-xdist` (optional)

They are installed along with the main package dependencies in `requirements.txt`.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/PDBeurope/protein-cluster-conformers",
    "name": "protein-cluster-conformers",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "cluster,monomeric,superpose,linear algebra,distance",
    "author": "Joseph I. J. Ellaway",
    "author_email": "jellaway@ebi.ac.uk",
    "download_url": "https://files.pythonhosted.org/packages/f4/a1/07b6e9ade5cbba2a73e93fa4a1c760192819348440b1a3e11f9b5f297633/protein-cluster-conformers-1.1.0.tar.gz",
    "platform": null,
    "description": "# Monomeric protein conformational state clustering\n\nThese scripts can be used to cluster a parsed set of monomeric protein chains via a global conformational change metric based on CA distances. Once the peptide chains destined for clustering have been specified, a pairwise CA distance matrix for each chain is produced. Distance difference matrices are then generated, again, pairwise but between CA distance matrices here. Therefore, for `N` unique peptide chains, `N` CA distance matrices and `N^2` distance difference matrices are generated.\n\nAdditional scripts are provided to cluster the chains based on distance-based scores calculated from all pairwise distance difference matricies, as well as scripts to produce dendrograms of the clustering results, swarm plots of the scores, and heatmaps for each distance difference matrix.\n\nExample input data is provided in the `benchmark_data/examples` folder, including scripts to download and save data from the [PDBe-KB's benchmark conformational state dataset](http://ftp.ebi.ac.uk/pub/databases/pdbe-kb/benchmarking/distinct-monomer-conformers/). Example scripts are included in `examples`, which run complete executions of the entire pipeline for a selection of structures from several difference UniProt accessions.\n\nFor intructions on importing `protein-cluster-conformers` into your own Python code, refer to `/tutorials/instructions.ipynb`.\n\n**Dependencies**:\n\n`protein-cluster-conformers` requires >=Python3.10 to run. Initialise virtual environment and install dependencies with:\n\n```shell\n$ cd contact_map_difference\n$ python3.10 -m venv cluster_venv\n$ source cluster_venv/bin/activate\n$ python -m pip install -r requirements.txt\n```\n\n_____\n\n## CLI: Clustering structures\n\nTo cluster a set of protein structures, run the `find_clusters.py` script:\n\n```shell\n$ python find_conformers.py [-h] [-v] -u UNIPROT -m MMCIF [MMCIF ...]\n\t\t\t\t\t\t\t[-s PATH_CLUSTERS] -c PATH_CA [-d PATH_DD]\n                          \t[-g PATH_DENDROGRAM [PATH_DENDROGRAM ...]]\n                          \t[-w PATH_SWARM [PATH_SWARM ...]] [-o PATH_HISTOGRAM]\n                          \t[-a PATH_ALPHA_FOLD]\n```\n\nThe following parameters can be parsed:\n\n```shell\nrequired arguments:\n  -u UNIPROT, --uniprot UNIPROT\n                        UniProt accession\n  -m MMCIF [MMCIF ...], --mmcif MMCIF [MMCIF ...]\n                        Enter list of paths to mmCIFs that overlap a given UniProt segment\noptional arguments:\n  -h, --help            show this help message and exit\n  -v, --verbose         Increase verbosity\n  -s PATH_CLUSTERS, --path_clusters PATH_CLUSTERS\n                        Path to save clustering results\n  -c PATH_CA, --path_ca PATH_CA\n                        Path to save CA distance matrices\n  -d PATH_DD, --path_dd PATH_DD\n                        Path to save distance difference matrices\n  -g PATH_DENDROGRAM [PATH_DENDROGRAM ...], --path_dendrogram PATH_DENDROGRAM [PATH_DENDROGRAM ...]\n                        Path to save dendrogram of clustering results\n  -w PATH_SWARM [PATH_SWARM ...], --path_swarm PATH_SWARM [PATH_SWARM ...]\n                        Path to save swarm plot of scores\n  -o PATH_HISTOGRAM, --path_histogram PATH_HISTOGRAM\n                        Path to save histograms of distance difference maps\n  -a PATH_ALPHA_FOLD, --path_alpha_fold PATH_ALPHA_FOLD\n                        Path to save AlphaFold Database structure\n\n```\n\n---\n\n### **Run instructions**\n\n#### Option 1) Cluster only\n\nTo only cluster a set of monomeric protein structures that share part or all of the same UniProt sequence, run:\n\n``` shell\n$ python find_clusters.py -u \"A12345\" \\\n    -m /path/to/structure_1.cif [chains] \\\n    -m /path/to/structure_2.cif [chains] \\\n    ... \\\n    -m /path/to/structure_N.cif [chains] \\\n    -s /path/to/save/clustering/results/\n```\n\nThe paths to each structure are parsed using the `-m` flag.\n\nChain IDs (only `struct_asym_id` is currently recognised) should be given as space-delimited arguments after the path. Parse in multiple structures using consecutive  `-m` flags. The UniProt accession must be parsed using the `-u` flag.\n\n**Example**: O34926\n\n```shell\n$ python find_conformers.py -u \"O34926\" \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \\\n    -s benchmark_data/examples/O34926/O34926_cluster_results/\n```\n\nBy default, the pipeline only clusters the parsed mmCIFs (and specified chains), saving clustering results to a CSV file in `-s` specified directory.\n\n----\n\n#### Option 2) Save matrices only\n\nTo save the matrices produced in the pipeline, simply specify the path in which to save them using the `-c` flag for CA distance matrices and the `-d` flag for CA distance difference matrices:\n\n```shell\n$ python find_clusters.py -u \"A12345\" \\\n    -m /path/to/structure_1.cif [chains] \\\n    -m ... \\\n    -s /path/to/save/cluster_results.csv \\\n    -c /path/to/save/CA/distance/matices \\\n    -d /path/to/save/distance/difference/matrices/\n```\n\nThese flags are mutually exclusive, meaning either or both can be used at the same time.\n\n**Example**: O34926\n\n```shell\n$ python find_clusters.py -u \"O34926\" \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \\\n    -c benchmark_data/examples/O34926_CA_distances \\\n    -d benchmark_data/examples/O34926_distance_differences/\n```\n\n---\n\n#### Option 3) Render distance difference maps only\n\n2D histograms (heatmaps) can be rendered and saved for each CA distance difference matrix by specifying the save directory using the `-o` flag:\n\n```shell\n$ python find_clusters.py -u \"A12345\" \\\n    -m /path/to/structure_1.cif [chains] \\\n    -m ... \\\n    -o /path/to/save/distance/difference/2D/histograms/\n```\n\nTo save the histogram in the default directory (`test/ouputs/dd_histograms`), simply parse the `-o` flag without a path.\n\nThe resulting plots are saved in PNG format (to save render time). E.g:\n\n<img src=\"./benchmark_data/figures/A6UVT1_6hac_A_to_6hae_K.png\" alt=\"Distance difference map of 6hac chain A to 6hae chain K\" height=\"350\"/>\n\n<br>\n\n**Example**: O34926\n\n```shell\n$ python run_find_clusters.py -u \"O34926\" \\\n\t-m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \\\n    -o ./benchmark_data/examples/O34926/O34926_distance_difference_maps/\n```\n\n---\n\n#### Option 4) Render dendrogram only\n\nFrom the clustering results, a dendrogram can be rendered to show the relationships between all clustered chains. To save a dendrogram of the hierarchical clustering results, run:\n\n```shell\n$ python run_find_clusters.py -u \"A12345\" \\\n    -m /path/to/structure_1.cif [chains] \\\n    -m ... \\\n    -g /path/to/save/dendrogram/ [png svg]\n```\n\nwhere either a `png` or `svg` file type is saved. E.g.\n\n<img src=\"./benchmark_data/figures/P14902_agglomerative_dendrogram.png\" alt=\"Dendrogram of clustered UniProt:P14902 chains, via UPGMA agglomerative clustering\" height=\"350\"/>\n\n<br>\n\n**Example**: O34926\n\n```shell\n$ python run_find_clusters.py -u \"O34926\" \\\n\t-m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \\\n    -g benchmark_data/examples/O34926/O34926_cluster_results/ png svg\n```\n\n---\n\n#### Option 5) Render swarm plot\n\nThe scores generated between pairwise structure comparisons can be plotted as a swarm plot by parsing the `-w` flag:\n\n```shell\n$ python run_find_clusters.py -u \"A12345\" \\\n    -m /path/to/structure_1.cif [chains] \\\n    -m ... \\\n    -w /path/to/save/swarm_plot/ [png svg]\n```\n\nLike rendering the dendrogram, the swarm plot can either be saved as `png`,  `svg` or both. E.g.\n\n<img src=\"./benchmark_data/figures/P15291_swarm_plot.png\" alt=\"Swarm plot of distance-based scores for chains in the UniProt:P15291 clusters\" height=\"350\"/>\n\n<br>\n\n**Example**: O34926\n\n```shell\n$ python find_clusters.py -u \"O34926\" \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \\\n    -w benchmark_data/examples/O34926/O34926_cluster_results/ png svg\n```\n\n------\n\n#### Option 6) Include AlphaFold Database structure(s)\n\nBy parsing in the `-a` flag,  the script will attempt to download and cluster the pre-generated AlphaFold structure, stored on the [AlphaFold Database](https://alphafold.ebi.ac.uk/). You do not need to have downloaded the predicted AlphaFold structure already but must be connected to the internet. The structure will be saved\n\n```shell\n$ python find_clusters.py -u \"A12345\" \\\n\t\t-m /path/to/structure_1.cif [chains] \\\n    -m ... \\\n    -a\n```\n\n**Example**: O34926\n\n```shell\n$ python find_clusters.py -u \"O34926\" \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \\\n    -a\n```\n\n------\n\n#### **Option 7) Run all**\n\n**Example #1:** O34926\n\n```shell\n$ python find_conformers.py -u \"O34926\" \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc3_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc5_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc6_updated.cif A B \\\n    -m benchmark_data/examples/O34926/O34926_updated_mmcif/3nc7_updated.cif A B \\\n    -c benchmark_data/examples/O34926/O34926_ca_distances/ \\\n    -d benchmark_data/examples/O34926/O34926_distance_differences/ \\\n    -s benchmark_data/examples/O34926/O34926_cluster_results/ \\\n    -o benchmark_data/examples/O34926/O34926_distance_difference_maps/ \\\n    -g benchmark_data/examples/O34926/O34926_cluster_results/ png svg\n    -a\n```\n\nor use the `run_O34926.sh` script.\n\n``` shell\n$ ./run_O34926.sh\n```\n\n**Example #2:** P15291\n\n``` shell\npython3 run_find_conformers.py -u \"P15291\" \\\n    -m benchmark_data/examples/P15291/P15291_updated_mmcif/2fy7_updated.cif A \\\n    -m benchmark_data/examples/P15291/P15291_updated_mmcif/2fya_updated.cif A \\\n    -m benchmark_data/examples/P15291/P15291_updated_mmcif/2fyb_updated.cif A \\\n    -m benchmark_data/examples/P15291/P15291_updated_mmcif/6fwu_updated.cif A B \\\n    -m benchmark_data/examples/P15291/P15291_updated_mmcif/2fyc_updated.cif A B \\\n    -m benchmark_data/examples/P15291/P15291_updated_mmcif/2fyd_updated.cif A B \\\n    -c benchmark_data/examples/P15291/P15291_ca_distances/ \\\n    -d benchmark_data/examples/P15291/P15291_distance_differences/ \\\n    -s benchmark_data/examples/P15291/P15291_cluster_results/ \\\n    -o benchmark_data/examples/P15291/P15291_distance_difference_maps/ \\\n    -g benchmark_data/examples/P15291/P15291_cluster_results/ png svg\n    -w benchmark_data/examples/P15291/P15291_cluster_results/ png svg\n    -a\n```\n\nor execute the `run_P15291.sh` script.\n\n```shell\n$ ./run_P15291.sh\n```\n\nWhen imported into Orc, the arguments required to execute the clustering process correctly will be parsed into the class instance and related methods as lists generated from the preceding functions called by the existing `protein-superpose` pipeline.\n\n---\n\n### Run on benchmark dataset\n\nThe scripts above are called by the `run_benchmark.py` wrapper. To generate conformational clustering results for the included benchmark dataset, run:\n\n``` shell\n$ python cluster_benchmark.py\n```\n\nThis will call the `run_benchmark(...)` functions included in `ca_distance.py`, `distance_difference.py`, `cluster.py`, `plot_distance_difference.py`, `plot_dendrogram.py` and `plot_swarm_plot.py`. No arguments need parsing into the script.\n\nResults will be saved in the `./benchmark_data/` folder.\n\n------\n\n## Contributing\n\nInstall developer dependencies:\n\n```shell\npip install -r dev-requirements.txt\n```\n\nTo run unit tests on the package, the Pytest framework is recommented and can be performed with:\n\n```shell\npytest --cov=cluster_conformers --cov-report=html -v\n```\n\nThe following dependencies will be required:\n\n- `pytest-cov`\n- `pytest-forked`\n- `purest-xdist` (optional)\n\nThey are installed along with the main package dependencies in `requirements.txt`.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Clusters conformations of monomeric protein",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/PDBeurope/protein-cluster-conformers"
    },
    "split_keywords": [
        "cluster",
        "monomeric",
        "superpose",
        "linear algebra",
        "distance"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e677a047e4d2752b6b3433323a678ce15e7ee1057125ece2555a2758c56b0176",
                "md5": "cf7afaf025c61e4f2ef073e6cd2ad424",
                "sha256": "b487cfae4cee40643d795f4394f83d1abb61fd755567a22d511eb485b45e4f4c"
            },
            "downloads": -1,
            "filename": "protein_cluster_conformers-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf7afaf025c61e4f2ef073e6cd2ad424",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 54213,
            "upload_time": "2023-07-11T20:19:00",
            "upload_time_iso_8601": "2023-07-11T20:19:00.795460Z",
            "url": "https://files.pythonhosted.org/packages/e6/77/a047e4d2752b6b3433323a678ce15e7ee1057125ece2555a2758c56b0176/protein_cluster_conformers-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4a107b6e9ade5cbba2a73e93fa4a1c760192819348440b1a3e11f9b5f297633",
                "md5": "ee81b8e6bb78c492022436ec4247a7f8",
                "sha256": "2be9b36eddea9c02643435037e376ebe0f02bfe1e301ae472bd9d8b7ff24aa50"
            },
            "downloads": -1,
            "filename": "protein-cluster-conformers-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ee81b8e6bb78c492022436ec4247a7f8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 46138,
            "upload_time": "2023-07-11T20:19:03",
            "upload_time_iso_8601": "2023-07-11T20:19:03.202673Z",
            "url": "https://files.pythonhosted.org/packages/f4/a1/07b6e9ade5cbba2a73e93fa4a1c760192819348440b1a3e11f9b5f297633/protein-cluster-conformers-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-11 20:19:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PDBeurope",
    "github_project": "protein-cluster-conformers",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "argparse",
            "specs": [
                [
                    "==",
                    "1.4.0"
                ]
            ]
        },
        {
            "name": "gemmi",
            "specs": [
                [
                    "==",
                    "0.5.6"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": [
                [
                    "==",
                    "3.7.1"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.21.6"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "1.3.5"
                ]
            ]
        },
        {
            "name": "pillow",
            "specs": [
                [
                    "==",
                    "9.2.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.28.1"
                ]
            ]
        },
        {
            "name": "seaborn",
            "specs": [
                [
                    "==",
                    "0.12.0"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    "==",
                    "1.7.3"
                ]
            ]
        },
        {
            "name": "scikit-learn",
            "specs": [
                [
                    "==",
                    "1.2.2"
                ]
            ]
        }
    ],
    "lcname": "protein-cluster-conformers"
}
        
Elapsed time: 0.09543s