CS1

3_Poets: Regex Play

This assignment requires students to write regular expressions (regex) to match patterns in words that solve word puzzles. A number of the puzzles are taken from WIll Shortz' books (1996, 2003). Shortz is National Public Radio's (NPR) puzzle master. This assignment is a stand-alone exercise for practice with the powerful pattern-matching syntax of regular expressions. The assignment involves no programming. A web-based CGI compares student regex with a dictionary of words and returns a table of resulting word matches. A "starter kit" includes a series of word puzzles to encourage regex play.

The author of this material was awarded a 2016 NCWIT Engagement Excellence Award for this assignment. Learn more on NCWIT's awards page.

Engagement Excellence

2_Poets: Reading Poetry Backwards – RPB v1.0

This programming assignment requires students to study, understand, and augment a Python program that (re)writes or “breaks” poems in various “deformed” manners, including printing the lines of a poem in reverse (last line to first line) and with randomized lines. Emily Dickinson wrote in the margins of a book: 'Did you ever read one of her Poems backward, because the plunge from the front overturned you?’ Learning goals include problem decomposition (functions), extending existing code, problem solving with multiple solutions, and building an app to handle a wide range of input texts.

The author of this material was awarded a 2016 NCWIT Engagement Excellence Award for this assignment. Learn more on NCWIT's awards page.

Engagement Excellence

1_Poets: Making a website -- Google's Ngram Viewer

This is the first of five assignments in a semester-long CS-1-like course named Computing for Poets to introduce students to programming within one area of the digital humanities: the application of computing to the study of digitized texts. Here, students must build a small website with answers to two queries applied to and the results obtained from Google’s Ngram Viewer. The course leverages a MOOC for HTML/CSS/Javascript practice to maximize in-class, hands-on sessions. Students will return to HTML in the final assignment in this series when their Python scripts will produce web pages on the go.

5_DNA: Comparative Genomics via Genomic Signature

This is the last of five programming assignments in a semester-long CS-1-like course named DNA to introduce students to programming within the context of genomics: the analysis of DNA within a single cell of an organism. Originally, the course targeted students in the life sciences but it now attracts students across the academy. The goal of these assignments is to prepare students to obtain enough confidence with scripting and associated scientific write-ups to conduct a small computational experiment in a final project.

This programming assignment requests a Python program to generate a report that serves as a preliminary study to compare and contrast certain features of sequences between multiple organisms. Comparative genomics is the analysis and comparison of genomes from different species. This assignment focuses on “genomic signature” to help infer if a region of DNA is “like” other regions of DNA. The genomic signature refers to the “characteristic frequency of oligonucleotides (e.g., motifs of length 4 bp are referred to as tetramers) in a genome or sequence. It has been observed that the genomic signature of phylogenetically related genomes is similar.

4_DNA: Motif Finder

This is the fourth of five programming assignments in a semester-long CS-1-like course named DNA to introduce students to programming within the context of genomics: the analysis of DNA within a single cell of an organism. Originally, the course targeted students in the life sciences but it now attracts students across the academy. The goal of these assignments is to prepare students to obtain enough confidence with scripting and associated scientific write-ups to conduct a small computational experiment in a final project.

This programming assignment assumes that you have already located a specific gene (perhaps using some of the software written in the previous assignment) but now you want to investigate the regulatory DNA sequences “upstream” (just prior to or to the left of) that gene. Regulatory (or promoter) sequences in intergenic regions (between the genes) are vitally important in the process of protein production. Promoter motifs (DNA "words") often are repetitive and/or "fuzzy" (variable) DNA sequences upstream of genes. This assignment applies regular expressions to locate certain categories of repetitions (direct and mirror repeats).

3_DNA: Mini Gene Finder

This is the third of five programming assignments in a semester-long CS-1-like course named DNA to introduce students to programming within the context of genomics: the analysis of DNA within a single cell of an organism. Originally, the course targeted students in the life sciences but it now attracts students across the academy. The goal of these assignments is to prepare students to obtain enough confidence with scripting and associated scientific write-ups to conduct a small computational experiment in a final project.

This programming assignment requests a Python program to work the steps in a simplified view of the Central Dogma of molecular biology that relates DNA, RNA, and proteins. Briefly put, the DNA sequence (gene) provides instructions for the protein's production. The program produces all three reading frames of an mRNA and outputs the results of four elementary tests to help a human reader pick the “valid” protein.

1_DNA: Playing with (strings of) DNA

This is the first of five programming assignments in a semester-long CS-1-like course named DNA to introduce students to programming within the context of genomics. This assignment requests a Python program to perform an introductory analysis of a "snip" of DNA that includes some upstream (intergenic) sequence and the beginning (but not all) of a gene (genic sequence). A "Starter Kit" includes a template of a Python source file that shows, by example, good introductory and inline documentation, the use of good (camelCase) variable names, and a healthy dose of print statements that produce meaningful and neat output. 

2_DNA: Chargaff’s Numbers

This is the second of five programming assignments in a semester-long CS-1-like course named DNA to introduce students to programming within the context of genomics. This programming assignment requests a Python program to open and read a FASTA-formatted file filled with DNA and print a neat summary of Chargaff’s numbers, defined as: the number/proportion/percentage of A, C, G, T nucleotides in the file of DNA. Students are required to research and download the genome of an entire microbe of their choice. In addition to submitting source code, students must practice their scientific writing in a report of their program as applied to an entire microbial genome of their choice. The report must include the sections of Introduction, Methods, Results, and Discussion.

Digital Sound Processing

In this assignment, students implement some simple filters on sound objects, including reversing a sound, mixing arbitrary-length lists of sounds, and changing volumes of sounds. These functions can each be written in ten or fifteen lines of code, using objects that represent sounds and samples from our media module. Then, calling on these functions, students write a "song generator": a function that takes a string of note data (a notestring) and produces its representative sound object that can be played or saved as a wav file.

Conditionals & Loops

In this assignment, students compose a variety of functions. Using Python, students create functions that perform a wide range of tasks (from calculating the height of an individual to the manipulation of strings) that emphasize the use of loops.

Subscribe to CS1