%load_ext autoreload
%autoreload 2
import molsysmt as msm
import numpy as np

Translate#

molecular_system = msm.systems['Met-enkephalin']['met_enkephalin.h5msm']
molecular_system = msm.convert(molecular_system)
msm.info(molecular_system)
form n_atoms n_groups n_components n_chains n_molecules n_entities n_peptides n_structures
molsysmt.MolSys 72 5 1 1 1 1 1 1
msm.get(molecular_system, coordinates=True)
Magnitude
[[[0.3325769901275635 0.15479089319705963 -1.5999999902760464e-07]  [0.39094069600105286 0.07236109673976898 -2.699999868127634e-07]  [0.3970048129558563 0.28457948565483093 -9.99999993922529e-09]  [0.36716631054878235 0.34001290798187256 -0.0889820009469986]  [0.3576965034008026 0.3653838038444519 0.12321429699659348]  [0.24969950318336487 0.38010749220848083 0.12413790076971054]  [0.3877483904361725 0.31157949566841125 0.21311970055103302]  [0.4267328083515167 0.49962669610977173 0.11949460208415985]  [0.40599268674850464 0.5918911099433899 0.22272799909114838]  [0.34001079201698303 0.566821813583374 0.30578771233558655]  [0.4699997901916504 0.7163547277450562 0.21927909553050995]  [0.45385220646858215 0.7881891131401062 0.2996537983417511]  [0.5547471046447754 0.7485542297363281 0.11259700357913971]  [0.6169254779815674 0.869461715221405 0.10924679785966873]  [0.5956326723098755 0.9246984124183655 0.18482139706611633]  [0.575487494468689 0.6562899947166443 0.009363500401377678]  [0.641469419002533 0.6813595294952393 -0.07369620352983475]  [0.5114806294441223 0.5318263173103333 0.012811900116503239]  [0.5276286005973816 0.459991991519928 -0.06756269931793213]  [0.5485541224479675 0.2705206871032715 -4.400000079840538e-07]  [0.6008824110031128 0.1593174934387207 -8.399999842367833e-07]  [0.6191006898880005 0.3838583528995514 -5.100000066704524e-07]  [0.5715286731719971 0.4729532301425934 -2.7999999474559445e-07]  [0.7640007734298706 0.3838583827018738 -7.400000185953104e-07]  [0.8003858327865601 0.3324839174747467 0.08898118138313293]  [0.800385594367981 0.33248472213745117 -0.08898322284221649]  [0.817053496837616 0.526512622833252 -2.0000000233721948e-07]  [0.739543616771698 0.6218888759613037 3.400000139208714e-07]  [0.9497726559638977 0.5409305691719055 -1.8000000068241206e-07]  [1.009423851966858 0.45942768454551697 -5.200000146032835e-07]  [1.0126099586486816 0.6714966297149658 1.3999999737279722e-07]  [0.9820963144302368 0.7265615463256836 -0.08898171037435532]  [0.9820970296859741 0.7265607714653015 0.08898268640041351]  [1.1641591787338257 0.6574378609657288 -4.899999908047903e-07]  [1.2164876461029053 0.546234667301178 -1.160000010713702e-06]  [1.2347058057785034 0.7707754969596863 -4.3000000005122274e-07]  [1.1871337890625 0.8598703742027283 1.999999987845058e-08]  [1.3796058893203735 0.7707754969596863 -8.299999763039523e-07]  [1.4159910678863525 0.7194008827209473 0.08898095041513443]  [1.4345051050186157 0.6996384859085083 -0.1232154369354248]  [1.3996739387512207 0.5963576436042786 -0.12413927167654037]  [1.3996739387512207 0.7504798769950867 -0.21312062442302704]  [1.5851554870605469 0.694503128528595 -0.1321101039648056]  [1.6467466354370117 0.6316419243812561 -0.24099069833755493]  [1.5859524011611938 0.5864068865776062 -0.3193415105342865]  [1.7864224910736084 0.6268805861473083 -0.24923734366893768]  [1.8343757390975952 0.5779387950897217 -0.3340087831020355]  [1.8645071983337402 0.6849804520606995 -0.14860351383686066]  [1.9732547998428345 0.6812735199928284 -0.15502412617206573]  [1.8029162883758545 0.7478417754173279 -0.03972272947430611]  [1.8637107610702515 0.793076753616333 0.03862788900732994]  [1.6632404327392578 0.7526033520698547 -0.03147577866911888]  [1.6152875423431396 0.8015453815460205 0.05329563841223717]  [1.434397578239441 0.9127709865570068 -9.000000034120603e-08]  [1.3580585718154907 1.0090869665145874 7.200000027296483e-07]  [1.5672829151153564 0.9255663752555847 -2.0999999605919584e-07]  [1.6259340047836304 0.8433407545089722 -7.699999855503847e-07]  [1.6317107677459717 1.0553549528121948 2.699999868127634e-07]  [1.6018720865249634 1.1107887029647827 -0.08898142725229263]  [1.592402696609497 1.13615882396698 0.12321498245000839]  [1.484405755996704 1.1508824825286865 0.12413889169692993]  [1.6224548816680908 1.082354187965393 0.21312010288238525]  [1.6621248722076416 1.2717351913452148 0.11945872753858566]  [1.7701332569122314 1.257092833518982 0.11857952177524567]  [1.6320841312408447 1.3256213665008545 0.029598509892821312]  [1.6164374351501465 1.368901014328003 0.2651723027229309]  [1.7100276947021484 1.5170873403549194 0.23409675061702728]  [1.6780644655227661 1.5611793994903564 0.13967618346214294]  [1.6932973861694336 1.5883041620254517 0.314900666475296]  [1.816113829612732 1.4926508665084839 0.22865690290927887]  [1.7832599878311157 1.041296124458313 -5.599999894911889e-07]  [1.8355883359909058 0.930092990398407 -1.5099999473022763e-06]]]
Unitsnanometer
n_atoms = msm.get(molecular_system, n_atoms=True)
shifts = np.ones([n_atoms,3], dtype=float)*msm.pyunitwizard.unit('nm')
molecular_system = msm.structure.translate(molecular_system, translation=shifts)
coordinates = msm.get(molecular_system, coordinates=True)
coordinates
Magnitude
[[[1.3325769901275635 1.1547908931970596 0.999999840000001]  [1.3909406960010529 1.072361096739769 0.9999997300000132]  [1.3970048129558563 1.284579485654831 0.9999999900000001]  [1.3671663105487823 1.3400129079818726 0.9110179990530014]  [1.3576965034008026 1.365383803844452 1.1232142969965935]  [1.2496995031833649 1.3801074922084808 1.1241379007697105]  [1.3877483904361725 1.3115794956684113 1.213119700551033]  [1.4267328083515167 1.4996266961097717 1.1194946020841599]  [1.4059926867485046 1.59189110994339 1.2227279990911484]  [1.340010792016983 1.566821813583374 1.3057877123355865]  [1.4699997901916504 1.7163547277450562 1.21927909553051]  [1.4538522064685822 1.7881891131401062 1.299653798341751]  [1.5547471046447754 1.7485542297363281 1.1125970035791397]  [1.6169254779815674 1.869461715221405 1.1092467978596687]  [1.5956326723098755 1.9246984124183655 1.1848213970661163]  [1.575487494468689 1.6562899947166443 1.0093635004013777]  [1.641469419002533 1.6813595294952393 0.9263037964701653]  [1.5114806294441223 1.5318263173103333 1.0128119001165032]  [1.5276286005973816 1.459991991519928 0.9324373006820679]  [1.5485541224479675 1.2705206871032715 0.999999559999992]  [1.6008824110031128 1.1593174934387207 0.9999991600000158]  [1.6191006898880005 1.3838583528995514 0.9999994899999933]  [1.571528673171997 1.4729532301425934 0.9999997200000053]  [1.7640007734298706 1.3838583827018738 0.9999992599999814]  [1.80038583278656 1.3324839174747467 1.088981181383133]  [1.800385594367981 1.3324847221374512 0.9110167771577835]  [1.817053496837616 1.526512622833252 0.9999997999999977]  [1.739543616771698 1.6218888759613037 1.000000340000014]  [1.9497726559638977 1.5409305691719055 0.9999998199999993]  [2.009423851966858 1.459427684545517 0.9999994799999854]  [2.0126099586486816 1.6714966297149658 1.0000001399999974]  [1.9820963144302368 1.7265615463256836 0.9110182896256447]  [1.9820970296859741 1.7265607714653015 1.0889826864004135]  [2.1641591787338257 1.6574378609657288 0.9999995100000092]  [2.2164876461029053 1.546234667301178 0.9999988399999893]  [2.2347058057785034 1.7707754969596863 0.99999957]  [2.1871337890625 1.8598703742027283 1.0000000199999999]  [2.3796058893203735 1.7707754969596863 0.9999991700000237]  [2.4159910678863525 1.7194008827209473 1.0889809504151344]  [2.4345051050186157 1.6996384859085083 0.8767845630645752]  [2.3996739387512207 1.5963576436042786 0.8758607283234596]  [2.3996739387512207 1.7504798769950867 0.786879375576973]  [2.585155487060547 1.694503128528595 0.8678898960351944]  [2.6467466354370117 1.631641924381256 0.7590093016624451]  [2.585952401161194 1.5864068865776062 0.6806584894657135]  [2.7864224910736084 1.6268805861473083 0.7507626563310623]  [2.834375739097595 1.5779387950897217 0.6659912168979645]  [2.8645071983337402 1.6849804520606995 0.8513964861631393]  [2.9732547998428345 1.6812735199928284 0.8449758738279343]  [2.8029162883758545 1.7478417754173279 0.9602772705256939]  [2.8637107610702515 1.793076753616333 1.03862788900733]  [2.663240432739258 1.7526033520698547 0.9685242213308811]  [2.6152875423431396 1.8015453815460205 1.0532956384122372]  [2.434397578239441 1.9127709865570068 0.9999999099999997]  [2.3580585718154907 2.0090869665145874 1.0000007200000027]  [2.5672829151153564 1.9255663752555847 0.9999997900000039]  [2.6259340047836304 1.8433407545089722 0.9999992300000144]  [2.6317107677459717 2.055354952812195 1.0000002699999868]  [2.6018720865249634 2.1107887029647827 0.9110185727477074]  [2.592402696609497 2.13615882396698 1.1232149824500084]  [2.484405755996704 2.1508824825286865 1.12413889169693]  [2.622454881668091 2.082354187965393 1.2131201028823853]  [2.6621248722076416 2.271735191345215 1.1194587275385857]  [2.7701332569122314 2.257092833518982 1.1185795217752457]  [2.6320841312408447 2.3256213665008545 1.0295985098928213]  [2.6164374351501465 2.368901014328003 1.265172302722931]  [2.7100276947021484 2.5170873403549194 1.2340967506170273]  [2.678064465522766 2.5611793994903564 1.139676183462143]  [2.6932973861694336 2.5883041620254517 1.314900666475296]  [2.816113829612732 2.492650866508484 1.2286569029092789]  [2.7832599878311157 2.041296124458313 0.9999994400000105]  [2.8355883359909058 1.930092990398407 0.9999984900000527]]]
Unitsnanometer
shifts = np.array([-1.0, -1.0, -1.0], dtype=float)*msm.pyunitwizard.unit('nm')
molecular_system = msm.structure.translate(molecular_system, translation=shifts,
                                           selection=[0,1,2], in_place=False)
msm.get(molecular_system, coordinates=True)
Magnitude
[[[0.3325769901275635 0.15479089319705963 -1.5999999902760464e-07]  [0.39094069600105286 0.07236109673976898 -2.699999868127634e-07]  [0.3970048129558563 0.28457948565483093 -9.99999993922529e-09]  [1.3671663105487823 1.3400129079818726 0.9110179990530014]  [1.3576965034008026 1.365383803844452 1.1232142969965935]  [1.2496995031833649 1.3801074922084808 1.1241379007697105]  [1.3877483904361725 1.3115794956684113 1.213119700551033]  [1.4267328083515167 1.4996266961097717 1.1194946020841599]  [1.4059926867485046 1.59189110994339 1.2227279990911484]  [1.340010792016983 1.566821813583374 1.3057877123355865]  [1.4699997901916504 1.7163547277450562 1.21927909553051]  [1.4538522064685822 1.7881891131401062 1.299653798341751]  [1.5547471046447754 1.7485542297363281 1.1125970035791397]  [1.6169254779815674 1.869461715221405 1.1092467978596687]  [1.5956326723098755 1.9246984124183655 1.1848213970661163]  [1.575487494468689 1.6562899947166443 1.0093635004013777]  [1.641469419002533 1.6813595294952393 0.9263037964701653]  [1.5114806294441223 1.5318263173103333 1.0128119001165032]  [1.5276286005973816 1.459991991519928 0.9324373006820679]  [1.5485541224479675 1.2705206871032715 0.999999559999992]  [1.6008824110031128 1.1593174934387207 0.9999991600000158]  [1.6191006898880005 1.3838583528995514 0.9999994899999933]  [1.571528673171997 1.4729532301425934 0.9999997200000053]  [1.7640007734298706 1.3838583827018738 0.9999992599999814]  [1.80038583278656 1.3324839174747467 1.088981181383133]  [1.800385594367981 1.3324847221374512 0.9110167771577835]  [1.817053496837616 1.526512622833252 0.9999997999999977]  [1.739543616771698 1.6218888759613037 1.000000340000014]  [1.9497726559638977 1.5409305691719055 0.9999998199999993]  [2.009423851966858 1.459427684545517 0.9999994799999854]  [2.0126099586486816 1.6714966297149658 1.0000001399999974]  [1.9820963144302368 1.7265615463256836 0.9110182896256447]  [1.9820970296859741 1.7265607714653015 1.0889826864004135]  [2.1641591787338257 1.6574378609657288 0.9999995100000092]  [2.2164876461029053 1.546234667301178 0.9999988399999893]  [2.2347058057785034 1.7707754969596863 0.99999957]  [2.1871337890625 1.8598703742027283 1.0000000199999999]  [2.3796058893203735 1.7707754969596863 0.9999991700000237]  [2.4159910678863525 1.7194008827209473 1.0889809504151344]  [2.4345051050186157 1.6996384859085083 0.8767845630645752]  [2.3996739387512207 1.5963576436042786 0.8758607283234596]  [2.3996739387512207 1.7504798769950867 0.786879375576973]  [2.585155487060547 1.694503128528595 0.8678898960351944]  [2.6467466354370117 1.631641924381256 0.7590093016624451]  [2.585952401161194 1.5864068865776062 0.6806584894657135]  [2.7864224910736084 1.6268805861473083 0.7507626563310623]  [2.834375739097595 1.5779387950897217 0.6659912168979645]  [2.8645071983337402 1.6849804520606995 0.8513964861631393]  [2.9732547998428345 1.6812735199928284 0.8449758738279343]  [2.8029162883758545 1.7478417754173279 0.9602772705256939]  [2.8637107610702515 1.793076753616333 1.03862788900733]  [2.663240432739258 1.7526033520698547 0.9685242213308811]  [2.6152875423431396 1.8015453815460205 1.0532956384122372]  [2.434397578239441 1.9127709865570068 0.9999999099999997]  [2.3580585718154907 2.0090869665145874 1.0000007200000027]  [2.5672829151153564 1.9255663752555847 0.9999997900000039]  [2.6259340047836304 1.8433407545089722 0.9999992300000144]  [2.6317107677459717 2.055354952812195 1.0000002699999868]  [2.6018720865249634 2.1107887029647827 0.9110185727477074]  [2.592402696609497 2.13615882396698 1.1232149824500084]  [2.484405755996704 2.1508824825286865 1.12413889169693]  [2.622454881668091 2.082354187965393 1.2131201028823853]  [2.6621248722076416 2.271735191345215 1.1194587275385857]  [2.7701332569122314 2.257092833518982 1.1185795217752457]  [2.6320841312408447 2.3256213665008545 1.0295985098928213]  [2.6164374351501465 2.368901014328003 1.265172302722931]  [2.7100276947021484 2.5170873403549194 1.2340967506170273]  [2.678064465522766 2.5611793994903564 1.139676183462143]  [2.6932973861694336 2.5883041620254517 1.314900666475296]  [2.816113829612732 2.492650866508484 1.2286569029092789]  [2.7832599878311157 2.041296124458313 0.9999994400000105]  [2.8355883359909058 1.930092990398407 0.9999984900000527]]]
Unitsnanometer