Skip to content

Commit

Permalink
removed column constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
jrober84 committed Sep 24, 2024
1 parent b43d78e commit c6c246f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion genomic_address_service/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def run_call(config):
if thresh_map_file is not None:
threshold_map = json.load(open(thresh_map_file,'r'))
else:
threshold_map = init_threshold_map(membership_file,thresholds)
threshold_map = init_threshold_map(thresholds)


run_data['threshold_map'] = threshold_map
Expand Down
17 changes: 3 additions & 14 deletions genomic_address_service/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,10 @@ def write_cluster_assignments(file ,memberships, threshold_map, outfmt, delimete
else:
fp.write(file, df, compression='GZIP')

def init_threshold_map(file,thresholds):
def init_threshold_map(thresholds):
thresh_map = {}
df = pd.read_csv(file,header=0,sep="\t")
cols = df.columns.values.tolist()
valid_cols = []
for idx,value in enumerate(cols):
if value in ['sample_id','id','ST','nomenclature','address']:
continue
valid_cols.append(value)

if len(valid_cols) != len(thresholds):
return {}

for idx,value in enumerate(valid_cols):
thresh_map[value] = thresholds[idx]
for idx,value in enumerate(thresholds):
thresh_map[idx] = value

return thresh_map

0 comments on commit c6c246f

Please sign in to comment.