Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
b5c42036
Commit
b5c42036
authored
8 years ago
by
kohleman
Browse files
Options
Downloads
Patches
Plain Diff
-added unified camel case naming for pi names
-added lane info to the pools SVN: 37418
parent
7b4eee9a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
deep_sequencing_unit/source/Jython/create_QGF_Invoices_simplified.py
+36
-11
36 additions, 11 deletions
...cing_unit/source/Jython/create_QGF_Invoices_simplified.py
with
36 additions
and
11 deletions
deep_sequencing_unit/source/Jython/create_QGF_Invoices_simplified.py
+
36
−
11
View file @
b5c42036
...
...
@@ -144,6 +144,14 @@ def merge_two_dicts(x, y):
z
.
update
(
y
)
return
z
def
camel_case_string
(
string
):
full_name
=
""
for
split
in
string
.
split
(
"
_
"
):
full_name
+=
split
[
0
].
upper
()
+
split
[
1
:]
+
"
"
return
full_name
.
strip
()
def
writeHeader
(
sheet
,
myRows
,
wb
,
configMap
,
piName
,
piSpace
):
# Write header
row
=
sheet
.
createRow
(
myRows
.
getNextRow
())
...
...
@@ -153,13 +161,12 @@ def writeHeader(sheet, myRows, wb, configMap, piName, piSpace):
row1
.
createCell
(
0
).
setCellValue
(
getDate
())
row1
.
getCell
(
0
).
setCellStyle
(
setFont
(
wb
,
configMap
,
10
,
True
))
createRow
(
configMap
,
wb
,
sheet
,
myRows
,
"
Principal Investigator
"
,
piName
.
replace
(
"
_
"
,
"
"
),
0
,
10
,
True
,
columnspace
=
1
)
createRow
(
configMap
,
wb
,
sheet
,
myRows
,
"
Principal Investigator
"
,
camel_case_string
(
piName
),
0
,
10
,
True
,
columnspace
=
1
)
createRow
(
configMap
,
wb
,
sheet
,
myRows
,
"
Data Space
"
,
piSpace
,
0
,
10
,
True
,
columnspace
=
1
)
createRow
(
configMap
,
wb
,
sheet
,
myRows
)
createRow
(
configMap
,
wb
,
sheet
,
myRows
,
"
Samples
"
,
""
,
0
,
10
,
True
,
True
)
def
createRow
(
configMap
,
wb
,
sheet
,
myRows
,
key
=
""
,
value
=
""
,
rowNumber
=
0
,
fontSize
=
10
,
boldness
=
False
,
underline
=
False
,
columnspace
=
0
):
if
rowNumber
==
0
:
row
=
sheet
.
createRow
(
myRows
.
getNextRow
())
...
...
@@ -205,9 +212,15 @@ def write_flowcell_details(configMap, flowCellProperties, myRows, sequencerVocab
def
write_samples
(
configMap
,
myRows
,
wb
,
sheet
,
setFont
,
sample
,
sampleValues
,
working_column_headers_dict
):
def
write_samples
(
configMap
,
myRows
,
wb
,
sheet
,
setFont
,
sample
,
sampleValues
,
working_column_headers_dict
,
lane
,
write_lane
=
False
):
singleSampleColumns
=
uniqueColumn
()
rowN
=
sheet
.
createRow
(
myRows
.
getNextRow
())
if
write_lane
:
rowN
.
createCell
(
singleSampleColumns
.
getNextColumn
()).
setCellValue
(
str
(
sampleValues
[
'
LANE
'
]))
rowN
.
getCell
(
singleSampleColumns
.
getCurrentColumn
()).
setCellStyle
(
setFont
(
wb
,
configMap
,
10
))
rowN
.
createCell
(
singleSampleColumns
.
getNextColumn
()).
setCellValue
(
configMap
[
'
sampleCodePrefix
'
]
+
sample
)
rowN
.
getCell
(
singleSampleColumns
.
getCurrentColumn
()).
setCellStyle
(
setFont
(
wb
,
configMap
,
10
))
for
code
,
label
in
working_column_headers_dict
.
iteritems
():
...
...
@@ -249,9 +262,14 @@ def write_intermediate_section(configMap, flowCellProperties, myRows, wb, sheet)
def
write_sample_column_header
(
configMap
,
working_column_headers_dict
,
myRows
,
wb
,
sheet
):
def
write_sample_column_header
(
configMap
,
working_column_headers_dict
,
myRows
,
wb
,
sheet
,
write_lane
=
False
):
myColumns
=
uniqueColumn
()
sampleHeader
=
sheet
.
createRow
(
myRows
.
getNextRow
())
if
write_lane
:
sampleHeader
.
createCell
(
myColumns
.
getNextColumn
()).
setCellValue
(
"
Flowcell:Lane
"
)
sampleHeader
.
getCell
(
myColumns
.
getCurrentColumn
()).
setCellStyle
(
setFont
(
wb
,
configMap
,
10
,
True
))
sampleHeader
.
createCell
(
myColumns
.
getNextColumn
()).
setCellValue
(
"
Sample Code
"
)
sampleHeader
.
getCell
(
myColumns
.
getCurrentColumn
()).
setCellStyle
(
setFont
(
wb
,
configMap
,
10
,
True
))
for
code
,
label
in
working_column_headers_dict
.
iteritems
():
...
...
@@ -334,13 +352,13 @@ def writeExcel(myoptions, configMap, service, piName, laneDict, sampleDict, piDi
write_sample_column_header
(
configMap
,
working_column_headers_dict
,
myRows
,
wb
,
sheet
)
for
reg_sample
in
regular_samples
:
value
=
write_samples
(
configMap
,
myRows
,
wb
,
sheet
,
setFont
,
reg_sample
,
regular_samples
[
reg_sample
],
working_column_headers_dict
)
value
=
write_samples
(
configMap
,
myRows
,
wb
,
sheet
,
setFont
,
reg_sample
,
regular_samples
[
reg_sample
],
working_column_headers_dict
,
lane
)
write_intermediate_section
(
configMap
,
flowCellProperties
,
myRows
,
wb
,
sheet
)
write_sample_column_header
(
configMap
,
working_column_headers_dict
,
myRows
,
wb
,
sheet
)
for
pool
in
pool_samples
:
value
=
write_samples
(
configMap
,
myRows
,
wb
,
sheet
,
setFont
,
pool
,
pool_samples
[
pool
],
working_column_headers_dict
)
write_sample_column_header
(
configMap
,
working_column_headers_dict
,
myRows
,
wb
,
sheet
,
write_lane
=
True
)
for
pool
in
sorted
(
pool_samples
)
:
value
=
write_samples
(
configMap
,
myRows
,
wb
,
sheet
,
setFont
,
pool
,
pool_samples
[
pool
],
working_column_headers_dict
,
lane
,
write_lane
=
True
)
write_flowcell_details
(
configMap
,
flowCellProperties
,
myRows
,
sequencerVocabulary
,
runModeVocabulary
,
flowcell
,
wb
,
sheet
,
createRow
)
...
...
@@ -523,10 +541,17 @@ def getFLowcellData(service, configMap, flowcell, logger):
for
samples
in
laneParents
:
sampleCode
=
samples
.
getCode
()
sampleProperties
=
samples
.
getProperties
()
s
[
sampleCode
.
split
(
"
-
"
)[
-
1
]]
=
sampleProperties
sample_properties_dict
=
{}
for
key
,
value
in
sampleProperties
.
iteritems
():
sample_properties_dict
[
key
]
=
value
sample_properties_dict
[
"
LANE
"
]
=
lane
s
[
sampleCode
.
split
(
"
-
"
)[
-
1
]]
=
sample_properties_dict
sampleDict
[
lane
]
=
s
pi
=
sanitizeString
(
sample
P
roperties
[
configMap
[
"
pIPropertyName
"
]])
invoiceProperty
=
sample
P
roperties
[
'
INVOICE
'
]
pi
=
sanitizeString
(
sample
_p
roperties
_dict
[
configMap
[
"
pIPropertyName
"
]])
invoiceProperty
=
sample
_p
roperties
_dict
[
'
INVOICE
'
]
# if sample got created via Excel upload, the property could be not set, which is represented by None
if
(
invoiceProperty
is
None
):
invoiceProperty
=
'
false
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment