@@ -28,8 +28,6 @@ import {
28
28
getOrganismId ,
29
29
} from "../../../../apis/catalog/brc-analytics-catalog/common/utils" ;
30
30
import { COLUMN_IDENTIFIER } from "@databiosphere/findable-ui/lib/components/Table/common/columnIdentifier" ;
31
- import { LABEL } from "@databiosphere/findable-ui/lib/apis/azul/common/entities" ;
32
- import { TEXT_BODY_SMALL_400 } from "@databiosphere/findable-ui/lib/theme/common/typography" ;
33
31
34
32
/**
35
33
* Build props for the accession cell.
@@ -89,6 +87,58 @@ export const buildAnnotationStatus = (
89
87
} ;
90
88
} ;
91
89
90
+ /**
91
+ * Build props for the assembly BackPageHero component.
92
+ * @param assembly - Assembly entity.
93
+ * @returns Props to be used for the BackPageHero component.
94
+ */
95
+ export const buildAssemblyBackPageHero = (
96
+ assembly : BRCDataCatalogGenome
97
+ ) : ComponentProps < typeof C . BackPageHero > => {
98
+ return {
99
+ breadcrumbs : getAssemblyBreadcrumbs ( assembly ) ,
100
+ title : "Select a Workflow" ,
101
+ } ;
102
+ } ;
103
+
104
+ /**
105
+ * Build props for the assembly details KeyValuePairs component.
106
+ * @param assembly - Assembly entity.
107
+ * @returns Props to be used for the KeyValuePairs component.
108
+ */
109
+ export const buildAssemblyDetails = (
110
+ assembly : BRCDataCatalogGenome
111
+ ) : ComponentProps < typeof C . KeyValuePairs > => {
112
+ const keyValuePairs = new Map < Key , Value > ( ) ;
113
+ keyValuePairs . set (
114
+ BRC_DATA_CATALOG_CATEGORY_LABEL . TAXONOMIC_LEVEL_SPECIES ,
115
+ C . Link ( {
116
+ label : assembly . taxonomicLevelSpecies ,
117
+ url : `${ ROUTES . ORGANISMS } /${ encodeURIComponent ( getGenomeOrganismId ( assembly ) ) } ` ,
118
+ } )
119
+ ) ;
120
+ const strain = getGenomeStrainText ( assembly ) ;
121
+ if ( strain ) {
122
+ keyValuePairs . set (
123
+ BRC_DATA_CATALOG_CATEGORY_LABEL . TAXONOMIC_LEVEL_STRAIN ,
124
+ strain
125
+ ) ;
126
+ }
127
+ keyValuePairs . set (
128
+ BRC_DATA_CATALOG_CATEGORY_LABEL . ACCESSION ,
129
+ C . CopyText ( {
130
+ children : assembly . accession ,
131
+ value : assembly . accession ,
132
+ } )
133
+ ) ;
134
+ return {
135
+ KeyElType : C . KeyElType ,
136
+ KeyValuesElType : ( props ) => C . Stack ( { ...props , gap : 4 } ) ,
137
+ ValueElType : C . ValueElType ,
138
+ keyValuePairs,
139
+ } ;
140
+ } ;
141
+
92
142
/**
93
143
* Build props for the assemblies cell.
94
144
* @param organism - Genome entity.
@@ -479,96 +529,6 @@ export const buildGenomeAnalysisPortals = (
479
529
} ;
480
530
} ;
481
531
482
- /**
483
- * Build props for the genome DetailViewHero component.
484
- * @param genome - Genome entity.
485
- * @returns Props to be used for the DetailViewHero component.
486
- */
487
- export const buildGenomeChooseAnalysisMethodDetailViewHero = (
488
- genome : BRCDataCatalogGenome
489
- ) : ComponentProps < typeof C . BackPageHero > => {
490
- return {
491
- breadcrumbs : getGenomeEntityChooseAnalysisMethodBreadcrumbs ( genome ) ,
492
- subTitle : C . Link ( {
493
- TypographyProps : { color : "ink.light" , variant : TEXT_BODY_SMALL_400 } ,
494
- label : `Species: ${ genome . taxonomicLevelSpecies } ` ,
495
- underline : "hover" ,
496
- url : `${ ROUTES . ORGANISMS } /${ encodeURIComponent ( getGenomeOrganismId ( genome ) ) } ` ,
497
- } ) ,
498
- title : `Analyze in Galaxy - ${ genome . accession } ` ,
499
- } ;
500
- } ;
501
-
502
- /**
503
- * Build props for the genome detail KeyValuePairs component.
504
- * @param genome - Genome entity.
505
- * @returns Props to be used for the KeyValuePairs component.
506
- */
507
- export const buildGenomeDetails = (
508
- genome : BRCDataCatalogGenome
509
- ) : ComponentProps < typeof C . KeyValuePairs > => {
510
- const keyValuePairs = new Map < Key , Value > ( ) ;
511
- keyValuePairs . set (
512
- BRC_DATA_CATALOG_CATEGORY_LABEL . TAXONOMIC_LEVEL_SPECIES ,
513
- C . Link ( {
514
- label : genome . taxonomicLevelSpecies ,
515
- url : `${ ROUTES . ORGANISMS } /${ encodeURIComponent ( getGenomeOrganismId ( genome ) ) } ` ,
516
- } )
517
- ) ;
518
- keyValuePairs . set (
519
- BRC_DATA_CATALOG_CATEGORY_LABEL . TAXONOMIC_LEVEL_STRAIN ,
520
- getGenomeStrainText ( genome , LABEL . UNSPECIFIED )
521
- ) ;
522
- keyValuePairs . set (
523
- BRC_DATA_CATALOG_CATEGORY_LABEL . TAXONOMY_ID ,
524
- genome . ncbiTaxonomyId
525
- ) ;
526
- keyValuePairs . set (
527
- BRC_DATA_CATALOG_CATEGORY_LABEL . ACCESSION ,
528
- C . CopyText ( {
529
- children : genome . accession ,
530
- value : genome . accession ,
531
- } )
532
- ) ;
533
- keyValuePairs . set (
534
- BRC_DATA_CATALOG_CATEGORY_LABEL . CHROMOSOMES ,
535
- genome . chromosomes ?? LABEL . UNSPECIFIED
536
- ) ;
537
- keyValuePairs . set ( BRC_DATA_CATALOG_CATEGORY_LABEL . IS_REF , genome . isRef ) ;
538
- keyValuePairs . set ( BRC_DATA_CATALOG_CATEGORY_LABEL . LEVEL , genome . level ) ;
539
- keyValuePairs . set ( BRC_DATA_CATALOG_CATEGORY_LABEL . LENGTH , genome . length ) ;
540
- keyValuePairs . set (
541
- BRC_DATA_CATALOG_CATEGORY_LABEL . SCAFFOLD_COUNT ,
542
- genome . scaffoldCount
543
- ) ;
544
- keyValuePairs . set (
545
- BRC_DATA_CATALOG_CATEGORY_LABEL . SCAFFOLD_N50 ,
546
- genome . scaffoldN50
547
- ) ;
548
- keyValuePairs . set (
549
- BRC_DATA_CATALOG_CATEGORY_LABEL . SCAFFOLD_L50 ,
550
- genome . scaffoldL50
551
- ) ;
552
- keyValuePairs . set (
553
- BRC_DATA_CATALOG_CATEGORY_LABEL . COVERAGE ,
554
- genome . coverage ?? LABEL . UNSPECIFIED
555
- ) ;
556
- keyValuePairs . set (
557
- BRC_DATA_CATALOG_CATEGORY_LABEL . GC_PERCENT ,
558
- genome . gcPercent
559
- ) ;
560
- keyValuePairs . set (
561
- BRC_DATA_CATALOG_CATEGORY_LABEL . ANNOTATION_STATUS ,
562
- genome . annotationStatus ?? LABEL . UNSPECIFIED
563
- ) ;
564
- return {
565
- KeyElType : C . KeyElType ,
566
- KeyValuesElType : ( props ) => C . Stack ( { ...props , gap : 4 } ) ,
567
- ValueElType : C . ValueElType ,
568
- keyValuePairs,
569
- } ;
570
- } ;
571
-
572
532
/**
573
533
* Build props for the organism BackPageHero component.
574
534
* @param organism - Organism entity.
@@ -706,17 +666,15 @@ export const buildWorkflowDetails = (
706
666
} ;
707
667
708
668
/**
709
- * Get the genome entity breadcrumbs.
710
- * @param genome - Genome entity.
669
+ * Get the assembly breadcrumbs.
670
+ * @param assembly - Assembly entity.
711
671
* @returns Breadcrumbs.
712
672
*/
713
- function getGenomeEntityChooseAnalysisMethodBreadcrumbs (
714
- genome : BRCDataCatalogGenome
715
- ) : Breadcrumb [ ] {
673
+ function getAssemblyBreadcrumbs ( assembly : BRCDataCatalogGenome ) : Breadcrumb [ ] {
716
674
return [
717
675
{ path : ROUTES . GENOMES , text : "Assemblies" } ,
718
- { path : "" , text : genome . accession } ,
719
- { path : "" , text : "Analyze " } ,
676
+ { path : "" , text : assembly . accession } ,
677
+ { path : "" , text : "Select a Workflow " } ,
720
678
] ;
721
679
}
722
680
0 commit comments