Bioinformatics ReviewBioinformatics Review
Notification Show More
Font ResizerAa
  •  Home
  • Docking
  • MD Simulation
  • Tools
  • More Topics
    • Softwares
    • Sequence Analysis
    • Algorithms
    • Bioinformatics Programming
    • Bioinformatics Research Updates
    • Drug Discovery
    • Phylogenetics
    • Structural Bioinformatics
    • Editorials
    • Tips & Tricks
    • Bioinformatics News
    • Featured
    • Genomics
    • Bioinformatics Infographics
  • Community
    • BiR-Research Group
    • Community Q&A
    • Ask a question
    • Join Telegram Channel
    • Join Facebook Group
    • Join Reddit Group
    • Subscription Options
    • Become a Patron
    • Write for us
  • About Us
    • About BiR
    • BiR Scope
    • The Team
    • Guidelines for Research Collaboration
    • Feedback
    • Contact Us
    • Recent @ BiR
  • Subscription
  • Account
    • Visit Dashboard
    • Login
Font ResizerAa
Bioinformatics ReviewBioinformatics Review
Search
Have an existing account? Sign In
Follow US
Bioinformatics ProgrammingPython

How to extract x,y,z coordinates of atoms from PDB file?

Tariq Abdullah
Last updated: May 11, 2022 8:07 pm
Tariq Abdullah
Share
1 Min Read
How to extract x,y,z coordinates of atoms from PDB file?
SHARE

The x, y, and z coordinates of atoms are provided in the PDB file. One way to extract them is by using the Biopython package [1]. In this article, we will extract coordinates of C-alpha atoms for each residue from the PDB file using Biopython.

Let’s say we have a PDB file named ‘input.pdb‘.



#!/usr/bin/env python3

from Bio.PDB import *
import numpy as np

p=PDBParser()

structure=p.get_structure('input', "input.pdb")

for model in structure:
      for chain in model:
            CA_coord = []
            for residue in chain:
                CA_coord.append((residue['CA'].get_vector()))
                print(CA_coord)

Save this file as Python script, for example, as ‘ca_coord.py‘, keep your input file in the same directory or provide the full path in the script, and run it as:

python3 ca_coord.py

References

  1. https://biopython.org/
TAGGED:biopythonc-alpha atomspdbpythonxyz coordinates
Share This Article
Facebook Copy Link Print
ByTariq Abdullah
Tariq is founder of Bioinformatics Review and Lead Developer at IQL Technologies. His areas of expertise include algorithm design, phylogenetics, MicroArray, Plant Systematics, and genome data analysis. If you have questions, reach out to him via his homepage.
Leave a Comment

Leave a Reply Cancel reply

You must be logged in to post a comment.

Starting in Bioinformatics? Do This First!
Starting in Bioinformatics? Do This First!
Tips & Tricks
[Editorial] Is it ethical to change the order of authors’ names in a manuscript?
Editorial Opinion
Installing bbtools on Ubuntu
[Tutorial] Installing BBTools on Ubuntu (Linux).
Sequence Analysis Software Tools
wes_data_analysis Whole Exome Sequencing (WES) Data visualization Toolkit
wes_data_analysis: Whole Exome Sequencing (WES) Data visualization Toolkit
Bioinformatics Programming GitHub Python

You Might Also Like

Bioinformatics ProgrammingSoftware

TIN: R package to analyze Transcriptome Instability

December 21, 2015
Bioinformatics Programming

How to extract fasta sequences from a multi-fasta file based on matching headers in a separate file?

May 20, 2020
SQL queries for complex information retrieval
Bioinformatics ProgrammingSQL

Nested SQL queries and aggregate functions for complex information retrieval from a database

October 1, 2020
smitostr.py: Python script to convert SMILES to structures.
Bioinformatics ProgrammingCheminformaticsPython

smitostr.py: Python script to convert SMILES to structures.

November 19, 2022
Copyright 2024 IQL Technologies
  • Journal
  • Customer Support
  • Contact Us
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Cookie Policy
  • Sitemap
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?

Not a member? Sign Up