Skip to content

Commit a914752

Browse files
committed
deactivate bed file input text when not required
1 parent f05463a commit a914752

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
epi2me-human-variation:
22
nf-long-reads:
33
is_inputType_path: False
4+
bed_file_as_arg: True
45
epi2me-basecalling:
56
genomrep-support:
6-
is_inputType_path: True
7+
is_inputType_path: False
8+
bed_file_as_arg: False
79
epi2me-somatic-variation:
810
mopopgen-support:
911
is_inputType_path: True
12+
bed_file_as_arg: False
1013
nfcore-rnaseq:
1114
nf-tp53:
1215
is_inputType_path: True
16+
bed_file_as_arg: False

pages/run_pipeline.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def reset_button_state():
3535
button_clicked = ss_values["button_clicked"]
3636
custom_sample_list = ss_values["custom_sample_list"] # only availanle if custom sample is selected
3737
BED_FILE = ss_values["BED_FILE"]
38-
samples = ["all", "demo", "customised"] # , "test"]
38+
samples = ["demo", "customised"] # , "test"]
3939

4040
# Create the selectbox and update session state
4141
pipeline_options = ["select"] + list(map_pipeline_project.keys())
@@ -73,11 +73,14 @@ def reset_button_state():
7373

7474
st.write("Your custom samples:", custom_sample_list)
7575
ss_set("custom_sample_list", custom_sample_list)
76+
77+
use_bed_file = map_pipeline_project[PIPELINE][PROJECT]["bed_file_as_arg"]#bool
7678
# Optional BED file path
7779
BED_FILE = st.text_input(
7880
"Optional BED file path",
7981
value="",
8082
help="Provide a full path to a BED file on Alma server, or leave empty to skip and use full genome",
83+
disabled=not use_bed_file
8184
)
8285
WORK_DIR = st.text_input("Working directory", value=WORK_DIR or SCRATCH)
8386
OUTPUT_DIR = st.text_input("Output directory", value=OUTPUT_DIR or SCRATCH)

tabs/tab_logon.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,26 @@ def update_group():
6464
"GROUP": ss_get("group_selection"),
6565
"SCRATCH": SCRATCH,
6666
"RDS": RDS,
67+
"WORK_DIR": SCRATCH,
68+
"OUTPUT_DIR": SCRATCH, # set default to scratch
6769
}
6870
)
6971

7072
def create_radio(GROUPS):
7173
options = GROUPS if GROUPS else []
7274
selection = ss_get("group_selection")
7375
index = options.index(selection) if selection in options else 0
76+
# Force initialize session_state manually if only one option
77+
if len(options) == 1:
78+
ss_set("temp_group_selection",options[0])
79+
update_group()
7480

7581
st.radio(
7682
"Select group",
7783
options,
7884
index=index,
7985
key="temp_group_selection", # Temporary key for updates
80-
on_change=update_group, # Calls update function on change
86+
on_change=update_group, # Calls update function on change
8187
)
8288

8389
# Handle connection
@@ -101,10 +107,6 @@ def create_radio(GROUPS):
101107
"password": password,
102108
"GROUP": GROUP,
103109
"GROUPS": GROUPS,
104-
"SCRATCH": SCRATCH,
105-
"WORK_DIR": SCRATCH,
106-
"OUTPUT_DIR": SCRATCH, # set default to scratch
107-
"RDS": RDS,
108110
"SAMPLE": SAMPLE,
109111
"PIPELINE": PIPELINE,
110112
"PROJECT": PROJECT,

0 commit comments

Comments
 (0)