Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes to process cif files and use them in training #141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/process/mmcif.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ def parse_mmcif( # noqa: C901, PLR0915, PLR0912
entity=entity.name,
residues=residues,
type=const.chain_type_ids["NONPOLYMER"],
sequence=None
)
)

Expand Down Expand Up @@ -1119,4 +1120,4 @@ def parse_mmcif( # noqa: C901, PLR0915, PLR0912
mask=mask,
)

return ParsedStructure(data=data, info=info)
return ParsedStructure(data=data, info=info, covalents=[])
9 changes: 6 additions & 3 deletions scripts/process/rcsb.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,18 @@ def finalize(outdir: Path) -> None:
failed_count = 0
records = []
for record in records_dir.iterdir():
path = records_dir / record
path = record
try:
with path.open("r") as f:
records.append(json.load(f))
except: # noqa: E722
failed_count += 1
print(f"Failed to parse {record}") # noqa: T201
print(f"Failed to parse {failed_count} entries)") # noqa: T201

if failed_count > 0:
print(f"Failed to parse {failed_count} entries.") # noqa: T201
else:
print("All entries parsed successfully.")

# Save manifest
outpath = outdir / "manifest.json"
with outpath.open("w") as f:
Expand Down
2 changes: 1 addition & 1 deletion src/boltz/data/module/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def load_input(record: Record, target_dir: Path, msa_dir: Path) -> Input:
for chain in record.chains:
msa_id = chain.msa_id
# Load the MSA for this chain, if any
if msa_id != -1:
if msa_id != -1 and msa_id != "":
msa = np.load(msa_dir / f"{msa_id}.npz")
msas[chain.chain_id] = MSA(**msa)

Expand Down