EC2 Default User
commited on
Commit
·
2a07266
1
Parent(s):
81941ad
move zip to s3
Browse files- human.csv +0 -3
- mouse_BALB_c.csv +0 -3
- mouse_C57BL_6.csv +0 -3
- oas-paired-sequence-data.py +9 -55
- rat_SD.csv +0 -3
human.csv
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:143c9ad2f008ffc36e1ad1b85567c1e61980305af5922223384944d2fed90dde
|
| 3 |
-
size 520174995
|
|
|
|
|
|
|
|
|
|
|
|
mouse_BALB_c.csv
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:a1ddbf5109598a3917e80c13491d9a6e44ac2fb0f6ae73e85a9317426f4c8c39
|
| 3 |
-
size 5102176
|
|
|
|
|
|
|
|
|
|
|
|
mouse_C57BL_6.csv
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:419efc54b5961543713f66048dee1d8944de462469ebc36ba619fcc975c7e332
|
| 3 |
-
size 3428906
|
|
|
|
|
|
|
|
|
|
|
|
oas-paired-sequence-data.py
CHANGED
|
@@ -1,25 +1,9 @@
|
|
| 1 |
-
|
| 2 |
-
#
|
| 3 |
-
#
|
| 4 |
-
#
|
| 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 |
-
# TODO: Address all TODOs and remove all explanatory comments
|
| 15 |
"""Paired sequences from the Observed Antibody Space database"""
|
| 16 |
-
|
| 17 |
-
|
| 18 |
import csv
|
| 19 |
-
import json
|
| 20 |
-
import os
|
| 21 |
-
import pandas as pd
|
| 22 |
-
|
| 23 |
import datasets
|
| 24 |
|
| 25 |
_CITATION = """\
|
|
@@ -39,11 +23,12 @@ _HOMEPAGE = "https://opig.stats.ox.ac.uk/webapps/oas/"
|
|
| 39 |
|
| 40 |
_LICENSE = "cc-by-4.0"
|
| 41 |
|
|
|
|
| 42 |
_URLS = {
|
| 43 |
-
"human": "human.
|
| 44 |
-
"rat_SD": "rat_SD.
|
| 45 |
-
"mouse_BALB_c": "mouse_BALB_c.
|
| 46 |
-
"mouse_C57BL_6": "mouse_C57BL_6.
|
| 47 |
}
|
| 48 |
|
| 49 |
_FEATURES = datasets.Features(
|
|
@@ -65,10 +50,6 @@ class OasPairedSequenceData(datasets.GeneratorBasedBuilder):
|
|
| 65 |
"""OAS paired sequence data."""
|
| 66 |
|
| 67 |
VERSION = datasets.Version("1.1.0")
|
| 68 |
-
|
| 69 |
-
# You will be able to load one or the other configurations in the following list with
|
| 70 |
-
# data = datasets.load_dataset('my_dataset', 'first_domain')
|
| 71 |
-
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
| 72 |
BUILDER_CONFIGS = [
|
| 73 |
datasets.BuilderConfig(name="human", version=VERSION, description="Human"),
|
| 74 |
datasets.BuilderConfig(name="rat_SD", version=VERSION, description="rat_SD"),
|
|
@@ -90,46 +71,19 @@ class OasPairedSequenceData(datasets.GeneratorBasedBuilder):
|
|
| 90 |
)
|
| 91 |
|
| 92 |
def _split_generators(self, dl_manager):
|
| 93 |
-
# TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
|
| 94 |
-
# If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
|
| 95 |
-
|
| 96 |
-
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
| 97 |
-
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
| 98 |
-
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
| 99 |
urls = _URLS[self.config.name]
|
| 100 |
data = dl_manager.download_and_extract(urls)
|
| 101 |
return [
|
| 102 |
datasets.SplitGenerator(
|
| 103 |
name=datasets.Split.TRAIN,
|
| 104 |
-
# These kwargs will be passed to _generate_examples
|
| 105 |
gen_kwargs={
|
| 106 |
"filepath": data,
|
| 107 |
"split": "train",
|
| 108 |
},
|
| 109 |
),
|
| 110 |
-
# datasets.SplitGenerator(
|
| 111 |
-
# name=datasets.Split.VALIDATION,
|
| 112 |
-
# # These kwargs will be passed to _generate_examples
|
| 113 |
-
# gen_kwargs={
|
| 114 |
-
# "filepath": os.path.join(data_dir, "dev.jsonl"),
|
| 115 |
-
# "split": "dev",
|
| 116 |
-
# },
|
| 117 |
-
# ),
|
| 118 |
-
# datasets.SplitGenerator(
|
| 119 |
-
# name=datasets.Split.TEST,
|
| 120 |
-
# # These kwargs will be passed to _generate_examples
|
| 121 |
-
# gen_kwargs={
|
| 122 |
-
# "filepath": os.path.join(data_dir, "test.jsonl"),
|
| 123 |
-
# "split": "test",
|
| 124 |
-
# },
|
| 125 |
-
# ),
|
| 126 |
]
|
| 127 |
|
| 128 |
-
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
| 129 |
def _generate_examples(self, filepath, split):
|
| 130 |
-
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
| 131 |
-
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
| 132 |
-
|
| 133 |
with open(filepath, newline="") as f:
|
| 134 |
reader = csv.reader(f, delimiter=",")
|
| 135 |
for key, row in enumerate(reader):
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
# coding=utf-8
|
| 3 |
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
| 4 |
+
# SPDX-License-Identifier: MIT-0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
"""Paired sequences from the Observed Antibody Space database"""
|
|
|
|
|
|
|
| 6 |
import csv
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
import datasets
|
| 8 |
|
| 9 |
_CITATION = """\
|
|
|
|
| 23 |
|
| 24 |
_LICENSE = "cc-by-4.0"
|
| 25 |
|
| 26 |
+
_BASE_URL = "https://aws-hcls-ml.s3.amazonaws.com/oas-paired-sequence-data/"
|
| 27 |
_URLS = {
|
| 28 |
+
"human": _BASE_URL + "human.zip",
|
| 29 |
+
"rat_SD": _BASE_URL + "rat_SD.zip",
|
| 30 |
+
"mouse_BALB_c": _BASE_URL + "mouse_BALB_c.zip",
|
| 31 |
+
"mouse_C57BL_6": _BASE_URL + "mouse_C57BL_6.zip",
|
| 32 |
}
|
| 33 |
|
| 34 |
_FEATURES = datasets.Features(
|
|
|
|
| 50 |
"""OAS paired sequence data."""
|
| 51 |
|
| 52 |
VERSION = datasets.Version("1.1.0")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
BUILDER_CONFIGS = [
|
| 54 |
datasets.BuilderConfig(name="human", version=VERSION, description="Human"),
|
| 55 |
datasets.BuilderConfig(name="rat_SD", version=VERSION, description="rat_SD"),
|
|
|
|
| 71 |
)
|
| 72 |
|
| 73 |
def _split_generators(self, dl_manager):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
urls = _URLS[self.config.name]
|
| 75 |
data = dl_manager.download_and_extract(urls)
|
| 76 |
return [
|
| 77 |
datasets.SplitGenerator(
|
| 78 |
name=datasets.Split.TRAIN,
|
|
|
|
| 79 |
gen_kwargs={
|
| 80 |
"filepath": data,
|
| 81 |
"split": "train",
|
| 82 |
},
|
| 83 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
]
|
| 85 |
|
|
|
|
| 86 |
def _generate_examples(self, filepath, split):
|
|
|
|
|
|
|
|
|
|
| 87 |
with open(filepath, newline="") as f:
|
| 88 |
reader = csv.reader(f, delimiter=",")
|
| 89 |
for key, row in enumerate(reader):
|
rat_SD.csv
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:c999367579296ad58beaadc22bc0c62729ecb43da828278ccf70aa36b4c3fd4a
|
| 3 |
-
size 16674377
|
|
|
|
|
|
|
|
|
|
|
|