Convert molecule file formats using OpenBabel
convert_molecule.Rd
This function converts molecular structure files between different formats using the OpenBabel chemical toolbox. It supports converting a single file, multiple files, or all files in a directory.
Usage
convert_molecule(
input_file,
input_format = NULL,
output_file = NULL,
output_format = NULL,
output_dir = "converted",
pattern = NULL,
recursive = FALSE,
obabel_path = NULL
)
Arguments
- input_file
Character, path to the input molecule file, or a character vector of file paths, or a directory containing molecule files to convert
- input_format
Character, format of the input file, default NULL (auto-detect from file extension)
- output_file
Character, path to the output file, default NULL (auto-generate based on input file name)
- output_format
Character, format for the output file, default NULL (auto-detect from output file extension)
- output_dir
Character, directory to save output files, default converted
- pattern
Character, file pattern to match when input_file is a directory, default NULL (all files)
- recursive
Logical, whether to search recursively in directories, default FALSE
- obabel_path
Character, path to OpenBabel executable, default NULL (uses GLUEDOCK_OBABEL_PATH environment variable)