EC2 Default User commited on
Commit ·
0ee293f
1
Parent(s): f36a018
tar.gz
Browse files- oas-paired-sequence-data.py +7 -4
- src/oas-data-cleaning.py +11 -5
oas-paired-sequence-data.py
CHANGED
|
@@ -25,11 +25,14 @@ _HOMEPAGE = "https://opig.stats.ox.ac.uk/webapps/oas/"
|
|
| 25 |
_LICENSE = "cc-by-4.0"
|
| 26 |
_BASE_URL = "https://aws-hcls-ml.s3.amazonaws.com/oas-paired-sequence-data/processed/"
|
| 27 |
_URLS = {
|
| 28 |
-
# "human": _BASE_URL + "human.zip",
|
|
|
|
|
|
|
|
|
|
| 29 |
"human": _BASE_URL + "test.tar.gz",
|
| 30 |
-
"rat_SD": _BASE_URL + "rat_SD.
|
| 31 |
-
"mouse_BALB_c": _BASE_URL + "mouse_BALB_c.
|
| 32 |
-
"mouse_C57BL_6": _BASE_URL + "mouse_C57BL_6.
|
| 33 |
}
|
| 34 |
|
| 35 |
_FEATURES = datasets.Features(
|
|
|
|
| 25 |
_LICENSE = "cc-by-4.0"
|
| 26 |
_BASE_URL = "https://aws-hcls-ml.s3.amazonaws.com/oas-paired-sequence-data/processed/"
|
| 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 |
"human": _BASE_URL + "test.tar.gz",
|
| 33 |
+
"rat_SD": _BASE_URL + "rat_SD.tar.gz",
|
| 34 |
+
"mouse_BALB_c": _BASE_URL + "mouse_BALB_c.tar.gz",
|
| 35 |
+
"mouse_C57BL_6": _BASE_URL + "mouse_C57BL_6.tar.gz",
|
| 36 |
}
|
| 37 |
|
| 38 |
_FEATURES = datasets.Features(
|
src/oas-data-cleaning.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
import os
|
| 2 |
import pandas as pd
|
| 3 |
import re
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
import boto3
|
| 6 |
import io
|
| 7 |
|
|
@@ -9,7 +11,7 @@ data_dir = os.getcwd()
|
|
| 9 |
output_path = os.getcwd()
|
| 10 |
|
| 11 |
# species_list = ["rat_SD", "mouse_BALB_c", "mouse_C57BL_6", "human"]
|
| 12 |
-
species_list = ["
|
| 13 |
|
| 14 |
S3_BUCKET = "aws-hcls-ml"
|
| 15 |
S3_SRC_PREFIX = "oas-paired-sequence-data/raw"
|
|
@@ -73,10 +75,14 @@ for species in species_list:
|
|
| 73 |
print(f"Creating {output_file_name}")
|
| 74 |
# species_df.to_csv(output_file_name, index=False, compression="zip")
|
| 75 |
species_df.to_csv(output_file_name, index=False)
|
| 76 |
-
zip_name = species + ".zip"
|
|
|
|
| 77 |
print(f"Creating {zip_name}")
|
| 78 |
-
with ZipFile(zip_name, "w") as myzip:
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
| 80 |
print(
|
| 81 |
f"Uploading {zip_name} to {os.path.join('s3://', S3_BUCKET, S3_DEST_PREFIX)}"
|
| 82 |
)
|
|
|
|
| 1 |
import os
|
| 2 |
import pandas as pd
|
| 3 |
import re
|
| 4 |
+
|
| 5 |
+
# from zipfile import ZipFile
|
| 6 |
+
import tarfile
|
| 7 |
import boto3
|
| 8 |
import io
|
| 9 |
|
|
|
|
| 11 |
output_path = os.getcwd()
|
| 12 |
|
| 13 |
# species_list = ["rat_SD", "mouse_BALB_c", "mouse_C57BL_6", "human"]
|
| 14 |
+
species_list = ["rat_SD"]
|
| 15 |
|
| 16 |
S3_BUCKET = "aws-hcls-ml"
|
| 17 |
S3_SRC_PREFIX = "oas-paired-sequence-data/raw"
|
|
|
|
| 75 |
print(f"Creating {output_file_name}")
|
| 76 |
# species_df.to_csv(output_file_name, index=False, compression="zip")
|
| 77 |
species_df.to_csv(output_file_name, index=False)
|
| 78 |
+
# zip_name = species + ".zip"
|
| 79 |
+
zip_name = species + ".tar.gz"
|
| 80 |
print(f"Creating {zip_name}")
|
| 81 |
+
# with ZipFile(zip_name, "w") as myzip:
|
| 82 |
+
# myzip.write("train.csv")
|
| 83 |
+
|
| 84 |
+
with tarfile.open(zip_name, "w:gz") as tf:
|
| 85 |
+
tf.add("train.csv")
|
| 86 |
print(
|
| 87 |
f"Uploading {zip_name} to {os.path.join('s3://', S3_BUCKET, S3_DEST_PREFIX)}"
|
| 88 |
)
|