Exemplo n.º 1
0
    if len( sys.argv ) < 2:
        _use()

    o = cmdDict( {'o':'traj.dat', 'i':'sim.crd'} )
    fcrd = o['i']
    fpdb = o['r']
    fout = o['o']
    box  = 'b' in o
    wat  = 'wat' in o
    hyd  = 'hyd' in o
    rnres  = 'rnres' in o
    code = o.get('code', None)
    step = int(o.get('step', 1))

    t = Trajectory( fcrd, fpdb, hasbox=box, rmwat=wat, verbose=True)
    
    if code:
        t.ref.pdbCode = code

    if hyd:
        t.ref.addChainId( keep_old=1 ) ## preserve chain-delimiters
        t.removeAtoms( lambda a: a['element'] == 'H' )

    if step != 1:
        t = t.takeFrames( N.arange(0,len(t),step) )

    print("Dumping result to ", fout)
    dump( t, absfile(fout) )

    print("Done")
Exemplo n.º 2
0
import biskit as B

from biskit.md import Trajectory, EnsembleTraj, traj2ensemble


com = Trajectory('rpa_com.crd', '0_com.pdb', hasbox=1 )
##com = T.load( 'com.traj' )

# re-order frames into 4 parallel trajectories
frames = N.zeros( len(com), int )

for i in range( 11 ):
    N.put( frames, range(i*4,i*4+4), N.arange(i,44,11) )

etraj = EnsembleTraj( n_members=4 )
etraj.frames = com.takeFrames( frames ).frames
etraj.ref = com.ref
etraj.resetFrameNames()
etraj.ref.disconnect()

# separate protein and DNA into two chains
etraj.ref.chainIndex(breaks=True, force=True, cache=True)
etraj.ref.addChainId()

## extract only some residues for speed
t1 = etraj.takeAtoms( etraj.ref.res2atomIndices(range(10)) )
t2 = etraj.takeChains( [1] )

etraj = t1.concatAtoms( t2 )

T.dump( etraj, 'com_fake.etraj' )