Added source Matlab code for reference
This commit is contained in:
parent
b8af977117
commit
b5d99903d2
186 changed files with 61405 additions and 1 deletions
19
matlab/linkage/xls2structure.m
Normal file
19
matlab/linkage/xls2structure.m
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
function xls2structure(source, target)
|
||||
% XLS2STRUCTURE converts a MLST data in xls format into a Structure data
|
||||
|
||||
[data, component_mat, popnames] = processxls(source);
|
||||
|
||||
data = data(:,[1:end-1]);
|
||||
[ninds, nloci] = size(data);
|
||||
|
||||
fid = fopen(target,'w');
|
||||
if (fid ~= -1)
|
||||
for i = 1:ninds
|
||||
fprintf(fid,'%s\t', popnames{i,1}{1});
|
||||
for j = 1:nloci
|
||||
fprintf(fid,'%d\t',data(i,j));
|
||||
end
|
||||
fprintf(fid,'\n');
|
||||
end
|
||||
end
|
||||
fclose(fid);
|
||||
Loading…
Add table
Add a link
Reference in a new issue