moseq2_app package

Main Module

Main functions that facilitate all jupyter notebook functionality.

moseq2_app.main.validate_inputs(inputs, progress_paths)

validate progress file input.

Args:

inputs (list): list of progress path inputs. progress_paths (dict): dictionary of notebook progress paths.

Returns:

error (bool): boolean flag for whether there is any error.

General Utilities Module

General utility functions.

class moseq2_app.util.bcolors

Bases: object

color UNICODE values used to color printed output.

BOLD = '\x1b[1m'
ENDC = '\x1b[0m'
FAIL = '\x1b[91m'
HEADER = '\x1b[95m'
OKBLUE = '\x1b[94m'
OKCYAN = '\x1b[96m'
OKGREEN = '\x1b[92m'
UNDERLINE = '\x1b[4m'
WARNING = '\x1b[93m'
moseq2_app.util.index_to_dataframe(index_path)

Read the index file into a dictionary and converts it into an editable DataFrame.

Args: index_path (str): Path to index file

Returns: index_data (dict): Dict object containing all parsed index file contents df (pd.DataFrame): Formatted dict in DataFrame form including each session’s metadata

moseq2_app.util.merge_labels_with_scalars(sorted_index, model_path)

Compute all the syllable statistics to plot, including syllable scalars.

Args: sorted_index (dict): Sorted dict of modeled sessions model_fit (dict): Trained AR-HMM results dict model_path (str): Respective path to the AR-HMM model in use. max_sylls (int): Maximum number of syllables to include

Returns: df (pd.DataFrame): Dataframe containing all of the mean syllable statistics scalar_df (pd.DataFrame): Dataframe containing the frame-by-frame scalar and label data

moseq2_app.util.read_and_clean_config(config_file)

read config files and reset incorrect parameters

Args:

config_file (dict): path to the config file

Returns:

config_data (dict): dictionary of config data.

moseq2_app.util.setup_model_folders(progress_paths)

Create model-specific folders

Args: progress_paths (dict): dictionary of notebook progress paths.

Returns: model_dict (dict): dictionary for model specific paths such as model_session_path, model_path, syll_info, syll_info_df and crowd_dir

moseq2_app.util.update_config(path: str) dict

update config.yaml with new paramters used.

Args:

path (str): path to config file.

moseq2_app.util.update_model_paths(desired_model, model_dict, progress_filepath)

Update relevant model paths in progress.yaml when specific model is chosen

Args: desired_model (str): file name of the desired specific model model_dict (dict): dictionary for model specific paths such as model_session_path, model_path, syll_info, syll_info_df and crowd_dir progress_filepath (str): path to progress.yaml

Returns: progress_paths (dict): dictionary of paths in the analysis

moseq2_app.util.uuid_lookup(target_uuid, uuid_dict_source)

Look up session infomtion with full/partial uuid. Helper function for users to look up uuid after running interactive_scalar_summary

Args: target_uuid (str): full or partial uuid the user wants to look up. uuid_dict (dict): dictionary from interactive_scalar_summary widget that has all the session information

moseq2_app.util.write_yaml(data, file)

write dictionary to yaml

Args:

data (dict): dictionary of data to be written to yaml file (str): string of yaml file name.

Subpackages