本文整理汇总了Python中Analyzer.Analyzer.create_distance_probability方法的典型用法代码示例。如果您正苦于以下问题:Python Analyzer.create_distance_probability方法的具体用法?Python Analyzer.create_distance_probability怎么用?Python Analyzer.create_distance_probability使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analyzer.Analyzer
的用法示例。
在下文中一共展示了Analyzer.create_distance_probability方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: atom_nodes_init
# 需要导入模块: from Analyzer import Analyzer [as 别名]
# 或者: from Analyzer.Analyzer import create_distance_probability [as 别名]
from Spectroscopy import Spectroscopy#For Testing
from init_relationships import relationships_init
from nodify import atom_nodes_init #For Testing
from Analyzer import Analyzer#For Testing
import sys #For Testing
import os #For Testing
import re #For Testing
xyz_file = sys.argv[1]
spectra_folder = sys.argv[2]
#Init the nodes and relationships, like distances, dihedrals, etc.
graph = atom_nodes_init(xyz_file)
relationships_init(graph)
#Add the spectra to the graph
spectra_files = os.listdir(spectra_folder)
for spectrum in spectra_files:
#spec_num = re.sub(r'(.*?)-.*', r'\1', spectrum)
spec_num = int(re.sub(r'.*?([0-9]*)-.*', r'\1', spectrum))
spec = Spectroscopy(spectra_folder + "/" + spectrum)
graph.add_spectrum(spec_num, spec)
#Create the histogram
analyzer = Analyzer(graph)
histogram = analyzer.create_distance_probability("Distance S - S", .5, 0, 10)
#print graph
print histogram