### Install TAPE Proteins Library Source: https://github.com/songlab-cal/tape/blob/master/README.md Installs the `tape_proteins` library into a Python virtual environment using pip. This command ensures the necessary dependencies for TAPE are available for use. ```bash pip install tape_proteins ``` -------------------------------- ### Load and Use trRosetta Model in Python Source: https://github.com/songlab-cal/tape/blob/master/README.md Provides a Python example demonstrating how to load the trRosetta model from the TAPE library and prepare data using `TRRosettaDataset`. It shows how to instantiate the model from a pretrained ensemble and perform a forward pass to obtain loss and predictions. ```python from tape import TRRosetta from tape.datasets import TRRosettaDataset # Download data and place it under `/trrosetta` train_data = TRRosettaDatset('', 'train') # will subsample MSAs valid_data = TRRosettaDatset('', 'valid') # will not subsample MSAs model = TRRosetta.from_pretrained('xaa') # valid choices are 'xaa', 'xab', 'xac', 'xad', 'xae'. Each corresponds to one of the ensemble models. batch = train_data.collate_fn([train_data[0]]) loss, predictions = model(**batch) ``` -------------------------------- ### Load Pretrained Protein Models with Huggingface API Source: https://github.com/songlab-cal/tape/blob/master/README.md Demonstrates how to load a pretrained protein language model (e.g., ProteinBertModel) and its corresponding tokenizer (TAPETokenizer) using the Huggingface API. It shows encoding a protein sequence into token IDs and obtaining sequence and pooled outputs from the model. ```python import torch from tape import ProteinBertModel, TAPETokenizer model = ProteinBertModel.from_pretrained('bert-base') tokenizer = TAPETokenizer(vocab='iupac') # iupac is the vocab for TAPE models, use unirep for the UniRep model # Pfam Family: Hexapep, Clan: CL0536 sequence = 'GCTVEDRCLIGMGAILLNGCVIGSGSLVAAGALITQ' token_ids = torch.tensor([tokenizer.encode(sequence)]) output = model(token_ids) sequence_output = output[0] pooled_output = output[1] # NOTE: pooled_output is *not* trained for the transformer, do not use # w/o fine-tuning. A better option for now is to simply take a mean of # the sequence output ``` -------------------------------- ### Embed Proteins using tape-embed Command Source: https://github.com/songlab-cal/tape/blob/master/README.md This command demonstrates how to generate protein embeddings from a FASTA file using the `tape-embed` utility. It specifies the UniRep babbler-1900 model and requires the `--tokenizer unirep` flag due to UniRep's unique vocabulary. The model will be automatically downloaded if not present. ```bash tape-embed unirep my_input.fasta output_filename.npz babbler-1900 --tokenizer unirep ``` -------------------------------- ### Download All TAPE Project Data Source: https://github.com/songlab-cal/tape/blob/master/README.md This snippet provides the command to download the entire TAPE project dataset, including both supervised and unsupervised Pfam data, using a provided shell script. The data is hosted on AWS. ```Shell download_data.sh ``` -------------------------------- ### Train Language Model with tape-train-distributed Source: https://github.com/songlab-cal/tape/blob/master/README.md This command illustrates how to train a transformer model for masked language modeling using `tape-train-distributed`. It highlights key parameters such as batch size, learning rate, half-precision training (`--fp16`), warmup steps, number of processes per node, and gradient accumulation steps. `tape-train-distributed` is recommended for its speed benefits over `tape-train`. ```bash tape-train-distributed transformer masked_language_modeling --batch_size BS --learning_rate LR --fp16 --warmup_steps WS --nproc_per_node NGPU --gradient_accumulation_steps NSTEPS ``` -------------------------------- ### Train Downstream Model with tape-train-distributed Source: https://github.com/songlab-cal/tape/blob/master/README.md Demonstrates how to train a downstream model using a pretrained language model with the `tape-train-distributed` command. It highlights essential hyperparameters like batch size, learning rate, warmup steps, and epoch count, which are critical for optimizing performance on specific downstream tasks. ```bash tape-train-distributed transformer secondary_structure \ --from_pretrained results/ \ --batch_size BS \ --learning_rate LR \ --fp16 \ --warmup_steps WS \ --nproc_per_node NGPU \ --gradient_accumulation_steps NSTEPS \ --num_train_epochs NEPOCH \ --eval_freq EF \ --save_freq SF ``` -------------------------------- ### TAPE Project Main Paper Citation Source: https://github.com/songlab-cal/tape/blob/master/README.md BibTeX citation for the primary TAPE paper, 'Evaluating Protein Transfer Learning with TAPE', which should be cited when using the TAPE framework. ```BibTeX @inproceedings{tape2019, author = {Rao, Roshan and Bhattacharya, Nicholas and Thomas, Neil and Duan, Yan and Chen, Xi and Canny, John and Abbeel, Pieter and Song, Yun S}, title = {Evaluating Protein Transfer Learning with TAPE}, booktitle = {Advances in Neural Information Processing Systems} year = {2019} } ``` -------------------------------- ### Load Protein Embeddings with NumPy in Python Source: https://github.com/songlab-cal/tape/blob/master/README.md After generating protein embeddings into an `.npz` file, this Python snippet shows how to load the data using NumPy. It demonstrates how to access the keys (protein IDs) and retrieve the embedding dictionary for a specific protein, which typically contains 'pooled' and 'avg' embeddings. ```python arrays = np.load('output_filename.npz', allow_pickle=True) list(arrays.keys()) # Will output the name of the keys in your fasta file (or if unnamed then '0', '1', ...) arrays[] # Returns a dictionary with keys 'pooled' and 'avg', (or 'seq' if using the --full_sequence_embed flag) ``` -------------------------------- ### Evaluate Downstream Model with tape-eval Source: https://github.com/songlab-cal/tape/blob/master/README.md Explains how to evaluate a trained downstream model using the `tape-eval` command. Users can specify various metrics such as mean squared error, mean absolute error, Spearman's rho, and accuracy to assess model performance. The command outputs metrics and dumps predictions into a `results.pkl` file. ```bash tape-eval MODEL TASK TRAINED_MODEL_FOLDER --metrics METRIC1 METRIC2 ... tape-eval transformer secondary_structure results/ --metrics accuracy ``` -------------------------------- ### TAPE Available Models and Tasks Source: https://github.com/songlab-cal/tape/blob/master/README.md Lists the various protein models and standard tasks supported by the TAPE library. This includes different model architectures like transformer, resnet, and trrosetta, as well as tasks such as language modeling, secondary structure prediction, and contact prediction. ```APIDOC Models: - transformer (pretrained available) - resnet - lstm - unirep (pretrained available) - onehot (no pretraining required) - trrosetta (pretrained available) Tasks: - language_modeling - masked_language_modeling - secondary_structure - contact_prediction - remote_homology - fluorescence - stability - trrosetta (can only be used with trrosetta model) ``` -------------------------------- ### Fluorescence Protein Landscape Study Citation Source: https://github.com/songlab-cal/tape/blob/master/README.md BibTeX citation for the study on the local fitness landscape of the green fluorescent protein, a dataset related to fluorescence used in the TAPE project. This citation acknowledges the source of experimental data. ```BibTeX @article{sarkisyan2016, title={Local fitness landscape of the green fluorescent protein}, author={Sarkisyan, Karen S and Bolotin, Dmitry A and Meer, Margarita V and Usmanova, Dinara R and Mishin, Alexander S and Sharonov, George V and Ivankov, Dmitry N and Bozhanova, Nina G and Baranov, Mikhail S and Soylemez, Onuralp and others}, journal={Nature}, volume={533}, number={7603}, pages={397}, year={2016}, publisher={Nature Publishing Group} } ``` -------------------------------- ### Pfam Protein Families Database Citation Source: https://github.com/songlab-cal/tape/blob/master/README.md BibTeX citation for the Pfam protein families database, used for pretraining within the TAPE project. This dataset is resource-intensive to produce and requires proper acknowledgment. ```BibTeX @article{pfam, author = {El-Gebali, Sara and Mistry, Jaina and Bateman, Alex and Eddy, Sean F and Luciani, Aur{\\'{e}}lien and Potter, Simon C and Qureshi, Matloob and Richardson, Lorna J and Salazar, Gustavo A and Smart, Alfredo and Sonnhammer, Erik L L and Hirsh, Layla and Paladin, Lisanna and Piovesan, Damiano and Tosatto, Silvio C E and Finn, Robert D}, doi = {10.1093/nar/gky995}, file = {::}, issn = {0305-1048}, journal = {Nucleic Acids Research}, keywords = {community,protein domains,tandem repeat sequences}, number = {D1}, pages = {D427--D432}, publisher = {Narnia}, title = {{The Pfam protein families database in 2019}}, url = {https://academic.oup.com/nar/article/47/D1/D427/5144153}, volume = {47}, year = {2019} } ``` -------------------------------- ### ProteinNet Standardized Dataset Citation Source: https://github.com/songlab-cal/tape/blob/master/README.md BibTeX citation for ProteinNet, a standardized dataset for machine learning of protein structure, specifically contact prediction, used in the TAPE project. This citation ensures proper attribution. ```BibTeX @article{proteinnet, title={ProteinNet: a standardized data set for machine learning of protein structure}, author={AlQuraishi, Mohammed}, journal={arXiv preprint arXiv:1902.00249}, year={2019} } ``` -------------------------------- ### NetSurfP-2.0 Protein Structural Features Prediction Citation Source: https://github.com/songlab-cal/tape/blob/master/README.md BibTeX citation for NetSurfP-2.0, a tool for improved prediction of protein structural features, specifically secondary structure, used within the TAPE project. This citation acknowledges the methodology. ```BibTeX @article{netsurfp, title={NetSurfP-2.0: Improved prediction of protein structural features by integrated deep learning}, author={Klausen, Michael Schantz and Jespersen, Martin Closter and Nielsen, Henrik and Jensen, Kamilla Kjaergaard and Jurtz, Vanessa Isabell and Soenderby, Casper Kaae and Sommer, Morten Otto Alexander and Winther, Ole and Nielsen, Morten and Petersen, Bent and others}, journal={Proteins: Structure, Function, and Bioinformatics}, year={2019}, publisher={Wiley Online Library} } ``` -------------------------------- ### Protein Data Bank (PDB) Citation Source: https://github.com/songlab-cal/tape/blob/master/README.md BibTeX citation for the Protein Data Bank (PDB), a critical resource for secondary structure and contact information used within the TAPE project. Proper citation is required for its use. ```BibTeX @article{pdb, title={The protein data bank}, author={Berman, Helen M and Westbrook, John and Feng, Zukang and Gilliland, Gary and Bhat, Talapady N and Weissig, Helge and Shindyalov, Ilya N and Bourne, Philip E}, journal={Nucleic acids research}, volume={28}, number={1}, pages={235--242}, year={2000}, publisher={Oxford University Press} } ``` -------------------------------- ### SCOPe Structural Classification of Proteins Citation Source: https://github.com/songlab-cal/tape/blob/master/README.md BibTeX citation for the SCOPe (Structural Classification of Proteins—extended) database, used for remote homology and contact prediction in the TAPE project. This citation acknowledges the data source. ```BibTeX @article{scop, title={SCOPe: Structural Classification of Proteins—extended, integrating SCOP and ASTRAL data and classification of new structures}, author={Fox, Naomi K and Brenner, Steven E and Chandonia, John-Marc}, journal={Nucleic acids research}, volume={42}, number={D1}, pages={D304--D309}, year={2013}, publisher={Oxford University Press} } ``` -------------------------------- ### CASP12 Critical Assessment of Protein Structure Prediction Citation Source: https://github.com/songlab-cal/tape/blob/master/README.md BibTeX citation for the CASP12 (Critical Assessment of Methods of Protein Structure Prediction—Round XII) dataset, utilized for secondary structure and contact prediction in TAPE. Acknowledging this resource is essential. ```BibTeX @article{casp, author = {Moult, John and Fidelis, Krzysztof and Kryshtafovych, Andriy and Schwede, Torsten and Tramontano, Anna}, doi = {10.1002/prot.25415}, issn = {08873585}, journal = {Proteins: Structure, Function, and Bioinformatics}, keywords = {CASP,community wide experiment,protein structure prediction}, pages = {7--15}, publisher = {John Wiley {\&} Sons, Ltd}, title = {{Critical assessment of methods of protein structure prediction (CASP)-Round XII}}, url = {http://doi.wiley.com/10.1002/prot.25415}, volume = {86}, year = {2018} } ``` -------------------------------- ### Protein Folding Stability Analysis Citation Source: https://github.com/songlab-cal/tape/blob/master/README.md BibTeX citation for the global analysis of protein folding stability, a dataset used within the TAPE project. This citation ensures proper acknowledgment of the experimental data source. ```BibTeX @article{rocklin2017, title={Global analysis of protein folding using massively parallel design, synthesis, and testing}, author={Rocklin, Gabriel J and Chidyausiku, Tamuka M and Goreshnik, Inna and Ford, Alex and Houliston, Scott and Lemak, Alexander and Carter, Lauren and Ravichandran, Rashmi and Mulligan, Vikram K and Chevalier, Aaron and others}, journal={Science}, volume={357}, number={6347}, pages={168--175}, year={2017}, publisher={American Association for the Advancement of Science} } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.