jbrowse-plugin-protein3d 0.0.3 → 0.0.5

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 (196) hide show
  1. package/dist/AddHighlightModel/GenomeMouseoverHighlight.js +3 -9
  2. package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +1 -1
  3. package/dist/AddHighlightModel/HighlightComponents.d.ts +1 -2
  4. package/dist/AddHighlightModel/HighlightComponents.js.map +1 -1
  5. package/dist/AddHighlightModel/ProteinToGenomeClickHighlight.js +4 -3
  6. package/dist/AddHighlightModel/ProteinToGenomeClickHighlight.js.map +1 -1
  7. package/dist/AddHighlightModel/ProteinToGenomeHoverHighlight.d.ts +1 -2
  8. package/dist/AddHighlightModel/ProteinToGenomeHoverHighlight.js +4 -3
  9. package/dist/AddHighlightModel/ProteinToGenomeHoverHighlight.js.map +1 -1
  10. package/dist/AddHighlightModel/util.js +1 -1
  11. package/dist/AddHighlightModel/util.js.map +1 -1
  12. package/dist/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.d.ts +16 -0
  13. package/dist/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.js +43 -0
  14. package/dist/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.js.map +1 -0
  15. package/dist/AlphaFoldConfidenceAdapter/configSchema.d.ts +13 -0
  16. package/dist/AlphaFoldConfidenceAdapter/configSchema.js +16 -0
  17. package/dist/AlphaFoldConfidenceAdapter/configSchema.js.map +1 -0
  18. package/dist/AlphaFoldConfidenceAdapter/index.d.ts +2 -0
  19. package/dist/AlphaFoldConfidenceAdapter/index.js +11 -0
  20. package/dist/AlphaFoldConfidenceAdapter/index.js.map +1 -0
  21. package/dist/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.d.ts +30 -0
  22. package/dist/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.js +78 -0
  23. package/dist/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.js.map +1 -0
  24. package/dist/AlphaMissensePathogenicityAdapter/configSchema.d.ts +13 -0
  25. package/dist/AlphaMissensePathogenicityAdapter/configSchema.js +16 -0
  26. package/dist/AlphaMissensePathogenicityAdapter/configSchema.js.map +1 -0
  27. package/dist/AlphaMissensePathogenicityAdapter/index.d.ts +2 -0
  28. package/dist/AlphaMissensePathogenicityAdapter/index.js +11 -0
  29. package/dist/AlphaMissensePathogenicityAdapter/index.js.map +1 -0
  30. package/dist/LaunchProteinView/components/AlphaFoldDBSearch.js +162 -13
  31. package/dist/LaunchProteinView/components/AlphaFoldDBSearch.js.map +1 -1
  32. package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.js +8 -6
  33. package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.js.map +1 -1
  34. package/dist/LaunchProteinView/components/HelpButton.js +6 -2
  35. package/dist/LaunchProteinView/components/HelpButton.js.map +1 -1
  36. package/dist/LaunchProteinView/components/HelpDialog.js +3 -1
  37. package/dist/LaunchProteinView/components/HelpDialog.js.map +1 -1
  38. package/dist/LaunchProteinView/components/LaunchProteinViewDialog.js +12 -4
  39. package/dist/LaunchProteinView/components/LaunchProteinViewDialog.js.map +1 -1
  40. package/dist/LaunchProteinView/components/MSATable.js +3 -1
  41. package/dist/LaunchProteinView/components/MSATable.js.map +1 -1
  42. package/dist/LaunchProteinView/components/ManualUniProtIDEntry.d.ts +8 -0
  43. package/dist/LaunchProteinView/components/ManualUniProtIDEntry.js +225 -0
  44. package/dist/LaunchProteinView/components/ManualUniProtIDEntry.js.map +1 -0
  45. package/dist/LaunchProteinView/components/TranscriptSelector.js +3 -1
  46. package/dist/LaunchProteinView/components/TranscriptSelector.js.map +1 -1
  47. package/dist/LaunchProteinView/components/UserProvidedStructure.js +19 -12
  48. package/dist/LaunchProteinView/components/UserProvidedStructure.js.map +1 -1
  49. package/dist/LaunchProteinView/components/calculateProteinSequence.js +5 -3
  50. package/dist/LaunchProteinView/components/calculateProteinSequence.js.map +1 -1
  51. package/dist/LaunchProteinView/components/useLocalStructureFileSequence.d.ts +1 -1
  52. package/dist/LaunchProteinView/components/useLocalStructureFileSequence.js +29 -9
  53. package/dist/LaunchProteinView/components/useLocalStructureFileSequence.js.map +1 -1
  54. package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.d.ts +1 -1
  55. package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.js +25 -8
  56. package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.js.map +1 -1
  57. package/dist/LaunchProteinView/components/util.js +1 -1
  58. package/dist/LaunchProteinView/index.js +7 -3
  59. package/dist/LaunchProteinView/index.js.map +1 -1
  60. package/dist/ProteinView/{loadStructureFromData.d.ts → addStructureFromData.d.ts} +2 -2
  61. package/dist/ProteinView/{loadStructureFromData.js → addStructureFromData.js} +3 -8
  62. package/dist/ProteinView/addStructureFromData.js.map +1 -0
  63. package/dist/ProteinView/{loadStructureFromURL.d.ts → addStructureFromURL.d.ts} +2 -2
  64. package/dist/ProteinView/{loadStructureFromURL.js → addStructureFromURL.js} +11 -9
  65. package/dist/ProteinView/addStructureFromURL.js.map +1 -0
  66. package/dist/ProteinView/clearSelection.js +1 -1
  67. package/dist/ProteinView/clearSelection.js.map +1 -1
  68. package/dist/ProteinView/components/ProteinAlignment.d.ts +2 -2
  69. package/dist/ProteinView/components/ProteinAlignment.js +37 -26
  70. package/dist/ProteinView/components/ProteinAlignment.js.map +1 -1
  71. package/dist/ProteinView/components/ProteinAlignmentHelpButton.d.ts +2 -2
  72. package/dist/ProteinView/components/ProteinAlignmentHelpButton.js +6 -4
  73. package/dist/ProteinView/components/ProteinAlignmentHelpButton.js.map +1 -1
  74. package/dist/ProteinView/components/ProteinAlignmentHelpDialog.js +6 -5
  75. package/dist/ProteinView/components/ProteinAlignmentHelpDialog.js.map +1 -1
  76. package/dist/ProteinView/components/ProteinView.js +18 -60
  77. package/dist/ProteinView/components/ProteinView.js.map +1 -1
  78. package/dist/ProteinView/components/{Header.js → ProteinViewHeader.js} +29 -12
  79. package/dist/ProteinView/components/ProteinViewHeader.js.map +1 -0
  80. package/dist/ProteinView/components/SplitString.d.ts +4 -4
  81. package/dist/ProteinView/components/SplitString.js +3 -3
  82. package/dist/ProteinView/components/SplitString.js.map +1 -1
  83. package/dist/ProteinView/genomeToProtein.d.ts +2 -2
  84. package/dist/ProteinView/genomeToProtein.js +4 -5
  85. package/dist/ProteinView/genomeToProtein.js.map +1 -1
  86. package/dist/ProteinView/highlightResidue.js +2 -2
  87. package/dist/ProteinView/highlightResidue.js.map +1 -1
  88. package/dist/ProteinView/launchRemotePairwiseAlignment.d.ts +2 -5
  89. package/dist/ProteinView/launchRemotePairwiseAlignment.js +7 -3
  90. package/dist/ProteinView/launchRemotePairwiseAlignment.js.map +1 -1
  91. package/dist/ProteinView/model.d.ts +492 -160
  92. package/dist/ProteinView/model.js +62 -246
  93. package/dist/ProteinView/model.js.map +1 -1
  94. package/dist/ProteinView/proteinToGenomeMapping.d.ts +6 -6
  95. package/dist/ProteinView/proteinToGenomeMapping.js +29 -28
  96. package/dist/ProteinView/proteinToGenomeMapping.js.map +1 -1
  97. package/dist/ProteinView/selectResidue.js +1 -1
  98. package/dist/ProteinView/selectResidue.js.map +1 -1
  99. package/dist/ProteinView/structureModel.d.ts +183 -0
  100. package/dist/ProteinView/structureModel.js +407 -0
  101. package/dist/ProteinView/structureModel.js.map +1 -0
  102. package/dist/ProteinView/useProteinView.d.ts +1 -4
  103. package/dist/ProteinView/useProteinView.js +3 -15
  104. package/dist/ProteinView/useProteinView.js.map +1 -1
  105. package/dist/ProteinView/util.d.ts +3 -3
  106. package/dist/ProteinView/util.js +8 -6
  107. package/dist/ProteinView/util.js.map +1 -1
  108. package/dist/UniProtVariationAdapter/UniProtVariationAdapter.d.ts +15 -0
  109. package/dist/UniProtVariationAdapter/UniProtVariationAdapter.js +55 -0
  110. package/dist/UniProtVariationAdapter/UniProtVariationAdapter.js.map +1 -0
  111. package/dist/UniProtVariationAdapter/configSchema.d.ts +17 -0
  112. package/dist/UniProtVariationAdapter/configSchema.js +20 -0
  113. package/dist/UniProtVariationAdapter/configSchema.js.map +1 -0
  114. package/dist/UniProtVariationAdapter/index.d.ts +2 -0
  115. package/dist/UniProtVariationAdapter/index.js +11 -0
  116. package/dist/UniProtVariationAdapter/index.js.map +1 -0
  117. package/dist/genomeToTranscriptMapping.d.ts +2 -2
  118. package/dist/genomeToTranscriptMapping.js +3 -3
  119. package/dist/genomeToTranscriptMapping.js.map +1 -1
  120. package/dist/index.js +6 -0
  121. package/dist/index.js.map +1 -1
  122. package/dist/jbrowse-plugin-protein3d.umd.production.min.js +2506 -1658
  123. package/dist/jbrowse-plugin-protein3d.umd.production.min.js.map +4 -4
  124. package/dist/mappings.d.ts +12 -10
  125. package/dist/mappings.js +7 -7
  126. package/dist/mappings.js.map +1 -1
  127. package/dist/mappings.test.js +7 -5
  128. package/dist/mappings.test.js.map +1 -1
  129. package/dist/test_data/gene.d.ts +577 -64
  130. package/dist/test_data/gene.js +1 -1
  131. package/dist/test_data/gene.js.map +1 -1
  132. package/package.json +20 -19
  133. package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +4 -17
  134. package/src/AddHighlightModel/HighlightComponents.tsx +1 -3
  135. package/src/AddHighlightModel/ProteinToGenomeClickHighlight.tsx +17 -14
  136. package/src/AddHighlightModel/ProteinToGenomeHoverHighlight.tsx +18 -17
  137. package/src/AddHighlightModel/util.ts +1 -1
  138. package/src/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.ts +63 -0
  139. package/src/AlphaFoldConfidenceAdapter/configSchema.ts +21 -0
  140. package/src/AlphaFoldConfidenceAdapter/index.ts +19 -0
  141. package/src/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.ts +109 -0
  142. package/src/AlphaMissensePathogenicityAdapter/configSchema.ts +21 -0
  143. package/src/AlphaMissensePathogenicityAdapter/index.ts +19 -0
  144. package/src/LaunchProteinView/components/AlphaFoldDBSearch.tsx +173 -12
  145. package/src/LaunchProteinView/components/AlphaFoldDBSearchStatus.tsx +8 -6
  146. package/src/LaunchProteinView/components/HelpButton.tsx +10 -2
  147. package/src/LaunchProteinView/components/HelpDialog.tsx +6 -1
  148. package/src/LaunchProteinView/components/LaunchProteinViewDialog.tsx +20 -4
  149. package/src/LaunchProteinView/components/MSATable.tsx +3 -1
  150. package/src/LaunchProteinView/components/ManualUniProtIDEntry.tsx +332 -0
  151. package/src/LaunchProteinView/components/TranscriptSelector.tsx +9 -7
  152. package/src/LaunchProteinView/components/UserProvidedStructure.tsx +18 -13
  153. package/src/LaunchProteinView/components/calculateProteinSequence.ts +6 -4
  154. package/src/LaunchProteinView/components/useLocalStructureFileSequence.ts +28 -9
  155. package/src/LaunchProteinView/components/useRemoteStructureFileSequence.ts +23 -8
  156. package/src/LaunchProteinView/components/util.ts +1 -1
  157. package/src/LaunchProteinView/index.ts +36 -26
  158. package/src/ProteinView/{loadStructureFromData.ts → addStructureFromData.ts} +2 -8
  159. package/src/ProteinView/{loadStructureFromURL.ts → addStructureFromURL.ts} +11 -11
  160. package/src/ProteinView/clearSelection.ts +1 -1
  161. package/src/ProteinView/components/ProteinAlignment.tsx +51 -35
  162. package/src/ProteinView/components/ProteinAlignmentHelpButton.tsx +4 -4
  163. package/src/ProteinView/components/ProteinAlignmentHelpDialog.tsx +15 -11
  164. package/src/ProteinView/components/ProteinView.tsx +22 -82
  165. package/src/ProteinView/components/{Header.tsx → ProteinViewHeader.tsx} +44 -23
  166. package/src/ProteinView/components/SplitString.tsx +8 -8
  167. package/src/ProteinView/genomeToProtein.ts +5 -9
  168. package/src/ProteinView/highlightResidue.ts +2 -2
  169. package/src/ProteinView/launchRemotePairwiseAlignment.ts +6 -3
  170. package/src/ProteinView/model.ts +75 -287
  171. package/src/ProteinView/proteinToGenomeMapping.ts +40 -38
  172. package/src/ProteinView/selectResidue.ts +1 -1
  173. package/src/ProteinView/structureModel.ts +512 -0
  174. package/src/ProteinView/useProteinView.ts +2 -19
  175. package/src/ProteinView/util.ts +20 -9
  176. package/src/UniProtVariationAdapter/UniProtVariationAdapter.ts +99 -0
  177. package/src/UniProtVariationAdapter/configSchema.ts +25 -0
  178. package/src/UniProtVariationAdapter/index.ts +17 -0
  179. package/src/__snapshots__/mappings.test.ts.snap +224 -224
  180. package/src/genomeToTranscriptMapping.ts +9 -9
  181. package/src/index.ts +6 -0
  182. package/src/mappings.test.ts +7 -5
  183. package/src/mappings.ts +25 -23
  184. package/src/test_data/gene.ts +3 -3
  185. package/dist/ProteinView/components/Header.js.map +0 -1
  186. package/dist/ProteinView/loadStructureFromData.js.map +0 -1
  187. package/dist/ProteinView/loadStructureFromURL.js.map +0 -1
  188. package/dist/ProteinView/useProteinViewClickBehavior.d.ts +0 -8
  189. package/dist/ProteinView/useProteinViewClickBehavior.js +0 -34
  190. package/dist/ProteinView/useProteinViewClickBehavior.js.map +0 -1
  191. package/dist/ProteinView/useProteinViewHoverBehavior.d.ts +0 -6
  192. package/dist/ProteinView/useProteinViewHoverBehavior.js +0 -31
  193. package/dist/ProteinView/useProteinViewHoverBehavior.js.map +0 -1
  194. package/src/ProteinView/useProteinViewClickBehavior.ts +0 -48
  195. package/src/ProteinView/useProteinViewHoverBehavior.ts +0 -44
  196. /package/dist/ProteinView/components/{Header.d.ts → ProteinViewHeader.d.ts} +0 -0
@@ -5,7 +5,10 @@ import { proteinAbbreviationMapping } from './proteinAbbreviationMapping'
5
5
 
6
6
  export function checkHovered(hovered: unknown): hovered is {
7
7
  hoverFeature: Feature
8
- hoverPosition: { coord: number; refName: string }
8
+ hoverPosition: {
9
+ coord: number
10
+ refName: string
11
+ }
9
12
  } {
10
13
  return (
11
14
  !!hovered &&
@@ -35,22 +38,30 @@ export function getMolstarStructureSelection({
35
38
  )
36
39
  }
37
40
 
38
- export function toStr(r: {
39
- structureSeqPos: number
41
+ export function toStr({
42
+ chain,
43
+ code,
44
+ structureSeqPos,
45
+ }: {
46
+ structureSeqPos?: number
40
47
  code?: string
41
48
  chain?: string
42
49
  }) {
43
50
  return [
44
- `Position: ${r.structureSeqPos}`,
45
- r.code
46
- ? `Letter: ${r.code} (${proteinAbbreviationMapping[r.code]?.singleLetterCode})`
51
+ structureSeqPos === undefined ? '' : `Position: ${structureSeqPos}`,
52
+ code
53
+ ? `Letter: ${code} (${proteinAbbreviationMapping[code]?.singleLetterCode})`
47
54
  : '',
48
- r.chain ? `Chain: ${r.chain}` : '',
55
+ chain ? `Chain: ${chain}` : '',
49
56
  ]
50
57
  .filter(f => !!f)
51
58
  .join(', ')
52
59
  }
53
60
 
54
- export function invertMap(arg: Record<number, number | undefined>) {
55
- return Object.fromEntries(Object.entries(arg).map(([a, b]) => [b, a]))
61
+ export function invertMap(arg: Record<number, number>): Record<number, number> {
62
+ return Object.fromEntries(
63
+ Object.entries(arg)
64
+ .map(([a, b]) => [b, +a])
65
+ .filter(f => f[0] !== undefined),
66
+ )
56
67
  }
@@ -0,0 +1,99 @@
1
+ import {
2
+ BaseFeatureDataAdapter,
3
+ BaseOptions,
4
+ } from '@jbrowse/core/data_adapters/BaseAdapter'
5
+ import { openLocation } from '@jbrowse/core/util/io'
6
+ import { ObservableCreate } from '@jbrowse/core/util/rxjs'
7
+ import {
8
+ Region,
9
+ Feature,
10
+ doesIntersect2,
11
+ SimpleFeature,
12
+ } from '@jbrowse/core/util'
13
+
14
+ interface UniProtVariantFeature {
15
+ begin: string
16
+ end: string
17
+ wildType: string
18
+ mutatedType: string
19
+ xrefs: {
20
+ name: string
21
+ id: string
22
+ url: string
23
+ alternativeUrl: string
24
+ }[]
25
+ predictions?: {
26
+ score: number
27
+ }[]
28
+ descriptions?: {
29
+ value: string
30
+ }[]
31
+ populationFrequencies?: {
32
+ frequency?: number
33
+ }[]
34
+ }
35
+
36
+ export default class UniProtVariationAdapter extends BaseFeatureDataAdapter {
37
+ public static capabilities = ['getFeatures', 'getRefNames']
38
+
39
+ public feats:
40
+ | Promise<{ uniqueId: string; start: number; end: number }[]>
41
+ | undefined
42
+
43
+ private async loadDataP() {
44
+ const { features } = JSON.parse(
45
+ await openLocation(this.getConf('location')).readFile('utf8'),
46
+ ) as { features: UniProtVariantFeature[] }
47
+
48
+ const scoreField = this.getConf('scoreField')
49
+
50
+ return features.map(({ begin, end, ...rest }, idx) => ({
51
+ ...rest,
52
+ uniqueId: `feat-${idx}`,
53
+ start: +begin,
54
+ end: +end + 1,
55
+ score:
56
+ scoreField === 'population_frequency'
57
+ ? rest.populationFrequencies?.[0]?.frequency
58
+ : scoreField === 'variant_impact_score'
59
+ ? rest.predictions?.[0]?.score
60
+ : undefined,
61
+ description: rest.descriptions?.map(d => d.value).join(','),
62
+ name: [
63
+ rest.mutatedType
64
+ ? `${rest.wildType}->${rest.mutatedType}`
65
+ : `${rest.wildType}->del`,
66
+ ],
67
+ }))
68
+ }
69
+
70
+ private async loadData(_opts: BaseOptions = {}) {
71
+ if (!this.feats) {
72
+ this.feats = this.loadDataP().catch((e: unknown) => {
73
+ this.feats = undefined
74
+ throw e
75
+ })
76
+ }
77
+
78
+ return this.feats
79
+ }
80
+
81
+ public async getRefNames(_opts: BaseOptions = {}) {
82
+ return []
83
+ }
84
+
85
+ public getFeatures(query: Region, opts: BaseOptions = {}) {
86
+ return ObservableCreate<Feature>(async observer => {
87
+ const { start, end, refName } = query
88
+ const data = await this.loadData()
89
+ for (const f of data) {
90
+ if (doesIntersect2(f.start, f.end, start, end)) {
91
+ observer.next(new SimpleFeature({ ...f, refName }))
92
+ }
93
+ }
94
+ observer.complete()
95
+ }, opts.signal)
96
+ }
97
+
98
+ public freeResources(): void {}
99
+ }
@@ -0,0 +1,25 @@
1
+ import { ConfigurationSchema } from '@jbrowse/core/configuration'
2
+
3
+ /**
4
+ * #config UniProtVariationAdapter
5
+ */
6
+ function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
7
+
8
+ const UniProtVariationAdapter = ConfigurationSchema(
9
+ 'UniProtVariationAdapter',
10
+ {
11
+ /**
12
+ * #slot
13
+ */
14
+ location: {
15
+ type: 'fileLocation',
16
+ defaultValue: { uri: '/path/to/my.bed.gz', locationType: 'UriLocation' },
17
+ },
18
+ scoreField: {
19
+ type: 'string',
20
+ defaultValue: '',
21
+ },
22
+ },
23
+ { explicitlyTyped: true },
24
+ )
25
+ export default UniProtVariationAdapter
@@ -0,0 +1,17 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager'
2
+ import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'
3
+
4
+ import configSchema from './configSchema'
5
+
6
+ export default function UniProtVariationAdapterF(pluginManager: PluginManager) {
7
+ pluginManager.addAdapterType(
8
+ () =>
9
+ new AdapterType({
10
+ name: 'UniProtVariationAdapter',
11
+ displayName: 'UniProtVariation adapter',
12
+ configSchema,
13
+ getAdapterClass: () =>
14
+ import('./UniProtVariationAdapter').then(r => r.default),
15
+ }),
16
+ )
17
+ }
@@ -1,4 +1,4 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
3
  exports[`mapping 1`] = `
4
4
  {
@@ -902,229 +902,6 @@ exports[`mapping 1`] = `
902
902
  exports[`test 1`] = `
903
903
  {
904
904
  "structureSeqToTranscriptSeqPosition": {
905
- "392": 0,
906
- "393": 1,
907
- "394": 2,
908
- "395": 3,
909
- "396": 4,
910
- "397": 5,
911
- "398": 6,
912
- "399": 7,
913
- "400": 8,
914
- "401": 9,
915
- "402": 10,
916
- "403": 11,
917
- "404": 12,
918
- "405": 13,
919
- "406": 14,
920
- "407": 15,
921
- "408": 16,
922
- "409": 17,
923
- "410": 18,
924
- "411": 19,
925
- "412": 20,
926
- "413": 21,
927
- "414": 22,
928
- "415": 23,
929
- "416": 24,
930
- "417": 25,
931
- "418": 26,
932
- "419": 27,
933
- "420": 28,
934
- "421": 29,
935
- "422": 30,
936
- "423": 31,
937
- "424": 32,
938
- "425": 33,
939
- "426": 34,
940
- "427": 35,
941
- "428": 36,
942
- "429": 37,
943
- "430": 38,
944
- "431": 39,
945
- "432": 40,
946
- "433": 41,
947
- "434": 42,
948
- "435": 43,
949
- "436": 44,
950
- "437": 45,
951
- "438": 46,
952
- "439": 47,
953
- "440": 48,
954
- "441": 49,
955
- "442": 50,
956
- "443": 51,
957
- "444": 52,
958
- "445": 53,
959
- "446": 54,
960
- "447": 55,
961
- "448": 56,
962
- "449": 57,
963
- "450": 58,
964
- "451": 59,
965
- "452": 60,
966
- "453": 61,
967
- "454": 62,
968
- "455": 63,
969
- "456": 64,
970
- "457": 65,
971
- "458": 66,
972
- "459": 67,
973
- "460": 68,
974
- "461": 69,
975
- "462": 70,
976
- "463": 71,
977
- "464": 72,
978
- "465": 73,
979
- "466": 74,
980
- "467": 75,
981
- "468": 76,
982
- "469": 77,
983
- "470": 78,
984
- "471": 79,
985
- "472": 80,
986
- "473": 81,
987
- "474": 82,
988
- "475": 83,
989
- "476": 84,
990
- "477": 85,
991
- "478": 86,
992
- "479": 87,
993
- "480": 88,
994
- "481": 89,
995
- "482": 90,
996
- "483": 91,
997
- "484": 92,
998
- "485": 93,
999
- "486": 94,
1000
- "487": 95,
1001
- "488": 96,
1002
- "489": 97,
1003
- "490": 98,
1004
- "491": 99,
1005
- "492": 100,
1006
- "493": 101,
1007
- "494": 102,
1008
- "495": 103,
1009
- "496": 104,
1010
- "497": 105,
1011
- "498": 106,
1012
- "499": 107,
1013
- "500": 108,
1014
- "501": 109,
1015
- "502": 110,
1016
- "503": 111,
1017
- "504": 112,
1018
- "505": 113,
1019
- "506": 114,
1020
- "507": 115,
1021
- "508": 116,
1022
- "509": 117,
1023
- "510": 118,
1024
- "511": 119,
1025
- "512": 120,
1026
- "513": 121,
1027
- "514": 122,
1028
- "515": 123,
1029
- "516": 124,
1030
- "517": 125,
1031
- "518": 126,
1032
- "519": 127,
1033
- "520": 128,
1034
- "521": 129,
1035
- "522": 130,
1036
- "523": 131,
1037
- "524": 132,
1038
- "525": 133,
1039
- "526": 134,
1040
- "527": 135,
1041
- "528": 136,
1042
- "529": 137,
1043
- "530": 138,
1044
- "531": 139,
1045
- "532": 140,
1046
- "533": 141,
1047
- "534": 142,
1048
- "535": 143,
1049
- "536": 144,
1050
- "537": 145,
1051
- "538": 146,
1052
- "539": 147,
1053
- "540": 148,
1054
- "541": 149,
1055
- "542": 150,
1056
- "543": 151,
1057
- "544": 152,
1058
- "545": 153,
1059
- "546": 154,
1060
- "547": 155,
1061
- "548": 156,
1062
- "549": 157,
1063
- "550": 158,
1064
- "551": 159,
1065
- "552": 160,
1066
- "553": 161,
1067
- "554": 162,
1068
- "555": 163,
1069
- "556": 164,
1070
- "557": 165,
1071
- "558": 166,
1072
- "559": 167,
1073
- "560": 168,
1074
- "561": 169,
1075
- "562": 170,
1076
- "563": 171,
1077
- "564": 172,
1078
- "565": 173,
1079
- "566": 174,
1080
- "567": 175,
1081
- "568": 176,
1082
- "569": 177,
1083
- "570": 178,
1084
- "571": 179,
1085
- "572": 180,
1086
- "573": 181,
1087
- "574": 182,
1088
- "575": 183,
1089
- "576": 184,
1090
- "577": 185,
1091
- "578": 186,
1092
- "579": 187,
1093
- "580": 188,
1094
- "581": 189,
1095
- "582": 190,
1096
- "583": 191,
1097
- "584": 192,
1098
- "585": 193,
1099
- "586": 194,
1100
- "587": 195,
1101
- "588": 196,
1102
- "589": 197,
1103
- "590": 198,
1104
- "591": 199,
1105
- "592": 200,
1106
- "593": 201,
1107
- "594": 202,
1108
- "595": 203,
1109
- "596": 204,
1110
- "597": 205,
1111
- "598": 206,
1112
- "599": 207,
1113
- "600": 208,
1114
- "601": 209,
1115
- "602": 210,
1116
- "603": 211,
1117
- "604": 212,
1118
- "605": 213,
1119
- "606": 214,
1120
- "607": 215,
1121
- "608": 216,
1122
- "609": 217,
1123
- "610": 218,
1124
- "611": 219,
1125
- "612": 220,
1126
- },
1127
- "transcriptSeqToStructureSeqPosition": {
1128
905
  "0": 392,
1129
906
  "1": 393,
1130
907
  "10": 402,
@@ -1347,5 +1124,228 @@ exports[`test 1`] = `
1347
1124
  "98": 490,
1348
1125
  "99": 491,
1349
1126
  },
1127
+ "transcriptSeqToStructureSeqPosition": {
1128
+ "392": 0,
1129
+ "393": 1,
1130
+ "394": 2,
1131
+ "395": 3,
1132
+ "396": 4,
1133
+ "397": 5,
1134
+ "398": 6,
1135
+ "399": 7,
1136
+ "400": 8,
1137
+ "401": 9,
1138
+ "402": 10,
1139
+ "403": 11,
1140
+ "404": 12,
1141
+ "405": 13,
1142
+ "406": 14,
1143
+ "407": 15,
1144
+ "408": 16,
1145
+ "409": 17,
1146
+ "410": 18,
1147
+ "411": 19,
1148
+ "412": 20,
1149
+ "413": 21,
1150
+ "414": 22,
1151
+ "415": 23,
1152
+ "416": 24,
1153
+ "417": 25,
1154
+ "418": 26,
1155
+ "419": 27,
1156
+ "420": 28,
1157
+ "421": 29,
1158
+ "422": 30,
1159
+ "423": 31,
1160
+ "424": 32,
1161
+ "425": 33,
1162
+ "426": 34,
1163
+ "427": 35,
1164
+ "428": 36,
1165
+ "429": 37,
1166
+ "430": 38,
1167
+ "431": 39,
1168
+ "432": 40,
1169
+ "433": 41,
1170
+ "434": 42,
1171
+ "435": 43,
1172
+ "436": 44,
1173
+ "437": 45,
1174
+ "438": 46,
1175
+ "439": 47,
1176
+ "440": 48,
1177
+ "441": 49,
1178
+ "442": 50,
1179
+ "443": 51,
1180
+ "444": 52,
1181
+ "445": 53,
1182
+ "446": 54,
1183
+ "447": 55,
1184
+ "448": 56,
1185
+ "449": 57,
1186
+ "450": 58,
1187
+ "451": 59,
1188
+ "452": 60,
1189
+ "453": 61,
1190
+ "454": 62,
1191
+ "455": 63,
1192
+ "456": 64,
1193
+ "457": 65,
1194
+ "458": 66,
1195
+ "459": 67,
1196
+ "460": 68,
1197
+ "461": 69,
1198
+ "462": 70,
1199
+ "463": 71,
1200
+ "464": 72,
1201
+ "465": 73,
1202
+ "466": 74,
1203
+ "467": 75,
1204
+ "468": 76,
1205
+ "469": 77,
1206
+ "470": 78,
1207
+ "471": 79,
1208
+ "472": 80,
1209
+ "473": 81,
1210
+ "474": 82,
1211
+ "475": 83,
1212
+ "476": 84,
1213
+ "477": 85,
1214
+ "478": 86,
1215
+ "479": 87,
1216
+ "480": 88,
1217
+ "481": 89,
1218
+ "482": 90,
1219
+ "483": 91,
1220
+ "484": 92,
1221
+ "485": 93,
1222
+ "486": 94,
1223
+ "487": 95,
1224
+ "488": 96,
1225
+ "489": 97,
1226
+ "490": 98,
1227
+ "491": 99,
1228
+ "492": 100,
1229
+ "493": 101,
1230
+ "494": 102,
1231
+ "495": 103,
1232
+ "496": 104,
1233
+ "497": 105,
1234
+ "498": 106,
1235
+ "499": 107,
1236
+ "500": 108,
1237
+ "501": 109,
1238
+ "502": 110,
1239
+ "503": 111,
1240
+ "504": 112,
1241
+ "505": 113,
1242
+ "506": 114,
1243
+ "507": 115,
1244
+ "508": 116,
1245
+ "509": 117,
1246
+ "510": 118,
1247
+ "511": 119,
1248
+ "512": 120,
1249
+ "513": 121,
1250
+ "514": 122,
1251
+ "515": 123,
1252
+ "516": 124,
1253
+ "517": 125,
1254
+ "518": 126,
1255
+ "519": 127,
1256
+ "520": 128,
1257
+ "521": 129,
1258
+ "522": 130,
1259
+ "523": 131,
1260
+ "524": 132,
1261
+ "525": 133,
1262
+ "526": 134,
1263
+ "527": 135,
1264
+ "528": 136,
1265
+ "529": 137,
1266
+ "530": 138,
1267
+ "531": 139,
1268
+ "532": 140,
1269
+ "533": 141,
1270
+ "534": 142,
1271
+ "535": 143,
1272
+ "536": 144,
1273
+ "537": 145,
1274
+ "538": 146,
1275
+ "539": 147,
1276
+ "540": 148,
1277
+ "541": 149,
1278
+ "542": 150,
1279
+ "543": 151,
1280
+ "544": 152,
1281
+ "545": 153,
1282
+ "546": 154,
1283
+ "547": 155,
1284
+ "548": 156,
1285
+ "549": 157,
1286
+ "550": 158,
1287
+ "551": 159,
1288
+ "552": 160,
1289
+ "553": 161,
1290
+ "554": 162,
1291
+ "555": 163,
1292
+ "556": 164,
1293
+ "557": 165,
1294
+ "558": 166,
1295
+ "559": 167,
1296
+ "560": 168,
1297
+ "561": 169,
1298
+ "562": 170,
1299
+ "563": 171,
1300
+ "564": 172,
1301
+ "565": 173,
1302
+ "566": 174,
1303
+ "567": 175,
1304
+ "568": 176,
1305
+ "569": 177,
1306
+ "570": 178,
1307
+ "571": 179,
1308
+ "572": 180,
1309
+ "573": 181,
1310
+ "574": 182,
1311
+ "575": 183,
1312
+ "576": 184,
1313
+ "577": 185,
1314
+ "578": 186,
1315
+ "579": 187,
1316
+ "580": 188,
1317
+ "581": 189,
1318
+ "582": 190,
1319
+ "583": 191,
1320
+ "584": 192,
1321
+ "585": 193,
1322
+ "586": 194,
1323
+ "587": 195,
1324
+ "588": 196,
1325
+ "589": 197,
1326
+ "590": 198,
1327
+ "591": 199,
1328
+ "592": 200,
1329
+ "593": 201,
1330
+ "594": 202,
1331
+ "595": 203,
1332
+ "596": 204,
1333
+ "597": 205,
1334
+ "598": 206,
1335
+ "599": 207,
1336
+ "600": 208,
1337
+ "601": 209,
1338
+ "602": 210,
1339
+ "603": 211,
1340
+ "604": 212,
1341
+ "605": 213,
1342
+ "606": 214,
1343
+ "607": 215,
1344
+ "608": 216,
1345
+ "609": 217,
1346
+ "610": 218,
1347
+ "611": 219,
1348
+ "612": 220,
1349
+ },
1350
1350
  }
1351
1351
  `;
@@ -8,16 +8,16 @@ export function genomeToTranscriptMapping(feature: Feature) {
8
8
  const cds = subs
9
9
  .filter(f => f.get('type') === 'CDS')
10
10
  .sort((a, b) => strand * (a.get('start') - b.get('start')))
11
- const g2p = {} as Record<number, number | undefined>
12
- const p2g = {} as Record<number, number | undefined>
11
+ const g2p = {} as Record<number, number>
12
+ const p2g = {} as Record<number, number>
13
13
 
14
14
  let proteinCounter = 0
15
- if (strand !== -1) {
15
+ if (strand === -1) {
16
16
  for (const f of cds) {
17
17
  for (
18
- let genomePos = f.get('start');
19
- genomePos < f.get('end');
20
- genomePos++
18
+ let genomePos = f.get('end');
19
+ genomePos > f.get('start');
20
+ genomePos--
21
21
  ) {
22
22
  const proteinPos = Math.floor(proteinCounter++ / 3)
23
23
  g2p[genomePos] = proteinPos
@@ -29,9 +29,9 @@ export function genomeToTranscriptMapping(feature: Feature) {
29
29
  } else {
30
30
  for (const f of cds) {
31
31
  for (
32
- let genomePos = f.get('end');
33
- genomePos > f.get('start');
34
- genomePos--
32
+ let genomePos = f.get('start');
33
+ genomePos < f.get('end');
34
+ genomePos++
35
35
  ) {
36
36
  const proteinPos = Math.floor(proteinCounter++ / 3)
37
37
  g2p[genomePos] = proteinPos
package/src/index.ts CHANGED
@@ -6,6 +6,9 @@ import { version } from '../package.json'
6
6
  import ProteinViewF from './ProteinView'
7
7
  import LaunchProteinViewF from './LaunchProteinView'
8
8
  import AddHighlightModelF from './AddHighlightModel'
9
+ import AlphaFoldConfidenceAdapterF from './AlphaFoldConfidenceAdapter'
10
+ import UniProtVariationAdapterF from './UniProtVariationAdapter'
11
+ import AlphaMissensePathogenicityAdapterF from './AlphaMissensePathogenicityAdapter'
9
12
 
10
13
  export default class ProteinViewer extends Plugin {
11
14
  name = 'ProteinViewer'
@@ -15,6 +18,9 @@ export default class ProteinViewer extends Plugin {
15
18
  ProteinViewF(pluginManager)
16
19
  LaunchProteinViewF(pluginManager)
17
20
  AddHighlightModelF(pluginManager)
21
+ AlphaFoldConfidenceAdapterF(pluginManager)
22
+ AlphaMissensePathogenicityAdapterF(pluginManager)
23
+ UniProtVariationAdapterF(pluginManager)
18
24
  }
19
25
 
20
26
  configure(_pluginManager: PluginManager) {}