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

add analysis

parent 1e70bd49
% polyribosomeAnalysis
clc
clear variables
close all
%% read stats file
stats = readCountTable('countTable_UTRPolysomes_Stats_21Nov2017.txt');
%% read ercc file
ercc = readCountTable('countTable_UTRPolysomes_ERCC_21Nov2017.txt');
%% read UTRs file
fh = fopen('countTable_UTRPolysomes_UTRs_21Nov2017.txt', 'r');
header = fgetl(fh);
header = regexp(header, '\t', 'split');
fmt = repmat({'%n'}, length(header), 1);
fmt(1:3) = {'%s'};
fmt = sprintf('%s ', fmt{:});
fmt(end) = [];
txt = textscan(fh, fmt, 'delimiter', '\t');
fclose(fh);
data.passid = txt{1};
data.symbol = txt{2};
data.feature = txt{3};
data.window = txt{4};
data.span = txt{5};
data.reads = txt{6};
data.counts = [txt{7:end}];
function data = readCountTable(fileName)
% READCOUNTTABLE
fh = fopen(fileName, 'r');
header = fgetl(fh);
data.header = regexp(header, '\t', 'split');
fmt = repmat({'%n'}, length(data.header), 1);
fmt(1) = {'%s'};
fmt = sprintf('%s ', fmt{:});
fmt(end) = [];
txt = textscan(fh, fmt, 'delimiter', '\t');
fclose(fh);
data.label = txt{1};
data.counts = [txt{2:end}];
end
Supports Markdown
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