Commit
·
a8f5cc9
1
Parent(s):
8641604
set msa as list; label as tensor
Browse files
contact_prediction_binary_rag.py
CHANGED
@@ -149,11 +149,12 @@ _CITATION = """
|
|
149 |
|
150 |
# You can copy an official description
|
151 |
_DESCRIPTION = """
|
|
|
152 |
"""
|
153 |
|
154 |
-
_HOMEPAGE = "
|
155 |
|
156 |
-
_LICENSE = "
|
157 |
|
158 |
class DownStreamConfig(datasets.BuilderConfig):
|
159 |
"""BuilderConfig for downstream taks dataset."""
|
@@ -176,7 +177,7 @@ class DownStreamTasks(datasets.GeneratorBasedBuilder):
|
|
176 |
{
|
177 |
"seq": datasets.Value("string"),
|
178 |
"label": datasets.Array2D(shape=(None, 2), dtype='int32'),
|
179 |
-
"msa": datasets.Value("string"),
|
180 |
"str_emb": datasets.Array2D(shape=(None, 384), dtype='float32'),
|
181 |
}
|
182 |
)
|
@@ -200,6 +201,7 @@ class DownStreamTasks(datasets.GeneratorBasedBuilder):
|
|
200 |
valid_parquet_file = dl_manager.download(f"data/valid-00000-of-00001.parquet")
|
201 |
test_parquet_file = dl_manager.download(f"data/test-00000-of-00001.parquet")
|
202 |
msa_path = dl_manager.download_and_extract(f"msa.tar")
|
|
|
203 |
str_file = dl_manager.download(f"md5_to_str.fasta")
|
204 |
codebook_file = dl_manager.download(f"codebook.pt")
|
205 |
|
@@ -260,6 +262,19 @@ class DownStreamTasks(datasets.GeneratorBasedBuilder):
|
|
260 |
yield key, {
|
261 |
"seq": seq,
|
262 |
"label": label,
|
263 |
-
"msa":
|
264 |
"str_emb": str_emb
|
265 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
# You can copy an official description
|
151 |
_DESCRIPTION = """
|
152 |
+
Contact map prediction aims to determine whether two residues, $i$ and $j$, are in contact or not, based on their distance with a certain threshold ($<$8 Angstrom). This task is an important part of the early Alphafold version for structural prediction.
|
153 |
"""
|
154 |
|
155 |
+
_HOMEPAGE = "https://huggingface.co/datasets/genbio-ai/contact_prediction_binary_rag"
|
156 |
|
157 |
+
_LICENSE = "Apache license 2.0"
|
158 |
|
159 |
class DownStreamConfig(datasets.BuilderConfig):
|
160 |
"""BuilderConfig for downstream taks dataset."""
|
|
|
177 |
{
|
178 |
"seq": datasets.Value("string"),
|
179 |
"label": datasets.Array2D(shape=(None, 2), dtype='int32'),
|
180 |
+
"msa": datasets.Sequence(datasets.Value("string")),
|
181 |
"str_emb": datasets.Array2D(shape=(None, 384), dtype='float32'),
|
182 |
}
|
183 |
)
|
|
|
201 |
valid_parquet_file = dl_manager.download(f"data/valid-00000-of-00001.parquet")
|
202 |
test_parquet_file = dl_manager.download(f"data/test-00000-of-00001.parquet")
|
203 |
msa_path = dl_manager.download_and_extract(f"msa.tar")
|
204 |
+
# msa_path = dl_manager.download(f"msa")
|
205 |
str_file = dl_manager.download(f"md5_to_str.fasta")
|
206 |
codebook_file = dl_manager.download(f"codebook.pt")
|
207 |
|
|
|
262 |
yield key, {
|
263 |
"seq": seq,
|
264 |
"label": label,
|
265 |
+
"msa": msa,
|
266 |
"str_emb": str_emb
|
267 |
}
|
268 |
+
|
269 |
+
def _as_dataset(
|
270 |
+
self,
|
271 |
+
split: Optional[datasets.Split] = None,
|
272 |
+
**kwargs
|
273 |
+
) -> datasets.Dataset:
|
274 |
+
dataset = super()._as_dataset(split=split, **kwargs)
|
275 |
+
dataset.set_format(
|
276 |
+
type="numpy",
|
277 |
+
columns=["label", "str_emb"],
|
278 |
+
output_all_columns=True
|
279 |
+
)
|
280 |
+
return dataset
|