Skip to content

Commit

Permalink
#3869 fix some comments issues
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlaStarla committed Feb 2, 2024
1 parent 00910a8 commit 1946733
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ test.describe('Snake Bond Tool', () => {
await bondTwoMonomers(page, peptide2, peptide3);
await bondTwoMonomers(page, peptide3, peptide4);

// await takeEditorScreenshot(page);
await takeEditorScreenshot(page);
});

test('Check snake mode arrange for peptides chain', async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ export class DrawingEntitiesManager {
);
({ lastPosition, maxVerticalDistance } = nextMonomerResult);

this.getRnaBaseSideChainMonomers(
this.setRnaBaseSideChainMonomers(
nucleotide.rnaBase,
rearrangedMonomersSet,
monomersWithSideChain,
Expand Down Expand Up @@ -1027,7 +1027,7 @@ export class DrawingEntitiesManager {
return { command, lastPosition, maxVerticalDistance };
}

private getRnaBaseSideChainMonomers(
private setRnaBaseSideChainMonomers(
rnaBase: RNABase,
rearrangedMonomersSet: Set<number>,
monomersWithSideChain: Array<BaseMonomer>,
Expand Down Expand Up @@ -1311,12 +1311,11 @@ export class DrawingEntitiesManager {
firstMonomers = [firstMonomerInR2R1Chain];
} else {
const oldMonomerPosition = monomerWithSideChain.position;
const newMonomerPosition = getFirstPosition(90, lastPosition);
const operation = new MonomerMoveOperation(
this.rearrangeChainModelChange.bind(
this,
monomerWithSideChain,
Coordinates.canvasToModel(newMonomerPosition),
Coordinates.canvasToModel(lastPosition),
),
this.rearrangeChainModelChange.bind(
this,
Expand All @@ -1326,7 +1325,10 @@ export class DrawingEntitiesManager {
);
rearrangedMonomersSet.add(monomerWithSideChain.id);
command.addOperation(operation);
lastPosition = getFirstPosition(90, newMonomerPosition);
const height =
(monomerWithSideChain.renderer?.monomerSize.height ?? 0) +
VERTICAL_DISTANCE_FROM_MONOMER;
lastPosition = getFirstPosition(height, lastPosition);
}

const rearrangeResult = this.reArrangeMonomers(
Expand All @@ -1344,18 +1346,6 @@ export class DrawingEntitiesManager {
return { command, lastPosition };
}

public getPhosphateFromRnaBase(baseMonomer: RNABase) {
const r1PolymerBond = baseMonomer.attachmentPointsToBonds.R1;
const sugarMonomer = r1PolymerBond?.getAnotherMonomer(baseMonomer);
if (sugarMonomer && sugarMonomer instanceof Sugar) {
const phosphate = getNextMonomerInChain(sugarMonomer);
if (phosphate && phosphate instanceof Phosphate) {
return phosphate;
}
}
return undefined;
}

public setMicromoleculesHiddenEntities(struct: Struct) {
struct.mergeInto(this.micromoleculesHiddenEntities);
this.micromoleculesHiddenEntities.atoms = new Pool();
Expand Down

0 comments on commit 1946733

Please sign in to comment.