Uploading data, README, code
Browse files- README.md +22 -0
- dataset_script.py +51 -0
- full_data.csv +0 -0
README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Protein sequences from SCOPe-2.08
|
| 2 |
+
|
| 3 |
+
This dataset is based on section A.4.3 of [1]. For understanding the identification of remote homology relations in hidden layers, we consider the Astral SCOPe v2.08 dataset [2], containing genetic domain sequence subsets filtered to obtain < 40% pairwise sequence identity. Each domain is hierarchically classified into fold, super-family, and family. We impose an initial filter by excluding the Rossman-like folds (c.2–c.5, c.27 and 28, c.30 and 31) and the four- to eight-bladed b-propellers (b.66–b.70), as recommended in [3]. As a result, we obtained a dataset composed of 14535 sequences. For each specific task, we define an ad hoc dataset, which we will describe in detail in the corresponding sections A.5.2 and A.6.4, essentially to ensure sufficient population in the classes
|
| 4 |
+
|
| 5 |
+
## Structure
|
| 6 |
+
|
| 7 |
+
- `data/` contains the data files.
|
| 8 |
+
- `dataset_script.py` contains the code to load and process the dataset.
|
| 9 |
+
|
| 10 |
+
## Usage
|
| 11 |
+
|
| 12 |
+
```python
|
| 13 |
+
from datasets import load_dataset
|
| 14 |
+
|
| 15 |
+
dataset = load_dataset("vkarthik095/filtered-SCOPe-2.08")
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
```markdown
|
| 19 |
+
## References
|
| 20 |
+
1. Lucrezia Valeriani, Francesca Cuturello, Alessio Ansuini, Alberto Cazzaniga. The geometry of hidden representations of protein language models. bioRxiv 2022.10.24.513504; doi: https://doi.org/10.1101/2022.10.24.513504
|
| 21 |
+
2. John-Marc Chandonia, Lindsey Guan, Shiangyi Lin, Changhua Yu, Naomi K Fox, and Steven E Brenner. SCOPe: improvements to the structural classification of proteins – extended database to facilitate variant interpretation and machine learning. Nucleic Acids Research, 50(D1):D553–D559, 12 2021
|
| 22 |
+
3. Johannes Söding and Michael Remmert. Protein sequence comparison and fold recognition: progress and good-practice benchmarking. Current opinion in structural biology, 21 3:404–411, 2011.
|
dataset_script.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import wget
|
| 2 |
+
import re
|
| 3 |
+
from Bio import SeqIO
|
| 4 |
+
import pandas as pd
|
| 5 |
+
|
| 6 |
+
def load_fasta_into_list(fasta_file):
|
| 7 |
+
"""
|
| 8 |
+
Load the FASTA file into a dictionary for quick lookup.
|
| 9 |
+
|
| 10 |
+
:param fasta_file: Path to the FASTA file
|
| 11 |
+
:return: List of dictionaries with processed sequences as keys and (id, description) as values
|
| 12 |
+
"""
|
| 13 |
+
fasta_list = []
|
| 14 |
+
scop_pattern = re.compile(r'\b[a-z]\.\d+\.\d+\.\d+\b')
|
| 15 |
+
|
| 16 |
+
for record in SeqIO.parse(fasta_file, "fasta"):
|
| 17 |
+
processed_sequence = str(record.seq)
|
| 18 |
+
fasta_list.append({
|
| 19 |
+
"id": record.id,
|
| 20 |
+
"primary" : processed_sequence,
|
| 21 |
+
"class": ".".join(record.description.split(" ")[1].split(".")[:-3]),
|
| 22 |
+
"fold": ".".join(record.description.split(" ")[1].split(".")[:-2]),
|
| 23 |
+
"super_family": ".".join(record.description.split(" ")[1].split(".")[:-1]),
|
| 24 |
+
"family": record.description.split(" ")[1],
|
| 25 |
+
"description": record.description,
|
| 26 |
+
})
|
| 27 |
+
return fasta_list
|
| 28 |
+
|
| 29 |
+
def should_exclude(record):
|
| 30 |
+
deets = record.description.split(" ")[1]
|
| 31 |
+
# print(deets)
|
| 32 |
+
fold = ".".join(deets.split(".")[:2])
|
| 33 |
+
return fold in excluded_folds
|
| 34 |
+
|
| 35 |
+
# URL of the file to download
|
| 36 |
+
url = "https://scop.berkeley.edu/downloads/scopeseq-2.08/astral-scopedom-seqres-gd-sel-gs-bib-40-2.08.fa"
|
| 37 |
+
|
| 38 |
+
# Download the file
|
| 39 |
+
file_name = wget.download(url)
|
| 40 |
+
print(f"\nDownloaded file: {file_name}")
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
excluded_folds = ['c.2', 'c.3', 'c.4', 'c.5', 'c.27', 'c.28', 'c.30', 'c.31', 'b.66', 'b.67', 'b.68', 'b.69', 'b.70']
|
| 44 |
+
|
| 45 |
+
fasta_list = [item for item in load_fasta_into_list(file_name) if item['fold'] not in excluded_folds]
|
| 46 |
+
|
| 47 |
+
df = pd.DataFrame(fasta_list)
|
| 48 |
+
|
| 49 |
+
df.to_csv('full_data.csv', index=False)
|
| 50 |
+
|
| 51 |
+
print(len(df))
|
full_data.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|