Skip to content

Commit 5840c21

Browse files
authored
Add handling for negative values (issue #11)
1 parent 4d1aa93 commit 5840c21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

matlab/CodeWebTool.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@
7575
error('data.value does not have the same number of rows as data.gene')
7676
end
7777

78+
% If there are negative values, shift positive
79+
if any(any(data.value <= 0))
80+
warning('there are negative expression values, adding mininmum + 1e-2 to all values')
81+
data.value = data.value + abs(min(min(data.value))) + 1e-2;
82+
end
83+
7884
% get the threshold value and the histogram for the complete dataset and
7985
% print a figure
8086
if SampleNumber>1

0 commit comments

Comments
 (0)