From 5bfa7add51ed28a8445143ec668b16eef74448b1 Mon Sep 17 00:00:00 2001
From: gbayarri
Date: Tue, 21 Jan 2025 16:21:50 +0000
Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20bioexcel?=
=?UTF-8?q?/biobb=5Fdna@d7ccc2e5eae6ff07c7b4efe1869b0f46325f3418=20?=
=?UTF-8?q?=F0=9F=9A=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
coverage/class_index.html | 4 +-
coverage/coverage.xml | 4 +-
coverage/function_index.html | 4 +-
coverage/index.html | 4 +-
coverage/status.json | 2 +-
...20f76a90aa51c7b_test_bipopulations_py.html | 4 +-
...aa51c7b_test_canonical_alpha_gamma_py.html | 4 +-
.../z_020f76a90aa51c7b_test_puckering_py.html | 4 +-
.../z_100f5897bddc1993_test_averages_py.html | 4 +-
...z_100f5897bddc1993_test_bimodality_py.html | 4 +-
...z_100f5897bddc1993_test_timeseries_py.html | 4 +-
...5897bddc1993_test_timeseries_unzip_py.html | 4 +-
coverage/z_159731231e5c9c9d___init___py.html | 4 +-
.../z_159731231e5c9c9d_bipopulations_py.html | 18 +-
.../z_159731231e5c9c9d_canonicalag_py.html | 18 +-
coverage/z_159731231e5c9c9d_puckering_py.html | 18 +-
coverage/z_3afbcd666ed82c91___init___py.html | 4 +-
.../z_3afbcd666ed82c91_dna_averages_py.html | 22 +-
.../z_3afbcd666ed82c91_dna_bimodality_py.html | 10 +-
.../z_3afbcd666ed82c91_dna_timeseries_py.html | 52 +-
...bcd666ed82c91_dna_timeseries_unzip_py.html | 28 +-
coverage/z_64e03be4370b7ecc___init___py.html | 4 +-
.../z_64e03be4370b7ecc_intrabpcorr_py.html | 14 +-
.../z_64e03be4370b7ecc_intrahpcorr_py.html | 8 +-
.../z_64e03be4370b7ecc_intraseqcorr_py.html | 14 +-
coverage/z_74fa14c6d0e940a4___init___py.html | 4 +-
.../z_74fa14c6d0e940a4_biobb_canal_py.html | 28 +-
.../z_74fa14c6d0e940a4_biobb_canion_py.html | 40 +-
.../z_74fa14c6d0e940a4_biobb_curves_py.html | 34 +-
.../z_74fa14c6d0e940a4_canal_unzip_py.html | 18 +-
coverage/z_76997f7c8cf1ed45___init___py.html | 4 +-
.../z_8030ef0ea5bfd6aa_test_canal_py.html | 4 +-
..._8030ef0ea5bfd6aa_test_canal_unzip_py.html | 4 +-
.../z_8030ef0ea5bfd6aa_test_canion_py.html | 4 +-
.../z_8030ef0ea5bfd6aa_test_curves_py.html | 4 +-
coverage/z_833b0317e3c43dca___init___py.html | 4 +-
coverage/z_833b0317e3c43dca_common_py.html | 4 +-
coverage/z_833b0317e3c43dca_constants_py.html | 4 +-
coverage/z_833b0317e3c43dca_loader_py.html | 4 +-
coverage/z_833b0317e3c43dca_transform_py.html | 4 +-
coverage/z_8a2a7f872cf1434f___init___py.html | 4 +-
.../z_8a2a7f872cf1434f_interbpcorr_py.html | 14 +-
.../z_8a2a7f872cf1434f_interhpcorr_py.html | 8 +-
.../z_8a2a7f872cf1434f_interseqcorr_py.html | 14 +-
coverage/z_957b841f7413f0a1___init___py.html | 4 +-
..._97f47455ed834d2d_test_correlation_py.html | 4 +-
coverage/z_9de9475b0a6fab52___init___py.html | 4 +-
...9de9475b0a6fab52_average_stiffness_py.html | 18 +-
...de9475b0a6fab52_basepair_stiffness_py.html | 8 +-
.../z_cda7f8e8576a7189_test_stiffness_py.html | 4 +-
flake8/biobb_dna.dna.dna_averages.report.html | 83 ++
flake8/biobb_dna.dna.dna_averages.source.html | 890 ++++++++++++++
.../biobb_dna.dna.dna_timeseries.report.html | 73 ++
.../biobb_dna.dna.dna_timeseries.source.html | 1037 +++++++++++++++++
flake8/flake8badge.svg | 2 +-
flake8/flake8stats.txt | 1 +
flake8/index.html | 24 +-
junit/junit.xml | 2 +-
junit/report.html | 6 +-
59 files changed, 2358 insertions(+), 266 deletions(-)
create mode 100644 flake8/biobb_dna.dna.dna_averages.report.html
create mode 100644 flake8/biobb_dna.dna.dna_averages.source.html
create mode 100644 flake8/biobb_dna.dna.dna_timeseries.report.html
create mode 100644 flake8/biobb_dna.dna.dna_timeseries.source.html
diff --git a/coverage/class_index.html b/coverage/class_index.html
index c9f16f5d..ac1bc945 100644
--- a/coverage/class_index.html
+++ b/coverage/class_index.html
@@ -55,7 +55,7 @@
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -756,7 +756,7 @@
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -114,7 +114,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_020f76a90aa51c7b_test_canonical_alpha_gamma_py.html b/coverage/z_020f76a90aa51c7b_test_canonical_alpha_gamma_py.html
index 7ae78804..499cda76 100644
--- a/coverage/z_020f76a90aa51c7b_test_canonical_alpha_gamma_py.html
+++ b/coverage/z_020f76a90aa51c7b_test_canonical_alpha_gamma_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -110,7 +110,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_020f76a90aa51c7b_test_puckering_py.html b/coverage/z_020f76a90aa51c7b_test_puckering_py.html
index 07b94763..99a02bcf 100644
--- a/coverage/z_020f76a90aa51c7b_test_puckering_py.html
+++ b/coverage/z_020f76a90aa51c7b_test_puckering_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -110,7 +110,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_100f5897bddc1993_test_averages_py.html b/coverage/z_100f5897bddc1993_test_averages_py.html
index 67698828..f62252ba 100644
--- a/coverage/z_100f5897bddc1993_test_averages_py.html
+++ b/coverage/z_100f5897bddc1993_test_averages_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -114,7 +114,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_100f5897bddc1993_test_bimodality_py.html b/coverage/z_100f5897bddc1993_test_bimodality_py.html
index e264e8d7..e95cc4ad 100644
--- a/coverage/z_100f5897bddc1993_test_bimodality_py.html
+++ b/coverage/z_100f5897bddc1993_test_bimodality_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -110,7 +110,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_100f5897bddc1993_test_timeseries_py.html b/coverage/z_100f5897bddc1993_test_timeseries_py.html
index 1ec88f2b..229b1261 100644
--- a/coverage/z_100f5897bddc1993_test_timeseries_py.html
+++ b/coverage/z_100f5897bddc1993_test_timeseries_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -112,7 +112,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_100f5897bddc1993_test_timeseries_unzip_py.html b/coverage/z_100f5897bddc1993_test_timeseries_unzip_py.html
index 5c64b3dc..0f1a5c94 100644
--- a/coverage/z_100f5897bddc1993_test_timeseries_unzip_py.html
+++ b/coverage/z_100f5897bddc1993_test_timeseries_unzip_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -115,7 +115,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_159731231e5c9c9d___init___py.html b/coverage/z_159731231e5c9c9d___init___py.html
index de927252..a8e3a4d1 100644
--- a/coverage/z_159731231e5c9c9d___init___py.html
+++ b/coverage/z_159731231e5c9c9d___init___py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -94,7 +94,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_159731231e5c9c9d_bipopulations_py.html b/coverage/z_159731231e5c9c9d_bipopulations_py.html
index b477346b..056df67c 100644
--- a/coverage/z_159731231e5c9c9d_bipopulations_py.html
+++ b/coverage/z_159731231e5c9c9d_bipopulations_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -204,7 +204,7 @@
122 if self.seqpos:
123 if (max(self.seqpos) > len(self.sequence) - 2) or (min(self.seqpos) < 1):
124 raise ValueError(
- 125 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
+ 125 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
126 )
127 if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1):
128 raise ValueError("seqpos must be a list of at least two integers")
@@ -270,13 +270,13 @@
188 def get_xlabels(self, strand1, strand2):
189 # get list of tetramers, except first and last two bases
190 labelsW = list(strand1)
- 191 labelsW[0] = f"{labelsW[0]}5'"
- 192 labelsW[-1] = f"{labelsW[-1]}3'"
- 193 labelsW = [f"{i}-{j}" for i, j in zip(labelsW, range(1, len(labelsW) + 1))]
+ 191 labelsW[0] = f"{labelsW[0]}5'"
+ 192 labelsW[-1] = f"{labelsW[-1]}3'"
+ 193 labelsW = [f"{i}-{j}" for i, j in zip(labelsW, range(1, len(labelsW) + 1))]
194 labelsC = list(strand2)[::-1]
- 195 labelsC[0] = f"{labelsC[0]}5'"
- 196 labelsC[-1] = f"{labelsC[-1]}3'"
- 197 labelsC = [f"{i}-{j}" for i, j in zip(labelsC, range(len(labelsC), 0, -1))]
+ 195 labelsC[0] = f"{labelsC[0]}5'"
+ 196 labelsC[-1] = f"{labelsC[-1]}3'"
+ 197 labelsC = [f"{i}-{j}" for i, j in zip(labelsC, range(len(labelsC), 0, -1))]
198
199 if self.seqpos is not None:
200 labelsC = [labelsC[i] for i in self.seqpos]
@@ -386,7 +386,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_159731231e5c9c9d_canonicalag_py.html b/coverage/z_159731231e5c9c9d_canonicalag_py.html
index 11c2c00c..b72d4320 100644
--- a/coverage/z_159731231e5c9c9d_canonicalag_py.html
+++ b/coverage/z_159731231e5c9c9d_canonicalag_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -204,7 +204,7 @@
122 if self.seqpos:
123 if (max(self.seqpos) > len(self.sequence) - 2) or (min(self.seqpos) < 1):
124 raise ValueError(
- 125 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
+ 125 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
126 )
127 if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1):
128 raise ValueError("seqpos must be a list of at least two integers")
@@ -278,13 +278,13 @@
196 def get_xlabels(self, strand1, strand2):
197 # get list of tetramers, except first and last two bases
198 labelsW = list(strand1)
- 199 labelsW[0] = f"{labelsW[0]}5'"
- 200 labelsW[-1] = f"{labelsW[-1]}3'"
- 201 labelsW = [f"{i}-{j}" for i, j in zip(labelsW, range(1, len(labelsW) + 1))]
+ 199 labelsW[0] = f"{labelsW[0]}5'"
+ 200 labelsW[-1] = f"{labelsW[-1]}3'"
+ 201 labelsW = [f"{i}-{j}" for i, j in zip(labelsW, range(1, len(labelsW) + 1))]
202 labelsC = list(strand2)[::-1]
- 203 labelsC[0] = f"{labelsC[0]}5'"
- 204 labelsC[-1] = f"{labelsC[-1]}3'"
- 205 labelsC = [f"{i}-{j}" for i, j in zip(labelsC, range(len(labelsC), 0, -1))]
+ 203 labelsC[0] = f"{labelsC[0]}5'"
+ 204 labelsC[-1] = f"{labelsC[-1]}3'"
+ 205 labelsC = [f"{i}-{j}" for i, j in zip(labelsC, range(len(labelsC), 0, -1))]
206
207 if self.seqpos:
208 labelsC = [labelsC[i] for i in self.seqpos]
@@ -401,7 +401,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_159731231e5c9c9d_puckering_py.html b/coverage/z_159731231e5c9c9d_puckering_py.html
index 1f6d981f..5e5d0a9c 100644
--- a/coverage/z_159731231e5c9c9d_puckering_py.html
+++ b/coverage/z_159731231e5c9c9d_puckering_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -196,7 +196,7 @@
114 if self.seqpos:
115 if (max(self.seqpos) > len(self.sequence) - 2) or (min(self.seqpos) < 1):
116 raise ValueError(
- 117 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
+ 117 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
118 )
119 if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1):
120 raise ValueError("seqpos must be a list of at least two integers")
@@ -263,13 +263,13 @@
181 def get_xlabels(self, strand1, strand2):
182 # get list of tetramers, except first and last two bases
183 labelsW = list(strand1)
- 184 labelsW[0] = f"{labelsW[0]}5'"
- 185 labelsW[-1] = f"{labelsW[-1]}3'"
- 186 labelsW = [f"{i}-{j}" for i, j in zip(labelsW, range(1, len(labelsW) + 1))]
+ 184 labelsW[0] = f"{labelsW[0]}5'"
+ 185 labelsW[-1] = f"{labelsW[-1]}3'"
+ 186 labelsW = [f"{i}-{j}" for i, j in zip(labelsW, range(1, len(labelsW) + 1))]
187 labelsC = list(strand2)[::-1]
- 188 labelsC[0] = f"{labelsC[0]}5'"
- 189 labelsC[-1] = f"{labelsC[-1]}3'"
- 190 labelsC = [f"{i}-{j}" for i, j in zip(labelsC, range(len(labelsC), 0, -1))]
+ 188 labelsC[0] = f"{labelsC[0]}5'"
+ 189 labelsC[-1] = f"{labelsC[-1]}3'"
+ 190 labelsC = [f"{i}-{j}" for i, j in zip(labelsC, range(len(labelsC), 0, -1))]
191
192 if self.seqpos:
193 labelsC = [labelsC[i] for i in self.seqpos]
@@ -370,7 +370,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_3afbcd666ed82c91___init___py.html b/coverage/z_3afbcd666ed82c91___init___py.html
index 07ecd10b..2118c59b 100644
--- a/coverage/z_3afbcd666ed82c91___init___py.html
+++ b/coverage/z_3afbcd666ed82c91___init___py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -95,7 +95,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_3afbcd666ed82c91_dna_averages_py.html b/coverage/z_3afbcd666ed82c91_dna_averages_py.html
index 1e4df842..488c66b0 100644
--- a/coverage/z_3afbcd666ed82c91_dna_averages_py.html
+++ b/coverage/z_3afbcd666ed82c91_dna_averages_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -209,7 +209,7 @@
127 if self.helpar_name not in constants.helical_parameters:
128 raise ValueError(
129 "Helical parameter name is invalid! "
- 130 f"Options: {constants.helical_parameters}"
+ 130 f"Options: {constants.helical_parameters}"
131 )
132
133 # get base length and unit from helical parameter name
@@ -226,7 +226,7 @@
144 if self.seqpos:
145 if (max(self.seqpos) > len(self.sequence) - 2) or (min(self.seqpos) < 1):
146 raise ValueError(
- 147 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
+ 147 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
148 )
149 if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1):
150 raise ValueError("seqpos must be a list of at least two integers")
@@ -242,12 +242,12 @@
160 # discard first and last base(pairs) from sequence
161 sequence = self.sequence[1:]
162 xlabels = [
- 163 f"{sequence[i:i+1+self.baselen]}"
+ 163 f"{sequence[i:i+1+self.baselen]}"
164 for i in range(len(ser_data.columns) - self.baselen)
165 ]
166 else:
167 sequence = self.sequence
- 168 xlabels = [f"{sequence[i:i+1+self.baselen]}" for i in self.seqpos]
+ 168 xlabels = [f"{sequence[i:i+1+self.baselen]}" for i in self.seqpos]
169
170 # rename duplicated subunits
171 while any(pd.Index(ser_data.columns).duplicated()):
@@ -269,19 +269,19 @@
187 )
188 axs.set_xticks(means.index)
189 axs.set_xticklabels(xlabels, rotation=90)
- 190 axs.set_xlabel("Sequence Base Pair " f"{'Step' if self.baselen==1 else ''}")
- 191 axs.set_ylabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
+ 190 axs.set_xlabel("Sequence Base Pair " f"{'Step' if self.baselen==1 else ''}")
+ 191 axs.set_ylabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
192 axs.set_title(
193 "Base Pair "
- 194 f"{'Step' if self.baselen==1 else ''} "
- 195 f"Helical Parameter: {self.helpar_name.capitalize()}"
+ 194 f"{'Step' if self.baselen==1 else ''} "
+ 195 f"Helical Parameter: {self.helpar_name.capitalize()}"
196 )
197 fig.savefig(self.stage_io_dict["out"]["output_jpg_path"], format="jpg")
198
199 # save table
200 dataset = pd.DataFrame(
201 {
- 202 f"Base Pair {'Step' if self.baselen==1 else ''}": xlabels,
+ 202 f"Base Pair {'Step' if self.baselen==1 else ''}": xlabels,
203 "mean": means.to_numpy(),
204 "std": stds.to_numpy(),
205 }
@@ -369,7 +369,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_3afbcd666ed82c91_dna_bimodality_py.html b/coverage/z_3afbcd666ed82c91_dna_bimodality_py.html
index 47214220..22904fb2 100644
--- a/coverage/z_3afbcd666ed82c91_dna_bimodality_py.html
+++ b/coverage/z_3afbcd666ed82c91_dna_bimodality_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -208,7 +208,7 @@
126 if self.helpar_name not in constants.helical_parameters:
127 raise ValueError(
128 "Helical parameter name is invalid! "
- 129 f"Options: {constants.helical_parameters}")
+ 129 f"Options: {constants.helical_parameters}")
130
131 # get unit from helical parameter name
132 if self.helpar_name in constants.hp_angular:
@@ -300,8 +300,8 @@
218 plt.vlines(info['mean2'], 0, ylim, colors="r", linestyles="dashed")
219 plt.legend()
220 plt.ylabel("Density")
- 221 plt.xlabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
- 222 plt.title(f"Distribution of {self.helpar_name} states")
+ 221 plt.xlabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
+ 222 plt.title(f"Distribution of {self.helpar_name} states")
223 plt.savefig(output_jpg_path, format="jpg")
224 plt.close()
225
@@ -426,7 +426,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_3afbcd666ed82c91_dna_timeseries_py.html b/coverage/z_3afbcd666ed82c91_dna_timeseries_py.html
index ed72ff3d..a2ce00f3 100644
--- a/coverage/z_3afbcd666ed82c91_dna_timeseries_py.html
+++ b/coverage/z_3afbcd666ed82c91_dna_timeseries_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -185,7 +185,7 @@
103 if self.helpar_name not in constants.helical_parameters:
104 raise ValueError(
105 "Helical parameter name is invalid! "
- 106 f"Options: {constants.helical_parameters}"
+ 106 f"Options: {constants.helical_parameters}"
107 )
108
109 # get base length from helical parameter name
@@ -229,7 +229,7 @@
147 if self.seqpos and self.helpar_name in constants.hp_basepairs:
148 if (max(cols) > len(self.sequence) - 2) or (min(cols) < 0):
149 raise ValueError(
- 150 f"seqpos values must be between 1 and {len(self.sequence) - 1}"
+ 150 f"seqpos values must be between 1 and {len(self.sequence) - 1}"
151 )
152 if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1):
153 raise ValueError("seqpos must be a list of at least two integers")
@@ -237,7 +237,7 @@
155 elif self.seqpos and self.helpar_name not in constants.hp_basepairs:
156 if (max(cols) > len(self.sequence) - 1) or (min(cols) < 0):
157 raise ValueError(
- 158 f"seqpos values must be between 1 and {len(self.sequence)}"
+ 158 f"seqpos values must be between 1 and {len(self.sequence)}"
159 )
160 if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1):
161 raise ValueError("seqpos must be a list of at least two integers")
@@ -254,7 +254,7 @@
172 # create indices list
173 indices = cols.copy()
174 # create subunits list from cols
- 175 subunits = [f"{i+1}_{sequence[i-1:i+self.baselen]}" for i in cols]
+ 175 subunits = [f"{i+1}_{sequence[i-1:i+self.baselen]}" for i in cols]
176 # clean subunits (leave only basepairs)
177 pattern = re.compile(r"\d+_[A-Za-z]{2}")
178 # get removed items
@@ -277,7 +277,7 @@
195 # trick for getting the index column from the .ser file
196 indices.insert(0, 0)
197 # create subunits list from cols
- 198 subunits = [f"{i+1}_{sequence[i:i+1+self.baselen]}" for i in cols]
+ 198 subunits = [f"{i+1}_{sequence[i:i+1+self.baselen]}" for i in cols]
199
200 # read input .ser file
201 ser_data = read_series(
@@ -293,64 +293,64 @@
211 # unstack columns to prevent errors from repeated base pairs
212 column_data = ser_data[[col]].unstack().dropna().reset_index(drop=True)
213 column_data.name = col
- 214 fu.log(f"Computing base number {col}...")
+ 214 fu.log(f"Computing base number {col}...")
215
216 # column series
- 217 series_colfn = f"series_{self.helpar_name}_{col}"
+ 217 series_colfn = f"series_{self.helpar_name}_{col}"
218 column_data.to_csv(
- 219 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.csv"
+ 219 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.csv"
220 )
221 # save table
222 zf.write(
- 223 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.csv",
- 224 arcname=f"{series_colfn}.csv",
+ 223 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.csv",
+ 224 arcname=f"{series_colfn}.csv",
225 )
226
227 fig, axs = plt.subplots(1, 1, dpi=300, tight_layout=True)
228 reduced_data = column_data.iloc[:: self.stride]
229 axs.plot(reduced_data.index, reduced_data.to_numpy())
230 axs.set_xlabel("Time (Snapshots)")
- 231 axs.set_ylabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
+ 231 axs.set_ylabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
232 axs.set_title(
- 233 f"Helical Parameter vs Time: {self.helpar_name.capitalize()} "
+ 233 f"Helical Parameter vs Time: {self.helpar_name.capitalize()} "
234 "(base pair "
- 235 f"{'step' if self.baselen==1 else ''} {col})"
+ 235 f"{'step' if self.baselen==1 else ''} {col})"
236 )
237 fig.savefig(
- 238 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.jpg",
+ 238 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.jpg",
239 format="jpg",
240 )
241 # save plot
242 zf.write(
- 243 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.jpg",
- 244 arcname=f"{series_colfn}.jpg",
+ 243 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.jpg",
+ 244 arcname=f"{series_colfn}.jpg",
245 )
246 plt.close()
247
248 # columns histogram
- 249 hist_colfn = f"hist_{self.helpar_name}_{col}"
+ 249 hist_colfn = f"hist_{self.helpar_name}_{col}"
250 fig, axs = plt.subplots(1, 1, dpi=300, tight_layout=True)
251 ybins, x, _ = axs.hist(column_data, bins=self.bins)
252 pd.DataFrame({self.helpar_name: x[:-1], "density": ybins}).to_csv(
- 253 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.csv",
+ 253 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.csv",
254 index=False,
255 )
256 # save table
257 zf.write(
- 258 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.csv",
- 259 arcname=f"{hist_colfn}.csv",
+ 258 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.csv",
+ 259 arcname=f"{hist_colfn}.csv",
260 )
261
262 axs.set_ylabel("Density")
- 263 axs.set_xlabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
+ 263 axs.set_xlabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
264 fig.savefig(
- 265 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.jpg",
+ 265 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.jpg",
266 format="jpg",
267 )
268 # save plot
269 zf.write(
- 270 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.jpg",
- 271 arcname=f"{hist_colfn}.jpg",
+ 270 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.jpg",
+ 271 arcname=f"{hist_colfn}.jpg",
272 )
273 plt.close()
274 zf.close()
@@ -424,7 +424,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_3afbcd666ed82c91_dna_timeseries_unzip_py.html b/coverage/z_3afbcd666ed82c91_dna_timeseries_unzip_py.html
index ff9e7fa8..446e5146 100644
--- a/coverage/z_3afbcd666ed82c91_dna_timeseries_unzip_py.html
+++ b/coverage/z_3afbcd666ed82c91_dna_timeseries_unzip_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -187,26 +187,26 @@
105
106 # Check that the type is valid
107 if self.type not in ["series", "hist"]:
- 108 fu.log(f"Type {self.type} not valid. Valid types are: series, hist.",
+ 108 fu.log(f"Type {self.type} not valid. Valid types are: series, hist.",
109 self.out_log, self.global_log)
110 exit(1)
111
112 # Check that the parameter is valid
113 if self.parameter not in constants.helical_parameters:
- 114 fu.log(f"Parameter {self.parameter} not valid. Valid parameters are: {constants.helical_parameters}.",
+ 114 fu.log(f"Parameter {self.parameter} not valid. Valid parameters are: {constants.helical_parameters}.",
115 self.out_log, self.global_log)
116 exit(1)
117
118 # Check that the sequence is valid
119 pattern = r'^[ACGT]+$'
120 if not re.match(pattern, self.sequence):
- 121 fu.log(f"Sequence {self.sequence} not valid. Only 'A', 'C', 'G' or 'T' bases allowed.",
+ 121 fu.log(f"Sequence {self.sequence} not valid. Only 'A', 'C', 'G' or 'T' bases allowed.",
122 self.out_log, self.global_log)
123 exit(1)
124
125 # Check that the index is valid
126 if self.index < 1 or self.index >= len(self.sequence) - 1:
- 127 fu.log(f"Index {self.index} not valid. It should be between 0 and {len(self.sequence) - 2}.",
+ 127 fu.log(f"Index {self.index} not valid. It should be between 0 and {len(self.sequence) - 2}.",
128 self.out_log, self.global_log)
129 exit(1)
130
@@ -214,39 +214,39 @@
132 bp = self.sequence[self.index-1] + self.sequence[self.index]
133
134 # Get the filename
- 135 filename = f"{self.type}_{self.parameter}_{self.index}_{bp}"
- 136 csv_file = f"{filename}.csv"
- 137 jpg_file = f"{filename}.jpg"
+ 135 filename = f"{self.type}_{self.parameter}_{self.index}_{bp}"
+ 136 csv_file = f"{filename}.csv"
+ 137 jpg_file = f"{filename}.jpg"
138
139 # Unzip the file
140 with zipfile.ZipFile(self.stage_io_dict["in"]["input_zip_file"], 'r') as zip_ref:
141 # Check if the csv file exists in the zip file
142 if csv_file in zip_ref.namelist():
143 # Extract the file
- 144 fu.log(f'{csv_file} exists, copying into {self.stage_io_dict["out"]["output_path_csv"]}.',
+ 144 fu.log(f'{csv_file} exists, copying into {self.stage_io_dict["out"]["output_path_csv"]}.',
145 self.out_log, self.global_log)
146 with zip_ref.open(csv_file) as source, open(self.stage_io_dict["out"]["output_path_csv"], "wb") as target:
147 shutil.copyfileobj(source, target)
148 else:
- 149 fu.log(f"File {csv_file} not found in the zip file.", self.out_log, self.global_log)
+ 149 fu.log(f"File {csv_file} not found in the zip file.", self.out_log, self.global_log)
150 exit(1)
151
152 # Check if the jpg file exists in the zip file
153 if jpg_file in zip_ref.namelist():
154 # Extract the file
- 155 fu.log(f'{jpg_file} exists, copying into {self.stage_io_dict["out"]["output_path_jpg"]}.',
+ 155 fu.log(f'{jpg_file} exists, copying into {self.stage_io_dict["out"]["output_path_jpg"]}.',
156 self.out_log, self.global_log)
157 with zip_ref.open(jpg_file) as source, open(self.stage_io_dict["out"]["output_path_jpg"], "wb") as target:
158 shutil.copyfileobj(source, target)
159 else:
- 160 fu.log(f"File {jpg_file} not found in the zip file.", self.out_log, self.global_log)
+ 160 fu.log(f"File {jpg_file} not found in the zip file.", self.out_log, self.global_log)
161 exit(1)
162
163 # Write the list of files
164 if self.stage_io_dict["out"]["output_list_path"]:
165 with open(self.stage_io_dict["out"]["output_list_path"], "w") as f:
166 for name in zip_ref.namelist():
- 167 f.write(f"{name}\n")
+ 167 f.write(f"{name}\n")
168
169 # Run Biobb block
170 # self.run_biobb()
@@ -322,7 +322,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_64e03be4370b7ecc___init___py.html b/coverage/z_64e03be4370b7ecc___init___py.html
index 9f576d5d..945c395b 100644
--- a/coverage/z_64e03be4370b7ecc___init___py.html
+++ b/coverage/z_64e03be4370b7ecc___init___py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -98,7 +98,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_64e03be4370b7ecc_intrabpcorr_py.html b/coverage/z_64e03be4370b7ecc_intrabpcorr_py.html
index 5b9e4ccd..d75be5be 100644
--- a/coverage/z_64e03be4370b7ecc_intrabpcorr_py.html
+++ b/coverage/z_64e03be4370b7ecc_intrabpcorr_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -242,15 +242,15 @@
160 propel = propel[propel.columns[1:-1]]
161 opening = opening[opening.columns[1:-1]]
162 labels = [
- 163 f"{i+1}_{self.sequence[i:i+1]}"
+ 163 f"{i+1}_{self.sequence[i:i+1]}"
164 for i in range(1, len(shear.columns) + 1)
165 ]
166 corr_index = [
- 167 f"{self.sequence[i:i+2]}" for i in range(1, len(shear.columns) + 1)
+ 167 f"{self.sequence[i:i+2]}" for i in range(1, len(shear.columns) + 1)
168 ]
169 else:
- 170 labels = [f"{i+1}_{self.sequence[i:i+1]}" for i in self.seqpos]
- 171 corr_index = [f"{self.sequence[i:i+2]}" for i in self.seqpos]
+ 170 labels = [f"{i+1}_{self.sequence[i:i+1]}" for i in self.seqpos]
+ 171 corr_index = [f"{self.sequence[i:i+2]}" for i in self.seqpos]
172
173 # rename duplicated subunits
174 shear.columns = labels
@@ -286,7 +286,7 @@
204 method = "pearson" # type: ignore
205 corr_data = ser1.corrwith(ser2_shifted, method=method)
206 corr_data.index = corr_index
- 207 results[f"{ser1.name}/{ser2.name}"] = corr_data
+ 207 results[f"{ser1.name}/{ser2.name}"] = corr_data
208 result_df = pd.DataFrame.from_dict(results)
209 result_df.index = corr_index # type: ignore
210
@@ -462,7 +462,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_64e03be4370b7ecc_intrahpcorr_py.html b/coverage/z_64e03be4370b7ecc_intrahpcorr_py.html
index 44524197..a9d9c5f0 100644
--- a/coverage/z_64e03be4370b7ecc_intrahpcorr_py.html
+++ b/coverage/z_64e03be4370b7ecc_intrahpcorr_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -295,7 +295,7 @@
213 axs.text(
214 j+.5,
215 i+.5,
- 216 f"{corr_matrix[coordinates[j]].loc[coordinates[i]]:.2f}",
+ 216 f"{corr_matrix[coordinates[j]].loc[coordinates[i]]:.2f}",
217 ha="center",
218 va="center",
219 color="w")
@@ -305,7 +305,7 @@
223 axs.set_yticklabels(corr_matrix.index)
224 axs.set_title(
225 "Helical Parameter Correlation "
- 226 f"for Base Pair Step \'{self.base}\'")
+ 226 f"for Base Pair Step \'{self.base}\'")
227 fig.tight_layout()
228 fig.savefig(
229 self.stage_io_dict['out']['output_jpg_path'],
@@ -432,7 +432,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_64e03be4370b7ecc_intraseqcorr_py.html b/coverage/z_64e03be4370b7ecc_intraseqcorr_py.html
index 1aa8ee8b..fe54c560 100644
--- a/coverage/z_64e03be4370b7ecc_intraseqcorr_py.html
+++ b/coverage/z_64e03be4370b7ecc_intraseqcorr_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -201,7 +201,7 @@
119 if self.helpar_name not in constants.helical_parameters:
120 raise ValueError(
121 "Helical parameter name is invalid! "
- 122 f"Options: {constants.helical_parameters}"
+ 122 f"Options: {constants.helical_parameters}"
123 )
124
125 # get base length and unit from helical parameter name
@@ -225,9 +225,9 @@
143 ser_data = ser_data[ser_data.columns[1:-1]]
144 # discard first and last base(pairs) from strands
145 sequence = self.sequence[1:]
- 146 labels = [f"{i+1}_{sequence[i:i+1]}" for i in range(len(ser_data.columns))]
+ 146 labels = [f"{i+1}_{sequence[i:i+1]}" for i in range(len(ser_data.columns))]
147 else:
- 148 labels = [f"{i+1}_{self.sequence[i:i+1]}" for i in self.seqpos]
+ 148 labels = [f"{i+1}_{self.sequence[i:i+1]}" for i in self.seqpos]
149 ser_data.columns = labels
150
151 # make matrix
@@ -245,7 +245,7 @@
163 axs.text(
164 j + 0.5,
165 i + 0.5,
- 166 f"{corr_data[corr_data.columns[j]].iloc[i]:.2f}",
+ 166 f"{corr_data[corr_data.columns[j]].iloc[i]:.2f}",
167 ha="center",
168 va="center",
169 color="w",
@@ -255,7 +255,7 @@
173 axs.set_yticks([i + 0.5 for i in range(len(corr_data))])
174 axs.set_yticklabels(labels)
175 axs.set_title(
- 176 "Base Pair Correlation " f"for Helical Parameter '{self.helpar_name}'"
+ 176 "Base Pair Correlation " f"for Helical Parameter '{self.helpar_name}'"
177 )
178 fig.tight_layout()
179 fig.savefig(self.stage_io_dict["out"]["output_jpg_path"], format="jpg")
@@ -350,7 +350,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_74fa14c6d0e940a4___init___py.html b/coverage/z_74fa14c6d0e940a4___init___py.html
index 291fa928..b66eb01c 100644
--- a/coverage/z_74fa14c6d0e940a4___init___py.html
+++ b/coverage/z_74fa14c6d0e940a4___init___py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -95,7 +95,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_74fa14c6d0e940a4_biobb_canal_py.html b/coverage/z_74fa14c6d0e940a4_biobb_canal_py.html
index bb0fb40c..c928a311 100644
--- a/coverage/z_74fa14c6d0e940a4_biobb_canal_py.html
+++ b/coverage/z_74fa14c6d0e940a4_biobb_canal_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -205,8 +205,8 @@
123 if line.strip().startswith("Strand 1"):
124 self.sequence = line.split(" ")[-1]
125 fu.log(
- 126 f"using sequence {self.sequence} "
- 127 f"from {self.stage_io_dict['in']['input_lis_file']}",
+ 126 f"using sequence {self.sequence} "
+ 127 f"from {self.stage_io_dict['in']['input_lis_file']}",
128 self.out_log)
129
130 # define temporary file name
@@ -218,29 +218,29 @@
136
137 # create intructions
138 instructions = [
- 139 f"{self.binary_path} <<! ",
+ 139 f"{self.binary_path} <<! ",
140 "&inp",
141 " lis=canal_output,"]
142 if self.bases is not None:
143 # add topology file if needed
144 fu.log('Appending sequence of bases to be searched to command',
145 self.out_log, self.global_log)
- 146 instructions.append(f" seq={self.bases},")
+ 146 instructions.append(f" seq={self.bases},")
147 if self.nastr is not None:
148 # add topology file if needed
149 fu.log('Adding null values string specification to command',
150 self.out_log, self.global_log)
- 151 instructions.append(f" nastr={self.nastr},")
+ 151 instructions.append(f" nastr={self.nastr},")
152
153 instructions = instructions + [
- 154 f" cormin={self.cormin},",
- 155 f" lev1={self.lev1},lev2={self.lev2},",
- 156 f" itst={self.itst},itnd={self.itnd},itdel={self.itdel},",
- 157 f" histo={self.histo},",
- 158 f" series={self.series},",
- 159 f" corr={self.corr},",
+ 154 f" cormin={self.cormin},",
+ 155 f" lev1={self.lev1},lev2={self.lev2},",
+ 156 f" itst={self.itst},itnd={self.itnd},itdel={self.itdel},",
+ 157 f" histo={self.histo},",
+ 158 f" series={self.series},",
+ 159 f" corr={self.corr},",
160 "&end",
- 161 f"{tmp_cda_path} {self.sequence}",
+ 161 f"{tmp_cda_path} {self.sequence}",
162 "!"]
163
164 self.cmd = ["\n".join(instructions)]
@@ -329,7 +329,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_74fa14c6d0e940a4_biobb_canion_py.html b/coverage/z_74fa14c6d0e940a4_biobb_canion_py.html
index bdff8f71..e54ee993 100644
--- a/coverage/z_74fa14c6d0e940a4_biobb_canion_py.html
+++ b/coverage/z_74fa14c6d0e940a4_biobb_canion_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -217,7 +217,7 @@
135 ]
136 if self.type not in ion_type_options:
137 raise ValueError(("Invalid value for property type! "
- 138 f"Option include: {ion_type_options}"))
+ 138 f"Option include: {ion_type_options}"))
139
140 # define temporary file names
141 input_cdi_file = Path(self.stage_io_dict['in']['input_cdi_path']).name
@@ -230,29 +230,29 @@
148
149 # create intructions
150 instructions = [
- 151 f"{self.binary_path} <<! ",
+ 151 f"{self.binary_path} <<! ",
152 "&inp",
153 " lis=canion_output,",
- 154 f" dat={input_cdi_file[:-4]},",
- 155 f" axfrm={input_afr_file[:-4]},",
- 156 f" solute={input_avg_struc[:-4]},",
- 157 f" type={self.type},",
- 158 f" dlow={self.dlow},",
- 159 f" dhig={self.dhig},",
- 160 f" rlow={self.rlow},",
- 161 f" rhig={self.rhig},",
- 162 f" alow={self.alow},",
- 163 f" ahig={self.ahig},",
- 164 f" itst={self.itst},",
- 165 f" itnd={self.itnd},",
- 166 f" itdel={self.itdel},",
- 167 f" rmsf={self.rmsf},",
- 168 f" circ={self.circ},"]
+ 154 f" dat={input_cdi_file[:-4]},",
+ 155 f" axfrm={input_afr_file[:-4]},",
+ 156 f" solute={input_avg_struc[:-4]},",
+ 157 f" type={self.type},",
+ 158 f" dlow={self.dlow},",
+ 159 f" dhig={self.dhig},",
+ 160 f" rlow={self.rlow},",
+ 161 f" rhig={self.rhig},",
+ 162 f" alow={self.alow},",
+ 163 f" ahig={self.ahig},",
+ 164 f" itst={self.itst},",
+ 165 f" itnd={self.itnd},",
+ 166 f" itdel={self.itdel},",
+ 167 f" rmsf={self.rmsf},",
+ 168 f" circ={self.circ},"]
169 if self.bases is not None:
170 # add topology file if needed
171 fu.log('Appending sequence of bases to be searched to command',
172 self.out_log, self.global_log)
- 173 instructions.append(f" seq={self.bases},")
+ 173 instructions.append(f" seq={self.bases},")
174 instructions.append("&end")
175 instructions.append("!")
176 self.cmd = ["\n".join(instructions)]
@@ -341,7 +341,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_74fa14c6d0e940a4_biobb_curves_py.html b/coverage/z_74fa14c6d0e940a4_biobb_curves_py.html
index 492d1c55..d1625ff7 100644
--- a/coverage/z_74fa14c6d0e940a4_biobb_curves_py.html
+++ b/coverage/z_74fa14c6d0e940a4_biobb_curves_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -216,7 +216,7 @@
134 range1_end = int(self.s1range.split(":")[1])
135 s2start = range1_end + 1
136 s2end = 2 * range1_end
- 137 self.s2range = f"{s2end}:{s2start}"
+ 137 self.s2range = f"{s2end}:{s2start}"
138
139 # check standard library files location if not provided
140 if self.stdlib_path is None:
@@ -228,14 +228,14 @@
146 if len(list(curves_aux_path.glob("standard_*.lib"))) != 3:
147 raise FileNotFoundError(
148 "One or all standard library files "
- 149 f"missing from {curves_aux_path}! "
+ 149 f"missing from {curves_aux_path}! "
150 "Check files standard_b.lib, "
151 "standard_s.lib and standard_i.lib exist.")
152 self.stdlib_path = curves_aux_path / "standard"
153 else:
154 raise FileNotFoundError(
155 ".curvesplus directory not found in "
- 156 f"{os.getenv('CONDA_PREFIX')} !"
+ 156 f"{os.getenv('CONDA_PREFIX')} !"
157 "Please indicate where standard_*.lib files are "
158 "located with the stdlib_path property.")
159 # copy standard library files to temporary folder
@@ -267,30 +267,30 @@
185
186 # create intructions
187 instructions = [
- 188 f"{self.binary_path} <<! ",
+ 188 f"{self.binary_path} <<! ",
189 "&inp",
- 190 f" file={tmp_struc_input},"]
+ 190 f" file={tmp_struc_input},"]
191 if self.stage_io_dict['in']['input_top_path'] is not None:
192 # add topology file if needed
193 fu.log('Appending provided topology to command',
194 self.out_log, self.global_log)
195 instructions.append(
- 196 f" ftop={tmp_top_input},")
+ 196 f" ftop={tmp_top_input},")
197
198 # create intructions
199 instructions = instructions + [
200 " lis='curves_output',",
- 201 f" lib={relative_lib_path},",
- 202 f" ions={self.ions},",
- 203 f" test={self.test},",
- 204 f" line={self.line},",
- 205 f" fit={self.fit},",
- 206 f" axfrm={self.axfrm},",
- 207 f" itst={self.itst},itnd={self.itnd},itdel={self.itdel},",
+ 201 f" lib={relative_lib_path},",
+ 202 f" ions={self.ions},",
+ 203 f" test={self.test},",
+ 204 f" line={self.line},",
+ 205 f" fit={self.fit},",
+ 206 f" axfrm={self.axfrm},",
+ 207 f" itst={self.itst},itnd={self.itnd},itdel={self.itdel},",
208 "&end",
209 "2 1 -1 0 0",
- 210 f"{self.s1range}",
- 211 f"{self.s2range}",
+ 210 f"{self.s1range}",
+ 211 f"{self.s2range}",
212 "!"
213 ]
214 self.cmd = ["\n".join(instructions)]
@@ -393,7 +393,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_74fa14c6d0e940a4_canal_unzip_py.html b/coverage/z_74fa14c6d0e940a4_canal_unzip_py.html
index 85edd2b4..17c977f5 100644
--- a/coverage/z_74fa14c6d0e940a4_canal_unzip_py.html
+++ b/coverage/z_74fa14c6d0e940a4_canal_unzip_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -197,7 +197,7 @@
115 }
116 # Check that the type is valid
117 if self.type not in extensions:
- 118 fu.log(f"Type {self.type} not valid. Valid types are: {', '.join(extensions.keys())}.",
+ 118 fu.log(f"Type {self.type} not valid. Valid types are: {', '.join(extensions.keys())}.",
119 self.out_log, self.global_log)
120 exit(1)
121
@@ -207,7 +207,7 @@
125 # Check that the correlation is valid
126 pattern = r'\d+_\d+'
127 if not re.match(pattern, self.correlation):
- 128 fu.log(f"Correlation {self.correlation} not valid. It should match the pattern <number_number>.",
+ 128 fu.log(f"Correlation {self.correlation} not valid. It should match the pattern <number_number>.",
129 self.out_log, self.global_log)
130 exit(1)
131 sufix = self.correlation
@@ -219,32 +219,32 @@
137 "opening", "phaseC", "phaseW", "propel", "reg", "rise", "roll", "shear",
138 "shift", "slide", "stagger", "stretch", "tbend", "tilt", "tip", "twist",
139 "xdisp", "ydisp", "zetaC", "zetaW"]:
- 140 fu.log(f"Parameter {self.helpar_name} not valid. Valid parameters are: alphaC, alphaW, ampC, ampW, ax-bend, betaC, betaW, buckle, chiC, chiW, curv, deltaC, deltaW, epsilC, epsilW, gammaC, gammaW, h-ris, h-twi, inclin, majd, majw, mind, minw, opening, phaseC, phaseW, propel, reg, rise, roll, shear, shift, slide, stagger, stretch, tbend, tilt, tip, twist, xdisp, ydisp, zetaC, zetaW.",
+ 140 fu.log(f"Parameter {self.helpar_name} not valid. Valid parameters are: alphaC, alphaW, ampC, ampW, ax-bend, betaC, betaW, buckle, chiC, chiW, curv, deltaC, deltaW, epsilC, epsilW, gammaC, gammaW, h-ris, h-twi, inclin, majd, majw, mind, minw, opening, phaseC, phaseW, propel, reg, rise, roll, shear, shift, slide, stagger, stretch, tbend, tilt, tip, twist, xdisp, ydisp, zetaC, zetaW.",
141 self.out_log, self.global_log)
142 exit(1)
143 sufix = self.helpar_name
144
145 # Generate the filename
- 146 filename = f"canal_output_{sufix}.{extensions[self.type]}"
+ 146 filename = f"canal_output_{sufix}.{extensions[self.type]}"
147
148 # Unzip the file
149 with zipfile.ZipFile(self.stage_io_dict["in"]["input_zip_file"], 'r') as zip_ref:
150 # Check if the file exists in the zip file
151 if filename in zip_ref.namelist():
152 # Extract the file
- 153 fu.log(f'{filename} exists, copying into {self.stage_io_dict["out"]["output_path"]}.',
+ 153 fu.log(f'{filename} exists, copying into {self.stage_io_dict["out"]["output_path"]}.',
154 self.out_log, self.global_log)
155 with zip_ref.open(filename) as source, open(self.stage_io_dict["out"]["output_path"], "wb") as target:
156 shutil.copyfileobj(source, target)
157 else:
- 158 fu.log(f"File {filename} not found in the zip file.", self.out_log, self.global_log)
+ 158 fu.log(f"File {filename} not found in the zip file.", self.out_log, self.global_log)
159 exit(1)
160
161 # Write the list of files
162 if self.stage_io_dict["out"]["output_list_path"]:
163 with open(self.stage_io_dict["out"]["output_list_path"], "w") as f:
164 for name in zip_ref.namelist():
- 165 f.write(f"{name}\n")
+ 165 f.write(f"{name}\n")
166
167 # Run Biobb block
168 # self.run_biobb()
@@ -315,7 +315,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_76997f7c8cf1ed45___init___py.html b/coverage/z_76997f7c8cf1ed45___init___py.html
index eeb535b6..48fa3d70 100644
--- a/coverage/z_76997f7c8cf1ed45___init___py.html
+++ b/coverage/z_76997f7c8cf1ed45___init___py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -108,7 +108,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_8030ef0ea5bfd6aa_test_canal_py.html b/coverage/z_8030ef0ea5bfd6aa_test_canal_py.html
index 2fe467e1..6d0ea88d 100644
--- a/coverage/z_8030ef0ea5bfd6aa_test_canal_py.html
+++ b/coverage/z_8030ef0ea5bfd6aa_test_canal_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -111,7 +111,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_8030ef0ea5bfd6aa_test_canal_unzip_py.html b/coverage/z_8030ef0ea5bfd6aa_test_canal_unzip_py.html
index daf093b1..4be5cd49 100644
--- a/coverage/z_8030ef0ea5bfd6aa_test_canal_unzip_py.html
+++ b/coverage/z_8030ef0ea5bfd6aa_test_canal_unzip_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -113,7 +113,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_8030ef0ea5bfd6aa_test_canion_py.html b/coverage/z_8030ef0ea5bfd6aa_test_canion_py.html
index 3102009e..b4aab9c5 100644
--- a/coverage/z_8030ef0ea5bfd6aa_test_canion_py.html
+++ b/coverage/z_8030ef0ea5bfd6aa_test_canion_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -111,7 +111,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_8030ef0ea5bfd6aa_test_curves_py.html b/coverage/z_8030ef0ea5bfd6aa_test_curves_py.html
index 7a329efa..ee3e19c5 100644
--- a/coverage/z_8030ef0ea5bfd6aa_test_curves_py.html
+++ b/coverage/z_8030ef0ea5bfd6aa_test_curves_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -113,7 +113,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_833b0317e3c43dca___init___py.html b/coverage/z_833b0317e3c43dca___init___py.html
index c072ffdb..54cc23fb 100644
--- a/coverage/z_833b0317e3c43dca___init___py.html
+++ b/coverage/z_833b0317e3c43dca___init___py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -89,7 +89,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_833b0317e3c43dca_common_py.html b/coverage/z_833b0317e3c43dca_common_py.html
index ad1a87be..0d8fea6a 100644
--- a/coverage/z_833b0317e3c43dca_common_py.html
+++ b/coverage/z_833b0317e3c43dca_common_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -119,7 +119,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_833b0317e3c43dca_constants_py.html b/coverage/z_833b0317e3c43dca_constants_py.html
index 6c80fc82..43e6fe38 100644
--- a/coverage/z_833b0317e3c43dca_constants_py.html
+++ b/coverage/z_833b0317e3c43dca_constants_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -162,7 +162,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_833b0317e3c43dca_loader_py.html b/coverage/z_833b0317e3c43dca_loader_py.html
index 64552fb6..b1b5abbd 100644
--- a/coverage/z_833b0317e3c43dca_loader_py.html
+++ b/coverage/z_833b0317e3c43dca_loader_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -133,7 +133,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_833b0317e3c43dca_transform_py.html b/coverage/z_833b0317e3c43dca_transform_py.html
index 831d0dee..bd035b23 100644
--- a/coverage/z_833b0317e3c43dca_transform_py.html
+++ b/coverage/z_833b0317e3c43dca_transform_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -102,7 +102,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_8a2a7f872cf1434f___init___py.html b/coverage/z_8a2a7f872cf1434f___init___py.html
index c9ac5e7a..a4239721 100644
--- a/coverage/z_8a2a7f872cf1434f___init___py.html
+++ b/coverage/z_8a2a7f872cf1434f___init___py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -97,7 +97,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_8a2a7f872cf1434f_interbpcorr_py.html b/coverage/z_8a2a7f872cf1434f_interbpcorr_py.html
index 0272aa72..7f71bb2f 100644
--- a/coverage/z_8a2a7f872cf1434f_interbpcorr_py.html
+++ b/coverage/z_8a2a7f872cf1434f_interbpcorr_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -242,15 +242,15 @@
160 roll = roll[roll.columns[1:-2]]
161 twist = twist[twist.columns[1:-2]]
162 labels = [
- 163 f"{i+1}_{self.sequence[i:i+2]}"
+ 163 f"{i+1}_{self.sequence[i:i+2]}"
164 for i in range(1, len(shift.columns) + 1)
165 ]
166 corr_index = [
- 167 f"{self.sequence[i:i+3]}" for i in range(1, len(shift.columns) + 1)
+ 167 f"{self.sequence[i:i+3]}" for i in range(1, len(shift.columns) + 1)
168 ]
169 else:
- 170 labels = [f"{i+1}_{self.sequence[i:i+2]}" for i in self.seqpos]
- 171 corr_index = [f"{self.sequence[i:i+3]}" for i in self.seqpos]
+ 170 labels = [f"{i+1}_{self.sequence[i:i+2]}" for i in self.seqpos]
+ 171 corr_index = [f"{self.sequence[i:i+3]}" for i in self.seqpos]
172
173 # rename duplicated subunits
174 shift.columns = labels
@@ -286,7 +286,7 @@
204 method = "pearson" # type: ignore
205 corr_data = ser1.corrwith(ser2_shifted, method=method)
206 corr_data.index = corr_index
- 207 results[f"{ser1.name}/{ser2.name}"] = corr_data
+ 207 results[f"{ser1.name}/{ser2.name}"] = corr_data
208 result_df = pd.DataFrame.from_dict(results)
209 result_df.index = corr_index # type: ignore
210
@@ -466,7 +466,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_8a2a7f872cf1434f_interhpcorr_py.html b/coverage/z_8a2a7f872cf1434f_interhpcorr_py.html
index a0444ce0..aa2bc86a 100644
--- a/coverage/z_8a2a7f872cf1434f_interhpcorr_py.html
+++ b/coverage/z_8a2a7f872cf1434f_interhpcorr_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -293,7 +293,7 @@
211 axs.text(
212 j+.5,
213 i+.5,
- 214 f"{corr_matrix[coordinates[j]].loc[coordinates[i]]:.2f}",
+ 214 f"{corr_matrix[coordinates[j]].loc[coordinates[i]]:.2f}",
215 ha="center",
216 va="center",
217 color="w")
@@ -303,7 +303,7 @@
221 axs.set_yticklabels(corr_matrix.index)
222 axs.set_title(
223 "Helical Parameter Correlation "
- 224 f"for Base Pair Step \'{self.basepair}\'")
+ 224 f"for Base Pair Step \'{self.basepair}\'")
225 fig.tight_layout()
226 fig.savefig(
227 self.stage_io_dict['out']['output_jpg_path'],
@@ -430,7 +430,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_8a2a7f872cf1434f_interseqcorr_py.html b/coverage/z_8a2a7f872cf1434f_interseqcorr_py.html
index 0c4a6302..7f198d80 100644
--- a/coverage/z_8a2a7f872cf1434f_interseqcorr_py.html
+++ b/coverage/z_8a2a7f872cf1434f_interseqcorr_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -205,7 +205,7 @@
123 if self.helpar_name not in constants.helical_parameters:
124 raise ValueError(
125 "Helical parameter name is invalid! "
- 126 f"Options: {constants.helical_parameters}"
+ 126 f"Options: {constants.helical_parameters}"
127 )
128
129 # get base length and unit from helical parameter name
@@ -229,9 +229,9 @@
147 ser_data = ser_data[ser_data.columns[1:-1]]
148 # discard first and last base(pairs) from strands
149 sequence = self.sequence[1:]
- 150 labels = [f"{i+1}_{sequence[i:i+2]}" for i in range(len(ser_data.columns))]
+ 150 labels = [f"{i+1}_{sequence[i:i+2]}" for i in range(len(ser_data.columns))]
151 else:
- 152 labels = [f"{i+1}_{self.sequence[i:i+2]}" for i in self.seqpos]
+ 152 labels = [f"{i+1}_{self.sequence[i:i+2]}" for i in self.seqpos]
153 ser_data.columns = labels
154
155 # make matrix
@@ -249,7 +249,7 @@
167 axs.text(
168 j + 0.5,
169 i + 0.5,
- 170 f"{corr_data[corr_data.columns[j]].iloc[i]:.2f}",
+ 170 f"{corr_data[corr_data.columns[j]].iloc[i]:.2f}",
171 ha="center",
172 va="center",
173 color="w",
@@ -259,7 +259,7 @@
177 axs.set_yticks([i + 0.5 for i in range(len(corr_data))])
178 axs.set_yticklabels(labels)
179 axs.set_title(
- 180 "Base Pair Correlation " f"for Helical Parameter '{self.helpar_name}'"
+ 180 "Base Pair Correlation " f"for Helical Parameter '{self.helpar_name}'"
181 )
182 fig.tight_layout()
183 fig.savefig(self.stage_io_dict["out"]["output_jpg_path"], format="jpg")
@@ -354,7 +354,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_957b841f7413f0a1___init___py.html b/coverage/z_957b841f7413f0a1___init___py.html
index d0971fef..3ef4a567 100644
--- a/coverage/z_957b841f7413f0a1___init___py.html
+++ b/coverage/z_957b841f7413f0a1___init___py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -89,7 +89,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_97f47455ed834d2d_test_correlation_py.html b/coverage/z_97f47455ed834d2d_test_correlation_py.html
index 001d9e10..2aee258d 100644
--- a/coverage/z_97f47455ed834d2d_test_correlation_py.html
+++ b/coverage/z_97f47455ed834d2d_test_correlation_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -209,7 +209,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_9de9475b0a6fab52___init___py.html b/coverage/z_9de9475b0a6fab52___init___py.html
index 8374775f..14d7cfbd 100644
--- a/coverage/z_9de9475b0a6fab52___init___py.html
+++ b/coverage/z_9de9475b0a6fab52___init___py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -93,7 +93,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_9de9475b0a6fab52_average_stiffness_py.html b/coverage/z_9de9475b0a6fab52_average_stiffness_py.html
index 292e86d6..360a6a96 100644
--- a/coverage/z_9de9475b0a6fab52_average_stiffness_py.html
+++ b/coverage/z_9de9475b0a6fab52_average_stiffness_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -209,7 +209,7 @@
127 if self.helpar_name not in constants.helical_parameters:
128 raise ValueError(
129 "Helical parameter name is invalid! "
- 130 f"Options: {constants.helical_parameters}"
+ 130 f"Options: {constants.helical_parameters}"
131 )
132
133 # get base length and unit from helical parameter name
@@ -224,7 +224,7 @@
142 if self.seqpos:
143 if (max(self.seqpos) > len(self.sequence) - 2) or (min(self.seqpos) < 1):
144 raise ValueError(
- 145 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
+ 145 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
146 )
147 if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1):
148 raise ValueError("seqpos must be a list of at least two integers")
@@ -239,10 +239,10 @@
157 ser_data = ser_data[ser_data.columns[1:-1]]
158 # discard first and last base(pairs) from sequence
159 sequence = self.sequence[1:]
- 160 xlabels = [f"{sequence[i:i+2]}" for i in range(len(ser_data.columns))]
+ 160 xlabels = [f"{sequence[i:i+2]}" for i in range(len(ser_data.columns))]
161 else:
162 sequence = self.sequence
- 163 xlabels = [f"{sequence[i:i+2]}" for i in self.seqpos]
+ 163 xlabels = [f"{sequence[i:i+2]}" for i in self.seqpos]
164
165 # calculate average stiffness
166 cov = ser_data.cov()
@@ -255,15 +255,15 @@
173 axs.set_xticks(range(len(xlabels)))
174 axs.set_xticklabels(xlabels)
175 axs.set_xlabel("Sequence Base Pair")
- 176 axs.set_ylabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
+ 176 axs.set_ylabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
177 axs.set_title(
- 178 "Base Pair Helical Parameter Stiffness: " f"{self.helpar_name.capitalize()}"
+ 178 "Base Pair Helical Parameter Stiffness: " f"{self.helpar_name.capitalize()}"
179 )
180 fig.savefig(self.stage_io_dict["out"]["output_jpg_path"], format="jpg")
181
182 # save table
183 dataset = pd.DataFrame(
- 184 data=avg_stiffness, index=xlabels, columns=[f"{self.helpar_name}_stiffness"]
+ 184 data=avg_stiffness, index=xlabels, columns=[f"{self.helpar_name}_stiffness"]
185 )
186 dataset.to_csv(self.stage_io_dict["out"]["output_csv_path"])
187
@@ -348,7 +348,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_9de9475b0a6fab52_basepair_stiffness_py.html b/coverage/z_9de9475b0a6fab52_basepair_stiffness_py.html
index d5b55353..9a22d13a 100644
--- a/coverage/z_9de9475b0a6fab52_basepair_stiffness_py.html
+++ b/coverage/z_9de9475b0a6fab52_basepair_stiffness_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -240,7 +240,7 @@
158 axs.text(
159 j + 0.5,
160 i + 0.5,
- 161 f"{stiff_df[coordinates[j]].loc[coordinates[i]]:.2f}",
+ 161 f"{stiff_df[coordinates[j]].loc[coordinates[i]]:.2f}",
162 ha="center",
163 va="center",
164 color="w",
@@ -257,7 +257,7 @@
175 axs.set_xticklabels(stiff_df.columns, rotation=90)
176 axs.set_yticks([i + 0.5 for i in range(len(stiff_df))])
177 axs.set_yticklabels(stiff_df.index)
- 178 axs.set_title(f"Stiffness Constants for Base Pair Step '{basepairname}'")
+ 178 axs.set_title(f"Stiffness Constants for Base Pair Step '{basepairname}'")
179 fig.tight_layout()
180 fig.savefig(self.stage_io_dict["out"]["output_jpg_path"], format="jpg")
181 plt.close()
@@ -381,7 +381,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/coverage/z_cda7f8e8576a7189_test_stiffness_py.html b/coverage/z_cda7f8e8576a7189_test_stiffness_py.html
index 5969820d..d235d16f 100644
--- a/coverage/z_cda7f8e8576a7189_test_stiffness_py.html
+++ b/coverage/z_cda7f8e8576a7189_test_stiffness_py.html
@@ -65,7 +65,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
@@ -130,7 +130,7 @@
» next
coverage.py v7.6.10,
- created at 2025-01-21 16:20 +0000
+ created at 2025-01-21 16:21 +0000
diff --git a/flake8/biobb_dna.dna.dna_averages.report.html b/flake8/biobb_dna.dna.dna_averages.report.html
new file mode 100644
index 00000000..49419b66
--- /dev/null
+++ b/flake8/biobb_dna.dna.dna_averages.report.html
@@ -0,0 +1,83 @@
+
+
+
+ flake8 violations: biobb_dna/dna/dna_averages.py
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flake8/biobb_dna.dna.dna_averages.source.html b/flake8/biobb_dna.dna.dna_averages.source.html
new file mode 100644
index 00000000..4d1861aa
--- /dev/null
+++ b/flake8/biobb_dna.dna.dna_averages.source.html
@@ -0,0 +1,890 @@
+
+
+
+ biobb_dna/dna/dna_averages.py - flake8 annotated source
+
+
+
+
+
+
+
+
+
+
1 #!/usr/bin/env python3
+
+
2
+
+
3 """Module containing the HelParAverages class and the command line interface."""
+
+
4
+
+
5 import argparse
+
+
6 from pathlib import Path
+
+
7 from typing import Optional
+
+
8
+
+
9 import matplotlib.pyplot as plt
+
+
10 import pandas as pd
+
+
11 from biobb_common.configuration import settings
+
+
12 from biobb_common.generic.biobb_object import BiobbObject
+
+
13 from biobb_common.tools.file_utils import launchlogger
+
+
14
+
+
15 from biobb_dna.utils import constants
+
+
16 from biobb_dna.utils.common import _from_string_to_list
+
+
17 from biobb_dna.utils.loader import read_series
+
+
18
+
+
19
+
+
20 class HelParAverages(BiobbObject):
+
+
21 """
+
+
22 | biobb_dna HelParAverages
+
+
23 | Load .ser file for a given helical parameter and read each column corresponding to a base calculating average over each one.
+
+
24 | Calculate average values for each base pair and save them in a .csv file.
+
+
25
+
+
26 Args:
+
+
27 input_ser_path (str): Path to .ser file for helical parameter. File is expected to be a table, with the first column being an index and the rest the helical parameter values for each base/basepair. File type: input. `Sample file <https://raw.githubusercontent.com/bioexcel/biobb_dna/master/biobb_dna/test/data/dna/canal_output_shift.ser>`_. Accepted formats: ser (edam:format_2330).
+
+
28 output_csv_path (str): Path to .csv file where output is saved. File type: output. `Sample file <https://raw.githubusercontent.com/bioexcel/biobb_dna/master/biobb_dna/test/reference/dna/shift_avg.csv>`_. Accepted formats: csv (edam:format_3752).
+
+
29 output_jpg_path (str): Path to .jpg file where output is saved. File type: output. `Sample file <https://raw.githubusercontent.com/bioexcel/biobb_dna/master/biobb_dna/test/reference/dna/shift_avg.jpg>`_. Accepted formats: jpg (edam:format_3579).
+
+
30 properties (dict):
+
+
31 * **sequence** (*str*) - (None) Nucleic acid sequence corresponding to the input .ser file. Length of sequence is expected to be the same as the total number of columns in the .ser file, minus the index column (even if later on a subset of columns is selected with the *seqpos* option).
+
+
32 * **helpar_name** (*str*) - (Optional) helical parameter name.
+
+
33 * **stride** (*int*) - (1000) granularity of the number of snapshots for plotting time series.
+
+
34 * **seqpos** (*list*) - (None) list of sequence positions (columns indices starting by 0) to analyze. If not specified it will analyse the complete sequence.
+
+
35 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
+
+
36 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
+
+
37 * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
+
+
38 Examples:
+
+
39 This is a use example of how to use the building block from Python::
+
+
40
+
+
41 from biobb_dna.dna.dna_averages import dna_averages
+
+
42
+
+
43 prop = {
+
+
44 'helpar_name': 'twist',
+
+
45 'seqpos': [1,2],
+
+
46 'sequence': 'GCAT'
+
+
47 }
+
+
48 dna_averages(
+
+
49 input_ser_path='/path/to/twist.ser',
+
+
50 output_csv_path='/path/to/table/output.csv',
+
+
51 output_jpg_path='/path/to/table/output.jpg',
+
+
52 properties=prop)
+
+
53
+
+
54 Info:
+
+
55 * wrapped_software:
+
+
56 * name: In house
+
+
57 * license: Apache-2.0
+
+
58 * ontology:
+
+
59 * name: EDAM
+
+
60 * schema: http://edamontology.org/EDAM.owl
+
+
61
+
+
62 """
+
+
63
+
+
64 def __init__(
+
+
65 self,
+
+
66 input_ser_path,
+
+
67 output_csv_path,
+
+
68 output_jpg_path,
+
+
69 properties=None,
+
+
70 **kwargs,
+
+
71 ) -> None:
+
+
72 properties = properties or {}
+
+
73
+
+
74 # Call parent class constructor
+
+
75 super().__init__(properties)
+
+
76 self.locals_var_dict = locals().copy()
+
+
77
+
+
78 # Input/Output files
+
+
79 self.io_dict = {
+
+
80 "in": {
+
+
81 "input_ser_path": input_ser_path,
+
+
82 },
+
+
83 "out": {
+
+
84 "output_csv_path": output_csv_path,
+
+
85 "output_jpg_path": output_jpg_path,
+
+
86 },
+
+
87 }
+
+
88
+
+
89 # Properties specific for BB
+
+
90 self.properties = properties
+
+
91 self.sequence = properties.get("sequence", None)
+
+
92 self.stride = properties.get("stride", 1000)
+
+
93 self.seqpos = [
+
+
94 int(elem) for elem in _from_string_to_list(properties.get("seqpos", None))
+
+
95 ]
+
+
96 self.helpar_name = properties.get("helpar_name", None)
+
+
97
+
+
98 # Check the properties
+
+
99 self.check_properties(properties)
+
+
100 self.check_arguments()
+
+
101
+
+
102 @launchlogger
+
+
103 def launch(self) -> int:
+
+
104 """Execute the :class:`HelParAverages <dna.averages.HelParAverages>` object."""
+
+
105
+
+
106 # Setup Biobb
+
+
107 if self.check_restart():
+
+
108 return 0
+
+
109 self.stage_files()
+
+
110
+
+
111 # check sequence
+
+
112 if self.sequence is None or len(self.sequence) < 2:
+
+
113 raise ValueError("sequence is null or too short!")
+
+
114
+
+
115 # get helical parameter from filename if not specified
+
+
116 if self.helpar_name is None:
+
+
117 for hp in constants.helical_parameters:
+
+
118 ser_name = Path(self.stage_io_dict["in"]["input_ser_path"]).name.lower()
+
+
119 if hp.lower() in ser_name:
+
+
120 self.helpar_name = hp
+
+
121 if self.helpar_name is None:
+
+
122 raise ValueError(
+
+
123 "Helical parameter name can't be inferred from file, "
+
+
124 "so it must be specified!"
+
+
125 )
+
+
126 else:
+
+
127 if self.helpar_name not in constants.helical_parameters:
+
+
128 raise ValueError(
+
+
129 "Helical parameter name is invalid! "
+
+
130 f"Options: {constants.helical_parameters}"
+
+
131 )
+
+
132
+
+
133 # get base length and unit from helical parameter name
+
+
134 if self.helpar_name.lower() in constants.hp_basepairs:
+
+
135 self.baselen = 1
+
+
136 elif self.helpar_name.lower() in constants.hp_singlebases:
+
+
137 self.baselen = 0
+
+
138 if self.helpar_name in constants.hp_angular:
+
+
139 self.hp_unit = "Degrees"
+
+
140 else:
+
+
141 self.hp_unit = "Angstroms"
+
+
142
+
+
143 # check seqpos
+
+
144 if self.seqpos:
+
+
145 if (max(self.seqpos) > len(self.sequence) - 2) or (min(self.seqpos) < 1):
+
+
146 raise ValueError(
+
+
147 f"seqpos values must be between 1 and {len(self.sequence) - 2}"
+
+
148 )
+
+
149 if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1):
+
+
150 raise ValueError("seqpos must be a list of at least two integers")
+
+
151 else:
+
+
152 self.seqpos = None # type: ignore
+
+
153
+
+
154 # read input .ser file
+
+
155 ser_data = read_series(
+
+
156 self.stage_io_dict["in"]["input_ser_path"], usecols=self.seqpos
+
+
157 )
+
+
158 if not self.seqpos:
+
+
159 ser_data = ser_data[ser_data.columns[1:-1]]
+
+
160 # discard first and last base(pairs) from sequence
+
+
161 sequence = self.sequence[1:]
+
+
162 xlabels = [
+
+
163 f"{sequence[i:i+1+self.baselen]}"
+
+
164 for i in range(len(ser_data.columns) - self.baselen)
+
+
165 ]
+
+
166 else:
+
+
167 sequence = self.sequence
+
+
168 xlabels = [f"{sequence[i:i+1+self.baselen]}" for i in self.seqpos]
+
+
169
+
+
170 # rename duplicated subunits
+
+
171 while any(pd.Index(ser_data.columns).duplicated()):
+
+
172 ser_data.columns = [
+
+
173 name if not duplicated else name + "_dup"
+
+
174 for duplicated, name in zip(
+
+
175 pd.Index(ser_data.columns).duplicated(), ser_data.columns
+
+
176 )
+
+
177 ]
+
+
178
+
+
179 # write output files for all selected bases
+
+
180 means = ser_data.mean(axis=0).iloc[: len(xlabels)]
+
+
181 stds = ser_data.std(axis=0).iloc[: len(xlabels)]
+
+
182
+
+
183 # save plot
+
+
184 fig, axs = plt.subplots(1, 1, dpi=300, tight_layout=True)
+
+
185 axs.errorbar(
+
+
186 means.index, means.to_numpy(), yerr=stds.to_numpy(), marker="o", capsize=5
+
+
187 )
+
+
188 axs.set_xticks(means.index)
+
+
189 axs.set_xticklabels(xlabels, rotation=90)
+
+
+
+
+ -
+
+ E225
+
+ Missing whitespace around operator
+
+
190 axs.set_xlabel("Sequence Base Pair " f"{'Step' if self.baselen==1 else ''}")
+
+
191 axs.set_ylabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
+
+
192 axs.set_title(
+
+
193 "Base Pair "
+
+
+
+
+ -
+
+ E225
+
+ Missing whitespace around operator
+
+
194 f"{'Step' if self.baselen==1 else ''} "
+
+
195 f"Helical Parameter: {self.helpar_name.capitalize()}"
+
+
196 )
+
+
197 fig.savefig(self.stage_io_dict["out"]["output_jpg_path"], format="jpg")
+
+
198
+
+
199 # save table
+
+
200 dataset = pd.DataFrame(
+
+
201 {
+
+
+
+
+ -
+
+ E225
+
+ Missing whitespace around operator
+
+
202 f"Base Pair {'Step' if self.baselen==1 else ''}": xlabels,
+
+
203 "mean": means.to_numpy(),
+
+
204 "std": stds.to_numpy(),
+
+
205 }
+
+
206 )
+
+
207 dataset.to_csv(self.stage_io_dict["out"]["output_csv_path"], index=False)
+
+
208
+
+
209 plt.close()
+
+
210
+
+
211 # Copy files to host
+
+
212 self.copy_to_host()
+
+
213
+
+
214 # Remove temporary file(s)
+
+
215 self.tmp_files.extend([self.stage_io_dict.get("unique_dir", "")])
+
+
216 self.remove_tmp_files()
+
+
217
+
+
218 self.check_arguments(output_files_created=True, raise_exception=False)
+
+
219
+
+
220 return 0
+
+
221
+
+
222
+
+
223 def dna_averages(
+
+
224 input_ser_path: str,
+
+
225 output_csv_path: str,
+
+
226 output_jpg_path: str,
+
+
227 properties: Optional[dict] = None,
+
+
228 **kwargs,
+
+
229 ) -> int:
+
+
230 """Create :class:`HelParAverages <dna.dna_averages.HelParAverages>` class and
+
+
231 execute the :meth:`launch() <dna.dna_averages.HelParAverages.launch>` method."""
+
+
232
+
+
233 return HelParAverages(
+
+
234 input_ser_path=input_ser_path,
+
+
235 output_csv_path=output_csv_path,
+
+
236 output_jpg_path=output_jpg_path,
+
+
237 properties=properties,
+
+
238 **kwargs,
+
+
239 ).launch()
+
+
240
+
+
241
+
+
242 def main():
+
+
243 """Command line execution of this building block. Please check the command line documentation."""
+
+
244 parser = argparse.ArgumentParser(
+
+
245 description="Load helical parameter file and calculate average values for each base pair.",
+
+
246 formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
+
+
247 )
+
+
248 parser.add_argument("--config", required=False, help="Configuration file")
+
+
249
+
+
250 required_args = parser.add_argument_group("required arguments")
+
+
251 required_args.add_argument(
+
+
252 "--input_ser_path",
+
+
253 required=True,
+
+
254 help="Helical parameter input ser file path. Accepted formats: ser.",
+
+
255 )
+
+
256 required_args.add_argument(
+
+
257 "--output_csv_path",
+
+
258 required=True,
+
+
259 help="Path to output csv file. Accepted formats: csv.",
+
+
260 )
+
+
261 required_args.add_argument(
+
+
262 "--output_jpg_path",
+
+
263 required=True,
+
+
264 help="Path to output jpg file. Accepted formats: jpg.",
+
+
265 )
+
+
266
+
+
267 args = parser.parse_args()
+
+
268 args.config = args.config or "{}"
+
+
269 properties = settings.ConfReader(config=args.config).get_prop_dic()
+
+
270
+
+
271 dna_averages(
+
+
272 input_ser_path=args.input_ser_path,
+
+
273 output_csv_path=args.output_csv_path,
+
+
274 output_jpg_path=args.output_jpg_path,
+
+
275 properties=properties,
+
+
276 )
+
+
277
+
+
278
+
+
279 if __name__ == "__main__":
+
+
280 main()
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flake8/biobb_dna.dna.dna_timeseries.report.html b/flake8/biobb_dna.dna.dna_timeseries.report.html
new file mode 100644
index 00000000..9c998414
--- /dev/null
+++ b/flake8/biobb_dna.dna.dna_timeseries.report.html
@@ -0,0 +1,73 @@
+
+
+
+ flake8 violations: biobb_dna/dna/dna_timeseries.py
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flake8/biobb_dna.dna.dna_timeseries.source.html b/flake8/biobb_dna.dna.dna_timeseries.source.html
new file mode 100644
index 00000000..66a429ea
--- /dev/null
+++ b/flake8/biobb_dna.dna.dna_timeseries.source.html
@@ -0,0 +1,1037 @@
+
+
+
+ biobb_dna/dna/dna_timeseries.py - flake8 annotated source
+
+
+
+
+
+
+
+
+
+
1 #!/usr/bin/env python3
+
+
2
+
+
3 """Module containing the HelParTimeSeries class and the command line interface."""
+
+
4
+
+
5 import argparse
+
+
6 import re
+
+
7 import zipfile
+
+
8 from pathlib import Path
+
+
9 from typing import Optional
+
+
10
+
+
11 import matplotlib.pyplot as plt
+
+
12 import pandas as pd
+
+
13 from biobb_common.configuration import settings
+
+
14 from biobb_common.generic.biobb_object import BiobbObject
+
+
15 from biobb_common.tools import file_utils as fu
+
+
16 from biobb_common.tools.file_utils import launchlogger
+
+
17
+
+
18 from biobb_dna.utils import constants
+
+
19 from biobb_dna.utils.common import _from_string_to_list
+
+
20 from biobb_dna.utils.loader import read_series
+
+
21
+
+
22
+
+
23 class HelParTimeSeries(BiobbObject):
+
+
24 """
+
+
25 | biobb_dna HelParTimeSeries
+
+
26 | Created time series and histogram plots for each base pair from a helical parameter series file.
+
+
27 | The helical parameter series file is expected to be a table, with the first column being an index and the rest the helical parameter values for each base/basepair.
+
+
28
+
+
29 Args:
+
+
30 input_ser_path (str): Path to .ser file for helical parameter. File is expected to be a table, with the first column being an index and the rest the helical parameter values for each base/basepair. File type: input. `Sample file <https://raw.githubusercontent.com/bioexcel/biobb_dna/master/biobb_dna/test/data/dna/canal_output_shift.ser>`_. Accepted formats: ser (edam:format_2330).
+
+
31 output_zip_path (str): Path to output .zip files where data is saved. File type: output. `Sample file <https://raw.githubusercontent.com/bioexcel/biobb_dna/master/biobb_dna/test/reference/dna/timeseries_output.zip>`_. Accepted formats: zip (edam:format_3987).
+
+
32 properties (dict):
+
+
33 * **sequence** (*str*) - (None) Nucleic acid sequence corresponding to the input .ser file. Length of sequence is expected to be the same as the total number of columns in the .ser file, minus the index column (even if later on a subset of columns is selected with the *usecols* option).
+
+
34 * **bins** (*int*) - (None) Bins for histogram. Parameter has same options as matplotlib.pyplot.hist.
+
+
35 * **helpar_name** (*str*) - (None) Helical parameter name. It must match the name of the helical parameter in the .ser input file. Values: majd, majw, mind, minw, inclin, tip, xdisp, ydisp, shear, stretch, stagger, buckle, propel, opening, rise, roll, twist, shift, slide, tilt, alphaC, alphaW, betaC, betaW, gammaC, gammaW, deltaC, deltaW, epsilC, epsilW, zetaC, zetaW, chiC, chiW, phaseC, phaseW.
+
+
36 * **stride** (*int*) - (1000) granularity of the number of snapshots for plotting time series.
+
+
37 * **seqpos** (*list*) - (None) list of sequence positions (columns indices starting by 1) to analyze. If not specified it will analyse the complete sequence.
+
+
38 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
+
+
39 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
+
+
40 * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
+
+
41
+
+
42 Examples:
+
+
43 This is a use example of how to use the building block from Python::
+
+
44
+
+
45 from biobb_dna.dna.dna_timeseries import dna_timeseries
+
+
46
+
+
47 prop = {
+
+
48 'helpar_name': 'twist',
+
+
49 'seqpos': [1,2,3,4,5],
+
+
50 'sequence': 'GCAACGTGCTATGGAAGC',
+
+
51 }
+
+
52 dna_timeseries(
+
+
53 input_ser_path='/path/to/twist.ser',
+
+
54 output_zip_path='/path/to/output/file.zip'
+
+
55 properties=prop)
+
+
56 Info:
+
+
57 * wrapped_software:
+
+
58 * name: In house
+
+
59 * license: Apache-2.0
+
+
60 * ontology:
+
+
61 * name: EDAM
+
+
62 * schema: http://edamontology.org/EDAM.owl
+
+
63
+
+
64 """
+
+
65
+
+
66 def __init__(
+
+
67 self, input_ser_path, output_zip_path, properties=None, **kwargs
+
+
68 ) -> None:
+
+
69 properties = properties or {}
+
+
70
+
+
71 # Call parent class constructor
+
+
72 super().__init__(properties)
+
+
73 self.locals_var_dict = locals().copy()
+
+
74
+
+
75 # Input/Output files
+
+
76 self.io_dict = {
+
+
77 "in": {
+
+
78 "input_ser_path": input_ser_path,
+
+
79 },
+
+
80 "out": {"output_zip_path": output_zip_path},
+
+
81 }
+
+
82
+
+
83 self.properties = properties
+
+
84 self.sequence = properties.get("sequence", None)
+
+
85 self.bins = properties.get("bins", "auto")
+
+
86 self.stride = properties.get("stride", 10)
+
+
87 self.seqpos = [
+
+
88 int(elem) for elem in _from_string_to_list(properties.get("seqpos", None))
+
+
89 ]
+
+
90 self.helpar_name = properties.get("helpar_name", None)
+
+
91
+
+
92 # get helical parameter from filename if not specified
+
+
93 if self.helpar_name is None:
+
+
94 for hp in constants.helical_parameters:
+
+
95 if hp.lower() in Path(input_ser_path).name.lower():
+
+
96 self.helpar_name = hp
+
+
97 if self.helpar_name is None:
+
+
98 raise ValueError(
+
+
99 "Helical parameter name can't be inferred from file, "
+
+
100 "so it must be specified!"
+
+
101 )
+
+
102 else:
+
+
103 if self.helpar_name not in constants.helical_parameters:
+
+
104 raise ValueError(
+
+
105 "Helical parameter name is invalid! "
+
+
106 f"Options: {constants.helical_parameters}"
+
+
107 )
+
+
108
+
+
109 # get base length from helical parameter name
+
+
110 if self.helpar_name.lower() in constants.hp_singlebases:
+
+
111 self.baselen = 0
+
+
112 else:
+
+
113 self.baselen = 1
+
+
114 # get unit from helical parameter name
+
+
115 if self.helpar_name in constants.hp_angular:
+
+
116 self.hp_unit = "Degrees"
+
+
117 else:
+
+
118 self.hp_unit = "Angstroms"
+
+
119
+
+
120 # Check the properties
+
+
121 self.check_properties(properties)
+
+
122 self.check_arguments()
+
+
123
+
+
124 @launchlogger
+
+
125 def launch(self) -> int:
+
+
126 """Execute the :class:`HelParTimeSeries <dna.dna_timeseries.HelParTimeSeries>` object."""
+
+
127
+
+
128 # Setup Biobb
+
+
129 if self.check_restart():
+
+
130 return 0
+
+
131 self.stage_files()
+
+
132
+
+
133 # check sequence
+
+
134 if self.sequence is None or len(self.sequence) < 2:
+
+
135 raise ValueError("sequence is null or too short!")
+
+
136
+
+
137 # calculate cols with 0 index
+
+
138 if self.seqpos:
+
+
139 cols = [i - 1 for i in self.seqpos]
+
+
140 else:
+
+
141 cols = list(range(len(self.sequence)))
+
+
142
+
+
143 # sort cols in ascending order
+
+
144 cols.sort()
+
+
145
+
+
146 # check seqpos for base pairs
+
+
147 if self.seqpos and self.helpar_name in constants.hp_basepairs:
+
+
148 if (max(cols) > len(self.sequence) - 2) or (min(cols) < 0):
+
+
149 raise ValueError(
+
+
150 f"seqpos values must be between 1 and {len(self.sequence) - 1}"
+
+
151 )
+
+
152 if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1):
+
+
153 raise ValueError("seqpos must be a list of at least two integers")
+
+
154 # check seqpos for non base pairs
+
+
155 elif self.seqpos and self.helpar_name not in constants.hp_basepairs:
+
+
156 if (max(cols) > len(self.sequence) - 1) or (min(cols) < 0):
+
+
157 raise ValueError(
+
+
158 f"seqpos values must be between 1 and {len(self.sequence)}"
+
+
159 )
+
+
160 if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1):
+
+
161 raise ValueError("seqpos must be a list of at least two integers")
+
+
162
+
+
163 if self.helpar_name in constants.hp_basepairs:
+
+
164 # remove first and last base pairs from cols if they match 0 and len(sequence)
+
+
165 if min(cols) == 0:
+
+
166 cols.pop(0)
+
+
167 if max(cols) == len(self.sequence) - 1:
+
+
168 cols.pop(-1)
+
+
169
+
+
170 # discard first and last base(pairs) from sequence
+
+
171 sequence = self.sequence[1:-1]
+
+
172 # create indices list
+
+
173 indices = cols.copy()
+
+
174 # create subunits list from cols
+
+
175 subunits = [f"{i+1}_{sequence[i-1:i+self.baselen]}" for i in cols]
+
+
176 # clean subunits (leave only basepairs)
+
+
177 pattern = re.compile(r"\d+_[A-Za-z]{2}")
+
+
178 # get removed items
+
+
179 removed_items = [s for s in subunits if not pattern.fullmatch(s)]
+
+
180 # get indices of removed items (in integer format and starting from 0)
+
+
181 removed_numbers = [
+
+
182 int(match.group())
+
+
183 for item in removed_items
+
+
184 if (match := re.match(r"\d+", item))
+
+
185 ]
+
+
186 removed_numbers = list(map(int, removed_numbers))
+
+
187 removed_numbers = [int(i) - 1 for i in removed_numbers]
+
+
188 # remove non basepairs from subunits and indices
+
+
189 subunits = [s for s in subunits if pattern.fullmatch(s)]
+
+
190 indices = [i for i in indices if i not in removed_numbers]
+
+
191 else:
+
+
192 sequence = self.sequence
+
+
193 # create indices list
+
+
194 indices = cols.copy()
+
+
195 # trick for getting the index column from the .ser file
+
+
196 indices.insert(0, 0)
+
+
197 # create subunits list from cols
+
+
198 subunits = [f"{i+1}_{sequence[i:i+1+self.baselen]}" for i in cols]
+
+
199
+
+
200 # read input .ser file
+
+
201 ser_data = read_series(
+
+
202 self.stage_io_dict["in"]["input_ser_path"], usecols=indices
+
+
203 )
+
+
204
+
+
205 # get columns for selected bases
+
+
206 ser_data.columns = subunits
+
+
207
+
+
208 # write output files for all selected bases (one per column)
+
+
209 zf = zipfile.ZipFile(Path(self.stage_io_dict["out"]["output_zip_path"]), "w")
+
+
210 for col in ser_data.columns:
+
+
211 # unstack columns to prevent errors from repeated base pairs
+
+
212 column_data = ser_data[[col]].unstack().dropna().reset_index(drop=True)
+
+
213 column_data.name = col
+
+
214 fu.log(f"Computing base number {col}...")
+
+
215
+
+
216 # column series
+
+
217 series_colfn = f"series_{self.helpar_name}_{col}"
+
+
218 column_data.to_csv(
+
+
219 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.csv"
+
+
220 )
+
+
221 # save table
+
+
222 zf.write(
+
+
223 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.csv",
+
+
224 arcname=f"{series_colfn}.csv",
+
+
225 )
+
+
226
+
+
227 fig, axs = plt.subplots(1, 1, dpi=300, tight_layout=True)
+
+
228 reduced_data = column_data.iloc[:: self.stride]
+
+
229 axs.plot(reduced_data.index, reduced_data.to_numpy())
+
+
230 axs.set_xlabel("Time (Snapshots)")
+
+
231 axs.set_ylabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
+
+
232 axs.set_title(
+
+
233 f"Helical Parameter vs Time: {self.helpar_name.capitalize()} "
+
+
234 "(base pair "
+
+
+
+
+ -
+
+ E225
+
+ Missing whitespace around operator
+
+
235 f"{'step' if self.baselen==1 else ''} {col})"
+
+
236 )
+
+
237 fig.savefig(
+
+
238 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.jpg",
+
+
239 format="jpg",
+
+
240 )
+
+
241 # save plot
+
+
242 zf.write(
+
+
243 Path(self.stage_io_dict.get("unique_dir", "")) / f"{series_colfn}.jpg",
+
+
244 arcname=f"{series_colfn}.jpg",
+
+
245 )
+
+
246 plt.close()
+
+
247
+
+
248 # columns histogram
+
+
249 hist_colfn = f"hist_{self.helpar_name}_{col}"
+
+
250 fig, axs = plt.subplots(1, 1, dpi=300, tight_layout=True)
+
+
251 ybins, x, _ = axs.hist(column_data, bins=self.bins)
+
+
252 pd.DataFrame({self.helpar_name: x[:-1], "density": ybins}).to_csv(
+
+
253 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.csv",
+
+
254 index=False,
+
+
255 )
+
+
256 # save table
+
+
257 zf.write(
+
+
258 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.csv",
+
+
259 arcname=f"{hist_colfn}.csv",
+
+
260 )
+
+
261
+
+
262 axs.set_ylabel("Density")
+
+
263 axs.set_xlabel(f"{self.helpar_name.capitalize()} ({self.hp_unit})")
+
+
264 fig.savefig(
+
+
265 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.jpg",
+
+
266 format="jpg",
+
+
267 )
+
+
268 # save plot
+
+
269 zf.write(
+
+
270 Path(self.stage_io_dict.get("unique_dir", "")) / f"{hist_colfn}.jpg",
+
+
271 arcname=f"{hist_colfn}.jpg",
+
+
272 )
+
+
273 plt.close()
+
+
274 zf.close()
+
+
275
+
+
276 # Copy files to host
+
+
277 self.copy_to_host()
+
+
278
+
+
279 # Remove temporary file(s)
+
+
280 self.tmp_files.extend([self.stage_io_dict.get("unique_dir", "")])
+
+
281 self.remove_tmp_files()
+
+
282
+
+
283 self.check_arguments(output_files_created=True, raise_exception=False)
+
+
284
+
+
285 return 0
+
+
286
+
+
287
+
+
288 def dna_timeseries(
+
+
289 input_ser_path: str,
+
+
290 output_zip_path: str,
+
+
291 properties: Optional[dict] = None,
+
+
292 **kwargs,
+
+
293 ) -> int:
+
+
294 """Create :class:`HelParTimeSeries <dna.dna_timeseries.HelParTimeSeries>` class and
+
+
295 execute the :meth:`launch() <dna.dna_timeseries.HelParTimeSeries.launch>` method."""
+
+
296
+
+
297 return HelParTimeSeries(
+
+
298 input_ser_path=input_ser_path,
+
+
299 output_zip_path=output_zip_path,
+
+
300 properties=properties,
+
+
301 **kwargs,
+
+
302 ).launch()
+
+
303
+
+
304
+
+
305 def main():
+
+
306 """Command line execution of this building block. Please check the command line documentation."""
+
+
307 parser = argparse.ArgumentParser(
+
+
308 description="Created time series and histogram plots for each base pair from a helical parameter series file.",
+
+
309 formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
+
+
310 )
+
+
311 parser.add_argument("--config", required=False, help="Configuration file")
+
+
312
+
+
313 required_args = parser.add_argument_group("required arguments")
+
+
314 required_args.add_argument(
+
+
315 "--input_ser_path",
+
+
316 required=True,
+
+
317 help="Helical parameter input ser file path. Accepted formats: ser.",
+
+
318 )
+
+
319 required_args.add_argument(
+
+
320 "--output_zip_path", required=True, help="Path to output directory."
+
+
321 )
+
+
322
+
+
323 args = parser.parse_args()
+
+
324 args.config = args.config or "{}"
+
+
325 properties = settings.ConfReader(config=args.config).get_prop_dic()
+
+
326
+
+
327 dna_timeseries(
+
+
328 input_ser_path=args.input_ser_path,
+
+
329 output_zip_path=args.output_zip_path,
+
+
330 properties=properties,
+
+
331 )
+
+
332
+
+
333
+
+
334 if __name__ == "__main__":
+
+
335 main()
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flake8/flake8badge.svg b/flake8/flake8badge.svg
index 58d58174..55710d42 100644
--- a/flake8/flake8badge.svg
+++ b/flake8/flake8badge.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/flake8/flake8stats.txt b/flake8/flake8stats.txt
index e69de29b..485dc39c 100644
--- a/flake8/flake8stats.txt
+++ b/flake8/flake8stats.txt
@@ -0,0 +1 @@
+4 E225 missing whitespace around operator
diff --git a/flake8/index.html b/flake8/index.html
index 72ffb954..f85061bd 100644
--- a/flake8/index.html
+++ b/flake8/index.html
@@ -6,22 +6,30 @@
-
+
flake8 violations
-
Generated on 2025-01-21 16:19
+
Generated on 2025-01-21 16:20
with Installed plugins: flake8-html: 0.4.3, mccabe: 0.7.0, pycodestyle: 2.12.1, pyflakes: 3.2.0
diff --git a/junit/junit.xml b/junit/junit.xml
index f281ff09..0ae1d8d9 100644
--- a/junit/junit.xml
+++ b/junit/junit.xml
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/junit/report.html b/junit/report.html
index 5532737b..12ffd4b7 100644
--- a/junit/report.html
+++ b/junit/report.html
@@ -7,7 +7,7 @@
report.html
-
Report generated on 21-Jan-2025 at 16:20:24 by pytest-html
+
Report generated on 21-Jan-2025 at 16:21:44 by pytest-html
v4.1.1