Exemple #1
0
    def fit_dcd_to_avg_input(self, amber=False, begin=1, frame_num=10000, massweighted=False, firstter=None, lastter=None, dcd_out=None):
        if self.type_na == 'arna+arna':
            supplement1 = None
            supplement2 = None 
        elif self.type_na == 'bdna+bdna':
            supplement1 = get_patch(self.seq1, 1)
            supplement2 = get_patch(self.seq2, 2)

        f_inp = path.join(self.inp_folder, 'fit_dcd_to_avg.inp')
        crd_inp = path.join(self.heavy_folder, '{0}.nohydrogen.avg.crd'.format(self.type_na))
        dcd_inp = path.join(self.heavy_folder, '{0}.nohydrogen.dcd'.format(self.type_na))
        if dcd_out is None:
            dcd_out = path.join(self.heavy_folder, '{0}.nohydrogen.fitavg.dcd'.format(self.type_na))

        inp = Script(f_inp)
        inp.write_bomlev()
        inp.initialize_rtf_prm(amber=amber)
        inp.write_seq(self.seq1, firstter=firstter, lastter=lastter, segid='strand1')
        if supplement1 is not None:
            inp.write_supplement(supplement1)
        inp.write_seq(self.seq2, firstter=firstter, lastter=lastter, segid='strand2')
        if supplement2 is not None:
            inp.write_supplement(supplement2)
        inp.gen_angle_dihedral()
        inp.delete_selection()
        inp.read_crd(crd_inp)
        inp.coor_copy()
        inp.read_traj(dcd_inp)
        inp.open_write_traj(dcd_out)
        inp.write_noh_dcd(begin=begin, frame_num=frame_num, mass_weighted=massweighted)
        inp.close_unit(21)
        inp.close_unit(30)
        inp.end()
Exemple #2
0
    def make_no_h_dcd_input(self,
                            mass_weighted=True,
                            amber=False,
                            supplement1=None,
                            supplement2=None,
                            begin=1,
                            frame_num=10000,
                            firstter=None,
                            lastter=None):
        f_inp = path.join(self.inp_folder, 'write_no_h_dcd.inp')
        crd_inp = path.join(self.mkcrd_folder, '{0}.crd'.format(self.type_na))
        dcd_out = path.join(self.heavy_folder,
                            '{0}.nohydrogen.dcd'.format(self.type_na))

        inp = Script(f_inp)
        inp.write_bomlev()
        inp.initialize_rtf_prm(amber=amber)
        inp.write_seq(self.seq1,
                      firstter=firstter,
                      lastter=lastter,
                      segid='strand1')
        if supplement1 is not None:
            inp.write_supplement(supplement1)
        inp.write_seq(self.seq2,
                      firstter=firstter,
                      lastter=lastter,
                      segid='strand2')
        if supplement2 is not None:
            inp.write_supplement(supplement2)
        inp.gen_angle_dihedral()
        inp.read_crd(crd_inp)
        inp.coor_copy()
        inp.read_traj(self.inp_dcd)
        inp.open_write_traj(dcd_out)
        inp.write_noh_dcd(mass_weighted=mass_weighted,
                          begin=begin,
                          frame_num=frame_num)
        inp.close_unit(21)
        inp.close_unit(30)
        inp.end()