@apollo-annotation/shared 0.3.10 → 0.3.12

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.
Files changed (247) hide show
  1. package/dist/Changes/AddAssemblyAliasesChange.d.ts +1 -0
  2. package/dist/Changes/AddAssemblyAliasesChange.d.ts.map +1 -0
  3. package/dist/Changes/AddAssemblyAliasesChange.js +7 -9
  4. package/dist/Changes/AddAssemblyAliasesChange.js.map +1 -1
  5. package/dist/Changes/AddAssemblyAndFeaturesFromFileChange.d.ts +5 -3
  6. package/dist/Changes/AddAssemblyAndFeaturesFromFileChange.d.ts.map +1 -0
  7. package/dist/Changes/AddAssemblyAndFeaturesFromFileChange.js +31 -13
  8. package/dist/Changes/AddAssemblyAndFeaturesFromFileChange.js.map +1 -1
  9. package/dist/Changes/AddAssemblyFromExternalChange.d.ts +1 -0
  10. package/dist/Changes/AddAssemblyFromExternalChange.d.ts.map +1 -0
  11. package/dist/Changes/AddAssemblyFromExternalChange.js +13 -16
  12. package/dist/Changes/AddAssemblyFromExternalChange.js.map +1 -1
  13. package/dist/Changes/AddAssemblyFromFileChange.d.ts +3 -2
  14. package/dist/Changes/AddAssemblyFromFileChange.d.ts.map +1 -0
  15. package/dist/Changes/AddAssemblyFromFileChange.js +4 -8
  16. package/dist/Changes/AddAssemblyFromFileChange.js.map +1 -1
  17. package/dist/Changes/AddFeatureChange.d.ts +3 -2
  18. package/dist/Changes/AddFeatureChange.d.ts.map +1 -0
  19. package/dist/Changes/AddFeatureChange.js +11 -11
  20. package/dist/Changes/AddFeatureChange.js.map +1 -1
  21. package/dist/Changes/AddFeaturesFromFileChange.d.ts +5 -3
  22. package/dist/Changes/AddFeaturesFromFileChange.d.ts.map +1 -0
  23. package/dist/Changes/AddFeaturesFromFileChange.js +27 -14
  24. package/dist/Changes/AddFeaturesFromFileChange.js.map +1 -1
  25. package/dist/Changes/AddRefSeqAliasesChange.d.ts +1 -0
  26. package/dist/Changes/AddRefSeqAliasesChange.d.ts.map +1 -0
  27. package/dist/Changes/AddRefSeqAliasesChange.js +7 -8
  28. package/dist/Changes/AddRefSeqAliasesChange.js.map +1 -1
  29. package/dist/Changes/DeleteAssemblyChange.d.ts +1 -0
  30. package/dist/Changes/DeleteAssemblyChange.d.ts.map +1 -0
  31. package/dist/Changes/DeleteAssemblyChange.js +5 -8
  32. package/dist/Changes/DeleteAssemblyChange.js.map +1 -1
  33. package/dist/Changes/DeleteFeatureChange.d.ts +4 -3
  34. package/dist/Changes/DeleteFeatureChange.d.ts.map +1 -0
  35. package/dist/Changes/DeleteFeatureChange.js +25 -12
  36. package/dist/Changes/DeleteFeatureChange.js.map +1 -1
  37. package/dist/Changes/DeleteUserChange.d.ts +1 -0
  38. package/dist/Changes/DeleteUserChange.d.ts.map +1 -0
  39. package/dist/Changes/DeleteUserChange.js +2 -6
  40. package/dist/Changes/DeleteUserChange.js.map +1 -1
  41. package/dist/Changes/FeatureAttributeChange.d.ts +1 -0
  42. package/dist/Changes/FeatureAttributeChange.d.ts.map +1 -0
  43. package/dist/Changes/FeatureAttributeChange.js +14 -8
  44. package/dist/Changes/FeatureAttributeChange.js.map +1 -1
  45. package/dist/Changes/FromFileBaseChange.d.ts +4 -3
  46. package/dist/Changes/FromFileBaseChange.d.ts.map +1 -0
  47. package/dist/Changes/FromFileBaseChange.js +4 -10
  48. package/dist/Changes/FromFileBaseChange.js.map +1 -1
  49. package/dist/Changes/ImportJBrowseConfigChange.d.ts +1 -0
  50. package/dist/Changes/ImportJBrowseConfigChange.d.ts.map +1 -0
  51. package/dist/Changes/ImportJBrowseConfigChange.js +3 -8
  52. package/dist/Changes/ImportJBrowseConfigChange.js.map +1 -1
  53. package/dist/Changes/LocationEndChange.d.ts +1 -0
  54. package/dist/Changes/LocationEndChange.d.ts.map +1 -0
  55. package/dist/Changes/LocationEndChange.js +3 -8
  56. package/dist/Changes/LocationEndChange.js.map +1 -1
  57. package/dist/Changes/LocationStartChange.d.ts +1 -0
  58. package/dist/Changes/LocationStartChange.d.ts.map +1 -0
  59. package/dist/Changes/LocationStartChange.js +3 -8
  60. package/dist/Changes/LocationStartChange.js.map +1 -1
  61. package/dist/Changes/MergeExonsChange.d.ts +3 -2
  62. package/dist/Changes/MergeExonsChange.d.ts.map +1 -0
  63. package/dist/Changes/MergeExonsChange.js +9 -13
  64. package/dist/Changes/MergeExonsChange.js.map +1 -1
  65. package/dist/Changes/MergeTranscriptsChange.d.ts +4 -3
  66. package/dist/Changes/MergeTranscriptsChange.d.ts.map +1 -0
  67. package/dist/Changes/MergeTranscriptsChange.js +20 -24
  68. package/dist/Changes/MergeTranscriptsChange.js.map +1 -1
  69. package/dist/Changes/SplitExonChange.d.ts +3 -2
  70. package/dist/Changes/SplitExonChange.d.ts.map +1 -0
  71. package/dist/Changes/SplitExonChange.js +6 -10
  72. package/dist/Changes/SplitExonChange.js.map +1 -1
  73. package/dist/Changes/StrandChange.d.ts +1 -0
  74. package/dist/Changes/StrandChange.d.ts.map +1 -0
  75. package/dist/Changes/StrandChange.js +2 -6
  76. package/dist/Changes/StrandChange.js.map +1 -1
  77. package/dist/Changes/TypeChange.d.ts +1 -0
  78. package/dist/Changes/TypeChange.d.ts.map +1 -0
  79. package/dist/Changes/TypeChange.js +2 -6
  80. package/dist/Changes/TypeChange.js.map +1 -1
  81. package/dist/Changes/UndoMergeExonsChange.d.ts +3 -2
  82. package/dist/Changes/UndoMergeExonsChange.d.ts.map +1 -0
  83. package/dist/Changes/UndoMergeExonsChange.js +4 -8
  84. package/dist/Changes/UndoMergeExonsChange.js.map +1 -1
  85. package/dist/Changes/UndoMergeTranscriptsChange.d.ts +3 -2
  86. package/dist/Changes/UndoMergeTranscriptsChange.d.ts.map +1 -0
  87. package/dist/Changes/UndoMergeTranscriptsChange.js +4 -8
  88. package/dist/Changes/UndoMergeTranscriptsChange.js.map +1 -1
  89. package/dist/Changes/UndoSplitExonChange.d.ts +3 -2
  90. package/dist/Changes/UndoSplitExonChange.d.ts.map +1 -0
  91. package/dist/Changes/UndoSplitExonChange.js +6 -10
  92. package/dist/Changes/UndoSplitExonChange.js.map +1 -1
  93. package/dist/Changes/UserChange.d.ts +1 -0
  94. package/dist/Changes/UserChange.d.ts.map +1 -0
  95. package/dist/Changes/UserChange.js +2 -6
  96. package/dist/Changes/UserChange.js.map +1 -1
  97. package/dist/Changes/index.d.ts +47 -46
  98. package/dist/Changes/index.d.ts.map +1 -0
  99. package/dist/Changes/index.js +70 -74
  100. package/dist/Changes/index.js.map +1 -1
  101. package/dist/Checks/CDSCheck.d.ts +2 -1
  102. package/dist/Checks/CDSCheck.d.ts.map +1 -0
  103. package/dist/Checks/CDSCheck.js +17 -26
  104. package/dist/Checks/CDSCheck.js.map +1 -1
  105. package/dist/Checks/TranscriptCheck.d.ts +2 -1
  106. package/dist/Checks/TranscriptCheck.d.ts.map +1 -0
  107. package/dist/Checks/TranscriptCheck.js +11 -16
  108. package/dist/Checks/TranscriptCheck.js.map +1 -1
  109. package/dist/Checks/index.d.ts +3 -2
  110. package/dist/Checks/index.d.ts.map +1 -0
  111. package/dist/Checks/index.js +2 -5
  112. package/dist/Checks/index.js.map +1 -1
  113. package/dist/Checks/util.d.ts +2 -1
  114. package/dist/Checks/util.d.ts.map +1 -0
  115. package/dist/Checks/util.js +1 -4
  116. package/dist/Checks/util.js.map +1 -1
  117. package/dist/Common/index.d.ts +2 -1
  118. package/dist/Common/index.d.ts.map +1 -0
  119. package/dist/Common/index.js +1 -4
  120. package/dist/Common/index.js.map +1 -1
  121. package/dist/Common/jwtPayload.d.ts +1 -0
  122. package/dist/Common/jwtPayload.d.ts.map +1 -0
  123. package/dist/Common/jwtPayload.js +5 -10
  124. package/dist/Common/jwtPayload.js.map +1 -1
  125. package/dist/GFF3/annotationFeatureToGFF3.d.ts +3 -2
  126. package/dist/GFF3/annotationFeatureToGFF3.d.ts.map +1 -0
  127. package/dist/GFF3/annotationFeatureToGFF3.js +96 -93
  128. package/dist/GFF3/annotationFeatureToGFF3.js.map +1 -1
  129. package/dist/GFF3/annotationFeatureToGFF3.test.d.ts +1 -0
  130. package/dist/GFF3/annotationFeatureToGFF3.test.d.ts.map +1 -0
  131. package/dist/GFF3/annotationFeatureToGFF3.test.js +77 -79
  132. package/dist/GFF3/annotationFeatureToGFF3.test.js.map +1 -1
  133. package/dist/GFF3/gff3ToAnnotationFeature.d.ts +3 -2
  134. package/dist/GFF3/gff3ToAnnotationFeature.d.ts.map +1 -0
  135. package/dist/GFF3/gff3ToAnnotationFeature.js +30 -22
  136. package/dist/GFF3/gff3ToAnnotationFeature.js.map +1 -1
  137. package/dist/GFF3/gff3ToAnnotationFeature.test.d.ts +1 -0
  138. package/dist/GFF3/gff3ToAnnotationFeature.test.d.ts.map +1 -0
  139. package/dist/GFF3/gff3ToAnnotationFeature.test.js +60 -63
  140. package/dist/GFF3/gff3ToAnnotationFeature.test.js.map +1 -1
  141. package/dist/GFF3/gffReservedKeys.d.ts +1 -0
  142. package/dist/GFF3/gffReservedKeys.d.ts.map +1 -0
  143. package/dist/GFF3/gffReservedKeys.js +12 -19
  144. package/dist/GFF3/gffReservedKeys.js.map +1 -1
  145. package/dist/GFF3/index.d.ts +4 -3
  146. package/dist/GFF3/index.d.ts.map +1 -0
  147. package/dist/GFF3/index.js +3 -6
  148. package/dist/GFF3/index.js.map +1 -1
  149. package/dist/GFF3/testUtil.d.ts +2 -1
  150. package/dist/GFF3/testUtil.d.ts.map +1 -0
  151. package/dist/GFF3/testUtil.js +8 -8
  152. package/dist/GFF3/testUtil.js.map +1 -1
  153. package/dist/Messages.d.ts +3 -2
  154. package/dist/Messages.d.ts.map +1 -0
  155. package/dist/Messages.js +1 -2
  156. package/dist/Operations/GetAssembliesOperation.d.ts +2 -3
  157. package/dist/Operations/GetAssembliesOperation.d.ts.map +1 -0
  158. package/dist/Operations/GetAssembliesOperation.js +2 -6
  159. package/dist/Operations/GetAssembliesOperation.js.map +1 -1
  160. package/dist/Operations/GetFeaturesOperation.d.ts +1 -0
  161. package/dist/Operations/GetFeaturesOperation.d.ts.map +1 -0
  162. package/dist/Operations/GetFeaturesOperation.js +2 -6
  163. package/dist/Operations/GetFeaturesOperation.js.map +1 -1
  164. package/dist/Operations/index.d.ts +5 -4
  165. package/dist/Operations/index.d.ts.map +1 -0
  166. package/dist/Operations/index.js +5 -9
  167. package/dist/Operations/index.js.map +1 -1
  168. package/dist/Validations/CoreValidation.d.ts +4 -3
  169. package/dist/Validations/CoreValidation.d.ts.map +1 -0
  170. package/dist/Validations/CoreValidation.js +6 -12
  171. package/dist/Validations/CoreValidation.js.map +1 -1
  172. package/dist/Validations/ParentChildValidation.d.ts +6 -5
  173. package/dist/Validations/ParentChildValidation.d.ts.map +1 -0
  174. package/dist/Validations/ParentChildValidation.js +6 -10
  175. package/dist/Validations/ParentChildValidation.js.map +1 -1
  176. package/dist/Validations/Validation.d.ts +6 -5
  177. package/dist/Validations/Validation.d.ts.map +1 -0
  178. package/dist/Validations/Validation.js +2 -7
  179. package/dist/Validations/Validation.js.map +1 -1
  180. package/dist/Validations/ValidationSet.d.ts +5 -4
  181. package/dist/Validations/ValidationSet.d.ts.map +1 -0
  182. package/dist/Validations/ValidationSet.js +3 -8
  183. package/dist/Validations/ValidationSet.js.map +1 -1
  184. package/dist/Validations/index.d.ts +5 -4
  185. package/dist/Validations/index.d.ts.map +1 -0
  186. package/dist/Validations/index.js +4 -7
  187. package/dist/Validations/index.js.map +1 -1
  188. package/dist/Validations/soSequenceTypes.d.ts +1 -0
  189. package/dist/Validations/soSequenceTypes.d.ts.map +1 -0
  190. package/dist/Validations/soSequenceTypes.js +1 -3
  191. package/dist/Validations/soSequenceTypes.js.map +1 -1
  192. package/dist/index.d.ts +9 -8
  193. package/dist/index.d.ts.map +1 -0
  194. package/dist/index.js +8 -11
  195. package/dist/index.js.map +1 -1
  196. package/dist/tsconfig.tsbuildinfo +1 -1
  197. package/dist/util.d.ts +3 -2
  198. package/dist/util.d.ts.map +1 -0
  199. package/dist/util.js +4 -10
  200. package/dist/util.js.map +1 -1
  201. package/package.json +16 -13
  202. package/src/Changes/AddAssemblyAliasesChange.ts +3 -1
  203. package/src/Changes/AddAssemblyAndFeaturesFromFileChange.ts +38 -16
  204. package/src/Changes/AddAssemblyFromExternalChange.ts +3 -2
  205. package/src/Changes/AddAssemblyFromFileChange.ts +11 -8
  206. package/src/Changes/AddFeatureChange.ts +8 -3
  207. package/src/Changes/AddFeaturesFromFileChange.ts +35 -18
  208. package/src/Changes/AddRefSeqAliasesChange.ts +3 -0
  209. package/src/Changes/DeleteAssemblyChange.ts +1 -0
  210. package/src/Changes/DeleteFeatureChange.ts +21 -3
  211. package/src/Changes/FeatureAttributeChange.ts +14 -1
  212. package/src/Changes/FromFileBaseChange.ts +4 -9
  213. package/src/Changes/LocationEndChange.ts +1 -1
  214. package/src/Changes/LocationStartChange.ts +1 -1
  215. package/src/Changes/MergeExonsChange.ts +4 -4
  216. package/src/Changes/MergeTranscriptsChange.ts +8 -8
  217. package/src/Changes/SplitExonChange.ts +3 -3
  218. package/src/Changes/StrandChange.ts +1 -1
  219. package/src/Changes/TypeChange.ts +1 -1
  220. package/src/Changes/UndoMergeExonsChange.ts +2 -2
  221. package/src/Changes/UndoMergeTranscriptsChange.ts +2 -2
  222. package/src/Changes/UndoSplitExonChange.ts +3 -3
  223. package/src/Changes/index.ts +46 -46
  224. package/src/Checks/CDSCheck.ts +8 -10
  225. package/src/Checks/TranscriptCheck.ts +4 -4
  226. package/src/Checks/index.ts +2 -2
  227. package/src/Checks/util.ts +1 -1
  228. package/src/Common/index.ts +1 -1
  229. package/src/GFF3/annotationFeatureToGFF3.test.ts +3 -3
  230. package/src/GFF3/annotationFeatureToGFF3.ts +105 -99
  231. package/src/GFF3/gff3ToAnnotationFeature.test.ts +3 -3
  232. package/src/GFF3/gff3ToAnnotationFeature.ts +29 -13
  233. package/src/GFF3/index.ts +3 -3
  234. package/src/GFF3/testUtil.ts +5 -1
  235. package/src/Messages.ts +2 -2
  236. package/src/Operations/index.ts +4 -4
  237. package/src/Validations/CoreValidation.ts +4 -4
  238. package/src/Validations/ParentChildValidation.ts +6 -6
  239. package/src/Validations/Validation.ts +5 -5
  240. package/src/Validations/ValidationSet.ts +4 -8
  241. package/src/Validations/index.ts +4 -4
  242. package/src/declare.d.ts +58 -0
  243. package/src/index.ts +8 -8
  244. package/src/util.ts +3 -3
  245. package/test_data/single_feature_mutliple_locations.gff3 +5 -0
  246. package/test_data/single_feature_mutliple_locations.json +76 -0
  247. package/tsconfig.json +6 -4
@@ -8,10 +8,10 @@ import {
8
8
  type SerializedFeatureChange,
9
9
  type ServerDataStore,
10
10
  } from '@apollo-annotation/common'
11
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
11
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
12
12
 
13
- import { findAndDeleteChildFeature } from './DeleteFeatureChange'
14
- import { SplitExonChange } from './SplitExonChange'
13
+ import { findAndDeleteChildFeature } from './DeleteFeatureChange.js'
14
+ import { SplitExonChange } from './SplitExonChange.js'
15
15
 
16
16
  interface SerializedUndoSplitExonChangeBase extends SerializedFeatureChange {
17
17
  typeName: 'UndoSplitExonChange'
@@ -1,26 +1,26 @@
1
- import { AddAssemblyAliasesChange } from './AddAssemblyAliasesChange'
2
- import { AddAssemblyAndFeaturesFromFileChange } from './AddAssemblyAndFeaturesFromFileChange'
3
- import { AddAssemblyFromExternalChange } from './AddAssemblyFromExternalChange'
4
- import { AddAssemblyFromFileChange } from './AddAssemblyFromFileChange'
5
- import { AddFeatureChange } from './AddFeatureChange'
6
- import { AddFeaturesFromFileChange } from './AddFeaturesFromFileChange'
7
- import { AddRefSeqAliasesChange } from './AddRefSeqAliasesChange'
8
- import { DeleteAssemblyChange } from './DeleteAssemblyChange'
9
- import { DeleteFeatureChange } from './DeleteFeatureChange'
10
- import { DeleteUserChange } from './DeleteUserChange'
11
- import { FeatureAttributeChange } from './FeatureAttributeChange'
12
- import { ImportJBrowseConfigChange } from './ImportJBrowseConfigChange'
13
- import { LocationEndChange } from './LocationEndChange'
14
- import { LocationStartChange } from './LocationStartChange'
15
- import { MergeExonsChange } from './MergeExonsChange'
16
- import { MergeTranscriptsChange } from './MergeTranscriptsChange'
17
- import { SplitExonChange } from './SplitExonChange'
18
- import { StrandChange } from './StrandChange'
19
- import { TypeChange } from './TypeChange'
20
- import { UndoMergeExonsChange } from './UndoMergeExonsChange'
21
- import { UndoMergeTranscriptsChange } from './UndoMergeTranscriptsChange'
22
- import { UndoSplitExonChange } from './UndoSplitExonChange'
23
- import { UserChange } from './UserChange'
1
+ import { AddAssemblyAliasesChange } from './AddAssemblyAliasesChange.js'
2
+ import { AddAssemblyAndFeaturesFromFileChange } from './AddAssemblyAndFeaturesFromFileChange.js'
3
+ import { AddAssemblyFromExternalChange } from './AddAssemblyFromExternalChange.js'
4
+ import { AddAssemblyFromFileChange } from './AddAssemblyFromFileChange.js'
5
+ import { AddFeatureChange } from './AddFeatureChange.js'
6
+ import { AddFeaturesFromFileChange } from './AddFeaturesFromFileChange.js'
7
+ import { AddRefSeqAliasesChange } from './AddRefSeqAliasesChange.js'
8
+ import { DeleteAssemblyChange } from './DeleteAssemblyChange.js'
9
+ import { DeleteFeatureChange } from './DeleteFeatureChange.js'
10
+ import { DeleteUserChange } from './DeleteUserChange.js'
11
+ import { FeatureAttributeChange } from './FeatureAttributeChange.js'
12
+ import { ImportJBrowseConfigChange } from './ImportJBrowseConfigChange.js'
13
+ import { LocationEndChange } from './LocationEndChange.js'
14
+ import { LocationStartChange } from './LocationStartChange.js'
15
+ import { MergeExonsChange } from './MergeExonsChange.js'
16
+ import { MergeTranscriptsChange } from './MergeTranscriptsChange.js'
17
+ import { SplitExonChange } from './SplitExonChange.js'
18
+ import { StrandChange } from './StrandChange.js'
19
+ import { TypeChange } from './TypeChange.js'
20
+ import { UndoMergeExonsChange } from './UndoMergeExonsChange.js'
21
+ import { UndoMergeTranscriptsChange } from './UndoMergeTranscriptsChange.js'
22
+ import { UndoSplitExonChange } from './UndoSplitExonChange.js'
23
+ import { UserChange } from './UserChange.js'
24
24
 
25
25
  export const changes = {
26
26
  AddAssemblyAndFeaturesFromFileChange,
@@ -48,26 +48,26 @@ export const changes = {
48
48
  AddAssemblyAliasesChange,
49
49
  }
50
50
 
51
- export * from './AddAssemblyAndFeaturesFromFileChange'
52
- export * from './AddAssemblyFromFileChange'
53
- export * from './AddAssemblyFromExternalChange'
54
- export * from './AddFeatureChange'
55
- export * from './AddFeaturesFromFileChange'
56
- export * from './DeleteAssemblyChange'
57
- export * from './DeleteFeatureChange'
58
- export * from './DeleteUserChange'
59
- export * from './FeatureAttributeChange'
60
- export * from './ImportJBrowseConfigChange'
61
- export * from './LocationEndChange'
62
- export * from './LocationStartChange'
63
- export * from './MergeExonsChange'
64
- export * from './SplitExonChange'
65
- export * from './MergeTranscriptsChange'
66
- export * from './UndoMergeExonsChange'
67
- export * from './UndoSplitExonChange'
68
- export * from './UndoMergeTranscriptsChange'
69
- export * from './StrandChange'
70
- export * from './TypeChange'
71
- export * from './UserChange'
72
- export * from './AddRefSeqAliasesChange'
73
- export * from './AddAssemblyAliasesChange'
51
+ export * from './AddAssemblyAndFeaturesFromFileChange.js'
52
+ export * from './AddAssemblyFromFileChange.js'
53
+ export * from './AddAssemblyFromExternalChange.js'
54
+ export * from './AddFeatureChange.js'
55
+ export * from './AddFeaturesFromFileChange.js'
56
+ export * from './DeleteAssemblyChange.js'
57
+ export * from './DeleteFeatureChange.js'
58
+ export * from './DeleteUserChange.js'
59
+ export * from './FeatureAttributeChange.js'
60
+ export * from './ImportJBrowseConfigChange.js'
61
+ export * from './LocationEndChange.js'
62
+ export * from './LocationStartChange.js'
63
+ export * from './MergeExonsChange.js'
64
+ export * from './SplitExonChange.js'
65
+ export * from './MergeTranscriptsChange.js'
66
+ export * from './UndoMergeExonsChange.js'
67
+ export * from './UndoSplitExonChange.js'
68
+ export * from './UndoMergeTranscriptsChange.js'
69
+ export * from './StrandChange.js'
70
+ export * from './TypeChange.js'
71
+ export * from './UserChange.js'
72
+ export * from './AddRefSeqAliasesChange.js'
73
+ export * from './AddAssemblyAliasesChange.js'
@@ -1,12 +1,12 @@
1
1
  import { Check } from '@apollo-annotation/common'
2
- import {
3
- type AnnotationFeatureSnapshot,
4
- type CheckResultSnapshot,
2
+ import type {
3
+ AnnotationFeatureSnapshot,
4
+ CheckResultSnapshot,
5
5
  } from '@apollo-annotation/mst'
6
6
  import { intersection2 } from '@jbrowse/core/util'
7
7
  import ObjectID from 'bson-objectid'
8
8
 
9
- import { getPrintableId } from './util'
9
+ import { getPrintableId } from './util.js'
10
10
 
11
11
  enum STOP_CODONS {
12
12
  'TAG',
@@ -99,12 +99,10 @@ function getOriginalCodonLocation(
99
99
  index: number,
100
100
  ): [number, number] | undefined {
101
101
  // Index 0 is the start codon, so reverse the CDS locations if strand is -1
102
- const sortedLocation: CDSLocation = structuredClone(cdsLocation)
103
- if (strand === -1) {
104
- sortedLocation.sort((a, b) => (a.min < b.min ? 1 : -1))
105
- } else {
106
- sortedLocation.sort((a, b) => (a.min < b.min ? -1 : 1))
107
- }
102
+ const sortedLocation =
103
+ strand === -1
104
+ ? cdsLocation.toSorted((a, b) => (a.min < b.min ? 1 : -1))
105
+ : cdsLocation.toSorted((a, b) => (a.min < b.min ? -1 : 1))
108
106
  let i = 0
109
107
  let currentStart: number | undefined = undefined
110
108
  let currentEnd: number | undefined = undefined
@@ -1,12 +1,12 @@
1
1
  import { Check } from '@apollo-annotation/common'
2
- import {
3
- type AnnotationFeatureSnapshot,
4
- type CheckResultSnapshot,
2
+ import type {
3
+ AnnotationFeatureSnapshot,
4
+ CheckResultSnapshot,
5
5
  } from '@apollo-annotation/mst'
6
6
  import { revcom } from '@jbrowse/core/util'
7
7
  import ObjectID from 'bson-objectid'
8
8
 
9
- import { getPrintableId } from './util'
9
+ import { getPrintableId } from './util.js'
10
10
 
11
11
  interface SpliceSequence {
12
12
  fivePrimeSeq: string
@@ -1,2 +1,2 @@
1
- export * from './CDSCheck'
2
- export * from './TranscriptCheck'
1
+ export * from './CDSCheck.js'
2
+ export * from './TranscriptCheck.js'
@@ -1,4 +1,4 @@
1
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
1
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
2
2
 
3
3
  export function getPrintableId(feature: AnnotationFeatureSnapshot): string {
4
4
  const gff_id = feature.attributes?.gff_id?.join(', ')
@@ -1 +1 @@
1
- export * from './jwtPayload'
1
+ export * from './jwtPayload.js'
@@ -3,12 +3,12 @@
3
3
  import { readFileSync } from 'node:fs'
4
4
  import { describe, it } from 'node:test'
5
5
 
6
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
6
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
7
7
  import { formatSync } from '@gmod/gff'
8
8
  import { assert, expect } from 'chai'
9
9
 
10
- import { annotationFeatureToGFF3 } from './annotationFeatureToGFF3'
11
- import { readAnnotationFeatureSnapshot, testCases } from './testUtil'
10
+ import { annotationFeatureToGFF3 } from './annotationFeatureToGFF3.js'
11
+ import { readAnnotationFeatureSnapshot, testCases } from './testUtil.js'
12
12
 
13
13
  describe('Converts AnnotationFeatureSnapshot JSON to GFF3 when', () => {
14
14
  for (const testCase of testCases) {
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
2
 
3
- import {
4
- type AnnotationFeatureSnapshot,
5
- type TranscriptPartLocation,
6
- type TranscriptPartNonCoding,
3
+ import type {
4
+ AnnotationFeatureSnapshot,
5
+ TranscriptPartLocation,
6
+ TranscriptPartNonCoding,
7
7
  } from '@apollo-annotation/mst'
8
- import { type GFF3Feature } from '@gmod/gff'
8
+ import type { GFF3Feature } from '@gmod/gff'
9
9
  import { intersection2 } from '@jbrowse/core/util'
10
10
 
11
11
  export function annotationFeatureToGFF3(
@@ -13,105 +13,111 @@ export function annotationFeatureToGFF3(
13
13
  parentId?: string,
14
14
  refSeqNames?: Record<string, string | undefined>,
15
15
  ): GFF3Feature {
16
- // eslint-disable-next-line unicorn/prefer-structured-clone
17
- const attributes: Record<string, string[] | undefined> = JSON.parse(
18
- JSON.stringify(feature.attributes ?? {}),
19
- )
20
- const ontologyTerms: string[] = []
21
- const source = feature.attributes?.gff_source?.[0] ?? null
16
+ const locations =
17
+ feature.type === 'apollo_feature_container'
18
+ ? Object.values(feature.children ?? {})
19
+ : [feature]
20
+ return locations.map((featureLoc) => {
21
+ // eslint-disable-next-line unicorn/prefer-structured-clone
22
+ const attributes: Record<string, string[] | undefined> = JSON.parse(
23
+ JSON.stringify(featureLoc.attributes ?? {}),
24
+ )
25
+ const ontologyTerms: string[] = []
26
+ const source = featureLoc.attributes?.gff_source?.[0] ?? null
22
27
 
23
- delete attributes.gff_source
24
- if (parentId) {
25
- attributes.Parent = [parentId]
26
- }
27
- if (attributes.gff_id) {
28
- attributes.ID = attributes.gff_id
29
- delete attributes.gff_id
30
- } else if (feature.children) {
31
- attributes.ID = [feature._id]
32
- }
33
- if (attributes.gff_name) {
34
- attributes.Name = attributes.gff_name
35
- delete attributes.gff_name
36
- }
37
- if (attributes.gff_alias) {
38
- attributes.Alias = attributes.gff_alias
39
- delete attributes.gff_alias
40
- }
41
- if (attributes.gff_target) {
42
- attributes.Target = attributes.gff_target
43
- delete attributes.gff_target
44
- }
45
- if (attributes.gff_gap) {
46
- attributes.Gap = attributes.gff_gap
47
- delete attributes.gff_gap
48
- }
49
- if (attributes.gff_derives_from) {
50
- attributes.Derives_from = attributes.gff_derives_from
51
- delete attributes.gff_derives_from
52
- }
53
- if (attributes.gff_note) {
54
- attributes.Note = attributes.gff_note
55
- delete attributes.gff_note
56
- }
57
- if (attributes.gff_dbxref) {
58
- attributes.Dbxref = attributes.gff_dbxref
59
- delete attributes.gff_dbxref
60
- }
61
- if (attributes.gff_is_circular) {
62
- attributes.Is_circular = attributes.gff_is_circular
63
- delete attributes.gff_is_circular
64
- }
65
- if (attributes.gff_ontology_term) {
66
- ontologyTerms.push(...attributes.gff_ontology_term)
67
- delete attributes.gff_ontology_term
68
- }
69
- if (attributes['Gene Ontology']) {
70
- ontologyTerms.push(...attributes['Gene Ontology'])
71
- delete attributes['Gene Ontology']
72
- }
73
- if (attributes['Sequence Ontology']) {
74
- ontologyTerms.push(...attributes['Sequence Ontology'])
75
- delete attributes['Sequence Ontology']
76
- }
77
- if (ontologyTerms.length > 0) {
78
- attributes.Ontology_term = ontologyTerms
79
- }
28
+ delete attributes.gff_source
29
+ if (parentId) {
30
+ attributes.Parent = [parentId]
31
+ }
32
+ if (attributes.gff_id) {
33
+ attributes.ID = attributes.gff_id
34
+ delete attributes.gff_id
35
+ } else if (featureLoc.children) {
36
+ attributes.ID = [featureLoc._id]
37
+ }
38
+ if (attributes.gff_name) {
39
+ attributes.Name = attributes.gff_name
40
+ delete attributes.gff_name
41
+ }
42
+ if (attributes.gff_alias) {
43
+ attributes.Alias = attributes.gff_alias
44
+ delete attributes.gff_alias
45
+ }
46
+ if (attributes.gff_target) {
47
+ attributes.Target = attributes.gff_target
48
+ delete attributes.gff_target
49
+ }
50
+ if (attributes.gff_gap) {
51
+ attributes.Gap = attributes.gff_gap
52
+ delete attributes.gff_gap
53
+ }
54
+ if (attributes.gff_derives_from) {
55
+ attributes.Derives_from = attributes.gff_derives_from
56
+ delete attributes.gff_derives_from
57
+ }
58
+ if (attributes.gff_note) {
59
+ attributes.Note = attributes.gff_note
60
+ delete attributes.gff_note
61
+ }
62
+ if (attributes.gff_dbxref) {
63
+ attributes.Dbxref = attributes.gff_dbxref
64
+ delete attributes.gff_dbxref
65
+ }
66
+ if (attributes.gff_is_circular) {
67
+ attributes.Is_circular = attributes.gff_is_circular
68
+ delete attributes.gff_is_circular
69
+ }
70
+ if (attributes.gff_ontology_term) {
71
+ ontologyTerms.push(...attributes.gff_ontology_term)
72
+ delete attributes.gff_ontology_term
73
+ }
74
+ if (attributes['Gene Ontology']) {
75
+ ontologyTerms.push(...attributes['Gene Ontology'])
76
+ delete attributes['Gene Ontology']
77
+ }
78
+ if (attributes['Sequence Ontology']) {
79
+ ontologyTerms.push(...attributes['Sequence Ontology'])
80
+ delete attributes['Sequence Ontology']
81
+ }
82
+ if (ontologyTerms.length > 0) {
83
+ attributes.Ontology_term = ontologyTerms
84
+ }
80
85
 
81
- const gff_score = feature.attributes?.gff_score
82
- let score: number | null = null
83
- if (gff_score && gff_score.length > 0) {
84
- if (gff_score[0]) {
85
- score = Number(gff_score[0])
86
- if (Number.isNaN(score)) {
87
- score = null
86
+ const gff_score = featureLoc.attributes?.gff_score
87
+ let score: number | null = null
88
+ if (gff_score && gff_score.length > 0) {
89
+ if (gff_score[0]) {
90
+ score = Number(gff_score[0])
91
+ if (Number.isNaN(score)) {
92
+ score = null
93
+ }
88
94
  }
95
+ delete attributes.gff_score
89
96
  }
90
- delete attributes.gff_score
91
- }
92
97
 
93
- const locations = [{ start: feature.min, end: feature.max }]
94
-
95
- return locations.map((location) => ({
96
- start: Number(location.start) + 1,
97
- end: Number(location.end),
98
- seq_id: refSeqNames ? refSeqNames[feature.refSeq] ?? null : feature.refSeq,
99
- source,
100
- type: feature.type,
101
- score,
102
- strand: feature.strand ? (feature.strand === 1 ? '+' : '-') : null,
103
- phase: null,
104
- attributes:
105
- Object.keys(attributes).length > 0
106
- ? (attributes as Record<string, string[]>)
107
- : null,
108
- derived_features: [],
109
- child_features: prepareChildFeatures(
110
- feature,
111
- attributes.ID?.[0],
112
- refSeqNames,
113
- ),
114
- }))
98
+ return {
99
+ start: Number(featureLoc.min) + 1,
100
+ end: Number(featureLoc.max),
101
+ seq_id: refSeqNames
102
+ ? refSeqNames[featureLoc.refSeq] ?? null
103
+ : featureLoc.refSeq,
104
+ source,
105
+ type: featureLoc.type,
106
+ score,
107
+ strand: featureLoc.strand ? (featureLoc.strand === 1 ? '+' : '-') : null,
108
+ phase: null,
109
+ attributes:
110
+ Object.keys(attributes).length > 0
111
+ ? (attributes as Record<string, string[]>)
112
+ : null,
113
+ derived_features: [],
114
+ child_features: prepareChildFeatures(
115
+ featureLoc,
116
+ attributes.ID?.[0],
117
+ refSeqNames,
118
+ ),
119
+ }
120
+ })
115
121
  }
116
122
 
117
123
  function prepareChildFeatures(
@@ -2,13 +2,13 @@
2
2
  import { readFileSync } from 'node:fs'
3
3
  import { describe, it } from 'node:test'
4
4
 
5
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
5
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
6
6
  import { type GFF3Feature, parseStringSync } from '@gmod/gff'
7
7
  import { assert, use } from 'chai'
8
8
  import chaiExclude from 'chai-exclude'
9
9
 
10
- import { gff3ToAnnotationFeature } from './gff3ToAnnotationFeature'
11
- import { readAnnotationFeatureSnapshot, testCases } from './testUtil'
10
+ import { gff3ToAnnotationFeature } from './gff3ToAnnotationFeature.js'
11
+ import { readAnnotationFeatureSnapshot, testCases } from './testUtil.js'
12
12
 
13
13
  use(chaiExclude)
14
14
 
@@ -1,26 +1,21 @@
1
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
2
- import { type GFF3Feature, type GFF3FeatureLineWithRefs } from '@gmod/gff'
1
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
2
+ import type { GFF3Feature, GFF3FeatureLineWithRefs } from '@gmod/gff'
3
3
  import { doesIntersect2 } from '@jbrowse/core/util'
4
4
  import ObjectID from 'bson-objectid'
5
5
 
6
- import { gffToInternal, isGFFReservedAttribute } from './gffReservedKeys'
6
+ import { gffToInternal, isGFFReservedAttribute } from './gffReservedKeys.js'
7
7
 
8
8
  export function gff3ToAnnotationFeature(
9
9
  gff3Feature: GFF3Feature,
10
10
  refSeq?: string,
11
11
  ): AnnotationFeatureSnapshot {
12
12
  const [firstFeature] = gff3Feature
13
- const { end, seq_id: refName, start, strand, type } = firstFeature
13
+ const { end, seq_id: refName, start, strand } = firstFeature
14
14
  if (!refName) {
15
15
  throw new Error(
16
16
  `feature does not have seq_id: ${JSON.stringify(firstFeature)}`,
17
17
  )
18
18
  }
19
- if (!type) {
20
- throw new Error(
21
- `feature does not have type: ${JSON.stringify(firstFeature)}`,
22
- )
23
- }
24
19
  if (start === null) {
25
20
  throw new Error(
26
21
  `feature does not have start: ${JSON.stringify(firstFeature)}`,
@@ -41,7 +36,7 @@ export function gff3ToAnnotationFeature(
41
36
  const feature: AnnotationFeatureSnapshot = {
42
37
  _id: new ObjectID().toHexString(),
43
38
  refSeq: refSeq ?? refName,
44
- type,
39
+ type: getFeatureType(gff3Feature),
45
40
  min,
46
41
  max,
47
42
  }
@@ -64,9 +59,6 @@ export function gff3ToAnnotationFeature(
64
59
  }
65
60
 
66
61
  function getFeatureMinMax(gff3Feature: GFF3Feature): [number, number] {
67
- if (gff3Feature.length > 1 && !gff3Feature.every((f) => f.type === 'CDS')) {
68
- throw new Error('GFF3 features has multiple locations but is not a CDS')
69
- }
70
62
  const mins = gff3Feature.map((f) => f.start).filter((m) => m !== null)
71
63
  const maxes = gff3Feature.map((f) => f.end).filter((m) => m !== null)
72
64
  const min = Math.min(...mins)
@@ -134,6 +126,20 @@ function convertFeatureAttributes(
134
126
  return
135
127
  }
136
128
 
129
+ function getFeatureType(gff3Feature: GFF3Feature) {
130
+ const [firstFeature] = gff3Feature
131
+ if (gff3Feature.length === 1 || firstFeature.type === 'CDS') {
132
+ const { type } = firstFeature
133
+ if (!type) {
134
+ throw new Error(
135
+ `feature does not have type: ${JSON.stringify(firstFeature)}`,
136
+ )
137
+ }
138
+ return type
139
+ }
140
+ return 'apollo_feature_container'
141
+ }
142
+
137
143
  function convertChildren(
138
144
  gff3Feature: GFF3Feature,
139
145
  refSeq?: string,
@@ -146,6 +152,16 @@ function convertChildren(
146
152
  if (locationsWithChildren.length > 1) {
147
153
  throw new Error('Features with multiple locations may not have children')
148
154
  }
155
+ if (gff3Feature.length > 1 && gff3Feature[0].type !== 'CDS') {
156
+ for (const gff3FeatureLocation of gff3Feature) {
157
+ const annotationFeature = gff3ToAnnotationFeature(
158
+ [gff3FeatureLocation],
159
+ refSeq,
160
+ )
161
+ convertedChildren[annotationFeature._id] = annotationFeature
162
+ }
163
+ return convertedChildren
164
+ }
149
165
  if (locationsWithChildren.length === 0) {
150
166
  return
151
167
  }
package/src/GFF3/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './annotationFeatureToGFF3'
2
- export * from './gffReservedKeys'
3
- export * from './gff3ToAnnotationFeature'
1
+ export * from './annotationFeatureToGFF3.js'
2
+ export * from './gffReservedKeys.js'
3
+ export * from './gff3ToAnnotationFeature.js'
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'node:fs'
2
2
 
3
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
3
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
4
4
 
5
5
  export function readAnnotationFeatureSnapshot(
6
6
  fn: string,
@@ -22,4 +22,8 @@ export const testCases: { filenameStem: string; description: string }[] = [
22
22
  filenameStem: 'gene_with_two_cds',
23
23
  description: 'Gene with two CDS',
24
24
  },
25
+ {
26
+ filenameStem: 'single_feature_mutliple_locations',
27
+ description: 'A single top-level feature has multiple locations',
28
+ },
25
29
  ]
package/src/Messages.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { type SerializedChange } from '@apollo-annotation/common'
2
- import { type CheckResultSnapshot } from '@apollo-annotation/mst'
1
+ import type { SerializedChange } from '@apollo-annotation/common'
2
+ import type { CheckResultSnapshot } from '@apollo-annotation/mst'
3
3
 
4
4
  interface BaseMessage {
5
5
  channel: string
@@ -1,6 +1,6 @@
1
- import { GetAssembliesOperation } from './GetAssembliesOperation'
2
- import { GetFeaturesOperation } from './GetFeaturesOperation'
1
+ import { GetAssembliesOperation } from './GetAssembliesOperation.js'
2
+ import { GetFeaturesOperation } from './GetFeaturesOperation.js'
3
3
 
4
4
  export const operations = { GetAssembliesOperation, GetFeaturesOperation }
5
- export * from './GetAssembliesOperation'
6
- export * from './GetFeaturesOperation'
5
+ export * from './GetAssembliesOperation.js'
6
+ export * from './GetFeaturesOperation.js'
@@ -1,10 +1,10 @@
1
1
  /* eslint-disable @typescript-eslint/require-await */
2
- import { type Change } from '@apollo-annotation/common'
2
+ import type { Change } from '@apollo-annotation/common'
3
3
 
4
- import { type TypeChange } from '../Changes'
4
+ import type { TypeChange } from '../Changes/index.js'
5
5
 
6
- import { Validation } from './Validation'
7
- import soSequenceTypes from './soSequenceTypes'
6
+ import { Validation } from './Validation.js'
7
+ import soSequenceTypes from './soSequenceTypes.js'
8
8
 
9
9
  export function isTypeChange(thing: Change): thing is TypeChange {
10
10
  return 'oldType' in thing && 'newType' in thing
@@ -1,18 +1,18 @@
1
1
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
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'
3
+ import type { Change } from '@apollo-annotation/common'
4
+ import type { Feature, FeatureDocument } from '@apollo-annotation/schemas'
5
+ import type { ClientSession, Model } from 'mongoose'
6
6
 
7
7
  import {
8
8
  type LocationEndChange,
9
9
  type LocationStartChange,
10
10
  isLocationEndChange,
11
11
  isLocationStartChange,
12
- } from '../Changes'
13
- import { getPrintableId } from '../util'
12
+ } from '../Changes/index.js'
13
+ import { getPrintableId } from '../util.js'
14
14
 
15
- import { Validation, type ValidationResult } from './Validation'
15
+ import { Validation, type ValidationResult } from './Validation.js'
16
16
 
17
17
  export class ParentChildValidation extends Validation {
18
18
  name = 'ParentChildValidation' as const
@@ -1,10 +1,10 @@
1
1
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
2
  /* eslint-disable @typescript-eslint/require-await */
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'
3
+ import type { Change, 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, Model } from 'mongoose'
8
8
 
9
9
  export interface Context {
10
10
  context: ExecutionContext