©
20
16
D
r. Wa
lte
r
F
.
de
Az
ev
ed
o
Jr
.
1
000000000000000000000000000000000000000
000000000000000000000000000000000000000
000000000000111111111110001100000000000
000000000001111111111111111111000000001
000000000111111111111111111111111000000
000000000111111111111111111111111000000
000000000011111111111111111111100000000
000000001111111111111111111111111000000
000011111111111111111111111111111000000
001111111111111111111111111111110000000
111111111111111111111111111110000000000
111111111111111111111111111110000000000
000011111111111111111111111111111110000
001111111111111111111111111111111111000
011111111111111111111111111111111111000
001111111111111111111111111111111111100
000000011111111111111111111111111111110
000000001111111111111111111111111111110
000000000001111111111111111111111111110
000000000000011111111111111111111111110
000000000000000111111111111111111111000
000000000000000000000000001111000000000
000000000000000000000000000000000000000
000000000000000000000000000000000000000
000000000000000000000000000000000000000
www.python.org
2
Hoje veremos a estrutura de dados chamada tuple. Um tuple é similar a uma lista, e é
representado entre parânteses, como mostrado abaixo.
Assim, se quisermos mostrar todo o conteúdo atribuído à variável my_tuple, basta
usarmos um loop for e colocarmos uma função print(), como mostrado abaixo.
A execução do código mostrará um aminoácido por linha, o arquivo show_tuple.py tem
o código do programa.
my_tuple =("ALA","ARG","ASN","ASP","CYS","GLU","GLN","GLY","HIS","ILE",
"LEU","LYS","MET","PHE","PRO","SER","THR","TRP","TYR","VAL")
for aa in my_tuple:
print(aa)
Estrutura de Dados em Python (Tuple)
3
Estrutura de Dados em Python (Tuple)
www.python.org
Até agora tuple parece bem similar com a lista. Uma das principais diferenças é que
um tuple ocupa menos memória e tem acesso mais rápido. Para programas com listas
extensas é vantajoso o uso de tuple.
Outras diferenças estão mostradas na tabela abaixo.
Lista
Tuple
Mutável
Imutável
Não pode ser usado
como chave para
dicionários
Pode ser usado como
chave para dicionários
[elemento1,....]
(elemento1,....)
4
CDKs
www.python.org
Vamos ilustrar alguns problemas típicos de análise estrutural de proteínas e como
desenvolvermos códigos para resolvê-los. Considere a seguinte situação, você está
interessado em representar por um gráfico de barras quantas quinases dependentes
de ciclinas (CDKs) estão depositadas no Protein Data Bank.
5
CDKs
www.python.org
Abaixo temos a página de entrada do Protein Data Bank. Para fazermos download a
partir de critérios pré-definidos usamos “Advanced Search”.
6
No
“Advanced Search” clicamos em Biology->Enzyme Classification, para
selecionarmos todas as CDKs para classificação enzimática (enzyme classification).
CDKs
7
CDKs
www.python.org
Digitamos 2.7.11.22 para a classificação enzimática (enzyme classification) e clicamos
em “Submit Query”.
8
Abaixo temos o resultado da busca. Podemos ter acesso aos códigos PDB clicando
em “Download Files”.
CDKs
9
Abaixo temos os códigos de acesso PDB para todas CDKs identificadas no PDB.
CDKs
10
CDKs
www.python.org
A figura mostra um cladograma que indica a similaridade sequencial entre as CDKs
humanas. Quanto mais próximo no gráfico, maior a identidade sequencial das
proteínas.
11
Realizando-se uma contagem das estruturas de cada um todos tipos de CDK temos
os resultados mostrados no arquivo CSV abaixo.
CDK, Número de Estruturas
1,
3
2,
375
3,
0
4,
9
5,
1
6,
16
7,
1
8,
20
9,
20
10,
0
11,
0
12,
5
13,
1
14,
0
15,
0
16,
1
17,
0
18,
0
19,
0
20,
0
CDKs
www.python.org
12
Veremos um programa (csv2barplot001.py) que realiza a leitura deste arquivo CSV e
faz o gráfico de barras para a porcentagem de cada tipo de CDK presente no PDB.
CDK, Número de Estruturas
1,
3
2,
375
3,
0
4,
9
5,
1
6,
16
7,
1
8,
20
9,
20
10,
0
11,
0
12,
5
13,
1
14,
0
15,
0
16,
1
17,
0
18,
0
19,
0
20,
0
CDKs
www.python.org
def main():
# Get file name
csv_in = "pdbdata1.csv" # Call read_csv x,y = read_csv(csv_in) # Call calc_perc() perc = calc_perc(y)
# Set up arguments for function bar_plot() x_label_in = "CDK Number"
y_label_in = "Percentage of CDK Structures" font_size_in = 18
title_in = ""
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks tuple_in = ("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20") dpi_in = 900 file_out = "barplot_pdb.png" # Call bar_plot_1() bar_plot_1(x,perc,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,tuple_in,dpi_in,file_out) main()
13
Podemos colocar as chamadas das funções numa função chamada função main().
Esta função depois tem que ser evocada, como mostrado abaixo.
Programa: csv2barplot001.py
def main():
# Get file name
csv_in = "pdbdata1.csv" # Call read_csv x,y = read_csv(csv_in) # Call calc_perc() perc = calc_perc(y)
# Set up arguments for function bar_plot() x_label_in = "CDK Number"
y_label_in = "Percentage of CDK Structures" font_size_in = 18
title_in = ""
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks tuple_in = ("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20") dpi_in = 900 file_out = "barplot_pdb.png" # Call bar_plot_1() bar_plot_1(x,perc,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,tuple_in,dpi_in,file_out) main()
14
Inicialmente atribuímos à variável csv_in a string com o nome do arquivo CSV.
Programa: csv2barplot001.py
def main():
# Get file name
csv_in = "pdbdata1.csv" # Call read_csv x,y = read_csv(csv_in) # Call calc_perc() perc = calc_perc(y)
# Set up arguments for function bar_plot() x_label_in = "CDK Number"
y_label_in = "Percentage of CDK Structures" font_size_in = 18
title_in = ""
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks tuple_in = ("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20") dpi_in = 900 file_out = "barplot_pdb.png" # Call bar_plot_1() bar_plot_1(x,perc,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,tuple_in,dpi_in,file_out) main()
15
Agora chamamos a função read_csv() que tem como argumento o nome do arquivo
CSV. Esta função retorna os arrays x e y.
Programa: csv2barplot001.py
def main():
# Get file name
csv_in = "pdbdata1.csv" # Call read_csv x,y = read_csv(csv_in) # Call calc_perc() perc = calc_perc(y)
# Set up arguments for function bar_plot() x_label_in = "CDK Number"
y_label_in = "Percentage of CDK Structures" font_size_in = 18
title_in = ""
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks tuple_in = ("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20") dpi_in = 900 file_out = "barplot_pdb.png" # Call bar_plot_1() bar_plot_1(x,perc,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,tuple_in,dpi_in,file_out) main()
16
Em seguida chamamos a função calc_perc() que calcula a percentagem de cada
número que está na segunda coluna do arquivo CSV e retorna o float perc.
Programa: csv2barplot001.py
def main():
# Get file name
csv_in = "pdbdata1.csv" # Call read_csv x,y = read_csv(csv_in) # Call calc_perc() perc = calc_perc(y)
# Set up arguments for function bar_plot() x_label_in = "CDK Number"
y_label_in = "Percentage of CDK Structures" font_size_in = 18
title_in = ""
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks tuple_in = ("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20") dpi_in = 900 file_out = "barplot_pdb.png" # Call bar_plot_1() bar_plot_1(x,perc,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,tuple_in,dpi_in,file_out) main()
17
As próximas linhas definem os argumentos a serem usados na função bar_plot_1()
Programa: csv2barplot001.py
def main():
# Get file name
csv_in = "pdbdata1.csv" # Call read_csv x,y = read_csv(csv_in) # Call calc_perc() perc = calc_perc(y)
# Set up arguments for function bar_plot() x_label_in = "CDK Number"
y_label_in = "Percentage of CDK Structures" font_size_in = 18
title_in = ""
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks tuple_in = ("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20") dpi_in = 900 file_out = "barplot_pdb.png" # Call bar_plot_1() bar_plot_1(x,perc,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,tuple_in,dpi_in,file_out) main()
18
Por último, chamamos a função bar_plot_1()
Programa: csv2barplot001.py
def read_csv(file_in):
"""Function to read a two-columns csv file and return two arrays""" # Import libraries
import numpy as np import csv
import sys
# Try to open csv file try:
fo = open(file_in,"r") csv1 = csv.reader(fo) except IOError:
sys.exit("I can't find "+csv_in+" file!") # Set up empty list
aux1 = [] aux2 = []
# Assign zero to count_str count_str = 0
# Looping throuh data for line in csv1: print(line[0]) aux1.append(float(line[0])) aux2.append(float(line[1])) count_str += int(line[1]) # Close file fo.close() # Make arrays x = np.array(aux1) y = np.array(aux2) return x,y
19
A função read_csv() é basicamente a repetição do que já foi visto para leitura de
arquivos CSV. As duas colunas são retornadas como arrays.
Programa: csv2barplot001.py
def calc_perc(y):
"""Function to calculate percentage of structures"""
# Import library import numpy as np
# Set up zero array p = np.zeros(len(y))
# Sum structures count_str = np.sum(y)
# Generate array with percentage i = 0 for line in y: p1 = float(line)/count_str p[i] = 100*p1 i+= 1 return p
20
A função calc_perc() recebe um array e calcula um novo array com a porcentagem de
ocorrência de cada dado disponível no array y. A função retorna um array com as
porcentagens (p).
Programa: csv2barplot001.py
def bar_plot_1(x_1,y_1,x_label_1,y_label_1,font_size_1,title_1,bar_width_1,tuple_1,dpi_1,file_out_1): """Function to generate bar plot"""
# Import library import matplotlib.pyplot as plt # Generates plot plt.bar(x_1,y_1,color="grey") plt.xlabel(x_label_1,fontsize=font_size_1) plt.ylabel(y_label_1,fontsize=font_size_1) plt.xticks(x_1+bar_width_1,tuple_1) plt.xlim(0,len(y_1)) # Shows plot plt.show()
# Saves plot on png file
plt.savefig(file_out_1,DPI=dpi_1)
21
A função bar_plot_1() gera o gráfico de barras.
Programa: csv2barplot001.py
22
Abaixo temos o gráfico gerado.
CDK, Número de
Estruturas
1,
3
2,
375
3,
0
4,
9
5,
1
6,
16
7,
1
8,
20
9,
20
10,
0
11,
0
12,
5
13,
1
14,
0
15,
0
16,
1
17,
0
18,
0
19,
0
20,
0
Programa: csv2barplot001.py
www.python.org
23
Vamos considerar que queremos estudar as ligações intermoleculares entre um
ligante ativo (inibidor) e uma proteína alvo. Vamos manter a CDK como exemplo. Para
isto precisamos baixar do PDB todas as estruturas que apresentam informação de
afinidade, por exemplo IC
50
. Abaixo temos parte de um arquivo CSV gerado pelo
programa SAnDReS (Xavier et al., 2016) que integra a informação do ligante com a
afinidade.
# Type of binding information: ic50
CHKLIG,1DI8,DTQ,A, 500,1000.0
CHKLIG,1DM2,HMD,A, 400,70.0
CHKLIG,1E9H,INR,A,1298,148.0
CHKLIG,1FVT,106,A, 299,60.0
CHKLIG,1FVV,107,A, 501,10.0
CHKLIG,1GII,1PU,A, 501,260.0
CHKLIG,1H00,FAP,A,1300,38000.0
CHKLIG,1H07,MFP,A, 301,3000.0
CHKLIG,1H0W,207,A,1299,13000.0
CHKLIG,1H1Q,2A6,A,1298,1433.3333333333333
CHKLIG,1H1R,6CP,A,1298,2300.0
CHKLIG,1JVP,LIG,P, 301,1600.0
CHKLIG,1KE5,LS1,A, 299,560.0
CHKLIG,1KE6,LS2,A, 299,5.7
CHKLIG,1KE7,LS3,A, 299,8.9
CHKLIG,1KE8,LS4,A, 299,1000.0
CHKLIG,1KE9,LS5,A, 299,660.0
CHKLIG,1OGU,ST8,A,1298,34.0
CHKLIG,1OI9,N20,A,1298,379.3333333333333
CHKLIG,1OIQ,HDU,A,1299,2900.0
CHKLIG,1OIR,HDY,A,1298,32.0
CHKLIG,1OIT,HDT,A,1299,2.25
CHKLIG,1OIU,N76,A,1298,210.0
Programa: intermol_interactions.py
www.python.org
24
No arquivo abaixo a primeira linha é de comentário e indica o tipo de afinidade, no
caso IC
50
. Em seguida temos linhas com informações sobre os ligantes dos arquivos
PDB. O SAnDReS identifica automaticamente qual ligante do arquivo PDB é o ativo,
ou seja, podemos ter mais de um ligante no PDB, assim o ideal é identificarmos qual
ligante é o inibidor.
# Type of binding information: ic50
CHKLIG,1DI8,DTQ,A, 500,1000.0
CHKLIG,1DM2,HMD,A, 400,70.0
CHKLIG,1E9H,INR,A,1298,148.0
CHKLIG,1FVT,106,A, 299,60.0
CHKLIG,1FVV,107,A, 501,10.0
CHKLIG,1GII,1PU,A, 501,260.0
CHKLIG,1H00,FAP,A,1300,38000.0
CHKLIG,1H07,MFP,A, 301,3000.0
CHKLIG,1H0W,207,A,1299,13000.0
CHKLIG,1H1Q,2A6,A,1298,1433.3333333333333
CHKLIG,1H1R,6CP,A,1298,2300.0
CHKLIG,1JVP,LIG,P, 301,1600.0
CHKLIG,1KE5,LS1,A, 299,560.0
CHKLIG,1KE6,LS2,A, 299,5.7
CHKLIG,1KE7,LS3,A, 299,8.9
CHKLIG,1KE8,LS4,A, 299,1000.0
CHKLIG,1KE9,LS5,A, 299,660.0
CHKLIG,1OGU,ST8,A,1298,34.0
CHKLIG,1OI9,N20,A,1298,379.3333333333333
CHKLIG,1OIQ,HDU,A,1299,2900.0
CHKLIG,1OIR,HDY,A,1298,32.0
CHKLIG,1OIT,HDT,A,1299,2.25
CHKLIG,1OIU,N76,A,1298,210.0
Programa: intermol_interactions.py
www.python.org
25
A palavra-chave “CHKLIG” indica que a informação é sobre um ligante, depois temos o
código PDB, seguido pelo código do ligante, a cadeia do ligante, o número do ligante.
Por último temos os dados de afinidade, em nanomolar (10
-9
M).
# Type of binding information: ic50
CHKLIG,1DI8,DTQ,A, 500,1000.0
CHKLIG,1DM2,HMD,A, 400,70.0
CHKLIG,1E9H,INR,A,1298,148.0
CHKLIG,1FVT,106,A, 299,60.0
CHKLIG,1FVV,107,A, 501,10.0
CHKLIG,1GII,1PU,A, 501,260.0
CHKLIG,1H00,FAP,A,1300,38000.0
CHKLIG,1H07,MFP,A, 301,3000.0
CHKLIG,1H0W,207,A,1299,13000.0
CHKLIG,1H1Q,2A6,A,1298,1433.3333333333333
CHKLIG,1H1R,6CP,A,1298,2300.0
CHKLIG,1JVP,LIG,P, 301,1600.0
CHKLIG,1KE5,LS1,A, 299,560.0
CHKLIG,1KE6,LS2,A, 299,5.7
CHKLIG,1KE7,LS3,A, 299,8.9
CHKLIG,1KE8,LS4,A, 299,1000.0
CHKLIG,1KE9,LS5,A, 299,660.0
CHKLIG,1OGU,ST8,A,1298,34.0
CHKLIG,1OI9,N20,A,1298,379.3333333333333
CHKLIG,1OIQ,HDU,A,1299,2900.0
CHKLIG,1OIR,HDY,A,1298,32.0
CHKLIG,1OIT,HDT,A,1299,2.25
CHKLIG,1OIU,N76,A,1298,210.0
Programa: intermol_interactions.py
www.python.org
26
O programa intermol_interactions.py realiza a leitura deste tipo de arquivo e extrai as
informações dos ligantes ativos de cada PDB. Esta informação é usada para a
identificação das interações intermoleculares entre inibidor e proteína. Esta informação
é usada para gerarmos um gráfico de barras que tem a participação de cada resíduo
de aminoácido nas interações intermoleculares. Consideramos um valor de corte de
4,5 Å.
# Type of binding information: ic50
CHKLIG,1DI8,DTQ,A, 500,1000.0
CHKLIG,1DM2,HMD,A, 400,70.0
CHKLIG,1E9H,INR,A,1298,148.0
CHKLIG,1FVT,106,A, 299,60.0
CHKLIG,1FVV,107,A, 501,10.0
CHKLIG,1GII,1PU,A, 501,260.0
CHKLIG,1H00,FAP,A,1300,38000.0
CHKLIG,1H07,MFP,A, 301,3000.0
CHKLIG,1H0W,207,A,1299,13000.0
CHKLIG,1H1Q,2A6,A,1298,1433.3333333333333
CHKLIG,1H1R,6CP,A,1298,2300.0
CHKLIG,1JVP,LIG,P, 301,1600.0
CHKLIG,1KE5,LS1,A, 299,560.0
CHKLIG,1KE6,LS2,A, 299,5.7
CHKLIG,1KE7,LS3,A, 299,8.9
CHKLIG,1KE8,LS4,A, 299,1000.0
CHKLIG,1KE9,LS5,A, 299,660.0
CHKLIG,1OGU,ST8,A,1298,34.0
CHKLIG,1OI9,N20,A,1298,379.3333333333333
CHKLIG,1OIQ,HDU,A,1299,2900.0
CHKLIG,1OIR,HDY,A,1298,32.0
CHKLIG,1OIT,HDT,A,1299,2.25
CHKLIG,1OIU,N76,A,1298,210.0
Programa: intermol_interactions.py
www.python.org
def main():
# Import library import numpy as np
# Set up the number of residues nres = 298 # Call read_access_codes() p,l = read_access_codes("chklig_cdk2.in") # Call sum_intermol_contacts() c = sum_intermol_contacts(p,l,nres) # Call my_csv() make_csv(c,"data1.csv")
# Set up arguments for function bar_plot_2()
x = np.arange(0,len(c)) # Set up x-axis array x_label_in = "Residue Number" # Set up x-axis label y_label_in = "Number of Intermolecular Contacts" # Set up y-axis label
font_size_in = 16 # Set up font size for axis labels title_in = "" # Set up title
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks dpi_in = 900 # Set up dots per inch
file_out = "barplot_pdb.png" # Set up output file name
# Call bar_plot()
bar_plot_2(x,c,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,dpi_in,file_out)
main()
27
Abaixo temos a função main() do programa intermol_interactions.py.
Programa: intermol_interactions.py
def main():
# Import library import numpy as np
# Set up the number of residues
nres = 298 # Call read_access_codes() p,l = read_access_codes("chklig_cdk2.in") # Call sum_intermol_contacts() c = sum_intermol_contacts(p,l,nres) # Call my_csv() make_csv(c,"data1.csv")
# Set up arguments for function bar_plot_2()
x = np.arange(0,len(c)) # Set up x-axis array x_label_in = "Residue Number" # Set up x-axis label y_label_in = "Number of Intermolecular Contacts" # Set up y-axis label
font_size_in = 16 # Set up font size for axis labels title_in = "" # Set up title
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks dpi_in = 900 # Set up dots per inch
file_out = "barplot_pdb.png" # Set up output file name
# Call bar_plot()
bar_plot_2(x,c,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,dpi_in,file_out)
main()
28
Inicialmente atribuímos o número de resíduos de aminoácido à variável nres.
Programa: intermol_interactions.py
def main():
# Import library import numpy as np
# Set up the number of residues
nres = 298 # Call read_access_codes() p,l = read_access_codes("chklig_cdk2.in") # Call sum_intermol_contacts() c = sum_intermol_contacts(p,l,nres) # Call my_csv() make_csv(c,"data1.csv")
# Set up arguments for function bar_plot_2()
x = np.arange(0,len(c)) # Set up x-axis array x_label_in = "Residue Number" # Set up x-axis label y_label_in = "Number of Intermolecular Contacts" # Set up y-axis label
font_size_in = 16 # Set up font size for axis labels title_in = "" # Set up title
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks dpi_in = 900 # Set up dots per inch
file_out = "barplot_pdb.png" # Set up output file name
# Call bar_plot()
bar_plot_2(x,c,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,dpi_in,file_out)
main()
29
Em seguida é chamada a função read_access_codes() que retorna duas listas com os
códigos PDB e os códigos dos ligantes ativos.
Programa: intermol_interactions.py
def main():
# Import library import numpy as np
# Set up the number of residues
nres = 298 # Call read_access_codes() p,l = read_access_codes("chklig_cdk2.in") # Call sum_intermol_contacts() c = sum_intermol_contacts(p,l,nres) # Call my_csv() make_csv(c,"data1.csv")
# Set up arguments for function bar_plot_2()
x = np.arange(0,len(c)) # Set up x-axis array x_label_in = "Residue Number" # Set up x-axis label y_label_in = "Number of Intermolecular Contacts" # Set up y-axis label
font_size_in = 16 # Set up font size for axis labels title_in = "" # Set up title
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks dpi_in = 900 # Set up dots per inch
file_out = "barplot_pdb.png" # Set up output file name
# Call bar_plot()
bar_plot_2(x,c,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,dpi_in,file_out)
main()
30
O programa agora chama a função sum_intermol_contacts() que faz a leitura de cada
arquivo PDB e identifica as interações intermoleculares para cada resíduo.
Programa: intermol_interactions.py
def main():
# Import library import numpy as np
# Set up the number of residues
nres = 298 # Call read_access_codes() p,l = read_access_codes("chklig_cdk2.in") # Call sum_intermol_contacts() c = sum_intermol_contacts(p,l,nres) # Call my_csv() make_csv(c,"data1.csv")
# Set up arguments for function bar_plot_2()
x = np.arange(0,len(c)) # Set up x-axis array x_label_in = "Residue Number" # Set up x-axis label y_label_in = "Number of Intermolecular Contacts" # Set up y-axis label
font_size_in = 16 # Set up font size for axis labels title_in = "" # Set up title
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks dpi_in = 900 # Set up dots per inch
file_out = "barplot_pdb.png" # Set up output file name
# Call bar_plot()
bar_plot_2(x,c,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,dpi_in,file_out)
main()
31
A função make_csv () gera um arquivo CSV com o número de contatos por resíduo
(data1.csv).
Programa: intermol_interactions.py
def main():
# Import library import numpy as np
# Set up the number of residues
nres = 298 # Call read_access_codes() p,l = read_access_codes("chklig_cdk2.in") # Call sum_intermol_contacts() c = sum_intermol_contacts(p,l,nres) # Call my_csv() make_csv(c,"data1.csv")
# Set up arguments for function bar_plot_2()
x = np.arange(0,len(c)) # Set up x-axis array x_label_in = "Residue Number" # Set up x-axis label y_label_in = "Number of Intermolecular Contacts" # Set up y-axis label
font_size_in = 16 # Set up font size for axis labels title_in = "" # Set up title
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks dpi_in = 900 # Set up dots per inch
file_out = "barplot_pdb.png" # Set up output file name
# Call bar_plot()
bar_plot_2(x,c,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,dpi_in,file_out)
main()
32
Em seguida são atribuídos os valores dos argumentos da função bar_plot_2().
Programa: intermol_interactions.py
def main():
# Import library import numpy as np
# Set up the number of residues
nres = 298 # Call read_access_codes() p,l = read_access_codes("chklig_cdk2.in") # Call sum_intermol_contacts() c = sum_intermol_contacts(p,l,nres) # Call my_csv() make_csv(c,"data1.csv")
# Set up arguments for function bar_plot_2()
x = np.arange(0,len(c)) # Set up x-axis array x_label_in = "Residue Number" # Set up x-axis label y_label_in = "Number of Intermolecular Contacts" # Set up y-axis label
font_size_in = 16 # Set up font size for axis labels title_in = "" # Set up title
bar_width_in = 0.35 # Sep up bar width to move bar in the xticks dpi_in = 900 # Set up dots per inch
file_out = "barplot_pdb.png" # Set up output file name
# Call bar_plot()
bar_plot_2(x,c,x_label_in,y_label_in,font_size_in,title_in,bar_width_in,dpi_in,file_out)
main()