Partial Force Render


In [1]:
%qtconsole

In [1]:
#Initialize
import os
import pandas as pd
%pylab inline


Populating the interactive namespace from numpy and matplotlib
/usr/lib/python2.7/site-packages/pytz/__init__.py:35: UserWarning: Module argparse was already imported from /usr/lib64/python2.7/argparse.pyc, but /usr/lib/python2.7/site-packages is being added to sys.path
  from pkg_resources import resource_stream

In [4]:
#change to working dir
work_dir = "/var/run/media/chen/Simulation/Simulation/Nucleosome/relex_trr_pre"
os.chdir(work_dir)

Render trajectory by different colors according to force value loaded on residue.

Section 0: Basic uses:

  • After done the partial force calculation, there are three output file.

    • force_bonded.csv Vector, Residue bonded force
    • force_external.csv Abs scaler, Residue force loaded from external molecules
    • force_internal.csv Abs scaler, Residue force loaded from same molecules

</font>

  • Recommand use force_external.csv to render.

0.1: Steps:

0. vmd                                                 #start vmd
1. mol load gro *.gro xtc *.xtc                        #loaded *.gro and correspond *.xtc into vmd
2.1. package require partial_force_render
2.2. partial_force_render "*.csv"                      #use .csv file to render the whole structure

* for modified version:
2.1.1 package require partial_force_render_threshold
2.1.2 partial_force_render_threshold "*.csv" threshold #only load value > threshold

0.2: Display:

Color map correspond force value, together with a scale bar.

0.3: Note:

*.csv:

* File is the output from partial_force calculatiion program.

* The first line is the head (time, residues)

* Start from the second line, is the force value use to render trajcetories.

* Notice the script only checks the number of residue corrspond to main molecule.

* User should take the responsibility to load the right file from certain calculation.

0.4: Major Patamers:

* color scale method "RGB"
* set color_max 1000
* set color_min 0.0

In [0]:


In [0]:


In [0]:

  • Todo:
  • Map Residue number to protein/DNA (H2A, H2B, H3, H4, DNA) X 2 Color

Section 1: General discription of nucleisome structure


In [6]:
#residue range:
H3_1 = arange(1,136)
H3_2 = arange(488, 623)
H4_1 = arange(136,238)
H4_2 = arange(623,725)
H2A_1 = arange(238,366)
H2A_2 = arange(725,853)
H2B_1 = arange(366,488)
H2B_2 = arange(853,975)
DNA = arange(975,1307)
DNA_1 = arange(975,1141)
DNA_2 = arange(1141,1307)
#print DNA_2

Section N: view raw Data


In [7]:
#
fm = pd.read_csv('force_external_md1000_pbc_mol_skip_10.csv')
cl=fm.columns

In [48]:
print cl[63], cl[83], cl[0], cl[1]
print cl[488 : 623]
print cl[DNA]


63-ARG 83-ARG Time(ps) 1-NALA
Index([u'488-NALA', u'489-ARG', u'490-THR', u'491-LYS', u'492-GLN', u'493-THR', u'494-ALA', u'495-ARG', u'496-LYS', u'497-SER', u'498-THR', u'499-GLY', u'500-GLY', u'501-LYS', u'502-ALA', u'503-PRO', u'504-ARG', u'505-LYS', u'506-GLN', u'507-LEU', u'508-ALA', u'509-THR', u'510-LYS', u'511-ALA', u'512-ALA', u'513-ARG', u'514-LYS', u'515-SER', u'516-ALA', u'517-PRO', u'518-ALA', u'519-THR', u'520-GLY', u'521-GLY', u'522-VAL', u'523-LYS', u'524-LYS', u'525-PRO', u'526-HIP', u'527-ARG', u'528-TYR', u'529-ARG', u'530-PRO', u'531-GLY', u'532-THR', u'533-VAL', u'534-ALA', u'535-LEU', u'536-ARG', u'537-GLU', u'538-ILE', u'539-ARG', u'540-ARG', u'541-TYR', u'542-GLN', u'543-LYS', u'544-SER', u'545-THR', u'546-GLU', u'547-LEU', u'548-LEU', u'549-ILE', u'550-ARG', u'551-LYS', u'552-LEU', u'553-PRO', u'554-PHE', u'555-GLN', u'556-ARG', u'557-LEU', u'558-VAL', u'559-ARG', u'560-GLU', u'561-ILE', u'562-ALA', u'563-GLN', u'564-ASP', u'565-PHE', u'566-LYS', u'567-THR', u'568-ASP', u'569-LEU', u'570-ARG', u'571-PHE', u'572-GLN', u'573-SER', u'574-SER', u'575-ALA', u'576-VAL', u'577-MET', u'578-ALA', u'579-LEU', u'580-GLN', u'581-GLU', u'582-ALA', u'583-SER', u'584-GLU', u'585-ALA', u'586-TYR', u'587-LEU', u'588-VAL', u'589-ALA', u'590-LEU', u'591-PHE', u'592-GLU', u'593-ASP', u'594-THR', u'595-ASN', u'596-LEU', u'597-CYS', u'598-ALA', u'599-ILE', u'600-HIP', u'601-ALA', u'602-LYS', u'603-ARG', u'604-VAL', u'605-THR', u'606-ILE', u'607-MET', u'608-PRO', u'609-LYS', u'610-ASP', u'611-ILE', u'612-GLN', u'613-LEU', u'614-ALA', u'615-ARG', u'616-ARG', u'617-ILE', u'618-ARG', u'619-GLY', u'620-GLU', u'621-ARG', u'622-CALA'], dtype=object)
Index([u'975-DC5', u'976-DT', u'977-DT', u'978-DA', u'979-DC', u'980-DA', u'981-DT', u'982-DG', u'983-DC', u'984-DA', u'985-DC', u'986-DA', u'987-DG', u'988-DG', u'989-DA', u'990-DT', u'991-DG', u'992-DT', u'993-DA', u'994-DA', u'995-DC', u'996-DC', u'997-DT', u'998-DG', u'999-DC', u'1000-DA', u'1001-DG', u'1002-DA', u'1003-DT', u'1004-DA', u'1005-DC', u'1006-DT', u'1007-DA', u'1008-DC', u'1009-DC', u'1010-DA', u'1011-DA', u'1012-DA', u'1013-DA', u'1014-DG', u'1015-DT', u'1016-DG', u'1017-DT', u'1018-DA', u'1019-DT', u'1020-DT', u'1021-DT', u'1022-DG', u'1023-DG', u'1024-DA', u'1025-DA', u'1026-DA', u'1027-DC', u'1028-DT', u'1029-DG', u'1030-DC', u'1031-DT', u'1032-DC', u'1033-DC', u'1034-DA', u'1035-DT', u'1036-DC', u'1037-DA', u'1038-DA', u'1039-DA', u'1040-DA', u'1041-DG', u'1042-DG', u'1043-DC', u'1044-DA', u'1045-DT', u'1046-DG', u'1047-DT', u'1048-DT', u'1049-DC', u'1050-DA', u'1051-DG', u'1052-DC', u'1053-DT', u'1054-DG', u'1055-DG', u'1056-DA', u'1057-DT', u'1058-DT', u'1059-DC', u'1060-DC', u'1061-DA', u'1062-DG', u'1063-DC', u'1064-DT', u'1065-DG', u'1066-DA', u'1067-DA', u'1068-DC', u'1069-DA', u'1070-DT', u'1071-DG', u'1072-DC', u'1073-DC', u'1074-DT', u'1075-DT', u'1076-DT', u'1077-DT', u'1078-DG', u'1079-DA', u'1080-DT', u'1081-DG', u'1082-DG', u'1083-DA', u'1084-DG', u'1085-DC', u'1086-DA', u'1087-DG', u'1088-DT', u'1089-DT', u'1090-DT', u'1091-DC', u'1092-DC', u'1093-DA', u'1094-DA', u'1095-DA', u'1096-DT', u'1097-DA', u'1098-DC', u'1099-DA', u'1100-DC', u'1101-DT', u'1102-DT', u'1103-DT', u'1104-DT', u'1105-DG', u'1106-DG', u'1107-DT', u'1108-DA', u'1109-DG', u'1110-DT', u'1111-DA', u'1112-DT', u'1113-DC', u'1114-DT', u'1115-DG', u'1116-DC', u'1117-DA', u'1118-DG', u'1119-DG', u'1120-DT', u'1121-DG', u'1122-DA', u'1123-DT', u'1124-DT', u'1125-DC', u'1126-DT', u'1127-DC', u'1128-DC', u'1129-DA', u'1130-DG', u'1131-DG', u'1132-DG', u'1133-DC', u'1134-DG', u'1135-DG', u'1136-DC', u'1137-DC', u'1138-DA', u'1139-DG', u'1140-DT3', u'1141-DA5', u'1142-DC', u'1143-DT', u'1144-DG', u'1145-DG', u'1146-DC', u'1147-DC', u'1148-DG', u'1149-DC', u'1150-DC', u'1151-DC', u'1152-DT', u'1153-DG', u'1154-DG', u'1155-DA', u'1156-DG', u'1157-DA', u'1158-DA', u'1159-DT', u'1160-DC', u'1161-DA', u'1162-DC', u'1163-DC', u'1164-DT', u'1165-DG', u'1166-DC', u'1167-DA', u'1168-DG', u'1169-DA', u'1170-DT', u'1171-DA', u'1172-DC', u'1173-DT', u'1174-DA', u'1175-DC', u'1176-DC', u'1177-DA', u'1178-DA', u'1179-DA', u'1180-DA', u'1181-DG', u'1182-DT', u'1183-DG', u'1184-DT', u'1185-DA', u'1186-DT', u'1187-DT', u'1188-DT', u'1189-DG', u'1190-DG', u'1191-DA', u'1192-DA', u'1193-DA', u'1194-DC', u'1195-DT', u'1196-DG', u'1197-DC', u'1198-DT', u'1199-DC', u'1200-DC', u'1201-DA', u'1202-DT', u'1203-DC', u'1204-DA', u'1205-DA', u'1206-DA', u'1207-DA', u'1208-DG', u'1209-DG', u'1210-DC', u'1211-DA', u'1212-DT', u'1213-DG', u'1214-DT', u'1215-DT', u'1216-DC', u'1217-DA', u'1218-DG', u'1219-DC', u'1220-DT', u'1221-DG', u'1222-DG', u'1223-DA', u'1224-DA', u'1225-DT', u'1226-DC', u'1227-DC', u'1228-DA', u'1229-DG', u'1230-DC', u'1231-DT', u'1232-DG', u'1233-DA', u'1234-DA', u'1235-DC', u'1236-DA', u'1237-DT', u'1238-DG', u'1239-DC', u'1240-DC', u'1241-DT', u'1242-DT', u'1243-DT', u'1244-DT', u'1245-DG', u'1246-DA', u'1247-DT', u'1248-DG', u'1249-DG', u'1250-DA', u'1251-DG', u'1252-DC', u'1253-DA', u'1254-DG', u'1255-DT', u'1256-DT', u'1257-DT', u'1258-DC', u'1259-DC', u'1260-DA', u'1261-DA', u'1262-DA', u'1263-DT', u'1264-DA', u'1265-DC', u'1266-DA', u'1267-DC', u'1268-DT', u'1269-DT', u'1270-DT', u'1271-DT', u'1272-DG', u'1273-DG', u'1274-DT', u'1275-DA', u'1276-DG', u'1277-DT', u'1278-DA', u'1279-DT', u'1280-DC', u'1281-DT', u'1282-DG', u'1283-DC', u'1284-DA', u'1285-DG', u'1286-DG', u'1287-DT', u'1288-DT', u'1289-DA', u'1290-DC', u'1291-DA', u'1292-DT', u'1293-DC', u'1294-DC', u'1295-DT', u'1296-DG', u'1297-DT', u'1298-DG', u'1299-DC', u'1300-DA', u'1301-DT', u'1302-DG', u'1303-DT', u'1304-DA', u'1305-DA', u'1306-DG3'], dtype=object)

In [14]:
dt_63 = fm[cl[63]]
dt_83 = fm[cl[83]]

In [17]:
plot(dt_63)
plot(dt_83)
legend([cl[63],cl[83]])


Out[17]:
<matplotlib.legend.Legend at 0x2e21390>

In [24]:
dt_570 = fm[cl[570]]
dt_550 = fm[cl[550]]

In [25]:
plot(dt_550)
plot(dt_570)
legend([cl[550],cl[570]])


Out[25]:
<matplotlib.legend.Legend at 0x44a5e10>

In [19]:
time_label = cl[0]
target = cl[1293]
plot(fm[time_label], fm[target]*1.66/1000)
legend(["force loaded on residue :" + target])
xlabel("time[ps]")
ylabel("force[nN]")


Out[19]:
<matplotlib.text.Text at 0x42f9290>

In [18]:
time_label = cl[0]
target = cl[1292]
plot(fm[time_label], fm[target]*1.66/1000)
legend([target])
xlabel("time[ps]")
ylabel("force[nN]")


Out[18]:
<matplotlib.text.Text at 0x3f2d950>

In [ ]: