예제 #1
0
 if tsdata[0][ts.head_col.step] == 1:
     if not ts.has_more_data():
         print('Not enough data in .ts file (2)')
         sys.exit(2)
     tsdata, lines = ts.read_onestep()
 
 if tsdata[0][ts.head_col.e_bridge] == '0.0000000':
     struct = dcd.read_onestep()
     iatom = 0
     for c in chains:
         for r in c.residues:
             for a in r.atoms:
                 a.xyz.put_as_list(struct[iatom])
                 iatom += 1
     imodel += 1
     pdb.modelID = imodel
     pdb.set_remark('ORIGINAL_FILE %s' % (dcd_filename,))
     pdb.set_remark('ORIGINAL_FRAME %i' % (i_org,))
     for iunit, x in enumerate(tsdata):
         if iunit == 0:
             tsline = 'TS_all'
         else:
             tsline = 'TS_%i  ' % (iunit,)
         for y in x:
             tsline += ' ' + y
         pdb.set_remark(tsline)
     pdb.write_all(chains)
 else:
     dcd.skip_onestep()
 
 i_org += 1
예제 #2
0
        continue
    
    struct = dcd.read_onestep()

    """ Move to the origin """
    if args.flg_origin:
        com = [0.0, 0.0, 0.0]
        for v in struct:
            com = [com[i]+v[i] for i in range(3)]

        com = [com[i]/float(len(struct)) for i in range(3)]

        for i in range(len(struct)):
            struct[i] = [struct[i][j] - com[j] for j in range(3)]

    iatom = 0
    for c in chains:
        for r in c.residues:
            for a in r.atoms:
                a.xyz.put_as_list(struct[iatom])
                iatom += 1

    movie.modelID = iframe + args.id_offset
    movie.set_remark('ORIGINAL_FILE %s' % (args.dcd,))
    movie.set_remark('ORIGINAL_FRAME %i' % (i_orig,))
    movie.write_all(chains)
    i_orig += 1

movie.close()
pdb.close()