-
Notifications
You must be signed in to change notification settings - Fork 0
/
rna_distmap_v0.1.py
45 lines (36 loc) · 1.19 KB
/
rna_distmap_v0.1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
from numpy import *
import matplotlib.pyplot as plt
from pylab import *
# The following python script is aimed at recreating interatomic distance plots such
# as the one in Figure 2 of Malathi and Yathindra, Biochemical Journal, 1982,
# 205, 457-460.
# http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1158502/?page=3
#
# CMmatr is the output of and octave script
# which computes the interatomic distance
# matrix from pdbfiles which have been parsed
# with an awk/bash script called PPdistance
#
inp = open("CMmatr");
#Arrange the data in an array
dist_arr = []
for line in inp.readlines():
dist_arr.append([])
for i in line.split():
dist_arr[-1].append(float(i))
inp.close()
M = array(dist_arr)
#Make the plot.
plt.clf()
plt.suptitle('Interatomic Phosphorus Distance Matrix', fontsize=18)
plt.title('RNA P4-P6 Ribozyme Domain of Group I Intron (PDB_ID:1GID)')
plt.xlabel('Residue Number')
plt.ylabel('Residue Number')
plt.imshow(M, vmin=0, vmax=20, origin=0,
cmap=cm.gist_heat, aspect='equal', interpolation='nearest')
plt.colorbar()
plt.grid(True)
#If you want to get a png figure uncomment the next line.
savefig("confmat.png", dpi=200, format="png")
plt.show()