Added utility functions to initialize and hold a struct for passing around the RNA info to functions for increased maintainability #671
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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