File I/O

molparse.io.modifyPDB(filename, atoms, copy_from=None)[source]

in-place modification of a PDB file for improved performance when only modifying a certain subset of atoms

filename: PDB to modify atoms: list of mp.Atom objects that will be modified in the PDB copy_from: (optional) copy {copy_from} –> {filename} before modifying

molparse.io.parse(file, verbosity=1, **kwargs)[source]

Parse a molecular structure file.

Supported filetypes

  • PDB: *.pdb

  • Gromacs: *.gro

  • XYZ: *.xyz

  • mol: *.mol

  • Gromacs Index: *.ndx

  • JSON: *.json

molparse.io.parseCIF(cif_file, verbosity=1, split_chains_by_type: bool = True, debug: bool = False, **kwargs)[source]

Parse a PDBx/mmCIF structure

molparse.io.parseGRO(gro, systemName=None, fix_indices=True, fix_atomnames=True, autoname_chains=True, element_guess_warnings=True, verbosity=1, auto_ter=['DA3', 'DT3', 'DG3', 'DC3'])[source]

Parse a Gromacs structure

molparse.io.parseMol(mol, verbosity=1)[source]

Parse an RDKit Molecule

molparse.io.parsePDB(pdb, systemName=None, index=1, fix_indices=True, fix_atomnames=True, autoname_chains=False, prune_alternative_sites=False, verbosity=1, debug=False, dry=False, resfilter=None, alternative_site_warnings=False, split_chains_by_type=True, remove_empty_chains=True, num_appended_hydrogen_chains=False, detect_misordered_chains=True, reordering_warnings=False, reordering_summary_warnings=True, skipping_residue_warning=True, keep_headers=False)[source]

Parse a PDB

molparse.io.read(filename, index=None, verbosity=1, tagging=True, tagByResidue=False, **parameters)[source]

Wrapper for ase.io.read

molparse.io.write(filename, payload, verbosity=1, **parameters)[source]

Write an object to a filename.