Skip to content

Commit

Permalink
returned old meta node RegulatoryElementSetInfo to legacy folder
Browse files Browse the repository at this point in the history
  • Loading branch information
MmPersida committed Sep 20, 2024
1 parent 6d66b4d commit c951805
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion components/legacy/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { MetaNode } from '@/spec/metanode'
import { GeneTerm, VariantTerm } from '@/components/core/term'
import { z } from 'zod'
import { gene_icon, mygeneinfo_icon } from '@/icons'
import { gene_icon, mygeneinfo_icon, datafile_icon } from '@/icons'
import * as array from '@/utils/array'
import { z_maybe_array } from '@/utils/zod'
import { resolveVariantCaID, getMyVarintInfoLink, variantIdResolveErrorMessage, alleleRegRespErrorMessage } from '@/components/service/variantinfo/variantUtils'
import { getAlleleRegistryVariantInfo } from '@/components/service/variantinfo/variantInfoSources/alleleRegistryVariantInfo'
import { getVariantInfoFromMyVariantInfo } from '@/components/service/variantinfo/variantInfoSources/myVariantInfo'
import { MyRegulatoryElementSetInfoC } from '@/components/service/regulatoryElementInfo/reUtils'
import { Table, Cell, Column} from '@/app/components/Table'
import { downloadBlob } from '@/utils/download'

export const MyVariantInfoC = z.object({
_id: z.string(),
Expand Down Expand Up @@ -119,3 +122,46 @@ export const VariantInfoFromVariantTermMyVarintInfo = MetaNode('VariantInfoFromV
legend: `The closest gene to ${props.inputs?.variant ? props.inputs.variant : 'the variant'}, as reported by MyVariant.info [\\ref{doi:10.1186/s13059-016-0953-9}\\ref{doi:10.1093/bioinformatics/btac017}.`,
}))
.build()

export const RegulatoryElementSetInfo = MetaNode('RegulatoryElementSetInfo')
.meta({
label: 'Regulatory Element Set Info',
description: '',
icon: [datafile_icon],
hidden: true,
})
.codec(MyRegulatoryElementSetInfoC)
.view(regulatoryElementSet => {
return(
<>
<p style={{fontSize: '14px'}}><b>Note:</b> In order to view all data, if avaliable, please expand the table rows!</p>
<Table
height={500}
cellRendererDependencies={[regulatoryElementSet]}
numRows={regulatoryElementSet.length}
enableGhostCells
enableFocusedCell
downloads={{
JSON: () => downloadBlob(new Blob([JSON.stringify(regulatoryElementSet)], { type: 'application/json;charset=utf-8' }), 'data.json')
}}>
<Column
name="Entity id"
cellRenderer={row => <Cell key={row+''}>{regulatoryElementSet[row].entId}</Cell>}
/>
<Column
name="Chromosome"
cellRenderer={row => <Cell key={row+''}>{regulatoryElementSet[row].entContent.coordinates.chromosome}</Cell>}
/>
<Column
name="Start Pos."
cellRenderer={row => <Cell key={row+''}>{regulatoryElementSet[row].entContent.coordinates.start}</Cell>}
/>
<Column
name="End Pos."
cellRenderer={row => <Cell key={row+''}>{regulatoryElementSet[row].entContent.coordinates.end}</Cell>}
/>
</Table>
</>
)
})
.build()

0 comments on commit c951805

Please sign in to comment.