@apollo-annotation/mst 0.1.18 → 0.1.20

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,93 @@
1
+ import { IAnyModelType, IMSTMap, Instance, SnapshotIn, SnapshotOrInstance } from 'mobx-state-tree';
2
+ export declare const AnnotationFeatureModel: import("mobx-state-tree").IModelType<{
3
+ _id: import("mobx-state-tree").ISimpleType<string>;
4
+ /** Unique ID of the reference sequence on which this feature is located */
5
+ refSeq: import("mobx-state-tree").ISimpleType<string>;
6
+ /**
7
+ * Type of feature. Can be any string, but is usually an ontology term,
8
+ * e.g. "gene" from the
9
+ * {@link http://sequenceontology.org/browser/current_release/term/SO:0000704 |Sequence Ontology}.
10
+ */
11
+ type: import("mobx-state-tree").ISimpleType<string>;
12
+ /**
13
+ * Coordinate of the edge of the feature that is closer to the beginning of
14
+ * the reference sequence. This can be thought of as the "start" of features
15
+ * on the positive strand. Uses interbase (0-based half-open) coordinates.
16
+ */
17
+ min: import("mobx-state-tree").ISimpleType<number>;
18
+ /**
19
+ * Coordinate of the edge of the feature that is closer to the end of the
20
+ * reference sequence. This can be thought of as the "end" of features on
21
+ * the positive strand. Uses interbase (0-based half-open) coordinates.
22
+ */
23
+ max: import("mobx-state-tree").ISimpleType<number>;
24
+ /**
25
+ * The strand on which the feature is located. `+1` for the positive (a.k.a.
26
+ * plus or forward) and `-1` for the negative (a.k.a minus or reverse)
27
+ * strand.
28
+ */
29
+ strand: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ITypeUnion<1 | -1, 1 | -1, 1 | -1>>;
30
+ /** Child features of this feature */
31
+ children: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IMapType<IAnyModelType>>;
32
+ /**
33
+ * Additional attributes of the feature. This could include name, source,
34
+ * note, dbxref, etc.
35
+ */
36
+ attributes: import("mobx-state-tree").IMapType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
37
+ }, {
38
+ readonly length: number;
39
+ readonly featureId: (import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>) | undefined;
40
+ /**
41
+ * Possibly different from `min` because "The GFF3 format does not enforce a
42
+ * rule in which features must be wholly contained within the location of
43
+ * their parents"
44
+ */
45
+ readonly minWithChildren: number;
46
+ /**
47
+ * Possibly different from `max` because "The GFF3 format does not enforce a
48
+ * rule in which features must be wholly contained within the location of
49
+ * their parents"
50
+ */
51
+ readonly maxWithChildren: number;
52
+ hasDescendant(featureId: string): boolean;
53
+ readonly cdsLocations: {
54
+ min: number;
55
+ max: number;
56
+ phase: 0 | 1 | 2;
57
+ }[][];
58
+ } & {
59
+ setAttributes(attributes: Map<string, string[]>): void;
60
+ setAttribute(key: string, value: string[]): void;
61
+ setType(type: string): void;
62
+ setRefSeq(refSeq: string): void;
63
+ setMin(min: number): void;
64
+ setMax(max: number): void;
65
+ setStrand(strand?: 1 | -1 | undefined): void;
66
+ addChild(childFeature: AnnotationFeatureSnapshot): void;
67
+ deleteChild(childFeatureId: string): void;
68
+ } & {
69
+ update({ children, max, min, refSeq, strand, }: {
70
+ refSeq: string;
71
+ min: number;
72
+ max: number;
73
+ strand?: 1 | -1;
74
+ children?: SnapshotOrInstance<(IMSTMap<IAnyModelType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IMaybe<import("mobx-state-tree").IMapType<IAnyModelType>>>) | undefined>;
75
+ }): void;
76
+ } & {
77
+ readonly parent: AnnotationFeature | undefined;
78
+ readonly topLevelFeature: AnnotationFeature;
79
+ readonly assemblyId: string;
80
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
81
+ export type Children = IMSTMap<typeof AnnotationFeatureModel> | undefined;
82
+ interface AnnotationFeatureRaw extends Instance<typeof AnnotationFeatureModel> {
83
+ }
84
+ export interface AnnotationFeature extends Omit<AnnotationFeatureRaw, 'children'> {
85
+ children?: Map<string, AnnotationFeature>;
86
+ }
87
+ interface AnnotationFeatureSnapshotRaw extends SnapshotIn<typeof AnnotationFeatureModel> {
88
+ }
89
+ export interface AnnotationFeatureSnapshot extends AnnotationFeatureSnapshotRaw {
90
+ /** Child features of this feature */
91
+ children?: Record<string, AnnotationFeatureSnapshot>;
92
+ }
93
+ export {};
@@ -0,0 +1,236 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AnnotationFeatureModel = void 0;
4
+ const util_1 = require("@jbrowse/core/util");
5
+ const mobx_state_tree_1 = require("mobx-state-tree");
6
+ const _1 = require(".");
7
+ const LateAnnotationFeature = mobx_state_tree_1.types.late(() => exports.AnnotationFeatureModel);
8
+ exports.AnnotationFeatureModel = mobx_state_tree_1.types
9
+ .model('AnnotationFeatureModel', {
10
+ _id: mobx_state_tree_1.types.identifier,
11
+ /** Unique ID of the reference sequence on which this feature is located */
12
+ refSeq: mobx_state_tree_1.types.string,
13
+ /**
14
+ * Type of feature. Can be any string, but is usually an ontology term,
15
+ * e.g. "gene" from the
16
+ * {@link http://sequenceontology.org/browser/current_release/term/SO:0000704 |Sequence Ontology}.
17
+ */
18
+ type: mobx_state_tree_1.types.string,
19
+ /**
20
+ * Coordinate of the edge of the feature that is closer to the beginning of
21
+ * the reference sequence. This can be thought of as the "start" of features
22
+ * on the positive strand. Uses interbase (0-based half-open) coordinates.
23
+ */
24
+ min: mobx_state_tree_1.types.number,
25
+ /**
26
+ * Coordinate of the edge of the feature that is closer to the end of the
27
+ * reference sequence. This can be thought of as the "end" of features on
28
+ * the positive strand. Uses interbase (0-based half-open) coordinates.
29
+ */
30
+ max: mobx_state_tree_1.types.number,
31
+ /**
32
+ * The strand on which the feature is located. `+1` for the positive (a.k.a.
33
+ * plus or forward) and `-1` for the negative (a.k.a minus or reverse)
34
+ * strand.
35
+ */
36
+ strand: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.union(mobx_state_tree_1.types.literal(1), mobx_state_tree_1.types.literal(-1))),
37
+ /** Child features of this feature */
38
+ children: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.map(LateAnnotationFeature)),
39
+ /**
40
+ * Additional attributes of the feature. This could include name, source,
41
+ * note, dbxref, etc.
42
+ */
43
+ attributes: mobx_state_tree_1.types.map(mobx_state_tree_1.types.array(mobx_state_tree_1.types.string)),
44
+ })
45
+ .views((self) => ({
46
+ get length() {
47
+ return self.max - self.min;
48
+ },
49
+ get featureId() {
50
+ return self.attributes.get('id');
51
+ },
52
+ /**
53
+ * Possibly different from `min` because "The GFF3 format does not enforce a
54
+ * rule in which features must be wholly contained within the location of
55
+ * their parents"
56
+ */
57
+ get minWithChildren() {
58
+ let { min } = self;
59
+ const children = self.children;
60
+ if (!children) {
61
+ return min;
62
+ }
63
+ for (const [, child] of children) {
64
+ min = Math.min(min, child.min);
65
+ }
66
+ return min;
67
+ },
68
+ /**
69
+ * Possibly different from `max` because "The GFF3 format does not enforce a
70
+ * rule in which features must be wholly contained within the location of
71
+ * their parents"
72
+ */
73
+ get maxWithChildren() {
74
+ let { max } = self;
75
+ const children = self.children;
76
+ if (!children) {
77
+ return max;
78
+ }
79
+ for (const [, child] of children) {
80
+ max = Math.max(max, child.max);
81
+ }
82
+ return max;
83
+ },
84
+ hasDescendant(featureId) {
85
+ const children = self.children;
86
+ if (!children) {
87
+ return false;
88
+ }
89
+ for (const [id, child] of children) {
90
+ if (id === featureId) {
91
+ return true;
92
+ }
93
+ if (child.hasDescendant(featureId)) {
94
+ return true;
95
+ }
96
+ }
97
+ return false;
98
+ },
99
+ get cdsLocations() {
100
+ if (self.type !== 'mRNA') {
101
+ throw new Error('Only features of type "mRNA" or equivalent can calculate CDS locations');
102
+ }
103
+ const children = self.children;
104
+ if (!children) {
105
+ throw new Error('no CDS or exons in mRNA');
106
+ }
107
+ const cdsChildren = [...children.values()].filter((child) => child.type === 'CDS');
108
+ if (cdsChildren.length === 0) {
109
+ throw new Error('no CDS in mRNA');
110
+ }
111
+ const cdsLocations = [];
112
+ for (const cds of cdsChildren) {
113
+ const { max: cdsMax, min: cdsMin } = cds;
114
+ const locs = [];
115
+ for (const [, child] of children) {
116
+ if (child.type !== 'exon') {
117
+ continue;
118
+ }
119
+ const [start, end] = (0, util_1.intersection2)(cdsMin, cdsMax, child.min, child.max);
120
+ if (start !== undefined && end !== undefined) {
121
+ locs.push({ min: start, max: end });
122
+ }
123
+ }
124
+ locs.sort(({ min: a }, { min: b }) => a - b);
125
+ if (self.strand === -1) {
126
+ locs.reverse();
127
+ }
128
+ let nextPhase = 0;
129
+ const phasedLocs = locs.map((loc) => {
130
+ const phase = nextPhase;
131
+ nextPhase = ((3 - ((loc.max - loc.min - phase + 3) % 3)) % 3);
132
+ return { ...loc, phase };
133
+ });
134
+ cdsLocations.push(phasedLocs);
135
+ }
136
+ return cdsLocations;
137
+ },
138
+ }))
139
+ .actions((self) => ({
140
+ setAttributes(attributes) {
141
+ self.attributes.clear();
142
+ for (const [key, value] of attributes.entries()) {
143
+ self.attributes.set(key, value);
144
+ }
145
+ },
146
+ setAttribute(key, value) {
147
+ self.attributes.merge({ [key]: value });
148
+ },
149
+ setType(type) {
150
+ self.type = type;
151
+ },
152
+ setRefSeq(refSeq) {
153
+ self.refSeq = refSeq;
154
+ },
155
+ setMin(min) {
156
+ if (min > self.max) {
157
+ throw new Error(`Min "${min}" is greater than max "${self.max}"`);
158
+ }
159
+ if (self.min !== min) {
160
+ self.min = min;
161
+ }
162
+ },
163
+ setMax(max) {
164
+ if (max < self.min) {
165
+ throw new Error(`Max "${max}" is less than Min "${self.min}"`);
166
+ }
167
+ if (self.max !== max) {
168
+ self.max = max;
169
+ }
170
+ },
171
+ setStrand(strand) {
172
+ self.strand = strand;
173
+ },
174
+ addChild(childFeature) {
175
+ if (self.children && self.children.size > 0) {
176
+ const existingChildren = (0, mobx_state_tree_1.getSnapshot)(self.children);
177
+ self.children.clear();
178
+ for (const [, child] of Object.entries({
179
+ ...existingChildren,
180
+ [childFeature._id]: childFeature,
181
+ }).sort(([, a], [, b]) => a.min - b.min)) {
182
+ self.children.put(child);
183
+ }
184
+ }
185
+ else {
186
+ self.children = (0, mobx_state_tree_1.cast)({});
187
+ self.children?.put(childFeature);
188
+ }
189
+ },
190
+ deleteChild(childFeatureId) {
191
+ self.children?.delete(childFeatureId);
192
+ },
193
+ }))
194
+ .actions((self) => ({
195
+ update({ children, max, min, refSeq, strand, }) {
196
+ self.setRefSeq(refSeq);
197
+ self.setMin(min);
198
+ self.setMax(max);
199
+ self.setStrand(strand);
200
+ if (children) {
201
+ self.children = (0, mobx_state_tree_1.cast)(children);
202
+ }
203
+ },
204
+ }))
205
+ // This views block has to be last to avoid:
206
+ // "'parent' is referenced directly or indirectly in its own type annotation."
207
+ .views((self) => ({
208
+ get parent() {
209
+ let parent;
210
+ try {
211
+ parent = (0, mobx_state_tree_1.getParentOfType)(self, exports.AnnotationFeatureModel);
212
+ }
213
+ catch {
214
+ // pass
215
+ }
216
+ return parent;
217
+ },
218
+ get topLevelFeature() {
219
+ let feature = self;
220
+ let parent;
221
+ do {
222
+ try {
223
+ parent = (0, mobx_state_tree_1.getParentOfType)(feature, exports.AnnotationFeatureModel);
224
+ feature = parent;
225
+ }
226
+ catch {
227
+ parent = undefined;
228
+ }
229
+ } while (parent);
230
+ return feature;
231
+ },
232
+ get assemblyId() {
233
+ return (0, mobx_state_tree_1.getParentOfType)(self, _1.ApolloAssembly)._id;
234
+ },
235
+ }));
236
+ //# sourceMappingURL=AnnotationFeatureModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationFeatureModel.js","sourceRoot":"","sources":["../src/AnnotationFeatureModel.ts"],"names":[],"mappings":";;;AAAA,6CAAkD;AAClD,qDAUwB;AAExB,wBAAkC;AAElC,MAAM,qBAAqB,GAAG,uBAAK,CAAC,IAAI,CACtC,GAAkB,EAAE,CAAC,8BAAsB,CAC5C,CAAA;AAEY,QAAA,sBAAsB,GAA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