aboutsummaryrefslogtreecommitdiff
path: root/r_qtl
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-02-16 14:13:39 +0300
committerFrederick Muriuki Muriithi2024-02-16 16:48:40 +0300
commit6e3d4c5cf0c9f4b6f468092730e4b6b22f7e5170 (patch)
tree4d1de5209eea5931c03812fcd111afc15e9277d0 /r_qtl
parent2931d48a5fd982f83c084c7db723bef6af34b21d (diff)
downloadgn-uploader-6e3d4c5cf0c9f4b6f468092730e4b6b22f7e5170.tar.gz
Strip comment lines.
Diffstat (limited to 'r_qtl')
-rw-r--r--r_qtl/r_qtl2.py4
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))