示例#1
0
aas = 'ACDEFGHIKLMNPQRSTVWY'
# Initialize the protein folder -- very important!
# side_length refers to the protein.  E.g., in the 5x5
# model, side_length=5.

if True:
	side_length = 5
	prot_length = side_length*side_length
	folder.init(side_length)

	for i in range(10000):
		# Create a random polypeptide
		prot = ''.join([random.choice(aas) for xi in range(prot_length)])
		# Fold it and retrieve its lowest-free-energy conformation, sid, and its
		# free energy of folding, dg.
		(sid, dg) = folder.fold(prot)
		# Print them out
		if dg < -3:
			print "%d\t%d\t%1.3f\t%s" % (i, sid, dg, prot)
		'''
		print "sid g"
		for i in range(1):
			# Create a random polypeptide
			prot = ''.join([random.choice(aas) for i in range(prot_length)])
			# Fold it and retrieve its lowest-free-energy conformation, sid, and its
			# free energy of folding, dg.
			(sid, dg) = folder.fold(prot)
			for j in range(50):
				G = folder.getEnergy(prot, j)	
				# Print them out
				print "%d\t%1.3f\t%s" % (sid, dg, prot)	
示例#2
0
文件: folder-test.py 项目: dad/evoli
# Initialize the protein folder -- very important!
# side_length refers to the protein.  E.g., in the 5x5
# model, side_length=5.

if True:
	print "****\nTesting folder module"
	side_length = 5
	prot_length = side_length*side_length
	folder.init(side_length)

	for i in range(10000):
		# Create a random polypeptide
		prot = ''.join([random.choice(aas) for xi in range(prot_length)])
		# Fold it and retrieve its lowest-free-energy conformation, sid, and its
		# free energy of folding, dg.
		(sid, dg) = folder.fold(prot)
		# Print them out
		if dg < -3:
			print "%d\t%d\t%1.3f\t%s" % (i, sid, dg, prot)
	sid = random.randint(0,1080)
	dg = -2
	gene = folder.getSequenceForStructure(sid, dg)
	(new_sid, new_dg) = folder.fold(translate.Translate(gene))
	assert(sid == new_sid and new_dg <= dg)

if False:
	print "\n****\nTesting misfold module with compact lattice folder"
	side_length = 5
	struct_id = 599
	target_fraction_accurate = 0.85
	ca_cost = 5
示例#3
0
def main():
    prot = sys.argv[1]
    folder.init(int(math.sqrt(len(prot))))
    (sid, dg) = folder.fold(prot)
    print sid, dg
示例#4
0
# Initialize the protein folder -- very important!
# side_length refers to the protein.  E.g., in the 5x5
# model, side_length=5.

if True:
    print "****\nTesting folder module"
    side_length = 5
    prot_length = side_length * side_length
    folder.init(side_length)

    for i in range(10000):
        # Create a random polypeptide
        prot = ''.join([random.choice(aas) for xi in range(prot_length)])
        # Fold it and retrieve its lowest-free-energy conformation, sid, and its
        # free energy of folding, dg.
        (sid, dg) = folder.fold(prot)
        # Print them out
        if dg < -3:
            print "%d\t%d\t%1.3f\t%s" % (i, sid, dg, prot)
    sid = random.randint(0, 1080)
    dg = -2
    gene = folder.getSequenceForStructure(sid, dg)
    (new_sid, new_dg) = folder.fold(translate.Translate(gene))
    assert (sid == new_sid and new_dg <= dg)

if False:
    print "\n****\nTesting misfold module with compact lattice folder"
    side_length = 5
    struct_id = 599
    target_fraction_accurate = 0.85
    ca_cost = 5
示例#5
0
文件: fold-protein.py 项目: dad/evoli
def main():
	prot = sys.argv[1]
	folder.init(int(math.sqrt(len(prot))))
	(sid, dg) = folder.fold(prot)
	print sid, dg