yuval hart, weizmann 2010© 1 introduction to matlab & data analysis final project: that’s...

18
Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

Upload: tobias-newman

Post on 04-Jan-2016

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

Yuval Hart, Weizmann 2010© 1

Introduction to Matlab & Data Analysis

Final Project: That’s all, Folks!

Page 2: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

2

Outline

Parsing files Efficient programming - vectorization Correlation coefficients Passing extra parameters Image plotting Curve Fitting & Optimization Figure handling

Page 3: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

3

“Rotation in 60 minutes”

Page 4: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

4

Rotation in 60 minutes:

During the past month you’ve measured promoter activity of 20 genes.

Your PI wants you to present your results at the next group meeting.

Page 5: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

5

To Do List

Get the sequences of the genes from a GenBank+Fasta files and calculate GC content

Display all correlation coefficients of the measured PA and relation to GC content

Find for the highest 4 genes, how correlation decays with distance from initial gene in the pathway

Page 6: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

6

To Do List

Get the sequences of the genes from a GenBank+Fasta files and calculate GC content

Display all correlation coefficients of the measured PA and relation to GC content

Find for the highest 4 genes, how correlation decays with distance from initial gene in the pathway

Page 7: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

7

GenBank file format

Page 8: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

8

Step 3: Attach every gene name with its DNA sequence

Build the structure with all needed fields:

% Build the structure Genes with the desired genes and their data: % name, startPosition, endPosition, sequence, complement (1/0), GCcontent% This is also the way to preallocate for structures:% Genes(1,sum(indGeneList))=struct( 'name', [], 'complement', [], 'sequence',[],...% 'StartPosition',[],'EndPosition',[],'GCcontent',1);

Genes=struct('name',geneNames(indGeneList),…'complement', num2cell(indComplement(indGeneList)'),... 'StartPosition',CDSpositionStartEndCelled(indGeneList,1)',…'EndPosition',CDSpositionStartEndCelled(indGeneList,2)',...'sequence',seq,'GCcontent',GCcontent);a=Genes;Note: Structures are assigned one by one only with

cell arrays

Page 9: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

9

To Do List

Get the sequences of the genes from a GenBank+Fasta files and calculate GC content

Display all correlation coefficients of the measured PA and relation to GC content

Find for the highest 4 genes, how correlation decays with distance from initial gene in the pathway

Page 10: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

10

Calculate and plot Correlation Matrix

Load the list of genes and measurements% Input:% measurement mat file contains:% geneList - a cell array of the genes Names% measurements - a matrix of 20 genes measurements at 1001 time points% GenesGCcontent - a vector of the genes GCcontent values

%measurements has a row for each gene containing its measurements through%1001 time points and the geneList namesload measurements

Page 11: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

11

Plot GC content and mean PA dependence

Plot fit results upon the previous graph:

Note: Smoothed data can lower the effect of outliers

Page 12: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

12

Calculate and plot Correlation Matrix

Calculate and display the corr. matrix

Page 13: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

13

To Do List

Get the sequences of the genes from a GenBank+Fasta files and calculate GC content

Display all correlation coefficients of the measured PA and relation to GC content

Find for the highest 4 genes, how correlation decays with distance from initial gene in the pathway

Page 14: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

14

Step 2: Fit correlations to the desired function

Using anonymous function to add more Parameters and fitting using lsqcurvefit:

function y_hat=FittingCurveExpGuess(c,x,init)% This assumes an exponential decreasing curvey_hat=init+c(1)*exp(c(2).*x);

initDis=-0.1;c0=[.7 0.1]; %assigning the initial values for the fit searchparamfunc = @(c,x)FittingCurveExpGuess(c,x,initDis); %def. of the anonymous functionExpParam=lsqcurvefit(paramfunc,c0,XdataPoints,correl,[0 -1],[1 1],options);

Function name

Initial guess

X data

Y data

Lower bound

upper bound

Page 15: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

15

Step 3: Plot the correlation data and fit

Page 16: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

16

Best of Luck in the Group Meeting !

Page 17: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

17

Best of Luck in the Group Meeting !

Page 18: Yuval Hart, Weizmann 2010© 1 Introduction to Matlab & Data Analysis Final Project: That’s all, Folks!

18

This is the end, my friend, the end

"Louis, I think this is the beginning of a beautiful friendship."