Skip to content

Commit

Permalink
fixing formatting error
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedanth-Ramji authored Nov 5, 2023
1 parent 50e0447 commit e9068aa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions argnorm/normalizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@

_ROOT = os.path.abspath(os.path.dirname(__file__))

def is_number(num):
"""
Required for checking aro mappings to discern between numbers and other
string identifiers.
"""
try:
float(num)
except ValueError:
return False

return True

def get_data_path(path, getting_manual_curation):
"""
Gets mapping tables and manual curation tables.
Expand Down Expand Up @@ -126,6 +138,7 @@ def get_aro_mapping_table(self):
if self.tool != 'argsoap' and self.mode != 'orfs':
df.loc[aro_nan_indices[i], 'Gene Name in CARD'] = manual_curation.loc[i, 'Gene Name in CARD']

df[TARGET_ARO_COL] = df[TARGET_ARO_COL].map(lambda a: f'ARO:{int(float(a)) if is_number(a) == True else a}')
return df

def load_input(self, input_file):
Expand Down

0 comments on commit e9068aa

Please sign in to comment.