From 7dd7b3ed6e56c178ee240b4cf38f5aa396eb2877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Pleva=C4=8D?= Date: Wed, 15 Nov 2023 19:30:55 +0100 Subject: [PATCH] Print label in ascii pritn --- src/SIMDDNA/ascii.py | 12 +++++++++++- src/SIMDDNA/register.py | 12 ++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/SIMDDNA/ascii.py b/src/SIMDDNA/ascii.py index 6d7dcfb..e0379b5 100644 --- a/src/SIMDDNA/ascii.py +++ b/src/SIMDDNA/ascii.py @@ -99,4 +99,14 @@ def showMolecule(molecule, spacing = ""): Invlines[2] += " " for line in reversed(Invlines): - print(spacing.join(line)) \ No newline at end of file + print(spacing.join(line)) + + # print bases in bottom + label = [] + for i in range(len(molecule)): + if (molecule.getBase(0, i) != nothing): + label.append(molecule.getBase(0, i) + spacing) + else: + label.append(" " + spacing) + + print("".join(label)) \ No newline at end of file diff --git a/src/SIMDDNA/register.py b/src/SIMDDNA/register.py index ce3fb92..5ca094f 100644 --- a/src/SIMDDNA/register.py +++ b/src/SIMDDNA/register.py @@ -146,35 +146,35 @@ myreg.inscription([ molecule.parse("{D*E*A*F*}") ]) -myreg.asciiShow("") +myreg.asciiShow(" ") myreg.inscription([ molecule.parse("{D*E*A*B*C*G*}") ]) -myreg.asciiShow("") +myreg.asciiShow(" ") myreg.inscription([ molecule.parse("{DEABCG}") ]) -myreg.asciiShow("") +myreg.asciiShow(" ") myreg.inscription([ molecule.parse("{A*B*C*}"), molecule.parse("{D*E*}") ]) -myreg.asciiShow("") +myreg.asciiShow(" ") myreg.inscription([ molecule.parse("{DEAF}") ]) -myreg.asciiShow("") +myreg.asciiShow(" ") myreg.inscription([ molecule.parse("{B*C*D*E*}") ]) -myreg.asciiShow("") \ No newline at end of file +myreg.asciiShow(" ") \ No newline at end of file