AI prompts
base on # AlphaMissense
This package provides the AlphaMissense model implementation. This implementation is provided for reference alongside the [AlphaMissense 2023 publication](https://www.science.org/doi/10.1126/science.adg7492) and will not be actively maintained moving forward.
We forked the [AlphaFold repository](https://github.com/google-deepmind/alphafold/tree/v2.3.2) and modified it to implement AlphaMissense.
What we provide:
* Detailed implementation of the AlphaMissense model and training losses ([modules_missense.py](https://github.com/deepmind/alphamissense/blob/main/alphamissense/model/modules_missense.py))
* The data pipeline to create input features for inference ([pipeline_missense.py](https://github.com/deepmind/alphamissense/blob/main/alphamissense/data/pipeline_missense.py)). The data pipeline requires access to genetic databases for multiple sequence alignments and, if using spatial cropping, protein structures of the AlphaFold Database hosted in Google Cloud Storage. Please see the section for genetic databases and [AFDB readme file](https://github.com/deepmind/alphafold/tree/main/afdb)) to learn how to access these datasets.
* Pre-computed predictions for all possible human amino acid substitutions and missense variants ([hosted here](https://console.cloud.google.com/storage/browser/dm_alphamissense)).
What we don’t provide:
* The trained AlphaMissense model weights.
## Access AlphaMissense predictions:
Predictions for human major transcripts and isoforms are provided [here](https://console.cloud.google.com/storage/browser/dm_alphamissense).
You can use these files with the Ensembl VEP tool and [AlphaMissense plug-in](https://www.ensembl.org/info/docs/tools/vep/script/vep_plugins.html).
## Installation
1. Install all dependencies:
```bash
sudo apt install python3.11-venv aria2 hmmer
```
2. Clone this repository and `cd` into it.
```bash
git clone https://github.com/deepmind/alphamissense.git
cd ./alphamissense
```
3. Set up a Python virtual environment and install the Python dependencies:
```bash
python3 -m venv ./venv
venv/bin/pip install -r requirements.txt
venv/bin/pip install -e .
```
4. Test the installation
```bash
venv/bin/python test/test_installation.py
```
## Usage
Because we are not releasing the trained model weights, the code is not meant to be used for making new predictions, but serve as an implementation reference. We are releasing the data pipeline, model and loss function code.
The data pipeline requires a FASTA file (i.e. `protein_sequence_file`) which should contain all target sequences, and the genetic sequence databases outlined in the next section.
```python
from alphamissense.data import pipeline_missense
protein_sequence_file = ...
pipeline = pipeline_missense.DataPipeline(
jackhmmer_binary_path=..., # Typically '/usr/bin/jackhmmer'.
protein_sequence_file=protein_sequence_file,
uniref90_database_path=DATABASES_DIR + '/uniref90/uniref90.fasta',
mgnify_database_path=DATABASES_DIR + '/mgnify/mgy_clusters_2022_05.fa',
small_bfd_database_path=DATABASES_DIR + '/small_bfd/bfd-first_non_consensus_sequences.fasta',
)
sample = pipeline.process(
protein_id=..., # Sequence identifier in the FASTA file.
reference_aa=..., # Single capital letter, e.g. 'A'.
alternate_aa=...,
position=..., # Integer, note that the position is 1-based!
msa_output_dir=msa_output_dir,
)
```
The model is implemented as a JAX module and can be instantiated for example as:
```python
from alphamissense.model import config
from alphamissense.model import modules_missense
def _forward_fn(batch):
model = modules_missense.AlphaMissense(config.model_config().model)
return model(batch, is_training=False, return_representations=False)
random_seed = 0
prng = jax.random.PRNGKey(random_seed)
params = hk.transform(_forward_fn).init(prng, sample)
apply = jax.jit(hk.transform(_forward_fn).apply)
output = apply(params, prng, sample)
```
For example, at this point the score of the variant would be stored in `output['logit_diff']['variant_pathogenicity']`.
## Genetic databases
AlphaMissense used multiple genetic (sequence) databases for multiple sequence alignments:
* [BFD](https://bfd.mmseqs.com/),
* [MGnify](https://www.ebi.ac.uk/metagenomics/),
* [UniRef90](https://www.uniprot.org/help/uniref).
We refer to the [AlphaFold repository](https://github.com/deepmind/alphafold) for instructions on how to download these databases.
## Citing this work
Any publication that discloses findings arising from using this source code should cite:
```bibtex
@article {AlphaMissense2023,
author = {Jun Cheng, Guido Novati, Joshua Pan, Clare Bycroft, Akvilė Žemgulytė, Taylor Applebaum, Alexander Pritzel, Lai Hong Wong, Michal Zielinski, Tobias Sargeant, Rosalia G. Schneider, Andrew W. Senior, John Jumper, Demis Hassabis, Pushmeet Kohli, Žiga Avsec},
journal = {Science},
title = {Accurate proteome-wide missense variant effect prediction with AlphaMissense},
year = {2023},
doi = {10.1126/science.adg7492},
URL = {https://www.science.org/doi/10.1126/science.adg7492},
}
```
## Acknowledgements
AlphaMissense communicates with and/or references the following separate libraries and packages:
* Abseil
* Biopython
* HMMER Suite
* Haiku
* Immutabledict
* JAX
* Matplotlib
* NumPy
* Pandas
* SciPy
* Tree
* Zstandard
We thank all their contributors and maintainers!
## License and Disclaimer
This is not an officially supported Google product.
The AlphaMissense Database contains predictions with varying levels of confidence, caution should be exercised in use. The information provided is not intended to be a substitute for professional medical advice, diagnosis, or treatment, and does not constitute medical or other professional advice. AlphaMisense has not been validated for, and is not approved for, any clinical use.
Copyright 2023 DeepMind Technologies Limited.
### AlphaMissense Code License
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
### AlphaMissense predictions License
AlphaMissense predictions are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0) (“CC License”). You may obtain a copy of the CC License at https://creativecommons.org/licenses/by/4.0/legalcode.
### Third-party software
Use of the third-party software, libraries or code referred to in the [Acknowledgements](#acknowledgements) section above may be governed by separate terms and conditions or license provisions. Your use of the third-party software, libraries or code is subject to any such terms and you should check that you can comply with any applicable restrictions or terms and conditions before use.
", Assign "at most 3 tags" to the expected json: {"id":"2183","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"