diff --git a/src/boltz/data/parse/fasta.py b/src/boltz/data/parse/fasta.py index 114cf9841..a37b02db0 100644 --- a/src/boltz/data/parse/fasta.py +++ b/src/boltz/data/parse/fasta.py @@ -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) diff --git a/src/boltz/data/parse/schema.py b/src/boltz/data/parse/schema.py index a10260bc4..4906c47c3 100644 --- a/src/boltz/data/parse/schema.py +++ b/src/boltz/data/parse/schema.py @@ -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, @@ -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 @@ -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: @@ -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!" diff --git a/src/boltz/data/parse/yaml.py b/src/boltz/data/parse/yaml.py index a08b7abf5..26e29ea8e 100644 --- a/src/boltz/data/parse/yaml.py +++ b/src/boltz/data/parse/yaml.py @@ -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)