diff --git a/src/nplinker/genomics/bgc.py b/src/nplinker/genomics/bgc.py index 77f16543..8decbb81 100644 --- a/src/nplinker/genomics/bgc.py +++ b/src/nplinker/genomics/bgc.py @@ -229,17 +229,17 @@ def _to_string(value: Any) -> str: """ # Convert list to comma-separated string if isinstance(value, list): - value = ", ".join(map(str, value)) + formatted_value = ", ".join(map(str, value)) # Convert dict to comma-separated string elif isinstance(value, dict): - value = ", ".join([f"{k}:{v}" for k, v in value.items()]) + formatted_value = ", ".join([f"{k}:{v}" for k, v in value.items()]) # Convert None to empty string elif value is None: - value = "" + formatted_value = "" # Convert anything else to string else: - value = str(value) - return value + formatted_value = str(value) + return formatted_value # CG: why not providing whole product but only amino acid as product monomer? # this property is not used in NPLinker core business. diff --git a/src/nplinker/metabolomics/spectrum.py b/src/nplinker/metabolomics/spectrum.py index 2674f461..6928a4f1 100644 --- a/src/nplinker/metabolomics/spectrum.py +++ b/src/nplinker/metabolomics/spectrum.py @@ -149,14 +149,14 @@ def _to_string(value: Any) -> str: """ # Convert list to comma-separated string if isinstance(value, list): - value = ", ".join(map(str, value)) + formatted_value = ", ".join(map(str, value)) # Convert dict to comma-separated string elif isinstance(value, dict): - value = ", ".join([f"{k}:{v}" for k, v in value.items()]) + formatted_value = ", ".join([f"{k}:{v}" for k, v in value.items()]) # Convert None to empty string elif value is None: - value = "" + formatted_value = "" # Convert anything else to string else: - value = str(value) - return value + formatted_value = str(value) + return formatted_value