Skip to content

Commit

Permalink
works with latest ruamel, dump fn now is a obj.method
Browse files Browse the repository at this point in the history
  • Loading branch information
adRn-s committed Feb 15, 2024
1 parent d96c6df commit 33c433a
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/dissectBCL/fakeNews.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,21 +581,30 @@ def organiseLogs(flowcell, sampleSheet):
mvFile
)
shutil.move(fileIn, fileOut)

# Write out ssdf.
outssdf = os.path.join(_logDir, 'sampleSheetdf.tsv')
sampleSheet.ssDic[outLane]['sampleSheet'].to_csv(outssdf, sep='\t')
# Write out the yaml files.
yaml = ruamel.yaml.YAML()
yaml.indent(mapping=2, sequence=4, offset=2)

# write out outLaneInfo.yaml
dic0 = sampleSheet.ssDic[outLane]
del dic0['sampleSheet']
yaml0 = ruamel.yaml.YAML()
yaml0.indent(mapping=2, sequence=4, offset=2)
outLaneInfo = os.path.join(_logDir, 'outLaneInfo.yaml')
dic = sampleSheet.ssDic[outLane]
del dic['sampleSheet']
with open(outLaneInfo, 'w') as f:
ruamel.yaml.dump(dic, f)
yaml0.dump(dic0, f)

# write out config.ini
dic1 = flowcell.asdict()
flowcellConfig = os.path.join(_logDir, 'config.ini')
with open(flowcellConfig, 'w') as f:
dic1['config'].write(f)

# write out flowcellInfo.yaml
del dic1['config']
yaml1 = ruamel.yaml.YAML()
yaml1.indent(mapping=2, sequence=4, offset=2)
flowcellInfo = os.path.join(_logDir, 'flowcellInfo.yaml')
dic = flowcell.asdict()
with open(flowcellInfo, 'w') as f:
ruamel.yaml.dump(dic, f)
yaml1.dump(dic1, f)

0 comments on commit 33c433a

Please sign in to comment.