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

Decide on interface for Renumerator #40

Open
krother opened this issue Aug 22, 2014 · 9 comments
Open

Decide on interface for Renumerator #40

krother opened this issue Aug 22, 2014 · 9 comments

Comments

@krother
Copy link
Collaborator

krother commented Aug 22, 2014

No description provided.

@cosi1
Copy link
Collaborator

cosi1 commented Aug 22, 2014

Maybe something like that would do the job?

__init__(structure, alignment = False)

When alignment is given, the constructor automatically inserts required gaps, basing on that alignment. If not, it is assumed that nothing will be inserted unless the user invokes insert_gap() manually.

insert_gap(position, length)

Inserts a gap at a given position.

renumber()

Applies all the insertions to the structure passed to the constructor.

@krother
Copy link
Collaborator Author

krother commented Aug 22, 2014

Would the structure be the template or the model? Can I use it for both (e.g. when modeling multiple templates or fragments?

I would like to have a method that renumbers a small section:

def renumber_section(index_start, index_end)

E.g. for renumbering a fragment at a specific location. If no alignment is given, the indices can be interpreted as residue numbers directly.

@krother krother closed this as completed Aug 22, 2014
@krother krother reopened this Aug 22, 2014
@cosi1
Copy link
Collaborator

cosi1 commented Aug 22, 2014

Would the structure be the template or the model? Can I use it for both (e.g. when modeling multiple templates or fragments?

I think that it would be best to operate on both template and model (since they are both descendants of ModernaStructure).

def renumber_section(index_start, index_end)

Could you explain that?

@krother
Copy link
Collaborator Author

krother commented Aug 22, 2014

The idea was to use Renumerator to renumber a fragment before inserting it. For that, Renumerator needs to know which part of the model it belongs to. Or would we create a proxy alignment for each fragment?

I agree that Renumerator could operate on both templates and models.

@cosi1
Copy link
Collaborator

cosi1 commented Aug 22, 2014

The idea was to use Renumerator to renumber a fragment before inserting it. For that, Renumerator needs to know which part of the model it belongs to. Or would we create a proxy alignment for each fragment?

Hmm... I didn't think of it that way... I always thought of the renumerator as a tool to insert gaps into structures (templates and models). Maybe we might need to rethink the idea of the renumerator to be more versatile.

@krother
Copy link
Collaborator Author

krother commented Aug 22, 2014

OK now I understand better. For that the interface you propose is very sound. I think this part is ready to be implemented. No need to mix responsibilities.

We also need to figure out where to put the renumeration code from Fragments. Could be a separate place.

@cosi1
Copy link
Collaborator

cosi1 commented Aug 22, 2014

Ok, so let's wait for Lena's opinion. When we reach consensus, I'll start implementing the logic (basically copypasting from renumber_template()).

@lenarother
Copy link
Owner

OK, I agree that there can be one class for renumbering Template and Model and separate for renumbering Fragment.

@lenarother
Copy link
Owner

Some comments on renumeration from Asia in #30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants