-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobalCC.py
More file actions
100 lines (79 loc) · 3.39 KB
/
Copy pathglobalCC.py
File metadata and controls
100 lines (79 loc) · 3.39 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import os, sys
import rmsd as r
import structureTools_TaylorArnaud as st
if __name__ == '__main__':
monDico = dict()
if (len(sys.argv) == 4):
prot1 =sys.argv[1]
prot2 =sys.argv[2]
ficAtome=sys.argv[3]
print("Fichier ",ficAtome," fourni comme fichier d'atomes !")
elif (len(sys.argv)== 3):
prot1 =sys.argv[1]
prot2 =sys.argv[2]
print("Default mode !")
else:
print("Le format d'entrée attendu est : structureTools_TaylorArnaud.py fichier_1.PDB fichier_2.PDB [atomes.txt]")
exit()
#########################################
# Etape 1 : RMSD de chaque conformation #
#########################################
#~ # Lecture des PDBs
dico_structure_Ref = st.lirePDB(prot1)
dico_dynamique = st.lirePDB(prot2)
# Création des listes des objets à traiter
model_ref = list(dico_structure_Ref.keys()).pop()
res=dict()
for model_dyn in dico_dynamique.keys():
res[model_dyn] = r.rmsd(dico_structure_Ref,dico_dynamique,model_ref,model_dyn,['CA','O','N','C5'])
#~ #Visualisation avec un nuage de points = Mieux
r.drawRMDS(res, title="RMSD vs Time")
st.createPDBMultiThreads(dico_structure_Ref,"Refs")
st.createPDBMultiThreads(dico_dynamique,"Frames")
#########################################
##### Etape 2 : RMSD des 5 domaines #####
#########################################
refId =list()
refNames = os.listdir("./Refs")
#Récupération des noms de domaines possibles
for a in refNames:
if(a[0:2] not in refId):
refId.append(a[0:2])
dicConfs = dict()
# Parcours des domaines possibles
for dom in refId:
#Extraction des conformations possibles pour le domaine d'intérêt
currentDom=st.lecture_dossier("./",dom+'*') # Récupération du chemin de tous les fichiers associé au domaine dom
confRef = st.lirePDB(currentDom[0][0]) # Chemin de la conformation de référence
y = list(confRef.keys())
y = int(y.pop())
for dyn in currentDom[1]: # Parcours des fichiers de conformation
fic = st.lirePDB(dyn)
z = int(list(fic.keys()).pop()) # Récupération du numéro de modèle
#~ z = int(z.pop())
if z not in dicConfs.keys():
dicConfs[z] ={} # Sauvegarde nouvelle configuration
w = r.rmsd(confRef,fic,y,z,['CA','O','N','C5']) # Calcul du RMSD pour chaque configuration
if(w != None): # Si calcul possible (CA alignés)
dicConfs[z][dom]= w # Sauvegarde
############################################
####### Ecriture du fichier de sortie ######
############################################
toDraw = dict()
with open("ficOut","w") as fic: #
for conf in dicConfs.keys():
fic.write("MODEL "+str(conf)+"\n")
fic.write("G-RMSD "+str(res[conf])+"\n") # Ecriture du RMSD global
for dom in dicConfs[conf].keys():
fic.write(str(dom)+"\t"+str(dicConfs[conf][dom])+"\n") # Ecriture du RMSD pour les 5 domaine de la configuration
if dom not in toDraw.keys():
toDraw[dom]={}#Dico pour la visualisation
toDraw[dom][conf]=dicConfs[conf][dom] #Ajoute du RMSD pour chaque couple (domaine,config)
####################################
##### Représentation graphique #####
####################################
for dom in toDraw.keys():
r.drawRMDS(toDraw[dom],title="flexibility of "+str(dom)+".")
#################################################################
##### Identifications des résidus appartenant à l'interface #####
#################################################################