本文整理汇总了Python中PyUtils.create_folder方法的典型用法代码示例。如果您正苦于以下问题:Python PyUtils.create_folder方法的具体用法?Python PyUtils.create_folder怎么用?Python PyUtils.create_folder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyUtils
的用法示例。
在下文中一共展示了PyUtils.create_folder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DownloadPDBs
# 需要导入模块: import PyUtils [as 别名]
# 或者: from PyUtils import create_folder [as 别名]
def DownloadPDBs(PDB_list_file):
PDB_list = open(os.getcwd()+'/'+PDB_list_file,'r').readlines()
for i in range(len(PDB_list)):
PDBid = PDB_list[i].strip()
PyUtils.create_folder(os.getcwd()+"/"+PDBid)
os.chdir(PDBid)
cmd = ["~/../scripts/pdbUtil/getPdb.pl"+" -id "+PDBid]
subprocess.call(cmd,shell=True)
os.chdir("..")
示例2: __init__
# 需要导入模块: import PyUtils [as 别名]
# 或者: from PyUtils import create_folder [as 别名]
def __init__(self, folder_name, compound, library = False):
self.folder = os.getcwd() + "/"
self.name = self.folder + folder_name + "/"
#self.compound = os.path.abspath(compound)[5:]
self.compound = compound
self.library = library
PyUtils.create_folder(self.name)
self.copyIndock()
self.softlink()
os.chdir(self.name)
self.dock_command = Paths.DOCKBASE + "docking/DOCK/src/i386/dock64"
self.DOCK()
示例3: poses2pdb
# 需要导入模块: import PyUtils [as 别名]
# 或者: from PyUtils import create_folder [as 别名]
def poses2pdb(self):
PyUtils.create_folder('recs')
os.chdir('poses')
for k in range(1, len(os.listdir(os.getcwd())) + 1):
i = str(k) + '.mol2'
surface = PYMOLUtils.get_surface_area(i)
with open(i, 'r') as f_mol:
for line in f_mol:
if 'SMILES' in line:
smile_line = line.split()[2]
if 'heavy atom count' in line:
heavy_atoms = int(line.split()[-1])
break
if surface < 200 or surface / heavy_atoms < 14.5:
self.counters.append(0)
continue
if '[N+](=O)[O-]' in smile_line or smile_line.count('N') + smile_line.count('O') + smile_line.count('n') + smile_line.count('o') > 4:
self.counters.append(0)
continue
pdb_pose = '../recs/' + i[:-4] + 'pdb'
subprocess.call(['convert.py', i, pdb_pose])
hetatm = []
with open(pdb_pose, 'r') as f_pdb:
for line in f_pdb:
if 'HETATM' in line:
hetatm.append(line[:23] + ' -1' + line[26:])
rec_pose = '../recs/rec_' + i[:-4] + 'pdb'
with open(rec_pose, 'w') as f_rec:
for line in hetatm:
f_rec.write(line)
for line in self.rec_lines:
f_rec.write(line)
sub_command = []
for res_l in self.res_list:
sub_command.append('-seed_residue')
sub_command.append(str(res_l))
subprocess.call(['python', Paths.SCRIPTS + 'HBonanza.py', '-trajectory_filename', rec_pose, '-hydrogen_bond_distance_cutoff', '3.0', '-hydrogen_bond_angle_cutoff', '30', '-seed_residue', '-1'] + sub_command + ['-just_immediate_connections', 'true'], stdout=open(os.devnull, 'w'))
os.remove(rec_pose + '.average_hbonds')
os.remove(rec_pose + '.frame_by_frame_hbonds.csv')
if os.path.isfile(rec_pose + '.hbond_averages_in_occupancy_column.pdb'):
os.remove(rec_pose + '.hbond_averages_in_occupancy_column.pdb')
counter = self.countHbonds(rec_pose + '.HBonds')
else:
counter = 0
self.counters.append(counter)
os.remove(rec_pose)
os.chdir('../')
shutil.rmtree('recs')
shutil.rmtree('poses')
示例4: runDirSingle
# 需要导入模块: import PyUtils [as 别名]
# 或者: from PyUtils import create_folder [as 别名]
def runDirSingle(self, dirname, command):
PyUtils.create_folder(dirname[:-1])
os.chdir(dirname[:-1])
self.runSingle(command)
os.chdir('../')
示例5: runDirSingle
# 需要导入模块: import PyUtils [as 别名]
# 或者: from PyUtils import create_folder [as 别名]
def runDirSingle(self, dirname, command):
PyUtils.create_folder(dirname[:-1])
curr = os.getcwd()
os.chdir(dirname[:-1])
self.runSingle(command)
os.chdir(curr)