@@ -28,7 +28,8 @@ def pipe_cmd(
2828 work_dir = "work" ,
2929 output_dir = "output" ,
3030 custom_sample_list = [],
31- bed_file = ""
31+ bed_file = "" ,
32+ dry_run = False
3233):
3334 def get_pipeline_command ():
3435 """Generate the pipeline execution command based on the sample selection."""
@@ -37,17 +38,19 @@ def get_pipeline_command():
3738 # not sure if this is the best thing-using job id for filenamne
3839 log_out = f"{ work_dir } /logs/%j.out"
3940 log_err = f"{ work_dir } /logs/%j.err"
40-
41- args = []
41+
42+ args = [path_to_script ]
4243 base_cmd = f"sbatch -o { log_out } -e { log_err } "
4344
4445 if selected_samples == "demo" :
45- args = [path_to_script , work_dir , output_dir ]
46+ args + = [work_dir , output_dir ]
4647
47- elif selected_samples == "all" :
48+ elif selected_samples == "all" :#I removed this option
4849 #./your_script.sh --env "/my/custom/env" --work-dir "my_work" --outdir "my_output" --config "my_config" --params "parans.json" --bed file.bed
49- args = [
50- path_to_script ,
50+ if dry_run :
51+ args .append ("--dry-run" )
52+
53+ args += [
5154 "--work-dir" , work_dir ,
5255 "--outdir" , output_dir ,
5356 ]
@@ -57,17 +60,16 @@ def get_pipeline_command():
5760 elif selected_samples == "customised" :
5861 if not custom_sample_list :
5962 raise ValueError ("custom_sample_list cannot be empty" )
60- args = [
61- path_to_script ,
63+ if dry_run :
64+ args .append ("--dry-run" )
65+ args += [
6266 "--work-dir" , work_dir ,
6367 "--outdir" , output_dir ,
6468 "--samples" , "\t " .join (custom_sample_list ),
6569 ]
6670 if bed_file :
6771 args += ["--bed" , bed_file ]
68- # elif selected_samples == "test": #this will become dry-run, but I should develop it for all scripts
69- # cmd_pipeline += f"sbatch -o {log_out} -e {log_err} /data/scratch/DCO/DIGOPS/SCIENCOM/msarkis/NF-project-configurations/test.sh --work-dir {work_dir} --outdir {output_dir}"
70-
72+
7173 preamble = f"""
7274 mkdir -p { work_dir } /logs
7375 cd { work_dir }
0 commit comments