Commit 28292999 authored by Georgi Tushev's avatar Georgi Tushev
Browse files

add RUVg norm

parent 220d63ec
InputHc2 InputHc3 80SHc2 80SHc3 2and3Hc2 2and3Hc3 4and5Hc2 4and5Hc3 6and7Hc2 6and7Hc3 bigger7Hc2 bigger7Hc3
ID InputHc2 InputHc3 80SHc2 80SHc3 2and3Hc2 2and3Hc3 4and5Hc2 4and5Hc3 6and7Hc2 6and7Hc3 bigger7Hc2 bigger7Hc3
fwdgroup00000165 8 18 27 25 18 19 21 32 18 13 7 7
fwdgroup00000167 617 617 229 270 378 391 623 761 499 472 212 216
fwdgroup00000179 13 9 0 9 4 5 16 13 14 10 4 2
......@@ -3,6 +3,43 @@ clc
clear variables
close all
tmp = readCountTable('countTable_UTRPolysomes_RUVg_22Nov2017.txt');
x = tmp.counts(:,1:2);
y = tmp.counts(:,3:2:end);
z = tmp.counts(:,4:2:end);
m = (y + z)./2;
mr = m ./ sum(m, 2);
w = [1,2.5,4.5,6.5,7.5];
scr = sum(bsxfun(@times, mr, w./mean(w)),2);
atest = {'fwdgroup00444122',...
'fwdgroup00444136',...
'fwdgroup00444148',...
'fwdgroup00444188',...
'fwdgroup00444190',...
'fwdgroup00444192'};
[~,idxRef] = intersect(tmp.label, atest);
N = 10;
idx = kmeans(mr,N);
clrmtx = jet(N);
figure('color','w');
hold on;
for k = 1 : N
plot((1:5),median(mr(idx==k,:)),'color',clrmtx(k,:));
end
hold off;
%{
%% read stats file
stats = readCountTable('countTable_UTRPolysomes_Stats_21Nov2017.txt');
......@@ -27,30 +64,32 @@ ercc.weight = ercc.volume ./ ercc.dilution;
ercc.mix = repmat(ercc.mix1,1,size(ercc.counts,2));
ercc.conc = bsxfun(@times, ercc.mix, ercc.weight);
[~,idxQry, idxRef] = intersect(ercc.label, ercc.ref);
X = ercc.conc(idxRef,:);
Y = ercc.counts(idxQry,:);
idxFilter = (sum(Y >= 5, 2) >= 2);
X = X(idxFilter,:);
Y = Y(idxFilter,:);
c = pca(Y);
[~,idxQry, idxRef] = intersect(ercc.label, ercc.ref);
Ysmth = smooth(X(:),Y(:),'lowess');
Ysmth = reshape(Ysmth, size(Y));
figure('color','w');
clrmtx = jet(12);
%% example variation, raw counts
tmp = Y+1;
tmpr = bsxfun(@rdivide, tmp, median(tmp(:)));
figure('color','w')
hold on;
for k = 1 : size(ercc.counts,2)
X = ercc.counts(idxQry,k);
Y = ercc.conc(idxRef,k);
idxFilter = X < 5;
X(idxFilter) = [];
Y(idxFilter) = [];
plot(log2(X),log2(Y),'.','Color',clrmtx(k,:));
p = polyfit(log2(X),log2(Y),1);
Xfit = linspace(2,16,100);
Yfit = polyval(p,Xfit);
plot(Xfit,Yfit,'color',clrmtx(k,:));
end
plot([0,13],[0,0],'k');
boxplot(log2(tmpr),'color',[.45,.45,.45]);
hold off;
set(gca,'XTickLabel',ercc.header(2:end),...
'XTickLabelRotation',45);
%}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment