EC2 Default User commited on
Commit
0d959d7
1 Parent(s): d87f45f
oas-paired-sequence-data.py CHANGED
@@ -90,8 +90,7 @@ class OasPairedSequenceData(datasets.GeneratorBasedBuilder):
90
  datasets.SplitGenerator(
91
  name=datasets.Split.TRAIN,
92
  gen_kwargs={
93
- # "filepath": os.path.join(data_dir, "train.csv"),
94
- "filepath": data_dir['train'],
95
  "split": "train",
96
  },
97
  ),
 
90
  datasets.SplitGenerator(
91
  name=datasets.Split.TRAIN,
92
  gen_kwargs={
93
+ "filepath": os.path.join(data_dir, "train.csv"),
 
94
  "split": "train",
95
  },
96
  ),
src/mouse_C57BL_6.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d610083fbd6e7efb45d1675b341bd1cd375b99465f040363ce70953e6a7a46cf
3
- size 379666
 
 
 
 
src/oas-data-cleaning.py CHANGED
@@ -1,13 +1,17 @@
1
  import os
2
  import pandas as pd
3
  import re
 
 
4
 
5
  data_dir = os.getcwd()
6
  output_path = os.getcwd()
7
 
8
  species_list = ["human", "rat_SD", "mouse_BALB_c", "mouse_C57BL_6"]
9
 
10
-
 
 
11
  for species in species_list:
12
  print(f"Downloading {species} files")
13
  list_of_df = []
@@ -50,18 +54,6 @@ for species in species_list:
50
  return row
51
 
52
  run_data = run_data.apply(calc_cdr_coordinates, axis=1)
53
-
54
- # run_data = run_data.drop(
55
- # columns=[
56
- # "cdr1_aa_heavy",
57
- # "cdr2_aa_heavy",
58
- # "cdr3_aa_heavy",
59
- # "cdr1_aa_light",
60
- # "cdr2_aa_light",
61
- # "cdr3_aa_light",
62
- # ]
63
- # )
64
-
65
  run_data.insert(
66
  0, "pair_id", run_id + "_" + run_data.reset_index().index.map(str)
67
  )
@@ -70,7 +62,19 @@ for species in species_list:
70
  print(f"{species} output summary:")
71
  print(species_df.head())
72
  print(species_df.shape)
73
- output_file_name = os.path.join(output_path, species + ".zip")
 
74
  print(f"Creating {output_file_name}")
75
- species_df.to_csv(output_file_name, index=False, compression="zip")
 
 
 
 
 
 
 
 
 
 
 
76
 
 
1
  import os
2
  import pandas as pd
3
  import re
4
+ from zipfile import ZipFile
5
+ import boto3
6
 
7
  data_dir = os.getcwd()
8
  output_path = os.getcwd()
9
 
10
  species_list = ["human", "rat_SD", "mouse_BALB_c", "mouse_C57BL_6"]
11
 
12
+ S3_BUCKET = "aws-hcls-ml"
13
+ S3_PREFIX = "oas-paired-sequence-data"
14
+ s3 = boto3.client('s3')
15
  for species in species_list:
16
  print(f"Downloading {species} files")
17
  list_of_df = []
 
54
  return row
55
 
56
  run_data = run_data.apply(calc_cdr_coordinates, axis=1)
 
 
 
 
 
 
 
 
 
 
 
 
57
  run_data.insert(
58
  0, "pair_id", run_id + "_" + run_data.reset_index().index.map(str)
59
  )
 
62
  print(f"{species} output summary:")
63
  print(species_df.head())
64
  print(species_df.shape)
65
+ # output_file_name = os.path.join(output_path, species + ".zip")
66
+ output_file_name = os.path.join(output_path, "train.csv")
67
  print(f"Creating {output_file_name}")
68
+ # species_df.to_csv(output_file_name, index=False, compression="zip")
69
+ species_df.to_csv(output_file_name, index=False)
70
+ # zip_name = os.path.join(output_path, species + ".zip")
71
+ zip_name = species + ".zip"
72
+ with ZipFile(zip_name, "w") as myzip:
73
+ myzip.write('train.csv')
74
+ s3.upload_file(zip_name, S3_BUCKET, os.path.join(S3_PREFIX, zip_name))
75
+ os.remove(output_file_name)
76
+ os.remove(zip_name)
77
+
78
+
79
+
80
 
src/train.csv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:bdffac439366acf3043668b2242cfe2e533dd37e2a6fac78fbaea6eb1a45f0ca
3
- size 379714