CheckBCRPocket

From p3d
Jump to: navigation, search

This small script collects atoms within 4Å of each beta carotene in a protein and determines what the amino acid composition is. Obviously, each residue will taken only once into account;)

CheckBCRPocket.py

usage

CheckBCRPocket.py

The output is a table. first row is the beta carotene (BCR) residue id, second row is the number of atoms of the BCR (should be 40), the rest is self-explanatory.

output

2AXT.old.questionmark.pdb
                    GLY  ALA  VAL  LEU  ILE  CYS  MET  PHE  TYR  TRP  PRO  SER  THR  ASN  GLN  ASP  GLU  HIS  LYS  ARG 
BCR ( 106  ) #a: 40  0    1    1    3    0    1    0    2    1    0    0    0    0    0    0    0    0    0    0    0   
BCR ( 5112 ) #a: 40  1    3    2    3    1    0    1    3    0    0    0    1    1    0    0    0    0    0    0    0  
BCR ( 111  ) #a: 40  2    0    2    2    1    0    0    4    1    1    1    0    2    0    0    0    0    0    0    0  
BCR ( 5116 ) #a: 40  1    0    3    1    1    0    0    2    1    0    0    1    0    1    0    0    0    0    0    0  
BCR ( 5105 ) #a: 40  2    0    1    1    1    0    0    0    0    1    0    2    0    0    0    0    0    0    0    0  
BCR ( 5107 ) #a: 40  0    0    1    2    1    0    1    2    0    0    0    0    0    0    0    0    0    0    0    0  
BCR ( 5106 ) #a: 40  0    1    1    3    0    1    0    2    1    0    0    0    0    0    0    0    0    0    0    0  
BCR ( 105  ) #a: 40  2    0    1    1    1    0    0    0    0    1    0    2    0    0    0    0    0    0    0    0  
BCR ( 107  ) #a: 40  0    0    1    2    1    0    1    2    0    0    0    0    0    0    0    0    0    0    0    0  
BCR ( 104  ) #a: 40  0    2    0    2    2    0    1    4    1    1    0    1    0    0    0    0    0    0    0    0  
BCR ( 101  ) #a: 40  0    3    1    4    4    1    0    1    0    1    1    0    0    0    0    0    0    0    0    0  
BCR ( 5104 ) #a: 40  0    2    0    2    3    0    1    4    1    1    0    1    0    0    0    0    0    0    0    0  
BCR ( 103  ) #a: 40  0    3    0    2    0    1    1    1    0    1    0    0    0    0    0    0    0    0    0    0  
BCR ( 113  ) #a: 40  2    4    2    5    0    0    0    2    1    1    0    1    0    0    0    0    0    1    0    0  
BCR ( 117  ) #a: 40  1    0    3    2    2    0    0    2    1    0    0    0    0    0    0    1    0    1    0    0  
BCR ( 5103 ) #a: 40  0    3    0    3    0    1    1    1    0    1    0    0    0    0    0    0    0    0    0    0  
BCR ( 5101 ) #a: 40  0    3    1    4    3    1    0    1    0    1    1    0    0    0    0    0    0    0    0    0  
BCR ( 5111 ) #a: 40  2    0    2    2    1    0    0    3    1    1    1    0    2    0    0    0    0    0    0    0  
BCR ( 112  ) #a: 40  1    3    2    3    1    0    1    3    0    0    0    1    1    0    0    0    0    0    0    0  
BCR ( 5117 ) #a: 40  0    0    3    2    2    0    0    2    1    0    0    0    0    0    0    1    0    1    0    0  
BCR ( 116  ) #a: 40  1    0    3    1    1    0    0    2    1    0    0    1    0    1    0    0    0    0    0    0  
BCR ( 5113 ) #a: 40  2    4    2    5    0    0    0    3    1    1    0    1    0    0    0    0    0    1    0    0  

code

#!/usr/bin/env python
'''Find the AA composition of beta-carotene binding sites. The file list is hard coded.

 by Ch. Fufezan 2009

usage: CheckBCRPocket.py'''

import sys
from p3d import protein as protein
#import p3d.vector
from collections import defaultdict as ddict
from p3d.library import Library as L
 
FILES = ['2AXT.old.questionmark.pdb']#'1JB0.pdb','2AXT.pdb','2E74.pdb']

if (__name__ == '__main__'):
	for pdbFile in FILES:
		print('')
		pdb = protein.Protein(pdbFile)
		print(pdb.fullname)
		''' 
		query Set C7 of BCR to have one atom per residue 
		'''
		print('{0:19}'.format(''),end='')
		for aa in L['AA']:
			print('{0:^5}'.format(aa),end='')
		print('')
		for i,c7 in enumerate(pdb.query('resname BCR and atom type C7')):
			bcr = c7.allAtomsOfSameResidue()
			print('BCR ({0:^6}) #a:{1:>3}'.format(c7.resid,len(bcr)),end='')
			stats = ddict(int)
			alreadySeen = []
			pocketatoms = pdb.query('protein and within 4 of ',bcr)
			for satom in pocketatoms:
				idTag =  '{0}{1}{2}'.format(satom.aa,satom.chain,satom.resid)
				if idTag not in alreadySeen:
					alreadySeen.append(idTag)
					stats[satom.aa] += 1
			for aa in L['AA']:
				print('{0:^5}'.format(stats[aa]),end='')
			print('')