Skip to content

remove ligand and alt res within chain#198

Merged
martin-steinegger merged 2 commits into
steineggerlab:masterfrom
NatureGeorge:fix_alt_aa_seq
Nov 9, 2023
Merged

remove ligand and alt res within chain#198
martin-steinegger merged 2 commits into
steineggerlab:masterfrom
NatureGeorge:fix_alt_aa_seq

Conversation

@NatureGeorge

Copy link
Copy Markdown
Contributor

solve #189

Cases to Test

PDB Entries with Alternative Residue Conformation

  • 3JQH
  • 1EJG

PDB Entries with Amino Acid Ligands

  • 3LSW
  • 3L1L

Something Should be Taken Care of

These changes assume the read-in PDB file contains enough information for gemmi to detect the entity type.

@martin-steinegger

Copy link
Copy Markdown
Collaborator

Thank you so much for the PR. I agree that we should remove ligands but why do you remove HET atoms?

@NatureGeorge

Copy link
Copy Markdown
Contributor Author

Thank you so much for the PR. I agree that we should remove ligands but why do you remove HET atoms?

I did not make code changes on removing HET atoms. Do you refer to the following lines of code?

bool isHetAtomInList = res.het_flag == 'H' && threeAA2oneAA.find(res.name) != threeAA2oneAA.end();
if (isHetAtomInList == false && res.het_flag != 'A')
continue;

These lines are the original code. (in other words, not committed by me)

From my understanding, removing HET atoms is within the logic of the original code, particularly when it meets residue type outside the alphabet of the threeAA2oneAA table, which contains the 20 standard amino acids and some kinds of modified residues.

GemmiWrapper::GemmiWrapper(){
threeAA2oneAA = {{"ALA",'A'}, {"ARG",'R'}, {"ASN",'N'}, {"ASP",'D'},
{"CYS",'C'}, {"GLN",'Q'}, {"GLU",'E'}, {"GLY",'G'},
{"HIS",'H'}, {"ILE",'I'}, {"LEU",'L'}, {"LYS",'K'},
{"MET",'M'}, {"PHE",'F'}, {"PRO",'P'}, {"SER",'S'},
{"THR",'T'}, {"TRP",'W'}, {"TYR",'Y'}, {"VAL",'V'},
// modified res
{"MSE",'M'}, {"MLY",'K'}, {"FME",'M'}, {"HYP",'P'},
{"TPO",'T'}, {"CSO",'C'}, {"SEP",'S'}, {"M3L",'K'},
{"HSK",'H'}, {"SAC",'S'}, {"PCA",'E'}, {"DAL",'A'},
{"CME",'C'}, {"CSD",'C'}, {"OCS",'C'}, {"DPR",'P'},
{"B3K",'K'}, {"ALY",'K'}, {"YCM",'C'}, {"MLZ",'K'},
{"4BF",'Y'}, {"KCX",'K'}, {"B3E",'E'}, {"B3D",'D'},
{"HZP",'P'}, {"CSX",'C'}, {"BAL",'A'}, {"HIC",'H'},
{"DBZ",'A'}, {"DCY",'C'}, {"DVA",'V'}, {"NLE",'L'},
{"SMC",'C'}, {"AGM",'R'}, {"B3A",'A'}, {"DAS",'D'},
{"DLY",'K'}, {"DSN",'S'}, {"DTH",'T'}, {"GL3",'G'},
{"HY3",'P'}, {"LLP",'K'}, {"MGN",'Q'}, {"MHS",'H'},
{"TRQ",'W'}, {"B3Y",'Y'}, {"PHI",'F'}, {"PTR",'Y'},
{"TYS",'Y'}, {"IAS",'D'}, {"GPL",'K'}, {"KYN",'W'},
{"CSD",'C'}, {"SEC",'C'},
// unknown
{"UNK",'X'}};
}

If the residue type is contained by the threeAA2oneAA table, the residue is kept and perform some filtering (NOTE: original code):

if (isHetAtomInList) {
bool hasCA = false;
for (gemmi::Atom &atom : res.atoms) {
if (atom.name == "CA") {
hasCA = true;

What I commit is the following lines of code (from line 288 to line 291):

if (isHetAtomInList) {
bool notPolymer = res.entity_type != gemmi::EntityType::Polymer;
if (notPolymer == true) {
continue;
}

The logic is that when it meets HET residue type that still falls within the threeAA2oneAA table, it has to check whether the residue is a member of the polymer chain, otherwise the residue is a non-polymer instance (i.e. ligand).

To implement this idea, I use gemmi's entity information. This requires the read-in PDB file to be standard enough for gemmi to determine the entity type of each residue. Perhaps there are some other ways to determine the entity type.

@martin-steinegger

Copy link
Copy Markdown
Collaborator

Thank you so much.

@martin-steinegger martin-steinegger merged commit 0c32b3b into steineggerlab:master Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants