@opencloning/utils 1.5.2 → 1.5.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @opencloning/utils
2
2
 
3
+ ## 1.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#655](https://github.com/manulera/OpenCloning_frontend/pull/655) [`b34e83f`](https://github.com/manulera/OpenCloning_frontend/commit/b34e83f0b8813de7744d3d71ad779be0df2f75cf) Thanks [@manulera](https://github.com/manulera)! - Changes to Assembler naming:
8
+
9
+ - Handle slashes in downloaded file names (were being turned into subfolders)
10
+ - Allow users to change names of outputs in assembler
11
+
12
+ - Updated dependencies []:
13
+ - @opencloning/store@1.5.3
14
+
3
15
  ## 1.5.2
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencloning/utils",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "type": "module",
5
5
  "main": "./src/utils/index.js",
6
6
  "exports": {
@@ -28,7 +28,7 @@
28
28
  "directory": "packages/utils"
29
29
  },
30
30
  "dependencies": {
31
- "@opencloning/store": "1.5.2",
31
+ "@opencloning/store": "1.5.3",
32
32
  "@teselagen/bio-parsers": "^0.4.34",
33
33
  "@teselagen/sequence-utils": "^0.3.42",
34
34
  "@zip.js/zip.js": "^2.7.62",
@@ -240,3 +240,10 @@ export function ebicTemplateAnnotation(templateSequence, roi, {max_inside, max_o
240
240
 
241
241
  return tidyUpSequenceData(annotatedSequence);
242
242
  }
243
+
244
+ export function editGenbankSequenceNameFromTextContent(genbankContent, newName) {
245
+ const lines = genbankContent.split('\n');
246
+ const locusLine = lines[0].replace(/(?<=^LOCUS\s+)[^\s]+/, newName.replaceAll('/', '_').replaceAll(' ', '_'));
247
+ lines[0] = locusLine;
248
+ return lines.join('\n');
249
+ }
@@ -1,4 +1,4 @@
1
- import { syncChromatogramDataWithAlignment } from './sequenceManipulation';
1
+ import { editGenbankSequenceNameFromTextContent, syncChromatogramDataWithAlignment } from './sequenceManipulation';
2
2
  import teselaJson from '../../../../cypress/test_files/example_chromatogram.json';
3
3
  import { getReverseComplementSequenceString } from '@teselagen/sequence-utils';
4
4
 
@@ -36,3 +36,23 @@ describe('syncChromatogramDataWithAlignment', () => {
36
36
  });
37
37
 
38
38
  });
39
+
40
+
41
+ const exampleGenbankContent = `LOCUS name 6317 bp DNA circular SYN 03-MAR-2026
42
+ DEFINITION description.
43
+ ACCESSION id
44
+ VERSION id
45
+ KEYWORDS .
46
+ SOURCE .
47
+ ORGANISM .
48
+ .
49
+ FEATURES Location/Qualifiers
50
+ ORIGIN
51
+ 1 attcaaaaat atgcaaaaaa cag
52
+ //`;
53
+ describe('editGenbankSequenceNameFromTextContent', () => {
54
+ it('replaces the sequence name', () => {
55
+ const result = editGenbankSequenceNameFromTextContent(exampleGenbankContent, 'hello/world bye');
56
+ expect(result).to.equal(exampleGenbankContent.replaceAll('name', 'hello_world_bye'));
57
+ });
58
+ });