diff options
-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)) |