@datagrok/sequence-translator 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -131,17 +131,20 @@ export function defineAxolabsPattern() {
|
|
|
131
131
|
asBases[i] = ui.choiceInput('', asBases[i].value, baseChoices, (v: string) => {
|
|
132
132
|
if (!enumerateModifications.includes(v)) {
|
|
133
133
|
enumerateModifications.push(v);
|
|
134
|
-
isEnumerateModificationsDiv.append(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
enumerateModifications.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
134
|
+
isEnumerateModificationsDiv.append(
|
|
135
|
+
ui.divText('', {style: {width: '25px'}}),
|
|
136
|
+
ui.boolInput(v, true, (boolV: boolean) => {
|
|
137
|
+
if (boolV) {
|
|
138
|
+
if (!enumerateModifications.includes(v))
|
|
139
|
+
enumerateModifications.push(v);
|
|
140
|
+
} else {
|
|
141
|
+
const index = enumerateModifications.indexOf(v, 0);
|
|
142
|
+
if (index > -1)
|
|
143
|
+
enumerateModifications.splice(index, 1);
|
|
144
|
+
}
|
|
145
|
+
updateSvgScheme();
|
|
146
|
+
}).root,
|
|
147
|
+
);
|
|
145
148
|
}
|
|
146
149
|
updateAsModification();
|
|
147
150
|
updateSvgScheme();
|
|
@@ -174,17 +177,20 @@ export function defineAxolabsPattern() {
|
|
|
174
177
|
ssBases[i] = ui.choiceInput('', ssBases[i].value, baseChoices, (v: string) => {
|
|
175
178
|
if (!enumerateModifications.includes(v)) {
|
|
176
179
|
enumerateModifications.push(v);
|
|
177
|
-
isEnumerateModificationsDiv.append(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
enumerateModifications.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
180
|
+
isEnumerateModificationsDiv.append(
|
|
181
|
+
ui.divText('', {style: {width: '25px'}}),
|
|
182
|
+
ui.boolInput(v, true, (boolV: boolean) => {
|
|
183
|
+
if (boolV) {
|
|
184
|
+
if (!enumerateModifications.includes(v))
|
|
185
|
+
enumerateModifications.push(v);
|
|
186
|
+
} else {
|
|
187
|
+
const index = enumerateModifications.indexOf(v, 0);
|
|
188
|
+
if (index > -1)
|
|
189
|
+
enumerateModifications.splice(index, 1);
|
|
190
|
+
}
|
|
191
|
+
updateSvgScheme();
|
|
192
|
+
}).root,
|
|
193
|
+
);
|
|
188
194
|
}
|
|
189
195
|
updateSsModification();
|
|
190
196
|
updateSvgScheme();
|
|
@@ -499,18 +505,20 @@ export function defineAxolabsPattern() {
|
|
|
499
505
|
const loadPatternDiv = ui.div([]);
|
|
500
506
|
const asModificationDiv = ui.div([]);
|
|
501
507
|
const firstAsPtoDiv = ui.div([]);
|
|
502
|
-
const isEnumerateModificationsDiv = ui.divH([
|
|
503
|
-
|
|
504
|
-
if (
|
|
505
|
-
enumerateModifications.
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
508
|
+
const isEnumerateModificationsDiv = ui.divH([
|
|
509
|
+
ui.boolInput(defaultBase, true, (v: boolean) => {
|
|
510
|
+
if (v) {
|
|
511
|
+
if (!enumerateModifications.includes(defaultBase))
|
|
512
|
+
enumerateModifications.push(defaultBase);
|
|
513
|
+
} else {
|
|
514
|
+
const index = enumerateModifications.indexOf(defaultBase, 0);
|
|
515
|
+
if (index > -1)
|
|
516
|
+
enumerateModifications.splice(index, 1);
|
|
517
|
+
}
|
|
518
|
+
updateSvgScheme();
|
|
519
|
+
updateOutputExamples();
|
|
520
|
+
}).root,
|
|
521
|
+
]);
|
|
514
522
|
|
|
515
523
|
let ssBases = Array(defaultSequenceLength).fill(ui.choiceInput('', defaultBase, baseChoices));
|
|
516
524
|
let asBases = Array(defaultSequenceLength).fill(ui.choiceInput('', defaultBase, baseChoices));
|
package/src/axolabs/draw-svg.ts
CHANGED
|
@@ -35,14 +35,8 @@ function getTextWidth(text: string, font: number): number {
|
|
|
35
35
|
return 2 * context.measureText(text).width;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
function getTextInsideCircle(
|
|
39
|
-
bases
|
|
40
|
-
numberOfNucleotides: number, enumerateModifications: string[]): string {
|
|
41
|
-
return ((bases[index].slice(-3) == '(o)') || !enumerateModifications.includes(bases[index])) ?
|
|
42
|
-
'' :
|
|
43
|
-
(['A', 'G', 'C', 'U', 'T'].includes(bases[index])) ?
|
|
44
|
-
bases[index] :
|
|
45
|
-
'';//String(numberOfNucleotides - nucleotideCounter);
|
|
38
|
+
function getTextInsideCircle(bases: string[], index: number): string {
|
|
39
|
+
return (bases[index].slice(-3) == '(o)' || !['A', 'G', 'C', 'U', 'T'].includes(bases[index])) ? '' : bases[index];
|
|
46
40
|
}
|
|
47
41
|
|
|
48
42
|
function getFontColorVisibleOnBackground(rgbString: string): string {
|
|
@@ -160,14 +154,15 @@ export function drawAxolabsPattern(
|
|
|
160
154
|
Math.max(xOfSsRightModifications, xOfAsRightModifications) +
|
|
161
155
|
widthOfLeftModification + baseDiameter * (Math.max(ssRightOverhangs, asRightOverhangs));
|
|
162
156
|
const yOfTitle = baseRadius;
|
|
163
|
-
const
|
|
157
|
+
const yOfSsNumbers = 2 * baseRadius;
|
|
158
|
+
const yOfAsNumbers = 8.5 * baseRadius;
|
|
164
159
|
const yOfSsTexts = 4 * baseRadius;
|
|
165
160
|
const yOfAsTexts = 7 * baseRadius;
|
|
166
161
|
const yOfComment = asExists ? 11 * baseRadius : 8.5 * baseRadius;
|
|
167
162
|
const yOfSsCircles = 3.5 * baseRadius;
|
|
168
163
|
const yOfAsCircles = 6.5 * baseRadius;
|
|
169
|
-
const yOfCirclesInLegends = asExists ? 9 * baseRadius : 6 * baseRadius;
|
|
170
|
-
const yOfTextLegend = asExists ?
|
|
164
|
+
const yOfCirclesInLegends = asExists ? 9.5 * baseRadius : 6 * baseRadius;
|
|
165
|
+
const yOfTextLegend = asExists ? 10 * baseRadius - 3 : yOfAsCircles - 3;
|
|
171
166
|
|
|
172
167
|
const image = svg.render(width, height);
|
|
173
168
|
|
|
@@ -196,11 +191,13 @@ export function drawAxolabsPattern(
|
|
|
196
191
|
getShiftToAlignNumberInsideCircle(ssBases, ssBases.length - i, numberOfSsNucleotides - nucleotideCounter);
|
|
197
192
|
if (ssBases[i].slice(-3) != '(o)')
|
|
198
193
|
nucleotideCounter--;
|
|
194
|
+
const n = (ssBases[i].slice(-3) != '(o)' && enumerateModifications.includes(ssBases[i])) ?
|
|
195
|
+
String(numberOfSsNucleotides - nucleotideCounter) : '';
|
|
199
196
|
image.append(
|
|
200
|
-
svg.text(
|
|
197
|
+
svg.text(n, xOfNumbers, yOfSsNumbers, legendFontSize, fontColor),
|
|
201
198
|
svg.circle(getXOfBaseCircles(i, ssRightOverhangs), yOfSsCircles, baseRadius, getBaseColor(ssBases[i])),
|
|
202
|
-
svg.text(getTextInsideCircle(ssBases, i,
|
|
203
|
-
|
|
199
|
+
svg.text(getTextInsideCircle(ssBases, i), xOfNumbers, yOfSsTexts, baseFontSize,
|
|
200
|
+
getFontColorVisibleOnBackground(getBaseColor(ssBases[i]))),
|
|
204
201
|
ssPtoStatuses[i] ?
|
|
205
202
|
svg.star(getXOfBaseCircles(i, ssRightOverhangs) + baseRadius, yOfSsTexts + psLinkageRadius, psLinkageColor) :
|
|
206
203
|
'',
|
|
@@ -222,13 +219,16 @@ export function drawAxolabsPattern(
|
|
|
222
219
|
for (let i = asBases.length - 1; i > -1; i--) {
|
|
223
220
|
if (asBases[i].slice(-3) != '(o)')
|
|
224
221
|
nucleotideCounter--;
|
|
222
|
+
const xOfNumbers = getXOfBaseCircles(i, asRightOverhangs) +
|
|
223
|
+
getShiftToAlignNumberInsideCircle(asBases, i, nucleotideCounter + 1);
|
|
224
|
+
const n = (asBases[i].slice(-3) != '(o)' && enumerateModifications.includes(asBases[i])) ?
|
|
225
|
+
String(nucleotideCounter + 1) : '';
|
|
225
226
|
image.append(
|
|
227
|
+
svg.text(n, xOfNumbers, yOfAsNumbers, legendFontSize, fontColor),
|
|
226
228
|
svg.circle(getXOfBaseCircles(i, asRightOverhangs), yOfAsCircles, baseRadius, getBaseColor(asBases[i])),
|
|
227
|
-
svg.text(getTextInsideCircle(
|
|
228
|
-
asBases, i,
|
|
229
|
-
|
|
230
|
-
getShiftToAlignNumberInsideCircle(asBases, i, nucleotideCounter + 1),
|
|
231
|
-
yOfAsTexts, baseFontSize, getFontColorVisibleOnBackground(axolabsMap[asBases[i]]['color'])),
|
|
229
|
+
svg.text(getTextInsideCircle(asBases, i),
|
|
230
|
+
getXOfBaseCircles(i, asRightOverhangs) + getShiftToAlignNumberInsideCircle(asBases, i, nucleotideCounter + 1),
|
|
231
|
+
yOfAsTexts, baseFontSize, getFontColorVisibleOnBackground(getBaseColor(asBases[i]))),
|
|
232
232
|
asPtoStatuses[i] ? svg.star(getXOfBaseCircles(i, asRightOverhangs) +
|
|
233
233
|
baseRadius, yOfAsTexts + psLinkageRadius, psLinkageColor) : '',
|
|
234
234
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<html><head><meta charset="utf-8"/><title>SequenceTranslator Test Report. Datagrok version datagrok/datagrok:latest SHA=
|
|
1
|
+
<html><head><meta charset="utf-8"/><title>SequenceTranslator Test Report. Datagrok version datagrok/datagrok:latest SHA=49ff04f38f57. Commit 128d0678.</title><style type="text/css">html,
|
|
2
2
|
body {
|
|
3
3
|
font-family: Arial, Helvetica, sans-serif;
|
|
4
4
|
font-size: 1rem;
|
|
@@ -229,7 +229,7 @@ header {
|
|
|
229
229
|
font-size: 1rem;
|
|
230
230
|
padding: 0 0.5rem;
|
|
231
231
|
}
|
|
232
|
-
</style></head><body><div id="jesthtml-content"><header><h1 id="title">SequenceTranslator Test Report. Datagrok version datagrok/datagrok:latest SHA=
|
|
232
|
+
</style></head><body><div id="jesthtml-content"><header><h1 id="title">SequenceTranslator Test Report. Datagrok version datagrok/datagrok:latest SHA=49ff04f38f57. Commit 128d0678.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-10-24 16:17:41</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (1)</div><div class="summary-passed">1 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div><div id="test-summary"><div class="summary-total">Tests (1)</div><div class="summary-passed">1 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></div><div id="suite-1" class="suite-container"><div class="suite-info"><div class="suite-path">/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts</div><div class="suite-time warn">15.882s</div></div><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename"> </div><div class="test-title">TEST</div><div class="test-status">passed</div><div class="test-duration">1.582s</div></div></div></div><div class="suite-consolelog"><div class="suite-consolelog-header">Console Log</div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at Object.<anonymous> (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/test-node.ts:62:11)
|
|
233
233
|
at Generator.next (<anonymous>)
|
|
234
234
|
at fulfilled (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/test-node.ts:28:58)
|
|
235
235
|
at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Using web root: http://localhost:8080</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:40:11
|
|
@@ -244,13 +244,13 @@ header {
|
|
|
244
244
|
at fulfilled (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:28:58)
|
|
245
245
|
at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Test result : Success : 1 : SequenceTranslator.sequence-translator.usCfCfUfGfAf : OK
|
|
246
246
|
Test result : Success : 0 : SequenceTranslator.sequence-translator.usAfsusgsgsg : OK
|
|
247
|
-
Test result : Success :
|
|
247
|
+
Test result : Success : 1 : SequenceTranslator.sequence-translator.UfUfUfsCfsuacg : OK
|
|
248
248
|
Test result : Success : 0 : SequenceTranslator.sequence-translator.susususauasu : OK
|
|
249
249
|
Test result : Success : 0 : SequenceTranslator.sequence-translator.CfGfCfsGfsCf : OK
|
|
250
250
|
Test result : Success : 1 : SequenceTranslator.sequence-translator.acacacsacsac : OK
|
|
251
251
|
Test result : Success : 0 : SequenceTranslator.sequence-translator.cccgggusug : OK
|
|
252
|
-
Test result : Success :
|
|
253
|
-
Test result : Success :
|
|
254
|
-
Test result : Success :
|
|
255
|
-
Test result : Success :
|
|
252
|
+
Test result : Success : 1 : SequenceTranslator.sequence-translator.UfAfCfGfGfCfAfUf : OK
|
|
253
|
+
Test result : Success : 0 : SequenceTranslator.sequence-translator.(invabasic)cuCfuUfsc : OK
|
|
254
|
+
Test result : Success : 1 : SequenceTranslator.sequence-translator.(invabasic)usAfsucuCfuUfAfgcugUfgCfacususu : OK
|
|
255
|
+
Test result : Success : 0 : SequenceTranslator.sequence-translator.(invabasic)asacgGfuGfCfAfacucuauuca : OK
|
|
256
256
|
</pre></div></div></div></div></body></html>
|