Repository navigation
#37: leave out residues outside the 20 standard amino acids with a warning, and name them - #38
Merged
Merged
Conversation
…ning, and name them A structure predicted from a sequence holding an X contains a residue named UNK, which the residue table has no radius, pKa or hydrophobicity for. Such a structure parsed without error and then failed with a KeyError naming only the residue type once the surface calculation had started. parse_pdb_text now checks the protein residues after the conformer election. By default it removes every residue that is not one of the 20 standard amino acids and logs a warning naming each by chain and number, so an unattended run finishes. drop_unknown_residues=False (calculate, run_prodes, prodes.read, PDBparser.parse, parse_pdb_text; --no-drop-unknown-residues on the command line, appended last to the arguments main passes to calculate) raises a ValueError naming them instead. HETATM parsing is not checked. A structure with no standard residue is refused either way. A residue removed from a chain end takes the terminal charge with it: the chain records which end was removed, Residue.pkas gives the residue now at that end no terminal group, and its terminus attribute is cleared, so the pKa groups and the atom charges agree. This is correct for an N-terminal pyroglutamate and is documented as wrong for an ordinary residue with an unknown name. A residue set loses the removed residues with a warning, and a set naming only removed residues is refused. The run record lists the removed residues as removed_residues and the setting under settings, and a residue the conformer election renamed to an unknown name and that was then removed is not also listed as renamed. Version 11.0.0, because prodes.read and PDBparser.parse are documented public entry points and now return a structure without residues they used to include. No feature value of any other structure changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A structure predicted from a sequence that contains
Xholds a residue namedUNK, which Boltz-2 and other predictors build with backbone atoms and a CB. Prodes, which calculates surface descriptors (charge, electrostatic potential, hydrophobicity, surface patches) from a PDB file, reads radii, pKa and hydrophobicity from a residue table that holds only the 20 standard amino acids. Such a structure therefore failed withKeyError: UNK is not found in the list with residuesonce the surface calculation had started, the error named neither the chain nor the residue number, and no features were produced. One affected example is the Boltz-2 model of the antibody with FDA UNII105J35OE21, where residue 1 of both heavy chains isUNK, most likely an N-terminal pyroglutamate.Closes #37
What changed
parse_pdb_textnow leaves out every ATOM residue outside the 20 standard amino acids, after the functionelect_conformershas kept one alternate conformation per residue, and logs a warning naming each, for exampleUNK A1, UNK B1. The run finishes.drop_unknown_residues=False(calculate,run_prodes,prodes.read,PDBparser.parse;--no-drop-unknown-residueson the command line) raises aValueErrornaming them instead.N+for the amine,C-for the carboxylate) and no terminal charge, because in the molecule it is bonded to the removed residue. Implemented asChain.n_terminus_removed/c_terminus_removed, read byResidue.pkas, and a clearedResidue.terminus.--residue-set NAME=FILE, a list of residue labels the surface patch features are also reported for) loses a removed residue with a warning; a set naming only removed residues is refused.prodes_run.jsongainsremoved_residuesandsettings.drop_unknown_residues.prodes.read()andPDBparser.parse()now return a structure without residues they used to include. No feature value of any other structure changes.Results
105J35OE21(4 chains,UNKat residue 1 of chains A and B)KeyErroronce the surface calculation had started, no featuresUNK A1, UNK B1; calculation completes;prodes_run.jsonhasremoved_residues: ["UNK A1", "UNK B1"]--no-drop-unknown-residuesValueErrornamingUNK A1, UNK B1, raised when the file is readLocal tests green, 509/509, including 21 new tests of this behaviour in
tests/test_unknown_residues.py. The105J35OE21results are from a manual run on that structure. CI green.Acceptance criteria still open
All acceptance criteria met.
Not verified
HIE,HSD,CYX) loses those residues by default, with a warning, rather than stopping. The README says to read the warning.UNK, so what PROPKA itself does withUNKatoms when predicting the neighbouring pKa values is not known.105J35OE21model were not compared with those of a model built from aQat residue 1.main: the parser functionbuild_structuremarks the C terminus on the last residue of whichever chain the previous atom record belonged to, not on the last residue of each chain. Removing a residue from such a file can move which residue gets that wrong terminus. Not fixed here; interleaved chains are not tested.Detail
elect_conformers, because a file can model one position as two different amino acids and only the elected one is the residue.UNKrecord therefore removes a residue that is otherwiseALA, and it is reported asUNK.build_structuregiveschain.residues.clear_removed_terminiruns afterparse_pdb_textwrites the structure's last C terminus. For a chain that lost an end it setsterminusby the same if/elif thatResidue.pkasuses, so a chain left with one residue ([UNK, VAL]or[VAL, UNK]) has the pKa group and the charged atom on the same end. Chains that lost no end are not touched.--pkafile for the residue next to a removed end is dropped byredo_pkaswith its existing warning, because that residue has no terminal group.elect_conformersrenamed to an unknown name and that was then removed is taken out ofalternate_conformers.residues_renamed, soprodes_run.jsondoes not list it as both renamed and removed.tests/test_unknown_residues.py;tests/test_cli.py,tests/test_run_prodes.pyandtests/test_output_bundle.pywere updated for the new argument and run record field.