diff --git a/actions/ost-compare-structures b/actions/ost-compare-structures index 4cf9ef75f66bd049f7a58cd5b71c8c061809f5d6..81d105baca7f20a122262f6a9eff9bb81d667510 100644 --- a/actions/ost-compare-structures +++ b/actions/ost-compare-structures @@ -59,6 +59,7 @@ results: * "lddt_no_stereochecks" * "min_pep_length" * "min_nuc_length" + * "lddt_add_mdl_contacts" The pairwise sequence alignments are computed with Needleman-Wunsch using BLOSUM62 (NUC44 for nucleotides). Many benchmarking scenarios preprocess the @@ -534,6 +535,21 @@ def _ParseArgs(): type=int, default=2, help="Set verbosity level. Defaults to 3 (Script).") + + parser.add_argument( + "--lddt-add-mdl-contacts", + dest="lddt_add_mdl_contacts", + default=False, + action="store_true", + help=("Only using contacts in lDDT that" + "are within a certain distance threshold in the " + "reference does not penalize for added model " + "contacts. If set to True, this flag will also " + "consider reference contacts that are within the " + "specified distance threshold in the model but " + "not necessarily in the reference. No contact will " + "be added if the respective atom pair is not " + "resolved in the reference.")) return parser.parse_args() @@ -731,7 +747,8 @@ def _Process(model, reference, args, model_format, reference_format): n_max_naive = args.n_max_naive, oum = args.oum, min_pep_length = args.min_pep_length, - min_nuc_length = args.min_nuc_length) + min_nuc_length = args.min_nuc_length, + lddt_add_mdl_contacts = args.lddt_add_mdl_contacts) ir = _GetInconsistentResidues(scorer.aln) if len(ir) > 0 and args.enforce_consistency: @@ -907,6 +924,7 @@ def _Main(): out["lddt_no_stereochecks"] = args.lddt_no_stereochecks out["min_pep_length"] = args.min_pep_length out["min_nuc_length"] = args.min_nuc_length + out["lddt_add_mdl_contacts"] = args.lddt_add_mdl_contacts out["status"] = "SUCCESS" with open(args.output, 'w') as fh: json.dump(out, fh, indent=4, sort_keys=False) diff --git a/modules/mol/alg/pymod/scoring.py b/modules/mol/alg/pymod/scoring.py index 066af3ad39ced2b73b31cc3917672e01d01b3c96..c18c5593b6710a5f7cf4a696a64d290a8cc387d5 100644 --- a/modules/mol/alg/pymod/scoring.py +++ b/modules/mol/alg/pymod/scoring.py @@ -164,12 +164,24 @@ class Scorer: produce high sequence identity alignments by pure chance. :type min_nuc_length: :class:`int` + :param lddt_add_mdl_contacts: lDDT specific flag. Only using contacts in + lDDT that are within a certain distance + threshold in the target does not penalize + for added model contacts. If set to True, this + flag will also consider target contacts + that are within the specified distance + threshold in the model but not necessarily in + the target. No contact will be added if the + respective atom pair is not resolved in the + target. + :type lddt_add_mdl_contacts: :class:`bool` """ def __init__(self, model, target, resnum_alignments=False, molck_settings = None, cad_score_exec = None, custom_mapping=None, usalign_exec = None, lddt_no_stereochecks=False, n_max_naive=40320, - oum=False, min_pep_length = 6, min_nuc_length = 4): + oum=False, min_pep_length = 6, min_nuc_length = 4, + lddt_add_mdl_contacts=False): self._target_orig = target self._model_orig = model @@ -257,6 +269,7 @@ class Scorer: self.oum = oum self.min_pep_length = min_pep_length self.min_nuc_length = min_nuc_length + self.lddt_add_mdl_contacts = lddt_add_mdl_contacts # lazily evaluated attributes self._stereochecked_model = None @@ -1615,7 +1628,8 @@ class Scorer: chain_mapping = lddt_chain_mapping, residue_mapping = alns, check_resnames=False, - local_lddt_prop="lddt")[0] + local_lddt_prop="lddt", + add_mdl_contacts = self.lddt_add_mdl_contacts)[0] local_lddt = dict() for r in self.model.residues: cname = r.GetChain().GetName() @@ -1638,7 +1652,8 @@ class Scorer: chain_mapping = lddt_chain_mapping, residue_mapping = stereochecked_alns, check_resnames=False, - local_lddt_prop="lddt")[0] + local_lddt_prop="lddt", + add_mdl_contacts = self.lddt_add_mdl_contacts)[0] local_lddt = dict() for r in self.model.residues: cname = r.GetChain().GetName() @@ -1693,7 +1708,8 @@ class Scorer: chain_mapping = lddt_chain_mapping, residue_mapping = alns, check_resnames=False, - local_lddt_prop="bb_lddt")[0] + local_lddt_prop="bb_lddt", + add_mdl_contacts = self.lddt_add_mdl_contacts)[0] local_lddt = dict() for r in self.model.residues: cname = r.GetChain().GetName()