## SMILES Splitter Script The file splitter script (`split_file.sh`) is used to split large SMILES files into smaller parts. ### Usage ```bash ./split_smi.sh [max_size_mb] ``` - ``: The SMILES file to split - `[max_size_mb]`: Optional. The maximum size of each part in MB (default: 1024) ### Running with xargs for parallel processing To split multiple files in parallel: ```bash find . -name "*.smi" | xargs -n1 -P$(nproc) ./split_file.sh ``` To specify a custom size (e.g., 500 MB): ```bash find . -name "*.smi" | xargs -n2 -P$(nproc) ./split_file.sh {} 500 ``` Note: This script will delete the original file if it was split successfully. ## SELFIES Converter Script The SELFIES converter script (`selfies_converter.py`) converts SMILES files to SELFIES format. ### Usage ```bash python selfies_converter.py [-v] [-b BATCH_SIZE] ``` - ``: The SMILES file to convert - `-v, --verbose`: Optional. Increase output verbosity - `-b BATCH_SIZE, --batch-size BATCH_SIZE`: Optional. Batch size for processing (default: 10000) ### Running with find and xargs for parallel processing To convert all .smi files in parallel: ```bash find . -name "*.smi" | xargs -I {} -P$(nproc) sh -c 'python selfies_converter.py {}' ``` To convert files and remove the original .smi files after successful conversion: ```bash find . -name "*.smi" | xargs -I {} -P$(nproc) sh -c 'python selfies_converter.py {} && rm {}' ``` Note: Be cautious when using the command that removes original files. Ensure you have backups before running it. With gz: ```bash find . -name "*.smi.gz" | xargs -P$(nproc) -I {} sh -c 'f="{}"; g="${f%.gz}"; gzip -dc "$f" > "$g" && python selfies_converter.py "$g" && rm "$g" && rm "$f"' ``` ## Output Both scripts will create output files in the same directory as the input files: - The file splitter creates `.part01.smi`, `.part02.smi`, etc. - The SELFIES converter creates `.selfies` for the converted file and `.alph` for the alphabet file.