forked from BIMIB-DISCo/scFBA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeSCdataset.m
57 lines (51 loc) · 1.55 KB
/
makeSCdataset.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
function [scStruct] = makeSCdataset(PoolExp, ExpGxC_SC, CellType, Gene_Names, epsilon)
% Preprocess dataset of single cell transcriptomic profiles to run scFBA
% functions.
%
% USAGE:
%
% scStruct = makeSCdataset(PoolExp, ExpGxC_SC, CellType, Gene_Names, epsilon)
%
% INPUT:
% PoolExp: Vector with expression profile of Pooled or Bulk
% cells.
% ExpGxC_SC: matrix genes x cells with TPM or RPKM or any other
% values for the single cell expression levels NOT
% log scaled.
% CellType: Identifier of each single cells.
% Gene_Names: Identifier of each genes. The format must be the
% same as the gene identifier used in metabolic model.
% OPTIONAL INPUTS:
% epsilon: value to add on each single cells expression level
%
% OUTPUTS:
% scStruct: Single Cells dataset in a structure built with makeSCdataset function.
%
%
% .. Author:
% - Davide Maspero 30/01/2018
if nargin < 5
epsilon = 0;
end
if size(CellType, 1)>1
scStruct.CellType = CellType;
else
scStruct.CellType = CellType';
end
if size(Gene_Names, 1)>1
scStruct.GenName = Gene_Names;
else
scStruct.GenName = Gene_Names';
end
if size(PoolExp, 1)==1
scStruct.TPMpl = PoolExp;
else
scStruct.TPMpl = PoolExp';
end
if size(ExpGxC_SC, 1)==size(CellType, 1)
scStruct.TPMsc = ExpGxC_SC;
else
scStruct.TPMsc = ExpGxC_SC';
end
scStruct.TPMsc = scStruct.TPMsc + epsilon;
end