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

Default split not appropriate.

parent 8701a22f
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,11 @@ echo -e "${{rate}}\\t{snakemake.params.these_settings}" >> {snakemake.params.rat ...@@ -54,6 +54,11 @@ echo -e "${{rate}}\\t{snakemake.params.these_settings}" >> {snakemake.params.rat
return run_with_modules(shell_commands, modules) return run_with_modules(shell_commands, modules)
return shell_commands return shell_commands
def split_on_tab(s):
return s.split("\t")
with NamedTemporaryFile() as fastq, NamedTemporaryFile() as rates_record: with NamedTemporaryFile() as fastq, NamedTemporaryFile() as rates_record:
snakemake.params.fastq = fastq.name snakemake.params.fastq = fastq.name
# Take the first 10000 reads from the input # Take the first 10000 reads from the input
...@@ -67,7 +72,7 @@ with NamedTemporaryFile() as fastq, NamedTemporaryFile() as rates_record: ...@@ -67,7 +72,7 @@ with NamedTemporaryFile() as fastq, NamedTemporaryFile() as rates_record:
(best_rate, best_settings) = max( (best_rate, best_settings) = max(
(float(rate), settings) (float(rate), settings)
for (rate, settings) for (rate, settings)
in map(bytes.split, rates_record)) in map(split_on_tab, rates_record))
with open(snakemake.output.mapping_params, "w") as fh: with open(snakemake.output.mapping_params, "w") as fh:
fh.write(f"{best_params}\t({best_rate}%%)\n") fh.write(f"{best_params}\t({best_rate}%%)\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment