Skip to content

Commit

Permalink
better -h (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjlane authored Oct 28, 2024
1 parent 3bfcaa8 commit 317eeb6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 35 deletions.
59 changes: 29 additions & 30 deletions meteor/scripts/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,82 +76,81 @@ class DiffmapArgParser(argparse.ArgumentParser):
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)

derivative_group = self.add_argument_group(
"derivative",
description=(
"The 'derivative' diffraction data, typically: light-triggered, ligand-bound, etc. "
),
required_group = self.add_argument_group("required")
required_group.add_argument(
"derivative_mtz",
type=Path,
help="Path to MTZ containing the `derivative` data; positional arg (order matters).",
)
required_group.add_argument(
"native_mtz",
type=Path,
help="Path to MTZ containing the `native` data; positional arg (order matters)",
)
required_group.add_argument(
"-s",
"--structure",
type=Path,
required=True,
help="Specify CIF or PDB file path, for phases (usually a native model)",
)
derivative_group.add_argument("derivative_mtz", type=Path)
derivative_group.add_argument(

labels_group = self.add_argument_group("mtz column labels (input)")
labels_group.add_argument(
"-da",
"--derivative-amplitude-column",
type=str,
default=INFER_COLUMN_NAME,
help="specify the MTZ column for the amplitudes; will try to guess if not provided",
)
derivative_group.add_argument(
labels_group.add_argument(
"-du",
"--derivative-uncertainty-column",
type=str,
default=INFER_COLUMN_NAME,
help="specify the MTZ column for the uncertainties; will try to guess if not provided",
)

native_group = self.add_argument_group(
"native",
description=("The 'native' diffraction data, typically: dark, apo, etc."),
)
native_group.add_argument("native_mtz", type=Path)
native_group.add_argument(
labels_group.add_argument(
"-na",
"--native-amplitude-column",
type=str,
default=INFER_COLUMN_NAME,
help="specify the MTZ column for the amplitudes; will try to guess if not provided",
)
native_group.add_argument(
labels_group.add_argument(
"-nu",
"--native-uncertainty-column",
type=str,
default=INFER_COLUMN_NAME,
help="specify the MTZ column for the uncertainties; will try to guess if not provided",
)

self.add_argument(
"-s",
"--structure",
type=Path,
required=True,
help="Specify CIF or PDB file path, for phases (usually a native model). Required.",
)

self.add_argument(
output_group = self.add_argument_group("output")
output_group.add_argument(
"-o",
"--mtzout",
type=Path,
default=DEFAULT_OUTPUT_MTZ,
help=f"Specify output MTZ file path. Default: {DEFAULT_OUTPUT_MTZ}.",
)

self.add_argument(
output_group.add_argument(
"-m",
"--metadataout",
type=Path,
default=DEFAULT_OUTPUT_METADATA_FILE,
help=f"Specify output metadata file path. Default: {DEFAULT_OUTPUT_METADATA_FILE}.",
)

self.add_argument(
kweight_group = self.add_argument_group("k weighting settings")
kweight_group.add_argument(
"-k",
"--kweight-mode",
type=WeightMode,
default=WeightMode.optimize,
choices=list(WeightMode),
help="How to pick the k-parameter. Optimize means max negentropy. Default: `optimize`.",
)

self.add_argument(
kweight_group.add_argument(
"-w",
"--kweight-parameter",
type=float,
Expand Down
6 changes: 4 additions & 2 deletions meteor/scripts/compute_difference_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
class TvDiffmapArgParser(DiffmapArgParser):
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self.add_argument(

tv_group = self.add_argument_group("TV denoising settings")
tv_group.add_argument(
"-tv",
"--tv-denoise-mode",
type=WeightMode,
Expand All @@ -34,7 +36,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
"negentropy. Default: `optimize`."
),
)
self.add_argument(
tv_group.add_argument(
"-l",
"--tv-weight",
type=float,
Expand Down
8 changes: 5 additions & 3 deletions meteor/scripts/compute_iterative_tv_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
class IterativeTvArgParser(DiffmapArgParser):
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self.add_argument(

it_tv_group = self.add_argument_group("iterative TV settings")
it_tv_group.add_argument(
"-x",
"--tv-weights-to-scan",
nargs="+",
Expand All @@ -31,7 +33,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
f"Default: {DEFAULT_TV_WEIGHTS_TO_SCAN_AT_EACH_ITERATION}."
),
)
self.add_argument(
it_tv_group.add_argument(
"--convergence-tolerance",
type=float,
default=ITERATIVE_TV_CONVERGENCE_TOLERANCE,
Expand All @@ -40,7 +42,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
f"Default: {ITERATIVE_TV_CONVERGENCE_TOLERANCE}."
),
)
self.add_argument(
it_tv_group.add_argument(
"--max-iterations",
type=float,
default=ITERATIVE_TV_MAX_ITERATIONS,
Expand Down

0 comments on commit 317eeb6

Please sign in to comment.