openprotein-python 0.9.0__tar.gz → 0.10.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.9.0 → openprotein_python-0.10.1}/.gitignore +4 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/PKG-INFO +4 -3
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/__init__.py +47 -3
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/align/align.py +2 -2
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/base.py +23 -32
- openprotein_python-0.10.1/openprotein/chains.py +12 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/common/model_metadata.py +4 -4
- openprotein_python-0.10.1/openprotein/common/reduction.py +22 -0
- openprotein_python-0.10.1/openprotein/common/residue_contants.py +75 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/embeddings/future.py +60 -35
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/embeddings/poet2.py +46 -48
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/fold/__init__.py +1 -1
- openprotein_python-0.10.1/openprotein/fold/alphafold2.py +123 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/fold/api.py +115 -23
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/fold/boltz.py +88 -215
- openprotein_python-0.10.1/openprotein/fold/common.py +117 -0
- openprotein_python-0.10.1/openprotein/fold/esmfold.py +79 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/fold/fold.py +2 -2
- openprotein_python-0.10.1/openprotein/fold/future.py +680 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/fold/minifold.py +14 -5
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/fold/models.py +2 -2
- openprotein_python-0.10.1/openprotein/fold/rosettafold3.py +108 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/fold/schemas.py +2 -1
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/jobs/futures.py +86 -36
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/jobs/jobs.py +4 -0
- openprotein_python-0.10.1/openprotein/models/__init__.py +17 -0
- openprotein_python-0.10.1/openprotein/models/foundation/boltzgen.py +319 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/models/foundation/proteinmpnn.py +10 -26
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/models/foundation/rfdiffusion.py +51 -23
- openprotein_python-0.10.1/openprotein/models/structure_generation.py +30 -0
- openprotein_python-0.10.1/openprotein/molecules/__init__.py +4 -0
- openprotein_python-0.10.1/openprotein/molecules/chains.py +222 -0
- openprotein_python-0.10.1/openprotein/molecules/complex.py +374 -0
- openprotein_python-0.10.1/openprotein/molecules/protein.py +1130 -0
- openprotein_python-0.10.1/openprotein/molecules/structure.py +223 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/prompt/api.py +34 -20
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/prompt/models.py +30 -3
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/prompt/prompt.py +30 -4
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/prompt/schemas.py +1 -1
- openprotein_python-0.10.1/openprotein/protein.py +12 -0
- openprotein_python-0.10.1/openprotein/scaffolds.py +8 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/svd/models.py +9 -8
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/umap/models.py +7 -5
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/umap/umap.py +8 -1
- openprotein_python-0.10.1/openprotein/utils/__init__.py +0 -0
- openprotein_python-0.10.1/openprotein/utils/chain_id.py +62 -0
- openprotein_python-0.10.1/openprotein/utils/cif.py +125 -0
- openprotein_python-0.10.1/openprotein/utils/numpy.py +12 -0
- openprotein_python-0.10.1/openprotein/utils/sequence.py +193 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/pyproject.toml +8 -2
- openprotein_python-0.9.0/openprotein/chains.py +0 -88
- openprotein_python-0.9.0/openprotein/common/reduction.py +0 -14
- openprotein_python-0.9.0/openprotein/fold/alphafold2.py +0 -134
- openprotein_python-0.9.0/openprotein/fold/esmfold.py +0 -54
- openprotein_python-0.9.0/openprotein/fold/future.py +0 -591
- openprotein_python-0.9.0/openprotein/fold/rosettafold3.py +0 -148
- openprotein_python-0.9.0/openprotein/models/__init__.py +0 -6
- openprotein_python-0.9.0/openprotein/models/foundation/boltzgen.py +0 -208
- openprotein_python-0.9.0/openprotein/protein.py +0 -632
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/LICENSE.txt +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/README.md +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/_version.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/align/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/align/api.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/align/future.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/align/msa.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/align/schemas.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/align.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/assaydata.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/deprecated/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/deprecated/design.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/deprecated/poet.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/deprecated/predict.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/deprecated/train.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/design.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/designer.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/embedding.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/error.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/fold.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/job.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/predict.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/predictor.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/prompt.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/svd.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/train.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/api/umap.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/deprecated.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/align/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/align/base.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/align/msa.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/align/prompt.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/assaydata.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/deprecated/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/deprecated/design.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/deprecated/poet.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/deprecated/predict.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/deprecated/train.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/design.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/designer.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/embeddings/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/embeddings/base.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/embeddings/esm.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/embeddings/future.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/embeddings/openprotein.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/embeddings/poet.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/embeddings/poet2.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/embeddings/test.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/fold/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/fold/alphafold2.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/fold/base.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/fold/boltz.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/fold/esmfold.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/fold/future.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/futures.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/predict.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/predictor/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/predictor/predict.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/predictor/predictor.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/predictor/validate.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/prompt.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/svd.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/train.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/models/umap.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/align.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/assaydata.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/deprecated/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/deprecated/design.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/deprecated/predict.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/deprecated/train.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/design.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/designer.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/embeddings.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/fold.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/job.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/predict.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/predictor.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/prompt.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/svd.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/train.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/app/services/umap.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/common/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/common/features.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/config.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/csv.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/data/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/data/api.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/data/assaydataset.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/data/data.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/data/schemas.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/design/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/design/api.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/design/design.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/design/future.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/design/schemas.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/embeddings/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/embeddings/api.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/embeddings/embeddings.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/embeddings/esm.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/embeddings/models.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/embeddings/openprotein.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/embeddings/poet.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/embeddings/schemas.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/errors.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/fasta.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/fold/complex.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/jobs/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/jobs/api.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/jobs/schemas.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/models/base.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/models/foundation/boltzgen_schema.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/models/models.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/predictor/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/predictor/api.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/predictor/models.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/predictor/prediction.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/predictor/predictor.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/predictor/schemas.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/predictor/validate.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/prompt/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/align.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/assaydata.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/deprecated/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/deprecated/design.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/deprecated/poet.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/deprecated/predict.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/deprecated/train.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/design.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/designer.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/embeddings.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/features.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/fold.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/job.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/predict.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/predictor.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/prompt.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/svd.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/train.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/schemas/umap.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/svd/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/svd/api.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/svd/schemas.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/svd/svd.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/umap/__init__.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/umap/api.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/umap/schemas.py +0 -0
- {openprotein_python-0.9.0 → openprotein_python-0.10.1}/openprotein/utils/uuid.py +0 -0
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openprotein-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.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
|
|
7
7
|
License-File: LICENSE.txt
|
|
8
8
|
Classifier: Development Status :: 4 - Beta
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Requires-Python: <3.
|
|
11
|
-
Requires-Dist: gemmi<0.8,>=0.
|
|
10
|
+
Requires-Python: <3.15,>=3.10
|
|
11
|
+
Requires-Dist: gemmi<0.8,>=0.6.0
|
|
12
12
|
Requires-Dist: numpy<3,>=1.9
|
|
13
13
|
Requires-Dist: pandas<3,>=2.2.2
|
|
14
14
|
Requires-Dist: pydantic<3,>=2.5
|
|
15
15
|
Requires-Dist: requests<3,>=2.32.3
|
|
16
|
+
Requires-Dist: tomli<3,>=2.3.0
|
|
16
17
|
Requires-Dist: tqdm<5,>=4.66.5
|
|
17
18
|
Description-Content-Type: text/markdown
|
|
18
19
|
|
|
@@ -6,8 +6,8 @@ A pythonic interface for interacting with our cutting-edge protein engineering p
|
|
|
6
6
|
isort:skip_file
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
import
|
|
9
|
+
import os
|
|
10
|
+
from pathlib import Path
|
|
11
11
|
|
|
12
12
|
from openprotein._version import __version__
|
|
13
13
|
from openprotein.data import DataAPI
|
|
@@ -161,4 +161,48 @@ class OpenProtein(APISession):
|
|
|
161
161
|
return self._models
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
connect
|
|
164
|
+
def connect(
|
|
165
|
+
username: str | None = None,
|
|
166
|
+
password: str | None = None,
|
|
167
|
+
backend: str | None = None,
|
|
168
|
+
timeout: int = 180,
|
|
169
|
+
) -> OpenProtein:
|
|
170
|
+
"""
|
|
171
|
+
Connect and create a :py:class:`OpenProtein` session.
|
|
172
|
+
|
|
173
|
+
Parameters
|
|
174
|
+
----------
|
|
175
|
+
username : str, optional
|
|
176
|
+
The username of the user. If not provided, taken from the
|
|
177
|
+
environment variable ``OPENPROTEIN_USERNAME`` or a
|
|
178
|
+
configuration file at ``~/.openprotein/config.toml``.
|
|
179
|
+
password : str, optional
|
|
180
|
+
The password of the user. If not provided, taken from the
|
|
181
|
+
environment variable ``OPENPROTEIN_PASSWORD`` or a
|
|
182
|
+
configuration file at ``~/.openprotein/config.toml``.
|
|
183
|
+
|
|
184
|
+
Examples
|
|
185
|
+
--------
|
|
186
|
+
>>> session = openprotein.connect("username", "password")
|
|
187
|
+
"""
|
|
188
|
+
|
|
189
|
+
CREDENTIALS_FILE_PATH = Path.home() / ".openprotein/config.toml"
|
|
190
|
+
if CREDENTIALS_FILE_PATH.exists():
|
|
191
|
+
import tomli
|
|
192
|
+
|
|
193
|
+
with open(CREDENTIALS_FILE_PATH, "rb") as f:
|
|
194
|
+
file_config = tomli.load(f)
|
|
195
|
+
else:
|
|
196
|
+
file_config = {}
|
|
197
|
+
USERNAME = os.getenv("OPENPROTEIN_USERNAME", str(file_config.get("username")))
|
|
198
|
+
PASSWORD = os.getenv("OPENPROTEIN_PASSWORD", str(file_config.get("password")))
|
|
199
|
+
BACKEND = os.getenv(
|
|
200
|
+
"OPENPROTEIN_API_BACKEND",
|
|
201
|
+
file_config.get("backend", "https://api.openprotein.ai/api/"),
|
|
202
|
+
)
|
|
203
|
+
return OpenProtein(
|
|
204
|
+
username=username or USERNAME,
|
|
205
|
+
password=password or PASSWORD,
|
|
206
|
+
backend=backend or BACKEND,
|
|
207
|
+
timeout=timeout,
|
|
208
|
+
)
|
|
@@ -7,7 +7,7 @@ from typing import BinaryIO, Iterator
|
|
|
7
7
|
from openprotein.base import APISession
|
|
8
8
|
from openprotein.errors import DeprecationError
|
|
9
9
|
from openprotein.jobs import Job
|
|
10
|
-
from openprotein.
|
|
10
|
+
from openprotein.molecules import Protein
|
|
11
11
|
|
|
12
12
|
from . import api
|
|
13
13
|
from .msa import MSAFuture
|
|
@@ -285,7 +285,7 @@ class AlignAPI:
|
|
|
285
285
|
session=self.session, job=api.msa_post(self.session, msa_file=msa_file)
|
|
286
286
|
)
|
|
287
287
|
|
|
288
|
-
def create_msa(self, seed: bytes) -> MSAFuture:
|
|
288
|
+
def create_msa(self, seed: bytes | str) -> MSAFuture:
|
|
289
289
|
"""
|
|
290
290
|
Construct an MSA via homology search with the seed sequence.
|
|
291
291
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import os
|
|
2
1
|
import sys
|
|
3
2
|
import warnings
|
|
4
|
-
from
|
|
5
|
-
from typing import Union
|
|
3
|
+
from typing import Mapping, Sequence
|
|
6
4
|
from urllib.parse import urljoin
|
|
7
5
|
|
|
8
6
|
import requests
|
|
@@ -13,10 +11,6 @@ from requests.packages.urllib3.util.retry import Retry # type: ignore
|
|
|
13
11
|
import openprotein.config as config
|
|
14
12
|
from openprotein.errors import APIError, AuthError, HTTPError
|
|
15
13
|
|
|
16
|
-
USERNAME = os.getenv("OPENPROTEIN_USERNAME")
|
|
17
|
-
PASSWORD = os.getenv("OPENPROTEIN_PASSWORD")
|
|
18
|
-
BACKEND = os.getenv("OPENPROTEIN_API_BACKEND", "https://api.openprotein.ai/api/")
|
|
19
|
-
|
|
20
14
|
|
|
21
15
|
class BearerAuth(requests.auth.AuthBase):
|
|
22
16
|
"""
|
|
@@ -34,29 +28,18 @@ class BearerAuth(requests.auth.AuthBase):
|
|
|
34
28
|
class APISession(requests.Session):
|
|
35
29
|
"""
|
|
36
30
|
A class to handle API sessions. This class provides a connection session to the OpenProtein API.
|
|
37
|
-
|
|
38
|
-
Parameters
|
|
39
|
-
----------
|
|
40
|
-
username : str
|
|
41
|
-
The username of the user.
|
|
42
|
-
password : str
|
|
43
|
-
The password of the user.
|
|
44
|
-
|
|
45
|
-
Examples
|
|
46
|
-
--------
|
|
47
|
-
>>> session = APISession("username", "password")
|
|
48
31
|
"""
|
|
49
32
|
|
|
50
33
|
def __init__(
|
|
51
34
|
self,
|
|
52
|
-
username: str
|
|
53
|
-
password: str
|
|
54
|
-
backend: str
|
|
35
|
+
username: str,
|
|
36
|
+
password: str,
|
|
37
|
+
backend: str,
|
|
55
38
|
timeout: int = 180,
|
|
56
39
|
):
|
|
57
40
|
if not username or not password:
|
|
58
41
|
raise AuthError(
|
|
59
|
-
"Expected username and password. Or use environment variables `OPENPROTEIN_USERNAME` and `OPENPROTEIN_PASSWORD`"
|
|
42
|
+
"Expected username and password. Or use environment variables `OPENPROTEIN_USERNAME` and `OPENPROTEIN_PASSWORD`. Or provide these variables (`username` and `password`) in ~/.openprotein/config.toml."
|
|
60
43
|
)
|
|
61
44
|
super().__init__()
|
|
62
45
|
self.backend = backend
|
|
@@ -132,7 +115,7 @@ class APISession(requests.Session):
|
|
|
132
115
|
response = super().request(method, full_url, *args, **kwargs)
|
|
133
116
|
|
|
134
117
|
if (js := kwargs.get("json")) and js is not None:
|
|
135
|
-
if
|
|
118
|
+
if _total_size(js) > 1e6:
|
|
136
119
|
warnings.warn(
|
|
137
120
|
"The requested payload is >1MB. There might be some delays or issues in processing. If the request fails, please try again with smaller sizes."
|
|
138
121
|
)
|
|
@@ -153,7 +136,7 @@ class APISession(requests.Session):
|
|
|
153
136
|
return response
|
|
154
137
|
|
|
155
138
|
|
|
156
|
-
def
|
|
139
|
+
def _total_size(o: Sequence | Mapping, seen=None):
|
|
157
140
|
"""Recursively finds size of objects including contents."""
|
|
158
141
|
if seen is None:
|
|
159
142
|
seen = set()
|
|
@@ -163,19 +146,27 @@ def total_size(o, seen=None):
|
|
|
163
146
|
seen.add(obj_id)
|
|
164
147
|
size = sys.getsizeof(o)
|
|
165
148
|
if isinstance(o, dict):
|
|
166
|
-
size += sum((
|
|
149
|
+
size += sum((_total_size(k, seen) + _total_size(v, seen)) for k, v in o.items())
|
|
167
150
|
elif isinstance(o, (list, tuple, set, frozenset)):
|
|
168
|
-
size += sum(
|
|
151
|
+
size += sum(_total_size(i, seen) for i in o)
|
|
169
152
|
return size
|
|
170
153
|
|
|
171
154
|
|
|
172
|
-
class RestEndpoint:
|
|
173
|
-
pass
|
|
174
|
-
|
|
175
|
-
|
|
176
155
|
class TimeoutError(requests.exceptions.HTTPError):
|
|
177
|
-
|
|
156
|
+
"""
|
|
157
|
+
An Exception raised due to timeout, possibly from overly large
|
|
158
|
+
requests.
|
|
159
|
+
"""
|
|
178
160
|
|
|
179
161
|
|
|
180
162
|
class CloudFrontError(requests.exceptions.HTTPError):
|
|
181
|
-
|
|
163
|
+
"""
|
|
164
|
+
An Exception raised due to CloudFront.
|
|
165
|
+
|
|
166
|
+
This is usually due to the strict timeout from CloudFront.
|
|
167
|
+
AWS CloudFront limits responses to return within 2 minutes.
|
|
168
|
+
This can be a bit prohibitive for our system that tends to
|
|
169
|
+
deal with large data. It is usually safe to just ignore/retry upon
|
|
170
|
+
hitting this error. Our system will scale up and still handle
|
|
171
|
+
the job.
|
|
172
|
+
"""
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
|
|
3
|
+
warnings.warn(
|
|
4
|
+
"openprotein.chains is deprecated and will be removed in v0.11. "
|
|
5
|
+
"Use `from openprotein.molecules import DNA, RNA, Ligand` instead.",
|
|
6
|
+
FutureWarning,
|
|
7
|
+
stacklevel=2,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from openprotein.molecules import DNA, RNA, Ligand
|
|
11
|
+
|
|
12
|
+
__all__ = ["DNA", "RNA", "Ligand"]
|
|
@@ -26,8 +26,8 @@ class ModelMetadata(BaseModel):
|
|
|
26
26
|
id: str = Field(..., alias="model_id")
|
|
27
27
|
description: ModelDescription
|
|
28
28
|
max_sequence_length: int | None = None
|
|
29
|
-
dimension: int
|
|
30
|
-
output_types: list[str]
|
|
31
|
-
input_tokens: list[str] | None
|
|
29
|
+
dimension: int | None = None
|
|
30
|
+
output_types: list[str] | None = None
|
|
31
|
+
input_tokens: list[str] | None = None
|
|
32
32
|
output_tokens: list[str] | None = None
|
|
33
|
-
token_descriptions: list[list[TokenInfo]]
|
|
33
|
+
token_descriptions: list[list[TokenInfo]] | None = None
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Reduction types used in OpenProtein."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from typing import Literal
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ReductionType(str, Enum):
|
|
8
|
+
"""
|
|
9
|
+
ReductionType is an enumeration of the possible reduction types available.
|
|
10
|
+
|
|
11
|
+
Attributes:
|
|
12
|
+
MEAN : Mean reduction takes the mean of the embeddings across the sequence length dimension.
|
|
13
|
+
SUM : Sum reduction takes the sum of the embeddings across the sequence length dimension.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
MEAN = "MEAN"
|
|
17
|
+
SUM = "SUM"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# NOTE: only works with python 3.12+
|
|
21
|
+
# Reduction = Literal[*tuple([r.value for r in ReductionType])]
|
|
22
|
+
Reduction = Literal["MEAN", "SUM"]
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# fmt: off
|
|
2
|
+
residue_atoms = {
|
|
3
|
+
"ALA": ["C", "CA", "CB", "N", "O"],
|
|
4
|
+
"ARG": ["C", "CA", "CB", "CG", "CD", "CZ", "N", "NE", "O", "NH1", "NH2"],
|
|
5
|
+
"ASP": ["C", "CA", "CB", "CG", "N", "O", "OD1", "OD2"],
|
|
6
|
+
"ASN": ["C", "CA", "CB", "CG", "N", "ND2", "O", "OD1"],
|
|
7
|
+
"CYS": ["C", "CA", "CB", "N", "O", "SG"],
|
|
8
|
+
"GLU": ["C", "CA", "CB", "CG", "CD", "N", "O", "OE1", "OE2"],
|
|
9
|
+
"GLN": ["C", "CA", "CB", "CG", "CD", "N", "NE2", "O", "OE1"],
|
|
10
|
+
"GLY": ["C", "CA", "N", "O"],
|
|
11
|
+
"HIS": ["C", "CA", "CB", "CG", "CD2", "CE1", "N", "ND1", "NE2", "O"],
|
|
12
|
+
"ILE": ["C", "CA", "CB", "CG1", "CG2", "CD1", "N", "O"],
|
|
13
|
+
"LEU": ["C", "CA", "CB", "CG", "CD1", "CD2", "N", "O"],
|
|
14
|
+
"LYS": ["C", "CA", "CB", "CG", "CD", "CE", "N", "NZ", "O"],
|
|
15
|
+
"MET": ["C", "CA", "CB", "CG", "CE", "N", "O", "SD"],
|
|
16
|
+
"PHE": ["C", "CA", "CB", "CG", "CD1", "CD2", "CE1", "CE2", "CZ", "N", "O"],
|
|
17
|
+
"PRO": ["C", "CA", "CB", "CG", "CD", "N", "O"],
|
|
18
|
+
"SER": ["C", "CA", "CB", "N", "O", "OG"],
|
|
19
|
+
"THR": ["C", "CA", "CB", "CG2", "N", "O", "OG1"],
|
|
20
|
+
"TRP": [
|
|
21
|
+
"C",
|
|
22
|
+
"CA",
|
|
23
|
+
"CB",
|
|
24
|
+
"CG",
|
|
25
|
+
"CD1",
|
|
26
|
+
"CD2",
|
|
27
|
+
"CE2",
|
|
28
|
+
"CE3",
|
|
29
|
+
"CZ2",
|
|
30
|
+
"CZ3",
|
|
31
|
+
"CH2",
|
|
32
|
+
"N",
|
|
33
|
+
"NE1",
|
|
34
|
+
"O",
|
|
35
|
+
],
|
|
36
|
+
"TYR": [
|
|
37
|
+
"C",
|
|
38
|
+
"CA",
|
|
39
|
+
"CB",
|
|
40
|
+
"CG",
|
|
41
|
+
"CD1",
|
|
42
|
+
"CD2",
|
|
43
|
+
"CE1",
|
|
44
|
+
"CE2",
|
|
45
|
+
"CZ",
|
|
46
|
+
"N",
|
|
47
|
+
"O",
|
|
48
|
+
"OH",
|
|
49
|
+
],
|
|
50
|
+
"VAL": ["C", "CA", "CB", "CG1", "CG2", "N", "O"],
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
restype_1to3 = {
|
|
54
|
+
"A": "ALA",
|
|
55
|
+
"R": "ARG",
|
|
56
|
+
"N": "ASN",
|
|
57
|
+
"D": "ASP",
|
|
58
|
+
"C": "CYS",
|
|
59
|
+
"Q": "GLN",
|
|
60
|
+
"E": "GLU",
|
|
61
|
+
"G": "GLY",
|
|
62
|
+
"H": "HIS",
|
|
63
|
+
"I": "ILE",
|
|
64
|
+
"L": "LEU",
|
|
65
|
+
"K": "LYS",
|
|
66
|
+
"M": "MET",
|
|
67
|
+
"F": "PHE",
|
|
68
|
+
"P": "PRO",
|
|
69
|
+
"S": "SER",
|
|
70
|
+
"T": "THR",
|
|
71
|
+
"W": "TRP",
|
|
72
|
+
"Y": "TYR",
|
|
73
|
+
"V": "VAL",
|
|
74
|
+
}
|
|
75
|
+
# fmt: on
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Future for embeddings-related jobs."""
|
|
2
2
|
|
|
3
3
|
from collections import namedtuple
|
|
4
|
-
from typing import Any, Generator
|
|
4
|
+
from typing import Any, Generator, Iterator, TypeVar, Union
|
|
5
5
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
|
|
@@ -25,7 +25,7 @@ from .schemas import (
|
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
class EmbeddingsResultFuture(MappedFuture,
|
|
28
|
+
class EmbeddingsResultFuture(MappedFuture[bytes, np.ndarray]):
|
|
29
29
|
"""Future for manipulating results for embeddings-related requests."""
|
|
30
30
|
|
|
31
31
|
job: EmbeddingsJob | AttnJob | LogitsJob
|
|
@@ -45,17 +45,17 @@ class EmbeddingsResultFuture(MappedFuture, Future):
|
|
|
45
45
|
else sequences
|
|
46
46
|
)
|
|
47
47
|
|
|
48
|
-
def stream_sync(self)
|
|
48
|
+
def stream_sync(self):
|
|
49
|
+
"""
|
|
50
|
+
Stream the embeddings results synchronously using the streaming endpoint.
|
|
51
|
+
"""
|
|
49
52
|
for i, array in enumerate(
|
|
50
53
|
api.request_get_embeddings_stream(session=self.session, job_id=self.id)
|
|
51
54
|
):
|
|
52
55
|
yield self.sequences[i], array
|
|
53
56
|
|
|
54
|
-
def get(self, verbose: bool = False) -> list[tuple[str | bytes, np.ndarray]]:
|
|
55
|
-
return super().get(verbose=verbose)
|
|
56
|
-
|
|
57
57
|
@property
|
|
58
|
-
def sequences(self)
|
|
58
|
+
def sequences(self):
|
|
59
59
|
if self._sequences is None:
|
|
60
60
|
self._sequences = api.get_request_sequences(
|
|
61
61
|
session=self.session, job_id=self.job.job_id, job_type=self.job.job_type
|
|
@@ -82,7 +82,7 @@ class EmbeddingsResultFuture(MappedFuture, Future):
|
|
|
82
82
|
Get embedding results for specified sequence.
|
|
83
83
|
|
|
84
84
|
Args:
|
|
85
|
-
sequence (bytes): sequence to fetch results for
|
|
85
|
+
sequence (str | bytes): sequence to fetch results for
|
|
86
86
|
|
|
87
87
|
Returns:
|
|
88
88
|
np.ndarray: embeddings
|
|
@@ -96,10 +96,13 @@ class EmbeddingsResultFuture(MappedFuture, Future):
|
|
|
96
96
|
return api.result_decode(data)
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
Score = namedtuple("Score", ["name", "sequence", "score"])
|
|
100
|
+
SingleSiteScore = namedtuple("SingleSiteScore", ["mut_code", "score"])
|
|
101
|
+
S = TypeVar("S", bound=Union[Score, SingleSiteScore])
|
|
102
|
+
|
|
101
103
|
|
|
102
|
-
|
|
104
|
+
class BaseScoreFuture(StreamingFuture[S]):
|
|
105
|
+
"""Future for manipulating results for embeddings score-related requests."""
|
|
103
106
|
|
|
104
107
|
def __init__(
|
|
105
108
|
self,
|
|
@@ -108,45 +111,67 @@ class EmbeddingsScoreFuture(StreamingFuture, Future):
|
|
|
108
111
|
sequences: list[bytes] | list[str] | None = None,
|
|
109
112
|
):
|
|
110
113
|
super().__init__(session=session, job=job)
|
|
111
|
-
|
|
114
|
+
# ensure all list[bytes]
|
|
115
|
+
self._sequences = (
|
|
116
|
+
[seq.encode() if isinstance(seq, str) else seq for seq in sequences]
|
|
117
|
+
if sequences is not None
|
|
118
|
+
else sequences
|
|
119
|
+
)
|
|
112
120
|
|
|
113
121
|
@property
|
|
114
|
-
def sequences(self) -> list[bytes]
|
|
122
|
+
def sequences(self) -> list[bytes]:
|
|
115
123
|
if self._sequences is None:
|
|
116
124
|
self._sequences = api.get_request_sequences(self.session, self.job.job_id)
|
|
117
125
|
return self._sequences
|
|
118
126
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
# mut_code, ... for ssp
|
|
130
|
-
# name, sequence, ... for score
|
|
131
|
-
header = next(stream)
|
|
132
|
-
score_start_index = 0
|
|
133
|
-
for i, col_name in enumerate(header):
|
|
134
|
-
if col_name.startswith("score"):
|
|
135
|
-
score_start_index = i
|
|
136
|
-
break
|
|
137
|
-
Score = namedtuple("Score", header[:score_start_index] + ["score"])
|
|
127
|
+
|
|
128
|
+
class EmbeddingsScoreFuture(BaseScoreFuture[Score]):
|
|
129
|
+
"""Future for manipulating results for embeddings score-related requests."""
|
|
130
|
+
|
|
131
|
+
job: ScoreJob | ScoreIndelJob
|
|
132
|
+
|
|
133
|
+
def stream(self) -> Iterator[Score]:
|
|
134
|
+
stream = api.request_get_score_result(session=self.session, job_id=self.id)
|
|
135
|
+
# name, sequence, ...
|
|
136
|
+
next(stream) # ignore header
|
|
138
137
|
for line in stream:
|
|
139
138
|
# combine scores into numpy array
|
|
140
|
-
scores = np.array([float(s) for s in line[
|
|
141
|
-
output = Score(
|
|
139
|
+
scores = np.array([float(s) for s in line[2:]])
|
|
140
|
+
output = Score(name=line[0], sequence=line[1], score=scores)
|
|
142
141
|
yield output
|
|
143
142
|
|
|
144
143
|
|
|
145
|
-
class
|
|
144
|
+
class EmbeddingsScoreSingleSiteFuture(BaseScoreFuture[SingleSiteScore]):
|
|
145
|
+
"""Future for manipulating results for embeddings score-related requests."""
|
|
146
|
+
|
|
147
|
+
job: ScoreSingleSiteJob
|
|
148
|
+
|
|
149
|
+
def stream(self) -> Iterator[SingleSiteScore]:
|
|
150
|
+
stream = api.request_get_score_result(session=self.session, job_id=self.id)
|
|
151
|
+
# name, sequence, ...
|
|
152
|
+
next(stream) # ignore header
|
|
153
|
+
for line in stream:
|
|
154
|
+
# combine scores into numpy array
|
|
155
|
+
scores = np.array([float(s) for s in line[1:]])
|
|
156
|
+
output = SingleSiteScore(mut_code=line[0], score=scores)
|
|
157
|
+
yield output
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
class EmbeddingsGenerateFuture(BaseScoreFuture[Score]):
|
|
146
161
|
"""Future for manipulating results for embeddings generate-related requests."""
|
|
147
162
|
|
|
148
163
|
job: GenerateJob
|
|
149
164
|
|
|
165
|
+
def stream(self) -> Iterator[Score]:
|
|
166
|
+
stream = api.request_get_generate_result(session=self.session, job_id=self.id)
|
|
167
|
+
# name, sequence, ...
|
|
168
|
+
next(stream) # ignore header
|
|
169
|
+
for line in stream:
|
|
170
|
+
# combine scores into numpy array
|
|
171
|
+
scores = np.array([float(s) for s in line[2:]])
|
|
172
|
+
output = Score(name=line[0], sequence=line[1], score=scores)
|
|
173
|
+
yield output
|
|
174
|
+
|
|
150
175
|
@property
|
|
151
176
|
def sequences(self):
|
|
152
177
|
raise Exception("generate job does not support listing sequences")
|