Skip to content

Commit

Permalink
Merge pull request #36 from UMCUGenetics/hotfix/v1.5.1
Browse files Browse the repository at this point in the history
Hotfix - v1.5.1
  • Loading branch information
rernst authored Jan 25, 2022
2 parents 4744c39 + dd6aef4 commit 2539225
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
16 changes: 13 additions & 3 deletions clarity_epp/export/caliper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Caliper export functions."""
import string

from genologics.entities import Process

Expand Down Expand Up @@ -187,6 +188,15 @@ def samplesheet_dilute(lims, process_id, output_file):
volume_water=ul_water
)

# Write output, sort by well
for well in clarity_epp.export.utils.sort_96_well_plate(output.keys()):
output_file.write(output[well])
wells = []
for col in range(1, 13):
wells.extend(['{}{}'.format(row, str(col)) for row in string.ascii_uppercase[:8]])

for well in wells:
if well in output:
output_file.write(output[well])
else:
output_file.write('Leeg\tNone\t{well}\t{plate_id_output}\t0\t0\n'.format(
well=well,
plate_id_output=output_artifact.location[0].name,
))
6 changes: 3 additions & 3 deletions clarity_epp/export/magnis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ def samplesheet(lims, process_id, output_file):
well_strip[placement] = artifact.name

# Write Header
output_file.write('sample_id\tinstrument_name\n')
output_file.write('sampleInstrument\n')

# Write samples
for well in clarity_epp.export.utils.sort_96_well_plate(well_strip.keys()):
output_file.write('{sample}\t{instrument_name}\n'.format(
output_file.write('{sample}{instrument_name}\n'.format(
sample=well_strip[well],
instrument_name=process.udf['Instrument naam']
instrument_name=process.udf['Instrument naam'].capitalize()
))
7 changes: 5 additions & 2 deletions clarity_epp/export/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ def sample_indications(lims, output_file, artifact_name=None, sequencing_run=Non
output_file.write('Sample\tIndication\n')
for sample_name, sample in samples.items():
output_file.write(
'{sample}\t{indication}\n'.format(sample=sample_name, indication=sample.udf['Dx Onderzoeksindicatie'])
'{sample}\t{indication}\n'.format(
sample=sample_name,
indication=sample.udf['Dx Onderzoeksindicatie'].split(';')[0] # select newest indication
)
)
else:
print("Can't find sample(s).")
print("no_sample_found")
10 changes: 5 additions & 5 deletions clarity_epp/qc/illumina.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ def set_avg_q30(lims, process_id):
process = Process(lims, id=process_id)
artifact = process.analytes()[0][0]

if all([udf in artifact.udf for udf in ['% Bases >=Q30 R1', 'Yield PF (Gb) R1', '% Bases >=Q30 R2', 'Yield PF (Gb) R2']]):
r1_q30 = artifact.udf['% Bases >=Q30 R1']
r1_yield = artifact.udf['Yield PF (Gb) R1']
r2_q30 = artifact.udf['% Bases >=Q30 R2']
r2_yield = artifact.udf['Yield PF (Gb) R2']
if all([udf in artifact.container.udf for udf in ['% Bases >=Q30 R1', 'Yield PF (Gb) R1', '% Bases >=Q30 R2', 'Yield PF (Gb) R2']]):
r1_q30 = artifact.container.udf['% Bases >=Q30 R1']
r1_yield = artifact.container.udf['Yield PF (Gb) R1']
r2_q30 = artifact.container.udf['% Bases >=Q30 R2']
r2_yield = artifact.container.udf['Yield PF (Gb) R2']

average_q30 = (r1_q30*r1_yield + r2_q30*r2_yield) / (r1_yield+r2_yield)

Expand Down

0 comments on commit 2539225

Please sign in to comment.