Skip to content
Open
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
46 changes: 32 additions & 14 deletions src/openfe_analysis/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,36 @@ def cli():


@cli.command(name="RFE_analysis")
@click.argument(
"loc",
type=click.Path(
exists=True, readable=True, file_okay=False, dir_okay=True, path_type=pathlib.Path
),
@click.option(
"--pdb",
type=click.Path(exists=True, readable=True, dir_okay=False, path_type=pathlib.Path),
required=True,
help="Path to the topology PDB file.",
)
@click.argument("output", type=click.Path(writable=True, dir_okay=False, path_type=pathlib.Path))
def rfe_analysis(loc, output):
pdb = loc / "hybrid_system.pdb"
trj = loc / "simulation.nc"

data = rmsd.gather_rms_data(pdb, trj)

with click.open_file(output, "w") as f:
f.write(json.dumps(data))
@click.option(
"--nc",
type=click.Path(exists=True, readable=True, dir_okay=False, path_type=pathlib.Path),
required=True,
help="Path to the NetCDF trajectory file.",
)
@click.option(
"--output",
type=click.Path(writable=True, dir_okay=False, path_type=pathlib.Path),
required=True,
help="Path to save the JSON results.",
)
def rfe_analysis(pdb: pathlib.Path, nc: pathlib.Path, output: pathlib.Path):
"""
Perform RMSD analysis for an RBFE simulation.

Arguments:
pdb: path to the topology PDB file.
nc: path to the trajectory file (NetCDF format).
output: path to save the JSON results.
"""
# Run RMSD analysis
data = rmsd.gather_rms_data(pdb, nc)

# Write results
with output.open("w") as f:
json.dump(data, f, indent=2)
Loading