-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshort_strain_name.m
executable file
·61 lines (34 loc) · 1.19 KB
/
short_strain_name.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
58
59
function converted_names = short_strain_name(input_names)
% The SHORT_STRAIN_NAME converts the strains that have different '_'
% appendages to the same unique strain name identifier.
% To update strain list, find the original 'short_strain_conv.xlsx' file.
% Created by KL 20150703
%% LOAD strain conversion table
load('unique_strains_figure_table.mat');
master_list = output;
%% Determine if input_names isacell
TF = iscell(input_names);
%% Assign label name from construct or wildcard name
construct_name = master_list(:,1);
other_name = master_list(:,2);
if TF==1
for iNum = 1:length(input_names)
new_name = strcmp(input_names{iNum}, construct_name);
idx = find(new_name(:,1)==1);
try
temp_label{iNum} = other_name{idx};
catch
temp_label{iNum} = input_names{iNum};
end
end
converted_names = temp_label;
else
new_name = strcmp(input_names, construct_name);
idx = find(new_name(:,1)==1);
try
temp_label = other_name{idx};
catch
temp_label = input_names;
end
converted_names = temp_label;
end