Anyone interested in using Python for Biomodelling. The material in this workshop will help you get the most out of the other workshops run during the week.
Basic knowledge of Python e.g. as in https://chryswoods.com/beginning_python
This workshop will introduce more intermediate features of Python that are useful for biomolecular modellers. This will include the use of Jupyter notebooks, how to write Python functions and classes, and how to properly structure, document and test code. The second part will introduce you to data analysis tools such as Pandas, NumPy and MatplotLib.
The workshop consists of a series of Jupyter notebooks. These are available below, and can be run using the workshop Jupyter server.
Once you have started the server, navigate to the python_and_data
directory
and you will find all workshop material there.
The workshops are numbered sequentially from 01_jupyter_howto.ipynb
to
17_regular_expressions.ipynb
. They cover a variety of useful Python topics,
and are mostly independent. Feel free to go through them in the order you
prefer, and to skip topics that you feel you are already comfortable with.
There are exercises in many of the topics. You can find answers in the
equivalent notebook in the answers
directory.
Below is a summary of each topic, together with links to view html versions of the notebooks the their answers, and to download the notebooks.
Introduction to Jupyter notebooks, including how to use the interface, how to view molecules, draw graphs, download files, and start a bash terminal.
Learn how to use Python Lists
Learn how to use Python dictionaries
Learn how to write a function in Python
Learn about objects and object orientated programming
Learn how to write your own Python classes
Learn how to add documentation to your code
Learn how to document Python classes, and protect hidden (private) functions and data from view.
Learn about exceptions, and how they can be used to signify errors.
Learn how to handle errors by catching exceptions
Learn how to package and share your code as a module
Learn how to use the pandas library for data analysis
Learn how to use the NumPy library for numeric calculation
Learn more about how to use NumPy, including understanding copies and views
Learn how to use the pandas with the MatPlotLib library to draw graphs
Learn how to use the nglview and BioSimSpace libraries to create 3D views of molecules.
Learn how to understand and write regular expressions for text/pattern matching.