Mangle
Utilities for modifying assay CSV files.
This module provides functions for modifying assay CSV files, including reassigning people who performed assays.
mangle_assays(assays_dir, people_file)
Create 'raw' assay files by mangling data of pristine files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
assays_dir
|
str
|
Directory containing assay CSV files |
required |
people_file
|
str
|
Path to the people JSON file |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If people data cannot be loaded or no people are found |
Source code in src/snailz/mangle.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
_load_people(people_file)
Read people and rearrange to {ident: data} dictionary.
Source code in src/snailz/mangle.py
36 37 38 39 40 41 42 43 | |
_mangle_assay(filename, people, data)
Mangle a single assay file.
Source code in src/snailz/mangle.py
46 47 48 49 50 51 52 53 54 | |
_mangle_id(filename, data, people)
Convert ID field to string.
Source code in src/snailz/mangle.py
57 58 59 60 61 62 63 | |
_mangle_indent(filename, data, people)
Indent data portion.
Source code in src/snailz/mangle.py
66 67 68 69 70 | |
_mangle_person(filename, data, people)
Replace person identifier with name.
Source code in src/snailz/mangle.py
73 74 75 76 77 78 79 80 81 | |