Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(11)  |  Call(11)  |  Derive(0)  |  Import(0)

src/m/d/MDAnalysis-0.8.1/examples/dcd2xtc.py   MDAnalysis(Download)
# loop through the trajectory and write a frame for every step
for ts in u.trajectory:
    w.write(ts)
    print "Converted frame %d" % ts.frame
w.close_trajectory()

src/m/d/MDAnalysis-0.8.1/examples/amber2dcd.py   MDAnalysis(Download)
# loop through the trajectory and write a frame for every step
for ts in u.trajectory:
    w.write(ts)
    print "Converted frame %d" % ts.frame
w.close_trajectory()

src/m/d/MDAnalysisTests-0.8.1/MDAnalysisTests/test_coordinates.py   MDAnalysisTests(Download)
        W = mda.Writer(self.outfile)
        u.trajectory[50]
        W.write(u.selectAtoms('all'))
        W.close()
        u2 = mda.Universe(self.outfile)
        pdb = MDAnalysis.Writer(self.outfile, multiframe=True, start=12, step=2)
        for ts in u.trajectory[-6:]:
            pdb.write(group)
        pdb.close()
        u2 = mda.Universe(self.outfile)
        # 2 frames expceted
        for ts in u.trajectory[-2:]:
            W.write(u.atoms)
        W.close()
        u0 = mda.Universe(self.outfile)
    def test_single_frame(self):
        u = MDAnalysis.Universe(PSF, CRD)
        W = MDAnalysis.Writer(self.outfile, u.atoms.numberOfAtoms())
        W.write(u.atoms)
        W.close()
        wXTC = MDAnalysis.Writer(self.xtc, self.u.atoms.numberOfAtoms())
        for ts in self.u.trajectory:
            wXTC.write(ts);
        wXTC.close()
 

src/m/d/MDAnalysisTests-0.8.1/MDAnalysisTests/test_atomgroup.py   MDAnalysisTests(Download)
    def test_write_Universe(self):
        U = self.universe
        W = MDAnalysis.Writer(self.outfile)
        W.write(U)
        W.close()