How to find the names of elements while parsing PDB files via biopython?
1
0
Entering edit mode
4 months ago
Tzunami ▴ 10

Hi all! Biopython has methods to get the atoms' names but the returned values are of the form CA, CB, HD etc. Is there a way to get just the elements' name (for example instead of CA, CB I need to get C, C indicating two carbon atoms). Thank you!

Biopython PDB • 188 views
ADD COMMENT
0
Entering edit mode
12 weeks ago
Tzunami ▴ 10

Found the solution (atom entries have an attribute called element which returns the element of the corresponding atom) -

for model in structure:
    for chain in model:
        for residue in chain:
            for atom in residue:
               print(atom.element)  # atom.element can be used to access the element
ADD COMMENT

Login before adding your answer.

Traffic: 1747 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6