Connect with us

Bioinformatics Programming

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

Published

on

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

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/

Tariq is founder of Bioinformatics Review and CEO 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.

Bioinformatics Programming

How to commit changes to GitHub repository using vs code?

Published

on

How to commit changes to GitHub repository using vs code?

In this article, we are providing a few commands that are used to commit changes to GitHub repositories using VS code terminal.

(more…)

Continue Reading

Bioinformatics Programming

Extracting first and last residue from helix file in DSSP format.

Published

on

Extracting first and last residue from helix file in DSSP format.

Previously, we have provided a tutorial on using dssp_parser to extract all helices including long and short separately. Now, we have provided a new python script to find the first and last residue in each helix file. (more…)

Continue Reading

Bioinformatics Programming

dssp_parser: A new Python package to extract helices from DSSP files.

Published

on

A new Python package named ‘dssp_parser‘ is developed to parse DSSP files. This package fetches all helices including long and short ones from DSSP files. (more…)

Continue Reading

LATEST ISSUE

ADVERT