Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Carlos-Francisco Méndez-Cruz
/
automatic-extraction-growth-conditions
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Carlos-Francisco Méndez-Cruz
2018-10-12 18:05:53 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0552c74b1dbd44b2dd000056f09f447d3e205520
0552c74b
1 parent
e63b97f8
Transform soft file in XML file
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
scripts/extract-manually-tagged-gcs.py
scripts/extract-manually-tagged-gcs.py
View file @
0552c74
...
...
@@ -98,13 +98,13 @@ if __name__ == "__main__":
hashGcs
[
serie
][
sample
][
tag
]
=
[
content
]
#print("New tag: {} and content: {}".format(tag, content.encode(encoding='utf-8', errors='replace')))
# print(hashGcs)
tags
=
[
"Technique"
,
"Orgn"
,
"Strain"
,
"Substrain"
,
"Gversion"
,
"Gtype"
,
"Phase"
,
"
Phase"
,
"Air"
,
"Med"
,
"Temp"
,
"Supp
"
]
tags
=
[
"Technique"
,
"Orgn"
,
"Strain"
,
"Substrain"
,
"Gversion"
,
"Gtype"
,
"Phase"
,
"
Air"
,
"Med"
,
"Temp"
,
"Supp"
,
"pH"
,
"Press"
,
"OD"
,
"Rate"
,
"Vess"
,
"Agit"
,
"Name"
,
"Anti
"
]
#with open(os.path.join(options.outputPath, f.replace(".xml", ".report.csv")), "w", encoding="utf-8") as oFile:
with
open
(
os
.
path
.
join
(
options
.
outputPath
,
f
.
replace
(
".xml"
,
".report.csv"
)),
"w"
)
as
oFile
:
output
=
'
Serie
\t
Sample
\t
'
output
=
'
"Serie","Sample",
'
for
tag
in
tags
:
output
=
output
+
tag
+
'
\t
'
output
=
output
.
rstrip
(
'
\t
'
)
output
=
output
+
'"'
+
tag
+
'",
'
output
=
output
.
rstrip
(
'
,
'
)
oFile
.
write
(
output
+
"
\n
"
)
for
serie
,
hashSample
in
hashGcs
.
items
():
print
(
"Serie: {}"
.
format
(
serie
))
...
...
@@ -117,10 +117,10 @@ if __name__ == "__main__":
else
:
pTags
.
append
(
''
)
output
=
'
{}
\t
{}
\t
'
.
format
(
serie
,
sample
)
output
=
'
"{}","{}",
'
.
format
(
serie
,
sample
)
for
tag
in
pTags
:
output
=
output
+
tag
+
'
\t
'
output
=
output
.
rstrip
(
'
\t
'
)
output
=
output
+
'"'
+
tag
+
'",
'
output
=
output
.
rstrip
(
'
,
'
)
oFile
.
write
(
output
+
"
\n
"
)
# oFile.write("{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\n".format(sample, serie, Technique, Orgn, Strain, Substrain, Gversion, Gtype, Phase, Air, Med, Temp, Supp))
# for tag, listContent in sorted(hashTag.items()):
...
...
Please
register
or
login
to post a comment