diff --git a/screen2.0/src/app/search/_ccredetails/entexdata.tsx b/screen2.0/src/app/search/_ccredetails/entexdata.tsx index 16fdbfb6..56aa81be 100644 --- a/screen2.0/src/app/search/_ccredetails/entexdata.tsx +++ b/screen2.0/src/app/search/_ccredetails/entexdata.tsx @@ -33,120 +33,114 @@ query entexActiveAnnotationsQuery( $coordinates: GenomicRangeInput! ) { }`) -export const ENTExData = (props: { accession, coordinates }) =>{ +export const ENTExData = (props: { accession, coordinates }) => { const { data, loading } = useQuery(ENTEx_QUERY, { variables: { accession: props.accession }, fetchPolicy: "cache-and-network", nextFetchPolicy: "cache-first", client, - }) + }) const { data: entexActiveAnno, loading: entexActiveAnnoLoading } = useQuery(ENTEx_Active_Annotations_QUERY, { variables: { coordinates: props.coordinates }, fetchPolicy: "cache-and-network", nextFetchPolicy: "cache-first", client, - }) + }) return ( {loading && } - {data && !loading && data.entexQuery.length>0 && + {data && !loading && - Tissue, - value: (row) => row.tissue.split("_").map(s=>s[0].toUpperCase()+s.slice(1)).join(" "), - }, - { - header: "Assay", - HeaderRender: () => Assay, - value: (row) => row.assay.replaceAll("_"," "), - }, - { - header: "Donor", - HeaderRender: () => Donor, - value: (row) => row.donor, - }, - { - header: "Hap 1 Count", - HeaderRender: () => Hap 1 Count, - value: (row) => row.hap1_count - }, - { - header: "Hap 2 Count", - HeaderRender: () => Hap 2 Count, - value: (row) => row.hap2_count - }, - { - header: "Hap 1 Allele Ratio", - HeaderRender: () => Hap 1 Allele Ratio, - value: (row) => row.hap1_allele_ratio.toFixed(2), - }, - { - header: "Experiment Accession", - HeaderRender: () => Experiment Accession, - value: (row) => row.experiment_accession, - render: (row) => - }, - { - header: "p beta binom", - HeaderRender: () => p Beta Binom, - value: (row) => row.p_betabinom.toFixed(2), - }, - { - header: "Imbalance Significance", - HeaderRender: () => Imbalance Significance, - value: (row) => row.imbalance_significance, - } - ]} - rows={data.entexQuery || []} - sortColumn={5} - searchable - sortDescending - itemsPerPage={10} - /> - } - { !loading && data && data.entexQuery.length==0 && No data available } - {entexActiveAnno && !entexActiveAnnoLoading && entexActiveAnno.entexActiveAnnotationsQuery.length>0 && - - Tissue, - value: (row) => row.tissue.split("_").map(s=>s[0].toUpperCase()+s.slice(1)).join(" "), - }, - { - header: "Supporting Assays", - HeaderRender: () => Supporting Assays, - value: (row) => row.assay_score.split("|").map(s=>s.split(":")[0]).join(", ") - } - ]} - rows={entexActiveAnno.entexActiveAnnotationsQuery || []} - sortColumn={0} - searchable - sortDescending - itemsPerPage={[10, 25, 100]} - /> - - + Tissue, + value: (row) => row.tissue.split("_").map(s => s[0].toUpperCase() + s.slice(1)).join(" "), + }, + { + header: "Assay", + HeaderRender: () => Assay, + value: (row) => row.assay.replaceAll("_", " "), + }, + { + header: "Donor", + HeaderRender: () => Donor, + value: (row) => row.donor, + }, + { + header: "Hap 1 Count", + HeaderRender: () => Hap 1 Count, + value: (row) => row.hap1_count + }, + { + header: "Hap 2 Count", + HeaderRender: () => Hap 2 Count, + value: (row) => row.hap2_count + }, + { + header: "Hap 1 Allele Ratio", + HeaderRender: () => Hap 1 Allele Ratio, + value: (row) => row.hap1_allele_ratio.toFixed(2), + }, + { + header: "Experiment Accession", + HeaderRender: () => Experiment Accession, + value: (row) => row.experiment_accession, + render: (row) => + }, + { + header: "p beta binom", + HeaderRender: () => p Beta Binom, + value: (row) => row.p_betabinom.toFixed(2), + }, + { + header: "Imbalance Significance", + HeaderRender: () => Imbalance Significance, + value: (row) => row.imbalance_significance, + } + ]} + rows={data?.entexQuery || []} + sortColumn={5} + searchable + sortDescending + itemsPerPage={10} + /> + } + {entexActiveAnno && !entexActiveAnnoLoading && entexActiveAnno.entexActiveAnnotationsQuery.length > 0 && + + Tissue, + value: (row) => row.tissue.split("_").map(s => s[0].toUpperCase() + s.slice(1)).join(" "), + }, + { + header: "Supporting Assays", + HeaderRender: () => Supporting Assays, + value: (row) => row.assay_score.split("|").map(s => s.split(":")[0]).join(", ") + } + ]} + rows={entexActiveAnno.entexActiveAnnotationsQuery || []} + sortColumn={0} + searchable + sortDescending + itemsPerPage={[10, 25, 100]} + /> + } );