diff --git a/graphql-api/src/graphql/resolvers/aliases.ts b/graphql-api/src/graphql/resolvers/aliases.ts index b85025f4d..554761e7e 100644 --- a/graphql-api/src/graphql/resolvers/aliases.ts +++ b/graphql-api/src/graphql/resolvers/aliases.ts @@ -54,12 +54,15 @@ const resolvers = { ac_hom: fieldAliasResolver('homozygote_count'), ac_hemi: fieldAliasResolver('hemizygote_count'), af: (obj: any) => (obj.an === 0 ? 0 : obj.ac / obj.an), + ancestry_groups: fieldAliasResolver('populations'), }, VariantDetailsSequencingTypeData: { qualityMetrics: fieldAliasResolver('quality_metrics'), ac_hom: fieldAliasResolver('homozygote_count'), ac_hemi: fieldAliasResolver('hemizygote_count'), af: (obj: any) => (obj.an === 0 ? 0 : obj.ac / obj.an), + ancestry_groups: fieldAliasResolver('populations'), + local_ancestry_groups: fieldAliasResolver('local_ancestry_populations'), }, VariantPopulation: { ac_hom: fieldAliasResolver('homozygote_count'), @@ -84,6 +87,7 @@ const resolvers = { consequence: fieldAliasResolver('major_consequence'), ac_hom: fieldAliasResolver('homozygote_count'), ac_hemi: fieldAliasResolver('hemizygote_count'), + ancestry_groups: fieldAliasResolver('populations'), }, StructuralVariantPopulation: { ac_hom: fieldAliasResolver('homozygote_count'), @@ -106,6 +110,29 @@ const resolvers = { MitochondrialVariantDetails: { // Single rsID rsid: (obj: any) => (obj.rsids || [])[0], + ancestry_groups: fieldAliasResolver('populations'), + }, + CopyNumberVariantDetails: { + ancestry_groups: fieldAliasResolver('populations'), + }, + ShortTandemRepeatAlleleSizeDistribution: { + ancestry_groups: fieldAliasResolver('populations'), + }, + ShortTandemRepeatAlleleSizeDistributionRepeatUnit: { + ancestry_groups: fieldAliasResolver('populations'), + }, + ShortTandemRepeatGenotypeDistribution: { + ancestry_groups: fieldAliasResolver('populations'), + }, + ShortTandemRepeatGenotypeDistributionRepeatUnit: { + ancestry_groups: fieldAliasResolver('populations'), + }, + VariantCooccurrence: { + ancestry_groups: fieldAliasResolver('populations'), + }, + VariantFilteringAlleleFrequency: { + grpmax: fieldAliasResolver('popmax'), + grpmax_ancestry_group: fieldAliasResolver('popmax_population'), }, } diff --git a/graphql-api/src/graphql/types/copy-number-variant.graphql b/graphql-api/src/graphql/types/copy-number-variant.graphql index f9fe1af07..e8efc198d 100644 --- a/graphql-api/src/graphql/types/copy-number-variant.graphql +++ b/graphql-api/src/graphql/types/copy-number-variant.graphql @@ -1,51 +1,59 @@ +type CopyNumberVariantAncestryGroup { + id: String! + sc: Float! + sn: Float! + sf: Float! +} + type CopyNumberVariantPopulation { - id: String! - sc: Float! - sn: Float! - sf: Float! + id: String! @deprecated(reason: "Use CopyNumberVariantAncestryGroup.id") + sc: Float! @deprecated(reason: "Use CopyNumberVariantAncestryGroup.sc") + sn: Float! @deprecated(reason: "Use CopyNumberVariantAncestryGroup.sn") + sf: Float! @deprecated(reason: "Use CopyNumberVariantAncestryGroup.sf") } type CopyNumberVariant { - sc: Float! - sn: Float! - sf: Float! - reference_genome: ReferenceGenomeId! - chrom: String! - end: Int! - filters: [String!] - length: Int - pos: Int! - type: String - posmin: Int - posmax: Int - endmin: Int - endmax: Int - variant_id: String! + sc: Float! + sn: Float! + sf: Float! + reference_genome: ReferenceGenomeId! + chrom: String! + end: Int! + filters: [String!] + length: Int + pos: Int! + type: String + posmin: Int + posmax: Int + endmin: Int + endmax: Int + variant_id: String! } type CopyNumberVariantDetails { - alts: [String!] - sc: Float! - sn: Float! - sf: Float! - chrom: String! - end: Int! - filters: [String!] - genes: [String!] - length: Int - populations: [CopyNumberVariantPopulation!] - pos: Int! - qual: Float - reference_genome: ReferenceGenomeId! - type: String - posmin: Int - posmax: Int - endmin: Int - endmax: Int - variant_id: String! + alts: [String!] + sc: Float! + sn: Float! + sf: Float! + chrom: String! + end: Int! + filters: [String!] + genes: [String!] + length: Int + ancestry_groups: [CopyNumberVariantAncestryGroup!] + populations: [CopyNumberVariantPopulation!] @deprecated(reason: "Use ancestry_groups") + pos: Int! + qual: Float + reference_genome: ReferenceGenomeId! + type: String + posmin: Int + posmax: Int + endmin: Int + endmax: Int + variant_id: String! } type CNVTrackCallableCoverageBin { xpos: Float! percent_callable: Float -} \ No newline at end of file +} diff --git a/graphql-api/src/graphql/types/mitochondria.graphql b/graphql-api/src/graphql/types/mitochondria.graphql index 78f38d8ed..024e94fd5 100644 --- a/graphql-api/src/graphql/types/mitochondria.graphql +++ b/graphql-api/src/graphql/types/mitochondria.graphql @@ -26,7 +26,7 @@ type MitochondrialVariantAgeDistribution { hom: Histogram } -type MitochondrialVariantPopulation { +type MitochondrialVariantAncestryGroup { id: String! an: Int! ac_het: Int! @@ -34,6 +34,15 @@ type MitochondrialVariantPopulation { heteroplasmy_distribution: Histogram! } +type MitochondrialVariantPopulation { + id: String! @deprecated(reason: "Use MitochondrialVariantAncestryGroup.id") + an: Int! @deprecated(reason: "Use MitochondrialVariantAncestryGroup.an") + ac_het: Int! @deprecated(reason: "Use MitochondrialVariantAncestryGroup.ac_het") + ac_hom: Int! @deprecated(reason: "Use MitochondrialVariantAncestryGroup.ac_hom") + heteroplasmy_distribution: Histogram! + @deprecated(reason: "Use MitochondrialVariantAncestryGroup.heteroplasmy_distribution") +} + type MitochondrialVariantHaplogroup { id: String an: Float @@ -79,7 +88,8 @@ type MitochondrialVariantDetails { mitotip_trna_prediction: String pon_ml_probability_of_pathogenicity: Float pon_mt_trna_prediction: String - populations: [MitochondrialVariantPopulation!]! + ancestry_groups: [MitochondrialVariantAncestryGroup!]! + populations: [MitochondrialVariantPopulation!]! @deprecated(reason: "Use ancestry_groups") pos: Int! ref: String! reference_genome: ReferenceGenomeId! diff --git a/graphql-api/src/graphql/types/short-tandem-repeat.graphql b/graphql-api/src/graphql/types/short-tandem-repeat.graphql index 52dd64ae0..95b80363e 100644 --- a/graphql-api/src/graphql/types/short-tandem-repeat.graphql +++ b/graphql-api/src/graphql/types/short-tandem-repeat.graphql @@ -31,37 +31,57 @@ type ShortTandemRepeatRepeatUnit { classification: String! } -type ShortTandemRepeatAlleleSizeDistributionPopulation { +type ShortTandemRepeatAlleleSizeDistributionAncestryGroup { id: String! distribution: [[Int!]!]! } +type ShortTandemRepeatAlleleSizeDistributionPopulation { + id: String! @deprecated(reason: "Use ShortTandemRepeatAlleleSizeDistributionAncestryGroup.id") + distribution: [[Int!]!]! + @deprecated(reason: "Use ShortTandemRepeatAlleleSizeDistributionAncestryGroup.distribution") +} + type ShortTandemRepeatAlleleSizeDistributionRepeatUnit { repeat_unit: String! distribution: [[Int!]!]! + ancestry_groups: [ShortTandemRepeatAlleleSizeDistributionAncestryGroup!]! populations: [ShortTandemRepeatAlleleSizeDistributionPopulation!]! + @deprecated(reason: "Use ancestry_groups") } type ShortTandemRepeatAlleleSizeDistribution { distribution: [[Int!]!]! + ancestry_groups: [ShortTandemRepeatAlleleSizeDistributionAncestryGroup!]! populations: [ShortTandemRepeatAlleleSizeDistributionPopulation!]! + @deprecated(reason: "Use ancestry_groups") repeat_units: [ShortTandemRepeatAlleleSizeDistributionRepeatUnit!]! } -type ShortTandemRepeatGenotypeDistributionPopulation { +type ShortTandemRepeatGenotypeDistributionAncestryGroup { id: String! distribution: [[Int!]!]! } +type ShortTandemRepeatGenotypeDistributionPopulation { + id: String! @deprecated(reason: "Use ShortTandemRepeatGenotypeDistributionAncestryGroup.id") + distribution: [[Int!]!]! + @deprecated(reason: "Use ShortTandemRepeatGenotypeDistributionAncestryGroup.distribution") +} + type ShortTandemRepeatGenotypeDistributionRepeatUnit { repeat_units: [String!]! distribution: [[Int!]!]! + ancestry_groups: [ShortTandemRepeatGenotypeDistributionAncestryGroup!]! populations: [ShortTandemRepeatGenotypeDistributionPopulation!]! + @deprecated(reason: "Use ancestry_groups") } type ShortTandemRepeatGenotypeDistribution { distribution: [[Int!]!]! + ancestry_groups: [ShortTandemRepeatGenotypeDistributionAncestryGroup!]! populations: [ShortTandemRepeatGenotypeDistributionPopulation!]! + @deprecated(reason: "Use ancestry_groups") repeat_units: [ShortTandemRepeatGenotypeDistributionRepeatUnit!]! } diff --git a/graphql-api/src/graphql/types/structural-variant.graphql b/graphql-api/src/graphql/types/structural-variant.graphql index 2061969cb..5de3a4210 100644 --- a/graphql-api/src/graphql/types/structural-variant.graphql +++ b/graphql-api/src/graphql/types/structural-variant.graphql @@ -1,13 +1,21 @@ -type StructuralVariantPopulation { +type StructuralVariantAncestryGroup { id: String! ac: Int! an: Int! homozygote_count: Int hemizygote_count: Int + ac_hemi: Int @deprecated(reason: "Use hemizygote_count") + ac_hom: Int @deprecated(reason: "Use homozygote_count") +} - # Deprecated - replaced by homozygote/hemizygote count - ac_hemi: Int - ac_hom: Int +type StructuralVariantPopulation { + id: String! @deprecated(reason: "Use StructuralVariantAncestryGroup.id") + ac: Int! @deprecated(reason: "Use StructuralVariantAncestryGroup.ac") + an: Int! @deprecated(reason: "Use StructuralVariantAncestryGroup.an") + homozygote_count: Int @deprecated(reason: "Use StructuralVariantAncestryGroup.homozygote_count") + hemizygote_count: Int @deprecated(reason: "Use StructuralVariantAncestryGroup.hemizygote_count") + ac_hemi: Int @deprecated(reason: "Use StructuralVariantAncestryGroup.hemizygote_count") + ac_hom: Int @deprecated(reason: "Use StructuralVariantAncestryGroup.homozygote_count") } type StructuralVariantAgeDistribution { @@ -87,7 +95,8 @@ type StructuralVariantDetails { genes: [String!] genotype_quality: StructuralVariantGenotypeQuality length: Int - populations: [StructuralVariantPopulation!] + ancestry_groups: [StructuralVariantAncestryGroup!] + populations: [StructuralVariantPopulation!] @deprecated(reason: "Use ancestry_groups") pos: Int! pos2: Int qual: Float diff --git a/graphql-api/src/graphql/types/variant-cooccurrence.graphql b/graphql-api/src/graphql/types/variant-cooccurrence.graphql index a7c21ce94..e2b83730c 100644 --- a/graphql-api/src/graphql/types/variant-cooccurrence.graphql +++ b/graphql-api/src/graphql/types/variant-cooccurrence.graphql @@ -1,14 +1,25 @@ -type VariantCooccurrenceInPopulation { +type VariantCooccurrenceInAncestryGroup { id: String! genotype_counts: [Int!]! haplotype_counts: [Float!]! p_compound_heterozygous: Float } +type VariantCooccurrenceInPopulation { + id: String! @deprecated(reason: "Use VariantCooccurrenceInAncestryGroup.id") + genotype_counts: [Int!]! + @deprecated(reason: "Use VariantCooccurrenceInAncestryGroup.genotype_counts") + haplotype_counts: [Float!]! + @deprecated(reason: "Use VariantCooccurrenceInAncestryGroup.haplotype_counts") + p_compound_heterozygous: Float + @deprecated(reason: "Use VariantCooccurrenceInAncestryGroup.p_compound_heterozygous") +} + type VariantCooccurrence { variant_ids: [String!]! genotype_counts: [Int!]! haplotype_counts: [Float!]! p_compound_heterozygous: Float - populations: [VariantCooccurrenceInPopulation!]! + ancestry_groups: [VariantCooccurrenceInAncestryGroup!]! + populations: [VariantCooccurrenceInPopulation!]! @deprecated(reason: "Use ancestry_groups") } diff --git a/graphql-api/src/graphql/types/variant.graphql b/graphql-api/src/graphql/types/variant.graphql index 8639db322..6a87fe217 100644 --- a/graphql-api/src/graphql/types/variant.graphql +++ b/graphql-api/src/graphql/types/variant.graphql @@ -1,21 +1,55 @@ -type VariantPopulation { +type VariantAncestryGroup { id: String! ac: Int! an: Int! homozygote_count: Int! hemizygote_count: Int + ac_hom: Int! @deprecated(reason: "Use homozygote_count") + ac_hemi: Int @deprecated(reason: "Use hemizygote_count") +} - # Deprecated - replaced by homozygote/hemizygote count - ac_hom: Int! - ac_hemi: Int +type VariantLocalAncestryGroup { + id: String! + ac: Int! + an: Int! } type VariantLocalAncestryPopulation { + id: String! @deprecated(reason: "Use VariantLocalAncestryGroup.id") + ac: Int! @deprecated(reason: "Use VariantLocalAncestryGroup.ac") + an: Int! @deprecated(reason: "Use VariantLocalAncestryGroup.an") +} + +type VariantAlleleBalance { + alt: Histogram +} + +type VariantGenotypeDepth { + all: Histogram +} + +type VariantPopulation { + id: String! @deprecated(reason: "Use VariantAncestryGroup.id") + ac: Int! @deprecated(reason: "Use VariantAncestryGroup.ac") + an: Int! @deprecated(reason: "Use VariantAncestryGroup.an") + homozygote_count: Int! @deprecated(reason: "Use VariantAncestryGroup.homozygote_count") + hemizygote_count: Int @deprecated(reason: "Use VariantAncestryGroup.heterozygote_count") + ac_hom: Int! @deprecated(reason: "Use VariantAncestryGroup.homozygote_count") + ac_hemi: Int @deprecated(reason: "Use VariantAncestryGroup.hemizygote_count") +} + +type VariantLocalAncestryGroup { id: String! ac: Int! an: Int! } +type VariantLocalAncestryPopulation { + id: String! @deprecated(reason: "Use VariantLocalAncestryGroup.id") + ac: Int! @deprecated(reason: "Use VariantLocalAncestryGroup.ac") + an: Int! @deprecated(reason: "Use VariantLocalAncestryGroup.an") +} + type VariantAlleleBalance { alt: Histogram } @@ -49,8 +83,10 @@ type VariantQualityMetrics { } type VariantFilteringAlleleFrequency { - popmax: Float - popmax_population: String + grpmax: Float + popmax: Float @deprecated(reason: "Use grpmax") + grpmax_ancestry_group: String + popmax_population: String @deprecated(reason: "Use grpmax_ancestry_group") } type VariantAgeDistribution { @@ -105,7 +141,8 @@ type VariantSequencingTypeData { homozygote_count: Int hemizygote_count: Int filters: [String!] - populations: [VariantPopulation] + ancestry_groups: [VariantAncestryGroup] + populations: [VariantPopulation] @deprecated(reason: "Use ancestry_groups") faf95: VariantFilteringAlleleFrequency # Deprecated - calculate from AC and AN @@ -199,8 +236,11 @@ type VariantDetailsSequencingTypeData { faf95: VariantFilteringAlleleFrequency faf99: VariantFilteringAlleleFrequency filters: [String!] - populations: [VariantPopulation] - local_ancestry_populations: [VariantLocalAncestryPopulation]! + ancestry_groups: [VariantAncestryGroup] + local_ancestry_groups: [VariantLocalAncestryGroup] + populations: [VariantPopulation] @deprecated(reason: "Use ancestry_groups") + local_ancestry_populations: [VariantLocalAncestryPopulation] + @deprecated(reason: "Use local_ancestry_groups") age_distribution: VariantAgeDistribution quality_metrics: VariantQualityMetrics