Next year separate strings + lists and dictionaries in separate weeks so we have time to go through the methods for each before the exercises in each topic.
TODO:
Week 3 check strings hand-in make strings exercise with HIV () - pairwise differences
Week 4
talk about values and references - mailund something on that. make lists exercise with HIV - maybe don't need any make dictionaries exercise with HIV - nucleotide and codon usage
Week 5
Week 6
Week 7
Week | Double lecture | Single Lecture | Excercise |
1 | Introduction, Expressions, If statements | Installation, IDLE, Expressions, If statements | |
2 | Control flow, Functions | Functons, Types, Modules, and problems | Control flow and Simple functions |
3 | Strings, Methods, Lists, Dictionaries | Hand-in and problems | Pairwise differences and counting bases |
4 | Strings, Methods, Lists, Dictionaries | Hand-in and problems | Virus open reading frames |
5 | Files | Hand-in and problems | Reformating virus data file |
6 | Regular expressions | Hand-in and problems | Find virus sequence motifs |
7 | Running scripts, Biopython, Guest lecture | Hand-in and problems | Finding virus genes |
8 | Wrap up, Exam, Bachelor projects, Evaluation |
Course outline
Here is an outline of the course as it is planed as we start out, but it may change a bit along the way when this makes sense.
Week | Double lecture | Single Lecture | Excercise | Hand in | |
1 | Intro, Expressions, If, Indentation, | Installation, IDLE, Expressions, If statements | None | ||
2 | Control flow, True and False, Functions, Modules | Types and problems | Control flow and Simple functions | Pytagoras functions | |
3 | Strings, Functions, Methods | Hand in and problems | String manipulation, GC content | ?? | |
4 | Lists, Dictionaries | Hand in and problems | Comparing sequences | ??| | |
5 | Files | Hand in and problems | Reformating data file | ?? | |
6 | Regular expressions | Hand in and problems | ORFs | ?? | |
7 | Running scripts, Biopython, Guest lecture | Hand in and problems | More ORFs | ?? | |
8 | Wrap up, Bachelor projects, Evaluation |
In the first of the double lectures I will intruduce new material, and in the second we will try and tackle this togeather. In the single lecture I will go through last weeks hand in, and other issues that turns out to require more of our attention. The complexity of the exercises you will do with your TAs will reflect the programming techniques you have been introduced to.
Case for Excercises
Download HIV-1 HIV-2 and different subtypes of those.
Strings: Find the 5' and 3' LTRs
Lists, Dictionaries: pairwise diffs to other HIV types, nucleotide content
Files: Reformatting data
ORFs1 and ORFs2: Find open reading frames, calculate codon bias,
Week 1
Lecture 3
Introduktion:
- Velkommen - presentation of TAs
- What is it we will be doing together.
Why learn to program:
- Your professors are from a time when lab experiments was done by human beings. This meant that the subsequent processing and analysis of data could easily be done by hand in an excel sheet of similar. With the advent of robotic technology in molecular biology this is changing. The automation of laboratory tasks has speed up the experimental work flows by orders of magnitudes. To benefit form this the processing and analysis must be handled as efficiently as the data collection.
Kurset:
- Ny forelaeser: Thomas -> Kasper
- Kurset omstrukutureret
- Snakket med Palle som de kender for at faa en fornaemmelse af dem.
- Hvorfor vi har valgt Python
- Hvordan jeg har planlagt kurset. Hvad jeg har valgt at tage med og hvad jeg har valgt fra og hvorfor.
- Hvorfor materiale er paa engelsk
- Hvorfor vi bruger engelske fagtermer.
- plan for kurset
- Holdrepresentanter
- Vi proever at dele tiden op saa enten i eller jeg arbejder ved computeren.
- oevelser: simplicitet vs. realisme
- Hvad kraever kurset af jeg, og hvordan faar i mest ud af det.
Praktiske ting:
- Tag din egen computer med til forelaesningerne hvis du har en.
The Lego analogy:
- Siple rules
- Few components
- Small kids don't understand the rules
- Like lego formalism is simple, but must be obeyed.
- They are not meant to be able to build perfect replicas of german castles, but know the rules about how the pieces fit together.
- And just as important you will be able to understand how programs are made, read and modify other peoples code, and conseptually outline a program you need to someone with more expecience in programming.
Talking to a computer:
- Manipulation of variables like adding and substracting numbers.
- Yes/No questions.
Quick excercise:
- Input ? say 3, output 1
- Figure out with the person to your right how ot get from 3 to 1. You can only use "substract one" operations, and only control thise by yes/no questions.
- It has to be a sequence of statements (udsagn):
- If it is above 30 C: Then take jaket off.
- If you are at Noerregade: Then turn right.
- Go through solution.
x = 7 if x == 1: output x if x > 1: x = x - 1 ... and keep doing that until we output x
Examples of variable manipulation:
- x = 4
- x = y
- x = x + 1 (note order evaluation)
Examples of variable manipulation:
- x == y
- x > 3
- x <= z
When a program is executed a operations are evaluated line by line. That lines to evaluate can be controled by yes/no questions.
French: Horse = Chevalier and the rest is like that... With programming this is almost true.
Week 2
Lecture 1
Hvordan gik oevelserne?
Control flow:
- Hvad er control flow?
- Naar man koerer et program eksekverer man en raekke statements. Hvilken kombination af statements der eksekveres kontroloeres vha control flow. "Controling the flow of statements".
- Tegning af if else control flow. Med forklaring
- if
- else
- elif
- while
- for in
Functions:
- smaa programmer i programmet.
- som i kogeboeger der har seperate afsnit om ting der skal bruges i mange retter. F.eks. "stegning af groentsager". Paa den maade behoever forfatteren ikke udpensle hvordan amn steger groentsager i alle opskrifterne, men bare referere til en del-opskrift.
- I programmering svarer saadan en delopskrift til en funktion.
def gangMedSyv(x): x = x * 7 return x
oldvalue = 2 newvalue = gangMedSyv(oldvalue)
scopes