@apollo-annotation/shared 0.3.5 → 0.3.7
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/dist/Changes/AddAssemblyAliasesChange.d.ts +16 -0
- package/dist/Changes/AddAssemblyAliasesChange.js +50 -0
- package/dist/Changes/AddAssemblyAliasesChange.js.map +1 -0
- package/dist/Changes/AddAssemblyAndFeaturesFromFileChange.d.ts +1 -1
- package/dist/Changes/AddAssemblyFromExternalChange.d.ts +1 -1
- package/dist/Changes/AddAssemblyFromFileChange.d.ts +1 -1
- package/dist/Changes/AddFeatureChange.d.ts +3 -2
- package/dist/Changes/AddFeatureChange.js +5 -25
- package/dist/Changes/AddFeatureChange.js.map +1 -1
- package/dist/Changes/AddFeaturesFromFileChange.d.ts +1 -1
- package/dist/Changes/AddRefSeqAliasesChange.d.ts +1 -1
- package/dist/Changes/DeleteAssemblyChange.d.ts +1 -1
- package/dist/Changes/DeleteFeatureChange.d.ts +12 -11
- package/dist/Changes/DeleteFeatureChange.js +37 -32
- package/dist/Changes/DeleteFeatureChange.js.map +1 -1
- package/dist/Changes/DeleteUserChange.d.ts +1 -1
- package/dist/Changes/FeatureAttributeChange.d.ts +3 -2
- package/dist/Changes/FeatureAttributeChange.js +14 -6
- package/dist/Changes/FeatureAttributeChange.js.map +1 -1
- package/dist/Changes/FromFileBaseChange.d.ts +3 -3
- package/dist/Changes/FromFileBaseChange.js.map +1 -1
- package/dist/Changes/ImportJBrowseConfigChange.d.ts +4 -1
- package/dist/Changes/ImportJBrowseConfigChange.js +17 -13
- package/dist/Changes/ImportJBrowseConfigChange.js.map +1 -1
- package/dist/Changes/LocationEndChange.d.ts +1 -1
- package/dist/Changes/LocationEndChange.js +40 -37
- package/dist/Changes/LocationEndChange.js.map +1 -1
- package/dist/Changes/LocationStartChange.d.ts +1 -1
- package/dist/Changes/LocationStartChange.js +40 -37
- package/dist/Changes/LocationStartChange.js.map +1 -1
- package/dist/Changes/MergeExonsChange.d.ts +30 -0
- package/dist/Changes/MergeExonsChange.js +130 -0
- package/dist/Changes/MergeExonsChange.js.map +1 -0
- package/dist/Changes/MergeTranscriptsChange.d.ts +36 -0
- package/dist/Changes/MergeTranscriptsChange.js +246 -0
- package/dist/Changes/MergeTranscriptsChange.js.map +1 -0
- package/dist/Changes/SplitExonChange.d.ts +33 -0
- package/dist/Changes/SplitExonChange.js +142 -0
- package/dist/Changes/SplitExonChange.js.map +1 -0
- package/dist/Changes/StrandChange.d.ts +1 -1
- package/dist/Changes/TypeChange.d.ts +1 -1
- package/dist/Changes/UndoMergeExonsChange.d.ts +27 -0
- package/dist/Changes/UndoMergeExonsChange.js +104 -0
- package/dist/Changes/UndoMergeExonsChange.js.map +1 -0
- package/dist/Changes/UndoMergeTranscriptsChange.d.ts +27 -0
- package/dist/Changes/UndoMergeTranscriptsChange.js +104 -0
- package/dist/Changes/UndoMergeTranscriptsChange.js.map +1 -0
- package/dist/Changes/UndoSplitExonChange.d.ts +32 -0
- package/dist/Changes/UndoSplitExonChange.js +111 -0
- package/dist/Changes/UndoSplitExonChange.js.map +1 -0
- package/dist/Changes/UserChange.d.ts +1 -1
- package/dist/Changes/index.d.ts +21 -0
- package/dist/Changes/index.js +21 -0
- package/dist/Changes/index.js.map +1 -1
- package/dist/Checks/CDSCheck.d.ts +1 -1
- package/dist/GFF3/annotationFeatureToGFF3.d.ts +2 -2
- package/dist/GFF3/annotationFeatureToGFF3.js +7 -1
- package/dist/GFF3/annotationFeatureToGFF3.js.map +1 -1
- package/dist/GFF3/annotationFeatureToGFF3.test.js +1 -1
- package/dist/GFF3/annotationFeatureToGFF3.test.js.map +1 -1
- package/dist/GFF3/gff3ToAnnotationFeature.d.ts +2 -2
- package/dist/GFF3/gff3ToAnnotationFeature.test.d.ts +1 -1
- package/dist/GFF3/gff3ToAnnotationFeature.test.js +1 -1
- package/dist/GFF3/gff3ToAnnotationFeature.test.js.map +1 -1
- package/dist/GFF3/gffReservedKeys.d.ts +7 -0
- package/dist/GFF3/gffReservedKeys.js +21 -1
- package/dist/GFF3/gffReservedKeys.js.map +1 -1
- package/dist/Messages.d.ts +2 -2
- package/dist/Operations/GetAssembliesOperation.d.ts +1 -1
- package/dist/Operations/GetFeaturesOperation.d.ts +1 -1
- package/dist/Validations/CoreValidation.d.ts +2 -2
- package/dist/Validations/CoreValidation.js +1 -1
- package/dist/Validations/CoreValidation.js.map +1 -1
- package/dist/Validations/ParentChildValidation.d.ts +5 -5
- package/dist/Validations/ParentChildValidation.js +3 -1
- package/dist/Validations/ParentChildValidation.js.map +1 -1
- package/dist/Validations/Validation.d.ts +5 -5
- package/dist/Validations/ValidationSet.d.ts +4 -4
- package/dist/Validations/ValidationSet.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/util.d.ts +2 -0
- package/dist/util.js +13 -0
- package/dist/util.js.map +1 -1
- package/package.json +4 -4
- package/src/Changes/AddAssemblyAliasesChange.ts +69 -0
- package/src/Changes/AddAssemblyAndFeaturesFromFileChange.ts +6 -6
- package/src/Changes/AddAssemblyFromExternalChange.ts +5 -5
- package/src/Changes/AddAssemblyFromFileChange.ts +5 -5
- package/src/Changes/AddFeatureChange.ts +11 -35
- package/src/Changes/AddFeaturesFromFileChange.ts +6 -6
- package/src/Changes/AddRefSeqAliasesChange.ts +6 -6
- package/src/Changes/DeleteAssemblyChange.ts +4 -4
- package/src/Changes/DeleteFeatureChange.ts +49 -43
- package/src/Changes/DeleteUserChange.ts +5 -5
- package/src/Changes/FeatureAttributeChange.ts +22 -13
- package/src/Changes/FromFileBaseChange.ts +6 -3
- package/src/Changes/ImportJBrowseConfigChange.ts +37 -22
- package/src/Changes/LocationEndChange.ts +47 -56
- package/src/Changes/LocationStartChange.ts +47 -56
- package/src/Changes/MergeExonsChange.ts +185 -0
- package/src/Changes/MergeTranscriptsChange.ts +379 -0
- package/src/Changes/SplitExonChange.ts +249 -0
- package/src/Changes/StrandChange.ts +6 -6
- package/src/Changes/TypeChange.ts +6 -6
- package/src/Changes/UndoMergeExonsChange.ts +149 -0
- package/src/Changes/UndoMergeTranscriptsChange.ts +153 -0
- package/src/Changes/UndoSplitExonChange.ts +174 -0
- package/src/Changes/UserChange.ts +5 -5
- package/src/Changes/index.ts +21 -0
- package/src/Checks/CDSCheck.ts +2 -2
- package/src/GFF3/annotationFeatureToGFF3.test.ts +4 -2
- package/src/GFF3/annotationFeatureToGFF3.ts +11 -5
- package/src/GFF3/gff3ToAnnotationFeature.test.ts +3 -3
- package/src/GFF3/gff3ToAnnotationFeature.ts +2 -2
- package/src/GFF3/gffReservedKeys.ts +25 -0
- package/src/Messages.ts +2 -2
- package/src/Operations/GetAssembliesOperation.ts +3 -3
- package/src/Operations/GetFeaturesOperation.ts +4 -4
- package/src/Validations/CoreValidation.ts +4 -3
- package/src/Validations/ParentChildValidation.ts +10 -8
- package/src/Validations/Validation.ts +5 -5
- package/src/Validations/ValidationSet.ts +8 -4
- package/src/util.ts +16 -0
- package/test_data/example01.json +3 -3
- package/test_data/example02.json +3 -3
- package/test_data/example04.json +3 -3
- package/test_data/gene_representations.gff3 +686 -1686
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/require-await */
|
|
2
2
|
import {
|
|
3
|
-
LocalGFF3DataStore,
|
|
3
|
+
type LocalGFF3DataStore,
|
|
4
4
|
Operation,
|
|
5
|
-
OperationOptions,
|
|
6
|
-
SerializedOperation,
|
|
7
|
-
ServerDataStore,
|
|
5
|
+
type OperationOptions,
|
|
6
|
+
type SerializedOperation,
|
|
7
|
+
type ServerDataStore,
|
|
8
8
|
} from '@apollo-annotation/common'
|
|
9
9
|
|
|
10
10
|
interface SerializedGetFeaturesOperation extends SerializedOperation {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/require-await */
|
|
2
|
-
import { Change } from '@apollo-annotation/common'
|
|
2
|
+
import { type Change } from '@apollo-annotation/common'
|
|
3
|
+
|
|
4
|
+
import { type TypeChange } from '../Changes'
|
|
3
5
|
|
|
4
|
-
import { TypeChange } from '../Changes'
|
|
5
|
-
import soSequenceTypes from './soSequenceTypes'
|
|
6
6
|
import { Validation } from './Validation'
|
|
7
|
+
import soSequenceTypes from './soSequenceTypes'
|
|
7
8
|
|
|
8
9
|
export function isTypeChange(thing: Change): thing is TypeChange {
|
|
9
10
|
return 'oldType' in thing && 'newType' in thing
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
2
|
-
|
|
3
|
-
import { Change } from '@apollo-annotation/common'
|
|
4
|
-
import { Feature, FeatureDocument } from '@apollo-annotation/schemas'
|
|
5
|
-
import { ClientSession, Model } from 'mongoose'
|
|
2
|
+
|
|
3
|
+
import { type Change } from '@apollo-annotation/common'
|
|
4
|
+
import { type Feature, type FeatureDocument } from '@apollo-annotation/schemas'
|
|
5
|
+
import { type ClientSession, type Model } from 'mongoose'
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
LocationEndChange,
|
|
9
|
-
LocationStartChange,
|
|
8
|
+
type LocationEndChange,
|
|
9
|
+
type LocationStartChange,
|
|
10
10
|
isLocationEndChange,
|
|
11
11
|
isLocationStartChange,
|
|
12
12
|
} from '../Changes'
|
|
13
|
-
import {
|
|
13
|
+
import { getPrintableId } from '../util'
|
|
14
|
+
|
|
15
|
+
import { Validation, type ValidationResult } from './Validation'
|
|
14
16
|
|
|
15
17
|
export class ParentChildValidation extends Validation {
|
|
16
18
|
name = 'ParentChildValidation' as const
|
|
@@ -79,7 +81,7 @@ export class ParentChildValidation extends Validation {
|
|
|
79
81
|
(childFeature.max > feature.max || childFeature.min < feature.min)
|
|
80
82
|
) {
|
|
81
83
|
throw new Error(
|
|
82
|
-
`Feature
|
|
84
|
+
`Feature ${getPrintableId(childFeature)} exceeds the bounds of its parent, ${getPrintableId(feature)}`,
|
|
83
85
|
)
|
|
84
86
|
}
|
|
85
87
|
this.checkChildFeatureBoundaries(childFeature)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
2
2
|
/* eslint-disable @typescript-eslint/require-await */
|
|
3
|
-
import { Change, ClientDataStore } from '@apollo-annotation/common'
|
|
4
|
-
import { FeatureDocument } from '@apollo-annotation/schemas'
|
|
5
|
-
import type
|
|
6
|
-
import type
|
|
7
|
-
import { ClientSession, Model } from 'mongoose'
|
|
3
|
+
import { type Change, type ClientDataStore } from '@apollo-annotation/common'
|
|
4
|
+
import { type FeatureDocument } from '@apollo-annotation/schemas'
|
|
5
|
+
import { type ExecutionContext } from '@nestjs/common'
|
|
6
|
+
import { type Reflector } from '@nestjs/core'
|
|
7
|
+
import { type ClientSession, type Model } from 'mongoose'
|
|
8
8
|
|
|
9
9
|
export interface Context {
|
|
10
10
|
context: ExecutionContext
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { Change, ClientDataStore } from '@apollo-annotation/common'
|
|
2
|
-
import { FeatureDocument } from '@apollo-annotation/schemas'
|
|
3
|
-
import { ClientSession, Model } from 'mongoose'
|
|
1
|
+
import { type Change, type ClientDataStore } from '@apollo-annotation/common'
|
|
2
|
+
import { type FeatureDocument } from '@apollo-annotation/schemas'
|
|
3
|
+
import { type ClientSession, type Model } from 'mongoose'
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
type Context,
|
|
7
|
+
type Validation,
|
|
8
|
+
type ValidationResult,
|
|
9
|
+
} from './Validation'
|
|
6
10
|
|
|
7
11
|
export class ValidationResultSet {
|
|
8
12
|
results: ValidationResult[] = []
|
package/src/util.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { type AnnotationFeature } from '@apollo-annotation/mst'
|
|
2
|
+
import { type Feature } from '@apollo-annotation/schemas'
|
|
3
|
+
|
|
1
4
|
export function splitStringIntoChunks(
|
|
2
5
|
input: string,
|
|
3
6
|
chunkSize: number,
|
|
@@ -9,3 +12,16 @@ export function splitStringIntoChunks(
|
|
|
9
12
|
}
|
|
10
13
|
return chunks
|
|
11
14
|
}
|
|
15
|
+
|
|
16
|
+
export function getPrintableId(feature: Feature): string {
|
|
17
|
+
const ff = feature as unknown as AnnotationFeature
|
|
18
|
+
const gff_id = ff.attributes.get('gff_id')?.join(',')
|
|
19
|
+
if (gff_id) {
|
|
20
|
+
return `ID=${gff_id} (_id: ${feature._id.toString()})`
|
|
21
|
+
}
|
|
22
|
+
const gff_name = ff.attributes.get('gff_name')?.join(',')
|
|
23
|
+
if (gff_name) {
|
|
24
|
+
return `Name=${gff_name} (_id: ${feature._id.toString()})`
|
|
25
|
+
}
|
|
26
|
+
return `_id: ${feature._id.toString()}`
|
|
27
|
+
}
|
package/test_data/example01.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"refSeq": "chr1",
|
|
31
31
|
"type": "exon",
|
|
32
32
|
"min": 1049,
|
|
33
|
-
"max":
|
|
33
|
+
"max": 1499,
|
|
34
34
|
"strand": 1,
|
|
35
35
|
"attributes": {
|
|
36
36
|
"gff_id": ["exon10002"]
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"refSeq": "chr1",
|
|
101
101
|
"type": "exon",
|
|
102
102
|
"min": 1049,
|
|
103
|
-
"max":
|
|
103
|
+
"max": 1499,
|
|
104
104
|
"strand": 1,
|
|
105
105
|
"attributes": {
|
|
106
106
|
"gff_id": ["exon10002"]
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"refSeq": "chr1",
|
|
160
160
|
"type": "exon",
|
|
161
161
|
"min": 1299,
|
|
162
|
-
"max":
|
|
162
|
+
"max": 1499,
|
|
163
163
|
"strand": 1,
|
|
164
164
|
"attributes": {
|
|
165
165
|
"gff_id": ["exon10001"]
|
package/test_data/example02.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"refSeq": "chr1",
|
|
20
20
|
"type": "exon",
|
|
21
21
|
"min": 11049,
|
|
22
|
-
"max":
|
|
22
|
+
"max": 11499,
|
|
23
23
|
"strand": 1,
|
|
24
24
|
"attributes": {
|
|
25
25
|
"gff_id": ["exon20001"]
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"refSeq": "chr1",
|
|
90
90
|
"type": "exon",
|
|
91
91
|
"min": 11049,
|
|
92
|
-
"max":
|
|
92
|
+
"max": 11499,
|
|
93
93
|
"strand": 1,
|
|
94
94
|
"attributes": {
|
|
95
95
|
"gff_id": ["exon20002"]
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"refSeq": "chr1",
|
|
149
149
|
"type": "exon",
|
|
150
150
|
"min": 11299,
|
|
151
|
-
"max":
|
|
151
|
+
"max": 11499,
|
|
152
152
|
"strand": 1,
|
|
153
153
|
"attributes": {
|
|
154
154
|
"gff_id": ["exon20003"]
|
package/test_data/example04.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"refSeq": "chr1",
|
|
20
20
|
"type": "exon",
|
|
21
21
|
"min": 31049,
|
|
22
|
-
"max":
|
|
22
|
+
"max": 31499,
|
|
23
23
|
"strand": 1,
|
|
24
24
|
"attributes": {
|
|
25
25
|
"gff_id": ["exon40001"]
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"refSeq": "chr1",
|
|
90
90
|
"type": "exon",
|
|
91
91
|
"min": 31049,
|
|
92
|
-
"max":
|
|
92
|
+
"max": 31499,
|
|
93
93
|
"strand": 1,
|
|
94
94
|
"attributes": {
|
|
95
95
|
"gff_id": ["exon40001"]
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"refSeq": "chr1",
|
|
149
149
|
"type": "exon",
|
|
150
150
|
"min": 31299,
|
|
151
|
-
"max":
|
|
151
|
+
"max": 31499,
|
|
152
152
|
"strand": 1,
|
|
153
153
|
"attributes": {
|
|
154
154
|
"gff_id": ["exon40002"]
|