Update tg2.py
Browse files
tg2.py
CHANGED
|
@@ -60,6 +60,18 @@ _URLS = {
|
|
| 60 |
"round_8": "/".join([_URL, "DRR201869/DRR201869.fastq.gz"]),
|
| 61 |
}
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
_FORWARD_PRIMER = "TAATACGACTCACTATAGGGAGCAGGAGAGAGGTCAGATG"
|
| 64 |
_REVERSE_PRIMER = "CCTATGCGTGCTAGTGTGA"
|
| 65 |
_DESIGN_LENGTH = 30
|
|
@@ -71,7 +83,6 @@ _DESIGN_LENGTH = 30
|
|
| 71 |
"add_reverse_primer":"CCTATGCGTGCTAGTGTGA",
|
| 72 |
"""
|
| 73 |
|
| 74 |
-
|
| 75 |
class TG2Config(datasets.BuilderConfig):
|
| 76 |
"""BuilderConfig for SQUAD."""
|
| 77 |
|
|
@@ -91,7 +102,7 @@ class TG2(datasets.GeneratorBasedBuilder):
|
|
| 91 |
"""SQUAD: The Stanford Question Answering Dataset. Version 1.1."""
|
| 92 |
|
| 93 |
BUILDER_CONFIGS = [
|
| 94 |
-
TG2Config(name=key, url=
|
| 95 |
]
|
| 96 |
|
| 97 |
DEFAULT_CONFIG_NAME = "round_4"
|
|
@@ -150,10 +161,4 @@ class TG2(datasets.GeneratorBasedBuilder):
|
|
| 150 |
return False
|
| 151 |
if self.config.remove_primer:
|
| 152 |
example["seq"] = seq[len(_FORWARD_PRIMER):len(seq)-len(_REVERSE_PRIMER)]
|
| 153 |
-
return True
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
if __name__=="__main__":
|
| 157 |
-
from datasets import load_dataset
|
| 158 |
-
dataset = load_dataset("tg2.py", split="all")
|
| 159 |
-
|
|
|
|
| 60 |
"round_8": "/".join([_URL, "DRR201869/DRR201869.fastq.gz"]),
|
| 61 |
}
|
| 62 |
|
| 63 |
+
_HUGGINGFACE_URLS = {
|
| 64 |
+
"round_0": "https://huggingface.co/datasets/thewall/tg2/resolve/main/data/DRR201861.fastq.gz",
|
| 65 |
+
"round_1": "https://huggingface.co/datasets/thewall/tg2/resolve/main/data/DRR201862.fastq.gz",
|
| 66 |
+
"round_2": "https://huggingface.co/datasets/thewall/tg2/resolve/main/data/DRR201863.fastq.gz",
|
| 67 |
+
"round_3": "https://huggingface.co/datasets/thewall/tg2/resolve/main/data/DRR201864.fastq.gz",
|
| 68 |
+
"round_4": "https://huggingface.co/datasets/thewall/tg2/resolve/main/data/DRR201865.fastq.gz",
|
| 69 |
+
"round_5": "https://huggingface.co/datasets/thewall/tg2/resolve/main/data/DRR201866.fastq.gz",
|
| 70 |
+
"round_6": "https://huggingface.co/datasets/thewall/tg2/resolve/main/data/DRR201867.fastq.gz",
|
| 71 |
+
"round_7": "https://huggingface.co/datasets/thewall/tg2/resolve/main/data/DRR201868.fastq.gz",
|
| 72 |
+
"round_8": "https://huggingface.co/datasets/thewall/tg2/resolve/main/data/DRR201869.fastq.gz",
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
_FORWARD_PRIMER = "TAATACGACTCACTATAGGGAGCAGGAGAGAGGTCAGATG"
|
| 76 |
_REVERSE_PRIMER = "CCTATGCGTGCTAGTGTGA"
|
| 77 |
_DESIGN_LENGTH = 30
|
|
|
|
| 83 |
"add_reverse_primer":"CCTATGCGTGCTAGTGTGA",
|
| 84 |
"""
|
| 85 |
|
|
|
|
| 86 |
class TG2Config(datasets.BuilderConfig):
|
| 87 |
"""BuilderConfig for SQUAD."""
|
| 88 |
|
|
|
|
| 102 |
"""SQUAD: The Stanford Question Answering Dataset. Version 1.1."""
|
| 103 |
|
| 104 |
BUILDER_CONFIGS = [
|
| 105 |
+
TG2Config(name=key, url=_HUGGINGFACE_URLS[key]) for key in _URLS
|
| 106 |
]
|
| 107 |
|
| 108 |
DEFAULT_CONFIG_NAME = "round_4"
|
|
|
|
| 161 |
return False
|
| 162 |
if self.config.remove_primer:
|
| 163 |
example["seq"] = seq[len(_FORWARD_PRIMER):len(seq)-len(_REVERSE_PRIMER)]
|
| 164 |
+
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|