thewall commited on
Commit
289235c
·
1 Parent(s): 046ce08

Update deepbindweight.py

Browse files
Files changed (1) hide show
  1. deepbindweight.py +9 -6
deepbindweight.py CHANGED
@@ -8,7 +8,7 @@ import datasets
8
  logger = datasets.logging.get_logger(__name__)
9
 
10
  ID_POOL = ()
11
- URL = "https://huggingface.co/datasets/thewall/DeepBindWeight/resolve/main/params"
12
 
13
  class DeepBindWeightConfig(datasets.BuilderConfig):
14
  pass
@@ -26,16 +26,17 @@ class DeepBindWeight(datasets.GeneratorBasedBuilder):
26
  features=datasets.Features(
27
  {
28
  "config": datasets.Value("string"),
29
- "existed": datasets.Value("bool")
 
30
  }
31
  ),
32
  homepage="http://tools.genes.toronto.edu/deepbind",
33
  )
34
 
35
  def _split_generators(self, dl_manager):
36
- url = f"{URL}/{self.config.name}.txt"
37
- logger.info(f"download from {url}")
38
- downloaded_files = dl_manager.download_and_extract(url)
39
  return [
40
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files}),
41
  ]
@@ -43,7 +44,9 @@ class DeepBindWeight(datasets.GeneratorBasedBuilder):
43
  def _generate_examples(self, filepath):
44
  """This function returns the examples in the raw (text) form."""
45
  logger.info("generating examples from = %s", filepath)
46
- yield 0, {"config": filepath, "existed": os.path.exists(filepath)}
 
 
47
 
48
 
49
  if __name__=="__main__":
 
8
  logger = datasets.logging.get_logger(__name__)
9
 
10
  ID_POOL = ()
11
+ URL = "https://huggingface.co/datasets/thewall/DeepBindWeight/resolve/main/"
12
 
13
  class DeepBindWeightConfig(datasets.BuilderConfig):
14
  pass
 
26
  features=datasets.Features(
27
  {
28
  "config": datasets.Value("string"),
29
+ "existed": datasets.Value("bool"),
30
+ "table": datasets.Value("string")
31
  }
32
  ),
33
  homepage="http://tools.genes.toronto.edu/deepbind",
34
  )
35
 
36
  def _split_generators(self, dl_manager):
37
+ param_url = f"{URL}/params/{self.config.name}.txt"
38
+ table_url = f"{URL}/ERP001824-deepbind.xlsx"
39
+ downloaded_files = dl_manager.download_and_extract([param_url, table_url])
40
  return [
41
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files}),
42
  ]
 
44
  def _generate_examples(self, filepath):
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
+ "table": filepath[1]}
50
 
51
 
52
  if __name__=="__main__":