Skip to content

Commit

Permalink
fix #337
Browse files Browse the repository at this point in the history
  • Loading branch information
manulera committed Jan 23, 2025
1 parent 4c85d9c commit d28e35e
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 31 deletions.
5 changes: 5 additions & 0 deletions dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
from pydna.dseqrecord import Dseqrecord

dsr = Dseqrecord("ATGCAAACAGTAATGATATAAT")
dsr.reverse_complement()
61 changes: 34 additions & 27 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repository = "https://github.com/pydna-group/pydna/tree/master"
version = "6.0.0-a.24.post.17+b7b559bd66"
[tool.poetry.dependencies]
appdirs = ">=1.4.4"
biopython = ">=1.80,<1.85"
biopython = "1.85"
cai2 = { version = ">=1.0.5", optional = true }
matplotlib = { version = ">=3.4.3", optional = true }
networkx = ">=2.8.8"
Expand Down
25 changes: 22 additions & 3 deletions src/pydna/seqrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,29 @@ class SeqRecord(_SeqRecord):
nicer output in the IPython shell.
"""

def __init__(self, seq, *args, id="id", name="name", description="description", **kwargs):
def __init__(
self,
seq,
id="id",
name="name",
description="description",
dbxrefs=None,
features=None,
annotations=None,
letter_annotations=None,
):
if isinstance(seq, str):
seq = _Seq(seq)
super().__init__(seq, *args, id=id, name=name, description=description, **kwargs)
super().__init__(
seq,
id=id,
name=name,
description=description,
dbxrefs=dbxrefs,
features=features,
annotations=annotations,
letter_annotations=letter_annotations,
)
self._fix_attributes()

def _fix_attributes(self):
Expand Down Expand Up @@ -612,7 +631,7 @@ def removeprefix(text, prefix):

if format == "pydnafasta":
return _pretty_str(
f">{self.id} {len(self)} bp {dict(((True,'circular'),(False,'linear')))[self.seq.circular]}\n{str(self.seq)}\n"
f">{self.id} {len(self)} bp {dict(((True, 'circular'), (False, 'linear')))[self.seq.circular]}\n{str(self.seq)}\n"
)
if format == "primer":
return _pretty_str(
Expand Down

0 comments on commit d28e35e

Please sign in to comment.