FOI-Bioinformatics / nanometa_live

A streamlined workflow and GUI for real-time species identification and pathogen characterization via nanopore sequencing data. Engineered for precision, speed, and user-friendliness, with offline functionality post-initialization.
GNU General Public License v3.0
15 stars 2 forks source link

Extend YAML Config Update Functionality to Include species_of_interest #28

Closed druvus closed 1 year ago

druvus commented 1 year ago

Summary:

This pull request extends the existing functionality for updating the YAML configuration file. It now allows for updating both single and nested variables in the YAML file, and adds the capability to update the species_of_interest field based on species names read from a species.txt file.

Changes:

  1. Utility Function for Nested Keys: Added a utility function called update_nested_dict that allows for updating nested keys in a dictionary. This is particularly useful for updating nested fields in the YAML configuration.

  2. Generic Config Update Function: Modified the existing update_config_file_with_comments function to make it more generic. It can now update both single and nested variables. It leverages the update_nested_dict function for this.

  3. Update Species of Interest: Added a new function called update_species_of_interest. This function uses species names in a list and updates the species_of_interest field in the YAML configuration file accordingly.