rxome-generator 1.0.4-beta.3 → 1.0.4-beta.6
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/demos/encoding_test.json +58 -0
- package/lib/rxome-api.js +4 -3
- package/lib/rxome-generator.js +2 -2
- package/package.json +1 -1
- package/ratest.json +58 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "UEN167DJ04KK",
|
|
3
|
+
"subject": {
|
|
4
|
+
"dateOfBirth": "2026-02-18",
|
|
5
|
+
"sex": 0
|
|
6
|
+
},
|
|
7
|
+
"comment": "",
|
|
8
|
+
"compressedFeatures": {
|
|
9
|
+
"includes": [
|
|
10
|
+
"HP:0000111"
|
|
11
|
+
],
|
|
12
|
+
"excludes": []
|
|
13
|
+
},
|
|
14
|
+
"interpretations": [
|
|
15
|
+
{
|
|
16
|
+
"id": "first",
|
|
17
|
+
"progressStatus": 3,
|
|
18
|
+
"diagnosis": {
|
|
19
|
+
"disease": {
|
|
20
|
+
"id": "OMIM:"
|
|
21
|
+
},
|
|
22
|
+
"genomicInterpretations": [
|
|
23
|
+
{
|
|
24
|
+
"subjectOrBiosampleId": "xfx2ybyipvr.y3n0hogaybn",
|
|
25
|
+
"variantInterpretation": {
|
|
26
|
+
"acmgPathogenicityClassification": "999",
|
|
27
|
+
"variationDescriptor": {
|
|
28
|
+
"geneContext": {
|
|
29
|
+
"valueId": "",
|
|
30
|
+
"symbol": "",
|
|
31
|
+
"alternateIds": [
|
|
32
|
+
""
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"expressions": [],
|
|
36
|
+
"extensions": [
|
|
37
|
+
{
|
|
38
|
+
"name": "test-type",
|
|
39
|
+
"value": "Exome sequencing, long read"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"allelicState": {
|
|
43
|
+
"id": "None"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"metaData": {
|
|
53
|
+
"created": "2026-02-18",
|
|
54
|
+
"createdBy": "Tom",
|
|
55
|
+
"submittedBy": "tom@kamphans.de",
|
|
56
|
+
"pseudonym": "UEN167DJ04KK"
|
|
57
|
+
}
|
|
58
|
+
}
|
package/lib/rxome-api.js
CHANGED
|
@@ -8,7 +8,8 @@ export async function getFetch() {
|
|
|
8
8
|
if (typeof window !== 'undefined') {
|
|
9
9
|
return window.fetch;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
// webpackIgnore comment prevents webpack from bundling node-fetch
|
|
12
|
+
return (await import(/* webpackIgnore: true */ 'node-fetch')).default;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
const API = 'https://app.findme2care.de';
|
|
@@ -51,7 +52,7 @@ export { base64ToBuffer, bufferToBase64, unpack };
|
|
|
51
52
|
// Node.js specific functions that require fs module
|
|
52
53
|
readSigKey = async name => {
|
|
53
54
|
try {
|
|
54
|
-
const FS = await import('fs');
|
|
55
|
+
const FS = await import(/* webpackIgnore: true */ 'fs');
|
|
55
56
|
if (!FS.existsSync( name )) {
|
|
56
57
|
throw 'Key file not found!';
|
|
57
58
|
}
|
|
@@ -75,7 +76,7 @@ export const generateApiKeys = async () => {
|
|
|
75
76
|
|
|
76
77
|
export const writeApiKeys = async (name = 'rxome', dir = '.') => {
|
|
77
78
|
try {
|
|
78
|
-
const FS = await import('fs');
|
|
79
|
+
const FS = await import(/* webpackIgnore: true */ 'fs');
|
|
79
80
|
const key = await generateApiKeys();
|
|
80
81
|
await Promise.all([
|
|
81
82
|
FS.writeFile( `${dir}/${name}.private.apikey`, bufferToBase64( key.privateKey ), { mode: 0o600 }, err => { if (err) throw err; } ),
|
package/lib/rxome-generator.js
CHANGED
|
@@ -42,7 +42,7 @@ export { ENUM_ACMG };
|
|
|
42
42
|
|
|
43
43
|
export const generateRxomeKeyFiles = async (name = 'rxome', dir = '.') => {
|
|
44
44
|
try {
|
|
45
|
-
const FS = await import('fs/promises');
|
|
45
|
+
const FS = await import(/* webpackIgnore: true */ 'fs/promises');
|
|
46
46
|
const { privateKey, publicKey } = await generateRxomeKeys( name );
|
|
47
47
|
await Promise.all([
|
|
48
48
|
FS.writeFile(`${dir}/${name}.private.key`, privateKey, { mode: 0o600 }, err => { console.log(err); }),
|
|
@@ -155,7 +155,7 @@ export const sanitizeACMG = ( str ) => {
|
|
|
155
155
|
if ( str == 'RISK_ALLELE' ) {
|
|
156
156
|
return 999;
|
|
157
157
|
}
|
|
158
|
-
isNaN(+(str.toString()))
|
|
158
|
+
return isNaN(+(str.toString()))
|
|
159
159
|
? Math.max(0, ENUM_ACMG.indexOf(str.toUpperCase()))
|
|
160
160
|
: +str
|
|
161
161
|
}
|
package/package.json
CHANGED
package/ratest.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "UEN167DJ04KK",
|
|
3
|
+
"subject": {
|
|
4
|
+
"dateOfBirth": "2026-02-18",
|
|
5
|
+
"sex": 0
|
|
6
|
+
},
|
|
7
|
+
"comment": "",
|
|
8
|
+
"compressedFeatures": {
|
|
9
|
+
"includes": [
|
|
10
|
+
"HP:0000111"
|
|
11
|
+
],
|
|
12
|
+
"excludes": []
|
|
13
|
+
},
|
|
14
|
+
"interpretations": [
|
|
15
|
+
{
|
|
16
|
+
"id": "first",
|
|
17
|
+
"progressStatus": 3,
|
|
18
|
+
"diagnosis": {
|
|
19
|
+
"disease": {
|
|
20
|
+
"id": "OMIM:"
|
|
21
|
+
},
|
|
22
|
+
"genomicInterpretations": [
|
|
23
|
+
{
|
|
24
|
+
"subjectOrBiosampleId": "xfx2ybyipvr.y3n0hogaybn",
|
|
25
|
+
"variantInterpretation": {
|
|
26
|
+
"acmgPathogenicityClassification": "1",
|
|
27
|
+
"variationDescriptor": {
|
|
28
|
+
"geneContext": {
|
|
29
|
+
"valueId": "",
|
|
30
|
+
"symbol": "",
|
|
31
|
+
"alternateIds": [
|
|
32
|
+
""
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"expressions": [],
|
|
36
|
+
"extensions": [
|
|
37
|
+
{
|
|
38
|
+
"name": "test-type",
|
|
39
|
+
"value": "Exome sequencing, long read"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"allelicState": {
|
|
43
|
+
"id": "None"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"metaData": {
|
|
53
|
+
"created": "2026-02-18",
|
|
54
|
+
"createdBy": "Tom",
|
|
55
|
+
"submittedBy": "tom@kamphans.de",
|
|
56
|
+
"pseudonym": "UEN167DJ04KK"
|
|
57
|
+
}
|
|
58
|
+
}
|