예제 #1
0
ldir = General.createLocalSpace()
odir = os.getcwd()
errorfree = True

smart = False
if args.rmsd == None:
	smart = True
else:
	rmsdeff = args.rmsd

for pdb in args.p:
	# set rmsd cutoff using Craig's function
	residues = PDB.ConRes(pdb)
	segments = Fragment.getSegments(residues)
	if smart:
		rmsdeff = mustpress.rmsdEff(segments, args.params[0], args.params[1])

	seqout = args.head + '_' + General.changeExt(pdb, 'seq')
	matchout = General.changeExt(seqout, 'match')

	if os.path.isfile(seqout):
		continue

	# search is additonal to a previous round
	if args.more != None:
		oseqf = args.more + '_' + General.changeExt(pdb, 'seq')
		if not os.path.isfile(oseqf):
			continue
		olen = sum([1 for x in open(oseqf)])
		if olen >= args.topn:
			omatchf = General.changeExt(oseqf, 'match')
예제 #2
0
ldir = General.createLocalSpace()
# copy .match and .seq
sub.call(['cp', matchf, seqf, ldir])
os.chdir(ldir) 

tmphead = args.head

if args.rmsd != None:
    if noHomoNow == 0:
        tmphead = Analyze.trimByRMSD(matchf, -1, tmphead, 'th1', args.rmsd, sorted = False, h**o = exclude, homo_log = True)
        noHomoNow = 1
    else:
        tmphead = Analyze.trimByRMSD(matchf, -1, tmphead, 'th1', args.rmsd, sorted = False)
if args.smart:
    if len(segments) == 1:
        smartcut = mustpress.rmsdEff(segments, 20, 0.9)
    else:
        if max(resnums) - min(resnums) < 8: # this is considered close, even there is gap between two segments
            smartcut = mustpress.rmsdEff(segments, 20, 0.9) - 0.2 # this is about 0.5
        else:
            smartcut = mustpress.rmsdEff(segments, 15, 1.1) # this is about 0.9
    if noHomoNow == 0:
        tmphead = Analyze.trimByRMSD(matchf.replace(args.head, tmphead), 0, tmphead, 'ts', smartcut, h**o = exclude, homo_log = True)
        noHomoNow = 1
    else:
        tmphead = Analyze.trimByRMSD(matchf.replace(args.head, tmphead), 0, tmphead, 'ts', smartcut)
elif args.bbrmsd != None:
    if noHomoNow == 0:
        tmphead = Analyze.trimByRMSD(matchf.replace(args.head, tmphead), 0, tmphead, 'th2', args.bbrmsd, h**o = exclude)
        noHomoNow = 1
    else: