<jupyter_start><jupyter_text>MCCE program template*By <NAME> *Feel free to use this template to run pKa calculation with MCCE.A complete documentation is at https://gunnerlab.github.io/Stable-MCCE/  Prepare the running environmentMCCE program needs to know where mcce executables are. This part set the environment.Change MCCE_PATH to your installation folder unless you run this on Levich server.<jupyter_code># Point this to your MCCE installation directory 
MCCE_PATH = "/home/mcce/Stable-MCCE"
import sys
import os
import subprocess

# Add to environment PATH
os.environ["PATH"] = "%s/bin/:%s" % (MCCE_PATH, os.environ["PATH"])
# Add to Python PATH
sys.path.insert(0, "%s/bin" % MCCE_PATH)<jupyter_output><empty_output><jupyter_text>Get the pdb fileYou can download from PDB like in this example, or upload a file to this directory.<jupyter_code>!getpdb 4lzt<jupyter_output><empty_output><jupyter_text>Step 1. Convert PDB file into MCCE PDBThis step proof reads the structure file and cut terminal residues and complex cofactors into smaller ones if necessary.<jupyter_code>!step1.py 4LZT.pdb<jupyter_output><empty_output><jupyter_text>Step 2. Make side chain conformersThis step makes alternative side chain locations and ionization states.<jupyter_code>!step2.py<jupyter_output><empty_output><jupyter_text>Step 3. Make energy tableThis step calculates conformer self energy and pairwise interaction table.You can run step 3 assuming the protein has dielectric constant 4 or 8. Small proteins have mor ploar and ionizable residues so  dielectric constant 8 is often better.**This step may take hours, please be patient.**<jupyter_code>!step3.py

# Use this line for dielectric constant 8
#!step3.py -d 8<jupyter_output><empty_output><jupyter_text>Step 4. Simulate a titration with Monte Carlo samplingThis step simulates a titration and writes out the conformation and ionization states of each side chain at various conditions.Use command```step4.py --xts```if you want entropy correction, which makes ionized and neutral groups of conformers have an equal chance to be sampled.Or```step4.py```without entropy correction.<jupyter_code>!step4.py --xts
#!step4.py<jupyter_output><empty_output><jupyter_text>Check the results * The occupancy table is in file fort.38.* The net charge is in file sum_crg.out* pKas are in file pK.out<jupyter_code>#check calculated pKa values
!cat pK.out 
#Checkcomformer occupancy
!cat fort.38
#checkresidue charges
!cat sum_crg.out<jupyter_output><empty_output><jupyter_text>Fit the titration curveUse the residue IDs in sum_crg.out or pK.out, pass to fitpka function, you can get a fitted titration curves.<jupyter_code>import fitpka
fitpka.fitpka(["GLU-A0035_", "ASP-A0066_"])<jupyter_output><empty_output><jupyter_text>Show major influencers to a residue pKaUse mfe.py to see all terms that contribute to the ionization free energy. https://gunnerlab.github.io/Stable-MCCE/tools/mfepy<jupyter_code>!mfe.py GLU-A0035_ -c 0.1<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07954545454545454, 'fraction_numerical': 0.01303475935828877, 'mean_word_length': 6.126190476190477, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '599133', 'license': 'MIT', 'n_tokens_mistral': 991, 'n_tokens_neox': 942, 'n_words': 329, 'path': 'wiki/docs/files/mcce.ipynb', 'repo_name': 'umeshkhaniya/Stable-MCCE', 'size': '2996'}