coalispr.resources.dialog¶
Module for gathering user-input.
Attributes¶
Classes¶
Present dialog based around given messages. |
Functions¶
|
Assemble a list of samples to be used by groupcompare. |
|
Collect tuple with coordinates for region to display or, if no |
Obtain user feedback for name of experiment/session. |
|
|
Collect tuple with old and new name for a sample in the experiment-file |
|
Obtain user choice for items from given list. |
|
Store Coalispr data and configuration files in suggested directory. |
Module Contents¶
- coalispr.resources.dialog.logger¶
- class coalispr.resources.dialog.PresentDialog(msg, item, pattern, per_confirm=True, fcie=None)¶
Present dialog based around given messages.
- msg¶
Welcome message
- Type:
str
- item¶
Requested item
- Type:
str
- pattern¶
Regular expression to validate user input
- Type:
str
- per_confirm¶
Flag to use confirm-dialog to verify output
- Type:
bool
- fcie¶
Function for extra test and that analyzes user input
- Type:
function
- SKIP = 'skip_this'¶
- msg1¶
- item¶
- pattern¶
- stop = 'stop'¶
- stopmsg¶
- msg2 = Multiline-String¶
Show Value
"""{} will be set to: {} Is that OK?"""
- errortext = Multiline-String¶
Show Value
""" Sorry, '{0}' cannot be used. {1}?"""
- fcie = None¶
- per_confirm = True¶
- try_input(commandinput)¶
Check (string) directly given input via the command line.
- Parameters:
commandinput (str) – List of input argumnets converted to string that can be parsed by self.fcie and matches pattern.
- display_dialog()¶
Show dialog with options.
- display_choices(choices, evalas=None)¶
Show choices for doing something.
- Parameters:
choices (dir) – Choicename: choice
evalas (str) – alternative string to display
- coalispr.resources.dialog.assemble_groupsamples(groups, agroup, trimmings)¶
Assemble a list of samples to be used by groupcompare.
- Parameters:
groups (dict of dicts) – Nested dictionaries of samples organized by grouping (from experiment.mixed_groups() )
agroup (str) – Name of chosen group or type to compare samples for.
trimmings (str) – Chosen setting for defining trimming sequence.
- Return type:
List of selected items.
- coalispr.resources.dialog.collect_limits(chrnam, rangex)¶
Collect tuple with coordinates for region to display or, if no chromosome, a pair of limits setting a range.
- Parameters:
chrnam (str) – Name of the chromosome for which the region is returned.
rangex (tuple) – Start and end of region/range to be analyzed.
- Returns:
Dialog to gather and return chromosomal coordinates for the region or
a pair of limits.
- coalispr.resources.dialog.get_experiment_name()¶
Obtain user feedback for name of experiment/session.
- coalispr.resources.dialog.get_old_new_samplenames(todolist)¶
Collect tuple with old and new name for a sample in the experiment-file
- Return type:
Dialog to gather and return names for samples.
- coalispr.resources.dialog.select_from(alist)¶
Obtain user choice for items from given list.
- Parameters:
alist (list) – List of items, or of dicts with items, to choose from.
- Return type:
List of selected items.
- coalispr.resources.dialog.suggest_storepath(path=None)¶
Store Coalispr data and configuration files in suggested directory.
- Parameters:
path (Path) – Location of configuration files (default: None); CONFPATH might not be set properly yet, absent at beginning and needs to be chosen.
- Returns:
Local storage folder including sub-folders for data and configuration
templates (‘constant_in’)