


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Exercise: Gaining Experience with Matlab
Lab Start Date: Thursday, September 6th Due Date: Tuesday, September 11th
For this exercise, students will work in pairs or small groups. Each group should have a diverse set of students (majors, class standing, etc). You should also change groups from week to week as we introduce new exercises.
Each student will submit individual answers to the laboratory exercises. At the top of the first page of the answer sheet, please state your name, your partners’ names, which course you are registered for and if you are taking the course for audit or credit. We request that you turn in the laboratory in hard-copy, not electronically. Please make two identical copies of your answers and give one to each of the professors. We encourage you to get together with your groups outside of lab to finish the questions, if necessary.
Information you might find useful:
Official Matlab Introduction (online): http://www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/learn_matlab.html
Matlab also has an extensive built-in help system which can be accessed either through the Windows Help interface or through a command-line driven system. To use the Windows Help interface, choose Help, MATLAB Help from the Matlab menus. A window similar to the one below will appear. By clicking on different tabs in the left-hand window, you can look for help in multiple ways, including through an A-Z index and through topic search.
A second way to use help is to type help topic_name at the Matlab command prompt. For example, if you were interested in looking up help information on the help function, you would type help help. This will provide you with the same information given through Windows Help.
Many of the later components of this course will require the use of Matlab to analyze and visualize data. The purpose of this exercise is to reinforce the key components of Matlab that
were introduced during lecture and that you will need down the road. This exercise will lead you through loading a data file similar to ones we will be using later in the course and performing basic statistical and plotting routines on that data.
In lecture, we briefly covered a number of Matlab file and directory commands. Using the Matlab help system, look up the entries for the functions pwd , cd , and mkdir and write a short description of what each function does in your answer sheet.
Using these functions in the Matlab command window create a directory called C:\userdata\CSC391 (or BIO 301, etc). You should use this directory as your working directory for this and future lab exercises.
Take a screenshot of your Matlab window or copy and paste proof that you have completed the above steps and insert this into your answer document.
Download the file named exercise1.dat from Blackboard into the directory you just made and load the data into a variable called geneArrayData using the Matlab load function. The file contains signal log ratio values (log 2 of experiment/control expression values) collected at time points for 12 genes by a microarray experiment. Don’t worry if you don’t understand what a microarray experiment is. We will cover this material later in the course. This is just an example data file for us to use to exercise your Matlab skills.
After loading the data, display the values held in the geneArrayData variable to the screen and copy and paste the values that are shown into your answer sheet.
Use the Matlab size function to display to the screen the size of the geneArrayData matrix from part 2. Write down the size returned in your answer sheet. Verify the order that the rows and columns are presented. Delineate in your answer sheet whether genes are the rows and time is the columns or if the opposite holds.
Extract the equivalent of one genes’ time course data from the geneArrayData matrix into a variable called singleGeneTimeCouse by using the Matlab array indexing functionality. Display the value held in this variable to the screen and copy and paste what is shown into your answer sheet.
Create a row vector holding the values from 1 to the number of timepoints for these microarray data by using the Matlab linspace function and assign that vector to the variable timePointIndices. Display the value held in this variable to the screen and copy and paste what is shown into your answer sheet.
discretization of the data before modeling. The discretization process inherently changes the data values.
We have written a Matlab function that discretizes experimental data. Download the Matlab function file discretize.m from Blackboard into the directory in which you have been working. Once the function is in your working directory, it can be applied to arrays just as if it was a built-in Matlab function.
Most functions have arguments and return values. In your answer sheet define the terms argument and return value, then supply the argument(s) and return value(s) for the discretize function.
Apply the discretize function to your singleGeneTimeCourse variable (choosing the value of other arguments of discretize as you like) and make sure that the results are returned in a variable and displayed to the screen. Copy and paste the results into your answer sheet.
Plot the raw and discretized singleGeneTimeCourse data against time in a figure. Try several different bin numbers and put the graph of each on a single plot with the raw data. Take a screenshot of that figure and include it in your answer sheet.
Undergraduate students only: Look at your plot of discretized and raw data and evaluate what discretization does to the data.
Plot the expression of all genes in this data set in an expression versus time plot. Paste this plot into your answer sheet. Select two genes from the data set, one gene that is up-regulated (higher expression later in the experiment) and one that is down-regulated (lower expression later in the experiment). State in your answer sheet what genes you chose and indicate them on the plot.
Apply 2-, 3-bin, and 4-bin discretization to each gene. Plot the experimental values and the discretized values on the same plot. Make some assessment about what discretization does and does not do to data. State what you think might be the advantages and disadvantages of applying discretization to experimental data. (You may wish to look at the plots that other students have created and discuss your results with other students.)