Skip to content
Snippets Groups Projects
Commit c0f02ae9 authored by Blaise Li's avatar Blaise Li
Browse files

Avoid bytes and spurious white characters.

parent 62fc689a
Branches
No related tags found
No related merge requests found
......@@ -56,11 +56,10 @@ echo -e "${{rate}}\\t{snakemake.params.these_settings}" >> {snakemake.params.rat
def split_on_tab(s):
# https://stackoverflow.com/a/15095537/1878788
return s.split(b'\t')
return s.strip().split("\t")
with NamedTemporaryFile() as fastq, NamedTemporaryFile() as rates_record:
with NamedTemporaryFile() as fastq, NamedTemporaryFile(mode="w+t") as rates_record:
snakemake.params.fastq = fastq.name
# Take the first 10000 reads from the input
# https://stackoverflow.com/a/46621920/1878788
......@@ -75,7 +74,7 @@ with NamedTemporaryFile() as fastq, NamedTemporaryFile() as rates_record:
for (rate, settings)
in map(split_on_tab, rates_record))
with open(snakemake.output.mapping_params, "w") as fh:
fh.write(f"{best_settings}\t({best_rate}%%)\n")
fh.write(f"{best_settings}\t({best_rate}%)\n")
if hasattr(snakemake.output, "methods"):
shell(f"cp {snakemake.input.methods} {snakemake.output.methods}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment