Skip to content

eskoruppa/IOPolyMC

Repository files navigation

IOPolyMC

Provides methods to read PolyMC output and write PolyMC input files

Install

git clone [email protected]:eskoruppa/IOPolyMC.git
pip install IOPolyMC/.

Use

Import package

import iopolymc as io

xyz files

Several methods to read and write xyz files

io.read_xyz(filename: str) -> dict

returns a dictionary with the keys 'pos' and 'types'.

io.load_xyz(filename: str,savenpy=True,loadnpy=True)

Same as read_xyz, except that it saves the configuration to a numpy binary upon first read and reads from binary upon future reading of that file. Loads only from binary if the .xyz file has not been changed since the binary was created.

io.read_xyz_atomtypes(filename: str) -> dict

Returns list of contained atom types.

io.write_xyz(outfn: str,data: dict,add_extension=True,append=False) -> None

Writes xyz file. The argument data has to be a dictionary containing the keys 'pos' and 'types'. 'pos' needs to be a list of configurations, one for each snapshot.

IDB files

io.read_idb(filename: str) -> dict
io.write_idb(filename: str, idbdict: dict, decimals=3)

restart files

io.read_restart(filename: str) -> List[dict]
io.write_restart(filename: str, snapshots: List[dict])

state files

io.read_state(filename: str) -> dict
io.load_state(filename: str) -> dict
io.read_spec(filename: str) -> dict
io.scan_path(path: str, ext: str, recursive=False) -> List[str]

theta files

io.read_thetas(filename: str) -> np.ndarray
io.load_thetas(filename: str) -> np.ndarray

Generate pdb files

io.gen_pdb(outfn: str, positions: np.ndarray,triads: np.ndarray,bpdicts: dict, sequence = None, center=True)
io.state2pdb(statefn: str, outfn: str, snapshot: int ,bpdicts_fn=None, sequence=None, center=True)

input files

io.read_input(filename: str) -> dict
io.write_input(filename: str,args: dict)
io.querysims(path: str, recursive=False, extension='in',sims=None,select=None) -> List[dict]
io.simfiles(infile: str,extension='in') -> List[str]

Generate PolyMC configurations by interpolating points

io.pts2config(pts : np.ndarray, disc_len : float, closed = False, numbp = None, translate_first = True) -> np.ndarray
io.config2triads(config : np.ndarray) -> np.ndarray
io.pts2xyz(outfn : str, pts : np.ndarray, disc_len : float, closed = False, numbp = None, translate_first = True, sequence = None, default_type = 'C', snapshotid = 0)
io.pts2restart(outfn : str, pts : np.ndarray, disc_len : float, closed = False, numbp = None, translate_first = True, sequence = None, default_type = 'a', snapshotid = 0)
io.unique_oligomers(num_bp: int,omit_equiv=True) -> List[str]

About

Provides methods to read PolyMC output and write PolyMC input files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages