
Explore Python programming for biological problems using Google Colab, covering variables, strings, operators, loops, lists, dictionaries, sets, matrices, functions, modules, regex, and basic object oriented programming with biology-focused exercises.
Learn Python programming for biological problems, applying data analysis and genomics insights through AI and neural networks. Use exercises and projects to apply basic concepts, without libraries or GUI focus.
Explore Python's origins, its simple, easy-to-learn design, and cross-platform portability across Windows, Mac OS, and Linux, with web development, artificial intelligence, data science, and libraries like TensorFlow.
Learn how to install Python on your machine using official sources or the Anaconda distribution, then create isolated environments with different Python versions and access tools via Anaconda Navigator.
Explore five popular Python IDEs and environments, including Spyder, PyCharm, Jupyter Notebook, Jupyter Lab, and Google Colaboratory, and learn how to set up Python projects in Anaconda Navigator.
Explore variables and constants, data types, and basic Python operations from input to printing, including integers, floats, strings, and booleans.
Learn Python mathematical operations, including variables, add, subtract, multiply, divide, modulus, exponent, and square roots with the math library; print results, apply rounding, and respect order of operations.
Calculate the inhibition constant chi from IC50 and substrate concentration in in vitro assays to assess inhibitor potency, and compute recombination frequency as the ratio of recombinant to total genotypes.
Compute Ki, the inhibition constant, from user inputs I50, substrate concentration, and Km in a Python exercise for enzyme inhibition assays, with careful parentheses and rounding.
Implement a Python exercise that calculates recombination frequency from recombinant and non-recombinant genotypes using four user inputs.
Explore boolean logic with Python by using logical operators (and, or, not) and relational comparisons like >, <, ==, !=, >=, <= to evaluate true and false values.
Practice using relational and logical operators to compare weights of five proteins, inputting two protein choices to test equality or determine which weight is greater in kilo Daltons.
Compare protein weights using relational operators and boolean expressions by selecting two proteins and printing whether protein two is greater than, less than, or equal to protein four.
Explore string variables in Python, converting to upper and lower case and capitalizing the first letter. Practice indexing, slicing, replacing, finding, measuring length, stripping spaces, and simple division examples.
Practice two exercises: abbreviate species names by capitalizing genus and shortening it to its letter with a dot, and extract exon from g to u in rna, protein coding region.
Capitalize the first letter of a species name, split it into genus and specific epithet, and form an abbreviation using the genus initial, a dot, and the epithet.
Learn to locate the start codon AUG and any termination codon UAG, UGA, or UAA in a pre-messenger RNA sequence and extract the exon using Python.
Explore how Python uses conditional operators with if, elif, and else, colons to start blocks, and indentation to control flow and print messages based on true or false.
Using conditional statements, this lecture guides solving two exercises: classifying taxonomic families by suffixes for plants and animals, and detecting start and termination codons in an rrna sequence.
Explore the first exercise on conditional statements, classifying a biological family as a plant if it ends with RC, an animal if it ends with Ed, or neither.
Learn to read an RNA sequence and determine whether it contains initiation codon and termination codon using nested conditional statements, reporting both, only initiation, only termination, or neither.
Learn to use Python for loops with range to print numbers and accumulate sums, exploring iteration over strings and nested loops, with the next lecture on while loops.
Learn how to implement and control a while loop in Python, including counting from 1 to 5, avoiding infinite loops, and using sum accumulation for validation.
Practice dna transcription to rrna and model bacterial growth from 500 with a 2.5 fold increase every 3 hours, using loops to estimate the required time.
Develop a Python exercise that transcribes a DNA sequence to RNA by looping over nucleotides and applying A to U, C to G, G to C, and T to A.
Explore bacterial growth modeling by coding a loop that starts with 500 individuals and multiplies by 2.5 every 3 hours to estimate when the population reaches 100,000.
Explore Python collections by learning tuples and lists, including creating, indexing (zero-based), concatenating, duplicating, adding with append, removing elements, and iterating with for loops.
Learn how to create and manipulate dictionaries and sets in python, including adding, updating, deleting entries, accessing keys and values, and performing set operations like intersection and difference.
Learn to create and inspect matrices in Python using NumPy, access rows and columns by index, and traverse matrix values with nested for loops.
Practice calculating peptide sequence mass using a dictionary of amino acid masses and transcribing a DNA sequence to RNA with dictionary-based rules.
Validate an input amino acid sequence using the allowed letters, then compute its mass by summing each residue's mass from a dictionary, returning grams per mole.
Transcribe a DNA sequence to RNA using a Python dictionary that maps DNA bases to RNA bases, showcasing a practical solution to the second collections exercise.
Simulate a biology test by prompting the user for questions with five options A–E, re-prompting on invalid input, updating a numeric score for each answer, and printing the final score.
Implement a Python project that simulates a ten-question biology test with A–E options, validates user input, and reports the score plus per-question results.
Develop a biology test simulation by building an interactive question-asking algorithm, tracking score and hits, validating answers, and iterating through questions to complete the project.
Implement a Python algorithm that prints the score and per-question results using f-strings, tracking hits, grade, and a looping question counter for a biology problem project.
Learn how to define and call Python functions to enable code reuse and modularity, using parameters, return values, default and optional arguments, and inline documentation.
Explore exercises that use functions to compute recombination frequency from recombinant and non recombinant genotypes, calculate Ki from IC50 and MCL, and transcribe DNA to rrna with a docstring.
Implement a Python function to calculate recombination frequency from two recombinant and two non recombinant genotypes, returning the result using the provided formula.
Compute the inhibition constant Ki from three inputs, I50, substrate concentration, and Michaelis constant, and print the result to illustrate practical work in an enzyme inhibition assay.
learn to implement a transcription function that converts a dna sequence to rna using a dna-to-rna mapping, build the rna sequence with a for loop, and return it.
Apply the Hardy-Weinberg theorem to calculate allele and genotype frequencies from 2500 individuals, determine expected genotype counts, and use a chi-square test to assess evolutionary processes.
Compute allele frequencies and expected genotypes for a 2500-individual population using the Harlequin Bear theorem, then evaluate observed versus expected counts with a chi-square test in Python.
Calculate expected genotype frequencies using p^2, 2pq, and q^2, compare with observed counts, and perform a chi-square test to assess whether evolution may be occurring.
Master math and datetime tasks in Python by using the math module for square roots, sign, cosine, and logarithms with bases, and the datetime module to obtain dates and times.
Learn to use Python's random and time modules to generate random numbers, select list elements, and control ranges and steps. Measure or pause code execution with time-related functions.
Develop two Python exercises: generate a random DNA sequence of a given size with the random module, and compute the final population using an ecology growth formula with four parameters.
Generate a random DNA sequence using Python's random module by defining a function that uses random.choice to pick from A, C, G, T to build a sequence of given length.
Define a function to compute the final population using N0 * e^(r*T) with the math module, returning the final value; demonstrate with N0=300, r=1.2, t=10 yielding about 48 million.
Learn to build a custom Python module, define functions like sum and multiply, save and import the package in Spyder and Google Colab, and test with runtime restarts.
Create two Python modules: a DNA sequence toolkit with functions for nucleotide percentages and the complementary sequence, and a population ecology toolkit with exponential and logistic growth models.
Create a dna module in python that outputs the complementary dna sequence and the percentages of adenine and guanine in a given sequence.
Create a python ecology module with population ecology functions for exponential growth and logistic growth, computing growth rate as birth minus death rate and demonstrating usage in a notebook.
Biologists, biology students, and professionals in related fields generally have little or no contact with computer programming. However, the growing of data in genomic, protein and organism databases can be used to model the solution for some problems, such as the discovery of medicines and insecticides. It leads biologists to benefit from computer programming knowledge, so that they can develop useful applications in molecular biology, ecology, research on diseases, among others.
This course was developed with the purpose of introducing biologists, students of biology, biomedicine, ecology, pharmacy and professionals in related areas to programming using Python, which is nowadays one of the most used programming languages. It has a clear syntax and is easy to learn especially if you are a professional who are not familiar with technology. Many tools used in the field of biology were written in Python, which makes it a great option for establishing your first contact with computer programming. You will learn the following topics:
Python installation and main tools (IDEs)
Variables, constants and strings
Math operations
Logical, relational and conditional operators
Loops (for and while)
Functions
Lists, dictionaries, tuples, sets and arrays
Manipulation of text files
Error and exception handling
Regular expressions
Object oriented
After learning the basic concepts of Python, you will be able to apply the concepts in exercises, challenges and practical projects related to Biology. Below are some of the case studies that we will implement step by step:
Prediction of the mass of a peptide sequence according to its amino acid composition
Schedule a biology test that calculates the grade and whether the user got each question right or wrong
Creating classes related to objects in the biological world
.fasta gene sequence analysis
Analysis of gene frequencies according to the Hardy-Weinberg Theorem
Creating functions for population ecology calculations
Discover patterns in RNA sequences
Estimation of gene distances
Basic species identification
Troubleshooting gene frequencies
Creating scripts for parsing .pdb-type protein sequence files
Transcription of DNA sequences into RNA
There are more than 80 classes, concepts, code demonstration, and exercises with solutions! More than 30 proposed challenges and 4 small projects applying the concepts learned in each section in a biological context, with step-by-step resolution.