Skip to content

Commit

Permalink
Fix FoldingContextAPI by using _isPseudoknot
Browse files Browse the repository at this point in the history
  • Loading branch information
guyguy2001 committed Jun 9, 2024
1 parent 55a7724 commit 7a2bdf8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/eterna/mode/PoseEdit/ScriptsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ export default class FoldingContextAPI {
return null;
}
const seqArr: Sequence = Sequence.fromSequenceString(seq);
const pseudoknots = this._targetConditions && this._targetConditions[0]
&& this._targetConditions[0]['type'] === 'pseudoknot';
const folded: SecStruct | null = this._folder.foldSequence(seqArr, null, constraint, pseudoknots);
const folded: SecStruct | null = this._folder.foldSequence(seqArr, null, constraint, this._isPseudoknot);
Assert.assertIsDefined(folded);
return folded.getParenthesis(null, pseudoknots);
return folded.getParenthesis(null, this._isPseudoknot);
});

this._scriptInterface.addCallback('fold_with_binding_site',
Expand All @@ -64,9 +62,7 @@ export default class FoldingContextAPI {
}
const seqArr: Sequence = Sequence.fromSequenceString(seq);
const structArr: SecStruct = SecStruct.fromParens(secstruct);
const freeEnergy = (this._targetConditions && this._targetConditions[0]
&& this._targetConditions[0]['type'] === 'pseudoknot')
? this._folder.scoreStructures(seqArr, structArr, true)
const freeEnergy = this._isPseudoknot ? this._folder.scoreStructures(seqArr, structArr, true)
: this._folder.scoreStructures(seqArr, structArr);
return 0.01 * freeEnergy;
});
Expand Down

0 comments on commit 7a2bdf8

Please sign in to comment.