Skip to content

Commit 53e4377

Browse files
committed
multichain protein
1 parent 12601f0 commit 53e4377

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

alphafold3_pytorch/cli.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import click
24
from pathlib import Path
35

@@ -15,19 +17,25 @@
1517

1618
@click.command()
1719
@click.option('-ckpt', '--checkpoint', type = str, help = 'path to alphafold3 checkpoint')
18-
@click.option('-p', '--protein', type = str, help = 'one protein sequence')
20+
@click.option('-prot', '--protein', type = str, multiple = True, help = 'protein sequences')
21+
@click.option('-rna', '--rna', type = str, multiple = True, help = 'single stranded rna sequences')
22+
@click.option('-dna', '--dna', type = str, multiple = True, help = 'single stranded dna sequences')
1923
@click.option('-o', '--output', type = str, help = 'output path', default = 'output.cif')
2024
def cli(
2125
checkpoint: str,
22-
protein: str,
26+
protein: list[str],
27+
rna: list[str],
28+
dna: list[str],
2329
output: str
2430
):
2531

2632
checkpoint_path = Path(checkpoint)
2733
assert checkpoint_path.exists(), f'AlphaFold 3 checkpoint must exist at {str(checkpoint_path)}'
2834

2935
alphafold3_input = Alphafold3Input(
30-
proteins = [protein],
36+
proteins = protein,
37+
ss_rna = rna,
38+
ss_dna = dna,
3139
)
3240

3341
alphafold3 = Alphafold3.init_and_load(checkpoint_path)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "alphafold3-pytorch"
3-
version = "0.4.49"
3+
version = "0.4.50"
44
description = "Alphafold 3 - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "[email protected]" },

tests/test_cli.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@ def test_cli():
2222
checkpoint_path = './test-folder/test-cli-alphafold3.pt'
2323
alphafold3.save(checkpoint_path, overwrite = True)
2424

25-
cli(['--checkpoint', checkpoint_path, '--protein', 'AG', '--output', './test-folder/output.pdb'], standalone_mode = False)
26-
27-
assert Path('./test-folder/output.pdb').exists()
25+
cli([
26+
'--checkpoint', checkpoint_path,
27+
'-prot', 'AG',
28+
'-prot', 'TC',
29+
'--output',
30+
'./test-folder/output.mmcif'
31+
], standalone_mode = False)
32+
33+
assert Path('./test-folder/output.mmcif').exists()
2834

2935
rmtree('./test-folder')

0 commit comments

Comments
 (0)