Metadata-Version: 2.4
Name: biochemHH
Version: 0.0.6
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==0.0.6
```

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

Activate the environment, replace `C:\biochemHH_work` in the first line with your desired working directory, and run the code in Windows CMD. The folder will be created if it does not exist, and the example files will be copied into it.

```
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.copy2(f,d/f.name) for n in ('example_input','example_script') for f in (p/n).rglob('*') if f.is_file() and f.suffix.lower() in ('.pdf','.gb','.py','.csv')]; print('Copied all matching files 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.

**4. Examples**

**4.1 Batch-mode cloning design**

```python
"""
Six types of variations are supported:
	1-aa substitution, e.g.,    R13A or 13A
	1-aa deletion, e.g.,        28del
	1-aa insertion, e.g.,       90~91insE
	multi insertions, e.g.,     101~102insEAT
	multi deletion, e.g.,       130~135del
	deletion & insertion, e.g., 140~142delinsAAG'
	Multiple variations can be joined by '_' to form a notation for a plasmid.
"""

from biochemHH import GBparser

notations = ['_R13A_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 is 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 an example input `pUCv2-cat.gb` have been copied into your working directory in step 3.

**4.2 Analyze noncovalent interactions**

```python
""" 
To specify a target_string:
	A:      A chain all residues
	P2:     P chain resi 2
	B1~23:  B chain resi 1~23
	These can be joined by space, forming target_string =  "A P2 B1~23"

To specify the chain to analyze against (coi):
	coi = ['A', 'B']    # analyze the target against all residues in chain A and B
	coi = []            # analyze the target against all residues in all chains
"""

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
"""
If '5AXN.cif' does not already exist in the working directory, either command will automatically download it from RCSB database.
"""

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')
```
