EC2 Default User
commited on
Commit
•
a024f41
1
Parent(s):
0c215e1
Fix parse
Browse files- .gitignore +0 -2
- oas-paired-sequence-data.py +8 -8
- src/human_oas_data_units.txt +0 -170
- src/mouse_BALB_c_oas_data_units.txt +0 -8
- src/mouse_C57BL_6_oas_data_units.txt +0 -2
- src/oas-data-cleaning.py +0 -70
- src/rat_SD_oas_data_units.txt +0 -20
.gitignore
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
urls
|
2 |
-
src
|
|
|
|
|
|
oas-paired-sequence-data.py
CHANGED
@@ -126,13 +126,13 @@ class OasPairedSequenceData(datasets.GeneratorBasedBuilder):
|
|
126 |
continue
|
127 |
else:
|
128 |
yield key - 2, {
|
129 |
-
"sequence_alignment_aa_heavy": row[
|
130 |
-
"cdr1_aa_heavy": row[
|
131 |
-
"cdr2_aa_heavy": row[
|
132 |
-
"cdr3_aa_heavy": row[
|
133 |
-
"sequence_alignment_aa_light": row[
|
134 |
-
"cdr1_aa_light": row[
|
135 |
-
"cdr2_aa_light": row[
|
136 |
-
"cdr3_aa_light": row[
|
137 |
}
|
138 |
|
|
|
126 |
continue
|
127 |
else:
|
128 |
yield key - 2, {
|
129 |
+
"sequence_alignment_aa_heavy": row[14],
|
130 |
+
"cdr1_aa_heavy": row[37],
|
131 |
+
"cdr2_aa_heavy": row[41],
|
132 |
+
"cdr3_aa_heavy": row[47],
|
133 |
+
"sequence_alignment_aa_light": row[113],
|
134 |
+
"cdr1_aa_light": row[136],
|
135 |
+
"cdr2_aa_light": row[140],
|
136 |
+
"cdr3_aa_light": row[146],
|
137 |
}
|
138 |
|
src/human_oas_data_units.txt
DELETED
@@ -1,170 +0,0 @@
|
|
1 |
-
SRR10358523_paired.csv.gz
|
2 |
-
SRR10358524_paired.csv.gz
|
3 |
-
SRR10358525_paired.csv.gz
|
4 |
-
1287156_1_Paired_All.csv.gz
|
5 |
-
1279049_1_Paired_All.csv.gz
|
6 |
-
1287155_1_Paired_All.csv.gz
|
7 |
-
1279050_1_Paired_All.csv.gz
|
8 |
-
1287157_1_Paired_All.csv.gz
|
9 |
-
1279051_1_Paired_All.csv.gz
|
10 |
-
1287158_1_Paired_All.csv.gz
|
11 |
-
1279052_1_Paired_All.csv.gz
|
12 |
-
1287163_1_Paired_All.csv.gz
|
13 |
-
1279053_1_Paired_All.csv.gz
|
14 |
-
1287164_1_Paired_All.csv.gz
|
15 |
-
1279054_1_Paired_All.csv.gz
|
16 |
-
1287165_1_Paired_All.csv.gz
|
17 |
-
1279055_1_Paired_All.csv.gz
|
18 |
-
1287166_1_Paired_All.csv.gz
|
19 |
-
1279057_1_Paired_All.csv.gz
|
20 |
-
1287167_1_Paired_All.csv.gz
|
21 |
-
1279058_1_Paired_All.csv.gz
|
22 |
-
1287168_1_Paired_All.csv.gz
|
23 |
-
1279059_1_Paired_All.csv.gz
|
24 |
-
1287169_1_Paired_All.csv.gz
|
25 |
-
1279060_1_Paired_All.csv.gz
|
26 |
-
1287170_1_Paired_All.csv.gz
|
27 |
-
1279061_1_Paired_All.csv.gz
|
28 |
-
1287171_1_Paired_All.csv.gz
|
29 |
-
1279062_1_Paired_All.csv.gz
|
30 |
-
1287172_1_Paired_All.csv.gz
|
31 |
-
1279063_1_Paired_All.csv.gz
|
32 |
-
1287173_1_Paired_All.csv.gz
|
33 |
-
1279065_1_Paired_All.csv.gz
|
34 |
-
1287174_1_Paired_All.csv.gz
|
35 |
-
1279066_1_Paired_All.csv.gz
|
36 |
-
1287175_1_Paired_All.csv.gz
|
37 |
-
1279067_1_Paired_All.csv.gz
|
38 |
-
1287176_1_Paired_All.csv.gz
|
39 |
-
1279068_1_Paired_All.csv.gz
|
40 |
-
1287177_1_Paired_All.csv.gz
|
41 |
-
1279069_1_Paired_All.csv.gz
|
42 |
-
1287178_1_Paired_All.csv.gz
|
43 |
-
1279070_1_Paired_All.csv.gz
|
44 |
-
1287179_1_Paired_All.csv.gz
|
45 |
-
1279071_1_Paired_All.csv.gz
|
46 |
-
1287180_1_Paired_All.csv.gz
|
47 |
-
1279072_1_Paired_All.csv.gz
|
48 |
-
1287181_1_Paired_All.csv.gz
|
49 |
-
1279073_1_Paired_All.csv.gz
|
50 |
-
1287182_1_Paired_All.csv.gz
|
51 |
-
1279074_1_Paired_All.csv.gz
|
52 |
-
1287183_1_Paired_All.csv.gz
|
53 |
-
1279075_1_Paired_All.csv.gz
|
54 |
-
1287184_1_Paired_All.csv.gz
|
55 |
-
1279076_1_Paired_All.csv.gz
|
56 |
-
1287185_1_Paired_All.csv.gz
|
57 |
-
1279077_1_Paired_All.csv.gz
|
58 |
-
1287186_1_Paired_All.csv.gz
|
59 |
-
1279078_1_Paired_All.csv.gz
|
60 |
-
1287187_1_Paired_All.csv.gz
|
61 |
-
1279079_1_Paired_All.csv.gz
|
62 |
-
1287188_1_Paired_All.csv.gz
|
63 |
-
1279080_1_Paired_All.csv.gz
|
64 |
-
1287189_1_Paired_All.csv.gz
|
65 |
-
1287144_1_Paired_All.csv.gz
|
66 |
-
1287190_1_Paired_All.csv.gz
|
67 |
-
1287145_1_Paired_All.csv.gz
|
68 |
-
1287191_1_Paired_All.csv.gz
|
69 |
-
1287146_1_Paired_All.csv.gz
|
70 |
-
1287192_1_Paired_All.csv.gz
|
71 |
-
1287147_1_Paired_All.csv.gz
|
72 |
-
1287193_1_Paired_All.csv.gz
|
73 |
-
1287148_1_Paired_All.csv.gz
|
74 |
-
1287194_1_Paired_All.csv.gz
|
75 |
-
1287149_1_Paired_All.csv.gz
|
76 |
-
1287195_1_Paired_All.csv.gz
|
77 |
-
1287150_1_Paired_All.csv.gz
|
78 |
-
1287196_1_Paired_All.csv.gz
|
79 |
-
1287151_1_Paired_All.csv.gz
|
80 |
-
1287197_1_Paired_All.csv.gz
|
81 |
-
1287152_1_Paired_All.csv.gz
|
82 |
-
1287198_1_Paired_All.csv.gz
|
83 |
-
1287153_1_Paired_All.csv.gz
|
84 |
-
1287199_1_Paired_All.csv.gz
|
85 |
-
1287154_1_Paired_All.csv.gz
|
86 |
-
1287159_1_Paired_All.csv.gz
|
87 |
-
1287200_1_Paired_All.csv.gz
|
88 |
-
1287160_1_Paired_All.csv.gz
|
89 |
-
1287201_1_Paired_All.csv.gz
|
90 |
-
1287161_1_Paired_All.csv.gz
|
91 |
-
1287202_1_Paired_All.csv.gz
|
92 |
-
1287162_1_Paired_All.csv.gz
|
93 |
-
1287203_1_Paired_All.csv.gz
|
94 |
-
1287204_1_Paired_All.csv.gz
|
95 |
-
1287205_1_Paired_All.csv.gz
|
96 |
-
1287206_1_Paired_All.csv.gz
|
97 |
-
1287207_1_Paired_All.csv.gz
|
98 |
-
ERR4082227_paired.csv.gz
|
99 |
-
ERR4082235_paired.csv.gz
|
100 |
-
ERR4082243_paired.csv.gz
|
101 |
-
ERR4082251_paired.csv.gz
|
102 |
-
ERR4082259_paired.csv.gz
|
103 |
-
ERR4082263_paired.csv.gz
|
104 |
-
ERR4082267_paired.csv.gz
|
105 |
-
ERR4082275_paired.csv.gz
|
106 |
-
ERR4082283_paired.csv.gz
|
107 |
-
ERR4082291_paired.csv.gz
|
108 |
-
ERR4082299_paired.csv.gz
|
109 |
-
ERR4082303_paired.csv.gz
|
110 |
-
SRR12875348_1_Paired_All.csv.gz
|
111 |
-
SRR12875349_1_Paired_All.csv.gz
|
112 |
-
SRR12875350_1_Paired_All.csv.gz
|
113 |
-
SRR12875351_1_Paired_All.csv.gz
|
114 |
-
SRR12875352_1_Paired_All.csv.gz
|
115 |
-
SRR12875353_1_Paired_All.csv.gz
|
116 |
-
SRR12875354_1_Paired_All.csv.gz
|
117 |
-
SRR12875355_1_Paired_All.csv.gz
|
118 |
-
SRR12875356_1_Paired_All.csv.gz
|
119 |
-
SRR12875357_1_Paired_All.csv.gz
|
120 |
-
SRR12875358_1_Paired_All.csv.gz
|
121 |
-
SRR12875359_1_Paired_All.csv.gz
|
122 |
-
SRR12875360_1_Paired_All.csv.gz
|
123 |
-
SRR12875361_1_Paired_All.csv.gz
|
124 |
-
SRR12875362_1_Paired_All.csv.gz
|
125 |
-
SRR10313332_paired.csv.gz
|
126 |
-
SRR10313335_paired.csv.gz
|
127 |
-
SRR12113363_1_Paired_All.csv.gz
|
128 |
-
SRR12113364_1_Paired_All.csv.gz
|
129 |
-
1_S1__1_Paired_All.csv.gz
|
130 |
-
1a_S1__1_Paired_All.csv.gz
|
131 |
-
BT4p2_S2__1_Paired_All.csv.gz
|
132 |
-
1a_S1mod2_S1__1_Paired_All.csv.gz
|
133 |
-
BT4p1_S1__1_Paired_All.csv.gz
|
134 |
-
1a_S1mod_S1__1_Paired_All.csv.gz
|
135 |
-
1b_S2__1_Paired_All.csv.gz
|
136 |
-
1b_S2mod2_S1__1_Paired_All.csv.gz
|
137 |
-
1b_S2mod_S1__1_Paired_All.csv.gz
|
138 |
-
1c_S3__1_Paired_All.csv.gz
|
139 |
-
1c_S3mod_S1__1_Paired_All.csv.gz
|
140 |
-
1d_S4__1_Paired_All.csv.gz
|
141 |
-
1d_S4mod_S1__1_Paired_All.csv.gz
|
142 |
-
1e_S5__1_Paired_All.csv.gz
|
143 |
-
1e_S5pc__1_Paired_All.csv.gz
|
144 |
-
1f_S6__1_Paired_All.csv.gz
|
145 |
-
2_S2__1_Paired_All.csv.gz
|
146 |
-
2_S7__1_Paired_All.csv.gz
|
147 |
-
2a_S3__1_Paired_All.csv.gz
|
148 |
-
2a_S6__1_Paired_All.csv.gz
|
149 |
-
2b_S7__1_Paired_All.csv.gz
|
150 |
-
2c_S8__1_Paired_All.csv.gz
|
151 |
-
3a_S3__1_Paired_All.csv.gz
|
152 |
-
3a_S4__1_Paired_All.csv.gz
|
153 |
-
3b_S4__1_Paired_All.csv.gz
|
154 |
-
3b_S5__1_Paired_All.csv.gz
|
155 |
-
3c_S5__1_Paired_All.csv.gz
|
156 |
-
3c_S6__1_Paired_All.csv.gz
|
157 |
-
3d_S6__1_Paired_All.csv.gz
|
158 |
-
3d_S7__1_Paired_All.csv.gz
|
159 |
-
3e_S7__1_Paired_All.csv.gz
|
160 |
-
3e_S8__1_Paired_All.csv.gz
|
161 |
-
AT6md_S1__1_Paired_All.csv.gz
|
162 |
-
AT6me_S2__1_Paired_All.csv.gz
|
163 |
-
AT6p2a_S3__1_Paired_All.csv.gz
|
164 |
-
AT6p2b_S4__1_Paired_All.csv.gz
|
165 |
-
AT6p2c_S5__1_Paired_All.csv.gz
|
166 |
-
AT7ma_S7__1_Paired_All.csv.gz
|
167 |
-
AT7mb_S1__1_Paired_All.csv.gz
|
168 |
-
AT7mc_S2__1_Paired_All.csv.gz
|
169 |
-
AT7md_S3__1_Paired_All.csv.gz
|
170 |
-
AT7me_S4__1_Paired_All.csv.gz
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/mouse_BALB_c_oas_data_units.txt
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
SRR9179273_paired.csv.gz
|
2 |
-
SRR9179274_paired.csv.gz
|
3 |
-
SRR9179279_paired.csv.gz
|
4 |
-
SRR9179280_paired.csv.gz
|
5 |
-
SRR9179283_paired.csv.gz
|
6 |
-
SRR9179284_paired.csv.gz
|
7 |
-
SRR9179285_paired.csv.gz
|
8 |
-
SRR9179286_paired.csv.gz
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/mouse_C57BL_6_oas_data_units.txt
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
SRR11528761_paired.csv.gz
|
2 |
-
SRR11528762_paired.csv.gz
|
|
|
|
|
|
src/oas-data-cleaning.py
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
import boto3
|
2 |
-
import io
|
3 |
-
import os
|
4 |
-
import pandas as pd
|
5 |
-
import re
|
6 |
-
import shutil
|
7 |
-
import tarfile
|
8 |
-
|
9 |
-
data_dir = os.getcwd()
|
10 |
-
output_path = os.getcwd()
|
11 |
-
|
12 |
-
species_list = ["rat_SD", "mouse_BALB_c", "mouse_C57BL_6", "human"]
|
13 |
-
|
14 |
-
S3_BUCKET = "aws-hcls-ml"
|
15 |
-
S3_SRC_PREFIX = "oas-paired-sequence-data/raw"
|
16 |
-
S3_DEST_PREFIX = "oas-paired-sequence-data/parquet"
|
17 |
-
s3 = boto3.client("s3")
|
18 |
-
|
19 |
-
for species in species_list:
|
20 |
-
print(f"Downloading {species} files")
|
21 |
-
list_of_df = []
|
22 |
-
species_url_file = os.path.join(data_dir, species + "_oas_data_units.txt")
|
23 |
-
with open(species_url_file, "r") as f:
|
24 |
-
for csv_file in f.readlines():
|
25 |
-
print(csv_file)
|
26 |
-
filename = os.path.basename(csv_file)
|
27 |
-
run_id = str(re.search(r"^(.*)_[Pp]aired", filename)[1])
|
28 |
-
s3_key = os.path.join(S3_SRC_PREFIX, species, csv_file.strip())
|
29 |
-
obj = s3.get_object(Bucket=S3_BUCKET, Key=s3_key)
|
30 |
-
run_data = pd.read_csv(
|
31 |
-
io.BytesIO(obj["Body"].read()),
|
32 |
-
header=1,
|
33 |
-
compression="gzip",
|
34 |
-
on_bad_lines="warn",
|
35 |
-
low_memory=False,
|
36 |
-
)
|
37 |
-
run_data = run_data[
|
38 |
-
[
|
39 |
-
"sequence_alignment_aa_heavy",
|
40 |
-
"cdr1_aa_heavy",
|
41 |
-
"cdr2_aa_heavy",
|
42 |
-
"cdr3_aa_heavy",
|
43 |
-
"sequence_alignment_aa_light",
|
44 |
-
"cdr1_aa_light",
|
45 |
-
"cdr2_aa_light",
|
46 |
-
"cdr3_aa_light",
|
47 |
-
]
|
48 |
-
]
|
49 |
-
run_data = run_data.dropna()
|
50 |
-
run_data.insert(0, "data_unit", run_id)
|
51 |
-
list_of_df.append(run_data)
|
52 |
-
species_df = pd.concat(list_of_df, ignore_index=True)
|
53 |
-
print(f"{species} output summary:")
|
54 |
-
print(species_df.head())
|
55 |
-
print(species_df.shape)
|
56 |
-
os.makedirs(species, exist_ok=True)
|
57 |
-
species_df.to_parquet(species, partition_cols=["data_unit"])
|
58 |
-
zip_name = species + ".tar.gz"
|
59 |
-
print(f"Creating {zip_name}")
|
60 |
-
with tarfile.open(zip_name, "w:gz") as tf:
|
61 |
-
tf.add(species, arcname="")
|
62 |
-
print(
|
63 |
-
f"Uploading {zip_name} to {os.path.join('s3://', S3_BUCKET, S3_DEST_PREFIX)}"
|
64 |
-
)
|
65 |
-
s3.upload_file(zip_name, S3_BUCKET, os.path.join(S3_DEST_PREFIX, zip_name))
|
66 |
-
print(f"Removing {species}")
|
67 |
-
shutil.rmtree(species)
|
68 |
-
print(f"Removing {zip_name}")
|
69 |
-
os.remove(zip_name)
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/rat_SD_oas_data_units.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
SRR9179275_paired.csv.gz
|
2 |
-
SRR9179276_paired.csv.gz
|
3 |
-
SRR9179277_paired.csv.gz
|
4 |
-
SRR9179278_paired.csv.gz
|
5 |
-
SRR9179281_paired.csv.gz
|
6 |
-
SRR9179282_paired.csv.gz
|
7 |
-
SRR9179287_paired.csv.gz
|
8 |
-
SRR9179288_paired.csv.gz
|
9 |
-
SRR9179289_paired.csv.gz
|
10 |
-
SRR9179290_paired.csv.gz
|
11 |
-
SRR9179291_paired.csv.gz
|
12 |
-
SRR9179292_paired.csv.gz
|
13 |
-
SRR9179293_paired.csv.gz
|
14 |
-
SRR9179294_paired.csv.gz
|
15 |
-
SRR9179295_paired.csv.gz
|
16 |
-
SRR9179296_paired.csv.gz
|
17 |
-
SRR9179297_paired.csv.gz
|
18 |
-
SRR9179298_paired.csv.gz
|
19 |
-
SRR9179299_paired.csv.gz
|
20 |
-
SRR9179300_paired.csv.gz
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|