EC2 Default User commited on
Commit
0236f5a
1 Parent(s): 0d959d7
Files changed (1) hide show
  1. src/oas-data-cleaning.py +7 -9
src/oas-data-cleaning.py CHANGED
@@ -7,11 +7,12 @@ import boto3
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 = []
@@ -26,7 +27,7 @@ for species in species_list:
26
  header=1,
27
  compression="gzip",
28
  on_bad_lines="warn",
29
- low_memory=False
30
  )
31
  run_data = run_data[
32
  [
@@ -65,16 +66,13 @@ for species in species_list:
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
 
 
7
  data_dir = os.getcwd()
8
  output_path = os.getcwd()
9
 
10
+ # species_list = ["rat_SD", "mouse_BALB_c", "mouse_C57BL_6", "human"]
11
+ species_list = ["rat_SD"]
12
 
13
  S3_BUCKET = "aws-hcls-ml"
14
  S3_PREFIX = "oas-paired-sequence-data"
15
+ s3 = boto3.client("s3")
16
  for species in species_list:
17
  print(f"Downloading {species} files")
18
  list_of_df = []
 
27
  header=1,
28
  compression="gzip",
29
  on_bad_lines="warn",
30
+ low_memory=False,
31
  )
32
  run_data = run_data[
33
  [
 
66
  # output_file_name = os.path.join(output_path, species + ".zip")
67
  output_file_name = os.path.join(output_path, "train.csv")
68
  print(f"Creating {output_file_name}")
69
+ species_df.to_csv(output_file_name, index=False, compression="zip")
70
+ # species_df.to_csv(output_file_name, index=False)
71
  # zip_name = os.path.join(output_path, species + ".zip")
72
  zip_name = species + ".zip"
73
  with ZipFile(zip_name, "w") as myzip:
74
+ myzip.write("train.csv")
75
  s3.upload_file(zip_name, S3_BUCKET, os.path.join(S3_PREFIX, zip_name))
76
  os.remove(output_file_name)
77
  os.remove(zip_name)
 
 
 
78