Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Antonio Politi
NPCMaturation
Commits
d38502a0
Commit
d38502a0
authored
Apr 02, 2017
by
Antonio Politi
Browse files
writing of annotation
* fix of wrinting * tool for writing
parent
69ee337c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
expdata/livecellCalibrated/livecelldataProcess.R
deleted
100644 → 0
View file @
69ee337c
This diff is collapsed.
Click to expand it.
matlabcode/FCS/writeAnnotationResfile2xml.m
0 → 100644
View file @
d38502a0
function
writeAnnotationResfile2xml
(
resfile
,
FAsession
)
if
nargin
<
1
[
resfile
,
pathname
]
=
uigetfile
({
'*.res'
;
'*.*'
},
'Select res file'
,
''
);
if
~
resfile
return
end
resfile
=
fullfile
(
pathname
,
resfile
);
end
[
pathname
,
resbase
,
ext
]
=
fileparts
(
resfile
);
[
tmp
,
dirname
]
=
fileparts
(
pathname
);
if
nargin
<
2
FAsession
=
resbase
;
FAsession
=
'2c'
end
restable
=
readtable
(
resfile
,
'Delimiter'
,
'\t'
,
'Header'
,
1
,
'FileType'
,
'text'
,
'TreatAsEmpty'
,{
'NA'
});
xmlFAfiles
=
strrep
(
restable
.
FullPath
,
[
'.zen'
],
[
'.zen.'
FAsession
'.xml'
]);
for
iD
=
1
:
length
(
xmlFAfiles
)
fprintf
(
'%s Writing annotation of file %d/%d\n'
,
resfile
,
iD
,
length
(
xmlFAfiles
))
if
~
exist
(
xmlFAfiles
{
iD
})
% search locally
[
m
,
iend
]
=
regexp
(
xmlFAfiles
{
iD
},
dirname
,
'match'
,
'end'
);
xmlfile
=
fullfile
(
pathname
,
xmlFAfiles
{
iD
}(
iend
+
1
:
end
));
else
xmlfile
=
xmlFAfiles
{
iD
};
end
if
~
exist
(
xmlfile
)
error
(
'Coul not find file'
);
end
node
=
xmlFA
.
readnode
(
xmlfile
);
% [path1, fout, ext] = fileparts(xmlfile);
% [path, fout, ext] = fileparts(fout);
%
% fname_out = fullfile(path1, sprintf('%s.test.xml', fout));
if
iscell
(
restable
.
Annotation
)
ann
=
restable
.
Annotation
{
iD
};
else
ann
=
restable
.
Annotation
(
iD
);
end
if
isnan
(
ann
)
xmlFA
.
writeannotation
(
node
,
32
);
else
xmlFA
.
writeannotation
(
node
,
ann
);
end
xmlFA
.
writenode
(
xmlfile
,
node
);
end
end
matlabcode/FCS/xmlFA.m
View file @
d38502a0
...
...
@@ -18,7 +18,7 @@ classdef xmlFA
node
=
nodes
.
item
(
i
);
switch
(
char
(
node
.
item
(
1
)
.
getTextContent
))
case
'm_nAnnotation'
ann
=
str2num
(
node
.
item
(
3
)
.
getTextContent
);
ann
=
char
(
node
.
item
(
3
)
.
getTextContent
);
break
;
end
end
...
...
@@ -31,8 +31,17 @@ classdef xmlFA
node
=
nodes
.
item
(
i
);
switch
(
char
(
node
.
item
(
1
)
.
getTextContent
))
case
'm_nAnnotation'
node
.
item
(
3
)
.
setTextContent
(
num2str
(
ann
));
break
;
if
isempty
(
ann
)
node
.
item
(
3
)
.
setTextContent
(
'32'
);
break
else
if
ischar
(
ann
)
node
.
item
(
3
)
.
setTextContent
(
num2str
(
double
(
ann
)));
else
node
.
item
(
3
)
.
setTextContent
(
num2str
(
ann
));
end
break
;
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment