diff --git a/src/pydna/myprimers.py b/src/pydna/myprimers.py index a6f4dfa4..2f1ac5bb 100644 --- a/src/pydna/myprimers.py +++ b/src/pydna/myprimers.py @@ -156,7 +156,7 @@ def pydna_code_from_list(self, lst: list): try: prstrs.index(str(p.seq).upper()) except ValueError as e: - print(f"{p.format('fasta-2line')}") + print(f"{p.format('primer')}") err = e else: indices.append(self.data.index(p)) @@ -168,7 +168,7 @@ def pydna_code_from_list(self, lst: list): msg += f"{self.identifier} = {curly}\n\n" msg += ", ".join(f"{self.identifier}[{i}]" for i in indices) msg += " = parse_primers('''\n\n" - msg += "\n".join(self[i].format("fasta-2line") for i in indices) + msg += "\n".join(self[i].format("primer") for i in indices) msg += "\n''')" return _pretty_str(msg) diff --git a/src/pydna/seqrecord.py b/src/pydna/seqrecord.py index 1baa81e2..49e230a4 100755 --- a/src/pydna/seqrecord.py +++ b/src/pydna/seqrecord.py @@ -628,7 +628,7 @@ def removeprefix(text, prefix): ) if format == "primer": return _pretty_str( - f">{self.id} {len(self)}-mer {removeprefix(self.description, self.name).strip()}\n{str(self.seq)}\n" + f">{self.id} {len(self)}-mer{removeprefix(self.description, self.name).strip()}\n{str(self.seq)}\n" ) return _pretty_str(super().__format__(format)) diff --git a/tests/test_module_myprimers.py b/tests/test_module_myprimers.py index dbfe73b2..8a3b3664 100644 --- a/tests/test_module_myprimers.py +++ b/tests/test_module_myprimers.py @@ -70,16 +70,16 @@ def test_PrimerList_init(monkeypatch): p[0], p[1], p[2], p[3] = parse_primers(''' - >0_primer + >0_primer 8-mer tttttttt - >1_primer + >1_primer 8-mer gggggggg - >2_primer + >2_primer 8-mer cccccccc - >3_primer + >3_primer 8-mer aaaaaaaa ''')""" @@ -145,4 +145,4 @@ def test_find_duplicate_primers(monkeypatch): if __name__ == "__main__": - pytest.main([__file__, "-v", "-s"]) + pytest.main([__file__, "-vvv", "-s"])