pdbxyz = open(pdbxyzfilename, "w") pdbang = open(pdbangfilename, "w") pdbstr1 = 'ATOM 14 CB ALA A 7 8.120 -0.000 52.923 0.00 8.12 A' pdbat1 = PDBAtom(pdbstr1) pdbstr2 = 'ATOM 14 CB GLY A 7 8.120 -0.000 52.923 0.00 8.12 A' pdbat2 = PDBAtom(pdbstr2) chains = [chr(i) for i in range(ord('A'), ord('M')+1)] for chain in chains: for mon in range(MT_len): R = R_MT pdbat2.z = 0.0 pdbat1.z = 2*r_mon*mon + z_step*(ord(chain) - ord('A')) alpha = alpha_step*(ord(chain) - ord('A')) pdbat2.y = -alpha pdbat2.x = 0.0 x = R*cos(-alpha) y = R*sin(-alpha) pdbat1.chainid = chain pdbat2.chainid = chain pdbat1.x = x pdbat1.y = y pdbat1.residueseq = mon/2 + 1 pdbat2.residueseq = mon/2 + 1 pdbat1.number = mon + MT_len*(ord(chain)-ord(chains[0])) + 1 pdbat2.number = mon + MT_len*(ord(chain)-ord(chains[0])) + 1 if mon%2 == 0: pdbat1.name = 'CA' pdbat2.name = 'CA' else:
chains = [chr(i) for i in range(ord('A'), ord('M') + 1)] for chain in chains: for mon in range(MT_len): if (MT_len - mon) < tail_len: if delete == True and chain == chains[len(chains) - 1]: break R = R_MT + (tail_len - (MT_len - mon)) * 2 * r_mon * sin( theta_tail) #tail_step*(tail_len - (MT_len - mon)) pdbat2.z = theta_tail #atan(tail_step/z_step) pdbat1.z = 2 * r_mon * mon + z_step * (ord(chain) - ord('A')) else: R = R_MT pdbat2.z = 0.0 pdbat1.z = 2 * r_mon * mon + z_step * (ord(chain) - ord('A')) alpha = alpha_step * (ord(chain) - ord('A')) pdbat2.y = -alpha pdbat2.x = 0.0 x = R * cos(-alpha) y = R * sin(-alpha) pdbat1.chainid = chain pdbat2.chainid = chain pdbat1.x = x pdbat1.y = y pdbat1.residueseq = mon / 2 + 1 pdbat2.residueseq = mon / 2 + 1 pdbat1.number = mon + MT_len * (ord(chain) - ord(chains[0])) + 1 pdbat2.number = mon + MT_len * (ord(chain) - ord(chains[0])) + 1 if mon % 2 == 0: pdbat1.name = 'CA' pdbat2.name = 'CA' else:
break pdbxyzfilename = 'volxyz_{}.pdb'.format(int(conc)) pdbangfilename = 'volang_{}.pdb'.format(int(conc)) pdbxyz = open(pdbxyzfilename, "w") pdbang = open(pdbangfilename, "w") pdbstr1 = 'ATOM 14 CB ALA A 7 8.120 -0.000 52.923 0.00 8.12 A' pdbat1 = PDBAtom(pdbstr1) pdbstr2 = 'ATOM 14 CB GLY A 7 8.120 -0.000 52.923 0.00 8.12 A' pdbat2 = PDBAtom(pdbstr2) for atom in atoms: pdbat1.x = atom[0] pdbat1.y = atom[1] pdbat1.z = atom[2] pdbat1.chainid = 'A' pdbat1.residueseq = atoms.index(atom) + 1 pdbat1.number = 2 * atoms.index(atom) + 1 pdbat1.name = 'CA' pdbxyz.write("%s\n" % str(pdbat1)) pdbat1.x = atom[0] pdbat1.y = atom[1] pdbat1.z = atom[2]+2*r_mon pdbat1.chainid = 'A' pdbat1.residueseq = atoms.index(atom) + 1 pdbat1.number = 2 * atoms.index(atom) + 2 pdbat1.name = 'CB' pdbxyz.write("%s\n" % str(pdbat1))
pdbxyz = open(pdbxyzfilename, "w") pdbang = open(pdbangfilename, "w") pdbstr1 = 'ATOM 14 CB ALA A 7 8.120 -0.000 52.923 0.00 8.12 A' pdbat1 = PDBAtom(pdbstr1) pdbstr2 = 'ATOM 14 CB GLY A 7 8.120 -0.000 52.923 0.00 8.12 A' pdbat2 = PDBAtom(pdbstr2) chains = [chr(i) for i in range(ord('A'), ord('M') + 1)] for chain in chains: for mon in range(MT_len): R = R_MT pdbat2.z = 0.0 pdbat1.z = 2 * r_mon * mon + z_step * (ord(chain) - ord('A')) alpha = alpha_step * (ord(chain) - ord('A')) pdbat2.y = -alpha pdbat2.x = 0.0 x = R * cos(-alpha) y = R * sin(-alpha) pdbat1.chainid = chain pdbat2.chainid = chain pdbat1.x = x pdbat1.y = y pdbat1.residueseq = mon / 2 + 1 pdbat2.residueseq = mon / 2 + 1 pdbat1.number = mon + MT_len * (ord(chain) - ord(chains[0])) + 1 pdbat2.number = mon + MT_len * (ord(chain) - ord(chains[0])) + 1 if mon % 2 == 0: pdbat1.name = 'CA' pdbat2.name = 'CA' else:
pdbat2 = PDBAtom(pdbstr2) chains = [chr(i) for i in range(ord('A'), ord('M')+1)] for chain in chains: for mon in range(MT_len): if (MT_len - mon) < tail_len: if delete == True and chain == chains[len(chains) - 1]: break R = R_MT + (tail_len - (MT_len - mon))*2*r_mon*sin(theta_tail) #tail_step*(tail_len - (MT_len - mon)) pdbat2.z = theta_tail #atan(tail_step/z_step) pdbat1.z = 2*r_mon*mon + z_step*(ord(chain) - ord('A')) else: R = R_MT pdbat2.z = 0.0 pdbat1.z = 2*r_mon*mon + z_step*(ord(chain) - ord('A')) alpha = alpha_step*(ord(chain) - ord('A')) pdbat2.y = -alpha pdbat2.x = 0.0 x = R*cos(-alpha) y = R*sin(-alpha) pdbat1.chainid = chain pdbat2.chainid = chain pdbat1.x = x pdbat1.y = y pdbat1.residueseq = mon/2 + 1 pdbat2.residueseq = mon/2 + 1 pdbat1.number = mon + MT_len*(ord(chain)-ord(chains[0])) + 1 pdbat2.number = mon + MT_len*(ord(chain)-ord(chains[0])) + 1 if mon%2 == 0: pdbat1.name = 'CA' pdbat2.name = 'CA' else:
break pdbxyzfilename = 'volxyz_{}.pdb'.format(int(conc)) pdbangfilename = 'volang_{}.pdb'.format(int(conc)) pdbxyz = open(pdbxyzfilename, "w") pdbang = open(pdbangfilename, "w") pdbstr1 = 'ATOM 14 CB ALA A 7 8.120 -0.000 52.923 0.00 8.12 A' pdbat1 = PDBAtom(pdbstr1) pdbstr2 = 'ATOM 14 CB GLY A 7 8.120 -0.000 52.923 0.00 8.12 A' pdbat2 = PDBAtom(pdbstr2) for atom in atoms: pdbat1.x = atom[0] pdbat1.y = atom[1] pdbat1.z = atom[2] pdbat1.chainid = 'A' pdbat1.residueseq = atoms.index(atom) + 1 pdbat1.number = 2 * atoms.index(atom) + 1 pdbat1.name = 'CA' pdbxyz.write("%s\n" % str(pdbat1)) pdbat1.x = atom[0] pdbat1.y = atom[1] pdbat1.z = atom[2] + 2 * r_mon pdbat1.chainid = 'A' pdbat1.residueseq = atoms.index(atom) + 1 pdbat1.number = 2 * atoms.index(atom) + 2 pdbat1.name = 'CB' pdbxyz.write("%s\n" % str(pdbat1))