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

Added utility functions to initialize and hold a struct for passing around the RNA info to functions for increased maintainability #671

Draft
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

LunarFawn
Copy link
Contributor

There are currently a lot of calls that must be made for every function we have to manipulate the strings coming from TS to C++ or to hold data structures. These clog up the readability of the codebase and make maintainability hard and adding new functions difficult. I created a stuct called SequenceStructureInfo in the Utils class for this. I made 3 functions called setSequenceInfo, setStructureInfo, and setGlobals to initialize values in the struct when appropriate in functions.

setSequenceInfo takes the RNA sequence string as a input by value and then created teh char array that is passed to the folding calls as well as generating the numerical RNA sequence array and recording the sequence length. the function is passed the SequenceStructureInfo struct by reference to make recording quick.

setStructureInfo take the secondary structure string as a input by value and SequenceStructureInfo struct by reference. This function records teh struct string, gets the char array for the structure as well as getting the pairs lists.

setGlobals takes a bool for setting the useMFE and OnlyOneMFE globals as well as the pknot and temp as inputs. It also is passed the SequenceStructureInfo struct by reference. This function sets teh complexity, sets a isPknot bool, as well as records teh folding temp.

The SequenceStructureInfo is called with the dnastucts variable for the ensemble already enumerated and when you are working on a specific single dna stuct from the dnaStructures struct then you assign it to teh oneDnaStruct currentStruct

…ouwn function call. Fixed a bug that was addressing things wring in this as well. signifiant speed increase
…ouwn function call. Fixed a bug that was addressing things wring in this as well. signifiant speed increase
…nted in Eternascript. Subopt now only takes 16-18sec in general
…ut a rna strand for use when passing values to functions. This is to make code maintenance cleaner
…ut a rna strand for use when passing values to functions. This is to make code maintenance cleaner
…ow everything about the RNA is contained in that struct
@luxaritas
Copy link
Member

While the simplifications here are good, but I'm concerned that there's a lot of leaky abstractions here - it feels like there's a lot of mixing concerns, side-effects, and implicit assumptions in usage.

We discussed this in more detail via DM - marking as a draft for now

@luxaritas luxaritas marked this pull request as draft October 24, 2022 14:50
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.

None yet

2 participants