Coder Social home page Coder Social logo

biographs's Introduction

Biographs: Amino acid networks in python

Other names for amino-acid network include:

  • Protein contact network
  • Residue contact network
  • Structural protein network

Work with amino acid networks using the power of solid packages networkx and biopython!

Install

To install, open a terminal and type the following:

$ pip install biographs

What is Biographs?

Biographs is a python module converting structural files formats like pdb or cif into amino acid networks. It is written over the libraries biopython and networkx. This allows for a flexible and powerful handling of both: protein networks and protein structures.

An amino-acid network is a network of amino acids such that two amino acids are connected if they share two atoms within a certain distance. Here, this distance is defined by the keyword cutoff that defines the threshold distance in angstroms (ร…).

It uses the great Bio.PDB module to construct the network given a cutoff distance. Here, the network is a networkx.Graph object, which allows high customization of the network and tons of tools for networks analysis.

To use biographs just type in a terminal (ignore the $ symbol):

$ pip install biographs

Basic usage

I have a pdb file in /Users/rdora/1eei.pdb, here is an example to build the amino acid network of the cholera toxin (PDB id 1eei).

import biographs as bg


molecule = bg.Pmolecule('Users/rdora/1eei.pdb')
# biopython molecule structural model
mol_model = pmolecule.model
# networkx graph, by default 5 angstrom
network = molecule.network()
list(network.nodes)[:10]
# Output
['G26', 'G27', 'G24', 'G25', 'G22', 'G23', 'G20', 'G21', 'G28', 'G29']

Distance threshold and weight

If you want to use a different distance to define if two atoms are connected or not (and therefore their amino acids), use:

# Threshold is 8 angstrom
network = molecule.network(cutoff=8)

Similarly, if you want to set the network to be weighted, where each edge has a weight equal to the number of atom-pairs that are within the distance threshold, then:

network = molecule.network(cutoff=8, weight=True)

Water molecules

By default, water molecules are not considered as atoms, you can change that behavior with:

# Use water molecules
molecule = Pmolecule('/Users/rdora/1eei.pdb', water=True)

Required packages

biopython Great to read and work with structure files such as pdb found in the protein data bank. You can listen to the voices of three of the main contributors of biopython in this podcast.

networkx Has an extensive set of functions to deal with networks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.