Skip to content

structureto3didescriptor yield wrong sequence output when it meets alternative residue conformation and amino acid ligands #189

Description

@NatureGeorge

Expected Behavior

foldseek structureto3didescriptor reads a PDB file, extract the protein sequence, then output corresponding 3Di sequence.

Current Behavior

foldseek structureto3didescriptor output a slightly incorrect result when it reads PDB file containing residues with alternative conformation/location or ligands that are amino acids. To be clear,

incorrect output sequence -> unnecessary additional/alternative residues in protein sequences and 3Di sequences.

Steps to Reproduce

foldseek structureto3didescriptor 3JQH.cif.gz 3JQH_output.tsv

or PDB 1EJG etc.

Foldssek Output (for bugs)

  • True protein sequence: PEKSKLQEIYQELTRLKAAVGEL (length 23)
  • current foldseek output protein sequene: PSEKSKLQEIYQELTRQELKAAVGEL (length 23+3=26)
  • current foldseek output 3Di sequene: DDDPVVVVVVVVVVCLVVVVVVVVVD (length 26)

Context

Quick fix: use gemmi's first_conformer function to remove alternative residue conformation:

// Iterators that in case of multiple conformations (alt. locations)
// skip all but the first conformation.
UniqProxy<Atom> first_conformer() { return {atoms}; }
ConstUniqProxy<Atom> first_conformer() const { return {atoms}; }
};

As well as gemmi's get_polymer function to remove ligands:

ResidueSpan get_polymer() {
auto begin = residues.begin();
while (begin != residues.end() && begin->entity_type != EntityType::Polymer)
++begin;
auto end = begin;
while (end != residues.end() && end->entity_type == EntityType::Polymer
&& end->subchain == begin->subchain)
++end;
return ResidueSpan(residues, &*begin, end - begin);
}
ConstResidueSpan get_polymer() const {
return const_cast<Chain*>(this)->get_polymer();
}

Your Environment

foldseek Version: 8.ef4e960

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions