Skip to content

Commit

Permalink
add a flag for parse_atoms_with_zero_occupancy
Browse files Browse the repository at this point in the history
  • Loading branch information
jdauparas committed Feb 19, 2024
1 parent a45f6f1 commit 1fcad04
Show file tree
Hide file tree
Showing 5 changed files with 809 additions and 4 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,17 @@ python run.py \
--parse_these_chains_only "B"
```

### 34 parse atoms with zero occupancy
Parse atoms in the PDB files with zero occupancy too.
```
python run.py \
--model_type "ligand_mpnn" \
--seed 111 \
--pdb_path "./inputs/1BC8.pdb" \
--out_folder "./outputs/parse_atoms_with_zero_occupancy" \
--parse_atoms_with_zero_occupancy 1
```

### Things to add
- Support for ProteinMPNN CA-only model.
- Examples for scoring sequences only.
Expand Down
7 changes: 4 additions & 3 deletions data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,17 +513,17 @@ def get_aligned_coordinates(protein_atoms, CA_dict: dict, atom_name: str):

def parse_PDB(
input_path: str,
atom_context_num=8,
device: str = "cpu",
chains: list = [],
parse_all_atoms: bool = False,
parse_atoms_with_zero_occupancy: bool = False
):
"""
input_path : path for the input PDB
atom_context_num: number of nearest ligand context atoms per residue
device: device for the torch.Tensor
chains: a list specifying which chains need to be parsed; e.g. ["A", "B"]
parse_all_atoms: if False parse only N,CA,C,O otherwise all 37 atoms
parse_atoms_with_zero_occupancy: if True atoms with zero occupancy will be parsed
"""
element_list = [
"H",
Expand Down Expand Up @@ -776,7 +776,8 @@ def parse_PDB(
]

atoms = parsePDB(input_path)
atoms = atoms.select("occupancy > 0")
if not parse_atoms_with_zero_occupancy:
atoms = atoms.select("occupancy > 0")
if chains:
str_out = ""
for item in chains:
Expand Down
Loading

0 comments on commit 1fcad04

Please sign in to comment.