Skip to content

About

This is an interactive courseware module for use in introductory biology classrooms. This module teaches the basics of genetics using biological real datasets. It includes several live scripts.

Resources

Contributing

Security policy

Stars

2 stars

Watchers

2 watching

Forks

Repository files navigation

Biosciences: Genetics

For MATLAB R2024b or older, use the legacy MLX release.

View on File Exchange Open in MATLAB Online

MATLAB Versions Tested

Curriculum Module

Created with R2025a. Compatible with R2025a and later releases.

Information

This curriculum module contains interactive MATLAB® live scripts that analyze genetic data.

Background

You can use these live scripts as demonstrations in lectures, class activities, or interactive assignments outside class. This module covers calculating the statistics of a single DNA sequence, uses real genetic data to create a phylogenetic tree, and explores within-species genetic variation.

This module utilizes data pulled from GenBank, the NIH's library of publicly available genetic sequences.

640px-Bdna_cropped.gif

A 3-dimensional model of DNA

An internet connection is needed for GenBank sequence retrieval and the initial download of the primates example. Downloaded data belongs in Data/ and is excluded from version control. Population data is simulated locally.

The instructions inside the live scripts will guide you through the exercises and activities. Get started with each live script by running it one section at a time. To stop running the script or a section midway (for example, when an animation is in progress), use the EndIcon.png Stop button in the RUN section of the Live Editor tab in the MATLAB Toolstrip.

Contact Us

Contact the MathWorks Educator Content Development Team if you would like to request assistance, provide feedback, or if you have a question.

Prerequisites

This module assumes basic MATLAB knowledge and it is recommended that all students take the MATLAB Onramp.

Getting Started

To learn more about opening and using MATLAB, see the accompanying Getting Started guide.

Accessing the Module

Use MATLAB R2025a or newer for these plain-text live scripts. For MATLAB R2024b or older, download the legacy .mlx release.

On MATLAB® Online™:

Use the OpenInMO.png link to download the module. You will be prompted to log in or create a MathWorks account. The project will be loaded, and you will see an app with several navigation options to get you started.

On Desktop:

Download or clone this repository. Open MATLAB, navigate to the folder containing these scripts and double-click on BiosciencesGenetics.prj. It will add the appropriate files to your MATLAB path and open an app that asks you where you would like to start.

Ensure you have all the required products (listed below) installed. If you need to include a product, add it using the Add-On Explorer. To install an add-on, go to the Home tab and select AddOnsIcon.png Add-Ons > Get Add-Ons.

Products

MATLAB®, Bioinformatics Toolbox™, and the Statistics and Machine Learning Toolbox™ are used throughout. The Mapping Toolbox™ is used for changem().

Scripts

Notes: These scripts can all be run independently, though we recommend going through these live scripts in order. These live scripts are intended to be used with output inline. To change the output, go to the View tab of the toolstrip, and select OutputInline.png Output Inline. The scripts have areas for the students to interact with the code Try.png.

Explore a single DNA sequence

Pl.png
In this script, students will...
$\bullet$ import and analyze DNA sequences in MATLAB, and visualize nucleotide content
Academic disciplines
$\bullet$ Biology

Comparative genetics

GeneticTree.png
In this script, students will...
$\bullet$ calculate genetic distances between species
$\bullet$ visualize genetic distance using phylogenetic trees
$\bullet$ use genetic data to interpret evolutionary relationships
Academic disciplines
$\bullet$ Biology

Population genetics

GeneticClusters.png
In this script, students will...
$\bullet$ visualize genetic differences within a population using dimensionality reduction
Academic disciplines
$\bullet$ Biology
$\bullet$ Machine Learning
$\bullet$ Linear Algebra

Problem Set

Axlotl.png
In this script, students will...
$\bullet$ retrieve and plot nucleotide data
$\bullet$ create phylogenetic trees
$\bullet$ visualize genetic differences within a population using dimensionality reduction
Academic disciplines
$\bullet$ Biology
$\bullet$ Machine Learning
$\bullet$ Linear Algebra

Further Resources for students

         1) an example of phylogenetic trees using the primate dataset

         2) an example of using phylogenetic trees to understand a disease

         3) more on sequence statistics

Related Courseware Modules

Courseware
Location
Biosciences: Working With Data
Penguins.jpeg
Available on:
OpenInFX.png
OpenInMO.png
GitHub
Biosciences: Statistical Methods
Penguin.jpeg
Available on:
OpenInFX.png
OpenInMO.png
GitHub
Biosciences: Image Processing
FluorescentCells.jpeg
Available on:
OpenInFX.png
OpenInMO.png
GitHub
Biosciences: Machine Learning
Rose.jpeg
Available on:
OpenInFX.png
OpenInMO.png
GitHub

Or feel free to explore our other modular courseware content.

Educator Resources

Contribute

Looking for more? Find an issue? Have a suggestion? Please contact the MathWorks Educator Content Development Team. If you want to contribute directly to this project, you can find information about how to do so in the CONTRIBUTING.md page.

License

The license for this project is in the LICENSE.md file in this repository.

Help us Improve

Share your feedback to help us improve this module.

© Copyright 2023-2026 The MathWorks, Inc.

About

This is an interactive courseware module for use in introductory biology classrooms. This module teaches the basics of genetics using biological real datasets. It includes several live scripts.

Resources

Contributing

Security policy

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages