gps-global-types 1.0.11 → 1.0.13

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.
@@ -0,0 +1,12 @@
1
+ export const ClusterFields = {
2
+ '_id': ObjectId,
3
+ 'threshold': Number,
4
+ 'scheme': String,
5
+ 'clusterNickName': String,
6
+ 'isActive': Boolean,
7
+ 'dateCreated': Date,
8
+ 'lastModified': Date,
9
+ 'minimumPatientCount': Number,
10
+ // 'isolates': [clusterIsoSchema], //array of ClusterIsolates
11
+ 'distances': Map,
12
+ }
package/index.tsx CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './global.types.js'
2
2
  export * from './link.types.js'
3
3
  export * from './mst.types.js'
4
- export * from './pie.types.js'
4
+ export * from './pie.types.js'
5
+ export * from './isolate.types.js'
@@ -0,0 +1,134 @@
1
+ export const KlebFields = {
2
+ 'Yersiniabactin': String,
3
+ 'Colibactin': String,
4
+ 'Aerobactin': String,
5
+ 'Salmochelin': String,
6
+ 'RmpADC': String,
7
+ 'rmpA2': String,
8
+ 'K_locus': String,
9
+ 'O_locus': String,
10
+ 'O_type': String,
11
+ "SHV_mutations": String,
12
+ "Omp_mutations": String,
13
+ "Col_mutations": String,
14
+ "Flq_mutations": String,
15
+
16
+ }
17
+
18
+
19
+ export const IsolateFields = {
20
+ "_id":String,
21
+ "mrsnId": String,
22
+ "qcCallFinal": String,
23
+ "rawOrganismId": String,
24
+ "genus": String,
25
+ "species": String,
26
+ "wgsId": String,
27
+ "topHits": String,
28
+ "wgsIdMethod": String,
29
+ "dbBuild": String,
30
+ "isContaminated": Boolean,
31
+ "projects": Array,
32
+ "libraryPlate": String,
33
+ "sequencingRun": String,
34
+ "numberOfContigsRaw": Number,
35
+ "numberOfContigsFilteredForLength": Number,
36
+ "totalLengthOfContigsFilteredForLength": Number,
37
+ "numberOfContigsFilteredForLowCoverage": Number,
38
+ "totalLengthOfContigsFilteredForLowCoverage": String,
39
+ "numberOfGoodContigs": Number,
40
+ "averageReadDepthOfGoodContigs": Number,
41
+ "totalLengthOfGoodContigs": Number,
42
+ "medianInsertSize": String,
43
+ "assembler": String,
44
+ "qcCallAssembly": String,
45
+ "scheme": String,
46
+ "mlst": String,
47
+ "gene1": String,
48
+ "gene2": String,
49
+ "gene3": String,
50
+ "gene4": String,
51
+ "gene5": String,
52
+ "gene6": String,
53
+ "gene7": String,
54
+ "gene8": String,
55
+ "qcCallMlst": String,
56
+ "uploadProcessed": String,
57
+ "uploadUser": String,
58
+ "sequencingRunDate": Date,
59
+ "qcCallId": String,
60
+ "manuallyEnteredWgsId": Boolean,
61
+ "accessionNumber": String,
62
+ "deprecatedSequencedIsolatesCollectionId": String,
63
+ "amr": Array,
64
+ "armordAccessionNumber": String,
65
+ "armordBed": String,
66
+ "armordCultureDate": Date,
67
+ "armordCultureSite": String,
68
+ "armordFacility": String,
69
+ "armordFacilityCode": String,
70
+ "armordFile": String,
71
+ "armordIsolateNumber": String,
72
+ "armordIsolateType": String,
73
+ "armordMrsnId": String,
74
+ "armordPatientId": String,
75
+ "armordRawOrganismId": String,
76
+ "armordUnit": String,
77
+ "submittedOrganismId": String,
78
+ "isManuallyEntered": Boolean,
79
+ "sampleType": String,
80
+ "qcPoc": String,
81
+ "qcReviewer": String,
82
+ "facilityCode": String,
83
+ "facilityName": String,
84
+ "collectionDate": String,
85
+ "index1": String,
86
+ "index2": String,
87
+ "r1FileNameRaw": String,
88
+ "r1FileNameRenamed": String,
89
+ "r1ReadCount": Number,
90
+ "r1ReadsWithWarningsCount": Number,
91
+ "r2FileNameRaw": String,
92
+ "r2FileNameRenamed": String,
93
+ "r2ReadCount": Number,
94
+ "r2ReadsWithWarningsCount": Number,
95
+ "qcCallFastQc": String,
96
+ "inputReads": Number,
97
+ "inputBases": Number,
98
+ "qtrimmedReadsCount": Number,
99
+ "qtrimmedReadsPercent": Number,
100
+ "qtrimmedBasesCount": Number,
101
+ "qtrimmedBasesPercent": Number,
102
+ "ktrimmedReadsCount": Number,
103
+ "ktrimmedReadsPercent": Number,
104
+ "ktrimmedBasesCount": Number,
105
+ "ktrimmedBasesPercent": Number,
106
+ "totalRemovedReadsCount": Number,
107
+ "totalRemovedReadsPercent": Number,
108
+ "totalRemovedBasesCount": Number,
109
+ "totalRemovedBasesPercent": Number,
110
+ "resultReadsCount": Number,
111
+ "resultReadsPercent": Number,
112
+ "resultBasesCount": Number,
113
+ "resultBasesPercent": Number,
114
+ "qcCallTrim": String,
115
+ "assemblyFile": String,
116
+ "assemblerVersion": String,
117
+ "assemblerStatus": Boolean,
118
+ "schemeSelection": String,
119
+ "source": String,
120
+ "mlstUtility": String,
121
+ "mlstUtilityVersion": String,
122
+ "mlstDatabaseVersion": Date,
123
+ "isRepresentative": Boolean,
124
+ "username": String,
125
+ "uploadDate": Date,
126
+ // $addFields with the intent of unpacking objects (amr + projects)
127
+ "tier": Number,
128
+ "allele": String,
129
+ "alleles": Array,
130
+ "projectCode": Array,
131
+ "mrsnSuperFamily": String,
132
+ "expectedPhenotype": String,
133
+ // "kleborate": [KlebSchema]
134
+ }
package/mst.types.tsx CHANGED
@@ -1,4 +1,6 @@
1
+ import type { ClusterFields } from "./cluster.types.js";
1
2
  import type { armordAccessionNumber, Color, mrsnId, ObjectId, RegexMatchedString } from "./global.types.js";
3
+ import type { IsolateFields } from "./isolate.types.js";
2
4
  import type { EdgeType } from "./link.types.js";
3
5
  import type { NodeType } from "./pie.types.js";
4
6
 
@@ -40,7 +42,7 @@ export interface LatestNodes { armordCultureDate: Date | string, isos: any[], _i
40
42
  export interface MSTGraph {
41
43
  name?:string,
42
44
  snapshotData?:SnapshotType
43
- nodes: NodeType[] // core parameter of d3tree.js . keeps all isolates collection data
45
+ nodes: any //todo:temp//NodeType[] // core parameter of d3tree.js . keeps all isolates collection data
44
46
  links: EdgeType[] // core parameter of d3tree.js
45
47
  latest: LatestNodes // earliest node for easy toggling
46
48
  custom: CustomDict // . I KNOW THIS IS DUMB but from user's pov it results in seamless color transitions across pages
@@ -95,7 +97,7 @@ export interface LegendBullet { //or custom upload data
95
97
  label: string
96
98
  }
97
99
 
98
- export type MSTLegend = Record<colorKey&'beforeAndAfter'&'custom color', LegendBullet[]> & Record<dateKey, 'date'>;
100
+ export type MSTLegend = Partial<Record<colorKey|'beforeAndAfter'|'custom color', LegendBullet[]>> & Partial<Record<dateKey, 'date'>>;
99
101
  // & { 'beforeAndAfter': [{ color: '#666666', label: 'Before ' }, { color: '#4a64aa', label: 'After ' }] }
100
102
 
101
103
 
@@ -150,3 +152,14 @@ export interface SnapshotType {
150
152
  // module.exports = { MSTGraph, MSTLegend, NodeType,EdgeType,Hex, ColorField,LabelField}
151
153
  // exports.unused = {};
152
154
 
155
+
156
+ export interface clusterProps {
157
+ //theres 4 ways of calling this function
158
+ //1. through a BAQ involving iso and/or cluster fields
159
+ isolatesQuery?:Partial<Record<keyof typeof IsolateFields, Object>>,
160
+ clusterQuery?:Partial<Record<keyof typeof ClusterFields, Object>>, //2. selecting a cluster on /clusters (sending cluster _id)
161
+ fuzzy?:number, //3. by recalculating a previous query
162
+ neighbors?:number, // (fuzzy and neighbors are only available on recalc)
163
+ snapshotData?:SnapshotType //4. uploading a snapshot. (should i extrapolate ),
164
+
165
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gps-global-types",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "types shared between front-end and back-end",
5
5
  "main": "index.js",
6
6
  "scripts": {