thewall commited on
Commit
f4717e7
·
1 Parent(s): 9af8b19

Update deepbindweight.py

Browse files
Files changed (1) hide show
  1. 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
- "table": datasets.Value("string")
 
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
- table_url = f"{URL}/ERP001824-deepbind.txt"
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
  ]
@@ -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
- "table": filepath[1]}
 
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__":