@datagrok/sequence-translator 1.2.0 → 1.2.1

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@datagrok/sequence-translator",
3
3
  "friendlyName": "Sequence Translator",
4
- "version": "1.2.0",
4
+ "version": "1.2.1",
5
5
  "author": {
6
6
  "name": "Alexey Choposky",
7
7
  "email": "achopovsky@datagrok.ai"
@@ -6,7 +6,7 @@ import * as DG from 'datagrok-api/dg';
6
6
  import {ExternalPluginUI} from '../view/app-ui';
7
7
  import {ColoredTextInput} from '../view/utils/colored-input/colored-text-input';
8
8
  import {highlightInvalidSubsequence} from '../view/utils/colored-input/input-painters';
9
- import {codesToHelmDictionary} from '../model/data-loading-utils/json-loader';
9
+ import {codesToSymbolsDictionary} from '../model/data-loading-utils/json-loader';
10
10
  import {MERMADE} from './const';
11
11
 
12
12
  export async function getExternalAppViewFactories(): Promise<{[name: string]: () => DG.View} | undefined> {
@@ -43,6 +43,6 @@ function getMerMadeParameters(): {[name: string]: any} {
43
43
 
44
44
  return {
45
45
  coloredInput: input,
46
- codes: codesToHelmDictionary
46
+ codes: codesToSymbolsDictionary
47
47
  }
48
48
  }
@@ -5,7 +5,6 @@ import * as DG from 'datagrok-api/dg';
5
5
 
6
6
  import {before, category, expect, test} from '@datagrok-libraries/utils/src/test';
7
7
  import {DEFAULT_FORMATS} from '../model/const';
8
- import {FormatConverter} from '../model/format-translation/format-converter';
9
8
  import {getJsonData} from '../model/data-loading-utils/json-loader';
10
9
  import {formatsToHelm} from './const';
11
10
  import {SequenceValidator} from '../model/parsing-validation/sequence-validator';
@@ -34,7 +33,7 @@ category('Formats support', () => {
34
33
  const result = Object.keys(output).length;
35
34
  // +1 due to nucleotides
36
35
  const expected = Object.keys(formatsToHelm).length + 1;
37
- expect(result, expected);
36
+ expect(true, expected <= result);
38
37
  });
39
38
  });
40
39
  });
@@ -4,8 +4,6 @@ import * as ui from 'datagrok-api/ui';
4
4
  import * as DG from 'datagrok-api/dg';
5
5
 
6
6
  import {before, category, expect, test} from '@datagrok-libraries/utils/src/test';
7
- import {DEFAULT_FORMATS} from '../model/const';
8
- import {FormatConverter} from '../model/format-translation/format-converter';
9
7
  import {getNucleotidesSequence} from '../model/format-translation/conversion-utils';
10
8
  import {getJsonData} from '../model/data-loading-utils/json-loader';
11
9
  import {helmToNucleotides} from './const';
@@ -9,7 +9,6 @@ import $ from 'cash-dom';
9
9
 
10
10
  import {errorToConsole} from '@datagrok-libraries/utils/src/to-console';
11
11
 
12
- // import {drawMolecule} from '../../utils/structures-works/draw-molecule';
13
12
  import {highlightInvalidSubsequence} from '../utils/colored-input/input-painters';
14
13
  import {getLinkedMolfile, saveSdf} from '../../model/sequence-to-structure-utils/sdf-tab';
15
14
  import {ColoredTextInput} from '../utils/colored-input/colored-text-input';
@@ -176,7 +175,8 @@ export class StructureLayoutHandler {
176
175
  let molfile = '';
177
176
  try {
178
177
  const strandData = this.getStrandData();
179
- molfile = this.getMolfile(strandData.ss, strandData.as, strandData.as2);
178
+ if (Object.values(strandData).some((data) => data.strand !== ''))
179
+ molfile = this.getMolfile(strandData.ss, strandData.as, strandData.as2);
180
180
  } catch (err) {
181
181
  const errStr = errorToConsole(err);
182
182
  console.error(errStr);
@@ -21,6 +21,11 @@ export class MoleculeImage {
21
21
  get molblock(): string { return this._validMolBlock; }
22
22
 
23
23
  set molblock(value: string) {
24
+ if (value === '') {
25
+ this._validMolBlock = value;
26
+ return;
27
+ }
28
+
24
29
  try {
25
30
  this.validateMolBlock(value);
26
31
  } catch (error) {