當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。