@apollo-annotation/jbrowse-plugin-apollo 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo-annotation/jbrowse-plugin-apollo",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Apollo plugin for JBrowse 2",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -46,9 +46,9 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@apollo-annotation/common": "^1.1.0",
50
- "@apollo-annotation/mst": "^1.1.0",
51
- "@apollo-annotation/shared": "^1.1.0",
49
+ "@apollo-annotation/common": "^1.1.2",
50
+ "@apollo-annotation/mst": "^1.1.2",
51
+ "@apollo-annotation/shared": "^1.1.2",
52
52
  "@emotion/react": "^11.10.6",
53
53
  "@emotion/styled": "^11.10.6",
54
54
  "@gmod/gff": "^2.1.0",
@@ -157,7 +157,15 @@ export function Translation({
157
157
 
158
158
  // Trim any sequence before first start codon and after stop codon
159
159
  const startCodonIndex = proteinSequence.indexOf('M')
160
- const stopCodonIndex = proteinSequence.lastIndexOf('*')
160
+ if (startCodonIndex === -1) {
161
+ notify('Start codon not found', 'error')
162
+ return
163
+ }
164
+ const stopCodonIndex = proteinSequence.indexOf('*', startCodonIndex)
165
+ if (stopCodonIndex === -1) {
166
+ notify('Stop codon not found', 'error')
167
+ return
168
+ }
161
169
 
162
170
  const startCodonPos = startCodonIndex * 3
163
171
  const stopCodonPos = stopCodonIndex * 3
@@ -190,7 +190,10 @@ export function CreateApolloAnnotation({
190
190
  assembly.name,
191
191
  )
192
192
  const refSeq = apolloAssembly?.refSeqs.get(refSeqId)
193
- const features = refSeq?.getFeatures(region.start, region.end)
193
+ const features = useMemo(
194
+ () => refSeq?.getFeatures(region.start, region.end),
195
+ [refSeq, region.start, region.end],
196
+ )
194
197
 
195
198
  useEffect(() => {
196
199
  const getDestinationFeatures = () => {