def mol_from_pdb(): mol = mdt.from_pdb('3aid') return mdt.Molecule(mol.chains['A'].residues['ARQ401'])
def test_from_pdb_mmcif_format(): mol = mdt.from_pdb('3aid', usecif=True) assert mol.metadata.pdbid == '3aid' assert mol.metadata.sourceformat == 'mmcif' assert mol.metadata.sourceurl.split('.')[-1] == 'cif' assert mol.num_atoms == 1912
def test_mmcif_fallback_if_no_pdb_file(): mol = mdt.from_pdb('4V5X') assert mol.metadata.pdbid.lower() == '4v5x' assert mol.metadata.sourceformat == 'mmcif' assert mol.metadata.sourceurl.split('.')[-1] == 'cif'
#!/usr/bin/env python """ A short script that assembles reasonable template geometries for standard amino acids and DNA bases """ import moldesign as mdt import json protein = mdt.from_pdb('4F0A') dna = mdt.build_bdna('ACTGAA') residues = {} for chain in protein.chains.values() + dna.chains.values(): for residue in chain: if residue.type not in ('dna', 'protein'): continue if residue.type == 'dna' and (residue.is_5prime_end or residue.is_3prime_end): continue if residue.type == 'protein' and (residue.is_c_terminal or residue.is_n_terminal): continue residues[residue.resname] = mdt.clean_pdb(mdt.Molecule(residue)) residue_pdb = {k: m.write(format='pdb') for k,m in residues.iteritems()} with open('residue_templates.json', 'w') as outfile: json.dump(residue_pdb, outfile)
def test_from_pdb_pdb_format(): mol = mdt.from_pdb('3aid') assert mol.metadata.pdbid == '3aid' assert mol.metadata.sourceformat == 'pdb' assert mol.num_atoms == 1912
def pdb3aid(): mol = mdt.from_pdb('3AID') return mol
#!/usr/bin/env python """ A short script that assembles reasonable template geometries for standard amino acids and DNA bases """ import moldesign as mdt import json protein = mdt.from_pdb('4F0A') dna = mdt.build_bdna('ACTGAA') residues = {} for chain in list(protein.chains.values()) + list(dna.chains.values()): for residue in chain: if residue.type not in ('dna', 'protein'): continue if residue.type == 'dna' and (residue.is_5prime_end or residue.is_3prime_end): continue if residue.type == 'protein' and (residue.is_c_terminal or residue.is_n_terminal): continue residues[residue.resname] = mdt.clean_pdb(mdt.Molecule(residue)) residue_pdb = {k: m.write(format='pdb') for k,m in residues.items()} with open('residue_templates.json', 'w') as outfile: json.dump(residue_pdb, outfile)
def protein_default_amber_forcefield(): mol = mdt.from_pdb('1YU8') newmol = mdt.assign_forcefield(mol) newmol.set_energy_model(mdt.models.ForceField) return newmol
def from_pdb(pdbcode): import moldesign as mdt mol = mdt.from_pdb(pdbcode) mol.write('out.pkl')
def pdb3aid(): #FPATH = '../notebooks/data/3AID.pdb' #assert os.path.exists(FPATH) mol = mdt.from_pdb('3AID') return mol