Skip to content

Commit

Permalink
Merge pull request #102 from dprada/main
Browse files Browse the repository at this point in the history
Make biossemblies and merge fixed. Function names changed.
  • Loading branch information
dprada authored Apr 6, 2023
2 parents 1bffaf6 + a4d0bbd commit da8dabd
Show file tree
Hide file tree
Showing 282 changed files with 6,271 additions and 1,592 deletions.
40 changes: 11 additions & 29 deletions .github/workflows/sphinx_docs_to_gh_pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,45 +27,27 @@ jobs:
- name: Setup GNU Fortran
uses: modflowpy/install-gfortran-action@v1 # https://github.com/modflowpy/install-gfortran-action

- name: Make conda environment
uses: conda-incubator/setup-miniconda@v2 # https://github.com/conda-incubator/setup-miniconda
- name: Setup conda env
uses: mamba-org/provision-with-micromamba@main
with:
python-version: 3.9
environment-file: devtools/conda-envs/docs_env.yaml
#mamba-version: "*"
#use-mamba: true
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
activate-environment: test
environment-name: docs
channels: uibcdf, conda-forge, ambermd, defaults

#- name: Setup conda env
# uses: mamba-org/provision-with-micromamba@main
# with:
# environment-file: devtools/conda-envs/docs_env.yaml
# environment-name: docs
# channels: uibcdf, conda-forge, ambermd, defaults

# extra-specs: |
# python=="3.9"
extra-specs: |
python=="3.9"
- name: Install package

shell: bash -l {0}
run: |
python setup.py develop
#- name: Info conda
# shell: bash -l {0}
# run: |
# micromamba info
# micromamba list
- name: Info conda
shell: bash -l {0}
run: |
conda info
conda list
- name: Info conda
shell: bash -l {0}
run: |
micromamba info
micromamba list
- name: Test import module
shell: bash -l {0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "4486ce37-5967-47a7-84eb-3493a59fb55b",
"metadata": {},
"source": [
"# Polyglot Selection"
"# Atoms Selection"
]
},
{
Expand Down Expand Up @@ -41,7 +41,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
254 changes: 254 additions & 0 deletions docs/contents/about/showcase/Thirds.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import molsysmt as msm\n",
"import nglview as nv\n",
"import warnings\n",
"warnings.filterwarnings('ignore')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Working with thirds"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Working with NGLView"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"molsys = msm.convert([nv.datafiles.GRO, nv.datafiles.XTC], to_form='molsysmt.MolSys')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"view = nv.show_molsysmt(molsys, standardize=True, viewer='NGLView')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"view"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.info(view)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.get(view, element='group', indices=[81, 82, 83], name=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.get(view, element='system', n_structures=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.get(view, element='atom', selection='atom_name==\"CA\"', coordinates=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.get(view, element='system', box=True) # Warning: only 1 frame"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.is_composed_of(view, proteins=1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.select(view, selection='atom_name==\"CA\" and group_name==\"LYS\"')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.select(view, selection='atom_name==\"CA\" and group_name==\"LYS\"', to_syntax='nglview')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.select(view, element='group', selection='group_name==\"LYS\"', to_syntax='nglview')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"contact_map = msm.structure.get_contacts(view, selection='molecule_type==\"protein\" and atom_name==\"CA\"', threshold='12 angstroms')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from matplotlib import pyplot as plt\n",
"plt.imshow(contact_map[10], cmap='Greys', origin='lower')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.convert(view, to_form='string:aminoacids1')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"molsys_A = msm.build.build_peptide(['AceAlaNME',{'forcefield':'AMBER14', 'implicit_solvent':'OBC1'}])\n",
"molsys_B = msm.structure.translate(molsys_A, translation='[0.5, 0.0, 0.0] nm')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"view1 = msm.convert(molsys_A, to_form='nglview.NGLWidget')\n",
"view2 = msm.view(molsys_B)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"view = msm.merge([view1, view2])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.info(view)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"view = msm.concatenate_frames([view1, view2])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msm.info(view)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
5 changes: 2 additions & 3 deletions docs/contents/about/showcase/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Quickstart_guide.ipynb
Barnase_Barstar.ipynb
Polyglot_selection.ipynb
OpenMM.ipynb
NGLView.ipynb
Selection.ipynb
Thirds.ipynb
```
7 changes: 7 additions & 0 deletions docs/contents/user/demo/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Demo Systems

```{eval-rst}
.. toctree::
:maxdepth: 2
```
Loading

0 comments on commit da8dabd

Please sign in to comment.