pydna icon indicating copy to clipboard operation
pydna copied to clipboard

pydna.seqrecord.SeqRecord modifies the seq property by removing spaces in the sequence.

Open BjornFJohansson opened this issue 5 months ago • 0 comments

pydna.seqrecord.SeqRecord in _fix_attributes method:

self.seq._data = b"".join(self.seq._data.split()) # remove whitespaces

It could be argued that this should happen in the init of the pydna.seq.Seq class itself. Right now, the pydna.seq.Seq class does not call the parent init.

The current code fails in the Seq object does not have a sequence with is optional in Bio.Seq.Seq:

from Bio.Seq import Seq
x = Seq(None, length=2000)
assert len(x) == 2000

BjornFJohansson avatar Nov 08 '25 07:11 BjornFJohansson