This can be problematic if a function is using the value to shifted as an argument, and this can be zero. In that case, this unintended behaviour happens:
from pydna.dseqrecord import Dseqrecord
from Bio.SeqFeature import SeqFeature, SimpleLocation
dseqr = Dseqrecord('ACCGGGTTTT', circular=True)
dseqr.features = [SeqFeature(SimpleLocation(0, 3, 1), type='misc_feature')]
# Shift by zero, returns the same sequence
dseqr_shifted = dseqr.shifted(0)
print(dseqr is dseqr_shifted) # Should be False, but it's True
# Add a feature to the shifted sequence
dseqr_shifted.features += [SeqFeature(SimpleLocation(3, 9, 1), type='misc_feature')]
print(len(dseqr.features)) #Should be 1, but it's 2
print(len(dseqr_shifted.features)) # Should be 2, it's 2
This can be problematic if a function is using the value to
shifted
as an argument, and this can be zero. In that case, this unintended behaviour happens: