Skip to content
Snippets Groups Projects
Commit cbf55fea authored by Gerardo Tauriello's avatar Gerardo Tauriello
Browse files

SCHWED-3890: clarify doc and help of ost compare-structures action.

parent 166b0b79
No related branches found
No related tags found
No related merge requests found
...@@ -33,38 +33,29 @@ Only model structures are "Molck-ed" in CAMEO. The call to molck is as follows: ...@@ -33,38 +33,29 @@ Only model structures are "Molck-ed" in CAMEO. The call to molck is as follows:
--complib=<COMPOUND LIB> \\ --complib=<COMPOUND LIB> \\
--rm=hyd,oxt,unk \\ --rm=hyd,oxt,unk \\
--fix-ele \\ --fix-ele \\
--map-nonstd <FILEPATH> \\ --map-nonstd \\
--out=<OUTPUT> --out=<OUTPUT> \\
<FILEPATH>
To be as much compatible with with CAMEO as possible one should call To be as much compatible with with CAMEO as possible one should call
compare-structures as follows: compare-structures as follows:
ost compare-structures \\ ost compare-structures \\
# General parameters
####################
--model <MODEL> \\ --model <MODEL> \\
--reference <REF> \\ --reference <REF> \\
--output output.json \\ --output output.json \\
# QS-score parameters
#####################
--qs-score \\
--residue-number-alignment \\
# lDDT parameters
#################
--lddt \\
--inclusion-radius 15.0 \\
# Molecular check parameters
############################
--molck \\ --molck \\
--remove oxt hyd unk \\ --remove oxt hyd unk \\
--clean-element-column \\ --clean-element-column \\
--map-nonstandard-residues \\ --map-nonstandard-residues \\
# Additional checks
###################
--structural-checks \\ --structural-checks \\
--bond-tolerance 15.0 \\ --bond-tolerance 15.0 \\
--angle-tolerance 15.0 \\ --angle-tolerance 15.0 \\
--consistency-checks --residue-number-alignment \\
--consistency-checks \\
--qs-score \\
--lddt \\
--inclusion-radius 15.0
""" """
import os import os
...@@ -131,38 +122,49 @@ def _GetDefaultCompoundLibraryPath(): ...@@ -131,38 +122,49 @@ def _GetDefaultCompoundLibraryPath():
def _ParseArgs(): def _ParseArgs():
"""Parse command-line arguments.""" """Parse command-line arguments."""
#
# General options
#
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
formatter_class=argparse.RawTextHelpFormatter, formatter_class=argparse.RawTextHelpFormatter,
description=__doc__, description=__doc__,
prog="ost compare-structures") prog="ost compare-structures")
parser.add_argument( #
'-v', # Required arguments
'--verbosity', #
type=int,
default=3, group_required = parser.add_argument_group('required arguments')
help="Set verbosity level.")
parser.add_argument( group_required.add_argument(
"-m", "-m",
"--model", "--model",
dest="model", dest="model",
required=True, required=True,
help=("Path to the model file.")) help=("Path to the model file."))
parser.add_argument( group_required.add_argument(
"-r", "-r",
"--reference", "--reference",
dest="reference", dest="reference",
required=True, required=True,
help=("Path to the reference file.")) help=("Path to the reference file."))
parser.add_argument(
#
# General arguments
#
group_general = parser.add_argument_group('general arguments')
group_general.add_argument(
'-v',
'--verbosity',
type=int,
default=3,
help="Set verbosity level. Defaults to 3.")
group_general.add_argument(
"-o", "-o",
"--output", "--output",
dest="output", dest="output",
help=("Output file name. The output will be saved as a JSON file.")) help=("Output file name. The output will be saved as a JSON file."))
parser.add_argument( group_general.add_argument(
"-d", "-d",
"--dump-structures", "--dump-structures",
dest="dump_structures", dest="dump_structures",
...@@ -171,26 +173,26 @@ def _ParseArgs(): ...@@ -171,26 +173,26 @@ def _ParseArgs():
help=("Dump cleaned structures used to calculate all the scores as\n" help=("Dump cleaned structures used to calculate all the scores as\n"
"PDB files using specified suffix. Files will be dumped to the\n" "PDB files using specified suffix. Files will be dumped to the\n"
"same location as original files.")) "same location as original files."))
parser.add_argument( group_general.add_argument(
"-ds", "-ds",
"--dump-suffix", "--dump-suffix",
dest="dump_suffix", dest="dump_suffix",
default=".compare.structures.pdb", default=".compare.structures.pdb",
help=("Use this suffix to dump structures.\n" help=("Use this suffix to dump structures.\n"
"Defaults to .compare.structures.pdb.")) "Defaults to .compare.structures.pdb."))
parser.add_argument( group_general.add_argument(
"-rs", "-rs",
"--reference-selection", "--reference-selection",
dest="reference_selection", dest="reference_selection",
default="", default="",
help=("Selection performed on reference structures.")) help=("Selection performed on reference structures."))
parser.add_argument( group_general.add_argument(
"-ms", "-ms",
"--model-selection", "--model-selection",
dest="model_selection", dest="model_selection",
default="", default="",
help=("Selection performed on model structures.")) help=("Selection performed on model structures."))
parser.add_argument( group_general.add_argument(
"-ca", "-ca",
"--c-alpha-only", "--c-alpha-only",
dest="c_alpha_only", dest="c_alpha_only",
...@@ -199,14 +201,14 @@ def _ParseArgs(): ...@@ -199,14 +201,14 @@ def _ParseArgs():
help=("Use C-alpha atoms only. Equivalent of calling the action with\n" help=("Use C-alpha atoms only. Equivalent of calling the action with\n"
"'--model-selection=\"aname=CA\" " "'--model-selection=\"aname=CA\" "
"--reference-selection=\"aname=CA\"'\noptions.")) "--reference-selection=\"aname=CA\"'\noptions."))
parser.add_argument( group_general.add_argument(
"-ft", "-ft",
"--fault-tolerant", "--fault-tolerant",
dest="fault_tolerant", dest="fault_tolerant",
default=False, default=False,
action="store_true", action="store_true",
help=("Fault tolerant parsing.")) help=("Fault tolerant parsing."))
parser.add_argument( group_general.add_argument(
"-cl", "-cl",
"--compound-library", "--compound-library",
dest="compound_library", dest="compound_library",
...@@ -215,99 +217,21 @@ def _ParseArgs(): ...@@ -215,99 +217,21 @@ def _ParseArgs():
"If not provided, the following locations are searched in this\n" "If not provided, the following locations are searched in this\n"
"order: 1. Working directory, 2. OpenStructure standard library" "order: 1. Working directory, 2. OpenStructure standard library"
"\nlocation.")) "\nlocation."))
# #
# QS-scorer options # Molecular check arguments
#
parser.add_argument(
"-qs",
"--qs-score",
dest="qs_score",
default=False,
action="store_true",
help=("Calculate QS-score."))
parser.add_argument(
"-c",
"--chain-mapping",
nargs="+",
type=lambda x: x.split(":"),
dest="chain_mapping",
help=("Mapping of chains between the reference and the model.\n"
"Each separate mapping consist of key:value pairs where key\n"
"is the chain name in reference and value is the chain name in\n"
"model."))
parser.add_argument(
"--qs-rmsd",
dest="qs_rmsd",
default=False,
action="store_true",
help=("Calculate CA RMSD between shared CA atoms of mapped chains.\n"
"This uses a superposition using all mapped chains which\n"
"minimizes the CA RMSD."))
parser.add_argument(
"-rna",
"--residue-number-alignment",
dest="residue_number_alignment",
default=False,
action="store_true",
help=("Make alignment based on residue number instead of using\n"
"a global BLOSUM62-based alignment."))
parser.add_argument(
"--qs-max-mappings-extensive",
dest="qs_max_mappings_extensive",
type=int,
default=1000000,
help=("Maximal number of chain mappings to test for 'extensive'\n"
"chain mapping scheme which is used as a last resort if\n"
"other schemes failed. The extensive chain mapping search\n"
"must in the worst case check O(N!) possible mappings for\n"
"complexes with N chains. Two octamers without symmetry\n"
"would require 322560 mappings to be checked. To limit\n"
"computations, no scores are computed if we try more than\n"
"the maximal number of chain mappings."))
#
# lDDT options
#
parser.add_argument(
"-l",
"--lddt",
dest="lddt",
default=False,
action="store_true",
help=("Calculate lDDT."))
parser.add_argument(
"-ir",
"--inclusion-radius",
dest="inclusion_radius",
type=float,
default=15.0,
help=("Distance inclusion radius."))
parser.add_argument(
"-ss",
"--sequence-separation",
dest="sequence_separation",
type=int,
default=0,
help=("Sequence separation. Only distances between residues whose\n"
"separation is higher than the provided parameter are\n"
"considered when computing the score"))
parser.add_argument(
"-spr",
"--save-per-residue-scores",
dest="save_per_residue_scores",
default=False,
action="store_true",
help=(""))
#
# Molecular check parameters
# #
parser.add_argument(
group_molck = parser.add_argument_group('molecular check arguments')
group_molck.add_argument(
"-ml", "-ml",
"--molck", "--molck",
dest="molck", dest="molck",
default=False, default=False,
action="store_true", action="store_true",
help=("Run molecular checker to clean up input.")) help=("Run molecular checker to clean up input."))
parser.add_argument( group_molck.add_argument(
"-rm", "-rm",
"--remove", "--remove",
dest="remove", dest="remove",
...@@ -321,15 +245,16 @@ def _ParseArgs(): ...@@ -321,15 +245,16 @@ def _ParseArgs():
" * nonstd - remove all residues not one of the 20\n" " * nonstd - remove all residues not one of the 20\n"
" * standard amino acids\n" " * standard amino acids\n"
" * unk - Remove unknown and atoms not following the\n" " * unk - Remove unknown and atoms not following the\n"
" nomenclature")) " nomenclature\n"
parser.add_argument( "Defaults to hyd."))
group_molck.add_argument(
"-ce", "-ce",
"--clean-element-column", "--clean-element-column",
dest="clean_element_column", dest="clean_element_column",
default=False, default=False,
action="store_true", action="store_true",
help=("Clean up element column")) help=("Clean up element column"))
parser.add_argument( group_molck.add_argument(
"-mn", "-mn",
"--map-nonstandard-residues", "--map-nonstandard-residues",
dest="map_nonstandard_residues", dest="map_nonstandard_residues",
...@@ -337,17 +262,21 @@ def _ParseArgs(): ...@@ -337,17 +262,21 @@ def _ParseArgs():
action="store_true", action="store_true",
help=("Map modified residues back to the parent amino acid, for\n" help=("Map modified residues back to the parent amino acid, for\n"
"example MSE -> MET, SEP -> SER.")) "example MSE -> MET, SEP -> SER."))
# #
# Options for various checks # Structural check arguments
# #
parser.add_argument(
group_sc = parser.add_argument_group('structural check arguments')
group_sc.add_argument(
"-sc", "-sc",
"--structural-checks", "--structural-checks",
dest="structural_checks", dest="structural_checks",
default=False, default=False,
action="store_true", action="store_true",
help=("Perform structural checks and filter input data.")) help=("Perform structural checks and filter input data."))
parser.add_argument( group_sc.add_argument(
"-p", "-p",
"--parameter-file", "--parameter-file",
dest="parameter_file", dest="parameter_file",
...@@ -357,21 +286,58 @@ def _ParseArgs(): ...@@ -357,21 +286,58 @@ def _ParseArgs():
"If not provided, the following locations are searched in this\n" "If not provided, the following locations are searched in this\n"
"order: 1. Working directory, 2. OpenStructure standard library" "order: 1. Working directory, 2. OpenStructure standard library"
"\nlocation.")) "\nlocation."))
parser.add_argument( group_sc.add_argument(
"-bt", "-bt",
"--bond-tolerance", "--bond-tolerance",
dest="bond_tolerance", dest="bond_tolerance",
type=float, type=float,
default=12.0, default=12.0,
help=("Tolerance in STD for bonds.")) help=("Tolerance in STD for bonds. Defaults to 12."))
parser.add_argument( group_sc.add_argument(
"-at", "-at",
"--angle-tolerance", "--angle-tolerance",
dest="angle_tolerance", dest="angle_tolerance",
type=float, type=float,
default=12.0, default=12.0,
help=("Tolerance in STD for angles.")) help=("Tolerance in STD for angles. Defaults to 12."))
parser.add_argument(
#
# Chain mapping arguments
#
group_cm = parser.add_argument_group('chain mapping arguments')
group_cm.add_argument(
"-c",
"--chain-mapping",
nargs="+",
type=lambda x: x.split(":"),
dest="chain_mapping",
help=("Mapping of chains between the reference and the model.\n"
"Each separate mapping consist of key:value pairs where key\n"
"is the chain name in reference and value is the chain name in\n"
"model."))
group_cm.add_argument(
"--qs-max-mappings-extensive",
dest="qs_max_mappings_extensive",
type=int,
default=1000000,
help=("Maximal number of chain mappings to test for 'extensive'\n"
"chain mapping scheme which is used as a last resort if\n"
"other schemes failed. The extensive chain mapping search\n"
"must in the worst case check O(N!) possible mappings for\n"
"complexes with N chains. Two octamers without symmetry\n"
"would require 322560 mappings to be checked. To limit\n"
"computations, no scores are computed if we try more than\n"
"the maximal number of chain mappings. Defaults to 1000000."))
#
# Sequence alignment arguments
#
group_aln = parser.add_argument_group('sequence alignment arguments')
group_aln.add_argument(
"-cc", "-cc",
"--consistency-checks", "--consistency-checks",
dest="consistency_checks", dest="consistency_checks",
...@@ -383,6 +349,73 @@ def _ParseArgs(): ...@@ -383,6 +349,73 @@ def _ParseArgs():
"will continue to calculate scores. If this flag is ON, checks\n" "will continue to calculate scores. If this flag is ON, checks\n"
"will not be ignored and if the pair does not pass the test\n" "will not be ignored and if the pair does not pass the test\n"
"all the scores for that pair will be marked as a FAILURE.")) "all the scores for that pair will be marked as a FAILURE."))
group_aln.add_argument(
"-rna",
"--residue-number-alignment",
dest="residue_number_alignment",
default=False,
action="store_true",
help=("Make alignment based on residue number instead of using\n"
"a global BLOSUM62-based alignment."))
#
# QS score arguments
#
group_qs = parser.add_argument_group('QS score arguments')
group_qs.add_argument(
"-qs",
"--qs-score",
dest="qs_score",
default=False,
action="store_true",
help=("Calculate QS-score."))
group_qs.add_argument(
"--qs-rmsd",
dest="qs_rmsd",
default=False,
action="store_true",
help=("Calculate CA RMSD between shared CA atoms of mapped chains.\n"
"This uses a superposition using all mapped chains which\n"
"minimizes the CA RMSD."))
#
# lDDT score arguments
#
group_lddt = parser.add_argument_group('lDDT score arguments')
group_lddt.add_argument(
"-l",
"--lddt",
dest="lddt",
default=False,
action="store_true",
help=("Calculate lDDT."))
group_lddt.add_argument(
"-ir",
"--inclusion-radius",
dest="inclusion_radius",
type=float,
default=15.0,
help=("Distance inclusion radius for lDDT. Defaults to 15 A."))
group_lddt.add_argument(
"-ss",
"--sequence-separation",
dest="sequence_separation",
type=int,
default=0,
help=("Sequence separation. Only distances between residues whose\n"
"separation is higher than the provided parameter are\n"
"considered when computing the score. Defaults to 0."))
group_lddt.add_argument(
"-spr",
"--save-per-residue-scores",
dest="save_per_residue_scores",
default=False,
action="store_true",
help=(""))
# Print full help is no arguments provided # Print full help is no arguments provided
if len(sys.argv) == 1: if len(sys.argv) == 1:
...@@ -954,7 +987,7 @@ def _Main(): ...@@ -954,7 +987,7 @@ def _Main():
ost.LogInfo("#" * 80) ost.LogInfo("#" * 80)
ost.LogInfo("Saving output into %s" % opts.output) ost.LogInfo("Saving output into %s" % opts.output)
with open(opts.output, "w") as outfile: with open(opts.output, "w") as outfile:
outfile.write(json.dumps(result, indent=4)) json.dump(result, outfile, indent=4, sort_keys=True)
if __name__ == '__main__': if __name__ == '__main__':
......
This diff is collapsed.
...@@ -549,7 +549,8 @@ Local Distance Test scores (lDDT, DRMSD) ...@@ -549,7 +549,8 @@ Local Distance Test scores (lDDT, DRMSD)
.. class:: lDDTScorer(reference, model, settings) .. class:: lDDTScorer(reference, model, settings)
Object to compute lDDT scores. Object to compute lDDT scores using :func:`LocalDistDiffTest` as in
`Mariani et al. <https://dx.doi.org/10.1093/bioinformatics/btt473>`_.
Example usage. Example usage.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment