Skip to content

Commit

Permalink
update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
RoriCremer committed Apr 11, 2022
1 parent fc7015c commit 1f53709
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
output_table_prefix = str(uuid.uuid4()).split("-")[0]
print(f"running with prefix {output_table_prefix}")

PET_VET_TABLE_COUNT = -1
REF_VET_TABLE_COUNT = -1
client = None

EXTRACT_SAMPLE_TABLE = f"{output_table_prefix}_sample_names"
Expand All @@ -45,7 +45,7 @@ def dump_job_stats():
print(" Total GBs billed ", total/(1024 * 1024 * 1024), " GBs")

def get_partition_range(i):
if i < 1 or i > PET_VET_TABLE_COUNT:
if i < 1 or i > REF_VET_TABLE_COUNT:
raise ValueError(f"out of partition range")

return { 'start': (i-1)*SAMPLES_PER_PARTITION + 1, 'end': i*SAMPLES_PER_PARTITION }
Expand Down Expand Up @@ -152,7 +152,7 @@ def get_ref_subselect(fq_ref_table, samples, id):
f" `{fq_ref_table}` WHERE sample_id IN ({sample_stanza})), "
return sql

for i in range(1, PET_VET_TABLE_COUNT+1):
for i in range(1, REF_VET_TABLE_COUNT+1):
partition_samples = get_samples_for_partition(sample_ids, i) #sample ids for the partition

if len(partition_samples) > 0:
Expand Down Expand Up @@ -185,7 +185,7 @@ def get_ref_subselect(fq_vet_table, samples, id):
f" `{fq_vet_table}` WHERE sample_id IN ({sample_stanza})), "
return sql

for i in range(1, PET_VET_TABLE_COUNT+1):
for i in range(1, REF_VET_TABLE_COUNT+1):
partition_samples = get_samples_for_partition(sample_ids, i) #sample ids for the partition

if len(partition_samples) > 0:
Expand Down Expand Up @@ -265,16 +265,16 @@ def make_extract_table(control_samples,

## TODO -- provide a cmdline arg to override this (so we can simulate smaller datasets)

global PET_VET_TABLE_COUNT ## TODO why are we using PET here?
PET_VET_TABLE_COUNT = max_tables
global REF_VET_TABLE_COUNT ## TODO why are we using PET here?
REF_VET_TABLE_COUNT = max_tables

global TEMP_TABLE_TTL_HOURS
TEMP_TABLE_TTL_HOURS = temp_table_ttl_hours

global TEMP_TABLE_TTL
TEMP_TABLE_TTL = f" OPTIONS( expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL {TEMP_TABLE_TTL_HOURS} HOUR)) "

print(f"Using {PET_VET_TABLE_COUNT} tables in {fq_ranges_dataset}...")
print(f"Using {REF_VET_TABLE_COUNT} tables in {fq_ranges_dataset}...")

# if we have a file of sample names, load it into a temporary table
if (sample_names_to_extract):
Expand Down

0 comments on commit 1f53709

Please sign in to comment.