diff --git a/apps/platform/src/pages/CredibleSetPage/ProfileHeader.gql b/apps/platform/src/pages/CredibleSetPage/ProfileHeader.gql index c5af1b08f..9feb13bfc 100644 --- a/apps/platform/src/pages/CredibleSetPage/ProfileHeader.gql +++ b/apps/platform/src/pages/CredibleSetPage/ProfileHeader.gql @@ -15,6 +15,9 @@ fragment CredibleSetProfileHeaderFragment on credibleSet { standardError } } + locusSize: locus(page: { size: 1, index: 0 }) { + count + } variant { chromosome position diff --git a/apps/platform/src/pages/CredibleSetPage/ProfileHeader.tsx b/apps/platform/src/pages/CredibleSetPage/ProfileHeader.tsx index ec5f2e263..94292533c 100644 --- a/apps/platform/src/pages/CredibleSetPage/ProfileHeader.tsx +++ b/apps/platform/src/pages/CredibleSetPage/ProfileHeader.tsx @@ -25,14 +25,15 @@ function ProfileHeader() { if (error) return null; const credibleSet = data?.credibleSet; + const leadVariant = credibleSet?.locus?.rows?.[0] || {}; + const beta = leadVariant.beta ?? credibleSet?.beta; + const standardError = leadVariant.standardError ?? credibleSet?.standardError; const study = credibleSet?.study; const target = study?.target; - const leadVariant = credibleSet?.locus.rows[0]; - const beta = leadVariant?.beta ?? credibleSet?.beta; - const standardError = leadVariant?.standardError ?? credibleSet?.standardError; + const { pValueMantissa, pValueExponent } = typeof leadVariant?.pValueMantissa === "number" && - typeof leadVariant?.pValueExponent === "number" + typeof leadVariant?.pValueExponent === "number" ? leadVariant : credibleSet ?? {}; @@ -169,24 +170,26 @@ function ProfileHeader() { > {credibleSet?.purityMinR2?.toPrecision(3)} - {credibleSet?.qualityControls?.length > 0 && + {credibleSet?.qualityControls?.length > 0 && ( -