Io
Robust, memory-efficient SMILES string handling library.
Provides unified streaming interface for processing SMILES from various sources with comprehensive error handling, validation, and memory optimization.
SMILESProcessor(validate_smiles=True, skip_invalid=True, max_length=10000, chunk_size=1000)
¶
Memory-efficient SMILES string processor with robust error handling.
Handles various input formats and provides streaming interface for processing large datasets without memory overflow.
Initialize SMILES processor.
PARAMETER | DESCRIPTION |
---|---|
validate_smiles
|
Whether to validate SMILES syntax
TYPE:
|
skip_invalid
|
Skip invalid SMILES instead of raising errors
TYPE:
|
max_length
|
Maximum allowed SMILES length (None for no limit)
TYPE:
|
chunk_size
|
Batch size for processing operations
TYPE:
|
chunk_size = chunk_size
¶
max_length = max_length
¶
skip_invalid = skip_invalid
¶
validate_smiles = validate_smiles
¶
get_stats()
¶
Get processing statistics.
stream(input_data)
¶
Stream SMILES records from various input types.
PARAMETER | DESCRIPTION |
---|---|
input_data
|
File path, single SMILES, or iterable of SMILES |
YIELDS | DESCRIPTION |
---|---|
SMILESRecord
|
Validated SMILES records with metadata
TYPE::
|
RAISES | DESCRIPTION |
---|---|
SMILESStreamError
|
If input cannot be processed |
stream_batches(input_data, batch_size=None)
¶
SMILESRecord(smiles, identifier='', source_line=None, metadata=dict())
¶
process_smiles_file(filepath, **kwargs)
¶
Convenience function for processing SMILES files.
stream_smiles(input_data, **kwargs)
¶
Convenience function for streaming SMILES.