本文整理汇总了Python中General.absPath方法的典型用法代码示例。如果您正苦于以下问题:Python General.absPath方法的具体用法?Python General.absPath怎么用?Python General.absPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类General
的用法示例。
在下文中一共展示了General.absPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: import General [as 别名]
# 或者: from General import absPath [as 别名]
# iterator of conDforMatches.py
import os, sys, argparse, glob
import General, PDB, Constants, mustpress
from time import sleep
selfbin = General.selfbin(sys.argv[0])
par = argparse.ArgumentParser()
par.add_argument('--tab', required = True, help = 'a .tab file')
par.add_argument('--head', required = True, help = 'head of .seq file')
par.add_argument('--o', default = 'env', help = 'suffix of output file')
par.add_argument('--uplimit', help = 'top n sequences to calculate')
par.add_argument('--wgap', help = 'if query is with gap, give a location to find intact fragments for query')
args = par.parse_args()
if args.wgap != None:
args.wgap = General.absPath(args.wgap)
lines = open(args.tab).readlines()
odir = os.getcwd()
jobs = []
seen = {}
for line in lines:
os.chdir(odir)
if line.startswith('#'):
continue
mut = mustpress.getMutation(line)
os.chdir(mut.dir)
pdbs = glob.glob('*.pdb')
pdbs.sort()
示例2: int
# 需要导入模块: import General [as 别名]
# 或者: from General import absPath [as 别名]
if tems[m][0] == "#":
continue
tem = tems[m].split()
(temp, peplen) = (tem[0], tem[5])
if int(peplen) < args.pepl: # peptide length in template is not long enough
continue
if not os.path.isfile(pepid + "/model" + str(m) + ".out/score.sc"):
if args.psfix == "":
tempdb = args.pdbbin + "/" + temp + ".pdb"
else:
tempdb = args.pdbbin + "/" + temp + "_" + args.psfix + ".pdb"
cmd = [
"python",
SELFBIN + "/fpd.py",
"--p",
General.absPath(args.p),
"--range",
" ".join(args.r),
"--pname",
pepid,
"--pseq",
" ".join(pep),
"--m",
tempdb,
"--dname",
"model" + str(m) + ".out",
]
if not args.abinitio:
# cmd.extend(['--flip'])
cmd.extend(["--ab", "0"])
elif first == True:
示例3: calculateOverlap
# 需要导入模块: import General [as 别名]
# 或者: from General import absPath [as 别名]
import os, argparse, glob
from math import sqrt
import General
par = argparse.ArgumentParser()
par.add_argument('--head', required = True, help = 'head of .match files')
par.add_argument('--o', required = True, help = 'suffix of the output file')
par.add_argument('--local', required = True, help = 'location of local structure data')
par.add_argument('--localh', required = True, help = 'the head of local .env files')
par.add_argument('--env', nargs = 2, help = 'the suffix of the non-local and local .env files')
args = par.parse_args()
args.local = General.absPath(args.local)
odir = os.getcwd()
dirs = [x for x in os.listdir('.') if os.path.isdir(x)]
dirs.sort()
def calculateOverlap(list1, list2):
# n_less = min(len(list1), len(list2))
# n_common = len(list(set(list1[0:n_less]).intersection(list2[0:n_less])))
# overlap = 0
# if n_less != 0:
# overlap = float(n_common) / n_less
# return overlap
n_common = len( list( set(list1).intersection(list2) ) )
overlap = 0
if n_common != 0:
overlap = float(n_common) / sqrt(len(list1) * len(list2))
return overlap
for d in dirs: