metapredict 3.0.1__tar.gz → 3.0.2__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.
- {metapredict-3.0.1 → metapredict-3.0.2}/.gitignore +1 -1
- {metapredict-3.0.1 → metapredict-3.0.2}/PKG-INFO +2 -2
- {metapredict-3.0.1 → metapredict-3.0.2}/README.md +1 -1
- {metapredict-3.0.1 → metapredict-3.0.2}/changelog.md +6 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/usage/command-line.rst +8 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/.DS_Store +0 -0
- metapredict-3.0.2/metapredict/_version.py +1 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/analysis/caid2_analysis.py +53 -13
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/.DS_Store +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/cython/domain_definition.c +13885 -13874
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/meta_tools.py +85 -26
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/predictor.py +7 -1
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/meta.py +22 -4
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/parameters.py +3 -0
- metapredict-3.0.2/metapredict/scripts/metapredict_caid.py +57 -0
- metapredict-3.0.2/metapredict/tests/.pytest_cache/v/cache/lastfailed +87 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/__init__.py +2 -1
- metapredict-3.0.2/metapredict/tests/input_data/caid_default/Q8N6T3.caid +407 -0
- metapredict-3.0.2/metapredict/tests/input_data/caid_default/p53.caid +394 -0
- metapredict-3.0.2/metapredict/tests/input_data/caid_default/sp|P0DMV8|HS71A_HUMAN Heat shock 70 kDa protein 1A OS=Homo sapiens OX=9606 GN=HSPA1A PE=1 SV=1.caid +642 -0
- metapredict-3.0.2/metapredict/tests/input_data/caid_fixed_0p2/Q8N6T3.caid +407 -0
- metapredict-3.0.2/metapredict/tests/input_data/caid_fixed_0p2/p53.caid +394 -0
- metapredict-3.0.2/metapredict/tests/input_data/caid_fixed_0p2/sp|P0DMV8|HS71A_HUMAN Heat shock 70 kDa protein 1A OS=Homo sapiens OX=9606 GN=HSPA1A PE=1 SV=1.caid +642 -0
- metapredict-3.0.2/metapredict/tests/input_data/caid_fixed_0p5/Q8N6T3.caid +407 -0
- metapredict-3.0.2/metapredict/tests/input_data/caid_fixed_0p5/p53.caid +394 -0
- metapredict-3.0.2/metapredict/tests/input_data/caid_fixed_0p5/sp|P0DMV8|HS71A_HUMAN Heat shock 70 kDa protein 1A OS=Homo sapiens OX=9606 GN=HSPA1A PE=1 SV=1.caid +642 -0
- metapredict-3.0.2/metapredict/tests/test_caid_output.py +113 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/test_metapredict_CPU_GPU.py +31 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict.egg-info/PKG-INFO +2 -2
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict.egg-info/SOURCES.txt +10 -23
- metapredict-3.0.1/docs/.DS_Store +0 -0
- metapredict-3.0.1/metapredict/_version.py +0 -1
- metapredict-3.0.1/metapredict/scripts/metapredict_caid.py +0 -26
- metapredict-3.0.1/metapredict/tests/.pytest_cache/v/cache/lastfailed +0 -30
- metapredict-3.0.1/metapredict/tests/output/1_Q8N6T3.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/2_p53.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/3_sp_P0DMV8_HS71.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/Q8N6T3.pdf +0 -0
- metapredict-3.0.1/metapredict/tests/output/Q8N6T3.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/Q8N6T3.ps +0 -1219
- metapredict-3.0.1/metapredict/tests/output/demo1.pdf +0 -0
- metapredict-3.0.1/metapredict/tests/output/demo1.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/demo1.ps +0 -1243
- metapredict-3.0.1/metapredict/tests/output/demo1_custom_title.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/demo1_disorder_thresh0p5.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/demo1_dpi_500.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/demo1_shaded_1_20.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/demo1_shaded_1_20_80_200.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/demo1_shaded_1_20_80_200_yellow.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/p53.pdf +0 -0
- metapredict-3.0.1/metapredict/tests/output/p53.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/p53.ps +0 -1139
- metapredict-3.0.1/metapredict/tests/output/sp_P0DMV8_HS71.pdf +0 -0
- metapredict-3.0.1/metapredict/tests/output/sp_P0DMV8_HS71.png +0 -0
- metapredict-3.0.1/metapredict/tests/output/sp_P0DMV8_HS71.ps +0 -1358
- metapredict-3.0.1/metapredict/tests/output/test.csv +0 -3
- {metapredict-3.0.1 → metapredict-3.0.2}/.codecov.yml +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/.lgtm.yml +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/.travis.yml +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/CODE_OF_CONDUCT.md +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/CONTRIBUTING.md +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/LICENSE +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/MANIFEST.in +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/colab/metapredict_colab.ipynb +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/devtools/README.md +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/devtools/conda-envs/test_env.yaml +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/devtools/scripts/create_conda_env.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/devtools/travis-ci/before_install.sh +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/Makefile +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/README.md +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/_static/README.md +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/_templates/README.md +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/changes.rst +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/conf.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/getting_started.rst +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/how_to_cite.rst +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/images/confidence_scores_disorder.png +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/images/meta_predict_disorder.png +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/images/python_meta_predict_MadeUpProtein.png +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/index.rst +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/make.bat +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/requirements.txt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/usage/acknowledgements.rst +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/usage/api.rst +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/usage/troubleshooting.rst +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/docs/usage/using-in-python.rst +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/__init__.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/analysis/caid1_and_2_disorder_pdb.fasta +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/analysis/caid1_disorder_pdb.fasta +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/analysis/caid2_disorder_pdb.fasta +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/analysis/seq_caid_plddt.tsv +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/analysis/test_different_predictors.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/architectures.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/creating_V2_and_V3_scores.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/cython/domain_definition.pyx +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/data_structures.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/domain_definition.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/encode_sequence.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/meta_graph.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/network_parameters.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/.DS_Store +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/epoch-49-step-42600.ckpt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/epoch023_val_loss1529.48.ckpt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/epoch029_val_loss791.84.ckpt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/epoch029_val_loss959.58.ckpt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/epoch096_val_loss1584.14.ckpt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/epoch099_val_loss1107.08.ckpt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/epoch179_val_loss1095.24.ckpt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/metaDisorder.pt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/meta_predict_disorder_100e_v1.pt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/metameta_2_7_22_nl2_hs20_b32_V3.pt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/metapredict_network_v2_200epochs_nl1_hs20.pt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/metapredict_network_v3_200epochs_nl2_hs20.pt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/non_bin_PAE_hs40_nl2.pt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/networks/smoothed_v3_real_plddt_re.pt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/ppLDDT/.DS_Store +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/ppLDDT/networks/alpha_fold_networkV7_hs100_nL2_200e_all_prot.pt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/backend/ppLDDT/networks/epoch019_val_loss1477.45.ckpt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/data/.DS_Store +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/data/README.md +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/data/test_data.fasta +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/metapredict_exceptions.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/scripts/__init__.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/scripts/metapredict_graph_disorder.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/scripts/metapredict_graph_pLDDT.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/scripts/metapredict_name.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/scripts/metapredict_predict_disorder.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/scripts/metapredict_predict_idrs.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/scripts/metapredict_predict_pLDDT.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/scripts/metapredict_quick_graph.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/scripts/metapredict_quick_predict.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/scripts/metapredict_uniprot.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/.DS_Store +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/.pytest_cache/.gitignore +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/.pytest_cache/CACHEDIR.TAG +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/.pytest_cache/README.md +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/.pytest_cache/v/cache/nodeids +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/.pytest_cache/v/cache/stepwise +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/cli_tests/__init__.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/cli_tests/input/three_seqs.fasta +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/cli_tests/test_metapredict-predict-disorder.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/cli_tests/test_metapredict-predict-idrs.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/input_data/DisorderPredictionssp_P04637_P53_HUMANC.txt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/input_data/build_data.ipynb +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/input_data/test_scores_100.npy +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/input_data/test_scores_100_v3.npy +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/input_data/test_seqs_100.fasta +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/input_data/testing.fasta +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/input_data/three_seqs.fasta +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/local_data.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/pytest.ini +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/test_batch_vs_single.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/test_cython_v_python.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/test_domain_functions.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/test_graph_disorder.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/test_graph_fasta.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/test_metapredict.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/test_metapredict_init.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/test_uniprot_functionality.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict/tests/test_write_fasta.py +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict.egg-info/dependency_links.txt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict.egg-info/entry_points.txt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict.egg-info/not-zip-safe +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict.egg-info/requires.txt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/metapredict.egg-info/top_level.txt +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/pyproject.toml +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/readthedocs.yml +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/setup.cfg +0 -0
- {metapredict-3.0.1 → metapredict-3.0.2}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: metapredict
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.2
|
|
4
4
|
Summary: A machine learning-based tool for predicting protein disorder.
|
|
5
5
|
Author-email: Ryan Emenecker <remenecker@wustl.edu>
|
|
6
6
|
License: MIT
|
|
@@ -22,7 +22,7 @@ Requires-Dist: pytest>=6.1.2; extra == "test"
|
|
|
22
22
|
|
|
23
23
|
# metapredict: A machine learning-based tool for predicting protein disorder.
|
|
24
24
|
|
|
25
|
-
### Last updated
|
|
25
|
+
### Last updated May 2026
|
|
26
26
|
|
|
27
27
|
## Current default version: V3
|
|
28
28
|
In November 2024, we changed the default version of metapredict from V2 to V3. Small increments (3.0.x) may be made as bug fixes or feature enhancements.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# metapredict: A machine learning-based tool for predicting protein disorder.
|
|
2
2
|
|
|
3
|
-
### Last updated
|
|
3
|
+
### Last updated May 2026
|
|
4
4
|
|
|
5
5
|
## Current default version: V3
|
|
6
6
|
In November 2024, we changed the default version of metapredict from V2 to V3. Small increments (3.0.x) may be made as bug fixes or feature enhancements.
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
This section is a log of recent changes with metapredict. My hope is that as I change things, this section can help you figure out why a change was made and if it will break any of your current workflows. The first major changes were made for the 0.56 release, so tracking will start there. Reasons are not provided for bug fixes for because the reason can assumed to be fixing the bug...
|
|
3
3
|
|
|
4
|
+
#### V3.0.2 (May 2026)
|
|
5
|
+
Changes:
|
|
6
|
+
|
|
7
|
+
* Updated `metapredict-caid` and CAID output logic: The default IDR/folded domain binarization now uses an algorithmic approach to decompose IDRs and folded domains, rather than a strict per-residue cutoff. This provides more biologically meaningful domain assignments and better reflects the underlying disorder/folded state segmentation.
|
|
8
|
+
|
|
9
|
+
|
|
4
10
|
#### V3.0.1 (November 2024)
|
|
5
11
|
Changes:
|
|
6
12
|
|
|
@@ -756,10 +756,18 @@ The third argument specifies the version of Metapredict to use. The options are:
|
|
|
756
756
|
- ``v2``
|
|
757
757
|
- ``v3``
|
|
758
758
|
|
|
759
|
+
|
|
759
760
|
**Example**:
|
|
760
761
|
|
|
761
762
|
.. code-block:: bash
|
|
762
763
|
|
|
763
764
|
$ metapredict-caid proteins.fasta output/ v3
|
|
764
765
|
|
|
766
|
+
CAID Output Binarization: Algorithmic Domain Assignment
|
|
767
|
+
------------------------------------------------------
|
|
768
|
+
|
|
769
|
+
By default, ``metapredict-caid`` uses an algorithmic approach to assign binary labels for IDRs and folded domains. Instead of applying a strict per-residue disorder score cutoff, metapredict decomposes each sequence into contiguous intrinsically disordered regions (IDRs) and folded domains using a domain segmentation algorithm. This results in more biologically meaningful domain assignments that better reflect the underlying disorder/folded state segmentation.
|
|
770
|
+
|
|
771
|
+
If you prefer the legacy strict cutoff-based assignment, you can use the ``--use-fixed-cutoff`` flag to specify a threshold for per-residue binarization.
|
|
772
|
+
|
|
765
773
|
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "3.0.2"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"""
|
|
1
2
|
# code to carry out the caid2 analsis for Disorder PDB dataset.
|
|
2
3
|
|
|
3
4
|
'''
|
|
@@ -8,7 +9,7 @@ facing.
|
|
|
8
9
|
'''
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
|
|
12
13
|
# This is commented out because it requires sklearn. Given that none of the stuff
|
|
13
14
|
# in the analysis part of metapredict is necessary for users, I'm leaving
|
|
14
15
|
# stuff back here commenting out to avoid addint sklearn as another dependency.
|
|
@@ -21,6 +22,20 @@ from sklearn.metrics import roc_auc_score, average_precision_score, f1_score, pr
|
|
|
21
22
|
import math
|
|
22
23
|
import matplotlib.pyplot as plt
|
|
23
24
|
|
|
25
|
+
def use_domains_function(seq_domain):
|
|
26
|
+
# domain-based binary classification using DisorderObject
|
|
27
|
+
cur_sequence = seq_domain.sequence
|
|
28
|
+
cur_scores = seq_domain.disorder
|
|
29
|
+
|
|
30
|
+
# build a per-residue binary mask from the IDR domain boundaries
|
|
31
|
+
# (boundaries are half-open Python-indexed [start, end) intervals).
|
|
32
|
+
cur_binary_mask = [0] * len(cur_sequence)
|
|
33
|
+
for boundary in seq_domain.disordered_domain_boundaries:
|
|
34
|
+
start, end = boundary[0], boundary[1]
|
|
35
|
+
for i in range(start, end):
|
|
36
|
+
cur_binary_mask[i] = 1
|
|
37
|
+
return cur_binary_mask
|
|
38
|
+
|
|
24
39
|
def read_caid2_seq_disorder(caid_file='caid2_disorder_pdb.fasta'):
|
|
25
40
|
'''
|
|
26
41
|
|
|
@@ -80,7 +95,10 @@ def stretch(scores, base=0.1, top=0.95):
|
|
|
80
95
|
|
|
81
96
|
|
|
82
97
|
|
|
83
|
-
def get_metapredict_scores(caid2_seqs_scores, version, cutoff=None, plddt=False,
|
|
98
|
+
def get_metapredict_scores(caid2_seqs_scores, version, cutoff=None, plddt=False,
|
|
99
|
+
smoothing=None,
|
|
100
|
+
stretch_scores=False,
|
|
101
|
+
use_domains=False):
|
|
84
102
|
'''
|
|
85
103
|
function to get the metapredict scores that match
|
|
86
104
|
to each sequence in the caid2 dataset.
|
|
@@ -98,6 +116,8 @@ def get_metapredict_scores(caid2_seqs_scores, version, cutoff=None, plddt=False,
|
|
|
98
116
|
whether to smooth scores over some window. Default=None (no smoothing)
|
|
99
117
|
stretch_scores : bool
|
|
100
118
|
whether to stretch the scores
|
|
119
|
+
use_domains : bool
|
|
120
|
+
whether to use domain-based binary classification
|
|
101
121
|
|
|
102
122
|
Returns
|
|
103
123
|
--------
|
|
@@ -127,7 +147,7 @@ def get_metapredict_scores(caid2_seqs_scores, version, cutoff=None, plddt=False,
|
|
|
127
147
|
|
|
128
148
|
# now get metapredict predictions.
|
|
129
149
|
if plddt==False:
|
|
130
|
-
metapredict_scores = predict(caid2_seqs, version=version)
|
|
150
|
+
metapredict_scores = predict(caid2_seqs, version=version, return_domains=use_domains)
|
|
131
151
|
else:
|
|
132
152
|
metapredict_scores = predict_pLDDT(caid2_seqs, version=version, return_as_disorder_score=True)
|
|
133
153
|
|
|
@@ -151,12 +171,18 @@ def get_metapredict_scores(caid2_seqs_scores, version, cutoff=None, plddt=False,
|
|
|
151
171
|
results={}
|
|
152
172
|
for s in metapredict_scores:
|
|
153
173
|
name=s
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
174
|
+
if not use_domains:
|
|
175
|
+
sequence=metapredict_scores[s][0]
|
|
176
|
+
scores=metapredict_scores[s][1]
|
|
177
|
+
binary_scores=np.array(scores)
|
|
178
|
+
binary_scores[binary_scores<cutoff] = 0
|
|
179
|
+
binary_scores[binary_scores>=cutoff] = 1
|
|
180
|
+
results[name] = {'sequence':sequence, 'scores':scores, 'binary':binary_scores.astype(int).tolist()}
|
|
181
|
+
else:
|
|
182
|
+
sequence=metapredict_scores[s].sequence
|
|
183
|
+
scores=metapredict_scores[s].disorder
|
|
184
|
+
binary_scores=np.array(use_domains_function(metapredict_scores[s]))
|
|
185
|
+
results[name] = {'sequence':sequence, 'scores':scores, 'binary':binary_scores.astype(int).tolist()}
|
|
160
186
|
return results
|
|
161
187
|
|
|
162
188
|
|
|
@@ -209,7 +235,8 @@ def calc_mcc(metapredict_scores, caid_scores):
|
|
|
209
235
|
return mcc_value
|
|
210
236
|
|
|
211
237
|
def calculate_stats(version='V2', cutoff=None, smoothing=None, stretch_scores=False,
|
|
212
|
-
evaluation_fasta='caid2_disorder_pdb.fasta'
|
|
238
|
+
evaluation_fasta='caid2_disorder_pdb.fasta',
|
|
239
|
+
use_domains=False):
|
|
213
240
|
'''
|
|
214
241
|
Calculate the AUC, APS, and F1 max
|
|
215
242
|
|
|
@@ -233,6 +260,9 @@ def calculate_stats(version='V2', cutoff=None, smoothing=None, stretch_scores=Fa
|
|
|
233
260
|
the fasta file to use for evaluation.
|
|
234
261
|
Default is the caid2_disorder_pdb.fasta
|
|
235
262
|
|
|
263
|
+
use_domains : bool
|
|
264
|
+
Whether to use domain-based binary classification. Default is False (per-residue binary classification)
|
|
265
|
+
|
|
236
266
|
whether to stretch the scores
|
|
237
267
|
|
|
238
268
|
Returns
|
|
@@ -249,7 +279,7 @@ def calculate_stats(version='V2', cutoff=None, smoothing=None, stretch_scores=Fa
|
|
|
249
279
|
# get caid dict.
|
|
250
280
|
caid_vals = read_caid2_seq_disorder(caid_file=evaluation_fasta)
|
|
251
281
|
# do metapredict prediction
|
|
252
|
-
metapredict_vals = get_metapredict_scores(caid_vals, version, cutoff=cutoff, smoothing=smoothing, stretch_scores=stretch_scores)
|
|
282
|
+
metapredict_vals = get_metapredict_scores(caid_vals, version, cutoff=cutoff, smoothing=smoothing, stretch_scores=stretch_scores, use_domains=use_domains)
|
|
253
283
|
# get linear values for metapredict and caid
|
|
254
284
|
metapredict_linear = []
|
|
255
285
|
caid_linear = ''
|
|
@@ -284,7 +314,8 @@ def calculate_stats(version='V2', cutoff=None, smoothing=None, stretch_scores=Fa
|
|
|
284
314
|
|
|
285
315
|
|
|
286
316
|
|
|
287
|
-
|
|
317
|
+
|
|
318
|
+
def print_current_network_accuracy(evaluation='all', additional_networks=None, use_domains=False):
|
|
288
319
|
'''
|
|
289
320
|
Function to print out the current network accuracies. Just a nice
|
|
290
321
|
one-liner to have sitting around.
|
|
@@ -298,6 +329,9 @@ def print_current_network_accuracy(evaluation='all', additional_networks=None):
|
|
|
298
329
|
additional_networks : list
|
|
299
330
|
additional networks to test. Must be in the
|
|
300
331
|
metapredict_networks dictionary in network_parameters.py
|
|
332
|
+
|
|
333
|
+
use_domains : bool
|
|
334
|
+
whether to use domain-based binary classification. Default is False (per-residue binary classification)
|
|
301
335
|
'''
|
|
302
336
|
# list of current networks
|
|
303
337
|
nets=['V1', 'V2', 'V3']
|
|
@@ -327,7 +361,8 @@ def print_current_network_accuracy(evaluation='all', additional_networks=None):
|
|
|
327
361
|
|
|
328
362
|
# add the results for each network
|
|
329
363
|
for net in nets:
|
|
330
|
-
results = calculate_stats(version=net
|
|
364
|
+
results = calculate_stats(version=net,
|
|
365
|
+
use_domains=use_domains)
|
|
331
366
|
temp=''
|
|
332
367
|
for result in results:
|
|
333
368
|
temp = temp + f'{result} = {results[result]}, '
|
|
@@ -336,4 +371,9 @@ def print_current_network_accuracy(evaluation='all', additional_networks=None):
|
|
|
336
371
|
# print the results
|
|
337
372
|
print(eval_string)
|
|
338
373
|
|
|
374
|
+
print('no domains')
|
|
375
|
+
print_current_network_accuracy()
|
|
376
|
+
|
|
377
|
+
print('with domains')
|
|
378
|
+
print_current_network_accuracy(use_domains=True)
|
|
339
379
|
"""
|
|
Binary file
|