openprotein-python 0.12.1__tar.gz → 0.13.1__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.
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/PKG-INFO +1 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/align/align.py +22 -3
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/align/api.py +9 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/align/msa.py +1 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/align/schemas.py +18 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/base.py +17 -8
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/data/data.py +1 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/data/schemas.py +1 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/design/schemas.py +16 -2
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/api.py +11 -3
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/embeddings.py +7 -2
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/models.py +5 -2
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/errors.py +17 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/api.py +91 -6
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/common.py +10 -6
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/future.py +153 -3
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/jobs/api.py +12 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/jobs/futures.py +25 -23
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/jobs/jobs.py +16 -3
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/jobs/schemas.py +1 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/models/structure_generation.py +1 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/molecules/complex.py +11 -4
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/molecules/template.py +15 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/predictor/models.py +2 -2
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/predictor/prediction.py +1 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/predictor/validate.py +1 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/prompt/models.py +1 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/svd/api.py +12 -3
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/svd/models.py +1 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/svd/svd.py +13 -2
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/umap/api.py +11 -2
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/umap/models.py +1 -1
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/umap/umap.py +12 -3
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/pyproject.toml +8 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/.gitignore +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/LICENSE.txt +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/README.md +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/_version.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/align/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/align/future.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/align.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/assaydata.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/deprecated/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/deprecated/design.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/deprecated/poet.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/deprecated/predict.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/deprecated/train.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/design.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/designer.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/embedding.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/error.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/fold.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/job.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/predict.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/predictor.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/prompt.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/svd.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/train.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/api/umap.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/deprecated.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/align/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/align/base.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/align/msa.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/align/prompt.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/assaydata.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/deprecated/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/deprecated/design.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/deprecated/poet.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/deprecated/predict.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/deprecated/train.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/design.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/designer.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/embeddings/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/embeddings/base.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/embeddings/esm.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/embeddings/future.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/embeddings/openprotein.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/embeddings/poet.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/embeddings/poet2.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/embeddings/test.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/fold/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/fold/alphafold2.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/fold/base.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/fold/boltz.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/fold/esmfold.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/fold/future.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/futures.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/predict.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/predictor/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/predictor/predict.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/predictor/predictor.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/predictor/validate.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/prompt.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/svd.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/train.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/models/umap.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/align.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/assaydata.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/deprecated/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/deprecated/design.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/deprecated/predict.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/deprecated/train.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/design.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/designer.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/embeddings.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/fold.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/job.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/predict.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/predictor.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/prompt.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/svd.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/train.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/app/services/umap.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/chains.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/common/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/common/features.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/common/model_metadata.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/common/reduction.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/common/residue_contants.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/config.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/csv.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/data/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/data/api.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/data/assaydataset.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/design/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/design/api.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/design/design.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/design/future.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/ablang.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/esm.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/future.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/openprotein.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/poet.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/poet2.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/schemas.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fasta.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/alphafold2.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/boltz.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/complex.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/esmfold.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/fold.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/minifold.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/models.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/protenix.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/rosettafold3.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/fold/schemas.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/jobs/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/models/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/models/base.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/models/foundation/boltzgen.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/models/foundation/boltzgen_schema.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/models/foundation/proteinmpnn.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/models/foundation/rfdiffusion.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/models/models.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/molecules/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/molecules/chains.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/molecules/protein.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/molecules/structure.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/predictor/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/predictor/api.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/predictor/predictor.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/predictor/schemas.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/prompt/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/prompt/api.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/prompt/prompt.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/prompt/schemas.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/protein.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/scaffolds.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/align.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/assaydata.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/deprecated/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/deprecated/design.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/deprecated/poet.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/deprecated/predict.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/deprecated/train.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/design.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/designer.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/embeddings.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/features.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/fold.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/job.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/predict.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/predictor.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/prompt.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/svd.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/train.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/schemas/umap.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/svd/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/svd/schemas.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/umap/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/umap/schemas.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/utils/__init__.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/utils/chain_id.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/utils/cif.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/utils/numpy.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/utils/sequence.py +0 -0
- {openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/utils/uuid.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openprotein-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.1
|
|
4
4
|
Summary: OpenProtein Python interface.
|
|
5
5
|
Author-email: Mark Gee <markgee@ne47.bio>, "Timothy Truong Jr." <ttruong@ne47.bio>, Tristan Bepler <tbepler@ne47.bio>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -189,6 +189,7 @@ class AlignAPI:
|
|
|
189
189
|
sequences: Sequence[bytes | str],
|
|
190
190
|
names: Sequence[str] | None = None,
|
|
191
191
|
scheme: AbNumberScheme = AbNumberScheme.CHOTHIA,
|
|
192
|
+
drop_minority_chains: bool = False,
|
|
192
193
|
) -> MSAFuture:
|
|
193
194
|
"""
|
|
194
195
|
Align antibody sequences using `AbNumber`.
|
|
@@ -205,6 +206,10 @@ class AlignAPI:
|
|
|
205
206
|
Optional list of sequence names, must be the same length as sequences if provided.
|
|
206
207
|
scheme : AbNumberScheme, default=AbNumberScheme.CHOTHIA
|
|
207
208
|
Antibody numbering scheme.
|
|
209
|
+
drop_minority_chains : bool, default=False
|
|
210
|
+
If True, drop sequences belonging to chain types that are in the
|
|
211
|
+
minority (e.g. heavy vs light) so the resulting alignment contains
|
|
212
|
+
only the dominant chain type.
|
|
208
213
|
|
|
209
214
|
Returns
|
|
210
215
|
-------
|
|
@@ -235,10 +240,15 @@ class AlignAPI:
|
|
|
235
240
|
lines.append(sequence)
|
|
236
241
|
content = b"\n".join(lines)
|
|
237
242
|
stream = BytesIO(content)
|
|
238
|
-
return self.abnumber_file(
|
|
243
|
+
return self.abnumber_file(
|
|
244
|
+
stream, scheme=scheme, drop_minority_chains=drop_minority_chains
|
|
245
|
+
)
|
|
239
246
|
|
|
240
247
|
def abnumber_file(
|
|
241
|
-
self,
|
|
248
|
+
self,
|
|
249
|
+
file,
|
|
250
|
+
scheme: AbNumberScheme = AbNumberScheme.CHOTHIA,
|
|
251
|
+
drop_minority_chains: bool = False,
|
|
242
252
|
) -> MSAFuture:
|
|
243
253
|
"""
|
|
244
254
|
Align antibody sequences using `AbNumber`.
|
|
@@ -253,13 +263,22 @@ class AlignAPI:
|
|
|
253
263
|
Sequences to align in FASTA or CSV format.
|
|
254
264
|
scheme : AbNumberScheme, default=AbNumberScheme.CHOTHIA
|
|
255
265
|
Antibody numbering scheme.
|
|
266
|
+
drop_minority_chains : bool, default=False
|
|
267
|
+
If True, drop sequences belonging to chain types that are in the
|
|
268
|
+
minority (e.g. heavy vs light) so the resulting alignment contains
|
|
269
|
+
only the dominant chain type.
|
|
256
270
|
|
|
257
271
|
Returns
|
|
258
272
|
-------
|
|
259
273
|
MSAFuture
|
|
260
274
|
Future object awaiting the contents of the MSA upload.
|
|
261
275
|
"""
|
|
262
|
-
job = api.abnumber_post(
|
|
276
|
+
job = api.abnumber_post(
|
|
277
|
+
self.session,
|
|
278
|
+
file,
|
|
279
|
+
scheme=scheme,
|
|
280
|
+
drop_minority_chains=drop_minority_chains,
|
|
281
|
+
)
|
|
263
282
|
return MSAFuture.create(session=self.session, job=job)
|
|
264
283
|
|
|
265
284
|
def upload_msa(self, msa_file: BinaryIO) -> MSAFuture:
|
|
@@ -269,6 +269,7 @@ def abnumber_post(
|
|
|
269
269
|
session: APISession,
|
|
270
270
|
sequence_file: BinaryIO,
|
|
271
271
|
scheme: AbNumberScheme | str = AbNumberScheme.IMGT,
|
|
272
|
+
drop_minority_chains: bool = False,
|
|
272
273
|
) -> Job:
|
|
273
274
|
"""
|
|
274
275
|
Align antibody sequences using AbNumber.
|
|
@@ -284,6 +285,10 @@ def abnumber_post(
|
|
|
284
285
|
Sequences to align in FASTA or CSV format.
|
|
285
286
|
scheme : AbNumberScheme, optional
|
|
286
287
|
Antibody numbering scheme. Default is IMGT.
|
|
288
|
+
drop_minority_chains : bool, optional
|
|
289
|
+
If True, drop sequences belonging to chain types that are in the
|
|
290
|
+
minority (e.g. heavy vs light) so the resulting alignment contains
|
|
291
|
+
only the dominant chain type. Default is False.
|
|
287
292
|
|
|
288
293
|
Returns
|
|
289
294
|
-------
|
|
@@ -297,7 +302,10 @@ def abnumber_post(
|
|
|
297
302
|
raise InvalidParameterError(f"Antibody numbering {scheme} not recognized")
|
|
298
303
|
|
|
299
304
|
files = {"file": sequence_file}
|
|
300
|
-
params = {
|
|
305
|
+
params = {
|
|
306
|
+
"scheme": scheme if isinstance(scheme, str) else scheme.value,
|
|
307
|
+
"drop_minority_chains": drop_minority_chains,
|
|
308
|
+
}
|
|
301
309
|
|
|
302
310
|
response = session.post(endpoint, files=files, params=params)
|
|
303
311
|
return Job.model_validate(response.json())
|
|
@@ -45,7 +45,7 @@ class MSAFuture(AlignFuture, Future):
|
|
|
45
45
|
self.page_size = page_size
|
|
46
46
|
self.msa_id = self.job.job_id
|
|
47
47
|
|
|
48
|
-
def
|
|
48
|
+
def _get(self, verbose: bool = False) -> Iterator[tuple[str, str]]:
|
|
49
49
|
"""
|
|
50
50
|
Retrieve the MSA of the job.
|
|
51
51
|
|
|
@@ -157,7 +157,24 @@ class AbNumberJob(MSAJob, Job):
|
|
|
157
157
|
|
|
158
158
|
|
|
159
159
|
class AbNumberScheme(str, Enum):
|
|
160
|
-
"""
|
|
160
|
+
"""
|
|
161
|
+
Antibody numbering scheme.
|
|
162
|
+
|
|
163
|
+
Attributes
|
|
164
|
+
----------
|
|
165
|
+
IMGT : str
|
|
166
|
+
IMGT numbering scheme, a standardized system unifying numbering across
|
|
167
|
+
all immunoglobulin and T-cell receptor variable domains.
|
|
168
|
+
CHOTHIA : str
|
|
169
|
+
Chothia numbering scheme, based on the structural location of
|
|
170
|
+
canonical loops in antibody variable domains.
|
|
171
|
+
KABAT : str
|
|
172
|
+
Kabat numbering scheme, based on sequence variability across
|
|
173
|
+
antibody variable domains.
|
|
174
|
+
AHO : str
|
|
175
|
+
AHo numbering scheme, a structure-based unified numbering scheme
|
|
176
|
+
for antibody variable domains.
|
|
177
|
+
"""
|
|
161
178
|
|
|
162
179
|
IMGT = "imgt"
|
|
163
180
|
CHOTHIA = "chothia"
|
|
@@ -8,8 +8,8 @@ import requests.auth
|
|
|
8
8
|
from requests.adapters import HTTPAdapter
|
|
9
9
|
from requests.packages.urllib3.util.retry import Retry # type: ignore
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
from openprotein.errors import
|
|
11
|
+
from openprotein._version import __version__
|
|
12
|
+
from openprotein.errors import AuthError, HTTPError
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class BearerAuth(requests.auth.AuthBase):
|
|
@@ -17,11 +17,19 @@ class BearerAuth(requests.auth.AuthBase):
|
|
|
17
17
|
See https://stackoverflow.com/a/58055668
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
-
def __init__(self, token):
|
|
21
|
-
self.
|
|
20
|
+
def __init__(self, username, token):
|
|
21
|
+
self._username = username
|
|
22
|
+
self._token = token
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def token(self):
|
|
26
|
+
warnings.warn(
|
|
27
|
+
"DeprecationWarning: Accessing session.auth.token is deprecated and will throw an error in the future. Use session.auth._token if you need it."
|
|
28
|
+
)
|
|
29
|
+
return self._token
|
|
22
30
|
|
|
23
31
|
def __call__(self, r):
|
|
24
|
-
r.headers["Authorization"] = "Bearer " + self.
|
|
32
|
+
r.headers["Authorization"] = "Bearer " + self._token
|
|
25
33
|
return r
|
|
26
34
|
|
|
27
35
|
|
|
@@ -56,6 +64,7 @@ class APISession(requests.Session):
|
|
|
56
64
|
)
|
|
57
65
|
adapter = HTTPAdapter(max_retries=retry)
|
|
58
66
|
self.mount("https://", adapter)
|
|
67
|
+
self.headers["User-Agent"] = f"openprotein-python/{__version__}"
|
|
59
68
|
self.login(username, password)
|
|
60
69
|
|
|
61
70
|
def post(self, url, data=None, json=None, **kwargs):
|
|
@@ -101,14 +110,14 @@ class APISession(requests.Session):
|
|
|
101
110
|
except HTTPError as e:
|
|
102
111
|
# if an error occured during auth, we raise an AuthError with reference to the HTTPError
|
|
103
112
|
raise AuthError(
|
|
104
|
-
|
|
113
|
+
"Authentication failed. Please check your credentials and connection."
|
|
105
114
|
) from e
|
|
106
115
|
|
|
107
116
|
result = response.json()
|
|
108
117
|
token = result.get("access_token")
|
|
109
118
|
if token is None:
|
|
110
119
|
raise AuthError("Unable to authenticate with given credentials.")
|
|
111
|
-
return BearerAuth(token)
|
|
120
|
+
return BearerAuth(username=username, token=token)
|
|
112
121
|
|
|
113
122
|
def request(self, method: str, url: str, *args, **kwargs):
|
|
114
123
|
full_url = urljoin(self.backend, url)
|
|
@@ -136,7 +145,7 @@ class APISession(requests.Session):
|
|
|
136
145
|
return response
|
|
137
146
|
|
|
138
147
|
|
|
139
|
-
def _total_size(o: Sequence | Mapping, seen=None):
|
|
148
|
+
def _total_size(o: Sequence | Mapping | object, seen=None):
|
|
140
149
|
"""Recursively finds size of objects including contents."""
|
|
141
150
|
if seen is None:
|
|
142
151
|
seen = set()
|
|
@@ -59,6 +59,7 @@ class DataAPI:
|
|
|
59
59
|
metadata = api.assaydata_post(
|
|
60
60
|
self.session, stream, name, assay_description=description
|
|
61
61
|
)
|
|
62
|
+
table.columns = [str(column).lower() for column in table.columns]
|
|
62
63
|
metadata.sequence_length = len(table["sequence"].values[0])
|
|
63
64
|
return AssayDataset(self.session, metadata)
|
|
64
65
|
|
|
@@ -67,7 +67,14 @@ class Subcriterion(BaseModel):
|
|
|
67
67
|
raise ValueError(
|
|
68
68
|
f"Expected to chain only with criterion or subcriterion, got {type(other)}"
|
|
69
69
|
)
|
|
70
|
-
|
|
70
|
+
all_subcriteria = [self] + others
|
|
71
|
+
types = {sc.criterion_type for sc in all_subcriteria}
|
|
72
|
+
if len(types) > 1:
|
|
73
|
+
raise ValueError(
|
|
74
|
+
"Cannot AND model and n_mutations criteria in the same group. "
|
|
75
|
+
"Use | (OR) to put them in separate groups instead."
|
|
76
|
+
)
|
|
77
|
+
return Criterion(all_subcriteria) # type: ignore - doesnt like Self
|
|
71
78
|
|
|
72
79
|
def __or__(self, other: "Subcriterion | Criterion | Any") -> "Criteria":
|
|
73
80
|
"""
|
|
@@ -332,7 +339,14 @@ class Criterion(RootModel):
|
|
|
332
339
|
elif isinstance(other, Criterion):
|
|
333
340
|
others = other.root
|
|
334
341
|
|
|
335
|
-
|
|
342
|
+
all_subcriteria = self.root + others
|
|
343
|
+
types = {sc.criterion_type for sc in all_subcriteria}
|
|
344
|
+
if len(types) > 1:
|
|
345
|
+
raise ValueError(
|
|
346
|
+
"Cannot AND model and n_mutations criteria in the same group. "
|
|
347
|
+
"Use | (OR) to put them in separate groups instead."
|
|
348
|
+
)
|
|
349
|
+
return Criterion(all_subcriteria)
|
|
336
350
|
|
|
337
351
|
def __or__(self, other: "Criterion | Subcriterion") -> "Criteria":
|
|
338
352
|
"""
|
|
@@ -28,20 +28,28 @@ from .schemas import (
|
|
|
28
28
|
PATH_PREFIX = "v1/embeddings"
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
def list_models(
|
|
31
|
+
def list_models(
|
|
32
|
+
session: APISession, verbose: bool = False
|
|
33
|
+
) -> list[str] | list[ModelMetadata]:
|
|
32
34
|
"""
|
|
33
35
|
List available embeddings models.
|
|
34
36
|
|
|
35
37
|
Args:
|
|
36
38
|
session (APISession): API session
|
|
39
|
+
verbose (bool): If True, return full ModelMetadata objects instead of model ID strings.
|
|
37
40
|
|
|
38
41
|
Returns:
|
|
39
|
-
list[str]: list of model names.
|
|
42
|
+
list[str] | list[ModelMetadata]: list of model names or metadata objects.
|
|
40
43
|
"""
|
|
41
44
|
|
|
42
45
|
endpoint = PATH_PREFIX + "/models"
|
|
43
|
-
|
|
46
|
+
params = {}
|
|
47
|
+
if verbose:
|
|
48
|
+
params["verbose"] = "true"
|
|
49
|
+
response = session.get(endpoint, params=params)
|
|
44
50
|
result = response.json()
|
|
51
|
+
if verbose:
|
|
52
|
+
return TypeAdapter(list[ModelMetadata]).validate_python(result)
|
|
45
53
|
return result
|
|
46
54
|
|
|
47
55
|
|
{openprotein_python-0.12.1 → openprotein_python-0.13.1}/openprotein/embeddings/embeddings.py
RENAMED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from openprotein.base import APISession
|
|
4
4
|
|
|
5
5
|
from . import api
|
|
6
|
+
from .ablang import AbLang2Model
|
|
6
7
|
from .esm import ESMModel
|
|
7
8
|
from .future import EmbeddingsResultFuture
|
|
8
9
|
from .models import EmbeddingModel
|
|
@@ -55,6 +56,7 @@ class EmbeddingsAPI:
|
|
|
55
56
|
#: Rotaprot model trained on UniRef90
|
|
56
57
|
rotaprot_large_uniref90_ft: OpenProteinModel
|
|
57
58
|
poet_2: PoET2Model
|
|
59
|
+
ablang2: AbLang2Model
|
|
58
60
|
|
|
59
61
|
#: ESM1b model
|
|
60
62
|
esm1b: ESMModel # alias
|
|
@@ -100,10 +102,13 @@ class EmbeddingsAPI:
|
|
|
100
102
|
def list_models(self) -> list[EmbeddingModel]:
|
|
101
103
|
"""list models available for creating embeddings of your sequences"""
|
|
102
104
|
models = []
|
|
103
|
-
for
|
|
105
|
+
for metadata in api.list_models(self.session, verbose=True):
|
|
104
106
|
models.append(
|
|
105
107
|
EmbeddingModel.create(
|
|
106
|
-
session=self.session,
|
|
108
|
+
session=self.session,
|
|
109
|
+
model_id=metadata.id,
|
|
110
|
+
default=EmbeddingModel,
|
|
111
|
+
metadata=metadata,
|
|
107
112
|
)
|
|
108
113
|
)
|
|
109
114
|
return models
|
|
@@ -74,6 +74,7 @@ class EmbeddingModel:
|
|
|
74
74
|
session: APISession,
|
|
75
75
|
model_id: str,
|
|
76
76
|
default: type["EmbeddingModel"] | None = None,
|
|
77
|
+
metadata: ModelMetadata | None = None,
|
|
77
78
|
**kwargs,
|
|
78
79
|
):
|
|
79
80
|
"""
|
|
@@ -87,6 +88,8 @@ class EmbeddingModel:
|
|
|
87
88
|
The model identifier.
|
|
88
89
|
default : type variable of EmbeddingModel or None, optional
|
|
89
90
|
Default EmbeddingModel subclass to use if no match is found.
|
|
91
|
+
metadata : ModelMetadata or None, optional
|
|
92
|
+
Pre-fetched metadata to avoid an extra API call.
|
|
90
93
|
kwargs :
|
|
91
94
|
Additional keyword arguments to pass to the model constructor.
|
|
92
95
|
|
|
@@ -106,11 +109,11 @@ class EmbeddingModel:
|
|
|
106
109
|
# Find the EmbeddingModel class that matches the model_id
|
|
107
110
|
for model_class in model_classes:
|
|
108
111
|
if model_id in model_class.get_model():
|
|
109
|
-
return model_class(session=session, model_id=model_id, **kwargs)
|
|
112
|
+
return model_class(session=session, model_id=model_id, metadata=metadata, **kwargs)
|
|
110
113
|
# default to ProtembedModel
|
|
111
114
|
if default is not None:
|
|
112
115
|
try:
|
|
113
|
-
return default(session=session, model_id=model_id, **kwargs)
|
|
116
|
+
return default(session=session, model_id=model_id, metadata=metadata, **kwargs)
|
|
114
117
|
except:
|
|
115
118
|
# continue to throw error as unsupported
|
|
116
119
|
pass
|
|
@@ -72,6 +72,23 @@ class TimeoutException(Exception):
|
|
|
72
72
|
super().__init__(self.message)
|
|
73
73
|
|
|
74
74
|
|
|
75
|
+
class JobFailedException(Exception):
|
|
76
|
+
"""Raised when retrieving results from a job that has failed."""
|
|
77
|
+
|
|
78
|
+
def __init__(
|
|
79
|
+
self,
|
|
80
|
+
job_id: str,
|
|
81
|
+
failure_message: str | None = None,
|
|
82
|
+
):
|
|
83
|
+
self.job_id = job_id
|
|
84
|
+
self.failure_message = failure_message
|
|
85
|
+
message = f"Job {job_id} failed"
|
|
86
|
+
if failure_message:
|
|
87
|
+
message = f"{message}: {failure_message}"
|
|
88
|
+
self.message = message
|
|
89
|
+
super().__init__(self.message)
|
|
90
|
+
|
|
91
|
+
|
|
75
92
|
class DeprecationError(Exception):
|
|
76
93
|
"""DeprecationError used for flagging to the user to not use this interface anymore."""
|
|
77
94
|
|
|
@@ -140,7 +140,7 @@ def fold_get_extra_result(
|
|
|
140
140
|
session: APISession,
|
|
141
141
|
job_id: str,
|
|
142
142
|
sequence_or_index: bytes | str | int,
|
|
143
|
-
key: Literal["pae", "pde", "plddt", "ptm"],
|
|
143
|
+
key: Literal["pae", "pde", "plddt", "ptm", "ipae"],
|
|
144
144
|
) -> np.ndarray: ...
|
|
145
145
|
|
|
146
146
|
|
|
@@ -176,7 +176,15 @@ def fold_get_extra_result(
|
|
|
176
176
|
job_id: str,
|
|
177
177
|
sequence_or_index: bytes | str | int,
|
|
178
178
|
key: Literal[
|
|
179
|
-
"pae",
|
|
179
|
+
"pae",
|
|
180
|
+
"pde",
|
|
181
|
+
"plddt",
|
|
182
|
+
"ptm",
|
|
183
|
+
"ipae",
|
|
184
|
+
"confidence",
|
|
185
|
+
"affinity",
|
|
186
|
+
"score",
|
|
187
|
+
"metrics",
|
|
180
188
|
],
|
|
181
189
|
) -> "np.ndarray | list[dict] | dict | pd.DataFrame":
|
|
182
190
|
"""
|
|
@@ -190,15 +198,16 @@ def fold_get_extra_result(
|
|
|
190
198
|
Job ID to retrieve results from.
|
|
191
199
|
sequence_or_index : bytes or str or int
|
|
192
200
|
Sequence to retrieve results for or its index in the job.
|
|
193
|
-
key : {'pae', 'pde', 'plddt', 'ptm', 'confidence', 'affinity', 'score', 'metrics'}
|
|
194
|
-
The type of result to retrieve.
|
|
201
|
+
key : {'pae', 'pde', 'plddt', 'ptm', 'ipae', 'confidence', 'affinity', 'score', 'metrics'}
|
|
202
|
+
The type of result to retrieve. ``ipae`` is a synthetic scalar per
|
|
203
|
+
unit (shape ``(1,)``) derived from ``pae`` and the chain layout.
|
|
195
204
|
|
|
196
205
|
Returns
|
|
197
206
|
-------
|
|
198
207
|
numpy.ndarray or list of dict
|
|
199
|
-
The result as a numpy array (for "pae", "pde", "plddt") or a list of dictionaries (for "confidence", "affinity").
|
|
208
|
+
The result as a numpy array (for "pae", "pde", "plddt", "ptm", "ipae") or a list of dictionaries (for "confidence", "affinity").
|
|
200
209
|
"""
|
|
201
|
-
if key in {"pae", "pde", "plddt", "ptm"}:
|
|
210
|
+
if key in {"pae", "pde", "plddt", "ptm", "ipae"}:
|
|
202
211
|
|
|
203
212
|
def formatter(response):
|
|
204
213
|
return np.load(io.BytesIO(response.content))
|
|
@@ -226,6 +235,82 @@ def fold_get_extra_result(
|
|
|
226
235
|
return output
|
|
227
236
|
|
|
228
237
|
|
|
238
|
+
@typing.overload
|
|
239
|
+
def fold_get_batch_extra_result(
|
|
240
|
+
session: APISession,
|
|
241
|
+
job_id: str,
|
|
242
|
+
key: Literal["pae", "pde", "plddt", "ptm", "ipae"],
|
|
243
|
+
) -> np.ndarray: ...
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
@typing.overload
|
|
247
|
+
def fold_get_batch_extra_result(
|
|
248
|
+
session: APISession,
|
|
249
|
+
job_id: str,
|
|
250
|
+
key: Literal["confidence"],
|
|
251
|
+
) -> list[list[dict] | None]: ...
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
@typing.overload
|
|
255
|
+
def fold_get_batch_extra_result(
|
|
256
|
+
session: APISession,
|
|
257
|
+
job_id: str,
|
|
258
|
+
key: Literal["affinity"],
|
|
259
|
+
) -> list[dict | None]: ...
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def fold_get_batch_extra_result(
|
|
263
|
+
session: APISession,
|
|
264
|
+
job_id: str,
|
|
265
|
+
key: Literal["pae", "pde", "plddt", "ptm", "ipae", "confidence", "affinity"],
|
|
266
|
+
) -> "np.ndarray | list":
|
|
267
|
+
"""
|
|
268
|
+
Fetch an extra result key stacked across every unit in a fold job.
|
|
269
|
+
|
|
270
|
+
Backed by a single server call to ``/v1/fold/{job_id}/results/{key}``
|
|
271
|
+
(not N per-unit calls). For ``.npy`` keys the server pads per-unit
|
|
272
|
+
arrays with NaN to the per-axis max shape and stacks along a new
|
|
273
|
+
leading dim; for ``.json`` keys it returns a length-``N`` array where
|
|
274
|
+
element ``i`` is unit ``i``'s parsed JSON (``None`` if that unit's
|
|
275
|
+
result was missing or failed to fetch).
|
|
276
|
+
|
|
277
|
+
Parameters
|
|
278
|
+
----------
|
|
279
|
+
session : APISession
|
|
280
|
+
Session object for API communication.
|
|
281
|
+
job_id : str
|
|
282
|
+
Job ID to retrieve results from.
|
|
283
|
+
key : {'pae', 'pde', 'plddt', 'ptm', 'ipae', 'confidence', 'affinity'}
|
|
284
|
+
The type of result to retrieve. ``ipae`` returns shape ``[N]``.
|
|
285
|
+
|
|
286
|
+
Returns
|
|
287
|
+
-------
|
|
288
|
+
numpy.ndarray or list
|
|
289
|
+
``np.ndarray`` of shape ``[N, ...]`` for npy keys; ``list`` of
|
|
290
|
+
length ``N`` for json keys (``confidence`` / ``affinity``), with
|
|
291
|
+
``None`` entries for units whose per-unit result could not be
|
|
292
|
+
fetched.
|
|
293
|
+
"""
|
|
294
|
+
if key in {"pae", "pde", "plddt", "ptm", "ipae"}:
|
|
295
|
+
|
|
296
|
+
def formatter(response):
|
|
297
|
+
return np.load(io.BytesIO(response.content))
|
|
298
|
+
elif key in {"confidence", "affinity"}:
|
|
299
|
+
|
|
300
|
+
def formatter(response):
|
|
301
|
+
return response.json()
|
|
302
|
+
else:
|
|
303
|
+
raise ValueError(f"Unexpected key: {key}")
|
|
304
|
+
endpoint = PATH_PREFIX + f"/{job_id}/results/{key}"
|
|
305
|
+
try:
|
|
306
|
+
response = session.get(endpoint)
|
|
307
|
+
except HTTPError as e:
|
|
308
|
+
if e.status_code == 400 and key == "affinity":
|
|
309
|
+
raise ValueError("affinity not found for request") from None
|
|
310
|
+
raise e
|
|
311
|
+
return formatter(response)
|
|
312
|
+
|
|
313
|
+
|
|
229
314
|
def fold_models_post(
|
|
230
315
|
session: APISession,
|
|
231
316
|
model_id: str,
|
|
@@ -139,13 +139,19 @@ def resolve_templates(session: APISession, templates: Sequence[Template]) -> lis
|
|
|
139
139
|
query=template.template
|
|
140
140
|
)
|
|
141
141
|
|
|
142
|
-
template_dict = {"query_id": struct_id_to_query_id[struct_id]}
|
|
142
|
+
template_dict: dict = {"query_id": struct_id_to_query_id[struct_id]}
|
|
143
143
|
if template.mapping is not None:
|
|
144
144
|
if isinstance(template.mapping, str):
|
|
145
145
|
template_dict["chain_id"] = template.mapping
|
|
146
146
|
else:
|
|
147
147
|
template_dict["chain_id"] = list(template.mapping.values())
|
|
148
148
|
template_dict["template_id"] = list(template.mapping.keys())
|
|
149
|
+
if template.index is not None:
|
|
150
|
+
template_dict["index"] = list(template.index)
|
|
151
|
+
if template.index_intervals is not None:
|
|
152
|
+
template_dict["index_intervals"] = [
|
|
153
|
+
[int(start), int(end)] for start, end in template.index_intervals
|
|
154
|
+
]
|
|
149
155
|
template_dicts.append(template_dict)
|
|
150
156
|
|
|
151
157
|
return template_dicts
|
|
@@ -199,19 +205,17 @@ def serialize_input(session: APISession, complexes: list[Complex], needs_msa: bo
|
|
|
199
205
|
p["msa_id"] = msa_id
|
|
200
206
|
_complex.append({"protein": p})
|
|
201
207
|
elif isinstance(chain, Ligand):
|
|
202
|
-
ligand_payload = {
|
|
203
|
-
"id": chain_id,
|
|
204
|
-
}
|
|
208
|
+
ligand_payload: dict[str, Any] = {"id": chain_id}
|
|
205
209
|
if chain.smiles is not None:
|
|
206
210
|
ligand_payload["smiles"] = chain.smiles
|
|
207
211
|
if chain.ccd is not None:
|
|
208
212
|
ligand_payload["ccd"] = chain.ccd
|
|
209
213
|
_complex.append({"ligand": ligand_payload})
|
|
210
214
|
elif isinstance(chain, DNA):
|
|
211
|
-
d = {"id": chain_id, "sequence": chain.sequence}
|
|
215
|
+
d: dict[str, Any] = {"id": chain_id, "sequence": chain.sequence}
|
|
212
216
|
_complex.append({"dna": d})
|
|
213
217
|
elif isinstance(chain, RNA):
|
|
214
|
-
r = {"id": chain_id, "sequence": chain.sequence}
|
|
218
|
+
r: dict[str, Any] = {"id": chain_id, "sequence": chain.sequence}
|
|
215
219
|
_complex.append({"rna": r})
|
|
216
220
|
else:
|
|
217
221
|
raise ValueError(f"Unexpected chain type: {chain}")
|