diff options
| author | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-09-28 12:20:20 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-09-28 12:20:20 -0500 |
| commit | c30c0924eaa5ddbb3d7fecc4c238acd832d8dd3a (patch) | |
| tree | de8fc8d5f6e515f539c3fcff655f11e4cf57ba3d /scripts/genotypes | |
| parent | 750398b0814af3853130f3f9943b02029f59360c (diff) | |
| download | gn-uploader-c30c0924eaa5ddbb3d7fecc4c238acd832d8dd3a.tar.gz | |
Add function to read file contents.
Diffstat (limited to 'scripts/genotypes')
| -rw-r--r-- | scripts/genotypes/preprocess_csv_collect_info.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/genotypes/preprocess_csv_collect_info.py b/scripts/genotypes/preprocess_csv_collect_info.py index f5d3418..a6671ff 100644 --- a/scripts/genotypes/preprocess_csv_collect_info.py +++ b/scripts/genotypes/preprocess_csv_collect_info.py @@ -17,6 +17,13 @@ from .types import FileStats, LineDetails, DotGenoFields, FieldsIdentity logger = logging.getLogger(__name__) +def filecontents(path: Path) -> Iterator[str]: + """Return an iterator to the file contents""" + with path.open("r") as fl: + for line in fl.readlines(): + yield line + + def identify_columns( fields: tuple[str, ...], settings: dict[str, str] |
