@@ -110,19 +110,22 @@ function draw(
110110 topLevelFeatureHeight ,
111111 )
112112
113- // Draw lines on different rows for each mRNA
113+ // Draw lines on different rows for each transcript
114114 let currentRow = 0
115- for ( const [ , mrna ] of children ) {
116- const isMrna = featureTypeOntology . isTypeOf ( mrna . type , 'mRNA' )
117- if ( ! isMrna ) {
115+ for ( const [ , transcript ] of children ) {
116+ const isTranscript = featureTypeOntology . isTypeOf (
117+ transcript . type ,
118+ 'transcript' ,
119+ )
120+ if ( ! isTranscript ) {
118121 currentRow += 1
119122 continue
120123 }
121- const { children : childrenOfmRNA , min } = mrna
122- if ( ! childrenOfmRNA ) {
124+ const { children : childrenOfTranscript , min } = transcript
125+ if ( ! childrenOfTranscript ) {
123126 continue
124127 }
125- for ( const [ , cds ] of childrenOfmRNA ) {
128+ for ( const [ , cds ] of childrenOfTranscript ) {
126129 if ( ! featureTypeOntology . isTypeOf ( cds . type , 'CDS' ) ) {
127130 continue
128131 }
@@ -132,7 +135,7 @@ function draw(
132135 coord : min ,
133136 regionNumber : displayedRegionIndex ,
134137 } ) ?. offsetPx ?? 0 ) - offsetPx
135- const widthPx = mrna . length / bpPerPx
138+ const widthPx = transcript . length / bpPerPx
136139 const startPx = reversed ? minX - widthPx : minX
137140 const height =
138141 Math . round ( ( currentRow + 1 / 2 ) * rowHeight ) + row * rowHeight
@@ -149,20 +152,20 @@ function draw(
149152 theme ?. palette . mode === 'dark' ? forwardFillDark : forwardFillLight
150153 const backwardFill =
151154 theme ?. palette . mode === 'dark' ? backwardFillDark : backwardFillLight
152- // Draw exon and CDS for each mRNA
155+ // Draw exon and CDS for each transcript
153156 currentRow = 0
154157 for ( const [ , child ] of children ) {
155- if ( ! featureTypeOntology . isTypeOf ( child . type , 'mRNA ' ) ) {
158+ if ( ! featureTypeOntology . isTypeOf ( child . type , 'transcript ' ) ) {
156159 boxGlyph . draw ( ctx , child , row , stateModel , displayedRegionIndex )
157160 currentRow += 1
158161 continue
159162 }
160163 for ( const cdsRow of child . cdsLocations ) {
161- const { _id, children : childrenOfmRNA } = child
162- if ( ! childrenOfmRNA ) {
164+ const { _id, children : childrenOfTranscript } = child
165+ if ( ! childrenOfTranscript ) {
163166 continue
164167 }
165- for ( const [ , exon ] of childrenOfmRNA ) {
168+ for ( const [ , exon ] of childrenOfTranscript ) {
166169 if ( ! featureTypeOntology . isTypeOf ( exon . type , 'exon' ) ) {
167170 continue
168171 }
@@ -361,7 +364,7 @@ function getFeatureFromLayout(
361364 if (
362365 featureTypeOntology . isTypeOf ( featureObj . type , 'CDS' ) &&
363366 featureObj . parent &&
364- featureTypeOntology . isTypeOf ( featureObj . parent . type , 'mRNA ' )
367+ featureTypeOntology . isTypeOf ( featureObj . parent . type , 'transcript ' )
365368 ) {
366369 const { cdsLocations } = featureObj . parent
367370 for ( const cdsLoc of cdsLocations ) {
@@ -372,7 +375,7 @@ function getFeatureFromLayout(
372375 }
373376 }
374377
375- // If mouse position is in the intron region, return the mRNA
378+ // If mouse position is in the intron region, return the transcript
376379 return featureObj . parent
377380 }
378381 // If mouse position is in a feature that is not a CDS, return the feature
@@ -390,9 +393,9 @@ function getRowCount(
390393 if ( ! children ) {
391394 return 1
392395 }
393- const isMrna = featureTypeOntology . isTypeOf ( type , 'mRNA ' )
396+ const isTranscript = featureTypeOntology . isTypeOf ( type , 'transcript ' )
394397 let rowCount = 0
395- if ( isMrna ) {
398+ if ( isTranscript ) {
396399 for ( const [ , child ] of children ) {
397400 const isCds = featureTypeOntology . isTypeOf ( child . type , 'CDS' )
398401 if ( isCds ) {
@@ -410,8 +413,8 @@ function getRowCount(
410413/**
411414 * A list of all the subfeatures for each row for a given feature, as well as
412415 * the feature itself.
413- * If the row contains an mRNA , the order is CDS -\> exon -\> mRNA -\> gene
414- * If the row does not contain an mRNA , the order is subfeature -\> gene
416+ * If the row contains a transcript , the order is CDS -\> exon -\> transcript -\> gene
417+ * If the row does not contain an transcript , the order is subfeature -\> gene
415418 */
416419function featuresForRow (
417420 feature : AnnotationFeature ,
@@ -427,7 +430,7 @@ function featuresForRow(
427430 }
428431 const features : AnnotationFeature [ ] [ ] = [ ]
429432 for ( const [ , child ] of children ) {
430- if ( ! featureTypeOntology . isTypeOf ( child . type , 'mRNA ' ) ) {
433+ if ( ! featureTypeOntology . isTypeOf ( child . type , 'transcript ' ) ) {
431434 features . push ( [ child , feature ] )
432435 continue
433436 }
@@ -534,9 +537,9 @@ function getDraggableFeatureInfo(
534537 throw new Error ( 'featureTypeOntology is undefined' )
535538 }
536539 const isGene = featureTypeOntology . isTypeOf ( feature . type , 'gene' )
537- const isMrna = featureTypeOntology . isTypeOf ( feature . type , 'mRNA ' )
540+ const isTranscript = featureTypeOntology . isTypeOf ( feature . type , 'transcript ' )
538541 const isCds = featureTypeOntology . isTypeOf ( feature . type , 'CDS' )
539- if ( isGene || isMrna ) {
542+ if ( isGene || isTranscript ) {
540543 return
541544 }
542545 const { bp, refName, regionNumber, x } = mousePosition
@@ -560,12 +563,12 @@ function getDraggableFeatureInfo(
560563 return { feature, edge : 'max' }
561564 }
562565 if ( isCds ) {
563- const mRNA = feature . parent
564- if ( ! mRNA ?. children ) {
566+ const transcript = feature . parent
567+ if ( ! transcript ?. children ) {
565568 return
566569 }
567570 const exonChildren : AnnotationFeature [ ] = [ ]
568- for ( const child of mRNA . children . values ( ) ) {
571+ for ( const child of transcript . children . values ( ) ) {
569572 const childIsExon = featureTypeOntology . isTypeOf ( child . type , 'exon' )
570573 if ( childIsExon ) {
571574 exonChildren . push ( child )
0 commit comments