metabolike package

Subpackages

Submodules

metabolike.config module

class metabolike.config.BrendaConfig(**data)

Bases: BaseModel

bkms_react_file: str
brenda_file: str
class metabolike.config.Config(**data)

Bases: BaseModel

brenda: Optional[BrendaConfig]
metacyc: MetacycConfig
neo4j: Neo4jConfig
class metabolike.config.MetacycConfig(**data)

Bases: BaseModel

atom_mapping: Optional[str]
classes: Optional[str]
compounds: Optional[str]
pathways: Optional[str]
publications: Optional[str]
reactions: Optional[str]
sbml: str
class metabolike.config.Neo4jConfig(**data)

Bases: BaseModel

database: str
password: SecretStr
uri: str
user: str
metabolike.config.load_config(config_file)
Return type

Config

metabolike.main module

metabolike.main.serve()

Serves an API to the graph database.

The command uses the following environment variables to configure the database connection: METABOLIKE_DB_URI, METABOLIKE_DB_USER, METABOLIKE_DB_PASSWORD, and METABOLIKE_DB_NAME.

Alternatively, you may save the variables in a file named “metabolike.env” in the current directory.

metabolike.main.setup(config_file=<typer.models.OptionInfo object>, create_db=<typer.models.OptionInfo object>, drop_if_exists=<typer.models.OptionInfo object>)

metabolike.utils module

metabolike.utils.add_kv_to_dict(d, k, v, as_list=False)

Add a key-value pair to a dictionary.

Parameters
  • d (Dict[str, Any]) – Dictionary to add the key-value pair to.

  • k (str) – Key to add.

  • v (Any) – Value to add.

  • as_list (bool) – If True, the value is appended to the list identified by k.

Return type

Dict[str, Any]

Returns

Dictionary with the key-value pair added. If the key already exists, the value is saved as a list.

metabolike.utils.chunk(itr, chunk_size)

Chunk an iterator into chunks of size chunk_size.

Ref: https://stackoverflow.com/a/71572942/5925357

Return type

Iterable

metabolike.utils.generate_gene_reaction_rule(genes)
metabolike.utils.snake_to_camel(s, sep='-')

Convert snake_case to CamelCase.

Parameters
  • s (str) – String to convert.

  • sep (str) – Separator to use.

Return type

str

Returns

camelCase string.

metabolike.utils.validate_path(filepath: Union[str, Path]) Path
metabolike.utils.validate_path(filepath: None) None
Return type

Optional[Path]

Module contents

Build graph database from BRENDA and BioCyc for studying reprogrammed metabolisms.