我对蛋白质进行了三维creo-EM扫描,这样它就包含了一条围绕自身弯曲和扭曲的链,并且在三维空间中有两条链的末端(就像连续的绳子)。我需要检测(x,y,z)的位置在给定的立方体空间的两个或可能的乘数2结束。扫描的立方体空间由扫描电镜提供的每个体素的密度表示(范围从0到1),因此“现有物质”给出的值接近1,“无物质”给出的密度值接近0。我需要一种方法来检测蛋白质的“绳子”边缘(可能的“绳子结束”的定义是在某些缠结的方向缺乏连续性。直观地说,我认为至少有两种方法:1)图论中的某个方法(我不能精确地指定-如果你知道一个-请命名或描述它)。2) 解析代数的导数-但我又不能说明具体的态度-所以请说出或解释一个。请指定建议方法的计算复杂度。我的项目是用Python实现的。请帮忙。提前谢谢。你知道吗
一种方法是选择阈值密度,将低于该阈值的所有体素转换为0,将高于该阈值的所有体素转换为1,然后在所有1-体素对中查找最短路径最长的1-体素对。这两个体素应该靠近最长的“绳子”的末端,而不管绳子的确切形状如何。你知道吗
可以定义一个图,其中每个1体素有一个顶点,每个1体素与其6个(或可能14个)相邻体之间有一条边。然后,可以使用广度优先搜索(这里不需要Dijkstra或Floyd Warshall,因为每条边都有权1),计算某个给定顶点u和O(| V |)时间和空间中其他每个顶点之间的最短路径的长度。对每个可能的起始顶点u重复此操作将给出一个O(| V | ^2)-时间算法。当你这么做的时候,要追踪到目前为止最远的一对。你知道吗
如果你的体素空间有w*h*d个单元,那么图中可能有w*h*d个顶点(如果每个体素都是1个体素),所以在最坏的情况下这可能需要O(w^2*h^2*d^2)时间,这可能是相当多的。幸运的是,如果你能负担得起一个稍微不精确的答案,有很多方法可以加快速度:
注意:如果由于弯曲,绳子上彼此靠近的远点之间没有完整的体素间隙,那么最短路径将通过这些错误连接“短路”,并可能降低精确度。您可以通过增加阈值来改善这一点。如果门槛太高,绳子就会断开。我希望您希望选择仅导致1个连接组件的最高阈值。你知道吗
如果要在三维扫描中枚举每个连续路径(从而获得每个路径的端点),可以对每个位置应用基本的深度优先搜索,例如:
或细节:
通用过程(dfs)在许多其他站点上都有很好的文档记录,但是如果您想测试它,这里有一些粗糙的java(我对python不太熟悉)可以反映上面的内容:
相关问题 更多 >
编程相关推荐