Metadata-Version: 2.4
Name: biochemHH
Version: 0.0.6.dev0
Summary: Molecular biology & structural biology tools
Author: Otter Brown
Author-email: 
License: GPL-2.0-only
Keywords: Molecular biology,Structural biology
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: biopython
Requires-Dist: biotite
Requires-Dist: biotraj
Requires-Dist: chardet
Requires-Dist: hydride
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pillow
Requires-Dist: primer3-py
Requires-Dist: scipy
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary


# biochemHH

**biochemHH** is a Python package supporting experimental protein engineering. It contains tools for cloning design, structure analysis, and structural file (GB, CIF) editing.

**1. Create a new Python environment**

Create a new Python environment (Python version >= 3.12).

**2. Install the package**

Activate the environment and run the following code:

```
pip install biochemHH
```

**3. Copy example files to your working directory**

Run the following code in Windows CMD to copy example scripts into your working directory of choice. Replace the `C:\biochemHH_work` in the first line with the path to your working directory. A working directory folder will be created if it does not exist.

```
set "WORKDIR=C:\biochemHH_work"

python -c "import biochemHH,pathlib,shutil; p=pathlib.Path(biochemHH.__file__).parent; d=pathlib.Path(r'%WORKDIR%'); d.mkdir(parents=True,exist_ok=True); [shutil.copytree(p/n,d/n,dirs_exist_ok=True) for n in ('example_input','example_script')]; [shutil.copy2(p/'example_input'/n,d/n) for n in ('pUCv2-cat.gb','Demonstration_of_batch_mode_cloning_design.pdf')]; print('Copied all files and folders to',d)"
```

**Notes:**
- It is recommended to install PyMOL for protein visualization.
- All input/output files will be read from/written to your working directory. Move output files elsewhere after completion to avoid overwriting them.
- Demonstration PDF files are available in the copied `example_input` folder.

**4. Examples**

**4.1 Batch-mode cloning design given mutation notations**

```python
from biochemHH import GBparser

notations = ['_13A_28del_90~91insE',       					# the first plasmid
			 '_101~102insEAT_130~135del_140~142delinsAAG',   # the second plasmid 
			 ]

GBparser.cloning_design_wrapper_1(
	base_filename='pUCv2-cat',	
	feature_select='cat',		# a gene annotated 'cat' in 'pUCv2-cat.gb' file
	notations=notations,
	species='ecoli',
	plasmid_prefix='pL-',
	oligo_prefix='Oz')

```
A detailed 'Demonstration_of_batch_mode_cloning_design.pdf' and the example input 'pUCv2-cat.gb' is copied into your working directory in step 3.

**4.2 Analyze noncovalent interactions**

```python
from biochemHH import StructureHH
StructureHH.Shell_analyses_II( '8OV6.cif' ,
                               target_string='C501 B52~55',
                               coi=[],
                               exclude_van_der_waals=False,
                               exclude_intrachain_van_der_waals=False,
                               exclude_intrachain_noncovalent_bonds=False,
                               exclude_water=False
                               )
```

**4.3 Structure file (CIF, PDB) editing**

```python
from biochemHH import StructureHH

# ........................................ Duplicate a structure
StructureHH.copy_structure_file('5AXN.cif', new_filename = '5AXNcopy.pdb')


# ........................................ Rename chains
StructureHH.rename_chains('5AXN.cif', initial_chain_id=['A', 'B'], new_chain_id=['C', 'D'], new_filename = '5AXNedit.cif')	# The example rename chain 'A' -> 'C', chain 'B' -> 'D' respectively.


# ........................................ Delete chains
StructureHH.delete_chains('5AXN.cif', chains_to_remove = ['B','P'], new_filename = '5AXNedit.cif')


# ........................................ Edit chain: retain a list of residues
StructureHH.chain_shrinking('5AXN.cif', chain = 'A', resi_to_retain = range(10,200), new_filename='5AXNedit.cif')


# ........................................ Edit chain: remove a list of residues
StructureHH.chain_shrinking('5AXN.cif', chain='A', resi_to_remove = range(10,200), new_filename='5AXNedit.cif')


# ........................................ Duplicate a residue
StructureHH.duplicate_residue( '5AXN.cif', initial_chain_resi = ['A', 304], new_filename='5AXNedit.cif', verbose = True)

# ........................................ Edit residue: re-assign and rename
StructureHH.edit_residue('5AXN.cif', initial_chain_resi = ['A', 304], new_chain_resi = ['L', 1], new_resname = 'LIG', new_filename = '5AXNedit.cif')


# ........................................ Edit residue: remove certain atoms
StructureHH.edit_residue('5AXN.cif', initial_chain_resi = ['A', 304], remove_atoms = ["O2'", "O3'"], new_filename = '5AXNedit.cif')


# ........................................ ATOM to HETATM (some AI tools only consider HETATM as ligand)
StructureHH.atom_to_hetatm('5AXN.cif', chain_id = 'P', new_filename='5AXNedit.cif')
```
