LatticePy


NameLatticePy JSON
Version 0.1.3 PyPI version JSON
download
home_page
SummaryA package for simulating molecules on a lattice.
upload_time2023-09-01 17:31:39
maintainer
docs_urlNone
authorSohit Miglani
requires_python
licenseMIT
keywords proteins simulation lattice
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LatticePy
A python package for MCMC simulations of folding and phase separation in biomolecules on a lattice. LatticePy currently supports the simulation of amino acids and protein polymers on a lattice with any given number of units.

## Installation

### Stable Release
Run the following command in bash (Not on PyPi yet) :

```bash
pip3 install LatticePy
```

### Developers Release
Run the following command in bash:

```bash
pip3 install git+https://github.com/sohitmiglani/LatticePy#egg=LatticePy
```

## Tutorial

### - Import the package and initialize the lattice. You can customize the bounds of the lattice, the compactness energy, the beta (1/Temperature), and the lattice type.
```python
from LatticePy import lattice
mylattice = lattice(bound=50, E_c=1.5, beta=0, lattice_type='simple_cubic')
```

### - Add your polymer

- By a list of polarities
```python
polymer = [-1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1]
mylattice.add_polymer(polymer, n_polymers=1, placement='straight') # to add it in a straight line
mylattice.add_polymer(polymer, n_polymers=1, placement='randomly') # to add it in a random fashion which may cause knots
```

- By sequence
```python
sequence = 'MTKSHSEEVIVPEFNSSAKELPRPLAEKCPSIIKKFISAYDAKPDFVARSPGRVNLIGEH'
mylattice.add_protein(sequence, type='straight', n_polymers=1)
```
### - Simulate your polymers with annealing

Change the parameters as you see fit
```python
mylattice.simulate(n_mcmc=200000, 
                   interval=1000, 
                   record_intervals = True, 
                   anneal=True, 
                   beta_lower_bound=0, 
                   beta_upper_bound=2, 
                   beta_interval=0.05)
```

### - Visualize the energy variation over all the MCMC steps

```python
mylattice.energy_variation_graph()
```
![](static/energy_variation_graph.png)

### - Visualize in an interactive 3-D lattice

```python
mylattice.visualize()
```

You can see the interactive 3-D lattice for this run <a href="https://www.sohitmiglani.com/LatticePy_figure" 
                                                        target="_blank" rel="noopener noreferrer">here.<a/>

### - Get important statistics

```python
mylattice.native_contacts
```
20

```python
mylattice.energy
```
-58.7

```python
mylattice.non_covalent_hydrophobic_contacts
```
9

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "LatticePy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "proteins,simulation,lattice",
    "author": "Sohit Miglani",
    "author_email": "sohitmiglani@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/17/4d/1b6960fa72d16bd93a23de3c1e84d1eea08e7adab1e5a0c5e3762f4b5884/LatticePy-0.1.3.tar.gz",
    "platform": null,
    "description": "# LatticePy\nA python package for MCMC simulations of folding and phase separation in biomolecules on a lattice. LatticePy currently supports the simulation of amino acids and protein polymers on a lattice with any given number of units.\n\n## Installation\n\n### Stable Release\nRun the following command in bash (Not on PyPi yet) :\n\n```bash\npip3 install LatticePy\n```\n\n### Developers Release\nRun the following command in bash:\n\n```bash\npip3 install git+https://github.com/sohitmiglani/LatticePy#egg=LatticePy\n```\n\n## Tutorial\n\n### - Import the package and initialize the lattice. You can customize the bounds of the lattice, the compactness energy, the beta (1/Temperature), and the lattice type.\n```python\nfrom LatticePy import lattice\nmylattice = lattice(bound=50, E_c=1.5, beta=0, lattice_type='simple_cubic')\n```\n\n### - Add your polymer\n\n- By a list of polarities\n```python\npolymer = [-1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1]\nmylattice.add_polymer(polymer, n_polymers=1, placement='straight') # to add it in a straight line\nmylattice.add_polymer(polymer, n_polymers=1, placement='randomly') # to add it in a random fashion which may cause knots\n```\n\n- By sequence\n```python\nsequence = 'MTKSHSEEVIVPEFNSSAKELPRPLAEKCPSIIKKFISAYDAKPDFVARSPGRVNLIGEH'\nmylattice.add_protein(sequence, type='straight', n_polymers=1)\n```\n### - Simulate your polymers with annealing\n\nChange the parameters as you see fit\n```python\nmylattice.simulate(n_mcmc=200000, \n                   interval=1000, \n                   record_intervals = True, \n                   anneal=True, \n                   beta_lower_bound=0, \n                   beta_upper_bound=2, \n                   beta_interval=0.05)\n```\n\n### - Visualize the energy variation over all the MCMC steps\n\n```python\nmylattice.energy_variation_graph()\n```\n![](static/energy_variation_graph.png)\n\n### - Visualize in an interactive 3-D lattice\n\n```python\nmylattice.visualize()\n```\n\nYou can see the interactive 3-D lattice for this run <a href=\"https://www.sohitmiglani.com/LatticePy_figure\" \n                                                        target=\"_blank\" rel=\"noopener noreferrer\">here.<a/>\n\n### - Get important statistics\n\n```python\nmylattice.native_contacts\n```\n20\n\n```python\nmylattice.energy\n```\n-58.7\n\n```python\nmylattice.non_covalent_hydrophobic_contacts\n```\n9\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A package for simulating molecules on a lattice.",
    "version": "0.1.3",
    "project_urls": null,
    "split_keywords": [
        "proteins",
        "simulation",
        "lattice"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f837f3bd6fd1d99d9eab8dda4a9586662b3f6dc63fb38b31d21f34a38d39e79c",
                "md5": "f740298d1139f3c25b52c527f3347f30",
                "sha256": "7ff24aecb2af5b97029065d187e3c6b488c500cba88e0606a14b14035989f514"
            },
            "downloads": -1,
            "filename": "LatticePy-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f740298d1139f3c25b52c527f3347f30",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10130,
            "upload_time": "2023-09-01T17:31:38",
            "upload_time_iso_8601": "2023-09-01T17:31:38.167832Z",
            "url": "https://files.pythonhosted.org/packages/f8/37/f3bd6fd1d99d9eab8dda4a9586662b3f6dc63fb38b31d21f34a38d39e79c/LatticePy-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "174d1b6960fa72d16bd93a23de3c1e84d1eea08e7adab1e5a0c5e3762f4b5884",
                "md5": "b19bc01d2455ed91656334131d7a2740",
                "sha256": "007257fd0522bf8a94049ddc12e14493d062bce2103c83b5d944204941ec1ec0"
            },
            "downloads": -1,
            "filename": "LatticePy-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b19bc01d2455ed91656334131d7a2740",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 9836,
            "upload_time": "2023-09-01T17:31:39",
            "upload_time_iso_8601": "2023-09-01T17:31:39.707861Z",
            "url": "https://files.pythonhosted.org/packages/17/4d/1b6960fa72d16bd93a23de3c1e84d1eea08e7adab1e5a0c5e3762f4b5884/LatticePy-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-01 17:31:39",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "latticepy"
}
        
Elapsed time: 0.10102s