小编awa*_*nit的帖子

蒙特卡罗模拟蛋白质结构和网格

我正在研究蛋白质结构的蒙特卡罗模拟脚本.我从来没有在蒙特卡洛脚本之前做过.我将大规模扩展这个计划.根据蛋白质xyz坐标我必须定义盒子大小.此框将被划分为大小为0.5 A的网格.根据距离和角度标准,我必须根据Boltzmann概率分布指定点.

3-D盒中的蛋白质结构,显示网格

我的程序应该通过取0.5 A的网格在每个方向上移动并生成随机点并检查距离和角度的条件.如果满足条件,则根据玻尔兹曼概率分布丢弃该点.

这是我生成随机点的代码

from __future__ import division    
import math as mean    
from numpy import *   
import numpy as np   
from string import *    
from random import *    

def euDist(cd1, cd2):# calculate distance
    d2 = ((cd1[0]-cd2[0])**2 + (cd1[1]-cd2[1])**2 + (cd1[2]-cd2[2])**2)
    d1 = d2 ** 0.5
    return round(d1, 2)

def euvector(c2,c1):# generate vector
    x_vec = (c2[0] - c1[0])
    y_vec = (c2[1] - c1[1])
    z_vec = (c2[2] - c1[2])
    return (x_vec, y_vec, z_vec)


 for arang in range(1000):  # generate random point …
Run Code Online (Sandbox Code Playgroud)

python simulation numpy montecarlo chemistry

12
推荐指数
1
解决办法
1563
查看次数

如何计算python中的质心

我是python编码的初学者.我正在研究结构坐标.我有pdb结构,它有xyz坐标信息(最后三个col)

ATOM      1  N   SER A   1      27.130   7.770  34.390    
ATOM      2  1H  SER A   1      27.990   7.760  34.930     
ATOM      3  2H  SER A   1      27.160   6.960  33.790    
ATOM      4  3H  SER A   1      27.170   8.580  33.790    
ATOM      5  CA  SER A   1      25.940   7.780  35.250    
ATOM      6  CB  SER A   1      25.980   9.090  36.020    
ATOM      7  OG  SER A   1      26.740  10.100  35.320    
ATOM      8  HG  SER A   1      26.750  10.940  35.860    
ATOM      9  C   SER A   1      24.640 …
Run Code Online (Sandbox Code Playgroud)

python math numpy shape

6
推荐指数
2
解决办法
2万
查看次数

标签 统计

numpy ×2

python ×2

chemistry ×1

math ×1

montecarlo ×1

shape ×1

simulation ×1