代码网址:https://media.nature.com/original/nature-assets/nprot/journal/v9/n3/extref/nprot.2014.042-S2.zip论文阅读:https://www.nature.com/articles/nprot.2014.042
def read_gaussian_outputfiles():
list_of_files = []
for file in glob.glob('*.out'):
list_of_files.append(file)
return list_of_files
def main():
lofc = read_gaussian_outputfiles()
lofc_freq = read_gaussian_freq_outfiles(lofc)
lofc_nmr = read_gaussian_nmr_outfiles(lofc)
locs = prepare_list_of_chemical_shifts(lofc_nmr)
lofe = get_list_of_free_energies(lofc_freq)
lofe = boltzmann_analysis(lofe)
lofe = report_chemical_shifts(lofc_nmr, lofe)
summed_proton_shifts = final_proton_chemical_shifts(lofe)
summed_carbon_shifts = final_carbon_chemical_shifts(lofe)
lofe = count_imaginary_freq(lofc_freq, lofe)
write_final_shift_csv(summed_proton_shifts,summed_carbon_shifts)
write_master_csv(lofe)
def glob(pathname, *, recursive=False):
"""Return a list of paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns.
If recursive is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
"""
def _iterdir(dirname, dironly):
if not dirname:
if isinstance(dirname, bytes):
dirname = bytes(os.curdir, 'ASCII')
else:
dirname = os.curdir
try:
with os.scandir(dirname) as it:
for entry in it:
try:
if not dironly or entry.is_dir():
yield entry.name
except OSError:
pass
except OSError:
return
版权声明: 本文为CSDN博主「beyondma」的原创文章,转载请附上原文出处链接及本声明。原文链接:https://blog.csdn.net/BEYONDMA/article/details/102555199
换个姿势阅读?扫码试试~
◆
精彩推荐
◆