Skip to content

Commit

Permalink
env for base_url
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarrett-scripps committed Jan 24, 2024
1 parent ba3eacc commit ca7d9ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ def get_env_str(var_name, default):
VALID_PROTEASES = copy.deepcopy(PROTEASES)
VALID_PROTEASES.pop('non-specific', None)
VALID_PROTEASES = {k.replace(' ', '_'): v for k, v in VALID_PROTEASES.items()}

BASE_URL = get_env_str('BASE_URL', 'http://localhost:8501')
5 changes: 2 additions & 3 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import matplotlib as mpl
from peptacular.term.modification import add_n_term_modification, add_c_term_modification

from constants import LINK
from constants import LINK, BASE_URL


def fetch_sequence_from_uniprot(accession_number):
Expand Down Expand Up @@ -198,7 +198,6 @@ def generate_app_url(protein_id, protein_sequence, proteases, custom_regex, miss
min_charge, max_charge, min_mz, max_mz, remove_non_proteotypic, n_term_static_mod,
c_term_static_mod, num_static_mods, n_term_var_mod, c_term_var_mod, max_var_mods,
num_variable_mods, static_mods, variable_mods):
base_url = 'http://localhost:8501/'

# flip the dictionary
static_mods_rev = {}
Expand Down Expand Up @@ -240,7 +239,7 @@ def generate_app_url(protein_id, protein_sequence, proteases, custom_regex, miss
'variable_mods': variable_mod_str
}
query_string = '&'.join([f'{key}={value}' for key, value in params.items() if value is not None])
return f'{base_url}?{query_string}'
return f'{BASE_URL}?{query_string}'


def make_clickable(sequence, mass_type):
Expand Down

0 comments on commit ca7d9ae

Please sign in to comment.