Python and C
In early October 2006 I lectured at the University of Stellenbosch on how to make C and Python work together, various ways to parse files, and more.
Programming for Bioinformatics in Python
At the end of July 2006 I taught an intense two week NBN course
titled "Modern Web Applications Development for Bioinformatics" and
based on the TurboGears framework. Here are the lecture notes.
Programming for Bioinformatics in Python
In August-September of 2005 I taught an intermediate level programming
course at the NBN (National
Bioinformatics Network) in South Africa. Here are the various notes
and assignments for the course.
- Parsing FASTA files,
Assignment #1
(data files simple.fasta,
fasta_reader.py,
br_sequences.fasta,
swissprot.dat)
- BLAST output parsing,
Assignment #2
(data files blastp.txt,
blast_parser.py)
- BLAST searching
- Making hydrophobicity plots
(data files bacteriorhodopsin.fasta,
fasta_reader.py,
data/savitzky_golay.py)
- The Monday (22 August) lecture is on chemical nomenclature and will cover my essays
Afterwords I'll describe the SMILES
molecular line notation and its extension to molecular reations using
SMIRKS.
I'll describe the subgraph matching problem and describe SMARTS patterns.
The exercises will be based on the on-line demos available from Daylight and OpenEye.
The network is down now so I'll have to work on it during the breaks tomorrow.
- Assignment #3 (chemical informatics)
- The Tuesday (23 August) chemical informatic lecture will cover
ways to compare two molecules, with an emphasis on
molecular fingerprints. This will lead into a discussion on chemical databases.
- The Wednesday Python lecture – Parsing GenBank
Assignment #4 (Python)
(data files br_plot.py,
bacteriorhodopsin.fasta,
br.gp,
1Z9KA.gp)
- Assignment 5 (chemical informatics)
- The Wednesday chemical informatics lecture will cover the
PyDaylight and
OpenEye toolkits
- Some information about chemical databases
which examples taken from gNova's
CHORD extension to PostgreSQL.
- A short lecture on list comprehensions
- Usability, day 1, August 29
- For the Python lecture for August 29 I'll talk about Python
generators. I'll make sure everyone
has CherryPy installed on their machines
and walk through the tutorial.
More advanced programmers may want to read the
IBM
developerWorks article as well.
- A good tutorial on HTML.
I like it better than the HTML
tutorial I started doing in class. I hope you get to the section on HTML forms!
- User requirements for the similarity project
- Using Python to write an HTML table for GenBank
sequence features
- Assignment 6
- Iterators and more FASTA parsing
- HTML forms
- More on web programming with CherryPy
- Assignment 7
- XML
- XML-RPC and web services
- Data clustering
- Student teaching schedule
Introduction to Programming for Bioinformatics in Python
In February 2004 I taught an introductary programming course at the NBN (National Bioinformatics Network)
in South Africa. It was part of an intense and impressive 7 week
training session for bioinformatics research with topics including
bioinfomatics theory, algorithms, databases, software, unix,
programming and even grant writing.
The portion I taught was two hours a day, six days a week for the
first two weeks. I started off with a translation of a introductory
Perl course Lincoln Stein taught but after the first day I realized
that most of the people in the class had very little programming
experience so I started the next day with the basics and lots of
slides.
Some of the students already knew how to program so I made a wide
range of exercises with the expectation that the beginning students
would only get through the first few in each problem set while the
most advanced ones would still be challenged with the harder ones.
Judging from the feedback it worked out pretty well.
Here are all the slides in PDF and PowerPoint format. I made them
using Apple's Keynote but that format is verbose and requires
directories so too much work to put it on-line. Contact me if you
need them.
- Introduction to Python [html]
- Strings in Python [PDF|PPT]
- Variables and References in Python [PDF|PPT]
- Lists and the 'for' loop [PDF|PPT]
- Stepping through a 'for' loop [PDF|PPT]
- The if statement and files [PDF|PPT]
- Working on exercises (a few notes first) [PDF|PPT]
- Code Blocks and Indentation [PDF|PPT]
- Functions [PDF|PPT]
- Why? [PDF|PPT]
- Dictionaries [PDF|PPT]
- Advanced Exercises [PDF|PPT]
- Sorting and Modules [PDF|PPT]
- Searching and Regular Expressions [PDF|PPT]
- Important modules: Biopython, SQL & COM [PDF|PPT]
- "Everything Else" [PDF|PPT]
- Answers to all the exercises
Some of the exercises used data files. I think this is the complete
list. If missing I note why.
I really enjoyed teaching the course. It was a lot of work but the
result was seeing many people really get into it and faces light up
with understanding and achievement.
To the whole class, best wishes and good luck for the future!