def parse(self, filename): filename = pmx_data_file(filename) self.filename = filename l = open(filename).readlines() self.lines = kickOutComments(l,';') self.__get_residue_names() for key in self.keys: rtp_lines = self.__read_residue_entry( key) # read atoms al = readSection(rtp_lines,'[ atoms ]','[') atoms = self.__read_rtp_atoms(key, al ) # read bonds bl = readSection(rtp_lines,'[ bonds ]','[') bonds = self.__read_rtp_bonds( key, bl ) # read dihedrals dl = readSection(rtp_lines,'[ dihedrals ]','[') diheds = self.__read_rtp_dihedrals(key, dl) # read impropers il = readSection(rtp_lines,'[ impropers ]','[') improps = self.__read_rtp_impropers(key, il) # read cmap (only for charmm) cmap = readSection(rtp_lines,'[ cmap ]','[') #print cmap #cmap = self.__read_rtp_cmap(key, cl) self.entries[key] = { 'atoms': atoms, 'bonds': bonds, 'diheds': diheds, 'improps': improps, 'cmap' : cmap }
def build_rna_strand(seq): dic = pmx_data_file('rna.pkl') seq = seq.lower() ss = [] for x in seq: ss.append(x) new = [] new.extend(dic[ss[0]].residues) ss.pop(0) while ss: newbp = ss.pop(0) newm = dic[newbp].copy() add_bp(newm, new, True) new.extend(newm.residues) chA = [] a = 1 for r in new: r.set_resid(a) a += 1 chA.append(r) mm = Model(residues=chA) mm.chains[0].set_chain_id('A') for chain in mm.chains: r = chain.residues[0] r.set_resname(r.resname + '5') make_5ter(r) r = chain.residues[-1] r.set_resname(r.resname + '3') make_3ter(r) return mm
def parse(self, filename, version): if not hasattr(filename,"append"): # not a list filename = pmx_data_file(filename) l = open(filename).readlines() self.filename = filename else: l = filename self.filename = '< from list >' self.lines = kickOutComments(l,';') self.__parse_atomtypes(version)
def parse(self, filename): if not hasattr(filename,"append"): # not a list filename = pmx_data_file(filename) self.filename = filename l = open(filename).readlines() else: l = filename self.filename = '< from list >' self.lines = kickOutComments(l,';') self.__parse_directives() self.__parse_bondtypes() self.__parse_angletypes() self.__parse_dihedraltypes()
def build_dna_strand(seq): dic = pmx_data_file('bp.pkl') seq = seq.lower() ss = [] for x in seq: ss.append(x) new = [] new.extend(dic[ss[0]].residues) ss.pop(0) while ss: newbp = ss.pop(0) newm = dic[newbp].copy() add_bp(newm, new) new.extend(newm.residues) chA = [] chB = [] a = 1 b = 1 for r in new: if r.chain_id == 'B': r.set_resid(a) a += 1 chA.append(r) else: chB.append(r) chB.reverse() for r in chB: r.set_resid(b) b += 1 mm = Model(residues=chA + chB) mm.chains[1].set_chain_id('C') mm.chains[0].set_chain_id('A') mm.chains[1].set_chain_id('B') for chain in mm.chains: r = chain.residues[0] r.set_resname(r.resname + '5') make_5ter(r) r = chain.residues[-1] r.set_resname(r.resname + '3') make_3ter(r) return mm
def build_dna_strand(seq): dic = pmx_data_file('bp.pkl') seq = seq.lower() ss = [] for x in seq: ss.append(x) new = [] new.extend(dic[ss[0]].residues) ss.pop(0) while ss: newbp = ss.pop(0) newm = dic[newbp].copy() add_bp(newm, new) new.extend(newm.residues) chA = [] chB = [] a = 1 b = 1 for r in new: if r.chain_id == 'B': r.set_resid(a) a+=1 chA.append(r) else: chB.append(r) chB.reverse() for r in chB: r.set_resid(b) b+=1 mm = Model(residues=chA+chB) mm.chains[1].set_chain_id('C') mm.chains[0].set_chain_id('A') mm.chains[1].set_chain_id('B') for chain in mm.chains: r = chain.residues[0] r.set_resname(r.resname+'5') make_5ter(r) r = chain.residues[-1] r.set_resname(r.resname+'3') make_3ter(r) return mm
def get_fragments(): dic = pmx_data_file('fragments.pkl') n = len(dic.keys()) print >> sys.stderr, "pmx__> # Fragments loaded: %d" % n return dic
def load_bbdep(): return pmx_data_file('bbdep.pkl')
def get_fragments(): dic = pmx_data_file('fragments.pkl') n = len(dic.keys()) print >>sys.stderr,"pmx__> # Fragments loaded: %d" % n return dic