Skip to content

Commit 7f8e6de

Browse files
committed
update n_jobs
1 parent a456af4 commit 7f8e6de

File tree

2 files changed

+40
-98
lines changed

2 files changed

+40
-98
lines changed

applications/pentapeptide_msm/pentapeptide_msm.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@
778778
}
779779
],
780780
"source": [
781-
"its = msm.timescales_msm(dtrajs, lags=100, nits=10, errors='bayes', n_jobs=-1)"
781+
"its = msm.timescales_msm(dtrajs, lags=100, nits=10, errors='bayes', n_jobs=1)"
782782
]
783783
},
784784
{
@@ -1311,7 +1311,7 @@
13111311
"name": "python",
13121312
"nbconvert_exporter": "python",
13131313
"pygments_lexer": "ipython3",
1314-
"version": "3.6.6"
1314+
"version": "3.8.6"
13151315
}
13161316
},
13171317
"nbformat": 4,

applications/trypsin_benzamidine_hmm/trypsin_benzamidine_hmm.ipynb

Lines changed: 38 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
{
1515
"cell_type": "code",
1616
"execution_count": null,
17-
"metadata": {
18-
"collapsed": false
19-
},
17+
"metadata": {},
2018
"outputs": [
2119
{
2220
"data": {
@@ -45,9 +43,7 @@
4543
{
4644
"cell_type": "code",
4745
"execution_count": null,
48-
"metadata": {
49-
"collapsed": false
50-
},
46+
"metadata": {},
5147
"outputs": [
5248
{
5349
"name": "stdout",
@@ -119,9 +115,7 @@
119115
{
120116
"cell_type": "code",
121117
"execution_count": null,
122-
"metadata": {
123-
"collapsed": false
124-
},
118+
"metadata": {},
125119
"outputs": [],
126120
"source": [
127121
"indir = './data'\n",
@@ -134,19 +128,15 @@
134128
},
135129
{
136130
"cell_type": "markdown",
137-
"metadata": {
138-
"collapsed": false
139-
},
131+
"metadata": {},
140132
"source": [
141133
"Now we decide which coordinates to be used in the further analysis. In this example we will use nearest-neighbor heavy-atom contacts between the Benzamidine residue and each other residue. If the nearest-neighbor distance between Benzamidine and a given other residue is smaller than 0.5 nm, the contact is set 1, otherwise 0. This results in a contact vector with 233 elements, i.e. each trajectory frame is now represented by a 233-dimensional binary feature vector."
142134
]
143135
},
144136
{
145137
"cell_type": "code",
146138
"execution_count": null,
147-
"metadata": {
148-
"collapsed": false
149-
},
139+
"metadata": {},
150140
"outputs": [],
151141
"source": [
152142
"feat = coor.featurizer(topfile)\n",
@@ -169,9 +159,7 @@
169159
{
170160
"cell_type": "code",
171161
"execution_count": null,
172-
"metadata": {
173-
"collapsed": false
174-
},
162+
"metadata": {},
175163
"outputs": [
176164
{
177165
"data": {
@@ -209,9 +197,7 @@
209197
{
210198
"cell_type": "code",
211199
"execution_count": null,
212-
"metadata": {
213-
"collapsed": false
214-
},
200+
"metadata": {},
215201
"outputs": [
216202
{
217203
"name": "stdout",
@@ -251,9 +237,7 @@
251237
{
252238
"cell_type": "code",
253239
"execution_count": null,
254-
"metadata": {
255-
"collapsed": false
256-
},
240+
"metadata": {},
257241
"outputs": [],
258242
"source": [
259243
"tica_lag = 10 # tica lagtime\n",
@@ -271,9 +255,7 @@
271255
{
272256
"cell_type": "code",
273257
"execution_count": null,
274-
"metadata": {
275-
"collapsed": false
276-
},
258+
"metadata": {},
277259
"outputs": [
278260
{
279261
"name": "stdout",
@@ -321,9 +303,7 @@
321303
{
322304
"cell_type": "code",
323305
"execution_count": null,
324-
"metadata": {
325-
"collapsed": false
326-
},
306+
"metadata": {},
327307
"outputs": [
328308
{
329309
"name": "stderr",
@@ -362,9 +342,7 @@
362342
{
363343
"cell_type": "code",
364344
"execution_count": null,
365-
"metadata": {
366-
"collapsed": false
367-
},
345+
"metadata": {},
368346
"outputs": [
369347
{
370348
"name": "stdout",
@@ -390,9 +368,7 @@
390368
{
391369
"cell_type": "code",
392370
"execution_count": null,
393-
"metadata": {
394-
"collapsed": false
395-
},
371+
"metadata": {},
396372
"outputs": [],
397373
"source": [
398374
"Dall = np.concatenate(dtrajs)\n",
@@ -413,9 +389,7 @@
413389
{
414390
"cell_type": "code",
415391
"execution_count": null,
416-
"metadata": {
417-
"collapsed": false
418-
},
392+
"metadata": {},
419393
"outputs": [
420394
{
421395
"data": {
@@ -454,9 +428,7 @@
454428
{
455429
"cell_type": "code",
456430
"execution_count": null,
457-
"metadata": {
458-
"collapsed": false
459-
},
431+
"metadata": {},
460432
"outputs": [
461433
{
462434
"name": "stdout",
@@ -490,9 +462,7 @@
490462
{
491463
"cell_type": "code",
492464
"execution_count": null,
493-
"metadata": {
494-
"collapsed": false
495-
},
465+
"metadata": {},
496466
"outputs": [
497467
{
498468
"name": "stderr",
@@ -522,15 +492,13 @@
522492
"source": [
523493
"nstates = 5\n",
524494
"lags=[1,2,3,4,5,7,10]\n",
525-
"its = msm.timescales_hmsm(dtrajs, nstates, lags=lags, errors='bayes', nsamples=250, n_jobs=-1)"
495+
"its = msm.timescales_hmsm(dtrajs, nstates, lags=lags, errors='bayes', nsamples=250, n_jobs=1)"
526496
]
527497
},
528498
{
529499
"cell_type": "code",
530500
"execution_count": null,
531-
"metadata": {
532-
"collapsed": false
533-
},
501+
"metadata": {},
534502
"outputs": [
535503
{
536504
"data": {
@@ -644,9 +612,7 @@
644612
},
645613
{
646614
"cell_type": "markdown",
647-
"metadata": {
648-
"collapsed": false
649-
},
615+
"metadata": {},
650616
"source": [
651617
"dG_stats = np.array([binding_free_energy(M) for M in its.models])\n",
652618
"kon_stats = np.array([binding_rate(M) for M in its.models])\n",
@@ -746,9 +712,7 @@
746712
{
747713
"cell_type": "code",
748714
"execution_count": null,
749-
"metadata": {
750-
"collapsed": false
751-
},
715+
"metadata": {},
752716
"outputs": [
753717
{
754718
"name": "stdout",
@@ -777,9 +741,7 @@
777741
{
778742
"cell_type": "code",
779743
"execution_count": null,
780-
"metadata": {
781-
"collapsed": false
782-
},
744+
"metadata": {},
783745
"outputs": [
784746
{
785747
"name": "stderr",
@@ -814,9 +776,7 @@
814776
{
815777
"cell_type": "code",
816778
"execution_count": null,
817-
"metadata": {
818-
"collapsed": false
819-
},
779+
"metadata": {},
820780
"outputs": [
821781
{
822782
"data": {
@@ -849,9 +809,7 @@
849809
{
850810
"cell_type": "code",
851811
"execution_count": null,
852-
"metadata": {
853-
"collapsed": false
854-
},
812+
"metadata": {},
855813
"outputs": [
856814
{
857815
"name": "stdout",
@@ -881,9 +839,7 @@
881839
{
882840
"cell_type": "code",
883841
"execution_count": null,
884-
"metadata": {
885-
"collapsed": false
886-
},
842+
"metadata": {},
887843
"outputs": [
888844
{
889845
"name": "stdout",
@@ -905,9 +861,7 @@
905861
{
906862
"cell_type": "code",
907863
"execution_count": null,
908-
"metadata": {
909-
"collapsed": false
910-
},
864+
"metadata": {},
911865
"outputs": [
912866
{
913867
"name": "stderr",
@@ -943,13 +897,12 @@
943897
{
944898
"cell_type": "code",
945899
"execution_count": null,
946-
"metadata": {
947-
"collapsed": false
948-
},
900+
"metadata": {},
949901
"outputs": [
950902
{
951903
"ename": "ValueError",
952904
"evalue": "Sets A and B have to be disjoint",
905+
"output_type": "error",
953906
"traceback": [
954907
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
955908
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
@@ -959,8 +912,7 @@
959912
"\u001b[1;32m/home/marscher/workspace/msmtools/msmtools/analysis/api.pyc\u001b[0m in \u001b[0;36mcommittor\u001b[1;34m(T, A, B, forward, mu)\u001b[0m\n\u001b[0;32m 877\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 878\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mforward\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 879\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mdense\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcommittor\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mforward_committor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mT\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mA\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mB\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 880\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 881\u001b[0m \u001b[1;34m\"\"\" if P is time reversible backward commitor is equal 1 - q+\"\"\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
960913
"\u001b[1;32m/home/marscher/workspace/msmtools/msmtools/analysis/dense/committor.pyc\u001b[0m in \u001b[0;36mforward_committor\u001b[1;34m(T, A, B)\u001b[0m\n\u001b[0;32m 72\u001b[0m \u001b[0mnotAB\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mX\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdifference\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mA\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdifference\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mB\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 73\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mAB\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m>\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 74\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Sets A and B have to be disjoint\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 75\u001b[0m \u001b[0mL\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mT\u001b[0m \u001b[1;33m-\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0meye\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mT\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# Generator matrix\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 76\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
961914
"\u001b[1;31mValueError\u001b[0m: Sets A and B have to be disjoint"
962-
],
963-
"output_type": "error"
915+
]
964916
}
965917
],
966918
"source": [
@@ -977,9 +929,7 @@
977929
{
978930
"cell_type": "code",
979931
"execution_count": null,
980-
"metadata": {
981-
"collapsed": false
982-
},
932+
"metadata": {},
983933
"outputs": [],
984934
"source": [
985935
"mplt.plot_flux(tpt, pos=pos, state_sizes=state_sizes, state_colors=state_colors, show_committor=False)\n",
@@ -996,9 +946,7 @@
996946
{
997947
"cell_type": "code",
998948
"execution_count": null,
999-
"metadata": {
1000-
"collapsed": false
1001-
},
949+
"metadata": {},
1002950
"outputs": [],
1003951
"source": [
1004952
"meta_samples = bhmm.sample_by_observation_probabilities(100)"
@@ -1007,9 +955,7 @@
1007955
{
1008956
"cell_type": "code",
1009957
"execution_count": null,
1010-
"metadata": {
1011-
"collapsed": false
1012-
},
958+
"metadata": {},
1013959
"outputs": [],
1014960
"source": [
1015961
"outfiles = ['./figs/hmm1_100samples.xtc', \n",
@@ -1022,9 +968,7 @@
1022968
{
1023969
"cell_type": "code",
1024970
"execution_count": null,
1025-
"metadata": {
1026-
"collapsed": false
1027-
},
971+
"metadata": {},
1028972
"outputs": [],
1029973
"source": [
1030974
"coor.save_trajs(inp, meta_samples, outfiles=outfiles)"
@@ -1044,9 +988,7 @@
1044988
{
1045989
"cell_type": "code",
1046990
"execution_count": null,
1047-
"metadata": {
1048-
"collapsed": false
1049-
},
991+
"metadata": {},
1050992
"outputs": [],
1051993
"source": [
1052994
"from IPython.display import Image\n",
@@ -1077,23 +1019,23 @@
10771019
],
10781020
"metadata": {
10791021
"kernelspec": {
1080-
"display_name": "Python 2",
1022+
"display_name": "Python 3",
10811023
"language": "python",
1082-
"name": "python2"
1024+
"name": "python3"
10831025
},
10841026
"language_info": {
10851027
"codemirror_mode": {
10861028
"name": "ipython",
1087-
"version": 2
1029+
"version": 3
10881030
},
10891031
"file_extension": ".py",
10901032
"mimetype": "text/x-python",
10911033
"name": "python",
10921034
"nbconvert_exporter": "python",
1093-
"pygments_lexer": "ipython2",
1094-
"version": "2.7.11"
1035+
"pygments_lexer": "ipython3",
1036+
"version": "3.8.6"
10951037
}
10961038
},
10971039
"nbformat": 4,
1098-
"nbformat_minor": 0
1040+
"nbformat_minor": 1
10991041
}

0 commit comments

Comments
 (0)