Views
No views yet
H (helix), E (strand) or C (coil). The model was developed by Ahmed Elnaggar et al. and more information can be found on the GitHub repository and in the accompanying paper. This repository is a fork of their HuggingFace repository.
This model is trained on uppercase amino acids: it only works with capital letter amino acids.1from transformers import AutoTokenizer, AutoModelForTokenClassification, TokenClassificationPipeline
2import re
3
4pipeline = TokenClassificationPipeline(
5 model=AutoModelForTokenClassification.from_pretrained("virtual-human-chc/prot_bert_bfd_ss3"),
6 tokenizer=AutoTokenizer.from_pretrained("virtual-human-chc/prot_bert_bfd_ss3", skip_special_tokens=True),
7 device=0
8)
9
10sequences_example = ["MGAEEEDTAILYPFTISGNDRNGNFTINFKGTPNSTNNGCIGYSYNGDWEKIEWEGSCDGNGNLVVEVPMSKIPAGVTSGEIQIWWHSGDLKMTDYKALEHHHHHH",
11 "MNKYLFELPYERSEPGWTIRSYFDLMYNENRFLDAVENIVNKESYILDGIYCNFPDMNSYDESEHFEGVEFAVGYPPDEDDIVIVSEETCFEYVRLACEKYLQLHPEDTEKVNKLLSKIPSAGHHHHHH"]
12
13sequence_examples = [" ".join(list(re.sub(r"[UZOB]", "X", sequence))) for sequence in sequence_examples]
14
15print(pipeline(sequences_example))["PRTEINO"]entity, score, index, word, start, end. entity is the predicted secondary structure, score is the confidence of the model about the prediction, index is the position of the residue in the sequence. word is the residue, which the prediction is made. start and end again idetify the position of the residue. Example for a single residue: [[{'entity': 'C', 'score': np.float32(0.9825784), 'index': 1, 'word': 'M', 'start': 0, 'end': 1}]].