当前位置: 首页>>代码示例>>Python>>正文


Python PyUtils.create_folder方法代码示例

本文整理汇总了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("..")
开发者ID:EkaterinaOsipova,项目名称:CovaLib,代码行数:11,代码来源:PDBUtils_old.py

示例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()
开发者ID:LondonLab,项目名称:CovaLib,代码行数:14,代码来源:DOCKovalent.py

示例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')
开发者ID:LondonLab,项目名称:CovaLib,代码行数:51,代码来源:PosesHBonds.py

示例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('../')
开发者ID:EkaterinaOsipova,项目名称:CovaLib,代码行数:7,代码来源:Cluster.py

示例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)
开发者ID:LondonLab,项目名称:CovaLib,代码行数:8,代码来源:Cluster.py


注:本文中的PyUtils.create_folder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。