Instructions to use multimolecule/rnabert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MultiMolecule
How to use multimolecule/rnabert with MultiMolecule:
pip install multimolecule
from multimolecule import AutoModel, AutoTokenizer tokenizer = AutoTokenizer.from_pretrained("multimolecule/rnabert") model = AutoModel.from_pretrained("multimolecule/rnabert") inputs = tokenizer("UAGCUUAUCAGACUGAUGUUGA", return_tensors="pt") outputs = model(**inputs) embeddings = outputs.last_hidden_stateimport multimolecule from transformers import pipeline predictor = pipeline("fill-mask", model="multimolecule/rnabert") output = predictor("UAGCUUAUCAG<mask>CUGAUGUUGA") - Notebooks
- Google Colab
- Kaggle
| datasets: | |
| - multimolecule/rnacentral | |
| library_name: multimolecule | |
| license: agpl-3.0 | |
| mask_token: <mask> | |
| pipeline_tag: fill-mask | |
| tags: | |
| - Biology | |
| - RNA | |
| - ncRNA | |
| - rna | |
| widget: | |
| - example_title: microRNA 21 | |
| mask_index: 11 | |
| mask_index_1based: 12 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035777 | |
| - label: '|' | |
| score: 0.035764 | |
| - label: '*' | |
| score: 0.03576 | |
| - label: <unk> | |
| score: 0.035756 | |
| - label: <cls> | |
| score: 0.03575 | |
| pipeline_tag: fill-mask | |
| sequence_type: ncRNA | |
| task: fill-mask | |
| text: UAGCUUAUCAG<mask>CUGAUGUUGA | |
| - example_title: microRNA 146a | |
| mask_index: 10 | |
| mask_index_1based: 11 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035803 | |
| - label: '*' | |
| score: 0.035778 | |
| - label: <cls> | |
| score: 0.035771 | |
| - label: '|' | |
| score: 0.035765 | |
| - label: '?' | |
| score: 0.035745 | |
| pipeline_tag: fill-mask | |
| sequence_type: ncRNA | |
| task: fill-mask | |
| text: UGAGAACUGA<mask>UUCCAUGGGUU | |
| - example_title: microRNA 155 | |
| mask_index: 15 | |
| mask_index_1based: 16 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035797 | |
| - label: '|' | |
| score: 0.035794 | |
| - label: <cls> | |
| score: 0.035773 | |
| - label: '*' | |
| score: 0.03577 | |
| - label: <unk> | |
| score: 0.035731 | |
| pipeline_tag: fill-mask | |
| sequence_type: ncRNA | |
| task: fill-mask | |
| text: UUAAUGCUAAUCGUG<mask>UAGGGGUU | |
| - example_title: RNA component of mitochondrial RNA processing endoribonuclease | |
| mask_index: 11 | |
| mask_index_1based: 12 | |
| masked_char: A | |
| output: | |
| - label: '*' | |
| score: 0.035793 | |
| - label: <null> | |
| score: 0.035782 | |
| - label: I | |
| score: 0.035752 | |
| - label: <unk> | |
| score: 0.035744 | |
| - label: <eos> | |
| score: 0.035741 | |
| pipeline_tag: fill-mask | |
| sequence_type: ncRNA | |
| task: fill-mask | |
| text: GGUUCGUGCUG<mask>AGGCCUGUAUCCUAGGCUACACACUGAGGACUCUGUUCCUCCCCUUUCCGCCUAGGGGAAAGUCCCCGGACCUCGGGCAGAGAGUGCCACGUGCAUACGCACGUAGACAUUCCCCGCUUCCCACUCCAAAGUCCGCCAAGAAGCGUAUCCCGCUGAGCGGCGUGGCGCGGGGGCGUCAUCCGUCAGCUCCCUCUAGUUACGCAGGCAGUGCGUGUCCGCGCACCAACCACACGGGGCUCAUUCUCAGCGCGGCUGUAAAAAAAAA | |
| - example_title: 7SK small nuclear RNA | |
| mask_index: 13 | |
| mask_index_1based: 14 | |
| masked_char: A | |
| output: | |
| - label: <cls> | |
| score: 0.035776 | |
| - label: <null> | |
| score: 0.035756 | |
| - label: '|' | |
| score: 0.035749 | |
| - label: . | |
| score: 0.035743 | |
| - label: '?' | |
| score: 0.035732 | |
| pipeline_tag: fill-mask | |
| sequence_type: ncRNA | |
| task: fill-mask | |
| text: GGAUGUGAGGGCG<mask>UCUGGCUGCGACAUCUGUCACCCCAUUGAUCGCCAGGGUUGAUUCGGCUGAUCUGGCUGGCUAGGCGGGUGUCCCCUUCCUCCCUCACCGCUCCAUGUGCGUCCCUCCCGAAGCUGCGCGCUCGGUCGAAGAGGACGACCAUCCCCGAUAGAGGAGGACCGGUCUUCGGUCAAGGGUAUACGAGUAGCUGCGCUCCCCUGCUAGAACCUCCAAACAAGCUCUCAAGGUCCAUUUGUAGGAGAACGUAGGGUAGUCAAGCUUCCAAGACUCCAGACACAUCCAAAUGAGGCGCUGCAUGUGGCAGUCUGCCUUUCUUUU | |
| - example_title: telomerase RNA component | |
| mask_index: 23 | |
| mask_index_1based: 24 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035805 | |
| - label: <cls> | |
| score: 0.035779 | |
| - label: '|' | |
| score: 0.035775 | |
| - label: <unk> | |
| score: 0.035762 | |
| - label: <eos> | |
| score: 0.035739 | |
| pipeline_tag: fill-mask | |
| sequence_type: ncRNA | |
| task: fill-mask | |
| text: GGGUUGCGGAGGGUGGGCCUGGG<mask>GGGGUGGUGGCCAUUUUUUGUCUAACCCUAACUGAGAAGGGCGUAGGCGCCGUGCUUUUGCUCCCCGCGCGCUGUUUUUCUCGCUGACUUUCAGCGGGCGGAAAAGCCUCGGCCUGCCGCCUUCCACCGUUCAUUCUAGAGCAAACAAAAAAUGUCAGCUGCUGGCCCGUUCGCCCCUCCCGGGGACCUGCGGCGGGUCGCCUGCCCAGCCCCCGAACCCCGCCUGGAGGCCGCGGUCGGCCCGGGGCUUCUCCGGAGGCACCCACUGCCACCGCGAAGAGUUGGGCUCUGUCAGCCGCGGGUCUCUCGGGGGCGAGGGCGAGGUUCAGGCCUUUCAGGCCGCAGGAAGAGGAACGGAGCGAGUCCCCGCGCGCGGCGCGAUUCCCUGAGCUGUGGGACGUGCACCCAGGACUCGGCUCACACAUGC | |
| - example_title: vault RNA 2-1 | |
| mask_index: 12 | |
| mask_index_1based: 13 | |
| masked_char: A | |
| output: | |
| - label: '*' | |
| score: 0.035797 | |
| - label: <null> | |
| score: 0.035778 | |
| - label: <eos> | |
| score: 0.035763 | |
| - label: <cls> | |
| score: 0.035723 | |
| - label: I | |
| score: 0.035718 | |
| pipeline_tag: fill-mask | |
| sequence_type: ncRNA | |
| task: fill-mask | |
| text: CGGGUCGGAGUU<mask>GCUCAAGCGGUUACCUCCUCAUGCCGGACUUUCUAUCUGUCCAUCUCUGUGCUGGGGUUCGAGACCCGCGGGUGCUUACUGACCCUUUUAUGCAA | |
| - example_title: brain cytoplasmic RNA 1 | |
| mask_index: 18 | |
| mask_index_1based: 19 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035795 | |
| - label: '|' | |
| score: 0.035761 | |
| - label: <cls> | |
| score: 0.035739 | |
| - label: <eos> | |
| score: 0.035733 | |
| - label: <unk> | |
| score: 0.035727 | |
| pipeline_tag: fill-mask | |
| sequence_type: ncRNA | |
| task: fill-mask | |
| text: GGCCGGGCGCGGUGGCUC<mask>CGCCUGUAAUCCCAGCUCUCAGGGAGGCUAAGAGGCGGGAGGAUAGCUUGAGCCCAGGAGUUCGAGACCUGCCUGGGCAAUAUAGCGAGACCCCGUUCUCCAGAAAAAGGAAAAAAAAAAACAAAAGACAAAAAAAAAAUAAGCGUAACUUCCCUCAAAGCAACAACCCCCCCCCCCCUUU | |
| - example_title: HIV-1 TAR-WT | |
| mask_index: 13 | |
| mask_index_1based: 14 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035794 | |
| - label: '*' | |
| score: 0.035775 | |
| - label: '|' | |
| score: 0.035741 | |
| - label: <eos> | |
| score: 0.035738 | |
| - label: <unk> | |
| score: 0.035716 | |
| pipeline_tag: fill-mask | |
| sequence_type: ncRNA | |
| task: fill-mask | |
| text: GGUCUCUCUGGUU<mask>GACCAGAUCUGAGCCUGGGAGCUCUCUGGCUAACUAGGGAACC | |
| - example_title: prion protein (Kanno blood group) | |
| mask_index: 21 | |
| mask_index_1based: 22 | |
| masked_char: A | |
| output: | |
| - label: <cls> | |
| score: 0.035799 | |
| - label: <null> | |
| score: 0.035798 | |
| - label: '|' | |
| score: 0.035754 | |
| - label: '*' | |
| score: 0.035751 | |
| - label: <unk> | |
| score: 0.035742 | |
| pipeline_tag: fill-mask | |
| sequence_type: mRNA | |
| task: fill-mask | |
| text: AUGGCGAACCUUGGCUGCUGG<mask>UGCUGGUUCUCUUUGUGGCCACAUGGAGUGACCUGGGCCUCUGC | |
| - example_title: interleukin 10 | |
| mask_index: 11 | |
| mask_index_1based: 12 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035801 | |
| - label: <cls> | |
| score: 0.035789 | |
| - label: <eos> | |
| score: 0.035753 | |
| - label: <unk> | |
| score: 0.035749 | |
| - label: '|' | |
| score: 0.035736 | |
| pipeline_tag: fill-mask | |
| sequence_type: mRNA | |
| task: fill-mask | |
| text: AUGCACAGCUC<mask>GCACUGCUCUGUUGCCUGGUCCUCCUGACUGGGGUGAGGGCC | |
| - example_title: Zaire ebolavirus | |
| mask_index: 11 | |
| mask_index_1based: 12 | |
| masked_char: A | |
| output: | |
| - label: '|' | |
| score: 0.035774 | |
| - label: <null> | |
| score: 0.035769 | |
| - label: <cls> | |
| score: 0.035749 | |
| - label: '*' | |
| score: 0.035746 | |
| - label: <unk> | |
| score: 0.035732 | |
| pipeline_tag: fill-mask | |
| sequence_type: mRNA | |
| task: fill-mask | |
| text: AAUGUUCAAAC<mask>CUUUGUGAAGCUCUGUUAGCUGAUGGUCUUGCUAAAGCAUUUCCUAGCAAUAUGAUGGUAGUCACAGAGCGUGAGCAAAAAGAAAGCUUAUUGCAUCAAGCAUCAUGGCACCACACAAGUGAUGAUUUUGGUGAGCAUGCCACAGUUAGAGGGAGUAGCUUUGUAACUGAUUUAGAGAAAUACAAUCUUGCAUUUAGAUAUGAGUUUACAGCACCUUUUAUAGAAUAUUGUAACCGUUGCUAUGGUGUUAAGAAUGUUUUUAAUUGGAUGCAUUAUACAAUCCCACAGUGUUAU | |
| - example_title: SARS coronavirus | |
| mask_index: 14 | |
| mask_index_1based: 15 | |
| masked_char: A | |
| output: | |
| - label: <cls> | |
| score: 0.03579 | |
| - label: '|' | |
| score: 0.035758 | |
| - label: <null> | |
| score: 0.035753 | |
| - label: <eos> | |
| score: 0.035753 | |
| - label: '*' | |
| score: 0.035746 | |
| pipeline_tag: fill-mask | |
| sequence_type: mRNA | |
| task: fill-mask | |
| text: AUGUUUAUUUUCUU<mask>UUAUUUCUUACUCUCACUAGUGGUAGUGACCUUGACCGGUGCACCACUUUUGAUGAUGUUCAAGCUCCUAAUUACACUCAACAUACUUCAUCUAUGAGGGGGGUUUACUAUCCUGAUGAAAUUUUUAGAUCAGACACUCUUUAUUUAACUCAGGAUUUAUUUCUUCCAUUUUAUUCUAAUGUUACAGGGUUUCAUACUAUUAAUCAUACGUUUGACAACCCUGUCAUACCUUUUAAGGAUGGUAUUUAUUUUGCUGCCACAGAGAAAUCAAAUGUUGUCCGUGGUUGGGUUUUUGGUUCUACCAUGAACAACAAGUCACAGUCGGUGAUUAUUAUUAACAAUUCUACUAAUGUUGUUAUACGAGCAUGUAACUUUGAAUUGUGUGACAACCCUUUCUUUGCUGUUUCUAAACCCAUGGGUACACAGACACAUACUAUGAUAUUCGAUAAUGCAUUUAAAUGCACUUUCGAGUACAUAUCU | |
| - example_title: insulin | |
| mask_index: 12 | |
| mask_index_1based: 13 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035796 | |
| - label: <eos> | |
| score: 0.035762 | |
| - label: . | |
| score: 0.035751 | |
| - label: '|' | |
| score: 0.035748 | |
| - label: <cls> | |
| score: 0.035747 | |
| pipeline_tag: fill-mask | |
| sequence_type: mRNA | |
| task: fill-mask | |
| text: AUGGCCCUGUGG<mask>UGCGCCUCCUGCCCCUGCUGGCGCUGCUGGCCCUCUGGGGACCUGACCCAGCCGCAGCCUUUGUGAACCAACACCUGUGCGGCUCACACCUGGUGGAAGCUCUCUACCUAGUGUGCGGGGAACGAGGCUUCUUCUACACACCCAAGACCCGCCGGGAGGCAGAGGACCUGCAGGUGGGGCAGGUGGAGCUGGGCGGGGGCCCUGGUGCAGGCAGCCUGCAGCCCUUGGCCCUGGAGGGGUCCCUGCAGAAGCGUGGCAUUGUGGAACAAUGCUGUACCAGCAUCUGCUCCCUCUACCAGCUGGAGAACUACUGCAACUAG | |
| - example_title: cyclin dependent kinase inhibitor 2A | |
| mask_index: 18 | |
| mask_index_1based: 19 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.03579 | |
| - label: '*' | |
| score: 0.035734 | |
| - label: <eos> | |
| score: 0.035726 | |
| - label: <cls> | |
| score: 0.035722 | |
| - label: C | |
| score: 0.03572 | |
| pipeline_tag: fill-mask | |
| sequence_type: mRNA | |
| task: fill-mask | |
| text: AUGGAGCCGGCGGCGGGG<mask>GCAGCAUGGAGCCUUCGGCUGACUGGCUGGCCACGGCCGCGGCCCGGGGUCGGGUAGAGGAGGUGCGGGCGCUGCUGGAGGCGGGGGCGCUGCCCAACGCACCGAAUAGUUACGGUCGGAGGCCGAUCCAGGUCAUGAUGAUGGGCAGCGCCCGAGUGGCGGAGCUGCUGCUGCUCCACGGCGCGGAGCCCAACUGCGCCGACCCCGCCACUCUCACCCGACCCGUGCACGACGCUGCCCGGGAGGGCUUCCUGGACACGCUGGUGGUGCUGCACCGGGCCGGGGCGCGGCUGGACGUGCGCGAUGCCUGGGGCCGUCUGCCCGUGGACCUGGCUGAGGAGCUGGGCCAUCGCGAUGUCGCACGGUACCUGCGCGCGGCUGCGGGGGGCACCAGAGGCAGUAACCAUGCCCGCAUAGAUGCCGCGGAAGGUCCCUCAGACAUCCCCGAUUGA | |
| - example_title: human papillomavirus type 16 E6 | |
| mask_index: 10 | |
| mask_index_1based: 11 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035779 | |
| - label: '|' | |
| score: 0.035758 | |
| - label: <unk> | |
| score: 0.035744 | |
| - label: . | |
| score: 0.035729 | |
| - label: I | |
| score: 0.035728 | |
| pipeline_tag: fill-mask | |
| sequence_type: mRNA | |
| task: fill-mask | |
| text: AUGCACCAAA<mask>GAGAACUGCAAUGUUUCAGGACCCACAGGAGCGACCCAGAAAGUUACCACAGUUAUGCACAGAGCUGCAAACAACUAUACAUGAUAUAAUAUUAGAAUGUGUGUACUGCAAGCAACAGUUACUGCGACGUGAGGUAUAUGACUUUGCUUUUCGGGAUUUAUGCAUAGUAUAUAGAGAUGGGAAUCCAUAUGCUGUAUGUGAUAAAUGUUUAAAGUUUUAUUCUAAAAUUAGUGAGUAUAGACAUUAUUGUUAUAGUUUGUAUGGAACAACAUUAGAACAGCAAUACAACAAACCGUUGUGUGAUUUGUUAAUUAGGUGUAUUAACUGUCAAAAGCCACUGUGUCCUGAAGAAAAGCAAAGACAUCUGGACAAAAAGCAAAGAUUCCAUAAUAUAAGGGGUCGGUGGACCGGUCGAUGUAUGUCUUGUUGCAGAUCAUCAAGAACACGUAGAGAAACCCAGCUGUAA | |
| - example_title: NRAS proto-oncogene | |
| mask_index: 36 | |
| mask_index_1based: 37 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035787 | |
| - label: '|' | |
| score: 0.035755 | |
| - label: <cls> | |
| score: 0.03575 | |
| - label: <unk> | |
| score: 0.035745 | |
| - label: '*' | |
| score: 0.035744 | |
| pipeline_tag: fill-mask | |
| sequence_type: 5' UTR | |
| task: fill-mask | |
| text: GGGGCCGGAAGUGCCGCUCCUUGGUGGGGGCUGUUC<mask>UGGCGGUUCCGGGGUCUCCAACAUUUUUCCCGGCUGUGGUCCUAAAUCUGUCCAAAGCAGAGGCAGUGGAGCUUGAGGUUCUUGCUGGUGUGAA | |
| - example_title: amyloid beta precursor protein | |
| mask_index: 15 | |
| mask_index_1based: 16 | |
| masked_char: A | |
| output: | |
| - label: <cls> | |
| score: 0.035785 | |
| - label: '*' | |
| score: 0.035768 | |
| - label: '?' | |
| score: 0.035765 | |
| - label: '|' | |
| score: 0.035756 | |
| - label: <unk> | |
| score: 0.035752 | |
| pipeline_tag: fill-mask | |
| sequence_type: 5' UTR | |
| task: fill-mask | |
| text: GUCAGUUUCCUCGGC<mask>GCGGUAGGCGAGAGCACGCGGAGGAGCGUGCGCGGGGGCCCCGGGAGACGGCGGCGGUGGCGGCGCGGGCAGAGCAAGGACGCGGCGGAUCCCACUCGCACAGCAGCGCACUCGGUGCCCCGCGCAGGGUCGCG | |
| - example_title: RUNX family transcription factor 1 | |
| mask_index: 15 | |
| mask_index_1based: 16 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035809 | |
| - label: '*' | |
| score: 0.035797 | |
| - label: <eos> | |
| score: 0.035737 | |
| - label: '|' | |
| score: 0.035719 | |
| - label: I | |
| score: 0.035716 | |
| pipeline_tag: fill-mask | |
| sequence_type: 5' UTR | |
| task: fill-mask | |
| text: ACUUCUUUGGGCCUC<mask>UAAACAACCACAGAACCACAAGUUGGGUAGCCUGGCAGUGUCAGAAGUCUGAACCCAGCAUAGUGGUCAGCAGGCAGGACGAAUCACACUGAAUGCAAACCACAGGGUUUCGCAGCGUGGUAAAAGAAAUCAUUGAGUCCCCCGCCUUCAGAAGAGGGUGCAUUUUCAGGAGGAAGCG | |
| - example_title: fragile X messenger ribonucleoprotein 1 | |
| mask_index: 15 | |
| mask_index_1based: 16 | |
| masked_char: A | |
| output: | |
| - label: '*' | |
| score: 0.035775 | |
| - label: '|' | |
| score: 0.035763 | |
| - label: <null> | |
| score: 0.035749 | |
| - label: <eos> | |
| score: 0.035744 | |
| - label: '?' | |
| score: 0.035741 | |
| pipeline_tag: fill-mask | |
| sequence_type: 5' UTR | |
| task: fill-mask | |
| text: CUCAGUCAGGCGCUC<mask>GCUCCGUUUCGGUUUCACUUCCGGUGGAGGGCCGCCUCUGAGCGGGCGGCGGGCCGACGGCGAGCGCGGGCGGCGGCGGUGACGGAGGCGCCGCUGCCAGGGGGCGUGCGGCAGCGCGGCGGCGGCGGCGGCGGCGGCGGCGGCGGAGGCGGCGGCGGCGGCGGCGGCGGCGGCGGCUGGGCCUCGAGCGCCCGCAGCCCACCUCUCGGGGGCGGGCUCCCGGCGCUAGCAGGGCUGAAGAGAAG | |
| - example_title: MYC proto-oncogene | |
| mask_index: 10 | |
| mask_index_1based: 11 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.03581 | |
| - label: <cls> | |
| score: 0.035767 | |
| - label: <eos> | |
| score: 0.035753 | |
| - label: '|' | |
| score: 0.035736 | |
| - label: <unk> | |
| score: 0.03573 | |
| pipeline_tag: fill-mask | |
| sequence_type: 5' UTR | |
| task: fill-mask | |
| text: AACUCGCUGU<mask>GUAAUUCCAGCGAGAGGCAGAGGGAGCGAGCGGGCGGCCGGCUAGGGUGGAAGAGCCGGGCGAGCAGAGCUGCGCUGCGGGCGUCCUGGGAAGGGAGAUCCGGAGCGAAUAGGGGGCUUCGCCUCUGGCCCAGCCCUCCCGCUGAUCCCCCAGCCAGCGGUCCGCAACCCUUGCCGCAUCCACGAAACUUUGCCCAUAGCAGCGGGCGGGCACUUUGCACUGGAACUUACAACACCCGAGCAAGGACGCGACUCUCCCGACGCGGGGAGGCUAUUCUGCCCAUUUGGGGACACUUCCCCGCCGCUGCCAGGACCCGCUUCUCUGAAAGGCUCUCCUUGCAGCUGCUUAGACG | |
| - example_title: activating transcription factor 4 | |
| mask_index: 20 | |
| mask_index_1based: 21 | |
| masked_char: A | |
| output: | |
| - label: '*' | |
| score: 0.035781 | |
| - label: '|' | |
| score: 0.035781 | |
| - label: <null> | |
| score: 0.035733 | |
| - label: <cls> | |
| score: 0.03573 | |
| - label: <unk> | |
| score: 0.035728 | |
| pipeline_tag: fill-mask | |
| sequence_type: 5' UTR | |
| task: fill-mask | |
| text: CAUUUCUACUUUGCCCGCCC<mask>CAGAUGUAGUUUUCUCUGCGCGUGUGCGUUUUCCCUCCUCCCCGCCCUCAGGGUCCACGGCCACCAUGGCGUAUUAGGGGCAGCAGUGCCUGCGGCAGCAUUGGCCUUUGCAGCGGCGGCAGCAGCACCAGGCUCUGCAGCGGCAACCCCCAGCGGCUUAAGCCAUGGCGCUUCUCACGGCAUUCAGCAGCAGCGUUGCUGUAACCGACAAAGACACCUUCGAAUUAAGCACAUUCCUCGAUUCCAGCAAAGCACCGCAAC | |
| - example_title: Human GPI protein p137 | |
| mask_index: 11 | |
| mask_index_1based: 12 | |
| masked_char: A | |
| output: | |
| - label: '*' | |
| score: 0.035785 | |
| - label: <cls> | |
| score: 0.035775 | |
| - label: <null> | |
| score: 0.03576 | |
| - label: <eos> | |
| score: 0.035741 | |
| - label: '|' | |
| score: 0.035736 | |
| pipeline_tag: fill-mask | |
| sequence_type: 3' UTR | |
| task: fill-mask | |
| text: UUUUUAAAAGG<mask>AAAGAUACCAAAUGCCUGCUGCUACCACCCUUUUCAAUUGCUAUGUUUUGAAAGGCACCAGUAUGUGUUUUAGAUUGAUUUAAAUGUUUCAUUUAAAUCACGGACAGUAGUUUCAGUUCUGAUGGUAUAAGCAAAACAAAUAAAACGUUUAUAAAAGUUGUAUCUUGAAACACUGGUGUUCAACAGCUAGCAGCUUAUGUGAUUCACCCCAUGCCACGUUAGUGUCACAAAUUUUAUGGUUUAUCUCCAGCAACAUUUCUCUAGUACUUGCACUUAUUAUCUGAAUUC | |
| - example_title: nucleophosmin 1 | |
| mask_index: 11 | |
| mask_index_1based: 12 | |
| masked_char: A | |
| output: | |
| - label: '*' | |
| score: 0.035774 | |
| - label: <null> | |
| score: 0.03577 | |
| - label: <cls> | |
| score: 0.035763 | |
| - label: '|' | |
| score: 0.035747 | |
| - label: <pad> | |
| score: 0.035716 | |
| pipeline_tag: fill-mask | |
| sequence_type: 3' UTR | |
| task: fill-mask | |
| text: GAAAAUAGUUU<mask>AACAAUUUGUUAAAAAAUUUUCCGUCUUAUUUCAUUUCUGUAACAGUUGAUAUCUGGCUGUCCUUUUUAUAAUGCAGAGUGAGAACUUUCCCUACCGUGUUUGAUAAAUGUUGUCCAGGUUCUAUUGCCAAGAAUGUGUUGUCCAAAAUGCCUGUUUAGUUUUUAAAGAUGGAACUCCACCCUUUGCUUGGUUUUAAGUAUGUAUGGAAUGUUAUGAUAGGACAUAGUAGUAGCGGUGGUCAGACAUGGAAAUGGUGGGGAGACAAAAAUAUACAUGUGAAAUAAAACUCAGUAUUUUAAUAAAGUAGCACGGUUUCUAUUGA | |
| - example_title: superoxide dismutase 1 | |
| mask_index: 12 | |
| mask_index_1based: 13 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035775 | |
| - label: '|' | |
| score: 0.035767 | |
| - label: '*' | |
| score: 0.035747 | |
| - label: <unk> | |
| score: 0.035747 | |
| - label: <cls> | |
| score: 0.035729 | |
| pipeline_tag: fill-mask | |
| sequence_type: 3' UTR | |
| task: fill-mask | |
| text: ACAUUCCCUUGG<mask>UGUAGUCUGAGGCCCCUUAACUCAUCUGUUAUCCUGCUAGCUGUAGAAAUGUAUCCUGAUAAACAUUAAACACUGUAAUCUUAAAAGUGUAAUUGUGUGACUUUUUCAGAGUUGCUUUAAAGUACCUGUAGUGAGAAACUGAUUUAUGAUCACUUGGAAGAUUUGUAUAGUUUUAUAAAACUCAGUUAAAAUGUCUGUUUCAAUGACCUGUAUUUUGCCAGACUUAAAUCACAGAUGGGUAUUAAACUUGUCAGAAUUUCUUUGUCAUUCAAGCCUGUGAAUAAAAACCCUGUAUGGCACUUAUUAUGAGGCUAUUAAAAGAAUCCAAAUUCAAACUAAA | |
| - example_title: hemoglobin subunit alpha 2 | |
| mask_index: 13 | |
| mask_index_1based: 14 | |
| masked_char: A | |
| output: | |
| - label: '*' | |
| score: 0.035797 | |
| - label: <cls> | |
| score: 0.03578 | |
| - label: <null> | |
| score: 0.035776 | |
| - label: <eos> | |
| score: 0.035756 | |
| - label: '?' | |
| score: 0.035725 | |
| pipeline_tag: fill-mask | |
| sequence_type: 3' UTR | |
| task: fill-mask | |
| text: CUGGAGCCUCGGU<mask>GCCGUUCCUCCUGCCCGCUGGGCCUCCCAACGGGCCCUCCUCCCCUCCUUGCACCGGCCCUUCCUGGUCUUUGAAUAAAGUCUGAGUGGGCAGCA | |
| - example_title: BRAF proto-oncogene | |
| mask_index: 12 | |
| mask_index_1based: 13 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035826 | |
| - label: <unk> | |
| score: 0.035759 | |
| - label: '*' | |
| score: 0.035756 | |
| - label: '?' | |
| score: 0.035748 | |
| - label: '|' | |
| score: 0.035747 | |
| pipeline_tag: fill-mask | |
| sequence_type: 3' UTR | |
| task: fill-mask | |
| text: AACAAAUGAGUG<mask>GAGAGUUCAGGAGAGUAGCAACAAAAGGAAAAUAAAUGAACAUAUGUUUGCUUAUAUGUUAAAUUGAAUAAAAUACUCUCUUUUUUUUUAAGGUGAACCAAAGAACACUUGUGUGGUUAAAGACUAGAUAUAAUUUUUCCCCAAACUAAAAUUUAUACUUAACAUUGGAUUUUUAACAUCCAAGGGUUAAAAUACAUAGACAUUGCUAAAAAUUGGCAGAGCCUCUUCUAGAGGCUUUACUUUCUGUUCCGGGUUUGUAUCAUUCACUUGGUUAUUUUAAGUAGUAAACUUCAGUUUCUCAUGCAACUUUUGUUGCCAGCUAUCACAUGUCCACUAGGGACUCCAGAAGAAGACCCUACCUAUGCCUGUGUUUGCAGGUGAGAAGUUGGCAGUCGGUUAGCCUGGG | |
| - example_title: H3 clustered histone 1 | |
| mask_index: 17 | |
| mask_index_1based: 18 | |
| masked_char: A | |
| output: | |
| - label: <null> | |
| score: 0.035798 | |
| - label: <cls> | |
| score: 0.035776 | |
| - label: '|' | |
| score: 0.035758 | |
| - label: <unk> | |
| score: 0.03575 | |
| - label: '*' | |
| score: 0.035735 | |
| pipeline_tag: fill-mask | |
| sequence_type: 3' UTR | |
| task: fill-mask | |
| text: UUACUGUGGUCUCUCUG<mask>CGGUCCAAGCAAAGGCUCUUUUCAGAGCCACCACCUUUUC | |
| --- | |
| # RNABERT | |
| Pre-trained model on non-coding RNA (ncRNA) using masked language modeling (MLM) and structural alignment learning (SAL) objectives. | |
| ## Disclaimer | |
| This is an UNOFFICIAL implementation of the [Informative RNA-base embedding for functional RNA clustering and structural alignment](https://doi.org/10.1093/nargab/lqac012) by Manato Akiyama, et al. | |
| The OFFICIAL repository of RNABERT is at [mana438/RNABERT](https://github.com/mana438/RNABERT). | |
| > [!CAUTION] | |
| > The MultiMolecule team is aware of a potential risk in reproducing the results of RNABERT. | |
| > | |
| > The original implementation of RNABERT does not prepend `<bos>` (`<cls>`) and append `<eos>` tokens to the input sequence. | |
| > This should not affect the performance of the model in most cases, but it can lead to unexpected behavior in some cases. | |
| > | |
| > Please set `bos_token=None, eos_token=None` in the tokenizer and set `bos_token_id=None, eos_token_id=None` in the model configuration if you want the exact behavior of the original implementation. | |
| > [!TIP] | |
| > The MultiMolecule team has confirmed that the provided model and checkpoints are producing the same intermediate representations as the original implementation. | |
| **The team releasing RNABERT did not write this model card for this model so this model card has been written by the MultiMolecule team.** | |
| ## Model Details | |
| RNABERT is a [bert](https://huggingface.co/google-bert/bert-base-uncased)-style model pre-trained on a large corpus of non-coding RNA sequences in a self-supervised fashion. This means that the model was trained on the raw nucleotides of RNA sequences only, with an automatic process to generate inputs and labels from those texts. Please refer to the [Training Details](#training-details) section for more information on the training process. | |
| ### Model Specification | |
| | Num Layers | Hidden Size | Num Heads | Intermediate Size | Num Parameters (M) | FLOPs (G) | MACs (G) | Max Num Tokens | | |
| | ---------- | ----------- | --------- | ----------------- | ------------------ | --------- | -------- | -------------- | | |
| | 6 | 120 | 12 | 40 | 0.48 | 0.96 | 0.46 | 440 | | |
| ### Links | |
| - **Code**: [multimolecule.rnabert](https://github.com/DLS5-Omics/multimolecule/tree/master/multimolecule/models/rnabert) | |
| - **Weights**: [multimolecule/rnabert](https://huggingface.co/multimolecule/rnabert) | |
| - **Data**: [multimolecule/rnacentral](https://huggingface.co/datasets/multimolecule/rnacentral) | |
| - **Paper**: [Informative RNA-base embedding for functional RNA clustering and structural alignment](https://doi.org/10.1093/nargab/lqac012) | |
| - **Developed by**: Manato Akiyama and Yasubumi Sakakibara | |
| - **Model type**: [BERT](https://huggingface.co/google-bert/bert-base-uncased) | |
| - **Original Repository**: [mana438/RNABERT](https://github.com/mana438/RNABERT) | |
| ## Usage | |
| The model file depends on the [`multimolecule`](https://multimolecule.danling.org) library. You can install it using pip: | |
| ```bash | |
| pip install multimolecule | |
| ``` | |
| ### Direct Use | |
| #### Masked Language Modeling | |
| You can use this model directly with a pipeline for masked language modeling: | |
| ```python | |
| import multimolecule # you must import multimolecule to register models | |
| from transformers import pipeline | |
| predictor = pipeline("fill-mask", model="multimolecule/rnabert") | |
| output = predictor("gguc<mask>cucugguuagaccagaucugagccu") | |
| ``` | |
| ### Downstream Use | |
| #### Extract Features | |
| Here is how to use this model to get the features of a given sequence in PyTorch: | |
| ```python | |
| from multimolecule import RnaTokenizer, RnaBertModel | |
| tokenizer = RnaTokenizer.from_pretrained("multimolecule/rnabert") | |
| model = RnaBertModel.from_pretrained("multimolecule/rnabert") | |
| text = "UAGCUUAUCAGACUGAUGUUG" | |
| input = tokenizer(text, return_tensors="pt") | |
| output = model(**input) | |
| ``` | |
| #### Sequence Classification / Regression | |
| > [!NOTE] | |
| > This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for sequence classification or regression. | |
| Here is how to use this model as backbone to fine-tune for a sequence-level task in PyTorch: | |
| ```python | |
| import torch | |
| from multimolecule import RnaTokenizer, RnaBertForSequencePrediction | |
| tokenizer = RnaTokenizer.from_pretrained("multimolecule/rnabert") | |
| model = RnaBertForSequencePrediction.from_pretrained("multimolecule/rnabert") | |
| text = "UAGCUUAUCAGACUGAUGUUG" | |
| input = tokenizer(text, return_tensors="pt") | |
| label = torch.tensor([1]) | |
| output = model(**input, labels=label) | |
| ``` | |
| #### Token Classification / Regression | |
| > [!NOTE] | |
| > This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for token classification or regression. | |
| Here is how to use this model as backbone to fine-tune for a nucleotide-level task in PyTorch: | |
| ```python | |
| import torch | |
| from multimolecule import RnaTokenizer, RnaBertForTokenPrediction | |
| tokenizer = RnaTokenizer.from_pretrained("multimolecule/rnabert") | |
| model = RnaBertForTokenPrediction.from_pretrained("multimolecule/rnabert") | |
| text = "UAGCUUAUCAGACUGAUGUUG" | |
| input = tokenizer(text, return_tensors="pt") | |
| label = torch.randint(2, (len(text), )) | |
| output = model(**input, labels=label) | |
| ``` | |
| #### Contact Classification / Regression | |
| > [!NOTE] | |
| > This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for contact classification or regression. | |
| Here is how to use this model as backbone to fine-tune for a contact-level task in PyTorch: | |
| ```python | |
| import torch | |
| from multimolecule import RnaTokenizer, RnaBertForContactPrediction | |
| tokenizer = RnaTokenizer.from_pretrained("multimolecule/rnabert") | |
| model = RnaBertForContactPrediction.from_pretrained("multimolecule/rnabert") | |
| text = "UAGCUUAUCAGACUGAUGUUG" | |
| input = tokenizer(text, return_tensors="pt") | |
| label = torch.randint(2, (len(text), len(text))) | |
| output = model(**input, labels=label) | |
| ``` | |
| ## Training Details | |
| RNABERT has two pre-training objectives: masked language modeling (MLM) and structural alignment learning (SAL). | |
| - **Masked Language Modeling (MLM)**: taking a sequence, the model randomly masks 15% of the tokens in the input then runs the entire masked sentence through the model and has to predict the masked tokens. This is comparable to the Cloze task in language modeling. | |
| - **Structural Alignment Learning (SAL)**: the model learns to predict the structural alignment of two RNA sequences. The model is trained to predict the alignment score of two RNA sequences using the Needleman-Wunsch algorithm. | |
| ### Training Data | |
| The RNABERT model was pre-trained on [RNAcentral](https://multimolecule.danling.org/datasets/rnacentral). | |
| RNAcentral is a free, public resource that offers integrated access to a comprehensive and up-to-date set of non-coding RNA sequences provided by a collaborating group of [Expert Databases](https://rnacentral.org/expert-databases) representing a broad range of organisms and RNA types. | |
| RNABERT used a subset of 76, 237 human ncRNA sequences from RNAcentral for pre-training. | |
| RNABERT preprocessed all tokens by replacing "U"s with "T"s. | |
| Note that during model conversions, "T" is replaced with "U". [`RnaTokenizer`][multimolecule.RnaTokenizer] will convert "T"s to "U"s for you, you may disable this behaviour by passing `replace_T_with_U=False`. | |
| ### Training Procedure | |
| #### Preprocessing | |
| RNABERT preprocess the dataset by applying 10 different mask patterns to the 72, 237 human ncRNA sequences. The final dataset contains 722, 370 sequences. The masking procedure is similar to the one used in BERT: | |
| - Mask rate: 15% | |
| - Replacement: `<mask>` for 80% of masked tokens | |
| - Replacement: random token for 10% of masked tokens | |
| - Replacement: unchanged token for 10% of masked tokens | |
| #### Pre-training | |
| The model was trained on 1 NVIDIA V100 GPU. | |
| ## Citation | |
| ```bibtex | |
| @article{akiyama2022informative, | |
| author = {Akiyama, Manato and Sakakibara, Yasubumi}, | |
| title = "{Informative RNA base embedding for RNA structural alignment and clustering by deep representation learning}", | |
| journal = {NAR Genomics and Bioinformatics}, | |
| volume = {4}, | |
| number = {1}, | |
| pages = {lqac012}, | |
| year = {2022}, | |
| month = {02}, | |
| abstract = "{Effective embedding is actively conducted by applying deep learning to biomolecular information. Obtaining better embeddings enhances the quality of downstream analyses, such as DNA sequence motif detection and protein function prediction. In this study, we adopt a pre-training algorithm for the effective embedding of RNA bases to acquire semantically rich representations and apply this algorithm to two fundamental RNA sequence problems: structural alignment and clustering. By using the pre-training algorithm to embed the four bases of RNA in a position-dependent manner using a large number of RNA sequences from various RNA families, a context-sensitive embedding representation is obtained. As a result, not only base information but also secondary structure and context information of RNA sequences are embedded for each base. We call this ‘informative base embedding’ and use it to achieve accuracies superior to those of existing state-of-the-art methods on RNA structural alignment and RNA family clustering tasks. Furthermore, upon performing RNA sequence alignment by combining this informative base embedding with a simple Needleman–Wunsch alignment algorithm, we succeed in calculating structural alignments with a time complexity of O(n2) instead of the O(n6) time complexity of the naive implementation of Sankoff-style algorithm for input RNA sequence of length n.}", | |
| issn = {2631-9268}, | |
| doi = {10.1093/nargab/lqac012}, | |
| url = {https://doi.org/10.1093/nargab/lqac012}, | |
| eprint = {https://academic.oup.com/nargab/article-pdf/4/1/lqac012/42577168/lqac012.pdf}, | |
| } | |
| ``` | |
| > [!NOTE] | |
| > The artifacts distributed in this repository are part of the MultiMolecule project. | |
| > If MultiMolecule supports your research, please cite the MultiMolecule project as follows: | |
| ```bibtex | |
| @software{chen_2024_12638419, | |
| author = {Chen, Zhiyuan and Zhu, Sophia Y.}, | |
| title = {MultiMolecule}, | |
| doi = {10.5281/zenodo.12638419}, | |
| publisher = {Zenodo}, | |
| url = {https://doi.org/10.5281/zenodo.12638419}, | |
| year = 2024, | |
| month = may, | |
| day = 4 | |
| } | |
| ``` | |
| ## Contact | |
| Please use GitHub issues of [MultiMolecule](https://github.com/DLS5-Omics/multimolecule/issues) for any questions or comments on the model card. | |
| Please contact the authors of the [RNABERT paper](https://doi.org/10.1093/nargab/lqac012) for questions or comments on the paper/model. | |
| ## License | |
| This model implementation is licensed under the [GNU Affero General Public License](license.md). | |
| For additional terms and clarifications, please refer to our [License FAQ](license-faq.md). | |
| ```spdx | |
| SPDX-License-Identifier: AGPL-3.0-or-later | |
| ``` |