Skip to content

Commit c0bd191

Browse files
authored
Address non-standard atoms parsing for polymer residues (#212)
* Update README.md * Update amino_acid_constants.py * Update dna_constants.py * Update rna_constants.py
1 parent 41e8124 commit c0bd191

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ A visualization of the molecules of life used in the repository can be seen and
5252

5353
- <a href="https://github.com/dhuvik">Dhuvi</a> for fixing a bug related to metal ion molecule ID assignment for `Alphafold3Inputs`!
5454

55+
- Tom (from the Discord channel) for identifying a discrepancy between this codebase's distogram and template unit vector computations and those of OpenFold (and <a href="https://github.com/vandrw">Andrei</a> for addressing these issues)!
56+
57+
- <a href="https://github.com/CyaNine">Kaihui</a> for identifying a bug in how non-standard atoms were handled in polymer residues!
58+
5559
- <a href="https://github.com/patrick-kidger">Patrick</a> for <a href="https://docs.kidger.site/jaxtyping/">jaxtyping</a>, <a href="https://github.com/fferflo">Florian</a> for <a href="https://github.com/fferflo/einx">einx</a>, and of course, <a href="https://github.com/arogozhnikov">Alex</a> for <a href="https://einops.rocks/">einops</a>
5660

5761
## Install

alphafold3_pytorch/common/amino_acid_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"CZ3",
4646
"NZ",
4747
# "OXT", # NOTE: This often appears in mmCIF files, but it will not be used for any amino acid type in AlphaFold.
48-
"_",
48+
"ATM", # NOTE: This represents a catch-all atom type for non-standard or modified residues.
4949
"_",
5050
"_",
5151
"_",
@@ -57,7 +57,7 @@
5757
"_",
5858
"_", # 10 null types.
5959
]
60-
element_types = [atom_type[0] for atom_type in atom_types]
60+
element_types = [atom_type if atom_type == "ATM" else atom_type[0] for atom_type in atom_types]
6161
atom_types_set = set(atom_types)
6262
atom_order = {atom_type: i for i, atom_type in enumerate(atom_types)}
6363
atom_type_num = len(atom_types) # := 37 + 10 null types := 47.

alphafold3_pytorch/common/dna_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"N2",
4040
"O4",
4141
"C7",
42-
"_",
42+
"ATM", # NOTE: This represents a catch-all atom type for non-standard or modified residues.
4343
"_",
4444
"_",
4545
"_",
@@ -59,7 +59,7 @@
5959
"_",
6060
"_", # 19 null types.
6161
]
62-
element_types = [atom_type[0] for atom_type in atom_types]
62+
element_types = [atom_type if atom_type == "ATM" else atom_type[0] for atom_type in atom_types]
6363
atom_types_set = set(atom_types)
6464
atom_order = {atom_type: i for i, atom_type in enumerate(atom_types)}
6565
atom_type_num = len(atom_types) # := 28 + 19 null types := 47.

alphafold3_pytorch/common/rna_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"O6",
4040
"N2",
4141
"O4",
42-
"_",
42+
"ATM", # NOTE: This represents a catch-all atom type for non-standard or modified residues.
4343
"_",
4444
"_",
4545
"_",
@@ -59,7 +59,7 @@
5959
"_",
6060
"_", # 19 null types.
6161
]
62-
element_types = [atom_type[0] for atom_type in atom_types]
62+
element_types = [atom_type if atom_type == "ATM" else atom_type[0] for atom_type in atom_types]
6363
atom_types_set = set(atom_types)
6464
atom_order = {atom_type: i for i, atom_type in enumerate(atom_types)}
6565
atom_type_num = len(atom_types) # := 28 + 19 null types := 47.

0 commit comments

Comments
 (0)