aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Amstutz2020-04-20 17:25:37 -0400
committerPeter Amstutz2020-04-20 17:25:37 -0400
commitcc557a64bb489bb39c3abf932a6cdfb87ad4a383 (patch)
treee219cc6df02b4d3c58fc44eab02f4f66c83a801a
parent5f44da5804547088d0f39d0687d81598598eebe5 (diff)
downloadbh20-seq-resource-cc557a64bb489bb39c3abf932a6cdfb87ad4a383.tar.gz
bh20-seq-resource-cc557a64bb489bb39c3abf932a6cdfb87ad4a383.tar.lz
bh20-seq-resource-cc557a64bb489bb39c3abf932a6cdfb87ad4a383.zip
Make sure there is a newline in relabeled fasta (but no blank lines)
-rw-r--r--workflows/pangenome-generate/relabel-seqs.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/workflows/pangenome-generate/relabel-seqs.py b/workflows/pangenome-generate/relabel-seqs.py
index b558fe2..1188ceb 100644
--- a/workflows/pangenome-generate/relabel-seqs.py
+++ b/workflows/pangenome-generate/relabel-seqs.py
@@ -12,4 +12,7 @@ for i, r in enumerate(reads):
data = fa.read(8096)
while data:
relabeled_fasta.write(data)
+ endswithnewline = data.endswith("\\n")
data = fa.read(8096)
+ if not endswithnewline:
+ relabeled_fasta.write("\\n")