Skip to content

Commit

Permalink
for issue #195, allowing notes field to be populated and added to the…
Browse files Browse the repository at this point in the history
… top of the report
  • Loading branch information
aineniamh committed Nov 27, 2023
1 parent 858b5b6 commit 83497f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions piranha/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def main(sysargs = sys.argv[1:]):
misc_group.add_argument('--runname',action="store",help=f"Run name to appear in report. Default: {VALUE_RUNNAME}")
misc_group.add_argument('--username',action="store",help="Username to appear in report. Default: no user name")
misc_group.add_argument('--institute',action="store",help="Institute name to appear in report. Default: no institute name")
misc_group.add_argument('--notes',action="store",help="Miscellaneous notes to appear at top of report. Default: no notes")
misc_group.add_argument('--orientation',action="store",help="Orientation of barcodes in wells on a 96-well plate. If `well` is supplied as a column in the barcode.csv, this default orientation will be overwritten. Default: `vertical`. Options: `vertical` or `horizontal`.")
misc_group.add_argument('-t', '--threads', action='store',dest="threads",type=int,help="Number of threads. Default: 1")
misc_group.add_argument("--verbose",action="store_true",help="Print lots of stuff to screen")
Expand Down Expand Up @@ -154,6 +155,7 @@ def main(sysargs = sys.argv[1:]):
args.username,
args.institute,
args.runname,
args.notes,
config)
# runs qc checks on the phylo input options and configures the phylo settings
# now need tempdir for this parsing, so run after directory_setup
Expand Down
5 changes: 5 additions & 0 deletions piranha/data/report.mako
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,11 @@
%if config["institute"]!="":
<h3><strong>${LANGUAGE_CONFIG["6"]}</strong> | ${config["institute"].lstrip("'").rstrip("'")}</h3>
%endif
%if config["notes"]!="":
<hr>
<p>${config["notes"].lstrip("'").rstrip("'")}</p>
<hr>
%endif
<div class="info_box">
<p>${LANGUAGE_CONFIG["52"]}</p>
</div>
Expand Down
6 changes: 4 additions & 2 deletions piranha/input_parsing/initialising.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ def get_defaults():
KEY_POSITIVE:VALUE_POSITIVE,
KEY_NEGATIVE:VALUE_NEGATIVE,
KEY_INSTITUTE:"",
KEY_NOTES:"",
KEY_THREADS:1,
KEY_VERBOSE:False,

KEY_CONFIGURATION_TABLE_FIELDS: VALUE_CONFIGURATION_TABLE_FIELDS,
KEY_COLOUR_MAP: VALUE_COLOUR_MAP,
KEY_COLOUR_THEME: VALUE_COLOUR_THEME
Expand Down Expand Up @@ -200,12 +201,13 @@ def setup_config_dict(cwd,config_arg):
config[KEY_INPUT_PATH] = cwd
return config

def misc_args_to_config(verbose,threads,username,institute,run_name,config):
def misc_args_to_config(verbose,threads,username,institute,run_name,notes,config):
misc.add_arg_to_config(KEY_VERBOSE,verbose,config)
misc.add_arg_to_config(KEY_THREADS,threads,config)
misc.add_arg_to_config(KEY_USERNAME,username,config)
misc.add_arg_to_config(KEY_INSTITUTE,institute,config)
misc.add_arg_to_config(KEY_RUNNAME,run_name,config)
misc.add_arg_to_config(KEY_NOTES,notes,config)

def set_up_verbosity(config):
if config[KEY_VERBOSE]:
Expand Down
1 change: 1 addition & 0 deletions piranha/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
KEY_USERNAME="username"
KEY_INSTITUTE="institute"
KEY_RUNNAME="runname"
KEY_NOTES="notes"
KEY_VERBOSE="verbose"
KEY_THREADS="threads"
KEY_LOG_API="log_api"
Expand Down

0 comments on commit 83497f0

Please sign in to comment.