BALM
1.0.0
이 저장소에는 바이오에서 영감을 얻은 항체 언어 모델을 사용한 항체 기능 및 구조의 정확한 예측을 위한 추론 코드가 포함되어 있습니다. 
conda env create -f environment.yml
conda activate BALM
BALM의 미리 훈련 된 무게는 Google 드라이브 링크에서 다운로드 할 수 있습니다.
from modeling_balm import BALMForMaskedLM
from ba_position_embedding import get_anarci_pos
from transformers import EsmTokenizer
import torch
# an antibody sequence example
input_seq = "AVQLQESGGGLVQAGGSLRLSCTVSARTSSSHDMGWFRQAPGKEREFVAAISWSGGTTNYVDSVKGRFDISKDNAKNAVYLQMNSLKPEDTAVYYCAAKWRPLRYSDNPSNSDYNYWGQGTQVTVSS"
tokenizer = EsmTokenizer.from_pretrained("./tokenizer/vocab.txt", do_lower_case=False, model_max_length=168)
tokenizer_input = tokenizer(input_seq, truncation=True, padding="max_length", return_tensors="pt")
# generate position_ids
tokenizer_input.update(get_anarci_pos(input_seq))
with torch.no_grad():
# please download from Google drive link before
model = BALMForMaskedLM.from_pretrained("./pretrained-BALM/")
# on CPU device
outputs = model(**tokenizer_input, return_dict=True, output_hidden_states=True, output_attentions=True)
# final hidden layer representation [batch_sz * max_length * hidden_size]
final_hidden_layer = outputs.hidden_states[-1]
# final hidden layer sequence representation [batch_sz * hidden_size]
final_seq_embedding = final_hidden_layer[:, 0, :]
# final layer attention map [batch_sz * num_head * max_length * max_length]
final_attention_map = outputs.attentions[-1]
Balmfold는 1 차 서열을 갖는 항체 3 차 구조를 예측하기 위해 BALM을 기반으로한다. 온라인 서버는 Balmfold Server에서 무료로 사용할 수 있습니다. 그냥 시도해보십시오. :)
우리의 모델이 귀하에게 유용하다고 생각되면 다음과 같이 인용하십시오.
@article{jing2024accurate,
title={Accurate prediction of antibody function and structure using bio-inspired antibody language model},
author={Jing, Hongtai and Gao, Zhengtao and Xu, Sheng and Shen, Tao and Peng, Zhangzhi and He, Shwai and You, Tao and Ye, Shuang and Lin, Wei and Sun, Siqi},
journal={Briefings in Bioinformatics},
volume={25},
number={4},
pages={bbae245},
year={2024},
publisher={Oxford University Press}
}
BALM의 아키텍처 및 사전 훈련 프로세스는 ESM과 포옹 얼굴 모델링 프레임 워크를 기반으로합니다. ESM과 Hugging Face 팀의 작업에 정말 감사합니다.
이 소스 코드는이 소스 트리의 루트 디렉토리에있는 LICENSE 파일에있는 MIT 라이센스에 따라 라이센스가 부여됩니다.