Regular Expressions & Python

Who: Tiffany Timbers, lead instructor.

When: February 17, 2016

Times: 9:15am-12:15pm PST

Where: SFU Location: SSB 8114, Simon Fraser University, Burnaby Campus UC Davis Location: DSI Space, Shields Library, UC Davis campus

Contact: Please contact Tiffany Timbers with any questions on content or SFU matters.

Contact Jessica Mizzi with UC Davis matters.

Description

This half-day workshop will introduce the topic of regular expressions (using patterns to match strings) and how it can be implemented in the programming language Python.

We will explore examples of using regular expressions find transcription factor binding sites and to find regions of phage DNA (spacers) in bacterial genomes - key parts of the CRISPR bacterial immune system. We will also explore how to build a test suite for regular expression searches to ensure the regular expression pattern matching is accurate.

Installation instructions

Please install Python version 3 or higher. Python is a popular language for scientific computing, and great for general-purpose programming as well. Installing all of its scientific packages individually can be a bit difficult, so we recommend Anaconda, an all-in-one installer. We also will be using the Python screed package. After installing Python (detailed instructions below), you can install screed by going to the command line/terminal and typing: pip install screed

This session will be taught using the IPython notebook, a programming environment that runs in a web browser. For this to work you will need a reasonably up-to-date browser. The current versions of the Chrome, Safari and Firefox browsers are all supported (some older browsers, including Internet Explorer version 9 and below, are not).

Windows

  1. Open http://continuum.io/downloads with your web browser.
  2. Download the Python 3 installer for Windows.
  3. Install Python 3 using all of the defaults for installation except make sure to check Make Anaconda the default Python.

Mac OS X

  1. Open http://continuum.io/downloads with your web browser.
  2. Download the Python 3 installer for OS X.
  3. Install Python 3 using all of the defaults for installation.

Linux

  1. Open http://continuum.io/downloads with your web browser.
  2. Download the Python 3 installer for Linux.
  3. Install Python 3 using all of the defaults for installation. (Installation requires using the shell). If you aren’t comfortable doing the installation yourself stop here and request help at the workshop.)
  4. Open a terminal window.
  5. Type bash Anaconda- and then press tab. The name of the file you just downloaded should appear.
  6. Press enter. You will follow the text-only prompts. When there is a colon at the bottom of the screen press the down arrow to move down through the text. Type “yes” and press enter to approve the license. Press enter to approve the default location for the files. Type “yes” and press enter to prepend Anaconda to your PATH (this makes the Anaconda distribution the default Python).

LICENSE: This documentation and all textual/graphic site content is licensed under the Creative Commons - 0 License (CC0) -- fork @ github. Presentations (PPT/PDF) and PDFs are the property of their respective owners and are under the terms indicated within the presentation.