@@ -6,7 +6,17 @@ import Sequence from 'eterna/rnatypes/Sequence';
66import { ExternalInterfaceCtx } from 'eterna/util/ExternalInterface' ;
77import { Assert } from 'flashbang' ;
88
9- export default class FoldingContextAPI {
9+ /**
10+ * An EternaScript API exposing all functions that handle folding an arbitrary
11+ * RNA sequence, and aren't dependent on what's the RNA in the puzzle.
12+ *
13+ * It adds itself to an existing script API (`ExternalInterfaceCtx`) from
14+ * `this.registerToScriptInterface`.
15+ *
16+ * Note: The API in this class is still affected by the selected folder
17+ * and the pseudoknot mode of the puzzle - just not the sequence.
18+ */
19+ export default class FoldingAPI {
1020 private readonly _getFolder : ( ) => Folder | null ;
1121 private readonly _getIsPseudoknot : ( ) => boolean ;
1222
@@ -34,7 +44,9 @@ export default class FoldingContextAPI {
3444 return null ;
3545 }
3646 const seqArr : Sequence = Sequence . fromSequenceString ( seq ) ;
37- const folded : SecStruct | null = this . _folder . foldSequence ( seqArr , null , constraint , this . _isPseudoknot ) ;
47+ const folded : SecStruct | null = this . _folder . foldSequence (
48+ seqArr , null , constraint , this . _isPseudoknot
49+ ) ;
3850 Assert . assertIsDefined ( folded ) ;
3951 return folded . getParenthesis ( null , this . _isPseudoknot ) ;
4052 } ) ;
0 commit comments