diff --git a/actions/ost-compare-structures b/actions/ost-compare-structures index 0da8fe4a2c491f49301cd64888dad01412516d0c..3b6b9107bbab5e5adcf22c9ea75286d1ca8959d7 100644 --- a/actions/ost-compare-structures +++ b/actions/ost-compare-structures @@ -233,6 +233,14 @@ def _ParseArgs(): "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", @@ -714,6 +722,26 @@ def _Main(): ost.LogWarning(msg) else: ost.LogInfo("Consistency check: OK") + if opts.qs_rmsd: + ost.LogInfo("-" * 80) + if skip_score: + ost.LogInfo( + "Skipping QS-RMSD because consistency check failed") + reference_results["qs_rmsd"] = { + "status": "FAILURE", + "error": "Consistency check failed."} + else: + ost.LogInfo("Computing QS-RMSD") + try: + reference_results["qs_rmsd"] = { + "status": "SUCCESS", + "error": "", + "ca_rmsd": qs_scorer.superposition.rmsd} + except qsscoring.QSscoreError as ex: + ost.LogError('QS-RMSD failed:', str(ex)) + reference_results["qs_rmsd"] = { + "status": "FAILURE", + "error": str(ex)} if opts.qs_score: ost.LogInfo("-" * 80) if skip_score: @@ -722,8 +750,6 @@ def _Main(): reference_results["qs_score"] = { "status": "FAILURE", "error": "Consistency check failed.", - "model_name": model_name, - "reference_name": reference_name, "global_score": 0.0, "best_score": 0.0} else: diff --git a/modules/mol/alg/pymod/qsscoring.py b/modules/mol/alg/pymod/qsscoring.py index 5a3477c903960d68d151739f77004914c7307721..dbe8c1dba6c332440915ac058b1d8e75cf8f7f4f 100644 --- a/modules/mol/alg/pymod/qsscoring.py +++ b/modules/mol/alg/pymod/qsscoring.py @@ -1470,7 +1470,7 @@ def _CleanInputEntity(ent): # check if CA only calpha_only = False - if ent_new.Select('aname=CB').atom_count == 0: + if ent_new.atom_count > 0 and ent_new.Select('aname=CB').atom_count == 0: LogInfo('Structure %s is a CA only structure!' % ent_new.GetName()) calpha_only = True @@ -2337,7 +2337,7 @@ def _CheckClosedSymmetry(ent_1, ent_2, symm_1, symm_2, chem_mapping, overlapped for overlap to be sufficient. :type sup_fract: :class:`float` :param find_best: If True, we look for best mapping according to - :func:`_ChainRMSD`. Otherwise, we return first suitable + :func:`_GetMappedRMSD`. Otherwise, we return first suitable mapping. :type find_best: :class:`bool`