moleculekit.tools.termini module#
Classify each protein chain terminus as a real biological end or a cut.
The builders cap every protein terminus by default, which is right for a construct boundary or an unfilled break and wrong for a mature protein’s own terminus - a real terminus is zwitterionic, and neutralising it invents chemistry. Telling the two apart needs evidence from outside the coordinate file, and this module is where that evidence is combined:
a terminal gap proves truncation on its own - the reference extends past the last modelled residue, whatever the reference is;
otherwise the terminus is flush with the reference, and it is a real end only if it maps onto a UniProt mature-chain boundary (via the SIFTS entity mapping or a precursor trim offset) - but “flush” is only readable when the chain was actually analysed for gaps, so a chain gap detection skipped gets
unknownat both ends rather than a boundary comparison against an assumed alignment.
No network I/O happens here: the caller supplies the mature spans.
- moleculekit.tools.termini.CAP_VOCABULARY = ('none', 'ACE', 'NME', 'NHE')#
the subset of
moleculekit.residues.CAP_RESIDUE_NAMESa force field ships a template for (htmd carries ACE, NME and NHE only), plusnoneto leave the terminus charged on AMBER’sN*/C*variants. Deliberately narrower than the recognised set:NMAandNH2are real cap resnames that can appear in a structure but cannot be built onto one.- Type:
The caps that can be requested
- moleculekit.tools.termini.detectTermini(mol, sequences, gaps, chainmeta, mature_spans, skipped_chains=())#
Classify both ends of every protein chain as natural, truncated or unknown.
- Parameters:
mol (
Molecule) – The structure the caps will be applied to. Must be the final, gap-filled structure: a terminus that exists only because residues are missing is not the terminus the build will have.sequences (
dict) –{chain: reference_sequence}as used for gap detection.gaps (
listofdict) –detectSequenceGapsoutput for the same structure and references.chainmeta (
dict) –{chain: {"source", "accession", "uniprot_refs", "trim_offset"}}- the survey’s per-chain reference metadata.uniprot_refsis every UniProt row with its SIFTS regions;accessionis the primary (most-covered) one, used only as a fallback label.mature_spans (
dict) –{accession: uniprotMatureChains(accession)}for every accession inuniprot_refs, fetched by the caller.skipped_chains (
iterableofstr) – Chains whose gap analysis was skipped -detectSequenceGaps’ second return value. Flushness is read from the absence of a terminal gap, so a chain with no gap analysis has no flushness evidence at all and its termini are reportedunknownrather than measured against the reference’s ends.
- Returns:
termini – Two entries per protein chain (
end"N"then"C"), each withchain,end,resid,insertion,resname,sel,classification(natural/truncated/unknown),evidence(uniprot_mature_chain/terminal_gap/no_gap_analysis/flush_no_evidence),accession,matched_feature,cappableandproposed_cap.selis a verified-unique atom selection for the residue, and is None when the terminus cannot be capped or cannot be selected unambiguously.- Return type: