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

Should fix 825: import cadnano - domains that end on deletions #826

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

mmguar
Copy link

@mmguar mmguar commented Oct 27, 2022

Import from cadnano can now shorten domains that end on a deletion (or multiple deletions).

Description

Modified design.dart to look at domains and recognize which ones end on deletions.
Possibly unwanted behavior: it will shorten a scaffold too, if deletions are at either of its ends.
It might not be the best way of doing this, and it's for sure not elegant, but it might be helpful to have a first implementation.

Related Issue

#825

Motivation and Context

Avoids warning stars when importing from cadnano, automates a tedious compatibility task.

How Has This Been Tested?

Tried on multiple deletions located at strand ends.
Could not run extensive tests on this machine (no google chrome).

@mmguar mmguar requested a review from dave-doty as a code owner October 27, 2022 01:14
Copy link
Member

@dave-doty dave-doty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit worried that this doesn't handle corner cases well. For example, what if there is a strand with a domain of length 2 and a deletion on one of its ends? I think it will have an infinite loop moving the deletion back and forth between the ends:

image

I'm also not sure how to handle corner cases such as this:

image

I'm happy to say those cases are super-rare and just not handle them (i.e., remove the deletion), but definitely don't want things to break or crash in that case.

@mmguar
Copy link
Author

mmguar commented Oct 31, 2022

I haven't seen the issue in the second case yet, the top strand is shortened by one. Is it because either of them could be considered scaffold?

The first case does not hang in infinite loop, but still returns an error (I suppose when the staple is found not to exist anymore).

****************************************************************************************************
* error type:    JSNoSuchMethodError
* error message: TypeError: can't access property Symbol.iterator, deserialized_helices_list is null
****************************************************************************************************

I am not sure what the best fix is. The error given is much clearer in the case where an entire staple has deletions. In that case the error given is Invalid Design.

Hopefully the code is still somewhat helpful in the future, I might have some time to improve on it, but not likely soon.

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