-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmt_plot_density.m
More file actions
47 lines (40 loc) · 1.19 KB
/
mt_plot_density.m
File metadata and controls
47 lines (40 loc) · 1.19 KB
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
41
42
43
44
45
46
%MT_PLOT_DENSITY - Plots signal density w.r.t intensity
%
% MT_PLOT_CORR(PROBES,VARARGIN)
%
% INPUT
% PROBES Probe structure
% VARARGIN %
%
% DESCRIPTION
% Plots density of signal w.r.t. expression intensity
% Algorithm is a bit crude (histogram counting)
%
% SEE ALSO
% MT_COR_IMAGE, MT_PLOT_SEQ_EFFECTS, MT_PLOT_AMP_EFFECTS, MT_PLOT_GENE
%
% (c) Marc Hulsman, 2011
% Delft Bioinformatics Lab
% Faculty of Electrical Engineering, Mathematics and Computer Science
% Delft University of Technology, Mekelweg 4, 2628 CD Delft, The Netherlands
function res = mt_plot_density(probes)
signal = mt_real_signal(probes);
start = floor(min(min(signal)));
stop = ceil(max(max(signal)));
k = histc(signal',start:0.1:stop);
x = jet(size(signal,1));
formats = {'-' ,':', '-.', '--'};
for i = 1:size(signal,1)
plot(k(:,i),formats{mod(i, 4) + 1}, 'Color',x(i,:));
hold on;
end;
hold off;
xlabs = start:0.1:stop;
set(gca,'XTick',[1:10:length(xlabs)]);
set(gca,'XTickLabel',xlabs(1:10:length(xlabs)));
xlabel('Log2 expression')
ylabel('Probe count')
title('Signal density');
if(size(signal,1) < 30)
legend(probes.array_names, 'Location', 'EastOutside');
end;