-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDFT_Genome_TriangleMutation_09102013.m
40 lines (30 loc) · 1.34 KB
/
DFT_Genome_TriangleMutation_09102013.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
%==============================================================
% First intron of myeloid cell leukemia protein 1 [Homo sapiens]
%>AAG00896.1 (gid=9857700 : nExons=3 : pLen=350 : intronLen=351,512 pIntronPos=230,313
clear
seq1='GTaagggggttcattaatcgccaaggcctcactcccttttttccatctctccccggactcacccgccaagggtgggttggaaaccgaaacgagtcagtgttgaaacgtgtctcatcctattcctgaagccagaatattctggccatgagtcattgtttccgcccatcttgattcttttggaaatggcagctcttgttcaaagaccggaaagggtgggatgtcaatttcaagtggggtcaacctgagttcgtaaatcccagtagcgattttcccgccgcgggtgggcaggcgaatcttgcgccggtttagacaaaggaggccgtgaggacctgcatgcttttctttctcAG';
N= length(seq1);
% We need to make d mutants in this sequence
randN = randperm(N);
distV=zeros(1,100);
len=zeros(1,100);
for(d=1:100)
len(d)=d;
pos=randN(1:d);
seq=mutateDNAMultiple(seq1,pos);
dist=getDistFFTGeneScale(seq1,seq);
distV(d)=dist;
end
titleText='Distance vs point mutation';
figure
plot(len,distV)
xlabel('Number of point mutations','FontSize',8,'FontWeight','bold');
ylabel('Distance','FontSize',8,'FontWeight','bold');
title(titleText,'FontSize',8,'FontWeight','bold');
hold on
temp = polyfit(len,distV,1)
a1 = temp(2) % y-intercept of the fitted line
a2 = temp(1) % slope of fitted lines
fit = a1+a2*len;
plot(len,fit,'g') % keep the first graph up while we plot the fitted line
legend('Distance','Regression')