diff --git a/biobb_dna/backbone/bipopulations.py b/biobb_dna/backbone/bipopulations.py index e234534e..0cabe9c0 100755 --- a/biobb_dna/backbone/bipopulations.py +++ b/biobb_dna/backbone/bipopulations.py @@ -95,10 +95,12 @@ def __init__( self.properties = properties self.sequence = properties.get("sequence") + # self.seqpos = properties.get("seqpos", None) self.seqpos = [ - int(item) for item in _from_string_to_list(properties.get("seqpos", None)) + int(elem) for elem in _from_string_to_list(properties.get("seqpos", None)) ] - + print("seqpos::::::::") + print(self.seqpos) # Check the properties self.check_properties(properties) self.check_arguments() @@ -124,6 +126,8 @@ def launch(self) -> int: ) if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1): raise ValueError("seqpos must be a list of at least two integers") + else: + self.seqpos = None # type: ignore # read input files epsilC = read_series( @@ -192,7 +196,7 @@ def get_xlabels(self, strand1, strand2): labelsC[-1] = f"{labelsC[-1]}3'" labelsC = [f"{i}-{j}" for i, j in zip(labelsC, range(len(labelsC), 0, -1))] - if self.seqpos: + if self.seqpos is not None: labelsC = [labelsC[i] for i in self.seqpos] labelsW = [labelsW[i] for i in self.seqpos] xlabels = labelsW + ["-"] + labelsC diff --git a/biobb_dna/backbone/canonicalag.py b/biobb_dna/backbone/canonicalag.py index c0b6d979..f60e31a6 100755 --- a/biobb_dna/backbone/canonicalag.py +++ b/biobb_dna/backbone/canonicalag.py @@ -126,6 +126,8 @@ def launch(self) -> int: ) if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1): raise ValueError("seqpos must be a list of at least two integers") + else: + self.seqpos = None # type: ignore # read input files alphaC = read_series( diff --git a/biobb_dna/backbone/puckering.py b/biobb_dna/backbone/puckering.py index 8d13d4fe..c1e6e40a 100755 --- a/biobb_dna/backbone/puckering.py +++ b/biobb_dna/backbone/puckering.py @@ -118,6 +118,8 @@ def launch(self) -> int: ) if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1): raise ValueError("seqpos must be a list of at least two integers") + else: + self.seqpos = None # type: ignore # read input files phaseC = read_series( diff --git a/biobb_dna/dna/dna_averages.py b/biobb_dna/dna/dna_averages.py index ae157901..8732719c 100755 --- a/biobb_dna/dna/dna_averages.py +++ b/biobb_dna/dna/dna_averages.py @@ -148,6 +148,8 @@ def launch(self) -> int: ) if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1): raise ValueError("seqpos must be a list of at least two integers") + else: + self.seqpos = None # type: ignore # read input .ser file ser_data = read_series( diff --git a/biobb_dna/stiffness/average_stiffness.py b/biobb_dna/stiffness/average_stiffness.py index 19c4d8ce..0b100914 100755 --- a/biobb_dna/stiffness/average_stiffness.py +++ b/biobb_dna/stiffness/average_stiffness.py @@ -146,6 +146,8 @@ def launch(self) -> int: ) if not (isinstance(self.seqpos, list) and len(self.seqpos) > 1): raise ValueError("seqpos must be a list of at least two integers") + else: + self.seqpos = None # type: ignore # read input .ser file ser_data = read_series( diff --git a/biobb_dna/test/unitests/test_backbone/test_bipopulations.py b/biobb_dna/test/unitests/test_backbone/test_bipopulations.py index 88ace0b8..c5aaa085 100644 --- a/biobb_dna/test/unitests/test_backbone/test_bipopulations.py +++ b/biobb_dna/test/unitests/test_backbone/test_bipopulations.py @@ -1,21 +1,25 @@ # type: ignore +import platform + from biobb_common.tools import test_fixtures as fx + from biobb_dna.backbone.bipopulations import bipopulations -import platform -class TestBIPopulations(): +class TestBIPopulations: def setup_class(self): - fx.test_setup(self, 'bipopulations') + fx.test_setup(self, "bipopulations") def teardown_class(self): - fx.test_teardown(self) + pass + + # fx.test_teardown(self) def test_bipopulations(self): returncode = bipopulations(properties=self.properties, **self.paths) - assert fx.not_empty(self.paths['output_csv_path']) - assert fx.not_empty(self.paths['output_jpg_path']) + assert fx.not_empty(self.paths["output_csv_path"]) + assert fx.not_empty(self.paths["output_jpg_path"]) assert fx.exe_success(returncode) - if platform.system() == 'Darwin': - assert fx.equal(self.paths['output_csv_path'], self.paths['ref_csv_output']) - assert fx.equal(self.paths['output_jpg_path'], self.paths['ref_jpg_output']) + if platform.system() == "Darwin": + assert fx.equal(self.paths["output_csv_path"], self.paths["ref_csv_output"]) + assert fx.equal(self.paths["output_jpg_path"], self.paths["ref_jpg_output"])