Skip to content

Commit

Permalink
Merge pull request #52 from jmborr/51_update_docs_data_repo
Browse files Browse the repository at this point in the history
modify docs to instruct how to download the data repository
  • Loading branch information
jmborr authored Apr 13, 2018
2 parents 4196c1e + 695a8e1 commit cf17385
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 5 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
History
=======

0.1.5 ()
--------

* Update notebook and docs with data repo (PR #51)

0.1.4 (2018-02-11)
------------------

Expand Down
Binary file added docs/images/data_download_ascii_file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/data_download_file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/data_download_zip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 40 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To install idpflex, run this command in your terminal:
$ pip install idpflex
This is the preferred method to install idpflex, as it will always install the most recent stable release.
This is the preferred method to install idpflex, as it will always install the most recent stable release.

If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process.
Expand Down Expand Up @@ -49,3 +49,42 @@ Once you have a copy of the source, you can install it with:
.. _Github repo: https://github.com/jmborr/idpflex
.. _tarball: https://github.com/jmborr/idpflex/tarball/master


Testing & Tutorials Data
------------------------

The external repository `idpflex_data <https://github.com/jmborr/idpflex_data>`
contains all data files used in testing, examples, and tutorials.
There are several ways to obtain this dataset:

1. Clone the repository with a git command in a terminal:

.. code :: bash
cd some/directory/
git clone https://github.com/jmborr/idfplex_data.git
2. Download all data files as a zip file using GitHub's web interface:

.. image:: images/data_download_zip.png
:width: 800px
:align: center
:alt: download dataset as zipped file

3. Download individual files using GitHub's web interface by browsing to the
file. If the file is in binary format, then click in Download button:

.. image:: images/data_download_file.png
:width: 800px
:align: center
:alt: download dataset as zipped file

If the file is in ASCII format, you must first click in the `Raw` view. After
this you can right-click and `Save as`.

.. image:: images/data_download_ascii_file.png
:width: 800px
:align: center
:alt: download dataset as zipped file

39 changes: 37 additions & 2 deletions notebooks/.ipynb_checkpoints/hiAPP_clustering-checkpoint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"import matplotlib.pyplot as plt\n",
"plt.ion()\n",
"\n",
"import os\n",
"import sys\n",
"import subprocess\n",
"import numpy as np\n",
Expand All @@ -46,6 +47,39 @@
"from idpflex.bayes import fit_to_depth"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Donwload Data\n",
"\n",
"It's assumed <code>git</code> is installed in your system. Otherwise,\n",
"[follow instructions](http://idpflex.readthedocs.io/en/latest/installation.html#testing-tutorials-data)\n",
"to download and unpack your data to <code>/tmp/idpflex_data</code>."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%bash\n",
"idpflex_data_dir=\"/tmp/idpflex_data\"\n",
"git clone https://github.com/jmborr/idpflex_data ${idpflex_data_dir}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"idpflex_data_dir = '/tmp/idpflex_data'\n",
"data_dir = os.path.join(idpflex_data_dir, 'data', 'simulation')\n",
"print(data_dir)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -61,7 +95,8 @@
},
"outputs": [],
"source": [
"simulation = mda.Universe('../tests/data/simulation/hiAPP.pdb', '../tests/data/simulation/hiAPP.xtc')\n",
"simulation = mda.Universe(os.path.join(data_dir, 'hiAPP.pdb'),\n",
" os.path.join(data_dir, 'hiAPP.xtc'))\n",
"print('Number of frames in trajectory is ', simulation.trajectory.n_frames)"
]
},
Expand Down Expand Up @@ -449,7 +484,7 @@
"source": [
"node_ids = [188, 190, 192] # ID's for the clusters matching the experimental profile \n",
"for id in node_ids:\n",
" pdb_list = [pdb_names[leaf_id) for leaf_id in cl.tree[id].leaf_ids]\n",
" pdb_list = [pdb_names[leaf_id] for leaf_id in cl.tree[id].leaf_ids]\n",
" open('/tmp/node{}_pdblist.txt'.format(id), 'w').write('\\n'.join(pdb_list))"
]
},
Expand Down
39 changes: 37 additions & 2 deletions notebooks/hiAPP_clustering.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"import matplotlib.pyplot as plt\n",
"plt.ion()\n",
"\n",
"import os\n",
"import sys\n",
"import subprocess\n",
"import numpy as np\n",
Expand All @@ -46,6 +47,39 @@
"from idpflex.bayes import fit_to_depth"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Donwload Data\n",
"\n",
"It's assumed <code>git</code> is installed in your system. Otherwise,\n",
"[follow instructions](http://idpflex.readthedocs.io/en/latest/installation.html#testing-tutorials-data)\n",
"to download and unpack your data to <code>/tmp/idpflex_data</code>."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%bash\n",
"idpflex_data_dir=\"/tmp/idpflex_data\"\n",
"git clone https://github.com/jmborr/idpflex_data ${idpflex_data_dir}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"idpflex_data_dir = '/tmp/idpflex_data'\n",
"data_dir = os.path.join(idpflex_data_dir, 'data', 'simulation')\n",
"print(data_dir)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -61,7 +95,8 @@
},
"outputs": [],
"source": [
"simulation = mda.Universe('../tests/data/simulation/hiAPP.pdb', '../tests/data/simulation/hiAPP.xtc')\n",
"simulation = mda.Universe(os.path.join(data_dir, 'hiAPP.pdb'),\n",
" os.path.join(data_dir, 'hiAPP.xtc'))\n",
"print('Number of frames in trajectory is ', simulation.trajectory.n_frames)"
]
},
Expand Down Expand Up @@ -449,7 +484,7 @@
"source": [
"node_ids = [188, 190, 192] # ID's for the clusters matching the experimental profile \n",
"for id in node_ids:\n",
" pdb_list = [pdb_names[leaf_id) for leaf_id in cl.tree[id].leaf_ids]\n",
" pdb_list = [pdb_names[leaf_id] for leaf_id in cl.tree[id].leaf_ids]\n",
" open('/tmp/node{}_pdblist.txt'.format(id), 'w').write('\\n'.join(pdb_list))"
]
},
Expand Down

0 comments on commit cf17385

Please sign in to comment.