Update deepbindweight.py
Browse files- deepbindweight.py +8 -8
deepbindweight.py
CHANGED
|
@@ -1,7 +1,4 @@
|
|
| 1 |
import os
|
| 2 |
-
import json
|
| 3 |
-
import re
|
| 4 |
-
import pandas as pd
|
| 5 |
import datasets
|
| 6 |
|
| 7 |
|
|
@@ -27,7 +24,8 @@ class DeepBindWeight(datasets.GeneratorBasedBuilder):
|
|
| 27 |
{
|
| 28 |
"config": datasets.Value("string"),
|
| 29 |
"existed": datasets.Value("bool"),
|
| 30 |
-
"
|
|
|
|
| 31 |
}
|
| 32 |
),
|
| 33 |
homepage="http://tools.genes.toronto.edu/deepbind",
|
|
@@ -35,8 +33,9 @@ class DeepBindWeight(datasets.GeneratorBasedBuilder):
|
|
| 35 |
|
| 36 |
def _split_generators(self, dl_manager):
|
| 37 |
param_url = f"{URL}/params/{self.config.name}.txt"
|
| 38 |
-
|
| 39 |
-
|
|
|
|
| 40 |
return [
|
| 41 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files}),
|
| 42 |
]
|
|
@@ -45,8 +44,9 @@ class DeepBindWeight(datasets.GeneratorBasedBuilder):
|
|
| 45 |
"""This function returns the examples in the raw (text) form."""
|
| 46 |
logger.info("generating examples from = %s", filepath)
|
| 47 |
yield 0, {"config": filepath[0],
|
| 48 |
-
"existed": os.path.exists(filepath[0]) and os.path.exists(filepath[1]),
|
| 49 |
-
"
|
|
|
|
| 50 |
|
| 51 |
|
| 52 |
if __name__=="__main__":
|
|
|
|
| 1 |
import os
|
|
|
|
|
|
|
|
|
|
| 2 |
import datasets
|
| 3 |
|
| 4 |
|
|
|
|
| 24 |
{
|
| 25 |
"config": datasets.Value("string"),
|
| 26 |
"existed": datasets.Value("bool"),
|
| 27 |
+
"selex": datasets.Value("string"),
|
| 28 |
+
"tf": datasets.Value("string")
|
| 29 |
}
|
| 30 |
),
|
| 31 |
homepage="http://tools.genes.toronto.edu/deepbind",
|
|
|
|
| 33 |
|
| 34 |
def _split_generators(self, dl_manager):
|
| 35 |
param_url = f"{URL}/params/{self.config.name}.txt"
|
| 36 |
+
selex_url = f"{URL}/ERP001824-deepbind.xlsx"
|
| 37 |
+
tf_url = f"{URL}/ERP001824-UniprotKB.xlsx"
|
| 38 |
+
downloaded_files = dl_manager.download([param_url, selex_url, tf_url])
|
| 39 |
return [
|
| 40 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files}),
|
| 41 |
]
|
|
|
|
| 44 |
"""This function returns the examples in the raw (text) form."""
|
| 45 |
logger.info("generating examples from = %s", filepath)
|
| 46 |
yield 0, {"config": filepath[0],
|
| 47 |
+
"existed": os.path.exists(filepath[0]) and os.path.exists(filepath[1]) and os.path.exists(filepath[2]),
|
| 48 |
+
"selex": filepath[1],
|
| 49 |
+
'tf': filepath[2]}
|
| 50 |
|
| 51 |
|
| 52 |
if __name__=="__main__":
|