EC2 Default User
commited on
Commit
·
fc382c2
1
Parent(s):
47dc5e5
Update unzip code
Browse files- oas-paired-sequence-data.py +17 -16
oas-paired-sequence-data.py
CHANGED
@@ -122,20 +122,21 @@ class OasPairedSequenceData(datasets.GeneratorBasedBuilder):
|
|
122 |
|
123 |
def _generate_examples(self, filepaths):
|
124 |
for filepath in filepaths:
|
125 |
-
with gzip.open(
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
|
|
141 |
|
|
|
122 |
|
123 |
def _generate_examples(self, filepaths):
|
124 |
for filepath in filepaths:
|
125 |
+
with gzip.open(filepath) as z:
|
126 |
+
with open(z, "r") as f:
|
127 |
+
reader = csv.reader(f, delimiter=",")
|
128 |
+
for key, row in enumerate(reader):
|
129 |
+
if key < 2:
|
130 |
+
continue
|
131 |
+
else:
|
132 |
+
yield key - 2, {
|
133 |
+
"sequence_alignment_aa_heavy": row[10],
|
134 |
+
"cdr1_aa_heavy": row[35],
|
135 |
+
"cdr2_aa_heavy": row[39],
|
136 |
+
"cdr3_aa_heavy": row[43],
|
137 |
+
"sequence_alignment_aa_light": row[100],
|
138 |
+
"cdr1_aa_light": row[123],
|
139 |
+
"cdr2_aa_light": row[127],
|
140 |
+
"cdr3_aa_light": row[131],
|
141 |
+
}
|
142 |
|