Skip to content
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: 1 addition & 2 deletions src/boltz/data/parse/fasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,4 @@ def parse_fasta( # noqa: C901, PLR0912
"version": 1,
}

name = path.stem
return parse_boltz_schema(name, data, ccd, mol_dir, boltz2)
return parse_boltz_schema(path, data, ccd, mol_dir, boltz2)
11 changes: 8 additions & 3 deletions src/boltz/data/parse/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ def token_spec_to_ids(


def parse_boltz_schema( # noqa: C901, PLR0915, PLR0912
name: str,
path: Path,
schema: dict,
ccd: Mapping[str, Mol],
mol_dir: Optional[Path] = None,
Expand Down Expand Up @@ -983,8 +983,8 @@ def parse_boltz_schema( # noqa: C901, PLR0915, PLR0912

Parameters
----------
name : str
A name for the input.
path : Path
Path to the input file.
schema : dict
The input schema.
components : dict
Expand All @@ -1000,6 +1000,7 @@ def parse_boltz_schema( # noqa: C901, PLR0915, PLR0912
The parsed target.

"""
name, parent = path.stem, path.parent
# Assert version 1
version = schema.get("version", 1)
if version != 1:
Expand Down Expand Up @@ -1110,12 +1111,16 @@ def parse_boltz_schema( # noqa: C901, PLR0915, PLR0912
msa = items[0][entity_type].get("msa", 0)
if (msa is None) or (msa == ""):
msa = 0
if msa != 0:
msa = str((parent / msa).resolve())

# Check if all MSAs are the same within the same entity
for item in items:
item_msa = item[entity_type].get("msa", 0)
if (item_msa is None) or (item_msa == ""):
item_msa = 0
if item_msa != 0:
item_msa = str((parent / item_msa).resolve())

if item_msa != msa:
msg = "All proteins with the same sequence must share the same MSA!"
Expand Down
3 changes: 1 addition & 2 deletions src/boltz/data/parse/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,4 @@ def parse_yaml(
with path.open("r") as file:
data = yaml.safe_load(file)

name = path.stem
return parse_boltz_schema(name, data, ccd, mol_dir, boltz2)
return parse_boltz_schema(path, data, ccd, mol_dir, boltz2)