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 29 |
|
_load_people(filename)
Read people and rearrange to {ident: data} dictionary.
Source code in src/snailz/mangle.py
32 33 34 35 36 37 38 39 |
|
_mangle_assay(people, data)
Mangle a single assay file.
Source code in src/snailz/mangle.py
42 43 44 45 46 47 48 |
|
_mangle_id(data, people)
Convert ID field to string.
Source code in src/snailz/mangle.py
51 52 53 54 55 56 57 |
|
_mangle_indent(data, people)
Indent data portion.
Source code in src/snailz/mangle.py
60 61 62 |
|
_mangle_person(data, people)
Replace person identifier with name.
Source code in src/snailz/mangle.py
65 66 67 68 69 70 71 |
|