COMP 204 Fall 2019: Computer programming for Life Sciences (3 Credits)

Course Description

Computer programming in a high level language: variables, expressions, types, functions, conditionals, loops, objects and classes. Introduction to algorithms, modular software design, libraries, file input/output, debugging. Emphasis on applications in the life sciences.
Prerequisites: BIOL 112 and a CEGEP level mathematics course

Restrictions: Only one of COMP 204, COMP 202 and COMP 208 can be taken for credit. COMP 204 cannot be taken for credit with or after COMP 250, COMP 206, COMP 208, or COMP 364.

This course introduces students to computer programming and is intended for those with little or no background in the subject. No knowledge of computer science in general is necessary or expected. On the other hand, basic computer skills such as browsing the Web, sending e-mail, creating documents with a word processor, and other such fundamental tasks will be necessary in this course.

Course content: The course aims to introduce students to computer programming. It uses the Python programming language. A large part of this course will focus on the basic building blocks of programming, which provide the foundations to learning other languages such as Java or C++.

Learning how to program is not easy; it is not a set of facts that one can simply memorize. In principle, a computer program is simply a set of instructions that tells a computer to perform a task. However, finding the right set of instructions can be quite challenging. For that, one has to learn how to structure a larger problem into small subsets, and then find the solution to each particular subset. This course aims to teach students a way of thinking that will enable them to build non-trivial programs.

Objectives: By the end of this course, students will be able to:
  1. Design and describe precise, unambiguous instructions that can be used [by a computer] to solve a problem or perform a task;
  2. Translate these instructions into a language that a computer can understand (Python);
  3. Write programs that solve complex problems (especially those arising in Life Sciences) by decomposing them into simpler subproblems;
  4. Apply programming-style and structure conventions to make your programs easy to understand, debug and modify;
  5. Learn independently about new programming-language features and libraries by reading documentation and by experimenting.

Programming language: Python 3.7 (see below for installation procedure)

List of life science topics used as examples: Central dogma of molecular biology, RNA and/or protein structure prediction, Genome sequencing and analysis, Biological networks, Evolution, Epigenetics, Biomarker discovery, Biosystems dynamics, Cell and biomedical imaging, Modeling.


Mathieu Blanchette: blanchem[at]cs[dot]mcgill[dot]ca>

Lecture Schedule

Lectures: MWF 11:35-12:25 PM
Location: Burnside 1B45 (basement)
Lecture schedule and material (slides, notes) are available here.
Lectures will be recorded and will be available through MyCourses.

Teaching Assistant

Octavia Maria Dancu: octavia-maria[dot]dancu[at]mail[dot]mcgill[dot]ca
Samy Coulombe: samy[dot]coulombe[at]mail[dot]mcgill[dot]ca
Airin Ahia-Tabibi: airin[dot]ahia-tabibi[at]mail[dot]mcgill[dot]ca
Elliot Layne: elliot[dot]layne[at]mail[dot]mcgill[dot]ca
Sandy Wong: sandy[dot]wong[at]mail[dot]mcgill[dot]ca

Office Hours

Mathieu: Monday 12:30-13:30 and Thursday 11:30-12:30, TR 3107
Octavia: Friday, 14:30-16:00, TR 3090
Samy: Friday, 9:30-11:00, TR 3090
Airin: Wednesday 14:00-15:30, TR 3090
Elliot: Thursday 11:00-12:30, TR 3090
Sandy: Tuesday 9:30-11:00, TR 3090

Student evaluation

Assignments: 30% (5 assignments worth 6% each)
Quizzes: 5% (top 25 of 35 quizzes)
Midterm exam: 20%, Tuesday, October 15, 18:00-20:00 in ENGMC 304 (Last name starting with A-L) or RPHYS 112 (Last name starting with M-Z).
Final exam: 45%, during final exam session (date TBD)
Assignments: 30% (5 assignments worth 6% each)
Quizzes: 5% (top 25 of 35 quizzes)
Final exam: 65%, during final exam session (date TBD)

This means that students who perform better on the final than on the midterm exam will have the (automatic) option to make their grading scheme 35% assignments, and 65% final. However, the assignments are a key part of learning the material, and as such there is no 100% final option.

Final letter grades: When we calculate your final course grade, we will use a formula that rounds to to the nearest integer. If your grade is 84.4 then it rounds to 84 and you get an A-, whereas if it is 84.6 then it rounds to 85 and you get an A. If your grade is 84.5, our formula will round it up to 85. The same rounding procedure holds for low grades. If your calculated final course grade is 49.4 then it rounds to 49 which is an F. We draw a very a hard line on this, so if you don't want to fail then you should stay far away from that line.

Supplemental exam: In exceptional situations, students may write a supplemental examination. However, ability to do so is not automatic, and depends on your exact situation; contact your Student Affairs Office for further information. The supplemental examination represents 100% of your supplemental grade.

Students who receive unsatisfactory final grades will NOT have the option to submit additional work in order to improve their grades.

In-class quizzes

To encourage students to keep up with the material on a lecture-to-lecture basis, we will have a quiz after each lecture. During the lecture, the instructor will announce the password to access the quiz. The quiz will be completed on MyCourse. It will consist of one or more multiple choices questions and will take 5-10 minutes to finish. Each quiz will become available at the end of each lecture and remain available until the end of the day of the lecture (i.e., 11:59 PM on that day). This will allow students to have enough time to finish the quiz after the lecture if they do not bring their laptops to the lecture (although it is recommended to do so).

There will be a total of 35 quizzes. We will retain the top 25 quizzes, each of which will be assigned a weight of 0.2%.


5 Python programming assignments, each aiming at addressing a specific biological question using programming techniques introduced in class. Solutions must be submitted electronically on MyCourses. Every student is responsible for verifying that their submissions are successful.

It is very important that you complete all assignments, as this is the best way to learn the material. By working hard on the assignments, you will gain essential experience needed to solve problems on the midterm and final examinations. To receive full grades, assignments (as well as all other course work) MUST represent your own personal efforts (see the section on Plagiarism Policy and Assignments below).

Late submission policy:
Late assignments will be deducted 10% each day or fraction thereof for which they are late, including weekend days and holidays; that is, assignments that are between 0 and 24 hours late will be deducted 20%, assignments that are between 24 and 48 hours late will be deducted 40%. Assignments submitted more than 48 hours after the deadline will not be accepted, nor graded, and will therefore receive a grade of 0%. Take care, programming assignments are notoriously time-consuming. Plan appropriately and do not submit to myCourses only minutes before the assignment deadline. Individual exceptions to the lateness policy will not be granted without appropriate justification submitted in writing and supported by documentary evidence.

Assignment grades:
Assignment marks will also be posted on myCourses. It is your responsibility to check that the marks are correct and to notify your section instructor of any errors or missing marks. If you believe that your assignment was graded incorrectly, you should first email the TA who marked your assignment. Their email address should be in the feedback left on your assignment. If you and the TA cannot resolve the discussion, then you should contact your instructor. Complaints about grading must be formulated within two weeks of the release of the grade.

The instructors reserve the right to modify the lateness policy for a particular assignment; any such modifications will be clearly indicated at the beginning of the relevant assignment specifications.

Getting help:
Post all your questions about the course (including assignments and the midterm/final) on the myCourses message boards so that everyone can see both the questions and the answers. You may freely answer other students' questions as well, with one important exception: you may not provide solution code (although you are permitted to provide one or two lines of code to illustrate a point). The instructor and teaching assistants will not answer questions by email. Post your questions on MyCourses, or ask them in person at office hours. Only email the instructors or TAs for private matters, and do not count on a quick response. Students are expected to monitor both their McGill e-mail account and MyCourses for course-related news and information.

Campus Computer Laboratories:
All required work can be carried out on standard desktop or laptop computers running Linux, Windows, or Mac OS X. Students can also use the SOCS computer laboratory facilities: All students registered in COMP-204 may use the SOCS computer laboratory facilities to do their work regardless of the program in which they are registered. These facilities are located on the third floor of the Trottier building. You may also use other computer laboratory facilities on campus to do your work.

Textbooks and software

There is no textbook that is mandatory for the course. However, students may find the following free resources useful: Recommended Software: All programming will be done in Python 3.7. You need to install Python 3.7 using Anaconda, which is free and works on all operating systems (Windows, Mac OS X, Linux).

IMPORTANT: Tutorials on installing and getting started with Python (Spyder IDER): Sept 8, Sept 9, and Sept 10, 5:00-6:00pm, in TR 3120.

Useful Links: Official language policy for graded work: In accordance with McGill University's Charter of Students' Rights, students in this course have the right to submit in English or in French any written work that is to be graded.

Plagiarism Policy

McGill University values academic integrity. Therefore all students must understand the meaning and consequences of cheating, plagiarism, and other academic offenses under the Code of Student Conduct and Disciplinary Procedures (see for more information).
Plagiarism Policy and Assignments You must include your name and McGill ID number at the top of each source code file that you implement and submit. By doing so, you are certifying that the program or module is entirely your own, and represents only the result of your own efforts.

Work submitted for this course must represent your own efforts. Assignments must be done individually; you must not work in groups. Do not rely on friends or tutors to do your work for you. You must not copy any other person’s work in any manner (electronically or otherwise), even if this work is in the public domain or you have permission from its author to use it and/or modify it in your own work (obviously, this prohibition does not apply to source code supplied by instructors explicitly for this purpose). Furthermore, you must not give a copy of your work to any other person, nor should you post your solutions on any publicly accessible repository.

The plagiarism policy is not meant to discourage interaction or discussion among students. You are encouraged to discuss assignment questions with instructors, TAs, and your fellow students. However, there is a difference between discussing ideas and working in groups or copying someone else's solution. A good rule of thumb is that when you discuss assignments with your fellow students, you should not leave the discussion with written notes. Also, when you write your solution to an assignment, you should do it on your own.

Students who require assistance with their assignments should see a TA or instructor during their office hours. If you have only partially finished an assignment, document the parts that do not work, and submit what you managed to complete for partial credit. However, the code to answer any question must compile (with the test engine provided to you, if any), or else you will receive a maximum grade of 25% on that question.

We will be using automated software similarity detection tools to compare your assignment submissions to that of all other students registered in the course, and these tools are very effective at what they have been designed for. However, note that the main use of these tools is to determine which submissions should be manually checked for similarity by an instructor or TA; we will not accuse anyone of copying or working in groups based solely on the output of these tools. You may also be asked to present and explain your assignment submissions to an instructor at any time.

Students who put their name on any code that are not entirely their own work will be referred to the appropriate university official who will assess the need for disciplinary action.

About posting solutions The instructor will do his best to provide solutions to assignments and exams in a timely manner. These solutions are the property of McGill and must not be posted anywhere online. Posting solution online would be considered as facilitating plagiarism and would be treated as such.