augernet.build_molecular_graphs¶
Molecular Graph Building¶
Builds PyTorch Geometric graphs for molecular property prediction. Supports both CEBE (Core Electron Binding Energy) and Auger spectroscopy outputs.
Usage: data_list = build_molecular_graphs( data_type='cebe', # 'cebe' or 'auger' source_type='calc', # 'calc', 'eval', or 'exp' ATOM_REP='SKIPATOM', raw_dir='/path/to/data', ... )
Key differences between graph types: - CEBE graphs: y = normalized (delta_be - mean) / std for binding energies - Auger graphs: y = flattened spectra [n_atoms, max_spec_len * 2] - Auger be_feature uses either molecular CEBE for carbons and atomic for others (be_feat = 'mol') or uses atomic reference values for all atoms (be_feat = 'atom') - CEBE be_feature uses atomic reference values for all atoms (be_feat = 'atom')
build_graphs(data_type, mol_file='mol_list.txt', auger_spin=None, auger_max_ke=273, auger_max_spec_len=300, DEBUG=False)
¶
Process calculated CEBE data using the feature-store approach.
All node features are stored as separate data.feat_* attributes.
data.x contains only the category_feature.
Source code in src/augernet/build_molecular_graphs.py
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 | |
get_butina_clusters(smiles_list, cutoff=0.65)
¶
Assign Butina cluster IDs from a list of SMILES strings.
Uses Morgan radius-2 / 1024-bit fingerprints (ECFP4) for the Tanimoto distance matrix, then Taylor-Butina clustering.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
smiles_list
|
list of str
|
SMILES for every molecule in the dataset. |
required |
cutoff
|
float
|
Distance cutoff passed to :func: |
0.65
|
Returns:
| Type | Description |
|---|---|
list of int
|
One cluster ID per molecule. |
Source code in src/augernet/build_molecular_graphs.py
get_per_atom_morgan_bits(mol, radius=1, n_bits=2048)
¶
Compute per-atom Morgan fingerprint bit sets for every atom.
This is the canonical low-level function used by all Morgan-FP consumers in this project (node features, locality analysis, etc.).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mol
|
RDKit Mol
|
Must already have explicit hydrogens ( |
required |
radius
|
int
|
Morgan FP radius. 1 = ECFP2, 2 = ECFP4, … |
1
|
n_bits
|
int
|
Number of bits in the hashed fingerprint. |
2048
|
Returns:
| Type | Description |
|---|---|
list[frozenset[int]]
|
One |