diff options
author | Frederick Muriuki Muriithi | 2024-02-16 14:13:39 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-02-16 16:48:40 +0300 |
commit | 6e3d4c5cf0c9f4b6f468092730e4b6b22f7e5170 (patch) | |
tree | 4d1de5209eea5931c03812fcd111afc15e9277d0 /r_qtl/r_qtl2.py | |
parent | 2931d48a5fd982f83c084c7db723bef6af34b21d (diff) | |
download | gn-uploader-6e3d4c5cf0c9f4b6f468092730e4b6b22f7e5170.tar.gz |
Strip comment lines.
Diffstat (limited to 'r_qtl/r_qtl2.py')
-rw-r--r-- | r_qtl/r_qtl2.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/r_qtl/r_qtl2.py b/r_qtl/r_qtl2.py index 93ce56c..e4c1894 100644 --- a/r_qtl/r_qtl2.py +++ b/r_qtl/r_qtl2.py @@ -302,3 +302,7 @@ def raw_file_data(zipfilepath: Union[str, Path], wrappedfile = io.TextIOWrapper(innerfile) for line in wrappedfile: yield line.strip() + +def strip_comments(rawdata: Iterator[str], commentchar) -> Iterator[str]: + """Remove comments from raw text.""" + return (line for line in rawdata if not line.startswith(commentchar)) |