@apollo-annotation/shared 1.1.0 → 1.1.2
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/GFF3/gff3ToAnnotationFeature.js +5 -0
- package/dist/GFF3/gff3ToAnnotationFeature.js.map +1 -1
- package/dist/GFF3/gff3ToAnnotationFeature.test.js +6 -0
- package/dist/GFF3/gff3ToAnnotationFeature.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/GFF3/gff3ToAnnotationFeature.test.ts +6 -0
- package/src/GFF3/gff3ToAnnotationFeature.ts +5 -0
- package/test_data/mixed_order.gff3 +13 -0
- package/test_data/mixed_order.json +87 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apollo-annotation/shared",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/GMOD/Apollo3.git",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"test:ci": "NODE_V8_COVERAGE=./coverage glob -c \"tsx --test --test-reporter spec --experimental-test-coverage \" \"**/*.test.ts\""
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@apollo-annotation/common": "^1.1.
|
|
21
|
-
"@apollo-annotation/mst": "^1.1.
|
|
22
|
-
"@apollo-annotation/schemas": "^1.1.
|
|
20
|
+
"@apollo-annotation/common": "^1.1.2",
|
|
21
|
+
"@apollo-annotation/mst": "^1.1.2",
|
|
22
|
+
"@apollo-annotation/schemas": "^1.1.2",
|
|
23
23
|
"@gmod/gff": "^2.1.0",
|
|
24
24
|
"@gmod/indexedfasta": "^5.0.2",
|
|
25
25
|
"@jbrowse/core": "^4.3.0",
|
|
@@ -137,6 +137,12 @@ describe('gff3ToAnnotationFeature examples', () => {
|
|
|
137
137
|
assert.equal(txt.match(/intron/g), null)
|
|
138
138
|
assert.equal(txt.match(/_codon/g), null)
|
|
139
139
|
})
|
|
140
|
+
it('Convert noncontiguous CDS lines', () => {
|
|
141
|
+
const [gffFeature] = readFeatureFile('test_data/mixed_order.gff3')
|
|
142
|
+
const actual = gff3ToAnnotationFeature(gffFeature)
|
|
143
|
+
const expected = readAnnotationFeatureSnapshot('test_data/mixed_order.json')
|
|
144
|
+
compareFeatures(actual, expected)
|
|
145
|
+
})
|
|
140
146
|
})
|
|
141
147
|
|
|
142
148
|
describe('CDS without exons', () => {
|
|
@@ -171,7 +171,12 @@ function convertChildren(
|
|
|
171
171
|
const cdsFeatures: GFF3Feature[] = []
|
|
172
172
|
const exonFeatures: GFF3Feature[] = []
|
|
173
173
|
const utrFeatures: GFF3Feature[] = []
|
|
174
|
+
const seenChildFeatures = new Set<GFF3Feature>()
|
|
174
175
|
for (const childFeature of childFeatures) {
|
|
176
|
+
if (seenChildFeatures.has(childFeature)) {
|
|
177
|
+
continue
|
|
178
|
+
}
|
|
179
|
+
seenChildFeatures.add(childFeature)
|
|
175
180
|
const [firstChildFeatureLocation] = childFeature
|
|
176
181
|
if (firstChildFeatureLocation.type === 'exon') {
|
|
177
182
|
exonFeatures.push(childFeature)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
OVOC_OM2 WormBase CDS 23840223 23840282 . - 0 ID=CDS:OVOC7322;Parent=Transcript:OVOC7322.1;Name=OVOC7322;prediction_status=Predicted;wormpep=OVP06434
|
|
2
|
+
OVOC_OM2 WormBase exon 23840223 23840282 . - . Parent=Transcript:OVOC7322.1
|
|
3
|
+
OVOC_OM2 WormBase gene 23840223 23842130 . - . ID=Gene:WBGene00244131;Name=WBGene00244131;sequence_name=OVOC7322;biotype=protein_coding;so_term_name=protein_coding_gene;curie=WB:WBGene00244131;Alias=OVOC7322
|
|
4
|
+
OVOC_OM2 WormBase mRNA 23840223 23842130 . - . ID=Transcript:OVOC7322.1;Parent=Gene:WBGene00244131;Name=OVOC7322.1;wormpep=OVP06434
|
|
5
|
+
OVOC_OM2 WormBase intron 23840283 23840606 . - . Parent=Transcript:OVOC7322.1
|
|
6
|
+
OVOC_OM2 WormBase CDS 23840607 23840698 . - 2 ID=CDS:OVOC7322;Parent=Transcript:OVOC7322.1;Name=OVOC7322;prediction_status=Predicted;wormpep=OVP06434
|
|
7
|
+
OVOC_OM2 WormBase exon 23840607 23840698 . - . Parent=Transcript:OVOC7322.1
|
|
8
|
+
OVOC_OM2 WormBase intron 23840699 23840940 . - . Parent=Transcript:OVOC7322.1
|
|
9
|
+
OVOC_OM2 WormBase CDS 23840941 23841057 . - 2 ID=CDS:OVOC7322;Parent=Transcript:OVOC7322.1;Name=OVOC7322;prediction_status=Predicted;wormpep=OVP06434
|
|
10
|
+
OVOC_OM2 WormBase exon 23840941 23841057 . - . Parent=Transcript:OVOC7322.1
|
|
11
|
+
OVOC_OM2 WormBase intron 23841058 23842123 . - . Parent=Transcript:OVOC7322.1
|
|
12
|
+
OVOC_OM2 WormBase CDS 23842124 23842130 . - 0 ID=CDS:OVOC7322;Parent=Transcript:OVOC7322.1;Name=OVOC7322;prediction_status=Predicted;wormpep=OVP06434
|
|
13
|
+
OVOC_OM2 WormBase exon 23842124 23842130 . - . Parent=Transcript:OVOC7322.1
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_id": "6a9b52bb29ee0a50a460744a",
|
|
3
|
+
"refSeq": "OVOC_OM2",
|
|
4
|
+
"type": "gene",
|
|
5
|
+
"min": 23840222,
|
|
6
|
+
"max": 23842130,
|
|
7
|
+
"strand": -1,
|
|
8
|
+
"children": {
|
|
9
|
+
"6a9b52bb29ee0a50a4607449": {
|
|
10
|
+
"_id": "6a9b52bb29ee0a50a4607449",
|
|
11
|
+
"refSeq": "OVOC_OM2",
|
|
12
|
+
"type": "mRNA",
|
|
13
|
+
"min": 23840222,
|
|
14
|
+
"max": 23842130,
|
|
15
|
+
"strand": -1,
|
|
16
|
+
"children": {
|
|
17
|
+
"6a9b52bb29ee0a50a4607443": {
|
|
18
|
+
"_id": "6a9b52bb29ee0a50a4607443",
|
|
19
|
+
"refSeq": "OVOC_OM2",
|
|
20
|
+
"type": "exon",
|
|
21
|
+
"min": 23840222,
|
|
22
|
+
"max": 23840282,
|
|
23
|
+
"strand": -1,
|
|
24
|
+
"attributes": { "gff_source": ["WormBase"] }
|
|
25
|
+
},
|
|
26
|
+
"6a9b52bb29ee0a50a4607444": {
|
|
27
|
+
"_id": "6a9b52bb29ee0a50a4607444",
|
|
28
|
+
"refSeq": "OVOC_OM2",
|
|
29
|
+
"type": "exon",
|
|
30
|
+
"min": 23840606,
|
|
31
|
+
"max": 23840698,
|
|
32
|
+
"strand": -1,
|
|
33
|
+
"attributes": { "gff_source": ["WormBase"] }
|
|
34
|
+
},
|
|
35
|
+
"6a9b52bb29ee0a50a4607445": {
|
|
36
|
+
"_id": "6a9b52bb29ee0a50a4607445",
|
|
37
|
+
"refSeq": "OVOC_OM2",
|
|
38
|
+
"type": "exon",
|
|
39
|
+
"min": 23840940,
|
|
40
|
+
"max": 23841057,
|
|
41
|
+
"strand": -1,
|
|
42
|
+
"attributes": { "gff_source": ["WormBase"] }
|
|
43
|
+
},
|
|
44
|
+
"6a9b52bb29ee0a50a4607446": {
|
|
45
|
+
"_id": "6a9b52bb29ee0a50a4607446",
|
|
46
|
+
"refSeq": "OVOC_OM2",
|
|
47
|
+
"type": "exon",
|
|
48
|
+
"min": 23842123,
|
|
49
|
+
"max": 23842130,
|
|
50
|
+
"strand": -1,
|
|
51
|
+
"attributes": { "gff_source": ["WormBase"] }
|
|
52
|
+
},
|
|
53
|
+
"6a9b52bb29ee0a50a4607447": {
|
|
54
|
+
"_id": "6a9b52bb29ee0a50a4607447",
|
|
55
|
+
"refSeq": "OVOC_OM2",
|
|
56
|
+
"type": "CDS",
|
|
57
|
+
"min": 23840222,
|
|
58
|
+
"max": 23842130,
|
|
59
|
+
"strand": -1,
|
|
60
|
+
"attributes": {
|
|
61
|
+
"gff_source": ["WormBase"],
|
|
62
|
+
"gff_id": ["CDS:OVOC7322"],
|
|
63
|
+
"gff_name": ["OVOC7322"],
|
|
64
|
+
"prediction_status": ["Predicted"],
|
|
65
|
+
"wormpep": ["OVP06434"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"attributes": {
|
|
70
|
+
"gff_source": ["WormBase"],
|
|
71
|
+
"gff_id": ["Transcript:OVOC7322.1"],
|
|
72
|
+
"gff_name": ["OVOC7322.1"],
|
|
73
|
+
"wormpep": ["OVP06434"]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"attributes": {
|
|
78
|
+
"gff_source": ["WormBase"],
|
|
79
|
+
"gff_id": ["Gene:WBGene00244131"],
|
|
80
|
+
"gff_name": ["WBGene00244131"],
|
|
81
|
+
"sequence_name": ["OVOC7322"],
|
|
82
|
+
"biotype": ["protein_coding"],
|
|
83
|
+
"so_term_name": ["protein_coding_gene"],
|
|
84
|
+
"curie": ["WB:WBGene00244131"],
|
|
85
|
+
"gff_alias": ["OVOC7322"]
|
|
86
|
+
}
|
|
87
|
+
}
|