diff options
| author | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-10-02 12:40:46 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-10-02 12:40:46 -0500 |
| commit | 4b994236f4d9457a6e4da0ce3b49d3da102b7583 (patch) | |
| tree | 47aea05727db6175dd1f1d32e16319407ec4f4be /scripts | |
| parent | ae185c819f0bb7b31faacf8105cbfd885da752e2 (diff) | |
| download | gn-uploader-4b994236f4d9457a6e4da0ce3b49d3da102b7583.tar.gz | |
Narrow data collected about file(s).
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/genotypes/preprocess_csv_collect_info.py | 12 | ||||
| -rw-r--r-- | scripts/genotypes/types.py | 4 |
2 files changed, 3 insertions, 13 deletions
diff --git a/scripts/genotypes/preprocess_csv_collect_info.py b/scripts/genotypes/preprocess_csv_collect_info.py index 9813f34..5c51e20 100644 --- a/scripts/genotypes/preprocess_csv_collect_info.py +++ b/scripts/genotypes/preprocess_csv_collect_info.py @@ -164,21 +164,15 @@ def file_statistics(filepath: Path, fileconfigs: dict) -> FileStats: logger.debug("THE FILE HEADERS: %s", headers) col_ids = identify_columns(headers, fileconfigs) _errors = validate_headers(headers, fileconfigs) - stats: dict = { - "data_lines": 0, - "total_lines": 0, - "blank_lines": 0, - "comment_lines": 0, - "dot_geno_lines": 0 - } _markers: tuple[str, ...] = tuple() + _data_lines = 0 genosymbols: set[str] = set() # NOTES: Maybe do the .geno file custom fields check in a separate script? lines = read_csv_file( filepath, fileconfigs["separator"], _is_skippable_line_) for line in lines: - stats["data_lines"] += 1 + _data_lines += 1 if line == headers: continue# skip headers line @@ -203,7 +197,7 @@ def file_statistics(filepath: Path, fileconfigs: dict) -> FileStats: continue # end of line processing return FileStats( - **stats, + data_lines=_data_lines, geno_symbols=tuple(genosymbols), samples_list=col_ids.samples, markers_list=_markers, diff --git a/scripts/genotypes/types.py b/scripts/genotypes/types.py index 077e90e..7f0e6cb 100644 --- a/scripts/genotypes/types.py +++ b/scripts/genotypes/types.py @@ -57,12 +57,8 @@ class UntransposedLineDetails: class FileStats:# pylint: disable=[too-many-instance-attributes] """Custom file statistics.""" data_lines: int - total_lines: int geno_symbols: Sequence[str] - blank_lines: int = 0 - comment_lines: int = 0 - dot_geno_lines: int = 0 samples_list: Sequence[str] = field(default_factory=tuple) markers_list: Sequence[str] = field(default_factory=tuple) errors: Sequence[LineError] = field(default_factory=tuple) |
