Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update shift_location for origin-wrapping feature with strand None #179

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

manulera
Copy link
Collaborator

@manulera manulera commented Jan 18, 2024

Hi @BjornFJohansson I think this should be the expected behaviour (strand = None same as strand = +1). See the example below, for a feature that wraps around the origin in a molecule of length 12:

from pydna.utils import shift_location
from Bio.SeqFeature import SimpleLocation


for strand in [None, 1, -1]:
    print('strand:', strand)
    print(shift_location(SimpleLocation(10, 14, strand), 0, 12))
    print()

Output is:

strand: None
join{[0:2], [10:12]}

strand: 1
join{[10:12](+), [0:2](+)}

strand: -1
join{[0:2](-), [10:12](-)}

I think for strand == None it should be join{[10:12], [0:2]} which more clearly shows the origin-wrapping nature of the feature.

The tests that fail are the same ones as before the change, so I don't think this breaks anything in the tests

@BjornFJohansson
Copy link
Collaborator

Sure!

@BjornFJohansson BjornFJohansson merged commit c6ac1a7 into cutsite_pairs Jan 26, 2024
0 of 45 checks passed
@manulera manulera deleted the fix_shift_location branch February 6, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants