Delete hg38.py
Browse files
hg38.py
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
2 |
-
#
|
3 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
-
# you may not use this file except in compliance with the License.
|
5 |
-
# You may obtain a copy of the License at
|
6 |
-
#
|
7 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
-
#
|
9 |
-
# Unless required by applicable law or agreed to in writing, software
|
10 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
-
# See the License for the specific language governing permissions and
|
13 |
-
# limitations under the License.
|
14 |
-
import json
|
15 |
-
import os
|
16 |
-
|
17 |
-
import datasets
|
18 |
-
import pandas as pd
|
19 |
-
|
20 |
-
_CITATION = """\
|
21 |
-
CITATION
|
22 |
-
"""
|
23 |
-
|
24 |
-
_DESCRIPTION = """\
|
25 |
-
DESCRIPTION
|
26 |
-
"""
|
27 |
-
|
28 |
-
_HOMEPAGE = "HOMEPAGE"
|
29 |
-
|
30 |
-
_LICENSE = ""
|
31 |
-
|
32 |
-
|
33 |
-
FILES = ["hg38_8k_train.jsonl", "hg38_8k_test.jsonl"]
|
34 |
-
|
35 |
-
|
36 |
-
task_list = [
|
37 |
-
"hg38_8k",
|
38 |
-
]
|
39 |
-
|
40 |
-
|
41 |
-
class hg38Config(datasets.BuilderConfig):
|
42 |
-
def __init__(self, **kwargs):
|
43 |
-
super().__init__(version=datasets.Version("1.0.0"), **kwargs)
|
44 |
-
|
45 |
-
|
46 |
-
class hg38(datasets.GeneratorBasedBuilder):
|
47 |
-
BUILDER_CONFIGS = [
|
48 |
-
hg38Config(
|
49 |
-
name=task_name,
|
50 |
-
)
|
51 |
-
for task_name in task_list
|
52 |
-
]
|
53 |
-
|
54 |
-
def _info(self):
|
55 |
-
return datasets.DatasetInfo(
|
56 |
-
description=_DESCRIPTION,
|
57 |
-
features=datasets.Features(
|
58 |
-
{
|
59 |
-
"chrom":datasets.Value("string"),
|
60 |
-
"start": datasets.Value("int32"),
|
61 |
-
"end": datasets.Value("int32"),
|
62 |
-
"seq": datasets.Value("string"),
|
63 |
-
}
|
64 |
-
),
|
65 |
-
homepage=_HOMEPAGE,
|
66 |
-
license=_LICENSE,
|
67 |
-
citation=_CITATION,
|
68 |
-
)
|
69 |
-
|
70 |
-
def _split_generators(self, dl_manager):
|
71 |
-
downloaded_files = dl_manager.download(FILES)
|
72 |
-
return [
|
73 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files[0]}),
|
74 |
-
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files[1]}),
|
75 |
-
]
|
76 |
-
|
77 |
-
def _generate_examples(self, filepath):
|
78 |
-
with open(filepath) as jsonl_file:
|
79 |
-
for row, line in enumerate(jsonl_file):
|
80 |
-
data = json.loads(line)
|
81 |
-
yield row, {
|
82 |
-
"chrom": data["chrom"],
|
83 |
-
"start": data["start"],
|
84 |
-
"end": data["end"],
|
85 |
-
"seq": data["seq"],
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|