Mangle
Modify assay CSV files to simulate poor formatting.
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
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
_load_people(filename)
Read people and rearrange to {ident: data} dictionary.
Source code in src/snailz/mangle.py
31 32 33 34 35 36 37 38 | |
_mangle_assay(people, data)
Mangle a single assay file.
Source code in src/snailz/mangle.py
41 42 43 44 45 46 47 | |
_mangle_id(data, people)
Convert ID field to string.
Source code in src/snailz/mangle.py
50 51 52 53 54 55 56 | |
_mangle_indent(data, people)
Indent data portion.
Source code in src/snailz/mangle.py
59 60 61 | |
_mangle_person(data, people)
Replace person identifier with name.
Source code in src/snailz/mangle.py
64 65 66 67 68 69 70 | |