I need to find peptides/proteins with a certain sequence of amino acids in a certain type of secondary structure. For example, "ALA PHE GLY" in alpha-helix. Is there any tool that does that?


1 Answer 1


Your request is rather specific, so there is no tool...

It is a straightforwards request though. I'd impose the requirement that the structures be solved and no predicted secondary structure. You can do it two ways if using Python.


After downloading all PDB structures, in python with PyMOL (installable with conda, tricky without) you'd do something like

import pymol2, os
from multiprocessing import Pool

def find_motif(file):
    motif = 'AFG'
        with pymol2.PyMOL() as pymol
            seq = pymol.cmd.get_fastastr()
            if motif not in seq:
                return None
            d = {x: []}
            # str.find will cause issues if there is a gap also structure may not start at one.
            pymol.cmd.iterate('resn ALA+PHE+GLY', 'x.append((resi, resn, ss))', space=d)
            sequence = -1
            i = 0
            for residue in d['x']:
                if residue['resn'] = 'ALA':
                    sequence = 0 # lazy enum
                    i = int(residue['resi'])
                elif sequence != -1 :
                    if int(residue['resi']) == i+1 and residue['resn'] = 'PHE':
                        sequence = 1
                    elif int(residue['resi']) == i+2 and residue['resn'] = 'GLY':
                        return (file, i)
                        sequence = -1
        return (file, None)

if __name__ == '__main__':
    p = Pool(12)
    structure_files = [f for f in os.listdir('pdb') if os.path.splitext(f)[1] == '.pdb']
    verdicts = p.map(finder, structure_files)
    print([(f,v) for f,v in verdicts if v is not None])

The end result will be a list of PDB with where in the sequence (in that PDB code). (I wrote this in the reply box, so there may be a typo or two). PyMOL has a selection algebra called pepseq, which matches missing atoms, but I was a whimp and played it safe by being more verbose. Also, a for loop can be used instead of an iterate. But I think it is slower.

atoms = pymol.cmd.get_model(f"pepseq {target} and name CA")
for atom in atoms.atom:
      if atom.ss == ' ...


In Uniprot, if a protein is crystallised, there will be the feature entries corresponding to the secondary structure. It is sheet or helix. No turns, pi-helices or 3_10 helices. There is no Biopython method for parsing Uniprot XML. I wrote myself a parser and it is not too horrid thing to do —although I monkeypatched elementtree. Alternatively, xmlschema.XMLSchema.to_dict can be used to convert the XML to a dictionary. The advantage of Uniprot is that the residues ids will not require correcting. The disadvantage is parsing XML.

My parser is specific for my application and it is poorly documented (so would not recommend it) but but... I can share it and human data. I'd be used like:

 import os
 from michelanglo_protein import ProteinCore
 p = ProteinCore().gload(file=os.path.join('gpickle','Q86V25.gpz'))
 if 'helix' in p.features:
        n = p.sequence.find( ...
        for ... p.features['helix'] #('helix', 'turn', 'strand')
        if x < n < y ...
  • $\begingroup$ Thank you. Parsing it on one's own doesn't look complicated. Still, I somehow balk at the idea that my needs are so specific... You are positive there's no such tool? $\endgroup$
    – user75619
    Jan 28, 2020 at 16:42
  • $\begingroup$ Proving a negative is hard, so I can only say I have never read of one.But I had a similar problem some time back and did it manually. Furthermore, logistically a server to do this would need its data pre-generated but then the combinatorial issues will be huge so would not work... $\endgroup$ Jan 28, 2020 at 17:12
  • 1
    $\begingroup$ there is msdmotif ebi.ac.uk/pdbe/docs/Tutorials/msdmotif/introduction.html but I suspect the query might be a bit slow as there would be a lot of hits $\endgroup$
    – gilleain
    Jan 28, 2020 at 23:01
  • $\begingroup$ I just realised that in my comment I said something incredibly daft. A server is totally possible, they just need to store sequence+SS type sequence as opposed to all combinations. Apologies. $\endgroup$ Jan 29, 2020 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.