COMP 204 Fall 2020: 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.8 (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 9:35-10:25
Location: Entirely online, using Zoom (see link on MyCourses).
Lectures will be recorded and will be available through MyCourses.

Teaching Assistant

See MyCourses/Content/Schedule

Office Hours

See MyCourses/Content/Schedule

Getting help: Discussion board

We will be using Piazza for question/answers. The sign-up link is available under Content on MyCourses. You can post your questions about the course here, answer other students' questions, and get the answers from the instructor or TAs. Different sections will be dedicated to questions about (i) lecture recordings and lecture notes; (ii) Assignments; (iii) Course logistics. IMPORTANT: Do not post code related to assignment. The only situation where you should communicate by email with the instructor are for personal issues. For issues related to assignments, see a TA or the instructor during class or office hours, where you can use the Share screen functionality to get help on your code.

Student evaluation

Assignments: 40% (5 assignments worth 8% each)
Quizzes: 5% (top 25 of 35 quizzes)
Midterm exam: 20%, held online on October 21. You will have 4 hours to complete the exam (but the exam will be designed to be feasible in 2 hours), in a period of your choice starting at 9:30am on October 21 and ending at 9:29am on October 22. Please let me know by Sept. 15 if you need special special arrangements.
Final exam: 35%. You will have 6 hours to complete the exam (but the exam will be designed to be feasible in 3 hours), BONUS: Up to 5% bonus for the student who will have been most helpful answering other students' questions on Piazza.
Assignments: 40% (5 assignments worth 8% each)
Quizzes: 5% (top 25 of 35 quizzes)
Final exam: 55%. You will have 6 hours to complete the exam (but the exam will be designed to be feasible in 3 hours). BONUS: Up to 5% bonus for the student who will have been most helpful answering other students' questions on Piazza.

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 40% assignments, and 45% 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.

Pre-class quizzes

To encourage students to keep up with the material on a lecture-to-lecture basis, we will have a quizzes due before each lecture. The quizzes will be completed on MyCourse. It will consist of one or more multiple choices questions and will take 5-10 minutes to finish. 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 CodePost. Every student is responsible for verifying that their submissions are successful.
See schedule on MyCourses.

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).

Assignment marking:

Assignments will be marked based in part on automated tests design by us and executed on CodePost. Once you submit a first version of your assignment, you will have access to some tests designed by our TAs to (partially) verify the program's correctness. Run these tests yourself, correct your program, and re-submit. You can go through cycle as many times as you need. However, be aware that the tests we are going to use to actually evaluate your program will be different (but of the same type) than those made available to you. Hence it is important that you also test your program on your own, to ensure it works in all cases.

If we are unable to run your program because it contains a syntax error, you will get at most 25% for that question. Also, be particularly careful that your program's output exactly matches what we are asking for. If your program is supposed to print something to screen, use exactly the same formatting, capitalization, and punctuation as in the examples given to you. And do not insert extra text either!

Getting help:
Post all your questions about the course (including assignments and the midterm/final) on Piazza 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 Piazza, 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.

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 one weeks of the release of the grade.

Late submission policy

Late assignments will be deducted 20% 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 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.
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.

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.8. You need to install Python 3.8 using Anaconda, which is free and works on all operating systems (Windows, Mac OS X, Linux).

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.