@@ -25,25 +25,25 @@ def new_write(string):
2525 st .error (str (e ))
2626
2727
28- def get_path_to_script (selected_pipeline , selected_project ):
28+ def get_path_to_script (selected_pipeline , selected_project , selected = "all" ):
2929 NX_shared_path = "/data/scratch/shared/RSE/NF-project-configurations/"
30- # e.g., /data/scratch/shared/RSE/NF-project-configurations/nf-long-reads/scripts
31- path = NX_shared_path + selected_project + "/scripts/"
32- # TODO: we need to rename all scripts and follow the same naming pattern to remove this extra complexity
33- if selected_project == "nf-long-reads" :
34- path = path + "epi2me-samples.sh"
35- elif selected_project == "nf-tp53" :
36- path = path + "tp53-samples.sh"
30+ # e.g., /data/scratch/shared/RSE/NF-project-configurations/epi2me-human-variation/nf-long-reads/scripts
31+ path = NX_shared_path + selected_pipeline + "/" + selected_project + "/scripts/"
32+ if selected == "all" :
33+ path = path + "launch_samples.sh"
34+ elif selected == "demo" :
35+ path = path + "launch_demo.sh"
3736 else :
38- print ("selected project is not supported yet" )
37+ path = path + "launch_sample_analysis.sh"
38+ raise Exception ("No support for sample runs on customised entries" )
3939 return path
4040
4141
4242# launch command based on the project
43- def pipe_cmd (username , selected_pipeline = None , selected_project = None , cmd_num = 0 ):
43+ def pipe_cmd (username , selected_pipeline = None , selected_project = None , cmd_num = 0 , selected_samples = "all" ):
4444 if cmd_num == 0 :
45- path_to_script = get_path_to_script (selected_pipeline , selected_project )
46- cmd_pipeline = f"sbatch { path_to_script } { username } "
45+ path_to_script = get_path_to_script (selected_pipeline , selected_project , selected_samples )
46+ cmd_pipeline = f"sbatch { path_to_script } "
4747 return cmd_pipeline
4848 elif cmd_num == 1 :
4949 cmd_pipeline = f"squeue -u { username } "
@@ -56,7 +56,7 @@ def pipe_cmd(username, selected_pipeline=None, selected_project=None, cmd_num=0)
5656 return cmd_pipeline
5757
5858
59- def tab (username , MY_SSH , selected_pipeline , selected_project ):
59+ def tab (username , MY_SSH , selected_pipeline , selected_project , selected_samples = "all" ):
6060 cols = st .columns ([1 , 1 , 1 ])
6161 with cols [0 ]:
6262 username = st .text_input (
@@ -67,7 +67,9 @@ def tab(username, MY_SSH, selected_pipeline, selected_project):
6767 )
6868
6969 def run_nextflow (): # username, MY_SSH, selected_pipeline, selected_project):
70- cmd_pipeline = pipe_cmd (username , selected_pipeline , selected_project , cmd_num = 0 ) # develop this
70+ cmd_pipeline = pipe_cmd (
71+ username , selected_pipeline , selected_project , cmd_num = 0 , selected_samples = "all"
72+ ) # develop this
7173 st .write ("Command used:" )
7274 st .code (cmd_pipeline )
7375 out_str , err_str = MY_SSH .run_cmd (cmd_pipeline , string = True )
0 commit comments