Loading Events

« All Events

ONLINE COURSE – Advanced Python for Ecologists and Evolutionary Biologists (APYB01) This course will be delivered live

14 July 2025 - 17 July 2025

£480.00
ONLINE COURSE – Advanced Python for Ecologists and Evolutionary Biologists (APYB01) This course will be delivered live

Event Date

Monday, 14th June, 2025

Course Format

This is a ‘LIVE COURSE’ – the instructors will be delivering lectures and coaching attendees through the accompanying computer practical’s via video link, a good internet connection is essential.

COURSE PROGRAM

TIME ZONE – UK (GMT+1) local time – however all sessions will be recorded and made available allowing attendees from different time zones to follow.

Please email oliverhooker@prstatistics.com for full details or to discuss how we can accommodate you.

About This Course

Python is a dynamic, readable language that is a popular platform for all types of  bioinformatics work, from simple one-off scripts to large, complex  software projects. This workshop aims to give novice programmers an introduction to using Python for research in evolutionary biology and genomics by using biological examples throughout. We will use example datasets and problems themed around sequence analysis, taxonomy and ecology, with plenty of time for participants to work on their own research data.

  1.  Learning about advanced language features (recursion, complex data structures, comprehensions, exceptions) that are relevant to bioinformatics work
  2.  Learning about development tools (benchmarking, profiling, unit testing) that can make it easier for us to write code that is both *fast* and *correct*
  3.  Learning about different programming styles and concepts (object-oriented programming, functional programming) that are suitable for different kinds of problems.

The workshop will use examples and exercises drawn from various aspects of bioinformatics work. After completing the workshop, students should be in a position to (1) take advantage of the advanced language features in their own programs and (2) use appropriate tools when developing software programs. They will also have a deeper understanding of how Python works internally, which will be invaluable when making sense of existing code and packages.

Intended Audiences

This course is designed for people who already know some Python and who are interested in tackling more ambitious programs, particularly ones that will deal with large or complex datasets and will therefore need to work efficiently. Students should have a basic biological background (or be prepared to ask a lot of questions!) as the examples and exercises assume some knowledge of what DNA is, what is meant by gene expression, how to read a phylogenetic tree, etc.

ThIS course is **NOT** suitable for complete beginners to Python as we will assume quite a lot of
knowledge of the basic syntax of the language. The material covered in the Introduction to Python for Biologists course is a suitable background. If you are not sure about whether the course is suitable for you please  email martin@pythonforbiologists.com and I will help you figure it out.

Venue

Delivered remotely

Course Details

Time zone – UK (GMT+1) local time

Availability – 20

Duration – 4 days, 8 hours per day

Contact hours – Approx. 28 hours

ECT’s – Equal to 3 ECT’s

Language – English

Teaching Format

Lectures/discussions of Python code, libraries and techniques delivered using interactive
notebooks. Workshop/practical time for students to tackle carefully designed programming
challenges that use the material from the discussion sessions. Usually followed up by
discussion of solutions, wrap up and summarisation.

Assumed quantative knowledge

Only descriptive statistics; the sections on performance require us to be comfortable discussing means and standard deviations.

Assumed computer background

This course assumes a background knowledge of Python syntax, so is not suitable for complete beginners to programming. If you have any questions about whether the course is suitable, don’t hesitate to email martin@pythonforbiologists.com to chat.

Equipment and software requirements
A laptop computer with a working version of Python is required. Python is free and open-source software for PCs, Macs, and Linux computers.
 
Participants should be able to install additional software on their computers during the course (please ensure you have administration rights to your computer).

Although not absolutely necessary, a large monitor and a second screen could improve the learning experience. Participants are also encouraged to keep their webcams active to increase their interaction with the instructor and other students.

Download Python

 

 

Tickets

The numbers below include tickets for this event already in your cart. Clicking "Get Tickets" will allow you to edit any existing attendee information as well as change ticket quantities.
APYB01 ONLINE
APYB01 ONLINE
£ 480.00
20 available

PLEASE READ – CANCELLATION POLICY

Cancellations are accepted up to 28 days before the course start date subject to a 25% cancellation fee. Cancellations later than this may be considered, contact oliverhooker@prstatistics.com. Failure to attend will result in the full cost of the course being charged. In the unfortunate event that a course is cancelled due to unforeseen circumstances a full refund of the course fees will be credited

If you are unsure about course suitability, please get in touch by email to find out more oliverhooker@prstatistics.com

COURSE PROGRAMME

Monday 14th

Day 1  – Classes form 09:30 – 17:30

Session 1 : Recursion and trees

  • In this session we will cover two very closely related concepts: trees (i.e. the various ways that we can store hierarchical data) and recursive functions (the best way to operate on treelike data). As recursion is inherently confusing, ww will start with a gentle introduction using biological examples before moving on to consider a number of core tree algorithms concerning parents, children, and common ancestors. In the practical session we'll look in detail at one particular way of identifying the last common ancestor of a group of nodes, which will give us an opportunity to explore the role of recursion. Core concepts introduced: nested lists, storing hierarchical data, recursive functions, relationship between recursion and iteration.

Session 2 : Complex data structures

  • In this session we will briefly recap Python’s basic data structures, before looking at a couple of new data types — tuples and sets — and discussing where each should be used. We will then see how we can combine these basic types to make more complex data structures for solving specific problems. We will finish our discussion by looking at specialized data types that are found in the Python core library. This session will also be our first introduction to benchmarking as we talk about the relative performance of different data types. In the practical session we will learn how to parse an input file into a complex data structure which we can then use to rapidly query the data. Core concepts introduced: tuples, sets, higher-order data structures, default dicts, Counters, big-O notation.
Tuesday 15th

Day 2  – Classes form 09:30 – 17:30

Session 3 : Classes and objects

  • In this session we will introduce the core concepts of object-oriented programming, and see how the data types that we use all the time in Python are actually examples of classes. We'll take a very simple example and use it to examine how we can construct our own classes, moving from an imperative style of programming to an object-oriented style. As we do so, we'll discuss where and when object-orientation is a good idea. In the practical we will practise writing classes to solve simple biological problems and familiarize ourselves with the division of code into library and client that object-oriented programming demands. Core concepts introduced: classes, instances, methods vs. functions, self, constructors, magic methods.

Session 4 : Object-oriented programming

  • Following on from the previous session, we will go over some advanced ideas that are common to most object-oriented programming languages. For each idea we'll discuss the basic concept, the scenarios in which it's useful, and the details of how it works in Python. This overview will also allow us to consider the challenges involved in designing object-oriented code. In the practical we will work on a simulation which will involve multiple classes working together. Core concepts introduced: inheritance and class hierarchies, method overriding, superclasses and subclasses, polymorphism, composition, multiple inheritance.
Wednesday 16th

Day 3 – Classes from 09:30 – 17:30

Session 5 : Functional programming in Python

  • This session will start with a look at a few different concepts that are important in functional
    programming, culminating in a discussion of the idea of state and its role in program design. We will see how functional programming is, in many ways, the complement of object-oriented programming and how that realization informs our decision about when to use each approach. We will take a quick tour of Python's built in tools that take advantage of functional programming and see how we can build our own. We will finish with a brief look at how functional programming can vastly simplify the writing of parallel code. In the practical, we will practise using Python's built in functional tools, then implement one of our own. Core concepts introduced: state and mutability, side effects, first-class functions, declarative programming, lazy evaluation, parallelism, higher-order functions.

Session 6 : Exception handling

  • This session will start with a reminder of the difference between syntax errors and exceptions, after which we will explore the syntax involved in catching and handling exceptions. We will then examine the way that exceptions can be handled in multiple places and the consequences for program design. We will finish this session by learning how we can take advantage of Python’s built in exception types to signal problems in our own code, and how we can create custom exception types to deal with specific issues. In the practical we will modify existing code to make use of exceptions. Core concepts introduced: exception classes, try/except/else/finally blocks, context managers, exception bubbling, defining and raising exceptions.
Thursday 17th

Day 4 – Classes form  09:30 – 17:30

Session 7 : Performance optimization

  • In this session we will learn about the various tools Python has for benchmarking code (i.e. measuring its memory and runtime performance) and for profiling code (identifying areas where improvements can be made). We will see that different tools are useful in different scenarios, and collect a set of recommendations for improving program performance. We will use these tools to illustrate and measure points about performance that have been made through the course. In the practical, we will take real-life code examples, measure their performance, and try to improve it. Core concepts introduced: function profiling, line profiling, profiler overhead, timing.

Session 8 : Unit testing

  • In this session we will begin with a gentle introduction to testing which will illustrate why it is useful and what type of problems it can solve. We will run through a series of examples using Python’s built in testing tools which will cover a number of different testing scenarios. We will then implement the same set of tests using the pytest testing framework and examine how using a framework makes the tests easier to write and interpret. After looking at a number of specialized tests for different types of code, we will discuss the impact of program design on testing. In the practical we will practise building and running test suites for existing code.

Dr. Martin Jones
Dr. Martin Jones

Martin a freelance trainer specialising in teaching programming (mostly Python) and Linux skills to researchers in the field of biology. He trained as a biologist and completed his PhD in large-scale phylogenetics in 2007, then held a number of academic positions at the University of Edinburgh ending in a two year stint as Lecturer in Bioinformatics. I launched Python for Biologists in 2015 and have been teaching and writing full-time ever since.

Details

Start:
14 July 2025
End:
17 July 2025
Cost:
£480.00
Event Categories:
, ,

Venue

Delivered remotely (United Kingdom)
Western European Time Zone, United Kingdom

Tickets

The numbers below include tickets for this event already in your cart. Clicking "Get Tickets" will allow you to edit any existing attendee information as well as change ticket quantities.
APYB01 ONLINE
APYB01 ONLINE
£ 480.00
20 available